internals

How does SQL Server store decimal type values internally?

扶醉桌前 提交于 2019-12-30 07:08:47
问题 In SQL Server you can use FLOAT or REAL to store floating point values the storage format of which is cleared defined by the IEEE 754 standard. For fixed point values we can use DECIMAL type (which has a synonym NUMERIC ). However I'm not pretty sure how SQL Server store DECIMAL values internally. For example, if I define a table and insert a row like this: IF OBJECT_ID('dbo.test_number_types') IS NOT NULL DROP TABLE dbo.test_number_types; CREATE TABLE dbo.test_number_types ( id INT IDENTITY

Computer Architecture: How do applications communicate with an operating system? [closed]

大憨熊 提交于 2019-12-29 10:00:07
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 3 years ago . Prelude: This is admittedly a fairly broad question regarding computer architecture, but one that I hear from others and wonder about quite often myself. I also don't think that there is a direct or quick answer to this. However, I was hoping someone well-versed in systems

What syntax is represented by an ExtSlice node in Python's AST?

佐手、 提交于 2019-12-23 17:22:33
问题 I'm wading through Python's ast module and can't figure out the slices definition: slice = Ellipsis | Slice(expr? lower, expr? upper, expr? step) | ExtSlice(slice* dims) | Index(expr value) So far, I know that Ellipsis is [...] , Slice is the usual [start:end:step] notation, Index is [index] , but which notation is ExtSlice ? 回答1: An extended slice is a slice with multiple parts which uses some slice-specific feature. A slice specific feature is something like ... (a literal ellipsis) or a :

Unit Testing Best Practice? / C# InternalsVisibleTo() attribute for VBNET 2.0 while testing?

女生的网名这么多〃 提交于 2019-12-23 12:32:07
问题 I'm building an Active Directory wrapper in VBNET 2.0 (can't use later .NET) in which I have the following: IUtilisateur IGroupe IUniteOrganisation These interfaces are implemented in internal classes (Friend in VBNET), so that I want to implement a façade in order to instiate each of the interfaces with their internal classes. This will allow the architecture a better flexibility, etc. Now, I want to test these classes (Utilisateur, Groupe, UniteOrganisation) in a different project within

Why does Single() not return directly when more than one element is found? [duplicate]

拟墨画扇 提交于 2019-12-23 06:53:25
问题 This question already has answers here : Bad implementation of Enumerable.Single? (7 answers) Closed 6 years ago . I found (roughly) this code in the Enumerable.Single method while inspecting it with some decompiler: foreach (TSource current in source) { if (predicate(current)) { result = current; num += 1L; } } if (num > 1L) { throw Error.MoreThanOneMatch(); } As you can see, it loops over all items before throwing. Why doesn't it break when num > 1 ? 回答1: Agree, that it will be better from

Why does Single() not return directly when more than one element is found? [duplicate]

有些话、适合烂在心里 提交于 2019-12-23 06:52:17
问题 This question already has answers here : Bad implementation of Enumerable.Single? (7 answers) Closed 6 years ago . I found (roughly) this code in the Enumerable.Single method while inspecting it with some decompiler: foreach (TSource current in source) { if (predicate(current)) { result = current; num += 1L; } } if (num > 1L) { throw Error.MoreThanOneMatch(); } As you can see, it loops over all items before throwing. Why doesn't it break when num > 1 ? 回答1: Agree, that it will be better from

Why does Single() not return directly when more than one element is found? [duplicate]

谁都会走 提交于 2019-12-23 06:52:08
问题 This question already has answers here : Bad implementation of Enumerable.Single? (7 answers) Closed 6 years ago . I found (roughly) this code in the Enumerable.Single method while inspecting it with some decompiler: foreach (TSource current in source) { if (predicate(current)) { result = current; num += 1L; } } if (num > 1L) { throw Error.MoreThanOneMatch(); } As you can see, it loops over all items before throwing. Why doesn't it break when num > 1 ? 回答1: Agree, that it will be better from

How to use reflection to unit-test an internal (Friend in VB) class within an assembly, when the InternalsVisibleToAttribute is not an option?

半城伤御伤魂 提交于 2019-12-22 18:40:10
问题 I have a solution with two projects within: Company.Project.vbproj Company.Project.Tests.vbproj Within the Company.Project.vbproj assembly, I have a class FriendClass.vb which scope is Friend (internal in C#) . Now I wish to test this FriendClass.vb from within the Company.Project.Tests.vbproj assembly. I know about the InternalsVisibleToAttribute, but that is not an option in Visual Basic .NET 2.0, as it is only available with C#, in .NET 2.0 (see here). I would like to create myself a proxy

Perl internals and Moose: constant-folding optimization

╄→尐↘猪︶ㄣ 提交于 2019-12-22 09:40:02
问题 I've been curious about constant-folding optimizations which Perl performs, but it occurred that when the code has Moose involved chances are that constant-folding won't be performed (please correct me if I am wrong). I have Moose code which contains the method as below: sub foo { my ($self) = shift; my $test_y = $self->pos->[1]; #... if ($self->is_map_val($self->pos->[0]+8, $test_y+32) || $self->is_map_val($self->pos->[0]+32-8, $test_y+32)) { { heavy_stuff(); } #... } and when I run perl -MO

What's the internal format of a .NET String?

限于喜欢 提交于 2019-12-22 04:46:12
问题 I'm making some pretty string-manipulation-intensive code in C#.NET and got curious about some Joel Spolsky articles I remembered reading a while back: http://www.joelonsoftware.com/articles/fog0000000319.html http://www.joelonsoftware.com/articles/Unicode.html So, how does .NET do it? Two bytes per char? There ARE some Unicode chars^H^H^H^H^H code points that need more than that. And how is the length encoded? 回答1: Before Jon Skeet turns up here is a link to his excellent blog on strings in