News for hackers. Stuff that matters.

navinp1912

Re:Files Are Hard on Monday December 14, 2015 @08:56AM (#10730956)
Agree whole heartedly.

I was asking this thinking of open(<file>,O_DIRECT|O_RDONLY); that bypasses buffer cache and read directly from the disk that atleast solves buffer cache i guess. The disk cache is another thing ie if we disable it we are good at the cost of performance.

I was pointing that tests can do these kind of things.

Re:Files Are Hard on Sunday December 13, 2015 @08:20PM (#10728827)
How does checksumming help if the data is in cache and waiting to be written ? For ex: I have 1MB of data, i write it but it stays in buffer cache after written and when you do checksum you are computing the checksum on buffer cache .

On Linux you have to drop_caches and then read get the checksum to be sure. Now per buffer or file drop_cache isnt available as per my knowledge . If you are doing a systemwide drop_caches you are invalidating the good and bad ones.

What if now if device is maintaing cache as well in addition to buffer cache?

Can someone clarify ?

Re:Why Coinbase is now hiring remote engineers on Sunday December 13, 2015 @04:20AM (#10725862)
Can someone give similar hackerrank/job challenge + resume links for other orgs ?
I'm using HP ZBook 15 G2 Mobile Workstations with ubuntu 14 LTS since last 3 months. The only thing i miss is SSD that i didn't choose in my customization. Has 16GB RAM, i7 . I switch between Win 8.1 and linux (something lxde instead of unity). The nice thing about this linux can run VMs and it is pretty fast and even containers work well. Also Win 8.1 ultimate has hyperv role so you can use that as a hypervisor as well.

Initially i had 64 bit 15.x but some unity programs used to crash when it released , so i installed something good.

I'm didn't find any problem with anything until now.

http://www8.hp.com/in/en/campaigns/workstations/zbook-15.htm...

http://www8.hp.com/in/en/products/laptops/product-detail.htm...

Re:Ask HN: Why keep living? on Sunday February 22, 2015 @05:01AM (#9088909)
>>>I won't go into the details that led up to this event<<<<

Fix the problem and then go ahead and do whatever you want. Atleast you would be helping one other person. One you have crossed the line, there are no rules,nothing to stop you. Problems are created by people or a group of people. Fix the problem and you will watch problems run to the hills. Yes you will have to pay a price for all this.

https://www.youtube.com/watch?v=I5UBikauIQM

http://codepad.org/LMNJWE6X

They say "Life is suffering". You want to choose to the easy route or the hard way, i leave it upto you.

Read upon Irom Sharmila.If you can do that , you are beyond anything. Nothing can stop you.

Re:LINQ Ruined My Favorite Interview Question on Friday July 12, 2013 @07:40AM (#6032057)
If you move what while (topK--) into the map loop , it becomes an online code for topK whereas what you wrote is an offline . If you want offline then pushing it into a priority_queue and then popping it out would be much faster.
Re:LINQ Ruined My Favorite Interview Question on Friday July 12, 2013 @12:11AM (#6030874)

     string s,f;
     map<string,int> M;
     set<pair<int,string> > S;
     while(cin >> s) {
             M[s]++;
             int x=M[s];
             if(x>1) S.erase(make_pair(x-1,s));
             S.insert(make_pair(x,s));
     }
     set<pair<int,string> >::reverse_iterator it=S.rbegin();
     int topK=10;
     while(topK-- && (it!=S.rend())) {
             cout << it->second<<" "<<it->first<<endl;
             it++;
     }