The Lesser Known Normal Forms of Database Design
By John Myles White on 9.10.2014-1st Normal Form: The database contains at least one table that is an exact copy of another table, except with additional columns.-2nd Normal Form: The database contains at least one table that is a corrupt, out-of-date copy of another table, except with additional columns. It is impossible to determine if these additional columns can be trusted.-3rd Normal Form: The database contains at least one table whose name contains the string_v1
and another table whose name contains the string_v2
. At least one column in the_v1
table must be an undeclared foreign key that refers to rows that no longer exist in any other table.-4th Normal Form: The database contains at least one table that has two or more columns whose contents are exactly the same, except that one of the columns has a name that is a misspelling of the other column’s name.-5th Normal Form: The database contains (A) at least one table whose name contains the stringdo_not_use
and (B) at least one other table whose name contains the stringdo_not_ever_ever_use
. In each of these tables separately, at least two columns must only contain NULL’s repeated for every single row. In addition, every string in these tables must have random amounts of whitespace padded on the left- and right-hand sides. Finally, at least one row must contain the text, “lasciate ogni speranza, voi ch’entrate.”Posted in Programming
Saturday, September 13, 2014
The Lesser Known Normal Forms of Database Design
Hehe, nice!
Thursday, September 11, 2014
Task.Run Etiquette and Proper Usage
Aha, here is the answer I've been looking for!
In general, do not use
Task.Run
in the implementation of the method; instead, use Task.Run
to call the method. There are two reasons for this guideline:- Consumers of your code assume that if a method has an asynchronous signature, then it will act truly asynchronously. Faking asynchronicity by just doing synchronous work on a background thread is surprising behavior.
- If your code is ever used on ASP.NET, a fake-asynchronous method leads developers down the wrong path. The goal of
async
on the server side is scalability, and fake-asynchronous methods are lessscalable than just using synchronous methods.
Wednesday, September 10, 2014
Monday, September 8, 2014
Hawking: 'God Particle' Could Wipe Out the Universe : Discovery News
What a load..
I expected better than this, Discovery. :/
I expected better than this, Discovery. :/
Friday, September 5, 2014
Background Garbage Collection in CLR 4.0 - If broken it is, fix it you should - Site Home - MSDN Blogs
Background Garbage Collection in CLR 4.0
RATE THIS
29 May 2009 7:23 AM
Yesterday I found this really nice Channel 9 interview with Maoni Stephens (Dev Owner of the CLR GC) and Andrew Pardoe (Program manager for the CLR GC) where they talked about the new Background GC in CLR 4.0.
She also talks about it here and there is not much value in me repeating what she already says there but basically the main points of the video and the post are:
Concurrent GC is being replaced by Background GC in CLR 4.0
Concurrent GC is the mode of the GC that you use in desktop applications for example. The goal of the concurrent GC is to minimize pause time, and it does so by allowing you to still allocate while a GC is in progress (hence the concurrent part).
Concurrent GC is only available in workstation mode.
In server mode (which is what you use in ASP.NET for example when you have multiple processors/cores), simplified all managed calls are paused while in a GC, which means that you can’t allocate anything. This means that the process pauses slightly while in a GC but on the other hand what you loose in pause time, you gain in throughput as GCs are made by x number of GC threads concurrently, where x is #procs*#cores.
In concurrent GC you were allowed to allocate while in a GC, but you are not allowed to start another GC while in a GC. This in turn means that the maximum you are allowed to allocate while in a GC is whatever space you have left on one segment (currently 16 MB in workstation mode) minus anything that is already allocated there).
The difference in Background mode is that you are allowed to start a new GC (gen 0+1) while in a full background GC, and this allows you to even create a new segment to allocate in if necessary. In short, the blocking that could occur before when you allocated all you could in one segment won’t happen anymore.
Background GC’s will be available in the Silverlight CLR as well
The CoreCLR uses the same GC as the regular CLR, so this means that Silverlight apps benefit from this as well…
As Server mode does not use concurrent GC this will not be available in Server GC
Having this in server mode would be incredibly cool as GCs can get pretty hefty, especially in 64 bit apps with very large heaps, but as Maoni mentions in the video and in the post, this work for the concurrent GC lays the foundation for the same work being done in the Server GC. Because of the complexities involved in doing this in Server GC though this is not included in v4.0.
If you do have a lot of latency due to heavy pause times during full garbage collections, there is a feature that was introduced in 3.5 SP1 that allows you to be notified when a full GC is about to occur. You can then redirect to another server in a cluster for example while the GC occurs.
I just want to mention that this not being in the Server GC does not mean that you should switch your server apps (asp.net etc.) to use workstation with concurrent, Server GC is optimized for these scenarios and should still be used there.
Have fun,
Tess
She also talks about it here and there is not much value in me repeating what she already says there but basically the main points of the video and the post are:
Concurrent GC is being replaced by Background GC in CLR 4.0
Concurrent GC is the mode of the GC that you use in desktop applications for example. The goal of the concurrent GC is to minimize pause time, and it does so by allowing you to still allocate while a GC is in progress (hence the concurrent part).
Concurrent GC is only available in workstation mode.
In server mode (which is what you use in ASP.NET for example when you have multiple processors/cores), simplified all managed calls are paused while in a GC, which means that you can’t allocate anything. This means that the process pauses slightly while in a GC but on the other hand what you loose in pause time, you gain in throughput as GCs are made by x number of GC threads concurrently, where x is #procs*#cores.
In concurrent GC you were allowed to allocate while in a GC, but you are not allowed to start another GC while in a GC. This in turn means that the maximum you are allowed to allocate while in a GC is whatever space you have left on one segment (currently 16 MB in workstation mode) minus anything that is already allocated there).
The difference in Background mode is that you are allowed to start a new GC (gen 0+1) while in a full background GC, and this allows you to even create a new segment to allocate in if necessary. In short, the blocking that could occur before when you allocated all you could in one segment won’t happen anymore.
Background GC’s will be available in the Silverlight CLR as well
The CoreCLR uses the same GC as the regular CLR, so this means that Silverlight apps benefit from this as well…
As Server mode does not use concurrent GC this will not be available in Server GC
Having this in server mode would be incredibly cool as GCs can get pretty hefty, especially in 64 bit apps with very large heaps, but as Maoni mentions in the video and in the post, this work for the concurrent GC lays the foundation for the same work being done in the Server GC. Because of the complexities involved in doing this in Server GC though this is not included in v4.0.
If you do have a lot of latency due to heavy pause times during full garbage collections, there is a feature that was introduced in 3.5 SP1 that allows you to be notified when a full GC is about to occur. You can then redirect to another server in a cluster for example while the GC occurs.
I just want to mention that this not being in the Server GC does not mean that you should switch your server apps (asp.net etc.) to use workstation with concurrent, Server GC is optimized for these scenarios and should still be used there.
Have fun,
Tess
Subscribe to:
Posts (Atom)