Friday, December 5, 2008

DOS Shell prompt

For those nervous about making the DOS/windows to UNIX transition:

export PS1='C:${PWD//\//\\\}>'

Thursday, December 4, 2008

Tech Train Wreck #1

Mortals, let me explain something to you. I am the god of Technology. That means I know technology; the good the bad, and the ugly. Now, I have the experience and savvy to navigate sharp silicon shoals, but you, obviously do not!

Why obviously? Well, welcome to My new feature: Tech train wrecks.

What's more, this series is interactive! I get to tell you mortals which of your technology insults my very being. You, my wonderful minions, will raze it from the face of the Earth, purging the blasphemy, and neither of us will have to come in contact with it again.

Tech train Wreck #1 - The humping USB dog

The offending pooches.

Now, I've got some affection for USB myself. How much? Let's just say that loud cries of "oh, TechGod! Affirmative! Affirmative!!" were heard at the TechGod household for weeks after the spec was out.

But come on, people, have some decency. No, forget that. Have some taste!

These dogs don't even have internal storage.

Note to ThinkGeek: Tech god will consider reasonable offers of profit sharing. Maybe kick in a Shiba, too.

Wednesday, November 26, 2008

Beware the Harpies

It is unlike the god of technology to elucidate on other disciplines, but He will do so if they impinge upon His realm.

It is a little known fact that male harpies exist. Of course, females are the most commonly seen, or, more to the point, heard. Scientists believe this is because they can produce sounds of a much higher frequency, enabling them to kill and consume more prey.

As you can see from this diagram, the perceived loudness of a sound starts an abrupt, dizzying climb around 20 kilohertz. Any shrieks or squawks at or above this frequency could be painful, indeed. Even deadly.

Scientists still do not understand the Harpy fully, as getting close enough for study can be a dicey proposition. Current theories believe the shrill sounds can also be used to increase status in all female groups, as well as their usual purpose - to deafen before the kill.

An online search shows that even social researchers are interested in the problem.
Sexual politics of the voice
An analysis of shreiking in all-female groups

They are known to congregate at lunch spots, nail salons, and cheerleading practice.

Set QuickEdit in windows cmd

If you have the misfortune to be using the command line on windows, right click the shortcut that launches your shell and do the following:

Properties | Options | QuickEdit mode

Now you can select text with the left mouse button, and paste with the right.
Then go to layout, and set the Screen buffer higher so you can have more scrollback.

Tuesday, November 25, 2008

Who are YOU getting your shell advice from?

I was looking for a fix for the cygwin version of Xemacs, and I stumbled across this:

http://www.cygwin.com/ml/cygwin/2004-04/msg01236.html

You could do worse for shell advice.

(Note: The Internet does not guarantee you'll get advice from this David Korn)

Set your cygwin home in Vista

Having two homes can suck.

Fortunately, Cygwin now reads the $HOME (or %HOME%) variable from the windows environment.

Right click on "Computer"
Properties
Advanced system settings link

Environment Variables button

Add a user variable HOME with value c:\users\YOUR_USERNAME

How much I know about music

"Everybody's heard this song - even you!"

Friday, November 21, 2008

Why is my iPhone Slow?

Welcome! Pull up a chair. I'm going to explain why your iPhone bogs down, making you want to smash it into tiny little designer pieces (thanks K!). For those of you who do not care, skip to the link at the bottom of this post.

This is especially frustrating to a person who knows what the deuce is going on, but is thwarted by a company that revels in its mantra, "Look, a shiny thing!" (Don't get me wrong Apple, keep pumping out the shiny - you are one of the best in the world at it).

This is a story of bits and bytes, and how they are shuttled about.

If you have a first-gen iPhone, you probably started noticing this problem after the update to the 2.0 firmware. Was there a bug? Well, no, not exactly.

I can hear you now: Dammit, you computer people are always equivocating!

Did you even read the title of this blog? I am busy with the pedantic pontification, here. Anyway, back to my technical audience.

The iPhone has two types of memory: RAM and flash. You can try to find information about the iPhone's innards in the links below:

iPhone technical specs

Oh, wait, I'm so silly. Technical specifications do not have pictures with cool mirror effects. I was momentarily blinded by the chrome, and all the musicians dancing about with their stage lights.

By the way, if someone wants to figure out the exact numbers, here are a few starting points:

Flash transfer rates from ArsTechnia - Keep in mind this is IDE over USB.
Flash transfer rates from AnandTech - A look at the iPhone's insides (not for the squemish!)
iPod Nano strip tease - get it while it's hot.

iPhone memory bandwidth calculation:
Let's start with the 620Mhz ARM
(or is it 400MHz? Psych! We're not telling! - Love, Apple)

Ok, fine. X million cycles per second, maximum 4 bytes/cycle
Take into account thumb mode, multiply by 16 Megarods to the hogshead, divide by a black turtleneck, all over a messenger bag. Aw, stuff it.

The bottom line is, I have no idea how fast the iPhone can transfer data from flash to main memory, but it's a damn sight slower than the transfer rate between main memory and the CPU.

When you start an application, if there is not enough memory to hold that app, stuff is pushed out, into flash.

Likely offenders: Web browser, heavy games you've downloaded.

Either the UI elements (or the code being called by them) are not cached in RAM, or a lot of processing is happening between each keystroke. My programmer's intuition says it's the former, because it doesn't seem related to the complexity of the code I assume is being run when the button is pressed. There are a couple other reasons I think this, of which more later.

So, how much memory do I have on this thing, anyway? Brace yourself, for I am about to reveal: CPU and memory data! On the Internet!

iPhone CPU and memory secrets

The iPhone probably has 128mb, with about 90mb available to applications (and likely less with each firmware update!)

Typical scenario: I've got 7 web pages open, and I want to get my email on. Damn - we're using 89mb, and the email app needs 5mb, right off the bat. Better start tossing some data. (wait 4 seconds) ok, great. now let's load the email app from flash into main memory - but not all of it, just the parts we need right now. Oh, wait, what's he doing? He clicked something! Better swap in the keyboard (wait 2 seconds). He pressed a KEY!! (wait 2seconds), again?!? He's pressing more keys? By the electronic gods, where will I find the RAM??

http://www.youtube.com/watch?v=DL7n9Vo7mJw

The agony.

This could be fixed by requiring applications to serialize their data when closed. It might make some apps start slower, but it would prevent us from losing our minds when we are trying to use an app with an unknown (and un-determinable) number of previously run apps hogging RAM.

Anyway, here's the fix:
http://nino.me.uk/?p=157

That's right - hold the home button for 8 seconds in your memory hogging app to "really" close it.
 
Add to Technorati Favorites