All posts by Shawn

Apple Media Center

The best thing about Windows is Windows Media Center, and it’s not as good as it could be (it lacks the ability to record HDTV). Apple really needs to come out with the TV recording solution I think, and it could be huge if they were to beat Microsoft to market with a HDTV recorder.

Hopefully {crossing fingers} that is the direction Apple is moving. Apple just came out with Front Row, which lets you control music, movies, pictures, etc. on your TV from a remote. But it lacks TV recording still.

Hopefully that’s Front Row 2.0…

CSS – overflow: auto;

I finally solved a CSS problem that has been driving me crazy on the theme I created for this blog. The fact that if you use a border on a block item (a DIV or H1 for example), the border will overlap a floating DIV. The text will wrap properly, but the border still extends into the floating DIV.

Anyway, the key to it is the overflow: auto; CSS attribute.

Without overflow: auto;

floating this to the right
This is a header

This is the main content of the page… I want the text to wrap (which it always does), but I also want the header border to not overlap the floating DIV (the problem).

<div style=”background-color: #eee; border: 1px solid #ddd; margin: 5px; padding: 5px; width: 300px;”>
<div style=”border: 1px solid #f00; float:right; width:100px; margin: 10px;”>floating this to the right</div>
<div style=”font-size:16px; background-color: #ddd; border: 1px dashed #0f0; overflow: auto”>This is a header</div>
This is the main content of the page… I want the text to wrap (which it always does), but I also want the header border to not overlap the floating DIV (the problem).
</div>

With overflow: auto;

floating this to the right
This is a header

This is the main content of the page… I want the text to wrap (which it always does), but I also want the header border to not overlap the floating DIV (the problem).

<div style=”background-color: #eee; border: 1px solid #ddd; margin: 5px; padding: 5px; width: 300px;”>
<div style=”border: 1px solid #f00; float:right; width:100px; margin: 10px;”>floating this to the right</div>
<div style=”font-size:16px; background-color: #ddd; border: 1px dashed #0f0; overflow: auto;“>This is a header</div>
This is the main content of the page… I want the text to wrap (which it always does), but I also want the header border to not overlap the floating DIV (the problem).
</div>
Update

Looks like it doesn’t work in Internet Explorer 6. Oh well, I’m over IE, so I’m not going to bother to come up with a weird hack. IE users will just have to upgrade to IE7 when it comes out I guess (or better yet, just use Firefox). πŸ™‚

I’m Going To Kill The Chargers

Dude, the San Diego Chargers should be 7-0, but instead they are 3-4. The 4 losses have all come with them leading in the last 2 minutes. Today they got beaten by the Philadelphia Eagles with such last minute stupidity I want to cry.

Still have to give some props to the Eagles for shutting down LaDainian Tomlinson like they did.

“A Law Firm I Like: Winn and Sims”?

I just found out today that it’s the professional opinion of Brian Winn (of Winn and Sims law firm) that my Winn and Sims blog is not only “infringing on their intellectual property rights”, but is a flat out “illegal site”. Not only that, I’m somehow “spreading misinformation” about them. It all seems like a very strange choice of words considering it’s nothing more than a factual timeline of events that transpired.

I would think that if it was the true belief of a lawyer that I’m trying to “malign his company’s reputation”, they would be quick to file a libel suit against me. Then again, maybe I was already served another mystery summons and I’m due to appear in court. πŸ˜‰

[Quoted from the source…]

Corpse Abuse

I read on CNN today that some US troops are being accused of “corpse abuse” because they burned some dead bodies. This is just a FYI to anyone that had to deal with my dead body someday…

Feel free to burn my body, mutilate it or whatever else you feel necessary. Hell, if you are starving, feel free to eat me for all I care.

MSN Requiring Cookies For RSS Readers

It seems as of last night MSN is now requiring end users to pass a cookie (specifically MC1) with all search and RSS feed requests. The cookie has 2 parts (V and GUID). V is always 3 for now (probably stands for VERSION), the second part is GUID which looks like an MD5 hash to me (32 character hexadecimal value). It also appears as if you can just make up the GUID to make it work (doesn’t validate against anything to make sure it’s valid).

Anyway, this seems really stupid, because now all the RSS feeds that were using MSN are going to break. The worst part is it doesn’t reject it, the web server simply holds the HTTP connection open (never returning anything and never closing it)… Nice! Wonder who’s idea that was. heh

Anyway, here’s a snippet of PHP code to form the cookie, which you can use with whatever you need (cookie name should be MC1):

[code=php]$cookie_mc1 = urlencode (Γ’β‚¬ΛœV=3&GUID=Ò€ℒ . md5($_SERVER[Γ’β‚¬ΛœSERVER_NAMEÒ€ℒ])); “test”[/code]

