background preloader

Programming

Facebook Twitter

String

Reference. Tools. Tips. Code. Parallel. Software optimization resources. C++ and assembly. Windows, Linux, BSD, Mac OS X. See also my blog Contents Optimization manuals This series of five manuals describes everything you need to know about optimizing code for x86 and x86-64 family microprocessors, including optimization advices for C++ and assembly language, details about the microarchitecture and instruction timings of most Intel, AMD and VIA processors, and details about different compilers and calling conventions. Operating systems covered: DOS, Windows, Linux, BSD, Mac OS X Intel based, 32 and 64 bits.

Note that these manuals are not for beginners. 1. This is an optimization manual for advanced C++ programmers. 2. This is an optimization manual for advanced assembly language programmers and compiler makers. 3. This manual contains details about the internal working of various microprocessors from Intel, AMD and VIA. 4. 5. All five manuals Download all the above manuals together in one zip file. C++ vector class library File name: vectorclass.zip, size: 682404, last modified: 2017-Jul-27.Download. Code Monkeyism: This Function is Not Tail Recursive. July 19, 2010 by Stephan Schmidt Tail recursion seems to be an easy concept, but most people get it wrong – including me. Reading the latest German Java SPEKTRUM, I’ve found an article about parallel multicore development by Kornelius Fuhrer.

One paragraph was about functional development and tail recursion. First he claims tail recursion makes functions 100% parallizeable (I guess broadly speaking all compositions h(g,f) of side effect free functions g,f are 100% parallizeable in f and g, nothing to do with tail recursion) then he claims his example functions are tail recursive: Wikipedia says about tail recursion: In computer science, tail recursion (or tail-end recursion) is a special case of recursion in which any last operation performed by the function is a recursive call, the tail call, or returns a (usually simple) value without recursion. In all three examples the last operation performed is the multiplication (*), not the function call to itself. About the author. LINQ To SQL and the Web.Config ConnectionString Value - Rick Strahl's Web Log. I just got had by an odd behavior in the LINQ to SQL model designer when working with a LINQ to SQL Model in a separate class library project.

I use LINQ to SQL in a business layer which always lives in a separate assembly and so the model does not live in the same project as the Web (or other) application I'm working on. When the model is created the DataContext has options on how the Connection is handled when you create your DataContext without specifying any parameters in the constructor - ie. you're instantiating the DataContext without a connection string or connection object: TimeTrakkerContext context = new TimeTrakkerContext(); When you do this the settings are read from the configuration settings or the default connection string if no settings are available. You can see these settings in the DataContext properties under Connection: You can specify a default connection string, and whether you like to use Application Settings to read the value from your config file.

OnCreated(); Map Reduce: A really simple introduction « Kaushik Sathupadi. Ever since google published its research paper on map reduce, you have been hearing about it. Here and there. If you have uptil now considered map-reduce a mysterious buzzword, and ignored it, Know that its not. The basic concept is really very simple. and in this tutorial I try to explain it in the simplest way that I can. Note that I have intentionally missed out some deeper details to make it really friendly to a beginner.

Chapter 1: Your CEO’s Strange itch: Imagine this. Dear <Your Name>, As you know we are building the blogging platform blogger2.com, I need some statistics. Picture yourself in that position for a moment. Occurance of one character words – Around 937688399933 Occurance of two chracter words – Around 23388383830753434 .. hence forth till 10 If homicide, suicide or resigining the job is not an option, how would you solve it? You decide to take leave for the day, go home, sleep over it, and the next day wake up with the greatest Idea ever. Each take 4 days. Abusing the c compiler.

Code reading Today I found something really neat in Larceny's foreign function interface. The deal is that often times you need to parse a C structure or a preprocessor definition, and man, parsing C makes a body feel lazy. What's a hacker to do? Larceny has an amusing take on this problem. The code looks straightforward enough: ;; parse out ent->d_name as a string (define (dirent->name ent) (define-c-info (include<> "dirent.h") (struct "dirent" (name-offs "d_name"))) (%peek-string (+ ent name-offs))) The define-c-info block calculates name-offs, which is the offset of d_name in the dirent structure.

I had imagined, looking at this, that they had some kind of database of the headers and such, and in a sense they do -- in the form of the C compiler. define-c-info is a macro that runs the C compiler at macro expansion time, compiling and running a generated C program that spits out the relevant information as an s-expression on its stdout. some people like diagrams Cool, no?

R&amp;D - Publications - WHP031. Dr Dobbs - HTML5 Web Workers. Visual Studio 2008 SP1 Stepping and Breakpoint Issues. Hacker News | For loops help - comp.lang.c. Chris&#039;s Wiki :: blog/programming/HowToWriteToStderr. Suppose that you're writing a command like, say, make; it writes progress output to standard output and error reports to standard error, and it doesn't necessarily immediately terminate when it encounters an error (or prints a warning; the important thing is that it keeps running after it prints things to standard error). There's a subtle catch in how you want to print things (such as standard error messages) to stderr in such a program. You don't want to just do the straightforward thing of printing to stderr and being done with it. Instead, you want to print messages to stderr with the following sequence: flush stdout, write your message to stderr, then flush stderr. (This is obviously inapplicable if all of your IO is complete unbuffered and there is nothing to flush.

But this is an uncommon case.) To convince you of this, here's a little test program to illustrate what goes wrong if you don't: And now let's show what goes wrong: $ .