webdeveloperss.com

WebDeveloperss  

Hand-Picked "Best of the Web Dev Blogs" (Beta)

Favicondrupal: Frequently tagged products at Amazon.com

Cracking Drupal: A Drop in the Bucket (Paperback) tagged "drupal" 3 times 4 Jun 2009, 8:03 am

Cracking Drupal: A Drop in the Bucket
Cracking Drupal: A Drop in the Bucket (Paperback)
By Greg Knaddison

Buy new: $26.40
40 used and new from $19.85
Customer Rating: 4.5

Customer tags: (3), (3), (2), (2), (2), (2), (2),

Blinklist Blogmarks del.icio.us Digg Ma.gnolia My Web 2.0 Newsvine Reddit Segnalo Simpy Spurl Wists Technorati

FaviconFlashtuts+

AS3 101: Variables 3 Jun 2009, 5:00 am

Back in March, when Flashtuts+ first appeared, we had a huge amount of requests for specific subjects and tutorials. A staggering 25% of those requests were for a series of tutorials to take beginners through the fundamentals of ActionScript. In true Envato style, we’ve listened to our audience; today sees the launch of a string of tutorials to lead you through ActionScript 3.0 from the ground up.

Whether you’re looking at ActionScript for the first time, or simply want to refresh a few things in your seasoned mind, these comprehensive tutorials aim to help you. Read on to learn more about the author and, of course, the first in the series: Variables..

AS3 101

This is the beginning of a series which will walk through some of the fundamental concepts of programming, as they apply to ActionScript 3.0. To kick things off, we’ll talk about variables. This tut is aimed squarely at those who have little-to-no scripting experience, but if you’ve used variables without really getting into the intricacies of datatyping and casting, you may want to follow along.

Thanks also to Davide Di Stefano for allowing us to deface his icon.

Introduction

Over the following steps, we’ll build a simple example, the main feature of which is the row of buttons that act as a group. The currently selected button has a different appearance, it can’t be clicked on again and the appearance is restored to its original state when another button is clicked. We’ll use a variable to keep track of what’s going on.

Step 1: What are Variables?

First things first: let’s define what a variable is. If you remember high school mathematics, you may recall that variables are "stand-in" values. That is, they are symbols (usually single letters, such as "x", or the "E" and "m" in E=mc2) which represent a numeric value. It is understood that the value might change depending on other factors in an equation.

In programming, a variable is exactly the same thing, with two main exceptions. First, in programming, a variable can hold more than just a number. It can hold a sequence of text characters (called a "string"), it can denote true or false (called a "boolean"), or it can hold something much more complex, like a date, an XML document, or a movie clip.

The second main difference with mathematics is that programming variables usually have descriptive names, rather than just a single-letter name. There are exceptions, of course: "x," "y," and "z" are commonly used to reference positions and "i" is commonly used denote the current iteration through a loop. A name which is relevant to the value being stored is not only common, but also helpful in keeping your program legible. For instance, if you wanted to keep track of how many particles you have on screen, you might name your variable "particleCount" or "totalParticles."

Like mathematic variables, programmatic variables have the potential for being changed during the course of the program. For instance, if you started with 10 particles, the variable "particleCount" would have the numeric value of 10. However, if you generated 10 more particles, the variable would then have the numeric value of 20. This is one of the key features of variables. You have a name that references a value, but that value is not necessarily going to be the same every time you access it. This is a mysterious but powerful aspect of variables. You’ll learn to appreciate this, even if it’s confusing at first.

To sum up this definition, a variable is basically a container to which you assign a name and in which you put a value. You can always get the value contained inside by referencing the variable by name and you can put a new value inside the container at any point. Any time you access the variable by name, you get the current value contained therein. For further reading, you may want to see what Wikipedia has to say about variables.

Step 2: Declaring a Variable

Enough theory, let’s actually get to work with making variables. Create a new Flash document (ActionScript 3.0). Click on the first frame of the first layer (it should be the only frame).

Open up the Actions panel by choosing Window > Actions (or pressing F9 on Windows or Opt-F9 on Mac).

In the Actions panel, type the following:

var message;

At this point, the varible is declared. This means that the container exists, but currently has no associated value.

This is the bare minimum you need to declare a variable. The word "var" is known as a keyword, meaning it’s reserved by the ActionScript language and has a specific meaning. In this case, it declares a variable. It needs to be followed by the variable name you want to use; if you don’t follow the var keyword with a variable name you’ll get an error when you try to test the movie.

Step 3: Naming your Variables

There are a few rules you should follow when naming your variables. Some are enforced by the ActionScript compiler, others are just conventions which, when followed, help you and others make better sense of your code.

First, the ActionScript language dictates that you can only use certain characters in your variable name. These are any alpha-numeric characters (letters and numbers), the underscore and the dollar sign. Any other character (hyphens, the space, the period, etc) is not allowed. Usually this is because many other characters have special significance in ActionScript.

ActionScript also imposes the rule that the variable name must not start with a number. Numbers are, however, allowed after the first character.

It also bears mentioning that ActionScript is case-sensitive, meaning that you must match the letter’s case when referring to a variable. In otherwords, the variable "message" is not the same as the variable "MESSAGE". This may seem restrictive as first, but there are actually good reasons for enforcing this. Space doesn’t permit a discourse on these reasons, however. For now, just learn to type your variables’ names exactly the same each time you want to use them.

The ActionScripting community at large has come to a general consensus on how to name your variables, although the following rules are more conventions and guidelines, rather than being enforced by ActionScript.

For starters, you should use descriptive names. This is a sort of self-documenting technique. If you name your variable "message," it’s likely you already have an idea of what the intended role of the contained value is. If it were simply "m," then that’s far less clear. It’s tempting to use abbreviated variable names and while you are initially writing your script it might mean less typing and still make sense. The next person to look at your code, or you yourself six months later, will likely be confused.

Another convention is the use of camel case. This is a technique for turning two or more words into a single word. Remember that you can’t use spaces (or any other white space, for that matter) in your names, so if you wanted to use the phrase "total particles" you have to find a way of getting rid of that space. "totalparticles" works, but the separation between the words is lost. Camel case is a method of capitalization that says that the entire word is lower case except for the first letter of each word, with the exception of the first letter of the first word. In other words, applying camel case to "total particles" results in "totalParticles".

There are more guidelines for choosing variable names, but they start to get more esoteric from here. For now, keep in mind the above rules and you’ll be off to a great start. Wikipedia has a few articles on the subject, including a short section in the previously linked article on variables in general, this article on naming conventions, and a short article on an effect called shadowing. Some other interesting reads are this list of bad variable names,this pronouncement of the two worst variables names ever and this anecdote describing why variable names matter.

Step 4: Setting a Value

Now that our variable is declared, we can put a value into it. On the next line of the Actions panel, type the following code:

message = "Hello";

We start by simply using the variable by its name. Then we follow it with an equals sign, which is known as the assignment operator. Following that, we have a quoted sequence of characters (ending with a semi-colon, which is just the way you end lines in ActionScript - you’ll see a lot of terminating semicolons in code).

The assignment operator requires that there be something on either side of it. It works by taking the value on the right side ("Hello", in this case) and putting it into the variable on the left side (message).

If we were to run this code, we would have a variable named "message," which contains a value of "Hello." It’s not doing anything else, so there’s nothing to see at the moment, but it may be a good idea to test the movie anyway to make sure you don’t get any errors, in case you typed something in wrong.

The script should look like this so far:

Step 5: Getting the Value

We now have a named container that has a value inside of it. Let’s access that value. In this case, we’ll simply trace the value to the Output panel.

On a new line of code, write the following:

trace(message);

The whole script will look like this:

As you may know, the trace function takes whatever you pass to it in between the parentheses and puts it into the Output panel. When you test the movie, you should see the Output panel open automatically and the value of the message variable (”Hello”, without the quotes) printed to it.

Any time you use the variable by name and are not putting it on the left side of the assignment operator (the equals sign), you are asking ActionScript to get the value contained by the variable and use that value. This is called evaluating the variable.

Step 6: Manipulating the Value

Now let’s prove that we can put different values into the same container. On the next line, let’s set the value of the message variable again:

message = "How are you?";

And then on the line after that, trace it out again:

trace(message);

The whole script will look like this:

Run the movie and you should now have two traces:

Notice that lines 3 and 5 are identical – they both trace message, but they produce different results! Each time we ask for message to be traced, the current value of the variable is evaluated and used. First it gets set to "Hello" and that shows up in the Output panel. After that we set it to "How are you?" and then that shows up in the Output panel.

It’s not rocket science, but this is one of the more confounding aspects of using variables. If you can master this, you’ll be well on your way to becoming an ActionScript guru.

Step 7: Understanding Datatypes

ActionScript supports something called strong typing. It’s an interesting language in that it’s only strongly-typed if you tell it to be so and it can be strongly-typed at certain points and weakly-typed in others. There is something to be said for the ease of use of a weakly-typed language, but most serious programmers will be able to talk for a few hours on the merits of strong typing. So what is it?

Strong typing simply means that when we declare a variable, we can also declare what kind of value can be put into it. That is, if we say that our message variable can only contain a string (as it happens to do so currently), then if we tried to put a number or date into it, ActionScript will complain in the form of an error. Causing errors might seem like a hindrance, but when you empower the computer to catch your errors for you, you actually end up saving time. Weakly typing your variables will avoid compiler errors, but might allow logical errors (for instance, trying to uppercase a number), in which case things can fail without warning. Allowing room for compiler errors through strongly-typing your code actually saves you time in the long run.

A datatype is, in a nutshell, the type of data that a value is. That is, values can be a string, a number, a boolean, a date, an XML document, a movie clip and many more built-in types - even types you create. Our message variable is implicitly of type String (note the capital "S"), so let’s make that type explicit. We’ll make our code strongly-typed, by decalring a datatype. Back on the first line of code, where we declare the message variable, modify it to read:

