background preloader

Javascript

Facebook Twitter

Microjs: Fantastic Micro-Frameworks and Micro-Libraries for Fun and Profit! JavaScript QuadTree Implementation at Mike Chambers. Last week I was playing around with a little EaselJS experiment which required me to do collision detection against all items on the screen. This worked fine with a small number of items, but of course, the more items I added, the slower everything became. I knew that I needed to optimize the code, and pare down the number of collision checks. I have done this before with a grid (even held a contest for it) and was going to port that AS3 code to JavaScript. However, Ralph Hauwert suggested I look at implemented a QuadTree, which should be more efficient.

<! A QuadTree is a data structure in which the coordinate space is broken up into regions / nodes that contain items. There are a couple of implementations in both JavaScript and ActionScript (Michael Baczynski has a nice AS3 implementation), but I decided that I wanted to learn a bit more and implement one from scratch. I've released all of the code under an MIT License, and you can download it from my GitHub repository.

ECMA-262 » JavaScript. The core. Read this article in: Japanese, German (version 2), Arabic, Russian, French, Chinese. This note is an overview and summary of the “ECMA-262-3 in detail” series. Every section contains references to the appropriate matching chapters so you can read them to get a deeper understanding. Intended audience: experienced programmers, professionals. We start out by considering the concept of an object, which is fundamental to ECMAScript. ECMAScript, being a highly-abstracted object-oriented language, deals with objects. There are also primitives, but they, when needed, are also converted to objects. An object is a collection of properties and has a single prototype object.

Let’s take a basic example of an object. For the code: we have the structure with two explicit own properties and one implicit __proto__ property, which is the reference to the prototype of foo: Figure 1. What for these prototypes are needed? Prototype objects are also just simple objects and may have their own prototypes. GameBoy Emulation in JavaScript: GPU Timings. This is part 3 of an article series on emulation development in JavaScript; ten parts are currently available, and others are expected to follow. The emulator described in this series is available in source form: In the previous parts of this series, a structure for a GameBoy emulator was laid out, and brought to the point where a game ROM could be loaded, and stepped through by the emulated CPU.

With the emulated processor attached to a memory mapping structure, it's now possible to attach peripherals to the system. One of the primary peripherals used by the GameBoy, and by any games console, is the graphics processor (GPU): it's the primary method of output for the console, and much of the processor's work goes on generating graphics for the GPU. Emulating the screen Nintendo's internal name for the GameBoy is "Dot Matrix Game"; its display is a pixel LCD of dimensions 160x144. Index.html: Canvas tag GPU.js: Canvas initialisation Raster graphics. 10 Fresh and Useful jQuery Plugins. When it comes to adding JavaScript functionality to a website, jQuery has become the solution of choice for web designers and developers.

With it’s ease of use and ever-growing selection of plugins, there’s really no point to look elsewhere. Awesome jQuery plugins are popping up everyday, and we’re always on the look out. So for this post, I’ve gathered 10 fresh plugins that you should find very useful. Cute Balloon Cute Balloon is a jQuery script that allow you to easy make a beauty tool tip balloon, also with ajax content. Captify Captify is a plugin that displays simple, pretty image captions that appear on rollover.

GvChart gvChart is a plugin for jQuery, that uses Google Charts to create interactive visualization by using data from the HTML table tag. Jmapping This plugin is designed for quick development of a page that implements a Google Map with a list of the locations that are specified within the HTML. jQuery.validity Animated table sort Flare Video Coin Slider Blockster Colortip. Opening up Closure Library.

Node.js

JSSP – JavaScript Server Page engine on top of NodeJS. I would like to introduce Alligator, a JSP/PHP/ASP-style template engine for JavaScript on top of NodeJS. Most web-apps have been written in Java, PHP, ASP.net, Ruby or Python, on the server side, and JavaScript on the client side. This approach of using different technologies and different programming languages for the different “sides” has few drawbacks: 1) Serialization of objects from one language to another has to be taken care of , e.g. take a look at GSON, a library that translates Java-to-JSON and vice versa. 2) Client-side code can’t be reused on the server-side and vice versa. 3) Web-apps “factories” has to hire different people with different expertises. 4) I bet you can think of at least 2 more drawbacks Other than that, the multi-threaded approach that most of the current web-server/application-server utilize is problematic for load since it is limited by the maximum number of OS thread per machine.

Let’s “Hello Word”-ing using Alligator: In this example the <? Logic.jssp: view.jssp: HTML Example in Manual. ItsNat: Feature Set & Examples. Overview Welcome to the ItsNat's Feature Showcase, this is a special Single Page Interface Java AJAX web application using ItsNat to show its capabilities with many examples and the source code used. ItsNat is an innovative open source GNU Lesser General Public License v3 (LGPL v3) licensed Java AJAX Component based Web Framework, it offers a approach to modern web development. ItsNat is server centric using a unique approach called .

ItsNat simulates a at the server, with ItsNat the server mimics the behavior of a web browser, containing a W3C DOM Level 2 node tree and receiving W3C DOM Events. ItsNat virtually supports 100% of browser market including mobile devices with AJAX support: Desktop Browsers: Adobe AIR HTML Component, Arora, Google Chrome, FireFox 1+, Internet Explorer v6,7,8, Internet Explorer v9, Moblin 2.0, Opera 9+, QtWebKit (Qt 4.4), Safari 3+. Mobile Browsers: SVG plugins: How ItsNat works In addition to AJAX, events can be transported by auxiliary SCRIPT elements. ItsNat: Natural AJAX. Component based Java Web Application Framework.