<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-9211325913345206620</id><updated>2011-12-29T21:25:05.511+02:00</updated><category term='C++'/><category term='Reversing'/><category term='C#'/><category term='TDD'/><category term='Git'/><category term='BDD'/><category term='Linux'/><category term='SPICE'/><category term='Projects'/><category term='Rails'/><category term='.Net'/><category term='Win32'/><category term='Tools'/><category term='Misc'/><category term='VS'/><category term='Design'/><category term='vim'/><category term='Tips'/><category term='GameDev'/><category term='Security'/><category term='Unit Testing'/><category term='Stupid Mistakes'/><title type='text'>Developer Diaries</title><subtitle type='html'>Humble Experiences in Computer World</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://kariem2k.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://kariem2k.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Karim Ahmed</name><uri>http://www.blogger.com/profile/15607260786211222497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>58</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-9211325913345206620.post-1820236772924502244</id><published>2011-12-18T22:22:00.001+02:00</published><updated>2011-12-18T22:22:06.065+02:00</updated><title type='text'>Trying to use kanban as a lazy procrastinator</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;First of all i learned the word "Procrastinator" from Mike Elgan's blog post&amp;nbsp;&lt;a href="https://plus.google.com/113117251731252114390/posts/VzaoETVvqCw"&gt;The ultimate productivity guide for lazy procrastinators (like me)!&lt;/a&gt;. Thanks Mike :).&lt;br /&gt;&lt;br /&gt;I have been trying to adopt a method to at least organize my programming tasks and not my personal life tasks, my main problem is that i am&amp;nbsp;easily&amp;nbsp;get distracted with losing focus and interest in tasks in hand, that makes me multitask in many tasks as possible.&lt;br /&gt;&lt;br /&gt;So i thought of trying to use some agile methodologies ideas like Scrum, but i really did not find things that are suitable for my needs because i think scrum's main concerns are release management and team management. also i found that kanban with its less constrains is mostly concerned with flow of tasks and how can make it as smooth as possible, and i found it can be a perfect match for me.&lt;br /&gt;&lt;br /&gt;I will do it&amp;nbsp;first&amp;nbsp;for my personal pet projects. I will divide my project into user stories and i will be committed for completing the user story from start to end, &amp;nbsp;but for my kanban board i will limit my WIP stories in the DOING column to 2 or 3 for a start, so i have some freedom for my "lose of interest" thing :) but without losing total control of that.&lt;br /&gt;&lt;br /&gt;What is your opinion?, any one tried that?&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9211325913345206620-1820236772924502244?l=kariem2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kariem2k.blogspot.com/feeds/1820236772924502244/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kariem2k.blogspot.com/2011/12/trying-to-use-kanban-as-lazy.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/1820236772924502244'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/1820236772924502244'/><link rel='alternate' type='text/html' href='http://kariem2k.blogspot.com/2011/12/trying-to-use-kanban-as-lazy.html' title='Trying to use kanban as a lazy procrastinator'/><author><name>Karim Ahmed</name><uri>http://www.blogger.com/profile/15607260786211222497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9211325913345206620.post-5380974927905513096</id><published>2011-09-25T11:11:00.000+02:00</published><updated>2011-11-05T14:53:08.168+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SPICE'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><title type='text'>Very simple ngspice circuit profiling framework using Google Perf Tools</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;I am trying to make some speedups in &lt;a href="http://ngspice.sourceforge.net/"&gt;Ngspice&lt;/a&gt; the open source circuit simulator using CUDA and the GPU. I needed some profiling so i can determine which parts of Ngspice that have potential speed up and parallelization.&lt;br /&gt;&lt;br /&gt;I used &lt;a href="http://code.google.com/p/google-perftools/"&gt;Google Perf Tools&lt;/a&gt; because it is really fast compared to &lt;a href="http://valgrind.org/"&gt;Valgrind &lt;/a&gt;for example,&amp;nbsp;despite&amp;nbsp;being a Valgrind fan but i needed fast profiling because SPICE is very processing intensive.&lt;br /&gt;&lt;br /&gt;Here is a very simple shell script that runs ngspice on every circuit in "circuits" directory and spits callgrind format to "profiling_info" directory. I used some of&amp;nbsp;&lt;em style="background-color: white; font-family: Arial, Helvetica, sans-serif; font-size: 16px;"&gt;CircuitSim90 circuits &amp;amp;&amp;nbsp;&lt;a href="http://www.intusoft.com/models/MCNC.zip"&gt;MCNC&lt;/a&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a href="https://github.com/kariem2k/spice-benchmarks"&gt;https://github.com/kariem2k/spice-benchmarks&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;To use it you should compile Ngspice for google profiler, so install google perf tools, and compile Ngspice using -lprofiler&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;./configure LIBS=-lprofiler&lt;/blockquote&gt;That script is for made on Ubuntu 11.04, the only difference for other distros will be the google profiler package and executable names.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;sudo apt-get install&amp;nbsp;libgoogle-perftools0&amp;nbsp;libgoogle-perftools0-dev google-perftools0&amp;nbsp;&lt;/blockquote&gt;&lt;br /&gt;If any one has a suggestion please feel free to tell me about it, also if anybody has a netlist for a big MOSFET circuit (1000+ MOSFETs) please tell me about it.&lt;br /&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9211325913345206620-5380974927905513096?l=kariem2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kariem2k.blogspot.com/feeds/5380974927905513096/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kariem2k.blogspot.com/2011/09/very-simple-ngspice-circuit-profiling.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/5380974927905513096'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/5380974927905513096'/><link rel='alternate' type='text/html' href='http://kariem2k.blogspot.com/2011/09/very-simple-ngspice-circuit-profiling.html' title='Very simple ngspice circuit profiling framework using Google Perf Tools'/><author><name>Karim Ahmed</name><uri>http://www.blogger.com/profile/15607260786211222497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9211325913345206620.post-7157266815993273907</id><published>2011-06-23T20:01:00.001+02:00</published><updated>2011-06-23T20:02:20.079+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='Rails'/><title type='text'>sanitize_sql and dynamic select in ActiveRecord Relation in Rails 3</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;I needed to select a calculated field based on an outer parameter passed to the select function, and of course with protection of sql injection.&lt;br /&gt;&lt;br /&gt;Something like this:&lt;br /&gt;&lt;pre class='brush: ruby'&gt;Word.select(['name,count(*) AS cnt,(LOWER(name) = ?) AS is_search_word',params[:search]])&lt;br /&gt;&lt;/pre&gt;&lt;blockquote&gt;Where the '?' will be given outside the SQL.&lt;/blockquote&gt;After reading a bit in the &amp;nbsp;"ActiveRecord::QueryMethods" module, i found that when calling where() with an array they call sanitize_sql on the parameters.&lt;br /&gt;&lt;br /&gt;so the correct version:&lt;br /&gt;&lt;pre class='brush: ruby'&gt;Word.select(sanitize_sql(['name,count(*) AS cnt,(LOWER(name) = ?) AS is_search_word',params[:search]]))&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;I find&amp;nbsp;sanitize_sql &amp;nbsp;is very useful since you can pass a partial statement using that method and it will sanitize it.&amp;nbsp;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9211325913345206620-7157266815993273907?l=kariem2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kariem2k.blogspot.com/feeds/7157266815993273907/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kariem2k.blogspot.com/2011/06/sanitizesql-and-dynamic-select-call.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/7157266815993273907'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/7157266815993273907'/><link rel='alternate' type='text/html' href='http://kariem2k.blogspot.com/2011/06/sanitizesql-and-dynamic-select-call.html' title='sanitize_sql and dynamic select in ActiveRecord Relation in Rails 3'/><author><name>Karim Ahmed</name><uri>http://www.blogger.com/profile/15607260786211222497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9211325913345206620.post-920231016427410281</id><published>2011-06-09T00:39:00.000+02:00</published><updated>2011-06-09T00:39:11.544+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='Rails'/><title type='text'>Thinking Sphinx and Delta Indexing on production</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;I had some problems when using delta indexing, if you don't have any problems in permissions and you don't have delta indexing:&lt;br /&gt;&lt;br /&gt;&lt;ul style="text-align: left;"&gt;&lt;li&gt;I have unicorn and nginx setup, i had to add bin_path: '/usr/bin' to my sphinx.yml, because my sphinx tools are in /usr/bin.&lt;/li&gt;&lt;li&gt;In production always restart unicorn after changes, or any other way to reload the cache, so when doing changes to the model like adding delta property to the model, you have to restart unicorn.&lt;/li&gt;&lt;li&gt;Any existing entities in the db will not indexed when enabling delta indexing when doing ts:rebuild, you must update_all('delta=t') and rebuilding.&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;Final thing when you are doing update_all, your delta index won't get updated, because before_save won't be called, You have to do the following:&lt;/div&gt;&lt;div&gt;&lt;pre class="brush: ruby"&gt;&amp;nbsp;Entity.update_all(["myattribute = ?,delta = ?", false,true], :id =&amp;gt;ids)&lt;br /&gt;&amp;nbsp;Entity.index_delta&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9211325913345206620-920231016427410281?l=kariem2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kariem2k.blogspot.com/feeds/920231016427410281/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kariem2k.blogspot.com/2011/06/thinking-sphinx-and-delta-indexing-on.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/920231016427410281'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/920231016427410281'/><link rel='alternate' type='text/html' href='http://kariem2k.blogspot.com/2011/06/thinking-sphinx-and-delta-indexing-on.html' title='Thinking Sphinx and Delta Indexing on production'/><author><name>Karim Ahmed</name><uri>http://www.blogger.com/profile/15607260786211222497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9211325913345206620.post-6524713672132942014</id><published>2011-06-04T20:59:00.003+02:00</published><updated>2011-06-05T11:39:24.930+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Rails'/><title type='text'>Sphinx &amp; Thinking Sphinx</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;I needed a Full-Text Search engine for my rails app, and i found out that Sphinx is great for my needs (and being from Egypt is another reason haha).&lt;br /&gt;&lt;br /&gt;I was struggling at first in understanding how i combine both my sql queries and my full text searching data, but it appears that i don't need that.&amp;nbsp;Now&amp;nbsp;I just thinks of Sphinx index as a simple Document Database that i store all my needed data in it and just query it for my needs, so i can now do all queries i want and just cache the results into sphinx, the index now has very complex calculated values based on complex queries i was doing at request time, but now i do them only in update time so the retreival now is very fast.&lt;br /&gt;&lt;br /&gt;like for example, adding these simple index attributes:&lt;br /&gt;popular =&amp;gt; &amp;nbsp;"ABS(up_votes - down_votes) &amp;gt; 500"&lt;br /&gt;first_char =&amp;gt;&amp;nbsp;"upper(substring(word from 1 for 1))"&lt;br /&gt;has 'CRC32(LOWER(word))',:type =&amp;gt; :integer, :as =&amp;gt; :word_hash &amp;nbsp;(for group_by)&lt;br /&gt;&lt;br /&gt;What i really miss in Thinking Sphinx, the&amp;nbsp;ability&amp;nbsp;to define an index from an arbitrary query, and the fluent syntax of Arel in creating search.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9211325913345206620-6524713672132942014?l=kariem2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kariem2k.blogspot.com/feeds/6524713672132942014/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kariem2k.blogspot.com/2011/06/sphinx-thinking-sphinx.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/6524713672132942014'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/6524713672132942014'/><link rel='alternate' type='text/html' href='http://kariem2k.blogspot.com/2011/06/sphinx-thinking-sphinx.html' title='Sphinx &amp; Thinking Sphinx'/><author><name>Karim Ahmed</name><uri>http://www.blogger.com/profile/15607260786211222497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9211325913345206620.post-8494384057681502518</id><published>2011-05-31T22:07:00.000+02:00</published><updated>2011-05-31T22:07:51.927+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Stupid Mistakes'/><category scheme='http://www.blogger.com/atom/ns#' term='Rails'/><title type='text'>"no such file to load -- bundler/setup" when running rake on linux</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;I am deploying a rails app to amazon ec2 and after deploying everything, and when running rake command i got that error:&lt;br /&gt;&lt;blockquote&gt;"no such file to load -- bundler/setup"&lt;/blockquote&gt;After sometime of installing, uninstalling and reinstalling of gems, i got the idea that maybe that rake is looking to a different gems location than bundler does. so i did&lt;br /&gt;&lt;blockquote&gt;&amp;nbsp;which rake&amp;nbsp;&lt;/blockquote&gt;I got &amp;nbsp;/usr/local/bin/rake&lt;br /&gt;&lt;br /&gt;and then doing which bundler i got /usr/local/bundler.&lt;br /&gt;&lt;br /&gt;I have two rakes actually one is in the /local/ and the other in the bin directly.&lt;br /&gt;&lt;br /&gt;What i did is recompiling ruby using&lt;br /&gt;&lt;blockquote&gt;./configure --prefix /usr&lt;/blockquote&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9211325913345206620-8494384057681502518?l=kariem2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kariem2k.blogspot.com/feeds/8494384057681502518/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kariem2k.blogspot.com/2011/05/no-such-file-to-load-bundlersetup-when.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/8494384057681502518'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/8494384057681502518'/><link rel='alternate' type='text/html' href='http://kariem2k.blogspot.com/2011/05/no-such-file-to-load-bundlersetup-when.html' title='&quot;no such file to load -- bundler/setup&quot; when running rake on linux'/><author><name>Karim Ahmed</name><uri>http://www.blogger.com/profile/15607260786211222497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9211325913345206620.post-7025844227741666653</id><published>2011-05-05T03:30:00.000+02:00</published><updated>2011-05-05T03:30:28.696+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><title type='text'>Delicious sold and a tip for importing to Google bookmarks</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;if you did not hear the awesome Delicious site is sold, so i decided to complete my Google cloud by using &lt;a href="https://www.google.com/bookmarks"&gt;Google Bookmarks&lt;/a&gt;, fortunately Google just enabled an opensource script hosted on their app engine to import delicious bookmarks, you will find a link on the top when you login to &lt;a href="https://www.google.com/bookmarks"&gt;Google Bookmarks&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;The script logins to your delicious account and imports your book marks to google, it worked great but it had one minor setback, it is case-sensitive when it comes to Tags(or Labels), so if i have two entries in Delicious that are tagged with "Design" and "design", google will interpret them as two different labels.&lt;br /&gt;&lt;br /&gt;What i did to solve this:&lt;br /&gt;&lt;br /&gt;1- &lt;a href="https://secure.delicious.com/settings/bookmarks/export"&gt;Exported&lt;/a&gt; the Delicious tags to an html file.&lt;br /&gt;2- using Vim to lower case all of the tag names in the exported file:&lt;br /&gt;&lt;blockquote&gt;%s/TAGS="\(.*\)"/TAGS="\L\1"/g&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/blockquote&gt;3- Deleted all of the bookmarks in Delicious.&lt;br /&gt;4- &lt;a href="https://secure.delicious.com/settings/bookmarks/import"&gt;Imported&lt;/a&gt; the modified file again into Delicious.&lt;br /&gt;5- &lt;a href="https://www.google.com/bookmarks/deliciousimport"&gt;Imported&lt;/a&gt; Delicious Bookmarks into Google.&lt;br /&gt;&lt;br /&gt;I wish the import script has the functionality of importing from html file, or doing some processing on tag names, i considered modifying, deploying, and making a pull request but it is 3 am now and the kids are crying :), maybe later isA.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9211325913345206620-7025844227741666653?l=kariem2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kariem2k.blogspot.com/feeds/7025844227741666653/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kariem2k.blogspot.com/2011/05/delicious-sold-and-tip-for-importing-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/7025844227741666653'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/7025844227741666653'/><link rel='alternate' type='text/html' href='http://kariem2k.blogspot.com/2011/05/delicious-sold-and-tip-for-importing-to.html' title='Delicious sold and a tip for importing to Google bookmarks'/><author><name>Karim Ahmed</name><uri>http://www.blogger.com/profile/15607260786211222497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9211325913345206620.post-4070371220339869558</id><published>2011-05-04T20:02:00.001+02:00</published><updated>2011-05-04T20:02:00.635+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><title type='text'>Negative Lookahead in Visual Studio Regular Expressions</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;If you want to do negative Regex Lookahead in VS Find functionality, use:&lt;br /&gt;&lt;blockquote&gt;~(your_string&amp;nbsp;)(.*)&lt;/blockquote&gt;&lt;br /&gt;That will match everything, that does not contain your_string.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9211325913345206620-4070371220339869558?l=kariem2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kariem2k.blogspot.com/feeds/4070371220339869558/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kariem2k.blogspot.com/2011/05/negative-lookahead-in-visual-studio.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/4070371220339869558'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/4070371220339869558'/><link rel='alternate' type='text/html' href='http://kariem2k.blogspot.com/2011/05/negative-lookahead-in-visual-studio.html' title='Negative Lookahead in Visual Studio Regular Expressions'/><author><name>Karim Ahmed</name><uri>http://www.blogger.com/profile/15607260786211222497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9211325913345206620.post-335936388222410623</id><published>2011-04-28T22:35:00.001+02:00</published><updated>2011-04-28T22:35:00.119+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>The best guide to POCO C++</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;I have used &lt;a href="http://pocoproject.org/"&gt;POCO C++ Librarie&lt;/a&gt;s in several projects till now, and i have to say that i totally loving it, it provides the simplicity and high level functionality that frameworks like .Net/JDK  provide.&lt;br /&gt;&lt;br /&gt;POCO project provides introductory slides to know the outlines of how you would use POCO libraries, but it is not much detailed and of course you will need much more info, the best place i found to get the implementation details you will need is the "Unit Tests" in POCO's source code, it is really helpful. I love automated tests :)&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9211325913345206620-335936388222410623?l=kariem2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kariem2k.blogspot.com/feeds/335936388222410623/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kariem2k.blogspot.com/2010/10/best-guide-to-poco-c.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/335936388222410623'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/335936388222410623'/><link rel='alternate' type='text/html' href='http://kariem2k.blogspot.com/2010/10/best-guide-to-poco-c.html' title='The best guide to POCO C++'/><author><name>Karim Ahmed</name><uri>http://www.blogger.com/profile/15607260786211222497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9211325913345206620.post-2814732923160950166</id><published>2011-04-28T22:00:00.010+02:00</published><updated>2011-04-28T22:00:04.138+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Rails'/><title type='text'>Simple RTL Rails Helper</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Some times you will need to reorder html elements according to the local, many things can handled using CSS but sometimes there is no way to make the elements displayed in the reverse order without doing that in the HTML itself, you can add that helper to your helpers folder.&lt;br /&gt;&lt;br /&gt;&lt;pre class='brush: ruby'&gt;module RtlHelper&lt;br /&gt;&amp;nbsp; class OrderElementsBuilder&lt;br /&gt;&amp;nbsp; &amp;nbsp; DIRECTIONS = [:rtl,:ltr]&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; def initialize(helper,direction)&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; @elements = []&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; @helper = helper&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; @direction = DIRECTIONS.include?(direction) ? direction : :ltr&lt;br /&gt;&amp;nbsp; &amp;nbsp; end&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; def method_missing(method,*args, &amp;amp;block)&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; options = args[0] || {}&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; @elements &amp;lt;&amp;lt; (@helper.content_tag(method,nil, options) do&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; @helper.capture(&amp;amp;block)&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; end)&lt;br /&gt;&amp;nbsp; &amp;nbsp; end&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; def to_html&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; elements = (@direction == :rtl) ? @elements.reverse : @elements&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; elements.join("\n").html_safe&lt;br /&gt;&amp;nbsp; &amp;nbsp; end&lt;br /&gt;&amp;nbsp; end&lt;br /&gt;&lt;br /&gt;&amp;nbsp; def order_elements(direction=nil)&lt;br /&gt;&amp;nbsp; &amp;nbsp; b = OrderElementsBuilder.new(self,direction)&lt;br /&gt;&amp;nbsp; &amp;nbsp; yield b&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; b.to_html.html_safe&lt;br /&gt;&amp;nbsp; end&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;#And this will go to your ERB (you can pass either :rtl or :ltr&lt;br /&gt;&lt;br /&gt;&amp;lt;div id=&amp;#39;headermenu-links&amp;#39;&amp;gt;&lt;br /&gt;          &amp;lt;ul&amp;gt;&lt;br /&gt;            &amp;lt;%= order_elements :rtl do |o| %&amp;gt;&lt;br /&gt;              &amp;lt;% o.li :class =&amp;gt; &amp;#39;test_class&amp;#39; do -%&amp;gt;&lt;br /&gt;                &amp;lt;%= link_to t(&amp;#39;mainmenu.home&amp;#39;), root_path %&amp;gt; &lt;br /&gt;              &amp;lt;% end -%&amp;gt;&lt;br /&gt;              &amp;lt;% o.li :class =&amp;gt; &amp;#39;test_class&amp;#39; do -%&amp;gt;&lt;br /&gt;                &amp;lt;%= link_to t(&amp;#39;mainmenu.new_word&amp;#39;), new_word_path %&amp;gt; &lt;br /&gt;              &amp;lt;% end -%&amp;gt;&lt;br /&gt;              &amp;lt;% o.li :class =&amp;gt; &amp;#39;test_class&amp;#39; do -%&amp;gt;&lt;br /&gt;                &amp;lt;%= link_to t(&amp;#39;mainmenu.manage_new_words&amp;#39;), admin_words_path %&amp;gt; &lt;br /&gt;              &amp;lt;% end -%&amp;gt;&lt;br /&gt;            &amp;lt;% end -%&amp;gt;&lt;br /&gt;          &amp;lt;/ul&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Of course you can do that using javascript, but i &amp;nbsp;think the effect of reordering elements specially for large pages will be quirky.&lt;br /&gt;&lt;br /&gt;I still think that you should use CSS, except when you have too do html reordering.&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9211325913345206620-2814732923160950166?l=kariem2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kariem2k.blogspot.com/feeds/2814732923160950166/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kariem2k.blogspot.com/2011/04/simple-rtl-rails-helper.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/2814732923160950166'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/2814732923160950166'/><link rel='alternate' type='text/html' href='http://kariem2k.blogspot.com/2011/04/simple-rtl-rails-helper.html' title='Simple RTL Rails Helper'/><author><name>Karim Ahmed</name><uri>http://www.blogger.com/profile/15607260786211222497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9211325913345206620.post-429333623190803430</id><published>2011-04-28T21:34:00.016+02:00</published><updated>2011-05-05T03:36:48.417+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><title type='text'>Getting output of a step in Visual Build</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;I wanted to get vault history from Visual Build between to labels, VisualBuild has out-of-the-box support for Vault it has the command "history", but it does not have any build in way to provide the start label and end label,&amp;nbsp;fortunately&amp;nbsp;they provide "Additional Command-line options", so adding the following will give the option to specify the begin label:&lt;br /&gt;&lt;blockquote&gt;-beginlabel "%LAST_LABEL_NAME%"&lt;/blockquote&gt;Second problem, is that it only lists that in the output pane, after some searching i found a system macro to&amp;nbsp;retrieve&amp;nbsp;the last step output.&lt;br /&gt;&lt;blockquote&gt;%LASTSTEP_OUTPUT%&lt;/blockquote&gt;&lt;br /&gt;by doing the following vbscript step, you can&amp;nbsp;retrieve&amp;nbsp;history info from vault&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: vb"&gt;Dim regEx, Match, Matches, Lines &lt;br /&gt;Set regEx = New RegExp&lt;br /&gt;strLines = Application.Macros(vbldMacroSystem).Item("LASTSTEP_OUTPUT").Value&lt;br /&gt;&lt;br /&gt;Lines = split(strLines,vbCrlf)&lt;br /&gt; &lt;br /&gt;For Each strLine in Lines&lt;br /&gt; regEx.Pattern = "&amp;lt;item txid=\"".*\"" date=\""(.*)\"" name=\""(.*)\"" type=\"".*\"" typeName=\""(.*)\"" version=\"".*\"" objverid=\"".*\"" user=\""(.*)\"" comment=\""(.*)\"" actionString=\""(.*)\"" \/&amp;gt;"&lt;br /&gt; strLine = Replace(strLine,"&amp;amp;quot;", "'")&lt;br /&gt; strLine = Replace(strLine,"&amp;amp;#xA;", """")&lt;br /&gt; strLine = Replace(strLine,"&amp;amp;#xD;", "")&lt;br /&gt; Set Matches = regEx.Execute(strLine)&lt;br /&gt; For Each Match in Matches&lt;br /&gt;  strDate = Match.SubMatches(0)&lt;br /&gt;  strName = Match.SubMatches(1)&lt;br /&gt;  strTypeName = Match.SubMatches(2)&lt;br /&gt;  strUser = Match.SubMatches(3)&lt;br /&gt;  strComment = Match.SubMatches(4)&lt;br /&gt;  strActionString = Match.SubMatches(5)&lt;br /&gt; Next&lt;br /&gt;Next&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9211325913345206620-429333623190803430?l=kariem2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kariem2k.blogspot.com/feeds/429333623190803430/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kariem2k.blogspot.com/2011/04/getting-output-of-step-in-visualbuild.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/429333623190803430'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/429333623190803430'/><link rel='alternate' type='text/html' href='http://kariem2k.blogspot.com/2011/04/getting-output-of-step-in-visualbuild.html' title='Getting output of a step in Visual Build'/><author><name>Karim Ahmed</name><uri>http://www.blogger.com/profile/15607260786211222497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9211325913345206620.post-3967198582051287989</id><published>2011-04-20T00:24:00.001+02:00</published><updated>2011-04-20T00:24:29.805+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='.Net'/><title type='text'>Be aware of tiniest creatures - Tooltip</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;br /&gt;While trying to find memory leaks in a fat .Net application, i encountered one of the biggest ones. caused by that small thing called "Tooltip".&lt;br /&gt;&lt;br /&gt;The tooltips that are created inside user controls and "SetToolTip" is called, the tooltip holds a reference for the user control and prevents it from GC.&lt;br /&gt;&lt;br /&gt;I discovered it with .Net Profiler, after few times of ignoring it that the tooltip is the cause of leaking the parent user control.&lt;br /&gt;&lt;br /&gt;It is a bug in .Net which i think it existed from 1.1.&lt;br /&gt;&lt;br /&gt;There is some solutions on the internet, like:&lt;br /&gt;&lt;pre class="brush:csharp"&gt;&amp;nbsp;tooltip.RemoveAll()&lt;br /&gt;&amp;nbsp;tooltip.SetToolTip(mycontrol,"Text")&lt;br /&gt;//OR&lt;br /&gt;&amp;nbsp;tooltip.SetToolTip(mycontrol,"")&lt;br /&gt;&amp;nbsp;tooltip.SetToolTip(mycontrol,"Text")&lt;br /&gt;&lt;/pre&gt;But the problem here is that the designer generates code that does not involve the reset call, so you have to do the setting of the tooltip text in your code instead of the designer.&lt;br /&gt;&lt;br /&gt;The other solution, is to do the RemoveAll and then explicit disposal of the ToolTip while you are disposing the form or the User Control.&lt;br /&gt;&lt;br /&gt;Luckily i have a base form form for all of the forms of the application, i have added a code there to recursively search for all of the tooltips inside the form or the child user controls, and dispose it while disposing the form.&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9211325913345206620-3967198582051287989?l=kariem2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kariem2k.blogspot.com/feeds/3967198582051287989/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kariem2k.blogspot.com/2011/04/be-aware-of-tiniest-creatures-tooltip.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/3967198582051287989'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/3967198582051287989'/><link rel='alternate' type='text/html' href='http://kariem2k.blogspot.com/2011/04/be-aware-of-tiniest-creatures-tooltip.html' title='Be aware of tiniest creatures - Tooltip'/><author><name>Karim Ahmed</name><uri>http://www.blogger.com/profile/15607260786211222497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9211325913345206620.post-1483172124605963288</id><published>2011-04-19T21:30:00.001+02:00</published><updated>2011-09-25T11:29:59.827+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='GameDev'/><title type='text'>I LÖVE Lua</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;I am creating a small 2D game for fun, i want to try that out on OpenGL ES on Anroid or IPhone, but i wanted first to do some prototyping.&lt;br /&gt;&lt;br /&gt;I considered using python, but i wanted something light weight and something i can run any place without installing a runtime, so i chose Lua (beside that i know Lua well and i don't want to use .Net :D)&lt;br /&gt;&lt;br /&gt;I am using a simple engine called &lt;a href="http://love2d.org/"&gt;LÖVE&lt;/a&gt;, that provides basic graphics work and runtime environment for my Lua scripts, it is just 3 dlls and an exe.&lt;br /&gt;&lt;br /&gt;Every time i work with Lua i fell in love with it :D. It works very well and provides features that makes life a lot easier, You will feel the flexibility, you will feel like forming your own programming language/paradigm with another language. using tables and metatables you can do magic.&lt;br /&gt;&lt;br /&gt;One thing i don't like about LOVE is that it does not provide math functionality, like vectors and matrices, so i had to make my own classes (Although it was a good math refreshing experience :)).&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9211325913345206620-1483172124605963288?l=kariem2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kariem2k.blogspot.com/feeds/1483172124605963288/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kariem2k.blogspot.com/2011/04/i-love-lua.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/1483172124605963288'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/1483172124605963288'/><link rel='alternate' type='text/html' href='http://kariem2k.blogspot.com/2011/04/i-love-lua.html' title='I LÖVE Lua'/><author><name>Karim Ahmed</name><uri>http://www.blogger.com/profile/15607260786211222497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9211325913345206620.post-360619626916540553</id><published>2011-04-09T17:24:00.006+02:00</published><updated>2011-04-09T17:32:07.938+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Rails'/><title type='text'>Rails surrounding chunks of collection elements with a tag in erb</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Here is a little helper method to rendering chunks of inner tags and surrounding them with a tag.&lt;br /&gt;&lt;br /&gt;The following will surround chunks of 3 TDs with a TR.&lt;br /&gt;&lt;br /&gt;--Your erb file&lt;br /&gt;&lt;pre class='brush: rails'&gt;&amp;nbsp; &amp;lt;%= each_and_surround_every 3, @words, :tr do |word| %&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;lt;%= link_to word.word, word_path(word) %&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;lt;% end -%&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;--Helper module&lt;br /&gt;&lt;pre class='brush: ruby'&gt;&amp;nbsp;def each_and_surround_every(every, collection, tag_element,&amp;amp;block)&lt;br /&gt;&amp;nbsp; &amp;nbsp; ret = ''&lt;br /&gt;&amp;nbsp; &amp;nbsp; collection.each_slice(every) { |chunk|&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; ret &amp;lt;&amp;lt; (content_tag tag_element do&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; chunk.collect{|e|&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; capture(e,&amp;amp;block)&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }.join.html_safe&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; end)&lt;br /&gt;&amp;nbsp; &amp;nbsp; }&lt;br /&gt;&amp;nbsp; &amp;nbsp; ret.html_safe&lt;br /&gt;&amp;nbsp; end&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9211325913345206620-360619626916540553?l=kariem2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kariem2k.blogspot.com/feeds/360619626916540553/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kariem2k.blogspot.com/2011/04/rails-surrounding-chunks-of-collection.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/360619626916540553'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/360619626916540553'/><link rel='alternate' type='text/html' href='http://kariem2k.blogspot.com/2011/04/rails-surrounding-chunks-of-collection.html' title='Rails surrounding chunks of collection elements with a tag in erb'/><author><name>Karim Ahmed</name><uri>http://www.blogger.com/profile/15607260786211222497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9211325913345206620.post-564415127745601219</id><published>2011-03-23T23:56:00.002+02:00</published><updated>2011-09-25T11:31:02.524+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><title type='text'>VMWare guest tools not good with Arch &amp; problems switching to Virtual Box</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Maybe it is me but i could not find a good way to make archlinux work inside a Vmware VM and do something like shared folders, it cause the whole terminal to lockup when i use the mounted shared folder, also sharing the&amp;nbsp;physical&amp;nbsp;drive caused all sorts of problems.&lt;br /&gt;&lt;br /&gt;I decided to switch to VirtualBox but without reinstalling and reconfiguring Archlinux again, so i searched and found the nicest feature in VBox, it can use Virtual Disks from multiple formats including VMWare's.&lt;br /&gt;&lt;br /&gt;I created a new VM that uses VMWare's Disk that contains the configured Archlinux, and booted but i got hit by the following error:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;span class="Apple-style-span" style="color: #222222; font-family: sans-serif; font-size: 13px; line-height: 19px;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;pre style="border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; direction: ltr; font-family: monospace !important; font-size: 1em; font-style: normal; font-weight: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow-x: auto; overflow-y: auto; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 868px;"&gt;&lt;span class="Apple-style-span" style="color: #222222; font-family: sans-serif; font-size: 13px; line-height: 19px;"&gt;&lt;code style="display: inline-block; font-family: monospace !important; font-size: 1em; padding-bottom: 0.75em; padding-left: 0.75em; padding-right: 0.75em; padding-top: 0.75em; white-space: pre;"&gt;:: Starting udevd...&lt;br /&gt;done.&lt;br /&gt;Waiting 10 seconds for device /dev/disk/by-uuid/my uuid&lt;br /&gt;ERROR: Unable to determine major/minor number of root device '/dev/disk/by-uuid/my uuid'.&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/blockquote&gt;My first thought was the VBox new disk, has another UUID than the VMware, but that maybe wrong because the disks UUID probably made by fdisk and it is not bound to the atcual HD, but to make sure, i booted archlinux live cd and mounted /dev/sda1 which is the boot partition, and opened the grub/menu.lst.&lt;br /&gt;and changed the UUIDs to /dev/sda1..sda4, and tried to boot but it failed like&amp;nbsp;expected.&lt;br /&gt;&lt;a href="http://www.blogger.com/post-edit.g?blogID=9211325913345206620&amp;amp;postID=564415127745601219" uuid=""&gt;&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;So i had to go to the Gurus and search archlinux forums, and finally i have seen that wiki article:&lt;br /&gt;&lt;a href="https://wiki.archlinux.org/index.php/Install_from_Existing_Linux"&gt;"Install from Existing Linux"&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Summary to what i did from archlinux livecd(sda1 is my boot partition, sda3 is my root one):&lt;br /&gt;&lt;blockquote&gt;mkdir /mnt/root&lt;br /&gt;mount /dev/sda1 /boot&lt;br /&gt;mount /dev/sda3 /mnt/root&lt;br /&gt;mount -t proc proc&amp;nbsp;/mnt/root/proc&lt;br /&gt;mount -t sysfs sys&amp;nbsp;/mnt/root/sys&lt;br /&gt;mount -o bind /dev&amp;nbsp;/mnt/root/dev&lt;br /&gt;chroot&amp;nbsp;/mnt/root&lt;br /&gt;mkinitcpio -p kernel26&lt;/blockquote&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;Then i restarted the machine, and it loaded and found the sda* partitions now, great, but when the X server loaded i found all sorts of "Permission"s errors for my home dir, i suspected i have done anythings for my home partition, but to make sure i switched for the terminal interface, and tryed to "chown" something on my /home but i found something strange when i "ls" the /home it contains my "root" partition :D, so i went to "/etc/fstab" and found that i swapped the sda3 with sda4 as the mount points :$, i fixed that and restarted and all things back to normal.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9211325913345206620-564415127745601219?l=kariem2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kariem2k.blogspot.com/feeds/564415127745601219/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kariem2k.blogspot.com/2011/03/vmware-guest-tools-not-good-with-arch.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/564415127745601219'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/564415127745601219'/><link rel='alternate' type='text/html' href='http://kariem2k.blogspot.com/2011/03/vmware-guest-tools-not-good-with-arch.html' title='VMWare guest tools not good with Arch &amp; problems switching to Virtual Box'/><author><name>Karim Ahmed</name><uri>http://www.blogger.com/profile/15607260786211222497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9211325913345206620.post-4689125925005506111</id><published>2011-03-23T23:00:00.002+02:00</published><updated>2011-06-08T18:00:12.710+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='Misc'/><title type='text'>Kindle 3 3G in Egypt</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;I have got a kindle 3 3G this month, i have to say it is really really&amp;nbsp;awesome in every aspect, and it is the best present i have ever received :D. even PDFs of programming books in the landscape mode is quite readable and usable, unless you need a very big font which you will see the difference when&amp;nbsp;opening&amp;nbsp;a story in kindle format, but PDF support is&amp;nbsp;awesome&amp;nbsp;and very fast in loading and displaying big PDFs (the biggest i tried is about 100 Megs).&lt;br /&gt;&lt;br /&gt;As i suspected 3G is not supported in Egypt for browsing, but here is cool tip, at the time of this post, Wikipedia browsing is working on free Kindle 3G &amp;nbsp;in Egypt.&lt;br /&gt;&lt;br /&gt;Happy kindling :).&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9211325913345206620-4689125925005506111?l=kariem2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kariem2k.blogspot.com/feeds/4689125925005506111/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kariem2k.blogspot.com/2011/03/kindle-3-3g-in-egypt.html#comment-form' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/4689125925005506111'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/4689125925005506111'/><link rel='alternate' type='text/html' href='http://kariem2k.blogspot.com/2011/03/kindle-3-3g-in-egypt.html' title='Kindle 3 3G in Egypt'/><author><name>Karim Ahmed</name><uri>http://www.blogger.com/profile/15607260786211222497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9211325913345206620.post-2725520673847521319</id><published>2011-02-16T11:16:00.002+02:00</published><updated>2011-05-05T03:33:19.862+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tools'/><title type='text'>Actual scale of the devices</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Every day i find a new site with great ideas, and i feel sorry for myself for not finding a simple idea like that by myself to make. &lt;br /&gt;&lt;br /&gt;Anyway the site is called &lt;a href="http://www.pective.com/"&gt;Pective&lt;/a&gt;, and the idea of the site is simple, you can see what is the actual size of a gadget before buying it.&lt;br /&gt;&lt;br /&gt;While it is not perfect, because it is community driven, the users submit their images to the site, so not every device you need will not be on the site, but i like the idea alot.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9211325913345206620-2725520673847521319?l=kariem2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kariem2k.blogspot.com/feeds/2725520673847521319/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kariem2k.blogspot.com/2011/02/actual-scale-of-devices-site.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/2725520673847521319'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/2725520673847521319'/><link rel='alternate' type='text/html' href='http://kariem2k.blogspot.com/2011/02/actual-scale-of-devices-site.html' title='Actual scale of the devices'/><author><name>Karim Ahmed</name><uri>http://www.blogger.com/profile/15607260786211222497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9211325913345206620.post-1984645340180679043</id><published>2011-02-12T21:00:00.000+02:00</published><updated>2011-02-12T21:00:11.013+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='Stupid Mistakes'/><title type='text'>XUnit.Net Throws and Dynamic types</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;While playing with dynamic types in C# 4.0, specially overriding the functionality of DynamicObject, &amp;nbsp;i faced a strange thing (at least to me :)).&lt;br /&gt;&lt;pre class="brush: csharp"&gt;Assert.Throws&amp;lt;PropertyNameAlreadyRegistered&amp;gt;(() =&amp;gt; vm.Load(ExampleSimpleObjectWithDuplicatedProperty.GetObject()));&lt;br /&gt;&lt;/pre&gt;&lt;blockquote&gt;where "vm" is a dynamic object&lt;/blockquote&gt;Resulted to a call to "TryGetMember" in my DynamicObject&amp;nbsp;inherited&amp;nbsp;class, "Load" is not a property, it is a method, so calling TryGetMember means that the DLR is trying to get a value of a property not invoking a &amp;nbsp;method.&lt;br /&gt;&lt;br /&gt;I took the statement out of the lambda, and the Load method is called in a right way without going through TryGetMember, so i have looked at what Throws method takes as a parameter&amp;nbsp;and found out that it takes one of two types of delegates:&lt;br /&gt;Assert.ThrowsDelegate and&amp;nbsp;Assert.ThrowsDelegateWithReturn&lt;br /&gt;&lt;br /&gt;The compiler decided that my lambda&amp;nbsp;expression will return a value, and that caused a problem.&lt;br /&gt;&lt;br /&gt;So to fix that i did this (maybe there is another solution but i don't fully understand the problem yet, i will research more on that topic):&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: csharp"&gt;Assert.Throws&amp;lt;PropertyNameAlreadyRegistered&amp;gt;((Assert.ThrowsDelegate)(() =&amp;gt; vm.Load(ExampleSimpleObjectWithDuplicatedProperty.GetObject())));&lt;/pre&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9211325913345206620-1984645340180679043?l=kariem2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kariem2k.blogspot.com/feeds/1984645340180679043/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kariem2k.blogspot.com/2011/02/xunitnet-throws-and-dynamic-types.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/1984645340180679043'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/1984645340180679043'/><link rel='alternate' type='text/html' href='http://kariem2k.blogspot.com/2011/02/xunitnet-throws-and-dynamic-types.html' title='XUnit.Net Throws and Dynamic types'/><author><name>Karim Ahmed</name><uri>http://www.blogger.com/profile/15607260786211222497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9211325913345206620.post-7253549874798382886</id><published>2011-02-03T15:52:00.004+02:00</published><updated>2011-09-25T11:34:13.614+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Misc'/><title type='text'>Linux in the sky</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;While travelling with KLM on a Boeing&amp;nbsp;&lt;span class="Apple-style-span" style="font-family: Helvetica, Verdana, Arial, sans-serif;"&gt;&lt;span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;"&gt;777-200/200ER&amp;nbsp;Airplane, The multimedia screen kept turning black when opening any of the movies they provide, so i asked the very friendly flight attendant for a solution for this, he told me that he is going to reset the screen for me and we will check after 10 minutes.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Helvetica, Verdana, Arial, sans-serif;"&gt;&lt;span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;"&gt;He restarted the machine and a surprise came up &amp;lt;&lt;linux&amp;nbsp;kernel loading="" screen=""&gt;&amp;gt;. I got really excited and happy&lt;/linux&amp;nbsp;kernel&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; font-family: Helvetica, Verdana, Arial, sans-serif;"&gt;&amp;nbsp;-yes, that is a little bit nerdy :D-.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Helvetica, Verdana, Arial, sans-serif;"&gt;&lt;span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;"&gt;Anyway, one lesson i learned from that,&amp;nbsp;Linux&amp;nbsp;media players are not that stable in the sky like they are on earth :D.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9211325913345206620-7253549874798382886?l=kariem2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kariem2k.blogspot.com/feeds/7253549874798382886/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kariem2k.blogspot.com/2011/02/linux-in-sky.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/7253549874798382886'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/7253549874798382886'/><link rel='alternate' type='text/html' href='http://kariem2k.blogspot.com/2011/02/linux-in-sky.html' title='Linux in the sky'/><author><name>Karim Ahmed</name><uri>http://www.blogger.com/profile/15607260786211222497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9211325913345206620.post-8203042008082602040</id><published>2011-02-03T02:15:00.002+02:00</published><updated>2011-02-03T02:19:06.151+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='BDD'/><category scheme='http://www.blogger.com/atom/ns#' term='TDD'/><title type='text'>BDD with cucumber, it is all about high level behavior</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;br /&gt;I know that is mensioned thousnad times before, but i am telling a story for a little AHA moment for me :).&lt;br /&gt;&lt;br /&gt;Testing low level stuff should not be in the cucumber feature,&amp;nbsp;like doing paging as a part of a bigger scenario for listing some items (and paging is not the target for the feature. It is just&amp;nbsp;secondary&amp;nbsp;thing in the feature).&lt;br /&gt;&lt;br /&gt;I was doing testing for paging functionality in my cucumber features&lt;br /&gt;&lt;ul style="text-align: left;"&gt;&lt;li&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;I was testing if i have less than threshold items i should not see paging.&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;If i have more than the threshold items i should see paging AND i check how many pages and how many items each page has.&lt;/li&gt;&lt;/ul&gt;I got stroke by the idea, that i should not do that for two reasons:&lt;br /&gt;&lt;ul style="text-align: left;"&gt;&lt;li&gt;That is not a high level feature description, the High level feature would be "I should see paging" and that is it, and that will be important for scalability and changes in requirements (because less text with much&amp;nbsp;expressiveness&amp;nbsp;is always a good thing, Functional programming&amp;nbsp;Philosophy&amp;nbsp;:D).&lt;/li&gt;&lt;li&gt;Paging should be a reusable component. Testing its functionality should be in another context, and has its own specs and features, and i should not test or describe its behavior in my business logic features/specs/testing. Doing that would be a code smell for me because i either did not extract paging as a component and redoing it for every listing functionality or i am just writing useless and duplicate lines of code in my features.&lt;/li&gt;&lt;/ul&gt;However IMHO only a simple highlevel step like "I should see paging" should be included in a "Listing" feature, because in another "Listing" feature paging is not required, eg. "truncating the entries and displaying most recent only".&lt;br /&gt;&lt;br /&gt;Side note: Internet absense can be a good thing :). Due to the protests and problems in Egypt, the Internet is shutdown by the government for almost 4 days now. I found out that it can be very helpful for coming with your own conclusions without being affected by others opinions, instead of keeping to search the internet for other peoples opinions and experiances and then doing my own thinking, even that conclusions and points of view may be wrong but i think that can be healthy specially in topics that need sense and experiance (Like TDD/BDD and Design which IMHO is all about talent/sense,experiance, and some form of guide lines) than things that are mostly documented technical things (like calling what APIs for achieving a certain functionality).&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9211325913345206620-8203042008082602040?l=kariem2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kariem2k.blogspot.com/feeds/8203042008082602040/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kariem2k.blogspot.com/2011/02/bdd-with-cucumber-it-is-all-about-high.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/8203042008082602040'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/8203042008082602040'/><link rel='alternate' type='text/html' href='http://kariem2k.blogspot.com/2011/02/bdd-with-cucumber-it-is-all-about-high.html' title='BDD with cucumber, it is all about high level behavior'/><author><name>Karim Ahmed</name><uri>http://www.blogger.com/profile/15607260786211222497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9211325913345206620.post-7871341048023588302</id><published>2010-11-12T15:15:00.002+02:00</published><updated>2011-02-03T02:20:27.436+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='GameDev'/><title type='text'>Torque is going out of business unless there is a buyer</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Another great gaming company is going out of business (or selling), GarageGames (now TorquePower ) made an &lt;a href="http://www.torquepowered.com/community/blog/view/20495"&gt;announcement&lt;/a&gt; today about winding down operations, they provided a good quality game cheap engine (although many extensions and the major updates were not free, and IMHO that made a drop in marketing of torque&amp;nbsp;technologies), also the fierce&amp;nbsp;competition&amp;nbsp;they are facing from engines like UDK and Unity as well the OSS &amp;nbsp;was an element in their loss too.&lt;br /&gt;&lt;br /&gt;I have obtained my license to their first engine Torque3D 1.4- from 8 years ago in 2002, by making some security auditing&amp;nbsp;against&amp;nbsp;their site and when i notified them about the flaws they had, they&amp;nbsp;re-payed&amp;nbsp;me with a license to their engine, and i really appreciated that.&lt;br /&gt;&lt;br /&gt;Of course&amp;nbsp;competitors&amp;nbsp;now can exploit that (BTW i really love this approach of taking chances)&lt;br /&gt;, &amp;nbsp;C4 Engine is now doing a 50% discount on their engine for previous torque users.&lt;br /&gt;&lt;br /&gt;I hope torque people go great in their careers and i hope better Torque technology in the future if they found a new buyer (or of course the best option is OpenSourcing Torque :D).&lt;br /&gt;&lt;br /&gt;UPDATE:&lt;br /&gt;Garage games back into action again :).&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9211325913345206620-7871341048023588302?l=kariem2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kariem2k.blogspot.com/feeds/7871341048023588302/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kariem2k.blogspot.com/2010/11/torque-is-going-out-of-business-unless.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/7871341048023588302'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/7871341048023588302'/><link rel='alternate' type='text/html' href='http://kariem2k.blogspot.com/2010/11/torque-is-going-out-of-business-unless.html' title='Torque is going out of business unless there is a buyer'/><author><name>Karim Ahmed</name><uri>http://www.blogger.com/profile/15607260786211222497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9211325913345206620.post-3656422317168752698</id><published>2010-10-03T21:34:00.002+02:00</published><updated>2011-02-16T11:36:21.726+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><title type='text'>MSI EX623 Sound Problems On ALSA Linux</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;My ACL1200/ACL888 soundcard on my MSI EX623 laptop had several problems.&lt;br /&gt;1)Did not work at all out of the box.&lt;br /&gt;2)The internal/external mics did not work&lt;br /&gt;3)No Jack sensing (when inserting the headphone jack the speakers still work)&lt;br /&gt;&lt;br /&gt;I have manged to solve all of the above issues except "The internal Mic Problem".&lt;br /&gt;After many trials and researching the internet i have managed to run the exernal mic and the audio but no Jack Sensing.&lt;br /&gt;using 3stack-dig model.&lt;br /&gt;&lt;br /&gt;But after looking at the "sound/pci/hda/patch-realtek.c" in ALSA source, i have found that "uniwill" model is the best match for my card.&lt;br /&gt;&lt;br /&gt;Now headphones with jack sensing are working great.&lt;br /&gt;&lt;br /&gt;So all you have to do is to add the following line to at the end of "alsa-base.conf"&lt;br /&gt;"sudo vim /etc/modprobe.d/alsa-base.conf"&lt;br /&gt;&lt;blockquote&gt;options snd-hda-intel model=uniwill&amp;nbsp;&lt;/blockquote&gt;Along with that fix use the Realtek drivers from:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://218.210.127.131/downloads/downloadsView.aspx?Langid=1&amp;amp;PNid=24&amp;amp;PFid=24&amp;amp;Level=4&amp;amp;Conn=3&amp;amp;DownTypeID=3&amp;amp;GetDown=false"&gt;http://218.210.127.131/downloads/downloadsView.aspx?Langid=1&amp;amp;PNid=24&amp;amp;PFid=24&amp;amp;Level=4&amp;amp;Conn=3&amp;amp;DownTypeID=3&amp;amp;GetDown=false&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9211325913345206620-3656422317168752698?l=kariem2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kariem2k.blogspot.com/feeds/3656422317168752698/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kariem2k.blogspot.com/2010/10/msi-ex623-sound-problems-on-alsa-linux.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/3656422317168752698'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/3656422317168752698'/><link rel='alternate' type='text/html' href='http://kariem2k.blogspot.com/2010/10/msi-ex623-sound-problems-on-alsa-linux.html' title='MSI EX623 Sound Problems On ALSA Linux'/><author><name>Karim Ahmed</name><uri>http://www.blogger.com/profile/15607260786211222497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9211325913345206620.post-8606472539276445351</id><published>2010-09-20T11:30:00.000+03:00</published><updated>2010-09-20T11:30:37.812+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><title type='text'>Chrome and Taskbar Autohide on windows</title><content type='html'>Google Chrome is a great browser, and i am a huge fan of auto hiding panels on any OS I use.&lt;br /&gt;&lt;br /&gt;On windows Google Chrome win maximized i cannot show my taskbar when moving my mouse to the bottom of the screen.&lt;br /&gt;&lt;br /&gt;After searching a little i found that bug is placed in google bug tracking system for ages and yet not resolved (till post's date).&lt;br /&gt;&lt;br /&gt;But here:&lt;br /&gt;http://code.google.com/p/chromium/issues/detail?id=20#c229&lt;br /&gt;&lt;br /&gt;A guy has found workaround:&lt;br /&gt;&lt;br /&gt;Just put apply any theme to the browser, it worked for m!!!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9211325913345206620-8606472539276445351?l=kariem2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kariem2k.blogspot.com/feeds/8606472539276445351/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kariem2k.blogspot.com/2010/09/chrome-and-taskbar-autohide-on-windows.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/8606472539276445351'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/8606472539276445351'/><link rel='alternate' type='text/html' href='http://kariem2k.blogspot.com/2010/09/chrome-and-taskbar-autohide-on-windows.html' title='Chrome and Taskbar Autohide on windows'/><author><name>Karim Ahmed</name><uri>http://www.blogger.com/profile/15607260786211222497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9211325913345206620.post-5160995364467498958</id><published>2010-09-15T16:35:00.007+03:00</published><updated>2010-10-06T13:23:48.223+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Security'/><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><title type='text'>Capturing Conficker with monitoring Admin$ shares</title><content type='html'>&lt;a href="http://en.wikipedia.org/wiki/Conficker"&gt;Conficker &lt;/a&gt;among some other worms exploit windows file sharing to be able to spread, it got spread on our network, and our network topology/security prevented us from doing a full remote scan on some machines, we spotted some machines with remote port scanning methods, and we could not spot others, I have made two trials:&lt;br /&gt;&lt;br /&gt;First one is to make a small c# application to get the value "KLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SvcHost\&lt;i&gt;netsvcs&lt;/i&gt;" of all pcs in the network using WMI and parse the multistring value and sort the occurrences and report them back to me, i sort the occurrences because it generates random service names so it would be too hard to spot that with naked eye, so by sorting the occurrences of service names in all of the machines the service name will be most likely repeated only once, that worked on some machines and some others did not work because of permission issues.&lt;br /&gt;&lt;br /&gt;The second approach is by using the "Win32_ServerConnection" WMI class, and polling any share connections to Admin$ object and i report the machine name to my email, if any access is made to the machine from that device.&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush:csharp"&gt;ManagementObjectSearcher searcher =&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; new ManagementObjectSearcher("root\\CIMV2",&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "SELECT * FROM Win32_ServerConnection WHERE ShareName = 'ADMIN$'");&lt;br /&gt;&lt;br /&gt;foreach (ManagementObject queryObj in searcher.Get())&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; string name = (string) queryObj["ComputerName"];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; listBox1.Invoke(new MethodInvoker(delegate()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (!computers.ContainsKey(name))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; computers.Add(name, DateTime.Now);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; listBox1.Items.Add(String.Format("ComputerName: {0}, Time: {1}",&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DateTime.Now));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; found = true;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }));&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;Sorry for the C# 2.0 syntax, but i had to use C# 2.0 to work on most of the machines.&lt;br /&gt;By deploying the code on many machines, it works like a distributed trap for the worm.&lt;br /&gt;&lt;br /&gt;That can be used for viruses that uses shared resources, but it can be any different object than Admin$.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9211325913345206620-5160995364467498958?l=kariem2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kariem2k.blogspot.com/feeds/5160995364467498958/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kariem2k.blogspot.com/2010/09/capturing-conficker-with-monitoring.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/5160995364467498958'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/5160995364467498958'/><link rel='alternate' type='text/html' href='http://kariem2k.blogspot.com/2010/09/capturing-conficker-with-monitoring.html' title='Capturing Conficker with monitoring Admin$ shares'/><author><name>Karim Ahmed</name><uri>http://www.blogger.com/profile/15607260786211222497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9211325913345206620.post-6872096579436107449</id><published>2010-09-13T12:19:00.001+03:00</published><updated>2011-03-24T02:32:53.291+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tools'/><category scheme='http://www.blogger.com/atom/ns#' term='vim'/><category scheme='http://www.blogger.com/atom/ns#' term='VS'/><title type='text'>Addictive Simplicty vs Big Complex Tools - OMG</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;After working sometime on a Ruby On Rails application for 2 months with simplest tooling possible (VIM) and then coming back to the big fat VS 2010, Despite using VS 20x more than vim, I found myself struggling with VS + Resharper, after tasting the simplicity everything else seems useless.&lt;br /&gt;&lt;br /&gt;Speed of coding is different, speed of navigation is different and the bloatedness of VS compared to what i used to in simple text editors makes me go nuts.&lt;br /&gt;&amp;nbsp; &lt;br /&gt;Yes VS and resharper has tons of productivity tools compared to a text editor, but i found myself more comfortable and productive (in a strange unexpressed way) with simple tools than something big like VS.&lt;br /&gt;&lt;br /&gt;But i never liked Visual Designers, Code Generation anyway, even before starting using vim 2.5 years ago.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9211325913345206620-6872096579436107449?l=kariem2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kariem2k.blogspot.com/feeds/6872096579436107449/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kariem2k.blogspot.com/2010/09/addictive-simplicty-vs-big-complex.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/6872096579436107449'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/6872096579436107449'/><link rel='alternate' type='text/html' href='http://kariem2k.blogspot.com/2010/09/addictive-simplicty-vs-big-complex.html' title='Addictive Simplicty vs Big Complex Tools - OMG'/><author><name>Karim Ahmed</name><uri>http://www.blogger.com/profile/15607260786211222497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9211325913345206620.post-6913095951480724103</id><published>2010-08-29T20:35:00.006+02:00</published><updated>2010-08-29T22:55:14.851+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Git'/><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><title type='text'>Git Power</title><content type='html'>Today i faced something, i had to delete all my source code from the host &lt;br /&gt;without removing the application itself from there.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://heroku.com/"&gt;Heroku&lt;/a&gt; is a cloud based host for rails, It uses git for deployment. It is really easy to deploy on it just treat it as a remote git repo, and push your changes to it.&lt;br /&gt;&lt;br /&gt;That means the deployment history is there, so if i "git rm -r app" the original code will still be stored in the git history and can easly retrieved again.&lt;br /&gt;&lt;br /&gt;The only option i had is to rewrite history, and guess what?! git supports that :D&lt;br /&gt;&lt;br /&gt;With &lt;a href="http://www.kernel.org/pub/software/scm/git/docs/git-filter-branch.html"&gt;filter-branch&lt;/a&gt; command, you can iterate on many things and rewrite the git history.&lt;br /&gt;&lt;br /&gt;if i run the following command, all files and folders in "views" will be removed from all commits.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;git filter-branch -f --index-filter "git update-index --remove $(echo app/views/**/*)" HEAD&lt;/blockquote&gt;&lt;blockquote&gt;git push heroku master --force&amp;nbsp; &lt;/blockquote&gt;Note: the force when pushing and the ** to tell all folders under views. &lt;br /&gt;&lt;br /&gt;You can use that also if you have multiple commits for a file with sensitive information and you want that files removed from the history so following pulls won't include that file.&lt;br /&gt;&lt;br /&gt;Also one last tip, to delete a remote branch:&lt;br /&gt;&lt;blockquote&gt;git push heroku :branch_to_delete&lt;/blockquote&gt;Notice the ':'&amp;nbsp; &lt;br /&gt;&lt;br /&gt;Again git shows how handy it is.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9211325913345206620-6913095951480724103?l=kariem2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kariem2k.blogspot.com/feeds/6913095951480724103/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kariem2k.blogspot.com/2010/08/git-power.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/6913095951480724103'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/6913095951480724103'/><link rel='alternate' type='text/html' href='http://kariem2k.blogspot.com/2010/08/git-power.html' title='Git Power'/><author><name>Karim Ahmed</name><uri>http://www.blogger.com/profile/15607260786211222497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9211325913345206620.post-396126176768247324</id><published>2010-08-27T01:23:00.000+02:00</published><updated>2010-08-27T01:23:04.174+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><title type='text'>SQL CE 3.5 and IIS 7.. Problem</title><content type='html'>I am trying to read a SQLCE 3.5 DB from an ASP.NET webservice.&lt;br /&gt;One of the customers had this problem,&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;SqlCEException: The operating system does not support the Encryption Mode provided&lt;/blockquote&gt;&amp;nbsp;To solve it you should set AppPool Identity to something like NetworkService, but the customer already had that set!!&lt;br /&gt;&lt;br /&gt;After searching the web, i found that &lt;a href="http://support.microsoft.com/kb/972002"&gt;http://support.microsoft.com/kb/972002&lt;/a&gt;, but instead of installing the hotfix we just installed the SP2 of SQLCE 3.5 :).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9211325913345206620-396126176768247324?l=kariem2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kariem2k.blogspot.com/feeds/396126176768247324/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kariem2k.blogspot.com/2010/08/sql-ce-35-and-iis-7-problem.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/396126176768247324'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/396126176768247324'/><link rel='alternate' type='text/html' href='http://kariem2k.blogspot.com/2010/08/sql-ce-35-and-iis-7-problem.html' title='SQL CE 3.5 and IIS 7.. Problem'/><author><name>Karim Ahmed</name><uri>http://www.blogger.com/profile/15607260786211222497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9211325913345206620.post-2719265644011644314</id><published>2010-08-27T01:17:00.000+02:00</published><updated>2010-08-27T01:17:23.919+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='.Net'/><title type='text'>Invoke, InvokeRequired and IsHandleCreated</title><content type='html'>I had a threading with UI problem yesterday, i was simply trying to invoke a User Control from a worker thread to update it, But i always had&lt;br /&gt;&lt;blockquote&gt;&lt;em&gt;InvalidOperationException was unhandled - Invoke or BeginInvoke cannot be called on a control until the window handle has been created.&lt;/em&gt; &lt;/blockquote&gt;The funny thing that IsHandleCreated of the control was returning true and the there is a valid handle for the control, and InvokeRequired was returning false, after checking the MSDN, to confirm that if the control handle has not been created yet, InvokeRequired will be false and IsHandleCreated will be false as well.&lt;br /&gt;&lt;br /&gt;So why that happens, my first thought was the control never been added to the parent UserControl (It is actually a UserControl inside another UserControl) using Me.Controls.Add, but i confirmed that my child control which i am trying to invoke gets added.&lt;br /&gt;&lt;br /&gt;After searching the code for some time, i found that the parent UserControl is the cause, because it never gets added to the Form :D. &lt;br /&gt;&lt;br /&gt;So apparently if the control is not added to its parent InvokeRequired will return false but IsHandleCreated will return true.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9211325913345206620-2719265644011644314?l=kariem2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kariem2k.blogspot.com/feeds/2719265644011644314/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kariem2k.blogspot.com/2010/08/invoke-invokerequired-and.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/2719265644011644314'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/2719265644011644314'/><link rel='alternate' type='text/html' href='http://kariem2k.blogspot.com/2010/08/invoke-invokerequired-and.html' title='Invoke, InvokeRequired and IsHandleCreated'/><author><name>Karim Ahmed</name><uri>http://www.blogger.com/profile/15607260786211222497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9211325913345206620.post-5770997891419703005</id><published>2010-08-13T15:12:00.004+02:00</published><updated>2010-08-15T09:35:47.508+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Unicode and ASCII problems</title><content type='html'>By default functions like "FileInfo&lt;span xmlns=""&gt;.&lt;/span&gt;OpenText" uses UTF8 as the encoding of the file, so the bytes read from the file are interpreted as UTF8 characters, when reading ASCII files using this method English charters are read normally but a problem arises when the file being read contains Extended ASCII characters (In my case Arabic), these characters are misinterpreted and replaced by other characters.&lt;br /&gt;&lt;br /&gt;Another problem, what if you are merging files using a simple .Net application and these files maybe saved as UTF8 files or ASCII files, you must know what is the encoding you are going to use for reading that file. Unfortunately i did not find something that .Net provides for auto-detecting the encoding of the file.&lt;br /&gt;&lt;br /&gt;Unicode files in general use &lt;a href="http://en.wikipedia.org/wiki/Byte_order_mark"&gt;BOM &lt;/a&gt;(It is optional&amp;nbsp; specially for UTF8, but on windows many programs use it to indicate that format of the text file)&lt;br /&gt;&lt;br /&gt;The following code checks the first 3 bytes of the file, if it matches the BOM sequence of UTF8 sets the flag (For all of Unicode formats use the table in the Wikipedia page)&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: csharp"&gt;if (bytes[0] == 0xef &amp;amp; bytes[1] == 0xbb &amp;amp; bytes[2] == 0xbf)&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp; isUTF8 = true;&lt;br /&gt;}&lt;br /&gt;if (isUTF8 )&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; readString = Encoding.UTF8.GetString(bytes);&lt;br /&gt;else&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; readString = Encoding.GetEncoding(1256).GetString(bytes); //here i use the codepage of Arabic ASCII format, you can use ASCIIEncoding.ASCII.GetString(bytes) for using the default codepage windows is using for Non-Unicode characters.&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Another and final problem for this post, What if you are merging files and the second file is a Unicode file, the BOM bytes are placed in the middle of the merged file, Application like SQL Server Management Studio does not ignore these BOM chars, and fails when running the SQL script, so we have to do this by ourselves&amp;nbsp; and filter them out before adding our file to the merged file.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9211325913345206620-5770997891419703005?l=kariem2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kariem2k.blogspot.com/feeds/5770997891419703005/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kariem2k.blogspot.com/2010/08/unicode-and-ascii-problems.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/5770997891419703005'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/5770997891419703005'/><link rel='alternate' type='text/html' href='http://kariem2k.blogspot.com/2010/08/unicode-and-ascii-problems.html' title='Unicode and ASCII problems'/><author><name>Karim Ahmed</name><uri>http://www.blogger.com/profile/15607260786211222497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9211325913345206620.post-266458623450124912</id><published>2010-07-12T21:00:00.012+03:00</published><updated>2011-02-16T11:34:06.072+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Design'/><title type='text'>Praising Runtime</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;After working and studying for some considerable time with dynamic runtime-checked languages (Lua, Ruby, Python, etc..), I realized one thing: "Never let my static compiled mindset hinder me" :D.&lt;br /&gt;&lt;br /&gt;Compiled languages are great in terms of performance, better refactoring, documentation (and of course IntelliSense), but IMHO, i must not make static compile time checks to be my only&amp;nbsp;obstacle&amp;nbsp;for boosting my productivity for a specific problem.&lt;br /&gt;&lt;br /&gt;I always been strict in that matter, i used to think that any code that i write must be statically typed, like my design for a scripting component for a game engine i am working on as a hobby project, i adopted event-based notifications from the C++ part to the Lua (which is a dynamic language) part, the args to that event were defined as classes in the C++ part binded to lua through LuaBind, and when i fire an event i pass an object from that classes to the lua function, that needed a lot of coding just to&amp;nbsp;guarantee that i don't pass invalid names of variables to the Lua part.&lt;br /&gt;&lt;br /&gt;After doing small to medium projects totally in interpreted languages, i noticed that typo mistakes are rare (not as was&amp;nbsp;expecting) and easy to spot. I did not use intellisense at all (Just GVim).&lt;br /&gt;&lt;br /&gt;The most annoying problem will be the documentation and refactoring, but i think proper TDD can solve that as well.&lt;br /&gt;&lt;br /&gt;I am not saying that dynamic languages are better, but the mindset can be very handy in some situations, I think MS is doing that also with the new "dynamic" keyword in C# 4.0 to ease things like the interoperability, or making amazing innovative things like what rails does.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9211325913345206620-266458623450124912?l=kariem2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kariem2k.blogspot.com/feeds/266458623450124912/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kariem2k.blogspot.com/2010/07/praising-runtime.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/266458623450124912'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/266458623450124912'/><link rel='alternate' type='text/html' href='http://kariem2k.blogspot.com/2010/07/praising-runtime.html' title='Praising Runtime'/><author><name>Karim Ahmed</name><uri>http://www.blogger.com/profile/15607260786211222497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9211325913345206620.post-3071248764789673766</id><published>2010-06-21T20:00:00.002+03:00</published><updated>2010-08-31T13:21:38.499+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Rails'/><title type='text'>The powerful rails link_to_remote :with</title><content type='html'>I am not a web dev. guy, so i don't know how big&amp;nbsp; the WOW factor is, but i found the :with parameter in link_to_remote really powerful.&lt;br /&gt;&lt;br /&gt;I needed to send an attribute of a div to the controller with ajax, so i do some processing according to that attribute value. After investigation i found the ":with" option which simply allows you to do some javascript assignment (so i can get the value using javascript) and append that value to the params hash to be sent to the controller.&lt;br /&gt;&amp;nbsp; &lt;br /&gt;&lt;pre class="brush: rails"&gt;&amp;lt;%= link_to_remote generate_status_cell(cell_id,image_name), :url =&amp;gt; {:action =&amp;gt; 'update_group_room_status',:status_date =&amp;gt; status_date, :cell_id =&amp;gt; cell_id}, :with =&amp;gt; "'value=' + $('#{cell_id}').getAttribute('value')"%&amp;gt; &lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9211325913345206620-3071248764789673766?l=kariem2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kariem2k.blogspot.com/feeds/3071248764789673766/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kariem2k.blogspot.com/2010/06/powerful-rails-linktoremote-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/3071248764789673766'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/3071248764789673766'/><link rel='alternate' type='text/html' href='http://kariem2k.blogspot.com/2010/06/powerful-rails-linktoremote-with.html' title='The powerful rails link_to_remote :with'/><author><name>Karim Ahmed</name><uri>http://www.blogger.com/profile/15607260786211222497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9211325913345206620.post-1823016429521167927</id><published>2010-06-16T16:26:00.000+03:00</published><updated>2010-06-16T16:26:13.017+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='Stupid Mistakes'/><title type='text'>MSBuild does not detect deep references like VS does, or what?!</title><content type='html'>If you have 2 projects (A, B), A depends on B and project B depends on assembly like "System.Windows.Forms", and finally A uses a class defined in Windows.Forms.&lt;br /&gt;&lt;br /&gt;VS is tolerant to that kind of situation, it will compile successfully for some reason, it will resolve that, but MSBuild does not.&lt;br /&gt;&lt;br /&gt;If you have a correction or i missed something please tell me.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9211325913345206620-1823016429521167927?l=kariem2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kariem2k.blogspot.com/feeds/1823016429521167927/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kariem2k.blogspot.com/2010/06/msbuild-does-not-detect-deep-references.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/1823016429521167927'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/1823016429521167927'/><link rel='alternate' type='text/html' href='http://kariem2k.blogspot.com/2010/06/msbuild-does-not-detect-deep-references.html' title='MSBuild does not detect deep references like VS does, or what?!'/><author><name>Karim Ahmed</name><uri>http://www.blogger.com/profile/15607260786211222497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9211325913345206620.post-872150328211766125</id><published>2010-06-14T14:46:00.000+03:00</published><updated>2010-06-14T14:46:28.611+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='GameDev'/><title type='text'>RadonLabs Down :(</title><content type='html'>The famous German creator of Nebula Device Engine &amp;amp; and the old Project Nomads, Radon Labs has been acquired by BigPoint, that is a very sad news for me at least because Radon Labs had great contributions to the opensource community, with their Nebula Device 1,2 and 3 which was in development, the engines had that awesome and innovative design and code.&lt;br /&gt;That was shocking news because RL seemed doing a great job with their game &lt;i&gt;Drakensang: The Dark Eye &lt;/i&gt;and they even bought new company place :). &lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;I don't know if they will pull the plug for the engine (at least the opensourcing) or not, but i hope they continue the way Radon Labs worked with the engine before.&lt;br /&gt;&lt;br /&gt;Thanks RadonLabs for your great efforts, and hope your people like "floh" have greater future with BigPoint.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9211325913345206620-872150328211766125?l=kariem2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kariem2k.blogspot.com/feeds/872150328211766125/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kariem2k.blogspot.com/2010/06/radonlabs-down.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/872150328211766125'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/872150328211766125'/><link rel='alternate' type='text/html' href='http://kariem2k.blogspot.com/2010/06/radonlabs-down.html' title='RadonLabs Down :('/><author><name>Karim Ahmed</name><uri>http://www.blogger.com/profile/15607260786211222497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9211325913345206620.post-783159736349898116</id><published>2010-06-07T10:01:00.002+03:00</published><updated>2010-06-21T23:59:42.033+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='vim'/><title type='text'>My vim config on GitHub</title><content type='html'>Simple vim config, tweaked for easy deployment across Linux and Windows, mainly for RoR development.&lt;br /&gt;&lt;br /&gt;Just&lt;br /&gt;git clone http://github.com/kariem2k/vim-config.git&lt;br /&gt;&lt;br /&gt;Enjoy&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9211325913345206620-783159736349898116?l=kariem2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kariem2k.blogspot.com/feeds/783159736349898116/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kariem2k.blogspot.com/2010/06/my-vim-config-on-github.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/783159736349898116'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/783159736349898116'/><link rel='alternate' type='text/html' href='http://kariem2k.blogspot.com/2010/06/my-vim-config-on-github.html' title='My vim config on GitHub'/><author><name>Karim Ahmed</name><uri>http://www.blogger.com/profile/15607260786211222497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9211325913345206620.post-106104082581071164</id><published>2010-06-07T09:54:00.001+03:00</published><updated>2010-06-07T09:55:36.429+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Stupid Mistakes'/><title type='text'>Git pushing to github with error, "error: src refspec master does not match any."</title><content type='html'>The problem was simply because i initialized the repo and created the remote one, but forgot to add (git add .) the files to the local repo and pushed straight right away.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9211325913345206620-106104082581071164?l=kariem2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kariem2k.blogspot.com/feeds/106104082581071164/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kariem2k.blogspot.com/2010/06/git-pushing-to-github-with-error-error.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/106104082581071164'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/106104082581071164'/><link rel='alternate' type='text/html' href='http://kariem2k.blogspot.com/2010/06/git-pushing-to-github-with-error-error.html' title='Git pushing to github with error, &quot;error: src refspec master does not match any.&quot;'/><author><name>Karim Ahmed</name><uri>http://www.blogger.com/profile/15607260786211222497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9211325913345206620.post-3143797440557018476</id><published>2010-05-26T14:34:00.002+03:00</published><updated>2010-06-24T11:54:57.211+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tools'/><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><title type='text'>Visual Studio Timemachine, and the rebuild every run</title><content type='html'>A colleague of mine has faced a strange problem, every time he run the application form VS, the application gets rebuilt again.&lt;br /&gt;&lt;br /&gt;After "*.*" searching the project directory, we found that one file has a modification date of tomorrow!, we think that is problems in the domain server caused that the system date shifted by one day, and the file is saved during that shift.&lt;br /&gt;&lt;br /&gt;So after changing the modification date of the file, VS is now working probably!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9211325913345206620-3143797440557018476?l=kariem2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kariem2k.blogspot.com/feeds/3143797440557018476/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kariem2k.blogspot.com/2010/05/visual-studio-timemachine-and-rebuild.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/3143797440557018476'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/3143797440557018476'/><link rel='alternate' type='text/html' href='http://kariem2k.blogspot.com/2010/05/visual-studio-timemachine-and-rebuild.html' title='Visual Studio Timemachine, and the rebuild every run'/><author><name>Karim Ahmed</name><uri>http://www.blogger.com/profile/15607260786211222497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9211325913345206620.post-276950737247285580</id><published>2010-05-24T10:40:00.001+03:00</published><updated>2010-05-24T10:42:06.153+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tools'/><title type='text'>yUML a great to visualize your thoughts if you like typing</title><content type='html'>I found yUML is a great simple tool for drawing UML diagrams, in a very fast innovative way using string to describe it.&lt;br /&gt;&lt;br /&gt;I really like it, i have an idea, i just type the design in my head and that is it, but never tried it with big diagrams and i think it will have problems with that.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://yuml.me/"&gt;Give It A Try&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Thanks&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9211325913345206620-276950737247285580?l=kariem2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kariem2k.blogspot.com/feeds/276950737247285580/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kariem2k.blogspot.com/2010/05/yuml-great-to-visualize-your-thoughts.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/276950737247285580'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/276950737247285580'/><link rel='alternate' type='text/html' href='http://kariem2k.blogspot.com/2010/05/yuml-great-to-visualize-your-thoughts.html' title='yUML a great to visualize your thoughts if you like typing'/><author><name>Karim Ahmed</name><uri>http://www.blogger.com/profile/15607260786211222497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9211325913345206620.post-2468223458776443750</id><published>2010-05-22T16:24:00.003+03:00</published><updated>2010-06-24T11:56:48.101+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><title type='text'>GVim console problem "murrine_style_draw_box: assertion `height &gt;= -1'"</title><content type='html'>On ubuntu 10.04 Gvim was reporting that error to the terminal when opening fuzzyfinder panel, after investigation, i found that it is a problem in the new ubuntu dark theme, once i changed it, the error is no more.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9211325913345206620-2468223458776443750?l=kariem2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kariem2k.blogspot.com/feeds/2468223458776443750/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kariem2k.blogspot.com/2010/05/gvim-console-problem.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/2468223458776443750'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/2468223458776443750'/><link rel='alternate' type='text/html' href='http://kariem2k.blogspot.com/2010/05/gvim-console-problem.html' title='GVim console problem &quot;murrine_style_draw_box: assertion `height &gt;= -1&apos;&quot;'/><author><name>Karim Ahmed</name><uri>http://www.blogger.com/profile/15607260786211222497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9211325913345206620.post-1190130146474561377</id><published>2010-04-23T16:50:00.000+02:00</published><updated>2010-04-23T16:50:38.544+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Stupid Mistakes'/><title type='text'>Windows Mobile Emulator and IIS</title><content type='html'>Yesterday i lost some time because of a stupid thing, i was using windows emulator to run a CF application that contacts a webservice for data querying, but this time i was trying to connect to a remote service instead of the one deployed on my local machine.&lt;br /&gt;&lt;br /&gt;The service always returned data that is totally different than the data returned by a direct SQL query to the remote SQL Server, tried checking the remote webservice's web.config, checked if caching maybe the problem, made sure that there is no body is manipulating the data while i am doing this, started to suspect the emulator so i restarted it, made sure that the application is configured for that webservice but nothing.&lt;br /&gt;&lt;br /&gt;I started to suspect the network and the VPN, made sure that the ip is pointing to the right machine, then i put a test asmx file to test with and connect to it from emulator's IE i could not, finally the aha moment came to me :D.&lt;br /&gt;&lt;br /&gt;On my machine the webservice has the same virtual directory path like the remote one, and IIS 7.5 by default has "*" binding for port 80, and with the fact that the emulator is connected through active sync, so my machine is considered a gateway to the emulator, and emulator's requests is hooked by local IIS before it gets routed through the internet, as a quick solution i changed the IIS bindings a little, and it worked.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9211325913345206620-1190130146474561377?l=kariem2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kariem2k.blogspot.com/feeds/1190130146474561377/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kariem2k.blogspot.com/2010/04/windows-mobile-emulator-and-iis.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/1190130146474561377'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/1190130146474561377'/><link rel='alternate' type='text/html' href='http://kariem2k.blogspot.com/2010/04/windows-mobile-emulator-and-iis.html' title='Windows Mobile Emulator and IIS'/><author><name>Karim Ahmed</name><uri>http://www.blogger.com/profile/15607260786211222497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9211325913345206620.post-150526330919658660</id><published>2010-04-19T15:29:00.012+02:00</published><updated>2010-04-19T16:36:41.896+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tools'/><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><title type='text'>Visual Studio code macros are awesome</title><content type='html'>I am in the middle of replacing OCX DTPicker control, from existing VB6 -&amp;gt; VB.NET application.&lt;br /&gt;&lt;br /&gt;In the designer code, each DTPicker ocx control has OCXState and it implements ISupportInitialize interface, when replacing DTPicker with windows forms DateTimePicker control the OCXState and ISupportInitialize are not supported, so they have to be removed manually from the designer file code, and removing them manually is a tedious and time consuming task.&lt;br /&gt;&lt;br /&gt;I have used VS code macros to do that for me, here is the code:&lt;br /&gt;&lt;pre class="brush: vbnet; wrap-lines: false"&gt;Public Sub FixOCXDtPicker()&lt;br /&gt;    Dim list As New List(Of String)&lt;br /&gt;    Dim curDocument As Document = DTE.ActiveDocument&lt;br /&gt;    Dim codeElems As Object = curDocument.ProjectItem.FileCodeModel.CodeElements&lt;br /&gt;&lt;br /&gt;    For Each curElemnt As CodeElement In codeElems&lt;br /&gt;        For Each curSubElemnt As CodeElement In curElemnt.Children&lt;br /&gt;            If curSubElemnt.Kind = vsCMElement.vsCMElementVariable Then&lt;br /&gt;                Dim curVar As CodeVariable = DirectCast(curSubElemnt, CodeVariable)&lt;br /&gt;                If curVar.Type.AsString.Contains("DTPicker") Then&lt;br /&gt;                    list.Add(curVar.Name)&lt;br /&gt;                End If&lt;br /&gt;            End If&lt;br /&gt;        Next&lt;br /&gt;    Next&lt;br /&gt;&lt;br /&gt;    For Each curVar As String In list&lt;br /&gt;        DTE.Find.FindReplace(vsFindAction.vsFindActionReplaceAll, "^.+" + curVar + "\.OcxState.+$", vsFindOptions.vsFindOptionsFromStart Or vsFindOptions.vsFindOptionsMatchInHiddenText Or vsFindOptions.vsFindOptionsRegularExpression, "", vsFindTarget.vsFindTargetCurrentDocument, , , vsFindResultsLocation.vsFindResultsNone)&lt;br /&gt;        'curDocument.Activate() 'Note: you will have to uncomment this line, if you are not using "vsFindResultsLocation.vsFindResultsNone" in the previous line, because for some reason the active document is changed from current code window to the "find results" one, so everything will be messed up in the loop.&lt;br /&gt;    Next&lt;br /&gt;&lt;br /&gt;    For Each curVar As String In list&lt;br /&gt;        DTE.Find.FindReplace(vsFindAction.vsFindActionReplaceAll, "^.+" + curVar + ".+ISupportInitialize.+$", vsFindOptions.vsFindOptionsFromStart Or vsFindOptions.vsFindOptionsMatchInHiddenText Or vsFindOptions.vsFindOptionsRegularExpression, , vsFindTarget.vsFindTargetCurrentDocument, , , vsFindResultsLocation.vsFindResultsNone)&lt;br /&gt;        'curDocument.Activate() 'Note: you will have to uncomment this line, if you are not using "vsFindResultsLocation.vsFindResultsNone" in the previous line, because for somereason the active document is changed from current code window to the "find results" one.&lt;br /&gt;    Next&lt;br /&gt;&lt;br /&gt;    If Not curDocument.Saved Then&lt;br /&gt;        curDocument.Save()&lt;br /&gt;    End If&lt;br /&gt;End Sub&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9211325913345206620-150526330919658660?l=kariem2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kariem2k.blogspot.com/feeds/150526330919658660/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kariem2k.blogspot.com/2010/04/visual-studio-code-macros-are-awesome.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/150526330919658660'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/150526330919658660'/><link rel='alternate' type='text/html' href='http://kariem2k.blogspot.com/2010/04/visual-studio-code-macros-are-awesome.html' title='Visual Studio code macros are awesome'/><author><name>Karim Ahmed</name><uri>http://www.blogger.com/profile/15607260786211222497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9211325913345206620.post-4039469131768200301</id><published>2010-04-17T23:31:00.003+02:00</published><updated>2010-04-17T23:48:18.020+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Git'/><title type='text'>Git Index and the interactive adding teaches me discipline</title><content type='html'>Git has the index (Staging area), it is the only VCS i know of that has this feature. As i understand, it is simply an intermediate location which you can prepare your commits before actually committing it, it is a really good feature, it makes things more natural from the command line.&lt;br /&gt;&lt;br /&gt;Although the git index causes confusion sometimes (at least for a beginner like me), but it also have power that can help in many cases, because the fact you can have now 3 versions of the file in the same time, one is committed, another one is staged and the final one is the one in your working directory.&lt;br /&gt;&lt;br /&gt;Combined with the interactive adding, you can split your changes to smaller micro commits (i group changes with logical relation in single commits), you even have the power to split your changes to a single file into several commits (can be done with --patch as well), AFAIK using Record Extension in mercurial, you can have similar functionality but without the index feature so you will commit directly. &lt;br /&gt;&lt;br /&gt;With that and being new to git and have the enthusiasm, i am now doing mirco small commits, i hope i don't return back to my big batch commiting style that i used to do.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9211325913345206620-4039469131768200301?l=kariem2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kariem2k.blogspot.com/feeds/4039469131768200301/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kariem2k.blogspot.com/2010/04/git-index-and-interactive-adding.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/4039469131768200301'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/4039469131768200301'/><link rel='alternate' type='text/html' href='http://kariem2k.blogspot.com/2010/04/git-index-and-interactive-adding.html' title='Git Index and the interactive adding teaches me discipline'/><author><name>Karim Ahmed</name><uri>http://www.blogger.com/profile/15607260786211222497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9211325913345206620.post-2584174359842782365</id><published>2010-04-16T00:27:00.008+02:00</published><updated>2010-04-16T00:44:19.080+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tools'/><title type='text'>"Generate From Usage" Feature in VS 2010</title><content type='html'>Today i was evaluating VS2010's new feature "Generate From Usage", It is used to generate undefined classes, members... from your code, just type the class or method and CTRL + Period it will then ask what to generate.&lt;br /&gt;&lt;br /&gt;&amp;nbsp;It generates the member or the class without leaving he tcurrent editing file which makes it perfect for TDD.&lt;br /&gt;&lt;br /&gt;You write your test method and write the code to test the non-existing classes and methods and then&amp;nbsp; generate those from your test code, from first look it is awesome killer feature BUT......&lt;br /&gt;&lt;br /&gt;What does VS do in that condition, AreEqual has many overloads ?&lt;br /&gt;&lt;pre class="brush: csharp"&gt;Assert.AreEqual(2, myObj.ItemsCount);&lt;/pre&gt;"ItemsCount" property is not&amp;nbsp; defined yet, so you press CTRL + PERIOD, generate the property, the realtime compilation is happy now, everything seems ok, but when we go to the class which contains that property, we will find that "ItemsCount" is defined as a property of type object, so we must change it to integer.&lt;br /&gt;&lt;br /&gt;That is very unnatural behavior&amp;nbsp; because we even must to switch to the file and got to the member declaration and change it, that is slow, Resharper on the other hand, is smarter, it detects that on its own, and even if it guessed it wrong, it always puts you on the place of the member type to edit.&lt;br /&gt;&lt;br /&gt;The thing that makes me nervous, is MS has mad a workaround in its &lt;a href="http://blogs.msdn.com/vbteam/archive/2008/12/13/walkthrough-tdd-support-with-the-generate-from-usage-feature-in-vs-2010-lisa-feigenbaum.aspx"&gt;tutorial &lt;/a&gt;for that feature, they are just using the IsTrue assert function, which will make you to compare using equality operators, which will lead the generator to know what is the type of your property, I hate marketing :D.&lt;br /&gt;&lt;br /&gt;So i will stick with Resharper a little more.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9211325913345206620-2584174359842782365?l=kariem2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kariem2k.blogspot.com/feeds/2584174359842782365/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kariem2k.blogspot.com/2010/04/generate-from-usage-feature-in-vs-2010.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/2584174359842782365'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/2584174359842782365'/><link rel='alternate' type='text/html' href='http://kariem2k.blogspot.com/2010/04/generate-from-usage-feature-in-vs-2010.html' title='&quot;Generate From Usage&quot; Feature in VS 2010'/><author><name>Karim Ahmed</name><uri>http://www.blogger.com/profile/15607260786211222497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9211325913345206620.post-258037840562062712</id><published>2010-04-15T11:57:00.003+02:00</published><updated>2010-04-16T00:42:43.259+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>?? in C#</title><content type='html'>Have you seen that c# code before?, i just saw it today, i think i did not study c# well :D&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: csharp"&gt;myVar = myVar2 ??&amp;nbsp; myVar3;&lt;/pre&gt;&lt;br /&gt;It is &lt;b&gt;Null Coalesce &lt;span class="searchword"&gt;Operator,&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;blockquote&gt;The &lt;span class="input"&gt;??&lt;/span&gt; operator is called the  null-coalescing operator and is used to define a default value for a  nullable value types as well as reference types. It returns the  left-hand operand if it is not null; otherwise it returns the right  operand. (MSDN)&lt;/blockquote&gt;And it is not from C# 4.0 or even 3.0 it is from C# 2.0 !!, Wow i like it much, it will make life a little easier and more inlined :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9211325913345206620-258037840562062712?l=kariem2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kariem2k.blogspot.com/feeds/258037840562062712/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kariem2k.blogspot.com/2010/04/in-c.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/258037840562062712'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/258037840562062712'/><link rel='alternate' type='text/html' href='http://kariem2k.blogspot.com/2010/04/in-c.html' title='?? in C#'/><author><name>Karim Ahmed</name><uri>http://www.blogger.com/profile/15607260786211222497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9211325913345206620.post-4965439416745001174</id><published>2010-04-12T20:15:00.004+02:00</published><updated>2010-04-13T13:23:15.330+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Git'/><category scheme='http://www.blogger.com/atom/ns#' term='Projects'/><title type='text'>Going Git in the new project</title><content type='html'>There must be a gazillion articles about git and DVCS out there, i just want to share my thoughts.&lt;br /&gt;&lt;br /&gt;No wonder that Distributed Version Control Systems (DVCS)&amp;nbsp; are now the hype in Open source&amp;nbsp; communities, supported by big and powerful projects like The Kernel, major Linux distros, Rails, Ogre3d, Openoffice, OpenJDK, Python, ..., those are the ones i remember, but believe me every day more and more projects adopt DVCS, big OSS hosting services are supporting DVCS protocols (Sourceforge, Google Code, CodePlex,..).&lt;br /&gt;&lt;br /&gt;I totally love the flexibility and the speed that DVCS tools provide, Distributed means that every developer has his own copy of the entire repository with entire commit history, He will be playing around and committing with his own private copy of the project, and when he is ready to share his work, He just pushes or pulls to another desired repository.&lt;br /&gt;&lt;br /&gt;You are committing and having your history without a dependency to a  remote repo., Network and internet connections suck sometimes, many  times you are alone in a world without internet connection, in  centralized VCSs you are in a problem, because you will not be able to  have the commit history and rollback capabilities VCSs provide, but in  DVCS you will be able to commit and do nearly all of the operations  without the need to be online.&lt;br /&gt;&lt;br /&gt;Every thing is distributed, you are not limited by a central repo. workflow, do what ever you want you can team up with some team members and share the work between each other and when your great idea works you share it with other team groups, you can make a development hierarchy, the main repo is controlled by one man that man pulls from developers he trust or ones below him in the hierarchy and they pull from who they trust (That is how the kernel development works), It is really really great to organize your workflow the way you want.&lt;br /&gt;&lt;br /&gt;The idea created a whole new social activity, sites like Github and BitBucket are considered a social sites like Facebook and twitter, go and see the activity in projects, see how new contributors create forks of the project extend it with their own ideas, how they communicate, how they provide pull requests, it is really awesome, how they share everything from simple configuration files to very big projects like the Kernel, it really reflects OSS philosophy.&lt;br /&gt;&lt;br /&gt;Even for single developers, Something like git or HG are just a single directory that resides on your hard drive, no servers, no setup, no hassle, going from a single developer project to multiple developers project will be very easy.&lt;br /&gt;&lt;br /&gt;There are three major DVCS that i know of (There is darcs but it did not suite me), they are Git, Mercurial (HG) and Bazaar. &lt;a href="http://git-scm.com/"&gt;Git&amp;nbsp;&lt;/a&gt;for example is used to track the Linux kernel , &lt;a href="http://mercurial.selenic.com/"&gt;Mercurial &lt;/a&gt;in Python and Firefox, and &lt;a href="http://bazaar.canonical.com/en/"&gt;Bazaar &lt;/a&gt;in Ubuntu and Launchpad, so the three are used in major huge projects, and they are working well.&lt;br /&gt;&lt;br /&gt;Because is not a comparison article and i am not an expert in either one, i won't compare any, I just will tell you why i chose git, also they are very similar in many concepts.&lt;br /&gt;&lt;br /&gt;First when i tried those a year or slightly more ago, Bazaar was not popular compared to Git and HG and was not relatively speedy (Still damn fast compared to VCSs :)), so i concentrated my research on Git and HG, I chose HG for two reasons BitBucket and the superior Windows support, BitBucket was a free hosting that provides a private hosting with SSL.&lt;br /&gt;&lt;br /&gt;I must&amp;nbsp; admit i did not use the full capabilities of HG, just the basic things, but i better studied git.&lt;br /&gt;The most technical-wise and crucial&amp;nbsp; feature i missed while using HG is not being cool enough :D, Git is adopted by RoR community as well as MacOS :D, and all cool pragmatic people comes from there, so i am not cool enough :D.&lt;br /&gt;&lt;br /&gt;I decided to give it a try, The first feature that i loved in it, is the Index or the staging area, it is a place to prepare your commit with all the changes you only want and then commit, that feels so natural man commits are really organized.&lt;br /&gt;&lt;br /&gt;And branching is very superior in Git, branches are light weight and volatile compared to Mercurial Named Branches and Local Clones, i plan to use small topic branches as much i can.&lt;br /&gt;&lt;br /&gt;Finally the rename tracking feature of git, because git tracks content not files, so it smartly detect rename operations while doing a history review even the files have some changes, it is really killer feature because &lt;br /&gt;i prefer using command line to using a plug-in for VS, so doing renames in VS will be handled automatically in git, in HG i must rename it manually from the command line ("hg has addremove --similarity &amp;lt;%&amp;gt;", but i think git has native support for that since the beginning so it would be better and also if i forgot to do that i would have problems)&lt;code&gt;.&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;A good &lt;a href="http://code.google.com/p/support/wiki/DVCSAnalysis"&gt;comparison &lt;/a&gt;between git and HG and why Google chose to support mercurial hosting.&lt;br /&gt;&lt;br /&gt;Git is great, its interface is harder but it is really intuitive, you will get to know it fast, but remember git has the power of manipulating the history itself and with this power you have responsibility :).&lt;br /&gt;&lt;br /&gt;Give it a try.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9211325913345206620-4965439416745001174?l=kariem2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kariem2k.blogspot.com/feeds/4965439416745001174/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kariem2k.blogspot.com/2010/04/going-git-in-new-project.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/4965439416745001174'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/4965439416745001174'/><link rel='alternate' type='text/html' href='http://kariem2k.blogspot.com/2010/04/going-git-in-new-project.html' title='Going Git in the new project'/><author><name>Karim Ahmed</name><uri>http://www.blogger.com/profile/15607260786211222497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9211325913345206620.post-5770477168152326377</id><published>2010-04-09T00:05:00.008+02:00</published><updated>2010-06-24T12:02:14.733+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Reversing'/><title type='text'>Just opensource it, obfuscation is too much trouble without a real gain :)</title><content type='html'>.Net assemblies can be decompiled very easily by design, using many available tools like Reflector, ildasm, that decompiles the assembly to nearly all of its original code.&lt;br /&gt;&lt;br /&gt;So any reverser can easily reverse your code statically without even the need for debugging, yes patching can be difficult because of the assembly signing with its contents, but reading code and the ability to crack the application will be like a walk in the park.&lt;br /&gt;&lt;br /&gt;.Net assemblies was not designed to be flexible for binary  manipulation of the PE, so protection tricks that were available for  pure native PEs (Packing &amp;amp; Encryption) cannot be done (even it is useless sometimes :)).&lt;br /&gt;&lt;br /&gt;The most  common protection scheme for most of the managed compiled languages is  obfuscation and string encryption (Which will be decrypted  sooner or later at run-time:)), also there is other options, you encrypt whole sections or  whole dlls and then decrypt and load them at run time (memory can be dumped  easily to get the unencrypted contents as well).&lt;br /&gt;&lt;br /&gt;Anyway, I am going to talk about a technique i saw for string encryption, string encryption makes things harder for crackers &lt;br /&gt;&lt;ul&gt;&lt;li&gt;The obfucator processes the code/assembly and create an encrypted binary resource that contains all hard-coded string, this resource is injected into the obfuscated assembly.&lt;/li&gt;&lt;li&gt;The obfucator injects an obfuscated code into the assembly, that code is simply used to retrieve strings from the stream by a calculated index.&amp;nbsp; &lt;/li&gt;&lt;li&gt;It replaces all reads to that strings with function calls to that code.&lt;/li&gt;&lt;/ul&gt;In the case i saw, the strings are indexed into the embedded resource with integer values, the index is generated using assembly's public key token as long with the MetadataToken for the method that retrieves the string from the stream, that provides protection from patching the assembly and altering the signature of it, because if the public key is changed, the retrieval process will be messed up.&lt;br /&gt;&lt;br /&gt;I don't know why they used the MetadataToken in the index generation, I think they did that just to avoid the generation of the index from another method outside the assembly, just to add extra level of complexity.&lt;br /&gt;&lt;br /&gt;But that really does not help at all, because of reflection, what i simply did to decrypt any string i want&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Copied the method code (with fixing the obfuscation artifacts of course), into an external project (using reflector).&lt;/li&gt;&lt;li&gt;using reflection, retrieved the MetadataToken of the indexer method and the public key of the assembly under attack, yes obfuscation renames the method but finding it using the debugger and reflection apis in the watch window is just easy.&amp;nbsp;&lt;/li&gt;&lt;li&gt;Pointing the function to read from the assembly's resource.&lt;/li&gt;&lt;li&gt;Passing any index in the obfuscated code to that function will simply get me the corresponding string. &lt;/li&gt;&lt;/ul&gt;IMHO obfuscation really does not help since obfuscation also puts many limits (mostly the usage of reflection), you should focus your efforts to improve your product and build communities around it, maybe i am wrong, but what i know is as long as your protection code resides in your binary there is no way to prevent crackers from cracking your code, yes you can make it very hard for them, but as long the cracker has the time element and the experience, he can do what ever he wants with your protection.&lt;br /&gt;&lt;br /&gt;Look at this : &lt;a href="http://www.theinquirer.net/inquirer/news/1595262/ubisoft-drm-cracked"&gt;http://www.theinquirer.net/inquirer/news/1595262/ubisoft-drm-cracked &lt;/a&gt;millions of dollars industry still cannot protect itself except for a few days or at most few weeks (But that period has the major profit),  they tried Starforce and it really failed, tried DRM and it really  really failed, they are just putting burdens on the real customers and keep disappointing them :D&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9211325913345206620-5770477168152326377?l=kariem2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kariem2k.blogspot.com/feeds/5770477168152326377/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kariem2k.blogspot.com/2010/04/just-opensource-it-obfuscation-too-much.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/5770477168152326377'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/5770477168152326377'/><link rel='alternate' type='text/html' href='http://kariem2k.blogspot.com/2010/04/just-opensource-it-obfuscation-too-much.html' title='Just opensource it, obfuscation is too much trouble without a real gain :)'/><author><name>Karim Ahmed</name><uri>http://www.blogger.com/profile/15607260786211222497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9211325913345206620.post-8690931025534093116</id><published>2010-04-03T23:51:00.007+02:00</published><updated>2010-04-13T13:22:49.942+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='BDD'/><category scheme='http://www.blogger.com/atom/ns#' term='Projects'/><category scheme='http://www.blogger.com/atom/ns#' term='Design'/><category scheme='http://www.blogger.com/atom/ns#' term='TDD'/><title type='text'>Starting a new side hobby project</title><content type='html'>I am starting a new hobby project (Won't say what it is about now :)), and planning to blog about what i see during the development life cycle.&lt;br /&gt;&lt;br /&gt;It will be a silverlight project backed by WCF web services, I want to experience those things, i have always been in the dark low level side :).&lt;br /&gt;&lt;br /&gt;I was to start it with a full TDD/BDD approach, without knowing anything ahead of me, just the big picture of the system and nothing more, but i found that i don't have enough experience in either TDD or Silverlight that enables me to do it that way.&lt;br /&gt;&lt;br /&gt;So i will start by designing the higher level components architecture and sketch them using UML Component Diagrams which are really perfect for my needs (It defines the system components and the relations between them using interfaces as contracts), that have the huge benefit of&amp;nbsp; breaking the system into smaller pieces (small for my small mind to understand and absorb :)), that will enable me to study each component and its implementation approaches in isolation. Then i will do each component in TDD/BDD fashion.&lt;br /&gt;&lt;br /&gt;What do you think? You had previous similar experiences.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9211325913345206620-8690931025534093116?l=kariem2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kariem2k.blogspot.com/feeds/8690931025534093116/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kariem2k.blogspot.com/2010/04/starting-new-side-hobby-project.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/8690931025534093116'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/8690931025534093116'/><link rel='alternate' type='text/html' href='http://kariem2k.blogspot.com/2010/04/starting-new-side-hobby-project.html' title='Starting a new side hobby project'/><author><name>Karim Ahmed</name><uri>http://www.blogger.com/profile/15607260786211222497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9211325913345206620.post-6325544063992239804</id><published>2010-04-01T07:13:00.002+02:00</published><updated>2010-04-04T14:00:33.772+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Unit Testing'/><category scheme='http://www.blogger.com/atom/ns#' term='Tools'/><title type='text'>NBuilder, a great fluent test object generator for .Net</title><content type='html'>I was planning to do a simple generic implementation of&amp;nbsp; "Builder" pattern to help me generating new test objects semi-automatically, but i came across &lt;a href="http://nbuilder.org/"&gt;NBuilder&lt;/a&gt; which has same functionality that i wanted.&lt;br /&gt;&lt;br /&gt;It has fluent interface with lambda expressions syntax which really helps in generating test objects in a very expressive way. &lt;br /&gt;&lt;br /&gt;Give it a try.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9211325913345206620-6325544063992239804?l=kariem2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kariem2k.blogspot.com/feeds/6325544063992239804/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kariem2k.blogspot.com/2010/04/nbuilder-great-fluent-test-object.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/6325544063992239804'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/6325544063992239804'/><link rel='alternate' type='text/html' href='http://kariem2k.blogspot.com/2010/04/nbuilder-great-fluent-test-object.html' title='NBuilder, a great fluent test object generator for .Net'/><author><name>Karim Ahmed</name><uri>http://www.blogger.com/profile/15607260786211222497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9211325913345206620.post-1594812803509436504</id><published>2010-03-27T20:11:00.004+02:00</published><updated>2010-04-04T13:59:59.097+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><title type='text'>dhcpcd problems with a gatway on different subnet</title><content type='html'>I am using Arch Linux on my home machine, I really love it and it is my distro for 1 year now, the main reason for that is simply because it is a very good (if not the best) and agile rolling release distro.&lt;br /&gt;&lt;br /&gt;The Arch Linux team is really doing great job in the maintenance of the packages. &lt;br /&gt;I never had any break in the system because of the rolling releases nature of it. Except one time with X Server 1.7, it was not yet released and a package (which I don't remember) was depending on it, that only caused warnings in some operations not a big deal. &lt;br /&gt;&lt;br /&gt;Anyway, I recently was Re-Partitioning my Hard Drive and accidentally deleted two of my Linux partitions (/, /home) without any usable configurations backup :(.&lt;br /&gt;Unfortunately I was doing a project on it (Thanks God for BitBucket :)), so I wanted Linux ASAP to continue working on it, but I did not have the time to rebuild my Linux again from scratch (&lt;a href="http://wiki.archlinux.org/index.php/The_Arch_Way"&gt;The Arch Way&lt;/a&gt;).&lt;br /&gt;To solve this I installed fedora 12, which is very good but I am really in Rolling Releases concept.&lt;br /&gt;Finally I had a little time to install Arch again.&lt;br /&gt;My network's topology (Shared Network), has changed in that period drastically, above of all i did not know that :). The main change was putting the Gateway into a different Gateway different subnet than the one I am in and the DHCP server as well.&lt;br /&gt;After installing Arch and as always upping my wlan0 interface, and doing "dhcpcd wlan0" or even "netcfg {myprofile}", caused the following:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;dhcpcd: wlan0: add_route: No such process&lt;/blockquote&gt;&lt;br /&gt;Very vague error that does not show much detail, I searched the logs but no real helping info.&lt;br /&gt;I am not a network or Linux guru, so I accepted the challenge (At least it is a challenge for me :))&lt;br /&gt;Did "route", and only the broadcast entry is there, and it was matching my sub net.&lt;br /&gt;To check on the network configuration, I logged to windows and did "route print". And discovered that the gateway is on a different subnet.&lt;br /&gt;I searched the web using that info, and found that (&lt;a href="http://roy.marples.name/projects/dhcpcd/ticket/170"&gt;default gateway not added if ip and gateway in different subnets&lt;/a&gt;), Also I found out it does not happen to all; it must a bug or something in the gateway itself. &lt;br /&gt;So what I did is adding the routes statically:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;route add {gatewayip}/0 dev wlan0&lt;br /&gt;route add default gw {gatewayip} dev wlan0 &lt;/blockquote&gt;&lt;br /&gt;It worked! But without DNS through the router, so as a quick solution I added “nameserver 4.2.2.3" to "/etc/resolv.conf"&lt;br /&gt;4.2.2.3 is a level 3 Verizon DNS Server; I might have been used 8.8.8.8 which is Google's new DNS service but first thing came to my mind is the Verizon one.&lt;br /&gt;The thing that I am wondering about is that Fedora 12 is using Network Manager 0.7.9999/0.8, which I think (I don't know for sure) uses DHCPCD, and never had that problem.&lt;br /&gt;Anyway today I going to install the rest of the things (dwm, conky, tint2, wicd, etc...), so I get working again :).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9211325913345206620-1594812803509436504?l=kariem2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kariem2k.blogspot.com/feeds/1594812803509436504/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kariem2k.blogspot.com/2010/03/i-am-using-arch-linux-on-my-home.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/1594812803509436504'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/1594812803509436504'/><link rel='alternate' type='text/html' href='http://kariem2k.blogspot.com/2010/03/i-am-using-arch-linux-on-my-home.html' title='dhcpcd problems with a gatway on different subnet'/><author><name>Karim Ahmed</name><uri>http://www.blogger.com/profile/15607260786211222497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9211325913345206620.post-2856872803702569418</id><published>2010-03-14T17:50:00.002+02:00</published><updated>2010-04-04T13:59:44.942+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='.Net'/><title type='text'>Label, buttons text cutoffs when using UseCompatibleTextRendering  = false</title><content type='html'>In a project that is a conversion from VB6 to VB.NET (Using the Upgrade Wizard).&lt;br /&gt;&lt;br /&gt;Many labels had cutoff, for several reasons :), one of the reasons because the "Application Framework" of VB.NET was enabled, which caused the text in the labels and controls that inherit from ButtonBase to be rendered using .Net 2.0 GDI+, so i had to disable it the Application Framework and it fixed the cutoff problems caused by that and that worked great (I did not want to know why that happened, because i was on a deadline, so i simply put that behind me and continued my way in the huge number of bugs resulted :) ).&lt;br /&gt;&lt;br /&gt;Just today i found out that the ApplicationFramework makes the controls text to be rendered using GDI+, why i returned for that damn problem? because the application was using an OCX list control and i had to convert to the .Net version of the control from same company, that control worked well on both vista and windows 7, but on 2003 and XP the control was really messed up :), first thing stroke my head is the "Enable Visual Styles" option when using Appliocation.EnableVisualStyles, that was not the problem but i was lucky enough because the real problem was strangely related to this :)&lt;br /&gt;&lt;br /&gt;I enabled VB.NET application framework and voila!!!, the the control worked fine, but of course we came to the first problem of cutoffs.&lt;br /&gt;&lt;br /&gt;So i dig a little and i found that the CompatibleTextRendering is disabled&amp;nbsp; and related with the Application Framework for some eason.&lt;br /&gt;&lt;br /&gt;So to confirm that is the real problem, I had to enable CompatibleTextRendering, two ways can do this, one before the creation of the first form in the application (Application.SetCompatibleTextRenderingDefault) which defaults that on every newly created Control that has supports UseCompatibleTextRendering, that did not work in VB because in my situation, the entry point to the application is from the Form itself, so there is another way,&lt;br /&gt;&lt;br /&gt;Protected Overloads Shared ReadOnly Property UseCompatibleTextRendering() As Boolean&lt;br /&gt;&lt;br /&gt;Which is placed in application events, when the application framework enabled, and make it return what you need.&lt;br /&gt;&lt;br /&gt;Once i disabled this the cutoffs disappeared and the List Control messed up again, so it is the problem ( I Hope :),&amp;nbsp; so what i did was simple and using a method that was applying fonts recursively to all the controls in all of the forms (Which was made to solve some of the cutoffs along with other things).&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;I set&amp;nbsp; UseCompatibleTextRendering to false for the whole application, to make the list work.&lt;/li&gt;&lt;li&gt;Then applied the UseCompatibleTextRendering = true on every control that either is a Label or a ButtonBase.&lt;/li&gt;&lt;/ul&gt;I hope that helps, it worked for me :).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9211325913345206620-2856872803702569418?l=kariem2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kariem2k.blogspot.com/feeds/2856872803702569418/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kariem2k.blogspot.com/2010/03/label-buttons-text-cutoffs-when-using.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/2856872803702569418'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/2856872803702569418'/><link rel='alternate' type='text/html' href='http://kariem2k.blogspot.com/2010/03/label-buttons-text-cutoffs-when-using.html' title='Label, buttons text cutoffs when using UseCompatibleTextRendering  = false'/><author><name>Karim Ahmed</name><uri>http://www.blogger.com/profile/15607260786211222497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9211325913345206620.post-6106987925934116673</id><published>2010-03-10T10:03:00.002+02:00</published><updated>2010-06-24T11:58:33.355+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tools'/><title type='text'>TiddlyWiki my ultimate notebook</title><content type='html'>I have tried many online note taking applications,&amp;nbsp; but i did not like any, mainly because i need something fast and small to make my notes and thoughts quickly (Google Style :)), Google Notes is great but they stopped supporting it in favor of Google Docs for example, and it is just too much for my needs.&lt;br /&gt;&lt;br /&gt;As an alternative i used to send myself an email a predefined subject prefix so it is gets filtered into a label, i used that for a year now, and it worked good but the categorization and formatting is not good at all for that purpose. &lt;br /&gt;&lt;br /&gt;So i tried to use something like a private wiki, hosted on a free service, but i did not find services that matches my needs (SSL is most important).&lt;br /&gt;&lt;br /&gt;And i stumbled upon TiddlyWiki while i am doing my research, and the idea behind it is great.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.tiddlywiki.com/"&gt;TiddlyWiki&lt;/a&gt; is a very innovative, self-contained, single html file wiki, in combination with DropBox i have a very good, localized, can be used offline and fast way to take my notes, and the synchronization can be made anytime while i am online.&lt;br /&gt;&lt;br /&gt;One something i miss, is the encryption of the wiki's file itself, there is some plug-ins to support that but it is&amp;nbsp; kind of outdated, i did not try them so i cannot criticize :), my solution is using 7zip to compress the file with a password but that also too much and removes the portability (Eg. Mobile Phones), but encryption is important for me :).&lt;br /&gt;&lt;br /&gt;Give it a shot it is really great.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9211325913345206620-6106987925934116673?l=kariem2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kariem2k.blogspot.com/feeds/6106987925934116673/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kariem2k.blogspot.com/2010/03/tiddlywiki-my-ultimate-notebook.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/6106987925934116673'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/6106987925934116673'/><link rel='alternate' type='text/html' href='http://kariem2k.blogspot.com/2010/03/tiddlywiki-my-ultimate-notebook.html' title='TiddlyWiki my ultimate notebook'/><author><name>Karim Ahmed</name><uri>http://www.blogger.com/profile/15607260786211222497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9211325913345206620.post-546984889677238059</id><published>2010-03-01T12:25:00.001+02:00</published><updated>2010-04-04T13:59:06.455+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tools'/><title type='text'>New software GeoSensor just released</title><content type='html'>OF course we all know that windows 7 provides new APIs and services for Geo Location for developers to exploit.&lt;br /&gt;A great SOFTWARE based sensor has been announced, so you can now query your location without hardware sensors, It currently depends on two Google location services (using WIFI and IP for locating you).&lt;br /&gt;&lt;br /&gt;The authors have also made a simple google maps client to exploit the APIs and show your location on the map.&lt;br /&gt;&lt;br /&gt;Firefox has provided similar APIs, starting from Firefox  version 3.5 &lt;a href="http://www.mozilla.com/en-US/firefox/geolocation/"&gt;http://www.mozilla.com/en-US/firefox/geolocation/&lt;/a&gt;, and it can be can be projected on Google Maps  using simple javascript.&lt;br /&gt;&lt;br /&gt;Here is my test for the GeoSense For Windows: &lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_USjqORzP-EM/S4uVvn4RMRI/AAAAAAAAAAM/khUWjtIbNMU/s1600-h/Untitled.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="285" src="http://1.bp.blogspot.com/_USjqORzP-EM/S4uVvn4RMRI/AAAAAAAAAAM/khUWjtIbNMU/s320/Untitled.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;For more information &lt;a href="http://www.geosenseforwindows.com/"&gt;http://www.geosenseforwindows.com/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I think i am going to give Microsoft's APIs a try, especially with that software sensor for free tests :).&lt;br /&gt;&lt;br /&gt;Great Job&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9211325913345206620-546984889677238059?l=kariem2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kariem2k.blogspot.com/feeds/546984889677238059/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kariem2k.blogspot.com/2010/03/new-software-gps-just-released.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/546984889677238059'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/546984889677238059'/><link rel='alternate' type='text/html' href='http://kariem2k.blogspot.com/2010/03/new-software-gps-just-released.html' title='New software GeoSensor just released'/><author><name>Karim Ahmed</name><uri>http://www.blogger.com/profile/15607260786211222497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_USjqORzP-EM/S4uVvn4RMRI/AAAAAAAAAAM/khUWjtIbNMU/s72-c/Untitled.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9211325913345206620.post-2617057976247900426</id><published>2010-02-23T13:23:00.002+02:00</published><updated>2010-04-04T13:57:53.738+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='Reversing'/><title type='text'>Change Product Key of Visual Studio 2008 but "Upgrade" button is invisible</title><content type='html'>I have been working with the trial version of VS 2008, but i was too lazy to change the product key while the trial period is about to end.&lt;br /&gt;&lt;br /&gt;So after the trial period ended, i tried to change it from Add/Remove Programs like i always do, but the problem was the "Upgrade" key and the key entry fields were all missing, so i have tried to change it from "setup.sdb" files and re-run the setup again but no luck.&lt;br /&gt;&lt;br /&gt;So because of the tight time i have,i did not have he option to further investigate (Even if there is a very easy way to do it :)),So i had to do it with the old fashion by Brute Forcing my way in  :).&lt;br /&gt;&lt;br /&gt;What i did is to use WinSpector (It is something like Spy++) to get to the Setup Window and show the "Upgrade" button and the fields and enter the key, and viola, VS 2008 started :).&lt;br /&gt;&lt;br /&gt;I don't know if that is legal or not, but sure it helped :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9211325913345206620-2617057976247900426?l=kariem2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kariem2k.blogspot.com/feeds/2617057976247900426/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kariem2k.blogspot.com/2010/02/change-product-key-of-visual-studio.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/2617057976247900426'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/2617057976247900426'/><link rel='alternate' type='text/html' href='http://kariem2k.blogspot.com/2010/02/change-product-key-of-visual-studio.html' title='Change Product Key of Visual Studio 2008 but &quot;Upgrade&quot; button is invisible'/><author><name>Karim Ahmed</name><uri>http://www.blogger.com/profile/15607260786211222497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9211325913345206620.post-3657319261554284444</id><published>2010-02-18T21:47:00.002+02:00</published><updated>2010-06-21T11:05:58.261+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Stupid Mistakes'/><title type='text'>SQL Server CE does not support ISNULL in a weird way</title><content type='html'>Today i had a strange problem when running a query on SQL Server CE, on customer's machine&lt;br /&gt;&lt;pre class="brush: sql"&gt;SELECT * FROM MyTable WHERE ISNULL(MyColumn,0) &amp;lt;&amp;gt; 0&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;From my basic understanding of SQL that should return all rows that has MyColumn NOT null, but it exactly returned the opposite.&lt;br /&gt;&lt;br /&gt;After some searching i found out that ISNULL function is not supported on SQLCE, but without causing an error (maybe problem by design i don't know), it worked as "IS NULL" so it worked as total inverse of how i wanted it to work.&lt;br /&gt;&lt;br /&gt;Is it my mistake not to read the documentation for basic and natural functions like this when doing development?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9211325913345206620-3657319261554284444?l=kariem2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kariem2k.blogspot.com/feeds/3657319261554284444/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kariem2k.blogspot.com/2010/02/sql-server-ce-does-not-support-isnull.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/3657319261554284444'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/3657319261554284444'/><link rel='alternate' type='text/html' href='http://kariem2k.blogspot.com/2010/02/sql-server-ce-does-not-support-isnull.html' title='SQL Server CE does not support ISNULL in a weird way'/><author><name>Karim Ahmed</name><uri>http://www.blogger.com/profile/15607260786211222497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9211325913345206620.post-1271323646975308503</id><published>2010-01-16T02:57:00.002+02:00</published><updated>2010-04-04T13:56:38.611+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='BDD'/><category scheme='http://www.blogger.com/atom/ns#' term='TDD'/><title type='text'>Test or not to test private methods while doing TDD?</title><content type='html'>I always see that question when reading articles about TDD, and i gave it a thought and IMHO i should not test private methods.&lt;br /&gt;&lt;br /&gt;Simply because TDD is Write the test -&amp;gt; make sure it fails -&amp;gt; write code so the test passes -&amp;gt; make sure the test is green -&amp;gt; REFACTOR the code -&amp;gt; Run tests and make sure all are green.&lt;br /&gt;&lt;br /&gt;Refactoring step is what will make you do private methods,And you are doing incremental small updates to the code, so you will not make a huge public method that consists of many calls too private methods in one shot, you will be constructing that method in a baby steps way and that will lead to actually testing each of that private methods but through the public interface.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9211325913345206620-1271323646975308503?l=kariem2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kariem2k.blogspot.com/feeds/1271323646975308503/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kariem2k.blogspot.com/2010/01/test-or-not-to-test-private-while-doing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/1271323646975308503'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/1271323646975308503'/><link rel='alternate' type='text/html' href='http://kariem2k.blogspot.com/2010/01/test-or-not-to-test-private-while-doing.html' title='Test or not to test private methods while doing TDD?'/><author><name>Karim Ahmed</name><uri>http://www.blogger.com/profile/15607260786211222497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9211325913345206620.post-6912750458224682806</id><published>2010-01-10T10:49:00.003+02:00</published><updated>2010-04-04T13:58:31.457+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Win32'/><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='.Net'/><title type='text'>SendMessage to Window Forms Labels</title><content type='html'>I have an installer that i have made 1.5 years ago which is an NSIS installer that works as a bootstrapper for several MSI packages, It has been required that while the installation of each MSI i report the progress of the installation of the package and as well i do report which MSI is being installed.&lt;br /&gt;&lt;br /&gt;The reporting should be to one of two interfaces, a VB6 application that launches the Bootstrapper exe, or another Self-Extracting NSIS application that gathers all of the msis and the bootstrap NSIS installer.&lt;br /&gt;&lt;br /&gt;What i have is simple, I use the MSI SDK to start each msi installation from the bootstrapper using a customer C/C++ DLL that i call in my bootstrapper through NSIS "System" plugin, and since the MSI gives me the ability to use a C/C++ callback to report the progress of the installation, in the callback i SendMessage to the HWND that i specify to that callback (So it report the progress to a progressbar in the VB6 or the Self-Extractor), and directly SendMessage to a label to the VB6 application from the Bootstrapper in order to update which file is currently being installed.&lt;br /&gt;&lt;br /&gt;That worked well untill i converted the VB6 application to .NET, The progressbar still working as excpected, but sending text to labels caused random unmanged exceptions on Vista machines or messed-up text on XP machines.&lt;br /&gt;&lt;br /&gt;So i had to do a quick dirty solution to fix this (Please tell me if there is an alternative or a cleaner solution), i have made an invisible UserControl, I pass its HWND to the Bootstraper instead of&amp;nbsp; the HWND of the actual label, and if it receives the WM_SETTEXT message it updates the label, Simple hah :).&lt;br /&gt;&lt;br /&gt;I did not override that on a normal label and i use it directly, because setting a text on a label causes a resend of the WM_SETTEXT again and again, which will cause troubles.&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: csharp"&gt;public class LabelSendMessageUpdater : UserControl&lt;br /&gt;{&amp;nbsp; &lt;br /&gt;&amp;nbsp; &amp;nbsp; private const int WM_SETTEXT = 0xc;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;br /&gt;&amp;nbsp; &amp;nbsp; private Label _LabelToUpdate;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;br /&gt;&amp;nbsp; &amp;nbsp; public Label LabelToUpdate {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; get { return _LabelToUpdate; }&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; set { _LabelToUpdate = value; }&lt;br /&gt;&amp;nbsp; &amp;nbsp; }&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;br /&gt;&amp;nbsp; &amp;nbsp; protected override void WndProc(ref Message m)&lt;br /&gt;&amp;nbsp; &amp;nbsp; {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (m.Msg == WM_SETTEXT) {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; try {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (_LabelToUpdate != null) {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; _LabelToUpdate.Text = Marshal.PtrToStringAuto(m.LParam);&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; catch (Exception ex) {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Debug.WriteLine("Error updating control text from SendMessage: " + ex.ToString());&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; base.WndProc(m);&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;&amp;nbsp; &amp;nbsp; }&lt;br /&gt;}&amp;nbsp;&lt;/pre&gt;&lt;br /&gt;I use the awesome "&lt;a href="http://alexgorbatchev.com/wiki/SyntaxHighlighter"&gt;SyntaxHighlighter&lt;/a&gt;", for the code highlighting.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9211325913345206620-6912750458224682806?l=kariem2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kariem2k.blogspot.com/feeds/6912750458224682806/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kariem2k.blogspot.com/2010/01/sendmessage-to-window-forms-labels.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/6912750458224682806'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/6912750458224682806'/><link rel='alternate' type='text/html' href='http://kariem2k.blogspot.com/2010/01/sendmessage-to-window-forms-labels.html' title='SendMessage to Window Forms Labels'/><author><name>Karim Ahmed</name><uri>http://www.blogger.com/profile/15607260786211222497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9211325913345206620.post-7838472309661616031</id><published>2010-01-09T05:15:00.002+02:00</published><updated>2010-04-04T14:01:31.366+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Stupid Mistakes'/><category scheme='http://www.blogger.com/atom/ns#' term='.Net'/><title type='text'>A series of unfortunate events</title><content type='html'>Yesterday, i had&amp;nbsp;a problem in a side project, It is simply a remote debugger for lua scripts on Windows Mobile and J2ME.&lt;br /&gt;A simple windows IDE listens on a port and the device connects to it wainting for the debugging session on the device to start.&lt;br /&gt;On&amp;nbsp;WM version&amp;nbsp;i use a heavely modified version of the awesome OpenSource project "LuaInterface", this version is modified to support the compact framework (because LuaInterface uses dynamic assembly emiting and some reflection calls which are not supported on the CF)&lt;br /&gt;&lt;br /&gt;The problem was when receiving a message to the debugger through a&amp;nbsp;tcp socket, And then&amp;nbsp;i process it and send an ACK to the IDE, but while sending the ACK an "ObjectDisposedException" exception&amp;nbsp;gets thrown&amp;nbsp;refering to the socket object is disposed.&lt;br /&gt;That is a popular exception when working with sockets and the connection between the client and the server&amp;nbsp;gets cutoff.&lt;br /&gt;&lt;br /&gt;So my initial (and unfortunatly the only) thinking "Argggggg, what makes that damn&amp;nbsp;connection get closed", trying everything from checking if i accedently terminated the connection thread from the server or an exception gets thrown that causes the temination of the connection, specially that happens only when&amp;nbsp;gracefully&amp;nbsp;disconnecting and reconnecting to the server. BUT NOTHING.&lt;br /&gt;&lt;br /&gt;The silly mistake:&lt;br /&gt;&lt;br /&gt;When i terminate the connection gracefully, and when reconnecting again i recreate&amp;nbsp;the client object(responsible for parsing commands and making calls to the luadebugger) which contains the socket object, and i inject to it&amp;nbsp;the luadebugger object which&amp;nbsp;has a longer life-time.&lt;br /&gt;In the intialization of the client&amp;nbsp;object i&amp;nbsp;also register the events of the luadebugger&amp;nbsp;object toe th&amp;nbsp;event handlers defined in&amp;nbsp;my client object.&lt;br /&gt;&lt;br /&gt;When i dispose the client object, i don't -= (Unregister)&amp;nbsp;the event handler of that object, so when the debugger changes its state that event handler&amp;nbsp;gets called and try to send the ACK despite the object is not used anymore and the socket&amp;nbsp;object is&amp;nbsp;disposed.&lt;br /&gt;&lt;br /&gt;Silly me hah.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9211325913345206620-7838472309661616031?l=kariem2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kariem2k.blogspot.com/feeds/7838472309661616031/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kariem2k.blogspot.com/2010/01/series-of-unfortunate-events.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/7838472309661616031'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/7838472309661616031'/><link rel='alternate' type='text/html' href='http://kariem2k.blogspot.com/2010/01/series-of-unfortunate-events.html' title='A series of unfortunate events'/><author><name>Karim Ahmed</name><uri>http://www.blogger.com/profile/15607260786211222497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9211325913345206620.post-4924009728639979489</id><published>2010-01-06T16:53:00.001+02:00</published><updated>2010-04-04T13:55:02.820+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tools'/><title type='text'>Dropbox is a bless</title><content type='html'>I use windows on both home and work machines, on my home pc&amp;nbsp;i also use Archlinux.&lt;br /&gt;&lt;br /&gt;I have some configuration files, some documents that always get updated.&lt;br /&gt;&lt;br /&gt;Maintaining and syncing&amp;nbsp;the files between environments may be a problem, so i hosted these files on a public SVN server and use svn to keep these files synchronized, the svn host supported SSL which was very important for me, another feature that svn repo can be browsed from any browser so i can get the file from any where even i don't have svn on that machine, that was working well for me, Until i discovered Dropbox!.&lt;br /&gt;&lt;br /&gt;Dropbox is a very good application that works on Linux, Windows, MACs, it simply creates a special directory that is&amp;nbsp;automatically synchronized with their secured web, even the previous file versions (Not as powerful like SVN method because SVN maintains history of commits and can do&amp;nbsp;diffs&amp;nbsp;etc.., but that is not a big deal to me).&lt;br /&gt;&lt;br /&gt;The operation cannot be more simple just drop the files on the special folder and it will be automatically uploaded, and synced on other registered machines).&lt;br /&gt;&lt;br /&gt;The free space is huge for my purposes, at the time of this post it is 2 GB.&lt;br /&gt;&lt;br /&gt;It is a really good solution, give it a try!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9211325913345206620-4924009728639979489?l=kariem2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kariem2k.blogspot.com/feeds/4924009728639979489/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kariem2k.blogspot.com/2010/01/dropbox-is-bless.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/4924009728639979489'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/4924009728639979489'/><link rel='alternate' type='text/html' href='http://kariem2k.blogspot.com/2010/01/dropbox-is-bless.html' title='Dropbox is a bless'/><author><name>Karim Ahmed</name><uri>http://www.blogger.com/profile/15607260786211222497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9211325913345206620.post-7720586550290836700</id><published>2010-01-05T08:49:00.001+02:00</published><updated>2010-04-04T13:54:29.651+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Unit Testing'/><category scheme='http://www.blogger.com/atom/ns#' term='BDD'/><category scheme='http://www.blogger.com/atom/ns#' term='TDD'/><title type='text'>Everyday i realize unit testing is a must</title><content type='html'>Hi,&lt;br /&gt;This is my first blog post YAY!!!&lt;br /&gt;I am average (or less :)) developer, knowing things from here and there, Just expressing my personal opinions about what i see.&lt;br /&gt;&lt;br /&gt;Here is one of my personal experiences that made me realize that unit testing is one of the most valuable tools that must be used by every developer.&lt;br /&gt;&lt;br /&gt;I am working with a relatively big client, to maintain their working projects that use technologies like VB6, ASP, COBOL, or porting these projects to newer technologies like .NET (Windows Mobile,SOAP Webservices, ASP.NET, Windows Forms, etc...), and handling the deployment of these projects.&lt;br /&gt;&lt;br /&gt;I am working on systems that depend heavily on Ad-Hoc Stored Procedures, Those SPs contain most of the business logic, every SP handles enormous business logic operations. What makes things more complicated that the system is made to support various back-end systems (COBOL Systems for example), so maintenance or adding features is a kind of hell (Or at least for me and my potentials :)), because it leads to serious amount of regression bugs.&lt;br /&gt;&lt;br /&gt;One of the tasks that was assigned to me is to correct a certain logic defects, I had to make my automated testing application that compares the calculations from the System to the original legacy but stable COBOL system, believe me that was very difficult to make everything work as expected and not introducing regression bugs (Because combination of myself, bad design, lack of entry points for testability, etc...).&lt;br /&gt;&lt;br /&gt;Before, i have worked on two projects that adopts things like DDD &amp;amp; Unit Testing (Not TDD or BDD which i am pursuing now to get a grep on it) , so at i least know some of the Pros. and Cons. of the process, and i tell you these approaches would helped me a big deal in some of the situations.&lt;br /&gt;&lt;br /&gt;In my opinion TDD as a methodology to drive your design, is a very effective method for driving your code to be testable.&lt;br /&gt;&lt;br /&gt;Here is how i think and understand TDD, please correct me if i am wrong:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;You are not a QA you are a developer who is pursuing meeting your customer's expectations, TDD helps you to do that, In TDD you are writing features check lists not tests, you check if the feature which the user will use will meet his expectations or not, that is killer thing to be able to understand TDD (BDD is invented to correct the mindset of the name "Test" in TDD to fix the issue i mentioned).&lt;/li&gt;&lt;li&gt;By not acting as a QA when writing your tests using TDD, you now guarantee two things:&lt;/li&gt;&lt;ul&gt;&lt;li&gt;Your code will be loosely coupled and that is a good feature anyway :).&lt;/li&gt;&lt;li&gt;Your code will be a lot more testable for further ordinary unit tests.&lt;/li&gt;&lt;li&gt;I tend to test drive my code to reach a stable non-changeable base(To avoid changes in tests when changes to code happen and that happens a lot in early stages in development), that assures that the code is working from the perspective of the user, then start writing extra unit tests(as a QA mind this time :)) to test extra different or extreme cases, and that strengthen my code with ordinary unit tests for higher code coverage.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;In conclusion, IMHO Unit Testing with its variations is one of the best practices that should always be used, but in its right places.&lt;br /&gt;&lt;br /&gt;Everyone values what he/she does not have :). &lt;br /&gt;&lt;br /&gt;Thanks&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9211325913345206620-7720586550290836700?l=kariem2k.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kariem2k.blogspot.com/feeds/7720586550290836700/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://kariem2k.blogspot.com/2010/01/everyday-i-realize-techniques-like-tdd.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/7720586550290836700'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9211325913345206620/posts/default/7720586550290836700'/><link rel='alternate' type='text/html' href='http://kariem2k.blogspot.com/2010/01/everyday-i-realize-techniques-like-tdd.html' title='Everyday i realize unit testing is a must'/><author><name>Karim Ahmed</name><uri>http://www.blogger.com/profile/15607260786211222497</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry></feed>
