This blog is subject the DISCLAIMER below.

Tuesday, February 27, 2007

Linux Tip #3 : Using Arabic keyboard

It is really simple to use Arabic in Linux. This command enables it:
setxkbmap -option grp:switch,grp:alt_shift_toggle,grp_led:scroll us,ar

You can make this command run each time the computer starts by adding to ~/.bashrc .

This command in short, set the switch keys to alt-shift (left alt and left shift), the mode of this key is to toggle, and it specifies that the state of the scroll-lock LED will show the language currently used. Use 'man setxkbmap' for more details on advanced use.

.. more.

The Windows Hosts file

windows has a very special file named the hosts file, it is located in
%SystemRoot%\System32\drivers\etc\hosts
this file allows u to define a domain & its IP, just like a DNS, but a local one but
without server, it also allows u to block a specific website, domain or any thing, only by giving it an IP that is not the real one, so there will be nothing to accept the connection
Q: WHAT MAKES IT A HELPFUL THING ??
A: coz simply if u have a program that makes some sort of validations on the server, that u dont want to happen, u can do that
ur only problem is just u have to know where it connects, but there is alot of tools & ways to determine that.
its also useful since u wont need a firewall to do that, its just a local file
1- just open it from the RUN command
2- select notepad & thats it
u'll actually find the LocalHost IP there, with the domain named "localhost"
add whatever u want in the same format as the other & that should be it

.. more.

Installing JDK6 On Ubuntu

Ubuntu is a great linux distribution. I have been using it for some time and it has never failed me. I have tried to use JDK6 with it but i didn't find a .deb package neither on sun's website nor ubuntu repositories. Fortunately, there is a way around that.

First, you need to download the JDK binary from here. I have downloaded jdk-6-linux-i586.bin the one suitable for my computer and most of us.

Second, chmod it to make it executable:

chmod 755 ./jdk-6-linux-i586.bin

Third, run the binary you have downloaded using this command:

./jdk-6-linux-i586.bin

then press yes to agree to the licence. After that you will find a new folder called jdk1.6.0

Then, you need to move this folder to use/lib/jvm using this command:

sudo mv jdk1.6.0 /usr/lib/jvm

You will need to enter the root password to do that.

sudo update-alternatives --config java

Selection    Alternative
-----------------------------------------------
1 /usr/bin/gij-wrapper-4.1
*+ 2 /usr/lib/jvm/java-gcj/jre/bin/java

Press enter to keep the default[*], or type selection number:
Those are the JVM's that currenlty exist.

Now we have moved the JDK to the folder where JVM's exists, but we need to enable the system to recognize it really exists

This command will finish all these thing:
update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.6.0/jre/bin/java 60 \
--slave /usr/share/man/man1/java.1.gz java.1.gz /usr/lib/jvm/jdk1.6.0/man/man1/java.1

Check the JVM's again:

sudo update-alternatives --config java

There are 3 alternatives which provide `java'.

Selection Alternative
-----------------------------------------------
1 /usr/bin/gij-wrapper-4.1
*+ 2 /usr/lib/jvm/java-gcj/jre/bin/java
3 /usr/lib/jvm/jdk1.6.0/jre/bin/java

Press enter to keep the default[*], or type selection number:
Now JDK 1.6 exists but it's not the default.
sudo update-alternatives --config java

There are 3 alternatives which provide `java'.

Selection Alternative
-----------------------------------------------
1 /usr/bin/gij-wrapper-4.1
+ 2 /usr/lib/jvm/java-gcj/jre/bin/java
* 3 /usr/lib/jvm/jdk1.6.0/jre/bin/java

Press enter to keep the default[*], or type selection number:
Now, select the one that contains JDK1.6.0, which will be 3 in this case.

You are done.

References:
http://trac.centricware.org/wiki/2007/01/28/21.58

.. more.

Monday, February 26, 2007

MySQL .Net Connector Error 2869 on Windows VISTA

I've solved an error I had while installing the .net connector of MySQL on windows VISTA.
I had an error number 2869 and the setup rolled back.
The solution that I found on the MySQL website was to run the command prompt in administrator mode and run the setup from there.
it worked with me, & I hope it does the same for u

