185 karma · joined December 10, 2014
Her talk on react fiber this year is quite good as well: https://www.youtube.com/watch?v=ZCuYPiUIONs
It matches up with the "Low cost plan" from the USDA for 2014: https://www.cnpp.usda.gov/sites/default/files/usda_food_plan...
The average per person spending in the US is somewhere close to $300 per person if I recall correctly. Taking that into account with the time savings, and it's really quite cheap as a pure fuel source.
That said, I'll be taking a good look at Godot. Most of my projects are in 2D, and I end up filling in a lot of what Unity doesn't provide. Godot seems to be a better fit for 2D provided the rest of the engine/editor holds up.
After only a few months I noticed my vision was getting blurry, lacking focus, and there was some visual swirling as if I was on LSD. Fast-forward another 9 months and colors were muted, all emotions were numbed, I was insanely irritable, and I felt completely distant from the world. I felt so numb to life that I was very close to seeking therapy due to increased thoughts of suicide. On weekends I never had caffeine, but one day I decided to try some tea. That little amount of caffeine was enough to kick me out of the withdrawals and and make me realize it was the caffeine that was causing it.
It's been two months since I last had caffeine and I'm still going through withdrawals. For a while I had to take ibuprofen because the headaches were so severe, but now it's just a slight head pressure. Colors are popping, sunlight is gorgeous, I can focus on words in a sentence without my vision darting around. It's better, but I know there's still another month or two to fully reset. I'm getting back to feeling like I did in grade school though which is amazing to me. I've always drank large amounts of soda since middle school/high school, so I've likely always been impacted by caffeine like this at a smaller scale.
I had actually tried stopping early on, but was sticking with decaf and only for two weeks which wasn't long enough to notice anything.
For some added info, I have the A;C form of http://www.snpedia.com/index.php/Rs762551 which supposedly makes me metabolize caffeine more slowly.
http://arstechnica.com/gadgets/2015/08/soylent-2-0-is-coming...
I've been checking in every few weeks and it's been fun to see it slowly getting clearer and larger. I recall watching shows about it on the Science Channel when I was in high school and thinking 9.5 years would be so far away. Feels odd that we're now only a few weeks away from it finally reaching Pluto.
Edit: Confirmed that the 2mb limit was removed. While viewable and editable, depending on the operation you attempt you may see issues.
I tried copy/pasting the contents of a 3mb json file several times and eventually it caused exceptions to be thrown (but no crash). Same test worked in Sublime Text, albeit with freezing. They do still have some work to do on the edge cases but it's been nice to see progress.
A lot of this came down to the people, but it didn't help that there was no leadership to help steer it in a good direction or notice the underlying issues. Story points were fabricated to help give good spreadsheets and charts to upper management, which led to us working insane overtime before our release due to how behind we were.
This is just one anecdote though, and I know there were other departments much better off than mine was. It was enough for me to want to get out though after I realized how difficult it was to get any change in place.
https://fgiesen.wordpress.com/2012/04/08/metaprogramming-for...
Another cool competition is MIT's Battlecode, which actually gives you a bytecode limit. If your code executes past the bytecode limit, your AI is paused and will actually resume on the next turn, without notification. Thus you'll be continuing with possibly old/dirty data. That pretty much prevents you from using any standard libraries and doing bytecode level optimizations, as well as manually yielding if you know it will take too long.
Your robots also can only talk to each other through a radio API that has limited bandwidth and possible corruption if I recall correctly. It's a complete opposite of what I worked on, where we focused more on strategy rather than code optimization.
Our other restriction was that we wanted to support hundreds of units per team, and we wanted tens of thousands of computed turns, but be able to compute that within 3-5 minutes.
We did learn from that naive approach though and the next year I believe it was done with a text based API. If performance were an issue, it could be done with protobuffers, since most popular languages have at least some implementation of them. The year we did the java implementation we had replays the size of 250mb+ due to how much data we had, even with deltas, compression, and other pruning. The text API was only feasible due to a massive reduction in the amount of game entities and turns.
The key thing was when you want to offer API commands. We wanted starting freshman to be able to compete, and that required offering things like pathfinding, predefined list filters, etc. This also mattered since it was run like TopCoder where they only knew about the game the day of the competition and had 8 hours to code an AI for it. The least buggy way to support that in multiple languages is to have the API computation happen on the server, then your language specific APIs are just wrappers around the API calls and data and much easier to change as your game changes.
I decided to take a look at Java 8's streams, and porting that speed over turned out to be pretty straightforward. The first step was to swap out our iterative, awful thread management download code with parallelStream. When I say awful, I mean it was increasing and decreasing a non-thread-safe static counter and busy waiting for it to hit 0, among other confusing constructs. I also took the time to refactor out several if statements and other code with filter and map statements.
Java 8 lambdas also worked well in that a lambda can be passed in where any Functional Interface is required (the interface has one function), so long as the lambda has the same arity. I was able to use this to have a list of Runnables (basically function/method pointers) that I ran in parallelStreams where previously it was iterative. It looked more verbose than but still comparable to my clojure code.
Finally, I had some tasks that took a long time but were not required at startup since you only needed the resources for specific functions in the app long after you loaded a project. I swapped those out with CompletableFuture.supplyAsync(), as well as took in a callback function for when it completed. If you did manage to need that resource before it finished loading, you would get a loading message until the callback was called.
Granted, a lot of what the app was doing beforehand could have been done much better, such as with ThreadPoolExecutor (and I did see some complaints about efficiency with parallelStream). However, the java8 way came out pretty clean as far as java goes, and I was able to add more/better functionality while still having less code overall. While there is still a lot of improvement that could be done to the streams, they worked out pretty well for my use case.
Edit: Should also point out that since you're not in a controlled environment, you have full internet and library access unlike ICPC where you have to rely on memorization and standard libraries.
For difficult problems you can often write a brute force solution with terrible complexity (think 2^n) for the small input set. For the large though, you'll need to really understand the problem and write an efficient solution via memoization, dynamic programming, pruning, or good (sometimes obscure) algorithm choices. For small solutions you get instant checking of your solution on submit (but not what you failed on, only that you did), for large ones you submit and hope for the best.
As for why you should care, for me at least it's fun to come up with fast solutions to problems regardless of whether they're efficient or if my code is well designed. You learn about new types of algorithms and ways of solving problems. For example, dynamic programming was foreign to me until I started doing tons of TopCoder. Google also uses it for recruiting, I'm still getting contacted by them even though I skipped last year.
My favorite moments come from solving problems poorly while knowing there's a proper solution out there. Ex: There was a problem in some competition where it was some special way you had to return the y-intercept of a line with a given slope that bisected a particular polygon. There was an actual way to do it properly, but I'm not so great at math/geometry so I ended up doing a binary search and did enough iterations to get the right amount of floating point precision they wanted.
With that new-found knowledge, I decided to make my 4th or 5th attempt at trying to grasp clojure and ran through some 4clojure problems. This time I breezed through the problems, and in many cases enjoyed writing it more than I would have in a typical iterative style. I made sure to follow some recommended users to see their solutions as well, which helped reduce much of my parentheses bloat.
My favorite thing about using high order functions has been that provided your underlying functions are tested/correct, you can more easily reason about and test your new functions, particularly when you keep things immutable/side-effect free.
I'm sure I would have gotten to this point eventually without Lodash, but being able to make use of bits and pieces at a time was a major catalyst for me.