Showing posts with label Computer. Show all posts
Showing posts with label Computer. Show all posts

Sunday, August 5, 2012

Signal Flow Graph Solver (sfg.js)

Hi it's been a while since i have posted here (about 1 year) and i apologize for that,a lot happened in the last year that prevented me from keeping this blog updated.
Any way this post is about a project that i have been working on in my free time.
It's a signal flow graph solver made entirely in javascript. it might come handy in solving simple problems or for demonstration of signal flow graphs.
Here is a quick -not so fancy- video about the application

I have released the source code on github under the mit license,so check it if you are interested.
hope you might it useful.

Friday, May 27, 2011

Mimic Compiz Zoom in Windows 7

The most thing that i miss once i log into windows is the compiz zoom using the winkey and the mouse wheel feature on linux , i tried to search for alternative but with no luck each time till i read an article recently on lifehacker which shows that the new built in magnifier in windows 7 has a mode to magnify the whole screen rather than certain part (aka docked mode) , that was great news except the shortcut keys are Winkey +/- and can't be changed !!.

After some searching i found a program called autohotkey that could serve me in solving this issue , any way if you aren't into technical details you can grab the compiled version and start using it immediately.
Otherwise , here is the complete source code of the script
; Created By :
;     Ahmed Kotb on 27/5/2011
; licensed under :
;     Creative commons Attribution 3.0
;     http://creativecommons.org/licenses/by/3.0/us/
; version :
;     1.0

; A small script that enables you to zoom in/out using the winkey
; and mouse wheel instead of winkey +/- on windows7 magnifier program

#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%

;zoom in
#WheelUp::send #{sc4E}
;zoom out
#WheelDown::send #{sc4A}

You may need to alter the default zoom value instead of 100%  to a more usable amount , iam fine with 25%

Hope you find it useful.

Wednesday, July 21, 2010

Missing Icons in Gnome System Menu

since i have installed ubuntu 10.04 ,  i have noticed that the icons in the system menu is missing ,  like this


actually i didn't bother .. but today i had some time to kill so i searched about that issue and found that it is a known bug since karmic and the solution is not that hard

here are the steps :

  1. Press Alt+F2 ... type gconf-editor and press run
  2. navigate to : /apps/desktop/gnome/interface
  3. and make sure that the menus_have_icons is marked
here is the gconf-editor screen


and you will have your icons back :)

i also noticed that this option brings icon to many menus in Ubuntu not just the system menu
here is the bug page: https://bugs.launchpad.net/ubuntu/+source/gnome-panel/+bug/442973
hope that was useful

Wednesday, June 23, 2010

missing unix2dos and dos2unix in ubuntu 10.04

unix2dos and dos2unix were handy tools used to convert files' endings from/to windows and Linux.
after i installed ubuntu 10.04 then installed the tofrodos package as usual i was surprised that the two programs doesn't exist , after some searching i discovered that the programs were just given different names
so:
the unix2dos become todos
and the dos2unix become fromdos
you can adopt to this new names or give them aliases if you wish...
hope that was useful.

Saturday, June 19, 2010

git packing

while i was reading the git community book , i have noticed this paragraph in the first chapter

It is important to note that this is very different from most SCM systems that you may be familiar with. Subversion, CVS,Perforce, Mercurial and the like all use Delta Storage systems - they store the differences between one commit and the next. Git does not do this - it stores a snapshot of what all the files in your project look like in this tree structure each time you commit. This is a very important concept to understand when using Git.
actually i didn't believe that ... i thought that would make git the most space inefficient scm ever created ... although data is compressed before storing but still each new change to a file however small will make git store ALL that file Again to the repository !!!!

so to make sure of that i wrote the following script

#!/bin/bash
git init
i=0
while [ $i -lt 20 ]
do
 echo commit $i
 du -hs
 git add a > /dev/null
 git commit -m "commit $i" > /dev/null
 i=$(($i+1))
 echo $i >> a
 echo '--------------'
done

the script appends one character to the file then commits the changes , at each commit it prints the size of the repository.
during the 20 commits the size of the repository grew from 1020K to 7.1 MB !!!

off course that is not the full story , git uses something called Packing ... it stores large number of objects in the same file using delta-compression , so data is not written more than one time , still newly created objects are stored again so periodic repacking is needed to reduce the repo size.

lets try to execute git gc in our repo
it prints the following
Counting objects: 60, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (40/40), done.
Writing objects: 100% (60/60), done.
Total 60 (delta 20), reused 0 (delta 0)

and the size of the repo became 1.3 MB !!! that is just great ...
so git is really space efficient compared to others.

Tuesday, May 18, 2010

Fix matlab gui in linux

This term I had to do some work on matlab so I installed the linux version but I found something very irritating in the guide gui builder , the gui wasnt stable at all and every time I move a button or any control all the window flickers like this …

at first I thought compiz was the reason for this but it turns out that disabling compiz has no great effect.
after a lot of searching I found that the reason of the problem was Java !! … matlab didnt find the jre location therefore couldn't render the gui well,
so a the executing this simple command in your terminal solves the problem

export MATLAB_JAVA=/usr/lib/jvm/java-6-sun/jre/

note : you have to replace the path on the previous command with the correct path of the jre

Friday, April 30, 2010

Ubuntu 10.04 Released

Ubuntu 10.04 LTS





it has been long since my last post but today Ubuntu 10.04 was officially released and available for download with lots and lots of new features ...the sad news is iam still using 9.04 and i dont have any time for a clean install due to study and assignments :(

which reminds me about a program that i use to manage my todo lists and i wanted to blog about but unfortunately there was no time for it either ...
Getting Things Gnome is a small program to manage todo lists and tasks

pretty list , isn't it ? :)

just found that it will be getting an integration with online services like remember the milk which is great..
any way enjoy Ubuntu :)

Wednesday, December 9, 2009

My First Google Chrome Extension

yesterday i have uploaded my first Google chrome extension to the official extension gallery that was opened for public few days ago.
say hello to Chrome MineSweeper :D



i know that some will say that mine sweeper is not some thing that you will use every day.. and i agree to some extent with but if you really understood this game you will find it really addicting .. i remember the first time i played it i finished the advanced board in 9 min !!!! but after some time my speed increased dramatically and i finished with this scores.

  • Small Board : 6 seconds
  • Medium Board : 41 seconds
  • Large Board :  135 seconds

which aren't a world class records :) but still makes me proud :D


any way ,
hope you like the extension ...
and please don't hesitate to leave your feedbacks and/or comments here.

Thursday, June 25, 2009

Quine-mcCluskey Logic Simplifier

in our fundamentals of logic design course we were required to implement the Quine-mcCluskey tabular method as (a summer project) to simplify boolean function and i was able to implement it using python  so i decided to share it hope it could be useful to some one ...

here is an executabe version for windows..(made using py2exe project)


and here is the python source code files...


it is worth mentioning that the source files consists of :
tabular.py : which the main program is found and u could also execute it from the command line using arguments
gui.py : which is a graphical user interface for the program using tkinter libs
   
features:
  • able to solve Boolean function upto 26 variable (theoretically it can do more but this just a limit that i enforced to be able to represent the variables using A,B,C....Z Notations , of course u can  remove this limit)
  • displaying the prime and essential implicants ( by default the program displays the implicants on letters but u can also change this to display them in numbers )
  • perform petric brute force algorithm to get the best (lowest cost) solution
  • draw the Prime Implicant chart before finding the essential prime implicants and after finding them...
to do :
those are some ideas that may/may not be done...
  • adding column and row dominance simplifying techniques.
  • adding a documentation for tabular.py and more comments to illustrate the algorithms used.
  • adding an interactive mode to solve the problems step by step.
  • adding a karno-map simulation.
  • improving the gui....
  • adding the project to source-forge ?...may be... :)
ScreenShots:
using gui mode



using the command line ( this picture is a part of the output not all of it)



finally... i will really appreciate any feedbacks , bug reports and/or opinions.
please send them to

or here in the comments...
thanks...
           

Sunday, June 14, 2009

Shutdown after Update in ubuntu

last two weeks i was busy in my exams and ubuntu wanted to download alot of updates..that is normal but for people with low connection speed having alot of updates is not that nice...as i will have to leave the computer open for a long time and offcourse i will not be able to use the Internet as the update-manager draws all the speed..so i decided to leave it open and go some where but i found no option in ubuntu update manager to close the computer after finishing updates so i created this small python script that will shutdown the computer after finishing all the updates and here it is...


