2,681 reputation
2718
bio website github.com/CodesInChaos
location Frankfurt, Germany
age
visits member for 4 years, 2 months
seen 5 hours ago

5h
comment Are there any benefits of using this extra variable in the for loop annotation?
In C#/.NET the variant using n might be slower than the variant using array.Length since the JITter might not notice that it could eliminate array bounds checks.
1d
comment “Client direct access to database” vs. “SOA”
How do you roll out new versions of the client? Do you care about limiting the access privileges for individual users?
Jan
26
comment Should an Http API always return a body?
@Hey I'd use the location http header for that.
Jan
26
answered Should an Http API always return a body?
Jan
24
comment Situations when O(n^2) better than O(n*log(n))
Concerning average vs. worst case, there is an important difference between "For every input the probabilistic algorithm is fast on average" vs. "For randomized inputs the deterministic algorithm is fast on average". The latter can easily bite you, perhaps the inputs you're dealing with in practice and the inputs you averaged over are not the same. Or perhaps an attacker deliberately crafted the input to hit the worst case as a DoS attack. One example of such an attack is HashDoS, which exploits the bad worst case complexity of hash tables. Similar issue with Quicksort with predictable pivots.
Jan
23
comment torrent support in browser
The problem with sequential downloading is that peers often leave once they finished downloading, so early pieces would be available on many peers and late pieces would be available on few peers. The tit-for-tat strategy doesn't work well either, if a client who has more pieces than another has all pieces they have, instead of different ones. This means random requests improve efficiency of the swarm, which is why many clients that support video streaming still mix sequential download with requests of random or rare blocks.
Jan
23
comment torrent support in browser
When connecting a to a peer they'll send you information about which blocks they have and they also send you a notification whenever they downloaded a new block. So clients only request blocks the peer has.
Jan
23
comment torrent support in browser
The bittorrent client can decide which blocks to request first. It can start in the beginning, which for example the video feature uTorrent does.
Jan
23
comment torrent support in browser
Opera contains a torrent client.
Jan
23
comment Throw exception or let code fail
Side notes: 1) Consider using string.Format over string concatenation for building the exception message. 2) only use as if you expect the cast to fail and check the result for null. If you expect to always get a Material, use a cast like (Material)Resources.Load(...). A clear cast exception is easier to debug than a null reference exception that occurs later on.
Jan
22
comment Where do free proxies come from and why do people make them freely available?
Because they enjoy sniffing the data you're sending through the proxy ;)
Jan
22
comment Kernel mode web servers: A clever optimization or a security nightmare?
Usermode applications are often written in typesafe languages which rules out most memory corruption based bugs (these are typically those that lead to remote code execution).
Jan
22
comment Kernel mode web servers: A clever optimization or a security nightmare?
The big problem with the Singularity approach is that it means that a but in the JITter can easily lead to privilege escalation.
Jan
20
comment REST request of different length
I would avoid returning a password hash via API. Another potential issue is that your hash looks unsalted. Password hashes should be slow and salted.
Jan
20
comment Is address 0000000C a special address?
I'd rather write 64 KiB instead of 65 kB in this case, since the power-of-two size is relevant.
Jan
16
comment What is the best way to structure and name files which contain generic classes with the same name?
The compiler internally mangles the name of generic types, adding a backtick and the number of generic parameters since .NET does not allow multiple types with the same name with a differing number of generic parameters but C# does. So the file naming convention matches what the compiler does.
Jan
15
comment Why “show line numbers” doesn't' check by default in all IDE's
Since an IDE can highlight lines in which an error (compile or runtime) occurred, line numbers are less important compared to programming in a simple text editor.
Jan
15
comment Creative Commons ShareAlike
My understanding of CC is that including a CC image in a software is only a combination and not an adaption, and thus the SA clause does not apply the the software as a whole. (Usual disclaimers, IANAL etc.)
Jan
15
comment Creative Commons ShareAlike
Reading older versions of CC might help you understand their intent. With each revision CC got less clear. You should also read the FAQ
Jan
14
comment How to solve this problem of duplicate code with a design pattern
Asking which pattern to use is the wrong approach. What matters is how to solve the problem. That solution may or may not make use of some standard design pattern.