Archive for May 2005

Windows in a window where it belongs.

I know I gave up my hatred for windows but after having it installed on my desktop for a week I’ve decided that it needs to be put in it’s place. Today I succeeded in installing ubuntu linux, vmware, and windows xp. Now windows is in a window where it belongs. It’s so nice to be able to reboot windows without disrupting my work. With the vmware drivers installed it actually performs very well. The response time is better than vnc to an equally powerful machine. I ran into a few swapping issues when compiling and playing music engine but that’s due to only having 512mb ram on this box. Still it’s much better than wasting hardware on a mostly idle windows box just for music engine.

[update: 6-5-2005 After upgrading this box to 2G ram all the swapping issues are resolved.]
[update: 6-5-2005 With the vmware data files in the vfs cache it takes about 15 seconds to boot windows.]

How to get your question answered on irc by example

n0other: Hello, I have a field publish_to, I want to select only those entries, where publish_to is not older than today, publish_to contains for example ’2005-05-30′, I do: SELECT * FROM table WHERE (publish_to – “‘.date(‘Y-m-d’) .’”) > 0; (php date function), but that doesnt work, how should I implement this, I cannot change date structure

Notice the detailed question with example. This shows people exactly what the problem is and that you have taken the time to try to solve it yourself.

firewire: so you want where it’s today and newer?
firewire: where publish_to >= curdate()

A quick response prior to testing

n0other: oh :}

Now after a quick test a final response letting everyone know that the problem was solved

n0other: works perfectly, thanks again
firewire: :)

It’s little times like these that make helping people on irc so much fun.

One day someone is going to come up with a word that rhymes with orange.

… and everyone is going to be really upset. Especially M&M Mars and their horrible new advertising compaign.

Borange – The same fruit you can get every day from any place that has fruit. Even when you don’t want it (a twist on the side of a breakfast dish).

Add your own…

Root, mysql, root – A simple explanation of users.

There seems to be a lot of confusion in the newbie crowd about the difference between MySQL and OS users. It works like this. Your operating system supports users. That’s who you log in as when prompted. When logged in you can start processes or programs. If I log into my linux box as user eric anything started by me is said to be running as user eric. There is a super user known as root that has total control over the system. It’s not a good idea to run processes as root because they have the power to change anything in the system both bad and good. When installing MySQL the install guide says to create a user known as ‘mysql’. This is a new user in the operating system just like user ‘eric’. One of the things root can do is start processes as other users. Mysqld will complain if you start it as root without telling it to change into another user after executing. This can be done with –user= on the command line or user=mysql in my.cnf When mysqld starts it starts as root but then turns itself into running as another user via the setuid() which means set user id.

Operating systems are good at keeping users out of files they don’t own and allowing them to manage their own processes but this isn’t enough for mysql. MySQL needs to be able to restrict users to databases, tables, and even columns. Since mysqld is running as the operating system user ‘mysql’ and it needs to track users from the outside world, it has to maintain it’s own users. These are MySQL users and are completely independent of the operating system users we just talked about. Unix operating systems have a super user and so does mysql. It’s named root by default.

operating system root -> mysqld running as system user mysql -> inside mysql root user -> mysql users.

MySQL can also have other users. Ones that are restricted to certain databases, tables, or columns. In an operating system your user privileges depend on your username and password. In mysql you are identified by your username, password, and where you are connecting from.

So your operating system has a user root and mysql has a user root. Your operating system has a normal user ‘eric’ and mysql has a normal user ‘eric’.

When MySQL Will Order Data.

This is cut and paste from an email I’m sending to the general mailing list. I’m putting this here so people can add comments. If any of this is wrong or you can think of a situation I didn’t. Add a nice comment :)

Here, off the top of my head are situations in mysql where you can trust that the data is ordered in some fasion.
1. Using an order by clause on a query.
2. Using a group by the data will come out in ascending order of the column that was grouped on.
3. alter table order by has been performed and the table hasn’t been modified .
4. select key from t; that uses the ‘Using Index’ in explain will return in the order of the key.

Use order by anyway just to be safe.

So much to talk about. Part 2 – What Now?

Driving past the crazy chain people coming down off the mountain I saw some very unique scenery. It was odd to think that all of this great country was going to be so close to home again. About this time I began to get fidgety for the ride to end. The scenery surprises were just beginning. It was a cloudy day and getting late. One of those days that produces what I like to call the ‘twilight zone effect”. It’s when a dark cloudy sky and sunset seems to produce a bright yellow glow over everything. This was the most defining when driving from Sacramento to Stockton. Just south of Stockton (I think it was south. It could have been north. Look it up if you really want) there are hills with only a few trees on them. When I say a few I mean about 5, if that. The rest are covered with from a distance looks like meadow grass. These mountains aren’t just decoration. They prop up power generating wind mills. I had heard of wind farms before but had no idea I was about to drive through one. With the twilight zone glow, the bald mountains and the wind farm it was quite a sight. I had a hard time staying on the road.

Past the sights and into the valley I began to feel my way through the many interchanges and possible routes into San Jose and beyond, eventually making my way into Sunnyvale. Time, about 6:00. I pulled off the highway and into a gas station parking lot. Now what? I was technically homeless. I drove down the street until I found a hotel that had open wireless. On to craigslist, from the parking lot of a Best Western I set out to find a new home. Craigslist produced a few hits and I began calling. The first hit I got was an asian family that had turned a back yard garage into an apartment. Yes they actually expected someone to live in their backyard. It was cheap so I checked it out. It was a nice place but very not very private or cozy living under the watching eye of a landlord and having to unlock the gate to their back yard to get in at night. Pass. After three or four more calls I was ready for a meal and bed.

The next day was much the same. Nothing after nothing in Sunnyvale. As I was driving up the road looking a place for lunch I saw a kid waving a free rent sign in front of an apartment complex. “Why not?” I said to myself. It turned out to be a good deal. Waved deposit. They could have given me the keys that night but there was one problem. The first months rent had to be paid with a money order or cashiers check. My bank was in chicago I’m in California. Shit. I learned a few things about money on that weekend. ATM’s have a limit of what they will dispense on any given day. This amount depends on the bank. An ACH takes at least two business days to complete. If you sell an index stock it takes 5 days to settle. If you want me to go into the details of this I will, but trust me I learned the hard way. Money settles and I move in. When I say I moved in I mean I moved in, my stuff was still stuck in a truck.

Watch Your Step.

It seems the mild temperatures and rain around here are the perfect breeding ground for snails. Walking between the buildings at work, to and from my car I saw no less than 30 snails today. I have been lucky enough not to step on them thus far but I noticed a few spots where the snails weren’t so lucky. It also seems that snails have no problem eating other snails.

Oops

I got a little happy with the comment delete trying to clear out some spam comments. If I dropped your comment sorry.