.. more.

Windows Vista Boot (Add or Remove)

I've just fixed my computer's boot system & saved my self 48 hrs of reinstalling a system.
I''ll take this chance to explain about the Vista's Boot manager (either removing it or Deleting it)
I currently have a dual boot of windows XP & VISTA
my XP for some reason crashed so I had to repair it, which rewrote the bootsector & over written the VISTA's boot sector. so I couldn't load windows VISTA.
The recovery stuff that u can find when u boot from the windows VISTA DVD were the way to solve it (add VISTA to the boot) not the startup recovery, but the command line

How to use the Bootrec.exe tool in the Windows Recovery Environment to troubleshoot and repair startup issues in Windows Vista

type:
bootrec.exe /Fixboot
& that should be it

To remove the VISTA Boot record, boot from windows XP CD, press r on the first screen (open the recovery console)
type fixboot
then fixmbr
then fixboot again for safty
that should be it

.. more.

A reasonable solution for serious Game Programming

There is a very reasonable solution if u seriously want to consider game programming, I dont advise making ur own engine, unless u just want to learn, but its never a good idea to use it for production, coz u'll need years of hard work to make a technology that is several years old when its done.
Simply u can buy or get an engine for free (there are several economical & free engines on the net), concentrate in the game u want to make, & leave the engine issues to the engine programmers.
Even when they make a new version of it, u wont have any hard time updating ur game.
Current game markets are in serious needs for original ideas (I KNOW, I"M FOLLOWING THAT MARKET :D) so if u want to succeed in this business, u'll have to offer what it needs.
Dont reinvent the wheel if u want to make money, coz whatever u do ur wheel wont be more circular than the existing ones ;)

.. more.

Sunday, February 25, 2007

Running Netbeans on XGL

If you tried to use Netbeans on XGL before, you probably know that you can't do it. It shows like an empty window. The solution being around is that you use a nested X server and so on. Other solutions include recompiling the JRE.

Well, I ran into a simple solution. You can add this to /etc/environment, and viola, it is working:
AWT_TOOLKIT="MToolkit"

For command line guys:
sudo echo 'AWT_TOOLKIT="MToolkit"' >> /etc/environment

Have fun ;)

http://ubuntuforums.org/showpost.php?p=1687890&postcount=4

.. more.

Enabling Dual-core/Hyper-threading in Ubuntu

Ubuntu 6.10 (Edgy) doesn't enable dual-core out-of-the-box. Maybe the next one will. Anyway to enable it, you have to use a different kernel.
I started to hear people screaming. I can see you clicking away of this article right now!

Well, don't be afraid, it is as easy as a single click nowadays. All you need to do, if you have Intel (non-AMD) processor is this:
From synaptic package manager choose these 2 packages:
kernel-686-smp
kernel-restricted-modules-686
And then reboot.
For command-line people just type:
sudo apt-get install linux-686-smp linux-restricted-modules-686
and reboot.

To make sure your kernel now sees the both processor type:
cat /proc/cpuinfo | grep -i '^processor' | wc -l
This command will show you how many processors is recognized by the kernel.

For AMD users, the packages are not named 686, they are named k7.
Good luck.

A last hint: (thanks to my dear friend Shereef Sakr)
To speedup the booting process, you might want to enable concurrency in the booting processes.
In the /etc/init.d/rc file, there is a line called CONCURRENCY=none, it is probably the first un-commented line. Change 'none' to 'shell' or to 'startpar'.

Shell and startpar both are concurrent but shell cares about the order or the printed output. I used startpar and it didn't work, so I used shell and it is working fine, although not as fast as startpar; startpar booted in a blink, but shell just cuts few seconds off.

.. more.

Saturday, February 24, 2007

Windows Presentation Foundation Part 2

In this post,I will speak about the features that lead WPF to make a great interface revolution in the design world.
So now we have to ask, is WPF different from previous technologies?And if it is, what are the new features it provides?
Surely, it is different and the evidence is the new features in Windows Vista
that depend on WPF.
So,let's list the most important WPF features.

