Skip to content

Instantly share code, notes, and snippets.

View dd1994's full-sized avatar
💭
I may be slow to respond.

JIANG Di dd1994

💭
I may be slow to respond.
View GitHub Profile
#include <stdio.h>
int search(int *a, int, int);
int main(void)
{
int a[10], i, x;
int j = 0;
#include <stdio.h>
#include <string.h>
void mcopy(char *, char *, int);
int main(void)
{
char a[80], b[80];
int m;
#include <iostream>
using namespace std;
int main()
{
int flag;
long int a, b;
long double result;
char operation;
#include <iostream>
#define MAX 100
using namespace std;
int main(void)
{
int i, j, m, n;
double a[MAX];
cout << "please input n: ";
// http://en.wikipedia.org/wiki/Simplex_algorithm
#include "SimplexAlgorithm.h"
#define M 200
#define N 100
int main(void)
{
int n, m, i, j;
printf("请输入总的变量的个数和松弛变量的个数:\n");
scanf("%d %d", &m, &n);
@dd1994
dd1994 / .ycm_extra_conf.py
Created August 18, 2014 14:28
Semantic Completion for C
# This file is NOT licensed under the GPLv3, which is the license for the rest
# of YouCompleteMe.
#
# Here's the license text for this file:
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
def fibonacci(n)
raise "bad argument" if n < 1 or n.is_a? Float
return 1 if n == 1 or n == 2
fibonacci(n-1) + fibonacci(n-2)
end
n = Integer(ARGV[0])
1.upto(n) {|x| print fibonacci(x).to_s + " "}
print "\n"
from http://stackoverflow.com/questions/21060234/ruby-operator-precedence-table
N A M Operator(s) Description
- - - ----------- -----------
1 R Y ! ~ + boolean NOT, bitwise complement, unary plus
(unary plus may be redefined from Ruby 1.9 with +@)
2 R Y ** exponentiation
1 R Y - unary minus (redefine with -@)

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+C copy current line (if no selection)
Ctrl+X cut current line (if no selection)
Ctrl+⇧+K delete line
Ctrl+↩ insert line after