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
11
votes
2 answers

Why does C# System.Decimal (decimal) "waste" bits?

As written in the official docs the 128 bits of System.Decimal are filled like this: The return value is a four-element array of 32-bit signed integers. The first, second, and third elements of the returned array contain the low, middle, and high…
Tom
  • 503
  • 2
  • 13
11
votes
3 answers

What Ruby technique does Rails use to make my controller methods render views?

Just curious if anybody knows what Ruby technique is used to accomplish the following in the Rails framework. If I don't write, say, an index method on a Rails controller, Rails will still render the index view file if the URL matches that route.…
Nathan Long
  • 122,748
  • 97
  • 336
  • 451
11
votes
2 answers

How does Firebug work internally?

I have debugged through JavaScript using Firebug more than hundred times without worrying about whats happening there. I want to know how exactly a Firebug handles JavaScript/DOM debugging. Say I set a break point on some statement inside a method…
pramodc84
  • 1,576
  • 2
  • 25
  • 33
11
votes
1 answer

Which channel type uses the least amount of memory in Go?

I find myself frequently using channels to get things to stop. In these cases the channel is being used solely as a means of signaling, and none of the data is actually used. For example: package main import ( "fmt" "time" ) func…
Jay Taylor
  • 13,185
  • 11
  • 60
  • 85
11
votes
1 answer

How does querySelector works under the hood?

Everyone knows what DOM selectors like document.getElementByID(...) and document.querySelector(...) do and how you can use it with classes, attributes, id and so on. But I was not able to find how does it work under the hood (I can find perf test…
Salvador Dali
  • 214,103
  • 147
  • 703
  • 753
11
votes
1 answer

Will the object change its hidden class if we create new prototype properties?

In V8, an object changes its hidden class when a new property is added. function Point(x, y) { this.x = x; // This will create new hidden class this.y = y; // This too } My question is simple, will this create a new hidden…
Tony Dinh
  • 6,668
  • 5
  • 39
  • 58
11
votes
1 answer

Ruby left vs right recursion

For some reason Ruby seems to perform better when facing left recursion. For example: def left_recursive_factorial(number) return 1 if number.zero? left_recursive_factorial(number.pred) * number end def right_recursive_factorial(number) …
ndnenkov
  • 35,425
  • 9
  • 72
  • 104
11
votes
1 answer

Why are two random deviates needed to ensure uniform sampling of large integers with sample()?

Given that the following are equivalent we might infer that R uses the same C runif function to generate uniform samples for sample() and runif()... set.seed(1) sample(1000,10,replace=TRUE) #[1] 27 38 58 91 21 90 95 67 63 7 set.seed(1) ceiling(…
Simon O'Hanlon
  • 58,647
  • 14
  • 142
  • 184
11
votes
3 answers

Why doesn't PHP's Autoload feature work in CLI mode?

This is more for my own personal edification than anything else but, this is something that has always bothered me: Why specifically can't PHP perform "autoloading" while in CLI mode? I've been reading this disclaimer for years, but I've never read…
DJ Sipe
  • 1,286
  • 13
  • 12
10
votes
2 answers

How does Lucene/Solr achieve high performance in multi-field / faceted search?

Context This is a question mainly about Lucene (or possibly Solr) internals. The main topic is faceted search, in which search can happen along multiple independent dimensions (facets) of objects (for example size, speed, price of a car). When…
ron
  • 9,262
  • 4
  • 40
  • 73
10
votes
3 answers

How can I inspect a jQuery object?

In jQuery 1.4.4, if I do this in Google Chrome's console: var divs = $('div'); ... what I get back appears to be an array of DOM elements. But I know it must be a jQuery object, because I can chain jQuery methods on…
Nathan Long
  • 122,748
  • 97
  • 336
  • 451
10
votes
4 answers

Laravel 5.4 - How to set PDO Fetch Mode?

The ability to customize the fetch mode was removed from L5.4 and is defaulted to PDO::FETCH_OBJ. The upgrade guide states that you can override this by using an event listener: Event::listen(StatementPrepared::class, function ($event) { …
Edward
  • 311
  • 2
  • 11
10
votes
1 answer

my C# winform needs to detect when other applications enter/exit/run-in TRUE fullscreen, prefer by events

my C# winform application needs put itself in standby mode during time other application runs in true fullscreen mode (not only maximized), like video games, video movies, powerpoint. I need a method to detect if currently there is other application…
mlev
  • 181
  • 7
10
votes
1 answer

Difference between taskkill and taskkill /f

On Microsoft Technet I can read that taskkill has a /f parameter to kill a process forcefully. I wonder what this does internally, to understand the impact of such an action. taskkill (without /f) does not simply send a WM_CLOSE message to the…
Thomas Weller
  • 55,411
  • 20
  • 125
  • 222
10
votes
1 answer

Why is `str` a primitive type?

Looking at both the docs and the code, it appears that str is a primitive type, while String is a struct { Vec }. Now as str is to a [u8] what String is to a Vec, couldn't str have been defined as struct str { slice: [u8]; } similar to how…
llogiq
  • 13,815
  • 8
  • 40
  • 72