Learn the powerful enterprise adaptable database:

Getting Started With ADABAS & Natural

Wednesday, March 20, 2013

Dreamweaver CS5.5 Mac OSX Setup For Local Site and Mobile Applications




1) During the first time running of Dreamweaver CS 5.5, the program may ask you the site location. If you have already installed a server such as XAMPP (if you haven't, you may follow this steps), go to menu Sites/New Site...




2) Set the Site Name and Local Path. Click Save.

3) Dreamweaver CS 5.5 supports mobile application development. Go to menu Site/Mobile Applications/Configure Application Framework...

4) Go to menu Site/Mobile Applications/Confire Application Framework. Set as follows.

/Applications/Xcode.app/Contents/Developer





5) Goto menu Site/Mobile Applications/Native Application Settings.


XAMPP Mac OS X 1.7.3: Installation





1) Download XAMPP Mac OS X 1.7.3 from http://www.apachefriends.org/en/xampp-macosx.html#849.

2) Double-click the dmg file.

3) An Installation Confirmation Dialog Window appears. Drag XAMPP icon to the Application icon.


4) Go to Application folder. Double-Click XAMPP Control icon.

5) Click the buttons to start the server,


6) By default, a getting start page will be displayed.




Saturday, March 16, 2013

VMWare Fusion: Share Guest Win XP Shared Documents with Host Mac OSX Mountain Lion


1) Go to VMWare Virtual Machine Library. Click Settings.

2) Go to System Settings section. Click Sharing. Tick Windows folder that you wish to share with Host Mac OSX.

3) Run Guest Win XP.

4) Go to My Computer. On the left panel, click My Network Places.

5) In My Network Places Window, on the left panel, click Set up a home or small office network.

Liferay 6.1: Setting Up Portal Service

1) Download Liferay 6.1 Bundle from http://sourceforge.net/projects/lportal/files/Liferay%20Portal/6.1.0%20GA1/liferay-portal-tomcat-6.1.0-ce-ga1-20120106155615760.zip/download 

2) Unzip it. (at the time of this writing, the bundle name is “liferay-portal-6.1.0-ce-ga1”)

3) Delete all folders under <Liferay-Home>/tomcat7.x.x/webapps/, except for the folder ROOT.

4) Navigate to <Liferay-Home>/tomcat7.x.x/bin/ to run the Tomcat Server.

4.1) Double-click on startup.bat(on a windows machine), or

4.2) Run the following command “sh startup.sh” (on a *nix based machine).

5) If Windows Firewall warning pops out, click “Allow Access”.


6)  You shall see the following output in console window; the whole output may take sometime to come out completely.


7) Open a browser of your choice, and enter the url “http:localhost:8080”. It may take up to few minutes before the main page appear as below. 

7.1) Take note that this Liferay system is currently running using Hypersonic (Default Database) and is not recommended for production use. Click “Finish Configuration”.

8) You get the message “Your configuration was saved successfully”. Click “Go to My Portal”.

9) You get the “Welcome” page.


10) If you click (Sign Out), you shall get the following window.



11) To Shut Down the server, Navigate to <Liferay-Home>/tomcat7.x.x/bin/ and Double-click on startup.bat




12) Once the server has shut down, the localhost is not available anymore.

Eclipse Liferay IDE 1.5.2: Setting Up Eclipse IDE For Liferay Development


This tutorial guides the reader to setup Eclipse for Liferay Development based on Liferay 6.1.1 CE GA1.

PRE-REQUISITES:
1) eclipse_Liferay_IDE_1.5.2_v201203040240-win32.zip
2) liferay-ide-eclipse-updatesite-1.5.2.zip (note: you will not use this throughout the tutorial but rather keep it as backup in case your eclipse is missing liferay update files)
3) liferay-plugins-sdk-6.1.0-ce-ga1-20120106155615760.zip
4) liferay-portal-tomcat-6.1.0-ce-ga1-20120106155615760.zip
-the above files can be downloaded from http://sourceforge.net/projects/lportal/files/
5) usbwlportal.zip (usbwebserver pre-configured with lportal database)
-the above file can be downloaded from http://sites.google.com/site/notaliferay/home/developer/usbwlportal.zip




STEPS:
1) Extract the zip file “liferay-portal-6.1.0-ce-ga1” to c:\. If you already have the same folder name, add a number to the end. e.g liferay-portal-6.1.0-ce-ga1-1. We will call this folder LIFERAY_HOME.




2) Extract the folder “eclipse” from the zip file “eclipse_Liferay_IDE_1.5.2_v201203040240-win32”  to LIFERAY_HOME. e.g. LIFERAY_HOME\eclipse .




3) Extract the SDK zip file “liferay-plugins-sdk-6.1.0-ce-ga1-20120106155615760” to LIFERAY_HOME. e.g. LIFERAY_HOME\liferay-plugins-sdk-6.1.0-ce-ga1-20120106155615760 .




4) Extract the usbwlportal.zip file to LIFERAY_HOME e.g. LIFERAY_HOME\usbwlportal


5) The final folder setup will be as follows:



6) Configure Eclipse.
6.1) Run Eclipse.


6.2) Set Workspace. Optionally, you may set relative path or empty ("").


6.3) Go to menu Help\About. Check that Liferay icon is present.


6.4) Go to menu Window\Preferences. We will follow the shortcut steps.


6.5) Configure installed Liferay Plugin SDKs.


6.6) Create new Liferay Runtime Environment
Select Tomcat 7.
Tick Create a new local server.


6.6.1) Set Tomcat and JRE directory. JRE is provided by default. Click Finish.


6.7) Check in Server\Runtime Environments to ensure Liferay Server has been added into the list. Click Ok.


7) The main window now displays Server Project.
At the bottom of the window, notice the Server Tab.
Start the server.
Unblock Firewall if any.
(note: To make the server load faster, you can delete all folders within webapp folder except ROOT folder.)


8) The console window will display output message. Wait until the messaging is done.


9) Right-click the Server. Select Open Liferay Portal Home.




10) Liferay Portal is displayed via Internal Web Browser.
This indicates that everything is alright up to this point.



11) Notice that in Database Section above, the Default Database is Hypersonic.
Hypersonic is a type of flat file database used for portal demonstration purpose.
If you want to run Liferay Portal for development or production purpose, you need to change to other types of database such as MySQL.


CHANGING DEFAULT DATABASE TO MYSQL

12) Before configuring Liferay Portal for MySQL connection, you need to setup lportal database at the MySQL server.

12a) Use the following commands to setup the database:

mysql -u root -p
create database YourDatabaseName character set utf8;
create user 'lportal'@'localhost' identified by 'YourDatabasePassword';
grant all privileges on YourDatabaseName.* to 'YourDatabasePassword';
flush privileges;


12b) Or download the pre-configured usbwebserver bundle, http://sites.google.com/site/notaliferay/home/developer/usbwlportal.zip?attredirects=0&d=1 , using username/password as liferay@localhost/password.

13) Click Change.



14) Enter the connection details and click finish.


15) Click Go to My Portal to start using the portal.



Friday, March 15, 2013

AppEngine: Google App Engine SDK for Python


1) Go to https://developers.google.com/appengine/downloads?hl=ca#Google_App_Engine_SDK_for_Python to download  Google App Engine SDK for Python.


2) Download and install. The installer will remind you to install Python 2.5.


3) Once installation is done, you will be prompted to launch the application.



4) Ready to deploy application to Google AppEngine (GAE)  server.


Follow this tutorial to deploy your first python application: http://basic-steps.blogspot.com/2013/03/appengine-deploying-python-to-appengine.html

Saturday, March 9, 2013

XCode 4.3 and iOS: Understanding Hello World App

copied from: http://www.appcoda.com/ios-programming-basic-how-does-the-hello-world-app-work/
-----
iOS Programming Basic: How Does the Hello World App Work?
   
 Share
I hope you enjoy the first iOS programming tutorial and already created your first app. Before we move onto the next tutorial and build a more complex app, let’s step back and have a closer look at the Hello World app. It’ll be good for you to understand some of the Objective-C syntax and the inner workings of the app.
So far you follow the step-by-step guide to build the Hello World app. But as you go through the tutorial, you may come across these questions:
  • What are those .xib, .h and .m file?
  • What are those “ugly” code inside “showMessage”? What do they mean?!
  • What actually happens after you taps the “Hello World” button? How does the button trigger the “showMessage” action?
  • How does the “Run” button in Xcode work?
I want you to focus on exploring the Xcode environment so I didn’t explain any of the above in the previous post. Yet it’s essential for every developer to understand the inner details behind the code and grasp the basic concept of iOS programming. For some technical concepts, they may be a bit hard to understand particularly you have no programming background. Don’t worry, however. This is just a start. As you move on and write more code in later tutorials, you’ll get better understanding about iOS programming. Just try your best to learn as much as possible.

Interface Builder, Header and Implementation Files

First, what are those .xib, .h and .m files? This is a very good question raised by one of the readers. Under the Project Navigator, you should find three main types of files – .xib, .h and .m. (If you expand the “Supporting Files” folder, you’ll find other file types such as plist and framework. But for now, let’s forget about them first. We’ll talk about them later.)
.xib – For files with .xib extension, they’re Interface Builder files that store the application’s user interface (UI). As you click on the .xib file, Xcode automatically switches to the Interface Builder for you to edit the UI of the app via drag-and-drop.
Hello World Interface Builder
Interface Builder in Xcode
.h and .m – Files with .h extension refers to the header files while those with .m extension are the implementation files. Like most of the programming languages, the source code of Objective-C is divided into two parts: interface and implementation.
Well, to put in analogy that you can better understand both terms, let’s consider a TV remote. It’s convenient to control the volume of a TV set wirelessly with a remote. To increase the speaker volume, you press the “Volume +” button. To switch channel, you simply key in the channel number. Let me ask you. Do you know what happens behind the scene when pressing the “Volume” button? Probably not. I believe most of us don’t know how the remote communicates with the TV set and controls the speaker volume. What we just know is, that button is used for changing the volume. In this example, the button that interacts with you is the “interface” and the inner detail which is hidden behind the button is referred as the “implementation”.
Now you should have a better idea about interface and implementation. Let’s go back to the code. In Objective-C, interfaces of a class are organized in “.h” file. We use the syntax “@interface” to declare the interface of a class. Take a look at the HelloWorldViewController.h, which is the header file:
1
2
3
4
5
@interface HelloWorldViewController : UIViewController

-(IBAction)showMessage;

@end
It starts with “@interface” followed by HelloWorldViewController, which is the class name. Inside, it declares a “showMessage” action, which is known as a method call.
Like the “Volume” button, apparently we do not know how the “showMessage” action works. You just know it’s used to display a message on screen. The actual implementation is put in the HelloWorldViewController.m, the implementation file:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
@implementation HelloWorldViewController

// I've removed other methods for better reading. Focus on the showMessage method first.

- (IBAction)showMessage 
{
    UIAlertView *helloWorldAlert = [[UIAlertView alloc]
                                    initWithTitle:@"My First App" message:@"Hello, World!" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
    
    // Display the Hello World Message
    [helloWorldAlert show];
}

@end
As you can see from the above, you use the declaration “@implementation” to declare an implementation. Inside the “showMessage”, it’s the actual code defined to display the alert message on screen. You may not understand every single line of code inside the “showMessage” method. In brief, it creates an UIAlertView with “My First App” as the title and “Hello, World” as the message. It then calls up the “show” method and request iOS to display the pop-up message on screen.
Hello World App
Hello World App
It’s vital for you to understand the concept of interface and implementation. If you have any question, feel free to raise your question at our forum.

Behind the Touch and Tap

What actually happened after tapping the “Hello World” button? How does the “Hello World” button invoke the “showMessage” method to display the “Hello World” message?
Recalled that you established a connection between the “Hello World” button and the “sendMessage” action in Interface Builder. Try opening up the “HelloWorldViewController.xib” again and select the “Hello World” button. Click the “Sent Events” button in the Utility area to open the Sent Events.
Hello World Button Sent Events
The Sent Events section shows you all connections between events and actions. As you can see in the above figure, the “Touch Up Inside” event is connected to the “showMessage” action. In iOS, apps are event-driven. The control/object (e.g. UIButton) listens for certain events (e.g. touches and taps). When the event is triggered, the object calls up the preset action that associates with the event.
In our Hello World app, when users lift up the finger inside the button, the “Touch Up Inside” event is triggered. Consequently, it calls up the “showMessage” action to display the “Hello World” message.
The below illustration sums up the event flow and what I have just described.
HelloWorld Message and Event Flow
Event and Message Flow of Hello World App

Behind the Scene of the “Run” Button

When you click the “Run” button, Xcode automatically launches the Simulator and runs your app. But what happens behind the scene? As a programmer, you have to look into the entire process.
Xcode Build Process
The entire process can be broken into three phases: compile, package and run.
Compile – You probably think iOS understands Objective-C code. In reality, iOS only reads machine code. The Objective-C code is only for you, the programmer to write and read. To make iOS understand the source code of the app, we have to go through a translation process to translate the Objective-C code into machine code. This process is referred as “compile”. Xcode already comes with a built-in compiler to compile the source code.
Package – Other than source code, an app usually contains resource files such as images, text files, xib files, etc. All these resources are packaged to make up the final app.
We used to refer these two processes as the “build” process.
Xcode Build Option
Run – This actually launches the Simulator and loads your app.