Förvillelser
link

Ändringar

0071 is the most recent release. It has a lot of new features, new interfaces, and probably some new bugs too. 0071 is not 100% compatible with older projects. Please see the changelog to get an overview of the differences between versions.

(Source: createdigitalmotion.com)

link

bpython is a fancy interface to the Python interpreter for Unix-like operating systems (I hear it works fine on OS X). It is released under the MIT License. It has the following features:

  • In-line syntax highlighting.
  • Readline-like autocomplete with suggestions displayed as you type.
  • Expected parameter list for any Python function.
  • “Rewind” function to pop the last line of code from memory and re-evaluate.
  • Send the code you’ve entered off to a pastebin.
  • Save the code you’ve entered to a file.
  • Auto-indentation.
  • Python 3 support.

link

Python.

Plumbum was born to fill this very gap: on the one hand, be pythonic (and be backed by strong libraries), and on the other, make it all as easy and one-liner-ish by nature: use a real programming language, with a well-behaved object model and high level concepts, to achieve what you’d normally do in a shell script, with the same expressive power and wrist-handiness of the shell. I call it shell combinators, as they mimic shell syntax, but keep you pythonic.

Plumbum is actually a collection of utilities that I wrote for several separate projects, but the time has come to consolidate them into a single, production-grade library. The library provides local and remote program execution, with support for piping and IO redirection; local and remote file-system path abstraction; a programmatic command-line interface (CLI) toolkit, and numerous other utilities.

Exempel:

from plumbum import local
from plumbum.cmd import wc, ls, echo, grep
from plumbum.utils import copy, delete

delete(local.cwd // "*/*.pyc")

for fn in local.cwd / "src" // "*.py":
print wc("-l", fn)

num_of_src_lines
= (ls["-l"] | grep["\\.py"] | wc["-l"])()
echo["1"] > "/proc/sys/net/ipv4/ip_forward")()
link
Clojure

Var på Clojure meetup igår. Mycket trevligt.

Postade tidigare den här länken, för att lära sig mer. Men vill nu även lägga till de här:

  • 4clojure - “4Clojure is a resource to help fledgling clojurians learn the language through interactive problems. The first few problems are easy enough that even someone with no prior experience should find the learning curve forgiving.”
  • Cemerik, Starting Clojure (mk. 2) - “A complete (though not pretty!) URL shortener webapp is built from scratch, with discussions of immutable data structures, function composition, and mild concurrency topics scattered throughout.”



link

Farbrausch är en demoscene-grupp som gjort en hel del imponerande produktioner. Nu släpper de mycket av sina verktyg med källkod. Härligt!

link

Julia is a high-level, high-performance dynamic programming language for technical computing, with syntax that is familiar to users of other technical computing environments. It provides a sophisticated compiler, distributed parallel execution, numerical accuracy, and an extensive mathematical function library.

(Source: r-bloggers.com)

link
Uppdatering av lolguides

Har donat lite med backenden för lolguides.net ikväll. Mycket skönt. Har äntligen fått insamlingsdelen trådad. Har även lyckats pilla till lite ny funktionalitet, det är nu enkelt att lägga till små notiser (olika eller likadana för index och champsidor).

Uppdatering: Glad att jag använder bootstrap2

link

The Challenge

The challenge is to come up with the fastest data structure that meets the following requirements:

  • Use less memory than an array in all circumstances
  • Fast Seek is more important than Fast Access
  • Seek and Access must be better than O(N).


Where Seek and Access are defined as:

Access (int index): Return me the value at the specified index ( like array[idx] ). 

Seek (int value): Return me all the Indexes that match value.

link

Övningar för den som är vill lära sig funktionell programmering med Clojure.

link

Scrapy is a fast high-level screen scraping and web crawling framework, used to crawl websites and extract structured data from their pages. It can be used for a wide range of purposes, from data mining to monitoring and automated testing.

Skulle kunna vara ett lite mer rigid alternativ till BeautifulSoup för lolguides.net kanske?

link
Java, Axis 1.4, SSL

Har nu haft ett par frustrerande duster med Axis 1.4 och webtjänster som använder SSL.

Axis 1.4 är ifrån 2006 och har en del brister. Några av dem involverar SSL.

Problem 1

Byta certifikat dynamiskt, i run-time. Detta går helt enkelt inte i en orörd Axis 1.4 -version. Se Apaches Axis wiki sida om problemet. Lösningen är att använda en forkad axis.

Problem 2

I javaversioner äldre än 1.6 18 så går det utmärkt att tjänsten du kommunicerar med gör s.k SSL renegotiation. I nyare versioner av java så fungerar det inte utan pill, då det finns risk för Man-in-the-middle attacker. Mer teknisk information om detta här http://java.sun.com/javase/javaseforbusiness/docs/TLSReadme.html och här
http://www.oracle.com/technetwork/java/javase/documentation/tlsreadme2-176330.html. Lösningen på nyare versioner av java är att passa in flaggan -Dsun.security.ssl.allowUnsafeRenegotiation=true till jvmen eller sätta den i din kod (java.lang.System.setProperty(“sun.security.ssl.allowUnsafeRenegotiation”, “true”);). Vägen till att komma fram till detta var lång och snårig. Felmeddelandet jag fick från Axis var det informativa:

AxisFault
 faultCode: {http://xml.apache.org/axis/}HTTP
 faultSubcode:
 faultString: (0)null
 faultActor:
 faultNode:
 faultDetail:
    {}:return code:  0

    {http://xml.apache.org/axis/}HttpErrorCode:0

(0)null
    at org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:744)
    at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:144)

Slutventilerat för stunden. :-)

link

PBS is a unique subprocess wrapper that maps your system programs to Python functions dynamically. PBS helps you write shell scripts in Python by giving you the good features of Bash (easy command calling, easy piping) with all the power and flexibility of Python.

Ser väldigt smidigt ut.

import pbs
print pbs.ifconfig("eth0")

# resolves to "curl http://duckduckgo.com/ -o page.html --silent" pbs.curl("http://duckduckgo.com/", o="page.html", silent=True)

# print the number of folders and files in /etc print pbs.wc(pbs.ls("/etc", "-1"), "-l")

# sudo
with pbs.sudo: print pbs.ls("/root")

link

by Allen B. Downey

Buy this book from Amazon.com.

Download this book in PDF.

Read this book online.

Description

This book is about complexity science, data structures and algorithms, intermediate programming in Python, and the philosophy of science:

  • Data structures and algorithms: A data structure is a collection that contains data elements organized in a way that supports particular operations. For example, a dictionary organizes key-value pairs in a way that provides fast mapping from keys to values, but mapping from values to keys is generally slower.

    An algorithm is a mechanical process for performing a computation. Designing efficient programs often involves the co-evolution of data structures and the algorithms that use them. For example, the first few chapters are about graphs, a data structure that is a good implementation of a graph—-nested dictionaries—-and several graph algorithms that use this data structure.

  • Python programming: This book picks up where Think Python leaves off. I assume that you have read that book or have equivalent knowledge of Python. As always, I will try to emphasize fundmental ideas that apply to programming in many languages, but along the way you will learn some useful features that are specific to Python.
  • Computational modeling: A model is a simplified description of a system that is useful for simulation or analysis. Computational models are designed to take advantage of cheap, fast computation.
  • Philosophy of science: The models and results in this book raise a number of questions relevant to the philosophy of science, including the nature of scientific laws, theory choice, realism and instrumentalism, holism and reductionism, and Bayesian epistemology.

link

Recently, this video of IBNIZ in action made its way around the electronic music blogosphere. IBNIZ is an extremely enigmatic art platform. It’s not necessarily easy, or pretty, or even broadly useful. IBNIZ is uniquely targeted at a small coterie of artists with specific aesthetic goals. I had the opportunity to ask Viznut, the creator of IBNIZ, about the language, and his views were so intriguing that I am publishing them unedited here.


link

Today we are launching code.nasa.gov, the latest member of the open NASA web family. Through this website, we will continue, unify, and expand NASA’s open source activities. The site will serve to surface existing projects, provide a forum for discussing projects and processes, and guide internal and external groups in open development, release, and contribution.