Thursday, September 26, 2013

Windows: Create a automated action...

Not all software out there allows you to save a series of commands/actions and allows you to run them again without the need of opening the software. Even if it can allow you to do that using command prompt, not all the functionalities will not be provided to you. Luckily there are software like...

You can script the actions that you would like to perform in a particular
software. On top of that, you can generate the script into a normal
windows executable(.exe) file that allows you to share it with normal
Windows User.

However, I knew that there are numerous software out there that can provide
you with a GUI interface and record all the necessary steps that you would
like to perform over and over again. Ex: winautomation, Do It Again,
RoboTask, etc... But most of them requires a license, and since I'm
performing a easy task, therefore I would rather spend a bit of time
scripting the actions rather than paying for a license.

* Click here to find out more about 'AutoHotkey'.

Thursday, September 19, 2013

Flex 4: Using Ant to create a smaller file size like bin-release

I was trying to create an automation script for some of the projects in Adobe Flex 4 the other day and I realised that the ant build is generating a far more bigger swf file (in terms of the file size)than the ones created using bin-release. After numerous attempts, I finally managed to compress the file size to match the ones that that were generated using bin-release.

<!-- Within the <mxmlc> tag of your ant script, you need to 
 add the following. And take note of the comments below -->

 <runtime-shared-library-path path-element="${FLEX_HOME}/frameworks/libs/textLayout.swc">
  <!-- If you are copying and pasting, do take note that 
   'textLayout_1.0.0.595.swz' isn't in the 'flex/' folder 
   but the 'tlf/' folder under 
   '' -->
  <url rsl-url="" 
  <url rsl-url="textLayout_1.0.0.595.swz" policy-file-url="" />

 <!-- If you are copying and pasting, do take note that 
  'framework.swc' needs to be included before the other 'swz' 
  that belongs to the same 'flex/' folder under 
  '', otherwise errors
  will occur when you run the web application. -->
    <runtime-shared-library-path path-element="${FLEX_HOME}/frameworks/libs/framework.swc">
        <url rsl-url="" 
        <url rsl-url="framework_4.0.0.14159.swz" policy-file-url="" />

    <runtime-shared-library-path path-element="${FLEX_HOME}/frameworks/libs/spark.swc">
  <url rsl-url="" 
  <url rsl-url="spark_4.0.0.14159.swz" policy-file-url="" />

 <runtime-shared-library-path path-element="${FLEX_HOME}/frameworks/libs/sparkskins.swc">
  <url rsl-url="" 
  <url rsl-url="sparkskins_4.0.0.14159.swz" policy-file-url="" />

 <runtime-shared-library-path path-element="${FLEX_HOME}/frameworks/libs/rpc.swc">
  <url rsl-url="" 
  <url rsl-url="rpc_4.0.0.14159.swz" policy-file-url="" />

 <runtime-shared-library-path path-element="${FLEX_HOME}/frameworks/libs/charts.swc">
  <url rsl-url="" 
  <url rsl-url="charts_4.5.0.20967.swz" policy-file-url="" />

 <!-- If you are copying and pasting, do take note that 'mx.swc'
  isn't in the 'libs/' folder but the 'libs/mx/' folder under 
  '${FLEX_HOME}/frameworks/libs/'  -->
 <runtime-shared-library-path path-element="${FLEX_HOME}/frameworks/libs/mx/mx.swc">
  <url rsl-url="" 
  <url rsl-url="mx_4.5.0.20967.swz" policy-file-url="" />
* Click here for a great guide on creating the ant automation file for your flex 4 project.

Friday, September 13, 2013

Flex: Scrolling to a particular row of data of a Datagrid

I was looking for a much more easier way of scrolling to a particular row of data that belongs to the dataGrid. And I managed to find this.

Source Code for the main application - 'SimpleDataGridScrolling.mxml'
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="" 
      xmlns:mx="library://" >
  <fx:XMLList id="records">
    <address>3987 Mauris Rd.</address>
    <address>692-535 Id Street</address>
    <address>191-491 Ullamcorper Road</address>
    <address>400-2992 Donec Rd.</address>
    <address>P.O. Box 490, 9377 Lorem, Avenue</address>
    <address>P.O. Box 203, 418 Amet Street</address>
    <address>5584 Ultrices Av.</address>
    <address>Ap #316-3329 Fermentum Avenue</address>
    <address>932-8151 Arcu. Road</address>
    <address>P.O. Box 244, 8472 Lacus. Ave</address>
    <address>3798 Risus. Avenue</address>
    <address>Ap #377-2082 Mollis. Road</address>
    <address>P.O. Box 801, 2289 Malesuada Rd.</address>
    <address>Ap #509-2519 Non, Avenue</address>
    <address>9373 Ut Avenue</address>
    <address>120-7486 Ornare, Av.</address>
    <address>Ap #821-3336 Velit. Av.</address>
    <address>Ap #689-7263 Consectetuer Rd.</address>
    <address>Ap #790-6923 Tincidunt St.</address>
    <address>948-115 Imperdiet Street</address>
    <address>P.O. Box 454, 9501 Lectus Avenue</address>
    <address>Ap #402-1566 Varius Road</address>
    <address>852-8076 Enim. St.</address>
    <address>876-4551 Ornare Ave</address>
    <address>P.O. Box 256, 4107 Tempor Rd.</address>
    <address>P.O. Box 467, 7273 Nulla Street</address>
    <address>743-8871 Sem Rd.</address>
    <address>Ap #183-8772 Magna. St.</address>
    <address>P.O. Box 645, 453 Ornare, St.</address>
    <address>537 Turpis Avenue</address>
  <s:XMLListCollection id="tempXmlCollection" 
  <s:XMLListCollection id="tempXmlCollection1" 
   import spark.components.List;
    * Upon changing the selection of the drop down menu,
    * we would need to loop through the data of the
    * datagrid and find the one that matches the 
    * selection from the drop down menu and we would
    * select the row and scroll to that row.
   protected function changeHandler(event:IndexChangeEvent):void
    var tempData:Object = ddId.selectedItem;
    var tempDP:XMLListCollection = 
     gridData.dataProvider as XMLListCollection;
    for(var i:int = 0; i < tempDP.length; i ++)
     if(tempDP.getItemAt(i).id == tempData)
      gridData.selectedIndex = i;
      //This works in Flex 4 Spark Components.
      gridData.grid.verticalScrollPosition = 
       gridData.grid.getCellY(i, 0);
      //This works in Flex 3 Components but not 
      //for Spark Components.
 <s:VGroup verticalAlign="middle" 
  <s:HGroup verticalAlign="middle" 
      horizontalAlign="center" >
   <s:Label text="Select a ID:"/>
   <s:DropDownList id="ddId"
  <s:DataGrid id="gridData" 
     <s:GridColumn dataField="id" 
     <s:GridColumn dataField="name" 
     <s:GridColumn dataField="address"  
* Click here for the demo shown in this post.
^ Click here for the source files for the demo.

Sunday, September 8, 2013


Have you used the Japanese Kaomoji(face characters) before? Do you like it? However, if you are going to copy and paste each and every one of them, that's going to be pretty troublesome. But, if you have a Windows PC, you can actually configure it and it is definitely much more faster than the usual Copy and Pasting method. (You can also apply it to a Mac PC, but I don't own one now.)

1) First of all, you will have to download the file over here.

2) You will have to change to the 「Microsoft Japanese IME」 keyboard.

3) Click on the triangular button, follow by the step
of clicking on the 「Show the Language bar」 button.

4) After that, click on the 「Tools」 button, follow by
the step of clicking on the「Dictionary Tool」 button.

5) This will open up the 「Microsoft IME Dictionary Tool」 software.

6) Click on the 「Tool」 button, follow by the step
of clicking on the 「Import from Text File...」 button.

7) Select the file,「kaomoji.txt」, that you have downloaded earlier.

8) Click on the 「Exit」 button, after all the data have been imported successfully.

You have imported all the data successfully.
From today onwards, while typing the Japanese characters 「いい」(Good) using
the 「Microsoft Japanese IME」 keyboard, all sorts of Japanese Kaomoji(face
characters) options will be given to you too. Isn't that great? :D

Friday, September 6, 2013

Beyond Notepad

Since I have been doing a lot of multitasking at my workplace every now and then, therefore opening 10 different notepad applications isn't going to help much. Luckily, there are several options out there that allow us to open multiple text files at 1 go. (I, myself have tried 'TextMate'(Mac), 'e-TextEditor'(Windows), 'Notepad++'(Windows), etc...)

Image taken from 'Notepad++'.
As for now, I think 'Notepad++' itself is strong enough to replace your default
'Notepad' application in Windows. Not only the performance of the application is
very good, it also allows you to open/edit/search through multiple files at one
go. On top of that, it's free and it also supports formatting for some of the
much more common programming languages(HTML, XML, Javascript, etc...).
(However, it would be great if I can also perform a Alt-Tab between the documents
opened using 'Notepad++'. :P)

* Click here to find out more about 'Notepad++'.