Skip to content

Instantly share code, notes, and snippets.

#include <stdio.h>
int main() {
int i=5;
switch ( 2 ) {
case 0:
for ( i=0; i<10; i++ ) {
case 1:
printf("A i=%d\n",i);
case 2:
#include <stdio.h>
using namespace std;
typedef long long int64;
int used[100][100];
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, -1, 0, 1};
int64 count(int x, int y, int len, int f, int wasRotate, int fCount) {
if (len == 0)
@EvaGL
EvaGL / if.l
Created March 9, 2013 14:55
Example with while
declare void @read(i32*)
declare void @write(i32)
@a = global i32 0
@b = global i32 0
define i32 @main() {
call void @read(i32* @a)
call void @read(i32* @b)
%1 = load i32* @a
@EvaGL
EvaGL / Code.java
Created September 8, 2012 21:29
Newton Method
public class Code {
static double border = 1;
public static double supLimPositive(double coef[]){
int m = 0;
for (int i = 0; i < coef.length; i++){
if (coef[i] < 0) {
m = i;
break;
}
// if (m!=0) break; Напоминание о том, как кое-кто хорошо отдохнул летом
@EvaGL
EvaGL / Node.java
Created May 11, 2012 23:33
Concurrent T-Tree
import java.util.Arrays;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
public class Node {
static final int MIN_ELEMENTS = 30, MAX_ELEMENTS = 2 * MIN_ELEMENTS;
private int[] data;
private int len;
@EvaGL
EvaGL / Main.java
Created March 30, 2012 09:47
Stackless Qsort
import java.util.Random;
public class Main {
private static boolean isSorted(int[] a) {
for (int i = 1; i < a.length; i++)
if (a[i - 1] > a[i])
return false;
return true;
}
@EvaGL
EvaGL / toLia.cpp
Created November 29, 2011 22:53
Diagram editor. Some bugs are fixed.
#include <windows.h>
#include <list>
HBRUSH hBrush;
HDC hdc;
RECT rect;
using namespace std;
int xPos, xPos1, yPos, yPos1, curX, curY, oldX, oldY, oldX1, oldY1;
bool IFCLICKED = 0;
bool IFRESIZED = 0;