ENTRIES TAGGED "javascript"

5 reasons to learn D3

D3 doesn’t stand for data-design dictator

Designers and developers making data visualizations on the web are buzzing about d3.js. But why? Read more…

Comment: 1

I just slipped on a banana peel named “this”

Keeping track of this in your JavaScript code

In JavaScript, the special variable this is used to refer an object. But which object this refers too depends on the code you’re executing and how this is used. So, a common problem for those learning JavaScript is keeping track of the value of this in different situations. You can be happily testing your code, and then – bam! Suddenly, things stop working, and you’re wondering what happened, not realizing that you’re assuming this is set to one value, when in fact, it’s an entirely different value. And, bugs caused by confusion about this are notoriously difficult to track down.
Read more…

Comment: 1
Four short links: 12 May 2014

Four short links: 12 May 2014

Design Review, Open Source IDS, Myths of Autonomy, and Rich Text Widget

  1. Questions I Ask When Reviewing a Design (Jason Fried) — a good list of questions to frown and stroke one’s chin while asking.
  2. Bro — open source network security monitor/IDS.
  3. Seven Deadly Myths of Autonomy (PDF) — it’s easy to fall prey to the fallacy that automated assistance is a simple substitute or multiplier of human capability because, from the point of view of an outsider observing the assisted human, it seems that—in successful cases, at least—the people are able to perform the task faster or better than they could without help. In reality, however, help of whatever kind doesn’t simply enhance our abilities to perform the task: it changes the nature of the task.
  4. Quill — open source in-browser rich text editor. People, while you keep making me type into naked TEXTBOX fields, I’m going to keep posting links to these things.
Comment

What is that upside-down tree doing in my browser?

Start using JavaScript to create dynamic web pages by updating the DOM.

The secret to getting your web pages to do your bidding with code is to use JavaScript to manipulate the Document Object Model, or DOM. The DOM is an upside-down tree-like structure that the browser uses to represent your web page internally, and it’s by getting and setting values in the DOM that you can modify your web page in response to users doing things like clicking a button, moving the mouse, or dragging an element around.

Getting started with the DOM is easy once you understand how the browser translates your HTML into this internal structure made of objects. Once these objects are created, then you can manipulate them using a wide variety of properties and methods, to change the content of an element, to add a style to an element, or even remove an element from the page completely.

Read more…

Comment: 1
Four short links: 7 May 2014

Four short links: 7 May 2014

Internet Broadband, Open Radio, Excel Formulae in JS, and Block Chains

  1. Observations of an Internet MiddlemanFive of those congested peers are in the United States and one is in Europe. There are none in any other part of the world. All six are large Broadband consumer networks with a dominant or exclusive market share in their local market. In countries or markets where consumers have multiple Broadband choices (like the UK) there are no congested peers. Relevant as competition works for gigabit fibre to consumers.
  2. Open TXopen source firmware for RC radio transmitters. The firmware is highly configurable and brings much more features than found in traditional radios.
  3. formula.js — Excel formulae in Javascript. Waiting for someone to write a Apple 1 emulator in them.
  4. Minimum Viable Block ChainThe block chain is agnostic to any “currency”. In fact, it can (and will) be adapted to power many other use cases. As a result, it pays to understand the how and the why behind the “minimum viable block chain”.
Comment

Wait, where is my variable defined?

Learn JavaScript scope so you always know where your variables are defined

You may have noticed that Head First JavaScript Programming is released! Now that the book is done, we’ve got a few more Head First JavaScript Programming teasers for you. The book is aimed at those of you who are learning JavaScript from the ground up, and our goal with these teasers is to tease out a few characteristics of the language that might surprise you, trip you up, or that you might want to pay special attention to as you learn.

Whether you’re coming to JavaScript from another language, or you’re learning JavaScript as your first language, the way scope works — that is, when and where your variables are defined — might surprise you. Scope in JavaScript isn’t always intuitive, and it’s easy to make some simple mistakes that can cause your code to work in unexpected ways.

Read more…

Comment
Four short links: 30 April 2014

Four short links: 30 April 2014

Critical Making, Torrent Filesystem, Testing Infrastructure, and Reproducible Research

  1. Critical Making — essays from 70 contributors looking at the politics, choices, and ethics of a lot of the makery going on.
  2. torrent-mount — mount a torrent as a filesystem in real time using Javascript. (via Joe McCann)
  3. Continuous Integration for Infrastructure — slides on the emerging tools for large-scale automated testing integrated into development and deployment workflow.
  4. Implementing Reproducible Research — book by Victoria Stodden and Johanna Cohoon on tools, practices, and platforms for making science that others can verify (another step in improving velocity and quality of scientific research).
Comment
Four short links: 25 April 2014

Four short links: 25 April 2014

IoT UX, Tilty Library, Local Govt Dashboard, and SF Dreams

  1. UX of the Internet of Things — a Pinterest board of IoT designs and experience.
  2. parallax.js — Javascript library for tilt, shake, etc. interactivity on iPad. NICE demo.
  3. Gov.UK Local Government Dashboard Prototype is Live — not glorious, but making the move from central to local government is super-important. (via Steve Halliday)
  4. How America’s Leading Science Fiction Authors are Shaping Your Future (Smithsonian) — SF writers create our dreams. “Techno-optimists have gone from thinking that cheap nuclear power would solve all our problems to thinking that unlimited computing power will solve all our problems,” says Ted Chiang, who has explored the nature of intelligence in works such as The Lifecycle of Software Objects. “But fiction about incredibly powerful computers doesn’t inspire people the same way that fiction about large-scale engineering did, because achievements in computing are both more abstract and more mundane.”
Comment
Four short links: 22 April 2014

Four short links: 22 April 2014

In-Browser Data Filtering, Alternative to OpenSSL, Game Mechanics, and Selling Private Data

  1. PourOver — NYT open source Javascript for very fast in-browser filtering and sorting of large collections.
  2. LibreSSL — OpenBSD take on OpenSSL. Unclear how sustainable this effort is, or how well adopted it will be. Competing with OpenSSL is obviously an alternative to tackling the OpenSSL sustainability question by funding and supporting the existing OpenSSL team.
  3. Game Mechanic Explorer — helps learners by turning what they see in games into the simple code and math that makes it happen.
  4. HMRC to Sell Taxpayers’ Data (The Guardian) — between this and the UK govt’s plans to sell patient healthcare data, it’s clear that the new government question isn’t whether data have value, but rather whether the collective has the right to retail the individual’s privacy.
Comment

5 ways developers win with PaaS

Powering your app with open source and OpenShift

Getting Started with OpenShift As a software developer, you are no doubt familiar with the process of abstracting away unnecessary detail in code — imagine if that same principle were applied to application hosting. Say hello to Platform as a Service (PaaS), which enables you to host your applications in the cloud without having to worry about the logistics, leaving you to focus on your code. This post will discuss five ways in which PaaS benefits software developers, using the open source OpenShift PaaS by Red Hat as an example.

No More Tedious Config Tasks

Most of us don’t become developers to do system administration, but when you are running your own infrastructure you end up doing exactly that. A PaaS can take that pain away by handling pesky config and important security updates for you. As a bonus, it makes your sys admin happy too by allowing you to provision your own environment for that killer new app idea you want to tinker with, rather than nagging them for root access on a new VM.

On OpenShift, it goes like this: let’s say you decide you want to test an idea for a Java app, using Tomcat and PostgreSQL (yes, we could argue about the merits of those choices, but work with me here). You can spin that up with a one-line terminal command:

That -s on the end is telling the platform to make the app auto-scaling, which I will elaborate on later; yes, that’s all it takes. RHC (Red Hat Cloud) is just a Ruby Gem wrapping calls to the OpenShift REST API. You could also use the OpenShift web console or an IDE plugin to do this, or call the API directly if that’s how you roll. The key technologies in play here are just plain old Git and SSH — there’s nothing proprietary.

Read more…

Comment