Quantum Search Using Grover’s Algorithm
Written by Roman V. Dushkin
Following the first quantum algorithms we have already reviewed ( Deutsch’s algorithm and the Deutsch-Jozsa algorithm — it's better to read these articles first, otherwise all the things mentioned here will be quite vague), let’s analyze Grover’s algorithm for the unstructured quantum search. An American mathematician Lov Grover formulated the algorithm in 1996 (it was long after the model of quantum computations had become popular). The algorithm uses a feature of quantum interference in order to solve an extremely demanding task of searching the value of some parameter, at which a defined function returns certain results. The given algorithm does not show the exponential advantage of the task in contrast to the classical computational model, but the advantage (quadratic) is quite essential for big values. However, it’s a general algorithm for solving quite a generalized problem. It has been proved that we cannot get a better result within theSecrets of the Conditional (ternary) Operator
Written by Alex Kulikov
Every self-respecting C/C++ programmer knows what the ternary operator is, and most everyone used it at least once in their programs. But do you know all the secrets of the ternary operator? What potential dangers are associated with its use and what features, seemingly not related to its direct purpose, it has? This article gives you the opportunity to test your knowledge and maybe learn something new. Let's start with a small test. Test Will the following code compile? Explain why. 1. int i; int j; (false ? i: j) = 45; 2. int i; int j; (true ? i: j) = 45; 3. short i; int j; (true ? i: j) = 45; 4. return true ? 0 : 1; 5. true ? return 0 : return 1; 6. What will be the output of the following piece of code? Why? std::cout << (false ? 9 : '9')A Short Course in Computer Graphics. How to Write a Simple OpenGL. Article 2 of 6
Written by Dmitry Sokolov
Hi, everyone. It’s me. It’s a model of my head rendered in the program we will create in the next hour or two. Last time we drew the wire mesh of a three-dimensional model. This time, we will fill polygons, or rather triangles, as OpenGL triangles almost any polygon, so there's no need to consider a complex case. Reminding you, that this series of articles is designed for your own programming. The time that I provide here is not for reading my code. It’s time for writing your code from scratch. My code is provided here just to compare your (working) code with mine. Any comments and questions are welcome. If you’re following this tutorial and writing your own code, upload it to github.com/code.google.com and other similar websites and provide links in comments. This can help you (other people will give advice), as well as other readers. Drawing aUndefined Behavior and Fermat’s Last Theorem
Written by Tyomitch
In accordance with the C and C++ standards, if the program leads to an integer overflow or any other “undefined behavior” (UB), the result of the program performance can be anything: it can post obscenities to Twitter or format your disk… Unfortunately, “Easter eggs” that would make the program...
Multitasking in the Linux Kernel. Workqueues
Written by Vita Loginova
Let’s go on talking about multithreading in the Linux kernel. Last time I told you about interrupts, the ways to process them, and tasklets. Since I’ve wanted it to be one article, I will refer to tasklets in the story about the workqueue, and assume that the reader is already familiar with them. Just like the last time, I will try to make my story as detailed as possible. Articles of the Series: Multitasking in the Linux Kernel Interrupts and Tasklets Multitasking in the Linux kernel. Workqueues Workqueue Workqueues are more complex and heavy entities, than tasklets. I will not even try to describe here all the implementation details, but I hope to review the most important things in some detail. Workqueues, just like tasklets, serve for the deferred processing of interrupts (but we can also use them for other purposes), but, unlike tasklets, they are run in theI Do Not Know C
Written by Dmitri Gribenko
The purpose of this article is to make everyone (especially C programmers) say: “I do not know C”. I want to show that the dark corners of C are much closer than it seems, and even trivial code lines may contain undefined behavior . The article is organized as a set of questions and answers. All the examples are separate files of the source code. 1. int i; int i = 10; Q: Is this code correct? (Will there occur an error related to the fact that the variable is defined twice? Reminding you that it’s a separate source file and not a part of the function body or compound statement) Answer A: Yes, this code is correct. The first line is the tentative definition that becomes the «definition» after the compiler processes the definition (the second line). 2. extern void bar(void); void foo(int *x) { int y =Introduction to Machine Learning with Python and Scikit-Learn
Written by Alex Krot
Hello, %username%! My name is Alex. I deal with machine learning and web graphs analysis (mostly in theory). I also work on the development of Big Data products for one of the mobile operators in Russia. It’s the first time I write a post, so please, don’t judge me too harshly. Nowadays, a lot of people want to develop efficient algorithms and take part in machine learning competitions. So they come to me and ask: “Where to start?”. Some time ago, I led the development of Big Data tools for the analysis of media and social networks in one of the institutions of the Government of the Russian Federation. I still have some documentation my team used, and I’d like to share it with you. It is assumed that the reader has a good knowledge of mathematics and machine learning (my team mostly consisted of MIPT (the Moscow InstituteA Short Course in Computer Graphics. How to Write a Simple OpenGL. Article 1 of 6
Written by Dmitry Sokolov
Describing the Task In this series of articles, I want to show the way OpenGL works by writing its clone (a much simplified one). Surprisingly enough, I often meet people who cannot overcome the initial hurdle of learning OpenGL / DirectX. Thus, I have prepared a short series of six lectures, after which my students show quite good renderers. So, the task is formulated as follows: Using no third-party libraries (especially graphic ones), get something like this picture: Warning you, that it is training material that will generally repeat the structure of the OpenGL library. It will be a software renderer. I do not want to show how to write applications for OpenGL . I want to show how OpenGL is built. I am deeply convinced that it is impossible to write efficient applications using 3D libraries without understanding this. I will try to make the final code notLock-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.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...
How to Implement the Deutsch-Jozsa Algorithm in Haskell
Written by Roman V. Dushkin
We have already mentioned this algorithm when solving the simplest tasks in quantum computations . Let’s go on developing the framework and review the initial algorithm enhancement, named the Deutsch-Jozsa algorithm. It is another article in the series about the model of quantum computations. That’s why you’d better read the previous articles, as they will help you to understand all the things here. You should refer to the first three articles: A Few Words About Reversible Computing How to Implement Deutsch’s Algorithm in Haskell Quantum Circuit Design: Methods and Techniques Today you will find out about the way to build an oracle on the basis of the given definition of a binary function. We will build it not manually, like we used to before, but automatically. You will also learn how to understand the function type with the help of the only one oracle call. We will also carryClojure. 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 givenMeteor. How to Build a TODO List
Written by Max Ovcharik
In this tutorial I don’t want to discuss why Meteor is the killer of the web, especially because I don’t think so and even like this framework. That’s why I want to show what to start with when developing applications on it. I’ll tell you about what packages there are and what Meteor is. I don’t have much experience in developing Web applications. I’ve been doing it for two years only, and I got to know Meteor only a few months ago. I should also warn you that the text is quite long, but the code is twice shorter than the text. I just want to share my experience with Meteor not for creating a simple example, but focus your attention on important things. Therefore, we are going to use plenty of external packages that simplify the process of development. And another warning: I used the following techniques forWhy 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...
or