This file contains 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> | |
const int MAX_NUM_BRIDGE = 10000; | |
const int MAX_NUM_VALUE = 100; | |
typedef unsigned int index; | |
bool termscheck(int n) | |
{ | |
return n < MAX_NUM_BRIDGE ? true : false; |
This file contains 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> | |
#define FULL_STACK_SIZE 10 | |
#define STACK_NUMBER 3 | |
// | |
#define NEXT_POS 1 | |
#define PREVIOUS_POS -1 | |
#define INCREASE 1 | |
#define DECREASE -1 |
This file contains 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> | |
typedef struct _Stack | |
{ | |
int data; | |
struct _Stack* pNext; | |
}Stack; | |
typedef Stack* Stack_Top; |
This file contains 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> | |
bool push(int data); | |
int pop(); | |
bool isFull(); | |
bool isEmpty(); | |
void PrintStack(); | |
#define STACK_SIZE 4 | |
#define STACK_EMPTY_POSITION -1 |
This file contains 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
void Cdrag_and_dropDlg::OnDropFiles(HDROP hDropInfo) | |
{ | |
LPTSTR pFileName = NULL; | |
DWORD dwNumDrop = 0, | |
dwBufSize = 0; | |
dwNumDrop = DragQueryFile(hDropInfo,0xFFFFFFFF, NULL, 0L); | |
for (int i = 0 ; i < dwNumDrop ; ++i) | |
{ |
This file contains 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> | |
class Date | |
{ | |
protected: | |
int month; | |
int day; | |
public: | |
Date(){std::cout<<"this pointer is "<<this<<std::endl;} |
This file contains 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
package com.example.transmitimage; | |
import java.io.IOException; | |
import android.content.Context; | |
import android.graphics.Bitmap; | |
import android.hardware.Camera; | |
import android.os.Handler; | |
import android.os.Message; | |
import android.util.Log; |
This file contains 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
// in Camera callback preview | |
int w = params.getPreviewSize().width; | |
int h = params.getPreviewSize().height; | |
int format = params.getPreviewFormat(); | |
YuvImage image = new YuvImage(data, format, w, h, null); | |
ByteArrayOutputStream out = new ByteArrayOutputStream(); | |
Rect area = new Rect(0, 0, w, h); | |
image.compressToJpeg(area, 50, out); |
This file contains 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
// decode Y, U, and V values on the YUV 420 buffer described as YCbCr_422_SP by Android | |
// David Manpearl 081201 | |
public void decodeYUV(int[] out, byte[] fg, int width, int height) | |
throws NullPointerException, IllegalArgumentException { | |
int sz = width * height; | |
if (out == null) | |
throw new NullPointerException("buffer out is null"); | |
if (out.length < sz) | |
throw new IllegalArgumentException("buffer out size " + out.length | |
+ " < minimum " + sz); |
This file contains 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
package com.example.client_test; | |
import java.io.DataInputStream; | |
import java.io.DataOutputStream; | |
import java.io.IOException; | |
import java.net.InetAddress; | |
import java.net.Socket; | |
import java.net.UnknownHostException; | |
import android.os.AsyncTask; |
NewerOlder