Skip to main content.
February 25th, 2008

How to Add Bookmarklets to your iPhone

Build yourself a hyperlink out of some webpage with this URL http://soft-use.com/inst.html? followed by the code for the bookmarklet.

Here’s an example of how the begining of the new URL would look:
http://soft-use.com/inst.html?javascript:location.href=...

Click the link on from you iPhone, bookmark the resulting page, and then edit the URL in the new bookmark to erase everything before the “javascript:”.

This page has some handy, ready-to-bookmark bookmarklets for your iPhone.

Posted by Greg Pinero (Primary Searcher) as Other at 9:09 PM MST

Comments Off

February 22nd, 2008

Two Dimensional Discrete Cosine Transform (DCT-II) in Python

Here’s my first shot at implementing the 2D discrete cosine transform in Python. It seems to work, but let me know in the comments if it’s wrong, or if you know of any easy ways to speed it up.

import numpy
#shortcuts
from numpy import pi
from math import cos,sqrt

def two_dim_DCT(X):
    """2D Discrete Cosine Transform
    X should be square 2 dimensional array
    Trying to follow:
    http://en.wikipedia.org/wiki/Discrete_cosine_transform#Multidimensional_DCTs
    http://en.wikipedia.org/wiki/JPEG#Discrete_cosine_transform"""
    result=numpy.zeros(X.shape)
    N1,N2=X.shape
    def alpha(n):
        """Normalizing function, not sure if necessary"""
        if n==0:return 0.353553390593 #sqrt(1/8.)
        else:return .5 #sqrt(2/8.)
    for (k1,k2),_ in numpy.ndenumerate(X):
        sub_result=0.
        for n1 in range(N1):
            for n2 in range(N2):
                sub_result+=X[n1,n2] * cos((pi/N1)*(n1+.5)*k1)*cos((pi/N2)*(n2+.5)*k2)
        result[k1,k2]=alpha(k1)*alpha(k2)*sub_result
    return result

Posted by Greg Pinero (Primary Searcher) as Python at 9:24 PM MST

4 Comments »

February 20th, 2008

What is the Name for those Wavy Arm Dolls They have at Sales

What is the official term for these guys?

The kind people at Reddit suggest either Wacky waving inflatable arm flailing tubeman or Air Dancers

Posted by Greg Pinero (Primary Searcher) as Idle Curiosities at 7:30 PM MST

Comments Off

February 19th, 2008

How do I Find What Version of PIL I have?

In your Python session:

from PIL import Image
print Image.VERSION

Posted by Greg Pinero (Primary Searcher) as Python at 11:08 PM MST

Comments Off

February 18th, 2008

Mini Searches with Answers

These are links associated with recent searches I’ve done. They’re not difficult enough to warrant to their own posts but still super useful.

O’Reilly Network — Avoid Common Pitfalls in Greasemonkey
I have to INSIST you read ALL of this before making any GreaseMonkey scripts! I hit about all of these pitfalls in my first GM script, at a cost of maybe 30 minutes each! Do yourself a favor and read this first.

Simple command line file encryption in Linux
# brett@parasite:~$ echo "hello" > secret
# brett@parasite:~$ openssl enc -aes256 -base64 -in secret -out encryptedsecret
# (password)
# brett@parasite:~$ cat encryptedsecret
# U2FsdGVkX1/M0fRNElD9nXtNXv5qCqB5GY7dgV421Ws=

Maps/Speed Traps Mashup - Best One So Far
Combines Microsoft Live Maps and the ability to pinpoint and review speed traps anywhere. Membership is totally free. Speeding tickets are not. Future revisions of the site will allow for uploading to mobile GPS devices and GPS Enabled Phones.

PDFescape - Your Online PDF Reader, Editor, Form Filler, Form Designer, Solution
Finally a way to fill out PDF forms?

Table2Clipboard :: Firefox Add-ons
Copy tables on webpages and paste into things something that actually makes sense and looks like a table.

Hide an image in text on a website, to appear when you select it

Tags: , , , , , , , , , , , , , , , , , , , , , , , ,

Posted by Greg Pinero (Primary Searcher) as Uncategorized at 4:30 AM MST

Comments Off

« Previous Entries