lopost python script

October 10th, 2008

Last post I talked about the laconica services and using linuxoutlaws.net. Well, I really enjoy it, but I wanted to be able to post without actually visitng the site. My first thoughts were to write something in perl so I could use it as an irssi plugin. I ended up just writing a stand-alone script in python and creating an alias in irssi to call it. It ended up being quite easy to add all the features I wanted, and I’m pretty pleased about that. I’ll be putting up the code, and I’ll keep it updated if I do more work on it.

laconica on linuxoutlaws.net

September 27th, 2008

Well, you may notice I’ve added a feed over on the right there of tweets (as in twitter). I’ve avoided sites like twitter for a few reasons:

  1. I feel like I can handle my own social networking, thank you very much. This is why I have my own blog, where I aggregate what I do at other sites (like the music I listen to and articles I digg) all on my own.
  2. Sites like Twitter and Facebook run proprietary software. No one is able to see, modify, or redistribute the code for these sites.
  3. Said sites also maintain licenses that can restrict what you post, and call into question the ownership rights of anything posted to them.

My friends over at Linux Outlaws have solved this problem for me. They’ve installed a service called Laconica, which functions much the same way as other micro-blogging software, like Twitter. The difference, however, between this and other services is that it is open-source software, and it is being run by some fellas I consider friends, which means that I am indeed, handling my own social networking. On top of that, I don’t feel like I should ever have to worry about doing something like aggregating my own posts over to this site and wondering if I really have a right to re-distribute my own content. One more neat part? You can subscribe to others’ tweets, even if they’re not on the same Laconica server.

If you’re interested, head over to Linux Outlaws’ Laconica site, and sign up. Also, if you have any interest in computers or Linux or you just hate microsoft, you should really head over to their podcast website and listen. To it all. Dan and Fab kick ass.

Ok, back to implementing a (yes, really) four-function calculator for fractions, in C++.

few and far between, and project euler #15

September 24th, 2008

I feel crappy that I haven’t been updating, but I’ve got 12 hour work days. There’s that twinge of guilt about unattended blogs, but I’ll be in the back of a class supervising a lecture (like I am now, actually) and just think: “now’s not the time!”

But yes, I’m still around, and I haven’t forgotten my meag… erm, “highly exclusive” readership. So, how’s my week been?

Ok. Been working on fixing my damned pointers. I have one that keeps faulting when I delete it and I don’t know why. So, as angry as computers make me, I was glad this morning.