You can test this in your browser by going to any MSN search result page (for example this one) after you delete the MC1 cookie from .msn.com (if you have it).

Update

Of course right after I write this and make some backend changes to some of my stuff to take it into account, Microsoft fixes it. Oh well… they must read my blog (heh j/k).

Concept Design Submittal

I had a 9:30 am meeting today with the homeowners association where I’m building my house for the first stage of a three stage process of getting your house approved to be built.

Of course, I’ve never been to something like that before, so I’m thinking it’s going to be 3 or 4 hours or something. Nope… I was there a total of 5 minutes (I guess thats a good thing). πŸ™‚

The good news is the first step (Concept Design Submittal) was approved, so now we can move on to the next phase of the review process (Design Development Submittal). I think that’s things like landscape plans, artist renderings of the home, samples of the materials you are going to use, etc.

Dude, I’m Awesome!

Well… I decided to write my own PHP script to rip out the old comments (from when this was a Blogger blog), parse them, format them and insert them into the database for WordPress.

The cool part is it all worked on the first try. That’s pretty amazing if you ask me (and that’s why I’m awesome.. hehe). πŸ™‚

So anyway, the 400+ comments that were made when this was a Blogger blog now show… And we can once again enjoy people telling me I have a small penis. πŸ™‚

10Ghz PowerMac G5

Okay, so Apple *did* announce quad processor PowerMacs today. The top-end being a 2.5Ghz x 4 G5 machine. I know what I’m getting myself for an early Christmas present (they aren’t shipping them until next month though). πŸ™‚

//www.apple.com/powermac/

Update

The video card that comes with it (PCI Express GeForce 6600) supports one dual link DVI port and one single link DVI port. That’s dumb, considering the old machines support 2 dual link DVI ports. That means you can’t drive 2 30″ monitors with a single card. Stupid if you ask me…

Also, does anyone know of a hardware SATA RAID card that support PowerMac G5 machines??

Two Stealth Fighters Outside My Window

So I’m sitting here working, minding my own business, when I happened to hear the roar of a jet engine somewhere close. So make the huge trouble (hehe) of turning my head to look out my window, and two Stealth Fighters were cruising by (maybe 500 feet off the ground). Obviously they just took off from the Miramar airbase (which is a few miles away). Probably going “home” after the airshow over the weekend.

One thing I noticed about them… they aren’t all that stealthy. I could hear it and see it perfectly fine. Aren’t they supposed to be invisible? πŸ™‚

Nazi Buildings

After seeing the “Jesus In The Sand” image from the Google satellites, it reminded me of a Nazi building a saw here in my hometown (San Diego).

I don’t know what is actually in it or anything, but it sure seems like a strange to design a building in the shape of a Nazi swastika (even pointing in the right direction if you look at it with the North at the top).

Anyway, click here to see it in Google Maps for yourself.

Google Finds Jesus With Satellites

Who would have thought that Jesus was trapped in a sand dune in Peru, but apparently it’s true. This is undeniable evidence that Jesus is alive and well. I think someone should go visit him and see what’s up (maybe they could answer the real question here… Has Jesus Christ taken up Spanish?)

Truthfully, I’m not sure why this has to be Jesus (it looks more like Gandalf to me). It could be anyone really…

Check it out in Google Maps

[originally from Google Sightseeing]

Quad Processor G5 PowerMacs?

Rumor has it that Apple is announcing dual processor PowerMac G5 towers with each CPU having two cores to give it four logical processors. If rumors are right, they should be announced on Wednesday (October 19th).

I have a 30″ Apple Cinema Display on the way, and it requires a dual link DVI video card (which I don’t currently have). So I’m thinking I’ll just get a new computer (with the necessary video card to drive the 30″ monitor) if they do indeed announce quad processor PowerMacs on Wednesday.

We’ll see…

LT Runs, Throws And Passes For TD

I don’t know how often it happens, but I can’t imagine it happens all the time that an NFL player rushes for a touchdown, catches a pass for a touchdown and also PASSES for a touchdown in a single game. But it happend today for the Chargers with LaDainian Tomlinson against the Raiders.

What would be funnier is if Drew Brees caught a touchdown pass from LaDainian Tomlinson. πŸ™‚

Update

Okay, I looked it up… the last time someone did it was New EnglandÒ€ℒs David Patton on Oct. 21, 2001

Google Maps On Cell Phone

Mologogo is a free GPS friend-tracking service that works on Nextel phones with Java and GPS. Over at the MAKE: Blog, Phil Torronne took Mologogo for a walk. It’s a really cool use of the Google Maps API. This one lets two (or more) people you use GPS enabled phone to show on a map where they are in relationship to each other.

