Python and Memcache Example

When I try to write some code in Python to access memcache service, I create a text file 'memcache.py'. This causes problems.

Only occurred in python script files, no problem with python shell. One of the reason may be the script file name is 'memcache.py'. Python will first try to load the module in the current directory,with that name, its importing itself. So the python script file name should be different from any module that imported in the script file.

Only occurred in python script files, no problem with python shell. One of the reason may be the script file name is 'memcache.py'. Python will first try to load the module in the current directory,with .

Java String Pool

Hi, Please confirm.. I face this question a lot in my interviews.

How many object of string objects are created.

Crawl Google search results and open link in Chrome window with Python script

This script will record the search keywords and visited url into MySQL database .These data may be useful, its of interest to look back what you have been searched in Google.

The script also demonstrate how to access MySQL Server and crawl web pages with python.

PHP shell script example: How to open file effectively

How people usually open a file? First they have to locate it then double click it to launch the associated program or type file name in the terminal as parameter to the command.

What if the file you are handling reside in a very deep and complex directory tree.The file name can be very long. For example, the source code tree of large project. Below is part of jdk source code tree:

What if the file you are handling reside in a very deep and complex directory tree.The file name can be very long. For example, the source .

Python encode decode guide

For many Python beginners , the encode decode and unicode stuff is always very annoying. This guide aims to make things clear.

If you know a little about Java, you should know that internally JVM represent all strings as unicode, any raw data like text file on disk or data comes from network called byte stream. Python is similar. The difference is bytestring and unicode both are string in Python and in Java only unicode can be String.

If you know a little about Java, you should know that internally JVM represent all strings as unicode, any raw data like text file on disk or data comes from network called byte stream. Python is similar. The difference .

Introduction to hash function

Consider this situation: there is an array of objects, each object has a unique identifier, also called key. The most common way to access the array is to find the object which's key equals the given key.

If the objects are randomly stored in the array, you have to scan the whole array and compare each object's key to the given parameter. If the array is sorted by the key, you can use binary search to located the object, it takes O(lgN) time.

If the objects are randomly stored in the array, you have to scan the whole array and compare each object's key to the .

What is jQuery fn

fn is the alias to the prototype property.

Its a shortcut for your to access the prototype of jQuery.Look at the jQuery source code:

glDrawBuffer

void glDrawBuffer(GLenum mode);

Specify, Select which color buffers are to be drawn into.

What is Write-Combined memory

Write-Combining can batches writes to the same cache line so they can be transferred in a single bus clock.

The data will be combined and stored in the write combine buffer, and then write is in burst mode.

Vertex array and indexes and Vertex Buffer Object(VBO)

The most obvious reason is that if an entity consist of many polygons , the adjacent polygons will share a lot of vertexes , if every polygons has it own vertexes, there will be a lot of redundant data.

The second reason is that dealing with every individual vertex separately are wasteful. Vertex arrays allows you to send vertex data in sets instead of individually.This can improve the performance. OpenGL can process an array of vertexes with just one function call.

The second reason is that dealing with every individual vertex separately are wasteful. Vertex arrays allows you to send vertex data in sets .

Previous Page 1 ... 61 62 63 64 Next Page