Archive for the ‘programming’ Category.

Tiger: Quartz Composer

Tiger: Free Real-Time Interactive Eye Candy Maker — Quartz Composer: “Joshua Ellis (zenarchery.com) writes us with an insanely cool discovery on the Mac OS X 10.4 developer DVD. I’m still waiting on my Tiger shipment, but this will definitely be on my install. Josh writes:

So I’m playing with the new Quartz Composer in OS X 10.4, which allows you to do weird sort of graphic installation-y stuff, plus design your own screensavers. It’s basically a drag-and-drop OpenGL composer, sort of like Max/MSP for making eye candy. You can load images or QuickTime movies and do real-time graphics processing on them.

In the list of controller tools? MIDI Clock, MIDI Controllers (aka pitch and mod wheel) and MIDI Notes. I haven’t gotten all my drivers updated yet, but it appears that this eye candy can be controlled via MIDI (in addition to the keyboard, an LFO, RSS feeds, the command line…pretty much anything). And you can write your eye candy out as an actual application. Which other people can download.

You have to install the XCode Tools to get this on Tiger, but they’re included free on the DVD. The app is called ‘Quartz Composer’. I think Macs may have just gotten a couple of hundred times more interesting.

Josh also tells us you can interactively map audio inputs to assign volume peak and spectrum to other controllers(!) While this is no substitute for Max/MSP and Jitter, for some visual fun and Swiss Army Knife-interactivity, looks like a must-install. Stay tuned..”

(Via createdigitalmusic.com.)

wow! WOW! wowowowow! Download an example I made. Here’s a small screen grab movie clip for those of you who aren’t on tiger yet. YEssss… here’s another. This is so much fun. What isn’t mentioned in the article is there’s drag and drop VIDEO support 3d transforms, Bonjour services, image getter, RSS feed support… IT’S OFF THE HOOK, PEOPLE!

update check out http://quartzcomps.com/ … thanks jono!

Share this:
Share this page via Email Share this page via Stumble Upon Share this page via Digg this Share this page via Facebook Share this page via Twitter

tiger day two

Will someone please write a hack so I can rotate my powerbook display and hold it like a book when I’m on the go? Lose quartz extreme acceleration? Fine. Second, will someone (probably you, same person writing this above hack) please add the ability to flip the screen backwards? This is for two things: one is the ever-increasing need for DIY teleprompters, and two, for DIY screen projectors. Trust me, You’ll be getting my $20 as soon as you write these.

Share this:
Share this page via Email Share this page via Stumble Upon Share this page via Digg this Share this page via Facebook Share this page via Twitter

automatically type PHP var_dump junk for debugging using applescript

ok, more grep fun, this time using an applescript that I did not originate. Man-o-man, I sure do type this a lot:

echo '<pre>'.var_dump($my_variable_here). '</pre>';

so, using the power of grep and now with someone’s great example apple script (sorry, i don’t know who you are), you can do this:


tell application "BBEdit"
activate
replace "^(.*)$" using "echo '<pre>'.var_dump(\1). '</pre>';" searching in selection of text window 1 options {search mode:grep, starting at top:false, wrap around:false, backwards:false, case sensitive:false, match words:false, extend selection:false}
set current glossary set to "HTML Glossary.html"
end tell

Now all I have to do is copy the variable to a new line, highlight it, and run the apple script. This is what you get:

$my_variable_here

turns into

echo '<pre>'.var_dump($my_variable_here). '</pre>';

Now I don’t have to manually type this over and over. Yay!

Update: I think I did originate that applescript after all. I think i just recorded it by starting recording and doing a grep search in BBEdit. Haha. God, I love the Mac and BBEdit.

Share this:
Share this page via Email Share this page via Stumble Upon Share this page via Digg this Share this page via Facebook Share this page via Twitter

BBEdit multifile search criteria to not search through backups

I love the multi-file search in bbedit. It’s extremely useful. The only problem is that it wants to search through every single file for a pattern match if you don’t tell it otherwise. Here’s a way to have it only search through your current files and not your backups.