Cool little friend finder application there. But now they just need to make a GPS enabled Motorola RAZR so I can use it.

Cat With Two Tongues

I don’t know about you, but I’m pretty sure that if my cat had two tongues, it would kind of freak me out. I think maybe this cat got some lizard DNA in him or something.

Just looking that that picture almost makes me want to cry. πŸ™‚

Thankfully, my cats are not a spawn of satan and only have one tongue. Although Yashi (my white cat) who has an oral fixation and will lick anything for hours might actually be jealous.

Switched To WordPress

Not that anyone would really notice, but I’ve switched this blog from Blogger to WordPress (finally). It’s been something I wanted to do for a long time, but I hated all the templates for WordPress. So I finally got off my butt and made my own.

Comments were lost… not that you guys had anything important to say anyway, so no biggie there. πŸ˜‰

Since it’s PHP and MySQL driven, it lets me have control over the underlying code. For example you can see what I’m listening to in iTunes and I made it show a random picture from my photo gallery on the sidebar.

Another blog you have to see to believe!

This is my annual “Blog You Have To See To Believe” entry. I spend an entire year going through over a million blogs. Then I pick one blog per year that is just so unbelievable and cool, everyone has to see it for themselves.

Words cannot describe it, so just check it out.

You can also find last year’s winner over here.

Update

It looks like last years winner is no longer online, probably because they were overwhelmed with the amount of traffic I sent them.

Video iPod

After rumors have been swirling the last few weeks about Apple releasing an iPod that can do video, it’s official now. They have a 30GB and 60GB iPod with a slightly larger screen that is capable of doing video (realtime decoding of MPEG4 and H.264 with 260,000 colors). Pricing doesn’t change ($299 and $399). It’s also 31% thinner than the previous model it’s replacing.

It also comes in black like the Nano. I’m tempted to throw away my existing 60GB iPod Photo and get one of the black 60GB Video iPods…

MySQL Problems On Mac OS X Server

For the last two months or so, I’ve been having a strange problem with my primary MySQL Server that required that the mysqld process (not the server itself) be restarted. The first image shows the CPU usage of the server, with the red arrows being the points I restarted the mysqld process (queries per second and types of queries do not change over time).

The server itself is a dual processor Xserve G5 with 5GB RAM, 1.2TB drive space, etc. so resources really are not an issue. Also, I should point out that no other services (like a web server) are running on the machine (it’s strictly MySQL only). Basically the longer the database server ran, the slower it would become (there are no “bad” queries anywhere either). After 24 hours it was slow enough that it needed to be restarted. I tried tweaking MySQL config options, throwing more memory at various aspects of MySQL.

While watching the processlist, I noticed something strange a few times. Something that should be blazingly fast (like an insert into a tiny HEAP table) was taking a VERY long time (sometimes 90 seconds), and not only that it was hanging all the query threads (even ones hitting unrelated databases). So then I had the idea to look at the query cache since that’s shared by all databases, and when you update a table, it needs to flush the queries from the cache for that table (which would explain why unrelated databases’ queries would hang while it was flushing the query cache for the HEAP table being updated). So to test this theory I rolled the query cache memory allocation from 256MB to 2MB. Low and behold… it worked! In my situation, the less memory you allocate to the query cache, the faster MySQL was. Then I remembered something that was added to Mac OS X 10.3 (I believe) and that’s the ulimit functionality. It’s actually a nice feature and can prevent a runaway process from taking down a machine. But in my case it was preventing MySQL (which really is the only process) from using very many resources. Still not sure why it would slowly get worse, but maybe it has to do with the more memory MySQL wanted to use over time, the more swap disk memory it was forced to use. Who knows… and to be honest, I don’t care, I’m just glad it works now.

Once I got that squared away, this is what my MySQL server CPU usage looks like:

Now, hopefully someone out there will find themselves in the same problem and this will be your solution, rather than spend months screwing with it (this ulimit stuff would apply to other BSD variants like FreeBSD, not just Mac OS X).

Run this from the shell (as root):

sysctl -w kern.maxfiles=122880
sysctl -w kern.maxfilesperproc=102400

This allows a single process (mysqld in my case) to have up to 102,400 files open at once at the kernel level (more than enough).

Add this to your /etc/sysstl.conf file (or create it if needed):

kern.maxfiles=122880
kern.maxfilesperproc=102400

This makes the settings work when you reboot the machine.

Edit the /Library/StartupItems/MySQLCOM/MySQLCOM script that MySQL installs (it’s part of the automatic startup package), and somewhere near the beginning, add this:

ulimit -n 7000
ulimit -c unlimited
ulimit -d unlimited
ulimit -s 65536

You could put it somewhere else, but I chose this file since it doesn’t get overwritten when you upgrade MySQL. This lets the mysqld process use more than the default per user resources that Mac OS X Server allows.

You may want to adjust your settings as you see fit for your situation, but that’s what I used.

I’m just happy it’s no longer a problem for me!!!!! Yaaaayyy!!!!

HDMI (High-Definition Multimedia Interface)

If you are buying an HDTV anytime soon, make sure it has at least one HDMI connector on it. It’s pretty much the new standard for connecting audio/video (and soon computers) together. It’s built upon the older DVI interface, but it adds digital content protection for the content owners (keep the studios happy) and also carries audio on the single cable (DVI does not). The lack of content protection on the current HDTV signals is the main reason there are no realistic options for HDTV DVRs yet (see previous entry).

Another nice thing is it’s backwardly compatible with DVI (also Type B HDMI is backwardly compatible with dual link DVI connections).

You can also get equipment to carry DVI/HDMI signals over fiber optic cable, so if your connected equipment is more than 25 feet or so apart, that is the way to go.

Now for my complaint (heh)… What would be really nice is if they just do away with the physical DVI/HDMI connector, and go straight to fiber optic and basically putting the DVI/HDMI <-> fiber optic equipment inside the TV, cable box (row whatever else you are connecting).

HDTV DVR

How come there isn’t any good options for a high definition digital video recorder? TiVo doesn’t have one, Windows Media Center can’t do it, etc. The only one I’ve run across (that didn’t end up being some home brew Linux setup) is the one built into some of Mitsubishi’s high-end TVs.

Weird.

Chargers Treat Patriots Like Bitches

The San Diego Chargers played a game in Foxborough against the New England Patriots at home. For those that don’t know, the Patriots are the defending Super Bowl champions (have also won 3 of the last 4 Super Bowls). And have not lost at home in 21 straight game (their last loss at home was against the Jets on December 22, 2002, so it’s been awhile).

Anyway, the San Diego Chargers ended that streak today and treated them like their red-headed stepchild (especially in the 2nd half where the Chargers outscored the Patriots 24-0). The final score was 41-17 Chargers. πŸ™‚

Peeing Statues

These Czech animatronic statues realistically urinate on the trough before them, moving their hips and organs in concert. Their “pee” spells out quotes from famous Prague residents.

While they are peeing, the two figures move realistically. An electric mechanism driven by a couple of microprocessors swivels the upper part of the body, while the penis goes up and down. The stream of water writes quotes from famous Prague residents.

Visitor can interupt them by sending SMS message from mobile phone to a number, displayed next to the sculptures. The living statue then ‘writes’ the text of the message, before carrying on as before.

Dog Eats 13 Inch Knife

Uhm… this “puppy” (a 6 month old Saint Bernard) ate a 13 inch serrated knife and is fine. Just take him down to the local vet and have it removed. No problem!

What I want to see is the video of a dog actually swallowing a knife. Crazy dog should be in the circus or something. πŸ™‚

Romanian Plastic Surgery

For those of you looking for some sort of testicular surgery, you should definitely get on this surgeon’s waiting list when he is available again in six months…

A Romanian surgeon has been suspended after allegedly cutting a patient’s penis into several pieces.

He was supposed to be operating on the man to lower a testicle into his scrotum when he accidentally cut the urinary channel.

It’s reported the surgeon then lost his temper and cut the man’s penis into several pieces.

The surgeon, based at a Bucharest hospital, has been suspended for six months and faces further investigations.

Tyra Banks’ Boobs

Everyone will be happy to know that Tyra Banks never had breast implants. I guess she did a show where she had someone do a sonogram on her to prove she had real boobs (I didn’t see the show myself, but read about it in the news). That seems like a pretty dumb thing to do if you ask me. Just a publicity stunt to get her name out there more if you ask me. Plus look, even *I’m* writing about her. Oh well… πŸ™‚

Thunder & Lightning

Last night there was the craziest thunder and lightning storm I’ve ever seen. I swear it seemed like it was right outside my window. The thunder was like an earthquake and every time it hit you could hear car alarms going off everywhere in the neighborhood.

Scripps pier is the closest pier to me (about 3 miles away), and this was a picture taken from there last night during the storm.

MySQL Is F’ing Fast

I’ve been doing a little tuning with one of my MySQL database servers today, and it’s pretty amazing how fast it is. Just ran a benchmarking thing on it before I applied some optimizations (so this is with no tuning), and this is what it looks like:

Uptime: 747 Threads: 1 Questions: 1409737 Slow queries: 0 Opens: 41055 Flush tables: 1 Open tables: 197 Queries per second avg: 1887.198

Notice the queries per second. And even more impressive is this is for a single threaded benchmark app.