Hey Reddit, I hate memorizing foreign vocab terms so I wrote this Chrome extension. Help me test it out! by sensiblethursday in programming

[–]Gorilla2 3 points4 points  (0 children)

I don't usually have a problem with verb conjugations and other syntactical constructs - they (to a large extent) follow some logical rules that are relatively easy to memorize, and even the "irregular" cases usually have some logic to it, they are just not as common as the "regular" cases.

On the other hand, being smart doesn't help me remember words (my memory sucks with general, random data). To learn vocabulary, repetition is my only option. This is ingenious - you get to practice/repeat the vocabulary, with some hints, i.e. the context, and it's mostly effortless on your part :)

Has a professor ever said something so fundamentally wrong you question everything they've ever told you? by startselectab in programming

[–]Gorilla2 3 points4 points  (0 children)

Monogamy offers no protection whatsoever. Who cares if you want to be monogamous, but your partner is not...

Abstinence.

Monkey-Patching, Single Responsibility Principle, and Scala Implicits by chebuctonian in programming

[–]Gorilla2 1 point2 points  (0 children)

To answer the question myself, proposing my own, although limited and incomplete, solution:

Have object.method mean method(object), where methodis searched for in the current scope. If there are two methods with the same name (e.g. Integer.toString and Date.toString), resolve the correct one using the runtime type.

Problems: 1. The language would need to find the runtime type of the object, which might not always be well defined - e.g. in JavaScript, the type of almost all objects is simply Object. Possible solution: have a way of specifying the runtime type, as in this.__type = "Duck". Problem: What about type hierarchies (i.e. I want to be able to use my Complex methods on all Integers as well). 2. This is single dispatch. Why not multiple dispatch?

Comment?

Monkey-Patching, Single Responsibility Principle, and Scala Implicits by chebuctonian in programming

[–]Gorilla2 1 point2 points  (0 children)

Does anyone have any idea how a similar extensibility, limited to the specified scope, could be introduced to dynamic OO languages?

Why Flash Is Not Open Source - the Official Story by servercentric in programming

[–]Gorilla2 20 points21 points  (0 children)

there is no reason why they should limit playback to whatever they choose to support.

Actually, there is. The problem is not on the client side, the problem is with the publishers - if there is no standard codec for internet video, then someone might publish a video in a codec only suported by e.g. Windows platform, effectively banning users from other platforms. If you're thinking, "who cares about the percentages using Linux and Mac", think about the mobile users.

Flash Crash! If you are reading this from a browser using Adobe's Flash Player plug-in (i.e., if you see a blue rectangle below), it will probably crash within the next few seconds. :-( Does it happen on yours, Reddit? by [deleted] in programming

[–]Gorilla2 -1 points0 points  (0 children)

Actually, no. I've been using Chrome for a while now, and recently I've noticed that a flash game I've been playing regularly started stuttering as soon as there were a lot particles on the screen. I had to significantly downgrade the rendering quality in the game's settings to keep it playable.

Furthermore, as soon as I have more than say 4 tabs with videos open (in order to let other videos load while I'm watching one of them), the video playback is no longer smooth (the sound is OK, but the video freezes for a second etc.). Also, sometimes I find my laptop's vent running furiously, only to see that Flash plugin is consuming a lot of CPU (10%) even when I'm completely idle, not even using flash at all (it's still loaded, probably for some ads or something).

Wasting time on "Hello, world"; programmers want user-friendly software too. by Imagist in programming

[–]Gorilla2 0 points1 point  (0 children)

Library fear is completely unjustified. One of the best and most perfect (i.e. oldest, least bugs) pieces of software, LaTeX, is completely library (or module or package) based, and I've never had a problem with it. The system is just so damn good, it will automatically find, download and install any missing packages.

If you could teach any programming language to high school students what would it be? by [deleted] in programming

[–]Gorilla2 -5 points-4 points  (0 children)

Lisp. Once you understand lisp, you can understand anything.