WPF features:
1. A unified platform for modern user interfaces:
Providing a unified technology foundation for creating full-featured user interfaces. As shown in this screen,it contains text and images along with both 2D and 3D graphics produced using WPF. The developer doesn't need to write code that uses specialized graphics technologies such as GDI+ or Direct3D.


2. The ability for developers and designers to work together:
Before using WPF, there was a problem: how can designers and developers work together?!! Now it is very easy as WPF enables designers to use the same common language (XAML) as developers and visa versa. This is the key change as shown on the following figure.


3. Graphical and Media Services:
-All graphics will be routed through Direct3D. This aims to provide a unified avenue for displaying graphics and to allow Windows to offload graphics tasks to the Graphics Processing Unit found on the computer's graphics card to reduce the workload on the computer's Central Processing Unit.

-WPF supports the 3D capabilities provided by Direct3D and provides tighter integration with other features like user interface (UI), time-based animations, 3D documents, vector graphics and 3D media and it also supports the video formats WMV, MPEG and AVI.

- A powerful concept in the WPF is the logical separation of a control from its appearance as the control's template can be overridden to completely change its visual appearance and control can contain any other control or layout.

4. Imaging:
Windows Imaging Component (WIC) for WPF will allow developers to write image codecs for their specific image file formats as well as custom bitmap effects and metadata.

5. Effects:
Special effects such as dropshadows and blurring are built-in and other effects such as reflections can be easily implemented.

6. Text:
WPF includes a number of text rendering features that were not available in GDI and it is the first Windows programming interface to support Open Type, TrueType, and OpenType CFF (Compact Font Format) fonts.

7. Deployment:
WPF isn't just for building traditional standalone applications but also offering XAML Browser Applications (XBAP).

8. Interoperability:
WPF provides interoperability with Win32: Via hosting, one can use WPF inside existing Win32 code, or one can use existing Win32 code inside WPF.

9. Data Binding:
WPF has a built-in set of data services to enable application developers to bind and manipulate data within applications.

After these features are known,I think it is the time to see and apply them yourself to enjoy with the great interface revolution using WPF.I found good link of WPF video tutorials using Microsoft Expression Blend.
Download them and begin to learn.
http://www.contentpresenter.com/index.php
To be continued……

.. more.

Explore the Java Platform- part3 APIs (J2ME-Configurations and profiles)

3.1.1 CLDC
The Connected Limited Device Configuration (CLDC) is a specification for applications targeted at devices with very limited resources such as pagers and mobile phones. The CLDC was developed under the Java Community Process as JSR 30 (CLDC 1.0) and JSR 139 (CLDC 1.1).

Typical requirements
16-bit CPU, a total of 160 KB memory available to the Java platform, as well as a limited connection to some kind of network.

Profiles
MIDP
Designed for cell phones, it supports an LCD orientated GUI API, with MIDP 2.0 including a basic 2D gaming API. Applications written to use this profile are called MIDlets. Almost all new cell phones come with a MIDP implementation, and it is now the de facto standard for downloadable cell phone games.

The Information Module Profile
(JSR 195) is designed for vending machines, network cards, routers, telephone boxes and other systems with either simple or no display and some form of limited two way network access. Only APIs for application creation, storage, and network access are defined. These are a subset of the javax.microedition.io, rms and midlet packages in MIDP. Siemens Mobile and Nokia put forward this specification to the JCP.

DoJa
The DoJa profile was designed for DoCoMo's i-mode mobile phone by NTT DoCoMo.

General APIs
java.io
java.lang
java.util

3.1.2 CDC
The Connected Device Configuration (CDC) is a framework for building J2ME applications on embedded devices ranging from pagers up to boxes. The CDC was developed under the Java Community Process as JSR 36 (CDC 1.0) and JSR 218 (CDC 1.1).

Typical Requirements
32-bit CPU, 2 MB of RAM, and 2.5 MB of ROM.

Profiles
Three profiles are based on the CDC
Foundation Profile
Java SE-like API
No graphical user interface (GUI)

Personal Basis Profile
Extension to Foundation Profile
Lightweight GUI support

Personal Profile
Extension to Personal Basis Profile
Full AWT and applet support
Easy to port PersonalJava-based applications

