background preloader

JSON: What It Is, How It Works, & How to Use It

JSON: What It Is, How It Works, & How to Use It
This week I want to cover a topic that I feel has become an important part of any developer’s toolkit: the ability to load and manipulate JSON feeds from other sites via AJAX. Many sites are sharing data using JSON in addition to RSS feeds nowadays, and with good reason: JSON feeds can be loaded asynchronously much more easily than XML/RSS. This article will cover the following: What is JSON? We’ll also use our newfound skills with JSON at the end of this project to build a quick app that loads photos from Flickr without requiring a page refresh. What Is JSON? JSON is short for JavaScript Object Notation, and is a way to store information in an organized, easy-to-access manner. Storing JSON Data As a simple example, information about me might be written in JSON as follows: This creates an object that we access using the variable jason. Storing JSON Data in Arrays Summary

blog.pyjeon.com Playing with JQuery Validation library | Elegant Code New job (2 weeks in), new responsibilities, new tools to play with. Amazingly (for me), one of the new tools is the JQuery Validation Library. My diving into this also coincides with ScottGu’s announcement that Microsoft is creating their own CDN for JQuery and JQuery Validation. Bad news is that this means I’m behind. That sucks. I was using JQuery MONTHS before Microsoft officially started supporting it (at least 6 months – but I’m too lazy to look it up). And you can add the JQuery Validation library like this: Note: see those end tags, great annoyance of my life, but you have to have them, you can’t do <script src=” />. Anyway, back to validation. The more I play with this library, the more I like it. Getting Started with JQuery Validation: The JavaScript Way: OK, assuming you have JQuery and the JQuery Validation library included, lets start with a simple customer form: 1: <form id="CustomerForm"> 2: <p> 3: <label for="firstNameEdit">First Name:</label> 5: </p> 6: <p> 9: </p>

Why Arc Isn't Especially Object-Oriented There is a kind of mania for object-oriented programming at the moment, but some of the smartest programmers I know are some of the least excited about it. My own feeling is that object-oriented programming is a useful technique in some cases, but it isn't something that has to pervade every program you write. You should be able to define new types, but you shouldn't have to express every program as the definition of new types. I think there are five reasons people like object-oriented programming, and three and a half of them are bad: Object-oriented programming is exciting if you have a statically-typed language without lexical closures or macros. I personally have never needed object-oriented abstractions. Maybe I'm just stupid, or have worked on some limited subset of applications.

jQuery Enlightenment | by Cody Lindley | 1st Edition | based on jQuery 1.3.2 Python to Javascript translation I'm currently doing a project with a backend in Python and a client mostly in Javascript -- still not public, but if everything turns out right I'll post about it later on -- and there are some algorithms I'd like to reuse in both, but without going to a full Python in browser style (such as Pyjs or brython)... Ideally I'd like something like Coffescript (but with a Python-like syntax so that a subset of Python can be used for both Python and Javascript generation). -- Sidenote: I decided I really have to grasp Javascript in order to find out how things work before trying an alternative language which compiles down to Javascript -- so far my experience has been nice.

60+ .NET libraries every developer should know about. Every good developer knows never to re-invent the wheel, especially if there is software out there that has been tested by others, and has an established track record. As a developer using the .NET framework I’ve found some of these libraries invaluable, so I’m sharing them for some of the other dev’s out there with a brief outline of how to use. Yedda Twitter Library. URL: I’ve used this on a number of very simple twitter projects, where I’ve just needed to send an update. Dim objYedda As New Yedda.TwitterDim status as StringDim strTwitterUser as String = “username”Dim strTwitterPassword as String = “password”status = “Hello World”objYedda.Update(strTwitterUser, strTwitterPassword, strStatus, Yedda.Twitter.OutputFormatType.RSS) This small section of code will update your Twitter stream (provided you have a reference to the DLL), and your username and password correct. FileHelpers Library URL: Elmah Ajax

VI tutorial for beginners Overview and main commands There are so many text editors on *nix systems, but VI is surely the most widespread. VI stands for VIsual editor and VIM is an improved version of VI. You can find VI in any Linux distribution, in Unix and Mac Os X systems. 1) command mode 2) row editing mode 3) input mode To run VI, open a Terminal window and type 'vi something'. 1) vi myfile (you are creating the myfile file) 2) press 'a' to enter input mode and type 'this is a simple text file' 3) now press ':' to enter row editing mode and type 'w!' You can move from input mode to command mode or from row editing mode to command mode by pressing the Esc key. Main command mode commands Main row editing mode commands :w -> write the file :w myfile -> write the file as 'myfile' :q -> quit the file :wq -> write and quit the file :q! (Page 1 of 1) Index DISCLAIMER: Any named products on this website are copyright © and/or trademarks ® of their respective companies.

Java Skein 512-512 Java Here are two Java implementations of the Skein 512-512 hash algorithm. Both implementations are relatively small, and compatible with the revised (version 1.3) test vectors and reference implementation. Skein512.java is optimize for speed. 151 MB/s on a MacBook Pro, 2.53 GHz Intel Core 2 Duo; Java 1.6, server mode. Skein512Small.java is optimize for size (32 lines). Test.java and testVectors.txt (3 MB) tests for both implementations. Scala The Scala implementation is based on the small Java implementation. Test.scala and Skein512.scala. Javascript Here is a Javascript implementations of the Skein 1.3 512-512 hash algorithm. To view the source code of the implementation, click 'View' 'Page Source'. Message (hex): Result: Public Domain This algorithm and source code is released to the public domain. Feedback For questions, improvements, or remarks, send an email to "db support" (one word) at "h2 database" (one word) dot com. Changelog Contribute a better translation

Text Processing Commands sort File sorter, often used as a filter in a pipe. This command sorts a text stream or file forwards or backwards, or according to various keys or character positions. Using the -m option, it merges presorted input files. tsort Topological sort, reading in pairs of whitespace-separated strings and sorting according to input patterns. uniq This filter removes duplicate lines from a sorted file. The useful -c option prefixes each line of the input file with its number of occurrences. The sort INPUTFILE | uniq -c | sort -nr command string produces a frequency of occurrence listing on the INPUTFILE file (the -nr options to sort cause a reverse numerical sort). Example 12-8. expand, unexpand The expand filter converts tabs to spaces. The unexpand filter converts spaces to tabs. cut A tool for extracting fields from files. Using cut to obtain a listing of the mounted filesystems: Using cut to list the OS and kernel version: Using cut to extract message headers from an e-mail folder: paste join head tail

Related: