This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; | |
| } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; Напоминание о том, как кое-кто хорошо отдохнул летом |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <cv.h> | |
| #include <highgui.h> | |
| int main() { | |
| cv::Mat image(200, 200, CV_8UC3); | |
| for (int i = 0; i < 200; ++i) | |
| for (int j = 0; j < 200; ++j) { | |
| image.ptr<unsigned char>(i)[3*j] = j * 255 / 200; | |
| image.ptr<unsigned char>(i)[3*j + 2] = j * 255 / 200; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import socket | |
| import re | |
| import os | |
| f = open(os.devnull, 'w') | |
| keys = [] | |
| bad = [0]*255 | |
| while True: | |
| for ip in xrange(1, 254): | |
| if bad[ip] > 0: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| struct tree{ | |
| int meta[3]; | |
| int value; | |
| tree *left; | |
| tree *right; | |
| tree() { | |
| meta[0] = 2; //pointers count | |
| meta[1] = sizeof(int) * 4; // offset to left | |
| meta[2] = meta[1] + sizeof(tree*); // offset to right |
OlderNewer