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
@Override | |
protected void doPost(HttpServletRequest req, HttpServletResponse resp) | |
throws ServletException, IOException { | |
try { | |
InputStream stream = req.getInputStream(); | |
// do whatever you want with the stream now | |
} catch (Exception ex) { | |
throw new ServletException(ex); | |
} |
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
// taken from: http://stackoverflow.com/a/10712949/198996 | |
// note: you don't have to change anything in this class | |
public class GTalkOAuthSASLMechanism extends SASLMechanism { | |
public static final String NAME = "X-GOOGLE-TOKEN"; | |
public GTalkOAuthSASLMechanism(SASLAuthentication saslAuthentication) { | |
super(saslAuthentication); | |
} |
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
import java.util.HashMap; | |
import java.util.LinkedList; | |
import java.util.List; | |
import java.util.Map; | |
/** | |
* some kind of depth-first and dijkstra mixture. this little code snippet is | |
* able to find a path between "things" - points without any distance or similar | |
* between each other | |
* |
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
String a = "test"; | |
String b = "test"; | |
System.out.println("a == b? " + (a == b)); // true | |
String c = "tester"; | |
String d = a + "er"; | |
System.out.println("c == d? " + (c == d)); // 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
#!/bin/bash | |
for dir in */; | |
do | |
clear; | |
echo $dir; | |
cd $dir; | |
git status; | |
cd ..; | |
read -p "Press [Enter] key to continue..." |
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
#!/bin/bash | |
if [ -z "$1" ] | |
then | |
exit 1 | |
fi | |
cd "$1" | |
cropImage() { |
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
// more information here: http://blog.tomtasche.at/2012/10/use-built-in-feedback-mechanism-on.html | |
try { | |
int i = 3 / 0; | |
} catch (Exception e) { | |
ApplicationErrorReport report = new ApplicationErrorReport(); | |
report.packageName = report.processName = getApplication() | |
.getPackageName(); | |
report.time = System.currentTimeMillis(); | |
report.type = ApplicationErrorReport.TYPE_CRASH; |
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
import android.content.Intent; | |
import com.announcify.uberall.droid.util.TextToSpeechHelper; | |
public class TextToSpeechService extends InfiniteWakelockIntentService { | |
private TextToSpeechHelper helper; | |
public TextToSpeechService() { | |
super("Announcify - Text-To-Speech"); |
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
import android.app.Service; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.os.Handler; | |
import android.os.HandlerThread; | |
import android.os.IBinder; | |
import android.os.Looper; | |
import android.os.Message; | |
import android.os.MessageQueue.IdleHandler; | |
import android.os.PowerManager; |
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
!taken from http://www.cisco.com/en/US/products/ps6366/products_tech_note09186a0080b40901.shtml | |
(Cisco Controller) >show rogue ap summary | |
Rogue on wire Auto-Contain....................... Disabled | |
Rogue using our SSID Auto-Contain................ Disabled | |
Valid client on rogue AP Auto-Contain............ Disabled | |
Rogue AP timeout................................. 1200 |