BKWLD

Author Archive

Enhance screen sharing

By Robert on February 5, 2008 at 12:15 pm

I was looking for a way to get screen sharing to work better when people are looking at my screen. Because I have two monitors, one of which is really big, I was hoping there would be some way to only share one monitor. So far I haven’t found a solution (please tell me if you do), but I did find this article on other sharing enhancements.

131094-sharebar2.png

Changing keyboard shortcuts

By Robert on January 17, 2008 at 11:23 am

I’ve always wanted to change tabs in TextMate so it worked the same way as Safari. I found this post that explains how. But even more so, it got me remembering that System Pref. I’ve seen it in there but never used it. And it works great!

picture-1.png

iPhone 1.1.3 map triangulation things IS useful

By Robert on January 17, 2008 at 9:12 am

When I first saw the inaccuracy of the new maps triangulation feature I figured I’d never find much use for it. For instance, I couldn’t use it to get from my office home, since the range it gave for my office was so big. But yesterday it came handy a couple of times:

  • I was on the train on the way to Portland and was able to figure out where I was on the route
  • I was in Portland, which I don’t know super well, and was able to get the map centered in generally the right area, from which I was able to look for street signs.

Also, I noticed that if you use the triangulation twice in row, you’ll get different results. For instance, the error range was super huge one time, but I hit again and it narrowed down to only about a block size error range.

Straighten quotes in textmate

By Robert on December 27, 2007 at 3:41 pm

One thing I missed from BBedit was straightening quotes. Just found these great commands that do the same thing.

Custom components in AS3 = dead

By Robert on December 18, 2007 at 3:58 pm

I’m pretty sure that making custom components in AS3 is worthless now. It was already kinda shaky in flash 8 and the documentation lacking. Check out this example of where I’m running up against a wall:


package {

	//imports
	import flash.display.*;
	import flash.events.*;

	//class
	public class Module extends Sprite {

		//component property
		[Inspectable] public var label:String;

		//constructor
		public function Module() {
			trace(label);
			addEventListener(MouseEvent.ON_CLICK, clicked);
		}

		//click event
		private function clicked(e:MouseEvent) {
			trace(label);
		}
	}
}

In this example, you create a simple sprite (the shape of which isn’t set here) that has a label property that you should be able to edit in the authoring environment. After adding it as a component in the library and editing the “label” field in the component inspector, publish. The first trace, in the constructor, will output null. It’s not set yet. But once you click on it you see the label you’ve given it. So, it is storing the input from the component inspector. However, flash AS3 doesn’t seem to provide a “creationComplete” event like Flex does. So you can’t tell at what point your properties were set.

MySQl vol.2

By Robert on December 6, 2007 at 2:58 pm

Here’s some more mysql odds and ends I’ve been picking up:

  • MySIAM and no deletes: If you never delete rows from a mysiam table, mysql won’t lock the whole table when you do inserts. In other words, people can run selects on the table while an insert is happening. I’m build this application right now with a column name is_deleted that I set to “1″ where I would have deleted the row. Then all my SELECTS have to have a “is_deleted=’0′” in the WHERE. I wonder if complicating my WHERE actually adds more time than not deleting saves…
  • Joins: According to the High Performance MySQL book I’m reading, choosing the order to join table is “one of MySQL’s weakest skills.” Figuring out best to do the join can take longer than running the SELECT. Thus, I’m taking from this: keep JOINs to a minimum.
  • SQL_CALC_FOUND_ROWS: Apparently using FOUND_ROWS() can be slower than running a second, non LIMIT-ed SELECT when you are trying to find how many total rows match your query.

Gmail IMAP - Not there yet

By Robert on December 1, 2007 at 9:57 am

