"xml" entries

Building C# objects dynamically

Using ExpandoObject to create objects that you can add properties, methods, and events to.

Buy “C# 6.0 Cookbook” in early release.
Editor’s note: This is an excerpt from “C# 6.0 Cookbook,” by Jay Hilyard and Stephen Teilhet. It offers more than 150 code recipes to common and not-so-common problems that C# programmers face every day. In it, you’ll find recipes on asynchronous methods, dynamic objects, enhanced error handling, the Rosyln compiler, and more.

Problem

You want to be able to build up an object to work with on the fly at runtime.

Solution

Use ExpandoObject to create an object that you can add properties, methods, and events to and be able to data bind to in a user interface.

We can use ExpandoObject to create an initial object to hold the Name and current Country of a person.

dynamic expando = new ExpandoObject();
expando.Name = "Brian";
expando.Country = "USA";

Once we have added properties directly, we can also add properties to our object in a more dynamic fashion using the AddProperty method we have provided for you. One example of why you might do this is to add properties to your object from another source of data. We will add the Language property.

Read more…

The Once and Future SVG

Plugin-free vector graphics are now easier than ever before

spline

Thirteen years ago, in 2001, the World Wide Web Consortium (W3C) finalized the specification for Scalable Vector Graphics, version 1.0. A few months later, in early 2002, O’Reilly published the original SVG Essentials, describing both the basics and the wonderful potential of SVG. An open standard for vector graphics, with support for scripting and animation, was an area of boundless possibility.

From some perspectives, not much has changed. The official SVG specification is still at version 1.1, which was released in 2003 and edited in 2011. Neither update introduced new features to SVG, instead focusing on improving clarity and consistency in the details.

In practice, however, SVG has changed considerably. There are numerous tools for creating SVG, both full-featured graphics programs and online widgets. Most importantly, nearly every web browser out there treats SVG as a first-class citizen (some outdated mobile and Internet Explorer versions being exceptions), displaying SVG as an interactive part of your document with no need for plug-ins.

Read more…

What every Java developer needs to know about Java 9

Introducing updated HTTP client support and JSON API integration.

What every Java developer needs to know about Java 9Java 8 may only have been released a few months ago, but Oracle has already announced the first set of features that will be targeted for Java 9. On August 11th, Mark Reinhold, a Chief Architect for Java, made available an initial feature set to subscribers on the jdk9-dev mailing list.

The crop of features are being run under a relatively new process, known as Java Enhancement Proposals (JEP). This process allows new language and VM features to be prototyped and explored without the full weight of the normal Java standardization process, although the expectation is that suitable, successful JEPs would go on to formal standardization. There will, of course, be many other new features that will be introduced in Java 9, but in this post we are going to focus on two major enhancements — and examine how they relate to features added in Java 7 and 8.

Read more…

The agile upside of XML

Anna von Veh and Mike McNamara on the benefits of XML and the tech-driven future of publishing.

Frankfurt TOC presenters Anna von Veh, a consultant at Say Books, and Mike McNamara, managing director at Araman Consulting Ltd & Outsell-Gilbane UK Affiliate, discuss xml workflows, the (sorry) state of ebook design, and how books and the web will evolve.

Four short links: 3 December 2010

Four short links: 3 December 2010

Snake Oil, JSON v XML, Pac Man, and the Full Stack

  1. Data is Snake Oil (Pete Warden) — data is powerful but fickle. A lot of theoretically promising approaches don’t work because there’s so many barriers between spotting a possible relationship and turning it into something useful and actionable. This is the pin of reality which deflates the bubble of inflated expectations. Apologies for the camel’s nose of rhetoric poking under the metaphoric tent.
  2. XML vs the Web (James Clark) — resignation and understanding from one of the markup legends. I think the Web community has spoken, and it’s clear that what it wants is HTML5, JavaScript and JSON. XML isn’t going away but I see it being less and less a Web technology; it won’t be something that you send over the wire on the public Web, but just one of many technologies that are used on the server to manage and generate what you do send over the wire. (via Simon Willison)
  3. Understanding Pac Man Ghost BehaviourThe ghosts’ AI is very simple and short-sighted, which makes the complex behavior of the ghosts even more impressive. Ghosts only ever plan one step into the future as they move about the maze. Whenever a ghost enters a new tile, it looks ahead to the next tile that it will reach, and makes a decision about which direction it will turn when it gets there. Really detailed analysis of just one component of this very successful game. (via Hacker News)
  4. The Full Stack (Facebook) — we like to think that programming is easy. Programming is easy, but it is difficult to solve problems elegantly with programming. I like to think that a CS education teaches you this kind of “full stack” approach to looking at systems, but I suspect it’s a side-effect and not a deliberate output. This is the core skill of great devops: to know what’s happening up and down the stack so you’re not solving a problem at level 5 that causes problems at level 3.

The gravitational pull of information

Bob Boiko on why designers and programmers should converge around content.

Content creators, designers and programmers all speak slightly different languages. Bob Boiko believes that a focus on information — its structure and its delivery — can get everyone on the same page.

Four short links: 8 October 2010

Four short links: 8 October 2010

Training Tricks, Visualizing Code, ASM+XML=ASMXML, and Poetic License

  1. Training Lessons Learned: Interactivity (Selena Marie Deckelmann) — again I see parallels between how the best school teachers work and the best trainers. I was working with a group of people with diverse IT backgrounds, and often, I asked individuals to try to explain in their own words various terms (like “transaction”). This helped engage the students in a way that simply stating definitions can’t. Observing their fellow students struggling with terminology helped them generate their own questions, and I saw the great results the next day – when students were able to define terms immediately, that took five minutes the day before to work through.
  2. Software Evolution Storylines — very pretty visualizations of code development, inspired by an xkcd comic.
  3. asmxml — XML parser written in assembly language. (via donaldsclark on Twitter)
  4. Poetic License — the BSD license, translated into verse. Do tractor workers who love tractors a lot translate tractor manuals into blank verse? Do the best minds of plumber kid around by translating the California State Code into haikus? Computer people are like other people who love what they do. Computer people just manipulate symbols, whether they’re keywords in Perl or metrical patterns in software licenses. It’s not weird, really. I promise.
Four short links: 1 June 2010

Four short links: 1 June 2010

Legal XML, Big Social Data, Crowdsourcing Tips, Copyright Balkanization

  1. XML in Legislature/Parliament Environments (Sean McGrath) — quite detailed background on the use of XML in legislation drafting systems, and the problems caused by convention in that world–page/line number citations, in particular. (Quick gloat: NZ’s legislature management system is kick-ass, and soon we’ll switch from print authoritative to digital authoritative)
  2. Large-Scale Social Media Analysis with HadoopIn this tutorial we will discuss the use of Hadoop for processing large-scale social data sets. We will first cover the map/reduce paradigm in general and subsequently discuss the particulars of Hadoop’s implementation. We will then present several use cases for Hadoop in analyzing example data sets, examining the design and implementation of various algorithms with an emphasis on social network analysis. Accompanying data sets and code will be made available. (via atlamp on Delicious)
  3. Breaking Monotony with Meaning; Motivation in Crowdsourcing Markets (Crowdflower) — This finding has important implications for those who employ labor in crowdsourcing markets. Companies and intermediaries should develop an understanding of what motivates the people who work on tasks. Employers must think beyond monetary incentives and consider how they can reward workers through non-monetary incentives such as by changing how workers perceive their task. Alienated workers are less likely to do work if they don’t know the context of the work they are doing and employers may find they can get more work done for the same wages simply by telling turkers why they are working.
  4. Balkanizing the WebThe very absurdity of the global digital system is revealing itself. It created all the instruments for global access and, then, turned around and arbitrarily restricted its commercial use, paving the way for piracy. Think about it: our broadband networks now allow seamless streaming of films, TV shows, music and, soon, of a variety of multimedia products; we have created sophisticated transaction systems; we are getting extraordinary devices to enjoy all this; there is a growing English-speaking population that, for a significant part of it, is solvent and eager to buy this globalized culture and information. But guess what? Instead of a well-crafted, smoothly flowing distribution (and payment) system, we have these Cupertino, Seattle or Los Angeles-engineered restrictions. The U.S. insists on exporting harsh copyright penalties and restrictions, while not exporting license agreements and Fair Use, so the rest of the world gets very grumpy.

An Open, Webby, Book-Publishing Platform

This short article outlines some ideas about an open source, online platform for making books, based on WordPress.

Some Tasty Bits from the StartWithXML UK Survey

We've got some raw results from the StartWithXML survey in the UK, and they are very different in some respects from the US survey we did. Some salient points:48.7% of the respondents were in the STM market, followed by trade (24.4%) and college (16%).The bulk of respondents were from large houses – 50.4% – and the rest were evenly divided…