start new:
tmux
start new with session name:
tmux new -s myname
#include <stdio.h> | |
#define SIZE 4 | |
int summarray3d(int a[SIZE][SIZE][SIZE], int size) | |
{ | |
int i, j, k, sum=0; | |
for(i=0;i<size;i++){ | |
for(j=0;j<size;j++){ | |
for(k=0;k<size;k++){ | |
sum +=a[k][j][i]; | |
printf("i:%2d,j:%2d,k:%2d, add:%p\n", i,j,k,&a[k][i][j]); |
#include <stdio.h> | |
#include <string.h> | |
int main(void) | |
{ | |
char test[80], blah[80]; | |
char *sep = "\\/:;=-"; | |
char *word, *phrase, *brkt, *brkb; | |
strcpy(test, "This;is.a:test:of=the/string\\tokenizer-function."); | |
//Note strtok is obsoleted and not reentrant |
#include <stdio.h> | |
#include <string.h> | |
//wrapper function of strtok | |
/*strIn, can be NULL, then the result output will use lastState to manipulate */ | |
char* strtok_tj_r(char* restrict strIn, const char* restrict tokens, char** restrict lastState) | |
{ | |
char* result; | |
if(strIn!=NULL){ | |
result = strtok(strIn,tokens);//the string has been modified by strok with token char replace by eof |
/* Display value of fixed point numbers */ | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <string.h> | |
/* Extract hex/decimal/or float value from string */ | |
static int get_num_val(char *sval, unsigned *valp) { | |
char *endp; | |
/* See if it's an integer or floating point */ | |
int isbinary = 0; |
#include <stdio.h> | |
#include <stdlib.h> | |
/* forward declaration */ | |
typedef struct object Object; | |
typedef int (*func_t)(Object *); | |
struct object { | |
int a, b; | |
func_t add, sub; |
A good commit message looks like this: | |
Header line: explaining the commit in one line | |
Body of commit message is a few lines of text, explaining things | |
in more detail, possibly giving some background about the issue | |
being fixed, etc etc. | |
The body of the commit message can be several paragraphs, and | |
please do proper word-wrap and keep columns shorter than about |
import java.nio.file.Files | |
import java.nio.file.Path | |
def getTempDirectory(prefix:String):String = { | |
val path = Files.createTempDirectory(prefix) | |
path.toString | |
} |
$sname="w32time" | |
#check if the service running | |
if((Get-service $sname | Where-Object {$_.status -eq "running"} ) -eq $Null){ | |
#Not Running, restart it | |
Stop-service $sname | |
Start-service $sname | |
} | |
sleep 30 |
A friend and I had a discussion about the basic skills that are often lacking in experienced programmers. How can a programmer work for ten or twenty years and never learn to write good code? So often they need close supervision to ensure they go down the right path, and they can never be trusted to take technical leadership on larger tasks. It seems they are just good enough to get by in their job, but they never become effective.
We thought about our experiences and came up with three fundamental skills that we find are most often missing. Note that these are not skills which take a considerable amount of talent or unique insight. Nor are they "trends" or "frameworks" to help you get a new job. They are basic fundamentals which are prerequisites to being a successful programmer.
Programmers cannot write good code unless they understand what they are typing. At the most basic level, this means they need to understand the rules of