HNHacker News
TopNewBestAskShowJobs

zwegner

1,066 karma · joined February 12, 2013

https://github.com/zwegner https://twitter.com/zwegner zwegner@gmail.com
submissionscomments
zwegner··on Python Multiple Assignment Is a Puzzle
With Python's evaluation/assignment order, both parts of a complex assignment happen at once--which is the source of the weird behavior in the article (A[0] is assigned to before the subscript of A[A[0] - 1] is evaluated).
zwegner··on Game about squares
Tiny bug report: after clicking on the levels and going back to level 0, all of the buttons on the sides disappear.
zwegner··on Python Multiple Assignment Is a Puzzle
The first--the latter isn't in order (expr3 is "evaluated" before expr2, which in this case means assignment).
zwegner··on Game about squares
Shouldn't that 16 be a 256? 4 squares with 4 orientations each = 4^4 = 256.

But yeah, definitely pretty doable with a brute-force memoized search. I imagine a lot of state space could be pruned by doing some analysis of when squares can only move further away from their home dots (and not be turned around or pushed back or anything).

zwegner··on Hold the Phone: A Big-Data Conundrum
Seems like a lot of this speculation could be replaced by a few benchmarks to see whether the phone actually got slower... but I guess that would take more time than looking at a Google trends graph.
zwegner··on IPFS: The Permanent Web
Looks fairly similar to PPSPP: https://datatracker.ietf.org/doc/draft-ietf-ppsp-peer-protoc...

Both look pretty cool, I'd like to see some more traction in this area.

zwegner··on Chemical Calligraphy [pdf]
> 3D information is impossible to be fully represented in 2D no matter how hard you try

Nit: it is possible. Maybe not in a simple human-readable way, but there are mappings, such as [0]. A simple example is representing a 2D bitmap image as a 1D string of bits, which could easily be generalized to 3D as well.

[0] https://en.wikipedia.org/wiki/Space-filling_curves

zwegner··on The voodoo of lobster economics
Relevant xkcd: https://xkcd.com/1268/
zwegner··on Electric life forms that live on energy
> Perhaps before too long we'll grow computers rather than manufacturing them.

Check this out: https://www.youtube.com/watch?v=WhGG__boRxU

Perhaps my favorite TED talk, it was quite mind-blowing to me.

zwegner··on Random Solutions are Often Good Enough
As a general rule, when anybody refers to a problem being NP-hard or whatever, they're talking about a generalized version of the problem, with at least one "size" variable--the time complexity has to be polynomial/exponential/whatever in something.

9x9 Sudoku has a constant size, which means that it can be evaluated in O(1) time, if such notation makes sense.

zwegner··on Inverter
OK, so it's fixed now. Tested in Firefox, Chrome, and Safari. As soon as rawgit refreshes its copy, the new version will be live.
zwegner··on Inverter
Ah, yes, I had forgotten that I didn't test in anything other than Firefox. I'm very much not a web developer--working with JS is really quite a pain, and I had to use as much ES6 magic as possible to make it tolerable. Looking now into Traceur to de-ES6ify the code...
zwegner··on Inverter
Huh, I just made a pretty similar game a couple weeks ago.

Mine is different in that it it's way less polished, starts with a randomly-initialized grid, and rows/columns that are all the same color disappear (so the goal is to make them all disappear).

It wasn't quite fun enough for me to clean it up more, but it was mildly amusing for a while. It's here in case anyone would like to try: https://rawgit.com/zwegner/switchy/master/switchy.html (or the source repo: https://github.com/zwegner/switchy)

zwegner··on Show HN: Show HN
I guess the filter should only include titles with a colon after the "Show HN". Right now there's the story from yesterday: "Show HN vs. TechCrunch vs. Product Hunt: what's most effective to launch a product".

(Is it weird that the first thing I did was to see if this story was there?)

