Archive for October, 2007

Web hosting script - 2: SOMEUSEFULTPUTSEQUENCESSequenceWhat You Use It Fortput sgr0Reset all

Wednesday, October 31st, 2007

2: SOMEUSEFULTPUTSEQUENCESSequenceWhat You Use It Fortput sgr0Reset all formatting. tput boldDisplay text in bold font. tput revDisplay inverse-colored text (white on blackinstead of black on white, for example). tput smulStart underlining text. tput rmulStop underlining text. tput setafSet foreground color. tput setabSet background color. These are your choices for foreground and back- ground colors: 0Black1Red2Green3Yellow4Blue5Magenta6Cyan7WhiteJust find the color you want to use and stick it at theend of the tput setafor tput setabcommand. You can combine the different text effects to producecolored and underlined prompts, boldface inversefonts, and any combination of your terminal supports. For example, you can display an underlined blueprompt: [freddie@bastille] BLUE= \[$(tput setaf4)\] [freddie@bastille] ULINE= \[$(tput smul)\] [freddie@bastille] RESET= \[$(tput sgr0)\] [freddie@bastille] PS1= $BLUE$ULINE[\ u@\h]$RESET [freddie@bastille] Notice that we used tput sgr0to restore the textback to its normal state (default color, no underline, no bold). That s usually a good idea when you usetputto customize your prompt. Otherwise, what- ever you type in after the colorized prompt will becolorized as well. Seeing a Red Alert When YouHave Superuser PrivilegesWe mention earlier in this technique that we canshow you a better way to remind yourself that youhold dangerous superuser privileges. The typicalway to distinguish between superuser status andmere-mortal status is to change one character inyour prompt (usually the last character) from $to #. But that s a pretty small change and can easily gounnoticed. Superuser privileges are dangerous:onemistake, and you re looking at hours of cleanup. Here s a way to make your privilege level jump outatyou: When you hold superuser privileges, yourprompt is displayed in red, and when you don t, your prompt is displayed in blue. The followingsteps explain how to make this change: 1.Open a terminal window and give yourselfsuperuser privileges with the sucommand. $ suPassword: # su2.Open the /etc/bashrcfile in your favoriteeditor. # kedit /etc/bashrcIf you prefer GNOME, you can use geditinstead: # gedit /etc/bashrcIf you re using SuSE, modify the/etc/bash.bashrc.localfile. If the filedoesn t already exist, it is automaticallycreatedwhen you save your changes.
Please visit our professional web hosting services to find out about cheap and reliable webhost service that will surely answer all your demands.

Simple web server - the right escape sequences, so youdon t have to

Wednesday, October 31st, 2007

