Jay Tuley

jay.tuley.name back online! by Jay

So my blog is back online finally, gave up on Typo and Rails. It was just too hard to keep running, so I’m back to good old PHP.

The blog software I chose to replace typo is Serendipity, mainly because it supports sqlite and since i was using sqilte with typo to make the migration easier.

The first hurdle faced was that php’s sqlite is sqlite version 2 instead of 3 and it’s hard to find a program that will version 2 let alone both, however looking through Serendipity’s source and found that it had sqlite3 support and googling a function call in that source let me to the php module used for sqlite3 support, php-sqlite3.

Unfortunately there isn’t a gentoo package for it, and I am not familar with php modules so it took a little bit of effort to get it installed, but i did.

Finally i used sqliteman to map the columns from the old blog engine to the new.

Here is the sql I used below.

Content:

INSERT INTO 
		s9y_entries
	SELECT
		contents.id as id,
		contents.title as title,
		STRFTIME('%25s',contents.published_at) AS timestamp,
		contents.body AS body,
		COUNT(feedback.type) AS comments,
		contents.extended AS extended,
		0 AS trackbacks,
		0 AS exflag,
		contents.author AS author,
		contents.user_id AS authorid,
		CASE
			WHEN contents.state='draft'
			THEN 'true' 
			ELSE 'false' 
			END AS isdraft,
		'true' AS allow_comments,
		STRFTIME('%25s',contents.updated_at) AS last_modified,
		'false' AS moderate_comments
	FROM
			contents
		LEFT JOIN
				feedback
			ON feedback.article_id = contents.id
	GROUP BY contents.id

Feedback:

INSERT INTO
		s9y_comments 
	SELECT
		id,
		article_id AS entry_id,
		0,
		STRFTIME('%25s',published_at) AS timestamp,
		title AS title,
		author AS author,
		email AS email,
		url AS url,
		ip AS ip,
		body AS body,
		"NORMAL" AS type,
		0 AS subscribed,
		"approved" AS status,
		null
	FROM
		feedback

Categories (note, I cheated on categories because i didn’t like how i did them originally and planned on manually tagging articles, so I made them all 0, i am not sure if that was necessary but i did it.):

INSERT INTO
		s9y_entrycat 
	SELECT 
		id,
		0 AS categoryid
	FROM
		contents
	WHERE
		state <> 'draft'

The last thing i did was permalinks, i was hoping if I did this i could map the old link scheme, however this didn’t work so I wouldn’t recommend doing this last sql command but I ran it so I’m posting it as well anyway.

INSERT INTO 
  s9y_permalinks(permalink,entry_id,type) 
 SELECT
  "articles/"
  ||strftime('%25Y/%25m/%25d',published_at)
  ||"/"
  ||trim(
    replace(
     replace(
      replace(
       replace(
        replace(
         replace(
          replace(
	      replace(
		  replace(
		   replace(
		    replace(
			replace(
			 replace(
			  replace(
			   replace(
                  lower(title)
				,' ','-')
			   ,',','-')
               ,'!','-')
              ,"'",'-')
             ,'/','-')
		  ,'?','-')
		,':','-')
        ,'(','-')
       ,')','-')
	 ,'"','-')
	,'>','-')
    ,'*','-')
   ,'----','-')
  ,'---','-')
,'--','-')
,'-')
    AS permalink,
  id,
  'entry' as type
   FROM contents
   WHERE state <> 'draft'

NicePlayer 0.96.X the Early Leopard by Jay

The First Release

So the first released was 0.96.0 in the wee hours of the A.M. of October 26th a last ditch effort to release something that actually worked on Leopard combined with a few bug fixes from 0.95 and some minor features I had started working on prior.

Version 0.96 (v543)
• Basic Leopard compatibility
• Progressive movie loading progress in scrubbing area
• Chapters expand in playlist drawer.
• New Playlist and Volume menus
• Fixed subtitle bugs involving parsing commas in SSA, and foreign encodings.
• Using Sparkle for future updates
• Fixed Transparency behavior in regards to correctly representing opacity and transparency

Something, I just found out is that, my pre-sparkle method of updating actually broke on Leopard so users didn’t get this update notification, however since 0.95 doesn’t work at all on Leopard, I’m sure such users have found the update since then who needed it, so it’s a good thing I’ve switched to sparkle on this release.

The Second Release

I got to fully test the sparkle update method by releasing, two weeks later, 0.96.1, which contained a few bugs that were introduced in 0.96.0’s haste (whoops), but also I got to try out some fun Leopard stuff.

Version 0.96.1 (v573)
• Fixed playlist delete bug – introduced 0.96.0
• Fixed playlist drag and drop bug – introduced 0.96.0
• Added Leopard Sized Icons
• Added Sparkle Preference Pane
• Fixed preference bug that ignored preference changes – introduced 0.96.0
• Code signed
• Resolution Independent GUI (Glitchy in Tiger, works pretty good in Leopard)
• New and Updated AppleScripts for the Script Menu

I added code signing as a build stage, however I haven’t figured out if being signed actually does anything. I thought it was supposed to reduce warning messages when downloading updates, however I tested downloading two copies of the same code signed NicePlayer and they both had the same warning dialog. Oh well. Sparkle updates don’t seem to cause warning messages, but i think that is not dependent on the code signing.

I also added new 512px icons, they are fun, the main app icon looks like glass in coverflow.

It’s great.

I updated quite a few of the default AppleScripts for the script menu. Since Leopard made setting the default dvd player scriptable, I’ve updated my script that previous did the same with laborious UI scripting (but still falls back for tiger). Also I’ve fixed the fullscreen behavior of the aspect ratio scripts so that by default they rescale to fit the screen after change the ratio. Finally, the most interesting to me of the default scripts changes, is that I added a pair of scripts to set the UI resolution for just NicePlayer. This means that if you want to set the scale of NicePlayers interface to 300%25 you can, with out using Quartz Debug and without effecting any other applications. The ideal usage of this feature in my mind is if you have a large screen and a wireless mouse and you want to control it from across the room. But I’m sure it helps with 30 inch screens upclose as well, I’m sure there are other uses, it’s always interesting to find out the creative things people use NicePlayer for.

Here is a picture at 300%25, although it’s on my macbook so screen the size isn’t large enough to contain the menus but you get the idea.

I’m very excited to get resolution independence working on NicePlayer, it’s something I tried to do on Tiger but I wasn’t having success, but with the new Leopard docs I finally figured it out. Although the changes I made work for resolution independence on Tiger, there are some weird glitchy bugs in windowing behavior such that I don’t recommend using it on Tiger.

The Third Release?

So there appear to be two significant bugs in 0.96 that have been reported. The first is that NicePlayer and Leopard Spaces aren’t friends, I have some ideas of where to look to figure out what is going on, so I’m hopeful, and if i do figure out I’ll just release another small update 0.96.3 rather than waiting for 0.97. The other bug I’d like to fix, but It’s only been reported twice and I can’t reproduce it, is that on Tiger some people have reported that the Volume icon shows up over the video and stays there on open and doesn’t disapear, since I can’t reproduced it, even though I have a Tiger install, it makes it kind of difficult. So if anyone has any clues to reproducing it, send preferences files or whatever, I’d appreciate it.

> cd to ... version 2.1.1 (just a little update) by Jay

So 2.1.1 fixes a bug when you have an apostrophe in the path for Terminal.app and iTerm plugins. Just a little shell script whoops. Therfore I recommend updating.

Also, for 2.1.1, a big thanks to Brian Koponen who contributed a plugin that enables support for PathFinder. So now “>cd to …” can work exactly like “Reveal in PathFinder”,which is an applescript that is bundled with pathfinder but obvoiusly “>cd to” is a TON faster.

update: Little bug in the build, the info plist didn’t have the excutable name macro replaced, which made launch services upset, and wasn’t noticeable from the Xcode since it would launch from the actual executable rather than the bundle. There is a new build out now.

> cd to ... version 2.1 (so soon?) by Jay

So I had a few requests for iTerm support, one request for xterm support, and one request for glterm support. And I thought about it, it would probably be easy, but I didn’t want to add preferences to my little one click mini application—it’s a little gratuitous. I also didn’t want to make a bunch of versions of the same program. However…

I then remembered there is a user interface in the get info window for enabling & disabling plugins inside a app package. So I thought it would be fun to create a use case in which someone actually would have a need to utilize this user interface in addition to fixing my issues with adding this features.

I created a very simple plugin interface, and “>cd to…” only checks the built in plugin folder (as that is the only directory that get info deals with — it also means that duplicate copies can have different behaviors enabled). So to get support for iterm or xterm you just have to enable the correct plugin while disabling the others (FYI though, if you have more than one plugin enabled it will open windows in each enabled plugin)

GLterm doesn’t look supportable for any automated directory change, at least as far as I can tell, so that’s why I only added xterm and iterm support.

Another small detail to note, about my xterm/X11 plugin, is that the script to launch the terminal is inside the X11_xterm.bundle’s resource folder. So you can add xterm flags or even change the X11 terminal without recompiling.

v 2.1

  • Plugin archtexture allowing support for other terminals
  • Default plugins for iTerm & X11/xterm
  • Terminal plugin will try to avoid opening two windows on terminal.app’s launch

> cd to ... version 2.0 (ported to objective-c) by Jay

So I had this applescript, I wrote a long time ago, that i used for open a terminal window from the finder. It was a compiled applet that you could launch from the finder toolbar. The biggest problem (especially on my intel laptop) is that it’s kind of slow to launch before it executes.

We’ll now with version 2.0, it is super fast, because it’s been ported to objective-c and sends apple-events by utilizing the appscript bridge on macforge by HAS.

I have a compiled universal binary and source of this application on google code it’s MIT licensed, just to keep things simpler since the appscript framework is MIT licensed, and my code is less than 20 lines so I’m not concerned that it’s not a copyleft licensed.