How I Got to the App Store Top With a Simple Currency App
Written by Valentin Shamardin
I will tell you how I’ve created quite an ordinary and not at all innovative application that has become objectively the best of its kind and even has been at the very top of the top for some time. It’s not a success story and not a guide for action. I just want to tell you how I developed the...
Clojure. Transducers, Reducers and Other Stuff
Written by Andrei Zhlobich
Transducers have become quite popular recently. It’s a new feature of the non-released Clojure 1.7. As of writing this, Сlojure 1.7-alpha5 version is the latest development release, but there also appeared a fair number of ports of transducers for such languages as Python , Ruby , JavaScript , PHP , Java , C++ , Lua , Erlang . To tell the truth, it’s a bit disconcerting, the library of reducers was added long ago (in Clojure 1.5). But no one said anything about them; nothing was ported, though they seem to be performing similar things. Or not? Let’s find out what these reducers & transducers are made for (do we really need them?), how they work and how we can use them… Finally, we will decide whether it’s time to throw reducers away. It would be wrong to describe concepts emerged in Clojure outside the context of the givenWhy Pay-per-Word Just Doesn’t Work for Tech Blogging
Written by Rockin'Robin
Tech blogging is on the rise though most of startups see it as a secondary thing. They’re totally right but there’s one condition to it — it requires skill as well as time. A lot of companies are comfortable with solving this problem by outsourcing content creation and hiring agencies or...
The Nth Fibonacci Number in O(log N)
Written by Ivan Yurchenko
Reading an article about getting a job in ABBYY, I came across the following task: Find the Nth Fibonacci Number in O(N) time of arithmetic operations. Thinking about it, I realized that the only solutions coming to my mind were those operating in O(n) time. But I found a better solution later. I am going to use the following denotation of sets: - non-negative integers — positive integers According to various mathematic traditions, a set of natural numbers can either contain 0 or not. Therefore, it’s preferred to indicate it explicitly in international mathematic texts. The Solution Donald E. Knuth provides a matrix identity of the following form: The identity is provided without any proof, but it’s quite easy to prove it by induction. The matrix on the right is called Q-matrix. Let’s indicate: According to the identity, . Thus, to calculate , we should calculate matrix and take the firstRadix Trees
Written by Nikolai Ershov
Having read some articles about tries (aka prefix trees aka radix trees), I decided to write one of my own. Today we are going to talk about a trie implementation in C++. We will also compare a string search with AVL and Radix tree. Intro A trie is an ordered tree data structure that is used to store a dynamic set or associative array where the keys are usually strings. We are going to take a look at the implementation of prefix trees for storing ASCII strings. Each string ends with a terminal symbol that will never repeat in a string again. To indicate terminal symbols in pictures and examples, we will use the dollar sign. To indicate them in the code, we’re going to use the null symbol. Thus, in our implementation the strings will be standard C ones, which allows to use the standard string.h library. All the mentioned above shouldTransactional Memory: History and Development
Written by JIghtuse
Definition Parallel programming is difficult. When using systems with common memory, you can’t go without synchronization of parallel processes/threads access to the common resource (memory). The following are used for it: locks (mutex); lock-free algorithms (lockless); transactional memory. Transactional memory is a technology of concurrent threads synchronization. It simplifies the parallel programming by extracting instruction groups to atomic transactions. Concurrent threads operate paralleled till they start to modify the same memory chunk. For example, operations of nodes adding to the red/black tree (animation in the heading) can operate in parallel in several threads. /* Move item from one list to another */ int move(list *from, list *to) { __transaction_atomic { node *n = pop(from); push(to, n); } } Concurrency management approach with transactional memory use is called optimistic: we think that threads operate independently of one another and rarely change the same data. In this case most transactions areJulia Set
Written by Pavel Nesterov
I always wanted to learn more about complex numbers. Not just the fact that the root of -1 was equal to i . I was particularly interested in figures with fractal structure. I wanted to understand what this meant and how to make such visualization. Having some time from work, I found a book on the theory of functions of a complex variable on the shelf and decided that it was time to start. Iterated Function Before writing an algorithm, we’ll have to learn a few basic notions. We’ll start with the concept of the iteration of function f . Let’s introduce the following notion of the n -th iteration of function f : in which ○ is a function composition . We’ll take the following identity map as the zero iteration: There are plenty of fixed-point theorems of certain types of maps. Let’s recall what a fixed point1,000,000 Views of Your Company's Blog: 5 Tips
Written by Alexander Lashkov
Each and every day thousands of co’s around the world setup their corporate blogs but most of them fail to deliver useful and interesting content. Those who succeed usually tell real life stories instead of posting same old press releases and advertising their products. Hustling for attention is hard and doing it for your company’s blog seems even harder but there’s a simple set of tips to be used in case you don’t want to waste time and resources on fruitless blogging. Look around: content is everywhere One of the most frequent excuses for not blogging we hear from tech co’s is “we don’t have anything significant to blog about”. Half of the startups we meet tend to believe that their potential audience is not interested in posts about anything less than graduating from YC. It’s sort of true as you should not really pose yourself as a topSomething About Cats, Dogs, Machine and Deep Learning
Written by Artem Hurshudov
Deep Blue beat Kasparov at chess in 1997. Watson beat the brightest trivia minds at Jeopardy in 2011. Can you tell Fido from Mittens in 2013? The picture and quote are taken from the challenge at Kaggle (contest to benchmark the latest computer vision and deep learning approaches) that took place last year in Autumn. Looking ahead, we can fairly enough reply “Yes” to the question. The ten leaders coped with the task by 98.8%, which can not but impress. But where does such question come from? Why have classification tasks been (and still are) beyond programs’ capacity, though a four year old child can cope with them? Why is it more difficult to identify objects of the world than to play chess? What is deep learning and why are cats mentioned so often in related posts? Let’s talk about it. What Does “Detect” Mean? Suppose there are twoCellular Automata Using Comonads
Written by Curly Brace
I have recently come across an article about implementing a one-dimensional cellular automaton using comonads. But this material is a bit outdated. Therefore, I’ve decided to write an article of my own and consider two-dimensional cellular automata by the example of The Game of Life: Universe Let’s take a look at Universe data type that is defined the following way: data Universe a = Universe [a] a [a] It’s a doubly infinite list focusing on some element that we can shift using the following functions: left, right :: Universe a -> Universe a left (Universe (a:as) x bs) = Universe as a (x:bs) right (Universe as x (b:bs)) = Universe (x:as) b bs It’s basically a zipper , but we can consider it as a constant C-pointer to the infinite memory area as all increment and decrement operations are applicable to it. But how do we dereference it? Let’sProcesses Paralleling to Speed up Computing and Tasks Execution in Linux
Written by XakepRU
Almost all PCs, released during the last few years, have had at least a dual core processor. So reader, if your PC isn’t extremely old or the bottom of the barrel budget brand, then most likely you are the owner of a multiple-processor system. Also if you like to play games, you should know you are utilizing potentially hundreds of GPU cores. But during the lion’s share of time all of these cores just gather dust. Let’s try to fix that. Introduction We rarely involve all the power of several processors (or cores) in order to solve every day problems. The high-end graphic engines are used for computer games only. I don’t like that. If I am working, why should my processors be resting? We should take on board all facilities and beauties of multi processors (multi cores) and parallelize everything possible. We should also use a heavy-duty video cardsLock-free Data Structures. 1 — Introduction
Written by khizmax
I hope that this article will give a good start for a series of notes about lock-free data structures. I would like to share my experience with community, monitoring and thoughts about what lock-free structures are, how to implement them and whether the concepts of Standard Template Library...
Exact Maximum Clique for Large or Massive Real Graphs
Written by biicode
The excellent performance reported by BBMCSP—an exact maximum clique algorithm tailored for massive real networks— in a previous post has raised a number of comments, some even questioning either the report itself or the problem’s complexity. This post gives an insight on how BBMCSP works. In the process, and similar to what happens when magicians explain their tricks, we are aware that some of the magic will be lost. BBMCSP’s overarching ideas are described in the pseudocode below: BBMCSP: an exact maximum clique algorithm Input: A simple graph G(V, E) Output: A maximum clique in G in Smax Compute k-core decomposition of G: K(G) Compute an initial clique greedily: Smax Remove vertices from G such that K(v)Lock-Free Data Structures. Yet Another Treatise
Written by Max Khiszinsky
As you might have guessed, this article focuses on lock-free queues. Queues can be different. They can differ in the number of producers and consumers (single/multi producer — single/multi consumer, 4 variants). They can be bounded, on the basis of a pre-allocated buffer, and unbounded, on the basis of a list. They can either support priorities, or not. They can be lock-free, wait-free or lock-based, with the strict (fair) and not strict (unfair) conformance to FIFO, etc. These types of queues are described in detail in the article by Dmitry Vyukov . As a rule, the more specialized requirements to a queue are, the more efficient its algorithm is. In this article, we will consider the most common version of queues – multi-producer/multi-consumer unbounded concurrent queues without the support of priorities. I guess the queue is the favorite data structure for researchers. On the one hand, it’s really simple;How I built my first Android Game and realized creativity is all about iterations
Written by Afsar Ahmad
Last week, on 27th February 2015, I released my first android game Rocket Romeo. As I started to spread the message to my friends, the game built traction. The graphics, mechanics and experience of the game has been greatly appreciated so far. In the midst of appreciation, I found that most of the people recognized my attempt to be creative. I have been wondering what creativity really is because for the past 45 days all I have done is tried to build a game which is loved by masses. The process was full of experimentation and iterations. To elucidate my iteration cycle, I am sharing the story of building Rocket Romeo. Here’s how the game now looks. Like I have said, I have been appreciated to be really creative while building this game. But on the other hand in my opinion — I was not creative, but iterative. Why I startedUSB Killer
Written by Dark Purple
It was a usual gloomy winter morning. My colleagues and I were drinking our morning coffee, sharing the news and there were no signs of trouble. But then a friend told about… (a quote from a chat in Skype): I read an article about how a dude in the subway fished out a USB flash drive from the outer pocket of some guy’s bag. The USB drive had “128” written on it. He came home, inserted it into his laptop and burnt half of it down. He wrote “129” on the USB drive and now has it in the outer pocket of his bag… A Picture to Attract Attention: Since I work in the company engaged in the development and manufacture of electronics, my colleagues and I are began to discuss options for creating a USB flash drive, that «would burn half a laptop down.» We had plenty ofOil Series in R
Written by kxx
“Charts are great for predicting the past.” -Peter Lynch I have not dealt with time series in practice, but I definitely read about them (mostly at school) and had some idea about the way the analysis is carried out. But it is well known that what told in textbooks on statistics and machine learning does not always reflect the real situation. I guess a lot of people follow the pirouettes made by the curve of oil prices . The chart looks either chaotic, or too regular, so making any predictions on it is quite a thankless job. Of course, we can unleash the full power of statistical, economic and mathematical, and expert methods on time series, but let’s try to deal with the technical analysis – of course, on the basis of R. When working with regular time series, we can use a standard approach: Visual analysis Decompose theWhy Most IT Companies Do Not Need Marketing Teams
Written by Dmitry Kabanov
The word for 2015 is hustle . Companies cutting costs and workforce are forced to look for real indie talent in order to outsource marketing and content creation. Startups have no time for anything but core product and they are about to recognise freelancers and niche agencies as well. Efficiency problem Major tech companies have their own marketing teams, startups tend to hire growth hackers and move towards spending most of their time working on core products. Both are still viable ways of doing marketing but there's a couple of moves that can minimize your co's burn rate. Whether it's a small to mid-sized tech company or a startup, this is going to work for you. Marketing teams: forget about efficiency here. Low output, high burn rate, poor content quality and tons of press releases – no need to explain the rest. Reason to this : dev folks, designersBayes’ Theorem, Predictions and Confidence Intervals
Written by HKey
There are plenty of articles on this subject, but they do not review real-life problems. I am going to try to fix this. We use Bayes’ Theorem (a.k.a. Bayes’ law or Bayes’ rule) to filter spam in recommendation services and for ratings system. A great number of algorithms of fuzzy searches would be impossible without it. Besides, the theorem is the cause of holy wars between mathematicians. Introduction Let’s start from the very beginning. If one event occurrence either increases, or decreases the probability of other event occurrence, such events are called dependent. Probability theory does not study cause-and-effect relations. Therefore, dependent events are not necessarily effects of each other, the relation is not always obvious. For example, “ a person has blue eyes ” and “ a person knows Arabic ” are dependent events, as Arabian people rarely have blue eyes. Let’s introduce the following notions: P(A) isComparing Rust and C++
Written by Dzmitry Malyshau
All the C++ and Rust examples in the article are not real. So use your imagination to estimate the scope of threat. C++ programs have been compiled with gcc-4.7.2 in C++11 mode, using online compiler . Programs in Rust have been built with Rust 0.11, using the rust play app. I know that there are a lot of changes in C++14 as well as in latest Rust release. But I would still be glad to read your feedback. You’re also welcome to share any information about D. Template Types C++ author has not been happy as for templates implementation in the language. He called them «compile-time duck typing» in one of his Lang-NEXT talks. The thing is that it’s not always clear, what we should use to instantiate a template looking at its declaration. The situation is worsened by monster-like error messages. Let’s try to build the following program: #includeMeet Kukuruku Hub v2.0
Written by Kukuruku Hub
We are happy to announce a new, redesigned version of Kukuruku Hub! First of all, we would like to say «Thank you!» to the whole team, who worked really hard to get this project off the ground. We have redesigned most of the web site and hope the UI/UX is more smooth and sleek now. Please let us know what you think and how we can improve. Really! Your opinion is super important. There is a comments section below the article. Otherwise, simply shoot us an email at [email protected] . In addition to redesign, we rolled out a new Companies feature. As you may or may not know, Kukuruku is based on hubs. A hub is a type of weblog in which posts are written and published by more than one author. Every hub is dedicated to a specific topic. It helps us to keep the information categorized andAre Time Travels Possible?
Written by forgotten
Being a fan of scientism , I am going to tell you about the nature of time, causality and time travels. Time According to classical mechanics, time is absolute and invariable in the sense that when moving from one reference system to another one, time frames do not change: (x, y, z, t) are coordinates in the old frame, while (x', y', z', t') are coordinates in the new one. It is expected that one system moves in-parallel along x axis at v speed. (adsbygoogle = window.adsbygoogle || []).push({}); It’s the so-called Galilean transformation , which is what happens to coordinates when reference systems are changed. In the Galilean sense, there’s just one “time flow” in the Universe and time coordinates are the same for all objects. At that, classical mechanics does not treat the time arrow originality in any way. Moreover, the concept of the flow of timeAVL Trees
Written by Nikolai Ershov
In the previous article we’ve reviewed Randomized Binary Search Trees . Today we are going to review the implementation of AVL Trees . They must be the first type of Balanced Binary Search Trees. They were invented by two Soviet inventors, G. M. Adelson-Velskii and E. M. Landis in 1962. There are plenty of AVL trees implementations, but, to my mind, none of them is good enough when you try to make sense of it all from scratch. They say that AVL trees are simpler than Red-Black trees , but when looking at the code, we can not believe it. Thus, I have decided to explain the structure of AVL trees step by step. I’ll also provide the code in C++. AVL Tree Notion First of all, an AVL Tree is a Binary Search Tree (BST), the keys of which meet standard requirements: a key of any tree nodeHaskell. Testing a Multithread Application
Written by Ankuzik
I guess it’s no secret for anyone that multithread applications writing is connected with many problems you wouldn’t face when developing single-thread programs. One of the problems lies in an application testing. We can’t control the order in which operations are performed. Therefore, we...
N2O: Erlang Web Framework
Written by mag2000
Introduction This post implies a good intro into N2O . In order to learn about Erlang/OTP Web Framework N2O main features you should visit the github page or the official SynRC website . You will find there all the charts and presentations which you like so much. In this article I will cover the principles of framework operation. Version under consideration: N2O: 1.1.0. It’s always more interesting to see the result than to talk about it. I suggest that you install N2O to your PC first and then you will go deeply into its insides. It’s clearer that way. You can find answers to the arisen questions and recommendations at the official channel IRC #n2o at FreeNode.net. Installation Install Erlang if hasn’t been done yet. Download N2O, compile and run it. git clone git://github.com/5HT/n2o.git cd n2o/samples make && make console Look at: 127.0.0.1:8000/ Having opened a few windows youBuilding a website with C++ (CppCMS). Part 1.
Written by Drus_K
Dear %username% , I would like to share with you my first-hand experience in creating a Website on CppCMS (library-template engine on C++). It can also be named as “help for beginners on CppCMS”. Why Would You Write a Website with C++ There are different pros and cons...
Benchmarks: 14 Sorting Algorithms and PHP Arrays
Written by ahwoobachairiesaas
In this article I will tell you about the benchmark of sorting algorithms, written on PHP. There are 14 algorithms presented: quickSort countingSort combSort heapSort mergeSort shellSort selectionSort insertSort gnomeSort combinedBubbleSort cocktailSort bubbleSort oddEvenSort bubbleSortWithFlag Algorithms are not alphabetically ordered, but in order of their performance speed descending when sorting an array of 8 thousand elements. The following arrays dimensions, used for sorting, are presented: 1 100 200 400 600 800 1000 5000 10000 15000 20000 25000 30000 Each measurement was performed with different array filling, which is passed to sorting function. In the first case the array has been filled by random values with a (1, n) interval, in which n — is an array dimension. In the second case the array has been filled by random values with a (1, PHP_INT_MAX) interval, in which PHP_INT_MAX — is maximum variable value of INT type in the current system. InThe Sunset of C and C++
Written by biicode
Because not only CPU cycles count, but also developers’ time There are approximately 4 million C and C++ programmers in the world, probably the largest community, with about 20% of the market, which is comparable or even larger than Java (both C and C++ together). They are also by far the oldest languages of the current mainstream ones, used in key industries and even increasingly due to synergies with other fields as the IoT/embedded systems or robotics, in which these languages are important. C++ is a great language, and it is improving faster than ever with the recent 11 and 14 standards, and 17 is very promising too. It is amazing how the syntax is becoming closer and closer to other more “modern” languages as python. And C is the solid foundation of most current IT technology. State of the art compilers, optimizers, debuggers and IDEs for C andTor: Illegal Weapons
Written by uuii
A few years ago, when I was reading some popular weapons forum, I thought of how much a gun might cost at the black market. Actually, I wasn’t going to buy one, as I had an arsenal of legal weapons of my own. I was just curious about it. Let’s see what discoveries I made. One of the samples Disclaimer : Further description is not an instruction of how and where to buy or sell illegal weapons (therefore, i'll will not provide any links). It’s just a research of quite a relevant topic with some summary at the end. After some time googling the Internet, it seemed that all the weapons offered there looked suspicious. Neither the websites, nor the sellers inspired confidence. But I kept looking anyway. One day, I came across an anonymous network called Tor , which is also called the “deep” or the “dark” Internet.Do Not Learn Frameworks. Learn the Architecture.
Written by Alex Rboots
I had an interesting conversation some time ago. A colleague of mine stood up for Angular and said that it fastened web development. I’ve developed complex web services for more than 10 years, used to work for Microsoft, and also Spotware Systems in Cyprus. As for now, I create an application for a strartup from the Silicon Valley. All in all, I follow the trends. But I felt like a dinosaur, as I saw no sense in using frontend frameworks, and it turned out to be mainstream. It was 2014, and I plunged into the world of Angular, Knockout and Backbone. If you want to find out what came out of it and why I stopped using them and recommend you to do the same, welcome under the cut. We all know that Angular has a lot of problems, and debugging is one of the main ones. When undocumentedPVS-Studio for Visual C++
Written by Andrey Karpov
Many of our articles are concentrated on anything but the PVS-Studio analyzer itself. We tell our readers about projects we have checked, nuances of C++ language, creation of plugins in C#, running PVS-Studio from the command line… But PVS-Studio was first of all designed for Visual Studio users. We have done a lot to make their work with the tool as comfortable as possible. But this particular fact is very often left outside the frame. I've decided to improve the situation and tell you about the PVS-Studio plugin from scratch. If you work in Visual C++, this article is for you. What Static Code Analysis Is and Why Do We Need It Static code analysis is the process of detecting errors and defects in software's source code. Static code analysis can be treated as an automated code review process. Code review is a wonderful technique but it has oneLock-Free Data Structures. The Evolution of a Stack
Written by Max Khiszinsky
In the previous articles I described the basis, on which lock-free data structures and basic algorithms of the lifetime management of elements of lock-free data structures are built. Actually, it was a prelude to the description of lock-free containers. But then I faced a problem of how to build the story. Describing the known algorithms would be quite boring, as there would be a lot of [pseudo-]code, plenty of details that are important but quite specific. After all, you can always find them in the references I provide in articles. What I wanted was to tell you an interesting story about exciting things. I wanted to show the development of approaches to designing concurrent containers. Then the method of presentation should be the following: take some container type – a queue, map, hash map – and make a review of the currently known original algorithms for this container type.Multitasking in the Linux Kernel. Interrupts and Tasklets
Written by Vita Loginova
In the previous article I mentioned about multithreading. The article covered such basic notions as types of multitasking, the scheduler, scheduling strategies, the state machine, and other. This time, I want to look at the problem of scheduling from another perspective. Namely, I’m going to tell you about scheduling not threads, but their “younger brothers”. Since the article turned out to be quite long, at the last moment I decided to break it up into several parts: Multitasking in the Linux Kernel. Interrupts and Tasklets Multitasking in the Linux Kernel. Workqueue Protothread and Cooperative Multitasking In the third part, I will also try to compare all of these seemingly different entities and extract some useful ideas. After a little while, I will tell you about the way we managed to apply these ideas in practice in the Embox project, and about how we started our operating system on aCopyright and a Bit of Porn
Written by Art Afian
The basic thesis of the traditional copyright system protection lies in the following postulate: if we allow to steal everything, films will no longer be shot, music will no longer sound and poems will no longer be made. Devoid of the state machinery protection, the flow of intellectual products will run low and leave the mankind lead an aimless life beyond the progress. The pictures depicted in regular plots about intellectual piracy often use the image of a starving poet who can not get an adequate fee for his work and talent. This image is extremely emotionally strong, especially considering the fact that not only right-holder representatives of big labels and corporations (though they definitely do not get a chicken feed) stand this position, but also actual authors and actors. The latter proved their right for own judgement. But I think that this point of view is wrong. By theCrowdfunding an Open Source Science for Our Complex World
Written by Shaun Swanson
In short, the crowdfunding campaign to launch the new physics discipline of Complex Thermostatistics ends this weekend, and we could really use your support to get us over our reach goal! Help us grow a community of researchers and science-lovers who are passionate about understanding complex systems. We will be working on an adaptation of Thermostatistics together for this purpose! Your contributions will provide a year-long runway for a collaborative infrastructure as well as educational materials for this emerging field. What is Thermostatistics? In the late 1800s, a growing belief in the atomic theory of matter solidified the importance of Statistical Mechanics as a means of deriving Thermodynamics . Thermostatistics focuses on this connection between the “microscopic” Statistical Mechanics of atoms, molecules, consumers, and firms and the “macroscopic” Thermodynamics of the behavior of systems at our scale and beyond. Thermodynamics was originally developed during the industrial revolution to better understandAn Interesting Task for an Interview. Currying and Partial Application of a Function
Written by Nick Makarov
I am currently attending some job interviews. Some of them are boring, others are interesting. During one of the interviews they asked me to write a function that could add two numbers. So, I wrote: it ('should add two numbers', function () { var add = function (a,b) { return a + b; }; assert.equal(add(2,3), 5); }); — «But what if that the function signature should be something like add(num1)(num2)?» — «No problem!» I think that they want to check whether I know about returning functions from functions. So, I wrote the following: it ('should be called like add(num1)(num2)', function () { var add = function (a) { return function (b) { return a + b; }; }; assert.equal(add(2)(3), 5); }); — «But what is we know the first addend beforehand and the second one will be known later? Then what?» I think that they’re talking about currying, soLock-free Stack for Windows
Written by Vengo
It is common practice not to like Windows. But, as a rule, phrase: “I haven't read the book but still condemn it” describes this situation well. Despite the tendency of not like Windows, there are still some things that are implemented well. I’d like to tell you about one of them. I’ll...
Ref-qualified member functions
Written by rpz
Today I’m going to tell you about a new and a little known (to my mind) C++ feature — reference-qualified member functions . I’ll tell about the rules of such functions overloading and, as an example of use, I’ll show you that with the help of ref-qualified you can try to improve the resource...
Java 8, Spring, Hibernate, SSP — Let’s Play
Written by fspare
Java 8 has been recently released. So I decided to write something using its new features. Namely the new collection api , which allows to work with collections in a more functional style, and default methods in the interfaces. This article is a brief review of my experience of Java 8,...
or