Tutorial: HTML Templates with Mustache.js When developing modern HTML applications, you often write a lot of HTML fragments programmatically. You concatenate HTML tags and dynamic data, and insert the resulting UI markup into the DOM. Here is a random code example of this approach: The proliferation of this kind of code throughout your application comes with some downsides. Mustache is a “logic-less” template syntax. In this article, we take a quick tour of some of the capabilities of Mustache.js. To start using Mustache.js, simply add a script tag to your html file pointing to mustache.js which is available here. You can run all the examples below here. Sample 1: Basic Template This is a self-explanatory example. Instead of being defined in a variable, the data often comes from a service call (see sample 2)Instead of being defined in a variable, the template is often read from a file (see sample 3) Result: Blog: Sample 2: Basic Template using Ajax data Blog: Sample 3: Externalized Template
Hypertext Preprocessor Apps, Tablets and Usability The current trend towards flat design presents a real threat to the usability on tablets, a recent study from researchers at the Neilson Norman Group (NNG) has found. The latest study was one of six to be carried out on usability and, while it was found that tablet usability is improving, there are still issues such as poor gestures, rescaled design and workflow. While for the most part the study found that sites in general tend to work reasonably well, the biggest issue with usability was found to lie in apps. However, with sites it’s not a huge issue and for the most part those the study looked at only needed “limited adjustment” to suit most tablets. This means that with regard to responsive sites, “tablet usability is reasonably solid” and has really improved recently, but apps are a different story. Testing, testing … The study tested apps on a variety of tablets, from first generation iPads to the latest Android and even some Windows devices. Do you need an app? Common app user issues
Debian -- The Universal Operating System Using CSS gradients - Web developer guide CSS gradients are new types of <image> added in the CSS3 Image Module. Using CSS gradients lets you display smooth transitions between two or more specified colors. This lets you avoid using images for these effects, thereby reducing download time and bandwidth usage. In addition, because the gradient is generated by the browser, objects with gradients look better when zoomed, and you can adjust your layout much more flexibly. Browsers support two types of gradients: linear, defined with the linear-gradient() function, and radial, defined with radial-gradient(). Linear gradients To create a linear gradient, you set a starting point and a direction (specified as an angle) along which the gradient effect is applied. Simple linear gradients Here's a linear gradient that starts at the center (horizontally) and top (vertically), and starts blue, transitioning to white. background: -prefix-linear-gradient(top, blue, white); background: linear-gradient(to bottom, blue, white); Using angles Size
Home - Pencil Project Software Language Processing Suite — Grammar zoo The objective of the Grammar Zoo is to accumulate grammars of various software languages, extracted and recovered from language documentation, parser specifications and other artefacts and make them available in a range of formats. 569 grammars and counting Abstract Behavioral Specification Language Source: HATS team, Grammar definition for the ABS language, (May 2012) [ReadMe] [ABS Tool Suite] [GitHub] [GitHub] Extracted grammar: [Browsable] [BGF] [EBNF] [DMS BNF] [SDF]Tagged with: language:ABS src:HATS tol0:private tol1:rscs2bgf author:HATS team extraction:rascal-sdUsed tools: [Rascal SD⇒BGF] Ada Ada 95 — Ada 2005 Ada 95 (4 grammars) Ada 2005 (2 grammars) Source: International Standard ISO/IEC 8652/1995(E) with Technical Corrigendum 1 and Amendment 1, Ada 2005 Reference Manual. API2MoL API2MoL API2MoL (2 grammars) Assembly Delphi Assembler Delphi Assembler Source: Jorge L. Basic Visual Basic concrete syntax — Visual Basic abstract syntax Visual Basic concrete syntax Source: James R. BibTeX
Ausdroid | Welcome home Evolve your own beats: automatically generating music via algorithms - Vik's Blog Update: you can find the next post in this series here. I recently went to an excellent music meetup where people spoke about the intersection of music and technology. One speaker in particular talked about how music is now being generated by computer. Music has always fascinated me. It can make us feel emotions in a way few media can. Sadly, I have always been unable to play an instrument well. I opted to pursue a strategy that "evolves" music out of other pieces of music. I'm going to broadly outline the keys to my strategy below. We can easily acquire music that is already categorized (ie labelled as classical/techno/electronic, etc)We can teach a computer to categorize new music automatically.Teaching a computer to categorize music automatically will give us a musical quality assessment tool (patent pending on the MQAT!) Here are some samples of the computer generated music. So, how did you do it? Unfortunately, these tracks were in .mp3 format. Training the algorithm Splicing/Remixing
Debugging Mobile with jsconsole Web development for mobile devices has several major limitations. There are strongly divergent screen resolutions (from iPad to the first generation of Blackberry), multiple browsers (webkit but also IEMobile, Firefox, Opera mini and mobile, etc.) and multiple operating systems (Windows Phone, Android, iOS, Palm, Blackberry). Each device has its own constraints and performance. When it comes time to debug all this, the task is not easy because there are only few tools permitting it – and because of the size of the screen, even then we are not out of the woods. Dragonfly for Opera already offers a native solution for remote debugging, but this technique is quite limited, especially when one has to take into account other mobile / browsers. Several phone manufacturers also offer emulators, but they don’t compare to the use of a real device offering ”feel and touch” – especially on the side of the web-client programming, and especially JavaScript. A JavaScript Console for Mobile :listen