Skip to content

Instantly share code, notes, and snippets.

String exp = "(x+(xx)+((xxx)+))+";
int close=-1, open=-1;
boolean check = true, hasCandidate = false;
int counter = 0;
for(int nextStart = exp.length()-1; nextStart!=0; ){
check = true; hasCandidate = false; counter = 0;
close = open = -1;
for(int i = nextStart; i>=0; i--){ // for every special character
if(exp.charAt(i)=='+' && i-1>=0 && exp.charAt(i-1)==')' && check){ // if firste checked specChar preceed by )
package pal;
public class MapGenerator {
public static long[] king = new long[50];
public static long[] rook = new long[50];
public static long[] pawn = new long[50];
public static long[] queen = new long[50];
public static long[] kingMap = {
0x182L, 0x385L, 0x70aL, 0xe14L, 0x1c28L, 0x3850L, 0x3020L, 0xc103L, 0x1c287L, 0x3850eL,
private int[] generateMoves(int status, int color) {
int[] moves = new int[45];
long whites = 0, blacks = 0;
blacks = Utils.getBlacks(status);
whites = Utils.getWhites(status);
long tmp = 0;
int movePointer = 0;
package pal;
public class Utils {
public static long setBit(int pos, long qword){
long tmp = 1;
tmp <<= pos;
qword|=tmp;
return qword;
}
public static long clearBit(int pos, long qword){
package pal;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.InputStreamReader;
public class Main {
static boolean local = true;
static int wKing, kKing, wRook, kRook, wPawn;
static int horizont = 0;
@dizzi
dizzi / gist:671379
Created November 10, 2010 19:42
pal2
package pal;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Comparator;
import java.util.HashMap;
public class Main {
#include <iostream>
using namespace std;
class Element {
Element * next;
Element * prev;
int value;
public:
Element() {
'''
Created on 15.4.2010
@author: meskod
'''
import string,time,calendar
from datetime import date, datetime, timedelta
class workingDays:
'''
00:5C:11:9F:85:F6:CB:8D:B1:F8:3E:90:F6:73:FC:AB:0F:5F:54:3A:F3:16:75:8E:83:
.........
---
62,98;
Min: 0, Average: 1, Max:62
00:5C:11:9F:85:62:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:
....
---
109,48;
import groovyx.net.http.*
import static groovyx.net.http.ContentType.*
import static groovyx.net.http.Method.*
def dlUrl = 'http://helheim.sh.cvut.cz'
def dlPath = '/~dizzi/autodl/'
def dlLocPath = 'd:/'
def http = new HTTPBuilder( dlUrl )