var message:String;

The colon specifies that what’s about to follow is a datatype and then you’ll see the datatype itself. All built-in datatypes will start with a capital letter and that is a common convention for custom datatypes as well. We won’t be getting into writing custom datatypes, however.

If you run the code at this point, you should see that it functions exactly the same.

For a longer discourse on datatypes and strong typing, head over to Wikipedia.

Step 8: Causing an Error

We can, however, illustrate how strong typing works by intentionally causing an error. Let’s add some more code, assigning the variable to yet another value. This time, though, we’ll try to put a number into it instead of a String. At the end, type the following:

message = 42;
trace(message);

Test the movie and you should see the following error:

1067: Implicit coercion of a value of type int to an unrelated type String.

The language is a little archaic, but it simply means that we have a number (or an "int") value and we tried to put it into a variable that was previously declared to only contain Strings.

Let’s throw another error. Delete the two lines of code you just added and replace them with the following line:

isNaN(message);

Then run the movie. You should get the following error:

The isNaN() function expects a number to be passed in to it through the parentheses (NaN means Not a Number, which is a special value meaning a number that doesn’t actually have a value. This function tests for that case). Since we’re passing in a String, we get basically the reverse error of what we had before.

Note that if you remove the String datatype from the variable and then re-run these two experiments, you won’t get an error. The code will actually execute and in this case the lack of datatyping isn’t such a big deal. In larger projects, having this kind of insurance can prevent errors and bugs that bring down your whole movie.

Step 9: Create a Button

That should be enough of an introduction; let’s see a specific use of variables in action. We’ll now start making the button group example shown at the start of this tutorial.

Create a new ActionScript 3 Flash file and create some art to serve as a button. Turn it into a movie clip.

Step 10: Create Four Instances

Drag the symbol on the stage four times so that there are four instances of the button. While it’s not necessary for the function of the movie, you may want to arrange them in a row at the top of the stage. Give each an instance name by clicking on each one individually and typing the name into the instance name field of the Properties panel.

I’ve named my buttons "button1," "button2,""button3," and "button4." For simplicity in following along with the code, be consistent and use my names.

Step 11: Create a Text Field

Underneath the row of buttons, create a dynamic text field, give it an instance name (I used "output") and go ahead and make it as big as will fit on the stage. The purpose of this text field will be to log the names of the buttons as they are clicked. We don’t need too much horizontal space but should have as much vertical space as possible.

Step 12: Hook Up Click Listeners

Create a new layer to hold your code, lock it and then click in the frame for that layer. Open the Actions panel. Write the following code to hook up an action to respond to mouse clicks for each button:

button1.addEventListener(MouseEvent.CLICK, buttonClick);
button2.addEventListener(MouseEvent.CLICK, buttonClick);
button3.addEventListener(MouseEvent.CLICK, buttonClick);
button4.addEventListener(MouseEvent.CLICK, buttonClick);
function buttonClick(event:MouseEvent):void {
	trace("click");
}

For now, the actual action taken in response to a click is trivial, but it’s enough for us to test. If you’ve done everything correctly so far, you should be able to test the movie and click on each of the four buttons. Every time you click, you will see the word "click" show up in the Output panel.

Step 13: Understanding Event.target

You may be wondering how we’ll accomplish our goal with just a single function. How will that one function react appropriately for each of the four different buttons?

Without getting into too much detail into the event paradigm of ActionScript 3, every function that acts as an event listener will receive an event object as a parameter. There are several kinds of event objects, from regular Event objects to MouseEvents to KeyboardEvents to ProgressEvents and more, but every event object will have a few common characteristics. One of the most useful of these is the "target" property. Every event object defines a target property that points to the thing that actually caused the event.

We can tell which button was clicked by accessing the target of the MouseEvent in the function. To see this in action, change the function contents to:

trace(event.target.name);

The whole script looks like this:

Rerun the movie and click on the buttons again. You should see the appropriate name show up in the Output panel.

This works because the event object itself is held in the variable called "event." That object has a property (a property is basically a variable, except that it belongs to an object) called "target", and using dot syntax we can access the target variable from the event variable. The target is the movie clip that was actually clicked and caused the event. By accessing the name property of that movie clip, we can get an indication of which button was clicked to print to the Output panel.

Step 14: Output the Button Name

Let’s now actually do something when a button is clicked. We’ll put the button’s name into the text field. Add the following to the buttonClick function (replacing, if you like, the trace statement)

output.appendText(event.target.name + "\n");
output.scrollV = output.maxScrollV;

The first line puts the name of the clicked button into the text field. The appendText() method will take the current text and add to it. We’ll put a newline character (the "\n") at the end of the added text to make sure the next bit of text added will be on a new line.

The second line makes sure that the last line of text is always visible. In a nutshell, this line sets the scroll amount (which line of text is at the top of the visible area) to the maximum amount based on how many lines there are.

Step 15: Create a Selected State

Remember that our goal is to make the clicked button the selected button, so we want to visually represent that. To easily make a visual change to the button, we’ll just set the alpha to something slightly transparent.

Replace the trace statement with the following:

event.target.alpha = 0.7;

The alpha property of a movie clip adjusts the transparency and ranges from 0 to 1, with 1 being fully opaque. Therefore, 0.7 is something that’s 70% opaque, or 30% transparent.

Run the movie and click on a button. You should see it change. Of course, we still have quite a bit to implement, so once a button obtains the selected look, it stays that way.

Step 16: Disable Event.target

You’ll notice that if you click on a button, you can continue to click on it, as evidenced by the name showing up each time you click. We want something like a group of tab buttons, where a button that is currently selected can’t be clicked. We can easily accomplish this by setting the mouseEnabled property of the recently-clicked button (still event.target) to false.

event.target.mouseEnabled = false;

The whole script at this point should look like the following:

Step 17: Variable to Hold the Current Button

So far we’re off to a good start, but while the button is reacting appropriately when we click it the first time, we have issues after that. The button is kind of stuck in the selected state and is never restored to its normal state when another button is clicked.

Now we can introduce the variable that will solve all of our problems. We need a variable that will contain the movie clip that is the currently selected button. By storing it in a variable, the information about which button is currently selected can persist from click to click.

We’ll call it "currentButton" and we’ll give it a datatype of MovieClip. At the top of the script, write this line:

var currentButton:MovieClip;

Step 18: Set the Variable to Event.target

Now, every time we click on a button, we want to track that button in the currentButton variable, so that at any given time we know which button is the current one. This is done with the following modification to the buttonClick function:

currentButton = event.target as MovieClip;

Notice the "as MovieClip" in the preceding code. We’ll gloss over all of the gory details here, but this is a necessity due to strong typing. Our currentButton variable is declared as being a MovieClip. However, the target property of the Event object is declared as being an Object, which is a very generic datatype. The target is defined as an Object so that it can be generic; lots of things can create events and so the target won’t necessarily always be a MovieClip. The problem is that the two datatypes don’t really match; we’re promising that only MovieClips will go into the currentButton variable, but we’re trying to put an Object in.

The best thing we can do is assume that the event’s target is, in fact, a MovieClip and so we perform a cast on it. The "as" operator takes the value on the left and treats it as though it were of the datatype specified on the right. The assumption is reasonable, since the code is inside of a function that should only ever get called when the user clicks on a MovieClip and that MovieClip creates the MouseEvent.

Note that casting is not without its problems. The biggest problem comes in the form of a cast that can’t be honored. For example, if we were to try to cast our event.target as an XML object, well, then that wouldn’t work at all, would it? MovieClips and XML objects have very little in common. When the cast is attempted, we would get an empty value back, which leaves us with a broken program. If we’re lucky we’ll get a runtime error saying that the cast can’t be completed; if we’re unlucky we’ll get the empty value and are left wondering why things didn’t work as planned.

Casting should be avoided if its not necessary, but in some cases (like this one) it’s pretty much the only option. If we didn’t cast the target, we’d get a compiler error. Go ahead and try it if you’d like to see what happens.

Step 19: Use currentButton

While not strictly necessary, we may as well use our new currentButton variable instead of event.target in the body of the function. It’s not necessary because while we’re in the function, we have access to event.target and our code will work just fine without making the following change. However, there are two compelling reasons to get in the habit of using typed (and casted, if need be) variables where possible.

The first reason is the main reason. As mentioned in the last step about casting, event.target is not typed as a MovieClip. Yet we know that it is, so we cast it as such. Think back to step 9, where we deliberately typed a variable as one thing and tried to use it as another, which caused errors. Now, if we go and tell the variable currentButton to set its alpha to 0.7, currentButton is a MovieClip and MovieClip has an alpha property and all is good. If we accidentally tried to set the aplah property (it happens more often than you would think), Flash would complain about it and let us know and we’d be able to correct our mistake quickly. Using event.target (which is a very generic, loosely-typed variable), it may take longer to find that typo.

The second reason has to do with performance. In this particular case, we’re not going to see huge gains from using a typed variable instead of event.target. In ActionScript 3, it is faster to use a value out of a single typed variable that it is out of an untyped property (as event.target is). In critical applications this might give you an extra few processor cycles.

So, in this step we are simply changing out occurences of event.target with currentButton, after it has been set.

Your code should look something like the following:

Step 20: Deselect the Old Current Button

Now that we have a variable declared and holding a value, we can use it to restore the visual appearance of the previously selected button. That is, if you click on button1 and it changes appearance, then you click on button2, we want button1 to look normal again.

The next bit of code needs to happen before we set the currentButton variable. Otherwise, we’ll be affecting the current button, not the previous button.

currentButton.alpha = 1;

This will restore the previous button’s appearance, but we won’t be able to click on it. We previously disabled it by setting its mouseEnabled property to false, so we can enable it by setting it back to true. Place this code immediately after the last bit of code we wrote:

currentButton.mouseEnabled = true;

The code should look like this:

Step 21: Check for null Value

If you tried running the movie after the last step, you’ll have run into a runtime error involving a "null object." This is ActionScript’s way of saying that a variable didn’t have a value before you tried doing something with it.

What happened was that when the movie starts, the currentButton variable is declared, but it doesn’t have a value yet. It only gets a value when you click on a button. Well, when you click on a button, the buttonClick function runs and the first thing it does is try to set the alpha of whatever is in currentButton. Unfortunately, nothing is in currentButton and so the "null object" error gets thrown. At that point, script execution stops and so we end up never getting to a place where we can actually set currentButton.

This is easily avoided, though. We simply need to check that currentButton doesn’t equal null before continuing. Replace the first two lines with:

if (currentButton) {
	currentButton.alpha = 1;
	currentButton.mouseEnabled = true;
}

Without getting into too much detail, this sets up a condition that only runs the statement after the parentheses if the statement inside the parentheses has a value. In other words, if currentButton has not been set, then skip the part about setting its alpha and pick up with the next line of code.

Here is the full code, in text form for reference:

var currentButton:MovieClip;

button1.addEventListener(MouseEvent.CLICK, buttonClick);
button2.addEventListener(MouseEvent.CLICK, buttonClick);
button3.addEventListener(MouseEvent.CLICK, buttonClick);
button4.addEventListener(MouseEvent.CLICK, buttonClick);
function buttonClick(event:MouseEvent):void {
	if (currentButton) {
		currentButton.alpha = 1;
		currentButton.mouseEnabled = true;
	}
	currentButton = event.target as MovieClip;
	trace(currentButton.name);
	output.appendText(currentButton.name + "\n");
	output.scrollV = output.maxScrollV;
	currentButton.alpha = 0.7;
	currentButton.mouseEnabled = false;
}

At this point, you have created a variable. It has a name and a datatype. It stores several different values over time, so that at certain points in time you can track the current value and do something with it. You learned about casting and why variables are the building block of all programs of any complexity.

I hope you enjoyed this beginner’s article, feel free to leave questions and opinions in the comments section. We have plenty more tutorials planned for the AS3 101 series, so stay tuned!

Blinklist Blogmarks del.icio.us Digg Ma.gnolia My Web 2.0 Newsvine Reddit Segnalo Simpy Spurl Wists Technorati

FaviconThink Vitamin

Six Ways that Google Wave is Going to Change Your Business, Career and Life 3 Jun 2009, 2:44 am

Google recently announced their most ambitious project to date called Google Wave. According to Google, Wave is “what email would look like if it was invented today.”

If you haven’t made time to watch the one hour video, I’d highly recommend you do so today.

What’s the big deal?

I believe there are six reasons why Wave is going to have a huge impact on you. However, this is all predicated on mass adoption of the technology. If no-one uses it, then obviously it won’t have a world-changing affect. However, I strongly believe Wave is going to achieve mass adoption for these reasons:

  1. Google has the world-wide audience necessary.
  2. Google has the cash in order to market Wave and promote its benefits.
  3. There is a huge financial benefit to working more efficiently. People who use Wave will be able to work faster, thus leaving behind those that stick to good-ol-fashion SMTP email.
  4. Wave is open-source (more on that below). If you want, you’ll be able to run Wave on your internal corporate network, without ever sending a single byte of data to Google.
  5. You can run it on the cloud, thus reducing in-house IT costs.

Now I’d like to explain why I think Wave is going to have a life-changing affect on you and your business:

1. Extensions

Google is making it easy to augment the power of Wave by writing Wave Extensions. These are similar to Firefox Add-ons and they fall into two areas: Robots and Gadgets. Here’s an explanation from the Extensions site:

  1. A robot is an automated participant on a wave. Robots are applications which run in the “cloud” and can modify state within the wave itself. A robot can read the contents of a wave in which it participates, modify the wave’s contents, add or remove participants, and create new blips and new waves. Robots perform actions in response to events. For example, a robot might publish the contents of a wave to a public blog site and update the wave with user comments. Check out the Robots API Overview and a Tutorial.
  2. A gadget is a small application that runs within a client. The gadget is owned by the wave, and all participants on a wave share the same gadget state. The only events a gadget responds to are changes to its own state object, and changes in the wave’s participants (for example, participants joining or leaving the wave). The gadget has no influence over the wave itself. Wave gadgets typically aren’t full blown applications, but small add-ons that improve certain types of conversations. For example, a wave might include a sudoku gadget that lets the wave participants compete to see who can solve the puzzle first. There’s a tutorial if you’re interested.

Screengrab of several Wave extensions

So why are Wave Extensions such a big deal? I believe that developers and designers will be able to sell Extensions to their clients or to a wider audience, possibly in an Extensions marketplace. This means a huge potential source of new income, providing there is mass adoption of Wave.

2. Embedding APIs

Google has created a huge API to Wave, but one of the really interesting parts is the ability to embed a Wave into any web page. A great example of how this could be used with blogging. You can create a Wave and then publish it to your blog. Then whenever someone comments on the blog post, it appears as a reply to you Wave in your Wave client - no need to visit the site.

That’s the kicker, embedded Waves remove the need to physically visit a site in order to interact with it. This is a fundamental, and very exciting, change to the way we currently interact with blogs and content.

Screengrab of an embedded Wave in a blog

So why is the Wave Embedding API such a big deal? It means that content is king and consuming it will become even easier. Really understanding this and taking advantage of it’s power will make you much more effective in reaching your audience.

3. Collaboration

The separation between documents and emails will be completely removed with Waves. This is because Waves can be edited by more than one person. A great example would be taking notes for a meeting. Here’s how it might work:

  1. I create a Wave titled “Notes from website branding project”
  2. I add the other people in the meeting as participants in the Wave
  3. Everyone who is a participant in the Wave can take notes simultaneously
  4. After the meeting, everyone’s got a copy of the notes

An added benefit is that people can “chat” during the meeting, by creating private replies right inside the Wave. The writer can choose whether or not to make this chat visible to other participants.

4. Open Source

Google doesn’t intend to ‘own’ Wave. They have open-sourced the technology and created the Wave Federation Protocol. A brief explanation from Google is:

[Wave Federation Protocol is] the underlying network protocol for sharing waves between wave providers.

Yes, that’s between wave providers: anyone can build a wave server and interoperate, much like anyone can run their own SMTP server. The wave protocol is open to contributions by the broader community with the goal to continue to improve how we share information, together.

To help potential wave providers get started, our plan is to release an open source, production-quality, reference implementation of the Google Wave client and server, as well as provide an open federation endpoint by the time users start getting access.

This means you can either use Wave hosted on Google’s infrastructure, or you can have it hosted on your own server, without ever interracting or sharing data with Google.

This makes it completely different from Microsoft Exchange Server, and even Google Apps (which isn’t available to host on your own infrastructure).

5. Google Web Toolkit (GWT)

Wave is written entirely in Google Web Toolkit. GWT allows you to write HTML 5 web apps in Java, which are then cross-compiled into optimized JavaScript. If you want to learn more, this video explanation is very helpful.

I’ve always been wary of auto-generated code, but I think this might be an exception to the rule (providing your ensure the HTML is accessible and standards-compliant). All you have to do is look at the Wave demo in order to realize GWT is seriously powerful.

What does this mean for you? I means if you’re a web developer, you need to have a serious look at GWT and the potential benefits it has to offer. Programming in Java gives you all the traditional benefits of breakpoints and being able to step through your code.

There is also a plugin for Eclipse if you’re interested.

6. Playback

The increased collaboration that possible with Wave might actually make it confusing for someone to be added to a Wave after a lot of editing and replies have been made. Enter ‘Wave Playback. The best way to explain it is by jumping to minute 13:00 on the Wave introduction video.

This feature allows you to step through the changes to a Wave as they happened over time.

What do you think?

Obviously we think Wave is a big deal, but what do you think? We’d love to hear your comments below.

If you’re interested, there are two other videos that are worth watching:

  1. Live Collaborative Editing: A short video explaining concurrency control and operational transformation in Google Wave
  2. Natural Language Processing: A short video explaining how Google uses their vast search history to implement spell checking.

Photo credit: flickr.com/photos/philipgibbs

Like this article?

If you enjoyed, this article, feel free to re-tweet it to let others know. Thanks, we appreciate it! :)

Related posts:

Blinklist Blogmarks del.icio.us Digg Ma.gnolia My Web 2.0 Newsvine Reddit Segnalo Simpy Spurl Wists Technorati

FaviconNettuts+

40+ Invaluable PHP Tutorials and Resources 27 May 2009, 2:00 am

PHP is one of the most popular scripting languages on the internet today, and one of the easiest to get into. Whether you’re a PHP newbie, or an experienced code-slinger, there is always something new to discover. A function you’re unfamiliar with a killer timesaving tool, a technique that you forgot about…

Object Oriented PHP

  • Object Oriented PHP for Beginners

    Object Oriented PHP for Beginners

    Killer PHP teaches the basics of Object Oriented PHP. An easy to follow 5-page guide with videos to go along with the article.

    Visit Article

  • Building Your First Simple CMS

    PHP for Beginners: Building Your First Simple CMS

    Jason Lengstorf shows how to build a very simply object-oriented Content Management System with PHP. While not a ready-to-use solution, due to a few security holes, it nonetheless does a good job at teaching a real-world use for PHP.

    Visit Article

  • Learning OOP in PHP ASAP!

    Learning OOP in PHP ASAP!

    An authoritative into to PHP OOP here at NETTUTS. Jo‹o Gradim does a thorough job at explaining the basics of Object Oriented Programming in PHP, with plenty of clear code examples and comments.

    Visit Article

Security

  • Tizag

    SQL Injection Prevention

    A brief primer on SQL injection and how to counter it.

    Visit Article

  • Password Hashing

    Password Hashing

    One of the worst things you can do security-wise is to store users’ passwords in plain text. A lot of people use the same passwords on multiple websites, and if someone manages to gain access to your user database, they will have the users’ passwords for everything. You should avoid this by encrypting the passwords with some simple PHP functions.

    Visit Article

  • Chriss Shiflett

    Security Corner: SQL Injection

    Chris Shiflett explains SQL injection, and covers a few permutations of the exploit, along with instructions on how to prevent it.

    Visit Article

  • 5 Helpful Tips for Creating Secure PHP Applications

    5 Helpful Tips for Creating Secure PHP Applications

    Avoid five of the most common security issues in PHP programs, three of which involve user input. If someone isn’t cross-site scripting or injecting SQL, they’re reading your error messages to find other ways to exploit your scripts. Don’t give those pesky script kiddies any room to sabotage your application.

    Visit Article

  • Akismet

    Akismet

    Email spam isn’t as bad as it once was, thanks to improved filtering technology. Now we have a greater menace: Comment spam. Any site with user-contributed messages, such as a forum or blog, could quickly have hundreds of junk messages, filled with links to questionable sites, added to the comment area. Luckily there is Akismet, a spam filter for just this sort of thing. WordPress blogs can use a simple plugin, and other sites can take advantage of the spam-nuking goodness through an API.

    Visit Site

  • ReCAPTCHA

    ReCAPTCHA

    Bots, they’re annoying, but what can you do about them? For blog comments, and similar applications, you have the wonderful Akismet filter, but what about other things? You could always use a CAPTCHA, one of those boxes where you enter the jumbled letters shown in an image. ReCAPTCHA provides such a service, with a unique twist. It helps old books be scanned into digital form, using CAPTCHA results to fix words that their computers couldn’t read. A user is shown two words, one that ReCAPTCHA knows and one it doesn’t, and has the user type both in. If the first word matches, it stores the value the user entered for the second, so the Internet Archive can aggregate the results and automatically figure out what the word is.

    Visit Site

  • PHP Short Tags

    PHP Short Open Tag: Convenient Shortcut or Short Changing Security?

    PHP offers a shortcut for the echo() construct, which looks something like <?=$var?>. It is often used by users of the CodeIgniter framework in Views, as a surrogate for a templating system. Could this convenient shortcut, which depends on short_open_tag being enabled in php.ini, be a security risk? Jeff Starr explains everything.

    Visit Article

  • MySQLi

    Prepared Statements in PHP and MySQLi

    A few years ago, the MySQLi PHP extension was released to improve upon the existing one, known simply as MySQL, like the database software both extensions communicate with. One of the many improvements added was support for prepared statements, a method of querying the database that separates data from the query, which is arguably a more secure way of doing things.

    Visit Article

Common Applications

  • PHP Contact Form

    PHP Contact Form

    Sometimes it’s a good idea to have a contact form on your website. It’s more convenient than a mailto link, and you don’t give out your email address right up front, which can help prevent spam. You can also, with a form, denote fields for mandatory information, which is useful in cases where you need certain information in order to provide an adequate response.

    Visit Article

  • User Membership With PHP

    User Membership With PHP

    User accounts are one the more common components of web applications. Allowing users to register and login isn’t as hard as it may seem at first thought.

    Visit Article

  • SimplePie

    Parse RSS Feeds With SimplePie

    RSS Feeds are one of the best things since sliced bread. Not only can you stay up to date with hundreds of websites’ content, but you can parse them with PHP. You could, for a basic example, display the headlines from a feed on your website, and link them to the full article. Or you could grab the feeds from your social media profiles and pull them all onto your personal website.

    Visit Site

  • Dynamically Create Thumbnails

    How to Dynamically Create Thumbnails

    When you deal with large images, it’s often necessary to create smaller “thumbnail” versions. In gallery situations, you may want to display a grid of thumbnails that link to the larger versions. In a CMS you might want to have an option to upload an image to go with a post, and have a smaller version for display in certain areas. Such image processing is easily within the capabilities of PHP.

    Visit Article

  • Markdown

    PHP Markdown

    HTML isn’t really the most user-friendly way to style text. Sure, some “ordinary” people know it, but overall the markup language is not something that most people want to mess around with. That’s where Markdown comes in. Markdown is a simple method of marking-up text to be formatted a certain way. It uses common conventions such as surrounding a phrase in *asterisks* for italicization, **double-asterisks** for bold text, and > characters for quoting text. It’s all easy enough for most people to grasp, especially since many people write plain text like that anyway. PHP Markdown is an implementation of Markdown for PHP. After including the class, you can convert Markdown-formatted text to HTML by passing the string to the Markdown() function.

    Visit Site

  • Zebra Striping

    Zebra Stripes

    Have you ever noticed how, if you have a long list of data, such as a table showing several data fields, it can be hard to follow a line from one side to the other when you read it? You tend to confuse it with the line below if you’re not careful. Zebra striping, despite the amusing name, is a technique that can much improve readability in such situations. In essence, you simply alternate the background color, switching between a light color and one slightly darker one, a simple feat for PHP.

    Visit Article

  • SimpleXML

    Get Started With SimpleXML in PHP

    In this “Web 2.0″ age, more and more web services are making public APIs available, allowing you to access data from their applications from yours. You could pull messages from Twitter, videos from YouTube, search results from Yahoo, and then aggregate them all into a Facebook application in some manner. Most XML-based APIs can be interacted with through PHP5’s SimpleXML functions, with which you can parse output and use as you wish.

    Visit Article

  • Caching Dynamic PHP

    Caching Dynamic PHP pages easily

    If your website is on a shared hosting account, you need to be careful of how much processor power you are using at any given time, especially if you tend to get sizeable amounts of traffic. That’s where caching comes in to play. Your web server can send-out pages quicker and more efficiently if it doesn’t have to process PHP scripts on every page load. Caching is a technique that temporarily stores scripts’ plain HTML output in a directory, and serves them instead of the script to improve performance. Every hour or so, depending on the application, the cache is emptied and replaced with the new output.

    Visit Article

Frameworks

  • CodeIgniter

    CodeIgniter

    A lightweight and modular Model-View-Controller framework for PHP. Requires little configuration, and no command-line usage. CodeIgniter has plenty of useful classes for functions such as image manipulation, file upload, caching, and database I/O. Compatible with PHP4.

    Visit Site

  • CakePHP

    CakePHP

    Another popular MVC framework. CakePHP is a little heavier than CodeIgniter, but has it’s own advantages. It’s quite full-featured, having plenty of thorough documentation and an impressive collection of helper classes developed by the community.

    Visit Site

  • Symfony

    Symfony

    Symfony is a bit harder to use than CakePHP and CodeIgniter, requiring the use of the command-line to run configuration commands and to create applications. While it seems more involved, it is no less of a viable option for those who would feel comfortable with it.

    Visit Site

  • Zend Framework

    Zend Framework

    Developed by Zend Technologies, Zend Framework is licensed under the New BSD license. It is along the same lines as CodeIgniter and CakePHP.

    Visit Site

  • Flourish Logo

    Flourish

    Flourish is an object-oriented PHP framework, but not an MVC one. The library allows for a more free coding structure than other frameworks, being an included library rather than a foundation to build upon. It is supposed to reduce the amount of code required to get things done, but not dictate your file structure.

    Visit Site

Screencasts

  • Login System Screencast

    How to Build a Login System for a Simple Website

    Build an object-oriented login system as you follow this hour-long tutorial. It’s not a complete solution, leaving you plenty of room to expand and make it your own, but by the end of the screencast you should have a good idea of how to build a well-structure login system that will withstand SQL Injection.

    Watch Screencast

  • CSS Tricks Logo

    WordPress as a CMS

    WordPress is more than just a blogging tool. It’s powerful enough to handle just about anything you throw at it. If functionality you need isn’t built-in, it can be added with a plugin or some custom coding. WordPress works just as well to manage websites that are more page-based than post-based, and it can be extended to do nearly anything.

    Watch Screencast

  • CodeIgniter

    CodeIgniter: Create a Blog in 20 Minutes

    A twenty minute video showing how to use CodeIgniter to create a basic content management system with posts, permalinks, and comments.

    Watch Screencast

  • XML Login and Registration

    Build a Login and Registration System with XML

    Some smaller projects may not require a full-blown database for login credentials. This screencast shows how to create a login and registration system that stores data in XML files instead. The tutorial covers several interesting PHP things, including file manipulation and the SimpleXML functions.

    Watch Screencast

  • WordPress Logo

    A Crash-Course in WordPress Plugin Development

    In this screencast, Jeffrey Way walks you through the creation of a basic WordPress plugin to automatically rewrite unfavorable HTML in posts. Covers plugin structure and the basis of the WordPress hook system.

    Watch Screencast

