text stringlengths 14 410k | label int32 0 9 |
|---|---|
public static void countMatchesWeighted(double minIDF, double minTFIDF) {
System.out.println("countMatchesWeighted running");
allDocPairs.clear();
Iterator it2 = dictionaryMap.entrySet().iterator();
while (it2.hasNext()) {
Map.Entry termEntry = (Map.Entry) it2.next();
... | 9 |
public void testCycNart() {
System.out.println("\n*** testCycNart ***");
try {
CycNart cycNart = new CycNart(ARITY_RELATION_FN, 1);
testCycObjectRetrievable(cycNart);
CycNart arityRelationFn1 = cycNart;
assertNotNull(cycNart);
assertEquals("(ArityRelationFn 1)", cycNart.toString())... | 4 |
private boolean jj_2_35(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_35(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(34, xla); }
} | 1 |
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof GridSquare)) {
return false;
}
GridSquare other = (GridSquare) object;
if ((this.gridRef == null && other.gridR... | 5 |
public void paint(Graphics g){
this.setDoubleBuffered(true);
Insets in = getInsets();
g.translate(in.left, in.top);
int[][] gameboard = logic.getGameBoard();
int cols = gameboard.length;
int rows = gameboard[0].length;
//draw borders
for (int i = 0;i<cols;i++) ... | 6 |
public void onUpdate()
{
super.onUpdate();
if (this.field_35126_c > 0)
{
--this.field_35126_c;
}
this.prevPosX = this.posX;
this.prevPosY = this.posY;
this.prevPosZ = this.posZ;
this.motionY -= 0.029999999329447746D;
if (this.wor... | 8 |
synchronized public void updateLog() {
try {
PrintWriter writer = new PrintWriter("log.txt", "UTF-8");
writer.println("allocatedmemory: " + this.maxSize);
writer.println("usedmemory: " + this.currSize);
writer.println("lastchunk: " + this.nextAvailableFileNo);
for(BackupFile file : files) {
writer... | 4 |
public static boolean incrementAuctionEndTime( int auctionID, int incrementAmount ) throws DatabaseException {
Connection conn = null;
ResultSet rs = null;
PreparedStatement ps = null;
int uid, bids;
String qUpdateAuctionTime = "UPDATE auctiontime SET endingTime = endingTime + ? WHERE auctionID = ?";
try ... | 7 |
@Override
public String toString() {
StringBuilder string = new StringBuilder();
for (String key : commands.keySet()) {
string.append(key);
string.append(", ");
}
string.delete(string.length() - 2, string.length());
return string.toString();
... | 1 |
private void rescaleDiameters(double[] realDiameters, int iteration) {
if (iteration > 5) {
return;
} else if (iteration == 0) {
double averageDiameter = 0;
for (int j = 0; j < nCircles; j++)
averageDiameter += realDiameters[j];
averageDiameter /= nCircles;
for (int j = 0; j < nCircles; j++)
... | 7 |
final void method3049(ByteBuffer class348_sub49, int i, int i_0_) {
if (i_0_ != 31015)
anInt9470 = -15;
int i_1_ = i;
while_213_:
do {
do {
if (i_1_ != 0) {
if (i_1_ != 1) {
if (i_1_ == 2)
break;
break while_213_;
}
} else {
anInt9474 = class348_sub49.getShort();
... | 6 |
public void paint(Graphics g) {
int xh, yh, xm, ym, xs, ys, s = 0, m = 10, h = 10, xcenter, ycenter;
String today;
currentDate = new Date();
SimpleDateFormat formatter = new SimpleDateFormat("s",Locale.getDefault());
try {
s = Integer.parseInt(formatter.format(curren... | 9 |
public List<AbstractResource> getResources() {
return this.resources;
} | 0 |
public void push(String stack, E element) {
synchronized(lock) {
if(STACK1.equals(stack)) {
array[tail1] = element;
tail1 += 3;
if(tail1 >= array.length) {
resize();
}
} else if (STACK2.equals(stack)) {
array[tail2] = element;
tail2 += 3;
if(tail2 >= array.length) {
resize(... | 6 |
public void readOpponentMoves(String[] moveInput) {
opponentMoves.clear();
for (int i = 1; i < moveInput.length; i++) {
try {
Move move;
if (moveInput[i + 1].equals("place_armies")) {
Region region = visibleMap.getRegion(Integer
.parseInt(moveInput[i + 2]));
String playerName = moveInput... | 6 |
private void updateInfo() {
StyledDocument doc = info.getStyledDocument();
try {
doc.remove(0, doc.getLength());
for (int i = 0; i < content.length; i++) {
doc.insertString(doc.getLength(), content[i] + newline, doc.getStyle(style[i]));
}
}
catch (BadLocationException ble) {
System.err.println("... | 2 |
public void setFunGrado(String funGrado) {
this.funGrado = funGrado;
} | 0 |
public static int getIndexOfUser(User u, ArrayList<User> users) {
int counter = 0;
for(User e:users) {
if(e.getUsername().equalsIgnoreCase(u.getUsername())) {
return counter;
}
counter++;
}
return -1;
} | 2 |
@Test
public void testPlayerHandSize() {
// tests that all players have about the same number of cards
int handSize = game.getPlayers().get(0).getCards().size();
for (Player p : game.getPlayers()) {
int currentSize = p.getCards().size();
Assert.assertTrue((handSize-2) < currentSize || (handSize+2) > curren... | 3 |
public boolean isDataValid()
{
Boolean retval = hasValidData;
if(retval == null)
{
final int n = pointVector.size();
if((n < 2) || ((n < 3) && !isOpen()))
{
hasValidData = new Boolean(false);
return false;
}
for(int i = 0; i < size(); i++)
{
... | 8 |
private void doPop(MouseEvent e){
int tilex = game.player.getX();
int tiley = game.player.getY();
if(tilex < game.tilemap.width && tilex >= 0 && tiley < game.tilemap.height && tiley >= 0) {
if(game.tilemap.items[tiley][tilex] != null) {
ItemPopupMenu menu = new ItemPo... | 5 |
private boolean r_postlude() {
int among_var;
int v_1;
// repeat, line 75
replab0: while(true)
{
v_1 = cursor;
lab1: do {
// (, line 75
... | 8 |
private void insertNode(Color color, Node root) {
int red = color.getRed();
int green = color.getGreen();
int blue = color.getBlue();
root.setReferences(root.getReferences() + 1);
String binary11 = Integer.toBinaryString(red);
String binary12 = Integer.toBinaryString(green);
St... | 8 |
public void onMessage(String channel, String sender, String login, String hostname, String message) {
String msg = message.toLowerCase();
String[] msgSplit = msg.split(" ");
for (int i = 0; i < msgSplit.length; i++) {
String urlTitle = "";
if (isYoutube(msgSplit[i])) {
... | 8 |
@Override
public boolean execute(CommandSender sender, String identifier,
String[] args) {
String playerName = args[0];
String titleId = args[1];
if (sender instanceof Player) {
try {
if (!DBManager.idExist(titleId)) {
sender.sendMessage("No titles exist with this id.");
return false;
}
... | 6 |
public void fletchingComplex(int screen) {
if (screen == 1) {
clearMenu();
menuLine("1", "Bronze arrow", 882, 0);
menuLine("5", "Ogre arrow", 2866, 1);
menuLine("7", "Bronze 'brutal' arrow", 4773, 2);
menuLine("15", "Iron arrow", 884, 3);
menuLine("18", "Iron 'brutal' arrow", 4778, 4);
menuLine("... | 4 |
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof CompanyPerson)) {
return false;
}
CompanyPerson other = (CompanyPerson) object;
if ((this.companyPersonPK == nu... | 5 |
public void setEventBus( EventBus eventBus )
{
this.eventBus = eventBus;
} | 0 |
public static void setMediaPath(String directory)
{
// check if the directory exists
File file = new File(directory);
if (!file.exists())
{
System.out.println("Sorry but " + directory +
" doesn't exist, try a different directory.");
FileChooser.pickMediaPath();
}
... | 4 |
void pushDuskObject(DuskObject objIn)
{
synchronized(objEntities)
{
if (objIn.intLocX < 0 || objIn.intLocY < 0 || objIn.intLocX >= MapColumns || objIn.intLocY >= MapRows)
{
return;
}
DuskObject objStore;
objStore = objEntities[objIn.intLocX][objIn.intLocY];
if (objIn == objStore) // needed to... | 8 |
public void update(float time)
{
HandleBlockSpawn(time);
for(int i = 0; i < ActiveBlock.size(); i++)
{
PuzzleBlock b = ActiveBlock.get(i);
b.update(time);
}
for(int i = 0; i < BlockMap.size(); i++)
{
for(int j = 0; j < BlockMap.get(i).size(); j++)
{
PuzzleBlock block = BlockMap.get(i).ge... | 7 |
public boolean comparePuzzle(Puzzle p1)
{
boolean answer = true;
Puzzle solution = new Puzzle();
char s = p1.getID().charAt(0);
int x = s - 'A' + 1;
solution.loadPuzzle("solution" + x);
int row = 0;
int column = 0;
while (column != 9 && answer == true)
{
while (row != 9 && answer == true... | 5 |
public CtField getField(String name) throws NotFoundException {
CtField f = getField2(name);
if (f == null)
throw new NotFoundException("field: " + name + " in " + getName());
else
return f;
} | 1 |
public boolean execute() {
Log.i(" ");
Log.i("Executing: " + Utils.cmdToString(cmd));
boolean success = false;
long startTime = System.currentTimeMillis();
try {
Runtime rt = Runtime.getRuntime();
Process p;
if (folder == null)
p = rt.exec(cmd);
... | 7 |
public LogDialog(final Panel panel) {
setTitle("Log filter");
setBounds(1, 1, 250, 250);
Dimension size = getToolkit().getScreenSize();
setLocation(size.width / 3 - getWidth() / 3, size.height / 3
- getHeight() / 3);
this.setResizable(false);
setLayout(null);
JPanel pan1 = new JPanel();
pan1.setBo... | 4 |
public void init()
{
this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
this.setLayout(new FlowLayout());
this.setResizable(false);
this.setLocationRelativeTo(null);
// Initialize labels.
startLevelLabel = new JLabel("Resolution Start Level: ");
stopLevelLabel = new JLabel("Resolution ... | 2 |
public void save() throws SQLException {
Map<String, String> values = new HashMap<String, String>();
values.put("reminderAhead", String.valueOf(this.reminderAhead));
super.save(values);
} | 0 |
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Salarie)) {
return false;
}
Salarie other = (Salarie) object;
if ((this.num == null && other.num != null) || (t... | 5 |
private Color selectColourForButton(Keyboard keyboard, char key) {
int[] RGB = new int[3];
int all = keyboard.getAmountOfAllKeys();
int keyAmount = keyboard.getAmount(key);
double percentageOfKeyInFile = 100 * (double) keyAmount / all;
if (keyAmount == 0) {
return new... | 5 |
private boolean tryMove(Shape newPiece, int newX, int newY){
for (int i = 0; i < 4; ++i) {
int x = newX + newPiece.x(i);
int y = newY - newPiece.y(i);
if (x < 0 || x >= BoardWidth || y < 0 || y >= BoardHeight)
return false;
if (shapeAt(x, y) != Tet... | 6 |
private void multiplicar(int columna, int fila, int[] datos) {
int index = 0;
int total = 1;
for (int i = 0; i < fila; i++) {
tableHtml += "<tr>";
for (int j = 0; j < columna; j++) {
total *= getNumero(datos, index);
tableHtml += "<td>" + g... | 2 |
@Override
public void removeState(String toRemoveID) throws UnresolvedReferenceException {
State toRemove = this.getState(toRemoveID);
//Make sure that toRemove is not referenced in another state's transition table
for (State toCheck : this.getStates()) {
if (!toCheck.equals(toRemove)) {
for (char symb... | 5 |
public String execute(String[] args){
int intPriority = Integer.parseInt(args[1]);
if(intPriority < 1 || intPriority > 9)
return "ERROR: Priority is only 1 - 9!";
runList.setPriority(Long.parseLong(args[0]), intPriority);
return process.toString();
} | 2 |
public boolean loadDataFiles(String filePath, String dataType) {
File folder = new File(filePath);
LoadDataWithJDBC obj2 = new LoadDataWithJDBC();
String filename = "";
File[] listOfFiles = folder.listFiles();
int count = 0;
try {
for (int i = 0; i < listOfFiles.length; i++) {
if (listOfFiles[i].is... | 6 |
public static void main(String[] args) throws InterruptedException {
if (args.length == 0) {
System.err.println("usage: [-threads value] <files...>");
System.exit(1);
}
int numberOfThreads = 2;
int startIdx = 0;
if (args[0].equals("-threads")) {
... | 9 |
public static Module load_mod( byte[] header_1084_bytes, DataInput data_input ) throws IOException {
int num_channels, channel_idx, panning;
int sequence_length, restart_idx, sequence_idx;
int num_patterns, pattern_idx, instrument_idx;
Module module;
num_channels = calculate_num_channels( header_1084_bytes );... | 8 |
public WaitForGameThread(PongWindow window) {
super("WaitForGameThread");
this.window = window;
} | 0 |
public static void main(String args[]) {
try {
int port =4321 ;
int poolSize =10;
//init forum sys
ForumSystem forumSystem = new ForumSystem();
User admin= forumSystem.startSystem("halevm@em.walla.com", "firstname", "admin", "1234");
//init reactor
Reactor reactor = startEchoServer(port, p... | 1 |
private void testSend(final TransactionResultData data) {
final Collection<InnerDataSubscription> allowed = _allowedDataIdentifications.get(data.getDataDescription());
final Collection<InnerDataSubscription> required = _requiredDataIdentifications.get(data.getDataDescription());
for(final TransactionDataset data... | 8 |
private void writeObject(ObjectOutputStream out) throws IOException {
out.writeUTF(getLevel().getName());
out.writeUTF(getLoggerName());
out.writeUTF(getMessage());
out.writeLong(getMillis());
out.writeInt(getParameters().length);
for (Object p : getParameters()) {
... | 3 |
public void keyReleased(KeyEvent e) {
int key = e.getKeyCode();
for (int i = 0; i < handler.objects.size(); i++) {
GameObject tempObject = handler.objects.get(i);
switch (tempObject.getID()) {
case Player:
switch (key) {
case KeyEvent.VK_D:
case KeyEvent.VK_A:
tempObject.setVelX(0);
... | 4 |
public static void publishQueryEvent(TicketQueryArgs args) {
long sequence = _ringBuffer.next();
TicketQueryArgs event = _ringBuffer.get(sequence);
args.copyTo(event);
event.setSequence(sequence);
// 将消息放到车轮队列里,以便处理
_ringBuffer.publish(sequence);
} | 0 |
private boolean judgeRuleAuthorized(String deliQuery, ArrayList<String> paras, String localQuery) {
boolean authFlag = false;
if (localQuery.equalsIgnoreCase("null")) {
System.out.println("[checkQuery] null"); //
} else if (localQuery.equalsIgnoreCase("all")) {
System.out.println("[checkQuery] all"); //... | 5 |
public void deleteItem(Item item){
try{
session.beginTransaction();
session.delete(item);
session.getTransaction().commit();
}
catch(HibernateException e){
Main.getFrame().showError("A hozzáadás sikertelen volt: "+e.getMessage());
}
} | 1 |
@SuppressWarnings("empty-statement")
public boolean gagne(){
int i;
for(i=0; i < tabMarq.length && tabMarq[i] == 1; i++);
return (i >= tabMarq.length); // On à trouvé aucun false
} | 2 |
private int miehenAvecinPaikallaToistaSukupuolta(boolean mies) {
int pisteita = 0;
try {
if (paikka.getMiehenAvecinPaikka() != null) {
if (paikka.getMiehenAvecinPaikka().getSitsaaja().isMies()) {
if (mies == false) {
pisteita += 500... | 5 |
public void act(Matrix matrix, Player player) {
if (!isAlive) {
return;
}
LinkedList<Node> neighbours = matrix.allNeighbours(x, y);
if (neighbours.contains(matrix.getNode(player.getX(), player.getY()))) {
hit(player);
return;
}
ArrayList<Node> shortestRoute = matrix.shortestRoute(matrix.getNode(... | 3 |
public SummaryResult read(String filePath) {
BufferedReader in = null;
try {
in = new BufferedReader(new FileReader(filePath));
String s;
int line = 1;
FileSplitUtil util = new FileSplitUtil();
while ((s = in.readLine()) != null && !strategy.endReading()) {
}
int i = 0;
for (; (s = in... | 8 |
public static void scan(InputStream source, InputStream format) throws IOException{
Scanner scanner = new Scanner(source);
SimpleFormat sf = JAXB.unmarshal(format, SimpleFormat.class);
CSVParser parser = new CSVParser(sf);
Integer r = 0;
while (scanner.hasNext(... | 2 |
void testFormulaCalc( String fs, String sh )
{
WorkBookHandle book = new WorkBookHandle( fs );
sheetname = sh;
try
{
sht = book.getWorkSheet( sheetname );
}
catch( Exception e )
{
log.error( "TestFormulas failed.", e );
}
FormulaHandle f = null;
Double i = null;
/*************************... | 5 |
public static boolean viewPassengerByTrain(ObjectOutputStream toServer, ObjectInputStream fromServer, Scanner scanner) throws IOException, ClassNotFoundException {
log.debug("Start \"viewPassengerByTrain\" method");
System.out.println("Input train name");
String trainName = scanner.next().toLowe... | 5 |
public static void main(String[] args) throws Exception {
//input files
String pathNetinf = args[0];
String pathGroundTruth = args[1];
//nodes
HashSet<Integer> usedNodes = new HashSet<Integer>();
HashSet<String> predictedEdges = new HashSet<String>();
HashSet<String> trueEdges = new HashSet<String>... | 7 |
private Comparable[] mergeTwoArrays(Comparable[] a, Comparable[] b) {
Comparable[] merged = new Comparable[a.length + b.length];
int i = 0, j = 0, k = 0;
while (i < a.length && j < b.length) {
if (b[j].compareTo(a[i]) >= 1) {
merged[k++] = a[i++];
} else... | 5 |
public static void main(String[] args) {
running = true;
// Preliminary stuff (config handler and packet manager setup)
System.out.println("Welcome to BBServer " + VERSION + ", the portal for Blazing Barrels multiplayer!");
File configFile = new File ("config.txt"); // File is within the jar for simplicity in ... | 5 |
public void start() throws IOException {
System.out.println("GraphTrimmer started!");
PrintWriter errorLogWriter = new PrintWriter(new File(
"./logs/GraphTrimmer-error-log.txt"));
// PrintWriter logWriter = new PrintWriter("./logs/GraphTrimmer-log.txt");
int beforeCnt = 0, afterCnt = 0, finishedUsers = 0;
... | 6 |
@Override
public void actionPerformed(ActionEvent e) {
CommandFromGod cmd = (CommandFromGod) e.getSource();
cmd.execute();
} | 0 |
private JSONWriter end(char mode, char c) throws JSONException {
if (this.mode != mode) {
throw new JSONException(mode == 'a'
? "Misplaced endArray."
: "Misplaced endObject.");
}
this.pop(mode);
try {
this.writer.write(c);
}... | 3 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Employee other = (Employee) obj;
if (deptId != other.deptId)
return false;
if (id != other.id)
return false;
if (name == null) {
if ... | 8 |
public boolean specspell(int castID, int casterY, int casterX, int offsetY, int offsetX, int angle, int speed, int startHeight, int endHeight, int enemyY,int enemyX, int Lockon)
{
try {
fcastid = castID;
fcasterY = casterY;
fcasterX = casterX;
foffsetY = offsetY;
foffsetX = offsetX;
fangle = angle;
fspeed = speed;
fsh... | 4 |
public final void accept(SpaceVisitor visitor) {
// The return type is captured, this gives the visitor a change
// to halt any further recursion in this space.
boolean proceed = visitor.visit(this);
if(proceed && !isLeaf()) {
for(Space space : nodes) {
space... | 3 |
public HashMap<String, ?> getAll(HashMap<String, ?> map) {
Object def;
String[] loc;
for (String key : map.keySet()) {
try {
def = map.get(key);
loc = key.split(".");
if (def.getClass() == Boolean.class) {
getBoolean(loc[0], loc[1], (Boolean) def);
} else if (def.getClass() == Integer.clas... | 7 |
public static ChunkCoord getChunkCoord(int x, int z, World world)
{
long hash = ((long)x & 0xFFFFFFFFL) | (((long)z & 0xFFFFFFFFL) << 32);
ChunkCoord coord = mCache.get(hash);
if(coord == null)
{
coord = new ChunkCoord(x, z, world);
mCache.put(hash, coord);
}
Validate.isTrue(coord.x == x && coord.... | 2 |
public void enable() {
super.enable();
_accelerator.setEnabled(true);
} | 0 |
private void InsertionSort(List<Endpoint> endPoints,
List<Integer> lookUp)
{
int endpSize = endPoints.size();
for (int j = 1; j < endpSize; ++j)
{
Endpoint key = new Endpoint(endPoints.get(j));
int i = j - 1;
while (i >= 0 && key.compareTo(endPoints.get(i)) == -1)
{
Endpoint e0 = new En... | 9 |
public int get(byte[] data, int offset, int len) {
if (len == 0) return 0;
int dataLen = 0;
synchronized (signal) {
// see if we have enough data
while (getAvailable() <= 0) {
if (eof) return (-1);
try { signal.wait(1000); } catch ... | 8 |
@Override
public String execute() throws Exception {
System.out.println("from ajax: account :" + account + " , password: " + password);
user = this.service.login(account, password);
// Invalid Account
if(user == null) {
status = 2;
msg = "Invalid Account, plz check it out";
}
// Wrong ... | 5 |
private static void generationBased(int start, int maxDepth) {
boolean done = false;
int i=start;
while (!done&&i<=maxDepth) {
project.generateAlternativesGeneration(i++);
project.log(path);
done = project.calculateEnergyConsumptionGeneration();
}
project.findBestSystemGeneration();
project.visuali... | 2 |
public Player(String[] newDeck, GameState gameState) {
playedLand = false;
this.life = 20;
this.deckList = newDeck;
deck = new ArrayList<Card>();
hand = new ArrayList<Card>();
this.gameState = gameState;
this.manaOpen = new int[6];
this.graveyard = new ArrayList<Card>();
//this.playerStyle = (int) Mat... | 1 |
private void setUpLists(int level) {
strandOne.clear(); strandTwo.clear(); strandThree.clear(); strandFour.clear();
inPlayOne.clear(); inPlayTwo.clear(); inPlayThree.clear(); inPlayFour.clear();
score = 0;
progress = 0;
oddBalls.add(new CurrentBall(5, imageMap.get("greyBall"), imageMap.get("apcoli"), null, nu... | 7 |
private void copyRGBtoRGBA(ByteBuffer buffer, byte[] curLine) {
if(transPixel != null) {
byte tr = transPixel[1];
byte tg = transPixel[3];
byte tb = transPixel[5];
for(int i=1,n=curLine.length ; i<n ; i+=3) {
byte r = curLine[i];
by... | 6 |
private void onMessageDecoded(final CoreMessage message) {
if (message.getType().equals(CoreMessageType.READY_TO_RECEIVE_FILE)) {
File file = new File(this.sendingFile.pathName);
try {
this.readingFile = new RandomAccessFile(file, "r");
this.readChannel = this.readingFile.getChannel();
this.beginSen... | 9 |
@Override
public boolean doMove() {
int startSteps = curGb.stepCount;
prepareMovement();
while(true) {
if(!check) {
curGb.step(dir); // walk
break;
} else {
State s = curGb.newState();
int add = EflUtil.runToAddressLimit(0, dir, 100, curGb.pokemon.walkSuccessAddress, curGb.pokemon.walkFa... | 9 |
public static void main(String args[]){
new Client();
} | 0 |
public static void SymbolTest2()
{
int counter = 1;
// set up stdout for output
PrintStream stdout = new PrintStream( new FileOutputStream( FileDescriptor.out ) );
//
// Construct SymbolData Table
//
//
// When symbol stable is constructed, it creates one scope with the
// name supplied in the... | 7 |
public String findFindWhat(String $_original_invoice) throws Exception {
if($_original_invoice.contains("map")){
return new DiscisionForMap().findOrShowMapof($_original_invoice);
}
else if($_original_invoice.contains("hotel")){
return findHotel($_original_invoice);
}
else if($_original... | 6 |
public void paint(Graphics g) {
if (img == null)
super.paint(g);
else
g.drawImage(img, 0, 0, null);
} | 1 |
public void saveBounds() {
String keyPrefix = getWindowPrefsPrefix();
if (keyPrefix != null) {
Preferences prefs = getWindowPreferences();
boolean wasMaximized = (getExtendedState() & MAXIMIZED_BOTH) != 0;
if (wasMaximized || getExtendedState() == ICONIFIED) {
setExtendedState(NORMAL);
}
prefs.st... | 3 |
private void adjustDirection() {
// set a random movement vector based on where the feeder is.
// will determine the quadrant to point vector to (relative to the
// feeder's current location).
if (currentLocation.x < Environment.getMinX()) { // on left edge
if (currentLocati... | 8 |
public static Stella_Object accessRelationSlotValue(Relation self, Symbol slotname, Stella_Object value, boolean setvalueP) {
if (slotname == Stella.SYM_STELLA_ABSTRACTp) {
if (setvalueP) {
self.abstractP = BooleanWrapper.coerceWrappedBooleanToBoolean(((BooleanWrapper)(value)));
}
else {
... | 6 |
public Object getObjectInstance(final Object ref, final Name name, final Context nameCtx, final Hashtable<?, ?> environment) throws Exception {
final ClassLoader classLoader = SecurityActions.getContextClassLoader();
if(classLoader == null) {
return ref;
}
final String factor... | 8 |
@Override
public <T extends Serializable> boolean unRegisterSubscriber(String subscriverId) {
LOGGER.log(Level.FINEST, "request unSubscription on OdynoDataBus");
for (Iterator<Subscriber<?, ?>> it = subscribers.iterator(); it.hasNext();) {
Subscriber<? extends Serializable, ? extends Fi... | 7 |
public void addComponent(Component component){
component.setOwner(this);
components.add(component);
if(Renderable.class.isInstance(component)){
renderers.add((Renderable)component);
}
if(Updatable.class.isInstance(component)){
updaters.add((Updatable)component);
}
} | 2 |
public void toggleOpen() {
if (moveTimer > 0) return;
containerOpen = !containerOpen;
if (containerOpen) {
Item active = getActiveItem();
if (active != Item.FIST && active != null) inventory.addItem(active, 1);
setActiveItem(Item.FIST);
}
} | 4 |
private boolean validate(String road) throws IOException, InputException
{
if (road == null ||road.equals(""))
return false;
InputStream fis;
BufferedReader br;
String line;
fis = new FileInputStream("data/road_names.txt"); //skal ændres til det rigtige fil navn
... | 4 |
@SuppressWarnings("deprecation")
public void addCbaseItem(ServiceInfo info) {
if( info.getServiceId() == -1 ) return;
// first create status array
conn.query("SELECT * FROM "+SCHEMA+".service_date_uptime where service_id = "+info.getServiceId());
ResultSet rs = conn.getQueryResult();
String uptimeDate = "... | 7 |
ColorComboBoxRendererWrapper (JComboBox comboBox) {
this.renderer = comboBox.getRenderer();
if( renderer instanceof ColorComboBoxRendererWrapper ) {
throw new IllegalStateException("Custom renderer is already initialized."); //NOI18N
}
comboBox.setRenderer( this );
} | 1 |
public T dequeue() throws Exception {
T res;
if (s1.isEmpty()) {
throw new Exception("Empty queue");
}
while (!s1.isEmpty()) {
s2.push(s1.pop());
}
res = s2.pop();
while (!s2.isEmpty()) {
s1.push(s2.pop());
}
return res;
} | 3 |
public static ArrayList<String> separaTokens(String expr) throws Exception {
ArrayList<String> tokens;
String token = "";
boolean entreAspa = false;
expr = expr.trim();
if (expr.length() != 0) {
tokens = new ArrayList<String>();
entreAspa = false;
for (int i = 0; i < expr.length(); i++) {
if (e... | 9 |
static void p2(int pos, int maxUsed) {
if(pos == k) {
System.out.println(Arrays.toString(a));
} else {
for(int i = maxUsed; i <= n; i++) {
a[pos] = i;
p2(pos+1,i);
}
}
} | 2 |
public PolynomialTerm(double power) {
_power = power;
} | 0 |
Subsets and Splits
SQL Console for giganticode/java-cmpx-v1
The query retrieves a limited number of text entries within a specific length range, providing basic filtering but minimal analytical insight.