HNHacker News
TopNewBestAskShowJobs

chrisb

547 karma · joined April 30, 2009

Contact me at chris _at_ dunelm.org.uk

Located just south of London, UK

Github: https://github.com/chrisdunelm

submissionscomments
chrisb··on Children who see clearly underwater
Are you talking about "Magic Eye" pictures like this: http://mentalfloss.com/article/29771/why-cant-some-people-se... ?

If so, this isn't really what I mean.

I mean with just one eye, being able to consciously refocus that eye. For example, looking at this writing on your screen able to make that go in and out of focus.

chrisb··on Children who see clearly underwater
This links to something that's occasionally interested me.

Are you able to consciously refocus your eye?

By this I mean stare at an object (with one eye), and consciously make it go in and out of focus, whilst always staring straight at it.

I find that I can do this to a certain extent - is this something that most people can do?

chrisb··on World's largest offshore wind farm to be built – Hornsea 1
1.2GW, 120km off the UK coast.

The UK currently (Jan 2016) has ~8.5GW onshore wind, and ~5GW offshore, so Hornsea 1 is a significant addition :)

chrisb··on First Vehicle2Grid Energy Storage Network in Europe
Good to see this happening.

Grid-scale electrical energy storage/peak-removal is definitely something that needs to happen before the move to 100% non-fossil-fuel is possible, and electric vehicles can play a worthwhile role here.

I plan that the next car I buy will be electric, and would love to be able to also use it to provide energy storage services :)

chrisb··on Audi is making fuel from air and water
Diesel is essentially a hydrocarbon, so water and CO2 can provide all the elements required.

