Open Source Lover

Google
 

Saturday, September 04, 2010

A day at Apple Store

Today, I decided to spend some time at Covent Garden Apple store and play with Apple devices. Time to time, I go and try the new toys at Apple store at Regent street, yet I had not been at Covent Garden store before.

Covent Garden has a relaxing and fun loving atmosphere with street shows, pubs, market area and night clubs in the area. I guess, that relaxing and exciting feeling also effects the people who comes to shops in the area. So, that may explain, why I felt like quite keen to play with Apple devices at Covent Garden Apple store. It felt like, home, far from rushing to do the things and by having enough space and computers, laptops, Ipods, Iphones(state of art devices of Apple) for everybody, it was quite pleasant environment.

I entered from one of the doors to an old and royal looking building where full of Apple gadgets, computers, tools and toys are placed for any body's use. As a person, who does not have Mac experience, first I found it difficult to find out even to scroll in the page without using side toolbars on Macbook. Then, I tried a bit more by hoping that I will find out by myself how to use a Mac OS operating system. But, the inspiration that I waited for last five minutes did not come till a friendly young Apple store assistant came with a kind smile on her face. I guess, she has seen many people like me, who really wanted to prove that he/she is not alien at all to technology, but a Windows user or Linux user...

After spending around 20 minutes showing me and making me try the things on Macbook, I finally started to feel comfortable with Mac as well. At that instant a smile came to my face, it might be more or less the same smile when Apple software engineers packed the final release of Mac OS operating system itself and I guess she was happy to see that, so she had a content, genuine smile on her face too. Afterwards I started to ask more questions regarding usage and compatibility of Windows apps in Mac by asking, if an emulator exists for Mac to run simple exe files which can run os Microsoft operating systems and if I can publish a book and order it pressed to an address as I can do for photo albums and some other questions a bit more in technical depth. By asking help of another store assistant, they provide me my necessary information and answers with patience. So I could answer questions on my mind with their help and maybe, they got some new ideas from my questions to improve the existing functionality.

After playing with Macbook, Macbook pro, iMacs, the touch sensitive mouse and sleek aluminium keyboard, which look like items to be shown at modern art gallery rather than in a store, I moved to my favorite devices and probably Apple's favorite devices, which saved Apple than being just another computer manufacturer, to iPods! They are just fantastic! My favorite model is iPod nano, small, light, colorful, aesthetic and with full of features. That small device can play videos, songs, contains fm radio, digital camera and voice record. It may have even more features that I could not discover yet. I had my headphone with me, so I could test the voice quality of that beautiful device. It was just fantastic. As an Ipod touch owner, I wanted to have one Ipod nano as well.

While, I was playing with Ipod touches, which are same as mine. A store assistant asked me if I need any help and we had a nice chat regarding, why Apple does no let Adobe Flash applications to be used on iPods and iPhones. After talking a bit more, I noticed actually they do not have acertain explanation for it. They know only as much as another person who follows technology news. Yet, it was visible, they are very much interested in with Apple products. Still, I expected them to know a bit more than that.

After spending a bit more time with new iPhone, I moved to upstairs. Apple Covent Garden store has four floors and mainly I spent my time at the entrance floor, where you can grab a Macbook or an iPod or an iMac and start using it. In the second floor, they have face to face facility where you can get a Mac training and make yourself comfortable with Apple products and at the same time they have a special section for kids to play(which I regret now, for not spending some time there) and Apple genius team to help customers to customize your machine just for you.

