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
16
votes
6 answers

How can I access the ListViewItems of a WPF ListView?

Within an event, I'd like to put the focus on a specific TextBox within the ListViewItem's template. The XAML looks like this:
David Schmitt
  • 58,259
  • 26
  • 121
  • 165
16
votes
1 answer

How is the s=s+c string concat optimization decided?

Short version: If s is a string, then s = s + 'c' might modify the string in place, while t = s + 'c' can't. But how does the operation s + 'c' know which scenario it's in? Long version: t = s + 'c' needs to create a separate string because the…
no comment
  • 6,381
  • 4
  • 12
  • 30
16
votes
1 answer

Why was the object_id for true and nil changed in ruby2.0?

I came across this ruby object_id allocation question sometime back and then read this awesome article which talks about VALUE and explains why object_id of true, nil and false the way they are. I have been toying with ruby2.0 object_id when I found…
Bharadwaj Srigiriraju
  • 2,196
  • 4
  • 25
  • 45
16
votes
4 answers

How to find out which .c file contains the .c functions of R internals, on Windows?

I want to view the source code of R's match.call function. As it is an internal function, I downloaded the R source code, went to ./src/main/names.c and looked for match.call there. Thus, I found out that the corresponding .c function is called…
15
votes
1 answer

canEqual() in the scala.Equals trait

From the source code scala/Equals.scala (here): package scala trait Equals extends scala.Any { def canEqual(that: scala.Any): scala.Boolean def equals(that: scala.Any): scala.Boolean } In the documentation, it says: A method that should be…
15
votes
3 answers

Why might a proc run faster than a block?

This answer on another question says that array.map(&:to_s) is faster than array.map { |n| n.to_s } In the first example, & turns :to_s into a Proc. The second example uses a block. Why might a Proc be faster than a block in that benchmark? Is…
Nathan Long
  • 122,748
  • 97
  • 336
  • 451
14
votes
2 answers

STL internals: deque implementation

I am using a std::deque for storing a large collection of items. I know that deques is implemented as a list of vectors. The size of those vectors cannot be set but I wander what is the algorithm for choosing that size.
cprogrammer
  • 5,503
  • 3
  • 36
  • 56
14
votes
3 answers

GNU STL string: is copy-on-write involved here?

(Disclaimer: I don't know what the C++ standard might say about this..I know, I'm horrible) while operating on very large strings I noticed that std::string is using copy-on-write. I managed to write the smallest loop that would reproduce the…
Michael Foukarakis
  • 39,737
  • 6
  • 87
  • 123
14
votes
2 answers

Rendering Optimization and Sibling Selectors

WebKit browsers have a built-in optimization technique for style rendering "that results in not even having to match style for about 60% of the elements on your page." However, that optimization is switched off completely for the entire page if "any…
cantera
  • 24,479
  • 25
  • 95
  • 138
13
votes
2 answers

Converting an extension method group to a delegate with a generic type

I have two extension methods on IDataReader with the following signatures: internal static List GetList(this IDataReader reader, Func del) internal static double? GetDoubleOrNull(this IDataReader reader, string…
Moss
  • 855
  • 1
  • 9
  • 23
13
votes
4 answers

I'm trying to understand Microsoft's DoubleUtil.AreClose() code that I reflected over

If you reflect over WindowsBase.dll > MS.Internal.DoubleUtil.AreClose(...) you'll get the following code: public static bool AreClose(double value1, double value2) { if (value1 == value2) { return true; } double num2 =…
myermian
  • 31,823
  • 24
  • 123
  • 215
13
votes
2 answers

How does event handling work internally within JavaScript?

Specifically Spidermonkey. I know you write functions and attach them to events to handle them. Where is the onClick handler defined and how does the JS engine know to fire onClick events when the user clicks? Any keywords, design patterns, links,…
Mad Rapper X
  • 311
  • 4
  • 16
13
votes
9 answers

Alignment along 4-byte boundaries

I recently got thinking about alignment... It's something that we don't ordinarily have to consider, but I've realized that some processors require objects to be aligned along 4-byte boundaries. What exactly does this mean, and which specific…
Tony the Pony
  • 40,327
  • 71
  • 187
  • 281
12
votes
1 answer

Is there a difference between \??\ and \\?\ paths?

The MSDN document Naming Files, Paths, and Namespaces talks about the \\?\ prefix. To quote: For file I/O, the "\?\" prefix to a path string tells the Windows APIs to disable all string parsing and to send the string that follows it straight to the…
Ilya
  • 5,533
  • 2
  • 29
  • 57
12
votes
6 answers

How does c# figure out the hash code for an object?

This question comes out of the discussion on tuples. I started thinking about the hash code that a tuple should have. What if we will accept KeyValuePair class as a tuple? It doesn't override the GetHashCode() method, so probably it won't be aware…
Massimiliano
  • 16,770
  • 10
  • 69
  • 112