JQuery for Beginners Download source - 858 KB Introduction jQuery is a JavaScript library which has a wide range of actions such as event handling, animation, HTML document traversing, and AJAX interaction for web development. jQuery simplifies JavaScript programming. $(document).ready Method The document ready event executes already when the HTML-Document is loaded and the DOM is ready, even if all the graphics are not loaded yet. $(document).ready(function() { alert("document is ready"); }); Selectors jQuery provides a simple way to select single element or group of elements. Sliding Effect jQuery provides three methods to show or hide elements in sliding behavior. SlideDown(speed, callback): This method gradually increases the height of the elements, from hidden to visible. All three methods has "Speed" and "callback" parameters. slow normal fast milliseconds, e.g., 100, 500, 1000, etc. The callback parameter is the name of a function that executes after the function completes. Sliding Example Fade Effect History
Why YouTube buffers: The secret deals that make—and break—online video Lee Hutchinson has a problem. My fellow Ars writer is a man who loves to watch YouTube videos—mostly space rocket launches and gun demonstrations, I assume—but he never knows when his home Internet service will let him do so. "For at least the past year, I've suffered from ridiculously awful YouTube speeds," Hutchinson tells me. "Ads load quickly—there's never anything wrong with the ads!—but during peak times, HD videos have been almost universally unwatchable. Hutchinson, a Houston resident who pays Comcast for 16Mbps business-class cable, is far from alone. Why does online video have such problems? But cynical types who suspect their Internet Service Providers (ISPs) intentionally degrade streaming video may be right as well. These business decisions involve "peering" agreements that Internet companies make to pass traffic from one to another and negotiations over caching services that store videos closer to people's homes so they can load faster in your browser.
CAGE Web Design | ColorHarmony - Processing Library - CAGE Web Design ColorHarmony is a Processing.org library developed by Rolf van Gelder, CAGE Web Design. With this library, you can generate so-called harmonized color palettes (also called color schemes), which means a set of colors that ‘look good together’. The generated palettes can be used, real-time, in Processing sketches. There are four types of palettes available: monochromatic, analogous, complementary and triads. Example of ColorHarmony palettes (see the palettes.pde example) Every palette is based on a base color. “Another important parameter of a color scheme is the base color. In the library, there is also an option to use a random base color for generating the palettes. Another option is to generate a fully random harmonized palette: the palette type and base color will be selected at random. The library contains a set of color conversion methods, which you, of course, also can use without generating the palettes. Check out the Javadocs for all the details and examples. Compatibility History
Preparing Yourself for Modern JavaScript Development There is a lot going on in the JavaScript world these days, both in and out of the browser. Talk about script loaders, client side MVC frameworks, minifiers, AMD, Common.js, Coffeescript, can quickly get your head spinning. And for those people who are completely immersed in that world, it can be easy to forget that the vast majority of JavaScript developers today haven’t heard of any of these tools, and in fact, they likely aren’t even equipped to try these tools. This post is going to be an attempt to simply address some of the low hanging fruit out there, and try to bring together a few different concepts that a developer should understand before they go out and try to tackle something like Backbone.js or Ember.js. Once you understand most of the concepts in this post, then you can go out and approach more advanced JavaScript topics with a bit of confidence. Modules It is a big name, but the implementation is very simple: Namespaces This could also be written like this: Wrapping It Up
Essential Math for Games Programmers As the quality of games has improved, more attention has been given to all aspects of a game to increase the feeling of reality during gameplay and distinguish it from its competitors. Mathematics provides much of the groundwork for this improvement in realism. And a large part of this improvement is due to the addition of physical simulation. Creating such a simulation may appear to be a daunting task, but given the right background it is not too difficult, and can add a great deal of realism to animation systems, and interactions between avatars and the world. This tutorial deepens the approach of the previous years' Essential Math for Games Programmers, by spending one day on general math topics, and one day focusing in on the topic of physical simulation. Topics for the various incarnations of this tutorial can be found below. Current Materials Slides The latest available versions of the slides for the math tutorials at GDC 2015 are as follows: Past Materials Core Mathematics
PShape If you see any errors in this tutorial or have comments, please let us know. This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. Daniel Shiffman (The source code for this tutorial are in the Processing Examples. One of the very first things you learn when programming with Processing is how to draw "primitive" shapes to the screen: rectangles, ellipses, lines, triangles, and more. rect(x,y,w,h); ellipse(x,y,w,h); line(x1,y1,x2,y2); triangle(x1,y1,x2,y2,x3,y3); A more advanced drawing option is to use beginShape() and endShape() to specify the vertices of a custom polygon beginShape(); vertex(x1,y1); vertex(x2,y2); vertex(x3,y3); vertex(x4,y4); // etc; endShape(); And you can build more complex shapes by grouping a set of drawing functions together, even perhaps organizing them into a class. class MyWackyShape { // Some variables // A constructor // Some functions // Display the shape! PShape is a datatype for storing shapes. ArrayList
2008 - A Year of Awesome JavaScript Games It's been a great year for JavaScript games. It looks like DHTML and canvas-based games are now capable of taking over some of the areas where Flash used to dominate. Many people have been building remakes of classic video games like Super Mario, Pac-Man, Breakout, Space Invaders, Bomberman or T&C Surf Designs. Others took the old arcade traditions and applied them to their own ideas, giving us cool games like Matt Hackett's Spacius, Mark Wilcox's Invaders from Mars, VertigoProject's RedLine Racing or a twist on the classic Tetris game. We've even seen some roleplaying games, like the very cool Tombs of Asciiroth or the more graphical CanvasQuest by Andrew Wooldridge and the Prototype based ProtoRPG by Pierre Chassaing. 2008 also saw a few libraries for JavaScript / DHTML game development pop up, most notably GameJS (pictured to the left with its demo game, Jetris) and GameQuery, the latter being an extension to the popular jQuery library. Demos Emulation Graphics Audio Odds and ends
samsquire/ideas Math Types & Utilities (mathutils) — Blender 2.79b f4dc9f9d68b - API documentation This module provides access to math operations. Note Classes, methods and attributes that accept vectors also accept other numeric sequences, such as tuples, lists. Submodules: The mathutils module provides the following classes: import mathutilsfrom math import radians vec = mathutils.Vector((1.0, 2.0, 3.0)) mat_rot = mathutils.Matrix.Rotation(radians(90.0), 4, 'X')mat_trans = mathutils.Matrix.Translation(vec) mat = mat_trans * mat_rotmat.invert() mat3 = mat.to_3x3()quat1 = mat.to_quaternion()quat2 = mat3.to_quaternion() quat_diff = quat1.rotation_difference(quat2) print(quat_diff.angle) class mathutils.Color(rgb) This object gives access to Colors in Blender. copy() Returns a copy of this color. use this to get a copy of a wrapped color with no reference to the original data. freeze() Make this object immutable. After this the object can be hashed, used in dictionaries & sets. b Blue color channel. g Green color channel. h HSV Hue component in [0, 1]. hsv HSV Values in [0, 1]. is_frozen is_wrapped owner r s v x
oCanvas - Object-based canvas drawing Kim Jong-il's Sushi Chef Kenji Fujimoto: Newsmakers The sushi chef was leaving his apartment when he noticed the stranger outside. He could tell by the man's suit—black and badly made—that he was North Korean. Right away, the chef was nervous. Even in his midsixties, the chef is a formidable man: He has thick shoulders, a broad chest; the rings on his strong hands would one day have to be cut off. But he'd long since quit wearing his bulletproof vest, and the last time a North Korean made the journey to visit him in Japan, a decade ago, he was there to kill him. The stranger came closer. "This is about your family," the stranger said. "Go away," the chef told the man, and without another word the man disappeared. A month later, in early July, another North Korean in a black suit came to the chef's door. "Come with me, Fujimoto," the man said, and together they went to a bare-bones hotel near the Sakudaira train station. Luring people back to North Korea to be executed or dispatched to gulags was a favorite trick of the regime.
Flow Fields, Part II – Keith Peters In Flow Fields, Part I, we covered what a flow field is and looked at a few different formulas to create them. And we rendered flow fields in a various ways. We even animated particles being influenced by fields. In this article we’ll cover a couple more ways to generate flow fields and some new ways to render them. As I said in the first part, the possibilities are endless. Perlin Noise Using simple math and minimal trigonometry gave us some pretty interesting patterns, but they wound up being very regular and repeating. What would be nice is something complex but non-repeating. We can tap into Perlin noise to create a flow field that varies all over the place and never repeats. If you’re using Processing or some other platform, you may have a Perlin noise function built in. I’m going to start with the same basic HTML file as last time, and add the perlin.jslibrary in the script tag. And here’s the first script file: The first block is the same as before. Pretty cool, eh? What else?
Handling select box (drop-down list) in a PHP form This tutorial will show you how to add select boxes and multi-select boxes to a form, how to retrieve the input data from them, how to validate the data, and how to take different actions depending on the input. Select box Let’s look at a new input: a “select” box, also known as a “drop-down” or “pull-down” box. A select box contains one or more “options”. Each option has a “value”, just like other inputs, and also a string of text between the option tags. This means when a user selects “Male”, the “formGender” value when accessed by PHP will be “M”. The selected value from this input was can be read with the standard $_POST array just like a text input and validated to make sure the user selected Male or Female. It’s always a good idea to have a “blank” option as the first option in your select box. ( For a generic, easy to use form validation script, see PHP Form Validation Script ) Multi-select Suppose you want to present a select box that allows the user to select multiple options.
Glass The hardware looks much better in person than I expected. In fact, I would even say it looks good. The industrial design is solid, and though it is being manufactured in small batches, it has the build quality you might expect from something being mass-produced. Glass is very clearly an early “alpha” product, and it’s only being sold to very few developers and invitees, so my thoughts below will focus mainly on the design challenges facing ambient computing in general and to point out some things I hadn’t thought about before actually wearing Glass. I was standing outside on a sunny day when I put on Glass for the first time. The software is very rudimentary, which is fine considering the “alpha” nature of the device, but I expected it to be smarter. While some of the human <=> computer interface design challenges facing ambient computers are obvious in theory, many of them are very hard to identify until you actually experience using the device as part of your life. Kudos