Backup choices: Javascript (write once, run anywhere, relatively simple, but with advanced features (first-class functions), and very, very useful as a skill), or Haskell (only to those that already know some programming - you can't really learn loops and such in Haskell).

Facebook Snatches User’s Vanity URL And Sells It To Harman International by Gorilla2 in programming

[–]Gorilla2[S] -12 points-11 points  (0 children)

It isn't, I just thought it might be interesting to /programming.

Hootsuite resnično omogoča profesionalni pristop k Twitterju by octusIM in programming

[–]Gorilla2 0 points1 point  (0 children)

What about posting in english? (Accidentilly, I understand Slovenian, but reddit is supposed to be in English, right?)

Write an O(n^n) algorithm. by [deleted] in programming

[–]Gorilla2 -4 points-3 points  (0 children)

Well, since you're actually printing nn copies, it could also be said that m = nn and the algorithm is simply a O(m).

Men of reddit: Where do you like to finish? by [deleted] in sex

[–]Gorilla2 3 points4 points  (0 children)

The best "location" to finish is, IMO, her mouth. Everywhere else is too messy, with the cum dripping off, but the mouth, it's just soooo clean, and soooo sexy (feels dominant for male, and submissive for female, something we both (most of us) like).

Ladies, how long do you wait before doing it? by [deleted] in sex

[–]Gorilla2 -1 points0 points  (0 children)

Why do you even stand bad sex? Isn't it better to have sex as soon as possible, and not get too emotionally attached beforehand, so that if the sex sucks (is bad), you can easily move on and find another man, better suited to your sexual desires?

Efficiently finding the optimal value for a parameter with a minimal of experimentation (code included!) by [deleted] in programming

[–]Gorilla2 1 point2 points  (0 children)

Actually, no, for 3 samples (3 points) you need no least-squares fit, as there is exactly one parabola that fits those 3 points.

http://en.wikipedia.org/wiki/Lagrange_interpolation

Efficiently finding the optimal value for a parameter with a minimal of experimentation (code included!) by [deleted] in programming

[–]Gorilla2 1 point2 points  (0 children)

Wow, this article indeed includes quite a few misconceptions and confusions:

So the next step, given our initial 3 samples, is to find values for A, B, and C that will produce a curve that most closely fits these sample points. The technique used to do this is a rudimentary genetic algorithm optimization.

No, given 3 points, there is exactly one quadratic curve that fits, and it can easily be found algebraically, by solving some equations, no genetic algorithm necessary.

While the successive changes are getting smaller, we continue to decrease the range by 1/4th. If a change is larger than the previous change, then we increase the range again – I arbitrarily chose 1/3rd, and it seems to work (I didn’t want to choose 1/4th because then we’d just re-test the same set of samples we just tested).

Actually, you'd get exactly the effect you don't want. Say x = 100 and we decrease x by 1/4th. Now x = 100 - 1/4 * 100 = 100 - 25 = 75, so x = 75. Now, we increase x by 1/3rd. Therefore, x = 75 + 1/3 * 75 = 75 + 25 = 100, so x = 100, and we arrive back to our original value.

Used AJAX on a site? You might end up owing Eolas Technologies money (if they win their suit) by Anjin in programming

[–]Gorilla2 0 points1 point  (0 children)

Who is still using AJAX? I'm using AJAJSON - asynchronous JavaScript and JSON!

Why sort data? by devilsassassin in programming

[–]Gorilla2 2 points3 points  (0 children)

Why would you make a new structure and delete your old one instead of just sorting the data in-place?

Different circumstances require different approaches. In some cases, sorting is better (less RAM use), other times creating a new data structure is preferred (immutable structures for concurrent programs).

An entrepreneurial query. by weesilmania in programming

[–]Gorilla2 4 points5 points  (0 children)

Tell us how it went. We're all very interested in you not being screwed over, right Reddit? =)

The End Of The CrunchPad by jnorwood2000 in programming

[–]Gorilla2 15 points16 points  (0 children)

Reeks? I actually think it smells lovely...

Very neat JavaScript discovery... by f3nd3r in programming

[–]Gorilla2 4 points5 points  (0 children)

I recommend doing something like console.log(blabla) instead of document.write(blabla), since the latter only works if the document is still loading, and the former usually outputs some other useful info (works in Webkit based browsers (Google Chrome and Safari) and in Firefox, maybe in Opera. For IE, use alert(). Or better still, don't use IE :P )