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
Sub CopyMultipleDiscreteCells() | |
' | |
' Copy multiple dicrete cells | |
' | |
' | |
Dim i As Long | |
For i = 1 To 9 | |
Selection.Copy | |
ActiveCell.Offset(10, 0).Select |
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
/* wrapper of Java thread */ | |
public void onButtonClicked() { | |
new RxBytesCheck().execute(); | |
} | |
private class RxBytesCheck extends AsyncTask<Void, Void, Long> { | |
@Override | |
protected Long doInBackground(Void... params) | |
{ | |
return TrafficStats.getTotalRxBytes(); |
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
private class HTTPRequestTest extends AsyncTask<Void, Void, Void> { | |
@Override | |
protected Void doInBackground(Void... params) | |
{ | |
String url = "http://cps.kaist.ac.kr/index.html"; | |
HttpClient httpclient = new DefaultHttpClient(); | |
// Prepare a request object | |
HttpGet httpget = new HttpGet(url); |
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
#built application files | |
*.apk | |
*.ap_ | |
# files for the DEX VM | |
*.dex | |
# Java class files | |
*.class |
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
MediaController mediaController = new MediaController(videoView.getContext(), false) { | |
@Override | |
public void show() { | |
show(0); | |
} | |
}; |
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
/* Tradditional Java thread */ | |
Handler mHandler = new Handler(); | |
private final Runnable mRunnable = new Runnable() { | |
public void run() | |
{ | |
updateTotalRxBytes(); | |
mHandler.postDelayed(mRunnable, 1000); // repeat after 1000ms | |
} | |
}; |
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
public static void start(int streamingMode) { | |
new Thread(new GproxyStart(streamingMode)).start(); | |
} | |
private static class GproxyStart implements Runnable { | |
int streamingMode; | |
public GproxyStart(int streamingMode) { | |
this.streamingMode = streamingMode; | |
} |
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
#!/system/bin/sh | |
IF=$1 | |
CMD=$2 | |
SERVER_NET='143.248.140.0/24' | |
IP=`ip -4 addr show $IF | grep 'inet ' | awk '{print $2}' | sed -e 's/\/[0-9]*//'` | |
DEF_GW=`ip ro show | grep -o "default.*$IF" | head -n1 | awk '{print $3}'` | |
if [ $# -ne 2 ] | |
then | |
echo "Usage: `basename $0` <network_name> <add|del>" |
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
all: | |
gcc pid_tid.c -lpthread | |
./a.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
// Source: http://stackoverflow.com/questions/356950/c-functors-and-their-uses | |
#include <assert.h> | |
#include <vector> | |
#include <algorithm> | |
#include <iostream> | |
struct add_x { | |
add_x(int x) : x(x) {} | |
int operator()(int y) {return x+y;} | |
private: int x; |
OlderNewer