internals

What constitutes a merge conflict in Git?

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-26 15:34:38
问题 How does git determine that a particular merge has a conflict and what the conflict is? My guess would go something like this: if the two commits being merged have a common parent commit, and if they have both changed line X from what the parent had, that's a conflict. What complicates my understanding is: "Changing line X" can mean replacing it with several new lines, and that's still shown as one conflict (version A has this one line, and version B has these 5 lines, or whatever) If you did

How does a debugger work?

£可爱£侵袭症+ 提交于 2019-11-26 14:49:34
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? Rob Walker The details of how a debugger works will depend on what you are debugging, and what the OS is. For native debugging on Windows you can find some details on MSDN: Win32 Debugging API . The user tells the debugger which process to attach to, either by name or by process ID. If it is a name then the debugger will look up the process ID, and

Are Git's pack files deltas rather than snapshots?

对着背影说爱祢 提交于 2019-11-26 12:49:47
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 information to store about a commit. But the longer the commit history gets, the more calculation it takes to compare ranges of revisions. By contrast, Git stores a complete snapshot of the whole project in each revision . The reason this doesn't make the repo size grow dramatically with each commit is each file in the project is stored as a file

Practical uses for the “internal” keyword in C#

笑着哭i 提交于 2019-11-26 08:52:15
问题 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? 回答1: Utility or helper classes/methods that you would like to access from many other classes within the same assembly, but that you want to ensure code in other assemblies can't access. From MSDN (via archive.org): A common use of internal access is in component-based development

Factors in R: more than an annoyance?

混江龙づ霸主 提交于 2019-11-26 08:47:05
问题 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 factors as grouping variables where the factor data type becomes necessary? Are there specific circumstances when I should be using factors? 回答1: You should use factors. Yes they can be a pain, but my theory is that 90% of why they're a pain is because

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

馋奶兔 提交于 2019-11-26 06:36:01
问题 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# compiler compile code for Int32 type? public struct Int32: IComparable, IFormattable, IConvertible { internal int m_value; // ... } But isn\'t this illegal in C#? If int is only an alias for Int32 , it should fail to compile with Error CS0523: Struct

How does a debugger work?

非 Y 不嫁゛ 提交于 2019-11-26 04:02:51
问题 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? 回答1: The details of how a debugger works will depend on what you are debugging, and what the OS is. For native debugging on Windows you can find some details on MSDN: Win32 Debugging API. The user tells the debugger which process to attach to,

Are Git's pack files deltas rather than snapshots?

大兔子大兔子 提交于 2019-11-26 03:37:37
问题 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 information to store about a commit. But the longer the commit history gets, the more calculation it takes to compare ranges of revisions. By contrast, Git stores a complete snapshot of the whole project in each revision . The reason this doesn\

How can bcrypt have built-in salts?

房东的猫 提交于 2019-11-26 00:17:13
问题 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 from an arcfour (arc4random(3)) key stream, seeded with random data the kernel collects from device timings. I don\'t understand how this can work. In my conception of a salt: It needs to be different for each stored password, so that a separate