JAJAH Development Blog

Blogs by JAJAH Developers

August 19th, 2008
Yesterday we held the 3rd MoMo TLV event. It was at Mandy’s, on the Yarkon and the topic was mobile content. 130 guest came and orange handed out gifts. I spotted 3 blond women other than me, next event I promise to take a photo of blonds…, momo TLV We had a speed lecture session; each person talked 15 min. we had a special guest from China - Ori Elraviv, Dragon ports Co-Founder, that talked about the mobile scene in china, and mostly answered question. Aviv Revach, Mominis Co-Founder, gave a short intro about mobile gaming. Guy Ami-Ad from Mobi, talked about mobile advertising and was charming as always, Aviad Rabinovich, Oranges Music Manager talked in addition to the regular "listening to music on your handset" about using your mobile for getting to know more music, music campaigns and song recognition, which I liked the most. It works by sending a part of a song recording to some server, and receiving the name of the band, song name and the album in a few seconds from the server. I was impressed, even more than seeing 3 other blonds in a mobile event.  I already know some sites that do something similar, such as WatZatSong, but in those sites you need to wait for users to recognize the song and say what it is. I don’t know what was the application that Aviad was using, but I liked it very much and Ill will find out… )As always we had an open bar, thanks to our sponsors Orange, BlueRun Amdocs and Eurocom. More pictures from the event can be found .

August 19th, 2008
As most of you know, JAJAH released a pre-installed Windows Mobile VoIP client for the Japanese EMobile operator. While working on it, I checked for performance issues and memory leaks. This was critical since in addition to outgoing VoIP calls the application runs in the background and listens to incoming VoIP calls. In order to monitor the performance I used the .Net compact framework remote performance Monitor (RPM). this tool is easy to use, once you understand how to install and use it, and this is the reason for this post. Installation: copy netcfrtl.dll and netcflaunch.exe  from C:\ProgramFiles\Microsoft.NET\SDK\ CompactFramework\ v2.0\ WindowsCE\wce500\armv4i to the Windows directory on your device. (to copy from your desktop to your windows mobile device use ActiveSync) Running the PRM: Connect your device to the desktop using ActiveSync Open NetCFRPM.exe from C:\Program Files\Microsoft.NET\SDK\CompactFramework\v2.0\bin Select "File" and then "Live Counters" image  In the device box select "ActiveSync"  and in the "application" box enter your application you wish to test. Press "connect". the application will start and you will see the changing counters. for more details about the counters check out David Kline’s post image image Using this view you can see the counters change and see what’s going on. to make things easier to monitor, you can have a view of the heap at real time and compare the GC heap at different intervals. imageGC Heap View: Click "View GC Heap" to view the heap status. In this view you can see the number of instances  each object has and the memory it consommes. you may also see the root object that is keeping the object alive, i.e. what is the object that holds a reference to the object and hence its not garbage collected.       imageComparing heap states Its very helpfully comparing different heap states over time. This can help you see the difference in object over time and help you find leaks in various states of your application. When interested to know the heap state click "View GC Heap". when you want to compare the heaps memory states go to "View" and then select "Compare Heap". this view allows you to view the difference in object during the run time.

August 6th, 2008
This post is aimed to windows mobile developers looking for a profiler for their mobile application. I came across EQATEC profile. This tool is great! You can run it on all .NET apps including .NET CF 2.0 and 3.5.  The usage is quite simple:
  1. Compile your application as usual. If you wish, you can later add profiler-attribute later for fine tuning the profiler.
  2. Use the profiler to build a profiled version of your application. The profiled assemblies are typically 30% larger than the original and runs 30% slower. I believe that for most apps that is acceptable. profiler   
  3. Deploy the profiled version and run it on your device. Your device doesn’t have to be connected via the ActiveSync for this step. After the application finished, find the report file. Usually, it will be be on ‘Temp’ folder or on SD card if you have one.
  4. Drag the report file to your desktop, and from there, to the profiler viewer. profviewer
  5. After a few minutes, people around you would probably find you mumbling “OMG, what the…?, I didn’t believe it takes so much time! And why the hell this method is called so many times”.
I found the viewer useful for the following points:
  1. Find out your bottle-necks methods. This could be methods that takes long time to execute, or relativity fast methods that are called numerous times.
  2. Find out what happens inside your code. You might realize that you overlooked some calls to method that consumes most of the application time.
  3. Prioritize your work. The 80-20 rule will work here. You’ll find out that most of the delays are trackable and easy to resolve.
For more information and understanding on how to use the profiler, go to the guide. BTW, EQATEC also have a tracer tool. However, it is an on-line tool that drastically reduces the performance of your application. For example, the bubbles example application rate was reduced from 54 frames/seconds to 3!

July 16th, 2008
In order to take a screen shot of your handset or of the emulator you should do the following: 1- Open the “Remote Zoom In” application from the “Visual studio Remote Tools” WM screenshot 2- Select to what device or emulator you want to connect. In case your connecting to a device make sure its connected to the PC with the USB cable. windows mobile screenshot 3- the application will connect to the device/emulator  and you will see the screenshot. if you would like to take another screenshot, just click the “Refresh” button 4 - To save the screenshot, select “Save as”.

July 3rd, 2008
Mobile Advertising At the beginning of the week I attended the IMA’s Mobile Advertising event that took place in Tel Aviv. the event was very well planed, and on schedule, every lecture started and ended on time! that was so surprising. I think that was the first event I have been to in Israel that corresponded to the time table! the place was full, it looked that there where allot of women, compared to other mobile events I have been to. I was proud… )The lectures where interesting. Most of them demonstrated the extra creativity needed for mobile advertisement. TurkCell showed some very interesting ways to advertise, which involves users consent to get advertisements. They talked about coupons that users receive from their favorite brands which are discounts only available for mobile users, and that way making users want to receive the advertisement. The most interesting thing they talked about was commercial ring tones, the user sends a SMS with a short code and then he "subscribes" to a ringtone of some brand. Every time the rington is played (i.e  the user has an incoming call), the user gets credit-his phone bill is reduced. the number of times the ringtone is played is monitored. The technology used is called RBT (Ring Back Tone).  This is the song we hear when calling a friend. Turkcell uses a company called TonlaKazan (meaning Tone&Win) to achieve this. Mobile Advertising Guy Ami-Ad,from Mobi, gave a rememberable lecture with allot of examples of innovated advertisements. a basic idea is that with a mobile, you can get to the user any time and any place, in the bed before he sleeps, or even in the bathroom…. he talked about having loyal users, and doing it by billing them only "after a few clicks".. and how important is it to make the users involved in the brands advertisements.  there were many more interesting lectures and talks. I think there are many advantages for mobile advertising. from the advertiser side, the user is available at any time and any place, tracking and monitoring the result are very easy and there is no better way of knowing your target client by his  profile and interests whereas just having an advertisement on TV. From the developer and business side, I think there is a barrier of where the technology in the mobile industry can develop and this is just because every thing in mobile cost money. Having advertisement to cover various charges on the mobile will increase demand in mobile technology. Disadvantages? none, or am I  grafted? ) the only issue I see is spamming users with advertisements, but in the case of mobile advertisement the user needs to consent getting advertisement or coupons…

June 28th, 2008
  womenThe F5 - Refreshing women venture’s First meeting was on Thursday. it was organized by Liat Vardi and sponsored by Sun. I arrived late, due to a major traffic jam  (2 hours from Raanna to Tel Aviv), but just in time to hear Miriam’s Schwab’s lecture on - "Using Blogs and SEO to Promote your Business". the lecture was general. The interesting part was samples of different blogs on the net and what to do to improve them.  women lecture After the lecture dessert was served and us girls had a chance to chat some more. other than business, technology and sharing goals we could say things like " bad hair day" and understand each other perfectly! The atmosphere was nice and relaxing.  I got to meet some very interesting women,  and learned allot. I’m waiting for the next events….

Count words Using Regular Expression

June 28th, 2008
I had to create a program that counts words in a string. The program need to count all words in the string except: 1. Html Code 2. Dividers 3. Extra spaces + new lines

I used regular expression to filter the strings. For this purpose I created two functions:

RemoveExtraSpaces - Remove extra spaces from string. The function allow only one space between each word.

CountWords - The function return number of words in a string. It use the function RemoveExtraSpaces and use regular expression to remove HTML Code , New Lines and Dividers.

///

/// This function remove Extra spaces , the Regular expression is

looking for white spaces that appears 2 times and more

///

/// This is the string that we want to check

/// Fixed String

private string RemoveExtraSpaces(string s)

{

Regex FindExtraSpace = new Regex("\\s{2,}");

return FindExtraSpace.Replace(s, " ");

}

///

/// This function return the number of words in a string that are

/// separated by space

///

/// The text that we want to check

/// number of words

public int CountWords(string strText)

