Better HN
topnewbestaskshowjobs
Log inSign up

T-R

1,407 karma · joined Jun 14, 2010 (16y ago) · 438 submissions

Submissions

comment 12y ago · link · parent

These kinds of tricks actually are being done: by the compiler (as long as you give it enough information and don't try to outsmart it) - they're exactly what gets put into optimization passes. Trying to do these optimizations by hand generally turns into a time sink that results in buggy, unmaintainable code, which is, pretty much by definition, too low level to take advantage of current or future compiler optimizations.

comment 12y ago · link · parent

One of my side projects is very similar: I built a recursive descent disassembler for Gameboy that I'm working on building into a decompiler. I took a slightly different approach - rather than generate assembly, I generate a call graph - each instruction is a node with zero or more potential following nodes.

The key word, though, is 'potential' - as the author mentions, one of the issues you run into with disassembly is that you sometimes run into code that jumps into garbage (dynamic jumps with insufficiently constrained inputs, or code that should've been unreachable), and sometimes you just hit an infinite loop waiting for an interrupt. It really needs some input/interactivity to determine likely entry points and dead ends/unreachable code.

One nice thing you can do while you have the call graph, though, is propagate constraints (basically type inference/data flow analysis) to get an idea of where dynamic jumps may go, which ones might be under-constrained, and which branch targets are likely dead ends. Haven't gotten as far as implementing it yet, but there's a paper on it here: http://www.cs.rhul.ac.uk/home/kinder/papers/phdthesis.pdf

comment 12y ago · link · parent

If split screens are your thing, it might be worth it to try a Tiling Window Manager. I agree with you that Sublime doesn't natively have enough split screens, so I use XMonad, and split them and organize them as I please.

comment 12y ago · link · parent

This was the first thing that struck me as well - just fantastic level/game design. Immediately brought to mind the instructional level design from Super Mario Bros - http://www.theoryofgaming.com/gold-standard-for-game-design/

comment 12y ago · link · parent

I think he might be referring to Mario Bros VGA - http://www.abandonia.com/games/880/MarioBrothersVGA

comment 12y ago · link · parent

The SMB3 mini-game was based on the original Mario Bros; The author describes Punch Ball as a distinct game:

> This is almost identical to the original Mario Bros, except you can't knock enemies upside down by hitting the platform they're standing on. The only way to defeat them is by hitting the POW block or throwing the Punch Ball which Mario and Luigi carry around.

comment 12y ago · link · parent

I wasn't aware of that, that's good to hear. I'm under the impression, though, that since SPDY encrypts everything, that you can't get caching at intermediate nodes unless you explicitly MITM yourself, which would reduce the utility of that feature. Then again, I'm not sure how much caching happens outside of places where you'd MITM yourself now anyway, so I guess in practice, that might not be a huge step back.

comment 12y ago · link · parent

I really do wish HTTP had a mechanism for responding to a single request with multiple combined response bodies as if requests were made for each individually (from the perspective of, e.g., a caching proxy) - the loss of separation of concerns from merging children into the parent isn't just a usability issue, it also means you lose your cache granularity - the cache for the parent object is now stale whenever a child is modified, and a request for a child after getting the parent won't hit the cache at the request level.

There's keep-alive, but that still means that if you want to get a parent and its children, you have to wait for the parent request round-trip.

To add - this is a major issue we've been working through at Slant.co - we've combined child objects into the requests for the parent objects (sometimes even two levels down), but it's significantly complicated caching efforts - we're in the process of building some namespacing into our server-side request cache, so we can transparently make cached Question and Option pages stale whenever, e.g., the title of a Pro/Con gets changed. If HTTP allowed multiple responses, we could treat everything transparently server-side as individual requests, and get much higher hit-rates for proxy and client-side caches.

comment 12y ago · link · parent

> I'd argue that in REST it would be desirable that resource representations do do that (provide [...] the direct locations of any embedded subentities that are separate addressable).

You could actually go a step further - if you're using "Hypertext as the engine of application state" (HATEOAS), URIs for the locations of direct subentities need to be there, if the client is expected to be able to make those state transitions, for the API to be "fully RESTful". (Though, I'd personally agree with the article that features like discoverability and content negotiation are secondary to those you get from idempotence/properly using HTTP methods, and feel they should be considered bonus features, rather than strict requirements)

comment 12y ago · link · parent

That's fantastic.

I'd been thinking about modifying an emulator to do automatic speedrun splits based on changes in memory. Many of the people who'd most appreciate that kind of thing prefer to speedrun on original hardware, though, and a lot of them would be happy to pay for modifications like this - as many have, e.g., paid to have their 3DS modded with HDMI output.

comment 12y ago · link · parent

Thanks for this - I've bookmarked it to read later. It looks like you've explained everything pretty thoroughly in the readme, and looks like an excellent example for getting started.

comment 12y ago · link · parent

I think this past month has been a bit of an outlier with new languages, such as Avail, being posted. That said, I wouldn't count Idris as one of them - it's been around for a little while now, and in the community of people familiar with purely functional languages, it's probably about as well known as Elm or Agda: If talking to a Haskeller, there's a good chance they've at least heard of it.

Of course, it's all relative - this community does have a good number of early language adopters and people involved in programming language research. At the other end of the spectrum, just a few years ago, I met a Java developer who, at the time, hadn't even heard of C# - I'd imagine he'd've been quite shocked by the languages talked about here.

comment 12y ago · link · parent

Sorry, I just noticed that I didn't really properly respond there. "Reading" can mean "pronouncing" or "comprehending" - I'm arguing that overall comprehension (including both word identification and reading speed) is easier in languages like Chinese or Japanese than in English. Just from personal anecdote, I feel that many English speakers learning Japanese that have trouble with reading comprehension have issues not because of the language itself, but because they try to study vocabulary as if it's a phonetic language, as many classes are taught that way - memorization focus is on how characters or words sound, rather than the meaning of the characters or radicals they're composed from. The situation may be worse with Chinese if it's as common as the author implies for students to still have trouble reading newspapers after 10 years of study.

comment 12y ago · link · parent

Familiarity with a character is a lot like familiarity with a latin root word in English - if you know most or all of the characters that compose a word, you can usually do a pretty good job guessing the meaning of it. Certainly there are exceptions (and there may be more in Chinese than Japanese, which I'm more familiar with, as Chinese uses non-phonetic characters explicitly), but I'd still argue that it's quite useful. In Korean, which has a phonetic alphabet (though based on the same characters), I can always sound out a word, but I'll often have no idea what it means, whereas in Japanese, often I can't read a word out loud, but I know exactly what it means. For every "uptight", there are a dozen 心電図 (心:heart + 電:electric + 図:map = electrocardiogram). It works with spoken language as well, though - often times I'll hear someone say a new word, and I'll ask "is this the right character/syllable breakdown?", and if it is, then I already know what it means.

Edit: To your point regarding English having both connection to meaning and pronunciation - that's definitely true, it's just not as immediately clear/visually identifiable, and not as dense. One could certainly argue that, if native speakers are having serious issues learning pronunciation in a language, then the language makes a poor tradeoff with density there.

comment 12y ago · link · parent

I can't really speak to the utility of using the characters in practice, but looking back on when I was studying Japanese and Korean, it frustrates me that more emphasis wasn't put on the characters, as learning the roots of the words was incredibly helpful in learning vocabulary, in the same way that learning Latin roots would be helpful in studying English. It was, though, much more of an issue in Japanese, where you run into the characters everywhere. Because of the heavy conversational emphasis in most foreign language classes, I didn't learn about character composition (radicals), or the phonetic element to characters until I took a bit of Chinese. When I did finally learn these things, my reading comprehension got a very significant boost.

I'd maybe argue that the use of Chinese characters in Japanese allows me to read much faster than if all writing were in Hiragana, particularly since people tend to identify words more by their shape, but Hangul does this quite well on its own, so I think maybe there's not as strong of a need for it in Korean.

comment 12y ago · link · parent

While what the author says is true, I feel like there's a hint of ethnocentrism - his complaints all (over)emphasize the use of the link between the pronunciation of a word and its written representation. Whenever the author discusses things like writing the word "president" or forgetting how to spell "tin can", implicit and unmentioned is that the hypothetical person knows the pronunciation of the word, and is attempting to translate it into writing, which, of course, is a natural thing for someone coming from a phonetic language to assume the importance of. Yes, more logographic languages like Chinese have a weaker link between pronunciation and written form, but this is a tradeoff, not simply bad design. One could similarly make an argument about English speakers forgetting what words mean (or for that matter, just that it takes forever to say anything in English).

comment 12y ago · link · parent

I'm not sure whether or not it's the case with Korean, but in Japanese, many homophones are tonal, though not often explicitly acknowledged as such. words like 神 (kami: god) and 紙 (kami: paper), or 席 (seki: seat) and 咳 (seki: cough) are fairly consistently spoken with a particular distinguishing intonation, which helps, along with context, to disambiguate them from eachother.

comment 12y ago · link · parent

> The idea that this composability is unique to Haskell is false. Java's streams are an example of exactly the same thing in another, non-functional, language. The Gang of Four "decorator", "composite", and "chain of responsibility" patterns are further general examples.

Certainly the concept of composability isn't unique to the Haskell community, no one's implying that it is. In fact, part of the point is that even these specific abstractions aren't unique to Haskell, but available anywhere, as they've been borrowed from mathematics. Composability and consistency are things that the mathematics community does exceedingly well, and the Haskell community has chosen to learn from them, while most other language communities do these things poorly, as they've chosen to reinvent the wheel. The GoF Design Patterns, in particular, are a rather verbose reinventing-the-wheel of well-known concepts like partial application, but with inconsistent vocabulary and implemented with regards to the limitations of some specific language's semantics, and do a poor job isolating the minimal set of constraints necessary to get the intended emergent properties. Calling a person or community arrogant for trying to highlight the utility of learning these lessons isn't helpful to anyone.

comment 12y ago · link · parent

These are not patterns unique to Haskell. In fact, it's just the opposite: these are mathematical abstractions, and so they can be used anywhere that you have use of function application, in stark contrast to the alternatives. By using these patterns instead of Ruby or Javascript-specific, Application-specific, or Object Oriented-specific patterns, you can be more confident that your abstractions will be consistent with eachother, and as a result, more composable.

Case in point: I'm currently developing in Javascript, but I use these patterns (Monad, Applicative Functor, etc) to manage things like asynchronous code and error handling, because they're far more flexible/composable and reliable (in terms of not having side effects) than the other offerings on hand, and I know that will always be the case, because these abstractions were designed with the constraint of composability in mind: in fact, they are, by definition, the minimum set of constraints required to get these emergent properties. The benefit that Haskell itself offers is that it can check at compile time that these constraints hold true.

comment 12y ago · link · parent

I hardly found any in Paris, myself. A bunch near the Google offices in Mountain View and Roppongi - maybe it's using past visited location data?

comment 12y ago · link · parent

Their new audience isn't quite as easily convinced to invest hundreds of dollars on a piece of dedicated hardware.

comment 12y ago · link · parent

Worst case with Facebook:

     - It would signal a shift toward gimmicky experiences targeting a
       casual market that wouldn't spend several hundred dollars on a
       piece of esoteric hardware.
     - It would spoil an opportunity to partner with a company that has
       much more experience in hardware, gaming, dev tools, or anything
       else Oculus could use to take off.
     - The likely integration with Facebook's authentication and social
       services will cause the product to suffer from all the ill will and
       distrust Facebook has generated within parts of its userbase and
       the developer community. Branding is important, and to these
       communities - the ones Oculus likely needs to take off - Facebook's is poison.
An acquisition by Zynga or Gree might've been almost as bad, but any of the other companies mentioned wouldn't have signaled such a shift, and such a betrayal of the intent of the initial kickstarter investors and hopes of its supporters. Oculus appears to gain nothing but money from this deal. I'd say the announcement alone squanders Oculus' only relevant lead over Sony and others.

comment 12y ago · link · parent

This is a terrible move for Oculus, though. The reaction from their core audiences - hardcore gamers and developers - seems to be largely negative, at a time right after Sony - a company that caters to that audience - announced its competing "Project Morpheus". It's not being taken as a signal of Facebook's innovation, but as Oculus moving toward a casual audience, and their fan base feels abandoned. Do they really feel that whatever plans they have with Facebook are so low-risk and high return that they no longer need that audience?

comment 12y ago · link · parent

This was a fantastic talk. Sad that you have to log in to view it now. That was definitely not the case a few months ago.

comment 12y ago · link · parent

I've not gotten a chance to play around with it yet, but there's plv8x (https://github.com/clkao/plv8x), for managing plv8 functions.

comment 12y ago · link · parent

True, but that's not at all uncommon. Perhaps it was submitted by the same person? Still, that'd hardly be a reason to shut down the conversation.

comment 12y ago · link · parent

Java (at least prior to Java 7), has some severe limitations in how code can be abstracted. As an example, it doesn't allow you to pass functions as arguments to other functions directly. As a result, the canonical way to handle situations where you would do this (such as passing a comparison operator to a sort function), is to declare an interface, define the function in a class that implements that interface (command pattern, etc.), and then instantiate an instance of the class and pass that. Closures are imitated by explicitly passing data to class constructors and storing it in member variables, and currying imitated through patterns like the onerous abstract factory pattern.

Additionally, the abstraction features Java does offer are implemented with some heavy language syntax, and often can't be generated at runtime or pre-compile time, at least not easily, and so there's a limit to the abstraction, even taking into account Java Generics. That's something where homoiconic languages like Clojure have a particular advantage.

As a result, abstracting things in these ways (which in other languages is incredibly common) gets to be painfully verbose. Often, things that would be beautifully abstracted in these ways are just left unabstracted (as in-line boilerplate) - the verbosity introduced makes the code less readable, rather than more, and so there's a stigma against "over-abstracted" code. The result is that code that does, or could, make use of these things takes exceedingly more code in Java than in a language like Clojure. Of course, conventions in Java of, e.g., giving each curly brace its own line aren't helping its case in line counts, either.

comment 13y ago · link · parent

One of the nice benefits of writing for an old console like the NES is that emulators are often the first things ported to new platforms - you effectively get all the portability of writing for a virtual machine, along with the ease of running on only one type of hardware. Most of the hardware/compatibility concerns (Can I maintain a proper framerate on this hardware? Is the screen large enough? What kind of controller does the user have?) are on the person porting the emulator, not the developer. Also, for the user, this means any configuration only needs to be done once for all of the games on that platform.

As for hardware, if you can't find an NES, you can always use a third-party retro console, like the Retron 3.[1]

Also, if you're worried about compatibility, Byuu's cycle-accurate SNES emulator[2] has been expanded to run NES, Gameboy, and Gameboy Advance games, so testing on actual hardware is a lot less necessary than it used to be.

[1] http://www.thinkgeek.com/product/13f8/ [2] http://byuu.org/higan/

comment 13y ago · link · parent

We're trying to cover exactly those kinds of questions - http://www.slant.co/topics/871/~best-linux-distribution

Not trying to compete with SO, but we think those questions need a home, and share eterm's view that maybe they're not a good fit for SO's format.

comment 13y ago · link · parent

King of the shrines?
1
456
15