Why? I did a project euler problem (#15) without a lick of programming. The question was in a 20×20 grid, how many combinations of paths are there from one corner to the other. Welllllll permutations tell us it’s the factorial of 2 times of the size of your grid, all over the factorial of the number of possible choices multiplied by factorial of the the number of columns. In easier terms, that’s

(2n)! / ¹n! * ²n!

And since our grid is 20×20… well. You figure it out.

Hope to be back soon enough!

project euler #9

September 5th, 2008

Many of you know I’ve been sucked into the world of Project Euler. I love problem-solving with computers, and I love math, despite not being great at problem-solving with computers and being even worse at mathematics.
As of yet, most of my solutions have been brute-force attempts which get the answer quite ahem thoroughly, if not the most efficiently.
Well, project euler #9 involves calculating pythagorean triplets, and I’d left it for a while deciding it would involve a pain-in-the-ass buttload of calculating and would take about 20 minutes to run. However, I’ve been listening to The Teaching Company’s The Joy of Thinking, and they presented ways of calculating the pythagorean triplets that I’d never really thought of.
Anyways, this morning I was waiting around for a while between errands, and a napkin and 4 lines of python inspired me. All I had to do was reduce the fact that:
2mn+(m*m - n*n)+(m*m+n*n) = 1000
to
m(m+n)=500 and run through m and n with n < m. BAM!

[nate@pepper python]$ time ./peuler9.py
sum = 1000
product = *****

real 0m0.012s
user 0m0.010s
sys 0m0.000s

Yes, I removed the actual answer so as not to be a spoiler. However, I will include my full source code, as I’m amazed at how simple it was, and maybe you’ll enjoy it too.
(source code after the jump…)
Read the rest of this entry »

general updatery

September 5th, 2008

Boy, is school ever busy!
I really dig my new position as a lab assistant. I get to help people, which I’ve always considered a good thing. In some ways, it’s kind of crappy, becuase in the classes that don’t end up needing a lot of technical assistance, I end up getting sent to make copies or working on stuff for project euler, but I consider it well worth it.
Classes are going good too. I’ll be essentially sleeping through my german class, but it will be an easy 5 credits. Might even get fun too.
I had my first C++ class in almost 10 years last night. THAT was a trip. Back when I started learning, STL had barely come into existence. We had only just got up into the process of implementing classes and whatnot. After that, I ended up doing all python and perl and ruby, and who needed to compile?
I got into this class and after our introduction, one of the first comments was “Well, I’m sure you’re all familiar with things the string classes and whatnot, so let’s move on to memory addressing and pointers”
/me jaw_floor()++;
Good news is, it’ll actually be a nice challenge to catch up.
I haven’t been to my Shell Scripting class yet, but it should be alot of fun. It’s with one of my favorite professors, so I plan on it being a fun time.
More later.

busy

August 24th, 2008

oh MAN! Have I ever been busy! Don’t worry, I’m still around, and with all kinds of new news to share. I’m just a tad busy. I’ve moved into a new house (which I’m currently working on wiring the whole place with Cat5E) and I’m switching jobs to a teaching assistant position at Washtenaw Community College. So, once I have the internet functioning throughout the house (and then of course, moving the server, etc) I’ll be back more often.

So no, world, I haven’t forgotten about you. Now, can you hold this cable while I go pull the other end through my wall?

dad’s awesome sculpture

July 28th, 2008

My father would never admit to this, but he is an awesome sculptor. He’s an electronics engineer by trade, but he loves to dabble and build stuff. Well, every once in a while, he will go and make these neat sculptures out of dysfunctional electronics parts. He doesn’t ever really show them off, and they just end up sitting in his basement. I think that is wholly an injustice. People should see how cool these things are!

So, absolutely without any permission whatsoever, I snuck down and took pictures of his latest creation — this kind of humanoid dragon thing. Tell me this isn’t badass!


Dragon Sculpture

Dragon Sculpture

Dragon Sculpture

Dragon Sculpture

Dragon Sculpture

Dragon Sculpture


gentoooooooo

July 23rd, 2008

Well, I’ve been having tons of fun with gentoo over the past few days. I like the idea of do-it-yourself linux distributions, when i have the time for them. And, seeing as I have had the past 3 days off work, I’ve had the time.

I’m actually typing this up on the laptop, while the workstation on which I’ve been playing with gentoo resizes its partitions. I borked up 2 installs already, but this is how one learns new things, when it comes down to it.

At first, I spent all kinds of time convinced I could make my own custom kernel to be all uber-useful. FAIL. So the second time around, I got everything up and running, with gnome all up and active, ATI drivers installed (manually, ’cause emerge didn’t want to have anything to do with installing them on a 2.6.25 kernel) and compiz running, if not very well (windows would wobble, but then no longer refresh their contents). I was upset that the version of Gnome that gentoo provides was 2.20, since the 2.22 version came out month ago, and went about enabling parts of the “testing” branch of portage. Big mistake. I was in dependancy hell, and realized that I wasn’t going to get everything back and moving smoothly with only 2 days experience with the system. On top of that, I’d tried putting all of gentoo on an 8.5GB partition, which isn’t nearly enough space to be installing everything from source comfortably.

So now, I’m resizing the partition on that hard drive, in anticipation of once again installing gentoo, over SSH, from my laptop. Awesome, if you ask me. It’s neat to think I’m remotely installing one machine from another machine.

Perhaps if I get some more time, I’ll get to write an update about how I’m loving my awesome new gentoo system.

new camera

July 17th, 2008

I got my new camera in the mail yesterday morning. I’m now the proud owner of a Canon Powershot A590IS. It’s got just enough tweakable geeky options to play with to keep my nerd side happy, without having so much that I wasted money getting options I don’t need. Awesome.


take that!

take that!

my boys

my boys


blog spammer, you’re dumb

July 15th, 2008

Well, some idiot has decided to add this blog to their spam bot. I’m not sure why, since comments are moderated, so their links to “Jessica Alba Ass” don’t show up without my approval. Nonetheless, their ill-programmed bot keeps putting comments on the same post (don’t be late). What’s the deal?

Ahh well, I feel bad for the poor unsuspecting victim whose computer is being used as a blog spam bot, because I’m sure their internet will soon be shut off.