The Nature of Code 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 ! 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.
STL Containers library Standard Containers A container is a holder object that stores a collection of other objects (its elements). They are implemented as class templates, which allows a great flexibility in the types supported as elements. The container manages the storage space for its elements and provides member functions to access them, either directly or through iterators (reference objects with similar properties to pointers). Containers replicate structures very commonly used in programming: dynamic arrays (vector), queues (queue), stacks (stack), heaps (priority_queue), linked lists (list), trees (set), associative arrays (map)... Many containers have several member functions in common, and share functionalities. stack, queue and priority_queue are implemented as container adaptors. Container class templates Sequence containers: array Array class (class template ) vector Vector (class template ) deque Double ended queue (class template ) forward_list Forward list (class template ) list Container adaptors:
The Python Tutorial — Python v2.7.5 documentation Python is an easy to learn, powerful programming language. It has efficient high-level data structures and a simple but effective approach to object-oriented programming. Python’s elegant syntax and dynamic typing, together with its interpreted nature, make it an ideal language for scripting and rapid application development in many areas on most platforms. The Python interpreter and the extensive standard library are freely available in source or binary form for all major platforms from the Python Web site, and may be freely distributed. The Python interpreter is easily extended with new functions and data types implemented in C or C++ (or other languages callable from C). This tutorial introduces the reader informally to the basic concepts and features of the Python language and system. For a description of standard objects and modules, see The Python Standard Library. The Glossary is also worth going through.
Python performance optimization If you want to optimize the performance of your Python script you need to be able to analyze it. The best source of information I found on the web is the PerformanceTips page on the Python wiki. We are going to describe two types of performance analysis in Python. The first type uses a stopwatch to time the repeated execution of a specific piece of code. This allows you to change or replace the code and see whether or not this improved the performance. Simple stopwatch profiling You can apply basic stopwatch style profiling using the “timeit” module. The output should be something like this: This shows us that the join method is more efficient in this specific case. Advanced profiling using cProfile To identify what takes how much time within an application we first need an application. Running the application with the profiler enabled can be done from the command line, so there is no need to change the code. Visualizing cProfile results It gave us some real nice insights: