Firebug 1.0 on the horizon

Categories: Uncategorized

    If you are developing an AJAX application, or develop JavaScript on a daily basis, then this tool is for you!  I have been using the current version of Firebug (0.4.1) for quite some time now, and have become reliant on its simplicity and capabilities.  Other than providing some JavaScript debugging (much better than the JavaScript console), the most useful thing for me has been the ability to show stack traces for JS errors and show XMLHtttpRequests.  Firebug shows all XHR calls, both POSTs and GETs, along with the data posted, the response, and headers.  This is extremely useful when debugging large AJAX applications - much easier than alerting everything!
    Well, Joe has been busy working on the v1.0 release of FireBug, and I have to say it looks amazing.  You can get a full feature list for FireBug 1.0 at it’s new home: www.getfirebug.com.  However, here is a brief listing of expected features:

Just the way you like it

Firebug is always just a keystroke away, but it never gets in your way. You can open Firebug in a separate window, or as a bar at the bottom of your browser. Firebug also gives you fine-grained control over which websites you want to enable it for.

Learn more

Inspect and edit HTML

Firebug makes it simple to find HTML elements buried deep in the page. Once you’ve found what you’re looking for, Firebug gives you a wealth of information, and lets you edit the HTML live.

Learn more

Tweak CSS to perfection

Firebug’s CSS tabs tell you everything you need to know about the styles in your web pages, and if you don’t like what it’s telling you, you can make changes and see them take effect instantly.

Learn more

Visualize CSS metrics

When your CSS boxes aren’t lining up correctly it can be difficult to understand why. Let Firebug be your eyes and it will measure and illustrate all the offsets, margins, borders, padding, and sizes for you.

Learn more

Monitor network activity

Your pages are taking a long time to load, but why? Did you go crazy and write too much JavaScript? Did you forget to compress your images? Are your ad partner’s servers taking a siesta? Firebug breaks it all down for you file-by-file.

Learn more

Debug and profile JavaScript

Firebug includes a powerful JavaScript debugger that lets you pause execution at any time and have look at the state of the world. If your code is a little sluggish, use the JavaScript profiler to measure performance and find bottlenecks fast.

Learn more

Quickly find errors

When things go wrong, Firebug lets you know immediately and gives you detailed and useful information about errors in JavaScript, CSS, and XML.

Learn more

Explore the DOM

The Document Object Model is a great big hierarchy of objects and functions just waiting to be tickled by JavaScript. Firebug helps you find DOM objects quickly and then edit them on the fly.

Learn more

Execute JavaScript on the fly

The command line is one of the oldest tools in the programming toolbox. Firebug gives you a good ol’ fashioned command line for JavaScript complete with very modern amenities.

Learn more

Logging for JavaScript

Having a fancy JavaScript debugger is great, but sometimes the fastest way to find bugs is just to dump as much information to the console as you can. Firebug gives you a set of powerful logging functions that help you get answers fast.

Learn more

Update December 4, 2006:

FireBug 1.0 is now in public beta and is available for download.

Read More

Flash file uploads

Categories: Uncategorized

    As an AJAX enthusiast, I often check several web2.0 and AJAX related blogs daily to get the latest scoop on projects, technologies, and innovations.  One of the best AJAX focused blogs is the popular ajaxian.com site.  Today, Dion Almaer published an article about the recently released project entitled "SWFUpload".  Of course this immediately caught my attention.  One of the best features of this script is the ability to degrade to a standard HTML upload form when Flash or JavaScript is not present or enabled in the browser, making this script highly usable and accessible.  According to their web site, SWFUpload has several very nice features, including:

  • Only display chosen filetypes in dialog
  • Upload multiple files at once by ctrl/shift-selecting in dialog
  • Trigger javascript functions on start, cancel, progress and complete
  • Get file information/size before upload starts
  • Style upload buttons any way you want
  • Do progress-bars/information using valid XHTML and CSS
  • No page reloads, display uploaded files as they are finished
  • Works on all platforms/browsers that has Flash support.
  • Degrades gracefully to a normal html upload form if Flash or javascript isn’t available

    The script is extremely easy to implement:

[-]View Code COLDFUSION
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<script type="text/javascript">
	mmSWFUpload.init({
		upload_backend : "../../upload.php",
		button_image : "images/custom_button.png",
		button_mouseover_image : "images/custom_button_over.png",
		width : "258px",
		height : "82px",
		target : "SWFUpload",
		allowed_filetypes : "*.gif;*.jpg;*.png",
		upload_start_callback : 'uploadStart',
		upload_progress_callback : 'uploadProgress',
		upload_complete_callback : 'uploadComplete',
		upload_error_callback : 'uploadError',
		upload_cancel_callback : 'uploadCancel'
	});
</script>

    However, as a ColdFusion programmer, the ability to perform file uploads via Flash is nothing new.  The power of ColdFusion MX 7 is AMAZING!  If you are running an older version of ColdFusion, or you are not familiar with ColdFusion, I recommend you look into the broad expansion of features and simplicity that ColdFusion MX 7 has.  Here are a couple of articles that show you the power of CF 7:

    These are just a few recent articles that can shine light on the power of CF MX 7, and will perhaps convince you to consider ColdFusion MX 7 has your server-side scripting language or to upgrade your existing ColdFusion installation from a previous version.
    I don’t just want to talk about ColdFusion MX 7 here though, what I really want to accomplish is showing you the power of the <CFFORM> tag provided in ColdFusion MX 7.  The CFFORM tag has been expanding in CF 7 to include not just HTML forms, but also XML and Flash forms.  Although we will not discuss the XML forms here, it provides the ability to generate XForms-compliant XML and applies an XSL skin the form as defined.  More information about XForms, their benefits and drawbacks and compatibility issues can be viewed on the W3C Forms Working Group web site.  The real advantage of the CFFORM tag that is relevant here is the ability to generate Flash forms in which all form elements and components are generated and outputted to the browser in Flash!  Built upon Flex technologies, Flash forms provide a wide array of possibilities to ColdFusion developers to create next-generation RIAs.
    If you are interested in the power of combing Flash technologies with ColdFusion, the AsFusion web site is a must!  Not only focused on ColdFusion, but also ActionScript (the language powering Flash - kinda like JavaScript), this web site provides numerous examples that showcase the power of CF+Flash.  The article on File Uploads shows how ColdFusion developers can develop interactive File Upload forms using Flash through the CFFORM tag, although, keep in mind that this ability is limited to Flash Player 8 and higher.  Check out their postings and examples on Flash File uploads using ColdFusion:

    In conclusion, yes, I think that the SWFUpload script is an excellent contribution to the development of RIAs, but lets not forget, ColdFusion has had this ability for quite some time (and as always, CF makes it very simple!)

Read More

Scrybe; tell me this doesn’t look amazing!

Categories: Uncategorized

    Today I ran across what looks to be an extremely promising web2.0 application that is still in beta, like all most web2.0 applications and startups, called Scrybe.  Scrybe is a planning and organizational tool that just might convince you to forget that bulky and clumsy notepad or personal organizer you’ve been carrying around all these years.
    From this demo video, it looks like Scrybe could teach a lesson or two to the big guys, such as Google’s Calendar, Yahoo’s Calendar, or WebEx’s WebOffice.  The amazing feature list, along with the planned expansion and development of new features such as importing, exporting, and synchronizing with mobile devices and traditional applications like iCal or Outlook and more, is enough to make you drool.  To really understand what I am talking about, you need to watch their demo video:

    Now that you checked out the video, see what I mean?  All I can say is I’m anxiously awaiting for a beta invitation so I can dive into this amazing web2.0 app.  The only question remains, just how long will it be until Google and the others implement these features or decide to buy them out?   Either way, I can’t wait!

Read More

Scriptaculous interactive tab navigation

Categories: Uncategorized

    Although this script is not very polished, and could probably use some enhancements to increase flexibility and make the script unobtrusive; I have implemented this simple tab navigation script in some projects for back-ends that manage applications.  By combining some simple functionality available by using the Prototype and Script.aculo.us javascript libraries, it is pretty simple to create an interactive tab navigation scheme.

    The CSS is fairly straightforward and allows you to modify the color scheme of the tabs, add rounded corners to the tabs, and anything else you can think of:

[-]View Code COLDFUSION
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<style>
    #tabs{
        margin-left: 4px;
        padding: 0;
        background: transparent;
        voice-family: ""}"";
        voice-family: inherit;
        padding-left: 5px;
    }
    #tabs ul{
        font: bold 11px Arial, Verdana, sans-serif;
        margin:0;
        padding:0;
        list-style:none;
    }
    #tabs li{
        display:inline;
        margin:0 2px 0 0;
        padding:0;
        text-transform:uppercase;
    }
    #tabs a{
        float:left;
        background:#A3BBE6 url(images/tabs_left.gif) no-repeat left top;
        margin:0 2px 0 0;
        padding:0 0 1px 3px;
        text-decoration:none;
    }
    #tabs a span{
        float:left;
        display:block;
        background: transparent url(images/tabs_right.gif) no-repeat right top;
        padding:4px 9px 2px 6px;
    }
    #tabs a span{float:none;}
    #tabs a:hover{background-color: #7E94B9;color: white;}
    #tabs a:hover span{background-color: #7E94B9;}
    #tabHeaderActive span, #tabHeaderActive a { background-color: #42577B; color:#fff;}
    .tabContent {
        clear:both;
        border:2px solid #42577B;
        padding-top:2px;
        background-color:#FFF;
    }
</style>

    The HTML is also very simple, which I often generate using server-side scripting to create the layout based on an XML or database schema.  For each tab in your layout, there is both a tabHeader and a corresponding tabContent div:

[-]View Code COLDFUSION
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<div id="tabs">
    <ul>
        <li style="margin-left: 1px" id="tabHeader1" class="currenttab"><a href="javascript:void(0)" onClick="toggleTab(1,6)"><span>Tab 1</span></a></li>
        <li id="tabHeader2"><a href="javascript:void(0)" onClick="toggleTab(2,6)" ><span>Tab 2</span></a></li>
        <li id="tabHeader3"><a href="javascript:void(0)" onclick="toggleTab(3,6)"><span>Tab 3</span></a></li>
        <li id="tabHeader4"><a href="javascript:void(0)" onClick="toggleTab(4,6)"><span>Tab 4</span></a></li>
        <li id="tabHeader5"><a href="javascript:void(0)" onclick="toggleTab(5,6);"><span>Tab 5</span></a></li>
        <li id="tabHeader6"><a href="javascript:void(0)" onclick="toggleTab(6,6);"><span>Tab 6</span></a></li>
    </ul>
    </div>
    <div id="tabscontent">
        <div id="tabContent1" class="tabContent" style="display:none;">
            <br /><div>First Tab Content goes here</div>
        </div>
 
        <div id="tabContent2" class="tabContent" style="display:none;">
            <br /><div>Second Tab Content goes here</div>
        </div>
 
        <div id="tabContent3" class="tabContent" style="display:none;">
            <br /><div>Third Tab Content goes here</div>
        </div>
 
        <div id="tabContent4" class="tabContent" style="display:none;">
            <br /><div>Fourth Tab Content goes here</div>
        </div>
 
        <div id="tabContent5" class="tabContent" style="display:none;">
            <br /><div>Fifth Tab Content goes here</div>
        </div>
 
        <div id="tabContent6" class="tabContent" style="display:none;">
            <br /><div>Sixth Tab Content goes here</div>
        </div>
    </div><!--End of tabscontent-->
</div><!--End of tabs-->

    This is where we get into the JavaScript.  First, be sure that you include the Prototype and Script.aculo.us javascript libraries.

[-]View Code COLDFUSION
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*-----------------------------------------------------------
    Toggles element's display value
    Input: any number of element id's
    Output: none 
    ---------------------------------------------------------*/
function toggleDisp() {
    for (var i=0;i<arguments.length;i++){
        var d = $(arguments[i]);
        if (d.style.display == 'none')
            d.style.display = 'block';
        else
            d.style.display = 'none';
    }
}
/*-----------------------------------------------------------
    Toggles tabs - Closes any open tabs, and then opens current tab
    Input:     1.The number of the current tab
                    2.The number of tabs
                    3.(optional)The number of the tab to leave open
                    4.(optional)Pass in true or false whether or not to animate the open/close of the tabs
    Output: none 
    ---------------------------------------------------------*/
function toggleTab(num,numelems,opennum,animate) {
    if ($('tabContent'+num).style.display == 'none'){
        for (var i=1;i<=numelems;i++){
            if ((opennum == null) || (opennum != i)){
                var temph = 'tabHeader'+i;
                var h = $(temph);
                if (!h){
                    var h = $('tabHeaderActive');
                    h.id = temph;
                }
                var tempc = 'tabContent'+i;
                var c = $(tempc);
                if(c.style.display != 'none'){
                    if (animate || typeof animate == 'undefined')
                        Effect.toggle(tempc,'blind',{duration:0.5, queue:{scope:'menus', limit: 3}});
                    else
                        toggleDisp(tempc);
                }
            }
        }
        var h = $('tabHeader'+num);
        if (h)
            h.id = 'tabHeaderActive';
        h.blur();
        var c = $('tabContent'+num);
        c.style.marginTop = '2px';
        if (animate || typeof animate == 'undefined'){
            Effect.toggle('tabContent'+num,'blind',{duration:0.5, queue:{scope:'menus', position:'end', limit: 3}});
        }else{
            toggleDisp('tabContent'+num);
        }
    }
}

    The first function, toggleDisp, is a simple function in which you can pass multiple element ids or the element object and switches the display mode of the element from ‘block’ to ‘none’ and vice-versa.  This can also be implemented using the Effect.Toggle function in the script.aculo.us library if you wish.  The second function, toggleTab, does all the work of actually opening and closing the tabs.  The function has 3 arguments.  First, the total number of tabs - this is where I could add some additional logic to automatically get the tab elements and count them, thus not requiring this argument.  Second, the "number" of the tab to leave open - I implemented this functionality to allow nested tabs.  Below is an example of where I wanted to have nested tabs:

    As you can see, I have 4 main tabs across the top, and I also have a nested tab in this particular instance.  Since I want to be able to open and close the ‘Add Administrator’ tab within the ‘Manage Grant Administrators’ tab, I have to pass in the tab number of the ‘Manage Grant Administrators’ tab to that when a user clicks on the ‘Add Administrator’ tab, the tab it is nested within is not closed - make sense?  As a side note: this entire management tool is completely AJAXified and contained on a single page, making it incredible easy and fast to manage the Grant application I developed.

    Lastly, the third argument to the toggleDisp function is a boolean value to specify if you want the opening and closing of the tabs to be animated or not.  This was added to allow for ability to turn off the scroll up/down animation of the tab contents when it is not desired, and is specified for each tab.

    Here is an example of the Script.aculo.us interactive tab navigation I have discussed.  I have also shared this code on the Script.aculo.us wiki site, in the hope that others will find value in this simple script, and perhaps make modifications and enhancements to further expand the simplicity and effectiveness it offers.  Please let me know if you use this script and find it helpful.

Update:

Read about HistoryTabs.js

Read More

JavaScript variable dump

Categories: Uncategorized

    If you are a ColdFusion developer then you are familiar with the tag <cfdump> that displays the contents of simple and complex variables, objects, components, user-defined functions, and other elements within ColdFusion.  This tag allows for simple debugging, showing you the metadata, data, and structure of any variable object.

    Once you become familiar with this tag as a developer, you become more and more reliant upon the ease of use, simplicity, and capabilities that it offers when developing ColdFusion applications.  Now, you just wished this capability was available in other languages that you may use.

    You may not be aware, but the <cfdump> tag has been ported over to other programming languages you may be using, which will dramatically increase your ability to effectively debug your applications; whether you are using JavaScript, PHP, or other languages.  NetGrow has released a dump method for JavaScript which resembles the <cfdump> tag, and dBug for PHP.  I highly suggest you check out this little gems for developing in either PHP or JavaScript.

    Here is an example dBug output from PHP:

    Here is an example dump method output from JavaScript:

Read More

Social networking for investors

Categories: Uncategorized

As my previous post suggests, I believe there is a significant link between the driving forces of both web 2.0 and the financial and capital markets that seek to utilize the collective intelligence of the masses.  The wikipedia authors of the Social network page say that:

Social network theory produces an alternate view, where the attributes of individuals are less important than their relationships and ties with other actors within the network. This approach has turned out to be useful for explaining many real-world phenomena, but leaves less room for individual agency, the ability for individuals to influence their success, because so much of it rests within the structure of their network.

I thought to myself: how can this link be reinforced even more?  Perhaps by bringing investors together on the Internet to create what I would call "Investor networking".  I found  a web site that attempts this idea: StockTickr.com.  However, I think that with some additional features, an increased focus on usability, and a better design; an investor networking site can bring together investors to create an intelligent networking application that can provide average investors with shared knowledge and opinions on publicly traded corporations; that can perhaps have a positive impact on the efficiency of the market in terms of disseminating useful information.

Read More

Financial markets and Web 2.0

Categories: Uncategorized

    The other day it struck me that the theory of web 2.0 and that of capital markets share a commonality: embracing the power of collective intelligence.  Popular web 2.0 sites like Flickr, wikipedia and del.icio.us have experienced enormous success with this approach, as have social networking sites like myspace and facebook.  Whether it is a personal story or photo, or the constant update to a huge collection of information and knowledge on every subject area, the success achieved by these web sites is due in large part, not to the developers or content managers, but to the many users and visitors to these sites.  It is amazing how the web has been able to capture the collective intelligence of the masses, in order to efficiently hopefully collect and archive data, information, and knowledge on a wide breadth of subject areas in the form of words, images, multimedia and more.  What I find to be impressive is that what is being called the next generation of the web, is not a new idea or concept.  In fact, capital markets around the world have relied upon this same premise for hundreds of years.

    Financial markets are heavily impacted by the effects of supply and demand but also the impact of investors’ and analysts’ personal rational and emotions.  This governing principle is taught in business schools around the country, referred to as the ‘efficient market theory’.  And of course, how could I write this article without drawing from the collective intelligence of wikipedia; so here is what the authors of wikipedia define as the efficient market hypothesis:

In finance, the efficient market hypothesis (EMH) asserts that financial markets are "efficient", or that prices on traded assets, e.g. stocks, bonds, or property, already reflect all known information and therefore are unbiased in the sense that they reflect the collective beliefs of all investors about future prospects. 

    This theory is highly debated in all levels of finance and economics, but one thing is clear: the market is not efficient.  This is exemplified by the personal monetary motivations of corporate executives and analysts.  Perhaps one of the most successful investors, Warren Buffet, said it best:

"The professors who taught Efficient Market Theory said that someone throwing darts at the stock tables could select stock portfolio having prospects just as good as one selected by the brightest, most hard-working securities analyst. Observing correctly that the market was frequently efficient, they went on to conclude incorrectly that it was always efficient."

    In conclusion, the idea behind all of this is that collectively, our intelligence far exceeds any individual’s personal intelligence or knowledge.  This principal is not only the driving force behind much of Google’s approaches and other web 2.0 companies’, but also that of the financial markets which seek to ensure the most efficient use of resources for the benefit of the stockholders, stakeholders and economy.  It is amazing how we have witnessed the shift in the paradigm of the web from the power of content being held by a few individuals who had the knowledge to do so to the masses of people that can share their own insight, knowledge, and intelligence with the rest of the world.  In the end, with all this collective intelligence, will the world be a better place because of it?  As a web 2.0 enthusiast I can only hope so.

Read More

Mac OS X Demo

Categories: Uncategorized

Interested in the Apple Macintosh platform?

Ever wondered what the Mac OS Tiger can do?
Thinking about switching from Windows to Mac?

…Take a look at this video, which introduces the features, user interface, and overall slickness of Mac OS X Tiger:

Read More

Ski season is just around the Bend

Categories: Uncategorized

It’s official! 

This morning I woke to the white glow outside my window that could only be SNOW!  Although it was only a slight dusting, and is barely sticking.  But hey, this is a great sign that the Ski season is just around the Bend!

Here’s a picture I took at work this morning of the view outside my window:

Snow falling outside my window at work
Read More

Dashalytics

Categories: Uncategorized

Dashalytics is a cool Max OS X widget that I came across that allows you to view your Google Analytics statistics on your Dashboard!  Here’s what they say about features and requirements:

Features

  • Multiple widgets can be used to monitor multiple sites
  • Works for Google Analytics accounts in any language
  • Uses the Keychain to store your password

Requirements

Dashalytics example screenshot
Read More