text stringlengths 14 410k | label int32 0 9 |
|---|---|
static final void method1127(boolean bool) {
anInt1374++;
for (Node_Sub19 node_sub19 = (Node_Sub19) Class89.aClass312_1199.method3613(65280); node_sub19 != null; node_sub19 = (Node_Sub19) Class89.aClass312_1199.method3620(16776960)) {
if (node_sub19.aBoolean7156) {
node_sub19.method2160((byte) 97);
} else... | 9 |
public final boolean isAlive() {
return wasStarted() && !myServerSocket.isClosed() && myThread.isAlive();
} | 2 |
public static void startGame()
{
System.out.println("Game started");
game = new BattleShipGame(0, 0, pixel.width, pixel.height, gridSize);
if(manualAdding)
{
editingMode = true;
game.editNextShip();
}
if(debugMode)
changeDelaySeconds = 1;
timerLength = changeDelaySeconds * (1000/(tickTi... | 2 |
public void altaInscripcion(Inscripcion inscripcion) {
if(this.getEquiposConfirmados())
throw new EquiposConfirmadosException("No se puede realizar la inscripcion porque los equipos ya fueron confirmados");
if(cantidadInscriptosEstandar()>=10)
throw new Hay10EstandarException("No se puede realizar la inscripc... | 5 |
@Override
public int compareTo(AstronomicalObject o) {
return (this.mass < o.mass) ? -1 : (this.mass > o.mass) ? 1 : 0;
} | 2 |
private static void getCollectionFrequency(String dirName, Normalizer stemmer) throws IOException {
// Création de la table des mots
HashMap<String, Integer> hits = new HashMap<String, Integer>();
File dir = new File(dirName);
//Normalizer stemmer = new FrenchStemmer();
if (dir.isDirectory()) {
// Liste de... | 6 |
public Symbol parse() throws java.lang.Exception
{
/* the current action code */
int act;
/* the Symbol/stack element returned by a reduce */
Symbol lhs_sym = null;
/* information about production being reduced with */
short handle_size, lhs_sym_num;
/* set up direct ref... | 7 |
private String doNext(boolean remove, int lookAhead) {
prevPos = pos;
String res = null;
for (int i = 0; i < lookAhead; i ++) {
if (pos == str.length()) {
throw new IllegalStateException("End of stream");
}
StringBuilder tmp = new StringBuilder();
String c = read();
if (... | 8 |
@GET
@Path("/search")
@Produces(MediaType.LIBROS_API_LIBRO_COLLECTION)
public LibroCollection getLibroparametros(@QueryParam("autor") String autor,
@QueryParam("titulo") String titulo) {
LibroCollection libros = new LibroCollection();
Connection conn = null;
Statement stmt = null;
String sql;
try {
c... | 7 |
private static void newElements() {
for (int i = 0; i < (FieldGame.size_x + 2); i++) {
for (int p = 0; p < (FieldGame.size_y + 2); p++) {
int[] neu = new int[5];
neu[0] = getRightImageNumber(i, p);
neu[1] = i * scale_x;
neu[2] = (FieldGame.size_y + 1) * scale_y - scale_y * p;
neu[3] = scale_x;... | 7 |
public static TileImprovementType getBestTileImprovementType(Tile tile,
GoodsType goodsType) {
int bestValue = 0;
TileImprovementType bestType = null;
for (TileImprovementType impType
: tile.getSpecification().getTileImprovementTypeList()) {
if (!impType.isNa... | 6 |
protected void despawnEntity()
{
EntityPlayer var1 = this.worldObj.getClosestPlayerToEntity(this, -1.0D);
if (var1 != null)
{
double var2 = var1.posX - this.posX;
double var4 = var1.posY - this.posY;
double var6 = var1.posZ - this.posZ;
double... | 8 |
public void loadMusic(){
while(true){
while(shallRun){
File soundFile = new File(theme);
try {
audioInputStream = AudioSystem.getAudioInputStream(soundFile);
} catch (UnsupportedAudioFileException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
Audi... | 6 |
public void render(Graphics2D g)
{
for(int x = 0; x < WORLD_WIDTH; x++)
{
for(int y = 0; y < WORLD_HEIGHT; y++)
{
if(tiles[x][y] != null)
tiles[x][y].render(g);
}
}
for(int x = 0; x < WORLD_WIDTH; x++)
{
for(int y = 0; y < WORLD_HEIGHT; y++)
{
if(collectables[x][y] != null)
c... | 7 |
public static void main(String[] args) {
//String filename = "fluxoCustoMinimo";
String filename = "fluxoMaximoComMaximizacao";
try {
Data data = new Data(filename);
//data.print(System.out);
Modelo modelo = new Modelo(data);
if (modelo.solveModel()) {
modelo.exportSolution();
}
modelo... | 5 |
public void actionPerformed(ActionEvent e) {
String command = e.getActionCommand();
if ("JavacLocation.Browse".equals(command)) {
handleBrowseForJavac();
return;
}
else if ("SourceOutputDir.Browse".equals(command)) {
if (dirChooser == null) {
dirChooser = new RDirectoryChooser(getOptionsDialog()... | 7 |
@Override
public void execute() {
if (isAnswering()) {
System.out.println("Answering");
if (Widgets.get(1188, 3).getText().equals("I can't afford that.")) {
System.out.println("Broke");
BearFurs.stop = -1;
} else {
while (isAnswering()) {
Keyboard.sendText("1", false);
Ta... | 7 |
public static DHCPOption newOptionAsShorts(byte code, short[] arr) {
if (!isOptionAsShorts(code)) {
throw new IllegalArgumentException("DHCP option type ("+code+") is not shorts");
}
byte[] buf = null;
if (arr != null) {
buf = new byte[arr.length * 2];
for (int i=0; i<arr.len... | 3 |
public static boolean itemExists(int itemID, int itemX, int itemY) {
for (int i = 0; i <= 5000; i++) { // Phate: Loop through all item spots
if(globalItemID[i] == itemID && globalItemX[i] == itemX && globalItemY[i] == itemY) // Phate: Found item
return true;
}
return false; // Phate: Item doesnt exis... | 4 |
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://down... | 6 |
public static void main(String[] args) {
// float f = 1.0; <-- Error
float x = (float) 1.0;
float y = 1.0F;
} | 0 |
@Override
public void timeStep(TimeEvent e) {
if(getState() == ENABLED) {
flash += e.getDelta();
if(flash > 1f) {
flash = 0;
}
}
} | 2 |
public static void assertNotNull(Object object) {
if (object == null) {
throw new CsvException("object can't be null.");
}
} | 1 |
static String toCSVString(String s) {
if (s == null)
return "";
StringBuilder sb = new StringBuilder(s.length()+1);
sb.append('\'');
int len = s.length();
for (int i = 0; i < len; i++) {
char c = s.charAt(i);
switch(c) {
case '... | 8 |
public synchronized boolean isRegrowColor(DyeColor dyeColor) {
List<String> regrowColors = sheepFeedPlugin.getConfig().getStringList("regrowcolors");
if ( regrowColors == null || regrowColors.size() == 0 ) {
SheepFeed.log("Config does not contain any regrowColor entries, while the plugin should have populated th... | 2 |
public boolean isCollision(Pacman p) {
// If Pacman collides with a ghost and isn't powered, he dies.
if ((isGhost() == 1 || isGhost() == 2) && !pacman.isPowered()) {
sounds.playDeath();
lives--;
pacman.initializePos(450, 550, 0);
evil1.initializePos(350,... | 7 |
public boolean isInMap(){
if(x<0)
return false;
if(x>Alpha.mapsize)
return false;
if(y<-Alpha.mapsize/2)
return false;
if(y>Alpha.mapsize/2)
return false;
return true;
} | 4 |
public String getWeaponSound(String weapon) {
if(weapon.equals("assets/data/actors/bullet.xml")) {
return "bullet";
}
return null;
} | 1 |
public Expression3 expression(boolean isExpressionInBrackets) throws ParsingException {
Expression3 left = summand();
while (true) {
if (tryConsume("+"))
left = new BinaryOperation<T>(left, summand(), arithmetics.get("+"));
else if (tryConsume("-"))
... | 6 |
public void checkFanCollisions()
{
int index=0;
fanIDs = tileMap.getFanIDs();
fanTileX = tileMap.getFanXCoords();
fanTileY = tileMap.getFanYCoords();
for(int i=0;i<fanTileX.size();i++)
{
fanDist = tileMap.getTile(fanIDs.get(i)).getFanHeight();
if(640+20>fanTileX.get(i) && 640+8<fanTileX.get(i)+32)
... | 9 |
public void remove(SurfaceSelection selection) {
Range range = selection.getSelection().getRange();
Element ancestor = getCommonMatchingAncestor(selection);
if (ancestor != null && ancestor.getParentElement() != null) {
Node startNode = range.getStartContainer();
Node endNode = range.getEndCont... | 9 |
public void createETables(Connection cCon, Connection eCon) throws SQLException {
//---------CREATE ETABLES--------------
DatabaseMetaData md = cCon.getMetaData();
Statement eStatement = eCon.createStatement();
Statement cStatement = cCon.createStatement();
ResultSet tables = md... | 8 |
public double fisher2c(){
double p = 0;
int nRows = thisMatrix.length;
int nColumns = thisMatrix[0].length;
int[] rowTotals = new int[nRows];
int[] columnTotals = new int[nColumns];
for (int i=0; i<nRows; i++){
rowTotals[i]=findSumRow(i, nColumns);
}
for (int i=0; i<nColumns; i++){
column... | 7 |
public ByteBuffer toBuffer() {
byte fixed = 0x00;
int length;
fixed |= (TypeValues.indexOf(type) << Shift.TYPE);
if (duplicate) {
fixed |= OrMask.DUPLICATE;
}
if (qos > 0) {
fixed |= (qos << Shift.QOS);
}
if (retain) {
fixed |= OrMask.RETAIN;
}
if (changed) {
generate();
}
le... | 9 |
private static double[] handleNegativity(double[][] table, boolean[] canBeNeg, int rows, int cols) {
//TODO: false
double[] maxima = new double[canBeNeg.length];
for (int i = 0; i < canBeNeg.length; i++) {
if (!canBeNeg[i]) {
for (int j = 0; j < rows - 1; j++) {
double current = Math.abs(table[j][cols... | 8 |
public void skipRemaining() throws IOException {
while (length > 0) {
int skipped = (int) skip(length);
if (skipped == 0)
throw new EOFException();
length -= skipped;
}
} | 2 |
public boolean hasPathSum(TreeNode root, int sum) {
// Start typing your Java solution below
// DO NOT write main() function
if (root == null)
return false;
if (root.left == null && root.right == null && root.val == sum)
return true; // 成功条件
return (hasPathSum(root.left, sum - root.val) || hasPathSum(ro... | 5 |
public Object nextValue() throws JSONException {
char c = this.nextClean();
String string;
switch (c) {
case '"':
case '\'':
return this.nextString(c);
case '{':
this.back();
return new JSONObject(this);
... | 7 |
private void performTroubleShooting(){
int length = decrementLocator(locator).toString().length();
try {
info("---------------- Troubleshooting starting --------------------");
for (int i = 0; i < length; i++) {
decrementLocator(locator);
Boolean result = isPresent(TIMEOUT_WAIT_0);
info("Re-try wi... | 4 |
private void savePreferences()
{
Preferences preferences = BrainPreferences.getPreferences();
preferences.put(PreferencesNames.LEFT_NAME, this.leftNameField.getText());
preferences.put(PreferencesNames.RIGHT_NAME, this.rightNameField.getText());
preferences.put(PreferencesNames.MAX_S... | 1 |
public static String[] getVersions() throws IOException {
String version = get("version.txt");
String[] versions = version.split("\n");
for (int i = 0; i < versions.length; i++) {
versions[i] = versions[i].substring(
version.indexOf("[version]") + 9,
version.indexOf("[/version]"));
}
return versi... | 1 |
private void adjust() {
boolean left = x < PLAYER_RADIUS;
boolean right = x > (WINDOW_WIDTH - PLAYER_RADIUS);
boolean top = y < PLAYER_RADIUS;
boolean bot = y > WINDOW_HEIGHT - PLAYER_RADIUS * 2;
if (right) x = (WINDOW_WIDTH - PLAYER_RADIUS) - 1;
if (left) x = PLAYER_RAD... | 4 |
public void forward(double steps){
double angle = this.angle * Math.PI / 180.0;
double dx = x + steps * Math.cos(angle);
double dy = y + steps * Math.sin(angle);
if (draw){
Graphics2D g = (Graphics2D)image.getGraphics();
g.setColor(color);
g.draw(new Line2D.Double(x, y, dx, dy));
}
if (curre... | 3 |
private static int method515(char ac[], int i) {
for (int k = i; k < ac.length && k >= 0; k++)
if (ac[k] >= '0' && ac[k] <= '9')
return k;
return -1;
} | 4 |
public void dagDistances(Graph g, Vertex start) {
List<Vertex> vertexList = g.vertices();
for (Vertex v : vertexList)
if (v.equals(start))
v.setDistance(0);
else
v.setDistance(Integer.MAX_VALUE);
Vertex[] sortedVertices = topologicalDFS(g);
for (Vertex u : sortedVertices) {
List<EdgeListObjec... | 6 |
public Queue createQueue(int queueId) throws QueueCreateException, QueueAlreadyExistsException {
try {
_out.writeInt(8); //Size
_out.writeInt(Response.MSG_QUEUE_CREATE);
_out.writeInt(queueId);
_out.flush();
int messageType = _in.readInt();
... | 4 |
private String normalizedName(Object o) {
if (!(o instanceof Class)) { return o.toString(); }
Class c = (Class)o;
String name = c.toString();
if (name.indexOf(' ') >= 0 && name.indexOf(' ') < name.length()-1) {
name = name.substring(name.lastIndexOf(' ')+1);
}
if (name.indexOf('.') >= 0 && name.indexOf('... | 7 |
@Override
public boolean equals(Object o) {
if (!(o instanceof Polynomial)) {
return false;
}
Polynomial other = (Polynomial) o;
Set<Integer> a = this.terms.keySet();
Set<Integer> b = other.terms.keySet();
if (!(a.equals(b))) {
return false;
... | 4 |
public boolean canBeKilledInstantly(Hero h){
int coefficient = h.level * 1;
if(coefficient > 20)
coefficient = 20 ;
if(this.HP < Percent.getPercent(coefficient, this.maxHP))
return true ;
return false ;
} | 2 |
void createComboEditor (CCombo combo, TableEditor comboEditor) {
combo.setItems (OPTIONS);
combo.setText (newItem.getText (1));
/* Set up editor */
comboEditor.horizontalAlignment = SWT.LEFT;
comboEditor.grabHorizontal = true;
comboEditor.minimumWidth = 50;
comboEditor.setEditor (combo, newItem, 1);
... | 3 |
public List<String> ExtractFromStream(InputStream is, int minLength) throws XMLStreamException, IOException {
List<String> lines = Lists.newArrayList();
XMLStreamReader staxXmlReader = XMLInputFactory.newInstance().createXMLStreamReader(is);
List<String> line = Lists.newArrayList();
for ... | 6 |
public static boolean checkAnagrams(String s1, String s2) {
if (s1 == null || s2 == null || (s1.length() != s2.length()) || s1.length() == 0) {
return false;
}
int[] charCount = new int[256];
for (int i=0;i<256;i++) {
charCount[i] = 0;
}
char[] str1chars = s1.toCharArray();
char[] str2chars = s2.toC... | 8 |
public void viewTicket(int ticketID) {
//===================== Local Data ======================//
Ticket ticket; //ticket to view details from
try {
ticket = tickets.fetch(ticketID);
} catch (Exception e) {
System.out.println("Unable to display info for this... | 8 |
protected HttpResponse sendRequestWithRetry(HttpRequest httpRequest) throws HttpException {
int retryCounter = 0;
int maxRetries = httpRequest.getHttpMethod().isIdemponent() ? config.getMaxRetryTimes() : 0;
if (httpRequest instanceof HttpStreamingRequest) {
maxRetries = 1; // for str... | 7 |
boolean inBlockComment(int start, int end) {
for (int i=0; i<blockComments.size(); i++) {
int[] offsets = (int[])blockComments.elementAt(i);
// start of comment in the line
if ((offsets[0] >= start) && (offsets[0] <= end)) return true;
// end of comment in the line
if ((offsets[1] >= start) && (offsets[1] <=... | 7 |
public void selectPrevious() {
selectedIndex--;
if(selectedItem != null)
selectedItem.deselect();
if(selectedIndex < 0) {
boolean selectionRolloverHandled = handleSelectionRollover(SelectionRolloverDirection.Top);
if(selectionRolloverHandled)
return;
else
selectedIndex = listItems.size()... | 3 |
public void writeSentence(TokenStructure syntaxGraph) throws MaltChainedException {
if (syntaxGraph == null || dataFormatInstance == null || !(syntaxGraph instanceof PhraseStructure) || !syntaxGraph.hasTokens()) {
return;
}
PhraseStructure phraseStructure = (PhraseStructure)syntaxGraph;
sentenceCount++;
tr... | 8 |
public void testFactory_parseMonths_String() {
assertEquals(0, Months.parseMonths((String) null).getMonths());
assertEquals(0, Months.parseMonths("P0M").getMonths());
assertEquals(1, Months.parseMonths("P1M").getMonths());
assertEquals(-3, Months.parseMonths("P-3M").getMonths());
... | 2 |
public FindReplaceModel() {
super();
try {
super.process(Outliner.FIND_REPLACE_FILE);
} catch (SAXException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
// Make sure size is at least 1.
if (getSize() <= 0) {
... | 4 |
public static void startupBacklinks() {
{ Object old$Module$000 = Stella.$MODULE$.get();
Object old$Context$000 = Stella.$CONTEXT$.get();
try {
Native.setSpecial(Stella.$MODULE$, Stella.getStellaModule("/LOGIC", Stella.$STARTUP_TIME_PHASE$ > 1));
Native.setSpecial(Stella.$CONTEXT$, ((Mo... | 6 |
@Override
public void insert(String dataBaseName, String tableName,
ArrayList<Field> entries) {
// get the array of col from load
XMLParser obj = new XMLParser();
ArrayList<Col>table=obj.load(dataBaseName, tableName);
//ArrayList<Col> table = intialize();
if (table == null){
System.out.println("NULL ... | 7 |
public void initUI() {
if(initiated){
w.setSize(500, 200);
return;
}
//setting self up
setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
//setting up MenuDialog
md = new MenuDialog(this);
//setting language-specific strings
if(Locale.getDefault() == Locale.GERMAN || Locale.getDefault() == Local... | 5 |
public void initialize() {
configuration = new HashMap<String, String>();
try {
createSettings();
load();
} catch(FileNotFoundException e) {
Logger.log(" No settings found. Using from default.");
}
//Set all the settings TODO Improve this
Settings.fullscreen = configuration.get(Strings.FULLSC... | 1 |
public void toFtanMLContent(Writer writer) {
Iterator<FtanValue> iterator=values.iterator();
while(iterator.hasNext()) {
FtanValue next=iterator.next();
if(next instanceof FtanString)
((FtanString)next).toFtanMLContent(writer);
else if(next instanceof FtanElement)
((FtanElement)next).toFtanMLConten... | 3 |
public static void copyRow(Row row, Row newRow) {
Cell cell = null;
Cell newCell = null;
int cellType;
Iterator<Cell> iterator = row.iterator();
int count = 0;
// 遍历单元格,完成复制
while (iterator.hasNext()) {
cell = iterator.next();
cellType = cell.getCellType();
newCell = newRow.createCell(count);
... | 5 |
public int getPageLastItem() {
int i = getPageFirstItem() + pageSize - 1;
int count = getItemsCount() - 1;
if (i > count) {
i = count;
}
if (i < 0) {
i = 0;
}
return i;
} | 2 |
static double grad(int hash, double x, double y, double z) {
int h = hash & 15; // CONVERT LO 4 BITS OF HASH CODE
double u = h<8||h==12||h==13 ? x : y, // INTO 12 GRADIENT DIRECTIONS.
v = h<4||h==12||h==13 ? y : z;
return ((h&1) == 0 ? u : -u) + ((h&2) == 0 ? v : -v... | 8 |
public int getSquareWidth() {
boolean test = false;
if (test || m_test) {
System.out.println("GameBoardGraphics :: getSquareWidth() BEGIN");
}
if (test || m_test) {
System.out.println("GameBoardGraphics :: getSquareWidth() END");
}
return SQUARE_WIDTH;
} | 4 |
private ArrayList<Game> getGames(String from, String to) {
DatastoreService datastore = DatastoreServiceFactory
.getDatastoreService();
Filter fromFilter = new FilterPredicate("gameId",
FilterOperator.GREATER_THAN_OR_EQUAL, from);
Filter toFilter = new FilterPredicate("gameId",
FilterOperator.LESS_TH... | 7 |
@Test(expected=BadPostfixException.class)
public void evaluatePostfix3() throws DAIndexOutOfBoundsException, DAIllegalArgumentException, NumberFormatException, NotEnoughOperandsException, BadPostfixException
{
try
{
postfix.addLast("^");
String result = calc.evaluatePostfix(postfix);
}
catch (... | 5 |
private void fireKeyEvent(KeyEvent e) {
super.processKeyEvent(e);
Object[] listeners = listenerList.getListenerList();
for (int i = listeners.length - 2; i >= 0; i -= 2) {
if (listeners[i] == KeyListener.class) {
KeyListener listener = ((KeyListener) listeners[i + 1])... | 5 |
public static int[] rotationArray() {
int n = cad.length;
Integer[] order = new Integer[n];
for (int i = 0; i < n; i++)
order[i] = i;
Arrays.sort(order, comp);
int[] sa = new int[n];
int[] classes = new int[n];
for (int i = 0; i < n; i++) {
sa[i] = order[i];
classes[i] = cad[i];
}
for (int le... | 9 |
public static void burnCard(Player p){
if(p == null || p.deck == null || pile == null || pile.isEmpty()){
return;
}
if(p.lives < 1)
return;
if(p.deck.isEmpty() || pile.isEmpty()){
p.lives--;
if(currentState == State.inGame){
p.addNotification("-1 Life", Color.RED);
}
return;
}
... | 9 |
public double score(StringWrapper s, StringWrapper t) {
checkTrainingHasHappened(s, t);
UnitVector sBag = asUnitVector(s);
UnitVector tBag = asUnitVector(t);
List<Similarity> similarities = new ArrayList<Similarity>(sBag.size());
double sim = 0.0;
int i = 0;
for (... | 6 |
private Comparator<SharingPeer> getPeerRateComparator() {
if (ClientState.SHARING.equals(this.state)) {
return new SharingPeer.DLRateComparator();
} else if (ClientState.SEEDING.equals(this.state)) {
return new SharingPeer.ULRateComparator();
} else {
throw new IllegalStateException("Client is neither sh... | 2 |
public static void create(CommandSender sender, String [] args){
if(sender.hasPermission("battlegrounds.team.create")){
//If missing parameters
if(args.length < 2+1){
sender.sendMessage(ErrorMessage.MissingParameters);
sender.sendMessage(ChatColor.YELLOW + usage);
}
else if(args.length > 2+1+1)... | 6 |
public String subCount(String root) {
int n = root.length();
StringBuilder sb = new StringBuilder();
char prev = 0;
int cnt = 0;
for (int i = 0; i < n; i++) {
char cur = root.charAt(i);
if (cur == prev)
cnt++;
else {
if (prev != 0) { // 第一条是空
StringBuilder tmp = new StringBuilder();
... | 6 |
protected String getPlayerTextField(int playerNum)
{
if (playerNum == 1)
{
return player1TextField.getText();
}
else if (playerNum == 2)
{
return player2TextField.getText();
}
else if (playerNum == 3)
{
return player3TextField.getText();
}
else if (playerNum == 4)
{
return player4Text... | 5 |
public Wave32(){
super();
MobBuilder m = super.mobBuilder;
for(int i = 0; i < 1250; i++){
if(i % 17 == 0)
add(m.buildMob(MobID.TENTACRUEL));
else if(i % 6 == 0)
add(m.buildMob(MobID.HORSEA));
else if(i % 5 == 0)
add(m.buildMob(MobID.TENTACOOL));
else if(i % 4 == 0)
add(m.buildMob(MobID... | 7 |
public void setIndirizzo(Address indirizzo) {
this.indirizzo = indirizzo;
} | 0 |
public static List<ParisModel> getAllTeamParisBySchedule(String schedId) {
List<ParisModel> result = new ArrayList<ParisModel>();
List<ParisVictoryModel> parisVict = getAllVictoryParisBySchedule(schedId);
for(ParisVictoryModel paris : parisVict) {
result.add(paris);
}
List<ParisScoreModel> parisScor = getA... | 2 |
@Override
public int compare(byte[] left, byte[] right) {
for (int i = 0, j = 0; i < left.length && j < right.length; i++, j++) {
int a = (left[i] & 0xff);
int b = (right[j] & 0xff);
if (a != b) {
return a - b;
}
... | 3 |
public int kitSize(){
return kit.size();
} | 0 |
@Override
public String toString() {
return isNull() ? "NULL" : isVoid() ? "VOID" : String.valueOf(value);
} | 2 |
public void makeHolierHole() {
for(int y = 0; y < getHeight(); y++) {
for(int x = 0; x < getWidth(); x++) {
if((x >= 1+y%2) && (x <= 5+y%2)) {
array[x][y].visible = false;
}
}
}
} | 4 |
public void requestImport(ImportReference reference) {
if (!imports.contains(reference))
imports.add(reference);
} | 1 |
public void run()
{
DatagramPacket dp = null;
byte[] arrBytes = null;
try
{
if (null == EzimAckSender.ms)
throw new Exception("Ack socket not prepared yet.");
arrBytes = this.msg.getBytes(EzimNetwork.dtxMsgEnc);
if (arrBytes.length > EzimNetwork.inBuf)
throw new Exception("Ack message too l... | 3 |
private void updateAlerts() {
try {
update(AlertNotifier.settings.alertURL);
}
catch(NumberFormatException e) {
AlertNotifier.console.writeLine("Encountered an improperly formatted number while updating alerts: " + e.getMessage());
}
catch(MalformedURLException e) {
AlertNotifier.console.writeLine("A... | 9 |
public void setDescription(String description) {
this.description = description;
} | 0 |
static void store_littleendian(byte[] x, int offset, int u)
{
x[offset] = (byte) u; u >>>= 8;
x[offset + 1] = (byte) u; u >>>= 8;
x[offset + 2] = (byte) u; u >>>= 8;
x[offset + 3] = (byte) u;
} | 0 |
public void writeValue(JTextFieldUnit othertext, JTextFieldUnit thistext,
JComboBoxUnit lefte, JComboBoxUnit righte) {
if(!thistext.getText().equals("")){
if (lefte.getSelectedItem() != null && righte.getSelectedItem() != null)
try {
othertext.setText(Double.toString(Converter.convert(Double
.parseD... | 6 |
public int getId() {
return id;
} | 0 |
public byte [] getPowerSpectrum(float[] BIJfht)
{
float[] fps = new float[maxN*maxN];
float min = Float.MAX_VALUE;
float max = Float.MIN_VALUE;
for (int row=0; row<maxN; row++)
{
fhtps(row, maxN, BIJfht, fps);
int base = row * maxN;
for (int col=0; col<maxN; col++)
{
float r = fps[base... | 8 |
public void testConstructor_RP_RP_PeriodType8() throws Throwable {
Partial dt1 = new Partial().with(DateTimeFieldType.year(), 2005).with(DateTimeFieldType.hourOfDay(), 12);
Partial dt2 = new Partial().with(DateTimeFieldType.year(), 2005).with(DateTimeFieldType.hourOfDay(), 14);
try {
... | 1 |
public PixelMap or(PixelMap rhs) {
int width = pixels.length;
int height = pixels[0].length;
int rhsWidth = rhs.pixels.length;
int rhsHeight = rhs.pixels[0].length;
int maxWidth = Math.max(pixels.length, rhs.pixels.length);
int maxHeight = Math.max(pixels[0].length, rhs.pixels[0].length);
boolean[][... | 9 |
void performSchedule() {
synchronized(this) {
// TODO: scan for notification and put it into buffer
//this.aNotification.add(null);
//this.notifyAll();
}
} | 0 |
@Override
public void itemStateChanged(ItemEvent event) {
if (event.getStateChange() == ItemEvent.SELECTED) {
if (event.getItemSelectable().equals(comboBox)) {
automaticItemSelection = true;
if (getIndex(driver.getPersonDB().getCustomerList()) != -1) {
setTextField(getIndex(driver.getPersonDB().getCu... | 6 |
public static void Warning(String s){ log.info("[AprilonIRC] " + s); } | 0 |
@EventHandler(priority = EventPriority.MONITOR)
public void onPlayerConsoleCommand(ServerCommandEvent event) {
String msg = event.getCommand();
if (getConfig.ConsoleCommands() && getConfig.logFilesEnabled()) {
filehandler.logConsole(msg);
}
if (getConfig.ConsoleCommands() && getConfig.MySQLEnabled()) {
a... | 4 |
public String toString(String input) {
return "u("+input+")";
} | 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.