Better HN
topnewbestaskshowjobs
Log inSign up

andrewstellman

353 karma · joined Nov 19, 2017 (9y ago) · 55 submissions

O'Reilly Author, Agile coach, Manager, Team Lead, Developer

Website: https://www.stellman-greene.com

Twitter: @andrewstellman

Github: https://github.com/andrewstellman/

Submissions

comment 4y ago · link · parent

> Teaching how to code should be about problem-solving and effectively using the tools of a programming language to solve it. Say for example modeling a card game. Even better if the example is a continuous improvement starting from the very basics, hard coding stuff, and then increasing the scope as follows:

How funny! This is exactly the approach Jenny Greene and I took in Head First C# (O'Reilly), right down to the way we start with cards and suits, then ordering, building up to a complete card game.

2.

Learn C# with Visual Studio, Visual Studio for Mac and Unity (& win a free book)(devblogs.microsoft.com ↗)

2 points · by andrewstellman · 5y ago · discuss

comment 7y ago · link · parent

I'm seeing several people asking what RDF is useful for. If you're curious, I use it for basketball analytics: https://github.com/andrewstellman/pbprdf

Here's an article about my system, pbprdf: https://www.zdnet.com/article/nba-analytics-and-rdf-graphs-g...

And an example of its use: https://gist.github.com/andrewstellman/4872dbb9dc7593e56abdd...

Here's an example of what the RDF files generated by pbprdf look like:

Here's the ontology, which defines the vocabulary it uses: https://github.com/andrewstellman/pbprdf/blob/master/generat...

And this is what the data looks like:

  <pbprdf/games/2017-11-29_Warriors_at_Lakers/230> pbprdf:shotPoints "3"^^xsd:int ;
        pbprdf:shotAssistedBy <pbprdf/players/Klay_Thompson> ;
        pbprdf:shotType "26-foot three point jumper" ;
        pbprdf:shotMade "true"^^xsd:boolean ;
        a pbprdf:Shot ;
        pbprdf:shotBy <pbprdf/players/Stephen_Curry> ;
        a pbprdf:Play ;
        pbprdf:forTeam <pbprdf/teams/Warriors> ;
        pbprdf:inGame <pbprdf/games/2017-11-29_Warriors_at_Lakers> ;
        pbprdf:time "10:23" ;
        pbprdf:period "3"^^xsd:int ;
        a pbprdf:Event ;
        rdfs:label "Warriors: Stephen Curry makes 26-foot three point jumper (Klay Thompson assists)" ;
        pbprdf:secondsIntoGame "1537"^^xsd:int ;
        pbprdf:secondsLeftInPeriod "623"^^xsd:int .

4.

Tower of Silence(en.wikipedia.org ↗)

4 points · by andrewstellman · 7y ago · discuss

5.

The Most Popular Health Articles of 2018, a Scientific Credibility Review(healthfeedback.org ↗)

1 points · by andrewstellman · 7y ago · discuss

comment 7y ago · link · parent

> The team realized that the process could be reversed: given a computer model of a 3D object, the researchers calculated what it would look like from many different angles, and then fed the resulting 2D images into a ordinary slide projector.

I'm pretty sure the researchers were using a normal computer projector and not a slide projector. But in my imagination, they printed a bunch of slides, fed them into a carousel projector, and pointed them at an old Smuckers jelly jar full of resin.

comment 7y ago · link · parent

> And unlike with object recognition that uses cameras, there are no privacy concerns, or need to maintain line-of-sight or good lighting conditions. Radar works through different materials and in the dark as well as the light.

Wait, what? The ability to see through walls and not require line of sight leads to fewer privacy concerns?

Seems to me the privacy concerns are significantly greater for radar than facial recognition. Radar can see places that cameras can't, and while it doesn't capture color information, it does capture detailed 3D data that camera-based systems need to interpolate.

Plus, you know, the whole working through walls thing. Seems like there are at least as many opportunities for abuse as with facial recognition technology.

comment 7y ago · link · parent

Well, yes, you're right – like beauty, readability is in the eye of the beholder. I've been writing a ton of Scala code lately, and my version is very Scala-like, so it looks better to me.

That said, I think there are several advantages:

• It's more compact, with fewer lines and fewer characters, but at least as readable

