<div id="fruits"> <ul> <li id="5">Apples</li> <li id="29">Oranges</li> <li id="32">Peaches</li> <li id="47">Bananas</li> <li id="30">Grapes</li> </ul> </div>
You can get a specific list item using jQuery
$jq("#fruits ul li[id=32]");
<div id="fruits"> <ul> <li id="5">Apples</li> <li id="29">Oranges</li> <li id="32">Peaches</li> <li id="47">Bananas</li> <li id="30">Grapes</li> </ul> </div>
$jq("#fruits ul li[id=32]");
$ du -sch foo/ dummy/ data/ booger/
3G foo/
2G dummy/
9G data/
5G booger/
19G total
ALTER TABLE my_table AUTO_INCREMENT=7
TRUNCATE TABLE my_table
select TIMEDIFF('2011-10-31 12:50:56' , '2011-09-23 12:50:21')
The above outputs : 838:59:59
select TIMEDIFF('15:50:56' , '12:55:21')
The above SQL outputs: 02:55:35
select DATEDIFF('2011-10-31 12:50:56' , '2011-09-23 12:50:21')
The above SQL outputs: 38
select DATEDIFF('2011-10-31' , '2011-09-23')
The above SQL outputs: 38
public class IpToolTester {
public static void main(String[] args) {
ImageTool imageTool = new ImageTool();
String srcPath = "lena_384.pgm";
Image srcImg = new Image(srcPath);
Image tgtImg = new Image();
tgtImg.init(srcImg.getNumRows(), srcImg.getNumCols());
imageTool.copyImg(srcImg, tgtImg);
tgtImg.save("lena_write.pgm");
System.out.println("Done");
}
}
5. Right click on the project and select "Run as->java application" $ cd ~/apps/oommf12a4pre-20091216
Run the following 2 commands $ tclsh oommf.tcl +platform
The above command prints summary of your platform configuration. Make sure all the config files are located and listed. Example output will be like the following oommf.tcl 1.2.0.4 info:
OOMMF release 1.2.0.4, snapshot 2009.12.16
Platform Name: darwin
Tcl name for OS: Darwin 10.7.0
C++ compiler: /usr/bin/g++
Tcl configuration file: /usr/lib/tclConfig.sh
tclsh: /usr/bin/tclsh8.5
Tcl release: 8.5.7 (config) 8.5.7 (running)
Tk configuration file: /usr/lib/tkConfig.sh
wish: /usr/bin/wish8.5
Tk release: 8.5.7 (config) 8.5.7 (running)
Tcl threads: Yes
OOMMF threads: Yes
Default thread count: 2
Now you have all the configurations good, to compile and build run the following command $ tclsh oommf.tcl pimake
The above command runs for a while. If there is an error, it prints the error on the console. $ tclsh oommf.tcl
1. Open httpd.conf located at /private/etc/apache2/httpd.conf
Open it using "vi" in terminal or open it using "text wrangler". Donot open using any word processing program, they will add unwanted characters into the file. # Virtual hosts
Include /private/etc/apache2/extra/httpd-vhosts.conf
/private/etc/apache2/extra/httpd-vhosts.conf
Open it using "vi" in terminal or open it using "text wrangler". Donot open using any word processing program, they will add unwanted characters into the file. <VirtualHost *:80>
DocumentRoot "/Library/WebServer/Documents/mydemo"
ServerName mydemo.local
ErrorLog "/private/var/log/apache2/mydemo.local-error_log"
CustomLog "/private/var/log/apache2/mydemo.local-access_log" common
</VirtualHost>
1. Open hosts located at /private/etc/hosts
Open it using "vi" in terminal or open it using "text wrangler". Donot open using any word processing program, they will add unwanted characters into the file. 127.0.0.1 mydemo.local
<?xml version="1.0"?>
<!DOCTYPE notes [
<!ELEMENT notes (note*)>
<!ELEMENT note (to,from,heading,body*)>
<!ELEMENT to (#PCDATA)>
<!ELEMENT from (#PCDATA)>
<!ELEMENT heading (#PCDATA)>
<!ELEMENT body (#PCDATA)>
]>
<notes>
<note>
<to>Joe</to>
<from>Tom</from>
<heading>Hello</heading>
</note>
<note>
<to>Bob</to>
<from>Joe</from>
<heading>Reminder</heading>
<body>this is msg</body>
</note>
</notes>
function startsWith($needle, $haystack){
return preg_match('/^'.preg_quote($needle)."/", $haystack);
}
function endsWith($needle, $haystack){
return preg_match("/".preg_quote($needle) .'$/', $haystack);
}
$cmd ='export PATH=$PATH:/opt/local/bin; myCommand 2>&1';
echo exec($cmd,$out);
$cmd = "gmake";
echo exec($cmd,$out);
sh: gmake: command not found
To fix this, we need to export the PATH of the gmake. $ which gmake
/opt/local/bin/gmake
$cmd ='export PATH=$PATH:/opt/local/bin; gmake 2>&1';
echo exec($cmd,$out) ;
gmake: *** No targets specified and no makefile found. Stop.
$today = date('Y-m-d');
$tomorrow = date('Y-m-d', strtotime('tomorrow'));
$yesterday = date('Y-m-d', strtotime('yesterday'));
CREATE TABLE booger_copy LIKE testing.booger;
INSERT booger_copy SELECT * FROM testing.booger;
If you want to copy only half of the existing table then, you can use LIMIT keyword in the select Query
If you've ever found yourself needing to measure the execution time of specific portions of your Python code, the `contextlib` module o...