Thursday, September 22, 2011

Two echo commands on the same line

I want to:
echo two or more lines output inside a loop such that the loop outputs the echo on the same lines, to prevent scrolling when the loop is for example 100 times.

I searched the web for "shell echo output same line", but didn't find what I wanted. I got this command
echo -en "hello"
which the -en option means print on the same line from the first character place. Which did not do the trick which I wanted because it is only for one line. Then I found the command "tput" which manipulates the cursor, and the code that moves the cursor up 2 lines
echo -en "\033[2A"
and here is what I got:

A sample code for echo 'ing two lines on the same place! It can be used to print more than two lines on the same lines.

echo "Total Files to search " $count 
echo "" # These two empty lines are needed for proper formating.
echo "" # For example when the cursor is at the end of the screen!
echo -en "\033[2A" # Move the cursor up 2 lines
tput sc	# Save the cursor position

j=0
for i in $searchDir
do
	tput el	# clear to end of line
	echo "Searching count $j out of $count"
	tput el # clear to end of line
	echo "Searching file $i"
	tput rc # Restore the cursor position

	j=`expr $j + 1`
done

echo ""
echo ""
echo ""
echo "Finished"

Thats all.

Thursday, August 5, 2010

Mind pad computers-mobiles

Control Your Nokia N900 By your Mind

This is what I wanted to blog about. The new technology is now towards BCI. The technology have reached a nice level in it and by future everything can and will be controlled by our Minds. No keyboard no mouse, no sound commands.
For now there are these products in the market:
http://en.wikipedia.org/wiki/NeuroSky/
http://en.wikipedia.org/wiki/Emotiv_Systems/
And the comparison:
http://en.wikipedia.org/wiki/Comparison_of_consumer_brain-computer_interface_devices/

So now the market is fighting with touch pad computers, in the future they will fight for mind pad computer/mobile or "mind screen computer/mobile".

I have posted this to say that there is a project plan to start working with one of the above products and develop a software for complete controlling of the computer or mobile. This can be done with the help of automation scripts - which I will make another blog for scripts automation on windows, linus, unix, and mobiles.

Good luck to future mind pad computers/mobiles.

Some useful links that I keep adding:
UCLA / Caltech researchers help patients move mouse cursors with their brains

Friday, June 25, 2010

Animation Advertisement

In 2007 Animation Advertisement came to my mind. The idea was to make use of the big advertisement screens that are on the roads of Kingdom of Bahrain for the animation without any sounds. And later expand the project.

For the start I was thinking of making simple ads like animation on traffic laws such as wearing seat belts, speed driving, driving and talking on the phone and so on.

I have done a lot of search and reading about drawing, animation, storyboards, film making, film editing, screen play, and so on. And one of the software  I found for 2D animation was Anime Studio. I have also looked at the work of one professional company that does animation and they are GreyKid (now they are called Freakish Kid. Their work is amazing!

Since I am not good at drawing I wanted to try it myself, if I can do it and if I can start a project about Animation Advertisement in the Kingdom of Bahrain.
These are the things that I have read and done:
Read a lot of books related to drawing. Read the basics of film making. Read the basics of animation. Read about the basics of 2D & 3D animation. Did some paper hand drawings. Did some 2D drawings using Anime Studio, I was using version 5 that time! Also I have done some animation using Anime Studio which was about 80% acceptable by me ;).

I will upload 2 drawings and 2 animation later.

Conclusion:
Animation Advertisement is not impossible! It can be done and we have all the required knowledge. I have tried to make a small team and start working on it, but didn’t find the dedicated team members and didn’t have the free time to work on it myself.
I can say that this project have good future. If anybody wants to start it let me know and I can give you all the info needed.

There is also another project which is making films and TV serials using animation but this is a different topic.

Wish you all good luck and regards.