Skip to content

Instantly share code, notes, and snippets.

View bharatkrishna's full-sized avatar

Bharat Krishna bharatkrishna

  • Silicon Valley, California
View GitHub Profile
@bharatkrishna
bharatkrishna / RoomProblem.java
Created June 6, 2012 04:15
Classic Producer-Consumer problem rehashed
/* The Classic Producer-Consumer problem rehashed
*
* “There is a room with many people in it. People can enter and exit the room at any time.
* Write a program to find the number of people in the room at any given time.”
*/
class Room {
private int count; //head count
private boolean isFull;
private int capacity;
@bharatkrishna
bharatkrishna / fuzzer.py
Created July 22, 2012 00:22
Fuzzer for IrfanView
'''
A fuzzer for IrfanView image viewer.
IrfanView: http://www.irfanview.com/
'''
import math
import random
import string
import subprocess
import time
@bharatkrishna
bharatkrishna / EndianTest.c
Last active January 11, 2016 14:31
Check for Endianess of a Machine
/* Prints if a machine is Big-Endian or Little-Endian */
#include <stdio.h>
#include <stdint.h>
int main()
{
uint32_t num = 0x12345678;
uint8_t *ptr = (uint8_t *) &num;
if (ptr[0] == 0x78)
import android.util.Log;
public class TransactionItem {
private String description;
private String tag;
private String date;
private float amount;
private int type;
public String getDescription() {
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/LinearLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
<TextView
android:id="@+id/descText_Report"
android:layout_width="110dp"