Archive

Archive for the ‘Electronics’ Category

Amazing Gadgets

These days there are a lot of newly discovered electronic gadgets are showing up. The features and uses are pretty interesting; that is why many people are always want to have each of the single gadgets for themselves. Electronic gadgets like cell phones, digital cameras, mp3s and laptops are among popular for the mid age people. Game gadgets like Wii are the one that is popular among kids and teens. The features of Wii are very interesting and it will surely give everyone a lot of fun. Enjoying the game itself plus exercising at the same time, very functional. There are a lot of sports to choose from, tennis or golf- name it. Almost everyday I go to my cousin’s house just to play Wii and I really enjoy playing with it.

Newly discovered electronic gadgets are really amazing, you can even have lots of features in one single gadget. An iphone is one of the newly invented cell phone which built in with almost every single gadget in it, camera, mp3 and games. You can even surf to the internet just like in your own computer or laptop. But interesting gadgets like this needs a lot of money to have one, quite expensive but really worth it.

Thanks to Pet Amber Alert

Ever since I got my dog Zech, I always find time to take care of him, feed him and bathing him. He is like a baby to me.  Since I got him as a present from my birthday, he became so much special to me. I always have fun buying him food, clothes and accessories. And I make some time walking with him in the morning around our area. Month ago an incident happened and I lost him. But I am very thankful to Pet Amber Alert; they helped my lost dog back home safely. Their expertise in recovering lost pets is very efficient and reliable. The program is very useful and dependable during a situation like this. Without their help I don’t think I can find my dog easily.

Computer Game Benefit

Playing computer games gives us a lot of fun and could be beneficial too. Meeting one’s goal is one of the main objective of the player. Everyone are motivated to meet those goals. Jeux or games on the other hand, catches anyone’s attention specially when you wanted some fun and some entertainment. Whatever computer game software you are using, mac games is one example- gives us the same benefit. So even you are just at home playing those computer games or some mac games, you can still get the benefit of keeping yourself motivated to meet your goals.

Introduction to Your Programming Tools

You will need a few tools for your work. I have provided them on the CD that comes with this book. Please resist any temptation to use tools from elsewhere. They will be excellent when you have gained confidence and fluency with programming. However, their complexity will overwhelm you while you are struggling to learn to program. It is enough to try to do something new without also trying to do it in an unnecessarily complicated environment.
You also need something to manage these tools with rather than having to remember every detail for yourself. Programmers use things called IDEs (Integrated Development Environments), which are rather like carpenters’ workbenches. Those that come with commercial compilers, or even the free ones that are used by experienced programmers, have a multitude of options that will simply get in your way and lead to confusion. (No differences here, then; professional work environments are rarely suited to the newcomer.)
So I have chosen a very simple IDE written and maintained by Al Stevens. He calls it Quincy and it provides just what we want: enough to work with but no frills to get in the way. If you have followed the instructions for installing the software you will have installed Quincy somewhere on your system (perhaps on the C drive, but possibly somewhere else; I have my copy on my E drive). You should have an icon of a cat’s face on your desktop. Click (or double-click, depending on how your system is set up) on it to open Quincy.

There are some things that you need to do every time you prepare to write a new program. I am going to walk you through them this time with images from my screen to help you. Until you get used to it, come back to this section each time you start a new program and follow through these steps.

  • Create a new project Select ‘‘Project’’ by double-clicking on it (or click and select ‘‘OK’’). Type ‘‘my first program’’ (get into the habit of giving descriptive names to projects and other files) in the Target name box. Use the browse button to find the sub-directory. You should find that in the directory called ‘‘tutorial’’ on the drive where you installed the tools from the CD. When you have found it, left click the OK button in the browse dialog box. Check that the ‘‘Type of Build’’ selected is ‘‘Console application’’.
  • Set the project options Select the ‘‘tools’’ menu and choose options. You should see the image at the top of the next page. Make sure that the boxes have been selected as in this image. Then use the browse button beside the Includes box to find the sub-directory called ‘‘fgw headers’’. That should be one of the other sub-directories in the same place. Click OK in the browse dialog and then click OK in the Options dialog box.
  • Get the special libraries Much of the programming you will be doing relies on two special files. Do not worry about exactly what they are; they contain resources that one of the programming tools will need. You have to find these two files and include them in the project. Click on the Project menu and select ‘‘Insert Files’’. You should then use the drop down menu in the dialog box to find the fgw headers sub-directory. You should then see something like this (the exact file list may be different, but the two important files fgwlib.a and libgdi32.a should be there. (If they are not in the sub-directory, your installation from the CD is faulty. Copy the contents of the fgw headers directory on the CD to tutorial\fgw headers.)
  • Save the project Go to the File menu in Quincy and save the project.

Learning Web Design, A Beginner’s Guide | CREATING A SIMPLE PAGE

A Web Page, Step by Step

You got a look at an (X)HTML document but now you’ll get to create one yourself and play around with it in the browser. The demonstration in this post has five steps that cover the basics of page production.

  • Step 1: Start with content. As a starting point, we’ll add raw text content and see what browsers do with it.
  • Step 2: Give the document structure. You’ll learn about (X) HTML elements and the elements that give a document its structure.
  • Step 3: Identify text elements. You’ll describe the content using the appropriate text elements and learn about the proper way to use (X)HTML.
  • Step 4: Add an image. By adding an image to the page, you’ll learn about attributes and empty elements.
  • Step 5: Change the look with a style sheet. This exercise gives you a taste of formatting content with Cascading Style Sheets.

Before We Begin, Launch a Text Editor

This section shows how to open new documents in Notepad and TextEdit. Even if you’ve used these programs before, skim through for some special settings that will make the exercises go more smoothly. We’ll start with Notepad; Mac users can jump ahead.

Creating a new document in Notepad (Windows users)

These are the steps to creating a new document in Notepad on Windows XP.

  1. Open the Start menu and navigate to Notepad (in Accessories). 1
  2. Clicking on Notepad will open a new document window, and you’re ready to start typing. 2
  3. Next, we’ll make the extensions visible. This step is not required to make (X)HTML documents, but it will help make the file types more clear at a glance. In any Explorer window, select “Folder Options…” from the Tools menu 3 and select the “View” tab. 4 Find “Hide extensions for known file types” and uncheck that option. Click OK to save the preference and the file extensions will now be visible.

Creating a new document in TextEdit (Macintosh users)
By default, TextEdit creates “rich text” documents, that is, documents that have hidden style formatting instructions for making text bold, setting font size, and so on. (X)HTML documents need to be plain text documents, so we’ll need to change the Format.

  1. Use the Finder to look in the Applications folder for TextEdit. When you’ve found it, double-click the name or icon to launch the application.
  2. TextEdit opens a new document. You can tell from the text formatting menu at the top that you are in Rich Text mode 1. Here’s how you change it.
  3. Open the Preferences dialog box from the TextEdit menu.
  4. There are three settings you need to adjust: Select “Plain text”. Select “Ignore rich text commands in HTML files”. Turn off “Append ‘.txt’ extensions to plain text files”.
  5. When you are done, click the red button in the top-left corner.
  6. Quit TextEdit and restart it to open a new document with the new Plain Text settings. The formatting menu will no longer be on the new document.

Step 1: Start with Content

Now that we’ve got our new document, it’s time to get typing. A web pagealways starts with content, so that’s where we begin our demonstration.

Step 2: Give the Document Structure

Introducing… the HTML element

Basic document structure

Step 3: Identify Text Elements

Introducing…semantic markup

Block and inline elements

Default styles

Step 4: Add an Image

Empty elements

Attributes

Here’s what you need to know about attributes:

  • Attributes go after the element name in the opening tag only, never in the end tag.
  • There may be several attributes applied to an element, separated by spaces in the opening tag. Their order is not important.
  • Attributes take values, which follow an equals sign (=).
  • A value might be a number, a word, a string of text, a URL, or a measurement depending on the purpose of the attribute.
  • Always put values within quotation marks. Although quotation marks aren’t required around all values in HTML, they are required in XHTML. You might as well do it the more future-compatible way from the start. Either single or double quotation marks are acceptable as long as they are used consistently, however, double quotation marks are the convention.
  • Some attributes are required, such as the src and alt attributes in the img element.
  • The attribute names available for each element are defined in the(X)HTML specifications; in other words, you can’t make up an attribute for an element.

Step 5: Change the Look with a Style Sheet

Depending on the content and purpose of your web site, you may decide that the browser’s default rendering of your document is perfectly adequate. However, I think I’d like to pretty up the Black Goose Bistro home page a bit to make a good first impression on potential patrons. “Prettying up” is just my way of saying that I’d like to change its presentation, which is the job of Cascading Style Sheets (CSS).

Creating a new document in TextEdit
(Macintosh users)
By default, TextEdit creates “rich text” documents, that is, documents that
have hidden style formatting instructions for making text bold, setting font
size, and so on. (X)HTML documents need to be plain text documents, so
we’ll need to change the Format, as shown in this example (Figure 4-3).
Use the Finder to look in the Applications folder for TextEdit. When
you’ve found it, double-click the name or icon to launch the application.
TextEdit opens a new document. You can tell from the text formatting menu
at the top that you are in Rich Text mode 1. Here’s how you change it.
Open the Preferences dialog box from the TextEdit menu.
There are three settings you need to adjust:
Select “Plain text”. 2
Select “Ignore rich text commands in HTML files”. 3
Turn off “Append ‘.txt’ extensions to plain text files”. 4
When you are done, click the red button in the top-left corner. 5
Quit TextEdit and restart it to open a new document with the new Plain
Text settings. The formatting menu will no longer be on the new
document.6

A Beginner’s Guide to (X)HTML, Style Sheets, and Web Graphics | Alternative Browsing Environments

The previous post focused on issues relevant to graphical browsers used on desktop or laptop computers. It is critical to keep in mind, however, that people access content on the Web in many different ways. Web designers must build pages in a manner that creates as few barriers as possible to getting to information, regardless of the user’s ability and the device used to access the Web. In other words, you must design for accessibility.
Accessibility is a major topic of discussion in the web design world, and a priority for all web designers. While intended for users with disabilities such as poor vision or limited mobility, the techniques and strategies developed for accessibility also benefit other users with less-than-optimum browsing experiences, such as handheld devices, or traditional browsers over slow modem connections or with the images and JavaScript turned off. Accessible sites are also more effectively indexed by search engines such as Google. The extra effort in making your site accessible is well worth the effort.

Users with disabilities

There are four broad categories of disabilities that affect how people interact with their computers and the information on them:

  • Vision impairment. People with low or no vision may use an assistive device such as a screen reader, Braille display, or a screen magnifier to get content from the screen. They may also simply use the browser’s text zoom function to make the text large enough to read.
  • Mobility impairment. Users with limited or no use of their hands may use special devices such as modified mice and keyboards, foot pedals, or joysticks to navigate the Web and enter information.
  • Auditory impairment. Users with limited or no hearing will miss out on audio aspects of multimedia, so it is necessary to provide alternatives, such as transcripts for audio tracks or captions for video.
  • Cognitive impairment. Users with memory, reading comprehension, problem solving, and attention limitations benefit when sites are design ed simply and clearly. These qualities are helpful to anyone using your site.

The lesson here is that you shouldn’t make assumptions about how your users are accessing your information. They may be hearing it read aloud. They may be pushing a button to jump from link to link on the page. The goal is to make sure your content is accessible, and the site is as easy to use as possible.

The mobile Web

The increased popularity of the Web, combined with the growing reliance on handheld devices such as cell phones, PDAs, and palm-top computers, has resulted in web browsers squeezing into the coziest of spaces.

Although most content accessible on mobile devices has been developed specifically for that type of browser, an increasing number of devices now include microbrowsers capable of displaying the same web content that you’d see on your PC. Microbrowsers are designed to accommodate limited display area, lower memory capacity, and low bandwidth abilities. Some have only basic HTML support and others support the current web standards.
One limitation of handheld devices is screen size. Mobile displays are roughly only 240 pixels square, although some have dimensions as small as 128 pixels or as large as 320. That’s not much room to look at a typical web site. Mobile browsers deal with the limited screen size the best they can. Some shrink the page to fit by displaying the text content as it appears in the HTML source document, and resizing the images to fit the screen. Others simply allow horizontal scrolling.

Dealing with diversity

The best way to accommodate the needs of all your visitors is to design with accessibility in mind. Accessible design not only helps your disabled visitors, but also those using the Web on the go or under any less-than-ideal conditions. You’ll also improve the quality of your content as perceived by search engine indexing programs.
The W3C started the Web Accessibility Initiative to address the need to make the Web usable for everyone. They developed the Web Content Accessibility Guidelines (WCAG) to help developers create accessible sites.

While accessibility and the techniques for achieving it are vast topics, I’ve summarized some of the guiding principles and provided pointers to useful resources here.

  • Start with clean HTML. When your source document has been marked up with appropriate, meaningful HTML elements and the content appears in a logical order, your content will make sense in the widest variety of circumstances, whether it is read aloud or displayed on a tiny handheld screen.
  • Provide alternatives. Always provide alternatives to non-text content such as alternative text or long descriptions for images, transcripts for audio, and captions for video content, to better serve users with various disabilities.
  • Allow text to resize. If you use style sheets to specify font size, do so in relative measurements such as percentages or ems (a unit of measurement for text equal to a capital “M” ) so that users can resize it with the browser’s “text zoom” feature (when available).
  • Don’t put text in graphics. Although it may be tempting to control the typography of a headline by putting it in a graphic, doing so makes it less accessible by removing that content from the document. It also prevents users from resizing the text.
  • Use accessibility features when creating HTML tables and forms. There are a number of attributes in HTML 4.01 and XHTML that improve accessibility by explicitly labeling columns or form fields. They’re only useful if you take the time to use them correctly.
  • Be careful with colors and backgrounds. Be sure that there is plenty of contrast between the foreground and background colors you specify. When using background images, be sure to also specify a similarly colored background color so text is legible, should the image not load properly.

A Beginner’s Guide to (X)HTML, Style Sheets, and Web Graphics | THE NATURE OF WEB DESIGN

THE NATURE OF WEB DESIGN

As a web designer, you spend a lot of time creating pages and tweaking them until they look good in your browser. Before you grow too attached to the way your page looks on your screen, you should know that it is likely to look different to other people. That’s just the nature of web design—you can’t guarantee that everyone will see your page the way you do. The way your site looks and performs is at the mercy of a number of variables such as browser version, platform, monitor size, and the preferences or special needs of each individual user. Your page may also be viewed on a mobile device like a cell phone, or using an assistive device like a screen magnifier or a screen reader. This unpredictable nature of the Web is particularly challenging if you have experience designing for print, where what you design stays put. As a print designer who made the transition to web design, I found I needed to let go of controlling things such as page size, typography, and precise color. Having a solid understanding of the web environment allows you to anticipate and plan for these shifting variables. Eventually, you’ll develop a feel for it. This post looks at the ways in which browsers, user configurations, platform, connection speed, computer monitors, and alternative browsing environments affect the design and functionality of web pages. It suggests some tips for coping along the way.

Browser Versions

One of the biggest challenges in designing for the Web is dealing with the multitude of browsers in current use. Although the current version of Microsoft Internet Explorer running on Windows makes up the lion’s share (60 to 80% as of this writing), there are at least a dozen browser versions that web developers pay attention to, and hundreds more obscure or antiquated browsers still in use. See the sidebar, Browser Roll Call, for more information on relevant browsers.

In the no-so-distant past, browsers were so incompatible that web authors were forced to create two separate sites, one for Internet Explorer and one for Netscape (the only two players at the time). Fortunately, things have improved dramatically now that browsers have better support for web standards established by the World Wide Web Consortium (W3C for short). The situation will continue to improve as older, problematic browser versions such as Internet Explorer 5 and Netscape 4 fade out of existence.
Fortunately, nearly all browsers in use today support HTML 4.01 and XHTML standards, with only a few exceptions. That doesn’t mean that an (X)HTML document will look identical on all browsers—there may still be slight differences in the default rendering of text and form elements. That’s because browsers have their own internal style sheets that determine how each element looks by default.
Instead, the new challenge for cross-browser consistency comes in the varying support of certain aspects of Cascading Style Sheets (CSS). Although most of the basic style sheet properties can be used reliably, there are still some bugs and inconsistencies that may cause unexpected results. Figure 3-1 shows how the same web page may be rendered differently based on the browser’s support of CSS.

Coping with various browser versions

How do professional web designers and developers cope with the multitude of browsers and their varying capabilities? Here are a few guidelines.

Don’t sweat the small stuff. As a web designer, you must allow a certain amount of variation. It’s the nature of the medium. What is important isn’t that form input boxes are all precisely 15 pixels tall, but that they work. The first lesson you’ll learn is that you have to let go.

Stick with the standards. Following web standards—(X)HTML for document structure and CSS for presentation—as documented by the W3C is your primary tool for ensuring your site is as consistent as possible on all standards-compliant browsers (that’s approximately 99% of browsers in current use).

Start with good markup. When an (X)HTML document is written in logical order and its elements are marked up in a meaningful way, it will be usable on the widest range of browsing environments, including the oldest browsers, future browsers, and mobile and assistive devices. It may not look exactly the same, but the important thing is that your content is available.

Don’t use browser-specific (X)HTML elements. There are markup elements and attributes out there that work only with one browser or another, a remnant from the browser wars of old. Don’t use them! (You won’t learn them here.)

Become familiar with the aspects of CSS that are likely to cause problems. Using style sheets effectively takes some practice, but experienced developers know which properties are “safe,” and which require some extra tweaks to get consistent results on all current browsers.

Tutorial | Create the new skin

Continuation from my last post. “Tutorial | Create Custom CSS Skin”.

In this section of the tutorial you will actually create the new skin that uses your custom images for buttons, and some other changes.
To start creating the skin, follow the next steps:

  1. Duplicate the aqua folder in the includes/skins folder in your site root. Rename the duplicate with the same name as the desired skin. Since the main color of this template is green, let’s name the skin green.
  2. Copy the button_big.gif and button_smallest.gif files from the zip package (or the folder where you created them) into the includes/skins/green/images folder. As mentioned in the previous page, the images folder stores all graphical elements used by the CSS files. When asked if you want to overwrite the existing files, click Yes. Also, copy the preview.gif file over the existing one in the includes/skins/green folder. This will allow you to identify the skin when selecting it in Dreamweaver.
  3. Through this action, you have replaced the original buttons with the custom created ones. The buttons are already changed.
  4. In order to see what changes are made, you must apply the skin. To do so, open the InterAKT Control Panel > CSS Skin and from the drop-down menu select the green entry.
  5. Now upload the includes folder to your server. Notice how all buttons have already changed to the new images, without writing or changing a line of CSS code – for all pages: list, form and contact form.
  6. If you want to use buttons of a different size however, you must edit the nxt.css and tng.css file, the section corresponding to each button type (big and smallest) and set the new width and height.
  7. The next step into creating a new skin is to replace the color used when highlighting list rows. At this point, it still uses the dashes if gray from aqua.
  8. For the highlight colors, there are two options to set in the CSS file: the color to use when moving the mouse over each row, and the one to use when the row is checked (after being clicked once). To alter them, you must change the following CSS sections:
    /* selected row (checkbox is clicked) */ .KT_tnglist tr.KT_highlight { background-color: #E2E2E2; } .KT_tnglist tbody tr.KT_over { background-color: #E2E2E2 ! important; }
  9. The first color to set is when the row is selected. Let’s change the shade of gray to a shade of green: #BACDA0.
  10. The second color to change is the color the row takes when the mouse is over it. Change it to #84D082. Save and upload the nxt.css file.
  11. The last element to change regarding the NeXTensio list is the way even rows are colored. The CSS code handling this is the following: .KT_tnglist tr.KT_even { background-color: #F2F2F2; }
  12. To display even rows in a different shade, replace the existing color (#F2F2F2) to #D5E6C1. Upload the nxt.css file and refresh the page. Results are immediate.
  13. When adding new links to a list or form, you might want to give them the same look as the rest. In order to benefit from the automatic conversion to a button, and the usage of skins for all manually added links, you need to set their style property to use the KT_link class.

These are the first steps in creating a skin to integrate MX Kollection elements into your site. Just a few image editing operations, some CSS knowledge and you’re off.

Tutorial | Create Custom CSS Skin

In this tutorial you will learn how to adapt the MX Kollection 3 elements to better fit your existing design and style. All this is done by using the fact that most of the HTML elements inserted by the MX Kollection 3 wizards and server behaviors use CSS files.
Besides choosing from one of the skins provided, you can also create a skin that integrates with your existing site smoothly, in a simple manner.
The application used in this tutorial is the web-site of a small company, that uses for the design an existing template, and for the dynamic elements MX Kollection3 Bundle.
The modules needed to complete this tutorial are:

  • The Transaction Engine
  • NeXTensio

For the basic operations requested in order to create a new skin, basic knowledge of graphic editing is required, while for more advanced changes, you will need some knowledge of CSS.
In this tutorial, you will customize an application that has been already created, that contains three
pages:

  • A NeXTensio List used to display the company products
  • A NeXTensio Form used in conjuncture with the list, to allow editing of elements
  • A Contact Form, that allows users send their messages through e-mail to the company.

The application uses a template design, and all that has to be changed are the list, form and contact form appearance, through the CSS files.

The tutorial wil not present how to create the NeXTensio list or form, or the contact form. These elements can be found in one of the other tutorials (for the NeXTensio list and form, see the Job site tutorial > Improve the Job Site > Receive job ads by e-mail ; to learn how to create the contact form that sends the e-mail message, see the How to Send Form Contents by E-mail (without using a database) tutorial. ).

The pages look as follows in the browser (no customization yet):

  • The NeXTensio product list
  • The NeXTensio form for one element
  • The contact form

Planning the application

This first section of this tutorial helps you create all the files and database tables needed for the application.
Before you start building this application, make sure you have a correctly configured Dreamweaver site, and a working database connection. For more instructions regarding such actions, consult the Getting started help file, which can be found in Help -> InterAKT -> Getting Started.
Through the tutorial, you will have to create several files in your site’s root. The file structure will look as in the example below, and you can create it easily by unpacking the zip file corresponding to your server model from \tutorials\Custom CSS Skin\ in your site root.

Besides these files that are the actual pages that will be viewed from the browser, some more files and folders will appear in your site structure:

  • Some images, that come with the site template
  • The Dreamweaver created Connection folder
  • The includes folder, created when an extension is used on a page.

Included in the zip file you can also find the template that has been used in the tutorial, as well as the new skin’s images and CSS files.
After having dealt with the file and folder structure, it is time to create the database structure that will be used throughout the site’s pages. The database is simple in nature, as it is not the scope of this tutorial, and contains only two tables:

  • product_prd – the table that stores the company’s product list
  • category_ctg – this table stores the different product categories.

The scripts already contains some data, in order for you to easily view the results.
Next, open the main index page and create a new connection named connAds and configure it to connect to your newly created database.

Create elements needed for the customization

The NeXTensio list and form, as well as the contact form will replace the section containing text in the image above. However, none of the existing skins match the selected design. None of the skins use green for buttons or backgrounds.
The finished application must display links as buttons, and the button styles must match the general design: to use some green on the background.
The easiest way to start when creating a new skin is to start from an existing one, and modify its elements to integrate it into the design, as shown in the User Manual. The skin used as a basis for this tutorial is the Aqua skin.
The first step to take before starting any work is to identify the elements you need changed. To accomplish this, open the pages in the browser, and decide which elements must be changed for each of them:

  1. For the NeXTensio List: all buttons on the page: the buttons that replace the edit and delete links, the top and bottom rows buttons for adding a record, editing and deleting multiple records, and the navigation buttons.
  2. For the NeXTensio Form:all available buttons.
  3. For the Contact Form: only the submit button for the form must be changed, to match the rest of the site.

The main focus will be on the buttons. These must be created as images with a photo editing software (Fireworks, Adobe Photoshop, etc), based on the site color scheme.
To find out how many and what size the new images must be, open the includes/skins/aqua/images folder. In this folder, all images used for the skin are stored: buttons, backgrounds, widget and error elements. The files that pose the most interest at this point are:

  • button_big.gif – it is displayed as the buttons on the top and bottom row
  • button_small.gif – which is not used in the current skin
  • button_smallest.gif – used for all other buttons on the list, form and contact
    form.

In order to see exactly which files are used by the skin and in which manner, simply note down the styles used by the different elements as shown by Dreamweaver, and then open the nxt.css file – for the NeXTensio list and form, and the tng.css file – for the contact form. Locate the style classes noted earlier, and check the files that are used.
For example, the Add new link on the NeXTensio bottom and top row uses the KT_bottombuttons
class. This class is defined in the nxt.css file.

As you can notice from the code above, when viewed as buttons, the image used is images/button_big.gif. The path is relative to the CSS file, therefore the actual folder is the one specified earlier. Another important element supplied by the CSS code is the size of the image to use. In this case, the image to use for the button must have a width of 110 pixels, and a height of 20 pixels.
Do the same for the other buttons, to discover the file names and sizes
The edit and delete links shown next to each record in the NeXTensio list use the button_smallest file, with the following size: width: 50 pixels and height 20 pixels.
Once the required elements for the customization are identified, you can start creating them. If using the template provided with the tutorial, the button replacement images are also provided in the zip package.
Once the new images for the buttons are created, you can start creating the actual skin, and applying
it onto your site.

Will continue on the next post. “Tutorial | Create the new skin”.

Effective Java Programming Language Guide | General Programming

Minimize the scope of local variables

“Minimize the accessibility of classes and members.” By minimizing the scope of local variables, you increase the readability and maintainability of your code and reduce the likelihood of error. The C programming language mandates that local variables must be declared at the head of a block, and programmers continue to do this out of habit; it’s a habit worth breaking. As a reminder, the Java programming language lets you declare variables anywhere a statement is legal.

The most powerful technique for minimizing the scope of a local variable is to declare it where it is first used. If a variable is declared before it is used, it is just clutter—one more thing to distract the reader who is trying to figure out what the program does. By the time the variable is used, the reader might not remember the variable’s type or initial value. If the program evolves and the variable is no longer used, it is easy to forget to remove the declaration if it’s far removed from the point of first use. Not only can declaring a local variable prematurely cause its scope to extend too early, but also too late. The scope of a local variable extends from the point of its declaration to the end of the enclosing block. If a variable is declared outside of the block in which it is used, it remains visible after the program exits that block. If a variable is used accidentally before or after its region of intended use, the consequences can be disastrous.

Nearly every local variable declaration should contain an initializer. If you don’t yet have enough information to initialize a variable sensibly, you should postpone the declaration until you do. One exception to this rule concerns try-catch statements. If a variable is initialized by a method that throws a checked exception, it must be initialized inside a try block. If the value must be used outside of the try block, then it must be declared before the try
block, where it cannot yet be “sensibly initialized.”
Loops present a special opportunity to minimize the scope of variables. The for loop allows you to declare loop variables, limiting their scope to the exact region where they’re needed. (This region consists of the body of the loop as well as the initialization, test, and update preceding the body.) Therefore prefer for loops to while loops, assuming the contents of the loop variable(s) aren’t needed after the loop terminates.

The second loop contains a cut-and-paste error: It initializes a new loop variable, i2, but uses the old one, i, which unfortunately is still in scope. The resulting code compiles without error and runs without throwing an exception, but it does the wrong thing. Instead of iterating over c2, the second loop terminates immediately, giving the false impression that c2 is empty. Because the program errs silently, the error can remain undetected for a long time.
If the analogous cut-and-paste error were made in conjunction with the preferred for loop idiom, the resulting code wouldn’t even compile.

Moreover, if you use the for loop idiom, it’s much less likely that you’ll make the cut-andpaste error, as there’s no incentive to use a different variable name in the two loops. The loops are completely independent, so there’s no harm in reusing the loop variable name. In fact, it’s stylish to do so.
The for loop idiom has one other advantage over the while loop idiom, albeit a minor one. The for loop idiom is one line shorter, which helps the containing method fit in a fixed-size editor window, enhancing readability.

This idiom is useful for random access List implementations such as ArrayList and Vector because it is likely to run faster than the “preferred idiom” above for such lists. The important thing to notice about this idiom is that it has two loop variables, i and n, both of which have exactly the right scope. The use of the second variable is essential to the performance of the idiom. Without it, the loop would have to call the size method once per iteration, which would negate the performance advantage of the idiom. Using this idiom is acceptable when you’re sure the list really does provide random access; otherwise, it displays quadratic performance.

Again, this idiom uses two loop variables, and the second variable, n, is used to avoid the cost of performing redundant computation on every iteration. As a rule, you should use this idiom if the loop test involves a method invocation and the method invocation is guaranteed to return the same result on each iteration.
A final technique to minimize the scope of local variables is to keep methods small and focused. If you combine two activities in the same method, local variables relevant to one activity may be in the scope of the code performing the other activity. To prevent this from happening, simply separate the method into two: one for each activity.