• There's simple separation of concerns: it only has a single print statement – the whole range is transformed, then printed – which makes it easy to refactor later if I need to use those values for something other than printing

• It's obvious that all of the cases are handled

• In an amazing coincidence, it looks like code I write :) so I personally prefer it

If you're implying that there are times that if/elif/else syntax is more readable than pattern matching, then yes, absolutely! There are times when one is preferable, and times when the other is.

Pattern matching is especially nice when you need to include conditionals and types:

  vehicle match {
     case car: Car if (car.passengers > 2) => addToHovLane(car)
     case truck: Truck                     => reject("No trucks allowed")
     case _                                => totalTraffic += 1
  }
There's a lot of casting going on there, and it's all handled in the pattern match. Converting this to if/else statements would require a lot of type tests and intermediate variables. Personally, I think that would make things harder to read.

That said, sometimes (often!) the more compact code is, the harder it is to read. I think it's always worth taking a few extra characters to improver readability. So I only use pattern matching with types and discards when I think it makes the code more readable and more flexible (e.g. easier to refactor, improves separation of concerns).

BTW, thanks for pushing back on this. I'm working on the 4th edition of Head First C# (O'Reilly), and C# added syntax very similar to this (borrowed from F#). Writing this reply gave me the opportunity to start thinking through how I want to teach it.

comment 7y ago · link · parent

I've been looking for an example that shows how pattern matching can make code much both compact and readable. I think this does nicely. Here's an example in Scala:

  (1 to 100).map(i => (i % 3, i % 5) match {
    case (0, 0) => "FizzBuzz"
    case (0, _) => "Fizz"
    case (_, 0) => "Buzz"
    case _ => s"$i"
  }).foreach(println)
Compare that to the rest of the examples on the page. The only one that comes close in either readability or compactness (in my opinion) is the Rust example, mainly because it's syntactically almost identical, just a bit more verbose. I'm really excited that C# 8 will support similar syntax with _ discards.

comment 7y ago · link · parent

I remember it running autonomously on the little roads in Schenley Park, which were wide just enough for the vehicle but not open to traffic. Unfortunately, I never learned what happened to the jogger.

comment 7y ago · link · parent

When I was studying computer science at Carnegie Mellon in the '90s, I played bass in a band, and the guitar player was a grad student at the Robotics Institute working on the autonomous vehicle project, the reason CMU was part of the consortium in the article. NavLab 2 was an Army Humvee with a laser scanner mounted on the front, along with some cameras and a bunch of other sensors, and some powerful-at-the-time computers (Sun SPARCstations, IIRC) in back. It was a pretty impressive sight: https://www.cs.cmu.edu/Groups/ahs/images/navlab_1_5_images/n...

It was usually parked in the Field Robotics garage, but if you went out early on a weekend morning, you might catch it driving itself slowly around Schenley Park (which is right next to CMU campus) – without anyone at the wheel, which was really unreal and sci-fi-ish at the time.

I remember one story of a jogger who was surprised to suddenly run across it. The story goes that the he or she screamed and actually fainted. The truck was programmed to stop if it found itself in front of any obstacle, so when the jogger came to, there was the truck looming above.

I have no idea if the story is actually true, but I like it anyway.

comment 7y ago · link · parent

This is such a great story. Congratulations on turning things around!

https://twitter.com/AndrewStellman/status/107722796317793484...

13.

New England Journal of Medicine photo series of medical anomalies(nejm.org ↗)

4 points · by andrewstellman · 7y ago · 1 comment

comment 8y ago · link · parent

I've known people who lived a life very similar to the one this person describes: moving from town to town, making art wherever they go, meeting new people, floating from relationship to relationship, not much money or stuff to their name, nothing really tying them down. The difference is that they were the sort of people who said "f_ck 'normal' society and its expectations" – an attitude that I don't see much these days – and, maybe as a result of that attitude, they were really happy people.

> I used to think I was the one who had it all figured out. Adventurous life in the city! Traveling the world! Making memories! Now I feel incredibly hollow. And foolish. How can I make a future for myself that I can get excited about out of these wasted years?

