background preloader

Packrat

Facebook Twitter

Practical threaded programming with Python. Introduction The Global Interpretor Lock refers to the fact that the Python interpreter is not thread safe.

Practical threaded programming with Python

There is a global lock that the current thread holds to safely access Python objects. Because only one thread can aquire Python Objects/C API, the interpreter regularly releases and reacquires the lock every 100 bytecode of instructions. The frequency at which the interpreter checks for thread switching is controlled by the sys.setcheckinterval() function. In addition, the lock is released and reacquired around potentially blocking I/O operations. It is important to note that, because of the GIL, the CPU-bound applications won’t be helped by threads.

With Python, there is no shortage of options for concurrency, the standard library includes support for threading, processes, and asynchronous I/O. It is important to first define the differences between processes and threads. 10 Ways to Make Python Go Faster « Get off the Table. Home > Python > 10 Ways to Make Python Go Faster On the “Sphere Online Judge” competition site, there are hundreds of programming challenges which you can attempt to solve in any of 40+ different programming languages.

10 Ways to Make Python Go Faster « Get off the Table

You simply submit your code, and the online judge will execute the code in a controlled environment. If you’re program generates the correct output (answers the set problem) within a specified time limit, you get some points on the scoreboard. Here’s the catch: The time limit is the same no matter what language you are using. This obviously puts interpreted languages like Python at a disadvantage, and often you need to squeeze every last ounce of speed from you algorithm. Can someone with a mac help me with the equivalent of this Linux code? : Python. SQLite3, Full Text Search with FTS3, and iOS 4.0. Fulltext search in SQLite and Django app. Since version about 3.5.9 SQLite contains full-text search module called FTS3 (older releases may have FTS1, FTS2).

Fulltext search in SQLite and Django app

Using this module we can easily add fast full text search to a Django application (or any other using SQLite). Lucene - Building PyLucene PyLucene is completely code-generated by JCC whose sources are included with the PyLucene sources.

Lucene -

Requirements To build PyLucene a Java Development Kit (JDK) and Ant are required; use of the resulting PyLucene binaries requires only a Java Runtime Environment (JRE). Apache Lucene - Indexing a Database and Searching the Content. Here is a Java code sample of using Apache Lucene to create the index from a database.

Apache Lucene - Indexing a Database and Searching the Content

(I am using Lucene version 2.3.2 and MySQL) I assumed that there is a table named pet in the "test" database with the fields "id" "name" and "color". After running this a folder named index is created in the working directory including indexed content. The following code (lucene searcher) shows how to search a record containing a particular keyword using the created lucene index. Searcher searcher = new IndexSearcher(IndexReader.open("index")); Query query = new QueryParser("color",analyzer).parse("white"); Hits hits = searcher.search(query); String sql = "select * from pet where id = ? " Searcher searcher = new IndexSearcher(IndexReader.open("index")); Query query = new QueryParser("color",analyzer).parse("white"); Hits hits = searcher.search(query); String sql = "select * from pet where id = ?

" Espinozaulises/jquery-history-plugin. Edgarjs/instachrome. Yikulju/Hello-History. Core concepts - Dropbox. How To View a Google Chrome Extension’s Full Source Code - Oren Yomtov's Website. Home » Blog » How To View a Google Chrome Extension’s Full Source Code You can extract and view any Google Chrome extension’s full source code following the following easy steps.

How To View a Google Chrome Extension’s Full Source Code - Oren Yomtov's Website

Every Google Chrome extension is basically a CRX file. When you click the “Install” button on the Google Chrome extension gallery you are basically clicking a link of the extension’s CRX file. The first step is downloading the extension’s CRX file. Instead of clicking it’s link, which will lead to that extension being installed on your browser, right-click the link and choose “Save link as…”. Extensions developer workflow. By Andreas Bovens From Opera 15 onward, Opera 11 & 12’s extension format is no longer supported, and instead, we’ve switched to Chromium’s extension model.

extensions developer workflow

Check out our new documentation for developing extensions for Opera 15 and higher and start building your own extensions. Contents Introduction In this short article, we’ll look at the developer workflow to create extensions, give some tips for extension development, and point out a couple of caveats. For this guide, we start with the Hello World example introduced in Saying hello world to Opera extensions! If you have gone through all steps except packaging, you should have something similar to the folder structure in Figure 1. Developer mode. Chronzz/MobileSafariPlugin. How to create a browser plug in. How to Write a Chrome Extension in Three Easy Steps. I just installed a “hello world” Chrome extension from this Chrome Extension tutorial page.

How to Write a Chrome Extension in Three Easy Steps

When you surf to www.google.com, the Google logo is replaced with a Lolcat: Here’s how to write your own Google Chrome extension in three steps: 1. Install the developer-channel version of Google Chrome. I don’t know if this is 100% necessary, but new support for plugins will probably show up in the developer version first. 2. I like several things about the extension framework: - Your plugin has to have a unique identifier (40 digit hexadecimal number). The Chrome extension manifest, which has metadata about your extension such as name, version, etc., looks much simpler to me than how Firefox wants extensions to be packaged. 3. Once you see how it works, just start hacking around and see what happens. One more nice thing: it looks like installing extensions doesn’t require you to restart the browser. Event listeners on plugin in document.onload events in opera. JavaScript Tip of the Week for October 7, 1996: History Tracker. For October 7, 1996: History Tracker Maybe its just me but I don't like the way Netscape keeps track of the history of pages you visited, so I created an alternative for JavaScript Tip of the Week.

JavaScript Tip of the Week for October 7, 1996: History Tracker

It's logically named the History Tracker, and it will track every page on your web site. It doesn't track any pages that do not exist on your server for security reasons. It not only records the URL and title of a page, but it also allows you to replay your browsing activites in chronological order. Mileswu/about-me-opera. Dodecagon/chrome-history. Nakah/Firefox-Chrome-History-Search. Jbrennan/Safari-History-Merger. About-me-opera/aboutme.rb at master · mileswu/about-me-opera. How to access Google Chrome browser history programmatically on local machine. Getting Started with HTML5 Local Databases « Dark Crimson Blog. Please note: This article was written in May 2010 and as of November 18, 2010, the Web Applications Working Group has reached an impasse and does not intend to maintain the Web SQL Database any longer.

Getting Started with HTML5 Local Databases « Dark Crimson Blog

Read more here. Starting with Safari 4, iOS OS3, Chrome 5, and Opera 10.5 (Desktop), HTML5 Local Databases (AKA Web SQL Databases) are now supported. I’ve been reading about local databases for quite some time and decided to do a write up with some basic examples on how to get started. Setting up the Database First we check if the browser supports the openDatabase method, is so we continue and define the database parameters: shortName is the DB name as it will be referred to by the browser and SQLversion openDatabase version. 1.0 for this (more on that here) displayName The full display name / description of the databasemaxSize This is max size in bytes is the size you expect the database to reach.