low-level

(Non-Relational) DBMS Design Resource

蹲街弑〆低调 提交于 2019-12-06 10:03:00
问题 As a personal project, I'm looking to build a rudimentary DBMS. I've read the relevant sections in Elmasri & Navathe (5ed), but could use a more focused text- something a bit more practical and detail-oriented, with real-world recommendations- as E&N only went so deep. The rub is that I want to play with novel non-relational data models. While a lot of E&N was great- indexing implementation details in particular- the more advanced DBMS implementation was only targeted to a relational model. I

Decoding git objects / “Block length does not match with its complement” error

巧了我就是萌 提交于 2019-12-06 02:57:51
问题 I'm stuck with very simple but annoying issue, and cannot find answer on the Internet. Hope you will be able to point me, what I've done wrong. I'm trying to decode object from Git repository. According to ProGit, file name and it's contents have been deflated during commit. I'm using C# to read object indicated by SHA1 into a stream, inflate it and convert into byte array. Here is the code: using System.IO.Compression; static internal byte[] GetObjectBySha(string storagePath, string sha) {

What's inside the stack?

寵の児 提交于 2019-12-05 19:16:09
问题 If I run a program, just like #include <stdio.h> int main(int argc, char *argv[], char *env[]) { printf("My references are at %p, %p, %p\n", &argc, &argv, &env); } We can see that those regions are actually in the stack. But what else is there? If we ran a loop through all the values in Linux 3.5.3 (for example, until segfault) we can see some weird numbers, and kind of two regions, separated by a bunch of zeros, maybe to try to prevent overwriting the environment variables accidentally.

How are functions curried?

梦想与她 提交于 2019-12-05 11:33:58
问题 I understand what the concept of currying is, and know how to use it. These are not my questions, rather I am curious as to how this is actually implemented at some lower level than, say, Haskell code. For example, when (+) 2 4 is curried, is a pointer to the 2 maintained until the 4 is passed in? Does Gandalf bend space-time? What is this magic? 回答1: Short answer: yes a pointer is maintained to the 2 until the 4 is passed in. Longer than necessary answer: Conceptually, you're supposed to

Is it worth to implement small filesystem for an EEPROM

旧街凉风 提交于 2019-12-05 09:47:12
I have bought an I2C EEPROM. I want to store sensor and voltage data. I'm assuming that value can be bigger than one byte, and there can be a lot of data. Is it worth is such case to implement a filesystem with small file allocation table? It would make me easier to peek trought EEPROM for example. I see two causes for a FAT on EEPROM If there is a requirement for the flexibility of having different files. Such as for data logging or configurations. It allows multiple such configuration/log files, to be independent and easily added in the future. This can be a very successful building block

Bluetooth protocol over wifi?

依然范特西╮ 提交于 2019-12-05 08:14:57
I'm looking to implement the Bluetooth protocol over a physical Wi-Fi based transport, if that makes sense. Basically my phone has Bluetooth, and my laptop has a Wi-Fi card (802.11a/b/g). I know that Wi-Fi operates over the range 2.412 GHz - 2.472 GHz, and that Bluetooth operates over the range 2.402 GHz - 2.480 GHz. I couldn't help but notice the overlap here. So my questions are: What sort of low-level APIs would I need (preferably in C, on Windows) in order to send a signal out at certain frequencies on the Wi-Fi card? Would I be able to implement a Bluetooth stack on top of this? So

How do I use low-level 8 bit flags as conditionals?

微笑、不失礼 提交于 2019-12-05 07:47:10
In my keyboard hook, each keypress gets a flag that states if it was injected or not. http://msdn.microsoft.com/en-us/library/ms644967(VS.85).aspx I've distilled a KBDLLHOOKSTRUCT from the lParam. I can access kbd.flags.XXX. I just don't know how to convert this 8bit flag into an if (injected) {... type conditional that I know how to use. If one of you smart computer-science types would help me out I'd really appreciate it. private static IntPtr HookCallback(int nCode, IntPtr wParam, IntPtr lParam) { KBDLLHOOKSTRUCT kbd = new KBDLLHOOKSTRUCT(); Marshal.PtrToStructure(lParam, kbd); //if

Algorithms for downscaling bitmapped fonts

纵然是瞬间 提交于 2019-12-05 05:03:05
问题 This is a follow-up to this question. I am working on a low level C app where I have to draw text. I have decided to store the font I want to use as an array (black and white, each char 128x256, perhaps), then I'd downscale it to the sizes I need with some algorithm (as grayscale, so I can have some crude font smoothing). Note: this is a toy project, please disregard stuff like doing calculations at runtime or not. Question is, which algorithm? I looked up 2xSaI , but it's rather complicated.

Can I change a user's keyboard input?

戏子无情 提交于 2019-12-05 03:17:54
问题 I found this keyboard hook code, which I'm trying to slightly modify for my purposes: http://blogs.msdn.com/toub/archive/2006/05/03/589423.aspx As an overview, I want to have the user press a key, say 'E', and have the keyboard return a different character, 'Z', to whatever app is in focus. The relevant method I changed now looks like: private static IntPtr HookCallback(int nCode, IntPtr wParam, IntPtr lParam) { if (nCode >= 0 && wParam == (IntPtr)WM_KEYDOWN) { //The truely typed character:

How to map two virtual adresses on the same physical memory on linux?

倖福魔咒の 提交于 2019-12-04 23:10:43
问题 I'm facing a quite tricky problem. I'm trying to get 2 virtual memory areas pointing to the same physical memory. The point is to have different page protection parameters on different memory areas. On this forum, the user seems to have a solution, but it seems kinda hacky and it's pretty clear that something better can be done performance-wise : http://www.linuxforums.org/forum/programming-scripting/19491-map-two-virtual-memory-addres-same-physical-page.html As I'm facing the same problem, I