Just A Reminder

posted by pope on January 6, 2010 at 5:31 pm

I totally exist. I mean, in real life anyway. Work became somewhat all-consuming, so I sort of disappeared from most of my internet homes. However, I am still around, and now that I've had a bit of relaxation on my winter break, I'm ready to be back and ready to start posting random nonsense that no one listens to.

permalink  |  Digg!  Share on Facebook  del.icio.us  Reddit  StumbleUpon  Slashdot  
tags: site news, personal, all tags
0 comments:  view  |  leave one

Quickly: Python Blows

posted by pope on September 25, 2009 at 12:31 pm

Here's a brief example of why I hate Python, and also why I love php. Check out the same code written in each language:

Python:


import MySQLdb 

class Eb_db:
    def __init__(self):
        try:
            connection = MySQLdb.connect(host="localhost",
            user="hammock", passwd="secret", db="waffles" )
            cursor = connection.cursor()
            cursor.execute( "SELECT * FROM Syrup WHERE taste = 'delicious'" )
        except MySQLdb.OperationalError, message:
                errorMessage = "Error %d:\n%s" % (message[ 0 ], message[ 1 ] )
                return
        else:
            self.data = cursor.fetchall()   
            self.fields = cursor.description   
            cursor.close()   
            connection.close()


PHP:

if(mysql_connect ('localhost', 'hammock', 'secret'))){
	if(!mysql_select_db('waffles')){
		echo 'Could not select the database: ' . mysql_error();
		exit();
	}
}else{
	echo 'Could not connect to the database: ' . mysql_error();
	exit();
}
$result = mysql_query("SELECT * FROM Syrup WHERE taste = 'delicious'");
if(!$result){
	echo 'No results were found: ' . mysql_error();
}else{
	while($row = mysql_fetch_array($result)){
		//do as you please, you're iterating over each row now:
		//$row['fieldName'] == 'data'
	}
}


Two lines of code less for Python, but assuming you didn't know either language, which of those is easier to read through and understand? This is of course also excluding the terrifying and often life ruining indentation-instead-of-braces deal that Python uses to define code blocks.

Someone who actually likes Python, please explain to me how this doesn't suck, because I just don't see it at all.

permalink  |  Digg!  Share on Facebook  del.icio.us  Reddit  StumbleUpon  Slashdot  
tags: Python, php, Programming, all tags
2 comments:  view  |  leave one

Also -- I've never had my life, or even my day, ruined by Python's indentation-significance.

Occasionally when cut-and-pasting code from a tab-formatted source to a space-formatted source, or v/v, I've gotten obvious errors, which were easy to sort out.
posted by Hamilton-Lovecraft on January 26, 2010 at 10:29 pm
Okay, I'll bite.

For starters, the class and def aren't doing anything for you in your Python snippet and have no parallel in your PHP; remove them and you lose two of those scary scary indent levels.

Second, yeah, python's mySQL API isn't particularly slick; for serious use of it you'll want to write a wrapper. I'm not that familiar with PHP but it appears that the APIs are just at a slightly different level of abstraction. But that's a library issue, not a Python issue.

I don't know much about PHP. What happens if you need to connect to two different databases concurrently in one program? I don't see what connects the mysql_connect() call to the mysql_select_db() and mysql_query() calls. Can you seriously only connect to one db at a time? That's a pretty bad failure of library design if so.
posted by Hamilton-Lovecraft on January 26, 2010 at 10:24 pm

A Conversation About Conversation

posted by pope on August 18, 2009 at 12:09 pm

The comment system on this site (and by virtue of it being basically just copypasta, WNV too) really sucks. Anyone who's ever used it (all four of you out there) knows that. It doesn't support replies, doesn't have any way of notifying anyone, including me, who wrote the post in the first place, about new comments, and just plain looks like shit. As a result, I've been looking around for ways to improve it. My extensive searching has brought me to something called Chirrup, a commenting system that uses Twitter as a datastore.

