internals

Understanding how .Internal C functions are handled in R

不打扰是莪最后的温柔 提交于 2019-12-02 15:07:52
I wonder if anyone can illustrate to me how R executes a C call from an R command typed at the console prompt. I am particularly confused by R 's treatment of a) function arguments and b) the function call itself. Let's take an example, in this case set.seed() . Wondering how it works I type the name in at the prompt, get the source ( look here for more on that ), see there is eventually a .Internal(set.seed(seed, i.knd, normal.kind) , so dutifully look up the relevant function name in the .Internals section of /src/names.c , find it is called do_setseed and is in RNG.c which leads me to...

Database Internals - Where to Begin? [closed]

醉酒当歌 提交于 2019-12-02 14:55:57
So lets say that you want to learn some stuff about database internals. What's the best source code to look at? the best books to buy? I was talking about this with a buddy the other day and he recommended: Art of Computer Programming, Volume 3: Sorting and Searching What other books would help me learn about all the File IO and memory issues, pages, locking, etc.... ? Textbook: Database Management Systems by Ramakrishnan and Gehrke. Or: Architecture of a Database System by Hellerstein, Stonebraker, and Hamilton. Production Code: PostgreSQL (I like the PG code better than SQLite , it's far

String concatenation in Python

大城市里の小女人 提交于 2019-12-01 22:10:29
问题 Can you describe difference between two ways of string concatenation: simple __add__ operator and %s patterns? I had some investigation in this question and found %s (in form without using parentheses) a little faster. Also another question was appeared: why result of 'hell%s' % 'o' refers to another memory region than 'hell%s' % ('o',) ? There is some code example: l = ['hello', 'hell' + 'o', 'hell%s' % 'o', 'hell%s' % ('o',)] print [id(s) for s in l] Result: [34375618400, 34375618400,

Why can't I add a tuple to a list with the '+' operator in Python?

自古美人都是妖i 提交于 2019-12-01 21:16:51
问题 Python not support adding a tuple to a list: >>> [1,2,3] + (4,5,6) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: can only concatenate list (not "tuple") to list What are the disadvantages for providing such a support in the language? Note that I would expect this to be symmetric: [1, 2] + (3, 4) and (1, 2) + [3, 4] would both evaluate to a brand-new list [1, 2, 3, 4] . My rationale is that once someone applied operator + to a mix of tuples and lists, they

LoadLibrary Reference Counting

邮差的信 提交于 2019-12-01 18:43:32
From MSDN : The system maintains a per-process reference count on all loaded modules. Calling LoadLibrary increments the reference count. Where is that reference count stored? The actual windows loader is found in NTDLL.dll's LdrLoadDll function. This function is undocumented, and its internal functionality is subject to change in future versions of windows; only those with access to the windows source code could state for certain what happens behind the scenes. However, wine 's source is available, and you can see where it increments the reference count ; it's stored in the LoadCount member

Why can't I add a tuple to a list with the '+' operator in Python?

一世执手 提交于 2019-12-01 18:24:02
Python not support adding a tuple to a list: >>> [1,2,3] + (4,5,6) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: can only concatenate list (not "tuple") to list What are the disadvantages for providing such a support in the language? Note that I would expect this to be symmetric: [1, 2] + (3, 4) and (1, 2) + [3, 4] would both evaluate to a brand-new list [1, 2, 3, 4] . My rationale is that once someone applied operator + to a mix of tuples and lists, they are likely to do it again (very possibly in the same expression), so we might as well provide the list

LoadLibrary Reference Counting

倖福魔咒の 提交于 2019-12-01 17:13:21
问题 From MSDN: The system maintains a per-process reference count on all loaded modules. Calling LoadLibrary increments the reference count. Where is that reference count stored? 回答1: The actual windows loader is found in NTDLL.dll's LdrLoadDll function. This function is undocumented, and its internal functionality is subject to change in future versions of windows; only those with access to the windows source code could state for certain what happens behind the scenes. However, wine's source is

How does .Net CLR implement an “Interface” internally?

我是研究僧i 提交于 2019-12-01 17:06:32
问题 Just curious about how .NET CLR handles interfaces internally? Q1] What happens when CLR encounters something like : simple interface example. (same used below.) interface ISampleInterface { void SampleMethod(); } class ImplementationClass : ISampleInterface { // Explicit interface member implementation: public void SampleMethod() { // Method implementation. } static void Main() { //Declare an interface instance. ISampleInterface mySampleIntobj = new ImplementationClass(); // (A) // Call the

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

旧巷老猫 提交于 2019-12-01 16:15:55
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 anything that touches on why: http://php.net/manual/en/language.oop5.autoload.php : Note: Autoloading is not available if using PHP in CLI interactive mode. Does anyone know what is preventing PHP, as a language, from autoloading while working in CLI mode? Autoloading on the command line works. Do note the mention of "interactive". PHP comes with

Create a process from a driver

不问归期 提交于 2019-12-01 06:20:29
Is there a way to create a user-mode process from kernel-mode on Windows NT platform (XP-W7)? EDIT: I must install only the driver. This is a specific of the project. To create a valid win32 process the driver must communicate with CSRSS (what is completely undocumented). So I ended up by queuing a user-mode APC and allocating virtual memory for the APC code in the context of the existing win32 process (that code will call CreateProcess and do the job). It is a tricky way but it works. I don't know an easier way to achieve this. But what about having a Windows service running which makes an