This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Set objFSO = CreateObject("Scripting.FileSystemObject") | |
y = "" | |
MyDate = DateSerial(2012, 1, 1) | |
y = year(MyDate)*10000+month(MyDate)*100+day(MyDate) | |
WScript.echo y | |
objFSO.CreateFolder y | |
For counterVariable = 1 to 366 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import datetime , timedelta | |
import os | |
dt_obj = datetime(2012, 1, 1, 17, 53, 59) | |
for i in range(0,366): | |
dt_obj2 = dt_obj + timedelta(days=i) | |
os.makedirs( dt_obj2.strftime("%Y%m%d") ) | |
print "done" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Movie Info</title> | |
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.min.js"></script> | |
<script src="https://code.angularjs.org/1.2.16/angular-route.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.7.0/underscore-min.js"></script> | |
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=trshant" async="async"></script> | |
<link rel="stylesheet" type="text/css" href="http://cdn.jsdelivr.net/min/1.5/min.min.css"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var rows = $('table.wikitable tr') ; | |
rowlen = rows.length ; | |
rrr = [] ; | |
for( i=1 ; i<rowlen ; i++ ){ | |
row = rows[i]; | |
var v = $(row).find('td a')[0].innerHTML ; | |
//alert( v ); | |
rrr.push( v ); | |
} | |
select_string = '<select name="">\n'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var position = {}; | |
document.addEventListener('mousemove', function(e){ | |
position = { x: e.clientX, y: e.clientY } // for browser window WRT | |
position = { x: e.pageX, y: e.pageY } // for page WRT | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
navigator.geolocation.getCurrentPosition(function(position) { | |
var latitude = position.coords.latitude; | |
var longitude = position.coords.longitude; | |
console.log( latitude , longitude ); | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
var beforePrint = function() { | |
console.log('Functionality to run before printing.'); | |
}; | |
var afterPrint = function() { | |
console.log('Functionality to run after printing'); | |
}; | |
if (window.matchMedia) { | |
var mediaQueryList = window.matchMedia('print'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string <- "Hello World" | |
string |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ipak function: install and load multiple R packages. | |
# check to see if packages are installed. Install them if they are not, then load them into the R session. | |
ipak <- function(pkg){ | |
new.pkg <- pkg[!(pkg %in% installed.packages()[, "Package"])] | |
if (length(new.pkg)) | |
install.packages(new.pkg, dependencies = TRUE) | |
sapply(pkg, require, character.only = TRUE) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function RoundingToNextTop( $num , $rounding ) { | |
return ( round( $num , (-1 * $rounding ) ) < $num )? round( $num , (-1 * $rounding ))+pow ( 10 , $rounding ) : round( $num , (-1 * $rounding ) ) ; | |
} | |
echo RoundingToNextTop( 13.3583 , 1 ) ; | |
// 20 | |
echo RoundingToNextTop( 103.3583 , 1 ) ; | |
// 110 | |
echo RoundingToNextTop( 103.3583 , 2 ) ; |
OlderNewer