Al Hoang

October 31, 2005

Windows Vs Unix linking dynamic load modules

Filed under: Uncategorized — @ 5:31 am

An very nice and short description of the differences between dynamic
module linking between Windows and Unix. It helped clear up one misconception
I had about Windows linking. .lib files are NOT static libraries
that you link into your program as I originally thought. Chris explains
it nice and succinctly:


In Windows, there are two types of library, a static library and an import library (both called .lib). A static library is like a Unix .a file; it contains code to be included as necessary. An import library is basically used only to reassure the linker that a certain identifier is legal, and will be present in the program when the .dll is loaded. So the linker uses the information from the import library to build the lookup table for using identifiers that aren’t included in the .dll. When an application or a .dll is linked, an import library may be generated, which will need to be used for all future .dll’s that depend on the symbols in the application or .dll.

Overall, a nice read helping to clear up (some of) the differences between
the linking system between Windows and UNIX.

Read it yourself

October 30, 2005

Looking for Comedy in the Muslim World

Filed under: Uncategorized — @ 8:06 am



Saw the trailer and it looks amusing. Wonder if it will make it to Japan,
though.

Memorable Quote

Lady: You’re not a Jew are you?
Al Brooks: Not… this minute

Watch the trailer

FreeBSD USB Hard Disk HOW-not TO

Filed under: Uncategorized — @ 7:59 am

I picked up a shiny new 160 gig drive to replace the current drive in the
server. The old approach to backup was something like this:

General Steps for backing up data partition

(Note: not exact steps)

  1. Power Down Server
  2. Insert new disk drive on a free IDE bus
  3. Setup new hard disk to be able to used in FreeBSD

    bsdlabel -w ad2
    newfs ad2

  4. Mount new hard disk to be able to copy things onto it

    mount /dev/ad2 /mnt/temp
  5. Dump data partition into new hard disk:
    ( dump -0f - /home ) | ( cd /mnt/temp ; restore -rf - )
  6. Power Down Again
  7. Swap hard drives
  8. Power up again, Done

Of course, snags always came up during that process but the main problem for
me is the Power Down phase. The server is just down for too long during the
dump session for my tastes. These days things are much easier with mass
storage devices for USB and Firewire. Just plug one of these babies in
and dump away. With the faster throughput of USB2.0 or Firewire, the finger
tapping has decreased somewhat. The MAJOR increase in storage capacity has
helped bring back up the wait times that the throughput increase would have
decreased.

I took my shot at using a USB HDD enclosure on the hard drive and plugging
it into FreeBSD. In the dmesg I saw a umass0 detected message but according
to the docs you should also be seeing a SCSI direct access drive.

Example da device detection (working case):

umass0: [Manufacturer shows up here]
da0 at umass-sim0 bus 0 target 0 lun 0
da0: Fixed Direct Access SCSI-0 device
da0: XX.000MB/s transfers
da0: YYYYYYMB (78125000 512 byte sectors: 255H 63S/T 4863C)

I saw only the umass0 message. After scritching my head why I saw no
da0 for awhile I realized something.

Support for USB HDD enclosures is heavily device driver dependent

aka. you can’t just buy any generic USB HDD enclosure and expect it to work.
I’d suggest reading the manpage for the
umass(4)
storage driver to ensure you have a compatible USB storage device. Needless
to say, the HDD enclosure I have (A DECA
SDHC-350) does not seem to be compatible with FreeBSD 5.4-STABLE at this time.

How I fixed it

I swapped to a IEEE1394 HDD enclosure I owned and the HDD came up perfectly
and was detected as da0 on my system. I then ran through the general backup
steps above to backup my system.

One thing I should add to the general steps is to create a very ‘basic’
FreeBSD installation on a small BSD slice on the data drive. With disk
space very cheap these days using up 1gig for a partition that can bootup
a minimal RELEASE or preconfigured setup is awfully handy when your system
drive takes a dive.

References

FreeBSD umass manpage
Encrypted Filesystem on a USB Thumbdrive
How to move FreeBSD to a new hard disk
How can I mount this device: da0

October 29, 2005

A visual guide to RAID

Filed under: Uncategorized — @ 12:42 am

Wow this is an awesome explanation of
RAID
without using more than 12 words!



October 27, 2005

Slinking by 8th grade math in the U.S.

Filed under: Uncategorized — @ 7:37 pm

James Robert links
to a mock 8th grade math test for U.S. students.

Out of curiosity I took a look at it and did okay. Although, in my
opinion too many number formulas and not enough problems to help translate
from a word problem into a math equation. Those tend to be harder but
I think are more useful in learning about how to apply math concepts learned
to a broader spectrum than just N+2=C.

My results:


***You Passed 8th Grade Math***

Congratulations, you got 10/10 correct!

Could You Pass 8th Grade Math?

 http://www.blogthings.com/couldyoupassei…

Try it yourself

Interesting Quote of the Day

Filed under: Uncategorized — @ 7:36 pm


I might be more thrilled at this prospect if I thought it would make us better, happier, nicer human beings. But that’s not immediately obvious to me.
- Charles Petzold, “Does Visual Studio Rot the Mind?”

Unfortunately, that is the way I feel about technology these days even though
I enjoy geeking out.

Read the original article yourself

Things to remember about Matlab

Filed under: Uncategorized — @ 7:36 pm

Pi != pi

> eval(cos(pi/2));
               pi
        cos(----)
               2
> eval(cos(Pi/2));
              0

October 20, 2005

How to Write Badly

Filed under: Uncategorized — @ 3:18 pm

Mainly aimed at academic journals but some of the principles are relevant
to becoming a better writer.


Writing is important