zwegner··on Homomorphic encryption implementation
You can do arbitrary computations, but you only get the encrypted result. So you can't actually tell whether x == y unless you have the key.
zwegner··on OS X Command Line Utilities
cd is a shell built-in, not an external command. It has to be, since it changes the directory of the shell process, which can't be done by a child process. So shells do have to implement this specially.
zwegner··on Today at 16:53:20 GMT, it'll be 1400000000 in Unix time.
<super-pedantic-mode>That's actually fixed-point, since the decimal point is always in the same place, right after the year.</super-pedantic-mode>
zwegner··on Large Public Datasets
Some of the links got truncated by Quora, so here's the same list (modulo intervening wiki edits) with full URLs:

  http://usgovxml.com
  http://aws.amazon.com/datasets
  http://databib.org
  http://datacite.org
  http://figshare.com
  http://linkeddata.org
  http://reddit.com/r/datasets
  http://thedatahub.org
  http://ckan.net
  http://quandl.com
  http://www.growmeme.com/overview
  http://www.kdnuggets.com/datasets/index.html
  http://enigma.io
  http://archive.ics.uci.edu/ml/
  http://crawdad.org/
  http://data.austintexas.gov
  http://data.cityofchicago.org
  http://data.govloop.com
  http://data.gov.uk/
  http://data.medicare.gov
  http://data.seattle.gov
  http://data.sfgov.org
  http://data.sunlightlabs.com
  https://datamarket.azure.com/
  http://developer.yahoo.com/geo/geoplanet/data/
  http://econ.worldbank.org/datasets
  http://en.wikipedia.org/wiki/Wikipedia:Database_download
  http://factfinder.census.gov/servlet/DatasetMainPageServlet
  http://ftp.ncbi.nih.gov/
  http://gettingpastgo.socrata.com
  http://googleresearch.blogspot.com/2006/08/all-our-n-gram-are-belong-to-you.html
  http://books.google.com/ngrams/
  http://medihal.archives-ouvertes.fr
  http://public.resource.org/
  http://rechercheisidore.fr
  http://snap.stanford.edu/data/index.html
  http://timetric.com/public-data/
  https://wist.echo.nasa.gov/~wist/api/imswelcome/
  http://www2.jpl.nasa.gov/srtm
  http://www.archives.gov/research/alic/tools/online-databases.html
  http://www.bls.gov/
  http://www.crunchbase.com/
  http://www.dartmouthatlas.org/
  http://www.data.gov/
  http://www.datakc.org
  http://dbpedia.org
  http://www.delicious.com/jbaldwinconnect/DataSets
  http://www.faa.gov/data_research/
  http://www.factual.com/
  http://research.stlouisfed.org/fred2/
  http://www.freebase.com/
  http://www.google.com/publicdata/directory
  http://www.guardian.co.uk/news/datablog
  http://www.infochimps.com
  http://www.kaggle.com/
  http://build.kiva.org/
  http://www.nationalarchives.gov.uk/doc/open-government-licence/open-government-licence.htm
  http://www.nyc.gov/html/datamine/html/home/home.shtml
  http://www.ordnancesurvey.co.uk/oswebsite/opendata/
  http://www.philwhln.com/how-to-get-experience-working-with-large-datasets
  http://www.imdb.com/interfaces
  http://imat-relpred.yandex.ru/en/datasets
  http://www.dados.gov.pt/pt/catalogodados/catalogodados.aspx
  http://knoema.com
  http://daten.berlin.de/
  http://www.qunb.com
  http://databib.org/
  http://datacite.org/
  http://data.reegle.info/
  http://data.wien.gv.at/
  http://data.gov.bc.ca
  https://pslcdatashop.web.cmu.edu/
  http://www.icpsr.umich.edu/icpsrweb/CPES/
zwegner··on Corecursion
> Minimax algorithm: https://en.wikipedia.org/wiki/Minimax (I actually generally use negamax, the non-corecursive version, but you should understand minimax first)

That's mutual recursion, not corecursion. Check the article out, corecursion has a much more... "mathematical" definition, relating to the types of initial data and final data.

By my quick reading, your second example might be considered corecursion (but I think is also just regular recursion). It might not be considered recursion at all, in this particular sense, as it's only one piece of infinite data, not a function that takes an input. I'm not the best algebraist though.

zwegner··on The Day I Started Lying to Ruth
Yeah, it's pretty crazy, I know that's just how she would feel. There's definitely lots of hope and love in me, but it's just really a lot for my brain to handle. I think it's going to take a while to fully process (if I ever do). When I was staying with her near the end I somehow managed to kick my not-coding streak and start a coding streak I've been keeping up with. Kinda helps to just keep my mind cranking along...

Thanks for the kind words. Even though there's the part of me that is saying all these emotions are pointless, it still feels good to hear things like that.

zwegner··on The Day I Started Lying to Ruth
But all of life does suck. It's also all beautiful, and amazing, and completely meaningless, yet full of meaning. To me it's all a big joke. Nothing makes sense.

Basically, yeah, it's more complicated than what I expressed in my comment. I used some poetic license.

But thanks, though.

zwegner··on The Day I Started Lying to Ruth
It's pretty weird. My mom just died of cancer a little more than a week ago. I thought it would be a bad idea to read this article, as it would just pointlessly make me (more) depressed. Yet, at the end, I really just felt numb to any emotion. There was just the same distinct sensation where nobody has any idea what I feel like, even this guy who just lost his wife. The more I think about it, the more it seems I don't really know what I'm feeling myself.

All the grief, anger, and beyond that, the feeling that any emotion I have is absolutely useless. I search for an explanation, all the while my brain is telling me that I'm stupid for even looking. What's the point of explaining what I'm going through to anyone? What can they do?

I don't really know what my point is. I'd be tempted to just say "life sucks", but I'd rather not be unreasonably pessimistic.

But then again, my mom just died.

Life. Fucking. Sucks.

zwegner··on Ask HN: Idea Sunday
This was discussed a couple weeks ago: https://news.ycombinator.com/item?id=7606310

Long story short, there's browser extensions for this.

zwegner··on A new book compiles knowledge necessary for society to recover after disaster
Thanks, that looks really awesome, starting to watch now.

Some really cool music in it too, featuring Edgard Varese!

zwegner··on Why CPUs aren't getting any faster (2010)
Hey, thanks for the critiques, a lot of them I don't really have a good answer for. A lot of these issues are not fully clear in my head (I haven't really CPU design either besides very basic college level VHDL stuff), and I'm not familiar with all of the current (or even past) research. A lot of my opinions come from my somewhat nebulous experience in the industry, and a lot of that is just what I've picked up from talking with people that would know (and that I'd rather not get too into on a public forum). There's definitely some hand-waving in there too, trying to be provocative and idealist :)

I'm mostly a software/compiler guy, where I know there can be a whole lot of improvement (especially in mainstream tools, not just toy/research projects), but my impression is that hardware isn't much better off. You've given me some good pointers for further topics to research, though. My email is in my profile if you want to chat more about this stuff!

zwegner··on Why CPUs aren't getting any faster (2010)
The article doesn't really seem to answer the question the title says it does.

Of course there's the well-known reasons, nonlinearity of power vs frequency scaling, diminishing returns in hardware design, etc. But there are others that we don't hear so much about.

Hardware design is still in pretty nascent stage, technology-wise. The languages used (say SystemC or Verilog) offer very little high-level abstraction, and the simulation tools suck. Sections of the CPU are still typically designed in isolation in an ad-hoc way, using barely any measurements, and rarely on anything more than a few small kernels. Excel is about the most statistically advanced tool used in this. Of course, CPUs are hugely intertwined and complicated beasts, and the optimal values of parameters such as register file sizes, number of reservation stations, cache latency, decode width, whatever, are all interconnected. As long as design teams only focus on their one little portion of the chip, without any overarching goal of global optimization, we're leaving a ton of performance on the table.

And for that matter, so is software/compiler design. The software people have just been treating hardware as a fixed target they have no control over, trusting that it will keep improving. That makes us lazy, and our software becomes more and more slow, by design (The Great Moore's Law Compensator if you will, also known as https://en.wikipedia.org/wiki/Wirth%27s_law).

The same problems we see in hardware design, huge numbers of deeply intertwined parameters, also applies to software/compiler design. We're still writing in C++ for performance code, for chrissakes. And even beyond that, the parameters in software and hardware are deeply intertwined with each other. To optimize hardware parameters, you need to make lots of measurements of representative software workloads. But where do those come from, and how are they compiled? Compiler writers have the liberty to change the way code is compiled to optimize performance on a specific chip (even if this isn't done so much in practice). To get an actually representative measurement of hardware, these compiler changes need to be taken into account. Ideally, you'd be able to tune parameters at all layers of the stack, and design software and hardware together as one entity. That is, make a hardware change, then do lots of compiler changes to optimize for that particular hardware instantiation. This needs to be automated, easy to extend, and super-duper fast, to try all of the zillions of possibilities we're not touching at the moment. There's even "crazy" possibilities like moving functionality across the hardware/software barrier. Of course it's a difficult problem, but we've made almost zero progress on it.

Backwards compatibility is another reason. New instructions get added regularly, but those are only for cases where big gains are achieved in important workloads. For the most part, CPU designers want improvements that work without a recompile, because that's what most businesses/consumers want. One can envision a software ecosystem that this wouldn't be such a problem for, but instead we have people still running IE6/WinXP/etc. Software can move at a glacial pace, and hardware needs to accommodate it. But this of course also enables this awfully slow pace of software progress.

zwegner··on Why CPUs aren't getting any faster (2010)
Depends on the application, of course. Haswell introduced some really cool new instructions (both the Bit Manipulation set as well as the Software Transactional Memory set). Don't have any numbers off-hand, but these can definitely speed up certain workloads.
zwegner··on Go’s map iteration order is random
Another good example is C++, std::map is (usually) a red-black tree.
zwegner··on Irony is ruining our culture
Huh? Alanis Morissette is a master of irony. She wrote an entire song about irony that doesn't contain a single ironic situation. It's so thick you can taste it.
zwegner··on Apple, Google to pay $324 million to settle conspiracy lawsuit
> Very cheap for the companies. But at least a good precedent to discourage such practices in the future.

does not compute

← PreviousPage 6 of 11Next →