Archive for the ‘programming’ Category.

West Valley College Cocoa class fall 2008

The cocoa programming class at West Valley College has returned. Sign up now.

http://westvalley.edu/documents/catalog/2008-2009_WVC_Catalog.pdf

“Page 62″

CIS 37.6 COCOA APPLICATION
PROGRAMMING
3 units
Co requisite: CIS 97.1A
Acceptable for credit: California State University
Programming Apple OS applications in Cocoa is
explored in this course. Using an object-oriented
paradigm, Cocoa builds graphical-user-interface
applications to run within the Apple Macintosh
operating system. Cocoa relies upon object-ori-
ented concepts: Objects, Classes, Methods, and
Messages as well as the collection of classes
called Frameworks. Students in this class begin
their work on simple applications and, by adding
features and re
inements create more advanced
applications. Credit/No Credit Option

The specific class you want to search for is:

CIS*37.6*63169

There’s probably a lab course you will be compelled to sign up for. Last semester it was:

CIS*97.1A*67759

I don’t know if that last part of the course is correct because I can’t register quite yet. If you took the class already, you may need to have Pat Fenton intervene on your behalf with admissions (like me)… Hope to see you there!

Technorati Tags: , , , ,


RSS feed parsing with PHP

Did I mention SimplePie yet? http://simplepie.org/ Holy cow, if you’ve ever used Magpie RSS, and are looking for a more robust solution, check out SimplePie. It’s a great PHP library that parses RSS or Atom.

Technorati Tags: , , , ,


Hacking Santa Snaps

Cocoa Duel had a great holiday themed coding competition. One of the entries was Santa Snaps. Santa Snaps lets you take your camera’s input and overlay some holiday themed graphics like a santa hat or reindeer antlers. We all had a fun time at our house playing around with it before xmas, but I started thinking about how cool this would be for our upcoming “Party 2-007″ james bond themed party. I’m very grateful that John Casasanta decided to upload the source for Santa Snaps because even a newbie obj-c hacker like myself had a fairly easy time of locating the things I needed to in order to change the graphics to more bond-appropriate ones. You can too, check it out:

download the source here: http://macheist.com/SantaSnaps/SantaSnapsProject.zip, unzip it, and open it up in Xcode.

Finderscreensnapz002

This one.. “SantaSnaps.xcodeproj”. If you have Xcode, you should be able to just double click the file.
Locate “Controller.m” in the classes folder as illustrated below….

Xcodescreensnapz009-1

See that there on line 26? @”santa hat”, @”santa glasses”, @”santa beard”, etc? This is the line you’re going to be changing.

Now, It doesn’t really matter how you generate your PNG files with their alpha channel in tact, as long as you do. I used to work for Adobe, so I use Photoshop. Take one of your photos that you took with SantaSnaps and open it up in whatever image editor you’re using. This will give you the frame size to use as well as a good indication as to where to place whatever new graphics you’re going to be placing. Then place your graphic where it should go, turn off the background layer, and save the file as a PNG file.
Photoshopscreensnapz001StevewithagrillPhotoshopscreensnapz003


Back to Xcode. In controller.m, on line 26, change the name of the first item @”Santa Hat” to @”whatever your file name was”. Drag your new PNG file into the “Resources” folder inside of the santasnaps xcode window. I’ve illustrated several changes that all happen the same way. Change each item in the “NSArray arrayWithObjects” list, and drag the actual graphic file into the resources folder. The order corresponds to the button order in the interface, so… keep that in mind.

Xcodescreensnapz008-1

At this point you could hit that “Build and Go” button and when you hit the santa hat icon in the application, your new graphic should show up.

Stevejaws2

This is the majority of the hard part. The other part is to edit the nib file, which in my opinion is much easier to do than digging through code. To replace the existing buttons with ones that match your new graphics, you’ll need two states for each new button you want to change. The selected state and the unselected state.
unselected
Grill Unselected


selected
Grill Selected

Find SantaSnaps.nib either in the project folder in Xcode or the finder and double click on it. It’ll look something like this:
Interface-Builderscreensnap

Drag your two button graphics, one at a time, into the nib file’s graphics tab. It’ll say something like “you want to add this to santasnaps project, yeah?” Yeah, you do. See below for “grill_selected” and “grill_unselected” :
Interface Builderscreensnapz004

and then drag and drop your unselected state graphic to the corresponding button you want to change, as seen in the upper left corner of this graphic:
Interface-Builderscreensna2

The last bit is to bring up the inspector palette and change the alt-icon state to the other graphic’s name. See below:
Interface-Buildersc3

see above… Icon: grill_unselected
alt. Icon: (change from “Santa Hat Button Pressed” to:) grill_selected

That’s it! Easy! :) Save the nib file and re-[build-and-go] from Xcode. Once you get the first one working, you’ll get into a regular rhythm for the other 8. Good luck! This is all I know, I don’t know anything else, I can’t help you any further. :)

Technorati Tags:


the love/hate relationship with sourceforge

