Al Hoang

March 21, 2008

Desktop environments and habits

Filed under: tech — hoanga @ 8:12 pm

Slashdot’s Roblimo has an article on switching back and forth between GNOME and KDE and that will probably spawn a long (,mostly pointless) debate on the merits of GNOME versus KDE versus foo that I’m sure many Linux users will have. The biggest gem in the article is in his discussion on why he hasn’t been converting people to use Desktop Linux

I don’t have time for much intense hand-holding, and that’s what it takes to teach people who are not naturally computer-inclined how to use any new operating system or software.

Habits are hard to break.

Kudos to the people who have the time and patience to help people embark on the long journey that requires ’switching’. However, I’m with Roblimo on this. I have a hard enough time managing my own time let alone adding more stuff to take away what I have of my time.

Read it yourself

Being stupid on numrows() versus getting the actual result in LuaSQL

Filed under: programming, stupid — hoanga @ 9:53 am

I’m dumb. I had a bug in a checker script that I wrote and only noticed it recently when I bothered to RTFM. Can you spot the error? Probably most programmers will.

Non-working version

require "luasql.mysql"

env = luasql.mysql()
mysqlconn = env:connect("somedb", "someuser")
curs = mysqlconn:execute("
SELECT COUNT(*) FROM some_table WHERE col1 = ''foo")
print("Number of rows in $dlq queue is: ", curs:numrows())

Working version

require "luasql.mysql"

env = luasql.mysql()
mysqlconn = env:connect("somedb", "someuser")
curs = mysqlconn:execute("
SELECT COUNT(*) FROM some_table WHERE col1 = ''foo")
print("Number of rows in $dlq queue is: ", curs:fetch())

Wall Street Journal on the necessity for IT Literacy in the enterprise

Filed under: tech — hoanga @ 9:52 am

WSJ talks about the need for IT literary in the enterprise. Especially from the people who sit at the top.

The article makes a strong case suggesting the tops of the company should have a much stronger grasp of IT in their organization to understand the benefits it can bring the organization instead of a just a recurring expense and trying to isolate the tech crew.

It’s rather convincing however it forgets one thing. “He who owns the gold, makes the rules”. In general, IT doesn’t own the gold. Anyways, here’s hoping…

Read it yourself

Getting erlang to build on MacPorts with an installed iPhone Open SDK

Filed under: fixes, osx — hoanga @ 9:48 am

I had some serious unexpected fun trying to install erlang on my OS X box using MacPorts. In general it’s usually a no brainer you usually type sudo port install <foo> and you have a new package installed without that much fuss. However here is the partial log of trying to install erlang and it blowing up…

$ sudo port install icu erlang
... ICU installs without a problem ...
--->  Fetching tcl
--->  Attempting to fetch tcl8.5.1-src.tar.gz from http://downloads.sourceforge.net/tcl
--->  Verifying checksum(s) for tcl
--->  Extracting tcl
--->  Configuring tcl
--->  Building tcl with target all
Error: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_tcl/work/tcl8.5.1/unix" && make all " returned error 2
Command output: /usr/bin/gcc-4.0 -c -Os -O2 -pipe    -Wall -Wno-implicit-int -fno-common -I. -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_tcl/work/tcl8.5.1/unix/../unix -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_tcl/work/tcl8.5.1/unix/../generic -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_tcl/work/tcl8.5.1/unix/../libtommath -DPACKAGE_NAME=\"tcl\" -
...
...
...
_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_tcl/work/tcl8.5.1/unix/../unix/tclLoadDyld.c
In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_tcl/work/tcl8.5.1/unix/../unix/tclLoadDyld.c:62:
/usr/local/include/mach-o/arch.h:35: error: nested redefinition of 'enum NXByteOrder'
/usr/local/include/mach-o/arch.h:35: error: redeclaration of 'enum NXByteOrder'
/usr/local/include/mach-o/arch.h:36: error: redeclaration of enumerator 'NX_UnknownByteOrder'
/usr/include/architecture/byte_order.h:137: error: previous definition of 'NX_UnknownByteOrder' was here
/usr/local/include/mach-o/arch.h:37: error: redeclaration of enumerator 'NX_LittleEndian'
/usr/include/architecture/byte_order.h:138: error: previous definition of 'NX_LittleEndian' was here
/usr/local/include/mach-o/arch.h:39: error: redeclaration of enumerator 'NX_BigEndian'
/usr/include/architecture/byte_order.h:140: error: previous definition of 'NX_BigEndian' was here
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_tcl/work/tcl8.5.1/unix/../unix/tclLoadDyld.c: In function 'TclpFindSymbol':
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_tcl/work/tcl8.5.1/unix/../unix/tclLoadDyld.c:382: warning: 'NSLookupSymbolInImage' is deprecated (declared at /usr/include/mach-o/dyld.h:182)
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_tcl/work/tcl8.5.1/unix/../unix/tclLoadDyld.c:415: warning: 'NSLinkEditError' is deprecated (declared at /usr/include/mach-o/dyld.h:217)
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_tcl/work/tcl8.5.1/unix/../unix/tclLoadDyld.c:419: warning: 'NSLookupSymbolInModule' is deprecated (declared at /usr/include/mach-o/dyld.h:181)
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_tcl/work/tcl8.5.1/unix/../unix/tclLoadDyld.c:428: warning: 'NSAddressOfSymbol' is deprecated (declared at /usr/include/mach-o/dyld.h:188)
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_tcl/work/tcl8.5.1/unix/../unix/tclLoadDyld.c: In function 'TclpUnloadFile':
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_tcl/work/tcl8.5.1/unix/../unix/tclLoadDyld.c:493: warning: 'NSUnLinkModule' is deprecated (declared at /usr/include/mach-o/dyld.h:169)
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_tcl/work/tcl8.5.1/unix/../unix/tclLoadDyld.c: In function 'TclpLoadMemory':
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_tcl/work/tcl8.5.1/unix/../unix/tclLoadDyld.c:697: warning: 'NSCreateObjectFileImageFromMemory' is deprecated (declared at /usr/include/mach-o/dyld.h:146)
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_tcl/work/tcl8.5.1/unix/../unix/tclLoadDyld.c:730: warning: 'NSLinkModule' is deprecated (declared at /usr/include/mach-o/dyld.h:161)
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_tcl/work/tcl8.5.1/unix/../unix/tclLoadDyld.c:732: warning: 'NSDestroyObjectFileImage' is deprecated (declared at /usr/include/mach-o/dyld.h:147)
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_tcl/work/tcl8.5.1/unix/../unix/tclLoadDyld.c:740: warning: 'NSLinkEditError' is deprecated (declared at /usr/include/mach-o/dyld.h:217)
make: *** [tclLoadDyld.o] Error 1

Error: The following dependencies failed to build: tk tcl
Error: Status 1 encountered during processing.

Pretty sucky, huh? My first lazy thought was, “I thought the point of a package manager was to avoid all these problems.”

After a little bit of thinking and staring at the error message, I did the workaround and moved the /usr/local/include directory away and tried rebuilding which made things much happier. Check the log below…

$ cd /usr/local
l$ ls
arm-apple-darwin	include			man
bin			info			share
docs			lib
etc			libexec
$ sudo mv include include.ignore
l$ sudo port install icu erlang
Skipping org.macports.activate (icu ) since this port is already active
--->  Cleaning icu
--->  Building tcl with target all
--->  Staging tcl into destroot
--->  Installing tcl 8.5.1_0
--->  Activating tcl 8.5.1_0

Voila. A working erlang install. Don’t forget to move back the include directory back to its old place.

Too Dumb to Haskell

Filed under: humor, programming — hoanga @ 9:01 am

Powered by WordPress

Protected by AkismetBlog with WordPress