Erlang for the Little Ones. Modules and Functions
Written by HaruAtari
Dear %username% , Let’s continue to learn Erlang. In the previous post we’ve reviewed the basic data types, lists and tuples. We also learnt how to use pattern matching and lists generator. In this post we’ll move on to the next level and review modules and functions. All...
2048 in Erlang
Written by peinguin
This article is about a WebSocket server on Erlang rather than about the game itself. I’ll tell you a small prehistory. When I began playing 2048 I couldn’t stop. It was to the detriment of both my job and family. So I decided that a bot should play instead of me. But the problem was that it’s a user game, there’s no global rating and it’s not comfortable to play without a browser. That’s why I decided to create the server part so that there would be rating and my bot could play without a browser. It’s my first project in Erlang. Many programmers are afraid of it. They suppose that it’s difficult to use it. But it’s actually not. I’ll try to highlight some things that are not obvious for Erlang beginners. I’ve hard coded a lot of things for simplicity. But anyway, I’ll be glad to read yourMasking a Class in Boost Graph. Part 1: Let the Interface Be
Written by Vadim Androsov
I had to rebuild a pathfinding algorithm for our game recently. The previous one ( Boost Concepts ) was bad as any sidestep was dangerous. So I wanted to take a ready algorithm from a good source. That’s exactly when I remembered about boost as there’s functionality for working with graphs. Unfortunately “find a function, call it and everything will work” approach wasn’t meant to be realized. The library is focused on the maximum use flexibility which has badly affected its simplicity. But it’s better than creating it from scratch (then fixing it). I didn’t want to bother with other libraries, while boost has already been used in the project. The following is given: a game field class with the following (significant for this article) interface: class GameField { public: GameField(); bool canPass(int x, int y) const; int getWidth() const; int getHeight() const; }; The field is a regular gridLock-free Data Structures. The Inside. Memory Management Schemes
Written by khizmax
As I’ve already mentioned in the previous articles , the main difficulties when implementing lock-free data structures are ABA problem and memory reclamation. I will separate these two problems even though they are connected as there are algorithms that can solve only one of them. In this article I am going to review popular methods of safe memory reclamation for lock-free containers. I’ll demonstrate the application of one or another method of the classic lock-free queue by Michael-Scott [MS98]. Tagged pointers Tagged pointers is a scheme introduced by IBM for to solve the ABA problem. Perhaps, it’s the most popular algorithm for this problem’s solution. According to this scheme each pointer represents an atomic pair of the memory cell address and its tag (32-bit integer number). templateLightweight HTTP Server in less than 40 Lines on libevent and C++11
Written by NYM
Looking through programming articles sometimes I see posts about creating your own HTTP server. I am most interested in C++ so I often read blogs about it. After looking them through you could easily write you own web server “on sockets” using boost.asio or something else. I also examined libevent and libev. Each of them has its advantages. Libevent is of great interest to me for developing a small HTTP server. Considering some innovations in C++11 the code becomes much more space-efficient and allows for the creation of a basic HTTP server in less than 40 lines. (adsbygoogle = window.adsbygoogle || []).push({}); The information of this post will be useful for those not familiar with libevent and those who want to quickly create an HTTP server. There’s nothing innovative in this post, so you can use it as material for working in the right direction. libevent is better thanTypes Construction in Scala
Written by primetalk
When constructing “enterprise” systems it often turns out that ValueObjects (or case classes) are created. They store information about some instance of entity that is processed by the system. For example: case class Person(name: String, address: Address) This way of data representation in the system has two major strengths: Strictly typed access to the data; Capability of meta information binding to features with the help of annotations. And drawbacks: If there are many entities, the number of such classes also increases and their processing requires a lot of code of the same type (copy-paste); Meta information can be represented by annotations to the object features. But annotations facilities are limited and need reflection use; If the data should be represented not about all object features at once, it’s difficult to use the created classes; It’s also difficult to introduce a change of feature value (delta). We want to implement a framework that will allow creating new “classes” (types, types’ constructors, objects of the new types) incrementally using our own “bricks”. Using our own “bricks” production we can reach theLock-free Data Structures. Memory Model. Part 3.
Written by khizmax
In the previous article we looked inside the processor, even if it’s hypothetic. We have clarified that for the proper parallel code execution we should prompt the processor to what limits he is allowed to execute its internal read/write optimizations. These prompts are memory barriers....
LibreS3: Open Source Amazon S3 Implementation
Written by Kukuruku Hub
The first version of LibreS3 project has been announced . LibreS3 is a robust open source implementation of the Amazon S3 service, supporting a subset of the S3 REST API. It's compatible with Amazon S3 client libraries and built on their basis tools, such as python-boto, s3cmd and...
Mobile Responsive Design
Written by muhurov
When designing a mobile version of the site, the core question is still what resolution to choose and which ones are the most popular. By reference to statistics we will consider five the most popular resolutions of mobile screens resolutions. And five the most popular tablet resolutions. And then media queries are entering the game. For instance, if we add the following code to the style sheet, it will define the site background, provided that a certain device will have 480 or less pixels screen. @media screen and (max-device-width: 480px) and (orientation: portrait) { #background { width: 480px; background:url(/img/background.jpg); } } We can also use CSS-rule @import for the conditional loading of stylesheets into the current stylesheet. For example, the following code imports the phone.css, provided that a certain device will have the screen and the display area of maximum width 480 pixels. @import url("phone.css") screen and (max-width:480px); When creatingPaperFold: Foldable Smartphone With Three Displays
Written by marks
The most interesting projects of electronic devices have been introduced lately. Electronic devices we could only dream about before. For example, a modular smartphone Project Ara should be introduced in 2015 by Google. Also, one of these days information about a project of a...
Leonardo da Vinci: Daily Routine
Written by kal1sha
Few people know that Leonardo da Vinci invented a way to spend little time for sleep, but not suffer from doing so. He slept only an hour and a half per day! Many people say that it was the exact secret of his efficiency. Today it is called a polyphasic sleep. Genius Leonardo decided that he spent too much time on sleep and invented his own sleep method. It lies in sleeping for 15 minutes every 4 hours. And he lived like that during not a week, but many years. Why does it work? Psychologists say that after sleep our working capacity increases from 6 to 10 times as much. And wise Leonardo used it to the fullest extent. Other psychologists say that polyphasic sleep doesn’t match all the people and they should read the literature about: sleep nature relaxation eutrophy healthy living P.S. I think this sleep method willHow to DDos any website with Facebook Notes
Written by ValdikSS
A month and a half ago chr13 discovered a way to perform DDoS of any website with the help of Google Spreadsheet, and now he applied such a method to Facebook Notes. And it worked! Operating procedure is absolutely the same as in Google Spreadsheet: Create a list with «unique»...
Yogurt making machine powered by Arduino
Written by Shrim
Everyone knows that yogurt is a very better-for-you product, plus it’s delicious. There is a short story under the cut about how I decided to create a yogurt maker, some pictures and a sketch. Wandering in the vast expanses of the Internet I came across such an interesting thing as a yogurt maker. My wife likes yogurt and fairly often buys it. Having read the specialized website, I was inspired. I was inspired by the very thought of easily making yogurt at home, plus it will be more health-giving than the store-brought one. Having read a few reviews and comparisons, my wife and I decided to buy “Moulinex YG230 YOGURTEO”. But oops, we couldn’t find where to buy it in our town. We were just going to place an order when it dawned upon me. What is a yogurt maker? Roughly speaking, it’s a device for keeping some definite temperatureLibreSSL: clean version of OpenSSL (OpenBSD project)
Written by Kukuruku Hub
Participants of the OpenBSD project, that have developed the system of the same name and also different tools such as OpenSSH, OpenBGPD, OpenNTPD and OpenSMTPD, began a LibreSSL project. It is a cleared from odd codes, easier version of OpenSSL. Theo de Raadt, the founder and the manager of OpenBSD and OpenSSH projects said that they have managed to get rid of approximately 90 000 code lines at C and 150 000 lines of the content on the whole. MacOS, Netware, OS/2, VMS and Windows support is deleted as few people need it. ”We are trying to make code more clean. 99.99% community representatives don’t need VMS support and 98% don’t need Windows support, — says Theo de Raadt. – They need POSIX support so that Unix and Unix-derivatives could start. People don’t care about FIPS. Code should be simple. Even after all the changes, the code base is stillOpenSSL Heartbleed Vulnerability Guide
Written by Vanav
What can be stolen by attacker Private key of the TLS server, private key of the TLS client (if the client is vulnerable), cookies, logins, passwords and any other data that are shared between the server and his clients. And you don’t need to monitor the communication path, you just can...
Marionette.js. Drag&Drop model sorting in the collection
Written by pharrell
Swapping elements in a list is a common task. But as a rule it is often made in a thorny way, especially if it’s Drag&Drop. And now I am going to tell you about a very easy and flexible way to do it using Marionette.js and jQuery UI Sortable. Installing jQuery UI We will need part of Sortable only, so in order to save the traffic, I cleared all the ticks for you here . You just need to download it. Pay attention We are using a reference to Marionette in the code below: var Marionette=Backbone.Marionette; Creating Behavior template This functionality will be implemented with Behaviors. Here’s the behavior code that will be in charge of capacity to sort models inside the collection: Behaviors.Sortable=Marionette.Behavior.extend({ onRender:function(){ var collection=this.view.collection // Close the collection ,items=this.view.children._views // Get the list of child elements ,view ; for(var v in items){ view=items[v] // Hook the elementWorld of Minecraft: full-scale model of Denmark
Written by ilya42
The Danish GeoData Agency launched a full-scale model of Denmark. The model is very detailed and was generated with real geographical data — it includes not only relief but also buildings, vegetation, parks and attractions Only the location of rocks and minerals on the ground and color facades of...
Hack: Facebook's new programming language for HHVM
Written by sferrka
Facebook has presented Hack – a new programming language based on the PHP syntax and intended for implementation with HHVM (HipHop Virtual Machine). Applications written on Hack can seamlessly interact and go with an existing code written on PHP, as the HHVM environment supports the...
eMersion Gesture Control System for Music Performance and More
Written by cudell
Don’t just let music move you, move to make music. We've created a smart technology that allows your instrument to transform movement, orientation and momentum into audio & visual effects. It's essentially wearable technology for musicians, dancers, digital interactive and...
or