Questions tagged [internals]

The internals tag denotes questions about how things work, as opposed to how to accomplish something specific. Of course, how something works underneath will have practical implications, but internals questions aren't about how to do something; rather, how to understand something.

If you understand how a database or parser or version control system actually works, you'll be better at using it. Internals questions seek this kind of inside knowledge.

568 questions
682
votes
5 answers

How can bcrypt have built-in salts?

Coda Hale's article "How To Safely Store a Password" claims that: bcrypt has salts built-in to prevent rainbow table attacks. He cites this paper, which says that in OpenBSD's implementation of bcrypt: OpenBSD generates the 128-bit bcrypt salt…
Nathan Long
  • 113,812
  • 91
  • 316
  • 418
444
votes
23 answers

Practical uses for the "internal" keyword in C#

Could you please explain what the practical usage is for the internal keyword in C#? I know that the internal modifier limits access to the current assembly, but when and in which circumstance should I use it?
Alexander Prokofyev
  • 32,090
  • 32
  • 91
  • 115
271
votes
10 answers

Why use a public method in an internal class?

There is a lot of code in one of our projects that looks like this: internal static class Extensions { public static string AddFoo(this string s) { if (s == null) { return "Foo"; } return…
bopapa_1979
  • 8,476
  • 9
  • 44
  • 73
185
votes
7 answers

How does a debugger work?

I keep wondering how does a debugger work? Particulary the one that can be 'attached' to already running executable. I understand that compiler translates code to machine language, but then how does debugger 'know' what it is being attached to?
ya23
  • 13,534
  • 7
  • 42
  • 41
101
votes
2 answers

Python string interning

While this question doesn't have any real use in practice, I am curious as to how Python does string interning. I have noticed the following. >>> "string" is "string" True This is as I expected. You can also do this. >>> "strin"+"g" is…
Ze'ev G
  • 1,478
  • 2
  • 11
  • 15
96
votes
7 answers

Factors in R: more than an annoyance?

One of the basic data types in R is factors. In my experience factors are basically a pain and I never use them. I always convert to characters. I feel oddly like I'm missing something. Are there some important examples of functions that use…
JD Long
  • 55,115
  • 51
  • 188
  • 278
81
votes
5 answers

How do databases work internally?

I've been working with databases for the last few years and I'd like to think that I've gotten fairly competent with using them. However I was reading recently about Joel's Law of Leaky Abstractions and I realised that even though I can write a…
Bonnici
  • 1,576
  • 2
  • 12
  • 20
72
votes
3 answers

What is [DllImport("QCall")]?

Many methods in the .Net library are implemented in native code. Those that come from the framework itself are marked with [MethodImpl(MethodImplOptions.InternalCall)]. Those that come from some unmanaged DLL are marked with [DllImport] (e.g.…
svick
  • 214,528
  • 47
  • 357
  • 477
71
votes
3 answers

Are Git's pack files deltas rather than snapshots?

One of the key differences between Git and most other version control systems is that the others tend to store commits as a series of deltas - changesets between one commit and the next. This seems logical, since it's the smallest possible amount of…
Nathan Long
  • 113,812
  • 91
  • 316
  • 418
56
votes
2 answers

If Int32 is just an alias for int, how can the Int32 class use an int?

Been browsing through .NET source code of .NET Framework Reference Source, just for fun of it. And found something I don't understand. There is a Int32.cs file with C# code for Int32 type. And somehow that seems strange to me. How does the C#…
Jurica Smircic
  • 5,006
  • 1
  • 21
  • 25
55
votes
6 answers

How can I learn more about Python’s internals?

I have been programming using Python for slightly more than half an year now and I am more interested in Python internals rather than using Python to develop applications. Currently I am working on porting a few libraries from Python2 to Python3.…
user277465
52
votes
2 answers

How to do internal interfaces visible for Moq?

I have 3 project in my C# solution. Signatures Structures Tests Signatures has public and internal interfaces. Also it has [assembly: InternalsVisibleTo("Structures")] [assembly: InternalsVisibleTo("Tests")] in AssemblyInfo.cs…
Valentine Zakharenko
  • 2,212
  • 1
  • 14
  • 37
50
votes
5 answers

How does fork() know when to return 0?

Take the following example: int main(void) { pid_t pid; pid = fork(); if (pid == 0) ChildProcess(); else ParentProcess(); } So correct me if I am wrong, once fork() executes a child process is created.…
Machina333
  • 603
  • 5
  • 13
47
votes
2 answers

How does object_id assignment work?

I'm playing around with Ruby's .object_id and noticed that, in several sequential sessions of irb, I get these identical results: false.object_id // 0 true.object_id // 2 nil.object_id // 4 100.object_id // 201 In fact, every integer's object_id…
Nathan Long
  • 113,812
  • 91
  • 316
  • 418
43
votes
2 answers

Make internal classes visible to other assemblies

Is it possible to make internal classes from my assembly visible to other assemblies? I know about the AssemblyInfo file and the [assembly: InternalsVisibleTo()] attribute, but it doesn't work in my case. The main purpose is to make it possible to…
Neir0
  • 11,481
  • 26
  • 76
  • 136
1
2 3
37 38