WordPress

  • WordPress Logo

    Using Custom Fields

    The WordPress Write screen offers an option to assign metadata to a post when you are writing it. That data could be anything from a thumbnail URL to your current mood to a flag to enable/disable the display of part of the template. You can add and remove fields while editing a post, and later call the data programatically with the get_post_meta() function.

    Visit Article

  • WordPress Write Panels

    Creating Custom Write Panels in WordPress

    Add a new meta box to the Write Post screen in WordPress. The tutorial uses post thumbnails as an example. The end result is a handy thumbnail URL field that creates a custom field to store the URL, allowing the theme to pull the image up with the post. If you make extensive use of custom fields, creating a meta box with a friendlier interface just might save you time in the long run.

    Visit Article

  • Smashing Magazine Logo

    10 Useful RSS-Tricks and Hacks For WordPress

    Exclude categories from your RSS feed, put ads in your feeds, set a delay between when the post is published and when it shows up in the feed. Smashing Magazine gives ten hacks and tips for getting the most out of your WordPress site’s feeds.

    Visit Article

  • WordPress Logo

    WordPress 2.7 Featuring Your Favorite Actions

    Using the favorite_actions filter, add (or remove) items to the favorite actions drop-down in the upper-right of the WordPress 2.7 backend. Any page in the Admin can be added to the menu. You could do this from your theme’s functions.php file, or through a plugin.

    Visit Article

  • Yoast Logo

    Easily display your last Tweet

    Who doesn’t use Twitter these days? The “A-List” bloggers were the early adopters, but now the Twitter community is full of developers, designers, politicians, businesses, celebrities, etc.. Wouldn’t it be neat if you could put your latest “tweet” in your blog’s sidebar? You could use a plugin, of course, but isn’t it more fun to roll your own solution with a bit of PHP magic? Joost de Valk has some working examples to learn from.

    Visit Article

  • Smashing Magazine Logo

    Mastering WordPress Shortcodes

    Shortcodes, introduced in WordPress 2.5, allow you to include things in posts with a simple statement such as [AdSense]. The placeholder is replaced with something useful whenever the post is displayed. To continue with the AdSense example, you could have any instance of [AdSense] replaced with your AdSense code.

    Visit Article

  • Devlounge Logo

    How to Write a Wordpress Plugin

    Writing a plugin is one of the best ways to contribute to the best ways to contribute to the WordPress community. If you have an idea for something to improve WordPress, put your PHP skills to use and make it happen. Devlounge has a comprehensive introduction to plugin development, which covers the major bases and should get you started in no time.

    Visit Article

Books

  • PHP 5 for Dummies

    PHP 5 for Dummies by Janet Valade

    A solid and easy to understand introduction to the PHP language. True to the series’ reputation, this volume could potentially teach nearly anybody (even someone without prior programming experience) how to write PHP scripts. A very good primer on PHP, though the current edition has a few errors from the typesetting process, namely the substitution of underscores where double-quotes should be.

    Buy From Amazon

  • PHP Hacks

    PHP Hacks by Jack Herrington

    O’Reilly Media is famous for the tech-centric books they exclusively publish. They consistently produce quality guides to everything from Linux to JavaScript to iPods. PHP Hacks is no exception. This book, rather than being a ground-up intro, focuses on practical lessons in PHP. The book is full of “hacks,” short tutorials filled with code snippets that show you how to do interesting and useful things with the language. A great book for intermediate-level PHP coders.

    Buy From Amazon

  • Wicked Cool PHP

    Wicked Cool PHP: Real-World Scripts That Solve Difficult Problems by William Steinmetz and Brian Ward

    From the venerable No Starch Press comes this gem, a 200-odd paged paperback chock-full of useful script bits to help you solve the tricky problems that come up all to often. Whether you’re a PHP newbie or an experienced code-forger, there’s something for you in this book. Keep a pad of paper handy when you read it.

    Buy From Amazon

  • PHP Anthology

    The PHP Anthology: 101 Essential Tips, Tricks & Hacks by SitePoint

    Inside The PHP Anthology, you will find not an introduction to PHP, but a more intermediate guide. It focuses on the Object Oriented approach throughout, and tries to give you a solid understanding of important and practical concepts that beginner books leave out, such as producing error-free output, XML web services, and the many aspects of security. It is full of useful tips and code snippets as well. Definitely worth a read.

    Buy From Amazon

Bonus: Some Useful PHP Functions


Blinklist Blogmarks del.icio.us Digg Ma.gnolia My Web 2.0 Newsvine Reddit Segnalo Simpy Spurl Wists Technorati

FaviconRSSmeme

fTag: Create a Realtime Twitter Stream About Anything 30 May 2009, 9:15 pm

http://www.rssmeme.com/story/11519516/ftag-create-a-realtime-twitter-stream-about-anything Shared 17 times. Tagged ftag (17) Twitter (14382) .

ftagsNote: you can try out Mashable’s fTag page and chat with Mashable readers here.

Twitter hashtags are great, but sometimes it’s hard to track conversations around a tag simply by using Twitter search.

That’s where new service fTag comes along…it attempts to replace the hashtag with an “ftag” (a word with an underscore before it) and pulls together all those tagged Tweets into a single stream on the site. It also lets you contribute to the stream from the fTags site itself. So whether you want to talk about Lost Dogs, or Global Warming, or Mashable, fTags provides a place to do it.

It’s a neat idea with one (potentially big) vulnerability: the obvious next step for Twitter to challenge Facebook would be to launch Twitter Groups, single pages built around hashtags. Twitter hasn’t been adding these obvious features due to issues simply keeping the site online, but if they did make the addition, fTag and the many similar products around would likely disappear.

ftags2


Reviews: Facebook, Mashable, Twitter

Tags: ftag, twitter

Blinklist Blogmarks del.icio.us Digg Ma.gnolia My Web 2.0 Newsvine Reddit Segnalo Simpy Spurl Wists Technorati

FaviconRSSmeme

Five Ways to Speed Up Page Response Times 28 May 2009, 11:01 am

http://www.rssmeme.com/story/11492571/five-ways-to-speed-up-page-response-times Shared 14 times. Tagged Web Development (397) .

It’s important for your website to load as fast as possible; users want to see your web pages quickly and if you can’t give them that - then they’ll go somewhere else. In this article, you’ll find a discussion on five simple and effective techniques for speeding up your web pages.

Five Ways To Speed Up Page Response Times.

1. Use YSlow to profile and measure your website load times

Knowing how long it takes for your website to load is the first step in determining what’s wrong. It also lets you know if you need to makes changes to your website to speed it up.

Before we begin, if you haven’t installed YSlow, please do. It is a Mozilla Firefox extension which can be found at the following link:

First, let’s navigate to the Six Revisions website so we are all working with the same example (just open it in a new tab or browser window).

In the bottom right hand corner of your browser, there is a bar with a odometer (see Figure 1). Next to that bar, after the page has completly loaded, you will see ‘YSlow’ followed by a number. That number is the time it took for the site to load (in seconds) in your browser. We want that number to get this number as low as possible.

Odometer.Figure 1: YSlow icon and odometer showing the page load time.

Most often, what causes such a long page load time is one or a combination of the following:

  • Too many HTTP requests
  • Uncompressed (or non-minified) JavaScript files
  • No expiration headers for static graphic files

We’ll talk about all of this in a moment.

To fimilarize yourself with the performance of site load times, travel around a few sites. Check out Google’s homepage, Facebook, and a few of your favorite blogs/sites and you will notice that the more images or JavaScript a site utilizes, the higher the page response time is.

Using the features of YSlow

Aside from measuring the speed it takes for a page to load, YSlow also provides you some insight into what you can do to increase the performance of your site, as well as where your site’s load performance is lacking.

Pictured below is the ‘Performance’ tab (Figure 2). When you click it, it launches details grading each area which impacts your load time complete with a overall performance grade.

Performance tab.Figure 2: The Performance tab.

The area that is the most subjective is Using a CDN (content delivery network). CDN’s are more useful for larger sites. What they do is spread the content of a site across multiple servers throughout various regions. In loading a website, a page loads faster when the physical server is located closer to the user. So in essence, using a CDN for your content delivery serves files from the server that is closer to the user accessing your page.

Performance - All.Figure 3: Performance tab shows you a letter grade (A, B, C, D, F) and a percent grade (1-100).

Aside from using a CDN (which can be costly) - everything else is doable.

Grading areas

Let’s run through each grading factor. Here is a brief desciption of what each of these graded areas are, and ways to
address them for optimum performance.

Make Fewer HTTP Requests: HTTP requests happen whenever a web page requests a file from the
server. These can range from scripts, CSS files, images, and asynchroneous client-side/server-side requests (Ajax and other variations of the technique).
This is the most crucial area when it comes to performance, and also one that is easily addressed with just a little bit of elbow grease. For example, caching files
on the user’s machine often helps, as well as consolidating scripts, CSS,
and images.

Add an Expires Header: 80% of the page load time is wrapped up in downloading scripts, images,
and CSS. Most often, these elements don’t change on users’ machines. By
adding some code to your .htaccess file you can cache the redundent files
on the users local machine (we’ll discuss how to do this later down the article).

Gzip Components: Gziping or compressing JS files, images, HTML documents, CSS files, etc. allows the user to download a much smaller
version of a file, increasing the speed of the page load. This can reduce the tax on your server, but unzipping (uncompressing) the components can lead to slower page response times depending on the user’s browser.

Put CSS at the top: Putting CSS files at the top of your document allows your site to
render your web pages as soon as possible while other components such as images and scripts are still loading.

Put JS at the bottom: With your CSS at the top of the document, inserting your JS files just
before you close your <body> tag allows you to render what seems
to be a complete page to the user while these scripts propogate in the
background.

Avoid CSS Expressions: I personally never use CSS expressions (otherwise called Dynamic Properties), which is an IE-only, proprietary way of adding programming concepts (such as control/conditional structures) to CSS. As of IE8, Trident-based layout engines (which is used in IE) will no longer be supported, so it’s never a good idea to use them anyways. Rather, I script with PHP to
load different CSS style rules based on various conditions, be it a random number,
time of day, or browser.

Make JS and CSS external: Placing JS and CSS in external files allows your browser to cache them
making your page load faster than those files loading inline every time
the page is called.

Reduce DNS lookups: Whenever a user types in a domain name in their web browser address field, the browser performs a DNS lookup to the IP
address. The more locations your site has to
access, the more DNS lookups that must occur. Do your best to keep these
low, on average it takes 60-100 milliseconds to do a DNS lookup.

Minify JS: Unlike regular gzip compression, minifing JavaScript files is removing
the unnessessary spaces, tabs, and various other selected characters
reducing the overall size of the file. With a smaller file your able to
have a faster page load. You can use JSMIN to minify your JavaScript.

Avoid redirects: No matter if you do a server-side header redirect, a JS redirect, or an HTML meta redirect, your site is going
to load a header with a blank page, then load your new page, increasing the time it takes for a user to get to the actual page they want to go to - So
completely avoid this at all costs.

