This file contains 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
//----------------- class looader and loaded classes | |
select map(heap.objects('java.lang.ClassLoader'), function (it) { | |
var res = ''; | |
res += "<br/>ClassLoader " + toHtml(it) + "<br/>"; | |
res += listLoadedClasses(it); | |
return res + "<br>"; | |
function listLoadedClasses(cl) { | |
var res = ""; | |
if (cl.classes != null) { | |
if (cl.classes.elementData != null) { |
This file contains 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
#!/usr/bin/env python | |
def renamets(path): | |
import os, stat, time | |
ts = os.stat(path)[stat.ST_MTIME] | |
src = path | |
ext = time.strftime("%Y-%m-%d_%H%M%S", time.localtime(ts)) | |
dst = src + "." + ext |
This file contains 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.io._ | |
import collection.JavaConversions._ | |
import java.util.jar.JarFile | |
import scala.concurrent._ | |
import ExecutionContext.Implicits.global | |
import scala.util.{Success, Failure} | |
import scala.concurrent.duration._ | |
case class MatchedEnt(path: String, names: List[String]) |
This file contains 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
/* | |
* shows font smoothing setting, which is true by default. | |
* flips font smoothing setting if "flip" was specified on command line. | |
* compilation: cl fontsmoothing.cpp user32.lib | |
*/ | |
#include <windows.h> | |
#include <stdio.h> | |
BOOL fontSmoothingStatus() | |
{ |
This file contains 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
/* dump big byte arrays in ascii */ | |
select [ba, ba.length, String.fromCharCode.apply(String, | |
toArray(ba))] from [B ba where ba.length > 1000000 |
This file contains 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.lang.annotation.Target; | |
import java.lang.annotation.Repeatable; | |
import static java.lang.annotation.ElementType.*; | |
import java.lang.annotation.Retention; | |
import static java.lang.annotation.RetentionPolicy.*; | |
@Target(METHOD) | |
@Retention(RUNTIME) | |
@Repeatable(Schedules.class) | |
public @interface Schedule { |
This file contains 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
/* | |
* JDK 8 javac has a new option -parameters. | |
* If this option was used, parameter name is stored in class file. | |
* The parameter name can be obtained via reflection. New class | |
* Parameter and a new method Method#getParameters() was added. | |
* $ ~/local/jdk1.8.0/bin/java ParamEx | |
* method: main | |
* param: java.lang.String[] arg0 | |
* method: doit | |
* param: java.lang.String arg0 |
This file contains 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
#!/usr/bin/env python | |
# | |
# windows batch file example | |
# c:\Python27\python %UserProfile%\local\bin\mypg.py %* | |
# | |
import sys | |
import os.path | |
DEFAULT_CHAR = ':' |
This file contains 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.io._ | |
import collection.JavaConversions._ | |
case class MatchedEnt(path: String, names: List[String]) | |
class FindJar(path: String, patternStr: String) { | |
import scala.util.matching.Regex | |
val pattern = patternStr.r |
This file contains 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 org.jfree.chart.ChartFactory | |
import org.jfree.chart.ChartFrame | |
import org.jfree.chart.JFreeChart | |
import org.jfree.data.general.DefaultPieDataset | |
object First extends App { | |
val data = new DefaultPieDataset | |
List(("Category 1", 43.2), ("Category 2", 27.9), ("Category 3", 79.5)). | |
foreach(e => data.setValue(e._1, e._2)) | |
val chart = ChartFactory.createPieChart("Simple Pie Chart", |
NewerOlder