Sunday, December 15, 2013

(Software) Architecture

(Software) Architecture: "The art of drawing lines, with the interesting rule that once you've drawn the lines all dependencies that cross that line go in the same direction" -- Robert C. Martin

Tuesday, July 16, 2013

Using your own Pre-populated SQLite database in (Xamarin.)Android applications

Problem:

Most of Sqlite-net samples – at least the ones I came across – address creating new databases and populating them with data at runtime through calling web services, or else. Nothing on the other side address the situations when you need to start with a pre-populated database.

Solution:

Thanks to this post, and other questions on StackoverFlow and Xamarin Forums, find below the C# version of the code on the mentioned post. Note that I only “translated” the part that copies the database file from the assets folder to your package data directory. That – off course – requires your SQLite database to be added to you Android project assets folder as an “Android Asset”.

Thursday, September 13, 2012

Visual Studio 2012 launch, MEA-ALM community, etc

If you haven't noticed already, Visual Studio 2012 launch was yesterday. It was such a buzz yesterday on Twitter. Our way in MEA-ALM community was to launch Hands-on Visual Studio website; a fairly large collection of guided, multi-lingual and real-life labs to experience, learn & practice Visual Studio 2012. I contributed a couple of videos too ;)

We had our own little twitter buzz too!

Remember, Visual Studio 2012 will be launched in Egypt by the End of September.

Sunday, December 11, 2011

FCIH Initiative family call for new members

FCIH initiative is group of FCIH graduates who are interested in passing their experience & knowledge to FCIH students. The kick off was on 7 November 2009; during these two years, we managed to hold number of sessions and  Java training.


We think of the initiative as our role towards the society and as a chance to help others find their way in life. Currently, we are hoping to add new members to FCIH  initiative family. Kindly, if you are interested, take a few minutes to fill  this form, if you are already a member please fill the form as well.


Please, feel free to spread the word to other FCIH graduates who might be interested.

Saturday, May 28, 2011

#Vodafone #Buzz #Fail

I was online through my favorite IM client; Google Talk, when a work-colleague started talking to me, asking me:

دا ايميل مين انا تعبت رابع ايميل يفتح غلط

I am using Vodafone Buzz from my mobile. Get it now for free from http://vf.eg/buzz

After talking for a while, I realized he was a total stranger; not my colleague. He's another user of Vodafone Buzz, like my colleague. The issue was that every time he signs in to Google Talk (using Vodafone Buzz), he signs in with my colleague's account. As far as I remember, Buzz associates your Vodafone number with the passwords you supply for your social networking sites (likes Facebook, Gmail , etc) so you don't have to type them every time you fire up the app.

If that was not scary enough, I'd just direct your attention to the fact: that stranger is not intending harm, (he's not a hacker for eg, or even evil enough to abuse the situation, he probably lack technical expertise too) so I'm expecting a disaster if he intended!! That if he was the only case of compromised password!!

Conclusion: If you're using Vodafone Buzz, just don't! And more importantly: UPDATE EVERY PASSWORD YOU'VE EVER SHARED WITH VODAFONE!

Side note: Thank GOD I don't save my credit card number on their website!!

Wednesday, March 23, 2011

Client-side Form Validation using jQuery Mobile

Lately, I've been involved in a project which is mainly targeting mobile browsers. The decided to use kinda "new" jQuery mobile "library". jQuery Mobile is a ……built over jquery, css, js, multiple browser support, etc…… It's still in beta? Yet, it renders pretty fine, and we didn't have more than a couple of issues with it. But it save us loads of time rendering on a nice range of supported mobile browsers.

For eg, I stepped into a problem with client-side validation lately. When jQuery Mobile renders input of type submit (i.e. a submit button for a form), it actually hides the "input" tag, and replace it with an anchor? (ie "a" tag).

Say, you want to add function to handle "onclick" event, validate the form, before hitting the server-side, and prevent it from submitting if it failed; something like:

<input type="submit" onclick="return ValidateForm()" />

The  function is actually never called because the actual input tag is as jQuery Mobile hides and replaces it by an anchor.