Remove duplicate scripts: Making your browser load the same script twice will increase your page
load. It’s simple math. More files equals more load time. Double check
your site and make sure your not calling jQuery 2 or 3 times or any
script for that matter.

Whew… that was a lot, let’s move on to the next tab of YSlow just before we get into some other techniques to increase the performance of your website.

Components tab.Figure 4: The Components tab.

The Components tab (Figure 4) gives you insight into what your efforts to increase your site speeds are producing. Here, you can see how long it takes for certain files to load, if those files are gziped, response times, as well as if they are cached in the users machine and when their cache expires. This is good for examining components of your site, measuring their performance and optimizing their speed.

Lastly, we have the Stats tab (Figure 5). This tab shows all the HTTP requests for both the downloaded files, as well as the cached files. The Empty cache shows the files the browser had to download in order to render the page. The Primed Cache, on the other hand, is the list of files that were already in the user’s browser cache, saving the browser from having to download those files again.

Stats tab.Figure 5: Stats tab.

2. Using CSS Sprites to reduce HTTP Requests

CSS Sprites may be the coolest thing since Tesla invented electricity… did I say that.. oops, I meant Edison.

Well, not quite, but pretty close.

CSS sprites can reduce your page load time simply by reducing the amount of HTTP requests your page makes to the server through the consolidation of your CSS background images.

Most tutorials teach you just to use CSS Sprites for navigation, where I am going to say to use it for the entire user interface of your site.

First, let’s take a quick look at YouTube and how they use CSS Sprites (Figure 6). You can find YouTube’s CSS Sprite here:

YouTube screenshot of Master Sprite.Figure 6: YouTube’s "master" CSS Sprite.

What happens is, using CSS, YouTube set a class with this image as the background (pictured above).Then with elements that need to use these images, their class is set accordingly, with the background-position CSS property set to properly align the top and left sides in that element.

Let’s give it a try. We are going to use the YouTube Image as an example.

In example below, we rendered the YouTube Logo to the screen. Using the same sprite class, and same image, we are going to create a simple rollover icon.

<style>
.sprite {
  background:url(http://s.ytimg.com/yt/img/master-vfl87445.png);
}

#logo {
  width:100px;
  height:45px;
  background-position:0 0;
}
</style>

<div id="logo" class="sprite"> </div>

Now what we’ve done is allowed for all of our static site assets to come from a single HTTP request, which significantly reduces page load

When you use hover with sprites it makes for a seemless transistion, unlike when you load the file on the hover state, which leaves a blank space until that file is loaded.

<style>
.sprite {
  background:url(http://s.ytimg.com/yt/img/master-vfl87445.png);
}
#logo {
  width:100px;
  height:45px;
  background-position:0 0;
}

#button {
  background-position:0 -355px;
  padding:5px 8px;
}

#button:hover{
  background-position:-25px -355px;
}

</style>

<div id="logo" class="sprite"> </div>

<a href="#" id="button" class="sprite"></a>

3. Load your CSS first and your JavaScript last

With some websites, you simply can’t get around all the HTTP requests, as it disrupts your functionality. So as an alternative, you can "bring out the appetizer" while the "main entree" is finishing up by loading the JavaScript files last.

In that regard, here’s a couple of tips:

  1. Load your CSS in your <head> tag above your body.
  2. Load your JavaScript just before you close your </head> tag.

What happens is that the page appears to be loaded on the user’s machine, so their eyes can begin scanning the offerings, all the while the JavaScript is catching up in the rears and loading in the background.

Tip: If you don’t want to physically move the JavaScript tags, as you feel it will
mess up the way your site works, I recommend using the defer property. usage is as
follows:

 <script defer='defer'>

4. Using Subdomains for parallel downloads

Parallel downloads are when you increase the simultaneous file downloads. If you have your status bar open in your footer, you will notice when traveling other websites making requests to static.domain.com and c1.domain.com.

This is a great way to optimize load performance. Although you will simply be using subdomains, and the content is on the same server, the browser see’s it as a seperate server.

To set this up:

  1. Create 3 Subdomains on your server
  2. Place your images in a folder in each of the subdomains
  3. Replace the image locations in your site to the paths of the newly create subdomains.

Now with JavaScript files, this doesn’t exceed beyond two parallel at a time.

5. Adding an Expires Header

Some sites are just very rich, even after using the techniques described above, performance seems as if it can be increased even more.

A user can go to your website and make all the nessessary HTTP requests to render the page, images, scripts, etc.

When you use an Expires Header, you can cache those elements on the user’s local machine, not only increasing their speed, but also saving you bandwidth. An Expires header can be used on all your scripts, CSS, and images as well.

This can be done simply by adding a line of code to your .htaccess file in the root directory of your site (if you don’t have one, you can create one - use a text editor and save it as .htaccess, then upload it to your root directory).

The following .htaccess entry sets a far future expires header sometime in 2010 for file types such as .ico, .pfd, .flv (Flash source files), .jpg, .png, etc.

<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|CSS|swf)$">
  Header set Expires "Thu, 15 Apr 2010 20:00:00 GMT"
</FilesMatch>

Beware: if you make updates to a file that has a far future expires header, you’ll have to rename it (version it) or else users with primed caches won’t see the updates.

For example, if you have a JavaScript file that you made updates to, use version numbers and then update all the files that refer to the old version (i.e. javascriptfile-1.0.js, javascriptfile-1.1.js)

Conclusion

That was a lot of stuff, but hopefully you picked up a few tips on how to make your web pages load faster. If you have more tips or questions, share them in the comments!

Related content

About the Author

Ryan Hickman is a web developer from Upstate NY. Loves PHP, Photoshop, CSS, Illustrator, Jquer, Ajax and Ruby on Rails! Currently working on the release of his first 2 startups. Very excited.Follow Ryan on Twitter.

Blinklist Blogmarks del.icio.us Digg Ma.gnolia My Web 2.0 Newsvine Reddit Segnalo Simpy Spurl Wists Technorati

FaviconPHP Freaks Content

poMMo - painless mass mailing 23 May 2009, 3:06 pm

Once every two or three months I need to send a newsletter to 4000+ subscribers. If you ever tried mass mailing, you probably know that Thunderbird is not exactly the tool to do it.

During last year I tested perhaps half a dozen different solutions both commercial and open-source/freeware. In my case additional requirement is to be able to send the message as properly UTF-8 encoded HTML, which many of these tools failed to fulfil.

And just today I literally stumbled upon an GPLicensed PHP/MySQL script called poMMo. It does just about everything I want it to do. I can import my address list, create the content using WYSIWYG editor, do a test run and finally send the newsletter to all subscribers.

The installation is very easy (I'm not even sure if there is an installation instruction as I didn't need one), just upload the files to server, modify template config file and create a MySQL database. Then just follow on-screen instructions.

