Thursday, November 19, 2009

Facebook badge test / cool hats etc

Wednesday, November 18, 2009

AIR / SQLite

A friend commented on how little documentation there is out there on AIR's built in database, SQLite. So here's my code example

Thursday, November 5, 2009

Gay marriage

A couple other friends have weighed in on this so I figured I'd throw in my take (inspired by Adam Carolla) :

Gay marriage - it's like this: I'm in Atlanta. I'm very aware of the Braves and the Hawks. I'm a fan of them; I love going to their games. Sports teams in any other city are really not on my radar. I don't boycott them, and I don't contact my congressman to prevent them from playing. Why? Because how, when and how well they play doesn't really affect me, personally, at all. I think the same is true of most people who want laws passed boycotting gay marriage- they don't want similar laws passed for sports teams in other cities- but they don't make this connection. It would be absurd for me to be morally against other sports teams, or other teams in general that don't affect me. Next time you're chatting with someone who is against gay marriage, ask them why they don't want legislation banning sports teams in other cities. Or if you are such a person, ask yourself that and please get right back to me.

Thursday, October 15, 2009

A couple random thoughts

1- Racecar drivers- are they required to wear seatbelts? I would think so. But suppose they weren't- would any of them choose not to wear their seatbelts? Considering how dangerous the sport is already, should they be allowed to make that choice in this hypothetical world? If not (for the driver's safety), then why are they allowed to race cars? Nevermind the excuse that they have to wear seatbelts to set a good example for the kids who watch- if that's the reason, then what kind of example does racing cars set? It's funny where people draw lines to rationalize what they love.

2- Suppose there is a land ruled by evil laws, and you have a good product to offer which, in its purest form, runs contrary to the evil laws, but can be watered down so as to not violate them. Is it more evil to go to the land and offer the watered down version, or not go there at all? Is either option not evil? I guess if you figure the good people ruled by the evil laws can find ways to get around the laws, then the best (least evil) thing is to do what Google does. The lesson they teach is: when confronted with an insurmountable monster, subvert with a smile rather than fight with pressure of absence. Is this a good lesson? That is, if confronted with something I don't like, something I figure I won't be able to change any other way as effectively, is this what I should do?
UPDATES:
According to this, Google would be out of China by 2010 April 10. Today is the 11th. Google is not out of China but google.cn is no longer serving censored results. Or any results. It's redirecting to uncensored Hong Kong. More info here, here, and here. It's a sticky situation, but again, probably the best way possible.

Monday, October 12, 2009

Note to self- I'm actually pretty cool

Going over my volunteer history, I stumbled upon this photo set from a few years back when Z & I worked on HabitatForHumanity. I forgot how hard I worked on that stuff; plus how it overlapped with my work with HandsOnAtlanta for the Katrina Evacuees. Not to mention my recent work with HoseaFeedTheHungry.

So kids, pay heed- volunteer work makes you feel proud in the future. (As opposed to mandatory altrusism, which is not as good.)

Friday, October 9, 2009

Photos from Japan

2008 September
===
UPDATE: 2011-07-21: Access to these photos is currently limited. If you want to see them, please contact me.
===











Lots more here

Iroha

Even the blooming flowers
Will eventually fade.
Even our world
Is not eternal.
The deep mountains of vanity-
Cross them today,
And superficial dreams
Shall no longer delude you.

Significance: This is the English translation of a Japanese syllabary pangram called the Iroha. It contains all the morae found in Japanese. It's similar to the English pangram "The quick brown fox jumps over the lazy dog." -- with one major difference: the Iroha is more efficient. It uses every kana only once, except one. The famous English pangram has 35 letters- 9 more than necessary to include all our letters.

Still, just as the ABC song is used for teaching the alphabet instead of the above English pangram, the Gojuon is used more than the Iroha.

It's probably just as well that we don't use "The quick brown fox jumps over the lazy dog." to teach our alphabet. Nevermind the ordering- that's only an excuse because it's what we're used to. The ABC song just makes learning about some arbitrary alphabetizing easier because of the lack of redundancy.

I suppose that's why the Gojuon is used more than the Iroha. Nevertheless, that shows an amazingly lower tolerance for redundancy than us. Consider this: there are other English pangrams but the above one is by far the most popular, probably due in part to its use of imagery. BUT what if another pangram were more popular, just as pronouncable, equally or more vivid, made just as much sense, and only repeated one letter? Wouldn't it be impossibly tempting to use that instead of the ABC song?
I think so. (At least then, "Twinkle Twinkle Little Star" wouldn't have to share its elegant melody.)

Note also that the Gojuon lists the morae in a phonetic order. Wouldn't it be great if our alphabet were so organized, possibly taking care of the ever-awkward "ellemminno" problem, like so:
AHJKRBCDEGPTVZFLMNSXIYOQUW
or if we want to keep a-z:
AHJKRFLMNSXIYOQUWBCDEGPTVZ

I can dream, can't I? Who knows- maybe one day people will look back at now and laugh at the stupid English teachers teaching the silly ABCs instead of the AHJs

Sunday, September 27, 2009

Where is Java Soundbank on Mac?

Google wasn't very helpful with this, so here you go google:
/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home/lib/audio/

That's where you put any alternative soundbanks from places like
this (which is a site with surprisingly little help for Mac developers)

And yes, it's almost 1AM, and I'm fiddling around with JFugue when I should maybe be sleeping.

Expression of gratitude is important

One teacher who had an enormous impact on my schooling is Professor Cynthia Johnston. She teaches Latin. She is a great teacher. Her creative idea of teaching with songs has made her lessons stick with me to this day. This made her a very good teacher. That, mixed with her professional patience, a friendly rapport and approachable demeanor made her great. All this is what I aspire to if and when I ever teach.

She only taught for a couple years while I was at Campbell High School; Georgia State University noticed how good she was and snatched her from us. I tried getting in touch with her last year to express my gratitude, but never got word back from Georgia State's foreign language department. If you or anyone you know has any information to her whereabouts, please pass along my sentiments.

Friday, September 11, 2009

Flex Popups with Effects

Whew, making popups have transition effects in Flex was harder than I thought it'd be.
Still, got it working.
Here's how you do it:
===
main.mxml:
<?xml version="1.0" encoding="utf-8"?>
<mx:application mx="http://www.adobe.com/2006/mxml" layout="absolute">

<mx:script>
<![CDATA[
import mx.managers.PopUpManager;
import mx.containers.TitleWindow;

public var swipe1:TitleWindow = new TitleWindow();
public var swipe2:TitleWindow = new TitleWindow();
public function popupClick():void{
var dialogClass:Class = Swipe2;
swipe2 = PopUpManager.createPopUp(this, dialogClass) as TitleWindow;
dialogClass = Swipe1;
swipe1 = PopUpManager.createPopUp(this, dialogClass) as TitleWindow;

}
]]>
</mx:Script>
<mx:button label="popup" click="popupClick()">
</mx:Application>

===
Swipe1.mxml:
<?xml version="1.0" encoding="utf-8"?>
<mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="400" height="300"
showCloseButton="true" close="handleClose(event)"
backgroundColor="green"
move="adjustForMove()">

<mx:script>
<![CDATA[
import mx.events.EffectEvent;
import mx.effects.WipeRight;
import mx.core.Application;
import mx.events.CloseEvent;
import mx.managers.PopUpManager;

private function adjustForMove():void{
this.x=Application.application.swipe2.x;
this.y=Application.application.swipe2.y;
}
private function transitionClick():void{
var wipeOut:WipeRight = new WipeRight();
wipeOut.showTarget = false;
wipeOut.target = this;//Application.application.swipe1;
wipeOut.addEventListener(EffectEvent.EFFECT_END,wipeEndHandler);
Application.application.swipe2.visible = true;
wipeOut.stop();
wipeOut.play()

}
private function wipeEndHandler(e:EffectEvent):void{
this.visible = false;
}
private function handleClose(event:CloseEvent):void{
Application.application.swipe2.handleClose(null);
PopUpManager.removePopUp(this);
}
]]>
</mx:Script>
<mx:button label="transition to 2" click="transitionClick()">
</mx:TitleWindow>

===
Swipe2.mxml:
<?xml version="1.0" encoding="utf-8"?>
<mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="400" height="300"
showCloseButton="true" close="handleClose(event)"
backgroundColor="red"
move="adjustForMove()">

<mx:script>
<![CDATA[
import mx.events.EffectEvent;
import mx.effects.WipeLeft;
import mx.core.Application;
import mx.events.CloseEvent;
import mx.managers.PopUpManager;

private function adjustForMove():void{
this.x=Application.application.swipe1.x;
this.y=Application.application.swipe1.y;

}
private function transitionClick():void{
var wipeOut:WipeLeft = new WipeLeft();
wipeOut.showTarget = false;
wipeOut.target = this;
wipeOut.addEventListener(EffectEvent.EFFECT_END,wipeEndHandler);
Application.application.swipe1.visible = true;
wipeOut.stop();
wipeOut.play()

}
private function wipeEndHandler(e:EffectEvent):void{
this.visible = false;
}
public function handleClose(event:CloseEvent):void{
PopUpManager.removePopUp(this);
}

]]>
</mx:Script>
<mx:button label="transition to 1" click="transitionClick()">
</mx:TitleWindow>

===

Let me know if you have any questions.

Wednesday, August 12, 2009

Free cat to a good home


Free cat, male, 10-14 years old, neutered, declawed (by previous owner), misty dark gray.

I hate to have to give him away, but I'm unemployed and can no longer afford to feed him.

His name is Moses.
Please be good to him.
He's a good cat.

Includes litter box, cat carrier, a little catnip, cat litter, and food.



Friday, August 7, 2009

Death to cable internet monopolies

Clear.com: This is the market at work, and it is a beautiful thing.
Seriously, clear.com, thank you.

For far too long I was trapped into Charter's uncompetitive pricing, unreliable connectivity and craptacular customer service. Why? I don't recall exactly how they phrased it, but I think it was something along the lines of "Because we're the only game in town, so screw you, that's why."

No more.

IF you've already switched FROM whatever local cable company has you locked in for internet providing TO clear.com, rock on.
If not, good, today is your lucky day.
You can switch to clear.com's wifi internet - no need for a phone line or frigging coax drilling holes in your house every time you reestablish service.
You just plug in their wifi modem and away you go (provided you're in one of the cities they're in, like Atlanta, Las Vegas or Portland. Also maybe in Texas, Idaho and Washington).
It is so sweet. I'm happy with it, and not just because they're not Charter.
AND with my referral code - r74fy5 - you get 10$ worth of music downloads. (And I get something too- of course I'm not posting this for free.)
Enjoy!

Monday, July 20, 2009

Notary Public

Any document notarized.
1st page: $5; each additional page: $1.
We'll come to you - very reasonable travel fee.

7 days a week, flexible hours.

All emails answered promptly.

Contact us for an appointment today.

Monday, June 29, 2009

For a friend

Two non-programming posts in one day?!
Yeah, but it's for a good cause:
A friend is in need of $ to make rent by Friday.
Click here to go the donate button.
Thanks!

Let's get political in here

HR 2454
This bill taxes energy companies, and that tax will be passed down to the people who pay those energy bills- like me. Friday last week, it was voted on by the House; it passed by 7 votes. No one has read the bill in its entirety - 1201 pages, 300 added on overnight in closed door meetings with who knows what lobbyists. Does that seem right to you?

Up next, a health care bill. Whether you're for or against it, I think you'll agree this is an issue important enough for congress to read the bill before they vote on it. It's too important for them not to.

Thursday, April 30, 2009

Default database in SQLServer

For future reference, to set the default database in SQLServer (so when you open the app, login, and click New Query, you won't have to specify the database to run against everytime), go to under the database you've connected to:

Security, Logins, & foreach the user you want this to apply to:

right click the user, Properties, & under the General tab you'll find the Default database drop-down.

Easy, huh?

Tuesday, April 28, 2009

Hey!, these are neat

Something I know a great deal about:
Outsighter podcast, available on Lexy

Something I just came across today, might be cool:
Haxe ("Hex")

Flex Builder for Linux

Thus sayeth John Mason:
Adobe is uncertain about developing Flex Builder for Linux. Apparently the flood of developers leaving Windows for Mac and Linux isn't enough of a wake up call.

Please vote and comment on this. It's pretty important. Frankly I'm surprise it came up given the direction they are going with the SDK, BlazeDS and AIR.

http://bugs.adobe.com/jira/browse/FB-19053

Monday, February 16, 2009

Extending TreeItemRenderer in Flex 3

Hat tip to Mac Martine for his post on how to do this in Flex 2.
Tried posting to his blog with my improvements for Flex 3. Alas, 500 server error.

===
package
{
import mx.controls.Image;
import mx.controls.Tree;
import mx.controls.treeClasses.*;

public class MyTreeItemRenderer extends TreeItemRenderer
{
// myImage: holds the image we are adding to the tree nodes
protected var myImage:Image;

// set image properties
private var imageWidth:Number = 30;
private var imageHeight:Number = 20;

// the image to be placed in branch nodes
private var branchImage:String = "data/branch.gif";
private var leafImage:String = "data/leaf.gif";


public function MyTreeItemRenderer()
{
super();
}

override protected function createChildren():void
{
// create a new image() to hold the image we'll add to the tree item
myImage = new Image();

myImage.width = imageWidth;
myImage.height = imageHeight;
myImage.setStyle( "verticalAlign", "middle" );

// and apply it to the tree item
addChild(myImage);

super.createChildren();
}

override public function set data(value:Object):void
{
super.data = value;

// get the tree that owns us
var _tree:Tree = Tree(this.parent.parent);

// if the current node is a branch node
if(TreeListData(super.listData).hasChildren)
{
// we don't want to show the default branch icons, let's empty them
_tree.setStyle("folderClosedIcon", null);
_tree.setStyle("folderOpenIcon", null);
}
else
{
// if we are in here, then the current node is a leaf node
// we don't want to show the default leaf icons, let's empty them
_tree.setStyle("defaultLeafIcon", null);
}
}

override protected function updateDisplayList(unscaledWidth:Number,
unscaledHeight:Number):void
{
super.updateDisplayList(unscaledWidth, unscaledHeight);
if(super.data)
{
// if the current node is a branch
if(TreeListData(super.listData).hasChildren)
{
// get the current node and it's children as XMLList
//var currentNodeXMLList:XMLList = new XMLList(TreeListData(super.listData).item);

// get the number of children under the current node
//var numOfImmediateChildren:int = currentNodeXMLList[0].children().length();

// set the image to be displayed in the branches
myImage.source = branchImage;

// set the label text
// super.label.text = TreeListData(super.listData).label.text + "(" + numOfImmediateChildren + ")";

} else {
// if we are in here, then the current node is a leaf node
myImage.source = leafImage;
}
// reset the position of the image to be before the label
myImage.x = super.label.x;

// reset the position of the label to be after the image, plus give it a margin
super.label.x = myImage.x + imageWidth;
}
}
}
}

Monday, January 19, 2009

Resize + percentHeight = wacky

Code:

<?xml version="1.0" encoding="utf-8"?>
<mx:application mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:script>
<![CDATA[

//these don't work with resize effect
private function a1():void{
b.percentHeight = 20;
a.percentHeight = 80;
}
private function b1():void{
a.percentHeight = 20;
b.percentHeight = 80;
}
//these DO work with resize effect
private function a2():void{
b.height = v.height * 0.2;
a.height = v.height * 0.8;
}
private function b2():void{
a.height = v.height * 0.2;
b.height = v.height * 0.8;
}
]]>
</mx:Script>
<mx:resize id="resize">

<!--
Run as is, with click functions a1 and b1, to see what goes wrong with resizing with a Resize object and percent heights.
(It's a doozy.)
Then change click functions to a2 and b2 to see how it is done right (rightly?).
Note, a1 and b1 work just fine if no Resize object is used.
-->
<mx:vdividedbox width="100%" height="100%" id="v">
<mx:panel id="a" title="A" width="100%" height="100%" backgroundcolor="#FFFFCC" resizeeffect="{resize}">
<mx:button click="a1()" label="Make A bigger">
</mx:Panel>

<mx:panel id="b" title="B" width="100%" height="100%" backgroundcolor="#99CCFF" resizeeffect="{resize}">
<mx:button click="b1()" label="Make B bigger">
</mx:Panel>
</mx:VDividedBox>

</mx:Application>

Tuesday, January 6, 2009

Little nugget

From the funny Onion News Video post today:

Congress approves Intellectual Stimulus Package giving every American a graduate degree. Debate and analysis next "In the Know" 9-10 PM ET Wednesday

Monday, January 5, 2009

My first blog post

This is my first blog post. Cool.