Every new technology has its own comparisons with its competitors as jQuery is closely compared with Flash. Flash was the technology used by many web designers a while ago, but now it’s the turn of jQuery to add the special effects or interactivity to a website. jQuery makes it easier to create sophisticated custom effects and animations compared to Flash. This article provides some fantastic examples with amazing results, which can be achieved using standard browser and your imagination.

Apple like retina effect

image
BumBum 16 february 2012, 18:03

I just recently have come across a hit parade of the most annoying things for the programmer on the internet.

Here they are:

10. Comments that explain “how” but do not explain “why”


In the university where I was a student studying a course of programming, we were taught to make detailed comments to the code. It’s better to have too many comments than to have too few. Unfortunately, sometimes this advice grows into the paranoia, namely programmer comments every single line of code. For example:

$r = $n / 2; // Set $r to $n divided by 2

// Loop while $r - ($n/$r) is greater than $t
while ( abs( $r - ($n/$r) ) > $t ) {
$r = 0.5 * ( $r + ($n/$r) ); // Set $r to half of $r + ($n/$r)
}
Skull 15 february 2012, 19:47

Let us consider a situation when you need to handle collisions between some objects. What do you do in this case? Probably, the easiest solution would be to check interaction between these objects. This is the right decision, and everything will be fine until you get a lot of objects. As soon as their number gets up to a few thousand, you will notice that everything works much slower. What if you get thousands of the particles? Then everything stops. Here things get much more interesting. What tricks and optimizations would you use to solve this problem?

Let us consider 2D case to make it simple, the particles are round, and the radius of the particles is the same for all of them.

Table of contents

1. Overview of algorithms
1.1. Exhaustive search
1.2. Sweep & Prune
1.3. Regular grid
2. Some optimizations
2.1. Sweep & Prune
2.2. Regular grid
3. Speed comparison
4. Application (software and source code)
5. Conclusion
KlauS 14 february 2012, 16:38

Twitter has changed 3 offices during its short history, and soon it will make its largest moving to a new office. Let us take a look at the origin of its office history.

image

The beginning

Initially, Twitter’s office was located at 164 South Park Avenue in San Francisco:
Tags: office, Twitter
Pirat 10 february 2012, 20:09

Microsoft has made quite a few changes to the Windows user interface with Windows 8. Today, we learn about one more change the company has made to the upcoming operating system.

The Verge cites sources close to Microsoft that say the Start button's functionality isn't completely dead:

"We have confirmed with sources close to Microsoft's Windows 8 development that a hot corner has replaced the Start button orb. A thumbnail-like user interface will appear in Metro or desktop mode, providing a consistent way to access the Windows desktop and Start Screen in Windows 8 regardless of touch or mouse input," writes Tom Warren. "The new interface is activated on hover from the lower-left corner of Windows 8 and includes a thumbnail preview of where you will navigate to after clicking on the new visual element."

So, it's gone, but it still exists in some form, it is moved to Charms bar.
Papay 10 february 2012, 15:22

imageThere is a widespread view that the ordinary PHP developer does not need to control memory management, but "controlling" and "knowing" are slightly different concepts. I will try to throw light upon some aspects of memory management when working with variables and arrays, and some interesting pitfalls of the internal optimization of PHP. As you can see, the optimization is good, but if you do not know exactly how it is optimized, you might meet the pitfalls, which can make you pretty nervous.

Overview


Learning the basics

In PHP a variable consists of two parts: "name" that is stored in hash_table, symbol_table and "value" that is stored in zval container.
This method allows creating multiple variables that are referring to one value, which in some cases allows optimizing the memory usage. How it looks in practice will be written further.

The most common code elements without which it is difficult to imagine a functional script are the following things:
- Creation, assignment and removal of variables (numbers, strings, etc.).
- Creation of arrays and their bypass (as an example will be used the function foreach).
- Passing and return values for functions / methods.
BumBum 9 february 2012, 14:16

Do you know how much memory the string has? I have heard all kinds of answers to this question, ranging from "do not know" to "string has 2 bytes". Here are some more questions: How much space does empty string take? How much space does the class object of Integer take? How much space will take your own class object with three Integer fields? It is funny, but none of my Java programmer friends could answer these questions ... Most of us do not need it, and nobody will think about it in the real java projects. After all, this is the same as you would not know the engine capacity of vehicle that you drive every day. You can be a great driver and did not even know what 2.4 or 1.6 means on your car. But I am sure that there are few people who are not familiar with the meaning of these numbers. So why do java programmers know so little about this part of their tool?

Integer vs int

We all know that in java - everything is an object. Except, perhaps, primitives and references to the objects themselves. Let us consider two typical situations:
ZimerMan 8 february 2012, 14:12

In the Web you can find a lot of solutions to emulate multithreading in php. Most often they are based on the forks, but there are variations about using curl, proc_open and etc.

I did not like the alternatives that I found, so I had to write my own solution.
Here is the following set of requirements:

• Use of the forks
• In-sync state with the interface in the absence of the necessary extensions
• Multiple use of child processes
• A full data exchange between processes. That is, running with the arguments and getting results at the end
• The event exchange between the child process-"thread" and the basic process at work
• Handling the thread pool with the multiple use, transferring arguments and getting results
• Error handling
• Timeouts for the work performance, waiting for work thread, initialization
• Maximum performance

The result is a CThread library.

Here is a link to the sources:
github.com/amal/CThread
xially 7 february 2012, 13:10

In C language, you may use functions without defining them. Pay attention that I speak about C language, not C++. Of course, this ability is very dangerous. Let us have a look at an interesting example of a 64-bit error related to it.
Andrey2008 7 february 2012, 5:47

imageIn today's world three-dimensional technologies have become very popular. 3D comes in the life of ordinary man rapidly and diversely, starting from 3D TVs, 3D scanners and even printers. Although the last two types of devices are available so far only to specialists. However, the technologies are not standing still. There have already become available three-dimensional printers that cost about $ 2,000 dollars. That fact is bringing closer the day when these devices will become available for every student, engineer or designer. Concerning methods to get the 3D model of a real physical object, then here is not everything that clear. It requires an expensive laser scanner, or you can try your luck with a web camera and the special software. Today anyone could have all these things.
However, there is a very simple way to scan the object into the 3D model using a conventional digital camera. How to do all that will be discussed further.
KlauS 5 february 2012, 11:20