Older blog entries for sness (starting at number 4847)

Decorators and Functional Python

Decorators and Functional Python: "Decorators are one of Python's great features. In addition to their intrinsic usefulness in the language, they also help us to think in an interesting way — a functional way.

I intend to explain how decorators work from the ground up. We'll start by covering a few topics you'll need in order to understand decorators. After that, we'll dive in and explore a few simple decorators and how they work. Finally, we'll talk about some more advanced ways to use decorators, such as passing them optional arguments or chaining them together."

'via Blog this'

Syndicated 2013-01-09 17:41:00 from sness

Two star programming

Two star programming: "I wrote up a benchmark where I remove every other element from a ten million list of integers. My results (clang, MacBook Pro 2012):

vector      :      10 ms
list        :     422 ms
forward_list:    1327 ms
C list      :     419 ms

So std::vector about 40x quicker than any linked list. std::forward_list was surprisingly slow.


'via Blog this'

Syndicated 2013-01-09 17:40:00 from sness

The Story of the PING Program

The Story of the PING Program: "I named it after the sound that a sonar makes, inspired by the whole principle of echo-location. In college I'd done a lot of modeling of sonar and radar systems, so the "Cyberspace" analogy seemed very apt. It's exactly the same paradigm applied to a new problem domain: ping uses timed IP/ICMP ECHO_REQUEST and ECHO_REPLY packets to probe the "distance" to the target machine."

'via Blog this'

Syndicated 2013-01-09 17:37:00 from sness

Don't worry, it's just ESD! (Electrostatic Discharge) - YouTube

Don't worry, it's just ESD! (Electrostatic Discharge) - YouTube: "