3.1.3 Getting into action
The previous sections described an overview of the components of the J2ME which appears easy, simple and small, although; do not trust the first impression, J2ME applications are considered the most challenging applications to develop, because getting yourself used to limited libraries is a difficult task, specially for CLDC which provides a very basic set of functionality. J2ME developer must always put system resources in the first priority, especially when developing an application that depends on resources in the first place such as a game. You can get J2ME resources from http://java.sun.com/javame/index.jsp

.. more.

Explore the Java Platform-part3 APIs (J2ME - OverView)

Explore the Java Platform
Part 3
APIs

Well, it has been a long time since our last post in this series. I’m sorry for the delay, but I was really busy and I didn’t have any time to do any thing, any way lets get to the subject directly.

This part starts showing the APIs of the java platform, as discussed before, the java APIs are grouped into 3 main groups which are; Java Micro Edition (J2ME), Java Standard Edition (J2SE), and Java Enterprise Edition (J2EE), the 2 in the acronyms stands for a standardization level, as mentioned before, java has passed through many standardization levels and Java2 is considered an important milestone in the standardization of java because it added an extra huge functionality to the previous versions. Now the new acronyms will omit the 2 using the names as Java ME, Java SE and Java EE, however, we will use the old names in the article because we will just talk about common concepts, but it is always good to know the new acronyms.

3.1 J2ME
Java 2 Micro Edition (J2ME) is Sun's version of Java aimed at machines with limited hardware resources such as PDAs, cell phones, and other consumer electronic and embedded devices. J2ME is aimed at machines with as little as 128KB of RAM and with processors a lot less powerful than those used on typical desktop and server machines. J2ME actually consists of a set of profiles. Each profile is defined for a particular type of device -- cell phones, PDAs, microwave ovens, etc. -- and consists of a minimum set of class libraries required for the particular type of device and a specification of a Java virtual machine required to support the device. The virtual machine specified in any profile is not necessarily the same as the virtual machine used in Java 2 Standard Edition (J2SE) and Java 2 Enterprise Edition (J2EE).

To date, Sun has released the following profiles:
The Foundation Profile -- A profile for next generation consumer electronic devices
The Mobile Information Device Profile (MIDP) -- A profile for mobile information devices, such as cellular phones and two-way pagers, and PDAs

A profile in itself does not do anything; it just defines the specification. Profiles are implemented with a configuration. You can think of a configuration as an implementation of a J2ME profile for a particular type of device such as a PDA. Some of the configurations currently available are

Connected Device Configuration (CDC)
An implementation of the Foundation Profile for next-generation, consumer electronic and embedded devices

Connected Limited Device Configuration (CLDC)
An implementation of MIDP for small, resource-constrained devices such as Palm OS devices.


Since each profile defines a different set of Java class libraries, you cannot take a Java application written for one profile and run it on a machine that supports another profile. Likewise, you cannot take an application written for Java 2 Standard Edition (J2SE) or Java 2 Enterprise Edition (J2EE) and run it on a machine that supports J2ME. You can only use the Java classes provide in the Java class library included in your target device's profile.

.. more.

Friday, February 23, 2007

AUC English Course

Here is the English course of the AUC, I guess it’s good :)
The password of the zip files is: taha
Here is how it is working
You first set up the main setup ISO file
You will have 12 levels; each level has its own ISO file if you want to run a certain level you have to insert its ISO file in your virtual CD room
That’s it hope you enjoy :)

The Main Setup File
SetUP.ISO

The basic level 1
Basic1.ISO

The basic level 2
Basic2.ISO

The basic level 3
Basic3.ISO

The intermediate level 1
Part1
Part2
Part3
Part4
Part5

The intermediate level 2
Part1
Part2
Part3
Part4
Part5

The intermediate level 3
Part1
Part2
Part3

Part4
Part5
Part6

The advanced level 1
Part1
Part2
Part3
Part4
Part5
Part6

The advanced level 2
Part1
Part2
Part3
Part4
Part5
Part6

The advanced level 3
Part1
Part2
Part3
Part4
Part5
Part6

The review
Part1
Part2
Part3
Part4
Part5
Part6

The executive
Part1
Part2
Part3
Part4
Part5
Part6
Part7

