Better HN
topnewbestaskshowjobs
Log inSign up

Scriptor

1,852 karma · joined Nov 10, 2008 (18y ago) · 533 submissions

Github: http://github.com/Scriptor
Submissions

comment 13y ago · link · parent

Javascript is frequently stripped of all whitespace as part of the minification process. This includes removing all newlines and indentation. This would a good bit harder with Python.

comment 13y ago · link · parent

Nice, thanks!

comment 13y ago · link · parent

Are there any plans to add a keyboard shortcut for this?

comment 13y ago · link · parent

Even if everyone survives long enough to have children, that doesn't mean they all have equal numbers of children.

comment 13y ago · link · parent

It's rather odd when someone says natural selection is completely 'dead'. Do they think everyone in the world has an equal chance of finding a partner and has the same number of children? Of course not. Even to this day there are factors that determine whose genes are passed down more frequently than others.

I can't stress this enough, but there is simply no goal for evolution. Up until relatively recently, it just so happened that larger brains and other features we consider 'human' have been beneficial. Even if it may not be a big factor now, don't decry it as evolution being 'dead', or even worse, that people are devolving.

If certain genetic traits allow certain people to pass their genes down to more offspring then you have all you need. It's a very simple concept with major consequences.

comment 14y ago · link · parent

There's a lab that adds a 'Mark as read' button. I usually just archive them with keyboard shortcuts. Just hit *-u and then press e.

comment 14y ago · link · parent

Not all villages in developing countries are dirt-poor and desperate for the slightest technology. Cheap cell phones are used quite a bit in many rural areas in Africa, for example: http://www.cnn.com/2012/09/13/world/africa/mobile-phones-cha.... For example, farmers can use them to look up weather forecasts and price information for their crops.

comment 14y ago · link · parent

It's really not terribly complicated to figure out what it does, here's the formatted version for adding two numbers

    (function() {
          var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __breaker = __opal.breaker, __slice = __opal.slice;
          var __a, __b;
          return self.$puts((__a = 1, __b = 2, typeof(__a) === 'number' ? __a + __b : __a['$+'](__b)))
    })();
The first line just declares some Opal-specific variables (__scope, nil, __breaker, etc.), which I guess are created whether or not they're actually used. The second line defines the temporary variables used to store the numbers. Then, depending on the type, it either actually adds them or use its own '$+' function, which I guess it adds to the prototype for all objects.

In terms of having to ever debug something like that, I agree that it'd probably be a huge pain.

comment 14y ago · link · parent

What languages do you typically work iwth?

comment 14y ago · link · parent

> 1. It is an IDE's job, to keep track of changes of individual expressions in the code of a project.

Is the IDE supposed to have it's own revision history stored somewhere? I understand how it might be an IDE's job to recognize individual functions but there's no way it is supposed to keep track of changes. That is entirely the source control's job.

> 2. This information should be stored separately from the source code files, as a meta-data to the project, not the individual files.

What information? This doesn't change your code in any way, it analyzes it and stores the data resulting from that in the datomic db.

3, 4, 6 are entirely subjective, it's rather clear plenty of others find this interesting and useful. I do agree that the query language isn't pretty.

5. Maybe someone will dislike Datomic enough to implement this as an emacs package. The source for codeq itself is open source, datomic is only a storage backend.

7. Let's be straight, judging from the points you made you certainly didn't go into this with no bias. Some of us don't get angry just because it comes from Hickey.

comment 14y ago · link · parent

One advantage is that you can view your repo's history as a list of new functions being added/removed/changed instead of just diffs of what lines are removed and added. You could add editor support and look at all previous versions of a specific function you're working on.

More specifically, where git mostly looks at code as a collection of files and differences in individual lines, codeq breaks it down into code as a collection of semantic units (function definitions for clojure, possibly class definitions, methods, etc. if other languages are supported). Your version control system would actually understand if a particular method had been moved from a subclass into a parent class, instead of just considering it as lines being deleted here and added elsewhere.

comment 14y ago · link · parent

At some point you have to relax a little with the side projects and just sit down with a book and read. Maybe go to a park or coffee shop to get a change in scenery so you're not tempted to open the laptop and start coding again. If you take public transportation, your commute's a good time as well.

comment 14y ago · link · parent

Have there ever been any studies done to look at the effects of any biases when you're actively trying to tell a bot apart from a human? My guess is that the judges end up looking for specific traits and characteristics. Bot developers can then include these in the AI. The issue is that those traits may not be even close to matching an actual person in other situations, but they're enough to provide a local maximum of sorts.

In this case, the fact that on average bots seemed scored as more "human" than actual humans is more of a sign of a critical flaw in the judging system than any great progress. It looks like they reduced typical human behavior to some very simple things, such as holding a grudge or other irrational behavior. If that was a major part of the judges' criteria (consciously or subconsciously) then all this contest proved is that bots can be programmed to be more irrational than human players.

comment 14y ago · link · parent

For what it's worth, you can turn off emails for repos you're watching here: https://github.com/settings/notifications

comment 14y ago · link · parent

That's true, actual tools need all those criteria that you described.

If you believe that functional languages don't meet those criteria, can you provide evidence for that? For example, from what I've gathered Clojure certainly has high quality libraries, an emphasis on speed when needed (performance is frequently superior to Python's), has debugging facilities, is easy to learn for someone with functional experience (just as Python or Java are relatively easy to learn for those with imperative experience) and can still be picked up with a little extra work otherwise, and has been used in production in large projects. I don't know about its hardware support so I won't comment on that.

comment 14y ago · link · parent

People always mention the infix operators, but really, how often do you come across them in your code? Unless you're working on something highly mathematic, it really isn't that big of a deal. Otherwise, sexprs visually are a matter of rearranging parentheses for basic function calls.

    (function1 (function2 1 2 3))

    function1(function2(1, 2, 3))
There is no difference in the way we read the first over the second.

comment 14y ago · link · parent

We don't know what those birds are feeling, but we have no reason to assume it's grief over other feelings. At face value, they are making alarm calls and gathering around the dead body. Of course we don't know how birds display grief and maybe this is how they show it, but again we have no evidence for that.

Thinking that their actions may be done to warn of poisonous food sources isn't as far-fetched as you make it out to be. It has a clear evolutionary benefit. As for grief, it is beneficial in tight communities as it helps strengthen social bonds. This is why people are less affected by the death of a stranger than that of a close relative. But blue jays are not highly social animals and the dead bird in question is one they have never seen before anyway. Scientifically, grief is actually one of the less likely possibilities as there doesn't seem to be any reason why they would grieve an unknown bird.

And does grief really make emotional sense? When a person finds a body on the street, what do they do? They call for help. Afterwards a crowd may gather as the police cordon off the area. But the crowd isn't grieving, they're simply morbidly curious.

comment 14y ago · link · parent

And if the parents aren't homozygous it could be attributed to recessive genes. Same reason why two brown-haired parents can have a blond child.

comment 14y ago · link · parent

And if the parents aren't homozygous it could be attributed to recessive genes. Same reason why two brunettes can have a blond child.

comment 14y ago · link · parent

Technically 'prehistoric' could fit. The remains are from a time before written records existed there.

But when you consider that written records had already long existed elsewhere in the world and that 'prehistoric' can go as far back as ancient mammals and even dinosaurs, it becomes a rather vague term.

However, in this case it's useful to describe it as prehistoric because this is the only type of evidence we have of their culture. Since there are very few written records, archaeological remains are the best bet for learning more about them, which is why finding something this well-preserved can be particularly exciting.

Otherwise, as far as I know human the brain belonged to is pretty much anatomically and genetically the same as modern humans.

comment 14y ago · link · parent

Evidenced by the phrase, "Rich Internet Application" :)

comment 14y ago · link · parent

From my personal experience I think some numbers do get reused. When I first got my Google Voice number I kept getting a bunch of calls asking for some other person, so I guess Google just reused someone else's old number.

comment 14y ago · link · parent

When I was 10 I started reading a VB book and was inordinately proud of myself for learning how to customize the toolbars in the IDE. I just assumed that that was a major part of programming. I also misunderstood the part on autocompletion and thought it meant most of your code was autogenerated.

I wasn't the most tech-literate child, but at least I've come a decent way since then.

comment 14y ago · link · parent

Also, I'm curious what the actual impact of it is. One of the main arguments against meat is that it takes a great deal more energy and work to create 1 pound of plant food than 1 pound of meat. From what I've seen, beyond meat uses some sort of manufacturing process to create it. How much energy does it take to ship all those materials and run that factory?

comment 14y ago · link · parent

It seems like a knee-jerk reaction to believe that all those papers are sponsored by the soy industry and everything saying that soy does have estrogen is coming from a reputable source.

comment 14y ago · link · parent

Actually, someone did a great job succinctly explaining it: http://news.ycombinator.com/item?id=4286701

The attitude that Clojure is only for some enlightened few who are worthy enough to understand it is extremely alienating. Lisps aren't that hard, homoiconicity isn't that opaque, the benefits of using Clojure can be explained in practical terms that most developers can understand, if not at first be convinced by. All these concepts can be explained succinctly in text.

Saying that Clojure is only for those who share some 'vision' is hand-wavy at best, insulting at worst.

Edit: My guess is that Datomic is targeted towards Clojure devs because they are already experienced with Datomic's philosophy and will understand the system better. It also provides a smaller and highly receptive market. They can then focus on perfecting the software instead of training a large number of people in the philosophy behind Clojure and Datomic.

comment 14y ago · link · parent

I think you went through Facebook's deactivation process, which is meant to be a temporary break from using facebook. To actually permanently delete your account so you can never log in again you have to go to https://www.facebook.com/help/delete_account

comment 14y ago · link · parent

There's also the intellectual property facet of this. Someone who steals your work could try and sell it to your competitors. This includes code as well as a list of your clients and your business plans.

comment 14y ago · link · parent

Right, the alternative is to just sort of guess how much you need to ctrl-u/d or j and k to get to a specific line. Also, I guess it depends on screen size. I usually have plenty so the line numbers' usefulness outweighs the extra space required, at least for me.
1
567
18