{

string exp = "#;#";

// The expression look for Html and new lines and the divider that

// we define before

Regex Match = new Regex("<[^>]+>|" + exp + "|\r\n|\n");

// Replace the tags with an empty string so they are not

// considered in count

strText = Match.Replace(strText, "");

// Remove the extra Spaces

strText = RemoveExtraSpaces(strText);

// Count the words in the string by splitting them wherever a

// space is found

return strText.Split(' ').Length;

}

Regular Expression in C#

June 25th, 2008
In the following post I will explain what is regular expression, what we can do with it and the special characters that we can use in order to find the specific pattern. The regular expression provide means to identify strings of text of interest. In other word the regular expression let us search a specific pattern in a text What we can do with Regular Expression ? 1. Search easily specific pattern 2. Validate a string for example : credit card number, Id number and ect.. 3. Find the specific pattern and do some action like replace characters Example of regular expression in C#:

Private void regExample()

{       string str = “Hello. My name is Inigo Montoya. You killed my father prepare to die.”;

string exp = @”\binigo\b”;

Regex ex1 = new Regex(exp,RegexOptions.IgnoreCase);

// /b in the end and in the begining means that the word is Inigo and not part as other words like Inigojbkbj

// Moreover the option IgnoreCase mean that there is no meaning to the letters case.

Console.WriteLine(ex1.IsMatch(str));

// Match can give you more data where this string is located

Match match = ex1.Match(str);

Console.WriteLine(“Found string ‘” + match.Captures[0].Value + “‘ in:” + match.Captures[0].Index);

Console.WriteLine(ex1.Replace(str, “David”));

// Let’s find Inigo and afterward somewhere in the string should appear the word father

Regex ex2 = new Regex(@”\bInigo\b.*\bfather\b”);

match = ex2.Match(str);

foreach (Capture c in match.Captures)

{

  Console.WriteLine(“Found the pattern in:” + c.Value + ” in Index: “ + c.Index);

}

}

Special Characters that can help us search a pattern:

 

Character
 
 

Description
 
 

Example
 
 

/b
 
 

Matches at the position between a word character
 
 
 

/blior/b mean that the search will look for the word lior
 
 

|

 
 

Causes the regex engine to match either the part on the left side, or the part on the right side
 
 
 

Abc | def – check for abc or def
 
 

.

 
 

Match any single character
 
 

Ab. à

can be ab or abc , and and so on..
 
 

^

 
 

Matches at the start of the string
 
 
 

^ab – the string need to start with ab
 
 

[^]
 
 

Accept any character expect the characters in bracket
 
 

[^d-f] – expect all charcters d or e or f
 
 

$
 
 

Verify the end of the string
 
 

Def$ - check if the string end with def
 
 

*

 
 

Repeats the previous item zero or more times
 
 
 

a* - a,aa,aaa,aaaa,aaaaaaa
 
 

+
 
 

Repeat the previous item one or more times

 
 

a+ - aa,aaaa,aaaaaa
 
 

?
 
 

Zero or one of the preceding item
 
 

Dogs? -> dog, dogs
 
 

{n}
 
 

{n}

where n is an integer >= 1
 
 
 

B{2} = bb
 
 

{n,m}
 
 

{n,m}

where n >= 0 and m >= n
 
 
 

B{2,4} = bb,bbb,bbbb
 
 

{n,}

 
 

Repeat the previous item at least n times
 
 

D{2} = dd, dddd and so on.
 
 

/d
 
 

Any number
 
 

0-9
 
 

/w
 
 

Any number or letter
 
 

1,2,3,a,b,d,g and so on.
 
 

/s
 
 

Match any whitespace character
 
 

 
   

June 21st, 2008
Nowadays, the hitech industry is having more and more women, especially in Israel. I guess it’s something to do with the Multitasking and passionate features that women have. Usually, when going to some technology event, most of the attendees are men. Of course, in some cases there are allot of blond girls which are called Nokia or Samsung girls, but I’m not referring to them. )My first women event was held in a beautiful hotel in Barcelona, drinking Cava and very women-like.  it was organized by the group, or should I say   Helen Keegen and Gillian Kennedy, which are also organizing , on the first of July, in London. Unfortunately I cannot attend that one- after all it’s in London. Happily enough, we have Liat Vardi who is organizing a , for hitech & web entrepreneur women. The group is called F5- Refreshing Women Ventures, and its goal is to inspire women, help get professional advice and support, as well as networking, so events will include lectures. I think this is a huge step for women in the Hitech industry in Israel - Thank you Liat, I’m so excited! The first meeting will take place on June 26th, at Shvil HaTnufa 5 St., building no. 2 a, 3rd floor, Tel Aviv. Facebook Event link: Meeting’s Schedule: 19:30-20:00 Mingling+ dinner 20:00-20:30 Networking 20:30-21:15 Ms. Miriam Schwab-" Using Blogs and SEO to Promote your Business" 21:15-21:30 Q+ A There are limited places left, so if you want to come please email Liat Vardi at LiatVardi [at] gmail[dot] com  as soon as possible with the following details: Full name Occupation – where do you work/what is your venture about? Your blog/website Cell no. Mail address City I’m there!! * I would personally like to thank Edward Resnick from Sun, that helped make this happen and also helped MoMo TLV