While I was just about to play with Macbook pro another friendly store assistant came and asked if I need any help. I said yes and asked him, why a home user, who only needs a computer to surf web, watch movie, listen music would buy an Macbook for almost two times price of a normal laptop or even three times price of a netbook, which has same features. As a person, who prefers to buy the things which makes me happy to use them, of course I value, style of Apple devices, user friendliness & security of Mac OS, durability and reliability of Apple products, service quality even after you bought an item from Apple or even before you decided to buy one, how passionate they are when, they are designing their products externally and internally. Yet, I wanted to hear that from a person who works in Apple store. I would be happier at least, if he told me as much as I knew about Apple products(by reading Inside Steve's Brain book, following each new product of Apple and mainly by own personal experience of using Apple devices) in sentences without using “I guess” or “it can be because of” blocks. Obviously, when I am asking such a question, I expect an expert answer, rather than a guess. Luckily most of the customers who gets an Apple are there with a positive attitude, as same as me. So my over all experience is quite happy one.

Till, I come Covent Garden Apple store, my favorite company for customer service was Turkish Airlines(Always happy to fly with them!), now, It became two companies in same level. In store, I felt like being between friends and as free as using my own computer, where nobody puts pressure to on you to sell something to you(Just do not move the Macbooks much, alarm is a bit sensetive), instead I had an impression, they were really trying to make me have an enjoyable time in store.

So, Apple store in Covent Garden is a store with full of gadgets or full state of art technology toys and people who are willing and ready to help you. That is indeed very good customer service. If you have chance to pay a visit to London, Apple Covent Garden store, go and experience it yourself! Have fun!

Tuesday, September 08, 2009

Adobe Flex 3

Hi,

Recently ( yesterday), I am asked to do a small the Flex Project as part of my initial screening interview. I liked it very much and it was much different than what I imagined. I had good fun, while i am trying to achieve my homework. It is the turely provides a user friendly and rich web experience for users. With Adobe Flex you can create powerful and astonishing looking web applications easily. I think, this is the future. To see what can be done, check the links at the end of that post.

So What is Flex ? Traditional web user interface is html + css + javascript output and that has limited ability. Yet, you may still think, google mail interface is amazing. But that impression won't last long after you see flex application. Check this example, http://techrageo.us/2007/06/19/communicating-charts-with-flex/, this example works directly on your browser. Like it ? :). You see how good looking it is. It is like a desktop application working on browser in swf file integrated into html code.

Development of this kind of application is as easy as developing desktop application user interface. I said interface, because flex does not directly interracts with server side. Instead it uses Soap, xml, web services... So When you want to execute a sql query directly on server, you can not do that. Flex is designed as user interface. So when you want to build an application which interracts with database, you need to have a server which does the biz logic with Java, .Net, Php, C or almost with anything :) that provides a web service interface to Flex, and then use the remote objects to read / write that data from server. Read more about that.

Code syntax is similar to java. Source code is stored in .mxml files and .as files(.as files are for Action Script files). Mxml have very similar sytax to xhtml. So if you know about xml, xslt, html and Java like language, that means you will learn that very quick.

I have used the Flex Builder 3 to do my small project. Which you can download it from internet and it is free for 60 days for Trial use.

I found a lots of documentation and there are tons of examples on the net. Seems like it is used much more than i thought before.

As an abosulte beginner, I am requested to the following things.

"We would like from you to create small application that reads data from server (Note: when solving the issue, do not use Flex Charting to show graphs).

Data are available at URL: !
Sorry, I can not give you the url but i will give you the php file which I put on my own web server ( simply setup wamp or phptriad to have php, mysql, apache server set and than put a php file which returns a json format string)

communication protocol is JSON.

After calling URL, server should return dates array with time in variable:
timeList.

Use this array as input to show graph that shows dependency of time on record count per hour / minute, etc.

- results write into data grid
- show charts, that will show all records on one chart with one-day granularity (that means column chart, where each column represents one day)
- bonus: when clicking any row in data-grid, the appropriate column will change its color

Appropriately comment the source, pack it and send it back to me the results.

Please use latest Adobe Flex 3

You can download data and put to your own server. The main purpose is just to send the data in JSON format.

Enjoy."

That is another good example for using DataGrid and Charts.

Note: Because of (useless) blogger, I can not post here the whole code. It deletes the tags. So Please have a look at the link and the code and above and steal the bit you need from my code :).

Here is the Code.
Note: Page has data grid and a chart. Their data providers are dpDGDate and dpChtTime. So set them on flex builder on their properties are add line to set their provider to the code.

