Saturday, April 19, 2014

New era of version control systems

May Allah`s peace , mercy and blessing be upon you

"Revision control, also known as version control and source control ... is the management of changes to documents, computer programs, large web sites, and other collections of information". That what wikipedia says about VCS, also in the overview they define a VCS as "... any kind of practice that tracks and provides control over changes to source code."

Today, you can find many great, good, bad and ugly version control systems like Git, Mercurial, Bazzar, SVN, CVS [order is not arbitrary]... but It turns out none of them is good enough for the company, a company that a friend of mine has interned at and told me about their ultimate VCS.

In this company - a well known multinational company that I'm not going to name -, if you want to proceed with a change you don't need to fork or clone or pull. What you do is that you duplicate the lines that you are willing to change, then comment the old ones and put a comment before and after the new code where you put an ID. To get this ID you insert a record in a Microsoft Access database where you specify changes and reasons etc, then you get the ID of that record and put it back in the comment. Changes are copied manually and added to the master if they are correct and god knows what test system they have.

Wow, amazing !! I couldn't believe this reactionary VCS, and what are the reasons behind this choice. And yes I called it a VCS because it's a "... practice that tracks and provides control over changes to source code".

Thursday, July 18, 2013

Blogger & AngularJs - Is it a better love story than Twilight ?

May Allah`s peace , mercy and blessing be upon you

I shared recently a post about how I got that idea to use AngularJs with Blogger using RSS as a resource and modding comments. Today, I want to share with you my impressions after two weeks since I launched the experiment.

Disclaimer: The experiment was on this blog, it's a small personal blog with minimalistic design, limited number of posts and few visitors, so my judgement will be based on those facts. Behavior on larger blogs isn't guaranteed to be the same.

What I like about it ?

It's very light, swift and fast, the page is visible quickly even with using a custom font and many base64 resources, not to mention that Angular for a reason that I don't understand loads resources for all posts even if they aren't rendered nor in the DOM yet !!!

Tuesday, July 2, 2013

Rebuilding Jaw,B blog

May Allah`s peace , mercy and blessing be upon you

Hello everyone, first of all, I think you noticed the comment's css bug, I don't know why the comments floats from the parent !! so I decided to redesign the blog and do some optimisations.

I didn't wanted the whole experience to be just old regular web development, like I used to do. Hence I decided to apply some of the great tools that I installed a long time ago but never used. I began with setting up directories and use Bower to download libraries, then I initialized Guard to watch javascript files and concatenate them and do Livereload. Also, I used Sass, Compass and Zen-grids for CSS.

Sunday, May 19, 2013

Guide : Installing Android Studio on Ubuntu

May Allah`s peace , mercy and blessing be upon you

Hi, if you watched (or assisted -if you are that lucky-) the Google I/O then you couldn't resist installing the new Android development environment the early access preview. Android Studio the IDE built on IntelliJ IDEA with a lot of features for Android development and debugging, making the process faster and more productive. Coming with extensible build tools, powerful code editing, smoother and richer GUI .. you can read these stuff here.

So, if you are like me, an Eclipse/ADT user you must wonder why they went with IntelliJ IDEA instead of Eclipse ? they responded with : "Because when we did just Eclipse, people kept asking for IntelliJ support" , "We will support both Eclipse and the new IntelliJ-based Android Studio. Eclipse support is not going away". Eclipse is still supported but I'm not that loyal :) to the IDE to stick with it.

Saturday, March 9, 2013

Pepper Pyramid - (Hologram) Experiment

May Allah`s peace , mercy and blessing be upon you

Nothing nerdy this time, I just wanted to share this experiment about pyramid holograms. In fact, many people prefer to call it Pepper Pyramid, called on John Henry Pepper who created the Pepper's Ghost effect. The principle is simple, the four sides of the pyramid are made of reflective glass or plastic so they can reflect four images taken from the sides of the object or scene, and they reflect each others which makes the object looks in a 3D way.

So here are some not very well pics due to the poor camera and the darkness :

Friday, December 7, 2012

MCPC 2012 - Problem D : Minimum bounding rectangle

May Allah`s peace , mercy and blessing be upon you

P.S: This is not the original text, I rephrased and summarized the original one because I'm lazy and I couldn't type the whole text. if there is an error it's my mistake.

[D] SCPC:
We need to build a contest hall in the shape of a cuboid (3D rectangle). for economical reasons, we need to minimize the size (area) of the rectangle. So given the coordinates of the teams, calculate the minimum rectangle area of land for a building big enough to fit all the teams.

Input :
T: number of cases.
N: number of teams.
Xi Yi: coordinates of each team.
1<=T,N<=100,
-10000<=Xi,Yi<=10000

Output:
Single line starting with case number, followed by the area of the minimum rectangle rounded to 4 decimal places.

Example :
4
4
0 0
1 1
1 0
0 1
4
0 0
2 2
2 0
0 2
4
0 0
1 2
1 0
0 2
3
0 0
1 0
1 1
--->
Case 1: 1.0000
Case 2: 4.0000
Case 3: 2.0000
Case 4: 1.0000

Contest Analysis :

Wednesday, December 5, 2012

MCPC 2012 - Problem C : Shortest path in a grid

May Allah`s peace , mercy and blessing be upon you

P.S: This is not the original text, I rephrased and summarized the original one because I'm lazy and I couldn't type the whole text. if there is an error it's my mistake.

[C] LCPC:
Chief judge Fegla and Nicole are in a university and need to meet each other to smoke Shesha O_o' !!! the problem is that all the walkways in the campus form a rectangular grid that has some strange properties :
No one can walk elsewhere the cells of the grid.
Any person on a cell can only go the cell on his left, right, front, rear, the walk takes one second.
Person can't get out of the grid's boundaries.
If a tree is planted in a cell, no one can walk on this cell.
Fegla and Nicole are in two cells(not necessarily different and has no tree)  they start looking for each other taking one action each second simultaneously, your job is to find the minimum number of seconds needed to meet.

Input :
T: number of cases.
R C: number of rows, number of columns.
r1 c1 r2 c2: Fegla's coordinates, Nicole's coordinates.
N: number of trees.
N lines : TRi TCi Tree i coordinates.
1<=R,C<=20, 0<=r1,r2<=R, 0<=c1,c2<=C,
0<=N<=R*C-2, 0<=TRi<=R, 0<=TCi<=C

Output:
Single line either the minimum number of seconds or -1 if they can never meet.

Example :
4
1 3
0 0 0 2
0
2 3
0 0 1 0
0
2 3
0 0 1 2
3
0 2
1 0
1 1
2 3
0 0 0 2
1
0 1

--->
1
1
-1
2

Contest Analysis :

Tuesday, December 4, 2012

MCPC 2012 - Problem B : Minimal and maximal rate

May Allah`s peace , mercy and blessing be upon you

P.S: This is not the original text, I rephrased and summarized the original one because I'm lazy and I couldn't type the whole text. if there is an error it's my mistake.

[B] JCPC:
Chief judge was hospitalized, he was kept in until a test (that returns a positive real number) dropped to 2.0 or less. Given the current result H and number of days D and provided that he is tested every hour and released immediately if result <= 2.0 print the minimum and maximum rate of decrease in this measurement to be released from the hospital after D days, but not after D+1 days.
1 day = 24 hours, very useful information !!!

Input :
T: number of cases.
T lines : H(current measurement) D(number of days)
1<=T<=200, 3<=H<=100, 1<=D<=150

Output:
Single line for each case in the following format : <maximum rate> <minimum rate> rounded to 5 decimal places after decimal point.

Example :
1
5 2
--->
0.06250 0.04225

Contest Analysis :

Monday, December 3, 2012

MCPC 2012 - Problem A : Pattern matching

