Skip to content

Instantly share code, notes, and snippets.

View ivarne's full-sized avatar

Ivar Nesje ivarne

  • Oslo, Norway
  • 14:16 (UTC +02:00)
View GitHub Profile
function old_colon{T<:Integer}(start::T, step::T, stop::T)
Range(start, step, max(0, div(stop-start+step, step)))
end
function new_colon{T<:Integer}(start::T, step::T, stop::T)
len,rem = divrem(stop-start,step)
Range(start, step, max(0, len+div(rem+step,step)))
end
function range_test_old()
@ivarne
ivarne / REPL.jl
Last active December 25, 2015 03:29 — forked from quinnj/gist:6908779
_
_ _ _(_)_ | A fresh approach to technical computing
(_) | (_) (_) | Documentation: http://docs.julialang.org
_ _ _| |_ __ _ | Type "help()" to list help topics
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 0.2.0-prerelease+3952
_/ |\__'_|_|_|\__'_| | Commit d0c2058 2013-10-06 19:08:09 UTC
|__/ | x86_64-w64-mingw32
julia> abstract BTree
"""
Somewhat minimal example demonstrating how the Python dropbox api has inconcistent UTF-8 handeling
for filenames and paths.
To simpelify upload of many files i let users copy their files to a upload folder under an
application specific dropox folder named upload. Then I download theese files to my server and makes
them availible to the application.
My problem was that if filenames contains non ASCII characters like æøå I got an encoding error when
I tried to delete the file. The problem was resolved when i encoded f['path'] to utf-8, but I have