Blog

  • Spam Costing Companies $22 Billion

    Survey says. While I much enjoy anything that points out the problems with spam in our daily lives, something irked me about the validity of this survey at CNN. Phone interviews? While I trust my instincts, I highly doubt my spam number reporting would be accurate, not just based on my subjectivity of wearing out my delete key hourly.

    I didn’t dig the productivity slant either in terms of how much weight. Companies are concerned about producitivity, yes, and hopefully too the powers that be to hopefully instantiate change, but how many things can you name that “affect” productivity? I can name a ton, but because of thier long standing integration compared to the relatively new influx of email spam, they become more Dilbert’ish and fall below the harsh radar. I guess something press wise needs to fall above, duh, but it just seems that there are a lot of things that do the same thing; negatively detract from our productivity.

    And where does that $22 billion go? Unfortunately, a small portion of the spam is responded too, enough so to continue to show enough return in revenue, and validate its continued use… but where does the rest of the $21,120,000,000 billion go of the $880,000,000 million dollars spammers’ get?

    Mine’s angel invested, bequeathed indirectly, to recognition algorithms for determining email spam, phishing, fraud, errors, virus’ and the speed at which I can delete them, leaving normal email untouched.

    I’ve developed the same skill for ignoring banner ads whilst online reading, taking a break from the TV during a commercial, and talking to my wife during ads at the movie theatre. You merely redirect and channel your existing focus, which is in effect, a producitivity enhancing skill to have.

  • My New Love for mx.core.View

    Old class (circa September 03, 2003, 2:49:24 AM… late night Nigel, hehe, or is that Cali time since I’m 3 hours ahead?), but I only now gained an appreciation for it. I was looking into a common pattern Flex uses in creating and deleting children (movieclips/components). Since a lot of the components in Flex are containers, they inherit from View up their inheritance tree, and therefore have the createChild, destroyChild methods. The createChild method is nicer (to me) than the createClassObject for a few reasons:
    – shorter to type
    – takes 3 parameters; the class name | the instance name | an init object, createClassObject takes 4; the 3rd being the depth

    Ex, UIComponent:

    createClassComponent(Label, "my_lbl", getNextHighestDepth());

    vs. View:

    createChild(Label, "my_lbl");

    …ahh, removing un-necessarey implementation details; OOP rulez.

    Additionally, View, the Flash version, already has the boundingBox_mc property defined, and already has the code to remove it in the constructor so you don’t have to repeatedly define this in your classes the extend UIComponent.

    It also already sets up tabbing for children within your component by running the 2 methods I always end up repeatedly typing into my own classes:

    tabChildren = true;
    tabEnabled = false;

    It also automatically implements a rect border; I believe this is used for borderStyles; you can see a good example of this in the Loader component, the comp used to load external content.

    yourLoader.setStyle("borderStyle", "inset");

    Your draw and size functions are replaced with doLayout, which you have to call super on. Additionally, for one-time layout deals, you can implement initLayout and call super on it; it’s good for stuff you’d typically put in your createChildren (have to call super in this one too), but didn’t necessarely have to do with creating children clips.

    You end up with a really nice class file structure going that is more lean than the UIComponent version.

    View
    – constructor // good practice
    – createChildren
    – doLayout
    + init & initLayout optional

    vs.

    UIComponent
    – constructor // good practice
    – init (calling super)
    – createChildren
    – draw (for your backgroundRect mostly)
    – size
    + boundingBox_mc in your properties

    I typically run my getter/setters to set themselves in the initLayout, but you could do it in the createChildren if you really wanted.

    …however, View appears somewhat unfinished in the Flash version (and both are missing the implementation of convertToUIObject, which converts externally loaded content via createChild to a UIObject… well, it appears that’s what it was eventually supposed to do).

    Update on convertToUIObject from off-blog email:

    …convertToUIObject is actually implemented in mx.core.ExternalContent. I guess it would be considered a mixin without a target. It’s a little weird.

    Here’s the part of ExternalContent.as that references View:

    static function classConstruct():Boolean
    {
    	var v = View.prototype;
    	var p = ExternalContent.prototype;
    	v.loadExternal = p.loadExternal;
    	v.prepareToLoadMovie = p.prepareToLoadMovie;
    	v.waitForUnload = p.waitForUnload;
    	v.checkLoadProgress = p.checkLoadProgress;
    	v.contentLoaded = p.contentLoaded;
    	v.convertToUIObject = p.convertToUIObject;
    	return true;
    }
    static var classConstructed:Boolean = classConstruct();

    View loads mx.core.ExternalContent and ensures that it’s actually there (i.e. not just loaded for type checking) by including this code in the class definition:

    // this never gets called, it just makes sure the external content module gets loaded
    static function extension()
    {
    	mx.core.ExternalContent.enableExternalContent();
    }

    Now, that’s ok for the Flex version… but you’ll start to realize that the Flash version is missing some important children management functions. UIComponent has destroyObject, which takes care of removing the movieclip/child component, authortime or not, and deletes the variable. It’s a bit unweidly because it takes a string, I guess because they assume your gonna keep a list of skin clips like some of the components do… not me.

    Case in point, destroyChildAt; its expecting a number which represents which child to remove. Do you know what child is 3? Do you know what # your submit_pb is? I don’t either, nor do I wanna manage that crap… the whole point of a helpful base class is to be… well, helpful.

    Looking in the Flex version, it implements some of the necessarey methods to prevent you from having to manage this information yourself; namely:
    – getChildAt(index:Number)
    – getChildIndex(child:UIObject)
    – destroyChild(child:UIObject)

    Implementing these methods yourself is trivial, and the Flex implementations of them are not to my liking (I didn’t like the way Flex wrote the innards of those functiosn), which is a good thing since my implementations have no relations… except the end result; managing my children for me.

    It has a few other useful methods too, but I don’t really need those; adding the above, including destroyAllChildren via my own, quick implementations, makes View a superior class to use for visual components that implement heavy use of Composition; a lot of sub-movieclips/components used in a wrapper class, AND with less code.

    mx.core.View is not for everyone… hell, mx.controls.Label extends UIObject! I am definately digging it though for a lot of my fixed-sized forms I’m building in Flash (miss you Flex!); leaner code, and less I have worry about writing, and instead focus my time on writing application specific code.

    Check out View today!

  • How to Setup & Use Subversion Source Control on Windows XP

    This hopefully will help those not familiar with source control systems and command prompts, specifically Cygwin tools and Subversion, get up to speed on what they are and how you use them. This won’t explain how to setup Subversion Source Control, but rather how to use tools to connect to it for a project. This article assumes you already have Subversion on a server somewhere with a project already checked and waiting to be worked on by developers.

    I made this tutorial because I had no idea what Subversion was, no idea what Cygwin is or does, and no idea how to connect to the Subversion server remotely without a GUI (even with). I’ve included a list of common commands at the bottom of the Cygwin part; I kept forgetting them so am documenting them here (yes, they are in the manual, duh but’s easier to type in my website, and search vs. digging in my filesystem).

    I’ve also inclued a brief on using TortoiseSVN, the GUI way of doing things.

    If you are proficient in these technologies, please feel free (in fact, I encourage you) to add corrects, modifications, and suggestions in the comments of this entry.

    For those of you not from a server-side, IT, admin, or hardcore programming background, you might feel intimidated and confused about what Subversion is, why you need it, and how to set it up.

    Skip to “Getting Started” if you want to know how to get setup.

    My Background & Take on Subversion

    The more I get integrated into becoming a true programmer, and fade farther and farther away from the world of design (my last tether using Flash to make a living), the more I learn about tools that normal developers use in their day to day lives, and just “know” all the nuances that are involved in setup and using them.

    I know jack, and it’s extremely intimidating and frustrating to ease into it. For example, it was easy for me to get into PHP; I knew Lingo, ActionScript, and had done enough HTML + CSS & ASP in my career to get the gist of how PHP worked.

    Getting into Subversion, though, is a whole other ballgame.

    I have worked at a company where the code base was just over a year old and we used Visual Source Safe for botht the .NET back end and the Flash front-end. At the time, I could see the benefit. However, most of my background is in 2 week to 2 month projects, working at breakneck speed, and that’s the last you see of them once they get out the door. When you do make changes, they are last minute, hard to do, and usually not what you wanted to do.

    When given other people’s code, I typically just re-write it since the track record of maintainable & portable code written in the Flash professional world, in my experience, is not there yet because of the debate on best practices and the wide array of approaching solutions to problems. Therefore, source safe solutions have always seemed silly to me; why check something in when your done, and you’ll just re-do it. If you made a change last week that broke something you did now, there is no point in going back since the code base has probably changed significantly since then.

    That attitude has changed since I’ve worked on bigger projects, and worked with “others”. Typically, I’ve been the sole Flash guy, or sole programmer, so never had to interact with others or a community code based like open source software. Now I have, and do, and recognize why source control systems are in place.

    Why Subversion?

    But, Subversion? Unlike Visual Source Safe, it’s free. Unlike CVS, it… well, to me, makes sense. I never understood the WinCVS GUI, and was glad BellSouth never got it working for me. It appeared to have the same user friendliness as Lotus Notes.

    I’ve also heard Subversion can be made more secure using SSH (secure way of accessing stuff over the interweb… er, net).

    Regardless, I know my company uses it, and I need to get comfortable using it with the other developers (Flash, PHP, Java, etc.).

    Getting Started – How do I use it?

    There are 2 ways that I know; I haven’t figured out how to get JSFL and bat files to allow you to do it in the Flash Project Panel yet. If you don’t know what that is, it is the Panel in Flash that, like Dreamweaver’s Files panel, allows you to see all of the files related to your Flash project. It’s folder structure doesn’t have to match your actual folder structure (although I make sure to do so). The benefit at BellSouth was I could easily right click on an AS file, and check out the file. It would take 10 years, but it would work with Visual Source Safe. In the past, I had to close the file, toggle to Visual Source Safe, and do my file operations of chekin/checkout there, then toggle back to Flash.

    The first way is to use a bash shell (I think that’s what it’s called). Basically, it’s one of those command windows, the black ones you see sometimes that do weird stuff. I’ve found this is quick and easy once you get used to it. Imagine instead of launching Dreamweaver, waiting, and then connecting to your FTP server, you could just ftp a file by typing 2 lines within 10 seconds? That is one benefit I’ve found.

    The one I’ve been using is called Cygwin; it’s a bash shell for Windows. It installs 10 billion things, and you don’t need them all. You can get it here:

    http://www.cygwin.com/mirrors.html

    What it really is a setup.exe file that connects and lets you install the components over the internet. For now, all you really need to ensure you have is:
    – openssh
    – subversion

    When presented with the list, which starts with “All” and then shows “Admin”, etc. down a list, those are lists of components you can install with it. Under base, if you select “cygwin”, it’ll automatically select most of the other files you need. However, manually ensure you get the 2 mentioned above. Clicking on the pluses “+” or words will show the list of files underneath the category. Click the circlar arrows icon will toggle how the category installs. It should be “default”.

    All > Base > cygwin
    All > Devel > subversion
    All > Libs > openssl
    All > Net > openssh
    All > Net > openssl

    “But Jesse, some of the things listed the user does not need.”

    Dude, trust me, if I install all of that stuff, I can successfully connect to my subversion server at work from home, and check in/check out files. If you know of exactly what files the user needs, please leave a comment to this entry.

    Cygwin Commands

    Here are some commands to get you at least something to start with.

    To navigate to other directories (use forward slash for folders and a backslash in front of spaces in folder and filenames):

    cd c:

    To check files out to a directory:

    svn checkout svn+ssh://yoursubversionserver ProjectName

    To check in files:

    svn commit folder\filename -m “I changed the algorithm”

    What has changed:

    svn status filename

    What is different about my file and the file checked in:

    svn diff folder\filename

    Get the latest files that are checked in:

    svn update

    TortoiseSVN: Command Line? Screw that mess!

    No problem, I’m tentative about learning a command line interface too because it doesn’t integrate with my usual workflow. There is a GUI, called TortoiseSVN, you can use that intergrates with Explorer, like Winzip does. It’s cool; it shows the checked out files with different icons, and is all accessible with right click.

    However, I still recommend installing all that weird stuff above becuase:
    – it’s easier for your IT admin to help you debug problems when you have a shell to test commands
    – it installs the necessarey files needed to connect anyway, and TortoiseSVN needs an SSH program anyway

    You can get Tortoise SVN here:

    http://tortoisesvn.tigris.org/download.html

    And after you install, and do the mandatory reboot:
    – right click inside the folder your gonna put your Flash/Flex/PHP project, and go to “TortoiseSVN > Settings…”.
    – Click on the “Network” Tab
    – in the bottom field, SSH client, navigate to something like: “C:\cygwin\bin\ssh.exe”

    If you don’t see that filepath, re-run the setup.exe for Cygwin, and look for more ssh type files in the huge list and make sure they are installed. Then, try finding it again.

    After hitting ok, you should be able to log into your server.

    Host File

    I couldn’t connect initially because my server admin at the office had to have me do 2 things:

    1. Change my host file to say our server’s name.

    Basically, if you type in an acronym for your server’s names, like “enterprise”, you do this because it’s easier to remember than 69.198.92.4 or that’s what the box is really named. Obviously, your computer doesn’t know where “enterprise” is. Your computer probably DOES know where yahoo.com is; but that’s because of Internet nameservers that go “Yo, dude, Yahoo’s this way…”. For personal stuff, you’ll have to input the exact static IP address, or “exact internet address”.

    You can do this by modifying your host file. I recommend a backup just in case you fubar something.

    Mine is here:

    C:\WINDOWS\system32\drivers\etc\hosts

    Notice, it has no file extension. Just open it in Notepad; I usually drag and drop it.

    For my server at work (which we don’t really have an enterprise, but let’s just say we do):

    45.98.99.2 enterprise

    Save the file, and close Notepad. You’ll know it worked if you can open Firefox or IE and type in “enterprise” into the address bar, and hit the server. Whether the admin actually has anything runnig, such as a webserver to show you anything is a different story, so just because you get a 404 doesn’t mean that it didn’t work; it could just be ignoring web traffic.

    Who I am and who my box thinks I am

    The second thing is how SSH clients store security information and transmit who they are to the server. Without getting technical about stuff I have no clue about, here’s what I had to do:

    Cygwin, the bash shell black window thing, wouldn’t connect to the server when I typed in the commands my admin gave me. That’s because the server admin had setup a username and password for me called:

    u: jesse
    p: jesse

    However, Cygwin was using my WindowsXP username, like “Cow”. So, when I tried to check files out or log into my ftp account, it wouldn’t work, even with the correct password.

    SO, I had to manually edit the file that Cygwin uses to talk identify to the server who is talking to it.

    Mine was here:

    C:\cygwin\etc\passwd

    Make sure to make a backup.

    Basically, open it up in Notepad, and anywhere you see your Windows login name, change it to whatever the username your admin gives you. Save the file, and restart Cygwin, or try again using TortoiseSVN.

    Workflow

    Typically, you check out files, edit them (you’ll see a “!” with Tortoise), and save them. Then, you do an update in Cygwin, or Tortoise to ensure you have the lastest, and commit or “check in” the files you’ve changed. You usually ensure that you have the lastest files first so you don’t overwrite someone’s changes, AND you should always leave a comment of what you did and changed. If someone else has changed the file your working on, the general rule of thumb is the last person has to merge their changes with the existing code.

  • New Search: No More Atomz, Hello Google

    I first started using MoveableType’s built in search for users to search my site. Then it broke.

    Anu told me to use Atomz.com as their search was free. They have some interesting reporting tools, and while it does help me focus the writing of my blog content based on what people are looking for, it wasn’t that beneficial overall. Not only was the crawling of my site a manual process that I had to do, but they had a limit on the number of pages that I was allowed to have their product crawl unless I was a paying member. They then started inserting ads in my search results, but didn’t pay me to host their ads.

    Google’s Adsense for search also allows you to maximize your earnings by providing the Google search engine to search your site, but you can customize the appearence of the results, have the google search engine interface be on your page, and utilize adsense in the search results. It appears Google has just as good, or better search query reporting tools compared to Atomz.com.

    If you experience any problems, let me know; I believe using Google’s search engine will improve the searching experience on my site.