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
#!/usr/bin/env python | |
#-*- coding:utf-8 -*- | |
import re | |
import os | |
import socket | |
web_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
web_socket.bind(("127.0.0.1", 8080)) | |
web_socket.listen(5) |
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
<%@ page language="java" contentType="text/html; charset=utf-8" import="java.awt.image.BufferedImage, javax.imageio.ImageIO, java.io.*, java.util.*" %> | |
<%! | |
static int[] deColor(BufferedImage orgImgBI) | |
{ | |
int oWidth = orgImgBI.getWidth(); | |
int oHeight = orgImgBI.getHeight(); | |
int oMinx = orgImgBI.getMinX(); | |
int oMiny = orgImgBI.getMinY(); | |
int i,j; | |
int pixel, R, G, B, Gray; |
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
#-*-coding: utf-8 -*- | |
EPS = 1.0e-4 | |
def guass(A, b): | |
""" 高斯消元法 | |
输入要求: | |
A = [[x11, x12, x13], [x21, x22, x23], [x31, x32, x33]] |
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> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <iostream> | |
using namespace std; | |
typedef struct | |
{ | |
char type1; | |
char type2; | |
}BmpFileHead; |
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<iostream> | |
using namespace std; | |
int i=0; | |
bool chk(); | |
bool c(); | |
void main(){ | |
chk(); | |
} | |
bool chk(){ | |
i >=1000 || i++,cout << i << " "; |
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> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <iostream> | |
using namespace std; | |
typedef struct | |
{ | |
char type1; | |
char type2; | |
}BmpFileHead; |
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
file1 = open("file1", "r") | |
file2 = open("file2", "r") | |
line1 = file1.readlines() | |
line2 = file2.readlines() | |
for i in range(0, len(line1)): | |
if(line1[i] != line2[i]): | |
print i+1 |
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 BinNode { | |
int data; | |
BinNode *lChild, *rChild; | |
}; | |
class BinSortTree{ | |
public: | |
BinSortTree(); | |
~BinSortTree(); | |
void SearchBST(int); | |
void CreateBST(int *, int); |
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<iostream> | |
using namespace std; | |
int bs(int* a, int key, int low, int high){ | |
int mid; | |
mid = (low+high) / 2 ; | |
if(low>high){ | |
return -1; | |
} |
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<iostream> | |
using namespace std; | |
int BS(int* arr, int n, int key){ | |
int low, high, mid; | |
low = 0; | |
high = n-1; | |
while(low<=high){ | |
mid = (low+high) >> 1; |