If you are tired of heavy-weight (but still decent) GUI tool kits like Qt 4 or wxWidgets, you should take a look at fltk. A statically linked, Intel-only “hello world” takes just 212kb on Mac OS X:
Feel free to use this simple quickstart (zip, < 900kb, incl. fltk 1.3) if you’d like an Xcode sample project.
Tags:
Zivo wrote a great post on the simple logic of chaining/ANDing/ORing Bash commands:
*snip*
Command Chaining:
TO run a -> b -> c
ls -lF /etc; pwd;who;ps
Logical ANDing:
Program b will execute only if program a was executed
a&&b&&c
Programs run mutually inclusive
Returns a exit status 0 and then run b exit status 0 and then run C
Logical ANDing – runs subsequent based on exit status of 0
ls -l /etc/resolv.conf && grep name /etc/resolv.conf
Logical ORing:
Run subsequent program based on failure of previous
ls -l /etc/resolve.conf || grep name /etc/resolv.conf
Example:
If the file text.txt doesnt exist you can create with ORing
ls -l test.txt || touch test.txt
Combining ANDing ORing
-bash-3.00$ ls -l text.txt || touch test.txt && ls -ltr test.txt
text.txt: No such file or directory
-rw-r--r-- 1 carlosap other 0 Aug 22 00:13 test.txt
BASH for LOOPS
text.txt
1
2
3
LOOPS SYNTAX:
for variable in list; do command variable; done
-bash-3.00$ for i in `cat test.txt`; do echo $i; done
1
2
3
-bash-3.00$ for i in `cat test.txt`; do echo test$i; done
test1
test2
test3
*snap*
Tags:
NetBeans 6.7 has just been released, and I am really curious about it. Installation worked like a charm, but the app failed when being launched in the Finder.
I tried “open /Applications/NetBeans/NetBeans\ 6.7.app/” in the Terminal, but all I got was “LSOpenFromURLSpec() failed with error …”.
Luckily there’s this blog with a decent solution:
1. open Terminal.app and log in as root (sudo -s)
2. enter this:
# cp -p /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/bin/java /tmp/java_original_binary
# lipo /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/bin/java -remove x86_64 -output /tmp/java
# cat /tmp/java > /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/bin/java
NOTE: you need root powers for this hack – don’t try this if you don’t understand the code. If it fails you are on your own…
Feel free to launch NetBeans now 
Tags: