This file contains 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
reverse = lambda s: ''.join([c for i,c in sorted(zip(range(len(s)), s), key=lambda c: -c[0])]) | |
reverse('burrito') # otirrub | |
# Or do it in a single line! | |
(lambda s: ''.join([c for i,c in sorted(zip(range(len(s)), s), key=lambda c: -c[0])]))('burrito') |
This file contains 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
//#!/usr/bin/node | |
// neg = node exif geolocation, latitude and longitude | |
// Add to your path, then use as: neg.js [path to image] | |
// chmod +x this file on download, move to a path folder | |
// or add to path manually | |
var im = require('imagemagick'); | |
if (process.argv.length === 3) { |
This file contains 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 im = require('imagemagick'); | |
var Guid = require('guid'); | |
var siteConf = require('./lib/getConfig'); | |
var lib = new require('./lib/asms-client.js')(app, cf).streamLib; | |
function ingestPhoto(req, res, next){ | |
if (req.files.image) { | |
im.identify(req.files.image.path, function(err, features){ | |
if (features && features.width) { | |
var guid = Guid.create(); |
This file contains 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
import os | |
def reverse_filename(s): | |
split_filename = s.split(" - ") | |
split_filename.reverse() | |
new_filename = " - ".join(split_filename) | |
return new_filename | |
file_extension = ".mp3" |
This file contains 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
import sys | |
import math | |
def is_prime(n): | |
if n < 4: | |
return True | |
if n % 2 == 0: | |
return False | |
for a in range(3, int(math.sqrt(n))+1): | |
if n % a == 0: |
This file contains 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 is_prime(n) | |
if n < 4 | |
return true | |
end | |
if n % 2 == 0 | |
return false | |
end | |
for a = 3:int(sqrt(n)) | |
if n % a == 0 | |
return false |
This file contains 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
program hw2 | |
implicit none | |
real x | |
double precision y | |
double precision z | |
integer i | |
double precision h | |
double precision q | |
This file contains 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
! use f90 or f95 for this | |
program hw2 | |
implicit none | |
! vars | |
double precision :: h, p | |
integer :: loop | |
double precision, dimension(11) :: trueVals | |
h = 1.0 |
This file contains 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
0.4 10.12 | |
0.6 10.21 | |
0.8 10.29 | |
1 10.21 | |
1.2 10.21 | |
1.4 10.12 | |
1.6 10.048 | |
1.8 10.14 | |
2 10.205 | |
2.2 10.12 |
This file contains 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
0.4 9.80 | |
0.6 9.73 | |
0.8 9.82 | |
1 9.73 | |
1.2 9.73 | |
1.4 9.82 | |
1.6 9.65 | |
1.8 9.65 | |
2 9.73 | |
2.2 9.73 |
OlderNewer