ENTRIES TAGGED "web"

Dos and don’ts in JavaScript

A few best practices for when you're learning the language

With every programming language, there’s a list of do’s and don’ts and JavaScript is no exception. Some of these best practices are there for your protection (like always always always using semi-colons!); some to make your code more readable and less error-prone; and some to increase the efficiency of your code. Read more…

Comment

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: 2 May 2014

Four short links: 2 May 2014

Collaborative Neighbourhood Storytelling, Chrome Evil, Responsive Web Instruction, and Open Source Packet Processing

  1. NewsPad: Designing for Collaborative Storytelling in Neighborhoods (PDF) — Microsoft Research report about tests of a tool to address needs in community reporting.
  2. Burying the URL — makes you suspect that “users interact with the web directly instead of via Google” is the #1 bug in Chrome’s issue tracker.
  3. Web Fundamentals — Google steering developers to making responsive sites, showing workflow for styling such that you can get sites that look good on all screens.
  4. snabbswitchopen source packet processing for ISPs.
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: 28 April 2014

Four short links: 28 April 2014

Retail Student Data, Hacking Hospitals, Testing APIs, and Becoming Superhuman

  1. UK Government to Sell Its Students’ Data (Wired UK) — The National Pupil Database (NPD) contains detailed information about pupils in schools and colleges in England, including test and exam results, progression at each key stage, gender, ethnicity, pupil absence and exclusions, special educational needs, first language. The UK is becoming patient zero for national data self-harm.
  2. It’s Insanely Easy to Hack Hospital Equipment (Wired) — Erven won’t identify specific product brands that are vulnerable because he’s still trying to get some of the problems fixed. But he said a wide cross-section of devices shared a handful of common security holes, including lack of authentication to access or manipulate the equipment; weak passwords or default and hardcoded vendor passwords like “admin” or “1234″; and embedded web servers and administrative interfaces that make it easy to identify and manipulate devices once an attacker finds them on a network.
  3. Postman — API testing tool.
  4. App Controlled Hearing Aid Improves Even Normal Hearing (NYTimes) — It’s only a slight exaggeration to say that the latest crop of advanced hearing aids are better than the ears most of us were born with. Human augmentation with software and hardware.
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
Four short links: 4 April 2014

Four short links: 4 April 2014

MSFT Opening, Declarative Web, Internet Utility, and Design Fiction Reading List

  1. C# Compiler Open Sourced — bit by the bit, the ship of Microsoft turns.
  2. The Web’s Declarative Composable Future — this. For the first time since 1993, I feel like the web platform is taking a step towards being a real platform (vs simply bolting features on the side).
  3. Why the Government Should Provide Internet Access — video interview with Susan Crawford about why the Internet should be treated like a utility. She’s the only policy person I see talking sense. There’s a multilarity coming, when a critical mass of everyday objects are connected to each other via the Internet and offline devices become as useful as an ox-drawn cart on railway tracks. At that point it’s too late to argue you need affordable predator-proof Internet, because you’re already over the (sensing, e-ink covered, Arduino-powered) barrel. (via BoingBoing)
  4. Design Fiction: A BibliographySome resources about design fiction I’m use to share with students.
Comment
Four short links: 3 April 2014

Four short links: 3 April 2014

Github for Data, Open Laptop, Crowdsourced Analysis, and Open Source Scraping

  1. dat — github-like tool for data, still v. early. It’s overdue. (via Nelson Minar)
  2. Novena Open Laptop — Bunnie Huang’s laptop goes on sale.
  3. Crowd Forecasting (NPR) — How is it possible that a group of average citizens doing Google searches in their suburban town homes can outpredict members of the United States intelligence community with access to classified information?
  4. Portia — open source visual web scraping tool.
Comment: 1