set two criteria for the search:

1. File Ends with: “.php” (or whatever)

2. File does not match grep pattern:

 ^.*\([0123456789]+-[0123456789]+-[0123456789]+[]\)?-?[0123456789]+

Anything at the front of the file name, (^.*),
then a backslashed open parens ,( \( ),
then any number or numbers, ([0-9]+),
a literal dash, ( – ),
another number or numbers ( [0-9]+ ),
a literal dash, ( – ),
a backslashed close parens, ( \) ),
maybe another dash, or not, ( ?- ),
maybe another number or numbers, ( [0-9]+ )

Let me know if that helped, or if I messed up the syntax. I used txt2regex to get me started here… that’s a super useful tool. Thanks Tony N.!

Share this:
Share this page via Email Share this page via Stumble Upon Share this page via Digg this Share this page via Facebook Share this page via Twitter

dunce cap

I was looking for a photo of a dunce cap, because I’m resetting my stupidometer after a record of like 3000+ days of uptime on non-stupidity with regards to wires being properly connected where they’re supposed to in order to receive mail… <smacking forehead>

… and I came across this post including a priceless photo of a powerline pole that’s had it’s bottom 80% removed and the top 20% resuspended by a new pole. I think i just saw one of these in my neighborhood. I’m going to look for it tonight.

Share this:
Share this page via Email Share this page via Stumble Upon Share this page via Digg this Share this page via Facebook Share this page via Twitter

mysql subselect problem

What am I doing wrong here?

SQL-query : 

SELECT count( (

	SELECT DISTINCT institution_ID
	FROM `respondants`
	WHERE 1
) )
FROM respondants

MySQL said:
#1242 - Subquery returns more than 1 row 

Right, that’s the point. I want to get a list of the count for each distinct institution ID. What am i supposed to do, short of doing this in php, which I already know how to do… is there a way to do this using mysql syntax? This seems so simple. Ok, what about this?

SQL-query : 

SELECT count( institution_ID )
FROM respondants
WHERE institution_ID = (
	SELECT DISTINCT institution_ID
	FROM `respondants`
	WHERE 1 )
LIMIT 0 , 30

MySQL said:
#1242 - Subquery returns more than 1 row 

crap.

Update:Stephen Phillips enlightened me:

Give this a try:

SELECT 
	distinct institution_ID, 
	count(*) 
FROM 
	respondants 
GROUP BY 
	institution_ID 
ORDER BY 
	institution_ID ASC;
Share this:
Share this page via Email Share this page via Stumble Upon Share this page via Digg this Share this page via Facebook Share this page via Twitter

FPDI

FPDI is t3h l33333t!!1!1! :D :D:D

Share this:
Share this page via Email Share this page via Stumble Upon Share this page via Digg this Share this page via Facebook Share this page via Twitter

realtime view on grep text transformations

I would love to have a program that would let me see a realtime view of the results of a grep transform over CSV or tab delimited data. That would seriously rock. Like web-kit preview in BBEdit.

Share this:
Share this page via Email Share this page via Stumble Upon Share this page via Digg this Share this page via Facebook Share this page via Twitter

php tools to work with PDB files

Math art!


whee!!! While looking at the make blog article on the Pixel roller, I checked out Processing, which is a programming language for visual arts! I was telling Jono about it, when I noticed this:
Bluetooth PDA sync.. whoa, wait, that’s my treo. I can send control data from my treo via bluetooth and control art programs? *head explodes*

Share this:
Share this page via Email Share this page via Stumble Upon Share this page via Digg this Share this page via Facebook Share this page via Twitter

stevecooley on “rss subscribe to one page or post”

stevecooley on “rss subscribe to one page or post”: “

I just figured out that I can embed statistics dashboards into WP posts using PHPExec and EZStatic. This is great because I can point my internal clients to pages on my blog. When they want to see stats updates for their data, they can just go to a url on my work blog.