The basic idea is pretty simple. Instead of writing php code that stores your comments in my own database, and then later reads that database to show them, why not put them in a system that I don't have to maintain and has more reliable uptime than my own site does anyway? There are also some further benefits to using Twitter rather than my own database. Right now, I just ask you to type a nickname for yourself on every comment post. The site doesn't care what you type there; you could easily pretend to be me (don't). It also doesn't remember what nickname you typed last time, so you're a stranger to it every time. This doesn't make for a particularly awesome environment for useful discussion. And it's kind of annoying for me because of all the spam. Or, now, annoying for you since I offloaded the annoyance into a captcha in every comment form, which, incidentally, even I still have to fill out if I want to comment anyway. Using your already established Twitter identity will make it both easier for you to comment and at the same time make sure people aren't pretending to be someone they aren't.

The fact that every comment will be posted via Tweet comes with even further added benefits to the site. Rather than being posted in some unknown region of the internet where the guy who wrote the article it refers to probably won't even see it, these comments will be posted to the wildly popular and closely followed world of Twitter, along with my name and a link back to the post. Every time you post something to me, you're also advertising for me! Genius.

There are a few small problems with adopting Chirrup as the sole method of commenting, however. There are two harsh realities that need to be faced. Some people just don't have a Twitter, and some people just don't want their name pasted on what they write. Whether they're calling me names and laughing at my foolish site code, or they really just are thoroughly concerned about privacy, there needs to be some way to support these people. Fortunately there is a simple solution. One option for commenting with Twitter, one option for guest commenting. The guest commenting system will of course have to be written by me, but will still nonetheless use Twitter, because we all know how it turns out when I write my own comment systems. Plus, using Twitter, these guest comments will still be able to join in the discussion of the regular users, just without the convenience of having a unique identity.

So yes, I am going to make Twitter the commenting system on this site very soon. But have no fear, things aren't changing that much; it will still be available to everyone on the internet, and only about six people will ever use it.

permalink  |  Digg!  Share on Facebook  del.icio.us  Reddit  StumbleUpon  Slashdot  
tags: Twitter, site news, comments, all tags
1 comments:  view  |  leave one

AND not to worry, the tagging system will still make absolutely NO sense whatsoever, and that blank with (5) tags will keep going strong.
posted by Pope on August 18, 2009 at 12:10 pm

Cider Is Delicious

posted by pope on August 13, 2009 at 11:50 am

Cider is a product of TransGaming, and it seriously blows my mind in the best way possible. The process goes a little something like this:

  • Me: Hey, Cider, what's u-
  • Cider: HEY GIMME A WINDOWS GAME
  • Me: Um, what? Why?
  • Cider: I HUNGER FOR WINDOWS GAME
  • Me: ...okay I guess. Here's Portal.
  • Cider: PORTAL? I LOVE PORTAL!
  • Me: Yeah me too, it's one of my favorites. So what exactly are you do wit-
  • Cider: HERE, HOLD THIS
  • Me: What the- You'd better not be using me to hide from the cops again. Wait...is this Portal.app?
  • Cider: YEAH
  • Me: ...is this Portal...but for OS X?
  • Cider: YEAH WHY
  • Me: ...i don't
  • Cider: PLAY WITH IT
  • Me: ...i don't even
  • Cider: ON YOUR MAC
  • Me: ...I'm so happy right now I can't ev-
  • Cider: FEED ME MORE I HAVE HUNGER

And that's the story of how I came to have native OS X apps of my favorite games. Whether or not my puny X3100 can handle such things is beside the point. Things like Half-Life 2 are beautiful; things like Portal would be beautiful if you blink every half second. How TransGaming pulled this off, I can't even begin to imagine. There are limitations to their dark magic though, such as the fact that games with popup menus before the actual game part starts tend to not work out, and some registry nonsense is just too impossible for this to handle. But, other than that, they seem to have figured out a way that just slapping .app on the folder from Program Files means it's Mac compatible now. And my god am I happy with that definition of it. You can never un-see something, and the inner workings of the Windows Registry seems like one of those things I would need some serious eye-bleach for.

Anyway, go get Cider, it's a winner. Or look for some cider-ized games somewhere. I'm sure they exist. You know, somewhere on the internet, perhaps.

permalink  |  Digg!  Share on Facebook  del.icio.us  Reddit  StumbleUpon  Slashdot  
tags: Cider, TransGaming, OS X, gaming, internet, all tags
0 comments:  view  |  leave one

Technology Makes Everything Easier!

posted by pope on June 26, 2009 at 12:43 pm

Steps taken to get desktop to be able to use internet in my room of my parents' house:

  1. find old ps/2 clickey-clack keyboard.
  2. lol profusely at silly old ps/2 clickey-clack keyboard.
  3. plug in old ps/2 clickey-clack keyboard because lol.
  4. realize this desktop only has wired internet, and this house only has wires in the basement.
  5. shut down computer.
  6. dig through closet.
  7. discover old memories.
  8. discover old wireless PCI card.
  9. unplug every wire from desktop.
  10. open desktop.
  11. install wireless PCI card into only available PCI slot.
  12. become concerned that wireless PCI card now blocks 90% of $600 graphics card intake vents.
  13. close desktop anyway.
  14. reconnect every wire to desktop.
  15. turn on computer.
  16. note that Windows Update failed to find drivers for the device to use to connect to the internet because it cannot connect to the internet.
  17. lol at flawed logic.
  18. use laptop to search device id on Google.
  19. note that wireless PCI card is one of the most generic pieces of hardware available to man.
  20. search for drivers for Windows 7.
  21. fail to find drivers because it's just too generic and Windows should know how to do it.
  22. search for drivers for Vista.
  23. fail to find drivers because no one has ever had to manually install this driver.
  24. tell Windows 7 to try updating driver again anyway.
  25. watch Windows 7 fail at finding the most generic device driver ever created.
  26. smash old ps/2 clickey-clack keyboard until dead.
  27. shut down computer.
  28. unplug all wires from desktop.
  29. carry desktop down basement stairs.
  30. borrow mouse, keyboard, network, power, and monitor cables from parents' desktop.
  31. turn on computer.
  32. watch monitor remain blank.
  33. remember that integrated VGA port on desktop will not work with $600 graphics card connected.
  34. force shut down computer.
  35. open desktop.
  36. try to remove $600 graphics card.
  37. note that little clip at the end of PCI Express slot is conveniently unreachable due to everything in the world being in the way.
  38. poke at $600 video card with screwdriver until it seems loose.
  39. poke at old ps/2 clickey-clack keyboard with screwdriver until all keys are detached and shattered.
  40. close desktop.
  41. turn on computer.
  42. watch as Windows Update installs wireless PCI card in less than five seconds.
  43. shut down computer.
  44. reinstall $600 graphics card in desktop.
  45. return wires to parents' desktop.
  46. carry desktop upstairs.
  47. trip over dog because you can't see.
  48. almost drop desktop on yourself.
  49. reconnect all wires to desktop.
  50. turn on desktop.
  51. not be able to connect to wireless anyway, because you forgot about MAC filtering.
  52. set remnants of old ps/2 clickey-clack keyboard on fire.
  53. use laptop to add desktop wireless MAC address to allowed list.
  54. connect to wireless network.
  55. go on facebook.
  56. complain that nothing interesting is going on and you're so bored.
  57. go to bed.
  58. dream of ways to dispose of old ps/2 clickey-clack keyboard murder evidence.

permalink  |  Digg!  Share on Facebook  del.icio.us  Reddit  StumbleUpon  Slashdot  
tags: lols, technology, annoying, all tags
0 comments:  view  |  leave one


show all posts

Please provide a reason for the ban

Ban user Cancel