HNHacker News
TopNewBestAskShowJobs

tylerneylon

2,127 karma · joined July 3, 2011

code: https://github.com/tylerneylon personal: http://tylerneylon.com

Email: tylerneylon@gmail.com

submissionscomments
tylerneylon··on Brian's Rules for Writing Cross Platform 'C' Code (2008)
I recently published an open source win/mac wrapper library in C. It is not well tested, and only covers the specific subset of functionality I needed for my current project. It may still be useful for others learning which pieces of each os handle which common tasks - things like CoreGraphics vs GDI, file system quirks, how to play audio, etc.

https://github.com/tylerneylon/oswrap

tylerneylon··on Brian's Rules for Writing Cross Platform 'C' Code (2008)
gcc and clang can handle mixed Objective-C and C++ in a single source file (some call it Objective-C++). The only tricky part is linking since C++ and ObjC++ use a different symbol name convention than C/ObjC; but you can still link between them by using extern "C" declarations in the right places.
tylerneylon··on Posical, the Positivist Calendar for Python
Another mathematically elegant calendar is the 7date:

http://tylerneylon.com/a/7date_spec/

tylerneylon··on Deeply Moving: Deep Learning for Sentiment Analysis
Structured sentiment analysis has been around for a while - meaning models that take into account the overall document as more than just a bag of words (reference below to a 2007 Google paper). There are a surprising number of challenges for those new to the problem, e.g. sarcasm or idioms. It's kind of fun to work on.

http://acl.ldc.upenn.edu/P/P07/P07-1055.pdf

tylerneylon··on Learn Lua in 15 Minutes
Ramanujan and Hardy are two well-known mathematicians who collaborated in Britain between 1914 and 1920. One day Hardy took taxi number 1729 to visit Ramanujan, and remarked to him that he (Hardy) could think of nothing special about the number (1729). Ramanujan replied that it was in fact the first number expressible as the sum of two cubes in two different ways (1^3 + 12^3 = 9^3 + 10^3). The story has since become an anecdotal symbol of Ramanujan's brilliant mind.

http://en.wikipedia.org/wiki/1729_(number)

That's a very obscure reference, though, so I apologize for sending anyone looking based on my previous comment.

tylerneylon··on Learn Lua in 15 Minutes
You have a keen eye for subtle references! I didn't expect many people to get that one :) There's another math anecdote reference hidden in there as well - probably even more obscure than Karl's sum.
tylerneylon··on Learn Lua in 15 Minutes
Thanks. My goal was to write the tutorial I wish I had when I started. Your description also matches my own preferred learning style.
tylerneylon··on Learn Lua in 15 Minutes
yep; fixed
tylerneylon··on Learn Lua in 15 Minutes
The title is a bit optimistic :) That's how long it takes me to read as if I were reading a novel, which isn't quite fair.

I wanted to express something like "hey, this guide is for programmers and is surprisingly short and easy to consume considering it covers the large majority of the language." The current title seemed a bit snazzier.

tylerneylon··on Learn Lua in 15 Minutes
You're right; I fixed that part.
tylerneylon··on HN front page, 16000 visitors in a day, how many actually read the article?
As another data point, I recently had a 60% read rate on a post that was on HN's front page for a while.

It was a post on medium.com about Pac-Man. Medium tracks number of views and number of reads per day. I think they use a metric that's not just time-on-page to differentiate between views and reads. My post had about 26k views and about 15k reads the day it was on the front page.

tylerneylon··on A game when games were new
Wow, this is awesome. Features I love: practice mode; cookie-man mode (brilliant); and the learning section that visually explains the AI's.
tylerneylon··on A game when games were new
Games like these are relatively easy to make with modern game engines like Löve. There are many original indie games in early development worth checking out:

http://love2d.org/forums/viewforum.php?f=5

tylerneylon··on A game when games were new
Essentially yes. Day one had all the ghost AI's and power pellets and lives and death. No sound and no score, though. It was completely made possible by the game engine (Löve) and the excellent Pac-Man analysis by other authors like Chad Birch.

You can see the exact state of the game at day one:

git clone git@github.com:tylerneylon/pacpac.git

git checkout 4abf17ca62dffd2ac3245f6ab06cc28fb9021791

You can return to the latest commit later via:

git checkout master

You can get the game engine (required to play) from http://love2d.org .

tylerneylon··on A game when games were new
Thank you! Lua is great fun - very similar to javascript. The only weird part for me is that it's 1-indexed, but I see that as a feature for kids learning to program for the first time.

Also, the code for PacPac is not very clean. Just like javascript, globals in Lua are the default, easy to use, and require discipline to avoid :)

tylerneylon··on The Elsevier boycott one year on
I'd say the boycott has reached the point of crossing the chasm into adoption by mainstream users. There are still new people signing up all the time, but the pace is low.

A bottleneck to mainstream use is the lack of overlap between hackers/devs and people who are most influential in academic publishing, such as senior editors. To developers the question is: if editors want to post their articles on the web, why don't they just do that? To editors, the question is: how can I practically make my journal open access? There is a need for technology to assist in setting up open access journals.

Some people are working on solutions, but it's not obvious what that solution will ultimately look like. There is some trial and error happening, and I hope great progress is made while the problem has the attention of the community.

tylerneylon··on MIT can honor Aaron Swartz by fighting to make journals open to everyone
I agree that it's very difficult to change hiring attitudes to support open access publishing. I disagree that difficulty means it's a mistake to try.

Hiring/tenure attitudes can include respect for people who choose to avoid closed-access publishers. This doesn't punish people who continue to publish the old way. If done right, it only helps the careers of those who avoid closed journals.

By the way, I somewhat snarkily complained that your comment was snarky. That was hypocritical of me, at least in spirit. Sorry about that. I like non-snarky, straightforward comments.

I'm glad you're signed up at the cost of knowledge. My personal role in open access is mainly as the creator of that site.

tylerneylon··on MIT can honor Aaron Swartz by fighting to make journals open to everyone
Sometimes good changes need a (possibly emotionally-inspired) boost to make them possible. A small-scale example is a kickstarter campaign. A larger example is support for a bill that's bad for corporations but good for individuals.

The case of academic publishing is particularly strange. The following parties want articles to be freely available: the authors, universities, funding agencies, and the taxpayers who pay for some funding agencies. The flow of money is so perverse, and the culture of tradition so strong, that no one has a good immediate incentive to switch to open access, though.

This is an important problem because 99% of the world has no access to research that essentially everyone involved, except the publisher, wanted to be free. Or, if you think money is more important than access to research, consider that in 2011, Reed Elsevier made more money than any of these: Verizon, Nike, Mastercard, FedEx, Bank of America, Delta, or Amazon.com. And their huge profit margins come from a strongly inelastic, broken system that funnels money from our universities and taxpayers.

tylerneylon··on MIT can honor Aaron Swartz by fighting to make journals open to everyone
Why is this the top-rated comment? I could literally use it as a generic I-know-more-than-the-author comment on any article about a problem (replacing the quote and author's name of course). It provides no more information than that the commenter thinks there's something wrong with the quote that's pulled out of the article.

A good comment would at least say why you think it's a difficult problem (that the author has supposedly missed).

As far as hiring or giving tenure based on merit instead of journal prestige, this is achievable. It's hard because traditionally journal names are extremely important. But it's doable. When I was a grad student, I was personally aware of the process of hiring people in my field. The problem right now is that one person could say, "X is good but candidate Y has two articles in Awesome Journal, so Y seems better." That statement implies Y has good work, but we need to make room for the reply, "Yes, but X has done better work and avoided Awesome J. because it's closed access." It's an attitude shift, which is hard, but doable.

tylerneylon··on Academics posting their papers online in tribute to Aaron Swartz
There are still many papers left behind paywalls. It does depend on the field you're in, as reflected by other comments.

I left academia years ago but continue to (try to) do research. Resources like scholar.google.com can often help find a free-to-read version of a paper, which is great. But access to a single key paper can make or break your progress. I've personally dropped many, many hours of work because of this problem - I couldn't reasonably access key literature that I needed.

tylerneylon··on Show HN: Pivit, an elegant game with simple rules and masterful strategy
I understand that the price is on the high end for a board game funding goal. I see craftsmanship and high quality as part of what the game is, fundamentally. It feels different to play chess in an app, with a cheap chess set, and with a finely crafted board and set of pieces; and I care about that difference.
tylerneylon··on How To Do Philosophy (2007)
Some commenters are defending modern philosophy, but I think there is something legitimately wonky in the discipline. I can't figure out the best way to describe it, but, to state it poorly, studying philosophy often feels like filtering out a ton of BS.

I'm saying it's all BS (it's not) but that there's too much.

I don't think it has to be that way. Example ideas:

* Writing in philosophy could be improved (http://tylerneylon.com/a/writing-about-philosophy/)

* The attitude toward 'what is philosophy?' could be improved (http://www.richardprice.io/post/35542139118/one-hypothesis-a...)

tylerneylon··on Redis crashes - a small rant about software reliability
The memory check algorithm is a nice solution of the challenges he presents - easy to understand and effective.

Here is a variation which, unless I'm missing something, would be a little simpler still and require less full-memory loops:

1. Count #1's in memory (possibly mod N to avoid overflow). 2. Invert memory. 3. Count #0's in memory. 4 Invert memory.

I think this would catch the same errors (stuck-as-0 or stuck-as-1 bits).

One difficulty is that multiple errors could cancel each other out, at which point you can do things like add checkpoints in the aggregation, or track more signals such as number of 01's vs number of 10's. In the end, this is like an inversion-friendly CRC.

tylerneylon··on No Studying After 5pm: Using Parkinson’s Law to Kick Procrastination’s Ass
Student life is not always easier than work life. The level of 'freedom and perks' you feel depends more on the culture of your cohort/workplace and your commitment than on being a student vs having a job.

I went from grad school to Google in nyc, where the working culture supported going home by around 6pm. That felt like the opposite of grad school, where I regularly slept in my office.

tylerneylon··on Show HN: hackathon for introverts
This is cool.

font-weight: bold;

would increase readability.

tylerneylon··on Using python and k-means to find dominant colors in images
I'm guessing this is a solved-many-times problem :) Here is my own version of the same thing:

http://tylerneylon.com/a/imghist/ (and source) https://github.com/tylerneylon/imghist/blob/master/imghist.p...

That also includes color histograms.

Thoughts on actually using this:

* If a human is using the color output, it's fun to weigh the colors by cluster sizes. * To find human-perspective dominant colors, it helps to throw out very-light/dark pixels. * Dribbble does a very good job of this - look at any of their individual photo pages. * For production use, C would be much more appropriate at solving this problem (but python is more fun to use).

Another cool application of color analysis like this:

http://www.vijayp.ca/blog/2012/06/colours-in-movie-posters-s...

tylerneylon··on A new kind of fractal?
It's possible that what we're looking at is based on the map f(z) = 1/z applied to the cartesian coordinate grid.

This is old-school, but a long time ago I wrote a java applet to help explore this function on the complex plane:

http://www.math.nyu.edu/~neylon/applet1/

If you move around the red square, you see a lot of the circular shapes that look similar to those in the fractal.

I don't completely understand the algorithm being used, so I'm not sure how to gain more confidence on this guess.

tylerneylon··on Big-O Misconceptions
Upper bound != worst case, though I can see why the language is confusing.

When we have a timing function f(n) we pretend f has one input, which is n = the size of the input to the algorithm. In reality, it's actually more like f(n, m) where m = a parameter specifying the _exact_ input to the algorithm. (Example: sorting algorithms have many possible input lists of length n.)

So when we write f(n) = O(g(n)), we are trying to make two simplifications: (1) Simplify away the actual input, replaced by only the _size_ of the input; and (2) simplify the actual function f to something that describes f but is much simpler.

I will make up an artificial example that is not perfect but is useful to explain the ideas. Suppose for any input size n we have parameters m in the range [-n-sin(n), n+sin(n)] and the exact timing function

f(n, m) = n + sin(n) + m

Then the first simplification is to determine how to ignore m. We could pick out the best m for n (the smallest f(n, m) for a fixed n), pick out the worst m, or take the average over all m. This is best-case, average-case, and worst-case complexity. For this function, we have:

f(n) = 0 [best case] f(n) = n + sin(n) [avg case] f(n) = 2(n + sin(n)) [worst case]

Then we could get an upper bound on _any_ of these.

f(n) = O(1) [best case] f(n) = O(n) [avg and worst case, not always the same, but they are the same in this example]

If we wanted a lower bound, we could say that

f(n) = Omega(n) [avg & worst case]

because f(n) >= n - 1 for all n (in general there could be more room for flexibility on the right-hand side, but it's not needed in this example).

The point here is that step 1 chooses a simplification across input instances, that we call worse case or average case, etc; and step 2 chooses a simplification in how to write down the function f(n), and this is what we call an upper bound for big-oh, or for theta, both an upper and lower bound.

tylerneylon··on Big-O Misconceptions
For folks who genuinely love math (I do!), there's a great but little-known book by Hardy called Orders of Infinity that can help readers grok the possibilities of big-oh notation. It's not about algorithms, but about getting a solid understanding of the many ways functions can behave as n goes to infinity. As a bonus, it's a short (< 100 page) book.

If you're more of a CS person than a mathy, I recommend Sipser's Introduction to the Theory of Computation. This one is written in friendly yet precise terms, and I found it a pleasure to read.

tylerneylon··on Big-O Misconceptions
I am curious to see how many HN-reading developers agree that big-O "really means" or "should mean" an expression of exact complexity (like theta does traditionally). I disagree.

There is an extremely active world of researchers and many (I believe) developers for which big-O definitely and clearly means "upper bound" and not the stronger theta notation. Basically all research papers in CS use O as an upper bound, and those, to me, are the definitive active voices. Beyond that, purposefully confounding O and theta is actually clashing different ideas together - ideas that have been separated for their utility. Often knowing the O notation requires some thought, and knowing theta is even harder; in practice what is most concerning is an upper bound, so that idea is important and useful. If the default object in language became exact complexity (not an upper bound), our lives would be much more difficult -- the practical thing to talk about would end up being whatever new notation replaced the idea of upper bound for complexity (aka the "traditional" big-oh).

← PreviousPage 4 of 7Next →