RSS feed [root] /languages /c /weblog




login:

password:

title search:




 


Mon Feb 06 23:51:37 HKT 2017

c



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

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

optimization


Optimizing Pixomatic for x86 Processors part II

http://www.ddj.com/architect/184405765
http://www.ddj.com/184405807
http://www.ddj.com/184405848
http://www.home.comcast.net[..]tom_forsyth/papers/pixomatic_gdc2004.ppt

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

Move 80 bytes asap - http://codereview.stackexchange.com[..]520/copying-80-bytes-as-fast-as-possible

Pass by value maybe faster than pass by reference - http://cpp-next.com/archive/2009/08/want-speed-pass-by-value/

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

case study of optimization with asm output - http://roartindon.blogspot.hk[..]2016/04/boosting-zopfli-performance.html

Thread-Local Storage - http://david-grs.github.io/tls_performance_overhead_cost_linux/

There are chance that remove branching make code run faster -
http://www.infoq.com/cn/articles/x86-high-performance-programming Other articles in same series - http://www.infoq.com[..]86-high-performance-programming-pipeline
http://www.infoq.com[..]igh-performance-programming-optimization

(google search) (amazon search)


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

book


https://www.ossblog.org[..]ming-with-9-excellent-open-source-books/

https://www.ossblog.org[..]er-c-programming-with-open-source-books/

(google search) (amazon search)


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

misc


The long past of C, how standard growth in C - http://esr.ibiblio.org/?p=4304

The state of C - http://drdobbs.com[..]int?articleId=223000089&siteSectionName=

Reference of C libraries - http://programmers.stackexchange.com[..]out-there-that-include-the-gnu-c-library

Reflection for C - http://altdevblogaday.com[..]/25/reflection-in-c-part-1-introduction/

Interesting idea, integrate C and lisp - http://voodoo-slide.blogspot.com/2010/01/amplifying-c.html

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

Why need header - http://stackoverflow.com[..]7/why-does-c-need-a-separate-header-file

How to monitor file usage - http://www.thegeekstuff.com/2010/04/inotify-c-program-example

C programming questions - http://stevenkobes.com/ctest.html

Taking input for compilation - http://susam.in/blog/compiler-taking-input-while-compiling/

Understand lvalues and rvalues - http://eli.thegreenplace.net[..]standing-lvalues-and-rvalues-in-c-and-c/

http://www.thegeekstuff.com/2012/05/classic-unix-books

You may have something like
switch (x) {
case 1 ... 100:
printf("1 <= %d <= 100\n", x);
break;
http://www.lainoox.com/ranges-in-c-switch-statements/

Tutorial - http://cslibrary.stanford.edu/101/EssentialC.pdf

(google search) (amazon search)


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

cpp


Element of Modern C++ Style, new language feature of C++11 - http://www.herbsutter.com/elements-of-modern-c-style/ , complete tutorial of C++11 - http://www2.research.att.com/~bs/C++0xFAQ.html . And also list of document - http://punchcard.wordpress.com/2011/11/01/c11-c0x-documentation/

How to embed script in C++ - http://dobbscodetalk.com[..]ing-Language-in-CPlusPlus.html&Itemid=29

Is CPP that crap? http://lwn.net/Articles/249460/

lint for c++ - http://groups.google.com[..]wse_thread/thread/b895a69d84ff909d?pli=1

http://www.ddj.com/cpp/archives.jhtml

Namespace tutorial - http://www.dreamincode.net/forums/showtopic59841.htm

http://loadcode.blogspot.com/2009/11/advantages-of-c-over-c.html

Delete a pointer in iterator - http://groups.google.com[..]wse_thread/thread/cfff42bf0c8a569c?hl=en

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

Free books - https://tfetimes.com/free-c-books/

(google search) (amazon search)


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

style


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!

http://www.natpryce.com/articles/000799.html

(google search) (amazon search)


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

ide


http://programmers.stackexchange.com[..]-lightweight-c-editor-or-ide-for-windows

13 Linux Debuggers for C++ Reviewed - http://www.drdobbs.com[..]icleId=240156817&siteSectionName=testing

(google search) (amazon search)


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

compiler


Template variable name lookup explain - http://groups.google.com[..]+/browse_thread/thread/e8755b9cb8f0fd61#

How link work, and how to debug if thing doesn't work - http://www.thegeekstuff.com/2011/10/gcc-linking

How to create static / dynamic library - http://www.lainoox.com/c-shared-libraries-static-dynamic/

GCC - http://www.thegeekstuff.com/2012/10/gcc-compiler-options/

(google search) (amazon search)


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

network


Sample code of flooding network with raw socket - http://www.lainoox.com/c-syn-flood-raw-socket/

C99 socket programming - http://gustedt.wordpress.com[..]m/2011/10/24/socket-programming-and-c99/

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

(google search) (amazon search)



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

profiler


gprof - http://www.ibm.com/developerworks/library/l-gnuprof.html http://www.thegeekstuff.com/2012/08/gprof-tutorial/

(google search) (amazon search)


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

make


Make alternatives - http://freecode.com/articles/make-alternatives

(google search) (amazon search)



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

security


Security coding standard for C - http://www.drdobbs.com[..]8_h&elq=71bc323bdc004bfc8091ce3238c093a2

(google search) (amazon search)


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

system


How to add file in /proc - http://www.thegeekstuff.com/2012/04/create-proc-files

Basic about unix signal - http://www.thegeekstuff.com/2012/03/linux-signals-fundamentals/

limitation of select call - http://www.moythreads.com[..]009/12/22/select-system-call-limitation/

Give hint to kernal about how use swap memory - http://linux.die.net/man/2/madvise

Recursive ls - http://synesis.com.au/software/recls/

Socket programming tutorial - http://www.codedanger.com/caglar/?p=210 http://simplestcodings.com/2011/01/18/ping/

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

(google search) (amazon search)


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

cobol


Where will cobol go? - http://www.javaworld.com[..]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 - http://betathoughts.blogspot.com/2010/02/history-of-malloc.html

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

Tutorial of valgrind - http://www.thegeekstuff.com/2011/11/valgrind-memcheck/

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

Core dump with few variable declaration removed - http://techblog.rosedu.org/c-extern-internals.html

Tracking memory allocation - http://jfdube.wordpress.com[..]-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/libc.so.1
#1 0xfe342e28 in cleanfree () from /lib/libc.so.1
#2 0xfe341f5c in _malloc_unlocked () from /lib/libc.so.1
#3 0xfe341e50 in malloc () from /lib/libc.so.1
#4 0xfe38f534 in _findbuf () from /lib/libc.so.1
#5 0xfe384f38 in _doprnt () from /lib/libc.so.1
#6 0xfe3886fc in fprintf () from /lib/libc.so.1
#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
(gdb)

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

bug


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

(google search) (amazon search)


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

gui


Example of using DBus - http://brunogirin.blogspot.com[..]m/2011/01/d-bus-experiments-in-vala.html

(google search) (amazon search)


Sat Aug 06 00:35:30 HKT 2011 From /weblog/languages/c

string


One big problem of strncpy, it doesn't allow you control the behaviour when overflow... http://blog.liw.fi/posts/strncpy/

Problem of atoi - http://www.lainoox.com/ascii-to-integer-atoi-in-c/

(google search) (amazon search)


Sat Jan 15 10:08:41 HKT 2011 From /weblog/languages/c

io


First Disk Seek on multi-core system - http://www.1024cores.net/home/scalable-architecture/wide-finder-2

(google search) (amazon search)