Welcome to Clyther’s documentation! — Clyther development documentation. CLyther is a Python tool similar to Cython and PyPy. CLyther is a just-in-time specialization engine for OpenCL. The main entry points for CLyther are its clyther.task and clyther.kernel decorators. Once a function is decorated with one of these the function will be compiled to OpenCL when called. CLyther is a Python language extension that makes writing OpenCL code as easy as Python itself. CLyther currently only supports a subset of the Python language definition but adds many new features to OpenCL. CLyther exposes both the OpenCL C library as well as the OpenCL language to python. Objectives: Make it easy for developers to take advantage of OpenCLTake advantage existing Python numerical algorithmsAccelerate my code! Philosophy: Enable users to have 100% control via Python.
Warning This is a brand new version of CLyther. If you do decide to use it then please think about Contributing.The best place to add your input to the Issue Tracker. List of freely available programming books. 5 Weeks of Go. I promised a few people that I’d write up my impressions of Go after spending 5 or so weeks learning it while developing Amberfell. I’m not an expert in computer language design nor do I have extensive experience in obscure languages. I pick my language based on how productive I and others can be with it not on how pure it is. In my opinion the Go designers have done an excellent job of blending the flexibility and convenience of a scripting language with the performance and safety of a strongly typed compiled language.
Coupled with its special support for concurrency and excellent standard library this makes Go a great language to work with. The amazing speed of the compiler means the development cycle is a fast as a scripting language even though full optimizations are always switched on. Go recently reached version 1.0 which is intended to remain stable for a number of years to come.
Syntax Go is a small language in the vein of C, easy to learn the basics in a couple of hours. Packaging. A few things to remember while coding in Python. How to be a Programmer: A Short, Comprehensive, and Personal Summary. Debugging is the cornerstone of being a programmer. The first meaning of the verb to debug is to remove errors, but the meaning that really matters is to see into the execution of a program by examining it. A programmer that cannot debug effectively is blind. Idealists that think design, or analysis, or complexity theory, or whatnot, are more fundamental are not working programmers. The working programmer does not live in an ideal world. Even if you are perfect, your are surrounded by and must interact with code written by major software companies, organizations like GNU, and your colleagues. Most of this code is imperfect and imperfectly documented. Debugging is about the running of programs, not programs themselves.
To get visibility into the execution of a program you must be able to execute the code and observe something about it. The common ways of looking into the ‘innards’ of an executing program can be categorized as: How to Debug by Splitting the Problem Space. Introduction to Test Driven Development (TDD) Test-driven development (TDD) (Beck 2003; Astels 2003), is an evolutionary approach to development which combines test-first development where you write a test before you write just enough production code to fulfill that test and refactoring. What is the primary goal of TDD? One view is the goal of TDD is specification and not validation (Martin, Newkirk, and Kess 2003). In other words, it’s one way to think through your requirements or design before your write your functional code (implying that TDD is both an important agile requirements and agile design technique).
Another view is that TDD is a programming technique. As Ron Jeffries likes to say, the goal of TDD is to write clean code that works. Table of Contents 1. Figure 1. I like to describe TDD with this simple formula: TDD = Refactoring + TFD. TDD completely turns traditional development around. Note that Figure 2 assumes that you're doing both, although it is possible to do either one without the other. 2. 3. 4. 5. 6. 7. 8. Improving your code with modern idioms — Porting to Python 3 - The Book Site. Once you have ported to Python 3 you have a chance to use the newer features of Python to improve your code.
Many of the things mentioned in this chapter are in fact possible to do even before porting, as they are supported even by quite old versions of Python. But I mention them here anyway, because they aren’t always used when the code could benefit from them. This includes generators, available since Python 2.2; the sorted() method, available since Python 2.4 and context managers, available since Python 2.5. The rest of the new features mentioned here have in fact been backported to either Python 2.6 or Python 2.7. Use sorted() instead of .sort() Lists in Python has a .sort() method that will sort the list in place. >>> infile = open('pythons.txt')>>> pythons = infile.readlines()>>> pythons.sort()>>> [x.strip() for x in pythons]['Eric', 'Graham', 'John', 'Michael', 'Terry', 'Terry'] The 2to3 fixer "idioms" will change some usage of .sort() into sorted().
Coding with context managers. Which languages are used for safety-critical software. Computer and Network Security - Massachusetts Institute of Technology - Spring 2012. Paper details, and presentation dates set Presentation dates are posted here. The project paper should be similar to a research paper - it should talk about the problem studied, the previous work (if any), the approach taken, the results found, and conclusions. In particular you should point out your project extends previous work on the subject! The paper should have an excellent bibliography, nice figures, be well-organized, and be well-written. A good paper is probably around 25 pages, though some groups may need more space, and less may be fine in some cases.
Problem Set 5 is posted Problem Set 5 is posted, and is due May 4th. Problem Set 4 posted PS4 is posted. Practice Number Theory Problems To sharpen your number theory skills, take a look at the following supplementary exercises, with a few additional supplementary problems here. Project Proposal Due Friday Your group of size 3 or 4 should turn in a multiple page project proposal by 11:59 PM this Friday, 3/23, as an email to 6857-staff.
Encryption is not gravy. When designing a secure service that stores user data, you might be temped to say “let’s make sure the data is encrypted.” That statement implies that you’re proposing adding goodness, without taking anything away. Something like “I’d like some of that delicious gravy on my roast turkey, please.” Clearly, turkey with gravy is strictly better than dry turkey. Who can possibly say no to gravy? Unfortunately, encryption is not gravy. There are deep consequences to the product you’re building once you choose to encrypt data, and the consequences differ greatly depending on the key management mechanism you choose. I wrote about this in part in my previous crypto-realism post, encryption is not magic: For the most part, encryption isn’t magic.
That last point bears repeating: if you design a system with encryption where users manage keys, you’re going to lose features. I’ve been there, and I’ve made that mistake. Exactly. Now don’t get me wrong. So what are my options where Mozilla fits in. Cheetah - The Python-Powered Template Engine. Basic framework for presentations using HTML5 + javascript. Bartaz/impress.js. Modern HTML Presentations. So Many Ways to Start Your Mongo. Starting up a vanilla MongoDB instance is super easy, it just needs a port it can listen on and a directory where it can save your info.
By default, Mongo listens on port 27017, which should work fine (it’s not a very commonly used port). We’ll create a new directory for database files: And then start up our database: 1.$ cd 2.$ bin/mongod --dbpath ~/dbs/mydb …and you’ll see a bunch of output: 01.$ bin/mongod --dbpath ~/dbs/mydb 02.Fri Apr 23 11:59:07 Mongo DB : starting : pid = 9831 port = 27017 dbpath = /data/db/ master = 0 slave = 0 32-bit 04.** NOTE: when using MongoDB 32 bit, you are limited to about 2 gigabytes of data 07.Fri Apr 23 11:59:07 db version v1.5.1-pre-, pdfile version 4.5 08.Fri Apr 23 11:59:07 git version: f86d93fd949777d5fbe00bf9784ec0947d6e75b9 09.Fri Apr 23 11:59:07 sys info: Linux ubuntu 2.6.31-15-generic 10.Fri Apr 23 11:59:07 waiting for connections on port 27017 11.Fri Apr 23 11:59:07 web admin interface listening on port 28017 Set up a slave, Maeve 1.$ mkdir ~/dbs/slave2.
HTML5 Presentation. In March 1936, an unusual confluence of forces occurred in Santa Clara County. A long cold winter delayed the blossoming of the millions of cherry, apricot, peach, and prune plum trees covering hundreds of square miles of the Valley floor. Then, unlike many years, the rains that followed were light and too early to knock the blossoms from their branches. Instead, by the billions, they all burst open at once. Seemingly overnight, the ocean of green that was the Valley turned into a low, soft, dizzyingly perfumed cloud of pink and white. Uncounted bees and yellow jackets, newly born, raced out of their hives and holes, overwhelmed by this impossible banquet.
Then came the wind. It roared off the Pacific Ocean, through the nearly uninhabited passes of the Santa Cruz Mountains and then, flattening out, poured down into the great alluvial plains of the Valley. About Exploit Exercises. Club Dr-DOS Wiki | Main / Compress. Cheat sheets for the beginners - Electronics. The picture shows a fragment of perfect cheat sheet that has the basic electronic components, including their appearance and the symbol on the schematic circuits. A cheat sheet for the electronic components (PDF, 168Kb)A cheat Sheet for the microcontrollers AVR (Part 1) (PDF, 61Kb)A cheat Sheet for the microcontrollers AVR (Part 2) (PDF, 61Kb) PS: Also, this website has an interesting blog with a description of effective electronic craft projects, including the links to the open source firmware.
SVG animations, CSS Animations, CSS Transitions | Web Platform Team Blog. Recently there was a discussion in the SVG working group how SVG Animations (based on SMIL Animations), CSS3 Animations and CSS3 Transitions contribute to the animation sandwich model for SVG presentation attributes. SVG presentation attributes First, what are SVG presentation attributes? In SVG, a subset of all CSS properties can be set by SVG attributes. Examples of these attributes are fill, stroke, font-size or filter.
Specifies the fill CSS property on the rect element. A list of all SVG presentation attributes can be found in the SVG 1.1 specification. Presentation attributes contribute to CSS cascading as shown in the graphic above. Or Settings on one style override settings of previous styles in the CSS cascade. Animation of presentation attributes But presentation attributes have another benefit. The animation sandwich model The following example demonstrates how two animations on the same attribute affect the value of the attribute itself: Combining CSS Animations with SVG Animations.
BrowserQuest/client at master · mozilla/BrowserQuest. Riak Overview. Faster than C ― Andreas Zwinkau. Judging the performance of programming languages, usually C is called the leader, though Fortran is often faster. New programming languages commonly use C as their reference and they are really proud to be only so much slower than C. Few language designer try to beat C. What does it take for a language to be faster than C? Better Aliasing Information Aliasing describes the fact that two references might point to the same memory location.
Void* memcopy(void* dst, const void* src, size_t count) { while (count--) *dst++ = *src++; return dst; } Depending on the target architecture, a compiler might perform a lot of optimizations with this code. In C99 the restrict keyword was added, which we could use here to encode that src and dst are different from all other references. Fortran semantics say that function arguments never alias and there is an array type, where in C arrays are pointers. Push Computation to Compile-Time Doing things at compile time reduces the run time. Runtime Optimization. Bit Twiddling Hacks. By Sean Eron Anderson seander@cs.stanford.edu Individually, the code snippets here are in the public domain (unless otherwise noted) — feel free to use them however you please. The aggregate collection and descriptions are © 1997-2005 Sean Eron Anderson. The code and descriptions are distributed in the hope that they will be useful, but WITHOUT ANY WARRANTY and without even the implied warranty of merchantability or fitness for a particular purpose.
As of May 5, 2005, all the code has been tested thoroughly. Thousands of people have read it. Moreover, Professor Randal Bryant, the Dean of Computer Science at Carnegie Mellon University, has personally tested almost everything with his Uclid code verification system. Contents About the operation counting methodology When totaling the number of operations for algorithms here, any C operator is counted as one operation. Compute the sign of an integer The last expression above evaluates to sign = v >> 31 for 32-bit integers.
Sign = (v ! Sean A. (un)classroom. S Nginx Tutorials (version 2012.03.23) I've been doing a lot of work in the Nginx world over the last few years and I've also been thinking about writing a series of tutorial-like articles to explain to more people what I've done and what I've learned in this area. Now I have finally decided to post serial articles to the Sina Blog in Chinese. Every article will roughly cover a single topic and will be in a rather casual style. But at some point in the future I may restructure the articles and their style in order to turn them into a "real" book. The articles are divided into series. For example, the first series is "Nginx Variables". Each series can be thought of as mapping to a chapter in the Nginx book that I may publish in the future. The articles are intended for Nginx users of all experience levels, including users with extensive Apache and Lighttpd experience who may have never used Nginx before.
The examples in the articles are at least compatible with Nginx 0.8.54. ? October 30, 2011. CSS-Tricks. Deploying My Django Application to DotCloud. This post is out of date. A revised tutorial can be found HERE. I have recently written about ep.io and gondor.io, two new Python/Django hosting services that are currently in beta. Another new service that has just recently hit the scene and is causing a lot of waves is DotCloud.com. DotCloud is a little different for a number of reasons. DotCloud's goal is to provide a bunch of different independent services that you can use as building blocks to build your application. DotCloud was part of the Y Combinator summer class of 2010, and they just recently raised $10 Million. Like all new technologies, I want to play with them, and see if they live up to all of the hype.
Documentation Before I get started with any new service the first thing I usually do is look at the documentation. First Steps: #! # make the script executable. chmod +x postinstall Deployment. Ken Cochrane | Blog | Django Hosting Roundup: (Ep.io vs Gondor.io vs DotCloud vs Heroku vs AppHosted vs DjangoZoom) Who wins? Platform Overview. Building a Mobile Web Application Tech Stack. CS61A, Spring 2012 Online Textbook. Python for makers. Python Meets the Arduino. Python for data lovers: explore it, analyze it, map it. Writing a Pyramid application. Introduction to Django. A Noob Speaks to Noobs: Your First Site in the Cloud. Designing Embedded Systems with Linux and Python. Cross-Compiling Python & C Extensions for Embedded Systems. Patterns for building large Pyramid applications. CRC 16 CCITT in C# - Sanity Free Coding - C#, .NET, PHP.
Building a blog in 30 mins with Django (Screencast) | arunrocks.com. Bottle: Python Web Framework — Bottle 0.11.dev documentation. Pylons Project : Home. C & C++