Archive for Uncategorized
Sprint’s new “Simply ‘Almost’ Everything®” Plans
Posted by: | CommentsI got one of the Sprint SERO plans for $30/month a few years ago, and it has met all of my needs except my need for a cooler phone. You see, the “unlimited data” plan packaged with my SERO plan isn’t “unlimited” enough to handle the newer (Android) phones.
I would have to upgrade at least to the “Everything Data 450″ plan for $70/month, which includes fewer plan minutes than my current SERO plan. For the past year I’ve decided I could do without, especially if Sprint’s idea of an upgrade is fewer minutes for twice the price.
Since the 4G EVO was released last month my attitude had slowly been changing, and as I was upgrading my phone I noticed this little gem from Sprint’s site: “Because we’ve boosted your data experience with this phone’s amazing services and features, you’ll need our $10/mo. Premium Data add-on plus one of the plans below.” Link.
Of course the “plans listed below” are the variations of Sprint’s aforementioned “Simply Everything®” plans. It’s probably going to take me at least another year before I’m ready to pay extra for a data plan for my “unlimited data plan” plan. Of course by then, it’ll probably be another $10 for a data plan for my premium data plan for my unlimited data plan. It’s almost enough to make me ask myself what it is I keep holding out for with Sprint.
Adobe Stratus and Flash P2P
Posted by: | CommentsSean Murphy (my friend and fellow BYU-AUG member) just did a write up of some training he did last month for our user group. It’s an introduction to P2P with Flash+Stratus.
In my opinion, this is some really exciting technology as most communication of this sort (for Flash player) has to be routed through an intermediate server. Naturally there will still be cases where that makes the most sense, but for p2p apps (i.e. voice/video chat, p2p file transfer, etc) this is definitely a breath of fresh air.
I’ve been working on my own AIR chat application (previously implemented using polling channels on BlazeDS) which I may post more information about over the Christmas break. I’m converting it to use Stratus for real time P2P chatting. In the meantime if you’re interested in getting your feet wet with this, take a look at Sean’s write up: here.
He walks through a multi-user video conferencing app he built. The write up itself is still a work in progress (he’s cleaning up the source, and making a few other changes). He’s the kind of guy that appreciates feedback, so let him know what you think.
You might also want to register for your own Stratus beta dev key: here.
Virtual CloneDrive on Windows 7
Posted by: | CommentsI’ve been using Daemon Tools for as long as I can remember to mount ISO images on Windows. I think it’s an awesome program, I’m sure many would agree. I have no complaints other than the fact that I haven’t been able to get it to work on Windows 7.
I’ve started using SlySoft’s Virtual CloneDrive as my Daemon Tools replacement on Windows 7, and I have been very pleased with it. It’s available for download here.
They’ve also got a few non-freeware products available that I can’t vouch for, although Game Jakal sounds extremely handy. I might have to give that a try when I’ve got some time to game.
Single Threaded Server in C++
Posted by: | CommentsThe versatility of the client-server architecture has always fascinated me. You can write a server once, and plug in whatever protocol you happen to be implementing. The same goes for clients.
I’m going to present here a simple server I implemented in C++. I guess if I had to give a name to the protocol I implemented, I would call it the “Echo Protocol”. There’s only one part of the code I’m going to comment on specifically in this article, and that is the process() method.
There are ample sources on the web and otherwise explaining the use of the socket, bind, listen, and accept methods – which are the basis for socket communication in C and C++.
One book I would recommend for someone serious about network programming (though it hardly needs my recommendation) is UNIX Network Programming, Third Edition by W. Richard Stevens, Bill Fenner and Andrew Rudoff. If you do read this book, be aware that they use wrapper functions throughout the book (i.e. Bind(), Listen()) to add a measure of error checking (see section 1.4 for their explanation). The wrapper functions have the same signature as the corresponding BSD functions, just make them lowercase.
Here is the code for my process() method:
void process() {
// Read the request
//------------------
string request = "";
while(! isRequestDone(request) ) {
// Read from the client
//-----------------------------
char buf;
bzero(&buf, 1);
nread = recv(client_fd, &buf, 1, 0);
request += buf;
if (nread < 0) {
if (errno == EINTR)
continue;// Continue reading
else
break; // No more
}
else if (nread == 0) {
break; // Nothing left to read
}
}
// Do something with the request
//------------------------------
// Send the response:
//------------------------------
string response = request;
int num_b = response.length();
for (int i = 0; i < num_b; i++) {
char cur = response[i];
send(client_fd, &cur, 1, 0);
}
// Close the connection here
close(client_fd);
}
This method is where you would implement the protocol (be it HTTP, or what have you). A crucial step in any interesting protocol would be parsing out the request (something you might do where I have the comment “Do something with the request”) and using that information to construct the response. Sometimes the request parsing is handled while the request is being received. I wanted to keep this example simple (so you’ll also notice I’m receiving and sending only 1 byte at a time… which involves a lot of overhead and I wouldn’t recommend for high load servers sending and receiving larger messages). You could increase the number being read at a time by increasing the size of buf and/or cur.
You can download the complete code for this server here: C++ single threaded server
You can compile this code on Linux with the following command:
g++ -Wall -o bin/server single_threaded_server.cpp
Linux and Windows both use BSD sockets, but I haven’t tried compiling this code on Windows without using g++ on cygwin. You’re on your own there.
This post is part of a series, next I’m going to post a simple C++ client. Then I’m going to present a threaded server architecture, and finally I’m going to post a Flex chat client and implement a simple chat protocol. Stay tuned.
Data Model Injector (poke)
Posted by: | CommentsI needed to build a simple command line interpreter for an application I am building, well, I didn’t need to but I wanted something inconspicuous that the testers (and interaction designers) wouldn’t see and complain about. So I threw something together, it was fun.
Two basic operations I was constantly needing to do was to get a value and/or modify a value. I modified my peek method to return the object in question. And then I also wrote a poke method that allows me to set a value specified by a dot notation.
Here’s the code to the modified peek:
private function peek(prop : String) : * {
try {
var a : Array = prop.split('.');
var x : * = model;
for (var i : int = 0; i < a.length; i++) {
x = x[ a[i] ];
}
return x;
}
catch (error : Error) { return "undefined"; }
}
You can see it’s just a one line change from my previous implementation. And here is poke:
private function poke(prop : String, val : *) : void {
try {
var a : Array = prop.split('.');
var x : * = model;
for (var i : int = 0; i < a.length-1; i++) {
x = x[ a[i] ];
}
x[ a[a.length-1] ] = val;
}
catch (error : Error) { trace(error.message); }
}
In this method I had to iterate one less time to get the parent of the object I wanted to assign to. And then on the final line I manually grabbed it to perform the assignment.
My initial wrong assumption was that I could do this in my loop:
for (var i : int = 0; i < a.length; i++) {
x = x[ a[i] ];
}
x = val;
Take a look at it, or step through it in a debugger to see why that doesn’t work. It was pretty enlightening.
Uninstalling IE 8 on Windows Vista
Posted by: | CommentsI blindly clicked a link to upgrade to IE 8 this morning. Sadly it was my first Windows Vista experience all over again– seriously, I had some pretty terrifying flashbacks.
Needless to say I couldn’t stand using it for more than 3 hours. The uninstall process was non-obvious if you think of the browser as an “application,” like I do. If you think of it as part of the OS, like they must at Microsoft, the way is a little more clear.
Here’s how in case anyone else made the same mistake I did (i.e. installing IE 8).
1. Open the control panel.
2. Open “Programs and Features” from the control panel.
3. Click “View installed updates” in the left-hand navigation panel. (This was the trickiest part. I spent a while trying to find it among the other programs before realizing it wasn’t there and changing my approach).
4. If you have a lot of updates, it’s easier to use the “Search” box. Don’t type “IE” in the search box, though, spell it out “Internet Ex…”.
5. Select it, right-click and choose “Uninstall” (it should be the only option)
The rest of the uninstall process was pretty easy (the smoothest part of my IE 8 experience). It required a restart, but IE 7 was back when I logged in.
I might try installing it again later this year, if it’s strill as bad as it was today I might have to make a permanent switch to Firefox (which I’ve been resisting as much as possible).
Update: (4/2/2009) Apparently I overrated the uninstall procedure. For some reason my mouse cursor in IE is always the “grab” cursor. Which means I can’t select text (among other things). This was the straw that broke the camel’s back. I’ve changed my default browser to Firefox. All I can do now is hope that Firefox gets better.
Go Daddy Substrings
Posted by: | CommentsI just made an interesting (though unremarkable) discovery. If you check for a domain’s availability at GoDaddy.com, and the domain name you check contains the substring “godaddy” it will prompt you to “enter another domain name”.
Whatever domain name you try– also try it at another registrar and you will see that it’s probably available. I tried “GodAddYou.com” (which was available 15 minutes ago, according to Hostway).
Makes me wonder what other substrings they’re filtering, and what other registrars might be filtering.
Testing Out ScribeFire
Posted by: | CommentsI don’t generally use Firefox for my every day browsing, but I do like the plugins. I use the S3 Organizer, Elasticfox (formerly the EC2 plugin) and the SQLite manager plugins fairly regularly. In fact I generally only browse with Firefox in two circumstances, 1) if I’m testing an application I’m developing or 2) when I need to do a quick search while using one of the plugins. If Firefox was configured to run first and foremost as an application platform, and secondarily as a browser, I wouldn’t feel cheated.
Anyway, today I’m trying out ScribeFire, I’ve had it installed for some time but have never gotten around to using it. Configuring it for my blog was a simple 3 step process. And now I’m going to test publishing. If I have any problems, I’ll write about them. If not, then the post ends here.
MacBook Pro : Update
Posted by: | CommentsI’ve been using my new (used) MacBook Pro for a week now, thought I’d post a quick report about it. The short summary is that it has replaced my old laptop for all the functions that I used my laptop for. In this respect it’s performance has been nearly flawless (more about that in a minute). Unfortunately I don’t think it will be replacing my desktop as my primary development machine anytime soon– which is OK. My original intention in getting a Mac wasn’t to “switch” (though I have to admit I was curious about whether it would happen or not).
Now for some of the issues I’ve encountered:
Running Windows on the Mac.
Despite what you’ll read on the VMWare Fusion 2 packaging, Windows is not “even better on the Mac”. Although the performance is considerably better than I’ve come to expect from other virtual machines, I still don’t get the same performance as I did on my old laptop as far as Windows is concerned. Running my compiler is noticably slower, checking my email in Outlook is about the same (I blame Outlook 2007, not Fusion, for this, though).
I was originally excited about the 3D support Fusion boasted, unfortunately the two games I’m into these days use OpenGL (which isn’t supported in Fusion) and not DirectX. Before anyone gloats because they recommended Parallels to me, which supports OpenGL, let me just say that gaming on a VM would be insane when I’ve got a perfectly good Windows PC.
I’ve got a lot of time invested into this, so I’ll probably stick with Fusion for the convenience of switching between Windows and Mac. I don’t think I’ll be using my Windows VM too much anyway, except when I’m on the road or at school. Or when I need to Recycle all of the Trash I have on my Mac…
Subversion Clients
I do 90% of my actual coding in Flex Builder these days, and fortunately for me Eclipse has a mature, feature rich Subversion plugin (Subclipse) I can use while I develop. I don’t use it very much when I develop on Windows because TortoiseSVN is better and I don’t have to get around the concept of “importing into a project” which Subclipse seems to want to force you to do. Unfortunately there’s nothing that really compares to TortoiseSVN for the Mac. The closest I’ve found is SCPlugin, which integrates into Finder, but it’s not nearly as mature as Tortoise. It’s a little odd, especially considering how many developers you see using Macs these days, hopefully the situation will improve in the near future.
Did the Definition of “Delete” Change?
Please, anyone… is there a key somewhere on the MacBook Pro keyboard that behaves exactly like the “Delete” button on a PC keyboard? (I mean besides the right-arrow/delete sequence).
It’s easier for me to criticize than to praise, but let me just say that my MacBook excels at being a Mac, no complaints there. I’m actually using iTunes again (which I haven’t for a long time because it used to suck so much resources on my previous PC). And as far as notebooks go, you’d be hard pressed to find a better looking one anywhere.
That’s my two cents.
Error #2044: Unhandled IOErrorEvent; text=Error #2038: File I/O Error.
Posted by: | CommentsI started this post a few months ago while I was working on an AIR application that uploads files to a remote server (by way of an upload script). I ran into this error, Error #2044: Unhandled IOErrorEvent; text=Error #2038: File I/O Error, which caused me considerable grief until I discovered the simple solution. I got the same error in an application I was working on today, and so decided to finish this post.
I looked up the problem when I first encountered it, and there seemed to be a consensus that the problem was due to using a bad URL for the location of the upload script. That was actually the case for me today, so I was able to fix it right away.
When I encountered the problem a few months ago, you could say that it was from using a bad URL, but it was much less obvious. I had written the upload script in ColdFusion, hosted on a CF server. I was certain that I had the URL typed correctly because I could access it in my browser. I discovered over an hour later that I had an authenticated session that allowed me to see it in the browser, a privilege not shared by the AIR app.
The problem was ultimately remedied by placing a special Application.cfc in the upload script’s directory that did away with the requirement for any session variables. This particular case may have been due to a combination of the CF server’s settings and the fact that I was using AIR, and not a Flex app that might have been served from the same server as the upload script.