The normal problem is that the cheapest/easiest source of hydrogen is from the stream reformation[1] of natural gas, but here there are using high temperature electrolysis[2] of water powered from green energy (they don't seem to specify exactly what this is).

The CO2 comes from atmospheric capture using a device from Climeworks[3], and biogas. This is CO2 neutral as all this CO2 is either in the atmosphere already, or will naturally end up in the atmosphere.

This is of course a very small-scale pilot by Audi, but I've often thought that using hydrocarbon fuels manufactured from atmospheric CO2 and water might be an excellent solution for transport and space heating. We have all the infrastructure for distributing these fuels, they are manufacturable using something like solar energy, and can be easily stored and transported themselves.

[1] http://en.wikipedia.org/wiki/Steam_reforming [2] http://en.wikipedia.org/wiki/High-temperature_electrolysis [3] http://www.climeworks.com/

chrisb··on Audi E-diesel made from water, CO2 and green power
Diesel is essentially a hydrocarbon, so water and CO2 can provide all the elements required.

The normal problem is that the cheapest/easiest source of hydrogen is from the stream reformation[1] of natural gas, but here there are using high temperature electrolysis[2] of water powered from green energy (they don't seem to specify exactly what this is).

The CO2 comes from atmospheric capture using a device from Climeworks[3], and biogas. This is CO2 neutral as all this CO2 is either in the atmosphere already, or will naturally end up in the atmosphere.

This is of course a very small-scale pilot by Audi, but I've often thought that using hydrocarbon fuels manufactured from atmospheric CO2 and water might be an excellent solution for transport and space heating. We have all the infrastructure for distributing these fuels, they are manufacturable using something like solar energy, and can be easily stored and transported themselves.

[1] http://en.wikipedia.org/wiki/Steam_reforming [2] http://en.wikipedia.org/wiki/High-temperature_electrolysis [3] http://www.climeworks.com/

chrisb··on Vatican urges action on climate change
Whatever your views on Christianity and the Catholic Church, if the official position of the Vatican becomes that Christians have a responsibility to protect the climate, then a huge number of people worldwide should start to take this more seriously.

Although as the article says: "Whether it will prove persuasive for American Republican lawmakers - around a third of whom are Catholic - is yet to be seen."

The actual statement is here: http://www.casinapioiv.va/content/accademia/en/events/2014/s...

Alternative article: http://www.nytimes.com/2015/04/28/world/europe/pope-francis-...

chrisb··on World's first lagoon power plants unveiled in UK
Link to the project itself: http://www.tidallagoonswanseabay.com/proposal-overview-and-v...
chrisb··on UK Green Party Policy: Unconditional “Citizens Income”
The Green Party are extremely unlikely to achieve a majority vote in the election, but it's just possible they'll be involved in a coalition.

It'd be exciting to see what happened if a policy like this is ever talked about seriously at high levels of government.

However, I do notice that the "Citizen's Income Trust" charity that provided the research to justify this has more recently changed their opinion. They are now stating that the poorest would not benefit from such a policy. http://www.theguardian.com/politics/2015/jan/27/green-party-...

chrisb··on Will the UK's gas holders be missed?
I can't find a reference now, but as I understand it this isn't so much of an issue at low pressure.

Apparently underground low pressure storage has been used successfully: http://en.wikipedia.org/wiki/Hydrogen_storage#Underground_hy...

chrisb··on Will the UK's gas holders be missed?
I was wondering if these could be used to store hydrogen generated by solar water-splitting? Could the hydrogen be piped in place of natural gas? Or combined with natural gas? seemingly "town gas" was primarily hydrogen [1]. Or it could generate electricity via combustion or fuel cell, providing dispatchable renewable energy with grid-scale storage :)

An averaged-size gas-holder has capacity of ~50,000 m^3 [2]. Gas holders store gas at essentially atmospheric pressure, so the stored hydrogen has an energy density of ~0.01 MJ/L [3] = ~10^7 J/m^3. So the gas-holder energy capacity is ~5*10^11 J = ~140 MWh

In comparison Dinorwig pumped-storage power station in the UK has an energy capacity of ~9000 MWh [4]

[1] http://en.wikipedia.org/wiki/Coal_gas#Composition

[2] http://en.wikipedia.org/wiki/Gas_holder

[3] http://en.wikipedia.org/wiki/Energy_density

[4] http://www.withouthotair.com/c26/page_191.shtml

chrisb··on Nobody builds nuclear reactors for fun anymore
If anyone is interested in investigating nuclear reactions, there is a wealth of publicly available data from a huge number of experiments; and simulation software is available.

For example: EXFOR (Experimental nuclear reaction data https://www-nds.iaea.org/exfor/exfor.htm) is an international collection of more than 20000 nuclear reaction experimental results dating back to the discovery of the neutron.

ENDF (Evaluated nuclear data library http://www.nndc.bnl.gov/endf/b7.1/) is the current best evaluation of the most up-to-date data available for many nuclear reactions that have been seen experimentally.

FLUKA (http://www.fluka.org/) "is a fully integrated particle physics MonteCarlo simulation package", partially developed and used by CERN.

Beware that all of these require some knowledge of nuclear physics to use and understand (obviously!), and can be somewhat archaic in data formats and computer languages used (think FORTRAN).

But it is truly wonderful how you and I have such easy access to such high quality and complete data.

chrisb··on Why have I failed?
Given the context, it's pretty clear that he thought he knew everything at the time, but now realises he didn't.

One of life's more painful, but essential, lessons.

chrisb··on Cause & Effect
Typo: should be "Iain M Banks"

I also enjoy his culture novels. His non-culture "Against a Dark Background" is also excellent.

chrisb··on Germany sets new solar-power record
They mean GW. Many news articles on this subject show irritating ignorance of energy/power and the correct use of units :(

GW per hour would be the rate of change of power generation, which is obviously incorrect given the context :)

chrisb··on Java 9 with GPU processing, Java 10 will be all-OOP without primitives
In C# primitives are not objects, but they can be boxed into objects.

So if you have a class:

  public class X {
    public Int32 i;
    public Int32 j;
    public Int32 k;
  }
Then it takes 12 bytes + single object overhead (which in MS .NET I believe is two pointers).

But if you assign a primitive (e.g. Int32) to an variable of type 'object' then it will be boxed and then require the object overhead.

A neat thing about C#/.NET is that generics are baked deeply into the platform, so using primitive (actually, any value-type struct) types as generic arguments will not require object memory or casting overheads.

chrisb··on Poll: What's Your Favorite Programming Language?
There are two ways of recursively calling lambda functions, neither perfect, but both usable.

  Func<int,int> fib = null;
  fib = n => n > 1 ? fib(n - 1) + fib(n - 2) : n;
Or write yourself a Y fixed-point combinator, described in http://blogs.msdn.com/b/wesdyer/archive/2007/02/02/anonymous...

  delegate Func<A,R> Recursive<A,R>(Recursive<A,R> r);
  static Func<A, R> Y<A, R>(Func<Func<A, R>, Func<A, R>> f) {
    Recursive<A, R> rec = r => a => f(r(r))(a);
    return rec(rec);
  }
used like this:

  Func<int,int> fib = Y<int,int>(f => n => n > 1 ? f(n - 1) + f(n - 2) : n);
(I'm not advocating writing a fib function this way, but it's a useful example!)
chrisb··on How the Boehm Garbage Collector Works
Garbage collectors have no problem with reference cycles.

A GC works by finding all objects that are reachable (referenced by some other object or a root), then discarding all other objects. So a cyclic data structure is completely discarded as soon as there are no live references to any of its objects.

As usual, Wikipedia has lots more information: http://en.wikipedia.org/wiki/Garbage_collection_(computer_sc...

GC roots are generally things like: static/global variables, active stack frames (function parameters and local variable), CPU registers.

chrisb··on Ask HN: Who's looking for employment?
Hi,

Looking for remote or on-site London/SE-England, freelance or permanent.

Experienced in embedded, server, web and desktop code design development; mainly in C/C#/Javscript, although always willing to learn more...

Enjoy working on anything interesting and technically challenging! See github for a couple of examples: https://github.com/chrisdunelm

Contact via profile

chrisb··on An actually usable .NET virtual machine in javascript
This will also happen in Cil2Js. Any .NET library method (including system libraries) that is implemented as CIL can be converted directly to JS.

In mscorlib however, there are many methods that are implemented directly by the .NET runtime; i.e. they are not implemented in CIL. Cil2Js will provide replacements for these, either written directly in JS, or in CIL (compiled from C# source) that will provide identical functionality.

For example, string.Length is not implemened in CIL. In fact, may of the methods on 'basic' types such as System.String, System.Array, System.Int32, etc... are implemented internally by the .NET runtime.

chrisb··on An actually usable .NET virtual machine in javascript
outer will be 2

A closure is created for the anonymous function, allowing access (by reference) to the non-local variables in the containing method.

chrisb··on An actually usable .NET virtual machine in javascript
Coincidently, I'm currently creating a similar project: https://github.com/chrisdunelm/Cil2Js

This is absolutely not yet ready for real use, but can convert a sub-set of CIL to JavaScript and is fully open source :)

Update:

il2js and Cil2Js work significantly differently. il2js interprets the .NET IL in a JavaScript virtual machine, whereas Cil2Js directly converts the .NET IL into JavaScript.

Having now looked at this il2js project in more detail, it appears to have some subtle (and some not-so-subtle) differences between running on .NET and running in JS. For example, integer division will return a double in JS; Stack<T>.Last() returns wrong end of stack on JS; no/little support for non-primitive value types; etc... Hopefully these will be sorted out soon, as it's these sorts of inconsistencies that can lead to extreme frustration.

I am unconvinced that a JS VM is a good technique, as I suspect it will be an order of magnitude slower that the same IL converted to JS (although I have no test data to prove this).

However, these aside, it's an impressive project.

chrisb··on Speed-of-light experiments yield baffling result at LHC
IPCC AR4 models all listed with lots of information and links (although some now dead): http://www-pcmdi.llnl.gov/ipcc/model_documentation/ipcc_mode...

For example, the three models developed by NASA: http://data.giss.nasa.gov/modelE/ar4/

Direct links to each model + code + datasets:

http://www.giss.nasa.gov/tools/modelE/ - with nightly code snapshots here: http://simplex.giss.nasa.gov/snapshots/

http://aom.giss.nasa.gov/ - with direct access to code here: http://aom.giss.nasa.gov/code.html and here: http://aom.giss.nasa.gov/code4x3.html

http://www.giss.nasa.gov/tools/modelii/ - seemingly work on this has now been merged with the ModelE simulation.

Lots of other code and data is available if you take the time to find it ... and then considerably more time to understand it.

chrisb··on Thorium Reactors
Minor point, but tidal sources are also not solar-derived.

And an advantage of tidal compared to most (all?) other renewables is that it is completely predictable.

There are downsides, especially to do with ecological effects/damage during construction and operation.

chrisb··on TinyVM 1.0 released; adds 16 lines of code, registers, a VM stack and more
In a slightly similar vein, you might enjoy looking at my Dot Net Anywhere project: https://github.com/chrisdunelm/DotNetAnywhere/tree/master/dn... (or http://www.dotnetanywhere.org for an easy to use zip download that will load and compile directly on Windows)

It is an almost complete .NET2.0 CIL interpreter, so it can run your exe's compiled from C#/VB/etc...

I'm not sure it has much practical application, but it was certainly fun to write, and I learnt a huge amount about interpreters and how .NET works.

PS Lots of bugs, a memory leak, an incomplete base class library, etc... so don't try to use this for anything serious!

chrisb··on Show HN: Weekend project - VS2010 CoffeeScript syntax highlighting
Thanks :)
chrisb··on Show HN: Weekend project - VS2010 CoffeeScript syntax highlighting
Not quite what you are asking for, but I've recently started using the Chirpy VS add-in (chirpy.codeplex.com). It comiles CoffeeScript on save in VS, producing one readable and one minified js version.

It also handles .less, but I haven't used this yet.

chrisb··on More letters to RIM; employees rally alongside anonymous exec
"A singer"?

That's not just "a singer".

It's Freddie Mercury himself.

chrisb··on GreenStart - SF Startup accelerator for cleantech - deadline Sunday
Based in SF, application deadline is this Sunday.

You get $25000 for 3-10%

chrisb··on The Art of Assembly Language Programming (Linux edition) [book]
Putting the memory and CPU into standby was done by setting/clearing variout bits and various control registers (memory mapped). The code to do this was in a loop that executed twice. A CPU register set to zero the first time round and set to 0xffffffff the second time round, to use as a mask.

All control register changes were then performed in the loop, with changes to the control registers masked by the mask register so that no changes were actually made the first time round the loop, but all code was loaded into the CPU cache, then the second time round the loop changes were made and the memory+CPU put to sleep.

The MIPS CPU was quite nice, because when it woke up after this all state was preserved, so it just carried on as if nothing had happened. And memory contents were preserved through standby as well, so it was all fairly simple.

This is in contrast to some ARM CPUs I've used where when they wake up after sleep, they jump to the reset address, so the boot code has to be aware of sleep/wake operations, which was a bit of a pain.

← PreviousPage 2 of 4Next →