June 20th, 2008
(This blog post was inspired from a discussion I had with Moti Gust earlier this week, Moti and I have been working jointly on various development projects since early 90’s)   Model-View-Controller (MVC) is a corner stone Design Pattern that in recent years received more and more acceptance. MVC is a “solution” to various problems raised when presentation code, business logic code and data access code are mixed together. MVC separates a UI driven application into three components: View - the presentation code (which renders the contents of the model), Controller - translates between user actions (received through the View) and actions performed by the model and Model - representing the enterprise data / business rules that communicate with the data model. The following image (taken from here) summarizes the concepts in this design pattern:   mvc-structure-generic   There are some frameworks that endorse MVC as the proper way to build UI applications, such as (part of the Castle Project)  and recently Microsoft has been looking into integrating MVC into the .NET Framework 3.5, lots of info on that around the web, one such link is this. MVC is a great concept, it provides away to separate between pure UI code, UI logic and application logic. The separation allows the UI developer to be de-coupled from the application logic, all he needs is a good, robust API and to separate between the graphical / rendering part of his presentation code (the View) and the link to the business logic (the Controller). It even allows another developer, who did not originally wrote the rendering part to tie between the model and the presentation. It gives a lot of flexibility. But Dragons be here - is that really the solution we’re looking for? Before going into the real-life example which flared this whole discussion, I think it’s worth a while to pause and think about Design Patterns. There are many ways to categorize and segment Design Patterns, I won’t get into all that, but if you look the MVC, Publish-Subscribe Design Pattern and Patterns like Singleton something very evident pops up : Singleton is implementation driven, it’s practicable (while some would argue that it’s overly used incorrectly [which I agree to, but we'll leave that for a later post, maybe]), its a technical way to write you code, it’s a tactical solution. While MVC (and others) are different, they are CONCEPTS, they are a way to think of information driven SYSTEM, it’s a strategical solution. But what MonoRail and Microsoft are doing is to endorse  MVC as a framework, rather than system’s architecture solution, and in my mind this falls short. If your development group is well disciplined and the design is good, you don’t really need a framework to uphold the rules - there are many other ways to address that. What is missing in my mind (and I’ll try to prove it with a real-time example) are system architecture solutions that address real-life application development & deployment cycles that address mid to large size projects with MVC. Instead we get some development frameworks suitable to a small group of developers working on smaller scale projects, at time it seems more of a university type of solution than issues we tackle in real life. So after all that, let’s get to the problem at hand. JAJAH is a medium to large size software project with a wide variety of  technologies, we’re also a global company with Marketing in the US and R&D, Operations and other departments in Israel. One of our hurdles is that content changes should be close to the Marketing team, while today every request has to flow to the R&D team and be part of the release cycle. This causes extra work (tidious, not-so-interesting work for our killer developers) on the R&D team, and does not provide quick enough response to the Marketing team. Hence we need some Content Management System where we can have a not-so-expensive HTML guy next to the marketing team making content changes. This is practically MVC. However, we need different release cycles, the View should be developed and deployed in a different way than the rest of the system. It’s not just separating everything to different projects, DLLs etc - it’s a whole different system. We need to QA the content, having it in a staging environment and have proper roll-out procedures. We also want to limit the changes that the HTML guy can make in the system, we don’t want to give the guy full control over all rendering aspects, just certain parts. We used to play around with Offermatica (recently acquired by Omniture), but while it’s a really cool tool, it’s mostly focused around A/B tests and is not suitable as a heavy duty content management system. MVC is cool, and it makes a lot of sense, but what we actually want is M-V-C, totally separating the components for that a framework is not enough. For that MonoRails is just not good enough since it keep everything together. What we need is some type of a Content Management System, coupled with a release cycle & deployment management, and same applies to the Model. The controller is a different story, at times we would like to couple it to the Model and times to the View release cycle. My point in all this is that Design Patterns should not be regarded as framework solutions pre-say, but rather as design concepts being applied to the high level system architecture and not necessarily at the development level. Amichay
Jajah is the VoIP player that brought you web-activated telephony.