However, it's quite easy to see the result if you add `&market=en-US` to the end of the query.
Example: https://www.bing.com/search?q=quicksort+java&market=en-US
[Disclaimer: Dev at HackerRank. Not affiliated with this product, though]
Bing Video to be exact.
(we all know it's true to an extent)
In my view, CodeMirror is pretty decent, and it seems to me that not much can be improved upon it. But I haven't had the chance to compare it to anything else.
It also doesn't seem to support anything advanced or synonyms for terms. I can search for "Reverse array python" but not "Reverse list python" (technically a list is the proper name, and array is a different construct in Python), and anything more advanced than sorting algorithms or simple features don't appear. I tried a few pathfinding algorithms, fibonacci sequence, prime numbers.... And I tried several variations of search terms. "Pathfinding in Pyhton" / "Graph Search in Python" / "Djikstra's algorithm in Python", nothing. I don't think it will be very useful because of this.
This is probably Microsoft's response.
import os
print '\n'.join(os.listdir('/'))
Personally, I'm partial to running IPython under Sandstorm for this kind of thing. (Also, if I were to host it, I'd be very nervous about any technique not involving equal or greater paranoia.)Also there's some files that are visible that probably shouldn't be, including one named "codechecker-android-release-key.keystore"...
For the curious, try running the code block. You can uncomment/commment things out to see different results as there's a cap on the amount of stdout printed.
import java.net.URLClassLoader;
import java.io.*;
import java.net.*;
class Solution
{
private static void printFile(String path) throws Exception {
System.out.println("File: " + path);
InputStream in = new FileInputStream(path);
byte buf[] = new byte[1024];
int len;
while( (len = in.read(buf)) > 0 ) {
System.out.write(buf, 0, len);
}
System.out.flush();
}
final protected static char[] hexArray = "0123456789ABCDEF".toCharArray();
private static String bytesToHex(byte[] bytes) {
char[] hexChars = new char[bytes.length * 2];
for ( int j = 0; j < bytes.length; j++ ) {
int v = bytes[j] & 0xFF;
hexChars[j * 2] = hexArray[v >>> 4];
hexChars[j * 2 + 1] = hexArray[v & 0x0F];
}
return new String(hexChars);
}
private static void printFileHex(String path) throws Exception {
System.out.println("File: " + path);
InputStream in = new FileInputStream(path);
ByteArrayOutputStream out = new ByteArrayOutputStream();
byte buf[] = new byte[1024];
int len;
while( (len = in.read(buf)) > 0 ) {
out.write(buf, 0, len);
}
byte bytes[] = out.toByteArray();
System.out.println(bytesToHex(bytes));
System.out.flush();
}
public static void main (String[] args) throws Exception
{
Class<?> clazz = Class.forName("java.lang.ClassLoader");
URLClassLoader cl =
(URLClassLoader) Thread.currentThread().getContextClassLoader();
System.out.println("Classpath:");
for(java.net.URL url : cl.getURLs()) {
System.out.println("" + url);
}
File local = new File("");
System.out.println("Local path: " + local.getAbsolutePath());
System.out.println("Files:");
File root = new File("/");
String list[] = root.list();
System.out.println("# root files: " + list.length);
//printFile("/etc/passwd");
printFileHex("/etc/codechecker-android-release-key.keystore");
System.out.println("# root files: " + list.length);
for(String base : new String[]{ "/etc", "/bin", "/sbin", "/usr"}) {
for(String name : new File(base).list()) {
System.out.println(base + "/" + name);
}
}
}
}We have a cluster of codechecker servers of the above type, which share the load of incoming queries. On each, sandboxing is via a chroot-based system. Programs get a fixed amount of memory/time.
Re: the codechecker keyfile - we're looking into this, as I'm not an android expert - but quick searching tells me this is used to sign apks. Our codechecker supports android builds, so that's probably what this is used for. This key is not used to sign anything official (like throwaway id_rsa you create when needed). Again, I'm not the expert on this and I'll add a confirmation here shortly.
That said, if anyone finds something a vulnerability/way out of the sandbox, please shoot me a mail (anil @ hackerrank) if you'd like to do a private disclosure.
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; class Solution {
public static void main(String[] args) throws IOException, InterruptedException {
final Runtime rt = Runtime.getRuntime();
final Process pr = rt.exec("uname -a");
new Thread(new Runnable() {
public void run() {
BufferedReader input = new BufferedReader(new InputStreamReader(pr.getInputStream()));
String line = null;
try {
while ((line = input.readLine()) != null)
System.out.println(line);
} catch (IOException e) {
e.printStackTrace();
}
}
}).start();
pr.waitFor();
}
}Why is it smart? Every major internet service is driven by it's early adopters. Every major service is built and designed by people like us, hacker news readers, techies, early adopters. But of course, not all services, especially those who want to be massive are targeted to early adopters anymore - they wrongly target the masses. To attract people to use your service, you have to have the early adopters first, they have to attract us first and then target the masses. Thus, we are seeing Bing take a page from DuckDuckGo in tailoring some parts of its service towards techies. It's a clever move.
Good startup idea could be found in this audience. Solve the coding problems through searching for code. Just do it better than bing. [0]
[0] "The way to win here is to build the search engine all the hackers use. A search engine whose users consisted of the top 10,000 hackers and no one else would be in a very powerful position despite its small size, just as Google was when it was that search engine." ~ http://paulgraham.com/ambitious.html