I hope she can learn to stop thinking about those years as wasted. She saw and did things that most people never get to see or do because they're too busy working. Plenty of 35-year-olds are in debt, upside-down on their houses, in miserable marriages, and just a few years from getting divorced, buying a convertible, and dating someone inappropriately young for them. More than a few of them would envy her life.

15.

Antinomianism – “to the pious, all is allowed”(en.wikipedia.org ↗)

1 points · by andrewstellman · 8y ago · discuss

comment 8y ago · link · parent

The vast majority of players won't realize that they can run untrusted code just by typing a few characters into a chat window. To be fair, most chat windows don't work that way.

17.

The Chymistry of Isaac Newton(webapp1.dlib.indiana.edu ↗)

1 points · by andrewstellman · 8y ago · discuss

comment 8y ago · link · parent

One of the biggest misconceptions about markets is that the most recent trade price is the current value. But that's not actually true – it's approximately true in heavily traded markets (like S&P 500 stocks). But for a much less frequently traded market (like brownstones in Park Slope, Brooklyn or apartments in downtown Minneapolis) where there are only a handful of transactions each week, the price doesn't actually reflect value. It reflects the most recent price paid – and if there aren't a lot of buyers, then the actual value is lower than that price.

Most people who have done a lot of options trading have seen this in practice: if you're trying to sell a really thinly traded option RIGHT NOW, most of the time the latest price is a higher than the price you'll get. That's because there was only one buyer at the time, and someone else got that person's bid. So now you'll have to go to the next-most-interested buyer, and you'll probably need to lower your asking price a bit because otherwise he or she would have been the most recent buyer.

All of this is masked in heavily traded markets. But it's a lot more apparent in housing. However, that's complicated by the fact that people REALLY HATE lowering their asking price, so instead of seeing prices drop, housing markets typically just see volume go down. And recent lower transaction prices are often dismissed by sellers ("That person was just desperate to sell, I'm going to wait for someone to pay what my house is worth").

19.

Shibuya 109 emoji(emojipedia.org ↗)

2 points · by andrewstellman · 8y ago · discuss

20.

Understanding C#: Use System.Console to build text-mode games (2010)(web.archive.org ↗)

1 points · by andrewstellman · 8y ago · discuss

21.

Lactose content in typical Italian Gorgonzola cheese: a pilot study (2012)(link.springer.com ↗)

1 points · by andrewstellman · 8y ago · discuss

comment 8y ago · link · parent

"Practical" is right – a seemingly "theoretical" exploit turns out to have serious practical implications. This is a really well-written article with lots of examples.

Excellent work!

23.

Kaomoji: Japanese Emoticons(kaomoji.ru ↗)

13 points · by andrewstellman · 8y ago · 5 comments

24.

Thagomizer(en.wikipedia.org ↗)

4 points · by andrewstellman · 8y ago · discuss

comment 8y ago · link · parent

Yep. Here's the line that prints it – open a new Chrome tab (ymmv w/ other browsers, definitely looks weird in Safari), open developer tools, and paste it into the console:

console.log("%c\t\t\t\t\t\t\t\t\t\t\t\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n Hi there! \n\nIt seems you like to poke around as much as we do.\n\nhttps://github.com/Microsoft/join-dev-design", "color: white; background-color: #080808; background-image: url(https://microsoft.github.io/join-dev-design/msft-square.svg)... background-size: 70%; background-position: 50% 25%; background-repeat: no-repeat; padding: 3em; text-align: center;font-size: 1.25em;");

26.

52-hertz whale(en.wikipedia.org ↗)

232 points · by andrewstellman · 8y ago · 34 comments

27.

Patrick Stewart was mistakenly cast for Dune and had no idea who Sting was(syfy.com ↗)

2 points · by andrewstellman · 8y ago · discuss

comment 8y ago · link · parent

This article talks about my open source RDF basketball analytics project: https://github.com/andrewstellman/pbprdf

The author links to the Hacker News thread where he learned about it: https://news.ycombinator.com/item?id=16542183

Happy to answer questions.

29.

NBA analytics and RDF graphs: Game, data, metadata evolution, and Occam's razor(zdnet.com ↗)

1 points · by andrewstellman · 8y ago · discuss

30.

Distracted people can be 'smell blind'(eurekalert.org ↗)

3 points · by andrewstellman · 8y ago · discuss

12