background preloader

Sylvester

Sylvester

Neurobots Neurobots This program simulates small robots, each one is controlled by a recurrent artificial neural network. They scan their surrounding using low resolution ray casting and this data is fed into the first layer of their neural network. The output layer of the neural network controls their movement. Options Tools Population | Food | Age | Mutation rate Neurobots v.1.5.5 by 50m30n3 - Index - Help - Source on GitHub Create HTML5 Canvas Drawing Board Within 5 Minutes! Welcome to “Create HTML5 Canvas Drawing Board Within 5 Minutes!” tutorial. We are going to create a drawing board using HTML5 Canvas API. This is an easy to follow tutorial, and I’ll try not to lose anyone, though, I promise. If you’re not entirely sure what HTML5 Canvas is, please read HTML5 Canvas For Absolute Beginners, before you continuing this tutorial. Please check out the demo before we start our tutorial. View Demo HTML Structure Ok, let’s start our tutorial by creating a div named “board” which will contains a canvas element and a color picker dropdown box. CSS Styles The CSS for this tutorial is simple and easy, following is how the CSS codes looks like: First of all, we have to offset the body’s margin; horizontally center the div with named “board”; and apply 3px width of border to the canvas element. The JavaScript Here is the section where we convert our canvas into a drawing board. Next, we will have a window.onload event to executes all the codes when the window has loaded.

JSFeat - JavaScript Computer Vision Library. Data structures Most of JSFEAT methods relies on custom data structures. There are just few provided at the moment but I'm sure its number will increase with new functionality. matrix_t The core and starting structure for any project is most likely matrix_t: var my_matrix = new jsfeat.matrix_t(columns, rows, data_type, data_buffer = undefined); matrix_t is quite flexible structure, it can be used as image representation or regular matrix for mathematics. columns and rows is the same as defining width and height for image. To construct data_type you need to use library internal signatures. // single channel unsigned charvar data_type = jsfeat.U8_t | jsfeat.C1_t;// 2 channels 32 bit integervar data_type = jsfeat.S32_t | jsfeat.C2_t;// 3 channels 32 bit floatvar data_type = jsfeat.F32_t | jsfeat.C3_t; Let's put all together: You can resize matrix_t at any time using resize method. my_matrix.resize(new_cols, new_rows, new_channels); data_t This is just a wrapper for JavaScript ArrayBuffer. Math

Utilisation de jQuery.ajax() - Syrinxoon Tuts Suite à la demande d'un visiteur du site, je vais vous expliquer tout au long de ce tutoriel comment fonctionne la fonction jQuery.ajax() du framework jQuery et comment vous en servir. Nous commencerons par l'aspect théorique à la base d'AJAX, à savoir, l'objet Javascript XMLHttpRequest. Si la théorie ne vous intéresse pas et que vous souhaitez passer tout de suite à la pratique, aucun problème, vous pouvez passer ce chapitre, je ne vous en voudrais pas, promis. Definition AJAX signifie Asynchronous Javascript And XML (Javascript et XML Asynchrone). Javascript et XML, okay, je vois, mais asynchrone, c'est quoi ça ? XMLHttpRequest XMLHttpRequest est un object Javascript implémenté dans tous les navigateurs actuels (je considère que votre navigateur est à jour, vous n'êtes pas des noobs quand même). La théorie est maintenant terminée, passons à la pratique. La fonction jQuery.ajax requière plusieurs paramètres (dans un objet JSON) pour fonctionner. <? Vraiment simple n'est-ce pas ? <?

Google JavaScript Style Guide We follow the C++ formatting rules in spirit, with the following additional clarifications. Curly Braces Because of implicit semicolon insertion, always start your curly braces on the same line as whatever they're opening. For example: if (something) { // ... } else { // ... } Array and Object Initializers Single-line array and object initializers are allowed when they fit on a line: Multiline array initializers and object initializers are indented 2 spaces, with the braces on their own line, just like blocks. Long identifiers or values present problems for aligned initialization lists, so always prefer non-aligned initialization. Not like this: Function Arguments When possible, all function arguments should be listed on the same line. // Four-space, wrap at 80. When the function call is itself indented, you're free to start the 4-space indent relative to the beginning of the original statement or relative to the beginning of the current function call. Passing Anonymous Functions Blank lines

JavaScript Fundamentals: Variables I have never heard of a language that doesn't use variables, and JavaScript is definitely not an exception to that. Variables are handled differently in each language and to become a true JavaScript expert you'll need to understand how JavaScript handles variables too. For the most part it's very straightforward, but there are plenty of "gotchas" you'll want to be aware of. Declaring a Variable The first thing that you'll probably want to know about JavaScript variables is that they are loosely typed. You don't need to set the type of a variable when you declare the variable.You can change the value of a variable to a different type at any time. Instead of saying what type of variable it will be, you simply use the var keyword when you declare a variable. In the first line where variableName was declared without a value, it will be undefined. You can also declare multiple variables with a single var keyword simply by separating the variable names and assignments with a comma: Scope Joe Zim

JavaScript reference JavaScript is a scripting language primarily used in Web applications. It allows authors to create dynamic HTML (DHTML) pages. The JavaScript language has three components: Core JavaScript is the base part of the JavaScript language that is supported on both the client and server side. Client-side JavaScript (CSJS) contains the core JavaScript elements and has several additional objects, properties and methods that are supported by browsers. Dottoro provides you a complete standard and browser specific Core and Client-side JavaScript reference with detailed descriptions, syntax, examples, browser support information, cross-browser solutions and much more. JavaScript is primarily used for event handling, form validation, DOM and style manipulation, browser detection, animation and more. Unfortunately, client side scripting has a drawback; sometimes different browsers support different language elements. Contents: External links:

Skill Level Indicator by apovtx Welcome to Skill Level Indicator's GitHub Page. Skill Level Indicator is a javascript function that helps you create nice and highly customizable rounded skill indicators. It's usage is very simple. It only requires a browser that supports the html5 canvas element. See it in action: Usage After including the script in your page you only have to just call it with 1 mandatory argument and some optional changes you may want. To include it in your page you just need to have: and to create a skill indicator: And that's all! Options You can customize the output with many different options: ToDo There are many things that are in the ToDo list! Create the canvas element automatically (will be in JQuery plugin version)Change the font-family of the textFallback for browsers that don't support canvasCalculate the text size depending on the radius and name length (done)

A Step-by-Step Tutorial of Building a Simple Peer-to-Peer WebSocket App – Part 1 | The Zinger This tutorial series walks you through the simple steps of building an HTML5 WebSocket app, demonstrating the power of the publish/subscribe development pattern directly in JavaScript. Our sample is almost as simple as a Chat app, the “Hello World” app of the WebSocket world, but is a tad more visual and dynamic. After trying out the completed application, you can either jump in the code and play with it right away, or move on to Part 2 of this tutorial for a step-by-step guide. About the Environment This tutorial requires a WebSocket server. Getting Started Firstly, to understand how the tutorial environment in JSFiddle works, open up the completed demo in JSFiddle. Note: The sample code uses an HTML5 element, <input type=”range”> that is unfortunately not supported by every browser. JSFiddle provides a simple, integrated environment to edit the source of your web pages and apps. In the bottom right pane, you can interact with the completed app. Modify the name of the topic. Like this:

Related: