Tuesday, September 30, 2008
Monday, September 29, 2008
Wine -- Windows Applications On Linux
Wine is a program that runs MS Windows applications on Unix-based systems by providing a compatibility layer by implementing some of the Windows APIs and wrapping the others to call native Unix functions, X server, and OpenGL. Wine implementation is all in userland (outside the kernel and doesn't need special privileges)[1].Wine was originally short of WINdows Emulator, but I a am not sure about if that's still the case. "Wine" is originally a recursive acronym "Wine Is Not an Emulator"[A]. (Update) Wine is more of a compatibility layer than of an emulator. An emulator usually emulates hardware, like a Playstation emulator (offtopic: I know a good one called pSX).
Wine doesn't only implement Windows system calls, but also most of the DLLs that comes with
Windows. Most notably DirectX (which is one of the top reasons to use Wine; playing Windows games on Linux). If you are a windows license owner you can use some of the native Windows DLLs instead (but others can't be used).
ReactOS[8] is to Windows as Linux is to Unix. A free and open source alternative. It uses Wine code. Several other commercial projects uses Wine too, like TransGaming Cedega and CodeWeavers CrossOver (and others). The former is a fork of Wine specially for gaming, they do NOT send their patches to the main-stream Wine. The latter is both a general-purpose and gaming-purpose dedicated development for Wine. Unlike the former, the latter sends it patches instantly to the main-stream Wine. It relies mostly on support for profit (as for what I understood).
Google have paid CodeWeavers to make Wine able to run Photoshop CS 2 on Linux[2]. CodeWeavers also have acted quickly to to make Wine able to run Google Chrome on Linux, and they made it in 11 days[3]. Google has actively encouraged Wine development through their interns [4] and through student participation during the Summer Of Code 2008 [5].
The only Microsoft acknowledgment about Wine, is to state it is not Genuine Windows and therefore deprived from Windows Genuine Advantage (some downloads). [6] Generously, Microsoft still allows some updates, like Office updates to Wine users. [same source]. (See [7] for instructions how to install Office 2003 on Linux.)
Wine is not small at all. WINE 1.0 have over 1.8 million lines of C code (with blank lines and comments), ~300,000 of which are tests, and ~87000 are related to Direct3D (a subset of DirectX) implementation[original research]. I am not sure how big is the Micorsoft Subsystem for Unix-based Applications (SUA)[9](*1), but I am sure it is much less. That's because what a Unix program assumes to find in a system is much less that what a Windows application assumes to find (which are thousands of Windows APIs[10]).
(Update)
Due to the large amount Wine has to implement, it doesn't implement all of the Windows APIs yet. A program that depends on an unimplemented API might not function correctly. Wine developers try to implement high-priority APIs first. Those are the ones used by the most popular applications. (For a list of which programs are compatible with Wine check Wine AppDB[11])
(Update)
Wine have been in development for more than 16 years (since 1992); even before Linux was born[12]. Wine's still not complete, because it faces the problem with catching up with more recent Windows systems. For example (not saying that this have actually happened), when they completely supported Windows 95 applications, they were struck by XP, and then XP SP 1 and Windows 2000 (just an example, I know there are several editions in the middle). Wine development is indeed much slower than the real development pace of the real Windows (thousands of organized developers vs. hundreds of random contributers - ~700 have contributed to Wine somehow [12]).
(*1)
Wine is binary compatibility layer, which means the binary executable can be executed both on Windows and Linux without modifications. While MS SUA is source compatibility layer, which means the same program will have two executables, compiled differently, but from the same source, in order to run on both platforms.
Wine's web page: http://winehq.org/ .
Other references and links:
[1] Linux Unified Kernel is a project to implement Windows system calls (only, not the entire set of APIs) natively in Linux kernel.
[2] http://apcmag.com/google_behind_photoshops_new_linux_compatibility.htm
[3] http://www.heise-online.co.uk/news/CodeWeavers-bring-Chrome-to-Mac-and-Linux--/111535
[4] http://code.google.com/opensource/wine.html
[5] http://wiki.winehq.org/SummerOfCode
[6] http://www.microsoft.com/genuine/downloads/faq.aspx
[7] http://www.wine-reviews.net/microsoft/running-ms-office-2003-under-linux-with-wine-0952.html
[8] http://www.reactos.org/en/index.html
[9] http://mohnabil.blogspot.com/2008/09/microsoft-subsystem-for-unix-based.html
[10] Unlike Windows system calls (http://www.metasploit.com/users/opcode/syscalls.html), which are less than 400 in Windows Vista, the entire set of the windows APIs are much more (http://www.codase.com/windows.html)
[11] http://appdb.winehq.org/
[12] http://www.winehq.org/site/history
[A] http://wiki.winehq.org/FAQ?action=recall&rev=217#head-8b4fbbe473bd0d51d936bcf298f5b7f0e8d25f2e
Posted by
Mohammad Alaggan
at
9/29/2008 11:47:00 PM
0
comments
Labels: Linux
Saturday, September 20, 2008
Iterative Development – there is a simpler way to work - Part II (finale)
NOTE: This text (part I and part II) is just an introduction to the existence of an alternative, not a guide to use that alternative.
Because I -personally- believe that an example is worth a thousand words, I will tell you my personal experience with iterative development; the story of our graduation project. We only tried iterative development when other ways failed.
Our graduation project was a clustered server for massive multiplayer online games. The entire period for the project to come out was approximately 10 months, overlapping an academic year.
We've spent almost 9 months of them in the design phase; the project turned out to be very big and needed some research and novel techniques. For 5-members team who doesn't know anything about clustering we needed that much time.
Anyways, having only one month left to hand the project, there was no single line of code. We thought that we already have an exhaustive list of classes and functions and it's only a matter of implementation.
Trying to implement the classes we designed, we had no idea how to start, and just -exactly- after 4 functions we totally lost contact with the design and didn't know how to proceed. We were overwhelmed by the complexity and inter-dependencies between modules that it was NOT possible to see anything running before at least thousands of lines of code, which will need even more time to fix (cuz they were not tested).
That seemed inappropriate for the 1-month due time. Our main problem was the inter-dependencies of the modules. That's where iterative development kicked in. (Note that changes in the server and the game affect each others so they have to be done according to each-other step by step).
You will notice in the following sequence that at any point of time we could
A. Hand something that worked, not complete, but works.
B. Features are added incrementally. That means at the dead line we will have N features working, compared to a complete set of features that doesn't work at all.
1- The ping server
The first thing we did is to implement a simple server and test if the game (which was not practically a game then :D) can connect and exchange messages with it. - day 1
2- Simple actions
Then we implemented simple actions to make the game work and players interact - the server is not clustered and there is no state persistence or anything. - day 3
(Starting from here, the server development and game development was going in parallel)
A. Server development
3- Splitting the server
After that we implemented a simple layer above Java Remote Method Invocation (RMI) to be able to split the server on the set of computers in the clusters, and to make debugging easier (that layer could be disabled to run the whole server on a single machine). - day 9
4- Persisting the state
Also, we've developed something we called Object Store to provide transparent persistence using aspect oriented programming. - day 26
5- Work that was not complete until we handed the project
Proper Object Store synchronization between several machines, database replication, security checks, traffic control and traffic load balancing, server peer to peer load balancing, distributed administration.
B. Game development
3- Adding a few actions each day to extend the things the player can do. First walking, then attacking, then riding a car etc. (That's very simple view, the actual actions are numerous and much more complicated than that). - Until we handed the project
Conclusion:
Using iterative development, we've faced the overwhelm we had from the extreme complexity and actually delivered something that was working and people can actually play and enjoy. Compared to waterfall model, nothing would have been delivered in the deadline, and there would have been an implementation paralysis, and an elongated testing phase which might require lots of parts to be reimplemented too.
It's like splitting a big project into smaller projects with limited set of features, and doing that over and over until it's enough or you meet the deadline.
Pros:
Early feedback
More visibility, for the developer and for the client, the client can make changes early (cuz client don't know what they want !
Can deliver at any point of time
Cons:
Adding new features later can result in modifying existing code or removing it, which is the cost tradeoff of using iterative development
Posted by
Mohammad Alaggan
at
9/20/2008 09:28:00 PM
0
comments
Labels: Concepts, TeamDevelopment
Tuesday, September 16, 2008
Fun: Linux sudo command
I think it might be nice to send something funny every now and then.
Posted by
Mohammad Alaggan
at
9/16/2008 10:08:00 PM
0
comments
Labels: Fun
Wednesday, August 27, 2008
IoC (Inversion Of Control) and Dependency injection (DI)
Context context=new InitialContext();
ResultSet results=statement.executeQuery("select * from users");
mmm so i will keep asking my container to give me what i want? yup you will.
well lets see how would the container and the component interact with each other (without IOC)
A Day in the Container's Life !
Container :oh i have been busy serving all other components and don't have time for myself :( .
Component:oh poor you Mr.Component.
Container:ahh what can i do this is my job :) , so how can i serve you ?
Component :oh yea i forgot , i want to you to serve me the resource bounded at bla bla bla
Container:ok sure no problem, just a min. here you are (hehehe now we got what we want :D )
Component:oh many thanks MR.Container, have a nice day.
Container:you too component bye.
IoC as most of people say it apples Hollywood principle which is :
This is what they call: don't call us , we will call you principle.
private DataSource dataSource;
{
//so now dataSource is set by Spring IOC
Connection connection=dataSource.getConnection("yourUser","yourPassword");
Statement statement=connection.CreateStatment();
ResultSet results=statement.executeQuery("select * from users");
. . . //i didnt include all the code just the important thing
}
//segments from XML configuration file
<%bean name="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<%property name="driverClassName" value="youDriverClassName" />
<%property name="url" value="DBUrl" />
<%property name="username" value="yourUsername" />
<%property name="password" value="youPassword" />
<%bean name"ourComponent" class="com.springIoC.IoCTesting">
<%property name="dataSource" ref="dataSource">
<%/bean>
mmm (spring IoC thinking...)
oh yea i have a bean named ourComponent .
wait a minute this bean have a property named dataSource! .
this property refers to another bean named dataSource which have some property (url,username,password,driverclassname) .
oh great so now what i need to do is inject this bean property (data source property in the ourComponent ) with the Datasource ,TA DA now it is done.
so we can see here that we didn't make any lookup , so there is zero times component did ask the container about the DataSource.
below is a diagram that shows the interaction in case we are using IoC or non IoC Container.
in the first we can see that the component ask the container to provide the resource it need (data source in our case ) but in the second image the container creates and inject the resource into the component
Types Of Injection:
We have seen in the previous sample that spring do the injection through setter (property) thats one way of injection , another way it to inject through the constructor (which spring also support)
this mean that i can inject all resource in the component through a constructor (and that constructor takes all the needed resource through arguments supplied)
so now we know what is Dependency injection and also the IoC concept , there are also some IoC containers other than spring IoC container for example :Pico container and also Avalon framework.
my Blog
Posted by
Ahmed Ali
at
8/27/2008 08:12:00 PM
1 comments
Labels: JAVA
Monday, August 25, 2008
Playlist creation Mobile App in Python !
This is a simple program i have made for my mobile phone (Nokia N70).
To cut a long story short, i have a a 1GB memory card more than half of them are mp3's, and i wanted a simple program to organize them (Playlist for each folder). At the same time, i wanted to play with something new and non-usual ( ! J2ME), i wanted to write it in python :) , and it turned out to be very easy.
Note that the code is not displayed properly here. Python code blocks depend on indentation.
import os
import sys
# Test folder
searchDirectory="/media/sda6/Songs/fdsfsd"
if not os.path.isdir ( searchDirectory ) :
print searchDirectory + " is not a directory."
sys.exit ( 0 )
m3uFilename = os.path.split ( searchDirectory )[1] + '.m3u'
# Get all files.
dirList=os.listdir(searchDirectory)
fileList = []
# Get mp3 or m4a files only.
for fname in dirList:
if fname.lower().endswith ( '.mp3' ) or fname.lower().endswith ( '.m4a' ) :
fileList.append ( fname )
# Begin : Generate the m3u file.
m3uFile = open( searchDirectory + os.path.normcase('/') + m3uFilename ,'w')
filesAdded = 0
for aFile in fileList:
print 'Adding ' + aFile
m3uFile.write ( aFile + '\n' )
filesAdded = filesAdded + 1
print 'Files Added : ' + str ( filesAdded )
m3uFile.close()
# End : Generate the m3u file.
import fileselector
searchDirectory = fileselector.fileselect()
import os
import sys
# Begin : Mobile Specific Code.
import fileselector
searchDirectory = fileselector.fileselect()
# End : Mobile Specific Code.
if not os.path.isdir ( searchDirectory ) :
print searchDirectory + " is not a directory."
sys.exit ( 0 )
m3uFilename = os.path.split ( searchDirectory )[1] + '.m3u'
# Get all files.
dirList=os.listdir(searchDirectory)
fileList = []
# Get mp3 or m4a files only.
for fname in dirList:
if fname.lower().endswith ( '.mp3' ) or fname.lower().endswith ( '.m4a' ) :
fileList.append ( fname )
# Begin : Generate the m3u file.
m3uFile = open( searchDirectory + os.path.normcase('/') + m3uFilename ,'w')
filesAdded = 0
for aFile in fileList:
print 'Adding ' + aFile
m3uFile.write ( aFile + '\n' )
filesAdded = filesAdded + 1
print 'Files Added : ' + str ( filesAdded )
m3uFile.close()
# End : Generate the m3u file.
Enjoy it :)
Posted by
Shereef Sakr
at
8/25/2008 08:22:00 PM
1 comments
Labels: Python
Introduction To WAP
Introduction:
Through this topic we will work together to understand Technology of Wireless Application Protocol (WAP), also we will take a fast tour about developing WAP Applications using ASP.net.
Technology Description:
Mobile Application :
When First Mobile arrived, it was only smart way for sending and receiving voice calls and after sometime for sending and receiving text messages. But now, it is become the most growing market for services and recreational purposes. It is also being used for accessing internet and multimedia world.
For this reason, a lot of developing and programming concepts changed to become compatible with mobile world, one of these concepts was WAP as a mobile alternative of WEB concepts for regular computers.
What is WAP ؟
From Wikipedia, WAP is an open international standard for application layer network communications in a wireless communication environment. Its main use is to enable access to the Internet (HTTP) from a mobile phone or PDA.
How it Work ؟
The Biggest different between WAP and WEB is that WAP able to work through less capabilities and slow speed in comapre with the configuration of regular computers.
WAP starts since an order come from mobile customer, it is convert HTML page to WML pages that is able to browsing through mobiles.
What is WML ؟
It is description language very similar to HTML tags, it have only some few different:
- The main Tag is <wml> instead of <html>.
- Documents splits to <card></cards>.
Introduction To WML:
This is sample from Wiki about WML document:
| <?xml version="1.0"?> <!DOCTYPE wml PUBLIC "-//PHONE.COM//DTD WML 1.1//EN" "http://www.phone.com/dtd/wml11.dtd" > <wml> <card id="main" title="First Card"> <p mode="wrap">This is a sample WML page.</p> </card> </wml> |
Reading and Writing Variables in WML:
| <setvar name="First_Name" value="Ahmed"/> <setvar name="Age" value="21"/> |
Later you can display it like that:
| <p>First Name: $(First_Name)</p> |
You can also read textbox value with the same way:
| <card id="card1" title="Tutorial"> <do type="accept" label="Answer"> <go href="#card2"/> </do> <p> <select name="name"> <option value="HTML">HTML Tutorial</option> <option value="XML">XML Tutorial</option> <option value="WAP">WAP Tutorial</option> </select> </p> </card> <card id="card2" title="Answer"> <p> You selected: $(name) </p> </card> </wml> |
ASP.net Application using WAP:
Do you remember our first WAP Application in this topic?
| <?xml version="1.0"?> <!DOCTYPE wml PUBLIC "-//PHONE.COM//DTD WML 1.1//EN" "http://www.phone.com/dtd/wml11.dtd" > <wml> <card id="main" title="First Card"> <p mode="wrap">This is a sample WML page.</p> </card> </wml> |
If you want to use it through ASP.net, you have to convert it to something like that:
| <%@ Page Inherits="System.Mobile.UI.MobilePage" Language="C#" %> <%@ Register TagPrefix="mobile" Namespace="System.Mobile.UI" %> <mobile:Form runat="server"> <mobile:Label runat="server"> This is a sample WML page. </mobile:Label> </Mobile:Form> |
If you want to work through VB.net instead of C#, just modify the first line like that:
| <%@ Page Inherits="System.Mobile.UI.MobilePage" Language="C#" %> |
And now, if your web site ordered from PC, the response will contain HTML tags, if it is ordered from Mobile, the response will contains WML tags.
Posted by
Ahmed Gamal
at
8/25/2008 05:42:00 PM
0
comments
Forth Arabic Wikipedia Day
Posted by
Shady M. Najib
at
8/25/2008 02:57:00 AM
0
comments
Labels: Announcements
Sunday, August 24, 2008
.NET Framework 3.5 Service Pack 1 has been released
ASP.NET in the .NET Framework 3.5 Service Pack 1 release includes numerous bug fixes. In addition, it includes features for the following:
- Enabling high-productivity data scenarios by using ASP.NET Dynamic Data.
- Supporting the browser navigation in ASP.NET AJAX applications by using ASP.NET AJAX browser history.
- Increasing the download speed for ASP.NET applications by using ASP.NET AJAX script combining.
.. more.
Posted by
Mohamed Gamal El-Din
at
8/24/2008 09:48:00 AM
0
comments
Expression Blend
When WPF - the new .net technology- arrived, Microsoft try to provide some tools makes life easy to WPF Developers, one of this tools was Expression Blend, we will try to show some features about it in this topic.
Try to download it form Microsoft web site, then run it and choose new Project - WPF Application (*.exe):
You can now choose your name, folder and .net language you want.
Click View-Active Document View then click split view to show both code and design view:
In the left side, you will find all tools you need for your design including painting tools such as brushs and pens. You can find also .net components such as commandbuttons. You can also click the link to more item to show all tools:
While you are painting, you will find additional properties for each tool in the right side:
Example:
Add new <canvas>, this will the container of our picture for this example:
| <Canvas> <Canvas x:Name="MainImageCanvas" Canvas.Left="40" Canvas.Top="120"> |
Add new MediaElement to add a picture:
| <MediaElement x:Name="MainImage" Source="c:/example/futex.jpg" Width="300" Height="300" ></MediaElement> |
Now we will apply some effects through properties, this is an example of code results from some operations:
| <Canvas.RenderTransform><TransformGroup> |
Press F5 now, this is a snap shot of expected results:
Now we will try to apply some shadow to the picture, so we will add <canvas> for a new picture object refer to the same file with new transformation parameters to make the second picture seems to be a shadow:
| <Canvas x:Name="ReflectionImageCanvas" Canvas.Left="260" Canvas.Top="640"> <MediaElement x:Name="ReflImage" Source="c:/example/futex.jpg" Width="300" Height="300" Volume="0"> </MediaElement> <Canvas.RenderTransform> <TransformGroup> <SkewTransform x:Name="ReflectionSkewTransform" AngleY="19" AngleX="-41" CenterX="0" CenterY="0" /> <ScaleTransform x:Name="ReflectionScaleTransform" ScaleY="-1" ScaleX="1" CenterX="0" CenterY="0" /> </TransformGroup> </Canvas.RenderTransform> </Canvas> |
Previous Code Result:
Last topic in this lesson is to add some transparent to the shadow of picture through opacity property, the result XAML maybe like that:
| <Canvas x:Name="ReflectionImageCanvas" Canvas.Left="260" Canvas.Top="640"> <MediaElement x:Name="ReflImage" Source="c:/example/futex.jpg" Width="300" Height="300" Volume="0"> </MediaElement> <Canvas.RenderTransform> <TransformGroup> <SkewTransform x:Name="ReflectionSkewTransform" AngleY="19" AngleX="-41" CenterX="0" CenterY="0" /> <ScaleTransform x:Name="ReflectionScaleTransform" ScaleY="-1" ScaleX="1" CenterX="0" CenterY="0" /> </TransformGroup> </Canvas.RenderTransform> <Canvas.OpacityMask> <LinearGradientBrush StartPoint="0.5,0.0" EndPoint="0.5,1.0"> <GradientStop Offset="0.345" Color="#00000000" x:Name="ReflGradientStop1" /> <GradientStop Offset="1.0" Color="#CC000000" x:Name="ReflGradientStop2" /> </LinearGradientBrush> </Canvas.OpacityMask> </Canvas> |
Now, you have to try to edit the position of shadow by changing top and left manually, the result must be something like that:
Full XAML Code:
| <Canvas> <Canvas x:Name="MainImageCanvas" Canvas.Left="40" Canvas.Top="120"> <MediaElement x:Name="MainImage" Source="c:/example/FUTEX.JPG" Width="300" Height="300" > </MediaElement> <Canvas.RenderTransform> <TransformGroup> <SkewTransform x:Name="MainSkewTransform" AngleY="-19" AngleX="0" CenterX="0" CenterY="0"/> <ScaleTransform x:Name="MainScaleTransform" ScaleY="1" ScaleX = "1" CenterX="0" CenterY="0"/> </TransformGroup> </Canvas.RenderTransform> </Canvas> <Canvas x:Name="ReflectionImageCanvas" Canvas.Left="267" Canvas.Top="645"> <MediaElement x:Name="ReflImage" Source="c:/example/futex.jpg" Width="300" Height="300" Volume="0"> </MediaElement> <Canvas.RenderTransform> <TransformGroup> <SkewTransform x:Name="ReflectionSkewTransform" AngleY="19" AngleX="-41" CenterX="0" CenterY="0" /> <ScaleTransform x:Name="ReflectionScaleTransform" ScaleY="-1" ScaleX="1" CenterX="0" CenterY="0" /> </TransformGroup> </Canvas.RenderTransform> <Canvas.OpacityMask> <LinearGradientBrush StartPoint="0.5,0.0" EndPoint="0.5,1.0"> <GradientStop Offset="0.345" Color="#00000000" x:Name="ReflGradientStop1" /> <GradientStop Offset="1.0" Color="#CC000000" x:Name="ReflGradientStop2" /> </LinearGradientBrush> </Canvas.OpacityMask> </Canvas> </Canvas> |
Don't forget that MediaElement can accept any type of media, try to attach video and see the result.
Anyway, you can copy this XAML code to a WPF .net solution and the same result will apply to your form.
.. more.
Posted by
Ahmed Gamal
at
8/24/2008 01:32:00 AM
0
comments
Friday, August 22, 2008
dotNetWork.org 7th gathering
Date:
12:00 - 16:00
Attendance is FREE =)
Note: This time we are having 2 parallel tracks, that's 4 sessions presented by 3 speakers.. Waiting for your feed-back about that..
Speakers
Senior Software Engineer - SilverKey Technologies Egypt.
Information Specialist - EDS.
Senior Software Engineer - ITWorx.
Agenda
12:00 - 13:30:
by Mohamed Ahmed Meligy.
by Tamer Mohammad Fathy AL-Khouly,
Mohammad Yousri El-Farsi.
13:30 - 14:00: Break
14:00 - 15:30:
by Mohamed Ahmed Meligy.
by Tamer Mohammad Fathy AL-Khouly,
Mohammad Yousri El-Farsi.
Location:
Buses will be available at: Nady El-Sekka (11:00 AM - 11:30 AM)
Please be there before 11:30 coz we will leave on time..
For those who wanna keep tuned with further news about this event & other upcoming events of the dotnetwork.org user group, please check the following links:
Yahoo!Group:
http://tech.groups.yahoo.com
Facebook Event:
http://www.new.facebook.com/event.php?eid=29202125063
You'd better join the above event if you have a facebook account so we can roughly estimate the attendees count..
Facebook Fan Page:
http://www.facebook.com/pages
Facebook Group:
http://www.facebook.com/group
Please don't hesitate to contact me if you have any further questions..
See u on the gathering ;)
.. more.
Posted by
Shady M. Najib
at
8/22/2008 10:24:00 AM
0
comments
Labels: Announcements
Tuesday, August 19, 2008
When database log file increases incredibly?
Working as DBA, I face problems daily and for the importance of the organization I work for; problems should be solved immediately. past days I had log file which its size exceeds 70 GB unreasonably... I've low disk space problem, clients access this database denied from doing any operation since log file can't allocate more free space on storage area, really all solutions weren't applied due to some restrictions, one of the solutions is to copy data from this database and transmit it to another database (which you can control log file growth) this solutions failed because SQL Server needs the new database has a log file its size like the old one aka 70 GB!!!!!
Another is to detach the database and trying attaching it without log file, fails also, since log file not exists.
While searching on this problem I've found someone has big size log file asks this question and I found the solution is to create a new database from the .mdf file of the old one and you shouldn't put the .ldf (log file(s)) besides. because SQL Server searching for the .ldf and if it didn't it creates another one with small size. and now old log file isn't belong to new created database and you can delete it and save more space :)
Code to create database from .mdf file
.. more.
Posted by
Ramy Mahrous
at
8/19/2008 06:41:00 PM
2
comments
Labels: Database
Friday, August 15, 2008
How to use dataset and adapters with stored procedures?
Q: How to use dataset and adapters with stored procedures?
A: I've asked this question two times today, and for that I thought to do a post and send the link better to answer everyone separately..
Right now, I've be_settings table, its schema (SettingName nvarchar(50) and SettingValue nvarchar(MAX)) what I need is to create stored procedure to get SettingName and SettingValue when the SettingValue = some value
then let's go to Visual Studio and create windows application and drop DataGridView on the form; press on the smart arow located on its top right, new dialog appears, choose to add new data source->Add project data source->Database
next->next->
then finish...
Your form should look like
in Load data onClick event handler, write this code
Just, Ctr + F5 and lets test our work
Hope, I answered your question ",)
Tip: if you using Windows Vista you need to run Visual Studio and SQL Server as administrator....
.. more.
Posted by
Ramy Mahrous
at
8/15/2008 11:07:00 PM
0
comments
Labels: .NET Q and A
Friday, August 08, 2008
Iterative Development – there is a simpler way to work - Part I
NOTE: This text (part I and part II) is just an introduction to the existence of an alternative, not a guide to use that alternative.
Probably the only way you know when you want to start a new project (for college for example), is the famous Waterfall mode. That's (Planning,Analysis,Design,Implementation,Testing).
When ever you get a project idea that you like and want to start in, your first thought is to gather all your team* to start doing the analysis.
You would probably be happy when you finish your analysis document(s). But now you want to do the design (most probably you understand design as "UML Class Diagram" only).
So you put the analysis documents aside, and perhaps this time let each team member tries to figure out the classes of some part of the project.
So far, although that it contains a handful of mistakes, the life is smiling at you. But...
Once you finished the so called "class diagram", you start the implementation. Needless to say, you will end up probably nothing like the design, that's if you were lucky and your project isn't really a very complex one.
And because you end up with something different, i.e. changes are added randomly as you find them, the code complexity will increase, readability will decrease, lots of ad-hoc fixes**, and will take much longer than anticipated to get it to work as you wanted (and with high probability you will miss the dead-line, and deliver your project nonfunctional or with lots of bugs that makes it totally unusable).
Well, this mostly isn't really because you are bad, or you did something wrong. But this is due to the nature of both the Waterfall model, and your experience in the kind of project you are trying to do. I will explain.
The Waterfall model assumes that you know exactly what you are doing, and that's there will be no modifications -in the design- afterwards. To do that, you must have tried and did that -arguably exact- kind of projects several times before. Which in an academic settings is not always true; because in each subject you are assigned a project to apply what you've just learned. So the uncertainty factor is very high. Thus the Waterfall assumption fails, and now it is to hinder you more than to help you.
Fortunately, there is an alternative way that assumes the uncertainty and will help you in that regard; Iterative Development***.
I will talk in details about it in Part II isA.
* This in the context of under-graduate projects' teams in our faculty.
** For people who don't know what ad-hoc means, I quote from some of my friends ;) = "طلسأ طلسأ يا عم الحج". See it on wikipedia http://en.wikipedia.org/wiki/Ad_hoc . In Arabic it probably means اعتباطاً. It's not always bad in some conditions, but in programming, it usually is.
*** Iterative Development isn't a model or process by itself but it describes a feature of several different processes. Like -for example, not to list- the Rational Unified Process, Extreme Programming, SCRUM, and generally the agile software development frameworks, all of which, is beyond the scope of this text. This text is just an introduction to the existence of an alternative, not a guide to use it. If you were interested to use it, you should pursue a good book or a good reference in that regard.
Posted by
Mohammad Alaggan
at
8/08/2008 12:13:00 PM
1 comments
Labels: Concepts, TeamDevelopment
Monday, August 04, 2008
Microsoft Infrastructure IT Professional Sessions – August 19
Yet another event invitation from Kareem Salah(IT Professional Audience Marketing Manager Microsoft Egypt)
You are courteously invited to attend our August IT Pro Session on Windows Server 2008. This session is a very special one where we will be having an IT Professional, Waleed Omar, discussing his actual implementation of Windows Server 2008 with a focus on Terminal Services. Waleed from Mantrac is one of the very first IT Professionals in Egypt to deploy the new Terminal Services in Windows Server 2008 in his production environment, which is currently used to provide remote application access to users across multiple countries.
Microsoft has published a case study on the implementation of Windows Server 2008 Terminal Services at Mantrac by Waleed, which you can view at:
http://www.microsoft.com/casestudies/casestudy.aspx?casestudyid=4000002026
Waleed will be providing a technical overview of the new features of Terminal Services in Windows Server 2008, along with hands-on-lab and a discussion of the implementation at Mantrac.
Microsoft is delighted to invite you to attend our August session, entitled Windows Server 2008: Implementation at Mantrac. Attendance is free-of-charge but Seats are limited.
Posted by
Ramy Mahrous
at
8/04/2008 09:38:00 PM
0
comments
Labels: Announcements, Microsoft
Monday, July 21, 2008
C# 4.0 is not a dream, it is comming :)
Posted by
Mohamed Gamal El-Din
at
7/21/2008 03:42:00 AM
1 comments
Saturday, July 19, 2008
dotNetWork.org 6th gathering
12:00 - 16:00
Attendance is FREE =)
Speakers
Team leader, MOSS MVP - ITWorx
Mohamed Samy
Technical Architect, VSTS MVP - ITWorx.
Agenda
SharePoint WebParts Development
by Marwan Tarek.
13:30 - 14:00: Coffee Break
14:00 - 15:30:
Patterns and Anti-patterns of SOA (Part 2)
by Mohamed Samy.
15:30 - 16:00: Lunch
Location:
Buses will be available at: Nady El-Sekka (11:00 AM - 11:30 AM)
Please be there before 11:30 coz we will leave on time..
For those who wanna keep tuned with further news about this event & other upcoming events of the dotnetwork.org user group, please check the following links:
Yahoo!Group:
http://tech.groups.yahoo.com
Facebook Event:
http://www.facebook.com/event.php?eid=18319879657
You'd better join the above event if you have a facebook account so we can roughly estimate the attendees count..
Facebook Fan Page:
http://www.facebook.com/pages
Facebook Group:
http://www.facebook.com/group
Please don't hesitate to contact me if you have any further questions..
See u on the gathering ;) .. more.
Posted by
Shady M. Najib
at
7/19/2008 11:13:00 PM
0
comments
Labels: Announcements
Thursday, July 17, 2008
Differences between some references in Enterprise Library 2.0 and 3.1
While working with Microsoft Enterprise Library 3.1 I've found there is difference in some references. I was working with DAAB (Data Access Application Block), in Microsoft Enterprise Library 2.0 we was refer to Microsoft.Practices.EnterpriseLibrary.Data.dll in 3.1 and 4.0 you should browse it manually
Posted by
Ramy Mahrous
at
7/17/2008 04:09:00 AM
0
comments
Labels: Microsoft
Friday, July 11, 2008
doNetWork.org first RockStar Day!!!
19:00 - 22:30
Attendance is FREE =)
Speaker
Agenda
what's new for reporting services in SQL-2008
20:30 - 21:00: Break
21:00 - 22:30:
Business Data Catalog of Office SharePoint Server 2007
Location:
El Khalifa el ma'moun street, Heliopolis,
Cairo, Egypt
Please be there before 19:00 coz we will start on time..
For those who wanna keep tuned with further news about this event & other upcoming events of the dotnetwork.org user group, please check the following links:
Yahoo!Group:
http://tech.groups.yahoo.com
Facebook Event:
http://www.facebook.com/event.php?eid=56508835231
You'd better join the above event if you have a facebook account so we can roughly estimate the attendees count..
Facebook Fan Page:
http://www.facebook.com/pages
Facebook Group:
http://www.facebook.com/group
Please don't hesitate to contact me if you have any further questions..
See u on the gathering ;) .. more.
Posted by
Shady M. Najib
at
7/11/2008 12:07:00 PM
0
comments
Labels: Announcements, Microsoft
Thursday, July 10, 2008
Google Code Jam
Google Code Jam is a coding competition in which professional and student programmers are asked to solve complex algorithmic challenges in a limited amount of time. The contest is all-inclusive: Google Code Jam lets you program in the coding language and development environment of your choice.
Google Code Jam begins in July and continues in August, when you will compete in online rounds against contestants from around the world. The Top 500 participants will advance to onsite competitions at a local Google office to compete against those in their region (Asia Pacific; Europe, Middle East and Africa; and the Americas). The Top 100 will participate in the final round at the Google Headquarters in Mountain View, California on Friday, November 14.
Don't be left out! Make sure to register between June 17 and July 17, and show your coding creativity in Google Code Jam.Prize Overview.
The top 100 finalists will divide over $80,000 in prize money:
| Competitor(s) | Prize |
|---|---|
| 1st Place | $10,000 |
| 2nd Place | $5000 |
| 3rd Place | $2500 |
| 4th – 10th Place | $1500 |
| 11th – 30th Place | $1000 |
| 31st – 50th Place | $750 |
| 51st – 75th Place | $500 |
| 76th – 100th Place | $250 |
http://code.google.com/codejam/ .. more.
Posted by
Ahmed Essawy
at
7/10/2008 03:11:00 PM
0
comments
.jpg)