Apart from sending simple generic newsletters like mine, poMMo offers some more advanced features as well such as personalised content (greet each subscriber with their own name!) or sending throttle (so that your hosting company won't block you).

And hey! It's open sourced which means I can plug into it with my script, that gathers email addresses from several sources!

All in all very simple yet powerful mailing manager. If it has any serious drawbacks, I didn't encounter those.

Blinklist Blogmarks del.icio.us Digg Ma.gnolia My Web 2.0 Newsvine Reddit Segnalo Simpy Spurl Wists Technorati

Favicon9lessons

Update a Record with Animation effect using JSP and jQuery. 2 Jul 2009, 5:48 am

I received a lot of requests about integration of JQuery and Ajax with Java (JSP). After long time again I'm working on JSP. I prepared a tutorial to update a record with animation effect using jQuery and JSP. Its very simple example contains some lines of Java and HTML code. Download Script     Live Demo Note: Live Demo in PHP hosting insert.jsp Contains javascript and HTML code update

Blinklist Blogmarks del.icio.us Digg Ma.gnolia My Web 2.0 Newsvine Reddit Segnalo Simpy Spurl Wists Technorati

FaviconRSSmeme

Make Your Google Analytics Data Public 22 May 2009, 5:31 pm

http://www.rssmeme.com/story/11433955/make-your-google-analytics-data-public Shared 19 times. Tagged Company & Product Profiles (8487) .

Last year we called on Google to let users have the option of making Google Analytics data public. Today they’ve done that, in a fashion. They aren’t aggregating the data into a public site (although adding it to Google Trends over time would make sense). But they are allowing websites to access the data via an API and publish it to the web or in applications.

From the blog post:

Many users are clamoring for a simpler way to share their Analytics traffic data with their external stakeholders. These stakeholders, such as investors and advertisers, typically use data reported by other services to evaluate the performance of a company. Many times these estimates are significantly different than that from Google Analytics.

One way to share your Analytics data with everyone is to use our recent integration with Google Ad Planner. With this, you can replace Ad Planner traffic estimates with actual data collected by Google Analytics.

Now you can use the Google Analytics Data Export API to create your own integrations to share Google Analytics data with everyone. For example, if you use WordPress blogging software, you can display Google Analytics traffic data directly on your website using the new Analyticator plugin by Sprial Web Consulting.

Wordpress users can download a plugin here.

Transparency is good. This is going to be a popular way to share metrics with advertisers and users.

Crunch Network: CrunchGear drool over the sexiest new gadgets and hardware.

Blinklist Blogmarks del.icio.us Digg Ma.gnolia My Web 2.0 Newsvine Reddit Segnalo Simpy Spurl Wists Technorati

FaviconRSSmeme

Easily Create Your Own Feed Bundles Of Joy With Google Reader 21 May 2009, 7:52 pm

http://www.rssmeme.com/story/11418470/easily-create-your-own-feed-bundles-of-joy-with-google-reader Shared 29 times. Tagged Company & Product Profiles (8110) Google (9565) Google Reader (689) .

picture-101Perhaps the biggest barrier to entry to using a feed reader for most people is building up a collection of good feeds. Sure, you can import someone else’s OPML file, but most people have no idea what that means, let alone how to do it. The “Browse for stuff” area of Google Reader is a better solution, as it offers a front-end way to subscribe to some suggested feed. But up until now those have been suggested by Google. Starting today, you and your friends on Google Reader can make your own bundles and share them.

And creating these bundles couldn’t be easier. You simply click on the “Create a bundle” button in the same “Browse for stuff” area, and you are given an area on the page in which you can simply drag and drop the feeds you wish to add into this bundle. You then name the bundle and give it a description, and you’re all set. If you choose to add the bundle to your shared items, you friends on Google Reader will see them.

This is a very good idea by Google. Quite often I get asked by non-tech friends what feeds they should subscribe to for various news. Usually that involves me hunting down the RSS links for each site I want to recommend. But now I can simply share a whole bunch of feeds, all packaged together with a few clicks. I’m still not sold on Google Reader’s overall social philosophy, and I think TechCrunchIT’s Steve Gillmor has a lot of good points about the viability of a straight-up feed reader like Google Reader against something like Twitter going forward — for mainstream usage. But I’ll give credit where it’s due. Even if browsing “your friends’ bundles,” sounds a bit dirty.

picture-96

Crunch Network: CrunchBase the free database of technology companies, people, and investors

  • ɹǝdınʞ ɯıʇ said: What a great feature! This may actually spur RSS adoption!
  • Ben said: FINALLY
  • Pankaj said: Apparently, not everyone can do this yet.
  • Forrest Cox said: I think the "mainstream consumption" question is certainly valid, though not nearly so slanted in favor of other social tools as Steve Gillmor. It will take an extraordinary event for me to drop Google Reader for something else. But, while I can see the usefulness of bundles such a these, I can't for the life of me envision consuming someone else's bundle...

Blinklist Blogmarks del.icio.us Digg Ma.gnolia My Web 2.0 Newsvine Reddit Segnalo Simpy Spurl Wists Technorati

FaviconGen X Design | Ian Selby

jQuery vs. MooTools – Finally, a Useful & Subjective JS Framework Comparison 21 May 2009, 11:00 am

It’s been said a thousand times I’m sure, but picking the right JavaScript framework is a pain. There are all sorts of biased arguments for one vs. another, but there’s really nothing subjective out there… until now. Arguably, jQuery is probably the most popular JS framework out in the wild, but that doesn’t always mean it’s the best choice. What you choose should really depend on what you’re trying to do. Aaron Newton of Clientcide has put together a really impressive look at jQuery vs. MooTools, which doesn’t categorically say one is better than the other, but, rather, goes into detail about why one framework is better than the other based on your needs. Definitely worth a read:
www.jqueryvsmootools.com

Blinklist Blogmarks del.icio.us Digg Ma.gnolia My Web 2.0 Newsvine Reddit Segnalo Simpy Spurl Wists Technorati

FaviconNettuts+

How to Set Up a Killer WordPress Testing Environment Locally 21 May 2009, 7:51 am

If you’re a heavy WordPress developer like me, you might find that you need to create a new installation for each site that requires a strange structure or specific posts, instead of using your uniform local test WordPress installation. Cue WordPress Mu. WordPress Multi User is a platform created by the geniuses at Automattic that is basically a WordPress installation that allows multiple blogs to run using the same software.

In this tutorial, I’m going to show you how to set up WordPress Mu locally so that it can be viewed in VMWare Fusion too, a piece of software that allows for cross-browser testing on Microsoft XP and Vista. Mac only, sorry, however I’m sure something similar can be done with the PC versions of MAMP.

Preface

Unfortunately this tutorial requires a few paid things, so it can get expensive. You’ll need MAMP PRO, Microsoft XP and VMWare Fusion- Only MAMP PRO is essential if you don’t need to cross-browser test. MAMP PRO has some functionality on MAMP that we need when defining our new developer site. Download WordPress MU as well, we’ll need that!

Note: MAMP PRO comes with MAMP- just stick both of them in Applications because you need the two.

Run Down

OK, so if you don’t know completely what we’ll be doing, I’m going to break it down further. If you use WordPress to develop your websites, then each time you create a new website you need to download a new installation of WordPress, install it, and go through that entire process just for a new site. This takes time AND hard drive space. What we’ll be doing, is setting up a type of WordPress installation that allows you to use the same WordPress files, and set up a new WordPress site via wp-admin instead of going through the famous 5 minute install.

At the end of the tutorial you’ll be able to visit http://wordpress.mu/ to see your local WordPress MU installation. You’ll also be able to open the same page in VMWare Fusion, which will be running Windows XP. This means you’ll be able to see it in ALL major browsers- IE5.5-8, Chrome, Safari Mac, Safari PC, Firefox Mac, Firefox PC, etc. The list goes on.

Step 1 - Changing Ports on MAMP PRO

Once you’ve installed MAMP PRO, open it up and the servers should start running. We need to change the ports. Ports are basically the ‘door’ that a server tells the browser to go through. You might be familiar with CPanelX’s port 8082. CPanel has told your server that to get to the CPanel, you need to go through door 8082. By default, MAMP PRO likes to have it’s own ports- 8888 for apache and 8889 for MySQL. We need to change this back to the default settings. You can either turn it to 80 / 3306 manually or simply click ‘Default Ports’

MAMP PRO will then tell you that the servers need to restart in order for changes to take effect. Click OK and let it do it’s thing. If it tells you that Apache’s failing to restart, check that ‘Web Sharing’ is un-ticked in your Sharing Prefs pane. You should now be able to visit http://localhost:80 to see either the ‘If you can see this page Apache is successfully installed’ page or the default MAMP index page. Great.

Step 2 - editing httpd.conf

httpd.conf is what Apache reads when it looks at what hosts or URLs to run on. You can find httpd.conf in ~/Applications/MAMP/conf/apache/httpd.conf

Scroll down to the very bottom, and you will probably find this:

<VirtualHost *>
	DocumentRoot "/Applications/MAMP/htdocs"
	ServerName localhost
</VirtualHost>

or nothing at all. We are going to add this, or change it to the following code. We’ll also be adding our own Virtual Host, which will be wordpress.mu (Just a side note, when doing this it’s important to never pick a URL that will conflict with an actual site, because while the settings are like you’ll never be able to visit your local site’s url online. e.g. if I set my host to be example.com, example.com would always resolve to my local machine as opposed to example.com online). So like I said, add this (or change the default one)

<VirtualHost *>
	DocumentRoot "/Users/YOU/wordpres.mu"
	ServerName localhost
</VirtualHost>

<VirtualHost *>
	DocumentRoot "/Users/YOU/Sites/wordpress.mu"
	ServerName http://wordpress.mu/
</VirtualHost>

Don’t forget to change YOU to your user name. This will also require a restart of the Apache and MySQL servers. You’ll probably notice that wordpress.mu doesn’t exist in your sites folder- so create it!

Step 3 - editing /etc/hosts

This file, hosts is the configuration for exactly that, the hosts. So httpd.conf set the hosts for your mac! This requires some Terminal work, but I promise you it’s as easy as copying and pasting the command, and then typing a single line!

Open Terminal (it’s in Utilities in the Applications folder) and type:

sudo pico /etc/hosts

And hit enter. sudo means it’s an admin action, pico is the Terminal’s editor (which you’ll soon see) and /etc/hosts is the path to what we want to edit. You’ll be prompted for your password, so type it in. You should now see this screen:

That last line may or may not be there- if it isn’t don’t worry we’ll be changing it anyway. Put the cursor at the bottom (clicking doesn’t work) and where that last line of code is, change localhost to wordpress.mu. It should read:

127.0.0.1 wordpress.mu

127.0.0.1 is the computer’s way of saying ‘me’. Save the file by pressing ctrl+o (o for write out and then ctrl+x to quit pico.

Step 4 - Adding a host for MAMP PRO

The final piece of the puzzle is to create a host alias in MAMP PRO. Now that the hosts are all set up, we need to tell MAMP PRO that it’s actually there. In MAMP PRO click on the ‘Hosts’ tab. You need to add an alias. Click the little plus in the bottom left. You need to set a few things. Server name: wordpress.mu, port: 80, Disk Location: /Users/YOU/Sites/wordpress.mu, and add an alias in the bottom right of wordpress.mu.

Click apply, and once again restart the servers

Step 5 - WordPress MU

Grab your wordpress-mu Download and rename it to wordpress.mu. Stick it in your sites folder. Hey presto, you can go through with the installation! Unfortunately I found no easy way to use sub-domains on a local server, so I just stuck to sub-folders as the structure. Great! You can now use WordPress mu on your local computer! Go ahead with the 5 minute install, and then you can add blogs under the ‘Admin Menu’. I wont go too much into the actual functionality of WPMU, but I’ll explain how I use when working at the end.

VMWare Fusion

I’m not going to go into depth on this topic, because there are many tutorials on it. I will however explain how to modify a brand new installation (even if you’ve used it for ages there probably isn’t a lot that will have changed anyway). Start up VMWare Fusion, and activate Unity if you so please. Unity allows you to run Windows XP windows natively in your mac- see screenshot below!

Step 6 - \etc\hosts (windows)

The /etc/hosts file in XP needs editing too. You can find it in C:\Windows\system32\drivers\etc\hosts. Open it up with Notepad, and we’re about to put our line in. We need to grab an IP address first. Open a new terminal window and type ifconfig -a. You will get a whole lot of junk back- scroll down a bit until you can see ‘vmnet8′. Grab that IP address, the one I’ve highlighted in the image below.

Then go back to your \etc\hosts file in windows, and at the bottom, paste that IP address in followed by wordpress.mu.

Step 7 - flushdns

Sadly, windows needs to be slapped for it to noticed that a change has taken place, so you now need to open Command Prompt. It is in Accessories in the start menu. Simply type ipconfig /flushdns. What this does is flush all the DNS names (localhost mainly) so that it recognises the updated hosts file.

Voila!

You are now able to visit your MAMP running WordPress MU installation on every windows browser there was- looks like I have a bit of work to do!

A practical use for it

So as promised, I said I’d tell you how I use it. What I’ve done is gone ahead and downloaded every browser I need/support and installed it into my XP install. This way I can compare my WordPress sites window beside window and easily have access to modify whatever I need to, without having to save it and refresh an online installation!

Take a Wrap

So there you have it. The ultimate guide to the ultimate WordPress setup. It feels like I haven’t put enough emphasis on WordPress MU itself, but it is just an install tutorial. WordPress MU saves loads and loads of disk space by taking all your separate WordPress blogs and putting them into 1- you have a universal theme folder/manager which makes it super easy to quickly swap between editing sites.


Blinklist Blogmarks del.icio.us Digg Ma.gnolia My Web 2.0 Newsvine Reddit Segnalo Simpy Spurl Wists Technorati

FaviconGoogle Blogoscoped

Book on Using the Google App Engine 21 May 2009, 4:10 am

Charles Severance’s “Using Google App Engine” is a new book by O’Reilly. According to the O’Reilly* description, it’ll help you build “scalable web applications” using Google’s framework, touching on the subjects “Python, HTML, Cascading Style Sheets (CSS), and HTTP”. A sample chapter [PDF] is available.

[Via DeWitt.]

*disclaimer: I wrote a book for O’Reilly before.

[By Philipp Lenssen | Origin: Book on Using the Google App Engine | Comments]


[Advertisement] Want to advertise here? Your ad will show in the blog and feed.

Blinklist Blogmarks del.icio.us Digg Ma.gnolia My Web 2.0 Newsvine Reddit Segnalo Simpy Spurl Wists Technorati

FaviconSearch Engine Journal

Yahoo Releases Placemaker Geo-Tagging Service for Unstructured Data 20 May 2009, 4:36 pm

Yahoo has just released Placemaker, a geo-enrichment tool for the web contents geared for developers. Yahoo’s official description of Placemaker service:

… a freely available geoparsing Web service. It helps developers make their applications location-aware by identifying places in unstructured and atomic content – feeds, web pages, news, status updates – and returning geographic metadata for geographic indexing and markup.

Yahoo Placemaker allows developers to geo-enrich web pages, blog posts, feeds, news articles, status updates and the applications which use this information.

Being an open API which works under GeoPlanet data, Yahoo Placemaker enables developers to add extra layer of geo-intelligence to their web contents to create their own location-based service. It’s basically a tool for making the whole of the Internet hyper local.

Basically, what Yahoo Placemaker does is to identify, disambiguates, and extracts places information on unstructured content, and then returns geographic metadata which identify the “whereness” of these contents.

Yahoo Placemaker competes with a similar Google service  - Geolocation API.

As Yahoo Placemaker is an open API, non-Yahoo sites including Twitter and Facebook  can make full use of this service to add geo-location features to their sites.

Check out the SEO Tools guide at Search Engine Journal.

Yahoo Releases Placemaker Geo-Tagging Service for Unstructured Data

Blinklist Blogmarks del.icio.us Digg Ma.gnolia My Web 2.0 Newsvine Reddit Segnalo Simpy Spurl Wists Technorati

FaviconPerformancing.com - Helping Bloggers Succeed

Can Twitter be a good data mining tool? 20 May 2009, 12:25 pm

Twitter has evolved much from its humble beginnings as what was simply a microblogging service. As people's needs grow, we often also find innovative applications for existing tools and services, and Twitter is no exception. For instance, when I saw my Twitter friends exchanging messages as if they were on a public chatroom, I was at first taken aback. But now it's the norm. And the system even supports exchanges of messages outright, whether private or for public consumption.

There are still a lot of potentially big uses of Twitter. For instance, people have been attributing the trending topics (which are popular mentions of keywords and #hashtags) to discussions that are currently popular. And now there's the proposal to use a different syntax to insert other metadata into your Tweets. Zembly founders Todd Fast and Jiri Kopsa have proposed this on TwitterData.org:

Twitter Data is a simple, open, semi-structured data representation format for embedding machine-readable, yet human-friendly, data in Twitter messages. This data can then be transmitted, received, and interpreted in real time to enable powerful new kinds of applications to be built on the Twitter platform.

Here is an example Twitter Data message:

I love the #twitterdata proposal! $vote +1

The variable $vote which is under the subject #twitterdata then gets an incremental addition of 1 point. The idea is to use Twitter as a vehicle for data, which can be mined using other applications (via Search or API).

By proposing an embedded data format, our goal is not to turn Twitter into a mere transport layer for machine-readable data, but instead to allow semi-structured data to be mixed fluidly with normal message content. To these ends, we have chosen a syntax that conceptually resembles the use of Twitter hashtags, albeit with different syntax and semantics, and which allows humans to interact with data in a reasonably normal way.

To see an example of this at work, twitterdata.org is displaying a widget that shows the "votes" cast for the idea, both affirmative and negative.

I think there is merit to the idea. Twitter itself doesn't necessarily have to have this functionality built-in. But with the popularity of such a syntax, third party apps will more easily be able to mine raw data from tweets.

Do you think this is a good idea? Or is there already an existing mechanism for doing exactly this without the need for introducing a new syntax or format?

Blinklist Blogmarks del.icio.us Digg Ma.gnolia My Web 2.0 Newsvine Reddit Segnalo Simpy Spurl Wists Technorati

FaviconBlogtrepreneur | Entrepreneur Blog

The Top 100 iPhone Apps 21 May 2009, 12:28 pm

Very few technology advancements get the buzz that I’ve been seeing surrounding the iPhone apps. For entrepreneurs, iPhone apps put valuable resources at their fingertips. Think working smarter and more efficiently. There are about 20 categories of iPhone apps, easily connecting the user to all aspects of daily living. I am going to take you on [...]

Blinklist Blogmarks del.icio.us Digg Ma.gnolia My Web 2.0 Newsvine Reddit Segnalo Simpy Spurl Wists Technorati

FaviconWebmonkey

Where 2.0: Google Launches a Data API for Google Maps 20 May 2009, 11:12 am

SAN JOSE, California — Google has extended its set of Data APIs for developers with the release of a Maps Data API.

The new Maps Data API lets application developers both view and store any maps or geodata from Google Maps in the form of standard Google Data API feeds. The new API is intended for all platforms — webapps, mobile client apps and desktop apps.

Google’s Steven Lee and Lior Ron made the announcement at the O’Reilly Where 2.0 Conference here Wednesday.

The Google representatives were sure to stress the importance of real-time indexing in modern applications — making the freshest content instantly searchable seems to be at the back of everyone’s minds at Google lately. To that end, the Google Maps Data API allows for real-time indexing and persistent searching within client apps.

The project is live at Google Code right now. If you’re new to Google Data APIs, have a look at Google’s primer.

There’s an ad component to Wednesday’s launch as well. You can place geo-targeted ads within your map mashup or client application — if a user is looking at a map of Napa Valley, they’ll see an ad for a discount wine merchant.

Along with a demo of the new API, the Lee and Ron gave conference attendees a peek at how location is being built into Firefox 3.5 and Google Chrome.

Google recently partnered with Firefox to add location-awareness directly to Mozilla’s browser, and it’s putting the same tech (which is based on Google Gears) into its Chrome browser. The implementation uses the W3C’s Geolocation specification that’s expected to be included in HTML 5.

In the demo, Lee showed Google Maps running in Firefox 3.5 beta 4. Just between the little zoom slider and the cardinal panning controls in the Google Maps window, there’s now a small blue button. Click on that button, and the map zooms in and recenters on your current location. It uses your active wi-fi connection to pinpoint your location.

Blinklist Blogmarks del.icio.us Digg Ma.gnolia My Web 2.0 Newsvine Reddit Segnalo Simpy Spurl Wists Technorati

FaviconHigh Scalability - Building bigger, faster, more reliable websites.

Scaling Memcached: 500,000+ Operations/Second with a Single-Socket UltraSPARC T2 20 May 2009, 12:34 am

A software-based distributed caching system such as memcached is an important piece of today's largest Internet sites that support millions of concurrent users and deliver user-friendly response times. The distributed nature of memcached design transforms 1000s of servers into one large caching pool with gigabytes of memory per node. This blog entry explores single-instance memcached scalability for a few usage patterns.

Table below shows out-of-the-box (no custom OS rewrites or networking tuning required) performance with 10G networking hardware and one single-socket UltraSPARC T2-based server with 8 cores and 8 threads per core (64 threads on a chip)...

Object Size / Ops/Sec / Bandwidth
100 bytes / 530,000 / 1.2 Gb/s
2048 bytes / 370,000 / 6.9 Gb/s
4096 bytes / 255,000 / 9.2 Gb/s

Check out the link for more details!

Blinklist Blogmarks del.icio.us Digg Ma.gnolia My Web 2.0 Newsvine Reddit Segnalo Simpy Spurl Wists Technorati

FaviconZend Developer Zone

NETTUTS.com: How to Implement Email Verification for New Members 19 May 2009, 7:42 am

On the NETTUTS.com site, a new tutorial has been posted about implementing a system to validate new members/signups for your site via their email.

Blinklist Blogmarks del.icio.us Digg Ma.gnolia My Web 2.0 Newsvine Reddit Segnalo Simpy Spurl Wists Technorati

Favicon9lessons

Facebook like multi Toggle Comment Box with jQuery and PHP. 9 Jun 2009, 12:34 am

Implement Facebook like toggle comment box for every updated wall. I had designed a simple example it contains of very simple jQuery and PHP code. Part 2: Submit multiple comment forms with jQuery and Ajax. Download Script     Live Demo javascript code Take a look at "#slidepanel"+I . Here 'I' element comment_button ID value 'msg_id'

Blinklist Blogmarks del.icio.us Digg Ma.gnolia My Web 2.0 Newsvine Reddit Segnalo Simpy Spurl Wists Technorati