imageIn the current project appeared necessity to perform a consistent series of ajax queries and something to do with their results at the end.
It is a fairly typical task, when the pattern of its solution usually is called as a waterfall. The implementation of this pattern is node.js, although some people work in the browser - async.
But we do not want to include the entire module for a single method as well as the copy / paste. The callback function is passed to async, everywhere we used the jQuery.Deferred. There is no difference, but we do not want to “break” a design style :)
As a result, there is written a small utility similar to jQuery.when

Unlike to the jQuery.when, the functions and their return should be passed by arguments, and not jqxhr, otherwise sense of waterfall will be lost. Although, it will not cause the error, because the waterfall accepts any argument’s types.
Papay 27 september 2011, 10:00

image
An article is dedicated to the plug-in, which simplifies the existence of client-side for a programmer.

When filling out the form happens that the form needs to be changed, considering the inputted data (hide and show the fields). The simplest example is when we order the delivery of goods, the user has selected an option “pickup”, and then the fields about the delivery address can be hidden, but it would be nice to show the map with directions for “pickup”.

What is next?


Often, such logic remains without realization, but if we care about the users, then it should be done.

The first standard approach is to make a step wizard, where the form is generated for each step on the server’s side. Some people think that this is a bad option, because it requires the dreary work of splitting the process into steps, writing tons of code, and there is no the pleasure working with this form.

The second approach is to write “puttee” JavaScript that implements all the logic on the client’s side. Especially, it is sad to write “cascading” logic, such as “if (a) was entered into a field A, then show B, if (c)was entered into a field B, then show D. If something else was entered into A, then hides B, and then D”.

Both options are not comfortable. First of all, the logic is realized by the imperative style instead of declarative. But there is way out!
Pirat 26 september 2011, 14:16

Part Two


The first part can be found here.

The software part

iPad application


Overpatching of the application took only a week for the iPad. The main time was spent on rework of the user’s interface. Dimensions of screen resolution of the iPad and iPhone are different, so if we have not considered this when designing the interface - we have a problem (especially, if we have numerous screens).
If we lead 1024 without changing the dimensions to 480, then the resulting image will be 480x360, so we get 40 extra pixels vertically. One simple solution is to leave empty space above and below. I do not like this approach. Since I only have had three screens (almost everything is in the vector), I have reworked the source materials for expansion of 1024x768 and has written a utility that moving in 480x320, and cutting (shifting) the specific parts from top, bottom or both sides that I do not need.

I completely rewrote the dialog of posting to Twitter, the old was not designed for the iPad.
Transferring a binary file into universal format took exactly one click. So, select a target “Upgrade this target to ipad”.
I used this code below to find out if the iPad is software-based or not:
BOOL isPad ()
{
# ifdef UI_USER_INTERFACE_IDIOM
return (UI_USER_INTERFACE_IDIOM () == UIUserInterfaceIdiomPad);
# else
return NO;
# endif
}
ZimerMan 25 september 2011, 10:32

Beginning


In October 2008, I have found out at an ordinary meeting with two friends that they are involved in the developing of games for the iPhone. At that time I already had almost completed shareware project for the Windows. I was inspired by the desire to port it for the iPhone, I started working in this direction.

Objectives


Create and adapt the development tools for the Windows platform without the purchasing of Mac device and related the development tools. Mac purchase was postponed until a full understanding of how it works. Almost finished project and tools for it were for the Windows, so I decided to do all for the Windows. I started implementing this idea after I spent a few days searching the internet.

Step one - Setting up the environment and compiler for the Windows, or to be more exact for the Cygwin

Tags: games, iOS, iphone
ZimerMan 25 september 2011, 10:30

The CSS syntax is simple, and in order to understand it is not necessary to have a doctorate degree in the field of IT. However, this is one of the few popular languages, which is not logical. Unlike other web programming languages such as JavaScript and PHP, the problems are not solved by the usual logic in the CSS. Algorithms such as “if X, then do Y, otherwise do Z” or “select all Y, then make with them X” cannot be implemented in a language like the CSS. This language created for the mounting, a language for designers, rather than developers. Some of the most experienced programmers spent a lot of effort in order to learn the CSS.

