Posts

Showing posts from 2008

Support rich text with the Yahoo! User Interface Library

During a recent project, my team's task was to redesign a Web page that utilized an ActiveX control as a rich text editor. One goal of the project was to replace the ActiveX control with a more standardized approach. We chose to use the rich text editor available with the Yahoo! User Interface (YUI) Library . This week I examine using the YUI Library's Rich Text Editor. YUI Library The YUI Library is a set of utilities and controls in JavaScript, as well as CSS templates for building richly interactive Web applications using standard technologies such as DHTML, DOM scripting, and AJAX. You can download the YUI Library 2.3.1 for free from SourceForge.net. The download allows you to install the libraries on a Web server. Another option is to use the library files directly from Yahoo! servers. Yahoo! provides an excellent overview of how to use its servers for applications implementing functionality via the YUI Library. Rich Text Editor A recent addition to the YUI Library

Moving to CSS-based layouts with the YUI Library

While initiating a recent project to make substantial changes to an existing Web application, it was decided to dump the table-based layout used in its original design in favor of CSS . We opted to use the Yahoo! User Interface (YUI) Library after evaluating different approaches. The YUI Library provides core CSS resources that have been developed by a professional team of developers and extensively tested by the Web community. This tutorial walks you through the steps of how to move from a table-based design to a CSS-based layout with the help of the YUI Library. The layout It is worth considering the division of screen real estate in the application to understand how it is coded using both tables and CSS. The overall page is divided into two horizontal sections: a header and a body. The header portion can be further divided into three horizontal strips. The first strip contains a strip of color at the top. The middle row contains text and a logo on a white background. The final

Build directory structures using SQL Server 2005

If you ever work with directory structures on the filing system, you know how challenging it can be to traverse through folders to find specific file(s). If you store this type of information structure in the database, you are even more aware of what it takes to retrieve the data. Writing queries to pull this information is sometimes difficult to achieve and inefficient. You can use the recursion and XML features in SQL Server 2005 to build a file location on the fly. Example This example searches for a document and builds the path to the document based upon a parent-folder to child-folder relationship in the database. One file will belong to one folder, which may be a child folder in a long lineage of parent folders. The ultimate goal is to provide a file to be searched for, and the process will build the location to the file. I've seen file path locations stored several ways in the database, usually with the purpose of storing the location of a file to be pulled for a Web s

Adapt to your audience with CSS media types

In addition to worrying about browsers, Web standards, and more, you also have to consider the multitude of devices or media that may be used to view a site. The CSS media type provides the functionality to build Web applications whose presentation may vary with its target media. Here's an examination of this CSS feature, along with examples. The media A CSS media type names a set of CSS properties. A user agent that claims to support a media type by name must implement all of the properties that apply to that media type. Style sheets allow you to specify how a document is presented with different media. For example, viewing a page on the screen should be presented differently than when it is printed or spoken via a speech synthesizer for the visually impaired. Here's a list of the media types that are currently supported: all: Applies to all media types. aural: Used for speech and sound synthesizers. braille: Provides support for braille tactile feedback devices. embos

How do I… Create a scrolling content box in CSS?

In my last TechRepublic Programming and Development blog entry, I showed you how to use Flash to create an animation that mimicked the behavior of the retired (and sometimes reviled) <marquee> tag. I had mentioned that it was possible to use CSS to duplicate the <marquee> tag as well, but only if it were coupled with a few lines of knotty JavaScript. However, there is an alternative CSS markup that will let you confine large blocks of content to a set width and height and let you scroll through them using a scrollbar control. This gives the effect of viewing content in a frame (remember those?), but the scrolling box stays put on one page and you can place it anywhere in your layout that you wish. This gives both you and your clients much more control over how you view your Web pages. All of my clients like this layout solution, and I bet yours will as well. This blog post is also available in PDF format as a TechRepublic download , which includes a sample Web page and t

Create custom Visual Studio 2005 code snippets

Visual Studio 2005's built-in code snippets are great, but you can extend the concept by creating custom code snippets to easily reuse common code blocks in your application. This tutorial walks you through the process of creating custom code snippets. Creating the file Code snippets are defined in XML files with the .snippet file extension. Microsoft created the Code Snippet XML Schema , which defines the structure of a snippet XML file and specifies the elements (and their attributes) that you may use in a code snippet file. Since code snippets are defined as XML, you can use your favorite XML or text editor to create and maintain them. Visual Studio 2005 supports XML editing, so it may be used to remain in a common environment. Code snippet example Depending on the project or organization, many code snippet candidates may exist. This may be a discrete chunk of code that you may reuse throughout the code (this also lends itself to a code library). In addition, the code may

Visual Studio 2008 simplifies JavaScript debugging

Image
One of the more cumbersome development tasks is debugging client-side JavaScript code. Tools such as Firebug are helpful, but in the case of Firebug, you're forced to use Firefox. Thankfully, Visual Studio 2008 provides a robust and developer-friendly environment for debugging JavaScript. Simplification Whenever I hear developers discuss the JavaScript debugger features in Visual Studio 2008, I notice that they're quick to point out that this type of functionality has been available in prior versions of the Visual Studio IDE for a long time. This is certainly true, but the improvements in Visual Studio 2008 make it much simpler to use. The irritating aspect of JavaScript debugging in Visual Studio 2005 is that you have to first execute the application before any breakpoints can be created in your JavaScript. This approach has been modified in Visual Studio 2008 to allow breakpoints to be defined in the source code before the application runs. In fact, you can set them in b

Why it’s impossible to become a programming expert

The pace of change in the technology industry has made it nearly impossible to specialize in much or become an expert in anything. I started cluing in on this a few years ago when I was reading a lot about Lisp, but I simply didn't have time to try it out. Learning Lisp, and learning it well, requires a lot of reading, practice, trial and error, and so on. This would have been fine and dandy, but I wasn't doing this during my 9-5 job; this was just a "wouldn't it be neat to learn this?" type of project. A few months ago, my father and I were discussing the topic of expertise, and some of the things he said really clicked in my head. Compare the amount of knowledge needed to really know C, Pascal, or maybe COBOL to their modern business programming analogues of J2EE and .NET. There are a few commands, a few primitive types, and a few operators. Let's look at the libraries in 1991 as an example (1991 is the year I learned to program). Windows was just starting

Manager won’t hire moonlighters

A TechRepublic member has a problem with prospective employers who won't hire him because he has a side business. How should he handle it? ————————————————————————————————————— In a blog this week I wrote about how to convince a prospective employer that you're not overqualified for a position . One of our TechRepublic members was frustrated by the fact that a couple of the people who interviewed him for a developer position refused to believe that he would be happy stepping down from the management position he currently held. This week, another member wrote in with a similar complaint. In this case, prospective employers think some business endeavors he started while on a hiatus will interfere with any new full-time position he gets. Here's the scoop: "I took a year's hiatus from IT and started up a few small businesses (consulting, web development) to keep me busy and to learn some new skills. Now that I'm back to looking for a job, employers ques

AJAX should not mandate HTTP

An interesting and unfortunate by-product of AJAX applications is that these applications rely upon the existence of an application server always being available. Many Web users are used to the idea that they can save a Web page to be read at their convenience. Even when there is Flash on the page, the page still works offline. After all, HTML is simply a document storage format, and HTTP is simply a protocol designed to optimally transmit HTML documents. But, in reality, more and more Web developers are assuming that the user will not want to save the Web page or lose network connectivity. I think that this is a mistake. A lot of frameworks have come out recently that are designed to tackle the offline problem; the frameworks' approach is usually to run a database on the client. The database can cache data from the "home server," and if the user makes changes while offline, that database can write the changes back to the "home server" when it becomes available

Cyber-bullying- the impact and the consequence

This is a difficult story on many fronts. In reading the facts, it is hard to believe that this kind of thing can happen. There may be a desire to blame the victim- who should have been "smarter." There is also a desire to shake the perpetrator who clearly should have known better. But perhaps it is a cautionary tale that we can all learn something from on many levels- not only personal, but from a corporate standpoint as well. On May 15, 2008, a federal grand jury indicted Lori Drew, 49, of O'Fallon, Missouri with one count of conspiracy and three counts of unauthorized computer access. If convicted, each count could net Ms Drew five years. Why does this matter? Allegedly, Ms. Drew, her 13 year old daughter, and Ms Ashley Grillis, 18, who was employed by the Drew family, created a fictitious MySpace profile for the purpose of harassing Megan Meier, a teenaged girl living on the same block as Drew and her family. For the next four weeks, a flirtatious relationship blo

Alpha Five: Data-driven application development done right

Alpha Software specializes in creating tools that let developers easily create data-driven applications. Richard Rabins (Co-Chairman) and his brother Selwyn Rabins (CTO) showed me the ropes on the latest version of its Alpha Five development package, and I'm pretty impressed. What is Alpha Five? Alpha Five is a package that allows developers to rapidly and easily create data-driven applications. I know… we've all heard this promise a dozen times before, so now we're pretty jaded by it. In this case, I am inclined to believe that someone got the formula right. From the demonstrations that I saw, Alpha Five "connects the dots" that most of the mainstream products just simply leave unconnected. For example, we're all familiar with the pain of putting together the standard master grid/detail view with a search box Web page. Here is a great example of the benefits of Alpha Five that I saw in action. Let's say that you need to put a grid component on the sc