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.

660 questions
495
votes
22 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
  • 33,874
  • 33
  • 95
  • 118
312
votes
12 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,949
  • 10
  • 51
  • 76
228
votes
7 answers

What does the git index contain EXACTLY?

What does the Git index exactly contain, and what command can I use to view the content of the index? Thanks for all your answers. I know that the index acts as a staging area, and what is committed is in the index rather than the working tree. I…
mochidino
  • 3,463
  • 4
  • 23
  • 15
214
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
  • 14,226
  • 9
  • 46
  • 43
118
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,646
  • 2
  • 12
  • 15
97
votes
8 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
  • 59,675
  • 58
  • 202
  • 294
83
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,596
  • 2
  • 12
  • 21
80
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
  • 236,525
  • 50
  • 385
  • 514
76
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
  • 122,748
  • 97
  • 336
  • 451
74
votes
3 answers

How to test an internal class in a class library?

I would like to write a class library which creates for me a complex object but should only be exposed as little as possible. I want it to be included into other projects and there I only have one call to this library which e.g. returns me an object…
Thomas Mondel
  • 1,944
  • 3
  • 20
  • 25
62
votes
4 answers

How to do internal interfaces visible for Moq?

I have 3 projects in my C# solution. Signatures Structures Tests Signatures have public and internal interfaces. Also, it has [assembly: InternalsVisibleTo("Structures")] [assembly: InternalsVisibleTo("Tests")] in AssemblyInfo.cs…
Valentyn Zakharenko
  • 2,710
  • 1
  • 21
  • 47
57
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
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
  • 6,117
  • 2
  • 22
  • 27
54
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
  • 12,849
  • 28
  • 83
  • 139
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
  • 602
  • 5
  • 15
1
2 3
43 44