the right escape sequences, so youdon t have to spend time looking them up. The blue prompt in the preceding example looks likethis when you use tput: [freddie@bastille] BLUE=$(tput setaf 4) [freddie@bastille] BLACK=$(tput setaf 0) [freddie@bastille] PS1= \[$BLUE\]\u@\h]\ [$BLACK\] [freddie@bastille] The first line uses tputto find the character sequencethat changes the foreground color to blue. The sec- ond line finds the character sequence that changesthe foreground color to black. Notice that you don tneed to know the magic escape sequences; tputkeeps a database of terminal descriptions and con- sults that database to find the sequence that corre- sponds to the terminal (or terminal emulator) you reusing. The third line patches the $BLUEand $BLACKsequences into the $PS1prompt string. The $PS1string, however, is still more complicatedthan it needs to be it s got a few extra \[and \] sequences. Those extra characters are required sothat bash knows which prompt characters take upscreen real estate and which ones don t (the invisiblecharacters must appear between a \[and \]pair). When you use tput, you can clean up extracharacters a bit more by including those extracharacters in the $BLUEand $BLACKvariables: [freddie@bastille] BLUE= \[$(tput setaf4)\] [freddie@bastille] BLACK= \[$(tput setaf0)\] [freddie@bastille] PS1= $BLUE\u@\h]$BLACK [freddie@bastille] tputcan do much more than just change the foregroundcolor of the prompt. Table 4-2 shows a few of the more use- ful tputsequences. (For a complete list, see man tputandman terminfo.) Colorizing Your PromptChanging the color of your prompt may not save youtons of time, but it can make the prompt more read- able and convey extra information without taking upscreen real estate. What kind of information can you encode withcolorized prompts? Just about anything. Turnyour prompt green when you re logged intoone host and blue when you re logged intoanother. Display your prompt in green whenthe system load is low, yellow as it increases, and red when you re running into resourcebottlenecks. Or, just change the color of yourprompt to a fixed color so that it stands out onthe screen. You can colorize your prompt two ways. The mostcommon (but not the most timesaving) way is toinclude special escape characters (characters thatyour terminal window understands, but humansdon t) in your prompt. For example, the followingstring turns your prompt blue: [freddie@bastille] PS1= \[\033[0;34m\] [\u@\h]\[\033[0m\] [freddie@bastille] Of course, because this is a black-and-white book, youcan t see the color here, but if you try this example, you ll see that the prompt turns blue. This methodworks, but it has two drawbacks. First, the syntax ishard to read (and hard to get right in the first place). Second, this method works only if your terminalemulator supports ANSI escape sequences manyterminal emulators (and many terminals) don t. Fortunately, you can fix both problems at once byusing tput. When changing the color of your prompt, usingtputmakes your prompts portable. That is, ifyou move to another terminal emulator, youdon t have to change prompts. tputalso07
You want to have a cheap webhost for your apache application, then check apache web hosting services.


put ringtones free people for

This only applies to POTS fixed phones, where put ringtones free people for voltage ring signal is switched on and off to create the ringing pattern.

rare ringtones org

[citation needed] In Japan, it is generally considered impolite to talk using rare ringtones org on any train — texting is generally the mode of mobile communication.

ringtones ringster

Later updating of the cellular system to ringtones ringster system credits this patent.

of ringtone entry the gladiators

The difference is paid by the customer in the form of of ringtone entry the gladiators bill.

ringtone questions

, USB cable), Bluetooth, text messaging, or e-mail, however, most ringtone questions makers have adopted ringtone questions size fits all” strategy of downloading through the Internet; while appealing to the lowest common denominator, this method usually results in charges to the user for Internet time used on their mobile phones.

download katana sanyo ringtones

A service akin to party line ringing is making download katana sanyo ringtones in some small office and home office situations allowing facsimile machines and telephones to share the same line but have different telephone numbers; this CLASS feature is usually called distinctive ringing generically, though carriers assign it trademarked names such as “Smart Ring”, “Duet”, “Multiple Number” and “Ringmaster.

loan checking without account payday a

Even with this information, the State of California recently passed loan checking without account payday a phone law that requires drivers over the age of 18 to use a hands-free device while using the phone in the car.

perkin loan

3 billion by November, 2007[9], thus reaching perkin loan of over half the planet’s population.

personal payday loan

There have been reports that warning lights on cellular masts, TV-towers and other high structures can attract and confuse birds.

private parent loans

Over private parent loans five years several dozen mobile operators (carriers) have abandoned networks on TDMA and CDMA technologies, switching over to GSM.

It Does/DisplaysTimesaving Bonus Info\D{}Date and/or time in (Web hosting ecommerce) a

Tuesday, October 30th, 2007

It Does/DisplaysTimesaving Bonus Info\D{}Date and/or time in a format of your choosingThe \Dmacro must be followed by a format string enclosed inbraces. bash interprets the format string by using the same rulesas the strftimelibrary function (see man strftimefor moredetails). If the format string is empty, the braces are still required, but bash chooses a display format appropriate to your locale. \eEscape character; used for complex stringsEscape characters introduce complex, unfriendly terminalcommand sequences. We show you a better way later in thistechnique. \hHost name up to the first .(dot)If you work on a number of different hosts from the same work- station, \hcan help you remember which one you re currentlyconnected to. \HEntire host nameSimilar to \h, but takes up too much screen real estate for ourtaste. \nNewline Use a new line to create a multiline prompt. \sShell name such as bash or cshWe ve never found a particularly good use for this one becausewe always stick to bash. \tCurrent time in 24-hour (HH:MM:SS) format\TCurrent time in 12-hour (HH:MM:SS) format\@Current time in 12-hour (am/pm) formatIs it 5:00 yet? \ACurrent time in 24-hour (HH:MM) format\uCurrent user nameInclude \uif you need to do work on someone else s behalf (inother words, if you re an administrator). That way you won t for- get who you are and send flaming e-mail using someone else sname! \WTrailing component of your current This is probably the most useful macro you could include in a working directorycustom prompt sort of a You Are Here sign. \wEntire current working directorySimilar to \W, but takes up a lot of room on your command line. \\Backslash character\!History numberEvery command that you execute is stored in a history log, andyou can refer to a specific command in the log by its history num- ber. Include the \!macro in your prompt, and you ll see the his- tory number assigned to each command. (We talk more abouthistory processing in Technique 9.) \$If the effective UID is 0, a #; otherwise a $The \$macro displays a pound sign (#) if you hold superuserprivileges or a dollar sign ($) if you don t. You can use the \$ macro to help you remember when you have enough privileges toseriously damage your system, but we show you a better way inthe section Seeing a Red Alert When You Have SuperuserPrivileges, later in this technique.
Please visit our professional web hosting services to find out about cheap and reliable webhost service that will surely answer all your demands.

TABLE4-1: HANDYMACROSFORYOURPROMPTMacroWhat It Does/DisplaysTimesaving Bonus Info\aSpeaker beepTo keep (Cheap web hosting)

Tuesday, October 30th, 2007

TABLE4-1: HANDYMACROSFORYOURPROMPTMacroWhat It Does/DisplaysTimesaving Bonus Info\aSpeaker beepTo keep users on their toes, code the $PS2variable to beep whenthe user needs to input additional information. Just enter$PS2= \a > , and the computer beeps when it needs attention! \dWeekday (Sun Sat), month name, and date Handy when you re pulling all-nighters and you need to know ( Thu Dec 18 , for example)when Saturday morning rolls around.
If you are in need for cheap and reliable webhost to host your website, we recommend http web server services.

Simple web server - rmeans that the file is opened for read-onlyaccess.

Tuesday, October 30th, 2007

rmeans that the file is opened for read-onlyaccess. wmeans that the file is opened for write-onlyaccess. umeans that the file is opened for read and writeaccess. You may see other letters following the file descrip- tor number see the man lsofpage for full details. If you don t see a number in the FD column, lsofisshowing you the usage type for that file: cwd: This file (actually a directory) is the currentworking directory for the process. rtd: This directory is the root directory for theprocess. (It s almost always /, except when theprocess is running in a chroot jail.) mem: This is a memory-mapped file (usually ashared object library). txt: This is the full pathname of the program. Again, you may see other usage types, and man lsofwill give you a complete list. Reading file typesThe file type column (fifth from the left, labeledTYPE) tells you what kind of file you re looking at. Linux is known for treating just about anything as if it were a file, so you ll see a variety of file types. A typical lsofreport shows the following file types: REG: A plain old disk file DIR: A directory FIFO: A named pipe (a connection between twoor more processes) CHR: A character-type device (such as a serialport or terminal) BLK: A block-type device (such as a raw diskdrive or CD) unix: A UNIX-domain socket (an interprocesscommunication link) IPv4: An IPv4 network connection IPv6: An IPv6 network connectionDiscovering Network ConnectionsWhen you re viewing network information with lsof, the last two file types in the preceding list IPv4and IPv6 are the ones that you re interested in. IPv4 and IPv6 files are active network connections ornetwork service providers (v4and v6refer to thenetwork address type). When lsoffinds a network connection, rather thanshow you a filename, it displays the IP address of thenetwork interface on your computer, the local portnumber, the IP address of the remote side of the con- nection, and the connection state. Here s an example: bastille:38517->louvre (ESTABLISHED) bastilleis the name of the local network interface, 38517is the TCP port assigned to this session, louvreis the name of the computer at the other endof the connection, and (ESTABLISHED)tells you thatthe network link is up and running. The local interface name is useful when youhave more than one network card in yourcomputer. Connections listed as (ESTABLISHED)show youactive network connections (such as an sshsessionor a Web browser connection). If you see a connec- tion listed as (LISTEN), you re looking at a networkserver. For example, if you see*.ssh (LISTEN)
Go visit our java server pages services for a reliable, lowcost webhost to satisfy all your needs.

Web server on xp - 930 Files and Streams Chapter 16 33 //

Saturday, October 13th, 2007

Adelphia web hosting - Chapter 16 Files and Streams 929 0 100

Friday, October 12th, 2007

Chapter 16 Files and Streams 929 0 100 200 300 400 500 byte offsets 100 100 100 100 100 100 bytes bytes bytes bytes bytes bytes Fig. 16.10Java s view of a random-access file. 16.10 The next several sections introduce the techniques necessary to create this credit-processing program. Figure 16.11 contains the RandomAccessAccountRecordclass that is used by the next four programs for both reading records from and writing records to a file. 1 // Fig. 16.11: RandomAccessAccountRecord.java 2 // Subclass of AccountRecord for random access file programs. 3 package com.deitel.jhtp4.ch16; 4 5 // Java core packages 6 import java.io.*; 7 8 public class RandomAccessAccountRecord extends AccountRecord { 9 10 // no-argument constructor calls other constructor 11 // with default values 12 public RandomAccessAccountRecord() 13 { 14 this( 0, “”, “”, 0.0 ); 15 } 16 17 // initialize a RandomAccessAccountRecord 18 public RandomAccessAccountRecord( int account, 19 String firstName, String lastName, double balance ) 20 { 21 super( account, firstName, lastName, balance ); 22 } 23 24 // read a record from specified RandomAccessFile 25 public void read( RandomAccessFile file ) throws IOException 26 { 27 setAccount( file.readInt() ); 28 setFirstName( padName( file ) ); 29 setLastName( padName( file ) ); 30 setBalance( file.readDouble() ); 31 } 32 Fig. 16.11 RandomAccessAccountRecordclass used in the random-access file programs (part 1 of 2).
From our experience, we can recommend PHP5 Web Hosting services, if you need affordable webhost to host and run your web application.

928 Files and Streams Chapter 16 16.7 Random-Access (Geocities web hosting)

Friday, October 12th, 2007

928 Files and Streams Chapter 16 16.7 Random-Access Files So far, we have seen how to create sequential-access files and to search through them to locate particular information. Sequential-access files are inappropriate for so-called instant-access applications, in which a particular record of information must be located immediately. Some popular instant-access applications are airline reservation systems, banking systems, point-of-sale systems, automated-teller machines and other kinds of transaction-processing systems that require rapid access to specific data. The bank at which you have your account might have hundreds of thousands or even millions of other customers, yet, when you use an automated teller machine, the bank determines in seconds whether your account has sufficient funds for the transaction. This kind of instant access is possible with random-access files. A program can access individual records of a random- access file directly (and quickly) without searching through other records. Random-access files are sometimes called direct-access files. As we have said, Java does not impose structure on a file, so an application that wants to use random-access files must create them. Several techniques can be used to create random-access files. Perhaps the simplest is to require that all records in a file be of the same fixed length. Using fixed-length records makes it easy for a program to calculate (as a function of the record size and the record key) the exact location of any record relative to the beginning of the file. We will soon see how this facilitates immediate access to specific records, even in large files. Figure 16.10 illustrates Java s view of a random-access file composed of fixed-length records (each record in this figure is 100 bytes long). A random-access file is like a railroad train with many cars some empty, some with contents. A program can insert data in a random-access file without destroying other data in the file. Also, a program can update or delete data stored previously without rewriting the entire file. In the following sections, we explain how to create a random-access file, enter data, read the data both sequentially and randomly, update the data and delete data no longer needed. 16.8 Creating a Random-Access File RandomAccessFile objects have all the capabilities of DataInputStream and DataOutputStream objects discussed earlier. When a program associates an object of class RandomAccessFile with a file, the program reads or writes data beginning at the location in the file specified by the file-position pointer and manipulates all data as primitive data types. When writing an int value, 4 bytes are output to the file. When reading a double value, 8 bytes are input from the file. The size of the data types is guaranteed, because Java has fixed sizes for all primitive data types regardless of the computing platform. Random-access file-processing programs rarely write a single field to a file. Normally, they write one object at a time, as we show in the following examples. Consider the following problem statement: Create a transaction-processing program capable of storing up to 100 fixed-length records for a company that can have up to 100 customers. Each record should consist of an account number that will be used as the record key, a last name, a first name and a balance. The program should be able to update an account, insert a new account and delete an account.
We recommend high quality webhost to host and run your jsp application: christian web host services.

Web and email hosting - Chapter 16 Files and Streams 927 Fig. 16.9Credit

Thursday, October 11th, 2007

Chapter 16 Files and Streams 927 Fig. 16.9Credit inquiry program (part 7 of 7). Fig. 16.9 16.6 Updating Sequential-Access Files Data that is formatted and written to a sequential-access file as shown in Section 16.4 cannot be modified without reading and writing all the data in the file. For example, if the name Whiteneeded to be changed to Worthington, the old name cannot simply be overwritten. Such updating can be done, but it is awkward. To make the preceding name change, the records before Whitein a sequential-access file could be copied to a new file, the updated record would then be written to the new file, and the records after Whitewould be copied to the new file. This requires processing every record in the file to update one record. If many records are being updated in one pass of the file, this technique can be acceptable.
Visit our web design programs services for an affordable and reliable webhost to suit all your needs.

926 Files and Streams Chapter 16 230 // (Web design rates)

Thursday, October 11th, 2007

926 Files and Streams Chapter 16 230 // display error if cannot read 231 // because problem with file 232 catch ( IOException ioException ) { 233 JOptionPane.showMessageDialog( this, 234 “Error reading from file”, 235 “Error”, JOptionPane.ERROR_MESSAGE ); 236 } 237 238 } // end method readRecords 239 240 // uses record ty to determine if a record should be displayed 241 private boolean shouldDisplay( double balance ) 242 { 243 if ( accountType.equals( “Credit balances” ) && 244 balance < 0 ) 245 246 return true; 247 248 else if ( accountType.equals( "Debit balances" ) && 249 balance > 0 ) 250 251 return true; 252 253 else if ( accountType.equals( “Zero balances” ) && 254 balance == 0 ) 255 256 return true; 257 258 return false; 259 } 260 261 // execute application 262 public static void main( String args[] ) 263 { 264 new CreditInquiry(); 265 } 266 267 // private inner class for creditButton, debitButton and 268 // zeroButton event handling 269 private class ButtonHandler implements ActionListener { 270 27 // read records from file 27 public void actionPerformed( ActionEvent event ) 27 { 27 accountType = event.getActionCommand(); 27 readRecords(); 27 } 27 27 } // end class ButtonHandler 27 280 } // end class CreditInquiry Fig. 16.9Credit inquiry program (part 6 of 7). Fig. 16.9
Note: In case you are looking for affordable and reliable webhost to host and run your j2ee application check Vision J2ee Web Hosting services.