Tuesday, October 07, 2008

Where do you want to connect today?

Long time no posts..
Anyway, I'm here now to share that website with you..
It just saves the time u take to write or modify a connection string to any data source..

Tuesday, September 02, 2008

I wish I learned.. (survey)

I decided to make that survey in order to see people's different opinions, The survey is about things you wish you leanred at college & that are related with the market or your career.
so I want everyone to tell me 5 things or more, he wished he learned at college before he starts working OR things he self-learnt by himself and he thinks that they are important for others to learn. (including technical (maybe certain technology), non-technical things)
Waiting for your comments..

Sunday, August 03, 2008

Saving a Bitmap

A friend of mine came through a problem while dealing with Bitmaps after writing some code that should open an image.. do some operations & finally save it in the same path. (overwrite the old copy)... the code looked as follows :
Bitmap
bmp = new Bitmap(@"C:\Pic.jpg");
..
//Do some Operations on bmp
..
btm.Save(@"C:\Pic.jpg");


An Exceptions is then fired on the bmp.Save(..) statement "A generic error occurred in GDI+"

At the first look, it seemed strange to see the exception esp the "Save" method should handle the overwriting process..
Yet, here was the mistake.. After creating the first bitmap from the image file, a lock has been done on the file in the memory, & then later, we are trying to save the bitmap in the same file (which is currently locked) & that's why we get that exception.
It will work in case you wanted to save in different paths, but not in case of overwriting..

so the suggested solutions was to create a copy from that bitmap, make the operations on that copy.. then dispose the bmp object (to release the lock) & later on save it (using the copy).. the new code should look as follows :

Bitmap bmp = new Bitmap(@"C:\Pic.jpg");
Bitmap copy = new Bitmap(bmp.Width, bmp.Height);
Graphics g = Graphics.FromImage(copy);
g.DrawImage(bmp, new Point(0, 0));
..
//Do some Operations on copy
..

//release the image file

bmp.Dispose();
bmp = copy;
bmp.Save(@"C:\Pic.jpg");

That's it..

Wednesday, June 04, 2008

Acrobat.com

Adobe is providing a suite of online services on their website Acrobat.com that you can use to create documents together and share them with others,
If you are a fan of google docs , then I suggest you try Buzzword.. Buzzword is one of those services that allow you to create documents & share them.

Another service is Create PDF that allows you to convert many files formats to PDFs & much of more converting PDFs to flash to be embedded in web pages (It's really good, I once tried it here)

But what I really liked most is Adobe Connect now, it is indeed one of the very nice services that allows you to make an online meetings that involves desktop sharing, video & audio conference calls & chatting... when I tried it, it was kind of slow but I think the reason was my internet connection..

Anyway, I truly like their services.. give them a try..

Thursday, May 29, 2008

MIT OpenCourseWare

That's reallly coool, maybe this news is from a while, but I just knew it now :)
MIT is opening its 1800 courses for free download (materials, audio & video) including graduate & undergraduate courses, Here is the link.. ENJOY :)

Monday, May 12, 2008

Open Sourcing - Security Package

As me & my friends has previously done with our image processing package, we are sharing our security package too on google code ::
Security Package (Source)

The project doesn't have a good UI, but it contains an implementation for most algorithms in security (except for the RSA & Hill Cipher, they have restrictions in implementation due to limits in time)
Hope that's useful for anyone :)

Thursday, May 01, 2008

Best & Worst Languages

Maybe when someone read the title, he
thinks that I will write here about the best & worst languages of all languages, which isn't a valid topic to talk about simply because there are no best & worst languages.. for every application there are best & worst languages to use to develop this application...

Anyway, what I wanted to share is that table in the post, I came through it while reading Code Complete , & I thought that this is what anybody would need before thinking about which language to use to develop/implement an application..
(ie: this is a common question for students starting to work on their graduation projects)..
I liked it, so thought about sharing it here..


Tuesday, April 01, 2008

