Uncategorized
Get motivated!
by mikez0r on Dec.28, 2009, under Uncategorized
Sarah Palin is coming to Houston! Yippeee!
“Sarah Palin made history as the first woman ever to be elected Governor of Alaska, and the youngest person to ever hold that office.Her straightforward, no-nonsense approach to politics and life captivated the nation and jettisoned her new book to an instant mega-bestseller. ”
I think jettisoning her book is the only appropriate action for it, though I worry about overflowing landfills.
Courtesy of Answer.com, the definition of jettison:
verb
To let go or get rid of as being useless or defective, for example: discard, dispose of, dump, junk, scrap, throw away, throw out. Informal chuck, shuck (off). Slang ditch.
noun
The act of getting rid of something useless or used up: disposal, dumping, elimination, riddance.
jettison indeed.
OS X 10.6 problems & fix
by mikez0r on Dec.16, 2009, under Uncategorized
Oh boy, was I seething at Apple after upgrading to 10.6. It seemed like just about everything broke. All of my Python development stuff went to hell in a handbasket (a stylish, well-designed handbasket). My 600$ (educational) copy of the Adobe CS3 Design pack would not even install. To boot, X11 did not work, so I couldn’t even use trusty old NXclient to remote desktop on my linux box.
I’m not sure why, but I didn’t bother searching for anyone with similar problems at the time. After going through the trouble to revert to 10.5, I did that search, and found all kinds of exactly similar problems, mostly caused by cruft from the old system. After a fresh OS X 10.6 install, things are in much better shape. Yes, there are other ways to clean up the cruft, but fresh installs feel so nice. CS3 still won’t install, but I can live with Inkscape and the GIMP.
Long story short: OS X is not the bulletproof OS that it is often advertised as, but it’s also not as bad as I thought.
Oh, one quirk:
Everyone mentions how much space 10.6 frees up on their hard drive. That’s nonsense. It may use a tiny bit less space, but the real “increase” in hard disk space comes because they switched to calling kilobytes 1000 bytes, rather than 1024 bytes (and MB are 1000 KB, and so forth). Because it divides the total number of bytes by an accordingly smaller number, you end up with a “bigger” hard drive. This has long been what the hard drive manufacturers do, but it’s awfully shady and very arbitrary for Apple to make that switch now.
OpenCV image registration
by mikez0r on Oct.13, 2009, under Uncategorized
This is more a note to self than anything else, but if you find it useful, hooray!
I’m trying to register images for school. There’s a neat trick to get rotation & scale roughly aligned, without doing any kind of brute forcing (which is really important, because my images can be any angle offset from one another). You take the log-polar transform of each image, and then cross-correlate the two transformed images. The distance from the center to the cross correlation maximum along the Y axis tells you the rotation, and the same on the X axis tells you the scale (on a logarithmic scale). The end result is that you can avoid the local alignment maxima associated with brute forcing, and save a whole lot of time in the process.
However, it doesn’t work perfectly for me yet. Here’s a few steps I’ve taken to improve it:
1. Pad the image that you’re going to match the template on.
Python with ctypes_opencv:
pad_img=ocv.cvCreateImage(ocv.cvSize(cropWidth*3,cropHeight*3),
expIPLimg.depth,expIPLimg.nChannels)
offset=ocv.cvPoint(cropWidth,cropHeight)
ocv.cvCopyMakeBorder(expLP, pad_img, offset,
ocv.IPL_BORDER_CONSTANT, ocv.cvAvg(expLP))
2. Do not cross-correlate the entire template to match. Instead, match only the central strip. There’s plenty of good stuff to match there, and you avoid the correlation penalties of having your template overlap with the padding. If you don’t do this, then the scale correction possible will be limited.
resultWidth = pad_img.width – refLP.width/2 + 1
resultHeight = pad_img.height – refLP.height + 1
result = ocv.cvCreateMat(resultHeight,resultWidth,ocv.CV_32F)
ocv.cvSetImageROI(refLP,ocv.cvRect(refLP.width/4,
0, refLP.width/2, refLP.height))
ocv.cvMatchTemplate(pad_img,refLP,result,ocv.CV_TM_CCOEFF_NORMED)
You smell like beer.
by mikez0r on Aug.24, 2009, under Uncategorized
Funny encounter today with some jailbait at the Woodstocks bar. Here’s how it went:
(2 young girls walk up next to me at the bar, and are wondering what the trinkets in the glass at the bar are)
Me: “those are bottle openers.”
Them: “you smell like beer.”
Me: “that’s because I’m drinking it.”
The real question, though, is how they know what beer smells like, but don’t know what a bottle opener looks like. Hmmmm….
How to annoy your TA/group elder
by mikez0r on Apr.21, 2009, under Uncategorized
1. Copy and paste answers from Wikipedia. Don’t bother paraphrasing them – leave them in their (somewhat) good English, so that they’re easy to pick up as plagiarized. Better yet, leave the blue text and active hyperlinks. Then justify it by saying the information was hard to find.
2. Treat your elder as the group secretary. He doesn’t get enough of this shit from the boss, and he looked lonely. Ask him to find you a desk, or better yet, make space for you.
3. Declare that it’s the TA’s fault that you don’t have a good sample to work with for lab. Demand that he provide a better one for next time. Ignore that other classmates got good results from the same sample, just a different region.
4. Do all of the above with charming enthusiasm and smiley faces.
Garlic
by mikez0r on Mar.19, 2009, under Uncategorized
On the suggestion of one of my new co-op friends, I tried eating a raw garlic clove to try to nip my cold in the bud. My body was unhappy with me the first time, and downright refused the second. I think I’ll stick to vitamins and horrible-tasting cough syrup.
In other news, I passed my qualifying exam. I’m now a dissertation away from being a mad doctor. Excitement abounds.
Fixed width string formatting in python
by mikez0r on Feb.25, 2009, under Nerd, Uncategorized
I wanted to make a nice, pretty text file from some log info, but python didn’t want to cooperate with string formatting.
I was trying something like this:
f=open(‘file’,'w’)
f.write(‘%-10s’ %string)
At the interactive prompt, the equivalent print command would give the desired result.
I got it to work by replacing f.write() with
print >> f, mystring.ljust(10)
This code has the same net result of printing to the file, but it actually does the spacing properly.
This thread gave me the hint I needed, though it looks like the poor guy never resolved his issue – he should have tried the print suggestion.
http://bytes.com/groups/python/25205-using-string-ljust-try-hold-fixed-width#links
Abstinence failing???
by mikez0r on Jan.13, 2009, under Uncategorized
From today’s school newspaper, an article that made me laugh quite a lot:
A recent study conducted by Janet Elise Rosenbaum yet again compares the sexual behavior between teens who take abstinence pledges and teens who don’t. She found that after five years of taking the pledge, 82 percent of the virginity pledgers deny having ever pledged and ultimately, there was no difference between the two groups in terms of sexual activity or sexually transmitted diseases. However, pledgers were less likely to use contraceptives, such as condoms, and Rosenbaum writes this may be because many abstinence-only programs disparage the effectiveness of contraceptives.
(Article by Helen Zou, available here )
I laughed a lot because I really hate faith-based initiatives, and to see them failing so miserably (indeed, being arguably counterproductive and potentially harmful) brings great joy to my twisted, cold, black heart. I hate them because they are pure nonsense initiated by people with likely good intentions, but absolutely absurd, borderline megalomaniacal obsessions with controlling thought. Of course the easiest targets for such thought control are young people, with the enormous potential for peer pressure in youth-oriented groups. To strive for prevention of disease and unwanted pregnancies is a noble goal, but to try to do so by fighting human nature is folly. I am delighted to see nature prove it as such.
Milk
by mikez0r on Jan.01, 2009, under Uncategorized
If you haven’t already seen this, you really should watch it. It’s a 1985 documentary on Harvey Milk, the subject of the recent Sean Penn movie.
http://www.hulu.com/watch/49577/the-times-of-harvey-milk
It’s worth watching because Harvey Milk exemplified the kind of person that we desperately need – right now and always. He was gentle and compassionate, yet fiery and determined in his push for human rights. I have been forced throughout my life to learn about Christianity at various religious schools and from growing up Catholic. This man, more than anyone in the political history of the United States that I know of, truly exemplifies what it means to be a Christian politician (even though he was Jewish): accepting of others, peaceful, selfless, and relentless in his pursuit of human equality. I only mention Christianity because of the current political skew in that direction. It is irrelevant in understanding Milk’s life, but does provide a widely acknowledged standard of excellence, a standard through which Milk can be evaluated to be a truly praiseworthy man.
The Sean Penn movie is also worth watching, but this documentary is better, in my opinion. It covers the events after the assassination in much greater detail. If you do go to see the Sean Penn movie, please avoid Cinemark theaters, as the owner of that chain donated the maximum personal contribution to the Yes on Prop 8 campaign, and should not be profiting from the memory of such a great leader of the gay community.
Conservative Lesbianism?
by mikez0r on Jan.01, 2009, under Uncategorized
I spent my New Year’s Eve Contra dancing in Sacramento. At some point, I realized that I was being followed/stalked by a woman. She first stood near me, and talked into space at no one in particular, I suppose hoping that I would listen and comment. Since I didn’t hear what she was saying, I paid no heed. Some time later, I got cornered near the snacks, coincidentally by the stack of progressive newspapers. She made sure to shout this time, though no more in my direction than before. I ignored her a couple of times, and started looking at the headlines of the newspapers. She shouted something about gun control. I finally realized she was trying to talk to me. See, I had suspected as much before, but I’m not used to people talking to me. Once she had my attention, she announced her status as a conservative lesbian. I thought it was rather oxymoronic. When I said as much, she said “What, have you been going to college? Who tells you this stuff?” Hmmm… Prop 8, anyone? It’s not news that conservatism and homosexuality do not go hand in hand these days (or ever have). I asked her if she ever wanted equal civil rights to heterosexuals. The conversation went nowhere. Never mind that she’s been following me (a guy) around looking for a dance. I dismissed her as confused, and went on my merry way, talking to other people so that she’d leave me alone. She never got her dance.
Now that I’m home, I decided to search up this funny sounding term, “conservative lesbianism.” There are at least a few things out there, but recent headlines are intermingled with stuff at least as far back as 2001. Mostly it’s the idea that these lesbians adhere to conservatism in the true sense – minimal government, and certainly minimal government interference in personal life. Since when, though, has the conservative element in this country actually adhered to those ideals? Certainly not recently. Why on earth would any lesbian or gay person currently identify with a party that is actively working to deny them civil rights, and whose religious core condemns them as hell-bound? What’s more important to you – your guns, or your dignity?
These people must wake up and get their priorities straight. The Republican party has no respect for them, and the Republicans have clearly shown no intention of minimizing government’s monitoring and control of people’s decisions. Until there is true conservatism in government, without the interference of religion and corporate greed, any conservative gay person would do well to lose that identity and focus on preserving their rights as equals.