text stringlengths 14 410k | label int32 0 9 |
|---|---|
public static void renderSVG(Card card, Graphics2D g) {
try {
SVGDiagram diagram;
if (card == null) {
diagram = universe.getDiagram(ImageManager.class.getResource(urlBase + "blank.svg").toURI());
} else {
diagram = universe.getDiagram(ImageMa... | 3 |
private KDNode construct(List<E> c,int depth) throws VariedDimensionException {
int length = c.size();
// edge cases
if (length == 0) {
return null;
}
if (length == 1) {
if (c.get(0).getDimension() != dimension) {
throw new VariedDimensionException("ERROR: Input list contained objects with non-ma... | 7 |
public String getNoDiskVMTemplate(String id)
{
String template = "";
try {
ApplianceDescriptor a = idApp.get(id);
String vmNetwork = "";
Collection<OVFVirtualNetwork> ns = a.getAssociatedVirtualNetworks();
for (OVFVirtua... | 8 |
public FordFulkerson(FlowNetwork G, int s, int t) {
value = 0.0;
while (hasAugmentingPath(G, s, t)) {
double bottle = Double.POSITIVE_INFINITY;
// compute bottleneck capacity
for (int v = t; v != s; v = edgeTo[v].other(v))
bottle = Math.min(bottle, edgeTo[v].residualCapacit... | 3 |
public BigDecimal getValue1(int row, int clums, int sheetat) {
BigDecimal value = new BigDecimal(0);
String s = null;
try {
XSSFSheet xSheet = xWorkbook.getSheetAt(sheetat);
XSSFRow xRow = xSheet.getRow(row - 1);
XSSFCell xCell = xRow.getCell(clums - 1);
xCell.setCellType(Cell.CELL_TYPE_STRING);
s ... | 1 |
private static void loadAnimations() {
File f = new File(Preferences.ANIMATION_PATH);
String[] folders = f.list();
String[] files;
if (folders != null) {
for (String s : folders) {
f = new File(Preferences.ANIMATION_PATH + "/" + s);
files = f.list();
if (files != null) {
ArrayList<Buffere... | 6 |
void start() {
while (true) {
int random = generateRandomNumber();
prevayler.execute(new NumberStorageTransaction(random));
int randomNumbersSize = numbers.numbersSize();
System.out.println("Random numbers generated: " + randomNumbersSize
+ "... | 3 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Contact other = (Contact) obj;
if (firstname == null) {
if (other.firstname != null)
return false;
} else if (!firstname.equals(other.fi... | 9 |
public int pobierzZListyPozycjiStatkiPrzezID(int aktTrafionyId, Plansza plansza) {
Integer[][] x;
Integer[][] y;
int wynik = 0;
int k = 0;
int posX;
int posY;
plansza.otoczenieListaStrzalow.clear();
while (k < plansza.po... | 9 |
protected void render() {
final float FADE_TIME = 0.25f ;
super.render() ;
final Texture realTex = texture ;
final float realAlpha = absAlpha ;
texture = highlit ;
if (amPressed() || amDragged() || amClicked()) {
absAlpha *= pressLit ;
super.render() ;
}
if (amHovered()) {
... | 4 |
@Override
public boolean deleteCustomer(Customer customer) {
if (doc == null)
return false;
Element currRoot = doc.getRootElement();
Element parrentCusto = currRoot.getChild("customers");
List<Element> listCusto = parrentCusto.getChildren();
if (customer.getLoanList() != null)
for (Loan item : custome... | 6 |
public static void testValidity(Object o) throws JSONException {
if (o != null) {
if (o instanceof Double) {
if (((Double) o).isInfinite() || ((Double) o).isNaN()) {
throw new JSONException("JSON does not allow non-finite numbers.");
}
} else if (o instanceof Float) {
i... | 7 |
@Override
public void mouseClicked(MouseEvent e) {
if (e.getClickCount() >= 2) {
if (e.getButton() == MouseEvent.BUTTON3) {
callSmoothZoom(e.getX(), e.getY(), 1);
return;
} else if (e.getButton() == MouseEvent.BUTTON1) {
callSmoothZoom(... | 5 |
public int nextNode()
{
if(m_foundLast)
return DTM.NULL;
int next;
org.apache.xpath.VariableStack vars;
int savedStart;
if (-1 != m_stackFrame)
{
vars = m_execContext.getVarStack();
// These three statements need to be combined into one operation.
savedStart =... | 9 |
private void parseDocument() {
//get a factory
SAXParserFactory spf = SAXParserFactory.newInstance();
try {
//get a new instance of parser
SAXParser sp = spf.newSAXParser();
//parse the file and also register this class for call backs
try {
sp.parse(xmlfile, this);
} catch(F... | 5 |
public void deleteEntry() {
if (isOnline) {
getListOfEvents(false);
System.out.println("Which entry do you want to delete? Input the number.");
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String numberOfLine = null;
try {
... | 9 |
public void removerAdmin(String nick){
try{
if(getAdmin().getPassword().equals(Login.getPasswordOculta())){
admins.remove(buscarAdmin(nick));
System.out.println("Se ha borrado exitosamente.");
}
}catch(Exception err){
System.out.println("No se ha encontrado.");
}
} | 2 |
public void drop(DropTargetDropEvent e) {
UIManager.put("OptionPane.background", Color.WHITE);
UIManager.put("Panel.background", Color.WHITE);
Transferable tr = e.getTransferable();
DataFlavor[] flavors = tr.getTransferDataFlavors();
File file;
for (int i = 0; i < flavors.length; i++) {
if (flavors[i].is... | 9 |
private void jMenu1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jMenu1MouseClicked
// TODO add your handling code here:
boolean cambios = true;
String contenidoEditor = Editor.getText();
String contenidoArchivo = "";
if(nombreArchivo != null){
... | 7 |
private boolean const_decl_id() {
if( is(TK.ID) ) {
boolean ret;
if (ret = symtab.add_entry(tok.string, tok.lineNumber, TK.CONST)) {
gcprint("int ");
gcprintid(tok.string);
}
scan();
return ret;
}
else {
... | 2 |
@Override
public void mouseClicked(final MouseEvent e) {
if (e.getSource() instanceof CellPanel && type != 42 && color != 42) {
for (int y = 0; y < Board.Y; y++) {
for (int x = 0; x < Board.X; x++) {
if (((CellPanel) e.getSource()).getCell() == game.getBoard().getCell(x, y)) {
client.doHumanMove(x... | 6 |
@Override
protected void addActualItem(Class<? extends Item> genericItem) {
super.addActualItem(genericItem);
Item item = null;
try {
item = genericItem.newInstance();
} catch (InstantiationException e) {
e.printStackTrace();
} catch (IllegalAccessExc... | 5 |
@Override
public void shoot(Spieler gegner) {
boolean invalidInput = true;
String input = null;
ausgabe.printSeparator();
System.out.println("Geben sie das Ziel an: x,y");
// Einleseschleife
while (invalidInput) {
try {
input = eingabe.getUserInput();
} catch (Exception e) {
e.printStackTr... | 5 |
public Object get(int index) throws JSONException {
Object object = this.opt(index);
if (object == null) {
throw new JSONException("JSONArray[" + index + "] not found.");
}
return object;
} | 1 |
public UmlDiagramData readXml( XElement xdiagram, UmlDiagramConverter converter ){
UmlDiagramData diagram = new UmlDiagramData();
diagram.setNextUnqiueId( xdiagram.getElement( "next-unique-id" ).getInt() );
XElement xitems = xdiagram.getElement( "items" );
for( XElement xdata : xitems ) {
switch( xdata.getN... | 5 |
public String toString() {
Enumeration<?> enm;
StringBuffer result;
result = new StringBuffer();
enm = elements();
while (enm.hasMoreElements()) {
result.append(enm.nextElement().toString());
if (enm.hasMoreElements())
result.append(",");
}
return result.toString(... | 3 |
private int handleT(String value,
DoubleMetaphoneResult result,
int index) {
if (contains(value, index, 4, "TION")) {
result.append('X');
index += 3;
} else if (contains(value, index, 3, "TIA", "TCH")) {
result.append(... | 8 |
public void queueOver(int r, int c)
{
if (p2u != null) {
core.GroupOfUnits unit = p2u.get(r, c);
updateStats(unit);
}
} | 1 |
public String optimizeAt(String in, int level){
for(int i=0;i<level;i++)
in = this.optimize(in);
//in = this.optimizeOneTime(in);
return in;
} | 1 |
public void run() {
long timer = System.currentTimeMillis();
long lastTime = System.nanoTime();
double delta = 0;
final double NS = 1000000000. / 60.;
requestFocus();
Sound.MUSIC_MENU.play(true);
while(running){
updated = false;
long now = System.nanoTime();
delta += (now - lastTime) / NS;
... | 6 |
public static void quick_srt(int array[], int low, int n) {
int lo = low;
int hi = n;
if (lo >= n) {
return;
}
int mid = array[(lo + hi) / 2];
while (lo < hi) {
while (lo < hi && array[lo] < mid) {
lo++;
}
while (lo < hi && array[hi] > mid) {
hi--;
}
if (lo < hi) {
int T = arra... | 9 |
public boolean shouldProceed() {
return this.shouldProceed;
} | 0 |
public void run() {
//This method keeps listening the socket
Message message;
Task task = null;
long time = -1;
while(menager.hasMessage()){
try {
System.out.print("message comming\n");
message = (Message) input.readObject();
if(message != null){
if(message instanceof ServerStatusMessag... | 8 |
public Footer() {
initComponents();
} | 0 |
public JSONArray toJSONArray(JSONArray names) throws JSONException {
if (names == null || names.length() == 0) {
return null;
}
JSONArray ja = new JSONArray();
for (int i = 0; i < names.length(); i += 1) {
ja.put(this.opt(names.getString(i)));
}
re... | 3 |
public void append(String str)
{
int newsize = this.size + str.length();
// If there's insufficient capacity, make a new array
if (newsize >= this.contents.length)
{
char[] oldcontents = this.contents;
this.contents = new char[computeNeededCapacity(newsize)];
for (int i = 0;... | 3 |
public HungarianAlgorithm(double[][] costMatrix) {
this.dim = Math.max(costMatrix.length, costMatrix[0].length);
this.rows = costMatrix.length;
this.cols = costMatrix[0].length;
this.costMatrix = new double[this.dim][this.dim];
for (int w = 0; w < this.dim; w++) {
if (w < costMatrix.length) {
if (costM... | 3 |
public Function computeFirstDerivative() {
if (mFunctionTerms == null) {
throw new IllegalStateException(
"mFunctionTerms is null - Did you forget to override computeFirstDerivative()?");
}
int termSize = mFunctionTerms.size();
Function deriv = new Function(new ArrayList<FunctionComponent>());
List<F... | 9 |
private void processFiles(Connection dbConnection) {
logger.info("Polling for files that need processing...");
try {
PreparedStatement s = dbConnection.prepareStatement("SELECT * FROM files WHERE ready_for_processing=1 AND process_state=0 AND ready_for_delete=0 AND (session_id IS NOT NULL OR in_use=1) AND (he... | 9 |
public static double pearsonsCorrelatrion(double[] obs, double[] sim, double missingValue) {
sameArrayLen(obs, sim);
double syy = 0.0, sxy = 0.0, sxx = 0.0, ay = 0.0, ax = 0.0;
int n = 0;
for (int j = 0; j < obs.length; j++) {
if (obs[j] > missingValue) {
ax ... | 5 |
protected void createTeleport() {
if (isTeleport) {
teleport.resetDuration();
}
isTeleport = true;
teleport.setLocations(ball);
} | 1 |
public ShopEvent createEvent(Node n, int value) {
String name = "";
String res = "";
Node attr = n.getFirstChild();
while(attr != null) {
if(attr.getNodeType() == Node.ELEMENT_NODE) {
if(attr.getNodeName().equalsIgnoreCase("Name")) {
... | 5 |
void FormalParameters(ProcedureBuilder pb) throws Exception {
if (Current_Token != Token.TOK_OPAREN) {
throw new Exception("Opening Parenthesis expected");
}
GetNext();
ArrayList lst_types = new ArrayList();
while (Current_Token == Token.TOK_VAR_BOOL
... | 8 |
@SuppressWarnings({ "deprecation", "unused" })
public static void setBar(Location origin, int length, int height) {
//origin.getBlock().setTypeIdAndData(35, (byte) 5, true);
Location loc10 = new Location(Bukkit.getWorld("COC"), origin.getX()+10, origin.getY(), origin.getZ());
int currentlength = 0;
while(cu... | 3 |
@Override
protected void startMaster(StartMaster startMaster) {
try {
super.startMaster(startMaster);
StartMasterVcf startMasterVcf = (StartMasterVcf) startMaster;
vcfFileIterator = new VcfFileIterator(startMasterVcf.vcfFileName);
vcfFileIterator.setParseNow(parseNow);
// Show header
if (showHeade... | 5 |
@Override
public boolean equals(Object o) {
if (!(o instanceof ImageInfo)) {
return false;
}
ImageInfo ii = (ImageInfo) o;
if (width != ii.width || height != ii.height) {
return false;
} else if (clip != null && ii.clip != null) {
return ... | 7 |
public boolean save(String key, InputStream in) {
if (in == null) return false;
OutputStream out = null;
File file = null;
try {
file = DiskUtils.getCacheFileForName(mAppContext, key);
file.getParentFile().mkdirs();
out = new FileOutputStream(file);
... | 8 |
public static int floatToShortBits( float fval )
{
int fbits = Float.floatToIntBits( fval );
int sign = fbits >>> 16 & 0x8000; // sign only
int val = ( fbits & 0x7fffffff ) + 0x1000; // rounded value
if( val >= 0x47800000 ) // might be or become NaN/Inf
{ ... | 5 |
public void visitTryCatchBlock(final Label start, final Label end,
final Label handler, final String type) {
checkStartCode();
checkEndCode();
checkLabel(start, false, "start label");
checkLabel(end, false, "end label");
checkLabel(handler, false, "handler label");
checkNonDebugLabel(start);
checkNonDe... | 4 |
private boolean isInRect(){
if(mouse == null) return false;
int x = mouse.x;
int y = mouse.y;
if(x > getxPos() && x < (getxPos() + width)){
if(y > yPos && y < (yPos + height)){
return true;
}
}
return false;
} | 5 |
public void setPassengerCarsCnt(int passengerCarsCnt) throws OutOfRangeException {
if (( passengerCarsCnt < 0 )&&( passengerCarsCnt > MAX_PASSENGERCARS_CNT )) {
logger.error("incorrect passengerCarsCnt argument: " + passengerCarsCnt);
throw new OutOfRangeException();
}
this.passengerCarsCnt = passengerCarsC... | 2 |
public ArrayList<ArrayList<Integer>> zigzagLevelOrder(TreeNode root) {
// Start typing your Java solution below
// DO NOT write main() function
ArrayList<ArrayList<Integer>> resArr = new ArrayList<ArrayList<Integer>>();
if (root == null)
return resArr;
ArrayList<TreeNode> tmp = new ArrayList<TreeNode>();
... | 8 |
public static PDFDecrypter createDecryptor
(PDFObject encryptDict, PDFObject documentId, PDFPassword password)
throws
IOException,
EncryptionUnsupportedByPlatformException,
EncryptionUnsupportedByProductException,
PDFAuthenticationFailureException ... | 9 |
public void run()
{
while(threadSocket != null && !socket.isClosed())
{
try{
Message message = (Message) reader.readObject();
message.setIp(socket.getInetAddress().getHostAddress());
message.setPort(socket.getPor... | 4 |
public static void LoadSettings()
{
File f = new File ("ue.ini");
if (!f.exists())
{
CreateDefaultSettings();
}
else
{
try
{
FileReader in = new FileReader("ue.ini");
BufferedReader br = new BufferedReader(in);
String currentLine = "";
while( (currentLine = br.readLine()) != n... | 8 |
public static String localXpath (Node node) throws DOMException {
String localname = node.getLocalName();
if (null == localname) {
throw new DOMException(DOMException.NOT_FOUND_ERR, "DOM Node doesn't have a local name!");
}
else {
int position = 1;
No... | 3 |
public String decrypt (String input) {
if(input.matches(".*\\d.*")) throw new IllegalArgumentException();
String formatted = input.toUpperCase().replaceAll("[^A-Z]", "");
if(formatted.length() == 0) throw new IllegalArgumentException();
char[] characters = formatted.toCharArray();
char[][] Table5x5 = _makeTable5x... | 7 |
public void setPasswordButtonBorderthickness(int[] border) {
if ((border == null) || (border.length != 4)) {
this.buttonPW_Borderthickness = UIBorderthicknessInits.PW_BTN.getBorderthickness();
} else {
this.buttonPW_Borderthickness = border;
}
somethingChanged();... | 2 |
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
String action = request.getParameter("act");
String login = request.getParameter("login");
String pass = request.getParameter("pass");
try {
RequestContext conte... | 7 |
public TexturePortalFX()
{
super(Block.portal.blockIndexInTexture);
Random var1 = new Random(100L);
for (int var2 = 0; var2 < 32; ++var2)
{
for (int var3 = 0; var3 < 16; ++var3)
{
for (int var4 = 0; var4 < 16; ++var4)
{
... | 8 |
private void findParent_knn(double[] target, KDNode node, int d) {
// If the node would be inserted in the branch "below"
if(target[d] < node.values[d]){
if (++d == dimensionCount) {
d = 0;
}
if(node.below == null){
tryToSave(node, target);
return;
}
tryToSave(node.below, target);
f... | 5 |
public static void checkRank(Player player) {
int kills = player.getKillCount();
for (int i = 0; i < ranks.length; i++) {
PkRank rank = ranks[i];
if (rank == null)
break;
if (rank.username.equalsIgnoreCase(player.getUsername())) {
ranks[i] = new PkRank(player);
sort();
return;
}
}
fo... | 7 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
GenericDTO other = (GenericDTO) obj;
if (codigo != other.codigo)
return false;
return true;
} | 4 |
public String Decrypt(String ctext)
{
BigInteger c = new BigInteger(ctext, 16);
BigInteger m = this.DoPrivate(c);
if (m.equals(Zero))
{
return null;
}
byte[] bytes = this.pkcs1unpad2(m, this.GetBlockSize());
if (bytes == null)
{
return null;
}
return new String(bytes);
} | 2 |
public void tabDragging(TabButton draggingTab){
if(getMousePosition() == null){
return;
}
int w = getMousePosition().x;
draggingTab.setLocation(w-draggingTab.dragXOffset, draggingTab.getLocation().y);
dropHighlightInfo.visible = true;
dropHig... | 6 |
public void setSave(final Expr expr, final boolean flag) {
if (SSAPRE.DEBUG) {
System.out.println(" setting save for " + expr + " to "
+ flag);
}
saves.put(expr, new Boolean(flag));
} | 1 |
@EventHandler(priority = EventPriority.NORMAL)
public void onPlayerKick(final PlayerKickEvent event) {
if (event.isCancelled() || event.getLeaveMessage() == null) {
return;
}
for (final IRCChannel c : Variables.channels) {
if (!c.getBlockedEvents().contains("game_kick... | 4 |
public void writeTo(DataOutput dout) throws IOException {
// Write out the size (number of entries) of the constant pool.
int size = getSize() + 1; // add one because constant 0 is reserved
if (size >= 65535) {
throw new RuntimeException
("Constant pool entry count c... | 9 |
void handleFocus(int type) {
switch (type) {
case SWT.FocusIn: {
if (hasFocus)
return;
if (getEditable())
text.selectAll();
hasFocus = true;
Shell shell = getShell();
shell.removeListener(SWT.Deactivate, listener);
shell.addListener(SWT.Deactivate, listener);
Display display = getDispla... | 8 |
public HttpRequest(String path, InputStream inputStream, OutputStream outputStream, int postIndex, Map<String, List<String>> headers) {
this.inputStream = inputStream;
this.outputStream = outputStream;
this.postIndex = postIndex;
this.headers = headers;
try {
this.url... | 3 |
public Transaction oldesttransactionLockOnVar(int index) {
List<Transaction> transactionsLockOnVar = new ArrayList<Transaction>();
for (Transaction t: locks.keySet()) {
ArrayList<Lock> lockListT = locks.get(t);
for (Lock lock: lockListT) {
if(lock.getIndex()==index) {
transactionsLockOnVar.add(t);
... | 4 |
public ControllerNode(int _ControllerId, Config config, String jobConf) throws IOException, ParseException {
controllerId = _ControllerId;
primary = config.getController(_ControllerId).isPrimary();
JsonParser parser = new JsonParser(jobConf);
workerNum = safeLongToInt(parser.parseWorker... | 8 |
public boolean remove(int codigo) {
boolean status = false;
Connection con = null;
PreparedStatement pstm = null;
try {
con = ConnectionFactory.getConnection();
pstm = con.prepareStatement(REMOVE);
pstm.setInt(1, codigo);
pstm.execute();
... | 2 |
public Transition getOutgoingTransition (State toState) throws NoSuchTransitionException {
Transition trans = null;
for(Transition t:outgoingTransitions) {
if (t.getToState() == toState) {
trans = t;
break;
}
}
if(trans == null)
... | 3 |
public Particle getParticle(PhysicsEvent event){
try {
if(particleID==5000) return event.beamParticle();
if(particleID==5001) return event.targetParticle();
if(particleType.compareTo("-")==0){
Particle fromEvent = event.getParticleByCharge(-1,particleSkip);... | 8 |
public void readFile() throws IOException {
try{
FileInputStream fstream = new FileInputStream("dataIn.txt");
DataInputStream in = new DataInputStream(fstream);
BufferedReader br = new BufferedReader(new InputStreamReader(in));
String strLine;
int me... | 4 |
public boolean doReadPackage() {
boolean result = true;
try {
mBis.reset();
int len = 0;
int totalLen = 0;
while ((len = mSocketChannel.read(mBuffer)) > 0) {
totalLen += len;
}
if (totalLen > 0) {
mBuffer.flip(); // important
mBuffer.get(mData, 0, totalLen);
ObjectInputStream ... | 7 |
public static void write(Matrix matrix, String path) throws MatrixIndexOutOfBoundsException {
int rows = matrix.getRowsCount();
int cols = matrix.getColsCount();
BufferedWriter buffer = null;
long startTime = System.currentTimeMillis();
try {
buffer = new Buffered... | 5 |
public void init( StorageTable directories, WorkBookHandle wbh ) throws StorageNotFoundException
{
Storage child = directories.getChild( "_SX_DB_CUR" );
if( wbh != null )
{
caches = new HashMap();
book = wbh.getWorkBook();
}
while( child != null )
{
if( wbh != null )
{
caches.put( Integer.... | 6 |
public static int getMouseButtonCode(MouseEvent e) {
switch (e.getButton()) {
case MouseEvent.BUTTON1:
return MOUSE_BUTTON_1;
case MouseEvent.BUTTON2:
return MOUSE_BUTTON_2;
case MouseEvent.BUTTON3:
return MOUSE_BUTTON_3;
... | 3 |
private boolean jj_3R_76() {
Token xsp;
xsp = jj_scanpos;
if (jj_3_17()) {
jj_scanpos = xsp;
if (jj_3_18()) return true;
}
return false;
} | 2 |
public String getStringLine(int n,int largeur) {
String toRet = "";
if(n>getHauteur()-1) {
for(int i = 0; i < (largeur-1)/2 ; i++) {
toRet+=" ";
}
toRet+="|";
for(int i = 0; i < (largeur-1)/2 ; i++) {
toRet+=" ";
... | 5 |
public static java.util.List doit(String[] args) {
try {
// Check to see whether there is a provider that can do TripleDES
// encryption. If not, explicitly install the SunJCE provider.
try {
Cipher c = Cipher.getInstance("DESede");
} catch (Exception e) {
// An exception he... | 8 |
public void render(GameContainer container, Graphics g) {
g.setFont(container.getDefaultFont());
float val = 1.00f - (isActive() ? (Board.mouseButtons.isDown(0) ? 0.20f : 0.10f) : 0.00f);
int offset = (isActive() ? (Board.mouseButtons.isDown(0) ? 1 : 0) : 0);
g.drawImage(buttonImage, getX() + 1, getY() + ... | 7 |
public static byte[] toByte(String hexString) {
int len = hexString.length()/2;
byte[] result = new byte[len];
for (int i = 0; i < len; i++)
result[i] = Integer.valueOf(hexString.substring(2*i, 2*i+2), 16).byteValue();
return result;
} | 1 |
public String guiPressed(String button)
{
guiPressed = button;
if(inBattle)
{
if(button.equals("hitFace") || button.equals("hitSholder"))
{
return Battle(button);
}
if(button.startsWith("inv") && !(inventory.getItem(getInt(button) - 1) == null))
{
return Battl... | 5 |
@Override
public String toString() {
return "Section "+id+" of "+parent.toString();
} | 0 |
public static Inventory decodeString(String encoded) {
YamlConfiguration configuration = new YamlConfiguration();
try {
configuration.loadFromString(Base64Coder.decodeString(encoded));
Inventory i = Bukkit.createInventory(null, configuration.getInt("Size"), StringUtil.limitCharac... | 2 |
public void keyReleased(KeyEvent e)
{
int key = e.getKeyCode();
if (key == KeyEvent.VK_A)
{
dx = 0;
}
if (key == KeyEvent.VK_D)
{
dx = 0;
}
if (key == KeyEvent.VK_W)
{
dy = 0;
}
if (ke... | 4 |
final Class299 method3706(Class299 class299, Class299 class299_24_,
float f, Class299 class299_25_) {
try {
anInt9873++;
if (f < 0.5F)
return class299;
return class299_24_;
} catch (RuntimeException runtimeexception) {
throw Class348_Sub17.method2929
(runtimeexception,
... | 5 |
public static void kFoldValidation(double data[][],int k,ProbabilityOptions options)
{
int interval = data.length / k;
double[][] results = new double[k][4];
ArrayList<ArrayList<double[]>> partitionedData = new ArrayList<ArrayList<double[]>>();
Classifier cl;
double fScore = ... | 8 |
public static void main(String[] args){
if (args.length != 1){
throw new RuntimeException("invalid number of arguments. Must receive one argument specifying working directory!!!");
}
workingDir = args[0].replace("\\", "/");
if (workingDir.charAt(workingDir.length() - 1) != '/')
workingDir += '/';
... | 4 |
public void sendMessage(String channel, String message, boolean sanityCheck) {
if(espanol && !message.startsWith("Activated on ")) {
message = Translator.getInstance().translate(message, Language.ENGLISH, Language.SPANISH);
espanol = false;
}
if(isTeamSpeak) {
if(channel.equals("#pringers")) {
for... | 8 |
public String deltalogin(){
System.out.println("111 Userbean ");
String returnValue="login"; //default
if((username != null )&& ( pw!= null) && (newpw!=null) ){
System.out.println("116 Userbean ");
String strSQL;
DBResults rs=null;
strSQL= "call loginCheck('"+ usern... | 7 |
public static Suit getSuit(String suit) {
switch(suit.toLowerCase()) {
case ("s"): return Spades;
case ("h"): return Hearts;
case ("d"): return Diamonds;
case ("c"): return Clubs;
default: throw new RuntimeException("what suit is this?!");
}
} | 4 |
public boolean matchesSub(Identifier ident, String name) {
for (int i = 0; i < matchers.length; i++) {
if (matchers[i].matchesSub(ident, name) == isOr)
return isOr;
}
return !isOr;
} | 2 |
@Override
protected boolean isValidNonDropMove(GameState state, int x, int y) {
/* Checks if the target tile is 2 tiles in front
* and one to the side.
* Then verifies if the target tile is still in the board,
* and whether the target tile could be moved into.
* */
... | 7 |
* @param bestMUM the best MUM at the start. may be a transposition
* @throws Exception
*/
void mergeSpecial( Graph g, MUM bestMUM ) throws Exception
{
TreeMap<SpecialArc,Graph> specials =
new TreeMap<SpecialArc,Graph>(new SpecialComparator());
while ( bestMUM != null )
{
if ( bestMUM.verify() )
{
... | 9 |
public synchronized void startElement(String uri, String localName,
String qName, Attributes attrList)
throws SAXException
{
ElementImpl elem;
int i;
String tagName = getName(qName, localName);
if ( tagName == null )
throw new SAXException( "HTM004 Arg... | 8 |
public ListNode reverseKGroup(ListNode head, int k) {
if(k <= 1) return head;
ListNode dummy = new ListNode(0);
dummy.next = head;
ListNode p = dummy;
ListNode f = dummy;
int i = 0;
while(f.next != null){
f = f.next;
if(++i % k ==0){
... | 3 |
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.