PageTracker

Thursday, March 1, 2012

Executing a remote shell file from windows

Well... its something really simple but couldn't find the proper way to do. All I wanted to do is
  1. Running a batch script which will compile my codes and encapsulate in a zip file.
  2. Copy the zip file to a remote linux server.
  3. At the linux box, I need to deploy my application by unzipping the archieve
  4. And finally running other commands to manage something more.
Problem was I was not sure about how to initiate a command in my linux box from windows batch script.

Finally found plink with the help of Mr.Yann Ramin in stackOverFlow
scp -p -pw password code-archieve.zip user@remote.host.com:/opt/code
plink -pw password user@remote.host.com cd /home/user/Documents;./doTheJob.sh



Here the plink is actually 
  • logging in to the remote server
  • Changing directory to where the script file resides [cd /home/user/Documents]
  • running the shell script [./doTheJob.sh]
Note that how we are concatenating multiple shell commands in a single line by separating with semicolon.


Hope it helped you in your critical time. Share your thoughts on this.

Wednesday, February 1, 2012

Writing your blog through your email

This is just to check and share the feature of blogger that I came across today ( probably im too late to check it out ;)
However, it seems easy to post your writings through your email, at least formatting your mail. 

Instead of a long talk, lets first know how to enable it. Follow the below steps
  • Sign in to your blogger.com account and go to  http://draft.blogger.com/home
  • Get inside your blog where you want to post your message.
  • Go to Settings > Mobile and Email.
  • Check out for Posting using email.
  • You should be able to see 
Email and Mobile Settings Panel

  • Type a secret code and add Comment Notification Email addresses. Save Settings
  • You are done! Now try to write an email from your mail box and send it to the mail address that you prepared with secret words.


Even if you are about to use some code snippets, you can use like following

int main( void ){
    printf("Hello world!!");
        return 0; 
}

So... are you ready to use your email to post blogs from now on? You must start as you can see, ive posted this article from my email and it worked pretty well.
Share if you found it useful or not!!

Monday, June 20, 2011

Windows Tweaks: Adding commands with folder context menu


Command Prompt Here:
In my development environment I need to access Command Prompt very frequently. And its really boring to open the console and every time do some cd.. cd.. cd and point it to my destined folder.
You are feeling the same right? :) Just get it and enjoy it...

Nothing much to do though... Just download the registry file. Then a “Double click”, followed by “Yes” and “OK”. And it will bring the command prompt in your folder's context menu.
If you are using windows Vista or later, you already have this available. But now XP users will also avail the facility.
Now, Just right click on any of your folder and click "Command Prompt Here".

The file is available through my Google doc shares. Download CMD_Here.reg.  

Cruel Delete:
Another utility here. Sometimes you may want to delete a large folder without being concerned about anything. All you want just to delete it. Then the command “rmdir” works much faster than window’s graphical delete option. But how fun it will be, if you can do the same without opening command prompt yourself!! Well... download this Cruel Delete.reg registry file and run it. Get the command in your folder context menu. :D

Thanks to Mr Md. Enamul Huq Sarker for his kind help.
Hope these will help you a lot.

Other resources:
Registry tweaks are really helpful. Here i am adding some more resources having some more nice tricks

Saturday, September 25, 2010

Bada tutorial: Application basics

Now as we know how to create a project and already met the containers, we can start writing our application right away. And for this we will need to have a little concept about some basics of starting up an application. So today's post is on some elementary stuffs. May seem little bit boring but yet required!! 

I will not repeat the words already said in bada API doc. I put the links of API doc with each description. Please read the doc and find some additional concerns in this post.

First lets look at the following state diagram of an application. 


Fig: Application life cycle. Collected from bada API doc.


You probably already have seen this earlier. To start with an application we need to know exactly how to handle all the methods indicated in the diagram. Lets start with the first one...

OnAppInitializing: At the time of launching your application the system will call OnAppInitializing method to initialize it. Take a look at the bada API doc for this method. Notice that an AppRegistry& object is being passed as parameter which is usually used to restore your application to some previous state. This is the registry object for the application. You can save your application status in it and restore your application in OnAppInitializing method. Remember!! It is not an alternative of database. Keep as few as possible values in it.
This method is the very first method to be called. So initialize or allocate all necessary resources that you need to show your first screen. Your application may have different sequences, but whatever it is, the starting of that sequence should be here. Note that, this method is called only once in the application life cycle.

OnForeground: First, lets see what the bada API doc tells about it. From the API doc, you will be able to understand that this method can be called several times in a single life cycle of your application ( See the above figure to identify the sequence). So apart from resuming your application process, which is instructed in API doc, if you draw any screen in this method, make sure you are drawing the right screen in terms of the application state. If you see the template of a Frame based application, you will find this method drawing on a canvas.

OnBackground: Again the bada API doc includes quite comprehensive description. You should efficiently do the releasing and consuming resources in all these methods.

OnAppTerminating: Like the OnAppInitializing method, this one is also a pure virtual method of Application class. So you are must to implement this one. bada API doc have the necessary concerns about using this method. Please give attention to the Remarks section on the API doc. You can terminate your application by either pressing the End key or programmatically by calling terminate method of application class. In both cases OnAppTerminating will be fired.

Above methods are the common ones that need to handle. Refer to the Osp::App::Application class for the all other required handlers. 

So we looked into different state handlers of an application. But for a complete application we also need Forms, Frame etc. Next post will be on Form.

Share your thoughts and stay tuned.

Wednesday, August 25, 2010

Bada tutorial: Meet the Containers

Hmm... "Meet the Container !" :O What will be going on today!! :)

Yes, today we will be looking on to all the containers. Because whatever application you develop you must need to deal with various types of containers. After all containers are the things that will hold all our component and show those on the screen. 

Lets look at the following picture. 


A total black window and a button saying "OK".

At first lets find out how many components are there. What do you say? Well would you say like following?
  1. A dark black window.
  2. A button.
is there anything else? Ok, lets look at the following one:



( Focus on "Frame" and "Form" only )
So you identified the "Frame" and "Form", right ? ( encircled ). 

Yes these two are the most common companion for any BADA app developer. As you can see, your application must have a (only one) Frame on the very base. And then you need Form. An application can have multiple forms. Say your application have three screens. Then you will need three different forms. And to show a screen you just need to set the corresponding form in the frame.

If you already launched the "Basic App" from BADA Sample projects, then you will find three screens under this application. So they used three forms for these three screens and showing one at a time.

Once you have the form ready to use, you can add different controls( Button, Label etc ) over it.

Now back to our first picture ( A button on a single black window ). How many components are there? Right!!
  1. A Frame,
  2. A Form ( on the Frame ),
  3. A button ( on the Form )
So basically, if we try to define "What is a Frame?" then we would say that, 
  • it is something which holds the whole application window. 
  • It listens the event of changing phone orientation ( portrait or landscape ). 
  • It contains different forms.

And "What is a Form?", 
  • In the same way form is something which holds all the other controls like Button, Label, EditField, EditArea etc ). 
  • Even though Form itself is a Container, it can hold another Container also, like ScrollPanel, OverlayPanel etc. 
Take a look on the full list of containers in bada developer guide.

Hope this article was helpful to understand the basic containers. On the next post we will be having idea on the anatomy of any BADA Application. Till then ... take care & keep tuned :)


Wednesday, August 18, 2010

Samsung BADA, Starting with sample application

Hurrayh!! You downloaded all the required stuffs right? ( Didnt get my point :( ? Please refer to the earlier post ;)
Hope you already installed the IDE with language packs. If so just run the IDE. Specify your BADA workspace where all your projects are supposed be resided. And continue...

So! Now we are totally ready to go for the sample applications right? Its really easy and fun at the same time. Hope the BADA IDE is running behind your web browser. Now all you need to do is follow the steps given here to run some sample applications. Playing with these applications will make you familiar with this IDE, as well as give you a brief idea over the BADA SDK. Anyway, lets stop my tattling and start working.

1. Open the window of BADA SDK samples window. Go to “Window > Show view > Other”. This will show you a dialog like following.


Select Bada SDK samples from this dialog. Click OK. The window of sample application list is opened.

2. Right click on any application ( Say Basic app ). Select “Copy into my workspace...”. This will copy the whole project into your workspace. You can find these sample applications in  [BADA_IDE_ROOT]\1.0.0b3\Samples directory. In my case this is C:\bada\1.0.0b3\Samples.

3. You need to build the application first. Then it will be able to run. BUT before that you need to configure the build settings. There are three build configurations...
  • Simulator build ( A build to run in the simulator )
  • Target build ( A build to run in the physical device )
  • Target release.
Running in Simulator
To run in simulator select the first one ( Simulator build ).

4. Right click. Build the project
5. Again, Right click. “Run As > bada Simulator Application”.

The Basic app should successfully run in simulator.

Running in Target
To run in your target device, select second one ( Target build )

4. Build the project.
5. “Run As > bada Target Application”. ( Make sure your target device is connected with the PC through USB )

The basic app should run in the target device now.

Note:
Running or debugging in target device requires some driver ([BADA_IDE_ROOT]\1.0.0b3\Tools\S8500-Driver-V5_02_0_0.zip ) setup and some other things to be done. Please refer to the pdf if you face any problem.

Hope by now the Basic app is running in your Samsung BADA phone.

Next post will be on the basic architecture of a Bada application. So stay tuned :)

Tuesday, August 17, 2010

Samsung BADA, A new era of Samsung smart phones begins



Yes! Samsung presenting a new mobile OS for the smart phones. This is BADA. You can take a look at the press release of BADA. This one is developed on top of the Samsung's legacy operating systems, but with a target for providing high end smart phone features. Besides, this is open for developers in the whole world. Just register in developer.bada.com and get joined with BADA community. Develop your smart application for your Samsung Smart phones and let others have fun with the excellent BADA applications.

As I am developing BADA applications, I will try to keep a focus on BADA app development in my following series of blogs. Today here is a very basic introduction with BADA. So lets start...

Start with the community:
Here is the BADA developer website ( http://developer.bada.com ). Register there and get connected with lots of resources on BADA and also find very active BADA forums to share your learnings, problems, suggestions and recommendations. Find the forums here.

Get the BADA SDK:
Go to Development tools > SDK/IDE. All resources are available here with different packages. Look at the following points to have a concise idea.

  • For only IDE with the SDK you can download only bada_SDK_1.0.0b3.exe. It includes the basic SDK with simulator and target loading facility.
  • You can see some Language Pack available there. You will need at least one language pack to work with. You can download all four packs also.
  • Instead of the above steps, you can simply download the full package including the SDK, and all language packs bundled in a single archive.
Once you collect all the resources, start installing bada_SDK_xxxxbx. For example, Im working with bada_SDK_1.0.0b3 ). Very simple and straight forward installation. Select the language pack you want.

Note: As the BADA release note shows for bada_SDK_1.0.0b3, it may act unstably in 64 bit machines with windows 7 or windows vista. So please have a look on the known issues after setting up the SDK.

So bring the BADA in home... Hurry up!! Because we are gonna work with the sample application soon :) And it will be definitely a fun, I promise!! Keep tuned.