Today's Question:  What does your personal desk look like?        GIVE A SHOUT

SEARCH KEYWORD -- Macro



  C Macro Tips and Tricks

Preprocessor vs Compiler To properly understand C macros, you must understand how a C program is compiled. In particular, you must understand the different things that happen in the preprocessor and in the compiler. The preprocessor runs first, as the name implies. It performs some simple textual manipulations, such as: Stripping comments. Resolving #include directives and replacing them with the contents of the included file. Evaluating #if and #ifdef directives. Evaluating #defin...

   C,Macro,Preprocessor,Trick     2012-05-01 06:49:05

  Macro vs. Micro Optimisation

So there's recently been a bit of hype about another Colebourne article: http://blog.joda.org/2011/11/real-life-scala-feedback-from-yammer.html I'd like to respond to a few points he makes. First - You should evaluate Scala and pay attention to its benefits and flaws before adopting it.  Yes, there are flaws to Scala.   Working at typesafe makes you more aware of some of them.  We're actively working to reduce/minimize/get rid of these.   In my opinion, the negat...

   Optimization,Performance,Micro,Macro,Software     2011-11-30 12:04:25

  Understanding PHP's internal function definitions

Welcome to the second part of the “PHP’s Source Code For PHP Developers” series. In the previous part ircmaxell explained where you can find the PHP source code and how it is basically structured and also gave a small introduction to C (as that’s the language PHP is written in). If you missed that post, you probably should read it before starting with this one. What we’ll cover in this article is locating the definitions of internal functions in t...

   PHP,internal function,definition,rationale     2012-03-16 10:46:26

  Vim anti-patterns

The benefits of getting to grips with Vim are immense in terms of editing speed and maintaining your “flow” when you’re on a roll, whether writing code, poetry, or prose, but because the learning curve is so steep for a text editor, it’s very easy to retain habits from your time learning the editor that stick with you well into mastery. Because Vim makes you so fast and fluent, it’s especially hard to root these out because you might not even notice them...

   Vim,Anti-pattern,macro,syntax     2012-02-08 10:06:15

  What are some lesser known but useful Unix commands?

A few that come to mind, some less known, some more: xargs or parallel: run things in parallel, with lots of options sed and awk: more well-known but still super useful for processing text files, and faster than Python or Ruby m4: simple macro processor screen: powerful terminal multiplexing and session persistence yes: print a string a lot cal: nice calendar env: run a command (useful in scripts) look: find English words (or lines in a file) beginning with a string cut and paste and join: data...

   Linux,Unix,Command,Less used     2011-12-27 09:27:49

  A trick of building multithreaded application on Solaris

Firstly, Let’s see a simple multithreaded application: #include <stdio.h> #include <pthread.h> #include <errno.h> void *thread1_func(void *p_arg) { errno = 0; sleep(3); errno = 1; printf("%s exit, errno is %d\n", (char*)p_arg, errno); } void *thread2_func(void *p_arg) { errno = 0; sleep(5); printf("%s exit, errno is %d\n", (char*)p_arg, errno); } int main(void) { pthread_t t1, t2; ...

   C, Solaris     2014-10-14 02:59:40

  Faster than C

Judging the performance of programming languages, usually C is called the leader, though Fortran is often faster. New programming languages commonly use C as their reference and they are really proud to be only so much slower than C. Few language designer try to beat C. What does it take for a language to be faster than C? Better Aliasing Information Aliasing describes the fact that two references might point to the same memory location. For example, consider the canonical memory copy: void...

   C,Performance,Speed,Fortran,Criteria     2012-03-25 09:12:23

  Learn how to tell a story before building your own start-ups

Imagine one day you become a successful start-up founder like Mark Zuckerberg, then somebody will come and find you and want to shoot a movie for you with your start-up story. If you are not successful yet, then this story should be written by yourself. For start-up founders, learn how to tell a story will not only promote yourself among investors, users and medias but also can create a macro development plan for your start-ups by explaining various unexpected things will happen. Pixar storyboa...

   Start-up,rules,Pixar     2013-03-10 10:06:54

  Learning Ruby and Ruby vs Lisp

The company I work for has a lot of legacy Ruby code, and as Ruby has become kind of a mainstream language, I decided to get a book about it and learn how it works. As my learning resource, I chose The Ruby Programming language by David Flanagan and Yukihiro Matsumoto as that receives great customer reviews, covers Ruby 1.8.7 and 1.9 and is authoritative because the language creator is one of the authors. The book makes a good read in general. There are plen...

   Ruby,Feature,Functional,OOP,Lisp,Difference     2011-12-12 07:42:01

  C vs Java Complete Comparison

Similarities: Java and C have same syntax operators. Difference—thinking Two paradigms: Java: Object oriented language C: Structured language Differences: --Syntax No preprocessor Java does not include a preprocessor and does not define any analogs of the #define, #include, and #ifdef directives. Constant definitions are replaced with static final fields in Java. (See the java.lang.Math.PI field for an example.) Macro definitions are not available in...

   C,Java,Comparison,Difference,Similaritie     2011-10-06 12:46:39