Archive for 2007

Browsing Sharepoint (and other IE-specific sites) in Firefox

Saturday, November 3rd, 2007

One thing that has always bugged me in the past was that Windows Update, Sharepoint intranets, and other Microsoft-specific sites always required IE to run. Technically, it’s because VBScript and WShell scripts are used in those sites (the validity of that is a totally separate topic). However, what to do if you use FireFox as your daily browser, and hate switching over to IE just to browse some fool’s site?

Well, as long as you are running Windows, this solution should work for you: the IE Tab Firefox add-on.

With it you can switch from Firefox to IE mode and back with the click of your mouse. A little Firefox icon is displayed in the lower right corner of the Firefox browser after installing this add-on. Click on that, and it turns into an IE icon, and refreshes your page, running it in IE within Firefox!

Oh! And for those of you running Minefield (Firefox 3.x Alpha), it claims to work in it as well.

This has become one of my FF necessities!

JavaScript: Chaining getElementsBy Methods

Tuesday, September 4th, 2007

,,

How often have you run into the situation where it would be great if you could chain getElement(s)By method calls? Unfortunately JavaScript does not support this out of the box since the getElement(s)By functions return various collection objects.

Thankfully there is a way you can extend JavaScript functions and objects using prototyping. The stub would look somewhat like this, and you would have to include this in whatever pages use the chained calls:

Object.prototype.getElementByID = function(s_id)
{
alert(s_name);

return null;
}

This is just one example. Using this process you can then run effective chaining that could look like this:

document.getElementsByTagName("rule").getElementsByAttribute("format", document.getElementsByAttribute("data_format");

As soon as I have the extended methods completed, I will make them available here for download. Feel free to contribute, if you have any particular ideas on this! :)

What’s Wrong w/ Domain Brokers

Friday, August 24th, 2007

So I’ve come up with this great business idea that will revolutionize the world, abolish hunger, and set in an era of universal peace never seen before. Well, ok, not quite… but almost, I swear!

Now, of course you need the catchy domain name to go with it. Think again, my web-clicking friend! Over 90% of all domain names have been snatched up by so-called domain brokers who make a living off of others wanting to buy a particular name.

Sure, I promote free markets as much (or maybe more) than the next guy, but I actually caught myself thinking “they should have laws against this sort of stuff”. Wow! I actually caught myself thinking in ways that totally contradict my political beliefs (liberty, freedom, and free markets). This caused me to question my presumption: what right do I have to a domain name that someone else purchased legally? Of course I have none! Is it underhanded and nefarious, or enterprising?

Sure, they aim to take advantage of you wanting your domain name, but don’t all businesses do that now-a-days? I mean, really, isn’t advertising doing the same thing: creating a perceived desire so that you go out and buy it from them? OK, so there’s a slight difference in how the company operates: domain brokers take advantage of the shortcomings of existing markets without having to do any campaigning or marketing for their “product”, but other companies do that as well.

On the other hand, it is near impossible for one business to register all business names in a given state and act as a business name broker. Why is that? This is because registering a business name is in most places a legal requirement that mandates paperwork. And quite often lots of it (articles of incorporation, registration application, etc.). Who wants to start up 100 businesses with all the involved paperwork just to get a monopoly on the names in the off-chance that someone will buy it from you? I highly doubt that the effort pays off.

Should similar registration requirements be placed on domain names? I believe they should. Whoa… wait, wait… let me explain! I believe they should … in certain situations and to a certain degree. All top-level domains should be assigned according to their purpose designation (currently it is more hap-hazard than a chicken coop), as described here. Additionally, I would also enforce the following restrictions:

  • .com: require that it be registered by a business and that it cannot be resold (instead it must be relinquished to the domain registration authority if the business closes).
  • .net: may only be registered by network companies (IT, communications, internet providers, etc.), otherwise same as .com.
  • .org: may only be registered by non-profit organizations, otherwise same as .com.
  • .edu: may only be registered by educational institutions, otherwise same as .com.

All names used for business purposes should require additional registration requirements (not government controlled!), e.g. the above-mentioned. These requirements should effect a verification procedure that makes sure the information provided is accurate. Now, this would admittedly upset many domain registrants, such as individuals and those that do not fit the mold as described above, but it would accomplish the goals of the top-level domains in the first place: to effectively categorize the internet. In addition it would free up domain names and put an ill-gotten industry out of business without harming the liberties of individuals. Well, that, and of course I would be able to get the domain name I’m looking for. ;-)

Testing Contribute Publishing Server 1.11

Friday, August 24th, 2007

,,,

Well, here is the promised follow-up on my evaluation of Contribute and its buddy CPS.

I had some initial trouble getting it configured so that it would tie in to our ActiveDirectory server (that way we don’t need to manage users aside from in ActiveDirectory). The problem was that I couldn’t establish a connection between CPS and AD.

My assumption at this point was that CPS as actually seeing AD, but I was providing incorrect credentials. Well, the CPS documentation states that you need to enter your user DN as follows: uid=username, ou=group, dn=server, dn=com. This never worked for connection to AD using Windows Authentication Method, eventhough I customized it to use our schema (meaning instead of uid I used samAuthentication).

Making a call to Adobe Support also proved fruitless, as they will not support unregistered (speak trial) versions of their software. When I mentioned that I was evaluating the software for a company with the possibility of a future purpose, it didn’t even phase them; *Indian accent* “I’m sorry sir, we can only support registered versions of your software.”

Back to the drawing board. Luckily (after hours of searching) I stumbled accross a post that mentioned that the user was connecting using the folliwng user DN: user@server.com. This worked like a charm!

Now that I was up and running, I ran contribute and began administering the users (I could now search active directory) and was able to establish a writer > publisher > admin workflow process. Exactly what we are looking for.

Contribute really is the optimal solution if you want to give your content writers as little or as much leeway as they need, while not sacrificing versatility (which is often lacking in CRMs with admin modules). Our users can now create whatever content they wish withing the parameters we allow them, without fear of them breaking site funcitonality; all the appropriate checks and balances are in place.

The downside is, that is is divorced from your Microsoft development path that comes with using Visual Studio. In our case that is not a real big deal, as we will simply use Adobe line of software for our public company site, and continue using Microsoft line of software for our intranet. This is a clean division of applications that corresponds to the division of responsibility (meaning that the users creating content for the public site aren’t the users managing the intranet).

What CPS provides is a tie-in to AD (user management), change control (versioning up to 99 changes per page), and mist importantly process workflow.

Testing Contribute CS3

Thursday, August 23rd, 2007

Where do I start? Well… I guess I could post about the reason behind this post. I am currently evaluating Contribute CS3 as a potential tool for our non-technical staff to assist in maintaining our company we site.

So far I am amazed at the ease of use in Contribute CS3! I played around with it back when Contribute 2 was published (not CS2), and dismissed it as a nifty tool that didn’t have any real value to me at the time. However, it has significantly matured since, and am delighted to find that it recognized my custom install of this WordPress blog on my site with no manual configuratino necessary! (It also recognizes many other blog standards, like Blogger, etc.)

Further testing will determine how viable it is for a medium-sized business that wants to allow content publishing to its web site without necessarily involving the IT department all the time. This means establishing of roles, publishing rights, and chain of events in the publication process. Contribute Publishing Server should allow for all this (and more!).

I’ll break into that next.

[Update: 9/25/2007] At the moment I am still awaiting purchase of Adobe CS3 at my workplace to post more detailed testing results. This post was basically a use-case for connecting to my WordPress blog. Future write-ups will be more detailed.

Ubuntu 7.04: Fixing Screen Refresh Rate

Sunday, July 8th, 2007

Well, after installing Ubuntu Feisty Fawn from scratch again, I have lost all my settings. This includes the screen refresh rate settings that are specified in /etc/X11/xorg.conf. If you are experiencing low screen refresh rates (usually 60Hz) and would like to adjust these higher, look for the following section “Monitor”. Adjust the upper limits similar to the following:

Section "Monitor"
Identifier "Generic Monitor"
Option "DPMS"
HorizSync 28-101
VertRefresh 41-160
EndSection

Now, log off (back to the login screen), and press <CTRL>-<ALT>-<BACKSPACE> to restart the X-Server without needing to reboot completely. Proceed to log in, and set your refresh preference.

Suppress “affected rows” Output in MS SQL Server

Friday, June 22nd, 2007

It gets a little annoying when you’re writing a log in your SQL script, only to have it cluttered with (x row(s) affected) statements. These can be very easily disabled by using the following command:

SET NOCOUNT ON

JavaScript Fading Colors

Monday, June 18th, 2007

I’m sure many of you are aware of the JavaScript scripts floating around the internet allowing for fading colors on web pages. The ones that I have seen tend to not use a class-based approach. Tonight I embarked on creating a color-fading class using only JavaScript. It was important for me to write this as a class for two reasons: I’m a great fan of object-oriented development, as it allows you to really ‘hook’ into the application (for testing, API documentation, and more).

What turned out to be the biggest problem was the timing between color changes. Traditionally JavaScript (JS) uses it’s infamous window.setTimeout() command to allow you to call functions after a certain amount of time has passed. The drawback with that command is that you cannot use objects with it, for the following reasons:

  • If you pass in an object that depends on reference (i.e. you want to execute a class method for a certain instance of that class), it looses the reference, and most likely won’t find the method called.
  • If you run multiple iterations and pass in variables to the method or object you are executing within setTimeout, and the code has completed running prior to executing the call in setTimeout, the each iteration will use the last available values of your iteration; it does not remember the individual values of the parameters of each iteration.

So, very bad situation. And searching the web only complicated things more for me. There had to be a simple way to get around this. This got me to thinking about how I could retain instance- and iteration-specific values, and still be able to use setTimeout. I had used function wrappers before in non-JS projects, so I thought it just might work here as well.

What I did was write a wrapper class for the setTimeout function. Each call to the setTimeout function would create a new instance of my wrapper class, thus retaining all the relevant information that I passed in at the time it was being passed in! And what do you know, it worked!

I have attached the code here, for your criticisms, as well as suggestions. Feel free to make use of it, should you like. Please do drop me a line if you do decide to use it. Also, if you make any updates or changes, please email me your changed code, as per the licensing agreement.

To use it, simply add a tag to any object that can have a background-color, like so:

<p fade="#ff0000|20|1500">Self-fading example (on page load).</p>
<p fade="||">Self-fading defaults example (on page load).</p>
<p onclick="FOBC.fade_element(this, 30, 3000, '#ffff66');">Event-driven fade (i.e. on click).</p>
<p onclick="FOBC.fade_element(this);">Event-driven fade with defaults (i.e. on click).</p>

Click me for demo.

Download: fade.js
Include the file in your page header, like so: <script type=”text/javascript” src=”fade.js”></script>

Syntax is: fade=”[hex color]|[frames per second]|[duration in miliseconds]”.
To use the pre-set defaults, simply use the following: fade=”||”, however, fade=”" will not work.
The defaults are: fade=”#ffff66|30|3000″.
Using the previous syntax will fade all items on page-load.

To fade items on demand, use the following JS:
Syntax is: FOBC.fade_element([DOM object], [frames per second], [duration in miliseconds], [starting hex color], [target hex color]);.
To use the pre-set defaults, simply use the following: FOBC.fade_element(document.getElementById(”test”), null, null, null, null);.
Defaults are same as above.

[Updated August 16, 2007: Included click demo, and added code examples.]

[Updated August 24, 2007: improved click demo.]

[Update August 24, 2007:] I have discovered a bug that will break the rendering of the fading effect, and will have a fix for this in shortly: when clicking and dragging (speak: highlighting) text that has a fade event, the fade will stutter and then cease to fade entirely. This also occurs when high-lighting text with a fade event through double-clicking.

Creating a Baseline Development Environment - Problem Analisys

Saturday, June 16th, 2007

Over the past few months I have been working on creating an optimum development environment for creating web applications in .NET. The current development environment is for creating web applications in PHP.

While the tools differ (.NET vs. PHP), the goal is still the same: creating web applications. Thus, you should be able to use the same development environment. Now, this will not hold water if you have a PHP environment that is highly specialized toward PHP development; the same goes for strongly .NET dependent environment set-ups.

My contention here is that your development environment should be set up according to the goal, and not the specific flavor of technology being implemented. This will allow for migration between different technologies without creating a huge upset in the way things are done. “What are you specifically getting at here?”, you ask me. Well, lets examine what a development environment entails.

Research
Ideas don’t just make themselves. A lot of thought, trial and error, and playing around goes into perfecting an idea and developing a use case and proof of concept. This includes database designs, code, integration of 3rd-party-tools, plug-ins, and so forth.

Documentation
Once your idea matures and you are able to show proof of concept and derive a use case from your research, it needs to be documented. Often documentation is a burden placed on developers or technical writers to satisfy process, and not necessity. I’m not talking about writing a doctorate on the work that needs to be implemented (code changes, functionality updates, new project design, application design, etc.). What I’m talking about here is the short and sweet documentation that is concise, demonstrative, and clear on how to implement the proposed items outlined in the document. You should be able to hand one portion of the documentation to any developer who should be able to create the desired end product without having to consult with the client. It needs to be that good! And at the same time you should be able to hand the other part of the documentation to the client, so as to give them a clear picture of exactly what the end product will do, what its specific parts are, how they interact, and how the client’s users will interact with them. Yes, it has to be that good. Only then will you achieve a useful product that your clients will be happy with.

Architecture
You will architect your products and applications based on the documentation, as well as your findings from your research. Architecting and documenting a web application design often go hand-in-hand and will require extensive revisioning of the documentation. Your application architecture needs to implement best practice designs wherever possible. If there aren’t any for your given situation, don’t hesitate to create best practices and publish them! Public scrutiny is your best advocate in creating high quality designs.

Development
The development stage of the product should not entail any unforeseen activities. Yes, you have developers, but they should not be trying to figure out problems as they are developing your applications. All problems, hurdles, and glitches should have been thought through in the documentation and architecture phases. At this point the development should follow the guidelines of the documentation, just as a cook follows a recipe.

Testing
While your situation may not allow for test-driven development, it is the best way to achieve your development goals with a minimum of bugs, and it also encourages use of best practices. Test-driven development means that you first develop a test class with various test methods that test each functionality of your application. Since you have thoroughly documented all functionality, you already know what you want to achieve; you write your test methods to test for the desired result by running the methods, classes, or functions of code in your application that correspond to that functionality. If the function fulfills those requirements without failing, you have achieved your goal, and your test is successful; if not, your test fails.
Like I said, not all environments will allow for this, and in the event you can’t or decide not to implement this, you always need to test your code during its development to ensure that you are meeting your goals. This testing should optimally include peers, so as to expose your code to their scrutiny. They will have feedback, certainly if there are errors, and more often than not even if your code runs fine. There is always room for improvement, and it is a great way to advance your programming skills.

Trial Phases
Once portions of the application are preview-ready they should be tried by the client. Never abandon your client during development. Keep them up-to-date at least on a semi-weekly basis, if not daily. Your client will never ever get the design specs exactly how they need to be in practice, so the trial of functionality will reveal any problems that actual implementation may hold. Keep your client in lock-step with your development, show them what’s going on, and even what is not working. Give them the opportunity to adjust the project. This is not necessarily scope creep, but more often corrective measures. We like to label this scope creep so that we can blame the client for missed deadlines. However, not all changes need too be implemented right away. Document any planned changes and add them as enhancements after the project is rolled out, or in another phase of development. Try to avoid adjusting your current documentation to much, as it will cause disruption in the development process, if many developers are working on many different parts, and have to rework a lot of their code. On the other hand, if extensive re-work is required it may be best to halt all development and iron out the details with the client, re-document, and then go from there.

Deployment
Once all trials have been performed satisfactory, the product needs to be deployed into the production environment. The deployment mechanism should have no impact on the development environment, and should not be part of, or depend on, your development environment. If at all possible, deployment should be automated, so as to avoid human error.

Maintenance
We all know that there will be updates and bug-fixes down the road, no matter how good we code an application. Maintaining bugs, and tracking errors should be done in a standardized way, regardless of technology. This means that your applications should inform you that the client is having problems. You should be aware, and maybe already have a patch available when the client comes to you with their issues.

Everything I outlined here is technology independent. It is a collection of procedures that can be adhered to regardless of the technologies being used. This means that you should be able to switch from PHP to .NET development in the same environment with no impact on your procedures, making the life of your management so much easier. Heck, it will make your life so much easier, too.

Now, this isn’t as easy as it sounds. We often have special tools to aid us with each of the above processes, like bug-tracking, project management, deployment, code versioning, and so on. Often these tools integrate with our development environments to make our lives (at the moment) easier.

This is the actual crux of my post: what tools can aid you with your processes, while remaining technology independent. I will post more on this as I work through it myself.

Renovation: the furniture has been moved!

Monday, June 11th, 2007

Well, to my delight WordPress 2.2 features enhanced Blogger import functionality, with which I have brought over all my previous posts (I discovered this after I had already manually copy/pasted all the posts, but nevertheless!).

Consider the furniture moved. Now, to re-decorate: I need to redesign my template. While the default WP theme will do for now, it’s not as slick as it could be.