Adding the validation function via js/jquery after the document is ready to the anchor, will allow you to call it on clicking the anchor. Yet, it won't stop the form being submitted.

A nice alternative, is to use an input tag of type button, that is:

 <input type="button" onclick="ValidateForm();" />

And submit the form inside the function handling "onclick", rather than returning true/false, like:

   1:  function ValidateOwnerId() {                
   2:      if (/*form is valid*/) {
   3:          $('#myForm').submit(); // Submit from
   4:      }
   5:      else//not valid
   6:      {
   7:          /*show some error message without submitting form*/
   8:      }
   9:  }

Friday, March 18, 2011

الذين قالوا نعم و الذين قالوا لا

الإسبوع ده كان من أكتر الأسابيع المرهقة بالنسبة لي. مش بس عشان النقاشات(الأسعدتني جدا لانها أول مرة في حياتي تبقى بالشكل المفتوح/المتفتح ده) الغير منتهية عن تعديلات الدستور والاستفتاء. لأ كمان عشان كان من أكتر الأسابيع الكنت مضغوط فيها في الشغل  لدرجة إني -لأكثر من مرة- تقريبا "طردت" زملاء لي بيتناقشوا في نفس الموضوع من حوالين مكتبي عشان أشتغل :D

بسبب ضغط الشغل ده مكنتش متابع بشكل كافي الأحداث.. والإكتشفتها امبارح بليل والنهاردة وانا بحاول ألحق الفاتني.. كنت مبسوط معظم الإسبوع بالمقالات الكنت بقرأها في السريع عشان أحاول احدد هصوت بإيه في الإستفتاء.. كنت بحاول أقرأ لكتاب أرائهم من "المعسكرين" , نعم و لا, عشان أحاول  أكون رأيي الشخصي..

قرأت لعمرو حمزاوي و معتز عبدالفتاح و لكثيرين غيرهم, ده غير التحليل الوافي الذي قام به وائل خليل. اليوم أثار حفيظتي عدة أشياء.. معظم ماكنت اقرأه خلال الأسبوع كان محاولة لتحليل السيناريوهات المتوقعة لنعم و لا.. لكن فجأة اكتشفت إنه الموضوع تحول إلى استفتاء على دينك و وطنيتك!!

كنت سمعت خلال الإسبوع إنه بعض الأصوات في الكنيسة قالت للناس تصوت بلا.. بس لانشغالي و أسباب أخرى وضعت هذا الكلام في خانة الإشاعات. اليوم اكتشفت إنه كلام صحيح. سمعت أيضًا أن السلفيين والإخوان المسلمين كانوا بيدعوا الناس لنعم و اكتشفت حقيقة الكلام ده في صلاة الجمعة اليوم.. لدرجة اني قمت رحت اصلي في مسجد تاني لأكتشف إنه بيقول نفس الكلام.. أخيرًا شفت الفيديو لبعض المشاهير بيحاولوا يضغطوا به على مشاعر الناس عشان يقولوا لا.. واليحسس أي حد إنه مش مصري لو قال نعم

كل ده حسسني إنه الناس ديه مش محترمة عقلي ولا عقل المصريين بشكل عام. يعني بدل كل الناس ديه تدعوا الناس لانها تحكم عقلها و متضيعش حقها و تروح تصوت.. لأ بتقولهم ماتفكروش.. احنا فكرنا لكم والإجابة كذا!! كان أكرم للجميع في رأي لو طالبوا المصريين بالنزول للإستفتاء زي الفيديو الأصلي المأخوذ منه فكرة إعلان  قول لأ.

الأسعدني حقيقي إنه فيه ناس بتنادي بالمشاركة في الاستفتاء بس.. كمان بعد الصلاة ناس كتير كانت -على غير ما كنت أتوقع-  مش عاجبها استغلال الخطيب للخطبة.. ده غير إني اكتشفت كمان إنه كاتب ليه وزنه زي فهمي هويدي بيحذر من كلام مشابه. مش عاوزين يجي يوم نتكلم بنغمة شفيق: "أنا حضرت الثورة و هتفت و استشهدت" :D

Saturday, March 05, 2011

