Better HN
topnewbestaskshowjobs
Log inSign up

orlandu63

108 karma · joined Jun 24, 2009 (17y ago) · 46 submissions

Submissions

comment 13y ago · link · parent

Fake answer: because O(log(fib(n))) conveys more information as to how the algorithm works.

Real answer: because I didn't realize that it's equivalent to O(n).

comment 13y ago · link · parent

In the same vein, there's also an O(log(fib(n))) recursive algorithm:

    fib :: Integer -> Integer
    fib 0 = 0
    fib 1 = 1
    fib 2 = 1
    fib n = case n `quotRem` 2 of
        -- if n = 2*m
        (m,0) -> (fib (m+1))^2 - (fib (m-1))^2

        -- if n = 2*m + 1
        (m,1) -> (fib (m+1))^2 + (fib (m  ))^2

comment 13y ago · link · parent

Even if the person meant "median", the author's sentence is still ambiguous: It is definitely possible that 70% of _college students_ are "above median" at multitasking than the _general population_.

comment 14y ago · link · parent

You don't need RAII to manage non-memory resources. All you need are first class functions.

comment 14y ago · link · parent

I think you mean group . sort

comment 14y ago · link · parent

I'd rather have the ability to choose between and freely mix significant whitespace and significant semi-colons within a single source file.

comment 14y ago · link · parent

Let's not forget that GNU/Linux is intended to run on any damn machine you throw at it, while the latest version of OSX is only intended to run on Apple hardware that is no more than 3 years old. It's amazing that Ubuntu is even competitive with OSX given these circumstances.

8.

Mosh: An Interactive Remote Shell for Mobile Clients(youtube.com ↗)

2 points · by orlandu63 · 14y ago · discuss

comment 14y ago · link · parent

This is a horrible idea.

comment 14y ago · link · parent

Nope, you just need lots of cash.

comment 14y ago · link · parent

I wouldn't call that computationally efficient. It is possible to make routing an O(log n) operation; your routing solution, like all routers that use regexes directly, is O(n).

comment 14y ago · link · parent

On the contrary I suggest either Intel or ATI graphics because unlike nVidia, Intel and ATI actually contribute to their open source drivers.

comment 15y ago · link · parent

I'm getting entirely different results with Python 3.2:

    % python -m timeit "[ x**3 for x in range(10000) ]"
    100 loops, best of 3: 7.85 msec per loop
    % python -m timeit "map(lambda x: x**3, range(10000))"
    1000000 loops, best of 3: 1.26 usec per loop
By these benchmarks map is 700 times faster than the corresponding list comprehension.

comment 15y ago · link · parent

Does anyone have a direct link to the PDF file?

comment 15y ago · link · parent

Does the person not use syntax highlighting? A missing <?php tag would cause the PHP code to be highlighted as HTML code which would look very strange to anyone who has edited a PHP file with a syntax-highlighting-enabled editor.

comment 15y ago · link · parent

Have you any citations to back up that statement?

comment 15y ago · link · parent

I've created an AUR package for this script, found here: http://aur.archlinux.org/packages.php?ID=46675

comment 15y ago · link · parent

Oh, that's right. 'to sitename' becomes 'cd ~/Sites/ sitename' which is not what you want. My apologies.

comment 15y ago · link · parent

I would suggest mapping an alias instead of creating a function so that you will still be able to take advantage of parameter completion:

> alias to='cd ~/Sites/'

comment 15y ago · link · parent

There also exists the ControlMaster configuration option which treats multiple sessions to the same host as a single connection. With this enabled, you only have to enter your SSH passphrase once per host. Aside from the convenience of not having to repeatedly enter your passphrase, subsequent sessions are initiated much faster (due to not having to renegotiate) and there is (theoretically) less strain put on your network adapter. Note, however, that if there are no active sessions to a host, the connection to that host will be dropped, and you will have to re-enter your passphrase upon reconnection. See the ControlPersist option for dealing with connection persistence.

If you're like me, however, you'll use both keychain and ControlMaster (for the increased negotiation speed) :)

comment 15y ago · link · parent

Thanks!

Also,

> mplayer -dumpstream "mmsh://proedvid.stanford.edu/knuth/musings/101206/101206-knuth-500.wmv?MSWMExt=.asf"

for for those you who'd like to download the video for later viewing.

comment 15y ago · link · parent

Pre-made meals aren't intrinsically bad for you; it's the preservatives and other questionable ingredients (and quantity of) that the manufacturers may add that is detrimental to your health.

comment 15y ago · link · parent

A monad is an abstraction for composing functions that return values with a context by defining how to compose that context. That's it.

comment 16y ago · link · parent

Have you taken a look at mpd and its accompanying CLI frontends? Tunneling X applications over SSH isn't popular because there's almost always a CLI application that accomplishes the same thing.

comment 16y ago · link · parent

Vim _can_ be extended through other languages, namely Python and Ruby.
12