RSS feed [root] /languages /weblog



title search:


Mon Aug 28 20:32:33 HKT 2017


(google search) (amazon search)
download zip of files only

Thu Jun 01 23:13:08 HKT 2017 From /weblog/languages/c


Optimizing Pixomatic for x86 Processors part II[..]tom_forsyth/papers/pixomatic_gdc2004.ppt

Fast way to add null after each char from a string -[..]wse_thread/thread/51d0f84dd22ad734?hl=en

Move 80 bytes asap -[..]520/copying-80-bytes-as-fast-as-possible

Pass by value maybe faster than pass by reference -

Why is java consumer/producer so much faster than C++, a lot of analysis and optimization tips for C++ coding -[..]mgroups#!topic/comp.lang.c++/7aNw3PzPvMI

case study of optimization with asm output -[..]2016/04/boosting-zopfli-performance.html

Thread-Local Storage -

There are chance that remove branching make code run faster - Other articles in same series -[..]86-high-performance-programming-pipeline[..]igh-performance-programming-optimization

(google search) (amazon search)

Thu Feb 16 22:45:06 HKT 2017 From /weblog/languages/c


(google search) (amazon search)

Wed May 11 10:20:21 HKT 2016 From /weblog/languages/c


The long past of C, how standard growth in C -

The state of C -[..]int?articleId=223000089&siteSectionName=

Reference of C libraries -[..]out-there-that-include-the-gnu-c-library

Reflection for C -[..]/25/reflection-in-c-part-1-introduction/

Interesting idea, integrate C and lisp -

How to prevent code duplication in C -[..]read/thread/b4d029524579944e?hl=en&pli=1

Why need header -[..]7/why-does-c-need-a-separate-header-file

How to monitor file usage -

C programming questions -

Taking input for compilation -

Understand lvalues and rvalues -[..]standing-lvalues-and-rvalues-in-c-and-c/

