<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>webr3.org &#187; PHP</title>
	<atom:link href="http://webr3.org/blog/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://webr3.org/blog</link>
	<description>brain&#039;s on fire!</description>
	<lastBuildDate>Tue, 19 Jul 2011 15:38:29 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Opening Linked Data</title>
		<link>http://webr3.org/blog/linked-data/opening-linked-data/</link>
		<comments>http://webr3.org/blog/linked-data/opening-linked-data/#comments</comments>
		<pubDate>Fri, 26 Nov 2010 11:51:29 +0000</pubDate>
		<dc:creator>nathan</dc:creator>
				<category><![CDATA[linked data]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[Blank node]]></category>
		<category><![CDATA[Computer file formats]]></category>
		<category><![CDATA[Computing]]></category>
		<category><![CDATA[Data management]]></category>
		<category><![CDATA[dom]]></category>
		<category><![CDATA[FOAF]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[King]]></category>
		<category><![CDATA[Knowledge representation]]></category>
		<category><![CDATA[Markup languages]]></category>
		<category><![CDATA[Metadata]]></category>
		<category><![CDATA[Open Data]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Procedural programming languages]]></category>
		<category><![CDATA[rdf]]></category>
		<category><![CDATA[RDF Schema]]></category>
		<category><![CDATA[RDF/XML]]></category>
		<category><![CDATA[RDFa]]></category>
		<category><![CDATA[registered media]]></category>
		<category><![CDATA[Resource Description Framework]]></category>
		<category><![CDATA[sem web community]]></category>
		<category><![CDATA[Semantic HTML]]></category>
		<category><![CDATA[semantic web]]></category>
		<category><![CDATA[Technology/Internet]]></category>
		<category><![CDATA[the king]]></category>
		<category><![CDATA[Turtle]]></category>
		<category><![CDATA[Twitter Inc]]></category>
		<category><![CDATA[typical web developer]]></category>
		<category><![CDATA[Uniform Resource Identifier]]></category>
		<category><![CDATA[URI scheme]]></category>
		<category><![CDATA[web developer]]></category>
		<category><![CDATA[Web Developers]]></category>
		<category><![CDATA[Web services]]></category>
		<category><![CDATA[web standard format]]></category>
		<category><![CDATA[Web standards]]></category>
		<category><![CDATA[World Wide Web]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://webr3.org/blog/?p=390</guid>
		<description><![CDATA[Linked Data has done fantastically well so far, but, compared to how well it could be doing, given the calibre and amount of data that's been opened up, it's not doing too well at all.
Why? well the sem web community is packed full of the most technically skilled and decent people I've come across so [...]]]></description>
			<content:encoded><![CDATA[<p>Linked Data has done fantastically well so far, but, compared to how well it could be doing, given the calibre and amount of data that's been opened up, it's not doing too well at all.</p>
<p>Why? well the sem web community is packed full of the most technically skilled and decent people I've come across so far, so it can't be that, the tooling is pretty damn good, there's loads of data, most of the data's of a high quality, wanted by developers, and certainly more than usable. The concepts, theory and technical aspects are all solid as a rock. In short it's all good, apart from one rather important detail.</p>
<p>Our Linked Open Data isn't really open data, not in the eyes of the common web developer at least. To most web developers on the planet, open data is something they can get access to and use easily.</p>
<p>A good example of 'open data' for most developers, is the Twitter API.</p>
<p>Here's how a developer accesses it in PHP:</p>
<pre><code>  $uri = 'http://api.twitter.com/1/statuses/show/7907258268647424.json';
  $tweet = json_decode(file_get_contents($uri));
  echo $tweet->user->description;
</code></pre>
<p>Here's how they access it in Javascript:</p>
<pre><code>  uri = 'http://api.twitter.com/1/statuses/show/7907258268647424.json';
  $.getJSON(uri, function(tweet) {
    write( tweet.user.description );
  });
</code></pre>
<p>The reality of the matter is that you can't do this with Linked Open Data, and that's because you can't do it with RDF - and really, honestly, if it's not that simple, the masses won't use it, because, if it's not that simple, they <i>can't</i> use it.</p>
<h3>The problems with the RDF formats</h3>
<p>They're not perfect, and they are a very mixed bunch, for a change, let's look at the negatives.</p>
<p><strong>RDF/XML</strong><br />
 - Requires full XML tooling<br />
 - Can't read or write by hand<br />
 - butt ugly</p>
<p>Let's be honest, unless you have a full XML and RDF stack and you know what you're doing, RDF/XML is simply a no go zone.</p>
<p><strong>RDFa</strong><br />
 - Requires HTML/DOM/XML tooling<br />
 - An extension to a markup language, designed to augment annotated documents.</p>
<p>RDFa is great, but not for the general <i>data</i> use case, it's not a simple data interchange format like JSON, and you can't publish or consume it without specialist tooling, in fact it requires an even bigger, more complicated, stack than RDF/XML.</p>
<p><strong>Turtle</strong><br />
 - Requires a custom parser<br />
 - It's not <i>yet</i> seen as a data format by the masses.<br />
 - Doesn't have a registered media type.</p>
<p>If we're all honest, Turtle is the king of RDF serializations, it's small, powerful, easy to write and read, requires minimal tooling to parse. In fact, I'd quite happily say that Turtle is the best all round data format, period.</p>
<p><strong>RDF/JSON and JSON-LD</strong><br />
 - Square peg, round hole</p>
<p>You can't shoe horn RDF in to JSON, no matter how hard you try - well, you <i>can</i>, but you loose all the benefits of JSON in the first place, because the data is RDF, triples and not objects, rdf nodes and not simple values - I fear I'd better explain, quickly:</p>
<p>The benefit of JSON is that you can do the following:</p>
<pre><code>  var u = tweet.user;                                // nested, simple objects
  write(u.message);                                  // simply "a string of text"
  if(u.geo_enabled) {                                // a boolean true
    var d = u.statuses_count * u.favourites_count;   // numbers..
  }
</code></pre>
<p>Anything more complicated than that and you've lost 95% of the benefits of JSON.</p>
<p>Here's the code to do that <code>if(u.geo_enabled)</code> with JSON/RDF:</p>
<pre><code>  var tweet = rdf['http://example.org/tweet/12343'];
  var user = rdf[tweet['http://example.org/property/userid']];
  var geoenabled = user['http://example.org/property/geo_enabled'];
  if( Boolean(geoenabled.value) ) {
</code></pre>
<p>and JSON-LD:</p>
<pre><code>  var tweet, user;
  for(o in jsonld) {
    if(jsonld[o]["@"] == 'http://example.org/tweet/12343') tweet = jsonld[o];
  }
  for(o in jsonld) {
    if(jsonld[o]["@"] == tweet['twit:userid']) user = jsonld[o];
  }
  if(user['twit:geo_enabled']) {
</code></pre>
<p>Remember, those two examples are only for the simple if line from the benefits of JSON example, can you even imagine all four lines?</p>
<p>Clearly, RDF in JSON is of little to no use to anybody, you can see plainly yourself, 95% of the benefits are lost and it's just another RDF serialization that's pretty much unusable without tooling. The only benefit JSON serializations of RDF have, are that you don't require an XML stack, which is quite a large benefit tbh.</p>
<h3>The problem with RDF</h3>
<p>I've been a little unfair there, you see the problem isn't with the serializations, we can't make a "better" serialization of RDF for general web developers, because the <i>real problem</i> is that the data's RDF, it's triples not simple objects, URIs rather than simple terms, RDF Nodes with a language or type, and not just simple values.</p>
<p>An array of RDF triples, or a structure of RDF, just simply isn't usable in most (all?) programming languages, by a typical web developer, without specialist tooling and libraries or APIs.</p>
<p>Am I saying RDF is bad? no of course not, it's awesomely brilliant in every way, it powers a paradigm shift and will have huge positive effects on the web and the human race. You know the score :)</p>
<p>What I am saying, is that we're not backwards compatible, we're not making our data open in formats which are usable by normal developers, developers who need and want the data, want the links, but not the semwebbery. Hell even most of us who are heavy sem web users only consider the ontology+reasoning side enabled by properties-with-uris some of the time, most of the time &lt;http://xmlns.com/foaf/0.1/name> might as well just be "name".</p>
<h3>Opening Linked Data</h3>
<p>So, here's what we need to do, we need to just accept that although we publish linked data as RDF, we also need to publish the data as simple objects so the world can use the data.</p>
<p>Given the linked data:</p>
<pre><code>  @prefix : &lt;http://webr3.org/nathan#> .
  @prefix foaf: &lt;http://xmlns.com/foaf/0.1/> .
  @prefix rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#> .

  :me a foaf:Person;
    foaf:age 29;
    foaf:holdsAccount [ foaf:accountName "webr3";
        foaf:homepage &lt;http://twitter.com/webr3>;
        rdfs:label "Nathan's twitter account"@en ];
    foaf:homepage &lt;http://webr3.org>;
    foaf:knows &lt;http://example.com/bob#me>;
    foaf:name "Nathan";
    foaf:nick "webr3", "nath" .

  &lt;http://example.com/bob#me> a foaf:Person;
    foaf:name "Bob" .</pre>
<p></code></p>
<p>We <strong>also</strong> need to publish it like this:</p>
<pre><code>{
  "http://webr3.org/nathan#me": {
    "a": "http://xmlns.com/foaf/0.1/Person",
    "age": 29,
    "holdsAccount": {
      "accountName": "webr3",
      "homepage": "http://twitter.com/webr3",
      "label": "Nathan's twitter account"
    },
    "homepage": "http://webr3.org",
    "knows": "http://example.com/bob#me",
    "name": "Nathan",
    "nick": [ "webr3", "nath" ]
  },
  "http://example.com/bob#me": {
    "a": "http://xmlns.com/foaf/0.1/Person",
    "name": "Bob"
  }
}</code></pre>
<p>and now one can do: <code>me.holdsAccount.label</code> and get back a string, in any language.</p>
<p><strong>What have we lost?</strong><br />
Well nothing in the grand scheme of things because we're still publishing the RDF in other formats via conneg, however in this specific serialization of the data: we've lost the properties, the .language and the .type, although basic types are still there, dates are detectable, numbers are supported, booleans are supported, everything else is just a PlainLiteral, a string.</p>
<p><strong>What's still there?</strong><br />
The data, <code>http</code> names for things, follow your nose, rdf types ++usable-accessible-data in a web standard format. It's 3.5 if not 4.5 star data!</p>
<p><strong>Other considerations</strong><br />
Probably be wise to allow direct access to a .json URI too, so people can simple-GET the data (in addition to exposing via conneg).</p>
<p>Should be an easy hit, any good reasons why not?</p>
<h3>The other RDF Serializations</h3>
<p>While we're here, there are a few other things that need tidied up, properly.</p>
<p><strong>Turtle</strong><br />
Let's make it <i>the standard</i> RDF serialization, with a proper registered media types of application/turtle and text/turtle, fix any bugs in the spec (if any), and possibly allow an optional comma in those lists (1,2,3).</p>
<p>Let's just accept that RDFa is great, but sometimes you just want to embed a chunk of RDF in an HTML document, you know we all want to on occasion, people are shouting for it, it's easy to do, to deploy, doesn't break anything, and it's a really easy hit - so, in the Turtle standard spec pop a note that shows how to include it in an HTML document.</p>
<pre><code>&lt;script type="text/turtle">
  // turtle in here, as-is, no special encoding
&lt;/script></code></pre>
<p><strong>RDF/XML</strong><br />
Leave it as is, let it run it's course naturally, and in many respects just forget it moving forwards, everybody supports it already, that won't change, but there's approximately zero need to keep pushing it.</p>
<p><strong>RDFa</strong><br />
As awesome as it is, just see it for what it is, RDF in attributes, it's like the missing markup features of HTML, for annotating documents and describing the things described in the documents with annotations. It's not a simple data or RDF format, and it's not <i>really</i> suited to just dropping chunks of machine readable RDF in to an HTML document, Turtle in HTML will do that far better.</p>
<p><strong>RDF/JSON and JSON-LD</strong><br />
Standardize a JSON serialization as a replacement / alternative to XML - but, admit and stipulate before hand that it's not usable as-is, or really writable and is arguably human readable. It simply needs to be a fast, unambiguous, optimized for the machine, RDF serialization - no bells and whistles for humans, no "12^^xsd:type" in a string - just something that you can JSON.parse and run circa 10-20 standardized lines of code over to get back an RDFGraph of RDFTriples.</p>
<p>Fin &#038; end.</p>
]]></content:encoded>
			<wfw:commentRss>http://webr3.org/blog/linked-data/opening-linked-data/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>server side js with v8</title>
		<link>http://webr3.org/blog/experiments/server-side-js-with-v8/</link>
		<comments>http://webr3.org/blog/experiments/server-side-js-with-v8/#comments</comments>
		<pubDate>Sun, 13 Jun 2010 01:09:50 +0000</pubDate>
		<dc:creator>nathan</dc:creator>
				<category><![CDATA[experiments]]></category>
		<category><![CDATA[Apache HTTP Server]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[C]]></category>
		<category><![CDATA[Computer programming]]></category>
		<category><![CDATA[Computer science]]></category>
		<category><![CDATA[Computing]]></category>
		<category><![CDATA[Curly bracket programming languages]]></category>
		<category><![CDATA[Ecma International]]></category>
		<category><![CDATA[ECMAScript]]></category>
		<category><![CDATA[haXe]]></category>
		<category><![CDATA[HTTP]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[JavaScript engine]]></category>
		<category><![CDATA[JavaScript programming language]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Ryan Dahl]]></category>
		<category><![CDATA[Scripting languages]]></category>
		<category><![CDATA[Server-side JavaScript]]></category>
		<category><![CDATA[Software engineering]]></category>
		<category><![CDATA[SSL]]></category>
		<category><![CDATA[V8]]></category>
		<category><![CDATA[Web Sockets]]></category>
		<category><![CDATA[Web Worker]]></category>

		<guid isPermaLink="false">http://webr3.org/blog/?p=363</guid>
		<description><![CDATA[Just logging some thoughts and scoping work..
v8 and server side ecma-262 (javascript) is a fantastic thought, and definitely the future imho (universal language).
To get going and start making server side js web applications there are two good approaches, v8cgi which aims more at letting you run js programs as a cgi app (like you do [...]]]></description>
			<content:encoded><![CDATA[<p>Just logging some thoughts and scoping work..</p>
<p><a href="http://code.google.com/p/v8/">v8</a> and server side <a href="http://www.ecma-international.org/publications/standards/Ecma-262.htm">ecma-262</a> (javascript) is a fantastic thought, and definitely the future imho (universal language).</p>
<p>To get going and start making server side js web applications there are two good approaches, <a href="http://code.google.com/p/v8cgi/">v8cgi</a> which aims more at letting you run js programs as a cgi app (like you do with php cgi) under apache and similar, seems to be picking up speed, nice approach (workable) - the other is <a href="http://nodejs.org/">node.js</a> which is off to a great start as a pure server side environment where 'HTTP is a first class protocol' which just proves what a good start <a href="http://twitter.com/ryah">Ryan Dahl</a> has made.</p>
<p>Briefly to touch on v8, it allows you expose C code to javascript, which is.. well perfect, would be good to see far more lib's exposed to js using tools like <a href="http://code.google.com/p/cproxyv8/">cproxyv8</a> and <a href="http://code.google.com/p/v8-juice/">v8-juice</a> - in particular I'm looking at you <a href="http://librdf.org/">librdf</a> (and an interesting sub-thought, apache and openssl).</p>
<p>Back to node.js, seems to be exciting already has a strong <a href="http://nodejs.org/api.html">API</a> to get some <a href="http://wiki.github.com/ry/node/">great demo's and projects</a> off the ground, and very well aligned with the W3C work (or maybe what-wg..), specifically on the <a href="http://www.whatwg.org/specs/web-workers/current-work/">Web Worker API</a> front; in fact there are already <a href="http://www.web2media.net/laktek/2010/05/04/implementing-web-socket-servers-with-node-js/">implementations of Web Sockets for node.js</a> (and <a href="http://github.com/LearnBoost/Socket.IO-node">socket.io</a>) - <a href="http://github.com/tav/nodelint.js">nodelint (jslint for node)</a> is a handy addition, whilst some projects seem to be <a href="http://www.persvr.org/">going all in, like Persevere</a>.</p>
<p>As for adapting current code to work on the server side, you'll want to be looking in to the <a href="http://wiki.github.com/ry/node/modules">modules</a> .. which.. well to be honest that's a new link I just found, and <a href="http://nodejs.org/api.html">not what I was thinking off</a>.. emm, I think that provides almost everything I need - might be about to jump back in with two feet!</p>
<p>The rest of this post was about to mention <a href="http://phpjs.org/">php.js</a>, <a href="http://www.harmony-framework.com/">harmony framework</a> (Converts PHP 5 code into Javascript), and then <a href="http://ecmascript4.com/">mascara</a> and of course <a href="http://haxe.org/">haxe</a> which compiles to js amongst many other targets.</p>
<p>Might have to come back to this post.. for anybody who follow what I do, thus far I'd figured out that node.js is http+tls friendly, you can get a clients certificate (for <a href="http://esw.w3.org/Foaf%2Bssl">foaf+ssl</a>) and you can send application webid+ssl certs too, although up till now I hadn't found a way to generate certificate (let alone using <a href="http://en.wikipedia.org/wiki/Spkac">spcak</a>) but that could be wrong..</p>
]]></content:encoded>
			<wfw:commentRss>http://webr3.org/blog/experiments/server-side-js-with-v8/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Reading List : Web, Linked Data, REST, Semantic Web</title>
		<link>http://webr3.org/blog/internet/reading-list-web-linked-data-rest-semantic-web/</link>
		<comments>http://webr3.org/blog/internet/reading-list-web-linked-data-rest-semantic-web/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 02:03:17 +0000</pubDate>
		<dc:creator>nathan</dc:creator>
				<category><![CDATA[internet]]></category>
		<category><![CDATA[1.1 Uniform HTTP Protocol]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[Atom Publishing Protocol]]></category>
		<category><![CDATA[Computing]]></category>
		<category><![CDATA[HTTP]]></category>
		<category><![CDATA[Knowledge representation]]></category>
		<category><![CDATA[linked data]]></category>
		<category><![CDATA[Paging]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Query languages]]></category>
		<category><![CDATA[rdf]]></category>
		<category><![CDATA[Reification]]></category>
		<category><![CDATA[Resource]]></category>
		<category><![CDATA[Roy T. Fielding]]></category>
		<category><![CDATA[Roy T. Fielding Dissertation]]></category>
		<category><![CDATA[semantic web]]></category>
		<category><![CDATA[Simple Knowledge Organization System]]></category>
		<category><![CDATA[Software engineering]]></category>
		<category><![CDATA[SPARQL]]></category>
		<category><![CDATA[Technology/Internet]]></category>
		<category><![CDATA[URIs Resources]]></category>
		<category><![CDATA[Web Access Control]]></category>
		<category><![CDATA[Web Architecture]]></category>
		<category><![CDATA[Web Resources     Named Graphs]]></category>
		<category><![CDATA[Web services]]></category>
		<category><![CDATA[Web Tutorial   Mindswap]]></category>
		<category><![CDATA[World Wide Web]]></category>
		<category><![CDATA[write-enabled Web]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://webr3.org/blog/?p=264</guid>
		<description><![CDATA[Personally, I have two types of reading, the posts etc that I "tweet" and then the heavier reading I do over time; this is a list of the latter for the past month - hopefully it'll help somebody who's looking for the same kind of info I have been.
I've grouped all the links in to [...]]]></description>
			<content:encoded><![CDATA[<p>Personally, I have two types of reading, the posts etc that I "tweet" and then the heavier reading I do over time; this is a list of the latter for the past month - hopefully it'll help somebody who's looking for the same kind of info I have been.</p>
<p>I've grouped all the links in to two main sections, and then sub-grouped by how they make sense in my head! :)</p>
<h3>Web, HTTP and REST</h3>
<p>Roy T. Fielding Dissertation - <a href="http://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm" target="_blank">Architectural Styles and the Design of Network-based Software Architectures</a> Of particular relevance and note are chapters 4-6 (many only ever read chapter 5 and miss the context + summary *needed* in chapters 4 and 6!)</p>
<ul>
<li><a href="http://www.ics.uci.edu/~fielding/pubs/dissertation/web_arch_domain.htm" target="_blank"> Chapter 4 - Designing the Web Architecture: Problems and Insights</a></li>
<li><a href="http://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm" target="_blank"> Chapter 5 - Representational State Transfer (REST)</a></li>
<li><a href="http://www.ics.uci.edu/~fielding/pubs/dissertation/evaluation.htm" target="_blank"> Chapter 6 - Experience and Evaluation</a></li>
</ul>
<p><a href="http://roy.gbiv.com/untangled/2008/rest-apis-must-be-hypertext-driven" target="_blank"> Roy T. Fielding - REST APIs must be hypertext-driven</a><br />
<a href="http://www.mail-archive.com/whatwg@lists.whatwg.org/msg12443.html" target="_blank"> Discussion on HTML5 and RESTful HTTP in browsers</a><br />
<a href="http://tech.groups.yahoo.com/group/rest-discuss/message/5168" target="_blank"> Discussion on URIs Resources and Switching content types w/ REST angle (v good)</a></p>
<p><a href="http://www.w3.org/Protocols/rfc2616/rfc2616.html" target="_blank">RFC 2616 HTTP/1.1</a> and the HTTPbis Working Group HTTP/1.1 update in parts:</p>
<ol>
<li><a href="http://tools.ietf.org/html/draft-ietf-httpbis-p1-messaging" target="_blank">Messaging</a></li>
<li><a href="http://tools.ietf.org/html/draft-ietf-httpbis-p2-semantics" target="_blank">Semantics</a></li>
<li><a href="http://tools.ietf.org/html/draft-ietf-httpbis-p3-payload" target="_blank">Payload</a></li>
<li><a href="http://tools.ietf.org/html/draft-ietf-httpbis-p4-conditional" target="_blank">Conditional</a></li>
<li><a href="http://tools.ietf.org/html/draft-ietf-httpbis-p5-range" target="_blank">Range</a></li>
<li><a href="http://tools.ietf.org/html/draft-ietf-httpbis-p6-cache" target="_blank">Cache</a></li>
<li><a href="http://tools.ietf.org/html/draft-ietf-httpbis-p7-auth" target="_blank">Authentication</a></li>
</ol>
<h3>Linked Data and the Semantic Web</h3>
<p><a href="http://esw.w3.org/topic/SweoIG/TaskForces/CommunityProjects/LinkingOpenData" target="_blank"> Linking Open Data Community Project</a><br />
<a href="http://esw.w3.org/topic/SweoIG/TaskForces/CommunityProjects/LinkingOpenData/Applications" target="_blank"> Linked Data Applications</a><br />
<a href="http://esw.w3.org/topic/TaskForces/CommunityProjects/LinkingOpenData/EquivalenceMining" target="_blank"> Equivalence Mining and Matching Frameworks</a><br />
<a href="http://esw.w3.org/topic/TaskForces/CommunityProjects/LinkingOpenData/SemWebClients" target="_blank"> Linked Data Browsers, Mashups and other Client Applications</a></p>
<p><a href="http://esw.w3.org/topic/DatasetDynamics" target="_blank"> Dataset Dynamics - On the Dynamics of Linked Datasets</a><br />
<a href="http://esw.w3.org/topic/WriteWebOfData" target="_blank"> Realizing a write-enabled Web of Data</a><br />
<a href="http://esw.w3.org/topic/WebAccessControl" target="_blank"> Web Access Control (WAC)</a>  - a decentralized system for allowing different users and groups various forms of access to resources where users and groups are identified by HTTP URIs.<br />
<a href="http://esw.w3.org/topic/WebAccessControl/Vocabulary" target="_blank"> Discussion of the WAC vocabulary</a><br />
<a href="http://www.w3.org/DesignIssues/CloudStorage.html" target="_blank"> Socially Aware Cloud Storage Design Note</a><br />
<a href="http://www.w3.org/2010/Talks/0303-socialcloud-tbl/" target="_blank"> Distributed Social Networking through Socially Aware Cloud Storage from TimBL</a><br />
<a href="http://esw.w3.org/topic/AwwswHome" target="_blank"> AWWSW - "Architecture of the World Wide Semantic Web" Task Force</a></p>
<p><a href="http://www.w3.org/TR/sparql11-http-rdf-update/" target="_blank"> SPARQL 1.1 Uniform HTTP Protocol for Managing RDF Graphs</a><br />
<a href="http://www4.wiwiss.fu-berlin.de/pubby/" target="_blank"> A Linked Data Frontend for SPARQL Endpoints</a><br />
<a href="http://www4.wiwiss.fu-berlin.de/bizer/rdfapi/index.html" target="_blank"> RAP - RDF API for PHP V0.9.6</a><br />
<a href="http://buzzword.org.uk/2009/posted-data/" target="_blank"> Inav the Terrible - An idea for posting RDF through HTTP.</a></p>
<p><a href="http://n2.talis.com/wiki/Changesets" target="_blank"> Talis Changesets</a><br />
<a href="http://triplify.org/vocabulary/update" target="_blank"> Triplify Update Vocabulary</a></p>
<p><a href="http://inkdroid.org/journal/2009/11/04/skos-as-atom/" target="_blank"> skos as atom</a></p>
<p><a href="http://tools.ietf.org/html/rfc4287" target="_blank"> RFC 4287 - The Atom Syndication Format</a><br />
<a href="http://tools.ietf.org/html/rfc5023" target="_blank"> RFC 5023 - The Atom Publishing Protocol</a><br />
<a href="http://ietfreport.isoc.org/all-ids/draft-snell-atompub-tombstones-06.txt" target="_blank"> AtomPub Tombstones - The Atom "deleted-entry" Element</a><br />
<a href="http://tools.ietf.org/html/rfc5005" target="_blank"> RFC 5005 - Feed Paging and Archiving</a><br />
<a href="http://tools.ietf.org/html/draft-brown-versioning-link-relations-07" target="_blank"> Versioning Link Relations - Link Relation Types for Simple Version Navigation between Web Resources</a></p>
<p><a href="http://www2005.org/cdrom/docs/p613.pdf" target="_blank"> Named Graphs, Provenance and Trust</a><br />
<a href="http://sunsite.informatik.rwth-aachen.de/Publications/CEUR-WS/Vol-521/paper1.pdf" target="_blank"> Accessing Site-Specific APIs Through Write-Wrappers From The Web of Data</a><br />
<a href="http://events.linkeddata.org/ldow2009/papers/ldow2009_paper18.pdf" target="_blank"> Provenance Information in the Web of Data - LDOW 2009 paper</a><br />
<a href="http://www.w3.org/2002/Talks/0910-rdf-reification/Overview.html" target="_blank"> Using Reification To Extend RDF</a> (historical reification approach)<br />
<a href="http://dig.csail.mit.edu/2009/presbrey/UAP.pdf" target="_blank"> RDF Policy-based URI Access Control for Content Authoring</a><br />
<a href="http://eprints.ecs.soton.ac.uk/18332/1/opm.pdf" target="_blank"> The Open Provenance Model Core Specification (v1.1)</a><br />
<a href="http://www.w3.org/2005/Incubator/prov/wiki/Main_Page" target="_blank"> W3C Provenance Incubator Group</a></p>
<p><a href="http://www.w3.org/History/" target="_blank"> History of the Web 1945, 1980 through 1997 on W3</a><br />
<a href="http://www.w3.org/TR/leiri/" target="_blank"> LEIRI - Legacy extended IRIs for XML resource identification</a> The type of "URI" used in xml:base<br />
<a href="http://www.slideshare.net/LeeFeigenbaum/cshals-2010-w3c-semanic-web-tutorial" target="_blank"> CSHALS 2010 W3C Semanic Web Tutorial</a><br />
<a href="http://www.mindswap.org/2002/rdfconvert/" target="_blank">Mindswap online RDF Converter</a><br />
<a href="http://www.w3.org/RDF/Validator/" target="_blank">W3 online RDF Validator</a></p>
]]></content:encoded>
			<wfw:commentRss>http://webr3.org/blog/internet/reading-list-web-linked-data-rest-semantic-web/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The Wall</title>
		<link>http://webr3.org/blog/general/the-wall/</link>
		<comments>http://webr3.org/blog/general/the-wall/#comments</comments>
		<pubDate>Thu, 24 Sep 2009 00:10:50 +0000</pubDate>
		<dc:creator>nathan</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[big applications]]></category>
		<category><![CDATA[Design Patterns]]></category>
		<category><![CDATA[FAQ]]></category>
		<category><![CDATA[good programmer]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Multitier architecture]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Software architecture]]></category>
		<category><![CDATA[Software design patterns]]></category>
		<category><![CDATA[Source lines of code]]></category>
		<category><![CDATA[Technology/Internet]]></category>

		<guid isPermaLink="false">http://webr3.org/blog/?p=144</guid>
		<description><![CDATA[
Something all of us developers realise but it doesn't always smack home until certain scenarios arise - The Wall (as I'll call it for now) is the virtual line behind the UI which is where the developer / client separation of concerns occurs. The client wants to see one thing on a UI, click a [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://webr3.org/blog/wp-content/uploads/2009/09/thewall.jpg" alt="thewall" title="thewall" width="600" height="250" class="alignnone size-full wp-image-145" /></p>
<p>Something all of us developers realise but it doesn't always smack home until certain scenarios arise - The Wall (as I'll call it for now) is the virtual line behind the UI which is where the developer / client separation of concerns occurs. The client wants to see one thing on a UI, click a few buttons, hit a few keys and see the UI change to another thing, this change indicates that we as programmers have done our job, behind that line is generally our concern.</p>
<p>Here's the scenario.. a few weeks back "we" started a full 3 tier app, the Applcation tier consisted of the three big layers, service layer -> domain model layer -> data source layer; everything implemented by the book with transfer objects, DAOs, business objects, a full language extension lib, utils, everything coded to interfaces and using factories.. you get the picture.. a lot of code. On the presentation tier we had single UI consisting of a full MVC framework with all the magic and goodness, the models of which talked to the service layer of the application tier (as it should).</p>
<p>A couple of hundred hours later we get our first full end to end done, a simple FAQ system.. possibly the most overkilled FAQ system ever, but still a great end to end test. This is where the wall becomes clear, because for all of that the client only saw a simple FAQ system.</p>
<p>At this point, as a developer you have to ask yourself why.. the FAQ system could have been developed in circa 1 hour using a few lines of PHP and simple mysql database + some echo's.</p>
<p>I don't have an answer to this, and don't think there is one... because if you think about all the immediate arguments for doing it the "proper" way.. maybe even the java way - you still have to think, what is more maintainable a few hundred files and a complex architecture full of design patterns, or three lines of PHP a "n00b" could maintain.</p>
<p>More over.. ultimately those few lines of code you could make the application with are pretty much the same few lines of code which aren't reusable when using the full application approach.</p>
<p>Finally you ask yourself.. if a good programmer introduces about 2.5 bugs per 100 lines.. then what requires more long term maintenance; 100 lines for a full FAQ system or 100 classes with 100 lines each.</p>
<p>Just a thought, that won't go anywhere - because i get paid to make these big applications, but when the pressures on and I've got a 3 hour deadline I do the 100 line thing.</p>
<p>no response needed, simply questioning oneself (again)</p>
]]></content:encoded>
			<wfw:commentRss>http://webr3.org/blog/general/the-wall/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>spl_object_hash is not unique</title>
		<link>http://webr3.org/blog/php/spl_object_hash-is-not-unique/</link>
		<comments>http://webr3.org/blog/php/spl_object_hash-is-not-unique/#comments</comments>
		<pubDate>Sun, 23 Aug 2009 11:27:02 +0000</pubDate>
		<dc:creator>nathan</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[gotcha]]></category>
		<category><![CDATA[Cryptographic hash function]]></category>
		<category><![CDATA[Cryptography]]></category>
		<category><![CDATA[Hash function]]></category>
		<category><![CDATA[Hashing]]></category>
		<category><![CDATA[Pointer]]></category>
		<category><![CDATA[Search algorithms]]></category>
		<category><![CDATA[spl_object_hash]]></category>

		<guid isPermaLink="false">http://webr3.org/blog/?p=128</guid>
		<description><![CDATA[Here is why you should avoid using spl_object_hash() in PHP
from the documentation: "This function returns a unique identifier for the object. This id can be used as a hash key for storing objects or for identifying an object."
spl_object_hash() actually returns an md5 hash of the internal pointer of an object.
PHP efficiently reuses internal pointers; meaning [...]]]></description>
			<content:encoded><![CDATA[<p>Here is why you should avoid using spl_object_hash() in PHP</p>
<p>from the documentation: "This function returns a unique identifier for the object. This id can be used as a hash key for storing objects or for identifying an object."</p>
<p>spl_object_hash() actually returns an md5 hash of the internal pointer of an object.</p>
<p>PHP efficiently reuses internal pointers; meaning the second you remove an object the pointer is reused.</p>
<p>thus:</p>
<pre class="brush: php; title: ;">
&lt;?php
$transaction_ids = array();
for( $i=0; $i&lt;10; $i++ ) {
 $transaction = (object)('transaction ' . $i);
 $hash = spl_object_hash( $transaction );
 $transaction_ids[] = $hash;
}
print_r( $transaction_ids );
?&gt;
</pre>
<p>will output:</p>
<pre>Array
(
[0] =&gt; 4b8051a089b9e8352a97af234d4478a7
[1] =&gt; 076b44c4ffe009b98c0ba3348459c57a
[2] =&gt; 4b8051a089b9e8352a97af234d4478a7
[3] =&gt; 076b44c4ffe009b98c0ba3348459c57a
[4] =&gt; 4b8051a089b9e8352a97af234d4478a7
[5] =&gt; 076b44c4ffe009b98c0ba3348459c57a
[6] =&gt; 4b8051a089b9e8352a97af234d4478a7
[7] =&gt; 076b44c4ffe009b98c0ba3348459c57a
[8] =&gt; 4b8051a089b9e8352a97af234d4478a7
[9] =&gt; 076b44c4ffe009b98c0ba3348459c57a
)
</pre>
<p>not even remotely unique, could lead to serious problems, and simply.. I'd forget using it if I was you.</p>
<p><img class="alignnone size-full wp-image-130" title="sucks" src="http://webr3.org/blog/wp-content/uploads/2009/08/sucks.jpg" alt="sucks" width="600" height="250" /></p>
]]></content:encoded>
			<wfw:commentRss>http://webr3.org/blog/php/spl_object_hash-is-not-unique/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Object to Array, Object to stdClass in PHP</title>
		<link>http://webr3.org/blog/php/object-to-array-object-to-stdclass-in-php/</link>
		<comments>http://webr3.org/blog/php/object-to-array-object-to-stdclass-in-php/#comments</comments>
		<pubDate>Tue, 18 Aug 2009 12:53:12 +0000</pubDate>
		<dc:creator>nathan</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Array]]></category>
		<category><![CDATA[Class]]></category>
		<category><![CDATA[Curly bracket programming languages]]></category>
		<category><![CDATA[Data structures]]></category>
		<category><![CDATA[Inheritance]]></category>
		<category><![CDATA[OBJ]]></category>
		<category><![CDATA[Object]]></category>
		<category><![CDATA[Object-oriented programming]]></category>
		<category><![CDATA[PHP programming language]]></category>
		<category><![CDATA[Procedural programming languages]]></category>
		<category><![CDATA[Scripting languages]]></category>

		<guid isPermaLink="false">http://webr3.org/blog/?p=122</guid>
		<description><![CDATA[
ObjectConverter - one of those classes you won't see the point of until you hit the problem.
Problem: When you convert an object (instance of a class) to an array in PHP, only the public properties are included; often you need public, protected, private and inherited properties to be visible, indeed there isn't any real way [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-123" title="objectconverter" src="http://webr3.org/blog/wp-content/uploads/2009/08/objectconverter.jpg" alt="objectconverter" width="600" height="250" /></p>
<p><strong>ObjectConverter </strong>- <em>one of those classes you won't see the point of until you hit the problem</em>.</p>
<p><strong>Problem</strong>: When you convert an object (instance of a class) to an array in PHP, only the public properties are included; often you need public, protected, private and inherited properties to be visible, indeed there isn't any real way to expose all properties of an object without adding a "toArray" method to class itself; simply there is no simple way to do this (private properties are private for a reason!).</p>
<p><strong>Solution</strong>: ObjectConverter :) This is a utility class which will turn any given instance in to either an array or a bare stdClass instance; effectively exposing all properties so you can persist or transfer your objects easily.</p>
<p><strong>Note</strong>: afaik no other "object to array" script can do this, and after playing with multiple approaches over the years I finally settled on this implementation which does *not* use reflection or any such heavy weight trickery.</p>
<p><strong>Usage</strong>:<br />
$array = ObjectConverter::toArray( $obj );<br />
$stdClass = ObjectConverter::toStdClass( $obj );</p>
<p><strong>Download</strong>: <a href="http://webr3.org/experiments/php/ObjectConverter.zip">ObjectConverter PHP Script</a> (php5 only)</p>
]]></content:encoded>
			<wfw:commentRss>http://webr3.org/blog/php/object-to-array-object-to-stdclass-in-php/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>PHP Events - Actionscript 3 style events in PHP 5</title>
		<link>http://webr3.org/blog/experiments/php-events-actionscript-3-style-events-in-php-5/</link>
		<comments>http://webr3.org/blog/experiments/php-events-actionscript-3-style-events-in-php-5/#comments</comments>
		<pubDate>Fri, 24 Jul 2009 17:33:12 +0000</pubDate>
		<dc:creator>nathan</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[experiments]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Curly bracket programming languages]]></category>
		<category><![CDATA[Event Listener]]></category>
		<category><![CDATA[Events]]></category>
		<category><![CDATA[multi site systems]]></category>
		<category><![CDATA[Negation]]></category>
		<category><![CDATA[Object-oriented programming]]></category>
		<category><![CDATA[Scripting languages]]></category>
		<category><![CDATA[Serialization]]></category>

		<guid isPermaLink="false">http://webr3.org/blog/?p=111</guid>
		<description><![CDATA[Here are a set of classes which aim to provide basic actionscript style events in php5;
The Point - Events are useful everywhere even when you don't have a UI, the main reason for building this was to create a kind of "hook" system for php. Often we create multi site systems where each implementation of [...]]]></description>
			<content:encoded><![CDATA[<p>Here are a set of classes which aim to provide basic actionscript style events in php5;</p>
<p><strong>The Point </strong>- Events are useful everywhere even when you don't have a UI, the main reason for building this was to create a kind of "hook" system for php. Often we create multi site systems where each implementation of that system has different client specific considerations; consider a system where one client wants all of there images to go to amazon s3 instead of being saved on the host like your other clients. With this system you can simply:</p>
<ol>
<li>throw an "storeUpload" event which is cancelable</li>
<li>register a default event listener which listens for "storeUpload" events and provides default functionality, saving the upload and setting the location (ur) on the event.target</li>
<li>on one site register a custom event listener which listens for the "storeUpload" event, uploads to amazon s3, then cancels the event and set the event.target to the s3 url instead</li>
</ol>
<p>as you can see, with this you can keep the codebase of your multisite application the same and simply hook in to events whereever you want.</p>
<p>the system consists of 2 public classes:</p>
<h3>Event</h3>
<p>The base class for all events, provides event type and cancelable; with typical usage you create a new event, then dispatch it when ready.</p>
<ul>
<li><strong>__construct</strong>( $type , $cancelable=FALSE )<br />
create a new event listener - if you extend the Event class you must call this with parent::__construct( $type , $cancelable );</p>
<p><strong>$type</strong> - string, event type eg "debugEvent"<br />
<strong>$cancelable</strong> - boolean, provides cancelation functionality, so you can prevent further event listeners from firing thus in effect overriding them.</p>
<p>throws InvalidArgumentException if $type is not a string</li>
<li><strong>cancel</strong>() : void<br />
cancels an event, only if it is cancelable</li>
<li><strong>isCancelable</strong>() : Boolean</li>
<li><strong>isCanceled</strong>() : Boolean</li>
<li><strong>getType</strong>() : string</li>
<li><strong>getTarget</strong>() : obj<br />
target always contains the instance which dispatched the event.</li>
</ul>
<h3>EventDispatcher</h3>
<p>All classes which wish to dispatch events must inherit from EventDispatcher (like in most languages), this class provides:</p>
<ul>
<li><strong>addEventListener</strong>( $type , $callable , $owner ) : void<br />
adds an event listener, this may be a function, a class method or a static class method.<br />
note: a current limitation is that event listener methods must be public</p>
<p><strong>$type</strong> - string, event type eg "debugEvent"<br />
<strong>$callable</strong> - string, the function or method which is to be called when event $type is dispatched<br />
<strong>$owner</strong> - mixed, used when $callable is a method, can be either an object instance, or the string name of a class for static methods.</p>
<p><strong>throws:</strong><br />
InvalidArgumentException when type or callable isn't a string<br />
Exception('unknown method / function')</li>
<li><strong>removeEventListener</strong>( $type , $callable , $owner ) : void<br />
removes an event listener that has been added with addEventListener, this only removes a single event listener each call, so if you have 3 identical event listeners you will need to call this method 3 times to remove them all.</p>
<p>arguments are the same as addEventListener - throws no exceptions, always returns void</li>
<li><strong>hasEventListener</strong>( $type ) : Boolean<br />
checks if any event listeners are registered for event $type; always returns boolean true or false.</li>
<li><strong>dispatchEvent</strong>( Event $event ) : void<br />
the obvious one, dispatches an event and notifies all listeners.</li>
</ul>
<h3>Notes:</h3>
<p>The event dispatcher implements a function which hides all instance properties starting with __ from the serialize process, thus hiding the events and meaning your current serialization process will still work, additionally you can utilize it to hide any properties you don't want to be serialized.</p>
<p>I've tried to make the classes as simple, small and practical as possible, they execute rather quickly and shouldn't make any speed difference to your application - do however be aware that loosely coupling and entire system could allow coding errors to creep in, so maybe don't use it everywhere - but then PHP isn't strict anyways so..!</p>
<h2>Download</h2>
<p>You can download the <a href="http://webr3.org/experiments/php/PHPEvents.zip">PHP Event system</a> here (3 classes + example, 4.2k) - hope somebody finds it useful!</p>
<p><img class="alignnone size-full wp-image-112" title="events" src="http://webr3.org/blog/wp-content/uploads/2009/07/events.jpg" alt="events" width="600" height="250" /></p>
]]></content:encoded>
			<wfw:commentRss>http://webr3.org/blog/experiments/php-events-actionscript-3-style-events-in-php-5/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Speeding up Apache2 and MySQL5 the easy way.</title>
		<link>http://webr3.org/blog/optimization/speeding-up-apache2-and-mysql5-the-easy-way/</link>
		<comments>http://webr3.org/blog/optimization/speeding-up-apache2-and-mysql5-the-easy-way/#comments</comments>
		<pubDate>Wed, 15 Jul 2009 22:28:14 +0000</pubDate>
		<dc:creator>nathan</dc:creator>
				<category><![CDATA[apache]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[backend db server]]></category>
		<category><![CDATA[HTTP]]></category>
		<category><![CDATA[HTTP persistent connection]]></category>
		<category><![CDATA[Hypertext Transfer Protocol]]></category>
		<category><![CDATA[Keepalive]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[ram]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Technology/Internet]]></category>

		<guid isPermaLink="false">http://webr3.org/blog/?p=85</guid>
		<description><![CDATA[One of the sites I manage is what I'd would call a high traffic website, traffic sits around 900 requests a second all day and peaks around 3500 a second in rush hour (when the new stories for the day are published each morning). Nearer 6000 per second at peak.
Skippable Details
All this traffic is round [...]]]></description>
			<content:encoded><![CDATA[<p>One of the sites I manage is what I'd would call a high traffic website, traffic sits around 900 requests a second all day and peaks around 3500 a second in rush hour (when the new stories for the day are published each morning). Nearer 6000 per second at peak.</p>
<h3>Skippable Details</h3>
<p>All this traffic is round robin'd to 2 apache2 servers (each is 2x 2.86 quad xeons w/ 4GB ram) and one backend db server of similar spec.</p>
<p>Over the years familiar problems rear there heads, the mysql "Too Many Connections" error, Apache running like a dog under stress etc.</p>
<p>This weekend I got the chance to rebuild the servers from scratch, and a chance to optimize everything - works very very well now!</p>
<h3>Easy Optimization - Apache2</h3>
<p>KeepAliveTimeout: Number of seconds to wait for the next request from the same client on the same connection.</p>
<p>Translate this to "Number of seconds to lock up a worker thread just incase another request comes in from the same client on the same connection" - in short a lot of browsers will request the page, keep the connection alive and use it to request images, css etc.</p>
<p>The default is 15 seconds; in my experience about 40-50% of connections will use KeepAlive, so if you have enough ram to support 500 requests before going in to swap memory, and you get 500 requests a second, by the time 3 seconds are past you've got a load of workers with RAM assigned doing nothing and all the hard work is getting done using swap memory instead, from this poitn on basically all the hard work is getting done using swap rather than ram, ya?</p>
<p>Thus, the simple fix is to knock KeepAliveTimeout right down - some people recommend 2 seconds, my personal preference is 4 seconds - works a charm for me :)</p>
<p>To analyse this yourself just check the server-status provided by apache (normally only viewable from localhost, easy way around this is to &lt;?php echo file_get_contents('http://localhost/server-status'); ?&gt;</p>
<h3>Easy Optimization - MySQL Server</h3>
<p>Other than the normal cnf values you should be optimizing [ key_buffer, sort_buffer_size, max_allowed_packet, thread_stack, thread_cache_size, max_connections, table_cache, query_cache_limit, query_cache_size ] - there is one more that is very important; namely wait_timeout.</p>
<p>wait_timeout - The number of seconds the server waits for activity on a noninteractive connection before closing it.</p>
<p>By default this value is very high, but often you get connections that just aren't closed properly, especially in the PHP apache world - if you ever hit that "Too many connections" error or see a lot of connections open for prolonged periods of time then this could / should be addressed.</p>
<p>Often you will see connections sitting idle for 10-15 seconds, for no good reason. Best to address it I'd say; and thus we lower wait_timeout to 5 seconds.</p>
<p>Connections are cleared faster, more resources free for other connections and all round its good. Remember one of mysql's strongest features is it's ability to open and close connections ultra-fast.</p>
<h3>Summary</h3>
<p>Honestly just check the your apache server status, see how many connections are open, how many of them are flagged K for keep alive then drop the keep alive time, take a note of processor usage / memory usage, drop the KeepAliveTimeout to 2, 4, 6, 8 and check it all again, you may be very suprised, it sure beats weeks of manual code optimizatios to make those scripts run faster.</p>
<p>Regards</p>
<p><img class="alignnone size-full wp-image-86" title="top" src="http://webr3.org/blog/wp-content/uploads/2009/07/top.jpg" alt="top" width="600" height="250" /></p>
]]></content:encoded>
			<wfw:commentRss>http://webr3.org/blog/optimization/speeding-up-apache2-and-mysql5-the-easy-way/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Experiments Upgraded</title>
		<link>http://webr3.org/blog/general/experiments-upgraded/</link>
		<comments>http://webr3.org/blog/general/experiments-upgraded/#comments</comments>
		<pubDate>Tue, 23 Jun 2009 13:58:05 +0000</pubDate>
		<dc:creator>nathan</dc:creator>
				<category><![CDATA[experiments]]></category>
		<category><![CDATA[general]]></category>
		<category><![CDATA[dom]]></category>
		<category><![CDATA[Extensible Stylesheet Language]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Markup languages]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[XML]]></category>
		<category><![CDATA[XSL Transformations]]></category>
		<category><![CDATA[XSLT]]></category>

		<guid isPermaLink="false">http://webr3.org/blog/?p=20</guid>
		<description><![CDATA[
It's a bit premature, seeing as I haven't even blogged about what the existing experiments are yet, however I'm glad to say that the section is finished and ready for veiwing.
Seeing as most of the audience of this blog will be using more recent browsers, I've opted for XSLT templates and small XML descriptors for [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-22" title="xslt-labs" src="http://webr3.org/blog/wp-content/uploads/2009/06/xslt-labs.jpg" alt="xslt-labs" width="600" height="250" /><br />
It's a bit premature, seeing as I haven't even blogged about what the existing experiments are yet, however I'm glad to say that the section is finished and ready for veiwing.</p>
<p>Seeing as most of the audience of this blog will be using more recent browsers, I've opted for XSLT templates and small XML descriptors for each item - this saves me writing tonnes of html, saves the server some weight, saves you some bandwidth and let's me palm off all rendering on to the client.</p>
<p>Inkeeping with the spirit of experiments, one of the main reasons I've done this is to see how the xml documents get listed in google (if at all); and to check if analytics works with XSLT.</p>
<p>On this note, I had to do a little bit of fiddling with the recommended embed code from google to get it to work; if anybody else hits this problem here's a modified version.</p>
<p><code><br />
&lt;script src="http://www.google-analytics.com/ga.js" type="text/javascript"&gt;&lt;/script&gt;<br />
&lt;script type="text/javascript"&gt;<br />
try {<br />
var pageTracker = _gat._getTracker("UA-3391780-6");<br />
pageTracker._trackPageview();<br />
} catch(err) {}<br />
&lt;/script&gt;<br />
</code></p>
<p>And as for the listings, well thats just a quick and dirty PHP 5 class which iterates the directories, loads them in to a dom document and spits out the xml - ultra simples.</p>
]]></content:encoded>
			<wfw:commentRss>http://webr3.org/blog/general/experiments-upgraded/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flash 10, Massive amounts of 3D Particles (with haXe)</title>
		<link>http://webr3.org/blog/haxe/flash-10-massive-amounts-of-3d-particles-with-haxe/</link>
		<comments>http://webr3.org/blog/haxe/flash-10-massive-amounts-of-3d-particles-with-haxe/#comments</comments>
		<pubDate>Mon, 22 Jun 2009 20:13:42 +0000</pubDate>
		<dc:creator>nathan</dc:creator>
				<category><![CDATA[Flash 10]]></category>
		<category><![CDATA[haXe]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Adobe Flash]]></category>
		<category><![CDATA[Curly bracket programming languages]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Ralph Hauwert]]></category>

		<guid isPermaLink="false">http://webr3.org/blog/?p=16</guid>
		<description><![CDATA[A couple of months ago I was playing a round with strange attractors in flash, using AS3 and flex, then a post caught my attention.
Ralph Hauwert somehow managed to push 300k+ 3D particles around in realtime using alchemy, pixelbender and flash 10; I played around with the code a bit and made similar in pure [...]]]></description>
			<content:encoded><![CDATA[<p>A couple of months ago I was playing a round with strange attractors in flash, using AS3 and flex, then a post caught my attention.</p>
<p><a href="http://www.unitzeroone.com/blog/2009/03/18/flash-10-massive-amounts-of-3d-particles-with-alchemy-source-included/" target="_blank">Ralph Hauwert</a> somehow managed to <a href="http://www.unitzeroone.com/labs/alchemyPushingPixels/" target="_blank">push 300k+ 3D particles around in realtime using alchemy, pixelbender and flash 10</a>; I played around with the code a bit and made similar in pure as3, nothing magnificent.. a month later in a totally unrelated event (namely me getting thoroughly p'd off with PHP) I discovered <a href="http://haxe.org/" target="_blank">haXe</a> and set to work playing around with it.</p>
<p>Finally in another totally unrelated event I came across <a href="http://blog.joa-ebert.com/2009/04/03/massive-amounts-of-3d-particles-without-alchemy-and-pixelbender/">Joa Eberts AS3 only version</a> of Ralphs earlier work; upon closer inspection I found it wasn't as fast as Ralph's alchemy version but completely awesome code non-the-less, to do this in pure AS3 is simply amazing.</p>
<p>As if you can't guess where this is going.. I thought I'd give it a go in "pure haXe" to see if one could replicate the speed of Ralphs version or maybe even top it. Sparing any further detail..</p>
<p>Here's <a href="http://webr3.org/experiments/haxe-particle-pusher/300k/">haXe pushing 300k+ 3d particles around in realtime</a> (source included)</p>
<p>and...</p>
<p>here's haXe pushing <a href="http://webr3.org/experiments/haxe-particle-pusher/600k/">600k particles</a> (twice as many), and erm <a href="http://webr3.org/experiments/haxe-particle-pusher/OneMillion/">1 Million</a> (a bit stuttery but hell why not)</p>
<p>and.. (just for fun)</p>
<p>here's haXe pushing <a href="http://webr3.org/experiments/haxe-particle-pusher/300k-Color/">300k particles in color</a>, and <a href="http://webr3.org/experiments/haxe-particle-pusher/500k-Color/">500k in color</a> for good measure! - before downplaying the color versions, it's worth noting that each r,g,b value is independantly calculated and weighted as a float then combined to a render color right before updating the bitmap, so in effect it's not just x,y,z stored for each pixel, it's r,g,b as well - so 2x more number crunching + a bit more.</p>
<p>think I can safely say I love haXe and since doign this I've been going nuts doing <a href="http://webr3.org/experiments/" target="_self">lots of experiments</a> using similar code :p</p>
<p>so, any doublts about haXe's perfomance with flash can be considered resolved imho.</p>
<p>regards, nathan</p>
<p><img class="alignleft size-full wp-image-17" title="300k-lol" src="http://webr3.org/blog/wp-content/uploads/2009/06/300k-lol.jpg" alt="300k-lol" width="600" height="250" /></p>
]]></content:encoded>
			<wfw:commentRss>http://webr3.org/blog/haxe/flash-10-massive-amounts-of-3d-particles-with-haxe/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
	</channel>
</rss>

