Aug 12 2008

svnant for subversion 1.5

Published by jfrank under Uncategorized

One day at work I saw that tortoiseSVN had an update, and so I blindly installed it and went about my business. It then began poisoning all the shared working copies that we use at work, with subversion 1.5 format, thereby causing all other svn clients to report “This client is too old to work with working copy …” Long story short, once you start its hard to stop.

I thought ok no problem, I’ll help all of my co workers upgrade and that will be that. Subversion 1.5 is a release after all, surely all the tools that go with it are released too! That turned out to be mostly true, but not for a specific tool that we use quite a bit here, svnant. There was no svnant bound against the latest dependencies.

I found an email by the guy who runs the show mark that said he wanted someone to take on the project. So I volunteered.

I became the svnant guy just like that. I made a simple release so if you are just dying to get svnant working with subversion 1.5 working copies, download the release candidate.

No responses yet

Jul 16 2008

launchy hot key broken

Published by jfrank under resources

I use Launchy for Windows, it is a command line launcher that allows the user to forget the start menu is even there. Which is a dream come true. It is also customizable and generally useful.

I somehow broke my launch key setting by resetting it to an invalid combination. Alt-Space is the default, and I had set it to something that simply didn’t bring up the Launchy window. This is a problem with Launchy because there is no ‘official’ way to reset the hotkey without first bringing up the launchy window.

In short, if you ever have this problem, instead of attempting a reinstall, which doesn’t work just do this:

How To Fix Launchy’s Hot Key:

  1. Kill Launchy.exe from the task manager.
  2. Open launchy.ini in your users application data folder.
    For windows XP users, this is:
    C:\Documents and Settings\yourusernamehere\Application Data\Launchy\Launchy.ini
  3. Add or replace these ini style keys:
    [GenOps]
    hotkeyAction=32
    hotkeyModifier=134217728
  4. Save the file, and restart Launchy.exe
  5. Use Alt-Space (which is what you just reset the hotkey combo to be)

No responses yet

Jul 11 2008

whew, finally something reasonable from the fcc

Published by jfrank under Uncategorized

“The Internet is based upon the idea that consumers can go anywhere they want and access any content they want,” Mr. Martin said. “When they show they are blocking access to some sort of content, they have the burden to show that what they are doing is reasonable.”

http://www.nytimes.com/2008/07/12/technology/12comcast.html?ref=technology

This is the latest good news in the net neutrality war since Google forced the telcos hand by bidding in a wireless spectrum auction. In so doing they enabled open access rules for devices that will use it.

No responses yet

May 01 2008

google charts is cool

Published by jfrank under resources

I picked three random names, three random numbers, and a random title to generate this chart.

Here is a breakdown of the url I used

http://chart.apis.google.com/chart

Chart Size
chs=375×175

Chart Title
chtt=Superdelegate+Endorsements

Chart Type
cht=p

Chart Data
chd=t:288,260,244

Chart Labels
chl=Uncommitted+(288)|Clinton+(260)|Obama+(244)

Color
chco=929AAF

Full url:
http://chart.apis.google.com/chart?chs=375×175&chtt=Superdelegate+Endorsements&cht=p&chd=t:288,260,244&chl=Uncommitted+(288)|Clinton+(260)|Obama+(244)&chco=929AAF

API:
http://code.google.com/apis/chart/

No responses yet

Apr 18 2008

adsense

Published by jfrank under setup

I wanted to try out AdSense, so I added it to my site. It was fairly painless, but I needed a clean way to integrate it with Word Press, so I went and looked for a plugin that deals with managing ads. There are many, and I found one, but I had to upgrade Word Press to the latest version in order to use the plugin.

Since it was so simple, I went ahead and added analytics too. It took about 5 minutes to add to my theme and that was that. Thanks Google.

Well it helps to have visitors too, after trying to convince barney to put ads on his site (which he declined), I am still left wondering a lot of things about it. Its more of an experiment right now than anything else. I’m wondering how much it would offset the bandwidth cost of an average blog. Like if someone was to get hits on a blog obviously factoring in images and other ‘heavy’ content, could the revenue from the Google ads offset or even overtake the cost of hosting?

One response so far

Apr 12 2008

lists

Published by jfrank under resources

I found an interesting site called maxmind while looking for a database of country information.

they have a simple iso list,

http://www.maxmind.com/app/iso3166

and a database of world cities

http://www.maxmind.com/app/worldcities

free.

No responses yet

Feb 11 2008

GSA Statistics python scripts

Published by jfrank under python

I have been tasked with upgrading Google search appliances and in doing so I wanted to calculate some statistics.

Comparing Crawled Pages Across GSA’s (or mini’s)

You could use this to compare any two url xml files from the Crawl Diagnostics –> Export All Pages To a File
I could have called them A and B, but I was comparing a mini and a gsa at the time, so the naming convention in the file goes. It uses simple python sets to see what is crawled in one machine, but not the other etc. Expects two local files, mini-urls.xml and gsa-urls.xml; either could be a gsa or mini export.

import xml.dom.minidom

def main():
    miniUrlSet = extractUrls(xml.dom.minidom.parse('mini-urls.xml'))
    gsaUrlSet = extractUrls(xml.dom.minidom.parse('gsa-urls.xml'))
    print 'mini', len(miniUrlSet)
    print 'gsa', len(gsaUrlSet)
    print 'intersections', len(miniUrlSet & gsaUrlSet)
    print 'mini is sub of gsa?', miniUrlSet <= gsaUrlSet
    gsaNotMini = gsaUrlSet - miniUrlSet
    print 'things in gsa but not mini:', len(gsaNotMini)
    for i in gsaNotMini:
        print i
    miniNotGsa = miniUrlSet - gsaUrlSet
    print 'things in mini but not gsa', len(miniNotGsa)
    for i in miniNotGsa:
        print i

def extractUrls(dom):
    nodelist = dom.getElementsByTagName("loc")
    urls = set()
    for node in nodelist:
        urls.add(node.firstChild.data) #i know all loc nodes have a single child text node, text nodes have a data property
    return urls

main()

Calculating Search Keywords Density Over Time

This is calculated against an export from the search logs feature under status and reports. You export the timeframe you want to compare over, and then run this against the log file. You get the top 100 keywords that people searched for, and the counts of how many times they were searched. Expects a local file log.log.

from datetime import datetime
from operator import itemgetter

def getQueryCounts(f):
       import re
       words = {}
       qReg = re.compile('.*?&q=(.*?)&')
       for l in f:
              keyword = qReg.findall(l)
              if(len(keyword) and len(keyword[0])):
                  words[keyword[0]] = words.get(keyword[0], 0) + 1
       return words

start = datetime.now()
f=open('log.log')
words = getQueryCounts(f)
f.close()
top = sorted(words.iteritems(),key=itemgetter(1),reverse=True)[:100]
print 'Top Words'
print '---------'
for word, num in top:
       print word, num
print 'runtime:', datetime.now() - start
raw_input("press enter")

No responses yet

Dec 20 2007

python. (not ruby)

Published by jfrank under python

I finally got shared folders up and running on my virtual fedora box. This required a little kernel/kernel headers upgrading, and compiling the vmware tools for my box, but it works like a charm. It even gives me cut and paste to the win xp desktop, which is… cool i guess.

I decided to go with python, which has a plethora of tools. Pylons is a piecemeal web framework that is closest to my liking, migrate is a library for schema migration, which works nicely with sqlalchemy, a monster orm.

sqlalchemy is cool because you can use parts of it totally independently. Coming from a CF background I am used to having nice named/pooled connections that I don’t have to think about. The base layer of sqlalchemy is that, a database type abstraction and pooling. Then you are free to go crazy with ORMish things or not, its up to you.

It is so reusable many people have written layers on top of it for even more magical coding… but its nice to have all the options.

Migrate, a RoR knockoff is the real find though, it looks young (as far as a project goes) but I watched a demo of it used in another python framework and it was exactly as I expected, like something we use at work for CF.  It has a schema version table, that holds app state version, and version files with ‘up/down’ methods. My main issue with many of these ’scafolmagic’ things is that no one bothered to mention how you get from one version to the next… or back again. You can’t build the model right the first time, and iterative programming is a fact of life. This library addresses that.

No responses yet

Dec 19 2007

cf admin api

Published by jfrank under coldfusion

Cookie name “CFAUTHORIZATION_SPLAT SPLAT” is a reserved token
The error occurred in administrator.cfc: line 116

Today I ran into a weird bug in the cf admin api, if you attempt to perform a login such as this:

<cfscript>
loggedin = createObject(”component”,”cfide.adminapi.administrator”).login(’dsafdsafsad’);
</cfscript>

It will bomb with the above error if your application name contains a space, the error is slightly different whether you use Application.cfc or <cfapplication> style.

The fix, thanks to Barney is to remove the space.

No responses yet

Dec 15 2007

virtualization

Published by jfrank under setup

I am using a virtual linux server via free vmware player on my development box, which is winxp. I found several groups who produce free stock distributions packaged in virtual machine format, which means I can run on literally the same stack as my real server locally.

I haven’t got there quite yet, but I intend to use a windows eclipse ide mapped into the virtual box via shared folders.

The subversion usage up to this point has left me with simple tasks to sync the two server’s configurations.

next up…. python or ruby

No responses yet

Next »