You may have something like
switch (x) {
case 1 ... 100:
printf("1 <= %d <= 100\n", x);

Tutorial -

(google search) (amazon search)

Tue Jan 05 23:00:16 HKT 2016 From /weblog/languages/c


Element of Modern C++ Style, new language feature of C++11 - , complete tutorial of C++11 - . And also list of document -

How to embed script in C++ -[..]ing-Language-in-CPlusPlus.html&Itemid=29

Is CPP that crap?

lint for c++ -[..]wse_thread/thread/b895a69d84ff909d?pli=1

Namespace tutorial -

Delete a pointer in iterator -[..]wse_thread/thread/cfff42bf0c8a569c?hl=en

Discussing about using standard container without copy constructor -[..]wse_thread/thread/50e174f87d0261cd?hl=en

Free books -

(google search) (amazon search)

Tue Dec 22 16:24:19 HKT 2015 From /weblog/languages


How go utilizing-multi-core

package main

import "runtime"

func calc()
sum := 0;
for i := 0; ; i++ {
sum += i;

func main()
go calc();
go calc();
go calc();
go calc();
go calc();
go calc();
go calc();

A presentation -

Some good thing about go -[..]3/12/16/studying-go-language-golang.html

About memory management and thread -

(google search) (amazon search)

Sun Jun 22 17:35:32 HKT 2014 From /weblog/languages


Overview of Erlang memory model, per thread heap and low thread footprint -[..]/erlang-vs-java-memory-architecture.html

Concurrency is an area where Erlang shines -[..]gView?showComments=true&entry=3364027251

And then, note the flatness of Erlang CPU-time curves and decent C (coroutine) performance compared to abysmal Java 6 and C++ (Pthreads) data in this benchmark -[..]ge&p1=hipe-2&p2=gpp-2&p3=gcc-2&p4=java-0

Another article about Erlang, contains pointers to useful site and reference large scale project -[..]201001928?cid=RSSfeed_DDJ_ArchitectDebug[..]2007/08/erlang-java-for-concurrent-futur[..]og/archives/2007/10/functional_prog.html

Mnesia , DBMS powered by Erlang -

Comment of OO from Joe Armstrong, , that tell why Erlang look like this, and why me and my college feel uncomfortable with it....

Some issues of Erlang -

Map reduce at Erlang -[..]/06/exploring-erlang-with-mapreduce.html[..]ly-500-million-users-11000-cores-an.html

(google search) (amazon search)

Tue Oct 29 18:40:18 HKT 2013 From /weblog/languages


Implementing a blog in common lisp -

Arc, new dialect of Lisp -

Detail discuss the good and bad of lisp for C programmers -

(google search) (amazon search)

Mon Aug 12 17:31:03 HKT 2013 From /weblog/languages/c


How to have good C code -

- Be Disciplined About Namespace Management
- Clearly Document Published APIs
- Keep Data Types Abstract
- Use Polymorphism Judiciously
- Prefer Modularisation Over Conditional Compilation
- The Best Way to Modularise a Large C Codebase is Don't Have a Large C Codebase!

(google search) (amazon search)

Sat Jul 13 18:02:24 HKT 2013 From /weblog/languages/c


13 Linux Debuggers for C++ Reviewed -[..]icleId=240156817&siteSectionName=testing

(google search) (amazon search)

Sun Nov 04 10:01:04 HKT 2012 From /weblog/languages/c


Template variable name lookup explain -[..]+/browse_thread/thread/e8755b9cb8f0fd61#

How link work, and how to debug if thing doesn't work -

How to create static / dynamic library -


(google search) (amazon search)

Sun Oct 28 09:42:16 HKT 2012 From /weblog/languages/c


Sample code of flooding network with raw socket -

C99 socket programming -[..]m/2011/10/24/socket-programming-and-c99/

How to Perform Packet Sniffing Using Libpcap with C Example Code -[..]m/2012/10/packet-sniffing-using-libpcap/

(google search) (amazon search)

Tue Aug 21 22:56:25 HKT 2012 From /weblog/languages/c


gprof -

(google search) (amazon search)

Sat Jul 28 12:01:37 HKT 2012 From /weblog/languages/c


Make alternatives -

(google search) (amazon search)

Thu May 10 00:29:56 HKT 2012 From /weblog/languages/c


Security coding standard for C -[..]8_h&elq=71bc323bdc004bfc8091ce3238c093a2

(google search) (amazon search)

Thu Apr 26 00:02:07 HKT 2012 From /weblog/languages/c


How to add file in /proc -

Basic about unix signal -

limitation of select call -[..]009/12/22/select-system-call-limitation/

Give hint to kernal about how use swap memory -

Recursive ls -

Socket programming tutorial -

Discussion about making flush() reliable -[..]wse_thread/thread/71da1187ec3b0445?hl=en

(google search) (amazon search)

Sun Apr 01 21:02:15 HKT 2012 From /weblog/languages


Where will cobol go? -[..]s-legacy-could-be-lost.html&site=jw_core

(google search) (amazon search)

Thu Mar 01 22:25:13 HKT 2012 From /weblog/languages/c

memory issue

Problem of malloc, and introduction to some improved version -

Personal memo about C++ memory management, from a Java developer, contain some rule of thumb tips -[..]c-trying-to-understand-memory-mangement/

Tutorial of valgrind -

Disucssion of GC in C++ -[..]10/25/garbage-collection-synopsis-and-c/

Core dump with few variable declaration removed -

Tracking memory allocation -[..]-management-part-2-allocations-tracking/

We have a process running fine for several years and recently have core dump everytime starting it up. here is the stacktrace:

(gdb) backtrace
#0 0xfe34251c in realfree () from /lib/
#1 0xfe342e28 in cleanfree () from /lib/
#2 0xfe341f5c in _malloc_unlocked () from /lib/
#3 0xfe341e50 in malloc () from /lib/
#4 0xfe38f534 in _findbuf () from /lib/
#5 0xfe384f38 in _doprnt () from /lib/
#6 0xfe3886fc in fprintf () from /lib/
#7 0x164f64 in _ZN7LogBook8WriteLogEPcS0_i (this=, pType=0x5c00e8 "INFO",
pMsg=0x6b0b14 "main. Database=XXXXXX. Performing Login to XXXX. user=SYSTEM.", nFile=0) at Util.cpp:164
#8 0x164e28 in _ZN7LogBook9PromptLogEPciS0_i (this=, pType=0x5c00e8 "INFO",
nType=3, pMsg=0x0, nFile=0) at Util.cpp:136
#9 0x14a364 in main (argc=3, argv=0xffbef5bc) at XXXX.cpp:385

Eventaully we found out the reason is the class LogBook is singleton, and it reuse few char* buffer internally, without delete and new in between, after adding delete and new for transaction, the process run correctly, as a rule of thumb, singleton is evil for most of the cases.

(google search) (amazon search)

Sat Oct 15 11:37:46 HKT 2011 From /weblog/languages/c


incorrect comparison of 64bit pointers -[..]/2011-08-28-just-fixed-a-20-year-old-bug

(google search) (amazon search)

Wed Oct 05 12:47:41 HKT 2011 From /weblog/languages


Pointer of using function languages like OPML in finance industry -

(google search) (amazon search)

Mon Sep 26 23:59:58 HKT 2011 From /weblog/languages/c


Example of using DBus -[..]m/2011/01/d-bus-experiments-in-vala.html

(google search) (amazon search)