So Verizon has finally released the new 5.0 OS for the BlackBerry Storm and I’d just like to say WOW. This is 99% better and is really how the phone should have been all along.
They’ve added new glow effects to the UI, giving it an all-new shiny. There’s also the elastic scrolling effects I think Storm users have been hoping for since day one. Threaded SMS has been added as well, which will definitely please anyone who does a lot of texting. Speaking of text…the new predictive text entry system is a nice addition as well, and seems to be quite effective at correcting most of my typos as I write this blog entry on my BlackBerry. On top of all of this, the phone exhibits greatly improved performance, on par with what one would expect given that its hardware is really no slouch.
Kudos to RIM on getting a software update out there that makes the Storm behave like a whole new device. I was still a bit disappointed that there’s no sign of a mixer for audio, so incoming texts will still interrupt any music you have playing. Aside from that…its a shame it took them nearly a year after the Storm was launched to get this update out there!
This has probably been done before, but this script fixes two problems I’ve noticed with loan calculators:
- They assume monthly interest compounding (most loans are compounded daily)
- They don’t allow you to calculate the payments if you’re splitting your payment (eg: paying $200 twice a month instead of $400 once a month)
#/usr/bin/env python
import math
# Remaining amount on the loan
toPayOff = 12345.67
# Interest rate
intRate = 12.34
# Amount of your payment
payAmt = 200
# Making the payment every x days
payEvery = 15
# Maximum amount you're willing to pay extra to just "pay it off"
balloonMax = 200
# Days til the next payment
runUpDays = 15
# Do not edit below this line
days = 0
pmtNum = 0
dailyInt = (intRate / 100) /365
origToPayOff = toPayOff
totalPaid = 0
while (runUpDays > 0):
toPayOff = (math.ceil((toPayOff * (1 + dailyInt))*100))/100
runUpDays -= 1
while (toPayOff > 0):
days += 1
toPayOff = (math.ceil((toPayOff * (1 + dailyInt))*100))/100
if (days % payEvery == 0):
toPayOff = (math.ceil(toPayOff * 100))/100
if (toPayOff < (payAmt + balloonMax)):
payAmt = toPayOff
toPayOff -= payAmt
pmtNum += 1
totalPaid += payAmt
print "Payment #%s\tPayment Amt: $%s\tBalance:%s" % (pmtNum,payAmt,toPayOff)
print "Over %s payments, you will pay a total of $%s ($%s in interest)" % (pmtNum,totalPaid,(totalPaid-origToPayOff))
Why the F*** hasn’t SCO died yet? They’ve gotten slapped around in court by IBM’s attorneys, declared bankruptcy, shed most of their staff… If not for the utter ignorance of the courts, they’d be gone. Now today, I read that a judge overturned the ruling that Novell owns the Unix copyright? C’mon…this is ridiculous. SCO is only suing because UNIXware is dead. If they DARE to take IBM back to court, I pity them for what they’ve got coming.
ref: http://www.networkworld.com/news/2009/082409-sco-unix-copyright-decision-overturned.html
Reading an article at http://www.dowhatsrightohio.com/ my eyes landed on what’s probably the best simple breakdown of all of the arguments people are using to try to strip rights from the LGBT community. I felt compelled to take the time to challenge their logic flaws:
a.) homosexuality is a choice so it shouldn’t be protected;
- To this, I’d simply like to ask…what person would choose a more difficult life. If it was simply a matter of choice, I don’t think you’d have so many people making the same choice for a more difficult life.
b.) homosexuality is a behavior so it shouldn’t be protected;
- Protesting is a behavior, yet that right is protected. Saying something shouldn’t be protected because it’s a behavior just makes no sense…look how many “behaviors” are already protected.
c.) homosexuals don’t meet the 3 three Supreme Court criteria for civil rights protection so they shouldn’t be protected (economically disadvantaged, immutable characteristic, politically powerless);
- By limiting the rights of the LGBT community, including restricting their ability to legally marry, you create a situation of economic disadvantage as the LGBT couples are no longer able to receive the same work and tax benefits as their straight counterparts. This becomes increasingly exacerbated as you look at all of the places today where one can have their employment terminated for no other reason.
- There has been no solid proof that one’s sexual orientation can be changed either willingly or forcibly. In fact there’s been a fair bit more research that suggests that this is indeed an immutable characteristic.
- The article itself states that the LGBT community is approximately 3% of the population. How does this not equate to being politically powerless?
d.) protections for homosexuals violate my religious freedoms so they shouldn’t be protected
- Someone needs to go back to high school and study the bill of rights again. People do not have unlimited rights, and their rights end where others’ begin. Your right to religious freedom CAN NOT override the rights to legal protections for LGBT persons.
I would like to see the conservatives fighting against the rights of their fellow man have a solid argument for what they’re doing. This isn’t because I believe that there IS a solid argument, just because I’d like to think that they have a reason aside from hatred and bigotry for what they’re doing.
Me: I’m getting faster at whipping out the python
Mike: nice
Mike: lol
Me: oh that sounded bad
Me: srsly didnt mean it THAT way
Me: lol
Mike: well you know when its that big you have to come up with procedures for whipping it out speedily without getting injured
Me: LOL
I had a niche need to make an easy summary of user directory sizes for an FTP server where the users’ homes could be in one of a few locations. I whipped up this script which should make it easy even for an ultra-novice to get this summary:
#!/usr/bin/env python
import subprocess
def run_this(commandline):
process = subprocess.Popen(commandline, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
out,err = process.communicate()
return out
print "Now calculating home directory size for all non-system users.\nThis may take a few minutes, please wait."
file = open('/etc/passwd','r')
userlist = list()
for line in file:
user = line.split(':')
if int(user[2]) >= 1000 and "nobody" not in user[0]:
usage = run_this("du -hs " + user[5] + " | cut -f 1")
userlist.append([user[4].split(',',1)[0], usage.strip()])
file.close()
print "\nStorage Consumed by Users"
print "------------------------------------------------\n"
for userinfo in userlist:
print userinfo[0] + "\t\t\t" + userinfo[1]
print "\n"
So, I recently had a need to randomly redirect a page on occasion…don’t ask.
< ?php
$case = mt_rand(1,100);
switch($case) {
case 42:
$url = "http://notalwaysright.com/?random";
break;
case 13:
$url = "http://icanhascheezburger.com/?random";
break;
case 66:
$url = "http://dynamic.xkcd.com/comic/random/";
break;
case 73:
$url = "http://bash.org/?random";
break;
case 100:
$url = "http://linux.die.net/man/4/random";
break;
default:
$url = "http://www.google.com/";
}
header("Location: " . $url);
?>
Anybody who’s adminned a Virtualmin server has probably had update hell. One that I personally have had to wrangle with is where Virtualmin will randomly disable email accounts, resulting in frustrated users calling you when noone can email them. I’ve written a quick Python script to dump out a list of all disabled email accounts to reduce the inevitable frustration caused by this issue, allowing one to quickly find all of the disabled emails and re-enable them, hopefully before anyone complains.
#/usr/bin/env python
file = open('/etc/postfix/virtual','r')
activemails = list()
for line in file:
if '@' in line:
activemails.append(line.split(None,1)[0])
file.close()
file = open ('/etc/passwd','r')
for line in file:
if '@' in line and '/bin/false' not in line:
email = line.split(':',1)[0]
if email not in activemails:
print email
file.close()
Hello world. The default post title on WordPress, but still fitting. Sometimes I want to rant. Sometimes I have profound thoughts. Other times still, I may have randomness to throw around. I’m going to do that here. Well, that’s the plan anyway. Let’s see how well it works out this time