TEDx, El Sawy Culture Wheel, Bibliotheca Alexandrina, Open Brands, etc

I was having a chat with a friend, who is an enthusiast about community work, about that same topic (more specifically in Suez, my hometown) last week. Our conversation drove me to think about an idea that should have been done a little while ago (IMHO).

We all like the cultural "presence" of "organizations" like El Sawy Culture Wheel, and Bibliotheca Alexandrina. But unfortunately their effect is pretty local to where they exist. Another thing, similar organizations are too limited in resources, to reach out of their physical locations. They might try to expand vertically; creating more services, and enhancing them. But they almost never try to "branch out" in other places.

My idea for them is to spread their spirit/culture, share their experience with others who are willing to create similar experiences for their local communities, in a way similar to TEDx. Imagine if every city/governorate had their own Culture Wheel, which operate the same way, with the same spirit, but totally independent (financially for eg) on El Sawy's. Imagine instead of the usual bureaucratic "cultural palaces" (قصور الثقافة) there's a real cultural experience where people from all ages (specially youth) can find a decent place to mingle with like-minded people talking and sharing ideas, etc.

Thursday, March 03, 2011

"Note in (Google) Reader" issue Fix

Probably you're familiar with the sharing button (at least on Firefox and Chrome) offered by Google reader to help you share stuff that don't have feeds. Today, for some reason I realized that mine wasn't working!

GReader

 

After tweeting about it, thanks to Flavio Gomes and @mtobis, I realized what went wrong. Seems like the JavaScript file used by the button was updated, without updating the button script accordingly.

 

To solve this, all you have to do is set _IS_MULTILOGIN_ENABLED a variable that's not defined (but used) in the script file in the button script. So add something like:

_IS_MULTILOGIN_ENABLED=true;
// or
_IS_MULTILOGIN_ENABLED=false;
// or better
_IS_MULTILOGIN_ENABLED=((typeof(_IS_MULTILOGIN_ENABLED)=="undefined")?false:_IS_MULTILOGIN_ENABLED);

 

at the beginning of the button script, just to set _IS_MULTILOGIN_ENABLED before it's accessed as "undefined" in the script.

Sunday, January 09, 2011

How to force undo checkout? #TFS

Sometimes you'd pop into cases where you find yourself in a situation where you have to force undo pending code changes of someone else (say a colleague who is no more around, or even temporarily) or your own pending changes if say your machine (along with your workspace on it).

Well, there a Visual Studio tool for that.. That's tf command-line utility, which you can look for in your VS directory under Common7\IDE..

Using tf has lots and lots of uses, here's a really LONG list of them. Note: there's 3 sub-lists for VS2005, 2008, 2010. But for our tiny problem here, we mainly have to options, I'm using here the most straight forward ones:

Undoing pending changes for a specific file:

That will need mainly main parameters to start with: The name/path of the file checkout, User name (of the user who did the checkout), and the Workspace in which the checkout was done (usually your machine name if you didn't create an new workspace).

You could have an issue with the third one (workspace name), so you might have to check the Workspaces command for more details, but generally a small command like the one below will do just ok in most cases:

tf workspaces /owner:UserName

Knowing the above you can easily undo the pending changes as below, note: parameters are in squiggly braces like {these}:

tf undo {file path} /workspace:{workspace};{username} /server:{TFS name/IP}

Of course the "/server" part can be removed if you're on the same server running TFS. An example with some data will look like:

tf undo $/myProject/myFile.cs /workspace:mySpace;FCIH\shady /server:FCIH_TFS

Deleting the whole workspace:

The other option is to delete the whole workspace, which in turn delete any related checkouts. A simple command for that could be:

tf workspace /delete {workspace};{username} /server:{TFS name/IP}

which with some example parameters might look like:

tf workspace /delete Shady-PC;FCIH\shady /server:10.0.0.2

UPDATE:

After a comment by Meligy, I think I needed to add this: Most of the above needs you to be logged in as an account with TFS admin privileges, check the exact required permissions for Undo, Workspace and Workspaces commands.

If you're not logged in as the appropriate account, you can append {/login:username, [password]} to provide the authorized username and password.

Meligy, also, mentioned another tool called TFS Sidekicks that can do similar stuff.

Saturday, January 01, 2011

The main thing

I was having a long walk/talk with a friend today when this came up:

“The main thing is to keep the main thing the main thing.” ~Stephen R. Covey

We first agreed that our major problem is that we don't keep the main thing the main thing.. Later we agree that may be the problem is that: we are not sure what our "main things" really are?

Thursday, December 30, 2010

How you do (online) Social!?

Pretty much of the people who follow me, do so for stuff related to Agile or Community events/stuff (along with a few others who knew me for sometime and might really care to follow my news as a person/friend)

I thought it was obvious how I categorize my stuff but lately I realized that it needed to be more explicit, so here is a list of what I'm sharing so you won't get spammed by my other personal stuff (That is the way I do it, what about you?):

ComCal.org: Wanna follow follow technical events and share events with others? Egypt IT community Calendar is a public calendar that includes offline IT community Events held around Egypt. Also, online events both from Egypt and around the world. Choose your way subscription between from the site. You can add events to share it with the community here.

@ASGEgypt: Anything Agile, I was a bit sleepy but probably will be posting there more often soon. Note: this is a "colaborative" twitter account, others (ASGE organizers) post there too.

FCIH Blog: A collaborative blog by many guys from FCIH, I try to blog there as much as I can, but the blog is really full of great posts by my fellow Helwaneez there.. Strangely, we have huge (daily) hits from USA & India compared to those from Egypt.

@FCIH: Speaking of the blog; many guys from FCIH blog might post/reply there to any technical questions.

Google Reader Share items: for more "serious" stuff like articles I read, etc

LinkedIn: my online "professional ID"/CV/Resume.

@mShady: I was always fond of status messages (here's the proof!).. So this is my status messages/shout out/ etc extended and kinda archived! This is "me"; no filters attached!

This Blog: A year or so ago, I've went back through my blog to make sure my tags are more limited. No I have like only 9 (not sure if I should really reduce that again). I'm trying to make sure that all the posts here are either under "Personal" or "Tehcnical" Tag.. All the other tags are just extra tagging..

Facebook: is more for friends and family (or at least I'm trying to do so from now on) though it's wasn't exactly my "policy" before, I used to accept almost everybody as friends as long as they look "human" to me.

BUZZ: A combination of all the above!! I prefer discussions on Buzz and Facebook.. twitter is not made for that!

 

Now that I wrote it down, may be this way I'll be more strict about these rules that they are now public Open-mouthed smile

Friday, December 24, 2010

A late brief review of #GEgypt

G-Egypt was a 3 day event held by Google on Dec 8th-10th at Dusit Thani (New Cairo). I've attended Day 2, and 3 (Day 2: targeting Software Developers, Day 3: targeting Entrepreneurs and Software Developers), & knew about what happened on Day 1 (targeting Academia) from my brother and a couple of my younger friends from the community/FCIH.

Most of the sessions was too simple (may be except for Day 1, as mostly the attendees were younger/students) and sometimes they seemed even dull too, as most of the speakers seem to be software developers who aren't much exposed to speak on similar events before.

Yet, the same speakers were much more interactive, answering questions at the pods. There were 5 pods on the open area for most of the speakers of each day + one for Cairo-GTUG (Google Technology User group).

The Keynotes was mainly talking about Google's plan on targeting MENA , and what they're offering (especially in Arabic) lately, with some demos (stuff like search, translate, Ejabat, Maps, AppEngine, with a note that Android Arabization is in there plan, but no dates announced). Stressing on that one of their main issues is the lack of "well-formatted" Arabic content, that's mostly buried in forums (which is not the best place to put your content SEO-wise), asking for developers of the region to help them with that.

The sessions about AppEngine (Google's cloud computing offering, and the main reason I attended the event) was one of the most attended sessions, yet the session presenters were pretty boring and later on, many of the attendees either left for the other parallel session or stayed not paying much attention.

Yet, Again, to get the audience attention, the AppEngine speakers (there were 2 of them) announced a technical contest (only on day 1, 2) for creating apps using AppEngine (+ using other Google Technologies) which was judged by the end of each day with the best app awarded a Google Nexus!

On Day 2, the most attended and most lively session, by far, was the mobile (Android) development session. There was another couple of sessions by Site Clinic team, analyzing real sites of some of the audience from an SEO (and sometimes a little security) point of view. There was a rather dull session about Chrome extensions too.

There was a couple of session about the benefits of working with open source and using open standards on Day 2, 3 (which were generally favored by most of the people I talked to about). Also, on Day 2, there was a session by adopters of Google development technologies (Android, Maps), talking about their experience using it, and starting their new businesses on top of it.

There was a multitude of sessions about maps and their applications on Day 2, 3 with a business (possible uses of maps, no code) sessions about the topic on Day 3.

On Day 3, the most attended and tweeted about sessions (actually throughout the whole 3-day-event) was the session and panel discussion about Entrepreneurship,. There was another Entrepreneurship panel discussion on day 2, but that too dull compared to Day 3.

Concerning logistics, the event was held on four areas: Main Auditorium, Breakout sessions room, an open area, and the dining area. The open area has many entertaining stuff like the ones you'd see on a typical "Life at Google" video; stuff like Wii, Beanbags, seats, Sofas. Also, the speakers’ pods were at this area. Also, there weren’t many giveaways, only t-shirts at the end of every day, and a couple of Google-branded mugs during the sessions. No attendee-kit, only a notebook and a pen on the seats during sessions.

The main organizer/host of the whole event is a French guy called Sebastian. He is a very lively person; probably most of the attendees will remember him and G-Egypt as synonyms (especially the ones not familiar with Google, before the event).

The event has a major drawback is that on every single day of the three day, the schedule wasn't progressing as planned. Also, the sessions were too short. Probably those were a couple of the main reasons why most of the sessions were too simple as most of them had to wrap up too soon.

 

Let me know how did G-Egypt went with you?

Saturday, November 27, 2010

Quote of the Moment

ليت الكلاب لنا كانت مجـاورة               وليتنا لا نرى مما نـرى أحـدا
إن الكلاب لتهتدي في مواطنهـا             والخلق ليس بهاد شرهـم أبـدا
فاهرب بنفسك واستأنس بوحدتها           تبقى سعيداً إذا ما كنت منفـرداً


الإمام الشافعي

Quote of the Moment

“Procrastination is my sin. It brings me naught but sorrow. I know that I should stop it. In fact, I will – tomorrow!” – Gloria Pitzer

Wednesday, November 17, 2010

Power to the people!

Earlier this week, I posted about Vodafone Ad showing a distorted version of Abbas Ibn Fernas (check it here). Finally today, Vodafone issued an apology on their Facebook page. Not exactly what I was hoping for, but they are promising to stop airing it on TV, too, soon (I won't listen to the "conspiracy theory" roaming in my head now).

Some people suggest that: nobody really watches ads on TV any more. But I'm kind of reluctant to accept it. Many "regular" people, who aren't familiar with Twitter, YouTube, Facebook, etc (my dad, & granddad generation, also, people with less education/social status) usually depend heavily on TV as their main source of entertainment.

One last thing, I just realized I didn't publish an important link on the last post, which was really the main pillar behind the campaign, this is vodafly.tumblr.com. Actually I'm very eager to use tumblr for similar stuff, it allows great collaboration for similar usages.

THANKS FOR STANDING TOGETHER, GUYS!!

Saturday, November 13, 2010

Vodafone Egypt #FAIL!!

Today I came a across a video shared by @MostafaNageeb on Facebook. The video is a part of Vodafone ISP ads campaign, the one with the three guys from “سمير و شهير و بهير”, the movie. I didn’t watch the movie, and I’m a (kind of) loyal customer of Vodafone Egypt, but I find the video pretty offending and ignorant too.

The video show Abbas Ibn Firnas, [a polymath: an inventor, engineer, aviator, physician, poet, and musician], as a maniac who would throw oneself over the edge of a cliff just for fun, mistaking him for the Greek fable of Daedalus and his son Icarus.

After sharing the video with a couple of links about who is really Abbas Ibn Firnas, and reading a couple of comments on my post on Facebook, I realized that some people were really anxious that they filed complaints to Vodafone Egypt about it on their Customer service complaints page, even more: some complained on the phone! The reply was: it depends on the volume of feedback they get, whether they will take it down or not. On YouTube, Vodafone replies (through the comments) is pretty mild.

Already, the ad on YouTube is getting lots of dislikes, so if you can, add yours too, there. If you find it that irritating, you might file a complaint too (find the links below).

One last note, Abbas didn’t get killed from that experiment!!

 

UPDATE (14-15/11/2010):

The ad video I mentioned above (which was "disliked" a lot on YouTube, also had many negative comments), was removed earlier today (14/11/2010) which made may people cheer about it. Only to find it republished under another name (Browser), a couple of hours later.

I was starting to feel that people were (kind of) exaggerating about the ad (even thought about re-blogging about it). But, now, that feels pretty sneaky of Vodafone, as if the people's feedback doesn't really matter, why are you doing ads for in the first place!? More over, were the marketing guys thinking that the (angry) users won't find out they did the republish!? Dah!?

 

UPDATE (17/11/2010):

We almost made it!! Read this post about it..

 

References:

The second ad republished, Browser [Arabic]

A video about Ibn Firnas [Arabic]

Wikipedia page about Ibn Firnas [English]

Vodafone Customer Service [English Complaints page]

Vodafone Customer Service [Arabic Complaints page]

Monday, October 25, 2010

About #ArabNetMe, #EgyITevent and similar stuff!

Was there pretty late (around 1.25hrs late), traffic was awful

I met a lot of people @NohaMahmoud @MGhoz @maha_ashour @Salma_ts2al @AhmedMoneim @RamyMahrous @MostafaNageeb @mostafasiraj

I suffered a bad headache so if I wasn't that nice, please pardon me

I came across many people who seemed (twitter familiar) but due to my grumpy attitude, I was too shy to ask them if they were who I thought they were (@3GFalcon, @a_monem).

Saw @AhmedYahia face-to-face for the first time but again I was too lame.

Had a brief discussion with @AhmedMoneim about (what they decided to "hashtag" as) #EgyITevent, (aka Limousine Gatherings)

Saw @remon_z for a sec before he disappeared!

Was planning on travelling but had to stay for urgent stuff at work that just came up, a couple of min before I leave!

As usual (saw it twice till now) @ZiadAly embarrassed himself by asking the audience to raise their hands if they used or knew about his latest startup but a pretty small number of people raised their hands.

Someone was sarcastically talking about the analogy between @kanaafa (Irish I think?) being an investor here in Egypt & a typical Egyptian going to invest in an even less developed country than Egypt (if that is ever possible!). Though, I find what he did pretty brilliant, the note was quite funny on the spot, though!

The typical idea in my head of a digital media marketer (like .digitalrepublic CEO?) is quite the "showy" extrovert type of people. On the extremely unexpected side, Karim? was pretty introvert not talking or even giving context to data he was showing us (on a discussion panel!). Yet the data was pretty useful, but needed much accompanied talk, insights before and after. They could have become something like @HansRosling talks if done well.

Monday, September 13, 2010

Do people in non-English-speaking countries code in English?

I was reading a question with the same name on Stack-Exchange Beta site for Non-programmer-related questions (aka Programmers) when I came across this answer posted by a (probably Ukrainian) developer named Igor.

Accompanied by an earlier attempt by a colleague at work to write an enum in Arabic, I tried to write this piece of code:

Strangely enough it compiled and even ran showing the expected output (10)!! Note, the order above of the 2nd & 3rd line is mingled due to RTL issues in Gist. Visual Studio will show it in the right order (or at least, a more readable order for me, copy it & past it in your IDE to know how it looks).

Off course, I’m pretty convinced that this isn’t the best practice you should follow, (check my answer to the same question). Yet, I find this really hilarious! As a matter of fact, I took the claim that it’s bad practice too much for granted to the extent that I’ve never even tired to write such a strange piece of code :D

Disclaimer

All the opinions expressed on this blog are my own and don't necessarily represent my employer's positions, strategies or opinions.