import time
import os
import getpass
password = getpass.getpass('please enter your password : ')
x = os.popen('ps -ef | grep "/usr/bin/gksu --desktop /usr/share/applications/update-manager.desktop"')
s=x.readline()
x.close()
if s.find("grep") == -1 :
 running=True
 print "updating manager is working..."

 while(running):
   x = os.popen('ps -ef | grep "/usr/bin/gksu --desktop /usr/share/applications/update-manager.desktop"')
   s=x.readline()
   x.close()
   time.sleep(10)
   print "still working..."
   if s.find("grep") != -1 :
    running=False
  
  os.popen("sudo -S shutdown -h 5", 'w').write(password)



Script usage is very simple :
just lunch the update manager and start the update process as usual then open a terminal and lunch the script (python "scriptname.py")
you will have then to write your password it is only used to call the shutdown command (i promise :D ) then you can go to sleep :D and the script will do the rest...
after finishing updates the script will give you 5 min to cancel the shutdown proccess if you have changed your mind...
hope you found this script useful

Friday, March 13, 2009

get your hotmail emails in gmail

Hotmail finally after a very long time have enabled pop3 for free so you can get your emails in any mail client that support pop3 protocol..
However , i wanted to forward my emails to my Gmail account so here is how u can do it ( don't worry you don't have to know what is pop3 to follow this tutorial :D )
  • open settings >> account tab
  • select "add email account you own"
  • enter ur hotmail accout email address and click next step
  • fill the data in the form that will appear as following
user name : yor complete email address
password : your password
pop server : pop3.live.com
port : 995

you have the option to leave a copy in hotmail account or delete it.....it is better to use ssl when retrieving mail as it is more secure...
gmail also enables you to create a label for the incoming mail and you can also achieve it..
click on add account and you are done :) .
gmail will also give u the option to send mail from your account , you can follow the instructions to do such thing...

after that you might found a new 300 emails in ur inbox ...dont panic !!! gmail have just download your whole hotmail inbox..you can then delete or achieve this messages.

it is worth mentioning that the main drawback for using this way that u might not recieve your emails at the same instant they were sent to your hotmail inbox as Gmail checks new messages at different rates, depending on previous mail fetch attempts and you cant control this rates...

Saturday, November 29, 2008

HP Magic Giveaway

image hp in its celebration of this holiday session and the thanksgiving will give 50 bloggers a six thousands dollars valued package to share with their visitors. !!!

so what does this package include ?

According to hp magic giveaway site , windows connected , Jake Ludington’s and GearLive Blogs

Hardware

Accessories

Software

Entertainment

hp

an interesting package isn't it ?? :)

for the complete list of blogs see this link.

it is worth mentioning that each blog will define its rules to win the package ...some will choose randomly others will require you to register in their site ..etc. but the what I have noticed is that the common rule in many blogs is that you will have share your prize with others..windows connected blog says "impacting a number of peoples lives with the hardware will get you the best chance to win" also bleeping computer blog require that you share at least one computer with some one who is in need of it...

Another thing to know is that not all of the blogs will start in the same time..each blog will start on a certain date and choose a winner after a week..I found an excellent article in istartedsomething blog which lists all the blogs and their starting dates in a fancy Google calendar :)...

and yes this giveaway is global and not restricted to USA citizens..so go ahead and don't forget your friend :)

Good Luck For Every One...

Sunday, November 23, 2008

Typealyzer

While I was searching for something I stumbled upon this interesting site ..Typealyzer which still in beta analysis your blog posts and determines what kind of person you are...i give it a try and here are the results.. :D

ISTP - The Mechanics

The independent and problem-solving type. They are especially attuned to the demands of the moment are masters of responding to challenges that arise spontaneously. They generally prefer to think things out for themselves and often avoid inter-personal conflicts.
The Mechanics enjoy working together with other independent and highly skilled people and often like seek fun and action both in their work and personal life. They enjoy adventure and risk such as in driving race cars or working as policemen and firefighters.

it also gives me an analysis of what part of my brain was dominant while writing !!!! really interesting.

it is worth mentioning that it still in beta..and the results might not be very accurate at least for me..as I am sure that I don't enjoy risks or driving race cars !! :D

Sunday, October 12, 2008

Project Touchless

Touchless is a free open source application hosted by CodePlex and built using .Net technologies , it enables you to do some touch tricks by using a webcam that tracks color based markers.

According to the project main page it is divided into two parts:

-Touchless Demo is an open source application that anyone with a webcam can use to experience multi-touch, no geekiness required. There are 4 fun demos: Snake - where you control a snake with a marker, Defender - up to 4 player version of a pong-like game, Map - where you can rotate, zoom, and move a map using 2 markers, and Draw - the marker is used to guess what....  draw!

-Touchless SDK is an open source SDK that enables developers to create multi-touch based applications using a webcam for input, geekiness recommended.

they provide a nice video which demonstrate all the features off the project.

Touchless

the first thing you might need after launching the demo is to set webcam and ensure that it is working then you will need to create markers, you should use a distinguished one so the camera can easily recognize and you can create more than marker , actually you will need more than one to play the demo's included.

the demo that I liked most is called the image demo were you can rotate , move and resize a photo with two markers like pictures in iphone or Microsoft surface.

and here is a screenshot where I was able to control a picture with two screwdrivers :D.

123

the second demo is a small snake game.

there is also another game that you can play with three other players

3

the last one is a paint demo where you can draw with markers.nice drawing,isn't it ? :).

4

Finally I hope you enjoy Multi touch with Touchless :D.

Wednesday, October 8, 2008

Analogy Screensaver

Screensavers were made originally to protect old CRT monitors from a problem called Phosphor burn-in which occurs when static image or text is displayed for long periods of time however they were used later on for other purposes like entertainment and security.

Modern CRT's are less vulnerable to burn-in problems and LCD screens doesn't face this problems at all so screensavers have lost their main goal that they were designed for , another thing is that screensavers consume power as when running computer normally and it causes screen aging.

According to wikipedia :

A typical LCD screen loses about 50% of its brightness during a normal product lifetime, if left on continuously

So the best thing to protect your screen is simply to turn it off when not used or configuring your computer to set the screen into a lower power mode and that could be done from power management in most modern operating systems.

However , sometimes you need a good or useful screen savers to be displayed if you are going to be idle for few minutes...

and here comes Analogy (the reason this article was written) a useful screensaver that displays a nice hybrid format clock into your screen.

11

Analogy is available for windows and OSX and can be downloaded from here.

Thursday, October 2, 2008

WebMail Notifier - Firefox Extension -

If you are a firefox user and you don't use mail clients like outlook or evolution then you might found this firefox extension useful.

WebMail Notifier will notify you when you receive a new message in your mail inbox and I found it great because of the following reasons :

  • Simple and just do what it says.
  • Supports Many mail services like gmail , hotmail and yahoo and others..
  • Low memory usage compared to installing a complete standalone program.
  • Much more better than using mail notifiers found in Chat Clients like MSN , yahoo ....

1 2 5

4

The Preference dialog is easy to understand and edit.3

Hope you found this extension useful.

Wednesday, October 1, 2008

Search Google in 2001 !!!

the Giant Company Google is Celebrating it's 10th Birthday, and in the honor of this occasion Google will give you a one month chance to search entries found in their old index (January 2001) where

"ipod" didn't refer to a music player, and "youtube" didn't refer to much of anything. !!!

google2001

the search page is found here.

Another thing is that it's not 100% like that of 2001 results as they have removed some sites also you will not find ads in search pages.

also when you search for a page you can see it's old archived version by clicking "View old version on the Internet Archive ", for more information see this FAQ page.

Tuesday, September 30, 2008

Compile and Execute Java Files using a bat file

I started to learn java and I needed a fast way to compile and execute small java programs that I wrote on notepad or my favorite Notepad++ and command prompt is considered a very fast way if you know that you Don't have to rewrite the command each time you want to compile or run a java file , you can just write them in a .bat file and execute all this commands with a double click.

All what you have to do is to write the commands in a text file and save it with .bat file extension.

An example of .bat file that compiles and execute a java file in my desktop :

@echo off

rem delete the old class file to avoid executing it
rem if there was an error in the new java file
cd C:\Documents and Settings\Ahmed Kotb\Desktop\
if exist a.class del a.class

rem Compile the java file(s)
cd C:\Program Files\Java\jdk1.6.0_04\bin\
javac "C:\Documents and Settings\Ahmed Kotb\Desktop\a.java"

rem Execute
cd C:\Documents and Settings\Ahmed Kotb\Desktop\
if exist a.class java a

pause

any comments or questions are welcomed
Hope this was useful.

Friday, August 22, 2008

My First Program

While I was organizing some old files I found this,My first program that I have made 6 years ago using visual basic 3 !!! (yes it was my first language) unfortunately I haven't found the valuable source code to share however the screen shot is enough to make you laugh :)

1st

5 years of kotbcorp

Two days ago this blog completed its 5th year  :). So congratulations to my self and Thanks for the few followers that have been here for ...