I'm curious how others have solved this problem, and what problems might lurk behind the naive solution:
I have a system which processes stock market data. There are tens of thousands of symbols, with associated prices/sizes, flowing into the system at the rate of several thousand every millisecond.
One of the basic operations that ne...
I'm currently implementing a JavaScript library that keeps track of the history of changes to the hash part in the address bar. The idea is that you can keep a state in the hash part, and then use the back button to go back to the previous state.
In most of the recent browsers, this is automatic and you only have to poll the location.ha...
What's the best way to implement a Hash that can be modified across multiple threads, but with the smallest number of locks. For the purposes of this question, you can assume that the Hash will be read-heavy. It must be thread-safe in all Ruby implementations, including ones that operate in a truly simultaneous fashion, such as JRuby, an...
Hi,
I was wondering (and used Google with no clear result) if there is any way to connect to a MySQL database with PHP using a hashed password. Say I have the following:
Password (plain): 'foobar'
Password (sha1): '8843d7f92416211de9ebb963ff4ce28125932878'
Now I would like to connect to MySQL like this (using the mysql_* function as ...
Question for all the SSL experts out there:
We have an embedded device with a little web server on it, and we can install our own SSL self-signed certificates on it. The client is written in .NET (but that doesn't matter so much).
How can I authenticate the device in .NET? Is it enough to compare the fingerprint of the certificate aga...
I have the page to encode and I have the page to decode.
I don't, however, have the knowledge on how to do it myself without the web pages.
What I'm trying to do is figure out how to encode a hoplink like:
http://geoffreyf6.earth4.hop.clickbank.net
into
http://8e5250ieuas1d9b9bo6c6p8xat.hop.clickbank.net/
The encode/decode pages ...
Hi All,
I'm having a bit of an issue wrapping my head around something. I'm currently using a hacked version of Gruff in order to accommodate "Scatter Plots". That said, the data is entered in the form of:
g.data("Person1",[12,32,34,55,23],[323,43,23,43,22])
...where the first item is the ENTITY, the second item is X-COORDs, and t...
I am mulling over a best practice for passing hash references for return data to/from functions.
On the one hand it seems intuitive to pass only input values to a function and have only return output variables. However in Perl, passing hashes can only be done by reference so it is a bit messy and would seem more of an opportunity to ...
Here's an interesting problem. Is it possible to split a string on the last matching regex only?
Consider the following list of column headings from my data file (which read along the same line, being tab-separated):
Frequency Min
Frequency Avg
Frequency Max
Voltage L1 Min
Voltage L1 Avg
Voltage L1 Max
Active Power L1 Min
Active Power ...
Hi,
in languages like PHP or Python there are convenient functions to turn an input string into an output string that is the HEXed representation of it.
I find it a very common and useful task (password storing and checking, checksum of file content..), but in .NET, as far as I know, you can only work on byte streams.
A function to do ...
How do I find the number of keys in a Perl hash variable, like Perl array $#?
...
How can I access the last element of keys in a hash without having to create a temporary array?
I know that hashes are unordered. However, there are applications (like mine), in which my keys can be ordered using a simple sort call on the hash keys. Hope I've explained why I wanted this. The barney/elmo example is a bad choice, I admit,...
I'm hoping this question has a very simple answer. I can think of ways to do with with boring, annoying looping, but I'm hoping there's a more elegant solution.
If I have the following two variables:
hash = {:a => 1, :b => 2, :c => 3, :d => 4}
keyset = [:a, :c]
How can I get the following two hashes in the simplest way possible?
has...
I understand that salts make the same password hash to different values. However, salts are usually stored in the database with the password. So let's say I am attacker, here is how I might use a dictionary attack against a salt (note in this example i don't write out 128 bit hashes or salts for the sake of brevity):
user_pw = 'blowfi...
I'm currently using MD5 hashes but I would like to find something that will create a shorter hash that uses just [a-z][A-Z][0-9]. It only needs to be around 5-10 characters long.
Is there something out there that already does this?
Update:
I like the CRC32 hash. Is there a clean way of calculating it in .NET?
Update2:
I'm u...
Say a user registers for your site, you hash the password they have chosen then use that hash as a salt and rehash their password with that salt.
Example:
String hash1 = MD5(password);
String endHash = MD5(hash1 + password);
then store endHash in your database. Would this effective agaisnt Rainbow Table attacks if my database was com...
I'm not sure how long they've been doing it but I just noticed google using # in their search url instead of search?.
New way
http://www.google.com/#q=stackoverflow
Old way
http://www.google.com/search?q=stackoverflow
The pound/hash sign is generally used as an anchor to a section of a page.
Besides a shorter url what could be the bene...
Hi,
I have a simple script trying to learn about hashes in Perl.
#!/usr/bin/perl
my %set = (
-a => 'aaa',
-b => 'bbb',
-c => 'ccc',
-d => 'ddd',
-e => 'eee',
-f => 'fff',
-g => 'ggg'
);
print "Iterate up to ggg...\n";
while ( my ($key, $val) = each %set ) {
print "$key -> $val \n";
last if ($val e...
Unlike std::map and std::hash_map, corresponding versions in Qt do not bother to return a reference. Isn't it quite inefficient, if I build a hash for quite bulky class?
EDIT
especially since there is a separate method value(), which could then return it by value.
...
So I'm reading up about hash tables, hash functions etc. I was intrigued to read on wikipedia about how "dynamic perfect hashing" involves using a second hash table as the data structure to store multiple values within a particular bucket.
Where I get lost however, is when it comes to how a universal hash function is selected to perfor...