Skip to content

Instantly share code, notes, and snippets.

View shahzore-qureshi's full-sized avatar

Shahzore Qureshi shahzore-qureshi

  • NYC
View GitHub Profile
@shahzore-qureshi
shahzore-qureshi / HTTP Client
Last active August 29, 2015 14:06
Basic Android HTTP Client
import java.io.BufferedReader;
import java.io.FilterInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.zip.GZIPInputStream;
import java.io.UnsupportedEncodingException;
@shahzore-qureshi
shahzore-qureshi / gist:9594974
Created March 17, 2014 06:52
Recursion Example
public double getMaxFlow()
{
double min;
if (inDiameter < outDiameter)
min = inDiameter;
else
min = outDiameter;
if (next == null)
return min;
[qureshs1@bart project4]$ make qemu
qemu -smp 2 -hda obj/kern/kernel.img -serial mon:stdio -k en-us -m 1100M
trap_check_kernel() succeeded!
Physical memory: 66556K available, base = 640K, extended = 65532K
spinlock_check() succeeded!
pmap_check() succeeded!
testfs: in main()
initfilecheck: found file 'consin' mode 0x9000 size 0
initfilecheck: found file 'consout' mode 0x1000 size 0
initfilecheck: found file '/' mode 0x2000 size 0
elfhdr *eh = (elfhdr *)ROOTEXE_START;
// Load each program segment
proghdr *ph = (proghdr *) ((void *) eh + eh->e_phoff);
proghdr *eph = ph + eh->e_phnum;
int ptypechk = 1;
while(ph < eph)
{
if (ph->p_type != ELF_PROG_LOAD)
{
@shahzore-qureshi
shahzore-qureshi / gist:5283223
Created April 1, 2013 04:17
.NET File Parser
string filePath = "C:\\Users\\Administrator\\Documents\\Visual Studio 2012\\Projects\\MvcApplication1\\MvcApplication1\\Content\\Uploads\\zipcodes.txt";
System.IO.StreamReader file = new System.IO.StreamReader(filePath);
string line;
string[][] strings = new string[40][];
char[] delimiters = new char[3];
delimiters[0] = '\"';
delimiters[1] = ',';
delimiters[2] = '\n';