fb

Ads

Pages

Some websites don't work witout the www. prefix [Solved]

This might seem like a lot of steps, but it's really not that bad. Just take them one at a time. Maybe open up one of the beers from my most recent Twelve Beers of Christmas list if that will help relax you. 
  1. Go to your domain registrar's website and log into the control panel for your domain. (For GoDaddy that's login, click My Account in the upper menu bar, click Visit My Account from the drop down menu, expand the Domains section, find your domain in the list, and click the Launch button under the Actions column.
  2. Find the DNS Settings or DNS Zone File section and open it.
  3. Find the Host Names section and look for a record that has the host name "@". You probably won't find one so you need to add one (there will be an Add or New button of some sort.)
  4. It will ask you what type of record you want to add. Choose either CName or Redirect.
  5. Put @ as the host name and your fully qualified domain name, including the www, in the destination or target field (ex: www.itsinfor.com/).
  6. Save the new DNS record and give it 15 minutes to 24 hours before you expect it to work.

Difference between Iterator and Enumeration in Java

The object returned by the iterator method deserves special mention. It is an Iterator, which is very similar to an Enumeration, but differs in two respects:
Iterator allows the caller to remove elements from the underlying collection during the iteration with well-defined semantics.
Method names have been improved.
 


The first point is important: There was no safe way to remove elements from a collection while traversing it with an Enumeration. The semantics of this operation were ill-defined, and differed from implementation to implementation.
The Iterator interface is shown below:

public interface Iterator {
boolean hasNext();
Object next();
void remove(); // Optional
}


The hasNext method is identical in function to Enumeration.hasMoreElements, and the next method is identical in function to Enumeration.nextElement. The remove method removes from the underlying Collection the last element that was returned by next. The remove method may be called only once per call to next, and throws an exception if this condition is violated. Note that Iterator.remove is the only safe way to modify a collection during iteration; the behavior is unspecified if the underlying collection is modified in any other way while the iteration is in progress. The following snippet shows you how to use an Iterator to filter a Collection, that is, to traverse the collection, removing every element that does not satisfy some condition:


static void filter(Collection c) {
for (Iterator i = c.iterator(); i.hasNext(); )
if (!cond(i.next()))
i.remove();
}


Two things should be kept in mind when looking at this simple piece of code:
The code is polymorphic: it works for any Collection that supports element removal, regardless of implementation. That's how easy it is to write a polymorphic algorithm under the collections framework!
It would have been impossible to write this using Enumeration instead of Iterator, because there's no safe way to remove an element from a collection while traversing
it with an Enumeration.

Getting a Char Without a Carriage Return in C

One of the first questions that MS-DOS programmers ask on encountering a UNIX systems are , "How do I read characters from the terminal without requiring the user to hit RETURN?" Terminal input in UNIX is "cooked" by default, meaning that the raw input is first processed so that line-editing characters (backspace, delete, and so on) can be used, and these keys take effect without being passed through to the running program.

Usually this is a desirable convenience, but it does mean that a read won't get the data until the user presses RETURN to signify that the line is finished. Input is effectively line-by-line, whereas some applications need to see each character as each individual key is pressed. This feature is essential for many kinds of software and is trivial on a PC. The C libraries there support this, often with a function called kbhit(), which indicates if a character is waiting to be read. The C compilers from Microsoft and Borland provide getch() 

(or getche() to echo the character) to get input character-by-character without waiting for the whole line.



People often wonder why ANSI C did not define a standard function to get a character if a key has been pressed. Without a standard function every system has a different method, and programs portability is lost. The argument against providing kbhit() as part of the standard is that it is mostly useful for games software, and there are many other terminal I/O features that are not standardized. In additionally , you don't want to promise a standard library function that some OS's will find difficult to provide. The argument for providing it is that it is mostly useful for games software, and that games writers do not need the myriad of other terminal input/output features that could be standardized. Whichever view you hold, it's true that X3J11 missed an opportunity to reinforce C as the language of choice for a generation of
student programmers writing games on UNIX.