Learning of CSS begins with the classes and ID, as well as the use of. and # for the direct indication of elements. This is enough to build the fully functional website, but it is not enough flexible solution in the case of a complete change of design. Let us take a look on an alternative approach to control such elements that hard to reach.

Adjacent sibling combinator


Let us start with the selector, which is handy in the difficult situations. The adjacent sibling combinator is indicated by a combination of two elements with a symbol +:

h1 + p
Tags: Css, html
Killer 23 september 2011, 15:49

Unlike most assemblers, the result of multiplication has the same number of digits as the multipliers in C / C + +. In order not to lose the accuracy, sometimes it is needed to perform additional operations for the multiplication.
Let us consider the task. The system determines the time since starting the program in the microprocessor’s ticks by calling the function:

unsigned long long getTickCount ();
Length unsigned long long - 64 bits. Converting to the physical units of time in the system, there is a constant:

const unsigned long long TICKS_PER_SECOND = 1999000000ULL;
It is required to determine the function of transferring ticks in a nanoseconds getNsec (unsigned long long ticks) with semantics:

unsigned long long getNsecNaive (unsigned long long ticks) {
static const unsigned long long NSEC_PER_SECOND = 1000000000ULL;
unsigned long long nsec = NSEC_PER_SECOND * ticks / TICKS_PER_SECOND;
return nsec;
}
Pirat 22 september 2011, 11:17

image

What is MapReduce?

This is an approach, algorithm or pattern of the parallel processing of large volumes of unprocessed data, for example, the results of crawlers or the logs of web queries. According to statistics 80% tasks could be mapped on is mapped on MapReduce, it just drives NoSQL. There are different implementations of MapReduce. Well known and patented implementation of this algorithm and the approach of Google, for example: MySpace Qizmt - MySpace's Open Source Mapreduce Framework, is also used in Hadoop, MongoDb and there are many different examples that we can give. More details can be found in the article MapReduce: Simplified Data Processing on Large Clusters

The algorithm receives at the input 3 arguments: the source collection, Map function, and Reduce function, and it returns a new collection of data.

Collection MapReduce (Collection source, Function map, Function reduce)

The algorithm is composed by few steps; the first one consists to execute the Map function to each item within the source collection. The Map will return zero or may instances of Key/Value objects
Tags: .net, mapreduce
ZimerMan 20 september 2011, 10:08

imageHow the battery goes dead: we all have seen how this happens in the phones, laptops, cameras, and the electric vehicles. It is painful process - if you are lucky – it could be slow. Over the years, the lithium-ion battery, which once powered your devices for the several hours (even days!), gradually loses its ability to hold the charge. After all we accept it, maybe curse Steve Jobs, and then we buy a new battery or a new gadget.

But why is this happening? What happens in a battery that causes it to go dead? The short answer lies in the fact that due to the damage from continuous effect of high temperatures and a large number of charging and discharging cycles, it eventually begins to break down the process of moving ions between the electrodes of lithium.

A more detailed answer, which lead us through the description of unwanted chemical reactions, corrosion, or a threat of high temperatures and other factors affecting the performance, It begins from an explanation, what is happening in the lithium-ion batteries, when everything works well.
Pirat 18 september 2011, 18:06

Today was an imported day for the team of Windows. At the conference BUILD was introduced a new operating system of Windows 8. Broadcasting of the event was at http://buildwindows.com (the recording is available at this site).

image

Here is a topic of this week for the developers. This week will be examined the new tools for creating the applications and API. At the conference BUILD was shown that the new version of Windows is suitable for a variety of devices: tablet PCs, laptops and desktop computers. The new tools were demonstrated that allow creating own applications in Metro style using HTML + Javascript, C / C + + and / or C # / XAML. You can use any of those languages of programming; it will always work with the OS. Windows 8 will be convenient for both the users and developers.
Papay 16 september 2011, 12:46

Every day new standards of CSS3 and HTML5 enter more deeply into the life of web designers and web developers, and the browsers are becoming more compatible with these standards.

image

In connection with this event we would like to present you a selection of 10 buttons of CSS3 that will make your life easier during the layout and creation of the web applications.
Tags: button, CSS3, html5
Siera 15 september 2011, 12:02