import mx.messaging.SubscriptionInfo;
import mx.binding.utils.BindingUtils;
import com.adobe.serialization.json.JSON;
import flash.events.*;
import flash.net.*;
import mx.collections.ArrayCollection;
[Bindable]
private var timeArr:Array;
[Bindable]
private var dpDGDate:ArrayCollection;
[Bindable]
private var dpChtTime:ArrayCollection;
private var prevSelectedColumn:DisplayObject;
/*
* This function will be called when Run button is pressed.
* Function will read the Json formatted data.
*/
public function run():void
{
var loader:URLLoader = new URLLoader();
var request:URLRequest = new URLRequest();
configureListeners(loader);
// Requesting Data from server.
request.url = "http://localhost/json.php";
loader.load(request);
}
/*
* Function will assign eventHandlers to methods.
* @param dispatcher IEventDispatcher
*/
private function configureListeners(dispatcher:IEventDispatcher):void
{
dispatcher.addEventListener(Event.COMPLETE, completeHandler);
dispatcher.addEventListener(Event.OPEN, openHandler);
dispatcher.addEventListener(ProgressEvent.PROGRESS, progressHandler);
dispatcher.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
dispatcher.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusHandler);
dispatcher.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
}
/*
* Function will be called when call is completed.
* Function will create Json object and will call function to set data providers.
* @param event Event
*/
private function completeHandler(event:Event):void
{
try
{
var tempLoader:URLLoader = URLLoader(event.target);
var obj:Object = JSON.decode(tempLoader.data);
setDataProviders(obj);
}
catch (error:Error)
{
trace("completeHandler: " + error.toString());
}
}
/*
* Function will be called when handler is open
* Function will create Json object and will call function to set data providers.
* @param event Event
*/
private function openHandler(event:Event):void
{
trace("openHandler: " + event);
}
/*
* Function to get information about progress
* @param event ProgressEvent
*/
private function progressHandler(event:ProgressEvent):void
{
trace("progressHandler loaded:" + event.bytesLoaded + " total: " + event.bytesTotal);
}
/*
* Function is called when Security Error is returned
* @param event SecurityErrorEvent
*/
private function securityErrorHandler(event:SecurityErrorEvent):void
{
trace("securityErrorHandler: " + event);
}
/*
* Function to get information about HTTP Status
* @param event HTTPStatusEvent
*/
private function httpStatusHandler(event:HTTPStatusEvent):void
{
trace("httpStatusHandler: " + event);
}
/*
* Function is called when Security Error is returned
* @param event IOErrorEvent
*/
private function ioErrorHandler(event:IOErrorEvent):void
{
trace("ioErrorHandler: " + event);
}
/*
* Function will get the array data from json object, which will be used as dataProvider for DataGrid & Chart.
* @param obj Json Object, which is donwloaded from server
*/
private function setDataProviders(obj:Object):void
{
try
{
timeArr = obj.timeList;
timeArr.sort();
setDataProviderForDataGrid();
setDataProviderForChart();
}
catch (error:Error)
{
trace("setDataProviderForDataGrid: " + error.toString());
}
}
/*
* Function will get the array data, which will be used as dataProvider for DataGrid.
*/
private function setDataProviderForDataGrid():void
{
try
{
dpDGDate = new ArrayCollection(timeArr);
}
catch (error:Error)
{
trace("setDataProviderForDataGrid: " + error.toString());
}
}
/*
* Function will get the array data, which will be used as dataProvider for Chart.
* Function will group the data by date and will get the count
* Hopefully it will do it correct :D.
*/
private function setDataProviderForChart():void
{
try
{
if (timeArr.length > 0){
var arrDays:Array = [];
var ln:uint = timeArr.length;
var count:uint = 0;
var str:String = timeArr[0].toString().substr(0,10);
for(var i:uint; i <>
if (timeArr[i].toString().substr(0,10) == str){
count++;
if(i == ln -1){
var obj:Object = {Day:str, Count:count};
arrDays.push(obj);
trace("Day: "+ str +", Count: "+ count.toString());
}
}else{
var obj:Object = {Day:str, Count:count};
arrDays.push(obj);
trace("Day: "+ str +", Count: "+ count.toString());
count = 1;
}
str = timeArr[i].toString().substr(0,10);
}
dpChtTime = new ArrayCollection(arrDays);
trace("DataProvider Dynamic: " + dpChtTime.toString());
}
}
catch (error:Error)
{
trace("setDataProviderForChart: " + error.toString());
}
}
/*
* Function will highlight the column on chart
* Makes a costly seach in Array Collection and find the index of column
* @param event The click event
*/
private function dataGridClick(event:Event):void{
var str:String = event.currentTarget.selectedItem.toString();
str = str.substr(0,10);
var ind:int = -1;
var arr:Array = dpChtTime.toArray();
for( var i:uint; i <>
var o:Object = arr[i];
if (o.Day == str){
ind = i + 1;
}
}
if (ind != -1){
barHighlight("chtTime", ind);
}
trace("dataGridClick selected row content : " + event.currentTarget.selectedItem.toString() + " " + str + " Index:" + ind);
}
/*
* This function will highlight a column/bar in a column/bar chart
* @param barName The name/id of the bar/column chart
* @param barIndex The position of the column you want to highlight
*/
private function barHighlight( barName:String, barIndex:int ):void
{
if (prevSelectedColumn)
{
prevSelectedColumn.alpha = .8;
prevSelectedColumn.filters = []; //remove the glow filter
}
prevSelectedColumn = this[barName].series[0].getChildAt( barIndex );
if (prevSelectedColumn)
{
prevSelectedColumn.alpha = 1;
prevSelectedColumn.filters = [new GlowFilter(), new DropShadowFilter()];
}
}
------------------------------

