background preloader

Practice programming with our programming & game challenges

Practice programming with our programming & game challenges

JSbooks - free javascript books Python Regular Expressions - Educational Materials Regular expressions are a powerful language for matching text patterns. This page gives a basic introduction to regular expressions themselves sufficient for our Python exercises and shows how regular expressions work in Python. The Python "re" module provides regular expression support. In Python a regular expression search is typically written as: match = re.search(pat, str) The re.search() method takes a regular expression pattern and a string and searches for that pattern within the string. str = 'an example word:cat!!' The code match = re.search(pat, str) stores the search result in a variable named "match". The 'r' at the start of the pattern string designates a python "raw" string which passes through backslashes without change which is very handy for regular expressions (Java needs this feature badly!). Basic Patterns The power of regular expressions is that they can specify patterns, not just fixed characters. a, X, 9, < -- ordinary characters just match themselves exactly. findall

11 Great JavaScript Interview Questions and Answers The values will be logged in the following order: Let’s first explain the parts of this that are presumably more obvious: 1 and 4 are displayed first since they are logged by simple calls to console.log() without any delay 2 is displayed after 3 because 2 is being logged after a delay of 1000 msecs (i.e., 1 second) whereas 3 is being logged after a delay of 0 msecs. OK, fine. The answer has to do with properly understanding JavaScript events and timing. The browser has an event loop which checks the event queue and processes pending events. Similarly, setTimeout() also puts execution of its referenced function into the event queue if the browser is busy. When a value of zero is passed as the second argument to setTimeout(), it attempts to execute the specified function “as soon as possible”.

Become a Professional JavaScript Developer with Tuts+ Courses A long time ago, in a galaxy far, far away, JavaScript was a hated language. In fact, “hated” is an understatement; JavaScript was a despised language. As a result, developers generally treated it as such, only tipping their toes into the JavaScript waters when they needed to sprinkle a bit of flair into their applications. Despite the fact that there is a whole lot of good in the JavaScript language, due to widespread ignorance, few took the time to properly learn it. Ironically, it turns out that much of what the development community hated had very little to do with the JavaScript language itself. Luckily, the community has matured immensely since those days. The Basics As a first step into these waters, an understanding of the fundamentals will prove essential. JavaScript FundamentalsWithout a doubt, JavaScript is the most popular programming language in the world. Advanced JS FundamentalsThis follow-up course will focus on DOM scripting and events. The Wonder of jQuery Tools

Related: