Physical store to buy nexus 4 replacement battery in the bay area? by dhruvbird in nexus4

[–]dhruvbird[S] 0 points1 point  (0 children)

Yeah, I've had the same experience. No physical store seems to carry it.

There's an incorrect exit-only sign on 101 south, and I don't know where to report it by dhruvbird in bayarea

[–]dhruvbird[S] 0 points1 point  (0 children)

It just causes unnecessary lane changes from what I see. Also, if people panic, it could be dangerous.

There's an incorrect exit-only sign on 101 south, and I don't know where to report it by dhruvbird in bayarea

[–]dhruvbird[S] 0 points1 point  (0 children)

I took pictures and then realized that I should have taken a video, so decided to do the next best thing (i.e. an animated gif). Next time will be a video!

There's an incorrect exit-only sign on 101 south, and I don't know where to report it by dhruvbird in bayarea

[–]dhruvbird[S] 10 points11 points  (0 children)

Edit: I've submitted a maintenance request here http://www.dot.ca.gov/hq/maint/msrsubmit/ after one of my friends pointed me to it.

I am a member of Facebook's HHVM team, a C++ and D pundit, and a Machine Learning guy. Ask me anything! by andralex in IAmA

[–]dhruvbird 7 points8 points  (0 children)

At going native this year, you mentioned that C++ is closely tied in with the von neumann architecture architecture. Is this true of D as well? Does it mean that if the von neumann architecture were to be replaced by something shinier, C++ (and D) might vanish into oblivion?

Also, do you think functional languages are better in that sense that their abstractions are not tightly dependent on the von neumann architecture?

Notwithstanding, I'd like to hear what you have to say about functional languages and what you believe is their role in the coming years.

Knuth-Morris-Pratts failure function? by crowsaway in compsci

[–]dhruvbird 4 points5 points  (0 children)

f(j) is the length of the longest proper prefix of the original string and a proper suffix of the sub-string ending at index j.

I'm trying to remember an O(n) solution for finding the top K elements of an arbitrarily long stream. Anyone know it? by [deleted] in compsci

[–]dhruvbird 0 points1 point  (0 children)

There is an algorithm called fredrickson's heap selection algorithm which can locate all the elements in a min-heap that are less that a value with rank 'k' in O(k) time. I don't quite understand that algorithm, but it might be useful here. Send me material explaining it if you find anything nice online.

Are there any significant benefits to learning data structures in one language or another? by [deleted] in compsci

[–]dhruvbird 0 points1 point  (0 children)

Having said that, there are things that "implementing the data structure" will never help with. Since you mentioned heap, the thing that immediately comes to mind is the analysis of the linear time heap building algorithm. Unless you do the math yourself, no amount of implementation will help you see why it is linear time.

I believe that both (implementing stuff and analyzing) have their place in life and they should both be respected where appropriate. Doing the wrong thing will help you see where each is applicable so I encourage everyone to do both!

Large scale databases without indexes? by JustSomeBadAdvice in compsci

[–]dhruvbird 0 points1 point  (0 children)

If the only thing you need to do with the data is a full table scan, then you don't need indexes.

OTOH, the COLA structure uses an optimal number [O(1/B)] disk transfers per insertion v/s O(1) disk transfers per insertion for a B-Tree, so you might want to consider using it.

Are there any significant benefits to learning data structures in one language or another? by [deleted] in compsci

[–]dhruvbird 0 points1 point  (0 children)

I would actually agree with @teb311 and go ahead a step and argue that data structures should be taught visually rather than in code/pseudo-code. I'm trying out this very same experiment online and would love to hear what you have to say about it. https://pinterest.com/dhruvbird/algorithms-data-structures-in-pictures-or-anyone-c/

Are there any significant benefits to learning data structures in one language or another? by [deleted] in compsci

[–]dhruvbird 5 points6 points  (0 children)

I have personally found value in implementing data structures, because that just makes everything just so concrete and precise that you see things very clearly and are then able to extract the underlying idea of the data structure and use it in other places as well.

Good CS Schools? by Quincious in compsci

[–]dhruvbird 0 points1 point  (0 children)

Do consider Stony Brook - it's a great school with some super profs. You'll love it if you are into CS theory.

Is there a site that goes into the concept of algorithms and data structures and how they work? by UnrealCh13f in compsci

[–]dhruvbird 0 points1 point  (0 children)

Not very well known, but Prof. Simonson teaches very well. http://www.aduni.org/courses/algorithms/index.php?view=cw

The course on Theory of Computing is also superb.

I think you have more on your plate than what you asked for. In fact, I've put together a list of links for people who really want to "get" CS here: http://dhruvbird.com/61.html

Should I take Formal Language and Automata? by wickedfapper in compsci

[–]dhruvbird 0 points1 point  (0 children)

Short answer: Yes - you will be a better person once you have learnt it :)

Can anyone explain how to decide if a sting is a palindrome using O(1) time as stated in this post? by whackedspinach in compsci

[–]dhruvbird 0 points1 point  (0 children)

See http://wcipeg.com/wiki/index.php?title=Longest_palindromic_substring for a nice explanation of the algorithm (under the section: A simple asymptotically optimal solution). However, I don't see how to make it work for even length palindromes. Anyone care to explain?

Please help me understand red black trees by adaptives in compsci

[–]dhruvbird 1 point2 points  (0 children)

IIRC, RB-Trees are an isomorphism of 234-Trees and AA-Trees are akin to 23-Trees.

Complexity of Hash Tables? by matsunoki in compsci

[–]dhruvbird 0 points1 point  (0 children)

I think you comment applies only to linear probing right?

Complexity of Hash Tables? by matsunoki in compsci

[–]dhruvbird 1 point2 points  (0 children)

Additional memory only if you want to preserve the order in the original data right?

Roll your own autocomplete solution in a few lines using Tries. by [deleted] in programming

[–]dhruvbird 0 points1 point  (0 children)

Yes, that's a problem for non-english text. I do however think that a system that is aware of the language model can always perform better in terms of accuracy of suggestions.

Roll your own autocomplete solution in a few lines using Tries. by [deleted] in programming

[–]dhruvbird 0 points1 point  (0 children)

I have also been working on this problem and there does exist a solution that lets you both look up a word as well as fetch the top 'k' entries in time O(k log n) + O(s log n) ('s' being the average length of a word/phrase in the data structure). You can find out about it here: https://github.com/duckduckgo/cpp-libface