Now what would be super-l33t would be the ability to subscribe to single posts or pages so that when I pull the feed in my aggregator, the pie charts are all updated. The problem is that yes, I can do this, but eventually my posts will fall off the end of the feed.

Anyone got any ideas for a ‘rss subscribe to this post’ kind of function? Or how about ‘rss subscribe to this category’ ? then I can make a separate category for the programs I do stats for, and let my clients subscribe to their program category in their aggregator.

(Via WordPress Support Thread: rss subscribe to one page or post.)

then

stevecooley on “rss subscribe to one page or post”

Bahaha.. below: “RSS feed for this thread” .. Yeah! like that!

[WordPress Support Thread: rss subscribe to one page or post]

Share this:
Share this page via Email Share this page via Stumble Upon Share this page via Digg this Share this page via Facebook Share this page via Twitter

HOWTO de-apple-hater-Cory BoingBoing

HOWTO de-Xeni BoingBoing: “Xeni Jardin:
Jason Gill says,

Someone has posted a script for GreaseMonkey (a Firefox extension that lets you add your own Javascript code to any website, to remove ads or add features: Link) that automatically removes any post by Xeni when viewing BoingBoing.’

Link. Of course, if you’re not reading my posts you’re gonna miss this one. D’oh!

See also: Boing Boing Butler.”

(Via Boing Boing.)

The code seems simple enough. It should be capable of matching one or more criteria, shouldn’t it? If you match cory and apple, remove the post. Now, how do you do this for the feed? Maybe this is where your 2nd tier feed service comes in. Content filtering as a 2nd tier feed provider… Hmm… This guy wants to de-xeni boingboing, and as I’ve noted in the past Cory’s anti-apple diatribes are tiresome to me…

hey, I just realized.. this is exactly what I posted earlier!

“select * from boingboing where 1 and !(author == corydocotorow AND content LIKE “%apple%”);

Share this:
Share this page via Email Share this page via Stumble Upon Share this page via Digg this Share this page via Facebook Share this page via Twitter

The final Solution to spam..

The final Solution to spam..: ”
After compaining for so long about spam getting through via my @php.net mail address, the php.net mail admins have at least partially answered my prayers, this has started appearing in the headers.

X-Host-Fingerprint: 00.00.00.00 the.host.name Windows 2000 SP2+, XP SP1 (seldom 98 4.10.2222)

After a bit of investigation, it appears the very nice tool p0f is being used transparently to recognize the sending machine type. I spent a bit of time here playing with this, although not perfect (it cant recognize hosts behind a NAT box), It’s pretty darn good..

It does lead me onto the theory though

The real solution to spam is just to block all Windows boxes from public email servers….

Seriously, I cant imagine anyone dumb enough to have a public facing Windows box, sending email. And what the hell, they should have to pay a relaying fee if they need messages delivered (if they are dumb enough to pay for windows, they are sure dumb enough to pay for a relaying service..)

This solution is alot simpler and more reliable than SPF.. hell, lets fire up an RFC, and get this standard layed down for good.. (oops I forgot to patent it..)

(Via Planet PHP.)

hoooooboy, AMEN!

Share this:
Share this page via Email Share this page via Stumble Upon Share this page via Digg this Share this page via Facebook Share this page via Twitter

south bay PHP user group meeting?

Hey, check out this craig’s list posting! ;)

South Bay PHP user group meeting? (cupertino)
Reply to: phpug_cupertino@earthorbitdesign.com
Date: 2005-03-07, 11:53AM PST

Is anyone interested in gathering in Cupertino to talk about PHP/MySQL?

it’s NOT ok to contact this poster with services or other commercial interests
ok to transmit this posting into outer space

62701257

Share this:
Share this page via Email Share this page via Stumble Upon Share this page via Digg this Share this page via Facebook Share this page via Twitter

Jef Raskin

The Joy of Tech has a great panel on Jef Raskin. Thank you Jef.

Share this:
Share this page via Email Share this page via Stumble Upon Share this page via Digg this Share this page via Facebook Share this page via Twitter