What's new in C# 3.0 ?? - Part 1

I'll be writing -in shaa Allah- a series of posts about the new features in C# 3.0.. I'll start this one with the improvements that were done on C# 2.0..

1) Auto-Implemented Properties:
How much time does the one spend writing private members in a class & writing their public properties.. too much ha? .. I hear someone saying "you can use snippets" .. ok, that will be fine yet this is still too much.. so here is one of the enhancements done in C# 3.0 which is the auto-implemented properties.. instead of writing sth like this..

class Employee
{
private string
empName;
public string
EmployeeName
{
get
{ empName = value; }
set
{ return this.empName; }
}
}

All you need now is to use the auto-implemented properties instead..

class Employee
{
public string
EmployeeName { get; set; }
}


The question regarding accessing private members from inside the class, well.. as there's no private members (or they are hidden), you have to use the properties to access them too..

2- Object Initializers:
Sometimes we want to set a lot of properties of an object while initializing it, but yet this isn't supported in any of the class constructors..so here comes the importance of the object initializers feature.. which will be very helpful while working with win forms & many of the .net libraries in setting properties more easily..

static void Main(string[] args)
{
Employee
e = new
Employee () { EmployeeName = "Roaa"};
}


3- Collection Initializers:
The same concept as the object initializers, but the difference is setting the values of a collection, It can be used by any collection which implements IEnumerable..

static void Main(string[] args)
{
List
<Employee>
employees = new List<
Employee>()
{

new
Employee () { EmployeeName = "Roaa" };
new
Employee () { EmployeeName = "Someone" };
new
Employee () { EmployeeName = "Roaa"};
};
}


4- var - Local Variable Type Inference
For an example as the follows, we notice the redundancy of information of the type..

Dictionary
<int,Employee>
employeesDict = new
Dictionary<int,Employee> ()

As the matter in fact, the compiler can be intelligent enough to find out about the type of the variable when a value is specified in the assignment statement.. so here comes the use of the 'var' which makes writing the code more smoother & easier..

var employeesDict = new
Dictionary<int,Employee>

but there are some restrictions on using 'var'.. as it is clear, it is for Local use only.. can't be used in return values, arguments.. etc..
Another thing, the use of 'var' doesn't affect the performance by any mean..

To be continued...

Friday, March 28, 2008

Finally, EDC 2008

I wrote a previous post about the timing of the EDC, finally the registration is now opened...
Check out the details at http://edc2008.com/
It is for 2 days (13th & 14th of April) in Cairo international Conference Center..
See you there in shaa Allah..

Wednesday, March 19, 2008

Microsoft Student Festival 2008 Wave..

Ahmad Fathy -MSP in Engineering, Alexandria university- is making a series of posts on his blog about Microsoft Student Festival..
He asked me to contribute in the Microsoft Student Festival 2008 Wave by sending my experience in MS Internship booth, check the post here.
Thanks Ahmad & waiting for more interesting posts !!

Monday, January 28, 2008

EDC 2008

Many did ask me about the timing of Microsoft EDC (Egypt Developer Conference) - previously known as the MDC- , so I'm publishing it here
The EDC will be on 13-15 April in intercontinental City Stars, The Reservation is still closed but I'll put the link as soon as it's available in shaa Allah..

Friday, January 04, 2008

Open Sourcing - Image Package

During the past days, we were delivering our projects for this semester after long days of working & coding..
At the end of these days, I started to think with my friends "what are we going to do really with this code?" .. I thought a lot about the end of previous years projects & I found that all of them are just resting in a folder called "projects" on my PC .. so I had a different idea this time.. "what about making our projects open source for anyone to learn from it??".. my friends approved & that was the beginning..
so here is the link for our image processing package (version1) on Google Code ::
Image Processing Package

(Image.cs (contains most of the implementation) & the exe uploaded only till now, Full version will be uploaded immediately after some bugs fixing in shaa Allah)