May Allah`s peace , mercy and blessing be upon you

P.S: This is not the original text, I rephrased and summarized the original one because I'm lazy and I couldn't type the whole text. if there is an error it's my mistake.

[A] ACPC:
One of your friends spilled coffee on a form, luckily it wasn't totally destroyed. You will tell him what the fields on his form say for him to fill. You are given all the fields in your form as two strings <label>: <info> and the given questions. Each question is a string that was originally a label in the form but got some of its letters covered by coffee.

Input :
N: number of labels.
N lines : <lable>: <info>
M: number of questions.
M lines: <question>
1<=N<=100, 1<=M<=100, M<=N
<label>,<info> : string of lowercase & uppercase English letters
<question> : string formed of lowercase & uppercase English letters and question mark '?'.

Output:
Single line for each question in the following format : <original label>: <original info> that contains the first matching label and the info that matches it.

Example :

4
Name: Amr Samir
Age: 21
University: Cairo Univ.
Smoker: no
2
?m????
??m?
--->
Smoker: no
Name: Amr Samir

Contest Analysis :

MCPC 2012 Just Another Wonderful Day, Briefly !!

May Allah`s peace , mercy and blessing be upon you

Hi again, it's been a while. This time I'm going to talk about another fabulous experience, the ACM-MCPC 2012 (Moroccan Collegiate Programming Contest) it's the 1st edition of the local qualification programming contest to the ACM-ACPC (Arab Collegiate Programming. Contest).
First of all I'll like to thank my university ENSIAS and the ACM represented by Eng. Mohamed Fouad (Deputy Regional Contest Director) and the judges. Also I'll like to thank the organizing committee for the great work, and congratulate them for organizing the event in record time.

Thursday, September 6, 2012

PHPLogger: Debugging PHP in console

May Allah`s peace , mercy and blessing be upon you

Yesterday, I got nostalgic about PHP because recently I used too much JavaScript and some Python, and what these two have in common is real easy debugging beside coolness . Back to PHP days I didn't care about debugging because I was a beginner - and still :P - , so I was satisfied with the old tricks echo, print_r , var_dump, die ... - etc Like if there is many :) - .

Debugging PHP really sucks , I know that PHP fans will be furbishing their swords already and start praising their tools but additional software like Xdebug is not practical when used outside IDE. I hate to get confused by windows so I use only two : Browser/Editor or Terminal/Editor. Therefore, using other terminal(s) to debug makes me discomfortable.

Wednesday, August 22, 2012

Matrixify 1.1

May Allah`s peace , mercy and blessing be upon you

Update : Matrixify now on Sublime Package Control.

Matrixify gets it's first update .. Oh Yeah !! :P , Seriously just a little update. I am new to Python and Sublime Text 2 plugins development but I used enough plugins to make me have the hunch that the method I'm using to read the format is not the genius one !!

I am lazy to look for solution so I asked on the ST2 forum and facelessuser answered : Sublime have an input form that prompt so it's a logical choice.

Another thing that come up is the indexes that I used for my arrays to output the matrix become much easier to calculate when the lines 0 is included.
output += separators[i%dim] + line + (lengths[(i%dim)] - len(line))*" "
if (i%dim) == dim-1:
    output += separators[dim] + "\n"

Thursday, August 16, 2012

Matrixify - a Sublime text 2 plugin

May Allah`s peace , mercy and blessing be upon you

Back to blogging ? No and yes , No because I never quit blogging and yes because I wasn't working on any exciting thing  that worths sharing. for the past months I spent time on Android development - just some basic stuff - , and reading some C++ books . I found C++ very interesting whatever what people said about how complex it is , it's expressive and efficient that's what matters !!

Back to our talk for today, I was trying to build a Gameboy emulator with C++ . I am new to the experience of emulation so I decided to read a source code to understand the architecture of the device.
There is a lot of open source emulators but I couldn't found a simple documented one , here comes Imran Nazar he tried to write an emulator using javascript, so I'am translating the code into C++.

Saturday, April 7, 2012

Day 2 : InputCanvas 2.0

May Allah`s peace , mercy and blessing be upon you

Hi , Last time I wrote the BasicShape object , today I think that I should add some proprieties : value & font in order to add text to shapes. Also a font's setter method :
/**
   * Set font proprieties.
   *
   * @param int size       : Size of border in pixel.
   * @param string color  : Color of border (Hex).
   * @param string family : Font family.
   * @return void
*/
BasicShape.prototype.Font = function (size, color, family) {
   this.font.size   = size   || 14;
   this.font.color  = color  || '#000000';
   this.font.family = family || 'Arial';
};
The next big thing is how to draw text on a shape while respecting border , border-radius , and padding ?!!

