HNHacker News
TopNewBestAskShowJobs

prakashk

939 karma · joined April 5, 2010

submissionscomments
prakashk··on The World Chess Championship is an anachronism
> ... every half point bring him closer to winning a match, and players are therefore incentivized to play for a draw.

This tendency could be discouraged by making wins more weighted realtively than draws: win = 2 points (or, may be 1.5 pts), draw = .5 pts, loss = 0 pts.

prakashk··on Cool C Programming
You'd have if you learned programming in India :)
prakashk··on From a useless Git Diff to a useful one
I am being pedantic, but that would be a function and not an alias.

This one is simple enough to be defined as an alias:

    alias gitdiff='git diff --patience --ignore-space-at-eol -b -w --ignore-blank-lines'
This[1] discusses aliases vs functions (just to make my reply a bit more useful [may be not for you, but in general] and to me feel less guilty.)

[1] http://unix.stackexchange.com/questions/30925/in-bash-when-t...

prakashk··on C++ has become a scripting language
Perl5 v12 and up:

    use v5.12;    # enables strictures
    open my $in,  "<", $ARGV[0];
    open my $out, ">", $ARGV[1];
    print $out sort <$in>;
Perl6:

    sub MAIN( $in, $out ) {
        spurt( $out, open($in, chomp => False).lines.sort.join )
    }
[EDIT: fixed typo in first example]
prakashk··on Unix Commands I Wish I’d Discovered Years Earlier
Color output is not on by default in 'ls'.

Your 'ls' must be an alias for the real ls with some options. For example, mine is:

    $ type ls
    ls is aliased to `ls --color=auto'
A quick way to run the original 'ls' (not the aliased version), just prefix it with backslash:

    $ \ls ...
Or:

    $ command ls ...
prakashk··on Why This Hacker Stood Up Against ‘Verbal Abuse’ in Linux Land
Your comments seem entirely premised on the patch being "complete rubbish". If that is not true (and, there's nothing in the GP's comment to indicate otherwise), and actually "there's a lot of good there", why should the maintainer not be grateful to John?
prakashk··on Giving Ruby a bad name: Women as Job Perks, Again
> My take on that "perk" is that the meaning that was intended is something like: "we have a gender diverse work place and have hired 4 awesome woman engineers! [...]"

Based on the comments made ([1] and [2]), that doesn't seem to be the case. The company doesn't seem to have any developers yet.

[1] http://lists.lrug.org/pipermail/chat-lrug.org/2013-July/0091... [2] http://www.newstatesman.com/economics/2013/07/women-offered-...

prakashk··on LINQ Ruined My Favorite Interview Question
> Perl 5, perhaps surprisingly, is not simpler:

Here's one.

    perl -0777 -nE '$w{$_}++ for split; say for (sort {$w{$b} <=> $w{$a}} keys %w)[0..9]'
It is slightly different compared to your version in that each word is printed on a separate line. To print all words on the same line, is just a bit longer:

    perl -0777 -nE '$w{$_}++ for split; $, = $"; say((sort {$w{$b} <=> $w{$a}} keys %w)[0..9])'
prakashk··on LINQ Ruined My Favorite Interview Question
Perl 6:

    .say for (bag($text.words) ==> sort {-*.value})[^10]
prakashk··on Internet Explorer 11: “Don’t call me IE”
> They have to make a browser that beats every other browser in it's standards compliance, stability and performance. They have to create the greatest browser that has ever been and ever will be.

I will add one more thing. They have to make the browser not just for Windows platform, but for all major platforms (Mac and Linux).

prakashk··on Fibonacci series and Dynamic programming
Perl 6 (from [1]):

    > my @fib := 1, 1, *+* ... *; @fib[99]
    354224848179261915075

    > (1, 1, *+* ... *)[99]
    354224848179261915075
[1] https://justrakudoit.wordpress.com/2010/12/29/perl-6-fibonac...
prakashk··on Rent-a-coder hilarity (2008)
> Isn't the joke on the guy posting the (impossible) job?

No, considering the poster's name is "AlanT"!

prakashk··on Millions Watch Netflix Without Paying [video]
> media hunt chrome add on

Are you talking about Media Hint (http://mediahint.com)?

The web site barely has any information what the addon is for. The mozilla.org page for this addon is not much better. The description says: This extension allows you to enjoy The Fun Stuff from any country! No additional set-up required. Install extension and you are ready to go. That is not very helpful.

Could you elaborate what is this addon useful for?

prakashk··on Free O'Reilly Books
I also have a few of those sitting in boxes in my garage. Every time I do some cleaning-up, I debate (just for a second!) whether I should dispose of them, but end up keeping them.
prakashk··on What would a poverty map of India look like?
The numbers for Hyderabad and Rangareddi districts in the state of Andhra Pradesh (in South India) show 3.1% and 7.3% respectively. Considering that the state capital and its metropolitan area are in these two districts, I expected highest numbers of people owning said "assets". But these two had lower numbers compared to other districts.

Then I came across the earlier post "We are the 5%" (http://datastories.in/blog/2013/04/01/indias-5-percent/), which had a similar map showing the "% of Households with TV, Computer, Phone and Vehicle, by District". This map shows Hyderabad with 22.7% and Rangareddi with 15.8%. These of course are more likely numbers.

Since TV and phone were among the lists of assets in both posts, the first set of numbers should be more in line with the second set. How is this discrepancy explained?

prakashk··on Why I still love Perl
> Curtis Poe's Beginning Perl

The online (draft) version of Beginning Perl is available at http://ofps.oreilly.com/titles/9781118013847/

prakashk··on Why I still love Perl
Because `> 100` is missing from the condition? Other than an example of poor copy-pasting of code, how do you conclude that it is "[n]ot a great advert for Perl"?

For the record, this would be the code with missing part included:

    my @large_orders = sort { $a->{items} <=> $b->{items} } grep { $_->{total} > 100 } @orders;
prakashk··on The Cost Of Free Doughnuts: 70 Years Of Regret
> _They should be charging a carry-on fee instead._

At least one airline, Spirit Air, already does. I am sure more will follow this practice.

prakashk··on Show HN: Weekend project, Intro.js
Very nice!

Just one thing. I pressed the Enter key thinking that it would take me to the next step (like the right-arrow), but the page background went darker. And, each successive press of Enter made it even darker. I actually liked the effect (even if it was unintended) as it increased the contrast between the step being focused and the rest of the page.

However, I found no way to get back to original page after all the steps are completed (by right-arrow navigation). Pressing ESC had no effect.

Edit: Using Firefox 20.0 on Ubuntu Lucid.

prakashk··on Show HN: Save Memory in Google Chrome
Chrome is not my primary browser, so I won't be installing this any time soon, but I thought the copy was really short and sweet, with no fluff. If this was "salesy", I wish more FOSS products were like this one.
prakashk··on Unix tricks
You might want try `ack` then. (http://betterthangrep.com/).

On Ubuntu/Debian systems, it is packaged as `ack-grep`.

prakashk··on Calcutta girl who fled home & marriage at 17 returns as millionaire US innovator
From http://www.chandallc.com/index.php?p=1_4_About:

Ms. Zaveri received a Masters degree in Molecular Biology and Genetics from the University of California at Santa Barbara. Subsequent graduate studies were undertaken at California Polytechnic University (“Cal Tech”)

Since when California Polytechnic University is called Cal Tech? Isn't that abbreviation used for "California Institute of Technology (http://caltech.edu)?

Searching for California Polytechnic University shows "Cal Poly" or "California Polytechnic State University, San Luis Obispo, CA (www.calpoly.edu).

Update: Wikipedia says (http://en.wikipedia.org/wiki/Linus_Pauling), Linus Pauling was at Caltech in the 1927–1963 period and does not indicate he was there in the later stage of his life (nineties). Nor does it say that he was ever associated with CalPoly. At least this part of the Ms. Zaveri's story seems suspicious to me.

prakashk··on Show HN: My Weekend Hack - Stack-Ed: Learn from the best on StackOverflow
Looks pretty nice. Couple of issues I found (others may have already mentioned these):

* Checkboxes imply that you can select multiple tags. But Clicking on a second tag is clearing the first. You might want to use a radio button, or (better) allow multiple tags to selected.

* As a minor but useful improvement, clicking on the tag name should select the checkbox (the cursor is already changing to hand, implying that the name is clickable, but it is currently not.)

* When I selected Perl tag, the first stackoverflow user displayed (ikegami) shows 0%. A bug?

* When you change from one tag to another the user list is refreshed, but the article list on the right is not. That seems a bit of disconnect for me. I am not sure what the best way here, but I think I prefer that article list also cleared out (or at least, display it faded or something).

That's all I have for now.

EDIT: Also, it would be nice if there is a text box to enter an arbitrary tag, instead of clicking on Load more tags... and hoping that the tag you want will show up. Useful for less popular tags.

prakashk··on Favorite Unix Commands
I have been known to use sudo when it is not appropriate to use the f-word ;)
prakashk··on Favorite Unix Commands
I use atool (http://www.nongnu.org/atool/), which is packaged in Debian and Ubuntu (and I am sure in other distributions as well). It supports all the formats I have encountered so far (tar, tar.gz, zip, rar, bz2 and others).

It provides a few commands, two of which I use the most:

    als - list files in an archive
    aunpack - exatract files from an archive
The best part is aunpack extracts files into a subdirectory (I hate polluting the current directory with files from a new archive which wasn't properly packaged to include a directory), and it does it only when necessary. Before I found it, I always used to create a temp directory, cd to it, unpack into it, and possibly move files around etc.
prakashk··on Felix - a fast scripting language
As aflott does, I use the built-in debugger as REPL for most simple uses.

I also use re.pl from Devel::REPL (https://metacpan.org/module/Devel::REPL).

prakashk··on KDE Gains “Magic Monitor” Functionality With New KScreen
> [1] A flash player that doesn't tint everything blue would also be welcome.

Are you talking about the problem described in this post? http://askubuntu.com/questions/117127/flash-video-appears-bl...

prakashk··on Ask HN: How do you escape CRUD jobs?
You seriously don't think Linus is solely responsible for Linux, do you?

He should and does get the credit for having the insight and chops to have started it all, and is the single-most important person for Linux, but today's Linux is the result of the work of thousands of programmers.

prakashk··on Perl is 25 years old today
... drop into a debugger at a predefined location in your code?

Add the line where you want the execution to stop:

    $DB::single = 1;
Then, run your program as:

    $ PERLDB_OPTS=NonStop perl -d program.pl
See: http://perldoc.perl.org/perldebug.html
prakashk··on Thinking the unthinkable
where is Michael's dad in all of this?

Busy trying not to pay child support and fighting her in court for custody of the children.

http://anarchistsoccermom.blogspot.com/2012/07/news-from-war...

← PreviousPage 3 of 7Next →