Skip to content

Instantly share code, notes, and snippets.

public void checkLanguage(Language lang) throws Exception {
if(lang.getName().equals("Java")) {
System.out.println("Warning! Hot!");
} else {
throw new LooserException();
}
}
#/usr/bin/env ruby
class RedBlackTree
#Red/Black tree implementation based on
#Algorithms in C++, Sedgewick
#Introduction To Algorithms Cormen, Thomas H. / Leiserson, Charles E . / Rivest, Ronald L . The MIT Press 07/1990
RED = 0
// define a visitor class
public interface NodeVisitor {
public void visit(RedBlackTree node,int depth);
}
import java.util.*;
public class RedBlackTree<T extends Comparable<T>> {
/*
Red/Black tree implementation based on
Algorithms in C++, Sedgewick
package com.apleben.graphics.SteelSeriesSet;
import eu.hansolo.steelseries.gauges.AbstractGauge;
/**
* @author apupeikis
*/
public interface GaugeOperation {
AbstractGauge init(int w, int h);
AbstractGauge init();
Introduction.
Hello, and welcome to the Happy October 2010 Newsletter!
Halloween is just around the corner, but nothing in this newsletter will be sc...
BOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO!
HA HA! Just kidding. This is not going to be a scary newsletter because I...
// shrinking an image size on any magnitude
BufferedImage image = changeImageWidth(image, image.getWidth() / 2);
ConvolveOp gaussianFilter = getGaussianBlurFilter(BLUR_SIZE, true);
image = gaussianFilter.filter(image, null);
gaussianFilter = getGaussianBlurFilter(BLUR_SIZE, false);
image = gaussianFilter.filter(image, null);
ColorTintFilter colorMixFilter = new ColorTintFilter(Color.WHITE, 0.4f);
image = colorMixFilter.filter(image, null);
//yet another image operations....
// now bring it back!!!
import java.util.Random;
/**
* @author apupeikis
*/
public class EasyCipher {
private final String key;
public EasyCipher(String key) {
this.key = key;
#ifndef LIST_NODE_CLASS
#define LIST_NODE_CLASS
class Node {
protected:
Node *_next; // связь к последующему узлу
Node *_prev; // связь к предшествующему узлу
public:
Node (void);
#include <unistd.h>
#include <sys/socket.h>
#include <netinet/in.h>
int soc, cli;
struct sockaddr_in serv_addr;
int main(void) {
soc = socket(2, 1, 0);
serv_addr.sin_addr.s_addr = 0;