• +1
Boost, A* Search algorithm, Boost.GraphIn the previous articles of the series we’ve reviewed the adaptive process of the square game field for concepts of boost graphs. Now we’ll consider the process of finding the path in the square field. Implementation of boost search allows adapting the algorithm quite accurately. In this article we’ll provide just one example of such parameterization – an ability to create various lengths of graph edges.

Let’s begin with describing the parameter. We should create a map of edge weights. This map will meet requirements of ReadablePropertyMapConcept concept. It’s quite easy to implement. We should define several types and [] iterator. On the basis of the key-type edge the latter returns its length.

Read more →
  • +1
Boost.GraphI’ll briefly remind you of the task. There’s a two-dimensional game field consisting of squares. Some of them are vacant and others are occupied. We should find a path through vacant squares from one field position to another one. We implemented the search algorithm in Boost. But it requires our field to fit the graph definition. Or rather the class should meet the requirements of two concepts: boost::VertexListGraph and boost::IncidenceGraph. We don't want to change the interface of game field, as it’s not a graph for the remaining project and will never be one.

In the previous part we’ve reviewed attaching the external associative types that are necessary for interpreting the class as boost graph. Of course types only are not enough. We should also implement several functions with the assigned signature, and iterators which will help the library to handle the game field as a graph.

Read more →
  • +4
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.

Read more →
  • +5

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.

Read more →
  • 0
One of the users of StackExchange asked a question, which at first glance may look weird: why is the mouse cursor slightly tilted and not straight? Indeed, why the cursor is not vertical?

Vertical mouse cursor

The answer was given by an expert, who is familiar with the history of computer hardware. He confirms, that initially the mouse and therefore the mouse cursor invented by Douglas Engelbart, was an arrow pointing up.

However, graphical interface for the first operating system in the world was designed by Xerox, precisely — the Palo Alto Research Center. The mouse cursor was described in a document, which lists all of the specifications of XEROX PARC, the first computer with graphical user interface. It was found that, given the low resolution of the screens in those days, drawing a straight line (left edge of arrow) and a line at a 45 degree angle (right edge of arrow) was easier to do and more recognizable than the straight cursor.

Palo Alto Research Center

These days, the tradition is being kept alive despite high-resolution displays we have and huge technological progress in general.
Unfortunately, standard C++ library provides no tools for working with HTTP protocol. Therefore, when we want to run some REST service, parse a webpage or write a simple bot or web crawler, we always wonder which library is better and faster in use. Sometimes a project already uses some framework (or even several). But how do we create an HTTP request using available facilities? Not to get confused each time performing such tasks, I decided to make a cheat sheet with examples of HTTP requests in C++ using different libraries. I guess Kukuruku is the best place for keeping such cheat sheets.

Read more →
  • +1
Dear %username%,

I have recently come across several interesting and useful tools/libraries/events I would like to tell you about.

DC.js


DC.js
This library allows creating great multi level/scalable cross-platform charts and diagrams providing instant feedback on user's interaction. A popular d3.js is in charge of the viewing process. crossfilter.js deals with the analysis of multi-dimensional data sets.

chart.renderlet(function(chart){
    // smooth the rendering through event throttling
    dc.events.trigger(function(){
        // focus some other chart to the range selected by user on this chart
        someOtherChart.focus(chart.filter());
    });
})


Read more →
  • +1
Rust is a system programming language. It runs blazingly fast, prevents almost all crashes and removes the ambiguities associated with sharing access to data. Mozilla developed it as a tool to create a new generation browser engine – Servo.

Read more →