Powered by Ajaxy
Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Python: Get Script Arguments

import sys
# iterate over the script arguments
if len(sys.argv) > 1:
    print "there are ", len(sys.argv)-1, "arguments:"
    for arg in sys.argv[

Python: Deleting Directory Trees

"""
Python Programming, Third Edition, by Mark Lutz. Copyright 2006 O'Reilly Media, Inc., 978-0-596-00925-0
"""
import sys, os
fcount = dcount = 0

Python: Using the sys Module to Get Script Arguments

import sys
print "current script name is", sys.argv[0]
if len(sys.argv) > 1:
    print "there are", len(sys.argv)-1, "arguments:"
    for arg in sy

Jav-Regular_Expression: Replace hex characters in a sequence

import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class RegexHDigit {
  public static void main(String[] argv) throws Exception

Java: How to use printf to show two decimals

public class Decimal2 
{
  public static void main(String[] argv) throws Exception {
    System.out.printf("two decimal: %.2f", 65.0 / 3.0);
  }
}
[/

Java: How to show positive values with a leading +.

import java.util.Formatter;
public class PositiveFormat
 {
  public static void main(String[] argv) throws Exception {
    Formatter fmt = new Fo

Java: How to Negate a BigDecimal

import java.math.BigDecimal;
public class NegatBigDec
{
  public static void main(String[] argv) throws Exception
  	{
    BigDecimal val = new BigDe

Java: How to call a static method of an abstract class

abstract class AbstractStaticMethode
{
  public static void salut()
  {
    System.out.println("Welcom to java.tubedir.com");
  }
  public static voi

Java: Create an image of swing component using Component.createImage()

import javax.swing.JFrame;
import java.awt.image.BufferedImage;
public class ComponentImage
{
  public static void main(String[] argv) throws Excepti

Java: How to multiply one BigDecimal to another BigDecimal

<pre lang='java'>
import java.math.BigDecimal;
public class BigDecMulti
 {
  public static void main(String[] argv) throws Exception
  	{
    BigD

Java: How to Negate a BigDecimal

<pre lang='java'>
import java.math.BigDecimal;
public class NegatBigDec
{
  public static void main(String[] argv) throws Exception
  	{
    BigDec

Java: How to divide one BigDecimal from another BigDecimal

<pre lang='java'>
import java.math.BigDecimal;
public class BigDecDiv
 {
  public static void main(String[] argv) throws Exception
  	{
    BigDec

Java: How to subtract from one BigDecimal another BigDecimal

<pre lang='java'>
import java.math.BigDecimal;
public class BigDecSous
 {
  public static void main(String[] argv) throws Exception
  	{
    BigDe