This file contains hidden or 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
package linuxfs; | |
import java.io.File; | |
import java.io.FileOutputStream; | |
import java.io.IOException; | |
import java.nio.channels.FileChannel; | |
/* | |
* Author: Ashwin Jayaprakash | |
*/ |
This file contains hidden or 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.concurrent.Phaser; | |
import java.util.concurrent.atomic.AtomicReferenceArray; | |
/* | |
* Author: Ashwin Jayaprakash | |
*/ | |
public class PhaserDemo { | |
public static void main(String[] args) { | |
final int workers = 2; | |
final int workLength = 10; |
This file contains hidden or 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
# Original version: http://blog.tsunanet.net/2010/08/jpmp-javas-poor-mans-profiler.html | |
# Usage: ./jpmp.sh <pid> <num-samples> <sleep-time-between-samples> | |
#!/bin/bash | |
pid=$1 | |
nsamples=$2 | |
sleeptime=$3 | |
for x in $(seq 1 $nsamples) |
This file contains hidden or 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
package com.javaforu.sqlite.demo; | |
import java.sql.*; | |
/* | |
* Author: Ashwin Jayaprakash / Date: Oct 23, 2010 / Time: 3:58:22 PM / Contact: http://www.ashwinjayaprakash.com | |
* | |
* Sqlite jdbc library (sqlite-jdbc-3.7.2.jar) from: http://www.xerial.org/trac/Xerial/wiki/SQLiteJDBC | |
*/ | |
public class FtsSample { |