I have downloaded all the parts of all levels and put them on DVD in case if any one in FCI-H wanaa them :)

.. more.

Thursday, February 22, 2007

How to design something?

I am not a designer, sure I am not.
But, through these years, I've learnt some tips, I decided to discuss that with you:

1- Before design a logo, search for logos in the same category, like if I assigned task to design a logo for Bank, first step I should do is to go to any search engine and search on "Bank logo" then review all logos then do my one (Do not steal, just see how other think!)

2- Read this, it contains a lot of logos, and more beautiful tips, really it helped me a lot, thanks to Amr Ghoniem who gave me it

3- Your design should be simple as you can

4- Try to read more about UI and its principles

5- You've to know what users like to see, your family is very valuable, you have to know how they interact with your software, because they are the users NOT YOU!!!

.. more.

Quick Overview on Linq project

in the name of ALLAH

Language Integrated Query or what we are calling it LINQ project .

first lets know the difference between Declarative and imperative query programming.

in declarative Q P : - u tell the system what u want, but u don't tell it what to do to find the solution. like the sql query ( select id from student where name like 'fci-h') here the system will get the solution with the best plan it can see it.

in imperative Q P :- use the imperative query in logic work, when u want the system to run with assigned steps ( do .... if ... else ... exit ..) etc.

before Linq project there were diferent ways to work with data ( data from XML files, data from database or from Collections like arrays and lists ) , but now linq project came with the Solution;
Linq project manipulate the data with the same queries Although its different type (from xml , db or collections ).

we have : - Dlinq - to work with the data from database.
Xlinq - to workwith the dta from XML files.
linq to object to work with the collections.

see this example :-
from c in .....
where .........
select .........

by this query u can select from(xml , db or collections) .

the Most powerful thing in linq project is Plinq( parallel Linq ) Plinq enables the system to decide the best execution plane in the multiple processor machines not me who choose the execution plane, and sure this give us the best Automatic memory optimization.

this was a Quick Overview on Linq project hope it be useful.
for further reading Click here

My Resources : - Microsoft Documentation and silverkey demo day.

Good Luck

.. more.

Wednesday, February 21, 2007

#'s Family

There are two categories of Sharps: .NET languages and libraries. This list includes a sampling of some of each.

A#, a port of the Ada programming language to the .NET platform, is distributed by the Department of Computer Science at the United States Air Force Academy under the GNU general public license. http://asharp.martincarlisle.com

Cocoa#, a wrapper for Cocoa that works within the Mono environment. http://www.cocoasharp.org

F#, a mixed functional and object-oriented programming language developed by Microsoft Research. http://research.microsoft.com/fsharp/fsharp.aspx

Gtk#, a .NET wrapper for GTK+ and other GNOME libraries. http://www.mono-project.com/GtkSharp

J#, Microsoft's implementation of Java, which the company is in the process of phasing out. http://msdn2.microsoft.com/en-us/vjsharp/

Spec#, an extension of C# from Microsoft that has its own compiler that's integrated into the Visual Studio platform. http://research.microsoft.com/specsharp

Sing#, a Spec# extension and compiler for Microsoft Research's Singularity project. Singularity is an attempt to write a completely managed operating system from the ground up. http://lambda-the-ultimate.org/node/1081

X# (also known as "Xen" and now officially dubbed "C Omega") is an extension to the C# language (specifically the asynchronous wide-area concurrency Polyphonic C# language). It also provides a data-type extension for XML. http://research.microsoft.com/Comega You can read more here

.. more.

Linux Shell Tip #2

In the previous post, I mentioned a case when you have run a program through the shell and you want to close the shell without closing your program.

So before you close the shell, you may notice that you can't type any other command untill you close the running program.

What if you need to use the shell for another purpose?

This is when you need to place an ampersand "&" at the end of the command. so for the gedit example i have mentioned before, the command would be like this:

gedit &

The ampersand (&) placed at the end of the command starts the process as a background process which means that this process will not capture your keyboard input in the shell, so you can use the shell for typing any other commands.

Remember that if u close the shell the programs you have run will close. To overcome this situation you will need to use nohup in association with the "&". So if you want to run gedit the command will:

nohup gedit &

and the general form of it would be:

nohup "your command" &

Now you can:

# Use the shell for any purpose after running the programs you want.
# Close the shell without disrupting the operation of the programs you have run.

.. more.

Monday, February 19, 2007

How to enable glass view in Vista?

Glass view: all your windows have a kind of transparency to each other, maximizing and minimizing windows in animating way, navigating through opened windows like below, a small viewing for any application opened in Start bar by moving your mouse on, etc...

By default Vista does not enable glass view, to enable it make sure that your VGA driver is installed.

First, I'd Like to thank Ehab el Gindy (Hobzy) he helped me in that.

To do right click on Desktop->Personalize->Windows Color and Appearance->Open classic appearance properties for more color options then from Color scheme select Windows Aero

.. more.

Per-application sound settings

Per-application sound settings feature in Vista enables you to adjust sound volume for each application can access your sound device as you see below

Usually, we want to decrease MSN sound because of our cute friends who give us Nudges and Guitar Smash wink while listening to bond team music or Beethoven symphonies loudly, if you don't use per-application sound settings in this case, you'll be homeless :-)

To adjust it, open "Volume Mixer" right click on Speaker Icon in Start bar then Open Volume Mixer. Now you can adjust any opened application displayed by adjusting the TrackBar.

.. more.

Sunday, February 18, 2007

Linux Shell Tip #1

As you use linux you will have to type commands into the shell. In this series of posts i am going to tell you how to overcome some annoyances when using the linux shell.

If you open gedit (a simple text editor) through the command line (by typing gedit) you will find that the terminal is still open. And if you close the terminal gedit will be closed too.

To override this behaviour you can type :
nohup gedit

This way if you close the terminal gedit will not be closed.

So what happens and how does nohup solve it??

When you run any program through the shell, this program is opened as a child process to the shell process. That means that the shell is a parent process to the program you have just run. So when you close the parent process(The shell in our case), a hangup signal is sent to the child process (Your program) which closes as a result.

nohup (means "no hangups") lets your program ignore those hangup signals, so that you can close the shell safely without mistakenly closing the program you have run.

Ofcourse, nohup is not constrained to gedit only. You can use it for any other program:
nohup "Your command"

.. more.

Saturday, February 17, 2007

Windows Presentation Foundation part 1

In this post, I will speak about the Windows Presentation Foundation (or WPF) which is one of the most important technologies in .NET framework 3.0.
Before beginning in WPF, we have to reply on some questions:
What is Microsoft .NET Framework 3.0? And what is the difference between it and previous releases?

Briefly, the Microsoft .NET Framework 3.0 (formerly WinFX), is the new managed code programming model for Windows. It combines the power of the .NET Framework 2.0 with four new technologies: Windows Presentation Foundation (WPF), Windows Communication Foundation (WCF), Windows Workflow Foundation (WF), and Windows CardSpace (WCS, formerly “InfoCard”).

Use the .NET Framework 3.0 today to build applications that have visually compelling user experiences, seamless communication across technology boundaries, the ability to support a wide range of business processes, and an easier way to manage your personal information online.

Windows Presentation Foundation (WPF)
The Windows Presentation Foundation (or WPF), formerly code named Avalon, is the graphical subsystem feature of the .NET Framework 3.0 and is directly related to XAML "Extensible Application Markup Language ". It is pre-installed in Vista the latest version of the Microsoft Windows operating system.

WPF is also available for installation on Windows XP SP2 and Windows Server 2003. It provides a consistent programming model for building applications and provides a clear separation between the UI and the business logic.

A WPF application can be deployed on the desktop or hosted in a web browser. It also enables richer control, design, and development of the visual aspects of Windows programs.
It aims to unify a host of application services: user interface, 2D and 3D drawing, fixed and adaptive documents, vector graphics, raster graphics, animation, data binding, audio, and video.

There are a number of development tools available for developing Windows Presentation Foundation applications.
One of the good tools is Microsoft Expression Blend.To download it, please follow the installation instructions:

http://www.microsoft.com/products/expression/en/expression-blend/try.mspx
This was just introduction to WPF.
To be continued….

.. more.