I was excited when Greg told me that Gmail had added IMAP support. I tried it out the other week and have since switched back to my old ways*. I had two main problems with it:

  1. I make extensive use of flagging in Mail.app and I use smart mailboxes that only show flagged items. When you flag something in a Gmail IMAP account, it flags it in 3 of the folders it creates: Inbox, Archive, and Starred. Because Mail.app treats each message in each folder uniquely, instead of seeing them as aliases of the same message, when I flag something it appears in my smart mailbox as 3 items. Lame.
  2. Your spam mailbox in Gmail gets treated as any old folder in Mail.app. Thus, my 5000+ unread spam emails appear as 5000 unread messages. I’m obsessive about getting my new mail icons down to 0, so it was a thorn in my side to see my spam treated this way.

With both of these issues, I could have “fixed” them in Mail.app if only it had better rules. I wish you could mark messages as read of apply rules to specific folders of an IMAP account or make combinations of AND and OR. Anyway, no Gmail IMAP for me yet.

*My “old way” is to have gmail forward all mail to a AOL free webmail account I setup for this purpose. They run IMAP as well. Then I have mail.app check the AOL mail, but use the Gmail SMTP for sending. Works pretty good. One note if you want to set this up yourself: it seems to me that AOL mail accounts you setup on their own only keep like 500 messages. But if you create an AIM account and then use it’s mail, there appears to be no restrictions. This is a theory I’ve formed based on my own experience, haven’t seen anything official about it.

Smarty

By Robert on November 27, 2007 at 9:13 am

I had started out building a new php project to have blocks of html code within class files that would do find and replace on the html, adding dynamic code where I had written special tags. Essentially, I had templates and PHP logic that powered them. In the course of researching something for this, I came across Smarty Templates. I’ve switched over to using this system to power the interaction between templates and logic on this project and I think I’ll be using it more in the future. It’s pretty dope. Fundamentally it defines special tags you instert into html and has a special class with methods designed to populate these tags. Here’s a little overview of some of the reasons I’ve decided to use them:

Reasons for Smarty:

  • Compiling of templates so that str_replace lag is removed (read: speed)
  • Caching of pages. This would be a way to reduce the amount of queries that are run (read: speed)
  • Full seperation between logic and code. The logic could be only in the engine while the templates follow the master, theme, client route.
  • Should allow custom templates to be a lot easier to make for noobs and may actually encourage more customization
  • Was created in like 2002 and continues to be updated even in the last week
  • Works in conjunction with popular php accelerators
  • Developed in part by php team

Some links I was looking at while researching it:

Anyway, it’s a cool system.

Leopard + mysql 2

By Robert on November 14, 2007 at 9:35 am

I installed Leopard on my work comp last night. Because I was scarred of php/mysql config from Mark’s post I ended up using Mamp. Just learned of it this morning and installed it, but it’s working pretty nice. One useful thing is it makes it really easy to change your apache directory, so you could test sites out as the root of the webserver without any host file / vhost shenanigans. Also, you can quickly switch between php 4 and 5. I wish it installed as a system pref instead of an app, but still, pretty rad.

Mamp

MySQL factoids vol.1

By Robert on November 13, 2007 at 7:58 am

I’m boning up on architecture design while I get ready for a big community site we’re making. I learned some new things about MySQL this morning (reading Ben’s “High Performance MySQL” book I thought would be useful to share:

  • MySQL will only ever use one index per table per query. Therefore if you have a query that has multiple columns it’s matching in it’s where statement, it only matters that one of them is indexed. And, if I’m correct, you’re better off having the column with the most diversity indexed.
  • This sort of follows from the previous, but this where multi column indexes come in handy. To use the book’s example, if you are always SELECTing based on last name and first name, if they are each separate indexes only one will be used. Thus, to fully optimize that SELECT, you’d want to have a multicolumn index over both of them
  • If you’re using a UNIQUE column just as a way to not allow duplicate entries in a table, it adds overhead. You may be better of checking for duplicates in your application before INSERTing. This may be an occasion to use InnoDB’s transactions too.
« Previous PageNext Page »