background preloader

Speed up coding

Facebook Twitter

11 Syntax Highlighters To Beautify Code Presentation. When sharing codes on a website, even they are wrapped with code tags or styled differently, it is always a challenge to read them without syntax highlighting.

11 Syntax Highlighters To Beautify Code Presentation

There are various syntax highlighters which can format the codes & color them appropriately according to the languages used. Whether it is a HTML page or runs on PHP, Ruby, Python, ASP, there is a suitable syntax highlighter. And, here is a collection of 11 Syntax Highlighters To Beautify Code Presentation: GeSHi (Generic Syntax Highlighter – With PHP) GeSHi is a powerful syntax highlighter script that supports almost every language. It is first created for phpBB forum system but became a project itself. SyntaxHighlighter (With JS) This is a flexible & extensible syntax highlighter built with JavaScript.

SyntaxHighlighter offers ready-to-use themes an new ones can be created easily for a custom presentation. It has support for 3rd party applications like Blogger, WordPress, Joomla & many others. 10 Reasons Why Your Code Won’t Validate (and How to Fix it) - NETTUTS. W3C validation isn't very forgiving at times, but it allows you to see errors that are generated by your markup.

10 Reasons Why Your Code Won’t Validate (and How to Fix it) - NETTUTS

Lots of errors and warnings thrown by the validator are a good indicator that your XHTML isn't in very good shape, and might not look consistent across different browsers. Here are 10 sneaky validation problems that trip developers up, and how to avoid them. Before we get started, here are a few good practices to remember when using the W3C validator. Don't sweat the warnings - If the validator says that you have 12 errors and 83 warnings, just worry about the errors for now.Knock off errors one at a time - Work your way straight down the list, top to bottom, knocking off errors one at a time.

The HTML is read by the browsers from top to bottom, so the errors show the same way. With those basic tips out of the way, let's have a look at some of the reasons why your markup isn't validating. How I Can Code Twice As Fast As You - NETTUTS. We're all familiar with text expander programs; though I would surmise that the percentage of us who use them when coding is quite low.

How I Can Code Twice As Fast As You - NETTUTS

To change things up a bit, today I'm going to you how to create custom text-expander scripts that will save you a great deal of time. If you're unfamiliar with such programs, you must watch this! After reviewing the screencast and tutorial, I'd love to hear how you save time when developing. Okay - so I'm mostly teasing with this article's title. Many, many techniques factor into writing quick and efficient code. Why Use a Text Expander? How many times have you typed the following: Granted, it only takes ten seconds or so, but imagine multiplying that figure by 100. Many IDEs offer a snippets section. How Fast? As an example, I took a 100% blank page and was able to create all of the code below in about ten seconds, without copying and pasting. Improve Your Python: 'yield' and Generators Explained.

Prior to beginning tutoring sessions, I ask new students to fill out a brief self-assessment where they rate their understanding of various Python concepts.

Improve Your Python: 'yield' and Generators Explained

Some topics ("control flow with if/else" or "defining and using functions") are understood by a majority of students before ever beginning tutoring. There are a handful of topics, however, that almost all students report having no knowledge or very limited understanding of. Of these, "generators and the yield keyword" is one of the biggest culprits. I'm guessing this is the case for most novice Python programmers. Many report having difficulty understanding generators and the yield keyword even after making a concerted effort to teach themselves the topic. What is a Python Generator (Textbook Definition) A Python generator is a function which returns a generator iterator (just an object we can iterate over) by calling yield. yield may be called with a value, in which case that value is treated as the "generated" value.

Magic? Round-up. Speeding Up Your Python Code - Max Burstein's Blog. In my opinion the Python community is split into 3 groups.

Speeding Up Your Python Code - Max Burstein's Blog

There's the Python 2.x group, the 3.x group, and the PyPy group. The schism basically boils down to library compatibility issues and speed. This post is going to focus on some general code optimization tricks as well as breaking out into C to for significant performance improvements. I'll also show the run times of the 3 major python groups. My goal isn't to prove one better than the other, just to give you an idea of how these particular examples compare with each other under different circumstances.

Using Generators One commonly overlooked memory optimization is the use of generators. Not only is it slightly faster but you also avoid storing the entire list in memory! Introducing Ctypes For performance critical code Python natively provides us with an API to call C functions. Just by switching to the C random function we cut our run time in half! Introducing Cython sudo pip install cython Compile using: