http://www.g-brain.net/tutorials/writing-linux-programs-in-raw-binary.txt
http://www.g-brain.net/tutorials/writing-linux-programs-in-raw-binary.txt
linux system call
Documents the journey from C code to assembly to machine code very nicely.Re: [RFC] Convert builin-mailinfo.c to use The Better String Library. [LWN.net]
s written in C++, go play with Monotone. Really. They use a "real database". They use "nice object-oriented libraries". They use "nice C++ abstractions". And quite frankly, as a result of all these design decisions that sound so appealing to some CS people, the end result is a horrible an
c++ なくなってくれると,おれ楽なんだけどな...Strophe
xmpp client
Strophe is a library for writing XMPP clients. It is implemented in both JavaScript and C for use in a wide variety of languages. The implementations are production ready, well documented, easy to use, and easy to extend.
A library for writing XMPP clients. It is implemented in both JavaScript and C for use in a wide variety of languages.
"Strophe is a library for writing XMPP clients. It is implemented in both JavaScript and C for use in a wide variety of languages. The implementations are production ready, well documented, easy to use, and easy to extend."Inside memory management
A low-level article
Replacement for the old INT 0x80, for Pentium II and newer
"Starting with version 2.5, linux kernel introduced a new system call entry mechanism on Pentium II+ processors. Due to performance issues on Pentium IV processors with existing software interrupt method, an alternative system call entry mechanism was implemented using SYSENTER/SYSEXIT instructions available on Pentium II+ processors. This article explores this new mechanism. Discussion is limited to x86 architecture and all source code listings are based on linux kernel 2.6.15.6."C/C++ のコードを Flash Player で動かす! Alchemy を速攻試してみる。 - IT戦記
すすすげええ
あ、アマチャンさんだったのか。Fast polling using C, memached, nginx and libevent - amix blog
Plus a nice comment from Zed.Linux C编程一站式学习
Google 流 C++ プログラムのデバック方法derwiki - What I Wish I Had Known About Developing C/C++ From Linux Before I Started
This page is about the Nimrod programming language, which combines Lisp's power with Python's readability and C's performance.
Nimrod Programming Language - efficient, expressive, elegant, statically typed, imperative, procedural, object-oriented, functional and generic
Nimrod is a new statically typed, imperative programming language, that supports procedural, object oriented, functional and generic programming styles while remaining simple and efficient. A special feature that Nimrod inherited from Lisp is that Nimrod's abstract syntax tree (AST) is part of the specification - this allows a powerful macro system which allows domain specific languages. Nimrod is a compiled, garbage-collected systems programming language which has an excellent productivity/performance ratio. Nimrod's design focuses on the 3E: efficiency, expressiveness, elegance (in the order of priority)...
Nimrod is a new statically typed, imperative programming language, that supports procedural, object oriented, functional and generic programming styles while remaining simple and efficient. A special feature that Nimrod inherited from Lisp is that Nimrod's abstract syntax tree (AST) is part of the specification - this allows a powerful macro system which allows domain specific languages.YouTube - Broadcast Yourself.
Paradigms
Programming Paradigms (CS107) introduces several programming languages, including C, Assembly, C++, Concurrent Programming, Scheme, and Python. The class aims to teach students how to write code for each of these individual languages and to understand the programming paradigms behind these languages.Embedded Systems Design - Embedded.com
Reglas para mejorar la programación en ctpl home page
Tpl works with files, memory buffers and file descriptors so it's suitable for use as a file format, IPC message format or any scenario where you need to store and retrieve your data.
A data serialization library for C.Writing buffer overflow exploits - a tutorial for beginners
good coders code, great reuseHistory of the C family of languages
History, the C family of languagesmy evolution as a programmer
I was reading an article on "Lambda the Ultimate" about Bruce Mills's book "A Theoretical Introduction to Programming," and in particular about the difference between "menu-lookup" writing of glue code, and "real programming", which the author defines as "to increase the computational capacity, to begin with a set of operations, and develop them into new operations that were not obviously implicit in the original set."
A really nice and introspective peek into Kragen's development as a programmer. Lots of nice insights.2009-07-04 - 当面C#と.NETな記録
一番右端の立っているビット位置を求める「ものすごい」コード
うーん全然わかんねー…
crazy!Alecco Locco: SQLite: A Lesson In Low-Defect Software
"99% Statement Coverage, 95% Branch Coverage, Goal: 100% branch coverage by Dec 2009, Striving for 100% test coverage has been [their] most effective method for finding bugs."
I didn't know gcc could do that. Cool.
@newsycombinator: "SQLite: A Lesson In Low-Defect Software (review/summary w/ working source) http://bit.ly/qcfy0" (from http://twitter.com/newsycombinator/status/3550078799)Azul Systems - Cliff Click Jr.’s Blog
Cliff Click Jr.’s Blog
I just foolishly got caught in a You-Tube discussion on Java vs C performance. Foolish because You-Tube comments are a lousy way to present anything and because it's hard to keep the level of discourse scholarly. And foolish especially for me because I've had this discussion so many times and it always comes out the same way... so here's my attempt at distilling my arguments into something I can point people the *next* time I get caught in this silly discussion. Is Java faster than C/C++? The short answer is: it depends.TCMalloc : Thread-Caching Malloc
User 'carlh' posting a series of lectures.
Reddit lessons on programming C - with discussions!
A course written entirely on reddit.ooc
ooc is a modern, object-oriented, functional-ish, high-level, low-level, sexy programming language. it's translated to pure C with a source-to-source compiler.Puzzle: Fast Bit Counting « Reflections
return ((tmp + (tmp >> 3)) & 030707070707) % 63;10 More Puzzle Websites to Sharpen Your Programming Skills | Coderholic
(he's) writing a series of tutorials on x86 assembly for C programmers who are already familiar with many of the basics of programming and computing.
Im writing a series of tutorials on x86 assembly for C programmers who are already familiar with many of the basics of programming and computing. The assembly tutorials available online just arent doing it for me, and I need something organized the way I think, on the topics Im interested in, presented in a way which make comprehensive understanding easy. Ill do the work, go find the answers, and then drop everything here for you to enjoy.C言語~ゲームプログラミングの館~
すごい情報量だなーuWSGI
uWSGI is a fast (pure C), self-healing, developer-friendly WSGI server, aimed for professional python webapps deployment and development.A Favorite Data Structure « Rotten Cotton
Ullman Set: position[members[i]] = i
Ullman set, an excellent tutorialC Craft - Preface
This header file is called “bithacks.h” and it contains various macros for bit manipulations. I also wrote tests for all the macros in the “bithacks-test.c” program. The most beautiful part of “bithacks.h” is the “B8” macro that allows to write something like ” x = B8(10101010) ” and turns it into ” x = 170 ” (because 10101010 in binary is 170 in decimal). I have not yet added B16 and B32 macros but I will add them when I publish the article on advanced bithacks. The credit for the B8 idea goes to Tom Torfs who was the first to write it.Wooji Juice: JavaScript for C & Python programmers
This is an introduction to JavaScript. There are plenty of these on the web, but most of them appear to be for non-programmers, teaching the building-blocks of programming as JavaScript uses them. And that's fine, because many people who have never programmed in their lives, find themselves needing a tiny bit of script for their web page, and need to start somewhere.アフォBlog C言語勉強したけどゲーム作れないぞコラって人向けに
ず、ゲームを作るときにはどのようなゲームか頭の中に完成形がないといけないわけです 「かいわれ育成ゲーム」想像してみてください 水をやったり、肥料をやったり 登場人物は・・・・天気は・・・・舞台は・・・・・
今回作るのはかいわれ育成ゲームです///
はい、色々想像できましたね? それ全部忘れてください。そんな複雑なの嫌です* is Unix
Ryan’s I like Unicorn because it’s Unix appears to have started a mini-meme of folks writing simple forking network servers in their language of choice. I’m really enjoying reading ‘em — they’re a sort of Rosetta Stone of network code — so I’m going to keep a running list of links here. Tell me about any I’ve missed (via email, comments, or twitter) and I’ll add ‘em to the list.
a . . . of Rosetta Stone of network codecmockery - Google Code
There are a variety of C unit testing frameworks available however many of them are fairly complex and require the latest compiler technology. Some development requires the use of old compilers which makes it difficult to use some unit testing frameworks. In addition many unit testing frameworks assume the code being tested is an application or module that is targeted to the same platform that will ultimately execute the test. Because of this assumption many frameworks require the inclusion of standard C library headers in the code module being tested which may collide with the custom or incomplete implementation of the C library utilized by the code under test.
A lightweight library to simplify and generalize the process of writing unit tests for C applications.
A nice unit testing framework for C.
"A lightweight library to simplify and generalize the process of writing unit tests for C applications." Seems simple and uncomplicated.
There are a variety of C unit testing frameworks available however many of them are fairly complex and require the latest compiler technology. Some development requires the use of old compilers which makes it difficult to use some unit testing frameworks. In addition many unit testing frameworks assume the code being tested is an application or module that is targeted to the same platform that will ultimately execute the test. Because of this assumption many frameworks require the inclusion of standard C library headers in the code module being tested which may collide with the custom or incomplete implementation of the C library utilized by the code under test. Cmockery only requires a test application is linked with the standard C library which minimizes conflicts with standard C library headers. Also, Cmockery tries to avoid the use of some of the newer features of C compilers.The C Programming Language: 4.10
4.10 Recursion
Similar to 'Pride and Prejudice and Vampires', here is an adaptation of a famous book in the computer science canon, rewritten in the style of H.P. Lovecraft, specifically 'The Shadow Over Innsmouth' (which I'm coincidentally also reading on my iPhone).
I never heard of C Recursion till the day before I saw it for the first and– so far– last time. They told me the steam train was the thing to take to Arkham; and it was only at the station ticket-office, when I demurred at the high fare, that I learned about C Recursion. The shrewd-faced agent, whose speech shewed him to be no local man, made a suggestion that none of my other informants had offered. "You could take that old bus, I suppose," he said with a certain hesitation. "It runs through C Recursion, so the people don't like it. I never seen more'n two or three people on it– nobody but them C folks."
Brian W Kernighan & Dennis M Ritchie & HP Lovecraft
void Cthulhu (int Ia) { if (Ia/10) Cthulhu (IA/10); putchar // ftagn! (Ia % 10 + '0'); } // neblod zin!Calculate exp() and log() Without Multiplications
How can C Programs be so Reliable?Core Dump: Autoconf and Automake Tutorial
I wrote a charming little utility for linux called getkey, that captures the keystrokes and displays them on the screen using OSD. Its called gekey and t has a couple of .c files and a hand crafted Makefile to go along with it. But I wanted to use the auto-tools (autoconf and automake) to create a configure script and a Makefile so that my utility could by installed like any other GNU tool using the famous:
libKsplice » Hello from a libc-free world! (Part 1) - System administration and software
As an exercise, I want to write a Hello World program in C simple enough that I can disassemble it and be able to explain all of the assembly to myself. This should be easy, right? [...]
Nice article about compiling "Hello World" without libc under linux. Suprisingly deep digging necessary to get it to run properly.
"Hello, world" without libc
As an exercise, I want to write a Hello World program in C simple enough that I can disassemble it and be able to explain all of the assembly to myself.lsコマンドをハックしてみよう (Yahoo! JAPAN Tech Blog)
lsコマンドのソースをいじくっていろいろ。 初歩的だけど確かに普段使ってるコマンドをいじくらせるのは面白いなぁ。Linux Assembly and Disassembly an Introduction
objdumpKsplice » Much ado about NULL: Exploiting a kernel NULL dereference - System administration and software blog
WEEK 12 -- 04/14/2010
Much ado about NULL: Exploiting a kernel NULL dereference6 Line EventMachine Bugfix = 2x faster GC, +1300% requests/sec at time to bleed by Joe Damato
"This results in an increase from 500 requests/sec to 7000 requests/sec when using Sinatra+Thin+Epoll+Threads. That is pretty ill." -- Joe Damato
On top of all that, this patch helps with Ruby’s green threads, too. If the epoll_wait causes a Ruby event to fire and that event creates a Ruby thread, that Ruby thread gets an entire copy of the existing stack. Each time that thread is switched into and out of, that thread stack has to be memcpy’d into and out of place. Reducing those memcpys by ~800,000 bytes is a HUGE performance win. Want to learn more about threading implementations? Check out my threading models post: here. Fixing this turned out to be pretty simple. A six (6!!) line patch: * Speeds up GC by 2-3x because of the huge decrease in stack frame size. * Fixes an open bug in EventMachine where using threads with Epoll causes lots of slowness. The reason is that each thread will inherit an ~800,000 byte stack that gets copied in and out every context switch. * This results in an increase from 500 requests/sec to 7000 requests/sec when using Sinatra+Thin+Epoll+Threads. That is pretty ill.
l in all, a productive debugging session lasting about an hour. The result was a simple patch, with 2 big performance improvements.http://www0.us.ioccc.org/1990/westley.c
IOCCC entry from 1990 that forms a dialogue between two characters in code.
Funny argument between a man and a woman written in c [for:twitter]
C Prog in the form of a conversation
Hilarious and amazing piece of code in C, it reads like a conversation between a couple, while it compiles well.
"[...] obviously, (char)lotte and (char*)lie are incompatible types..."the bit twiddler
一些有用的代码收集
Frammenti di codice C per trucchetti
the bit twiddler【ハウツー】Cアプリを高速化せよ! - 正式リリースされたgoogle-perftoolsを試す (1) google-perftoolsとは | エンタープライズ | マイコミジャーナル
> google-perftoolsには次に挙げる4つのツールが含まれている。* 高速メモリアロケータ TCMalloc * ヒープチェッカー * ヒーププロファイラ * CPUプロファイラWhy you should never use rand() | game development | Ian Bullard
<GeDaMo> Use mmap rather than malloc if you want memory with nx disabled: http://androidbutnotparanoid.blogspot.com/2009/05/dynamically-generating-and-executing.html
Computer programs can generate machine code in memory and then execute it. This is the case with Sun's Java Hotspot VM, which dynamically compiles Java bytecode to native code to increase the VM's performance. Several exploits are based on buffer overflows to remotely inject machine code into memory and then jumping into it. Google released it's Chrome web browser featuring the V8 Javascript Engine, which greatly improved Javascript's performance by compiling Javascript to native code.バグを生まないコーディング法、10個の規則でソフト開発を効率化(1/3) ― EE Times Japan
C のコーディング方法の良くまとまったガイドライン.
EE Times Japanmixi Engineers’ Blog » 100行のCプログラムでWebチャットを実装する方法
Tokyo CabinetAlecco Locco: A Gazillion-user Comet Server With libevent, Part 0
A test with 200,000 sockets (note it's 100,000 pairs) showed a process size of 2MB, so far so goodHigher Computing For Everyone - Learn Programming - Free Programming Classes Online
The course which started it all! First presented on the social news website Reddit in October, 2009, this course has grown to over 6,000 subscribers. Start here if you have little or no programming background. Even experienced programmers may find new and interesting details as well as a helpful refresher in this course. Start at Lesson One, and proceed through each lesson one at a time. If you get stuck, simply follow the "discussion" links and myself and others will be glad to help you.
http://www.reddit.com/r/carlhprogramming/Clockwise/Spiral Rule
There is a technique known as the ``Clockwise/Spiral Rule'' which enables any C programmer to parse in their head any C declaration!
""There is a technique known as the ``Clockwise/Spiral Rule'' which enables any C programmer to parse in their head any C declaration!
"Technique [...] which enables any C programmer to parse in their head any C declaration".
"There is a technique known as the ``Clockwise/Spiral Rule'' which enables any C programmer to parse in their head any C declaration!"MIT OpenCourseWare | Electrical Engineering and Computer Science | 6.087 Practical Programming in C, January IAP 2010 | Home
This course provides a thorough introduction to the C programming language, the workhorse of the UNIX operating system and lingua franca of embedded processors and micro-controllers. The first two weeks will cover basic syntax and grammar, and expose students to practical programming techniques. The remaining lectures will focus on more advanced concepts, such as dynamic memory allocation, concurrency and synchronization, UNIX signals and process control, library development and usage. Daily programming assignments and weekly laboratory exercises are required. Knowledge of C is highly marketable for summer internships, UROPs, and full-time positions in software and embedded systems development.MIT OpenCourseWare | Electrical Engineering and Computer Science | 6.087 Practical Programming in C, January IAP 2010 | Home
This course provides a thorough introduction to the C programming language, the workhorse of the UNIX operating system and lingua franca of embedded processors and micro-controllers. The first two weeks will cover basic syntax and grammar, and expose students to practical programming techniques. The remaining lectures will focus on more advanced concepts, such as dynamic memory allocation, concurrency and synchronization, UNIX signals and process control, library development and usage. Daily programming assignments and weekly laboratory exercises are required. Knowledge of C is highly marketable for summer internships, UROPs, and full-time positions in software and embedded systems development.MIT OpenCourseWare | Electrical Engineering and Computer Science | 6.087 Practical Programming in C, January IAP 2010 | Home
This course provides a thorough introduction to the C programming language, the workhorse of the UNIX operating system and lingua franca of embedded processors and micro-controllers. The first two weeks will cover basic syntax and grammar, and expose students to practical programming techniques. The remaining lectures will focus on more advanced concepts, such as dynamic memory allocation, concurrency and synchronization, UNIX signals and process control, library development and usage. Daily programming assignments and weekly laboratory exercises are required. Knowledge of C is highly marketable for summer internships, UROPs, and full-time positions in software and embedded systems development.