And here is the part of php file(json.php).Note: Write between php tags. Bloggers somehow deletes the tags.
echo '{"tg_flash": null, "timeList": ["2007-06-22 18:02:13", "2007-06-22 22:45:00", "2007-06-23 10:18:35", "2007-06-23 10:41:35", "2007-06-23 10:43:26", "2007-06-23 10:43:45", "2007-06-23 10:45:08", "2007-06-23 10:45:28", "2007-06-23 11:17:52", "2007-06-23 13:13:08", "2007-06-23 13:36:14", "2007-06-24 09:14:04", "2007-06-24 11:42:45", "2007-06-24 18:22:13", "2007-07-01 02:58:25", "2007-07-01 03:03:18", "2007-06-27 15:18:46", "2007-06-27 13:07:24", "2007-06-27 13:08:00", "2007-06-27 13:08:42", "2007-06-27 13:08:48", "2007-06-27 13:10:27", "2007-06-27 13:10:58", "2007-06-27 13:11:03", "2007-06-27 13:11:21", "2007-06-27 13:12:12", "2007-06-27 13:12:42", "2007-06-27 13:13:21", "2007-06-27 13:13:34", "2007-06-27 13:13:35", "2007-06-27 13:13:41", "2007-06-27 13:13:49", "2007-06-27 13:13:59", "2007-06-27 13:14:37", "2007-06-27 13:14:38", "2007-06-27 13:14:46", "2007-06-27 13:15:28", "2007-06-27 13:16:14", "2007-06-27 13:16:15", "2007-06-27 13:17:21", "2007-06-27 13:18:25", "2007-06-27 13:19:15", "2007-06-27 13:19:44", "2007-06-27 13:20:06", "2007-06-27 13:20:19", "2007-06-27 13:21:12", "2007-06-27 13:21:19", "2007-06-27 13:21:54", "2007-06-27 13:22:08", "2007-06-27 13:23:39", "2007-06-27 13:23:52", "2007-06-27 13:24:02", "2007-06-27 13:24:30", "2007-06-27 13:25:08", "2007-06-27 13:27:05", "2007-06-27 13:28:32", "2007-06-27 13:28:32", "2007-06-27 13:28:42", "2007-06-27 13:29:45", "2007-06-27 13:30:10", "2007-06-27 13:30:17", "2007-06-27 13:30:41", "2007-06-27 13:30:42", "2007-06-27 13:30:51", "2007-06-27 13:31:26", "2007-06-27 13:31:34", "2007-06-27 13:32:46", "2007-06-27 13:33:27", "2007-06-27 13:33:40", "2007-06-27 13:33:57", "2007-06-27 13:34:07", "2007-06-27 13:34:16", "2007-06-27 13:35:04", "2007-06-27 13:35:16", "2007-06-27 13:35:38", "2007-06-27 13:36:07", "2007-06-27 13:36:20", "2007-06-27 13:36:26", "2007-06-27 13:36:40", "2007-06-27 13:37:35", "2007-06-27 13:37:55", "2007-06-27 13:38:45", "2007-06-27 13:39:46", "2007-06-27 13:40:19", "2007-06-27 13:40:25", "2007-06-27 13:40:37", "2007-06-27 13:41:18", "2007-06-27 13:41:31", "2007-06-27 13:41:56", "2007-06-27 13:41:57", "2007-06-27 13:42:55", "2007-06-27 13:42:56", "2007-06-27 13:44:12", "2007-06-27 13:44:37", "2007-06-27 13:45:34", "2007-06-27 13:45:35", "2007-06-27 13:45:43", "2007-06-27 13:46:39", "2007-06-27 13:46:40", "2007-06-27 13:46:47", "2007-06-27 13:47:21", "2007-06-27 13:49:18", "2007-06-27 13:49:26", "2007-06-27 13:50:29", "2007-06-27 13:51:06", "2007-06-27 13:52:09", "2007-06-27 13:53:07", "2007-06-27 13:53:58", "2007-06-27 13:54:45", "2007-06-27 13:54:59", "2007-06-27 13:56:29", "2007-06-27 13:56:36", "2007-06-27 13:56:37", "2007-06-27 13:56:44", "2007-06-27 13:56:49", "2007-06-27 13:56:50", "2007-06-27 13:56:52", "2007-06-27 13:57:19", "2007-06-27 13:57:40", "2007-06-27 13:57:47", "2007-06-27 13:57:53", "2007-06-27 13:58:06", "2007-06-27 13:58:27", "2007-06-27 13:58:37", "2007-06-27 13:59:09", "2007-06-27 13:59:44", "2007-06-27 13:59:46", "2007-06-27 13:59:54", "2007-06-27 14:00:42", "2007-06-27 14:01:29", "2007-06-27 14:01:42", "2007-06-27 14:01:46", "2007-06-27 14:03:32", "2007-06-27 14:04:08", "2007-06-27 14:04:47", "2007-06-27 14:05:35", "2007-06-27 14:07:36", "2007-06-27 14:08:05", "2007-06-27 14:08:33", "2007-06-27 14:08:39", "2007-06-27 14:09:31", "2007-06-27 14:09:39", "2007-06-27 14:10:26", "2007-06-27 14:10:46", "2007-06-27 14:10:50", "2007-06-27 14:10:56", "2007-06-27 14:10:58", "2007-06-27 20:43:35", "2007-06-27 20:43:45", "2007-06-27 20:43:48", "2007-06-27 20:44:01", "2007-06-27 20:44:26", "2007-06-27 20:45:08", "2007-06-27 20:45:15", "2007-06-27 20:46:53", "2007-06-27 20:49:12", "2007-06-27 20:50:39", "2007-06-27 20:51:08", "2007-06-27 20:52:01", "2007-06-27 20:52:39", "2007-06-27 20:53:07", "2007-06-27 20:53:31", "2009-01-28 18:03:35", "2009-02-08 14:16:04", "2009-05-11 18:57:16", "2009-05-11 19:16:21"]}';

And here is the result when you run.

After clicking the run button.


I think, it is very user friendly and very enjoyable to work with Flex ;)

More to read..

Ten things to correct about Flash and it's ability.

Flex Language reference

Flex for Java developers

Spring Powered Flex

And more about Flex and Java

And more about Flex :) Interesting articles

I loved that one - 11 mins to create a Flex app.

Google uses Flex too ( SAP and Oracle too :D )

And here is a company which does amazing apps with Flex

How about that amazing example - open source component

What is new with Flex 3

Some other nice web portals with Flex

And of course http://flex.org/

Quick Start