"Prepend" is a very obscure word which means literally to premeditate, as in, "He looked at her with malice prepended."Source: http://cygwin.com/ml/cygwin/2001-07/msg01544.html Now I'm going to have to retrain my brain to start using another word. I'm not even sure what word works best here. Prefix text?
Monday, October 24, 2011
"Prepend" doesn't mean what you think it means
For years, I thought prepend text meant something similar to append text, accept it meant to add text to the beginning instead of the end of a word. Turns out that even though lots of other people seem to think the same thing, it actually means something else:
Thursday, February 17, 2011
Finally got a regular expression to validate a number between zero and eleven, allowing a leading zero. It allows only two digits to be entered maximum, and you can put one whitespace character before or after a single digit. Tested in Firefox 3.6 and IE 6.
It should be simple, but "simple" wasn't working in Firefox 3.6. I didn't bother testing other browsers with the one that didn't work in Firefox.
<asp:RegularExpressionValidator ControlToValidate="txtNumberOfMonths"
ErrorMessage="Months At: Please use a rounded number from 0 to 11"
ValidationExpression="^[\s]*((0?[0-9])|(1[0-1]))[\s]*$" runat="server"/>
The simple regex that didn't work was: "\s*(0?\d|1[01])\s*
It should be simple, but "simple" wasn't working in Firefox 3.6. I didn't bother testing other browsers with the one that didn't work in Firefox.
<asp:RegularExpressionValidator ControlToValidate="txtNumberOfMonths"
ErrorMessage="Months At: Please use a rounded number from 0 to 11"
ValidationExpression="^[\s]*((0?[0-9])|(1[0-1]))[\s]*$" runat="server"/>
The simple regex that didn't work was: "\s*(0?\d|1[01])\s*
Monday, May 04, 2009
I've been following the market share of Internet Explorer 8 in hopes that it would take off an people would get off of IE6 and IE7. In April 2009, IE8 doubled it's market share, and then some.
It looks like most of the converts came from IE6 and IE7. Firefox 3 picked up almost a half a percent, but it looks like Chrome only picked up a fifth of a percent.
Web Browser Market Share Trend
http://marketshare.hitslink.com/browser-market-share.aspx?qprid=1
It looks like most of the converts came from IE6 and IE7. Firefox 3 picked up almost a half a percent, but it looks like Chrome only picked up a fifth of a percent.
Web Browser Market Share Trend
http://marketshare.hitslink.com/browser-market-share.aspx?qprid=1
Wednesday, September 24, 2008
Monday, August 11, 2008
The force is strong with this one... Darth Vader doing the Thriller dance.
http://www.collegehumor.com/video:1819422
http://www.collegehumor.com/video:1819422
Tuesday, June 17, 2008
I had the ASP.NET problem that I could not give focus to my UserControl. I solved the problem by creating a method in my UserControl which overrides the Focus method of the Control class.
public override void Focus()
{
txtTextBox.Focus();
}
This only works in the 2.0 Framework and beyond. If you are using Framework 1.1, visit here:
http://ryanfarley.com/blog/archive/2004/12/21/1325.aspx
public override void Focus()
{
txtTextBox.Focus();
}
This only works in the 2.0 Framework and beyond. If you are using Framework 1.1, visit here:
http://ryanfarley.com/blog/archive/2004/12/21/1325.aspx
Wednesday, March 12, 2008
I just found this modern art facilitator. It's fun to make art and then if you choose "watch," you can see a slideshow of the latest artwork...
http://windowseat.ca/viscosity/
My first piece of art was crap, but still fun to make. I'll be back to make another when I'm inspired...
http://windowseat.ca/viscosity/
My first piece of art was crap, but still fun to make. I'll be back to make another when I'm inspired...
Wednesday, February 13, 2008
Crap! 50/50 chance Lake Mead will be gone by 2021!! 10% chance it'll be gone by 2014!
Ouch!! And to add to that, the hydro-electric capabilities will be gone before it dries up, so that'll come first. That'll hurt a lot of us in the South West.
crave.cnet.com article
Ouch!! And to add to that, the hydro-electric capabilities will be gone before it dries up, so that'll come first. That'll hurt a lot of us in the South West.
crave.cnet.com article
Friday, February 01, 2008
I read something today on TreeHugger.com that got me thinking about global warming -- what a surprise! Bill Nye, the Science Guy, was thinking about heavily traded commodities. These are the products that are causing traffic (sea, land and air) all over the world. The second most heavily traded commodity is coffee (after oil). Bill Nye suggested thinking about the affect coffee consumption has on the world, and it's true. The ships that pollute the world would be used less if we were not importing (and exporting) so many goods. I'm no isolationist, but maybe cutting back on unnecessary imports would be a good place for everyone to start.
The part of the interview I'm referring to:
Full interview:
treehugger.com interview with Bill Nye
About 15% of America's air pollution came from ships at the beginning of this century, and the EU thinks up to 40% of their pollution could come from ships in the next two years.
bbc.co.uk article
usatoday.com article
Wikipedia: Ship Pollution
The part of the interview I'm referring to:
Tree Hugger: And maybe you can give us one great eco-experiment or investigation that you can suggest our readers try at home to better understand environmental issues?
Bill Nye: You know, I did some research into what were the most heavily traded commodities in the world. The first, of course, is oil... But the second is coffee, which surprised me. It’s not something you need, like wheat or rice, but something you can choose to buy... So I’d ask you to keep a running record of how much you spend on coffee and bottled water for a week or even a month, and compare them. It’s amazing what you’ll find... And if you can convince people to change some really basic habits you can really change the world... Just think of the enormous impact coffee consumption has on the planet.
Full interview:
treehugger.com interview with Bill Nye
About 15% of America's air pollution came from ships at the beginning of this century, and the EU thinks up to 40% of their pollution could come from ships in the next two years.
bbc.co.uk article
usatoday.com article
Wikipedia: Ship Pollution
Friday, November 30, 2007
The kindle by Amazon looks pretty cool, but I can't figure out if it will be a niche market for a long time, or whether this is the breakthru product that will make ebooks really take off. I don't think it will be for commuters, but maybe for people who are on the road a lot of the time. I can see avid readers who don't like killing trees or storing used books to buy into this big time as well. But I just don't know if that's a big enough market to make it really take off. What do you think?
Tuesday, November 27, 2007
I searched for good cross-browser code that will disable backspace when in a drop-down element. Before you say that's bad design, don't disable shortcuts the user may want, know that it's a requirement that I cannot talk the business analyst out of. I first tried attaching the event to the drop-downs themselves, but was having issues with that. So now it runs for the entire document.
Here is my solution:
function noBackspace(evnt)
{
if (window.event) // IE
{
evnt = window.event;
if (window.event.keyCode == 8 && evnt.srcElement.type == "select-one")
{
evnt.cancelBubble = true;
evnt.keyCode = 0;
evnt.returnValue = false;
return false;
}
}
else if (evnt.which) // Firefox/Netscape/Opera
{
if (evnt.which == 8 && evnt.target.type == "select-one")
{
evnt.stopPropagation();
evnt.returnValue = false;
return false;
}
}
return true;
}
window.onload = function () { document.onkeydown = noBackspace; };
Here is my solution:
function noBackspace(evnt)
{
if (window.event) // IE
{
evnt = window.event;
if (window.event.keyCode == 8 && evnt.srcElement.type == "select-one")
{
evnt.cancelBubble = true;
evnt.keyCode = 0;
evnt.returnValue = false;
return false;
}
}
else if (evnt.which) // Firefox/Netscape/Opera
{
if (evnt.which == 8 && evnt.target.type == "select-one")
{
evnt.stopPropagation();
evnt.returnValue = false;
return false;
}
}
return true;
}
window.onload = function () { document.onkeydown = noBackspace; };
Thursday, November 15, 2007
Optical illusions forwarded in emails usually don't get much of a response out of me, but for some reason, this one really amazed me. Enjoy!
Follow the movement of the rotating pink dot. The dots will remain only one color, pink.

Now, stare at the black " + " in the center. The moving dot turns to green.
Now, concentrate on the black " + " in the center of the picture. After a short period, all the pink dots will slowly disappear, and you will only see only a single green dot rotating.
It's amazing how our brain works. There really is no green dot, and the pink ones don't really disappear. This should be proof enough; we don't always see what we think we see.
Follow the movement of the rotating pink dot. The dots will remain only one color, pink.

Now, stare at the black " + " in the center. The moving dot turns to green.
Now, concentrate on the black " + " in the center of the picture. After a short period, all the pink dots will slowly disappear, and you will only see only a single green dot rotating.
It's amazing how our brain works. There really is no green dot, and the pink ones don't really disappear. This should be proof enough; we don't always see what we think we see.
Monday, March 26, 2007

We went to the Big Bear Discovery Center to find out how to hike there. They told us we couldn't go see it. There is an access road that gets you 0.6 miles away from the tree, but the access road was closed, and the only way to get there is to hike four miles in over moderate to difficult terrain.

The trail head was 0.6 miles from the Discovery Center (~6,900 feet), so we just hiked along the lake to the trail head. It was a great hike with great views of the lake. It had been a long time since I had hiked a trail like this so there were parts that winded me, but when we reached top, it was worth it. At the top you are hiking along the Pacific Crest Trail, which is a well-known trail that goes from Mexico to Canada. It felt good to think about all the brave people that have taken this trail.

We decided to go for it because we had some extra time. It turned out to be the steepest part of the hike. There were event better views of the lake along the way, which kept us inspired and also gave us something to look at while we rested. We seriously considered stopping because we were all getting so tired. We were promised a 360 degree view of Big Bear Lake and the Holcolm Valley on the other side of the mountain, so we pushed on.
At 1pm, over 1600 feet higher, we finally made it! The view on the other side was pretty but not spectacular. The Holcomb Valley is not developed like Big Bear is. The area is almost unspoiled. All three of us didn't remember to bring a camera, so no pictures of our actual trip, sorry.
Thursday, October 26, 2006
A good friend of mine interviewed with Google a while back, and I thought it would be cool to work there. Then, I read this article today. Now I really feel bad for him AND me, cause we should both work there. Many programmers I know would LOVE working there. The article starts off talking about Agile programming, but the middle of the article is about Google culture. I'm in love with Google now, and I'm considering doing everything I can to steer my career path so I can work there one fine day...
steve-yegge.blogspot.com: good-agile bad-agile
steve-yegge.blogspot.com: good-agile bad-agile
Wednesday, September 13, 2006
I've been using the "new hotmail" called Windows Live Mail (beta). My biggest complaint is the amount of space they use for advertizing at the top. But, I figured out a way to get around it.
First, you have to be using Firefox (or other configurable browsers). I have the Web Developer extension in Firefox, and in there, you can specify your own CSS style sheet. I just looked at the source code for the main page, found the CSS class name they were using for the advertisement and then added my own CSS like so:
.cAdBannerContainer
{
display: none;
}
Now, I get about 100 pixels more space on the screen. The only thing is I don't know how to make it so my CSS gets added to Firefox each time I open it. Right now, I have to reapply each time. If anyone knows how to make it apply to every page, please let me know.
First, you have to be using Firefox (or other configurable browsers). I have the Web Developer extension in Firefox, and in there, you can specify your own CSS style sheet. I just looked at the source code for the main page, found the CSS class name they were using for the advertisement and then added my own CSS like so:
.cAdBannerContainer
{
display: none;
}
Now, I get about 100 pixels more space on the screen. The only thing is I don't know how to make it so my CSS gets added to Firefox each time I open it. Right now, I have to reapply each time. If anyone knows how to make it apply to every page, please let me know.
Friday, September 01, 2006
My adventures in used phones...
Well, I learned a little bit last week. You see, my "old" Nokia phone was breaking. Two buttons stopped working... two of the most important buttons. First, the "go back" (in the menu) button stopped working, which makes it annoying to look up contacts or play games on your phone. Annoying because I had to use the "hang up" button to go back to the home screen each time. Also, some features while talking also become impossible.
The second button to break was the "hang up" button, which then meant I had to turn off my phone to end phone calls, stop games, or get back to the home screen. Needless to say, I needed a new phone.
Usually, I go to the Cingular store, get ask for the cheapest phone they have that I can upgrade to. They show me the expensive ones, and I say, what about that one that says it's free? They say, it doesn't have many features, and no one likes it, and I say I like it, and they forget about upselling me.
The "free" phone usually costs about $40 dollars because they "have to" charge you the taxes on the retail price, and they "have to" charge you a phone upgrade fee because it costs them $25 to open both phones and move a little chip from one phone to another. Tough job. It takes 5 minutes to do, and that works out to $300 an hour.
So I decided to try something new. I had heard about "unlocked" phones, which sounds really sexy, but usually, it just means that you can use the phone with more carriers, or you can use more features of the phone, like bluetooth.
I don't care about features really, and I was happy buying a cheap phone.
The first thing I learned is that if you don't care about fancy features, you can get a really cheap phone on eBay ($14 with shipping). The second thing I learned is that if you buy a phone that works with one provider (Cingular, Sprint, AT&T), it doesn't work with the others. The way I found that out is this: I bought a phone from a guy who marketed his phone as a AT&T, Cingular phone. I don't think he knew that AT&T and Cingular were not compatible. I certainly didn't know it.
So when I got the phone I was all excited and put my chip in. Turn on phone. Get message: "Phone Restricted". "Enter Restriction Code:" with a box for me to enter the code. I thought it wanted a password. I tried the basics... 1234, 4321, 1111. Clearly, I was not going to guess the number. Then I tried emailing the guy telling him my problem and asking for the password. No response.
Then I saw the line that said "carrier: AT&T, Cingular" and I guessed the problem. This phone will only work with AT&T! So I search on what code to enter. It turns out it's not a simple code. There is a phone ID marked on the inside of your phone that a technician can use to "unlock" the phone for all providers.
I ended up paying $5 to a group of guys that unlock phones by giving you the code via their website.
In the end, I paid $19 for a new, less-advanced phone. I will know what to do the next time I try this, but I'll never go to the Cingular store again, unless I "need" a phone with fancy features and they have a good price on it.
... as I side note, be careful if you sell old phones and PDAs. The "complete reset" function doesn't always delete your data. The phone I bought had not been reset at all, so I had a bunch of phone numbers of this guys friends and family. But I saw on ZDNet or CNet that sometimes people can use PCs to undelete information on a PDA. Very scary if you have important info on your phone.
Well, I learned a little bit last week. You see, my "old" Nokia phone was breaking. Two buttons stopped working... two of the most important buttons. First, the "go back" (in the menu) button stopped working, which makes it annoying to look up contacts or play games on your phone. Annoying because I had to use the "hang up" button to go back to the home screen each time. Also, some features while talking also become impossible.
The second button to break was the "hang up" button, which then meant I had to turn off my phone to end phone calls, stop games, or get back to the home screen. Needless to say, I needed a new phone.
Usually, I go to the Cingular store, get ask for the cheapest phone they have that I can upgrade to. They show me the expensive ones, and I say, what about that one that says it's free? They say, it doesn't have many features, and no one likes it, and I say I like it, and they forget about upselling me.
The "free" phone usually costs about $40 dollars because they "have to" charge you the taxes on the retail price, and they "have to" charge you a phone upgrade fee because it costs them $25 to open both phones and move a little chip from one phone to another. Tough job. It takes 5 minutes to do, and that works out to $300 an hour.
So I decided to try something new. I had heard about "unlocked" phones, which sounds really sexy, but usually, it just means that you can use the phone with more carriers, or you can use more features of the phone, like bluetooth.
I don't care about features really, and I was happy buying a cheap phone.
The first thing I learned is that if you don't care about fancy features, you can get a really cheap phone on eBay ($14 with shipping). The second thing I learned is that if you buy a phone that works with one provider (Cingular, Sprint, AT&T), it doesn't work with the others. The way I found that out is this: I bought a phone from a guy who marketed his phone as a AT&T, Cingular phone. I don't think he knew that AT&T and Cingular were not compatible. I certainly didn't know it.
So when I got the phone I was all excited and put my chip in. Turn on phone. Get message: "Phone Restricted". "Enter Restriction Code:" with a box for me to enter the code. I thought it wanted a password. I tried the basics... 1234, 4321, 1111. Clearly, I was not going to guess the number. Then I tried emailing the guy telling him my problem and asking for the password. No response.
Then I saw the line that said "carrier: AT&T, Cingular" and I guessed the problem. This phone will only work with AT&T! So I search on what code to enter. It turns out it's not a simple code. There is a phone ID marked on the inside of your phone that a technician can use to "unlock" the phone for all providers.
I ended up paying $5 to a group of guys that unlock phones by giving you the code via their website.
In the end, I paid $19 for a new, less-advanced phone. I will know what to do the next time I try this, but I'll never go to the Cingular store again, unless I "need" a phone with fancy features and they have a good price on it.
... as I side note, be careful if you sell old phones and PDAs. The "complete reset" function doesn't always delete your data. The phone I bought had not been reset at all, so I had a bunch of phone numbers of this guys friends and family. But I saw on ZDNet or CNet that sometimes people can use PCs to undelete information on a PDA. Very scary if you have important info on your phone.
Monday, July 10, 2006
one red paperclip blog
Can you believe this guy?? In one year he traded different items until he traded for a house! He started with a paperclip!!!
Can you believe this guy?? In one year he traded different items until he traded for a house! He started with a paperclip!!!
Subscribe to:
Posts (Atom)