Basic Boolean
Whenever you search for more than one keyword at a time, Google will search for all of them. If you search for
XML Java “web Services”
Google will search for all the words. If you want to specify that either word is acceptable, you put an OR between each item
XML OR Java OR “Web Services”
If you want to have definitely one term and one of two or more other terms, you group them with parentheses, like this
XML (Java OR “Web Services”)
This query searches for the word “Java” or phrase “Web Services” along with the word “XML.” A stand-in for OR borrowed from the computer programming realm is the | (pipe) character, as in
XML (Java | “Web Services”)
If you want to specify that a query item must not appear in your results, use a -.(minus sign or dash).
XML Java -”Web Services”
This will search for pages that contain both the words “XML” and “Java” but not the phrase “Web Services.”
Operators
In addition to the basic AND, OR, and quoted strings, Google offers some rather extensive special syntaxes for honing your searches. Google being a full-text search engine, it indexes entire web pages instead of just titles and descriptions. Additional commands, called special syntaxes, let Google users search specific parts of web pages or specific types of information. Specifying that your query words must appear only in the title or URL of a returned web page is a great way to have your results get very specific without making your keywords themselves too specific.
Here are some of the common keywords that you can add to your query in Google
intitle, allintitle
Restricts your search to the titles of web pages. The variation, allintitle: finds pages wherein all the words specified make up the title of the web page. It’s probably best to avoid the allintitle: variation, because it doesn’t mix well with some of the other syntaxes.
Eg: intitle:”george bush”
allintitle:”money supply” economics
inurl, allinurl
Restricts your search to the URLs of web pages. This syntax tends to work well for finding search and help pages, because they tend to be rather regular in composition. An allinurl: variation finds all the words listed in a URL but doesn’t mix well with some other special syntaxes.
Eg: inurl:help
allinurl:search help
intext, allintext
Searches only body text (i.e., ignores link text, URLs, and titles). There’s an allintext: variation, but again, this doesn’t play well with others. While its uses are limited, it’s perfect for finding query words that might be too common in URLs or link titles.
Eg: intext:”yahoo.com”
allintext:html
inanchor
Searches for text in a page’s link anchors. A link anchor is the descriptive text of a link. For example, the link anchor in the HTML code O’Reilly and Associates is “O’Reilly and Associates.”
site
Allows you to narrow your search by either a site or a top-level domain. AltaVista, for example, has two syntaxes for this function (host: and domain:), but Google has only the one.
Eg: site:loc.gov
site:thomas.loc.gov
site:edu
site:nc.us
You can also use site: operator to exclude certain domains from a search
Eg: google -site:google.com
This is particularly useful for ego searches. You can find out all those sites which mention your name expect your site.
Eg: bill gates -site:microsoft.com -site:wikipedia.org
link
Returns a list of pages linking to the specified URL. Enter link:www.google.com and you’ll be returned a list of pages that link to Google. Don’t worry about including the http:// bit; you don’t need it, and, indeed, Google appears to ignore it even if you do put it in. link: works just as well with “deep” URLs-http://www.raelity.org/apps/blosxom/ for instance-as with top-level URLs such as raelity.org.
cache
Finds a copy of the page that Google indexed even if that page is no longer available at its original URL or has since changed its content completely. This is particularly useful for pages that change often. If Google returns a result that appears to have little to do with your query, you’re almost sure to find what you’re looking for in the latest cached version of the page at Google.
filetype
Searches the suffixes or filename extensions. These are usually, but not necessarily, different file types. I like to make this distinction, because searching for filetype:htm and filetype:html will give you different result counts, even though they’re the same file type. You can even search for different page generators, such as ASP, PHP, CGI, and so forth-presuming the site isn’t hiding them behind redirection and proxying. Google indexes several different Microsoft formats, including: PowerPoint (PPT), Excel (XLS), and Word (DOC).
Eg: homeschooling filetype:pdf
“leading economic indicators” filetype:ppt
related
Finds pages that are related to the specified page. Not all pages are related to other pages. This is a good way to find categories of pages; a search for related:google.com would return a variety of search engines, including HotBot, Yahoo!, and Northern Light.
Eg: related:www.yahoo.com
related:www.cnn.com
info
Provides a page of links to more information about a specified URL. Information includes a link to the URL’s cache, a list of pages that link to that URL, pages that are related to that URL, and pages that contain that URL. Note that this information is dependent on whether Google has indexed that URL or not. If Google hasn’t indexed that URL, information will obviously be more limited.
Eg: info:www.oreilly.com
info:www.nytimes.com/technology
define
Will get the definition of the term that you have entered. This syntax can be used to get the definitions of words, phrases, and acronyms
Eg: define:dreaming
This query will get you the definition of the word dreaming
numrange
If you want to search for a range of numbers then you can use two dots (without spaces) to represent a range of numbers
Eg: inventions 1850..1899
This query will get you all the inventions between 1850 and 1899
safesearch
If you include safesearch: in your query, Google will exclude adult-content.
Eg: safesearch:breasts
This will search for information on breasts without returning adult or pornographic sites.
stocks
If you start your query with stocks:, Google will interpret the rest of the query terms as NYSE, NASDAQ, AMEX, or mutual fund stock ticker symbols, and will open a page showing stock information for the symbols you specify.
Eg: stocks:goog
This will show information about Google’s stock. Specify ticker symbols not company names. If you enter an invalid ticker symbol, you’ll be told so and given a link to a page where you can look up a valid ticker symbol.
The Special Syntaxes
Currency Conversion
Google makes it easy to calculate money conversions from one form of currency to another.
Eg: $5 in yenThe above query will let you know that five dollars is worth about 566.599846 yen.
If you’re not sure of the name of a currency, use nationality instead.
Eg: 25 Australian money in Italian money
This may sound awkward but it does the job.
Eg: $5 in indian money
This will let you know that 5 US dollars is worth about 224.477976 Indian rupees
You can even convert units in this fashion.
Eg: $2.85 per gallon in British money per literThis query will tell you that it is about 42 pence per liter and provides an international basis for discussing gas prices at the pump.
Check Airfares
When you google for the names of two major cities, Google automatically offers to search for flights.
Eg: Denver Fort Lauderdale
In the form labeled “Flights from Denver, CO to Fort Lauderdale, FL”, enter a departure and return date and choose whether to search using Expedia, Hotwire or Orbitz. Do not use quotation marks in your initial search. Denver “Fort Lauderdale” will not bring up the flight search form.
Find Song Lyrics
If you are looking for the title or lyrics of a song then you can use Google search phrases and wildcards to find them.
Eg: “Friday I am in love” lyrics
Or use the wildcard operator to get lyrics with certain words in them, like this
Get the current time for any city using Google
In addition to fetching fresh results and following cricket scores, you can also now also get the current time for any city by just searching in Google.
All you have to do is just type time followed by the city name
Eg: time Chennai
Fetch only Fresh results
In order to use this you have to add a new parameter as_qdr at the end of the url like below
http://www.google.com/search?q=ipod&as_qdr=d
The as_qdr parameter can take the following possible values.
· d[number] - past number of days (e.g.: d5)
· w[number] - past number of weeks (e.g: w5)
· y[number] - past number of years (e.g: y5)
Cricket
Being born in India, circket is there in my blood and the same for Sadeesh Duraisamy who works in Google. Thanks to him and now we can keep an eye on the latest circket scores
If you want to add fields in registration form on joomla 1.0 its easy because there you can easily add new variables in user class, but joomla 1.5 architecture is much different from 1.0 . So you can follow given steps to add new fields in joomla 1.5:
Step 1: Add new fields in user table in database.
example:
ALTER TABLE jos_users ADD occupation VARCHAR (100) NO NULL AFTER name;
and
ALTER TABLE jos_users ADD position VARCHAR (100) NO NULL AFTER occupation;
Step 2: Modify the user class to include the new files in libraries/joomla/table/user.php
Example: Add new variables in user class as given below
var $occupation = null;
var $position = null;
Step 3:Now you can modify the code (default.php) which displays the registration page on Root Folder/components/com_user/view/register/tmpl/default.php
Example:
<tr>
<td width=”30%” height=”40″>
<label id=”myoccupation” for=”occupation”><?php echo JText::_( ‘Occupation’ ); ?>: </label> </td>
<td>
<input type=”text” name=”occupation” id=”occupation” size=”40″ value=”<?php echo $this->user->get( ‘occupation‘ );?>” class=”inputbox required” maxlength=”50″ /> * </td>
</tr>
Now your new fields are available on your registration form.
enjoy…..
“JHTML form not supported. File not found”
This problem occures when a file form.php is missing. Its necessary to recover this file from Root Folder/libraries/joomla/html/html/form.php
You can place this file or install new joomla version to resolve this problem.
Problem comes when you want to use rendered, actionListener and action attributes of < a:actionLink> with variable ‘r’.
Actually the problem is not of < a:actionLink> or of ‘r’ value but of the working process of jsf framework itself.
After rendered, JSF again checks the ‘r’ value and call for the action. And at that time it does not find the value of ‘r’ so fails to perform the action means ‘r’ is not available.
Solution:
To solve this problem you can wrap the < a:actionLink> with < a:booleanEvaluator> tag
and then there is no need to use rendered in < a:actionLink> because the condition can be checked in < a:booleanEvaluator>.
Sample code looks like this:-
< a:booleanEvaluator value=”#{r.myVariable == true/false}” id=”some-id”>
< a:actionLink value=”" id=”newid” image=”someImage.gif” action=”dialog:MyDialog” actionListener=”#{MyDialog.anyAction}” tooltip=”tooltip” showLink=”false”>
< f:param name=”paramName” value=”#{r.paramValue}”/>
< /a:actionLink>
< /a:booleanEvaluator>
Keep AlgoBlogging!!!
Scenario: you need to find noderef of a folder which contains a document of given node id
Solution:
1. First create the NodeRef for the given node id.
StoreRef storeRef = Repository.getStoreRef();
NodeRef documentNodeRef = new NodeRef(storeRef, documentId);Where documentId is the Node Id for which you are trying to get the parent folder NodeRef.
2. Now you would need to take help of “NodeService” to get the parent folder NodeRef. Suppose you have NodeService available in your bean (you can always get the NodeService from getNodeService() method of ServiceRegistry OR get if from session):
ChildAssociationRef childAssociationRef = this.nodeService.getPrimaryParent(documentNodeRef);
NodeRef documentParentNodeRef = childAssociationRef.getParentRef();
documentParentNodeRef is what you were looking for
Happy AlgoBlogging!!!
Here’s a way to handle sessions in joomla 1.5:
$session =& JFactory::getSession();
$session->set(’variable_name’, ‘variable_value’);
$session->get(’variable_name’);
Some times we get stuck that, our JS code submitting the form is not working, so here is a small trial solution to your problem.
if your code have any form element named “submit”, than just rename it to anything else.
and see the magic.
FOUND_ROWS()
A SELECT statement may include a LIMIT clause to restrict the number of rows the server returns to the client. In some cases, it is desirable to know how many rows the statement would have returned without the LIMIT, but without running the statement again. To obtain this row count, include a SQL_CALC_FOUND_ROWS option in the SELECT statement, and then invoke FOUND_ROWS() afterward:
mysql> SELECT SQL_CALC_FOUND_ROWS * FROM tbl_name
-> WHERE id > 100 LIMIT 10;
mysql> SELECT FOUND_ROWS();
The second SELECT returns a number indicating how many rows the first SELECT would have returned had it been written without the LIMIT clause.
In the absence of the SQL_CALC_FOUND_ROWS option in the most recent SELECT statement, FOUND_ROWS() returns the number of rows in the result set returned by that statement.
The row count available through FOUND_ROWS() is transient and not intended to be available past the statement following the SELECT SQL_CALC_FOUND_ROWS statement. If you need to refer to the value later, save it:
mysql> SELECT SQL_CALC_FOUND_ROWS * FROM … ;
mysql> SET @rows = FOUND_ROWS();
If you are using SELECT SQL_CALC_FOUND_ROWS, MySQL must calculate how many rows are in the full result set. However, this is faster than running the query again without LIMIT, because the result set need not be sent to the client.
SQL_CALC_FOUND_ROWS and FOUND_ROWS() can be useful in situations when you want to restrict the number of rows that a query returns, but also determine the number of rows in the full result set without running the query again. An example is a Web script that presents a paged display containing links to the pages that show other sections of a search result. Using FOUND_ROWS() allows you to determine how many other pages are needed for the rest of the result.
The use of SQL_CALC_FOUND_ROWS and FOUND_ROWS() is more complex for UNION statements than for simple SELECT statements, because LIMIT may occur at multiple places in a UNION. It may be applied to individual SELECT statements in the UNION, or global to the UNION result as a whole.
The intent of SQL_CALC_FOUND_ROWS for UNION is that it should return the row count that would be returned without a global LIMIT. The conditions for use of SQL_CALC_FOUND_ROWS with UNION are:
The SQL_CALC_FOUND_ROWS keyword must appear in the first SELECT of the UNION.
The value of FOUND_ROWS() is exact only if UNION ALL is used. If UNION without ALL is used, duplicate removal occurs and the value of FOUND_ROWS() is only approximate.
If no LIMIT is present in the UNION, SQL_CALC_FOUND_ROWS is ignored and returns the number of rows in the temporary table that is created to process the UNION.
Important
FOUND_ROWS() is not replicated reliably, and should not be used with databases that are to be replicated.
Joomla Reference link for pagination:
http://docs.joomla.org/Using_JPagination_in_your_component
Trivial problem while making Ajax call across domains.
I had just started understanding Ajax through jQuery using JSON. jQuery support to Ajax and JSON is awesome. I was stuck at a point where I had to make ajax call from my php application to java application. JSON seems to be the ideal solution for this, however a normal $.getJSON() method does not work as expected in case of cross domains calls.
Over the net, you will find that you need to write your own jquery function in such scenario. You may find sample codes as well. Forget it!!! JSON-P (’P’ stands for padding) does the magic.
In my next posts, I will discuss more about JSON and JSON-P, and how to make cross domain ajax calls!!!
Hi friends,
Are you new to joomla 1.5 and find yourself in trouble installing a module? No problem here you can get the solution.
Steps to install a module in Joomla 1.5:
• First go to admin section and on mouse-over at “Extension” tab a drop down of child menu will appear then click on ‘install/uninstall’ menu. It will take you to a page with upload & install button along with browse button.
• Click on browse button and select the module zip file which you want to install.
• Click on upload & install button. This will automatically install your module.
In a nutshell, the installation involves following steps:
<em>Joomla Admin Section -> Extension -> Install/Uninstall -> Browse -> select zip file -> Upload & Install -> module has been successfully uploaded.</em>
Troubleshoot:
Are you still in trouble!!! Not able to install because of following problem: “JFolder::create: Path not in open_basedir paths Warning! - Failed to move file” OR “Unable to find install package”.
Then once again go to the admin panel and on mouse-over at “Help” tab a drop down with child menu will appear. Click on “system info”. Then click on the “Directory Permissions”.
The page will display number of folders which are used while installation and the information if these folders are writable/un-writable.
Now go through the directory in your file system and make all folders writable.
Making folders writable involves following steps:
<em>Joomla Admin Section -> Help -> System Info -> Directory Permissions -> find un-writable folders -> Go to the directory in your file system and make them writable</em>
Still in trouble!!! Do write your comments here and I will try to solve the problem.
Happy reading AlgoBlog!!!