Monday, February 20, 2012

Blogger custom comment form [Wordpress like] - Part II

May Allah`s peace , mercy and blessing be upon you

Last time we transformed all inputs to a single JSON object which would be stored in a plain text comment and sent to the server , this time we will try to display those comments.

Ok we need to get the JSON string stored in comment's body from Blogger's database using :
<b:loop values='data:post.comments' var='comment'>
      <data:comment.body />
</b:loop>

Saturday, February 11, 2012

Blogger custom comment form [Wordpress like] - Part I

May Allah`s peace , mercy and blessing be upon you

I was playing with Blogger's comment form using Firebug . If you don't know, Blogger uses an iframe to display the form , So because of the Cross-domain we can't style the form neither apply any Javascript code on it .

First, you need to know the major inconvenient of this method : comments will be considered as spam , So you have to check Not spam manually every time to make the comment visible (if you already administrating comments then you are used to).

Let's look at the next HTML code :
 
<form id="commentForm" method="POST" action="http://www.blogger.com/comment-iframe.do">
    <input type="text" id="user" placeholder="User Name" />
    <input type="email" id="email" placeholder="email" />
    <input type="url" id="url" placeholder="Website" />
    <textarea id="text"  placeholder="Text..."></textarea>
    <input type="hidden" name="commentBody" id="commentBody" />
    <input type="hidden" name="security_token" value="AAAAAAAAAAAAAAAAAAAAAAAAAA:***********" />
    <input type="hidden" name="blogID" value="**************" />
    <input type="hidden" name="postID" expr:value="data:post.id" />
    <input type="hidden" name="identityMenu" value="ANON" />
    <button id="sub">Submit</button>
</form>

Friday, February 10, 2012

Canvas : Shape + shadow

May Allah`s peace , mercy and blessing be upon you

Hi, I've been working on InputCanvas and I faced an issue , finally I got to the solution and I'll share it with you .

I'll use this beautiful cloud from html5canvastutorials.com

Tuesday, February 7, 2012

Day 1 : InputCanvas 2.0

May Allah`s peace , mercy and blessing be upon you

Today I'll start redesigning InputCanvas , the old version wasn't clear and customisable. There was only 2 objects FormCanvas and InputCanvas , and only text input.
In this new version I'll try to create so match more objects that we can use separately. Also I'm going to use one of the most important feature in OOP which is inheritance , the most important object is BasicShape it's the parent object of all types of inputs with basic proprieties and methods.

Monday, February 6, 2012

InputCanvas 2.0

May Allah`s peace , mercy and blessing be upon you

Hi, I have been developing InputCanvas.js in the open (on github.com), It's the first Javascript Library to create real forms and inputs on the Canvas element . It's not HTML's native inputs and no CSS positioning .

What can I do with InputCanvas?

You can create forms and inputs that work exactly like usual html fields on canvas , with events and style support.

How can I use it ?

Using InputCanvas is really simple . just follow the steps :

Sunday, February 5, 2012

Why english ??

May Allah`s peace , mercy and blessing be upon you

Ok, for a long time I was blogging in Arabic - I don't know yet but may be I'll continue - , for the moment I am trying to start blogging in English . Why? that's a good question.

First of all , I am working on some open source projects. So you guessed I need to write documentations, instructions , tutorials and so on . Writing those things in Arabic or French is against Freedom of information . English is international , that's a fact specially in technical domains ,  people all over the world can read and understand what I am writing : Africa , ME , US , UK , China , India , Japan ...

Secondly, I should switch my blogging efforts to English articles, in order to reach a wider audience , get more feedback and to have interesting discussions. 

In the third place , Blogging and Tweeting are my only activities that needs writing :) , So I want to improve my English by writing articles .

I hope this blog will be good enough for you . Enjoy reading and reacting .

Zoli Issam's blog proudly powered by Blogger | All rights reserved Jaw,B 2010-2013