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

 PROGRAMMING


  Read white space with scanf()

Usually, when we want to enter string with white spaces in C, we need to call gets() or fgets(0 method. We usually will not use scanf(0 or fscanf() because they cannot accept white spaces when scan user inputs. But when we specify the format in scanf() function, we may read strings with white space. the code section below illustrate this:#include <stdio.h> int main(int argc,char **argv){       char name[30];    fprintf(stdout,"Please enter the name : \n");fscanf(stdin,"%[^\n]s",name); fprintf(stdout,"%s\n",name); return 0;} On a...

19,946 0       C SCANF WHITE SPACE STRING FORMAT


  10 Ways to Be a More Productive Web Developer

We could all be more productive. There are many things we can do — some big, some small — that will enhance the way we work and improve the outcomes of our activities.Although I can’t promise that I’ll be able to help you cure all your productivity ailments, I do hope that I can provide you with a few useful, solid tips on streamlining your web development workflow and making every part of the development cycle move quickly and smoothly.Follow each one of these tips and I can almost guarantee you that you’ll save time, be able to create more and/or better wor...

2,289 0       EFFICIENCY API WAYS WEB DEVELOPMENT FRAM


  What programming languages should I learn?

Since I started this blog, I have gotten quite a few emails asking me “What programming languages do you recommend for X?” I often finding myself writing something along the lines ofI would honestly recommend python. Something about me being biased because I know and love it.  Usually say something about the competing technology with a back handed insult. Also if they are starting out I would recommend a language that enforces better OO (Object Orientated) practices than python, like Java (don’t hate me but it’s true).Then I go on to say something ...

3,597 0       JAVA PROGRAMMING LANGUAGE POPULARITY TRE


  Most Pressed Keys and Programming Syntaxes

I switch between programming languages quite a bit; I often wondered what happens when having to deal with the different syntaxes, does the syntax allow you to be more expressive or faster at coding in one language or another. I dont really know about that; but what I do know what keys are pressed when writing with different programming languages. This might be something interesting for people who are deciding to select a programming language might look into, here is a post on the answer to the aged question of: Which programming language should I learn?As far as I can tell lang...

4,986 0       PROGRAMMING LANGUAGE KEYBOARD HOTTEST KE


  Pointers, arrays, and string literals

A recently posted question on Stack Overflow highlighted a common misconception about the role of pointers and arrays held by many programmers learning C.The confusion stems from a misunderstanding concerning the role of pointers and strings in C. A pointer is an address in memory. It often points to an index in an array, such as in the function strtoupper in the following code:void strtoupper(char *str){ if (str) { // null ptr check, courtesy of Michael while (*str != '\0') { // destructively modify the contents at the current pointer location ...

2,789 0       CHAR POINTER INITIALIZATION LITERAL CANN


  Readability in Programming Languages

I saw a side by side comparison of a bunch of scripting languages online recently. Scripting Languages: PHP, Perl, Python, Ruby My first, and second reaction was yuck! Now I have my biases – biases which may  not be shared by others of course. But I like readable code and for me anytime I see a special character (anything not an alphanumeric) it slows me down. This got me thinking about where we are going in design of programming languages? Are we moving forward (what ever that means) or backwards or just sideways?Back when I started programming close to 40 years ago the ...

2,025 0       PROGRAMMING STYLE CODING STYLE READABILI


  Gcd Algorithm with JavaScript

How to find the greatest common divisor betweentwo integers? We may encounter this problem frequently in interviews or otheroccasions.Anefficient metho to find gcd is the Euclideanalgorithm, whichuses the divisionalgorithm incombination with the observation that the gcd of two numbers also divides theirdifference: divide 48 by 18 to get a quotient of 2 and a remainder of 12. Thendivide 18 by 12 to get a quotient of 1 and a remainder of 6. Then divide 12 by6 to get a remainder of 0, which means that 6 is the gcd. Formally, it could bewritten asgcd(a,0)= agcd(a,b)= gcd(b...

10,882 2       JAVASCRIPT ALGORITHM GCD IMPLEMENTATION


  Permutation algorithm with JavaScript

In secondary school, we have learned permutation. Basically, for n numbers, the number of permutations for these n numbers can be calculated to n! which is called 'n factorial'. But to display all the permutations on the screen, we need to use a recursive function. The problem is how to write this function. Next I write a program to display the permutations for n numbers with JavaScript. First, we need to understand that from these n numbers, we can first take any one number from it, and the (n-1) numbers remaining has the similar property as the n numbers, we need to find the permutation...

34,932 0       JAVASCRIPT ALGORITHM PERMUTATION IMPLEME