Search This Blog

Saturday, May 09, 2009

NSOpreation

Peace be upon you

How are you guys? I am sorry that it has been long time since last post, but I have exams, work and my beloved iPhone projects.

Now, let us get to the point of todays post, it is about something called NSOpreation and NSOpreationQueue, this classes are part of the "iPhone Threading programming", which means that this things are mostly used when u do some threading in the iPhone app

The point here that makes me really get stunned was that this thing manages that queue of tasks, it is really critical to have something like that done for you, this thing manages that threads combined with locks combined with queue management, imagine that you have some kind of big thing, I will never have example better than Standford CS193p sample, flicker, imagine that you get some list of information from flicker and u wanna display it, considering that it is coming from the web, it will take some time, so there will be a need to handle it really wisely to make user feels Ok and don't get bored from your application, if I am going to do it on Windows, I may use "Threads", "Locks" to handle it and I think it will be a bit headache.

In the iPhone development "as far as I know such class is not exist for Mac OS yet", this classes will save all that time that will be sucked by implement this stuff, I really recommend downloading the sample and check it out, it is available online on the CS193p page, I really wish that I have some time to write example to show you how much it can be efficient to use such thing.
ohh, I forgot to mention that iPhone considered a subset of unix, which means internally it uses the pthread, I think it has all the POSIX , can u imagine that this little device runs UNIX :D

anyways, it was nice writing to you :) and I hope u like it as I do ;)

thanks for your time.

BR
Ahmed Essam

Tuesday, April 14, 2009

Arabic in iPhone Safari Sourcsecode

Peace be upon you

This days, I have forward my focus into iPhone development, actually I have figured out too many things that I miss by not working for Mac :D
I am not going to get into debate or something like that but all I am going to say is "Apple definition for the word 'Framework' is much much much much better than anyone else"
Let us get to what I am coming to say today.

Today I would like to demonstrate some stuff related to Arabic inside WebKit which the core of Safari
I will sort then explain, as I don't have much time I will explain in hurry :D
First, to get the code , you have to download it from Apple Opensource section, here is link
http://www.opensource.apple.com/darwinsource/iPhone/
in the Article I have used the 2.2.1
so let us start with BiDi related function , this function called BidiCharacterRung, I put it here because I have noticed that it has some kind of detection for the Right To Left issue



shapeArabic, If you know about Arabic representaion, the reshaping is the phase which make the Arabic readable by the user

This line I like very much, this code prevent from showing "boxes" if the font is not exist


The function related to previous figure


  1. The first image shows that the Arabic is really solved in manar of character direct, this doesn't mean RTL, you can notice that in Safari because actually it showes Arabic is resolved and corrected but not Shaped
  2. The code showes that there is some work done in many levels, there is some code also to solve Arabic in the SVG render engine, which means that it is ready, I don't know why they didn't use it, may be it is little buggy
  3. I like this part very very much, in OS X, when you use font that doesn't have the glphy"the shape of the character" of the character, it will find anther font that does have a font containe the character, why this thing is very important, it think it is better to see the character than seeing squares :D, you can easily see this in Windows mobile if it doesn't has Arabic support by 3rd party
What do I think about this code is, this code is somekind of memory conuming, as I understand that the code doubles the buffer to manage to solve the bidi issue
I think it should be optimized some how.
anyways, I like the code it is very well commented, I really recommend you to review it,
it doesn't require any thing from Apple products to review this stuff.

I hope that anyone correct me if there is anything wrong

Thanks for your time.

BR
Ahmed Essam

Thursday, March 26, 2009

iPhone OS 3.0 Has full Arabic Support

Peace be upon you
As you know that I have started my tries with the iPhone and I was very annoied because there is no Arabic Support for this Amazing device, now with iPhone OS 3.0 (the used to call it OS X now they call it iPhone OS) you can read Arabic , check out the images 


Arabic in the local application, it means that the strings are in the application, there is nothing I have done more than showing the string.


in the settings you will see that there is Arabic Key board

Now I have tried to use the Arabic keyboard and it is working "I liked it, but it didn't give right to left"

The best of all "Safari" now the browser supports the Arabic and it is working very nice, it is really nice experience to have.

I will not be able to talk much about the iPhone OS 3.0 because of the Agreement.

I am sorry for the low rate of posting but I promise I will be focusing in the blog soon

Thanks for your time.

BR
Ahmed Essam