26 Feb 2014 A recently popular new startup that is making waves, namely Secret.ly was quite soon hacked after it was first released, giving the attacker access to the identity of the poster, effectively defeating the purpose of the secrecy. So they said "We take security seriously" and threw a public challenge to the hackers around the world... Or so it seems becase there are no real incentives besides curiosity and pride and maybe some swag from secretly.
On the other hand, the not so known messaging app created by the brothers Nikolay and Pavel Durov. While the latter is well known being the founder of the most popular russian social networking site VK.com, his brother Nikolay is less know and he was the one to device the new communication and open source protocol MTProto for the Telegram. Telegram is non profit, partially open source (the Protocol and API code is open so every one who is skeptical can make sure that it is truly secure) and is absolutely free. It is available for Android and iOS. And if all the above doesn't blow you away yet, there's more. To make sure their implementation is secure, they are running a crypto challenge and the winner will get $200,000 in Bitcoin currency. Now that's serious.
25 Oct 2013 Here's a simple function that will remove curly quotes aka smart quotes from your strings. Very useful if you enter data from MS Word files or other sources that may use weird unicode characters. Use it as an input cleaning step before saving the string data.
function remove_curly_quotes($text) {
// First, replace UTF-8 characters.
$text = str_replace(array("\xe2\x80\x98", "\xe2\x80\x99", "\xe2\x80\x9c", "\xe2\x80\x9d", "\xe2\x80\x93", "\xe2\x80\x94", "\xe2\x80\xa6"), array("'", "'", '"', '"', '-', '--',
'...'), $text);
// Next, replace their Windows-1252 equivalents.
$text = str_replace(array(chr(145), chr(146), chr(147), chr(148), chr(150), chr(151), chr(133)), array("'", "'", '"', '"', '-', '--', '...'), $text);
return $text;
}
25 Oct 2013 I needed to hit a number of files on a remote HTTP server with an index ranging from 1 to 150 and my first instinct was to use wget with some sort of a loop (bash script seemed like the most logical thing to do).
Then I realized that I can do the same thing in a simple oneliner using ‘curl’
It’s super easy using the following info:
You can specify multiple URLs or parts of URLs by writing part sets within braces as in:
http://site.{one,two,three}.com or you can get sequences of alphanumeric series by using [] as in:
ftp://ftp.numericals.com/file[1-100].txt ftp://ftp.numericals.com/file[001-100].txt (with leading zeros) ftp://ftp.letters.com/file[a-z].txt
Nested sequences are not supported, but you can use several ones next to each other:
http://any.org/archive[1996-1999]/vol[1-4]/part{a,b,c}.html
You can specify any amount of URLs on the command line. They will be fetched in a sequential manner in the specified order. You can specify a step counter for the ranges to get every Nth number or letter:
yo
http://www.numericals.com/file[1-100:10].txt http://www.letters.com/file[a-z:2].txt
08 Sep 2013 Here’s a simple code snippet to calculate approximate physical size of the screen of any Android device. If you find that useful or have suggestions to improve, your thoughts and feedback are welcome in the comments.
/**
* Calculates an approximation to the diagonal size of the screen. Based on the width and height pixels, the # of pixels in diagonal are calculated and then using the density DPI
* the pixels are translated into physical dimension in pixels
*
* @param activity
* @return
*/
public static double getDiagonalSize(Activity activity) {
DisplayMetrics metrics = new DisplayMetrics();
activity.getWindowManager().getDefaultDisplay().getMetrics(metrics);
return Math.sqrt((metrics.widthPixels * metrics.widthPixels)
+ (metrics.heightPixels * metrics.heightPixels))
/ metrics.densityDpi;
}