background preloader

Tutoriels

Facebook Twitter

Community • View topic - How to use distinct with multiple columns in Criteria API. HTML 5 canvas - the basics - Opera Developer Community. Table of contents Introduction The HTML5 specification includes lots of new features, one of which is the canvas element. HTML5 canvas gives you an easy and powerful way to draw graphics using JavaScript. For each canvas element you can use a "context" (think about a page in a drawing pad), into which you can issue JavaScript commands to draw anything you want. Browsers can implement multiple canvas contexts and the different APIs provide the drawing functionality. Most of the major browsers include the 2D canvas context capabilities - Opera, Firefox, Konqueror and Safari.

This article takes you through the basics of implementing a 2D canvas context, and using the basic canvas functions, including lines, shape primitives, images, text, and more. Note that you can download all the code examples in a single zip file, as well as viewing them live using the links below. The basics of using canvas That's your drawing pad created, so now let's put pen to paper. The 2D context API Paths Text Shadows. Let’s Call It a Draw(ing Surface) You are here: Home Dive Into HTML5 Diving In HTML 5 defines the <canvas> element as “a resolution-dependent bitmap canvas which can be used for rendering graphs, game graphics, or other visual images on the fly.” A canvas is a rectangle in your page where you can use JavaScript to draw anything you want. So what does a canvas look like? Invisible canvas The markup looks like this: Let’s add a dotted border so we can see what we’re dealing with.

Canvas with border You can have more than one <canvas> element on the same page. Let’s expand that markup to include an id attribute: Now you can easily find that <canvas> element in the DOM. var a_canvas = document.getElementById("a"); Simple Shapes Every canvas starts out blank. Click to draw on this canvas The onclick handler called this function: function draw_b() { var b_canvas = document.getElementById("b"); var b_context = b_canvas.getContext("2d"); b_context.fillRect(50, 25, 150, 100); } And then there’s this Every canvas has a drawing context Paths path . Constant, Synchronized or ThreadLocal for Utility Objects? A subtle mistake I have made previously is to declare certain "utility" objects as constants in my web app without understanding that they are not thread safe.

For example, in my current application I need a SimpleDateFormat object to do some work translating String to Date and vice versa. My first thought is to write the following. For a batch job or stand-alone application, this would probably be ok, because only one thread would ever access this object at once. Some Ojbects are not Thread Safe The problem with the above code is that SimpleDateFormat is not thread safe.

This won't happen every time: in fact it will be extremely rare because calls to the object finish so quickly. There are two ways around this problem: synchronize access to the object or have a copy of it for each thread. Synchronized It's not too hard to synchronize access to the object. This code ensures that only one thread at a time will be able to execute formatDate() or parseDate(). Thread Local Conclusion. TYPO3 - the Enterprise Open Source CMS: Home. Next Generation Enterprise Web Development | ICEfaces . Spring . Flex/AIR . 3D | rainwebs.net.

Best Practice Software Engineering - Observer. The aim of the Observer-Pattern is to define a one-to-many dependency between objects so that when the object on the "one-side" changes state, all its dependents are notified and updated automatically. The Observer/Observable-Pattern is known under many different Names, each flavor is used for a special purpose and has a slightly different form. Most common other names for this pattern are Producer/ConsumerPublish/SubscribeDependents The main idea of the Observer-Pattern is that an object (the observer) that always requires actual data of another object (the observable or subject). The fist solution that comes into mind might be to continuously ask the subject for changes of the data desired and if necessary load the data. The mechanism of continuously asking the subject for changes, also called polling has the main disadvantage of causing an unnecessary high system load.

This is the Observer pattern. Applicability / Uses The Observer-Pattern is especially useful when Structure Sample.

Ajax Comet real time web application

CMS. Prototypal Inheritance. Static Version In almost all modern programming languages we use the concept of Object Oriented Programming (OOP) to help manage the complexity of today's software. The biggest challenge in modern software is in fact managing the complexity of it. Most languages do this with a variant OOP called Classical OOP. This is the one you see in Java, C#, C++, PHP, Ruby, and Python. It has the idea that classes should be separate from instances. Classes hold behavior and instances hold data. While this is a great abstraction, I would like to experiment with other ideas. So what does JavaScript have? From what I hear (I wasn't there at the time), JavaScript was initially a prototypal inheritance system. Classical OOP classical.js var frank = new Person("Frank Dijon");frank.greet(); Output => 'Hello world, my name is Frank Dijon' Here we have a class like object Person. Prototypal OOP I don't like the new keyword, it overloads the meaning of functions and is dangerous.

Instead try this on for size: IT Knowledge Exchange Tech Blogs. Microsoft might not win mobile front end, but has a good shot at back-end managementPosted in View From Above by Ron Miller on 2014-04-15 10:54:44 The new version of Windows Phone OS, 8.1, was released yesterday to the developer community and early reviews say it’s enterprise friendly, but is that enough in an age when people are choosing their own devices? It may very well be as Simon Bisson wrote on CITEworld (where I’m also a contributor…READ MORE PowerShell versionsPosted in PowerShell for Windows Admins by Richard Siddaway on 2014-04-15 10:06:00 I’ve been using the CIM cmdlets for a number of posts recently and had a comment that a reader got a message that Get-CimInstance didn’t exist on their Windows 7 machine.

Windows 7 ships with PowerShell 2.0; Windows 8 with PowerShell 3.0 and Windows 8.1 with PowerShell 4.0. You need PowerS…READ MORE #NoEstimates Go Portfolio! Traveling abroad brings with it a series of experiences that can be both frustrating and surprising. Dear Readers: Csound. It is free software, available under the LGPL. Csound was originally written at MIT by Barry Vercoe, based on his earlier system called Music 11, which in its turn followed the MUSIC-N model initiated by Max Mathews at the Bell Labs. Its development continued throughout the 1990s and 2000s, led by John ffitch at the University of Bath.

The first documented version 5 release is version 5.01 on March 18, 2006. Many developers have contributed to it, most notably Istvan Varga, Gabriel Maldonado, Robin Whittle, Richard Karpen, Michael Gogins, Matt Ingalls, Steven Yi, Richard Boulanger, and Victor Lazzarini. Developed over many years, it currently has nearly 1700 unit generators. Csound code[edit] Csound takes two specially formatted text files as input. The orchestra and score files may be unified into a single structured file using markup language tags (a CSD file with filename extension .csd). Csound 5[edit] Csound 6[edit] A bison/flex based parser for the Csound language is now standard. Dm-0804lamb-pdf.pdf (Objet application/pdf)

Entreprise Integration patterns Framework

HTML5. RIA. Android. Unix/Linux. J2EE. Cloud computing.