Saturday, June 19, 2010

Add external Jar file

 Right click on the ProjectName then add external library.
Or right click on the Refereced Libraries->build Path-> Configure Build Path->Add external Library



reference
http://www.wikihow.com/Add-JARs-to-Project-Build-Paths-in-Eclipse-(Java)

Friday, June 18, 2010

advanced google search: How to search content inside and outside a webiste?

Search content inside website can be done using:
freepastry site:*.edu

Sometimes one wants exclude contents from a web domain, in the above example the top 6 out 8 search results are from:https://mailman.rice.edu/mailman
To exclude the results from mailman.rice.edu , one can use:
-site:mailman.rice.edu







Here are the results of
freepastry site:*.edu -site:mailman.rice.edu


as shown in the picture, results from mail.rice.edu are excluded

Monday, June 14, 2010

Smallest possible match

Regular expression smallest match.
I need one regular expression to extract all the opening tag, closing tag and all the strings in between opening and closing tag. eg:

Is this all there anything can be here, \n
[]+*403<>??!@#$%^&*()adsfadsf





By default the regular expression [\w|\W] would give the whole string above. To get the three pairs of open and close tag. You do [\w|\W]+?

Reference:
http://www.unagibay.com/DesktopDefault.aspx?tabindex=1&tabid=100&itemid=1826
http://www.regextester.com/

Friday, June 4, 2010

How to find processor types on Windows, Ubuntu/Linux, and Macbook

 Here I give examples of finding the OS and processor types of a PC,Mac and Ubuntu:

OS Processor type OS type
Windows 64 bit 32 bit
Mac OS X 64 bit: Intel Core 2 Duo 32 bit
Ubuntu 64 bit 32 bit

On windows
open cmd and type systeminfo
In the output:
System Type: X86-base PC  says the operating system is 32 bit.
Processors: X64 Family Model tells you the processor is 64 bit






On Mac:




Then compare your processor with the chart below:



On Ubuntu:
type lshw | -class processor outputs the cpu width 64 bits 
type uname -a output i686


 

Tuesday, March 16, 2010

why / as sysdba

to start up oracle:
->su -l oracle //login as oracle, password
->sqlplus //start sqlplus
->/ as sysdba //?? see below
->startup //start oracle
->exit //quit sqlplus


http://download.oracle.com/docs/cd/B10501_01/server.920/a90842/ch4.htm#1006252

The AS clause allows privileged connections by users who have been granted SYSOPER or SYSDBA system privileges. You can also use either of these privileged connections with / and /NOLOG.

If you use this option, you need to quote the command arguments on many operating systems, for example:

SQLPLUS "/ AS SYSDBA" SQLPLUS "SYSTEM/your_password AS SYSOPER"


http://ugweb.cs.ualberta.ca/~c391/manual/chapt4.html

Enter the command ``sqlplus /''.
Note: This example assumes that you have been given the same ORACLE user ID as your login. If you forget to add the ``/'' you will be asked to enter your name and password for your ORACLE user ID, in which case you should press $\wedge C$ (cntrl-C) and start over. Entering your system user ID and password will not get you access to SQL*Plus. If your ORACLE user ID differs from your system ID refer to the ``SQL*Plus User's Guide and Reference''.

Sunday, November 29, 2009

Add Model reference to View

In Model View Controller in the context of Cocoa, when View(PolygonView) needs a reference to Model(PolygonShape):
Step 1: declare an instance variable of PolygonShape in PolygonView



Step 2 Link the Outlet PolygonShape to Class PolygonShape

Thursday, October 15, 2009

#include vs #include "file"

First: <> vs ""
Both would work if file exist. The difference is the order of directories are searched.
In case of <>: ONLY searches in list of SYSTEM directories. If file does not exist in the system directories then C1083 error.

In case of "file": First searches in the including file directory(current file directory), if not found then searches in the SYSTEM directories. If either is found then C1083 error.

Second: file vs file.h
Some of the header files end with ".h" others do not. Eg stdio.h vs fstream .Both of the files are in system directory so proper inclusion would be
#include
#include

of course the following would work as well
#include "stdio"
#include "fstream.h"

See picture for more clarification example





verifies files are in system directory


ref:http://gcc.gnu.org/onlinedocs/cpp/Include-Syntax.html