Even if ideas are great, when nobody can understand them, they are worthless.


Read it yourself (PDF)

October 17, 2005

Squeak Weekly

Filed under: Uncategorized — @ 8:40 am





Squeak is a great programming tool that
lots of coders will never get a chance to truly exercise (yet?). One thing
about getting into any software project is also learning about the community
that keeps it alive. Usually this means finding websites with information
on it or keeping up with mailing lists. However, the
Squeak
Development Mailing List
gets a truly heavy amount of email per day
(Easily 40+ mails on a not so fast day). This is very hard to keep up with
but it also shows that the Squeak project overall is very lively.

Enter Squeak Weekly an
effort by one person to try to take the best of what’s happening in the
Squeak community every week and summarize it. It also has interviews or
Q&A sessions with many primary Squeak people in the community which is a great
way to understand what is happening within the community.

This week’s interview was with Andreas Raab and I found some interesting
stuff out on Tweak:


Another key idea in Tweak is that of asynchronous event handling. Unfortunately
I can’t say I invented that (though at the time where I came up with the idea I
wasn’t aware of anybody else doing it) but it turns out that this is what is
now typically referred to as “event-loop concurrency”. The idea here is that
all responses to events are asynchronous messages, e.g., are executed some time
*after* the event has been signaled. The reason this is important is that by
using asynchronous events you do not expose internally inconsistent state to a
listener.

When you use synchronous events (callbacks) you end up with the
problem that the listener (inadvertently or not) may request temporarily
inconsistent state or otherwise violates the invariants of the computation
(like raising an exception). A good (or rather bad) example is the system
notification mechanism in Squeak - it allows listeners to interfere *during*
the compilation process with unclear results what might happen if there is any
problem. In Tweak this simply cannot happen

Take me to Squeak Weekly

October 16, 2005

Fixing ‘invalid charset name’ message in Debian

Filed under: Uncategorized — @ 6:57 am

It seems that Debian always finds some way
to have small niggling issues that end up being a major problem if you follow
unstable. Unstable is very good for getting the latest packages prebuilt however
as it is said. It’s unstable.

My latest issue was anytime I used the command man I got the following:


# man man
Reformatting man(1), please wait…
invalid charset name
man: command exited with status 256: /usr/bin/zsoelim /tmp/zmanQKj7sy | /usr/bin/tbl | /usr/bin/nroff -mandoc -rLL=79n -rLT=79n -Tascii8 | iconv -c -f ISO-8859-1 -t EUC-JP | /usr/bin/pager -s

Not exactly what I would call an easy to debug message. After googling I found
a Japanese page that dealt with this
problem
.
The basic gist of the page is that the default version of less that comes with
Debian will barf if you’re not living in ASCII world. One solution is to go back
to good old more or use jless, which is a version that is happy with
Japanese.

You can do that by running the following commands (as root):

apt-get install jless
update-alternatives –config pager

Debian keeps track of the default pager in its system in /etc/alternatives/pager.
And you need to remember to use update-alternative to get it fixed.
Problems solved and now I can go on happily computing.

October 15, 2005

Chinese becoming a more mainstream secondary language in U.S. K-12 Education?

Filed under: Uncategorized — @ 2:00 pm





There’s an article in the New York Times
on Chinese becoming more popular in K-12 schools. It’s interesting that
China has given some funding for Chinese teaching materials, scholarships
for Chinese teachers, and on the curriculums.

The article cites a lack fo qualified teachers to teach and many schools
have waiting lists to add Chinese to their curriculum. I wonder what red
tape one has to jump through to add such a program. I wish I could
have taken Chinese in the earlier grades but it was such an ‘exotic’ language
that finding Chinese language instruction was only at the Chinese language
schools which were targeted to the ethnic Chinese in the U.S.

I guess for Chinese speakers in the U.S. this is a career
opportunity waiting for them if they don’t want to follow the traditional
routes of doctor, engineer, professor, or business yuppy.
Although frankly, even with the China boom it won’t outtake Spanish for
a long time. And if they are able to start getting certified teachers
trained out in a decent clip, will there become an eventual flood of
too much talent? I hope not.


Read it yourself

October 6, 2005

The Everglades aren’t what they used to be

Filed under: Uncategorized — @ 1:00 pm


It is unknown how many pythons are competing with alligators in the Everglades, but at least 150 have been captured in the past two years

Releasing an animal that came from Southeast Asia into the Southern U.S. is NOT
what I consider releasing it back into the wild. I consider that tampering
with the ecosystem.

Read it yourself

October 1, 2005

Converting OGG to Mp3 en masse (Win32)

Filed under: Uncategorized — @ 10:58 pm





As much as I find the Ogg Vorbis codec
very cool for its lack of any encumbering by patents, copyrights, or
other IP minefields the practicality of using it as a standard format
across multiple systems has been impractical for me (need to load
Ogg Vorbis plugin into
all instances of iTunes I use, my mp3 player(s)
don’t support Ogg Vorbis, etc. etc).

Luckily, my ears are quite insensitive to lossy audio formats so the whole
argument on audio fidelity falls on deaf ears for me.
So, I usually convert everything to mp3 and let it stand.

Anyways this creates the problem of converting [Format X] -> Mp3 so
I’m always looking for tools. With UNIX it’s rather easy. Find a CLI
utility and write a shell script to automate the process. However on
Windows I want a GUI. After a bit of searching I found that
CDex is an excellent
freeware utility that can convert Oggs to Mp3 en masse. I just
tried it out and it worked as well as I hoped. The ID tags unfortunately
didn’t seem to get translated unfortunately. Either way kudos to
CDex!

Powered by WordPress

Protected by AkismetBlog with WordPress