Archive for October, 2009

Java 1.5 features

  • Generics: provides compile-time (static) type safety for collections and eliminates the need for most typecasts (type conversion).
  • Metadata: also called annotations; allows language constructs such as classes and methods to be tagged with additional data, which can then be processed by metadata-aware utilities.
  • Autoboxing/unboxing: automatic conversions between primitive types (such as int) and primitive wrapper classes (such as integer).
  • Enumerations: the enum keyword creates a typesafe, ordered list of values (such as day.monday, day.tuesday, etc.). Previously this could only be achieved by non-typesafe constant integers or manually constructed classes (typesafe enum pattern).
  • Swing: new skinnable look and feel, called synth.
  • Var args: the last parameter of a method can now be declared using a type name followed by three dots (e.g. Void drawtext(string… Lines)). In the calling code any number of parameters of that type can be used and they are then placed in an array to be passed to the method, or alternatively the calling code can pass an array of that type.
  • Enhanced for each loop: the for loop syntax is extended with special syntax for iterating over each member of either an array or any iterable, such as the standard collection classesfix the previously broken semantics of the java memory model, which defines how threads interact through memory.
  • Automatic stub generation for rmi objects.
  • Static imports concurrency utilities in package java.util.concurrent.
  • Scanner class for parsing data from various input streams and buffers.
  • Assertions
  • StringBuilder class (in java.lang package)

Popularity: 11% [?]

How to Get the Base URL in Flash ActionScript 2 and ActionScript 3?

Step 1

Create a flash project and set the Publish Settings’ ActionScript version as 2.

Step 2

Create two dynamic texts, named as txtFullUrl and txtBaseUrl.

baseurl01

Step 3

Create another layer; in first frame of that layer write the following ActionScript code.

Action Script 2 Code

baseurl02

function GetTheBaseUrl() {
var RootFullUrl = _root._url;
txtFullUrl.text = RootFullUrl;
var lastSlashIndex:Number = RootFullUrl.lastIndexOf("/");
var DriveIndex:Number = RootFullUrl.indexOf("|");
 
if (DriveIndex>=0) {
baseUrl = RootFullUrl.substring(0, DriveIndex);
baseUrl += ":";
} else {
baseUrl = "";
}
baseUrl += RootFullUrl.substring(DriveIndex+1, lastSlashIndex+1);
txtBaseUrl.text = baseUrl;
return baseUrl;
}
 
var BaseURL:String= GetTheBaseUrl();

Action Script 3 Code

baseurl03

txtFullUrl.text = this.loaderInfo.url;
 
var FullUrl:String = this.root.loaderInfo.url;
var lastSlashIndex:Number = FullUrl.lastIndexOf("/");
var DriveSepIndex:Number = FullUrl.indexOf("|");
 
var baseUrl:String;
if (DriveSepIndex >= 0) {
baseUrl = FullUrl.substring(0, DriveSepIndex);
baseUrl += ":";
} else {
baseUrl = "";
}
baseUrl += FullUrl.substring(DriveSepIndex + 1, lastSlashIndex + 1);
txtBaseUrl.text = baseUrl;

Step 4

Press Ctrl + Enter to run the application.

Popularity: 15% [?]

6 Useful WebTools For Designers

COLOR PALETTE
To create a clean website, color plays a major role.  Selecting the color scheme for your site is made simple by introduction of many tools; you can use the color blender online tool to select your color scheme.
To select the color scheme go to www.colorblender.com and click on the first color box. Change its color by using the RGB sliders below. It will generate 6 color matching palette for the selected color. It also allows you to change all 6 color palette manually by selecting the ‘Direct Edit’ radio button.

colorblender

CSS GENERATOR
Cascading style sheets forms an integral part of the web designing. Use the web tool available in csscreator.com [ link to : http://csscreator.com/tools/cssgenerate] to create style sheets for the HTML elements. Set the properties and click on ‘Generate CSS’.

cssgenerator

LOADING IMAGE GENERATOR
Generating “loading” gif images made easy with the web tool www.ajaxload.info.
To generate specify the “loading” image type, background color, foreground color and transparency and click “Generate It!”

ajaxload_info

ICON FINDER
It’s (www.iconfinder.net )an icon directory, where you can search for icons just as you google, filter it by its sizes and background color.

icon_finder

FAVICON GENERATOR
Use the web tool www.favicon.cc you can generate the favicon. Either import an image or design your own favicon by using tools available.

favicon_generator

WEB 2.0 BUTTON GENERATOR
Go to www.mycoolbutton.com to create free buttons. Generate free icons of your style and need.

mycoolbutton

Popularity: 12% [?]

Designed by: Business Web Hosting | Thanks to Buy Icons, travel tips and Used Cars