Posts

xrange with float steps - Python

The great thing about this code, is that the definition its a generator. (You can easily identify the keyword yield) def drange(start, stop, step): r = start while r >>>i0=drange(0.0, 1.0, 0.1) >>>["%g" % x for x in i0] ['0', '0.1', '0.2', '0.3', '0.4', '0.5', '0.6', '0.7', '0.8', '0.9', '1'] >>> source

Region Of Interest Ascii - IDL

An IDL little snippet to read Regions of Interest from an ascii file function load_roi, file_name ; Open file in read-only mode. openr, fd, file_name, /GET_LUN ; Read total pixel from 1 ROI. size = 0 readf, fd, size ; Read the indices of the pixels in the ROI result = intarr(size) readf, fd, result ; Close the file. close, fd return, result end Coded by Sil!

How to create symbolic link in Mac Os Lion

ln -s <absolute_path> <name_of_link>

Timeit function

Here i present a little function (with an example below) to time some bunch of code using timeit. # -*- coding: utf-8 *-* import timeit class Chronoit(): """ A little class to handle timeit output. The output is in seconds. """ def __init__(self, main_statement, setup_statement, total_iterations): self.main_stmt = main_statement self.setup_stmt = setup_statement self.total_iter = total_iterations t = timeit.Timer(self.main_stmt, self.setup_stmt) self.show_results(t.timeit(number=self.total_iter)) def show_results(self, time_elapsed): time_per_pass = time_elapsed / self.total_iter if time_per_pass > 60.0: minutes_per_pass = time_per_pass / 60.0 secs_per_pass = time_per_pass % 60.0 print "#" * 50 print "Timing" print "setup stmt: \"" + self.setup_stmt.split("\n")[1] + ...

Modem Zyxel p-660R-T1 v3s Arnet

User: admin Password: alvlgeddl

Tethering in Iphone 4 - Movistar Argentina

General → Network → Cellular Data Network Under "Internet Tethering" we write: APN:internet.gprs.unifon.com.ar Username: internet Password: internet Turn on and off General → Network → Personal Hotspot and swipe to on Select a password and you're done!

New Ninja-IDE scheme color - focojoaco version 2

{ "keyword": "#228b22", "operator": "#242424", "brace": "#228b22", "definition": "#6495ed", "string": "#ff8c00", "string2": "#838b83", "comment": "#8b8878", "properObject": "#8b0a50", "numbers": "#ff4500", "spaces": "#000000", "extras": "#A37A00", "editor-background": "#eeeee0", "editor-selection-color": "#ebc79e", "editor-selection-background": "#8b8878", "editor-text": "#242424", "current-line": "#6ca6Cf", "selected-word": "#a2cd5a", "fold-area": "white", "fold-arrow": "darkGray" } Ninja IDE Website