• Home
  • About Me
  • Contact

kanorben.net - blog

My personal blog on technology, programming, life, and the random


 

March 2008
M T W T F S S
« Feb   Apr »
 12
3456789
10111213141516
17181920212223
24252627282930
31  

Blogroll

  • Boing Boing
  • BorjaNet
  • Brian Mayer
  • Dean Armstrong’s Blog
  • Ellen Smith’s blog
  • Faraocious
  • Gross or Awesome?
  • Marcus Westin’s Blog
  • Paul Mantz’s Blog
  • Slashdot
  • TechCrunch
  • Tomorrow with Alex Beinstein
  • Valleywag

Personal Sites

  • DOIT Fortune Database
  • My bookmark’s on del.icio.us
  • My CS account page
  • My Facebook Profile
  • My LinkedIn Page
  • My Picasa Albums
  • My Twitter
  • pyXSD
  • The SUCCESS Blog
  • UofC ACM Site

webcomics

  • Questionable Content
  • The Perry Bible Fellowship
  • Welcome To The Future
  • xkcd.com

Meta

  • Register
  • Log in
  • Entries RSS
  • Comments RSS
  • WordPress.org
Add to Google Add to My Yahoo! Subscribe with Bloglines
Bloggers' Rights at EFF

Twitter Updates

    RSS My Del.icio.us

    • VX32 Virtual Extension Environment
    • Starting Forth's home-page
    • Quick start - The Open Source Backup Wiki (Amanda, MySQL Backup)
    • Telemarketers - Kill the Calls
    • Ian Bicking: a blog :: Python HTML Parser Performance
    • Mac OS X 10.4 Tiger: Page 5 - launchd
    • MidpSSH | SSH and Telnet client for Mobile devices (MIDP/J2ME)

    RSS My Facebook Posted Items

    • Neave Television ...telly without context
    • Cock Puncher: The Game!
    • Clever Squirrel
    • Thurston Moore Interviews Beck and Mike D
    • Ubersite - How I Ruined My Neighbor's Christmas, New Years, and Birthdays for Years to Come...

    Playing With Ctypes and Ghostscript

    March 25th, 2008 by knorby

    I have been playing around with the ctypes library in python recently. It is a foreign function interface for dynamic linked libraries(DLL)/shared libraries. It works back to python 2.3, and it was added into the standard library in python 2.5. Anyway, it provides a much nicer way to access C libraries then using one of the various methods to create a C extension, though it is a bit slower. As I learned at pycon, one of the benefits is that PyPy (one of the craziest things I have ever seen) can use ctypes. I was thinking of staying for the PyPy sprint at pycon, but I think they were going to work on a pure python implementation of the library, which was far too intimidating to me. I will post about pycon at some point soon.
    I guess I find ctypes so special just because it is the first thing in recent history with python where I was really amazed. I first saw it with µTidylib, which is a python wrapper around the HTML tidy library. What got me was just playing with it on the interpreter:

    >>> from ctypes import *
    >>> libc = CDLL("libc.so.6")
    >>> libc.printf("Hello, World!\n")
    Hello, World!
    14
    >>>

    Obviously, it is a lot more powerful than this example illustrates, but you get the idea. I have been fixing up some of the filters in the print system at the Maclab over spring break, so I have been working with ghostscript a bit. There is an API for ghostscript, so I have started writing a wrapper library for it in my free time to practice using ctypes, and, well, because one doesn’t exist. I am trying to think of a name that somehow combines ghosts, snakes, and desktop publishing….

    Posted in C, Python, coding, postscript | No Comments

    Removing Social Ads from Facebook Feeds

    March 3rd, 2008 by knorby

    I am not a huge fan of ads. I say that somewhat hypocritically as adSense proudly barfs somewhat random ads out on this page, none of which I really expect will ever click on, but that is besides the point ;). Anyway, I can normally block ads with adBlock, but social ads are trickier. Every social ad div has for a class:
    feed_item clearfix social_ad
    Each one is a seperate class. They do some trick so it is hard to override with a page wide css that doesn’t take out everything, so userContent.css and similar tricks are out. I ended up brute forcing it and writing a greasemonkey that does the job.

    Download it here: hidefacebookfeedadsuser.js

    Update: There is another class used as well. If I remember correctly, instead of social_ads, its ad_capsule with everything else the same.

    Posted in coding, css, facebook, firefox, internet, javascript | No Comments

     
    Add to Technorati Favorites - Creative Commons License - © 2007 Karl Norby