March 12, 2010

Pages


Search Site


Subscribe

...to receive future posts via email.

Topics



Archives

Entries for month: May 2009

What Twitter Clients Actually Need

May 28 2009 by Adam

I'm a big fan of Twitter clients that allow grouping your followee's into groups. Tweetdeck was probably one of the first to do this, and it was a big step forward. Lately, I've been using Nambu and Seesmic Desktop on the desktop (which I feel are about on par with — or slightly better than — Tweetdeck feature-wise, but more importantly: not ugly), and Nambu and BrightKite on my iPhone. BrightKite's auto-post to twitter and built-in image posting (and hosting) makes sites like TwitPic and Posterous seem very kludgy, and I'm happy to be done with them.

It always seems like the latest & greatest twitter client comes along and makes switching seem worth it, so we all switch. That's great. But now, with the advent of grouping, we've run into a problem. Every time I switch clients, I need to re-enter all of my groups, and so far, nobody has found a way to make doing that quick and easy.

Tweetdeck was probably the best and fastest way for creating groups from scratch, with a long list of checkboxes for everyone you follow. That can get a little bit cumbersome when you follow several hundred people, but worse: the list doesn't seem to update often, and it's not really known when that cache updates, or how to force an update, if you even can.

Nambu has a nice dialog for creating and editing groups — when it doesn't cause the client to crash — but it's about this big —> <— (tiny!) and that makes going through a list of 200+ people a royal pain in the ass.

Seesmic Desktop requires you to see the person's tweet in order to add them to a group. You can search for the person's username, but that counts as an API request, so you're limited to a certain number of those per hour, and you share that request pool with updates, so it isn't ideal. And trying to find a single tweet in the "Home" column — which shows several hundred of them — is like trying to find a needle in a hay stack. Worse yet, some people just don't tweet that often, so not only do you have to find that needle, you have to be searching while it's still in the haystack. I like the interface for adding users to groups after the group is already established, but this is far from ideal for creating new groups.

Something I wish all clients had, and I've voiced this on many occasions in the various feedback forums the clients have, is a special group that shows tweets by people that you don't have assigned to any groups. That would make any of these interfaces much more usable, in my opinion, since it's the catch-all bin for anyone that slips through the cracks.

I used a great web-based client, KinkyTwits, that basically accomplished this by allowing you to set an option so that users from groups were not displayed in the Home list. Actually I really loved this client, but it still has some bugs that are show-stoppers. I hear Ben has been thinking about updating it or rewriting it altogether, but haven't seen anything about it in a while.

As much as I would love to see that feature get implemented and become popular, that's not my biggest concern. Switching clients is a hassle. Any time I switch, it takes at least a few hours to get my groups set back up. This is not a unique problem. Think about RSS and having to switch RSS reader applications for one reason or another. Any RSS reader worth its salt can read and write OPML files, which are the standard format for sharing a list of RSS/ATOM feeds.

We need that. We need some sort of standard to develop for storing groups of twitter names. It's really rather simple, and could be represented very easily in XML. If clients started supporting the import and export of these files, trying a new client out could be so much simpler.

Here's just a sample of what I have in mind:

There are so many different ways to skin this cat, but I hope that someone, somewhere, starts this trend, and it catches on. I think it's desperately needed, considering how often a better twitter client surfaces that makes switching worthwhile.

Posted in Twitter | 0 comments

Come see Mark Drew at the next Philly CFUG Meeting!

May 26 2009 by Adam

I just wanted to remind you of the upcoming Philly CFUG meeting, this Thursday, 5/28 from 6:00-7:30.

Mark Drew will be presenting on the ColdSpring framework (used for Inversion of Control, specifically Dependency Injection, as well as Aspect Oriented Programming). If you're at all interested in Object-Oriented Programming in ColdFusion, or have been thinking about learning ColdSpring, I highly recommend this presentation. Mark makes it easy to get started, and shows just how powerful ColdSpring can be.

The meeting is at Wharton's Jon M. Huntsman Hall, room F90, conveniently located near the 37th Street trolley stop, and rumor has it there will be punch and pie.

You can find more information on the Philly CFUG site on Adobe Groups.

See you there!

Posted in CFUG | ColdFusion | Philadelphia | 0 comments

Debug or Bust

May 19 2009 by Adam

"At this point, I attempted to binary search the thread contents in the same manner as before, hoping to find something in there that caused the error. No luck. In fact, things only got weirder. I would comment out random blocks here and there – all the queries, all custom tag calls, etc. – and sometimes it would work, sometimes it wouldn't. I thought maybe I had been awake too long and called it a night, hoping that I could see something new with fresh eyes in the morning."

From my article, Debug or Bust, now available on the FusionAuthority website.

Posted in ColdFusion | 0 comments

Now Soliciting Your Subversion Horror Stories And Worst Practices

May 11 2009 by Adam

I'm giving a presentation at the end of the month on Subversion for my office. It's going to be recorded and I'll be sure to post the video here for anyone interested in watching.

Here's where I need your help: What are some of the craziest, dumbest, most ridiculous things you've ever seen done in Subversion (or some other version control system, as long as the scenario would still apply)?

Anything is fair game. Awful commit comments? Terrible branching or merging practices? I want to hear about it all, and I welcome your comments!

Posted in Subversion | Best Practices | 1 comments

How To Make A Trillion Dollars (or more)

May 01 2009 by Adam

Last week, Ray released a game he wrote using ColdFusion, BlazeDS, Flex, and AIR. It's a simple yet addictive stock trading game, where each player starts with a million dollars and has 11 different made-up stocks to choose from.

Since Ray released the source of the game earlier this week, we can now look into the specifics of how it works. Some of this was common knowledge before the source was released, but it doesn't make much sense to describe it all separately, so I'm just combining it. The stock prices change every other minute, and are affected by two random factors: whether to raise or lower the price, and by how much. There is a 60% chance the price will go up, and a 40% chance it will go down; but the price stays between a pre-defined maximum and minimum per-stock. Some have much higher margins than others.

Before the source was released, some people quickly realized there was more going on than met the eye (quite literally… the interface was a little too simple, but hey… it was just a proof of concept, what do you want?), and asked for a feed that provided a snapshot of the current prices. Ray obliged and provided this RSS feed, and this page that shows peoples current cash holdings (note that it does not include any amount invested in stocks — initial or current value.)

As you might expect, having a feed of the current data leads to tracking the history of the data, which leads to inferring what the maximum and minimum values are, which leads to developing strategies for the best times to buy and sell. We now also know that with a 60% chance to increase in price, if already maxxed out, there's a good chance that a stock will stay maxxed out for a few consecutive periods, leaving plenty of opportunity to check in and sell for the best possible profit.

I certainly won't claim to be one of the first to figure these things out, but I also didn't let the information pass me by. Billie Blaze created a chart to show the values of all stocks for the last hour, and a tool to help you track what price you paid for your stocks, and based on the number of shares you purchased, the percentage and dollar-value increase or decrease in your investment in real-time. Similarly, this high/low tracker was developed. Personally, I started to believe Ray's comments that he might be tweaking the max/min values, and since the high/low tracker's developer (Sid) wasn't online at the time, I duplicated his work, with some changes of my own. Pretty soon, my desktop at home looked like this:

Screenshot Thumbnail (click for full size)

Armed with these tools, it's pretty easy to decide which stocks to invest in, and when to buy and sell. Personally, I focused my long-term efforts on "Grouple" and to a lesser extent, "Yamoo;" but when I was sitting around waiting for prices to change and had cash to spare, I would invest in anything that had bottomed out, because it can only go up, and there's money to be made. As you make more money, it becomes easier and easier to make more and more per investment.

Knowing that the Grouple minimum is $80, and the maximum is $280, you stand to earn $200 profit per-share owned, if you make a "perfect" investment (buy at absolute min, sell at absolute max). If this was your first investment, and you had $1 million to spend, that would get you 12,500 shares, for a total profit of $2.5 million. You can see how, once you start getting into the hundred-million-dollar to billion-dollar bankroll range, it is easy to make millions of dollars in profit when a stock goes up by 3 or 4 dollars. When it goes up by hundreds of dollars, you're making hundreds of millions.

If this wasn't easy enough for you — after all… it does require some level of patience and the willingness to spend some level of time at the computer waiting for the random numbers to swing in your favor — how do you think you might take it to the next level? For me — and I know I'm not alone in this — the next logical step was SMS alerts. And with most major cell phone providers offering an email to SMS gateway, it couldn't be easier.

Since I already had a scheduled job running to track the history of the prices, it was pretty simple to watch for some threshhold values and fire off an email when they were crossed. My original code was pretty simple, and I ended up getting about 100 SMS messages the first day I had it running. That was enough motivation to improve it, so what I'm about to share with you is the best I've done so far as far as these alerts go.

First, let's setup some configuration points.

Now, while we're tracking the feed data, check for potential alerts, and send them if necessary:

... select max(stockprice) as themax, min(stockprice) as themin from tblPrices where stockname = #stockprice# #stockprice#

Looking at this code now, I can see some obvious efficiency improvements to be made — less database hits and things like that, but it's fast enough and not causing any errors so I'm not going to worry about it right now.

First we grab the current prices, and loop over each one. For each stock, set some easy reference points to the name and current price, use a poorly named variable ("oneHrAgo") to store a timestamp indicating what the time was two hours ago (Can you guess how much time my tracker originally used?), and grab the lifetime max and min values for the current stock from the database. From there, I calculate what the range for my threshhold will be. I decided to go with 10% (application.blinkRange) of the difference between the max and min values. So set the alert threshholds, and start checking to see if we need to send any alerts.

Loop over stocks we care enough to alert over (application.alertStocks). If the current time is within alertable limits (for me, 9am—10pm), continue. For each, if the current stock from the feed is being watched, and if the stock price has crossed a threshhold, and the current alert would be opposite of what the last alert was (buy when last was sell, sell when last was buy), and it's been more than 30 minutes since the last alert was sent about this stock, then send the alert, and update the timestamp and type of the last alert to the current values.

With these rules in place, the SMS alerts have gone down to just 5-6 per day. I think I may shorten the duration or take it out altogether, because the alert-type toggle works well enough to keep from getting 20 SELL alerts in a row for the same stock when it never went down into buyable range.

I still haven't crossed the trillion-dollar threshhold, but I'm pretty satisfied having made it all the way up to 2nd place overall at one point, and still holding strong at 4th. When I do hit a trillion, I'll probably call that good enough and throw in the towel. This has been a really fun exercise in gaming the system within legal limits.

Posted in ColdFusion | 5 comments