kba

Denmark

derfor.dk

Age: 24

My e-mail is kristian at website.

1d
awarded Electorate
Jun
12
awarded Guru
Jun
11
awarded Autobiographer
Jun
11
revised Filtering records from database table to be view and update
added 3 characters in body
May
30
comment What exactly makes code "clean"?
I don't think complexity belongs here - some problems are computationally heavy, but that doesn't make them unclean.
May
28
awarded Scholar
May
23
comment Best synchronization tool for UNIX
@FSMaxB Thanks for the suggestion, but I prefer something selfhosted.
May
23
comment Best synchronization tool for UNIX
@FSMaxB: I have just tried out ownCloud and been struggling with it for a few hours and nothing has synchronized yet as well. I keep getting weird errors such as failed to extract meta information for /kba/files/clientsync/test: unable to determine file format.
May
23
comment Best synchronization tool for UNIX
I simply don't like the idea of having my data stored at a third party. You often hear how companies like those have had leaked data.
May
23
asked Best synchronization tool for UNIX
May
21
comment PHP: Fastest way to handle undefined array key
Still, however, my tests imply that this doesn't improve the performance after all. Even after having run through every item in the array once, the lookup time is still worse. My tests could be bad.
May
21
comment PHP: Fastest way to handle undefined array key
The more you know! I can't remove my downvote now, unless you edit your entry. If you could add that explanation to your answer, I can remove my downvote and upvote you instead.
May
21
comment PHP: Fastest way to handle undefined array key
I tested it and you seem to be right, but I don't quite understand how $tmp is being modified. Does isset have side effects? I don't see you assigning anything to $tmp in the second line.
May
21
comment PHP: Fastest way to handle undefined array key
Yes, that will modify the array, but that is not what you're doing. You're returning $tmp or null, you're not modifying $tmp in your code example.
May
21
comment PHP: Fastest way to handle undefined array key
In what way does your approach modify the array? I don't see you making any changes to $tmp or $lookup_table[$key].
May
21
comment PHP: Fastest way to handle undefined array key
I was skeptical about this approach, so I generated a random array of about 5000 keys in the range of 0-100,000, and ran through the array from 0-100,000. I tried your methoed with reference, a method without reference, but still an auxiliary variable, and a simple approach without either auxiliary variable or reference. Your reference approach took more than twice as long as the other ones. The naive approach was marginally faster than the auxiliary variable approach.
May
20
awarded Caucus
May
18
comment In bash, how do I escape an exclamation mark?
Doing bzr commit -m "It works"! works, too.
May
13
awarded Caucus
May
13
awarded Enlightened
1 2 3 4 5