Fibbing Around
April 24, 2008 on 10:45 pm | In Personal, Programming | By QBasicer | No CommentsMy officemate Alexei and I were wondering a bit on how fast Fibonacci in assembly would be, so I wrote a quick little linear fib application in Linux.
08048074 <_start>: 8048074: 31 c0 xor %eax,%eax 8048076: bb 01 00 00 00 mov $0x1,%ebx 804807b: ba 01 00 00 00 mov $0x1,%edx 08048080 <_calc>: 8048080: 31 c9 xor %ecx,%ecx 8048082: 01 c1 add %eax,%ecx 8048084: 01 d9 add %ebx,%ecx 8048086: 89 d8 mov %ebx,%eax 8048088: 89 cb mov %ecx,%ebx 804808a: 42 inc %edx 804808b: 83 fa 2e cmp $0x2e,%edx 804808e: 75 f0 jne 8048080 <_calc> 8048090: 89 cb mov %ecx,%ebx 8048092: b8 01 00 00 00 mov $0x1,%eax 8048097: cd 80 int $0x80
Runs pretty quick, but I’m not sure how good it would be, as it’s only using 32 bits, so it can only calculate fib(46) and lower, and doesn’t even output (that’s a bit trickier).
Smallest Hello World
April 23, 2008 on 10:04 am | In Personal, Programming | By QBasicer | No CommentsIn what turned out to be an assembly vs Java comparison of hello world, I’ve managed to get a hello world app down to a lean 380 bytes. objdump -d:
hello.bin: file format elf32-i386 Disassembly of section .text: 08048094 <.text>: 8048094: ba 0c 00 00 00 mov $0xc,%edx 8048099: b9 b8 90 04 08 mov $0x80490b8,%ecx 804809e: bb 01 00 00 00 mov $0x1,%ebx 80480a3: b8 04 00 00 00 mov $0x4,%eax 80480a8: cd 80 int $0x80 80480aa: bb 00 00 00 00 mov $0x0,%ebx 80480af: b8 01 00 00 00 mov $0x1,%eax 80480b4: cd 80 int $0x80
Can you do better? This hello world does not link to any outside libs like stdlib, and only uses kernel system calls. We were able to get a java 6 compiled class to 517 bytes, but I’m not sure if I could make it smaller (Java bytecode maybe?)
Edit: I found a page on creating really small ELF executables for linux. They don’t say hello world, but it could be easily modified if you knew how to translate AT&T to Intel. I really can’t remember, or have the ambition to do so, so I’ll just link
Daft Punk’d
April 21, 2008 on 3:02 pm | In Music, Personal | By QBasicer | No CommentsI’m pretty sure I’m a Daft Punk addict. Last.fm says so. That’s alright, I guess. There’s much worse things to be an addict of.
I now offically own all but one of the Daft Punk Albums:
- Homework
- Discovery
- Human After All
- Daft Club
- Human After All – Remixes
- Musique Vol. 1
- Alive 2007
The one album I need to pick up to complete the collection is Alive 1997, which I’ve found on Amazon for $85. I’m thinking I might just find a copy this summer to complete my collection. I’m especially proud of my Human After All – Remixes, that I picked up for about $40. It’s a rare Japanese only album. It’s one of 3,000 every made. Unfortunately the CD has a lot of DRM, so it wasn’t quite easy to import into iTunes, but linux got the wave files last night, so I just gotta encode them and slap them on. It’s actually pretty nice, I’m glad I picked it up. I got the actual CD off eBay through a seller in Australia, and it came really quickly.
I’ve started toying around with Last.fm a bit more, the radio feature is quite nice, and I’ve found a few songs I’ve liked already. Mmmm, instrumental jazz….
Application Development Preferences
April 15, 2008 on 1:27 pm | In Programming | By QBasicer | 3 CommentsYou’re going to be writing an app. The biggest question is what language will you use?
For some people, it’s a nobrainer, it’s either Java, C++, or other language. What would you use? Usually it has to depend on what the app is for. Lets just say a simple chat client that’s cross platform.
That narrows down the playing field to a few choices:
Java:
- SWT
- AWT
- Swing
CLR (C#, VB, etc):
- Winforms
C/C++
- wxWidgets (GTK)
- Qt
Which would you use, and why? Personally, I like the C/C++ route. I’ve delt with both wxWidgets and Qt, and find both offerings pretty nice. I really like how Qt works over wx, but that’s just personal preference.
Java is getting better these days, but I feel that application start time is still a big issue, as well as memory usage, although these are supposedly getting better. The other issue with Java is that it usually requires people to go and download a JRE before usage, while if you static compile the C/C++ libs, you don’t usually need any extra dependencies (or even just package the dll’s/so’s along with the main executable).
So what about you, oh general audience, what would you choose, and why?
Apple “Just Works” don’t you know *sic*…
April 8, 2008 on 7:18 pm | In Uncategorized | By BioHazard | 9 CommentsI’ve liked Apple for a couple years after I started working with them full-time. It was leagues better than the Micromess I left for it. Unfortunately, now the Apple system is slipping into eviality. I’m having a terrible time keeping things working. Whenever something can go wrong, it does. You think I’m making it up don’t you? Here’s some examples:
- I needed to set up a voice chat with iChat. Can I use my nice headset? Nope. The iMacs only have a line-in jack. Great. I know the iMac has a built-in mic, but I want to use /mine/. Next, I wanted to extend it to video. Of course if I was stupid, I could go buy an iSight camera that costs as much as a full digicam. I bought a Logitech camera. It said “MacOS” on the box. I plug it in, nothing. I had to install a funky Linux driver port to get it to work with Skype, it wasn’t 1337 enough to work with iChat. iChat sucks anyway so meh.
- Okay, what else? I have a G5 XServe with OSX Server 10.4 and a Opteron server running Gentoo Linux. I wanted to backup the XServe to the Linux server. since it has more room (the XServe only has 200GB even with all 3 drives striped!). Can I use RSyncd? No. SSHFS? Nope. NFS? No. FT-freaking-P? Really really no. I didn’t even bother with Samba as there are tons of UNIX native solutions that claim to be supported by OSX.
- I’m one to like a clean network as far as traffic goes. Why do all the Macs need to use ZeroConf/Bonjour/Redevouz/MDNS/Avahi/wtfbbq? I have a fully functional DNS system. I don’t want anything to be able to subvert my DNS system with MNDS. Also, what’s with all the SMB boradcast messages when I have Windows sharing turned off? There are no SMB-capable devices in the building. Same with AppleTalk. WTF is Appletalk doing in any modern OS? AppleTalk is long dead, rotten, made into gasoline and burned. MacOS doesn’t work with anything older than a couple years anyway so why bother looking for such old stuff?
- Another thing that bothers me is the inability of iTunes/QuickTime to play any free audio/video formats. The Apple web page on OSX says clearly “We support Open Standards” (it even has a picture of a “come on in” sign *sic*), but it can’t play Vorbis, XviD, Theora, FLAC, hell I wouldn’t be surprised if it couldn’t play WAVs…
- MacOS X 10.4 has a cool new remote desktop service that lets you connect to the Mac and do remote stuff. Not sure why it took them so long but whatever. Anyway, they advertise that it works with VNC clients as well. Lies! I was really looking forward to this feature. Sad was I when no VNC client I tried worked from my Linux machines. I did manage to get Chicken of the VNC to work, but the server will only let it connect with /zero/ bandwidth-saving capability. That sucks. If I have to be on the local network, why not just be at my computer?
- I do have to say, AirPort works really well. It “Just Works” with every network gear that gets near it. Like some cheap ho it will associate and …exchange…packets… with anything that beacons. Eww.
- Apple is clearly in bed with Microsoft. Every version of MacOS since 10.3 comes bundled with an “Office 200x Test Drive”. First of all, I object to putting cocaine in birthday party goody bags, but that aside, the Office uninstaller should work. Upon running it, you get a wizard that seaches for Office, tells you it’s going to remove it and grays out the “continue” button. Big help that is. $ shred -r /Applications/Microsoft* takes care of that problem though.
Last week I got some Leopard machines. Lot’s of “Just Work”ing here:
- The MS Office uninstaller is /still/ broken after what, 5 years?
- Adobe CS2 is really, really unstable. Bad stuff. I really wish I had known that.
- Searches with spotlight do not work when searching Server 10.4 shares. (the Apple tech basically said “Go buy 10.5 server. ($1,000)”)
- Our font collection had to be hacked pretty radically to work with inDesign on 10.5.
- The printers can no longer print through anything but the first tray and nothing but letter size paper.
- It doesn’t want to accept the address to my local NTP server.
- The most annoying 10.5 problem of all: Firefox is severely broken. It can’t browse much of anything and all file downloads fail. Safari works great. It just doesn’t have any of my mission-critical plug-ins I need to do my job (Web Developer, FireBug, Tamper Data, etc).
- This is only after 1 day of toying with 10.5. I expect more problems once the production department starts doing real work on these machines
Anyway, that’s just what I can remember off the top of my head. I’ve had countless problems with things not working with the Apple system. Basically if you want it to work with a mac, the device itself must have an apple logo pressed or etched into it. The bigger the logo, the better it works. All that “Apple Just Works” stuff is a bunch of hooey. Don’t drink the Kool-Aid. It will go right through you and get you in the end.
At this point, there aren’t as many dart holes in my picture of Jobs as there are in Ballmer, but there are some really good shots.
Powered by WordPress with Pool theme design by Borja Fernandez. I rewrote the CSS because I'm cool like that.
Entries and comments feeds.
Valid XHTML and CSS. ^Top^