Now, I love sourceforge, but it’s becoming my opinion that having actual files associated with a project should be a requirement for starting a project on sourceforge.

Technorati Tags:


xcode: tab through arguments for autocompleted calls

when in xcode, you can start typing just about anything and hit escape or f5 to get it to give you a list of suggested things to automatically complete what you started typing.

Xcodescreensnapz001

Once you select one of the items in the list, hit control-/ to go forward, control-shift-/ to go backwards through the list of arguments… handy!

Xcodescreensnapz002
Xcodescreensnapz003
Xcodescreensnapz004
Xcodescreensnapz005

Technorati Tags: , ,


MySQL : “how many records per day?”

I just figured out a cool MySQL trick. I’ve been stupidly doing a very large loop through each month and possible day of the month to query my table for a run-rate per day… as in, “how many records were recorded for each day the data has been accepting data?”… No more large number of queries to get this data, just one:

SELECT DISTINCT(date(your_date_field_name)) AS thedate, count( * ) AS count
FROM your_table_name
GROUP BY thedate
ORDER BY thedate ASC

Results look like this:

2006-10-02	25
2006-10-03	12
2006-10-04	31
2006-10-05	131
2006-10-06	31
2006-10-07	130
2006-10-08	102

which is perfect.

Technorati Tags:


Atom Bank Shot

Atom Bank Shot:

  1. I installed the experimental Atom Publishing Protocol Server in in my local Wordpress test install.
  2. Posted a entry using curl to talk to Wordpress.
  3. Used hAtom2Atom.xsl to grab the embedded hAtom from the Sandbox themed blog.
  4. Read the posted entry in NetNewsWire.

Round trip.

My colleague Bill is making progress publishing to Wordpress with the Atom protocol. Deeje, meet Bill.

Technorati Tags: ,


ternary operator

Something about ternary operators feels like cheating, but, I guess since it’s not just a weird syntactical anomaly with PHP, I should learn to love it. Ah, heuristic learning…

A ‘click’ Moment ?

My Colleague Bill says:

A ‘Click’ Moment :
Alex Iskold, who I’ll quote in full from the µFormats list:

I am fairly new to microformats. My initial reaction was why not describe the page data in XML first, then use XML to describe the presentation and then use XSLT to produce the actual HTML page.

I then realized that this approach does not solve a problem. In fact it misses the point of microformats, which is to embed the meta-data with the data, to make the data ’self-describing’ and to eliminate the need for additional query and parsing.

Using RDF does not bring anything new to the solution, in fact there maybe a lot of solutions to the format problem. For that reason the format that we choose should be as short as possible, so that we do not make the documents super verbose.

I spent, and sadly feel like I wasted, a couple of months trying to figure out how to bend microformat/structured blogging to meet the needs of archival fine art cataloging for my artwork. I was using an existing XML schema defined by a consortium, so it wasn’t like I was trying to poorly define my own data structure..

Part of the problem was the “why don’t you run your idea past us so we can tell you how it can be more like something someone else has already done” mentality… (it’s right there in their manifesto: “if you’re thinking of defining a new microformat: don’t.”) , another part was the newness and sparsely defined workflow of the structured blogging plugin for wordpress, and admittedly part of it was my lack of understanding of how XML works in conjunction of how microformats and structured blogging works. I got the feeling that it shouldn’t actually be me that has to bend to the will of system, but the other way around. In order for structured blogging and microformats to work, the system needs to bend to me. Otherwise, I just don’t see the benefit over being able to let my publishing package of choice interchange with other systems with RSS… try as you might to convince me, if it ain’t easy to use, it ain’t going to be in use.

Oh well.. maybe some day it will make sense again.

Steve Cooley at the Chabot Science and Space Center

I’ll be here on friday, May 26th… the Lunar Lounge Express on the invitation of Chachi Jones to demo the new visuals that I’ve been hammering on in Processing … this will be my first public performance in about 7 years. I’m getting psyched about it. I hope you can come out and see the show.

3d pixels from realtime video

Hey, this is a video of the code I wrote in processing to take realtime video and create 3d boxes with a height equalling the pixel’s brightness.

I originally had this posted on my blog, but then I had a server failure, so this is being reposted to try to unbreak the links people made to this page. :)

who loves you?

Help out Wordpress

Professionally, what am I?

I guess it depends on who you ask. To a designer or marketer, I’m a programmer. If you ask an application developer, I’m a “scripter”. If you ask some web technologist, I’m a programmer, and graphics people get lumped in with scripters. What? Wait, what scripts are people doing that aren’t programming anymore?

Technorati Tags: ,


AJAX

I found a place for AJAX at work!  It’s so rad! :D  It’s not in a customer-facing application, but where I was able to use it, it’s increased the speed of the app by about 300% or so.  I’d love to show you!  but, I probably shouldn’t.  You can ask me about it in general terms, though!

The application feels more like a desktop app now.. and a lot less like a web app.  This is very exciting stuff, I just needed to find a place for it.  Now I can see lots of other places for it. :)

Technorati Tags: