Bash (Born Again SHell) allows to convert hexadecimal number to decimal integers. For example, so:
echo $[0xFFFE]
Or this way:
let x=0xFFFE ; echo $x
or
((x=0xFFFE)) ; echo $x
Or so:
printf "%d\n" 0xFFFE
The last way, allows to convert the decimal values to the hexadecimal format. So I made two aliases for a test:
alias h2d='printf "%d\n" ${1}'
alias d2h='printf "0x%x\n" ${1}'
Now, I can write:
h2d 0x3B
and
d2x 12
Monday, May 31, 2010
Visual Studio for iPhone?
Absolutely unexpected:
AppleInsider. Microsoft's Steve Ballmer rumored to present at Apple's WWDC 2010
Think Different. Rumor: Will Steve Ballmer demonstrate Visual Studio for iPhone on WWDC?
Chowdhry says the new version of VS will allow developers to write native applications for the iPhone, iPad and Mac OS.Barron's. Apple: Will Steve Ballmer Show Up At The WWDC Keynote? Update: No, He Won’t
AppleInsider. Microsoft's Steve Ballmer rumored to present at Apple's WWDC 2010
Think Different. Rumor: Will Steve Ballmer demonstrate Visual Studio for iPhone on WWDC?
Saturday, May 29, 2010
Setstone + NeXT Computer = NextSTEP framework
Mac OS X Reference Library. Why Objective-C?
Historical note: As a language, Objective-C has a long history. It was created at the Stepstone company in the early 1980s by Brad Cox and Tom Love. It was licensed by NeXT Computer Inc. in the late 1980s to develop the NeXTStep frameworks that preceded Cocoa. NeXT extended the language in several ways, for example with the addition of protocols.
Historical note: As a language, Objective-C has a long history. It was created at the Stepstone company in the early 1980s by Brad Cox and Tom Love. It was licensed by NeXT Computer Inc. in the late 1980s to develop the NeXTStep frameworks that preceded Cocoa. NeXT extended the language in several ways, for example with the addition of protocols.
Monday, May 24, 2010
Snow Leopard. Setup Terminal
1. Launch Terminal.
2. In the menu choose Preferences
3. On page Startup select Pro in the combo box
4. On page Settings select "Pro Default"
5. Check "Antialias text"
6. On page "Shell" select "Close if the shell exited cleanly" in the "When the shell exits:" combo box
7. Close the Preferences.
8. Make the Terminal window bigger.
9. In the menu Shell press on "Use Settings As Default"
10. In the Terminal window type:
nano .profile
11. Add the following text:
export PATH=.:$PATH
export PS1="[\[\e[33m\]\u@\H \[\e[32m\]\w\[\e[0m\]]\n[\[\e[31m\]\!\[\e[0m\]]>"
export CLICOLOR=1
12. Press Ctrl+o. Press Enter.
13. Press Ctrl+x. It closes the editor.
14. In the Terminal type
exit.
Now you can launch Terminal again and type, for example:
ls -l
2. In the menu choose Preferences
3. On page Startup select Pro in the combo box
4. On page Settings select "Pro Default"
5. Check "Antialias text"
6. On page "Shell" select "Close if the shell exited cleanly" in the "When the shell exits:" combo box
7. Close the Preferences.
8. Make the Terminal window bigger.
9. In the menu Shell press on "Use Settings As Default"
10. In the Terminal window type:
nano .profile
11. Add the following text:
export PATH=.:$PATH
export PS1="[\[\e[33m\]\u@\H \[\e[32m\]\w\[\e[0m\]]\n[\[\e[31m\]\!\[\e[0m\]]>"
export CLICOLOR=1
12. Press Ctrl+o. Press Enter.
13. Press Ctrl+x. It closes the editor.
14. In the Terminal type
exit.
Now you can launch Terminal again and type, for example:
ls -l

Saturday, May 22, 2010
GNU utilities for Win32
In case someone needs: GNU utilities for Win32.
Friday, May 21, 2010
Sun in Netanya. May 21.2010
It's not just a photo. It was very strange to see on the sky something like a circle rainbow around the sun in a sunny day.
Thursday, May 20, 2010
Determine memory on your Mac
Type (copy and paste) the following line in the Terminal:
system_profiler SPMemoryDataType | grep -e 'Size: [0-9]' | awk '{print $2}' | perl -e '$sum=0; while (<>) { $sum+=$_;} print "$sum\n";'
The output will be the amount of the memory on your Mac.
Funny? I found this exercise in a nice book "Beginning Mac OS X Snow Leopard Programming".
If you want to understand what's going on, you need to test sequemtially each part:
system_profiler SPMemoryDataType
system_profiler SPMemoryDataType | grep -e 'Size: [0-9]'
system_profiler SPMemoryDataType | grep -e 'Size: [0-9]' | awk '{print $2}'
system_profiler SPMemoryDataType | grep -e 'Size: [0-9]' | awk '{print $2}' | perl -e '$sum=0; while (<>) { $sum+=$
system_profiler SPMemoryDataType | grep -e 'Size: [0-9]' | awk '{print $2}' | perl -e '$sum=0; while (<>) { $sum+=$_;} print "$sum\n";'
The output will be the amount of the memory on your Mac.
Funny? I found this exercise in a nice book "Beginning Mac OS X Snow Leopard Programming".
If you want to understand what's going on, you need to test sequemtially each part:
system_profiler SPMemoryDataType
system_profiler SPMemoryDataType | grep -e 'Size: [0-9]'
system_profiler SPMemoryDataType | grep -e 'Size: [0-9]' | awk '{print $2}'
system_profiler SPMemoryDataType | grep -e 'Size: [0-9]' | awk '{print $2}' | perl -e '$sum=0; while (<>) { $sum+=$
Subscribe to:
Posts (Atom)