HNHacker News
TopNewBestAskShowJobs

jsingleton

3,046 karma · joined April 8, 2013

Author of ASP.NET Core 2 High Performance (Packt Publishing): unop.uk/book

I'm a developer, engineer, hacker and entrepreneur. My personal blog is at: unop.uk

[ my public key: https://keybase.io/jps; my proof: https://keybase.io/jps/sigs/O8UP6-fFcMSV4qZW8VA39-Z_NiV8JtLjKAk6cOH1O7A ]

submissionscomments
jsingleton··on Live display of CO2 emitted to produce electricity in European countries
Ben Cruachan is great and free if you come by train. The walk up to the top is good on a nice day but not easy. I went in the summer and there's a photo at the bottom of this blog post: https://unop.uk/mobile-gb-rail-live-departure-boards/
jsingleton··on Show HN: A London Underground Tube Status Board Written in React
This is the output of part 1 in a tutorial series, which is here: https://unop.uk/building-a-web-app-in-react-and-asp-net-core...
jsingleton··on Live display of CO2 emitted to produce electricity in European countries
Nuclear power stations are surprisingly boring. It's mostly solid state, relatively quiet and inaccessible (for obvious reasons). I went on a trip to Dungeness (Kent) and it looks like you still can[0] along with 6 others.

For pumped storage there is Dinorwig[1] (North Wales) and Cruachan (West Scotland). If you arrive by public transport you can get a free tour of the Cruachan pumped storage hydro plant.

[0]: https://www.edfenergy.com/energy/education/visitor-centres

[1]: http://www.electricmountain.co.uk/

[2]: http://www.visitcruachan.co.uk/

Edit:

There's a photo at the bottom of this blog post from my visit to Cruachan last summer: https://unop.uk/mobile-gb-rail-live-departure-boards

If you're in the French Alps then you could visit Grand'Maison on a bad weather day: http://www.musee-edf-hydrelec.com/

jsingleton··on Live display of CO2 emitted to produce electricity in European countries
I was talking to a CERN physicist once who joked that the reason for the LHC winter shutdown was because France needed heating. It's probably more to do with economics but it's almost true. France has a lot of cheap nuclear power in the summer, and only limited pumped storage capacity to cache it with.
jsingleton··on Live display of CO2 emitted to produce electricity in European countries
https://energyuse.eu is an interesting study in how online discussion can help. It's part of an EU trial that I'm on (https://www.decarbonet.eu).
jsingleton··on Live display of CO2 emitted to produce electricity in European countries
This is a very pretty map! It shows that location is important but time is also an interesting domain. You can do your bit by running appliances at the best time. This is a post I made on https://energyuse.eu (part of an EU trial I'm involved with - https://www.decarbonet.eu).

Saving energy in general is a positive step. For example, we've just bought a new freezer and dishwasher with better energy ratings and these will save money over their lifetimes. However, when is the best time to run a wash to save the most CO2e?

Unless you are on an Economy 7 style tariff or have solar panels then when you use power has no effect on how much it costs you. If you are, then at night or in the middle of the day is better, respectively. Dynamic demand to grid signals isn't ready for consumer adoption yet but you can look at the information manually if you want to use power at less demanding times.

The grid frequency[0] is a reasonable indicator but is pretty technical. There are other, easier to understand, data sources available:

- Earth Notes: GB Grid Intensity[1] gives a simple traffic light indication

- GridCarbon[2] is a real-time carbon intensity app (CO2 Modeller[3] is from the same guys)

- MyGridGB[4] shows similar data on the web (and includes Solar data[5])

By avoiding peak time you may not save money but you can save carbon.

[0]: http://www2.nationalgrid.com/uk/Industry-information/electri...

[1]: http://www.earth.org.uk/_gridCarbonIntensityGB.html

[2]: http://gridcarbon.uk

[3]: http://www.co2modeller.info

[4]: http://www.mygridgb.co.uk

[5]: https://www.solar.sheffield.ac.uk/pvlive

jsingleton··on Ask HN: Is it ok to use traditional server-side rendering these days?
Server-side rendering is absolutely fine. The only caveat I would add is that if you want to change some functionality to a client-side JavaScript app later then having dynamically generated HTML will make this harder. For example, if you want to make it work offline in the future then you will probably have to rewrite the presentation layer.

Razor views in ASP.NET Core are really nice (disclaimer, I wrote a book on this so I'm obviously biased). However, if you are making a Single Page App then you will need to stick to HTTP APIs (returning JSON, not HTML). The controllers in Core can easily do both now that MVC 6 and Web API 2 are merged and the same thing.

The only exception to this is for an initial rendering of your app server-side, so that the browser gets populated HTML on the first load and there is something to see immediately. For example, using ReactJS.NET you can load the same model into your Razor view that you return from your API and pre-render it using view helpers.

If you're interested then I wrote more about this today: https://unop.uk/react-and-asp-net-core/

P.S. Has this whole thread been hidden or flagged?

jsingleton··on Packt Publishing $5 eBooks and Videos
Full disclosure - my book on making high performance web apps (in ASP.NET Core) is one of these: https://www.packtpub.com/application-development/aspnet-core...
jsingleton··on Show HN: H4ck 1t, multiplayer hacking game
FYI there's a summary and video on the root domain: https://h4ck1t.com

Edit:

Turn your speakers down when you play the video if you don't like modem sounds.

This game looks fun. Reminds me a little of Uplink from 2001 (https://www.introversion.co.uk/uplink/).

jsingleton··on Google will now tell you whether a bar or shop is busy in real-time
First traffic, now this. Next up, how busy is your train?

It's not clear how they get the data for this. Assuming it's the same tech as for minor road traffic then it probably uses Google's location services on Android devices.

jsingleton··on Facebook Said to Create Censorship Tool to Get Back into China
Shadow-banning / hell-banning happens on HN too, but you're right that it's not a very nice way of moderating. Obviously, it's worse if it also gets you in trouble with the state. Manipulating people's view of the world is pretty dishonest in any case though.

I'm sure China would love to hide posts that mention 'Fatty Kim the Third' [0]. If you control the discourse then you can control what people think. We've seen this in both the UK and US recently. Russia have an agency dedicated to false information with sockpuppet accounts on social media [1] and the US has done related activities [2]. I'm sure other countries and interest groups have similar institutions. If you have an official integrated tool to do this work then it becomes so much easier. Worrying times.

[0]: http://www.reuters.com/article/us-china-northkorea-internet-...

[1]: https://www.theguardian.com/world/2015/apr/02/putin-kremlin-...

[2]: https://www.theguardian.com/technology/2011/mar/17/us-spy-op...

jsingleton··on Microsoft and Linux and Patents and Tweets
A bit off-topic but the image used suggests that MS have officially adopted the ninja cat riding a flame-breathing unicorn meme [^0]. They even added special emoji to Win 10 [^1].

[^0]: http://www.windowscentral.com/here-microsoft-ninja-cat-wallp...

[^1]: http://blog.emojipedia.org/ninja-cat-the-windows-only-emoji/

jsingleton··on Who’s Hiring? Who’s Firing? Checking in on Tech Jobs
Ja. See also the borrowed word Zeitgeist, literally time-ghost but more accurately the 'spirit of the age'.
jsingleton··on KestrelHttpServer SuperCharged MemoryPoolIterator
Ben has been once of the main external contributors to Kestrel and is a big reason of why it's so fast. Great work! I have no idea how he manages to do all of this and write a game at the same time.

https://www.techempower.com/blog/2016/11/16/framework-benchm...

https://www.techempower.com/benchmarks/#section=data-r13&hw=...

jsingleton··on Windows 10 Cannot Protect Insecure Applications Like EMET Can
MS have listened and pushed back EOL to mid 2018. Looks like they are still trying to encourage upgrades to Win 10 though.

From https://support.microsoft.com/en-us/kb/2458544:

> The Enhanced Mitigation Experience Toolkit

> We have listened to customers' feedback regarding the January 27, 2017 end of life date for EMET and we are pleased to announce that the end of life date is being extended 18 months. The new end of life date is July 31, 2018. There are no plans to offer support or security patching for EMET after July 31, 2018. For improved security, we recommend that customers migrate to the latest version of Windows 10.

jsingleton··on CoreCLR ARM 32-bit progress
Not sure of the specifics. Java SE is now included with the official OS (Raspbian/NOOBS) [0]. When the Pi first launched you had to use the soft FP version of the OS or Java wouldn't work but this had a significant performance penalty. They added official support for hard FP a few years ago [1]. I believe the .NET issue was similar in that the VM (CLR i.e. JVM) didn't support the hard FP version of the OS. FP on the Pi processor is a bit weird and a non-standard implementation from what I've read.

P.S. In researching this post I noticed that one of my projects (a globe wake lamp) has been included in the latest project book (p108) [2]. First I've heard of this! This is actually an old version and there is a newer write-up on my blog [3].

[0]: https://www.raspberrypi.org/downloads/noobs/

[1]: https://www.raspberrypi.org/blog/oracle-java-on-raspberry-pi...

[2]: https://www.raspberrypi.org/magpi-issues/Projects_Book_v2.pd... [pdf]

[3]: https://unop.uk/pi-glowbe-mark-2/

jsingleton··on CoreCLR ARM 32-bit progress
Nice work. It will be great to use ASP.NET Core on a Pi with official support.

I tried .NET out on the Pi using Mono, years ago when it was relatively new but after the software floating point OS was deprecated. The weird hardware floating point CPU made it pretty much unusable. Even simple things like DateTime objects would fail to work correctly.

Similar issues were in Java IIRC but they had a special build of that. I think Sony had a fixed build of Mono but I haven't tried it. It will be good to have official .NET support outside of Win 10 IoT.

jsingleton··on Decrypting TLS Browser Traffic with Wireshark (2015)
As others here are pointing out, with passive monitoring (i.e. Wireshark) you can't decrypt Perfect Forward Secrecy (PFS) traffic even if the private keys are known / later discovered. This is by design and is the great thing about ephemeral Diffie-Hellman key exchange. The private keys would only allow you to impersonate the server in an active attack, not decrypt a new direct connection.

The key is never transmitted (even in encrypted form), unlike with RSA. A good way of thinking about this is with a colour mixing analogy. I had a go at explaining this (with a Lego stormtrooper) here: https://unop.uk/understanding-encryption-and-key-exchange/

jsingleton··on Decrypting TLS Browser Traffic with Wireshark (2015)
Worth pointing out that Charles isn't free [0], unlike Fiddler. It used to be that on Mac/Linux you didn't have many choices but there is now a Beta of Fiddler for Mac and an Alpha for Linux (using Mono) [1].

[0]: https://www.charlesproxy.com

[1]: https://www.telerik.com/download/fiddler

jsingleton··on Decrypting TLS Browser Traffic with Wireshark (2015)
Fiddler is great. Hadn't heard of NetRipper. Will take a look, thanks.

Also worth considering is Microsoft Message Analyzer, which used to be Network Monitor (NetMon). https://blogs.technet.microsoft.com/MessageAnalyzer/

Edit: I should add that this isn't an endorsement, just another option. I only included MMA as a side-note in my recent book. I focussed on Wireshark and Fiddler to keep things simple.

jsingleton··on .NET Framework – What's New in C# 7.0
I think if you're writing property accessors manually then there should be an explicit private backing field. Otherwise there is just too much magic going on.

Normal auto-implemented properties are fine:

  public string LastName {get; set;}
As are read-only ones:

  public string LastName {get; private set;}
Yet, I feel that if you are writing logic in there then you should fully control it. Or else there is too much being done that is non-obvious and could cause problems down the line (for others or your future self).

However, they might be able to achieve something with data annotations that wouldn't be too magic. For example:

  [RaisePropertyChanged("Batina")]
  public string LastName {get; set;}
Tip: In VS you can just type "prop" then press tab to auto-generate the code for a class property. You can then easily auto-change this to a fully implemented version. This also works for "for" and "foreach" loops etc.

I haven't done much Java in a while but do you still have to write out all of your property accessors fully? Might not be too bad if the IDE can generate this code.

jsingleton··on Site requests bank logins for online purchases
As a Brit I was surprised when I received a reply on Twitter to a blog post I wrote [0] that said:

  ...in Germany nearly 80% of transactions are still cash - lots of places that simply don't take cards
Reading this thread that now makes more sense. We have it pretty good in the UK with contactless and chip & PIN (although I hear the Dutch have it better). I always feel the US is so backwards when I visit and they do the stripe & sign thing.

However, I still think there are many reasons cash should always be accepted. I won't repeat them here as they're covered in the post.

[0]: https://unop.uk/do-you-accept-cash/

jsingleton··on Visual Studio for Mac Preview
Xamarin Studio didn't support .NET Core, so previously you had to use the CLI tools and an editor like VS Code. You could run ASP.NET MVC in XS (version 5, Core is effectively version 6) but this ran on Mono.

Visual Studio for Mac (aka XS vNext) does now support ASP.NET Core so there is less need for VS Code. The re-brand makes sense (it's not just for Xamarin now). However, Code runs on more platforms (Linux, ARM etc.) and is also used in the browser as part of Azure.

I wrote a better summary of the differences here: https://unop.uk/getting-started-with-c-sharp-and-cross-platf.... It's the last in a four part blog series about .NET on Mac.

jsingleton··on Connect 2016 [video]
Wednesday, November 16th

10:00am - 12:30pm EST (15:00am - 17:30pm GMT): Keynotes by Scott Guthrie and Scott Hanselman

I suspect a big announcement about .NET on Mac. :)

jsingleton··on Why we need the best tools on Chromebooks and Raspberry Pi
Unless you are accessing the Pi over SSH you will probably be using a GUI. VS Code will be running inside the window manager (LXDE). It's not something you run from a CLI.

The main version of NOOBS has X starting by default these days. Even the standard Raspbian image has a GUI, but you can use the lite version for headless servers (https://www.raspberrypi.org/downloads/raspbian/). This is similar to Ubuntu Server but different to NOOBS lite, which is just a small network installer.

jsingleton··on Visual Studio for Mac
Ah OK, it was probably under embargo and got posted early by mistake. I've been to Connect(); before in a time zone ahead of the US and nothing gets announced in the morning until the US wakes up and the embargo is lifted.

Edit: FYI Connect(); is November 16th-18th starting 9:45am EST https://connectevent.microsoft.com

jsingleton··on Ask HN: Is Xamarin worth learning?
It depends. I've been pretty happy with Xamarin for what I'm doing (a game [0]).

If you are using basic Xamarin then you will end up writing separate UI code for each platform, but you can still share business logic if you architect if well. Xamarin.Forms is different and lets you share the UI too.

Even with Forms, you will always have some platform specific code, but this is normally small. For example, some implementation details when using SQLite.

[0]: I'm writing about this starting with https://unop.uk/cross-platform-native-mobile-app-development...

jsingleton··on Ask HN: Is Xamarin worth learning?
I couldn't get React Native working for Android (on either Mac or Windows) but I've been pretty happy with Xamarin. I've written a simple game in Xamarin.Forms that I will be posting about.

Purely by coincidence, I have four blog posts on this out this week. The first one (on React Native and Xamarin) is here: https://unop.uk/cross-platform-native-mobile-app-development...

jsingleton··on Visual Studio for Mac
Strange, not sure if this is a bug or if MS published too early and retracted it?

Edit: Thanks for the tip BTW. I had linked to this from a blog post, but have now removed the dead link (https://unop.uk/cross-platform-native-mobile-app-development...).

jsingleton··on Visual Studio for Mac
Yeah, for now you have to type the XAML but a designer is coming. There is a preview of a previewer but I couldn't get the one in VS to do anything. The XS previewer did work for me though. Make sure Android Studio / ADK is updated if only iOS is working.
← PreviousPage 6 of 24Next →