The Nature of Code Becoming a Pythonista — Platipy 0.2 documentation This chapter is will provide a very brief review of some important python concepts which will be useful and necessary. The basic concepts will be for those who are unfamiliar with Python, but a good refresher for those who don’t write in Python every day. Intermediate concepts will be great for programmers of all levels to refresh on some Python idioms. The code below will focus on Python 2.5+, since that is the version on most XO laptops. PEP8 and The Zen of Python¶ One of the most important aspects of developing in Python is the Python community. Use 4 spaces per indentation level. The Zen of Python is a list of guiding principles behind the design of Python, and a good list of guiding principles for any project written in python. Control Flow in Python¶ The if statement acts predictably in Python. >>> if <conditional>:... statement... elif <conditional>:... statement... else:... statement >>> for <item> in <sequence>:... statement >>> while <conditional>:... statement Numerics¶ Strings¶ Note
10 Things C++ Developers Learning C# Should Know After taking a lot of time with C# fundamentals, I decided to go down a different road this week and talk about some of the differences in C# that can be troublesome to people who are used to C++ development but are learning C#. My first post on this blog months ago was just a simple piece on how I divorced C++ as my first-love language (here). This is not to say that C++ is not still a valuable language, in fact as far as object-oriented languages go C++ is still king of performance. That said, C++ has a lot of quirks and idiosyncrasies due to its age and backward-compatibility with C that have caused it to take a back seat to C# and Java for business programming where time-to-market and maintainability are more important than having the absolute best performance. C# especially has made huge inroads into the business development market because it offers a lot of the power of C++ without a lot of the danger. 1. This one should be obvious, so I put it right up front. 2. 3. 4. 3: public:
Learn Python - Free Interactive Python Tutorial objgraph 1.7.2 Draws Python object reference graphs with graphviz objgraph is a module that lets you visually explore Python object graphs. You'll need graphviz if you want to draw the pretty graphs. I recommend xdot for interactive use. pip install xdot should suffice; objgraph will automatically look for it in your PATH. Moved to GitHub.Python 3.4 support (LP#1270872).New function: is_proper_module.New shortnames argument for typestats, most_common_types, show_most_common_types, show_growth, show_refs, and show_backrefs.count and by_type accept fully-qualified type names now.Fixes issue 4. Bugfix: setup.py sdist was broken on Python 2.7 (UnicodeDecodeError in tarfile).The filename argument for show_refs and show_backrefs now allows arbitrary image formats, not just PNG. Bugfix: non-ASCII characters in object representations would break graph generation on Python 3.x, in some locales (e.g. with LC_ALL=C). Python 3 support, thanks to Stefano Rivera (fixes LP#687601).Removed weird weakref special-casing.
PythonBooks - Learn Python the easy way ! Online Python Tutor - Learn programming by visualizing code execution teejeejee: Playing with C++0x -- lambdas C++0x has a workload of new features[2]... Today I'm having a look at lambdas. Lambdas are available in g++-4.5, for now only available in experimental. What are lambdas? Closures are a very powerful tool that are being retrofitted in many languages (for instance Java). Enough for theory, let's have a look at this new beast. How do they look like? [](int i) { return i + 1; }; This is the increment lambda. How to read this? Using a lambda To use it add arguments, for instance: [](int i) { return i + 1; }(0); would compute the value 1. Storing a lambda The type of a lambda is automatically deduced. auto inc = [](int i) { return i + 1; }; std::cout << inc(0) << std::endl; Notice that calling a named lambda is not different from calling a function. auto mult = [](int x, double y) -> double { return x * y; }; Capturing environment You can use lambdas to capture outter environment. void f() { int x = 5; [](int w) { return w + x; }(0); } void f() { int x = 5; [=](int w) { return w + x; }(0); } Yes, mutable.
s Python Class - Educational Materials Welcome to Google's Python Class -- this is a free class for people with a little bit of programming experience who want to learn Python. The class includes written materials, lecture videos, and lots of code exercises to practice Python coding. These materials are used within Google to introduce Python to people who have just a little programming experience. The first exercises work on basic Python concepts like strings and lists, building up to the later exercises which are full programs dealing with text files, processes, and http connections. The class is geared for people who have a little bit of programming experience in some language, enough to know what a "variable" or "if statement" is. To get started, the Python sections are linked at the left -- Python Set Up to get Python installed on your machine, Python Introduction for an introduction to the language, and then Python Strings starts the coding material, leading to the first exercise.
A Working Introduction to Crypto with PyCrypto A Working Introduction to Crypto with PyCrypto filed under: cryptography, introduction, and python posted on 2011-06-17 Recently at work I have been using the PyCrypto libraries quite a bit. The documentation is pretty good, but there are a few areas that took me a bit to figure out. Some quick terminology: for those unfamiliar, I introduce the following terms: plaintext: the original messageciphertext: the message after cryptographic transformations are applied to obscure the original message.encrypt: producing ciphertext by applying cryptographic transformations to plaintext.decrypt: producing plaintext by applying cryptographic transformations to ciphertext.cipher: a particular set of cryptographic transformations providing means of both encryption and decryption.hash: a set of cryptographic transformations that take a large input and transform it to a unique (typically fixed-size) output. There are two basic types of ciphers: symmetric and public-key ciphers. What is a salt? Encryption
Hackasaurus Look ahead Learn all about Firefox OS » Welcome to Webmaker! That username is taken You must choose a username Invalid username. You must agree to our terms and conditions. X-Ray Goggles Remix and share web pages instantly Activate X-Ray Goggles See how Goggles work by swapping an image Copy this image URL (highlight the text below, right-click, then copy the link) The URL you just copied links to a new image! Share your remix When you're ready to share your remixed page, click the Publish button or press P on your keyboard. Help If you need help, make sure the X-Ray Goggles are activated, then press H on your keyboard. Remix any webpage! You can take X-Ray Goggles with you anywhere on the web: Make sure your web browser's bookmarks bar is enabled. Now visit any website on the internet.
Code Like a Pythonista: Idiomatic Python In this interactive tutorial, we'll cover many essential Python idioms and techniques in depth, adding immediately useful tools to your belt. There are 3 versions of this presentation: ©2006-2008, licensed under a Creative Commons Attribution/Share-Alike (BY-SA) license. My credentials: I am a resident of Montreal,father of two great kids, husband of one special woman,a full-time Python programmer,author of the Docutils project and reStructuredText,an editor of the Python Enhancement Proposals (or PEPs),an organizer of PyCon 2007, and chair of PyCon 2008,a member of the Python Software Foundation,a Director of the Foundation for the past year, and its Secretary. In the tutorial I presented at PyCon 2006 (called Text & Data Processing), I was surprised at the reaction to some techniques I used that I had thought were common knowledge. Many of you will have seen some of these techniques and idioms before. These are the guiding principles of Python, but are open to interpretation. import this