Home

Advertisement

Our new office. Tower-2: «Vordenkliff»

  • May. 31st, 2009 at 4:30 PM
It took much longer than expected.
Kovorking Club "Tower" has finally been moved to a new office, located in Yekaterinburg, at ul.Kraulya, 51. Three months later, after we started digging the earth in search of replacement of the old landmark tower, which spent its first year, is in poluetazhah and balconies.

We work for a year. We made many mistakes, tried a lot of good finds, survived the crisis ... and now we are just trying to start from scratch, implementing best that realized during this time.

We present you our new office,% username%:

Tower-2: «Vordenkliff»
 

Tags:

Flag Counter

  • May. 31st, 2009 at 4:29 PM
Very interesting service - anyone who sees this picture, will be marked on it in the counter of his country!
 

Tags:

Decorators function allows you to add additional behavior of the function, without altering it. Signature original decorated and features are identical.


Debouncing

If the literal translation - «removal drebezga». This allows the designer to make the call a few functions for some time in one call, the delay begins to run anew with each new attempt to call. Two options:
The real challenge occurs only if the last attempt with the time, greater than or equal to delay.
The real challenge going on at once, and all other attempts to call are ignored until it will be time, greater than or equal to delay count from the last attempt.
Using

debouncedFn = $. debounce (fn, timeout, [invokeAsap], [context]);
fn - the original function
timeout - a delay
invokeAsap - true / false, default false. The parameter that indicates which of the above options debouncing need to use (default is first)
context - the context of the original function

Example use

For example, you suggest. Send requests to the server on each keyup wasteful and unnecessary. You can decorate handler so that it only worked after a user ceases to press the keys, for example, within 300 milliseconds:
function onKeyUp () (... );

$ ( 'input [name = suggest]'). keyup ($. debounce (onKeyUp, 300));

* This source code was highlighted with Source Code Highlighter.

Or you have one handler for multiple events, and need to get if for some time takes place both events handler only worked on the last events:
$ ( 'input'). bind ( 'keyup blur', $. debounce (process, 300));

* This source code was highlighted with Source Code Highlighter.

Throttling

This decorator allows «retard» function - the function will be executed no more than once during that period, even if it will be called many times during this period. Ie all the intermediate calls will be ignored.

Using

throttledFn = $. throttle (fn, period, [context]);
fn - the original function
period - period
context - the context of the original function
Example use

For example, to resize the window (or, say, on the mousemove) you have triggered a heavy handler. It can be «retard»:
$ (window). resize ($. throttle (doComplexSomputation, 300));
As a result, the function will be executed no more frequently than once every 300 milliseconds.

My realization of these designers in a jQuery-plugin can be downloaded from code.google.

Ps. Inspired by a book by Nicolas Zakasa «Professional Javascript for Web Developers, 2nd Edition», although it it confuses debounce and throttle, calling the first second. At ajaxian also raised this issue.
 

Tags:

Already after one week (June 7) will be held in European Parliament elections. What are the preliminary classifications participation «pirate party» in this election?

Elections to the European Parliament are held every 5 years in all EU countries. From 2009 to 2014. in the European Parliament will be 736 delegates. Sweden will be presented at the European Parliament of 18 delegates, and in order to get into parliament, the party will need to gain a little more than 5 percent of the total number of votes. The figure shows the initial classifications as of May 27. Simple arithmetic calculations we get the number of interest which need to use the party (thus far) to get 2 out of 18 votes - about 10.3%. What, in view of increasing the share of «The Pirate Party» at 0.3% over the previous week, making it the chance to receive the European Parliament in more than one location unlikely. But for the rest of time, of course, all can happen, and we still have to wait for the whole week.
«Pirate Party» is not the first time participating in the elections to the European Parliament, in 2006, she managed to gain only 0.63% of the vote in Sweden. After the events of this year, the number of party members increased to 46 000. The program of the party includes the following items: the free exchange of files between Internet users, reducing the cost of licensing discs, the elimination of patent law, the prohibition of DRM-systems.
 

Tags:

Learning PowerShell talk

  • May. 31st, 2009 at 4:25 PM
In many science fiction movies, people interact with computers using voice commands. For example, a person comes into the room, and there is dark. «Computer, light 50%!» - He said. «There is a light 50%!» - Recalled pleasant female contralto computer and take a canopy, including the soft light. Who would not like this? But if the very idea of such a collaboration was born into the world very long, stranstvuya since the pages of science fiction books and films frames, but now everything has changed: the availability of handy high-tech has made much possible. In the novel by Robert Haynlayna «Luna - a harsh mistress» (1966) supercomputer Mike could speak freely, but he was a huge amount of space and, of course, was not mobile. The hero of my story can not boast of a perfect pronunciation, or the opportunity to engage in dialogue, but for his size he is very capable. Of course, I am talking about the Asus EeePC netbuke 1000.

Not so long ago, I found it a new operating system MS Windows 7 RC and could not see what was suggested in the kit. My greatest interest was the command line and PowerShell environment PowerShell ISE. Somewhere on the Internet, there are a variety of cmdlets for almost any task, including the reproduction of speech. But I wanted to realize through all the normal functions, not to be dependent on established cmdlets. They are the same in the end, it may not be on a particular computer, and copy the profile - business hours. In addition, the recent history of the disappearance of the new assembly, for example, cmdlets Get-Clipboard to the clipboard, alarming about the excessive use of rare cmdlets. And the classes. NET will not denutsya, although access may also not very simple: in this case have to run the console in-sta to be able to work with the clipboard.
Prefix the names of the functions I use one of its nicknames, to be able to quickly get to the auto samopisnye function by entering all three characters: they are anywhere else in the PowerShell commands can not be found.

But here, in fact, the realization:

function astSpeak ([string] $ inputString, [int] $ speed = -2,
  [int] $ engine = 0, [switch] $ file,
  [switch] $ list, [switch] $ buffer,
  [int] $ volume = 85)
(
  # Create the object
  $ oVoice = New-Object-com "SAPI.spvoice"

  # If you want to display a list of votes
  if ($ list)
  (
  Write-Output "set in the voice:"
  $ i = 0
  Foreach ($ Token in $ oVoice.getvoices ())
  (
  Write-Host $ i - $ Token.getdescription ()
  $ i + +
  )
  )
  # If you want to let out
  else
  (
  # Get text from a file, if the switch is set
  if ($ file) ($ toSpeechText = Get-Content $ inputString)
  # Away the text from the clipboard (requires treatment sta)
  elseif ($ buffer) (
  $ null = [reflection.Assembly]:: LoadWithPartialName ( "System.Windows.Forms")
  $ toSpeechText = [Windows.Forms.Clipboard]:: GetText ())
  # Using the received string if the switch is not set
  else ($ toSpeechText = $ inputString)
   
  # Plays
  $ oVoice.rate = $ speed
  $ oVoice.volume = $ volume
  $ oVoice.voice = $ oVoice.getvoices (). item ($ engine)
  $ oVoice.Speak ($ toSpeechText)
  )
)
 

Tags: