Posted in Notebook on August 20th, 2006 by kai – Comments Off
Gone are the days of spending big $$$ on expensive software to manage, develop and deploy web sites, web apps and software. There are so many inexpensive and open-source solutions for source-control, bug-tracking and project management, that there is no excuse, whether you are a three-person or 50-person shop, to be without these invaluable tools.
The list below is be no means complete, but does include the tools I use.
-
Source Control
First and foremost for any development task is source control for every piece of code, documentation and proposal that you write. There are many solutions out there and I’ve used a number of them including, CVS, SourceSafe, Perforce and Subversion. But taking into consideration cost, ease-of-use and setup, Subversion is by far my favorite. Subversion is an open source versioning control system released under an Apache/BSD-style license.
There are tons of great clients for the system, including,
- SmartSVN
Client runs on OS
- TortoiseSVN
Software integrates with Windows Explorer, exposes all functionality via the explorer tree
- VisualSVN
Integrates with Visual Studio 2003 and 2005.
I’ve used all of these but my personal preference is SmartSVN. Subversion is currently only available on Linux and Mac, but this really doesn’t matter. Hosting companies like Dreamhost, along with other includes features has one-click installation of Subversion. So for $10/month you can setup your own source-control, with the added benefit of hosting in 24 hours.
-
Project Management
Both a developers worse nightmare and savior, project management software is a piece of development with the bottom-line of, “get your shit done and preferably on-time”. In my experience, I have used my $.30 notebook, MS Excel, my own custom built tool and even the monster of an application MS Project but they all just seemed to be more a hassle than help. So unless you’ve been on a big rock for the last year, you’ve probably heard of BaseCamp put out by 37Signals. BaseCamp is simple, straight-forward, easy to use, is built using Ruby-on-Rails, is cheap, etc etc… This tool is really everything that I need and doesn’t include anything that I don’t need. The cost ranges from FREE to $149/month, depending on how much storage and many features you need.
-
Bug Tracking
When cost is an issue and your development team is made up of three people, open-source applications as Bugzilla and inexpensive web 2.0 applications as 16bugs become invaluable. Both of these applications are really quite adequete but very specific in their target audience. 16bugs is “web 2.0-ish”, very usable, as simple as can be and takes all of 3 minutes to setup. I’ve had a few email exchanges with “the” developer/creator of the application and he/she is very receptive of feedback. You create a company, create projects, create custom fields, categories and your off to many more years of carpal tunnel. Overall it’s perfect for the small development team, but my only gripe, why in the world can’t I create a custom drop-down menu field? Only text boxes? Oh well, maybe in a future release. So if your bug tracking needs are simple, simple 16bugs is perfect. Bugzilla on the complete opposite end if free, packed with features, security and privileges/roles, so I won’t say any more than that. If you want a fairly complete bug-tracking application, you can’t go wrong with Bugzilla.
Posted in AJAX, JavaScript, Notebook on August 2nd, 2006 by kai – Comments Off
The Prototype library, including script.aculo.us and a few others are a critical part of my development toolbox. These Javascript frameworks provide the foundation for creating interactive, usuable, fast and light-weight web-applications. Below are just a few examples of functions I use all the time.
-
Ajax.Request
Take a look at the two functions below. Using the Ajax.Request method you can call a processing file, all that processing file needs to do is output some text who response is passed to the onComplete function, displayProcessIt() and from there, you can generate a complete page of data, hide/show lists elements, divs, whatever you need.
function processIt(){
var url = '/path/processing_file.aspx';
var pars = 'param1='+param1Val;
var myAjax = new Ajax.Request( url, { method: 'get', parameters: pars, onComplete: displayProcessIt });
}
function displayProcessIt(strData){
var strResponse = strData.responseText
// Do whatever you want with this data on the client
}
All I know is after I learned how to use this one piece of functionality, my development become that much easier. That’s not to say this technique is ground-breaking or new, I know I’ve written enough “kind-of-does-this” code over the years.
- Element.show(), Element.hide(), Element.toggle()
Yes, I know these are very self-explanatory, but these are three sweet gems. All you do is create a pointer to an element by it’s ID and there you go, hide, show, toggle, beautiful…
function doSomething(e1){
Element.toggle($(e1));
}
Using $ creates a reference to that object by id and toggle…well, it toggles the display of the referenced element.
Posted in JSON, Notebook on July 31st, 2006 by kai – Comments Off
I found out the hard way that JSON files are not a recognized mime type by Windows 2003 Server (IIS 6.0), where references to those same files on XP Pro (IIS 5.1) renders just fine. I came across this bug when doing customizations to the Google Map API, rendering area maps using the GDowloadUrl (Using XML and Asynchronous HTTP with Maps) and the light-weight JSON files. Anytime I parsed through the JSON file and called GDowloadUrl, I would get a file not found error. Sure enough, pasting the complete URL to the JSON file into FF, resulted in File not found…error…error…
.
The solution was straight-forward enough. Open IIS Manager and under the HTTP Headers tab > MIME Types, add the custom .json and restart IIS.
The JSON format, if you haven’t used it, is a light-weight technology indepenedant data-interchange format that uses conventions found in languages including C, C++, C#, Java, JavaScript, Perl, Python, and many others. If you’re familiar with XML, JSON is just as structured and human-readable, well as readable as it can be. Check out the JSON website for documentation and examples.
An area where you’ll see more and more people using the JSON format is AJAX, specifically to speed-up calls back and forth from the server. A good article to get you started is Speeding Up AJAX with JSON.
Posted in Notebook, T-SQL on June 29th, 2006 by kai – Comments Off
By appending FOR XML auto to the end of your sql statement you can have your sql recordset returned as XML. A very useful utility.
SELECT * FROM [Table Name] FOR XML auto
Depending whether you pull from one or multiple tables, your output is structured XML based on the database schema. In situations we you are joining two tables there are two ways to have data returned in a clean way, (1) User a View or (2) User sub-queries.
Posted in Events on June 10th, 2006 by kai – Comments Off
d.Construct is an affordable, one-day conference aimed at those building the latest generation of web-based applications. The event discusses how new technology is transforming the web from a document delivery system into an application platform.
http://dconstruct.org/
9-5:30pm, Sept 8th 2006
Brighton Corn Exchange
For a list of all the speakers,
http://2006.dconstruct.org/speakers/
Posted in SQL Server, T-SQL on February 9th, 2006 by kai – Be the first to comment
With the release of SQL Server 2005, a feature has been added that makes paging data much easier. This feature is the ROW_NUMBER function. This function assigns consecutive row numbers for data returned from a query. One requirement of this function is you need to specify a column for ordering. Take a look at the table and query below,
[ tbl_Chair ]
ChairID ChairName
——- ———-
2 Aeron
65 Designer
14 Staples
23 Ergonomic
39 Blue
select row_number() over (order by ChairID) as Row, ChairName from tbl_Chair
Row ChairName
—- ———-
1 Aeron
2 Staples
3 Ergonomic
4 Blue
5 Designer
Now if I only wanted the 3rd thrugh 5th row, I could say,
select row, name
from (
select row_number() over (order by ChairID) as Row, ChairName from tbl_Chair
)
where row >=3 and row <=5
Now add a temp table to store the number of Chairs in your table to count the number of pages for paging, you have a stored proc like,
CREATE PROCEDURE GetChairs
(
@PageNumber int,
@ProductsPerPage int
)
…
And you have nice paging functionality.
Posted in .NET on October 20th, 2005 by kai – Be the first to comment
I’ve come across a few times on IIS running on Windows 2003 Server, fortunately the problem is easy to fix. If you are developing ASP .NET 2.0 there’s a chance you are missing the ASP.NET 2.0.XXXXX Web Service Extension.First thing you want to do is open Windows Explorer and navigate to,
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files
Right-click on the folder, click on the permissions tab and give “NETWORK SERVICE” permissions to write to the folder.
Secondly open IIS Manager and click on the Web Service Exension folder. In the right window click “Add a new web service extension…” and enter the following,
Extension Name: ASP.NET v2.0.XXXXX
Required Files: C:\WINDOWS\Microsoft.NET\Framework\v2.0.XXXXX\aspnet_isapi.dll
When completed, IIS should look like below,

Posted in Oracle on September 22nd, 2005 by kai – Be the first to comment
When Oracle performance becomes a mystery and you need to get under the hood of the car, falling upon raw oracle tracing is usuablly a good start. From SQLPLUS or your favorite Oracle Client tool, run through the following steps. What you end up doing is to dump a raw trace of what Oracle is doing. I find this to be very useful information in addition to using an Explain Plan.
alter session
set timed_statistics=true;
alter session set max_dump_file_size=unlimited;
alter session set events '10046 trace name context forever, level 12';
SQL STATEMENT
alter session set events '10046 trace name context off';
From the raw trace file is generated in your oracle instance path to UDUMP. “C:\oracle\product\10.1.0\admin\[INSTANCE NAME]\udump” From there open up DOS PROMPT and run,
tkprof [dump file name]
Open command line and tkprof.
Posted in Oracle, PLSQL on July 3rd, 2005 by kai – Be the first to comment
With collections, it is possible to return a table from a pl/sql function. First, we need to create a new object type that contains the fields that are going to be returned:
create or replace type t_col as object ( i number, n varchar2(30) );
Then, out of this new type, a nested table type must be created.
create or replace type t_nested_table as table of t_col;
Now, we’re ready to actually create the function:
create or replace function
return_table return t_nested_table as v_ret
t_nested_table;
begin
v_ret := t_nested_table();
v_ret.extend;
v_ret(v_ret.count) := t_col(1, 'one');
v_ret.extend;
v_ret(v_ret.count) := t_col(2, 'two');
v_ret.extend;
v_ret(v_ret.count) := t_col(3, 'three');
return v_ret;
end;
Here’s how the function is used:
select * from table(return_table);
Posted in SQL Server, T-SQL on April 1st, 2005 by kai – Be the first to comment
First time I ran across a query like the one below,
SELECT CustomerID, CompanyName FROM Customers WHERE CustomerID = N'CAMBR'
I asked myself, why is there an ‘N’ before ‘CAMBR’. Well, the ‘N’ actually designates unicode. If your query contains a field that can only be represented by 2 byte characters (i.e. Asian or accented characters), you need to use the N before the value or SQL Server will replace the characters with garbage (usually question marks). Below is another example, USE Northwind
SELECT CompanyName, ContactName, Phone, Fax
FROM Customers WHERE CompanyName LIKE N'%snabbk'p'
ORDER BY CompanyName ASC, ContactName ASC
For most cases, you should avoid using unicode. Unicode makes your database larger and slower. Also in a nvarchar field you only can store 4000 chars instead of 8000 in a “normal” varchar field. If you have in index on a nchar or nvarchar field it will take twice of the size therefore reducing the performance. I spend a good amount of time working with the Japanese character set and have run across some of these issues. If you do use Unicode, all Unicode is not the same. The Win32 API, Java, ODBC/OLEDB, etc all use UCS-2/UTF-16 as their representation of Unicode (UCS-2 encodes Unicode using 16 bits per character instead of the variable 8-24 bits used by UTF-8). But, Oracle, among others, use UTF-8, which is a multi-byte representation of Unicode. So, in UTF-8, typical ASCII codes are single byte, and double-byte is only used if a Unicode character is interjected.