Windows Jump lists Customization

Windows 7 ,8 comes with a very handy feature called Jump list. This feature will shows a list of related tasks & Recent documents of a process or shortcut icon which is in the task bar. You can view and customize it easily.

1. Right click on any icon in the task bar.

2. It will show a list of related tasks to that application as well, Number of recently used applications.

3. If there is a shortcut you wish to see every time you open the Jump list of that application you can pin that as well to Jump list. Say for Windows Media Player you have recent shortcut of a movie and you wish it to appear permanently then you can pin it to the jump list.



4. You can also customize number of Recent Items in Jump list.

  • Right click on Start Button or taskbar (Super bar) of Windows 7 

  • Click on properties. It will pop up Taskbar & start Menu properties. 

  • Select the tab ‟startMenu‟. This will bring Customize & Privacy options.

  • Select Customize button there. e. Select Number of items in Jumplist from 10 to number you wish to.



5. Also you can choose default settings if you wish to undo all the changes you have done.

HTML Tables

Table of two rows and three columns
 

<table border="1">
<tr>

<td>USA </td>
<td>Canada </td>
<td>UK </td>
<tr>

<td>UK </td>
<td>Canada </td>
<td>USA </td>
</table>

 

The entire table is contained between <table> and </table> tags

Each table row starts with a <tr> tag.

Each cell starts with a <td> tag. A cell is one column of one row.


Attributes of the <table> tag  

The <table> tag allows a number of optional attributes that specify the properties of the entire table.
  • <table align="right"> positions the table at the right side of the viewer window; align="center" centers it; and align="left" places it on the left side.
  • The width="50" attribute (<table width="50">) sets the width of the entire table;
  • border="1" tells the browser to draw a border around the entire table. The dimension  specifies how border thick to make the border.             For example: <table border="1">
Captioning a table

To add a title to a table, place the caption text between <caption> and </caption> tags just after the <table> tag:
 

<table border="1">
<caption> Animals </caption>
<tr>

<td>Lions
<td>Elephants
<tr>

<td>Cows
<td>Tigers
</table>


You can use an align="bottom" attribute in the <caption> tag to position the caption below the table. (default => top)
 For example:
<caption align="bottom">
Animals</caption>
 

Specifying dimensions
 

<table width="50%"> 

</table>
The width attribute of a <table> tag specifies how wide the table is, relative to the size of the browser window. The above example says to make the table 1/2 the width of the window.

Assign Keyboard Shortcuts for Programs in windows

Application can be assigned a shortcut key in Microsoft Windows.
To create Shortcut keys for any application in MS Windows .
1. Right-click the program icon and select Properties.
2. Select the Shortcut tab
3. Click in Shortcut key textbox
4. Enter the keyboard shortcut for that program.(Any Short cut keys)




5. Press OK to exit.
6. Use the Keyboard shortcut combo to launch the application.
 

Like the way i have used a combo of keys Ctrl+Alt+S to launch Snipping Tool application other applications can also be launched using Shortcut keys.

Declaration & Definition [C]

Before getting to the bottom of this problem, we need to refresh our memories about some essential C terminology. Recall that objects in C must have exactly one definition, and they may have multiple external declarations. By the way, no C++ mumbo-jumbo here—when we say "object" we mean a C
"thing" known to the linker, like a function or data item.
A definition is the special kind of declaration that creates an object; a declaration indicates a name that allows you to refer to an object created here or elsewhere. Let's review the terminology:


definition => occurs in only one place ---> specifies the type of an object; reserves storage for it; is used to createnew objects
example:

int my_array[100];
 

declaration => can occur multiple times ---> describes the type of an object; is used to refer to objects definedelsewhere (e.g., in another file)
example:

extern int my_array[];
 

The declaration of an external object tells the compiler the type and name of the object, and that memory allocation is done somewhere else. Since you aren't allocating memory for the array at this point, you don't need to provide information on how big it is in total. You do have to provide the size
of all array dimensions except the leftmost one—this gives the compiler enough information to generate indexing code.