text stringlengths 14 410k | label int32 0 9 |
|---|---|
public void wdgmsg(Widget sender, String msg, Object... args) {
if (sender == leave) {
wdgmsg("leave");
return;
}
for (Member m : avs.keySet()) {
if (sender == avs.get(m)) {
wdgmsg("click", m.gobid, args[0]);
return;
}
}
super.wdgmsg(sender, msg, args);
} | 3 |
public void setThreads(Integer threads) {
this.threads = threads;
} | 0 |
@Override
public void validate(FacesContext context, UIComponent component,
Object value) throws ValidatorException {
String password = value.toString();
UIInput uiInputConfirmPassword = (UIInput) component.getAttributes().get("pwd2");
String confirmPassword = uiInp... | 5 |
int value(Board b, Side s) {
if (b.piecesContiguous(s)) {
return 1;
} else if (b.piecesContiguous(s.opponent())) {
return -1;
} else {
return 0;
}
} | 2 |
public boolean compBlock(Material block, Player play, String sAction, ArrayList<PaymentCache> aPayer) {
HashMap<String, ArrayList<Material>> hJobs = _jobsdata.getMatHash();
if(hJobs.isEmpty())
return false;
for(Map.Entry<String, ArrayList<Material>> e : hJobs.entrySet()) {
... | 5 |
public void reiniciar(){
if (comboBox_1.getSelectedItem() == "Universitario" || comboBox_1.getSelectedItem() == "<Selecciona>") {
comboBoxGrado.setSelectedItem("<Selecciona>");
comboBoxNivelAlcanzado.setSelectedItem("<Selecciona>");
comboBoxPostGrado.setSelectedItem("<Selecciona>");
comboBox_Certificacion... | 4 |
private void order(String order, String location,
List<ServiceRequest> requests) {
if (order != null) {
if (order.equals("popular")) {
Collections.sort(requests, new Comparator<ServiceRequest>() {
@Override
public int compare(ServiceRequest sr1, ServiceRequest sr2) {
if (sr1.getVotes() == s... | 9 |
public void paint(Graphics g) {
int frameHeight = getSize().height;
int frameWidth = getSize().width;
Graphics2D g2d = (Graphics2D) g;
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
g2d.clearRect(0, 0, frameWidth... | 4 |
void addAlternative(){
String new_name = (String)JOptionPane.showInputDialog(
this,
"Alternative name:",
"Add New Alternative",
JOptionPane.PLAIN_MESSAGE,
null,
null,
"Alt(" + counter + ")");
... | 7 |
public boolean doesDatabaseExist() {
try {
getConnection(true);
rs = getConn().getMetaData().getCatalogs();
while (rs.next()) {
String databaseName = rs.getString(1);
if(databaseName.equals(dbName)){
return true;
}
}
} catch (SQLException e) {
e.printStackTrace();
} finally {
... | 4 |
public NextVoteManager(final NextVote nvPlugin) {
this.plugin = nvPlugin;
try {
plugin.getDatabase().find(VoteHistory.class).findRowCount();
} catch (PersistenceException ex) {
log.log(Level.INFO, "Installing database for " + plugin.getDescription().getName() + " due to f... | 2 |
public synchronized static void renameBlob(String newName, String oldName) {
File file = new File(oldName);
if (file.isDirectory()) {
System.out.println("Blob is a directory");
renameBlobDir(oldName, newName);
}
if (file.isFile()) {
System.out.println("Blob is a file");
renameSingleBlob(oldName, ne... | 2 |
@Override
public void body() {
loadResourcesIDs();
while (true)
{
printRuntimeMessage("Submitting next gridlets chunk...");
int submittedCount = submitGridletsChunk();
printRuntimeMessage(String.format("...%1$d gridlets submitted",
sub... | 3 |
public static MetroSubmodesOfTransportEnumeration fromValue(String v) {
for (MetroSubmodesOfTransportEnumeration c: MetroSubmodesOfTransportEnumeration.values()) {
if (c.value.equals(v)) {
return c;
}
}
throw new IllegalArgumentException(v);
} | 2 |
public AlbumFeature(File song)
throws MP3Exception {
super(song);
this.obf= new ObjectFactory();
this.album= this.obf.createAlbumType();
this.getHttp= GetHttpPage.getInstance();
try {
this.log= AlbumLogger.getInstance().getLog();
} catch (LogException e) {
throw new MP3Exception("LogException "... | 1 |
public boolean postMortem(PostMortem pm) {
JSONzip that = (JSONzip) pm;
return this.namehuff.postMortem(that.namehuff)
&& this.namekeep.postMortem(that.namekeep)
&& this.stringkeep.postMortem(that.stringkeep)
&& this.substringhuff.postMortem(that.substring... | 5 |
private boolean searchUpForPrevSubsetNode( Node node, K key, Object[] ret ) {
if( node.mLeft != null && mComp.compareMins( node.mKey, key ) >= 0 &&
mComp.compareMinToMax( key, node.mLeft.mMaxStop.mKey ) < 0 )
{
// Request downward searh on left subtree.
ret[0] = node... | 9 |
public static int taxiCab(int color1, int color2) {
int dRed = Math.abs( ((color1 & RED_MASK) >> 16) - ((color2 & RED_MASK) >> 16));
int dGreen = Math.abs( ((color1 & GREEN_MASK) >> 8) - ((color2 & GREEN_MASK) >> 8));
int dBlue = Math.abs( (color1 & BLUE_MASK) - (color2 & BLUE_MASK));
... | 0 |
public static byte menuprincipal(){
byte op=0;
do{
System.out.println("1 Abrir cuenta bancaria");
System.out.println("2. Consultar saldo cuenta bancaria");
System.out.println("3. Extraer dinero cuenta bancaria");
System.out.println("4. Ingresar dinero cuenta bancaria");
System.out.println("5. Salir");
... | 4 |
private double parseMulOrDiv() throws Exception{
char op; //
double result; //
double partialResult; //ӱʽĽ
//ָ㵱ǰӱʽֵ
result=this.parseExponent();
//ǰǵĵһĸdz˳ȡģг˳
while((op=this.token.charAt(0))=='*'||op=='/'||op=='%'){
this.getToken();//ȡһ
//ָ㵱ǰӱʽֵ
partialResult=this.parseExponent();
switch(op... | 8 |
public void setAdresse(String adresse) {
this.adresse = adresse;
} | 0 |
static public String numberToString(Number n)
throws JSONException {
if (n == null) {
throw new JSONException("Null pointer");
}
testValidity(n);
// Shave off trailing zeros and decimal point, if possible.
String s = n.toString();
if (s.indexOf('.') > 0 ... | 6 |
public void mousePressed(MouseEvent e) {
JPanel panel = (JPanel)e.getSource();
Component component = panel.getComponentAt(e.getPoint());
if (component instanceof Field) {
Field field = (Field)component;
int x = field.getFieldX();
int y = field.getFieldY();
... | 7 |
public Object get(int index) throws JSONException {
Object object = opt(index);
if (object == null) {
throw new JSONException("JSONArray[" + index + "] not found.");
}
return object;
} | 1 |
public boolean isAlive()
{
return alive;
} | 0 |
public CodeRunResult run(CodeRunParams params) {
CodeRunResult result;
Class clazz = params.getCompilationResult().getCompiledClasses().get(TestClassCodeBuilder.TEST_CLASS);
try {
Object o = clazz.getConstructor().newInstance();
Method m = clazz.getDeclaredMethod("execute... | 2 |
public void setQuantity(Integer quantity) {
this.quantity = quantity;
} | 0 |
public void setOtherTlvArray(Tlv[] otherTlvArray) {
OtherTlvArray = otherTlvArray;
} | 0 |
public synchronized double compute() {
if ((getChild1() != null) && (getChild2() != null)) {
double val1 = getChild1().compute();
double val2 = getChild2().compute();
if (getOperator().equals(ADD)) {
setValue(val1 + val2);
} else if (getOperator().equals(SUBTRACT)) {
setValue(val1 - val2);
}... | 6 |
@Override
public void setPixel(int x, int y, int c)
{
if (x < 0 || x >= width)
return;
if (y < 0 || y >= height)
return;
if (format == 1)
{
c &= 0x1F;
c |= getPixelVal(x, y) & (~0x1F);
}
if (format == 6)
{
... | 6 |
public static int jump_greedy(int[] A) {
// try greedy
if(A==null || A.length<=1) return 0;
int cnt = 0;
int start = 0;
int end = 0;
while(true) {
int curMaxEnd=end;
cnt++;
for(int i=start;i<=end;++i) {
if((A[i]+i)>curMa... | 7 |
public boolean isYourMove() throws InterruptedException {
boolean test = false;
if (test || m_test) {
System.out.println("ConnectFourAI :: isYourMove() BEGIN");
}
setYourTurn(true);
if (!(getGame().getPlayer1() instanceof Human ||
getGame().getPlayer2() instanceof Human)){
sendMov... | 6 |
@Override
public void paintComponent(Graphics g) {
super.paintComponent(g);
BufferedImage pokemonSpriteSheet = null;
try {
pokemonSpriteSheet = ImageIO.read(new File("Images/CondensedOverworldSprites.png"));
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}... | 6 |
private int minDistance_dp(String word1, String word2) {
if (word1.equals(word2)) {
return 0;
}
int M = word1.length(), N = word2.length();
if (M == 0 || N == 0) {
return Math.abs(M - N);
}
// init P
int[][] P = new int[M + 1][N + 1];
... | 8 |
public InstrumentInfo(String symbol) {
m_symbol = symbol;
final String url = "http://download.finance.yahoo.com/q?s=" + symbol + "&d=t";
try {
Document doc = Jsoup.connect(url).get();
Elements table = doc.select("body table:nth-child(2) > tbody > tr > td > table > tbod... | 4 |
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof DistanceFilter)) return false;
DistanceFilter other = (DistanceFilter) o;
if (this.distance != other.distance ||
this.lat != other.lat ||
this.lng != other.lng ||
!this.latField.... | 7 |
public String get(int i) {
NodoListaDiccionario aux;
if(i>size || i < 0)
return null;
if(i>size/2) {
aux = ultimo;
for(int j = size-1; j>i; j--)
aux = aux.getAnterior();
return aux.getPalabra();
} else {
aux = primero;
for(int j = 0; j<i; j++)
aux = aux.getSiguiente();
return aux.... | 5 |
protected void eraseFromScrollItem(Scroll buildingI, Ability theSpell, int level)
{
if(buildingI == null)
return;
StringBuilder newList=new StringBuilder();
for(Ability A : buildingI.getSpells())
{
if(!A.ID().equalsIgnoreCase(theSpell.ID()))
newList.append(A.ID()).append(";");
if(buildingI.isGener... | 9 |
public void setAge(int age)
{
Age = age;
} | 0 |
private TLanguageFile initSingle( Element node, String workDir, String projectDir)
{
TLanguageFile back = null ;
String filename = node.getAttribute("filename") ;
if (filename != null)
{
if (filename.length() > 0)
{
File workFile = new File( filename ) ;
// file doesn't ... | 7 |
public MemberResolver.Method atMethodCallCore(CtClass targetClass,
String mname, ASTList args)
throws CompileError
{
int nargs = getMethodArgsLength(args);
int[] types = new int[nargs];
int[] dims = new int[nargs];
String[] cn... | 2 |
public void setReasonForStopping(String reason) {
reasonForStopping = reason;
} | 0 |
@Override
void replaceChild(@SuppressWarnings("unused") Node oldChild, @SuppressWarnings("unused") Node newChild)
{
// Replace child
for(ListIterator<PVar> i = this._var_.listIterator(); i.hasNext();)
{
if(i.next() == oldChild)
{
if(newChild != nul... | 3 |
@Override
public double[][] solve(double[] f, int n, double k, double u, double dt, double dx) {
int m = f.length;
double[][] ans = new double[n][];
ans[0] = f;
for (int i = 1; i < n; i++) {
double[] prevLayer = ans[i - 1], curLayer = new double[m];
for (int j = 0; j < m; j++) {
curLayer[j] = prevL... | 2 |
public void visitIfStmt(final IfStmt stmt) {
if (stmt.trueTarget() == oldDst) {
if (FlowGraph.DEBUG) {
System.out.print(" replacing " + stmt);
}
stmt.setTrueTarget(newDst);
if (FlowGraph.DEBUG) {
System.out.println(" with " + stmt);
}
}
if (stmt.falseTarget() == oldDst) {
if (FlowG... | 6 |
@Override
public void setTemperature(int i, int j, double value) {
if (i >= 0 && i < numLongCells && j >= 0 && j < numLatCells) {
cellValues[i][j] = value;
}
// Allow overrunning the "size" of the grid. We are on
// a sphere, after all. This is convenient for checking nei... | 7 |
private void finFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_finFieldActionPerformed
// TODO add your handling code here:
String OneLine;
String word;
int occurrences;
int lines = 0;
int i, j;
StringTokenizer strtok;
HashTable ht... | 5 |
@Override
public void renderControl(Graphics2D g) {
BufferedImage Control = new BufferedImage(this.getSize().getWidth(), this.getSize().getHeight(), BufferedImage.TYPE_INT_ARGB);
Graphics2D g2d = (Graphics2D) Control.getGraphics();
if(this.getBackgroundColor() != null)
{
... | 5 |
protected void FillBuff() throws java.io.IOException
{
if (maxNextCharInd == available)
{
if (available == bufsize)
{
if (tokenBegin > 2048)
{
bufpos = maxNextCharInd = 0;
available = tokenBegin;
}
else if (tokenBegin < 0)
bufpos = maxN... | 9 |
private void balanceAfterInsert(AVLNode<T> node) {
int balanceFactor = node.getBalanceFactor();
if (balanceFactor > 1 || balanceFactor < -1) {
AVLNode<T> parent = null;
AVLNode<T> child = null;
Balance balance = null;
if (balanceFactor < 0) {
parent = (AVLNode<T>) node.lesser;
balanceFactor = pa... | 8 |
public List<Proveedor> getListaProveedor(){
List<Proveedor> ListaProveedor = new LinkedList();
Conexionbd.conexion bd = new Conexionbd.conexion();
List<producto> lp = new LinkedList();
try{
bd.conectarBase();
ResultSet rs = bd.sentencia.executeQuery("SELECT * FROM... | 5 |
public void render() {
if(blocksBackground != null){
for(int x = 0; x < blocksBackground.length; x++){
for(int y = 0; y < blocksBackground[x].length; y++){
if(blocksBackground[x][y] != null){
blocksBackground[x][y].render();
}
}
}
}
if(blocksForeground != null){
for(int x =... | 9 |
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 fe... | 6 |
@Override
public Case getCaseForIA(Joueur joueurAdverse) {
Random rand = new Random();
Case caseTouchee;
int x = rand.nextInt(this._parametre.getNbCaseX());
int y = rand.nextInt(this._parametre.getNbCaseY());
while (((Case) (joueurAdverse.getCases().get(x + y * this._parametr... | 2 |
public Map<String, TestScript> getTestScripts() throws Exception{
File[] scriptFiles = this.file.getTestScripts();
Map<String, TestScript> allScripts = new HashMap<String, TestScript>();
for(File script : scriptFiles){
ExcelReader reader = new ExcelReader(script);
ExcelModel excel = reader.loadExcel();
L... | 8 |
public void definirTerrain(int[][] je){
if (jeu.length != je.length && jeu[0].length != je[0].length)
throw new TailleErreur();
for (int i = 0; i<je.length; i++){
for (int j=0; j<je[0].length; j++){
jeu[i][j]=je[i][j];
}
}
} | 4 |
public void campaign2Clicked()
{
WindowStack ws = WindowStack.getLastInstance();
System.out.println(ws);
if (ws != null) {
WindowCampaign campaign = new WindowCampaign(2);
ws.push(campaign);
}
} | 1 |
private void select(){
switch(currentChoice){
case 0:
if(!glitches)glitches = true;
else glitches = false;
Player.setGlitch(glitches);
System.out.println(glitches);
System.out.println("2: "+ Player.isGlitch());
break;
case 1:
gsm.setState(GameStateManager.OPTIONSSTATE);
break;
case 2:
... | 6 |
public static File getFileChoice(Component owner, String defaultPath,
FileFilter filter, String title) {
//
// There is apparently a bug in the native Windows FileSystem class that
// occurs when you use a file chooser and there is a security manager
... | 5 |
public static void main( String [ ] args )
{
int numItems = 10000;
BinomialQueue<Integer> h = new BinomialQueue<>( );
BinomialQueue<Integer> h1 = new BinomialQueue<>( );
int i = 37;
System.out.println( "Starting check." );
for( i = 37; i != 0; i = ( i + 37 ) % numItems )
if( i... | 4 |
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Product product = (Product) o;
if (!productCode.equals(product.productCode)) return false;
return true;
} | 4 |
public String getColumnName(int column) {
if (column == 0)
return " ";
if (column == terminals.length + 1)
return "$";
return terminals[column - 1];
} | 2 |
public void create(String path) {
// Set base url to the Wiki URL (for images that we didn't catch, etc.)
prince.setBaseURL(config.getBaseUrl());
File output = new File(path).getAbsoluteFile();
File temp = new File(path + ".pdf").getAbsoluteFile();
if(!output.getParentFile().exists())
output.getParentFi... | 4 |
private int evalState(State s, State ls) {
//attack + defense
int weight[] = {4,4,3};
int atk = weight[0]*attack(s,ls);
int def = weight[1]*defense(s);
int diff = weight[2]*difference(s);
int score = atk + def + diff;
//System.out.println("Attack = "+atk+" | Defense = "+def+" Difference = "+diff+... | 1 |
protected Integer calcBPB_FATSz16() throws UnsupportedEncodingException {
byte[] bTemp = new byte[2];
for (int i = 22;i < 24; i++) {
bTemp[i-22] = imageBytes[i];
}
BPB_FATSz16 = byteArrayToInt(bTemp);
System.out.println(BPB_FATSz16);
return BPB_FATSz16;
} | 1 |
public void encode(String message) throws IOException {
char[] msgChars = message.toCharArray();
for(int i = 0; i < this.width; i++) {
if(i < message.length()) {
this.picture.setRGB(i, 0, (int) msgChars[i]);
} else {
this.picture.setRGB(i, 0, 0); // Set to nothing
}
}
if(this.filename.getAbsol... | 3 |
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Board other = (Board) obj;
if (this.boardHeight != other.boardHeight) {
return false;
... | 9 |
public boolean isValidMove(int startCol, int startRow, int endCol, int endRow)
{
//Works
return ((startRow == endRow && Math.abs(startCol - endCol) <= 1) || (startCol == endCol && Math.abs(startRow - endRow) <= 1) ||
(endCol != startCol && startRow != endRow && ((Math.abs(startRow - endRow) == 1 && Math.abs(s... | 7 |
public int getScoreEndGame(BufferedImage screenshot) {
// crop score image
BufferedImage scoreImage = screenshot.getSubimage(370, 265, 100, 32);
// transform template images into black-white format
BufferedImage[] endGameNumberTemplates = { extractNumber(_endGame0),
extractNumber(_endGame1), ext... | 7 |
private boolean jj_3_55() {
if (jj_scan_token(POINT)) return true;
if (jj_3R_72()) return true;
return false;
} | 2 |
@Override
public boolean executeMouvement() {
Carte carte = null;
int x=0,y=0;
if (Carte.isCreated()){
carte = Carte.getInstance(0, 0, 0, null);
}
if (carte!=null){
x= chevalier.getPositionX();
y=chevalier.getPositionY();
carte.getCartePanel().deplacementPossible(chevalier);
while ((cheva... | 5 |
public void save() {
if (ChristmasCrashers.isDebugModeEnabled())
System.out.println("Saving level " + ID + " in world " + worldID + ".");
File dataFile = new File(getDiskLocation());
if (!dataFile.exists()) {
System.out.println("Data file for level " + ID + " in world " + worldID + " does not exist - creati... | 8 |
synchronized public void terminate() {
gameThread.setMessage(TERMINATE_MESSAGE);
notify();
gameThread.doDelay(25);
board = null;
} | 0 |
public void skillCheck(String attribute, int skill,
int difficulty) {
Result r = Dice.contest(skill, difficulty);
while (r.equals(Result.TIE)) {
r = Dice.contest(skill, difficulty);
}
if (r.equals(Result.FAILURE)) {
switch (attribute) {
case "stamina":
pc.increaseStat(AbilityType.STAM... | 9 |
public boolean canStart() {
return !(isStarted || preStart);
} | 1 |
private void injectObject() {
for(BeanDefinition beanDefinition : beanDefines){
Object bean = sigletons.get(beanDefinition.getId());
if(bean!=null){
try {
PropertyDescriptor[] ps = Introspector.getBeanInfo(bean.getClass()).getPropertyDescriptors();
for(PropertyDefinition propertyDefinition : beanD... | 9 |
private void stopPosition() {
StreamsterApiInterfaceProxy proxy = new StreamsterApiInterfaceProxy();
Position[] positions = new Position[0];
try {
positions = proxy.getPositions();
} catch (RemoteException ex) {
Logger.getLogger(JobTradeUpGBPJPY.class.getName()).l... | 6 |
public void addTile(Tile tile) {
//Si la pioche a ete verrouillee
if (isClose)
return ;
//Si il s'agit d'une pioche ouverte
if (isOpen && tile != null) {
JLabel tmp = new JLabel(tile.getIcon());
tmp.addMouseListener(this);
this.tileList.put( tile.getType(), tmp);
}
//Apparence de la pioche... | 5 |
private DetachedCriteria makeCriteria(Map<String, Object> condition) {
DetachedCriteria criteria = DetachedCriteria.forClass(Class.class);
if (condition == null) {
return criteria;
}
criteria.createAlias("grade", "g");
criteria.createAlias("g.specialty", "s");
... | 5 |
public PrimitiveUndoableMove(CompoundUndoableMove undoable, Node node, int index, int targetIndex) {
this.undoable = undoable;
this.node = node;
this.index = index;
this.targetIndex = targetIndex;
} | 0 |
public void die()
{
xDeathPos = (int) x;
yDeathPos = (int) y;
world.paused = true;
deathTime = 1;
Art.stopMusic();
world.sound.play(Art.samples[Art.SAMPLE_MARIO_DEATH], this, 1, 1, 1);
if(world.recorder != null){
if(running)
world.recorde... | 8 |
private void checkMaxFlow(long vID, IAIGraph yolo) {
// die drei beispielgraphen sind so gebaut, dass
// der maximale flow bei graph 9 und graph 20
// daran ueberprueft werden kann, ob alle von der Quelle
// ausgehende Kanten voll ausgeschoepft sind
// unser graph 21 wurde so gebaut, dass er mit eiem sc... | 3 |
public void drawRadar(FrameBuffer buffer, Car car) {
float xf=0;
float zf=0;
SimpleVector carPos=car.getTransformedCenter();
SimpleVector temp=new SimpleVector();
float rot=car.getDirection();
float dx=(float) buffer.getOutputWidth()/10f;
float dy=(float) buffer.getOutputHeigh... | 6 |
private void scrollAndAnimateBy(int increment) {
if (scrollerTimer == null || !scrollerTimer.isRunning()) {
int index = itemIndex + increment;
if (index < 0) {
index = 0;
} else if (index >= dataModel.getSize()) {
index = dataModel.getSize() - ... | 9 |
public void updateStockPrices() throws Exception{
PreparedStatement ps = null;
ResultSet rs = null;
List<String> tickers = new ArrayList<String>();
boolean oldAutoCommitState = con.getAutoCommit();
con.setAutoCommit(false);
//Gets List of Stock Tickers
try {
ps = _preparedSta... | 5 |
public void editCard()
{
if (selectedCard != null)
{
if (selectedCard instanceof HeroFrontCard)
{
frame.newWindow(CreatorFrame.FILE_NEW_HERO_FRONT, selectedCard);
}
if (selectedCard instanceof HeroBackCard)
{
frame.newWindow(CreatorFrame.FILE_NEW_HERO_BACK, selectedCard);
}
if ... | 8 |
private static Properties loadProperties() throws Exception {
InputStream stream = Version.class.getResourceAsStream(POM_PATH);
Properties props = new Properties();
try {
props.load(stream);
return props;
} catch (Exception ex) {
throw ex;
}
... | 1 |
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Salle other = (Salle) obj;
if (this.id != other.id) {
return false;
}
if ((th... | 7 |
public BufferedImage renderPrepared(int px, int pz, int sx, int sz, double min, double max)
{
BufferedImage res = new BufferedImage(sx, sz, BufferedImage.TYPE_INT_RGB);
double[] data = get2DData(px, pz, sx, sz);
for(int x = 0; x < sx; x++)
for(int z = 0; z < sz; z++)
... | 4 |
private void setTransform(boolean slide) {
if(slide) {
slideTransform.x = getBounds().getX();
slideTransform.y = getBounds().getY();
} else {
slideTransform.x = (getBounds().getX() + (getBounds().getWidth() * value) - (SpriteList.get(sliderKnob).getWidth() / 2f));
slideTransform.y = getBounds().getY();
... | 1 |
public static void main(String[] args) {
if (args.length <= 0) {
System.out.println("At least one arg (pebbler project) must be" +
"specified");
}
// Quarter-assed flag parsing.
String projectFileName = args[0];
String nextFlag = args.length > 1 ? args[1] : "";
boolean createBoo... | 6 |
@Override
protected MultiLevelCache getCurrentLevelCache(String poolName) {
String upperCase = poolName.toUpperCase();
SockIOPool pool = SockIOPool.getInstance(upperCase);
if (!pool.isInitialized()) {
try {
initializePool(pool);
} catch (Exception e) {
throw new CacheUnreachableException("创建Memcach... | 2 |
private String[] findLinks(String pageHTML, String currentPageURL){
System.err.println("FindLinks : " + pageHTML);
ArrayList<String>links = new ArrayList<String>();
//imgur has changed their html classes, we'll use this to make changes easier
String postDelimiter = "id=\"imagelist";
if(pageHTML.contains... | 7 |
public void drawTrade(Graphics g)
{
g.setColor(new Color(255,126,0,200));
g.fillRect(0,0,getWidth(),getHeight());
g.setFont(new Font("Sanserif",Font.BOLD,18));
g.setColor(Color.WHITE);
g.drawString("You",50,70);
try
{
for(int i=0; i<partyPokemon.length; i++)
{
if(partyPokemon[i]!=null)
g.... | 9 |
private static void handle(String argument) {
System.out.println("Handling '" + argument + "':");
Path path = Paths.get(argument);
if (!Files.exists(path)) {
System.out.println("The file '" + path + "' does not exist.");
return;
}
Element diagram;
try (XMLParser parser = new XMLParser(path)) {
... | 4 |
public JSONWriter key(String string) throws JSONException {
if (string == null) {
throw new JSONException("Null key.");
}
if (this.mode == 'k') {
try {
this.stack[this.top - 1].putOnce(string, Boolean.TRUE);
if (this.comma) {
... | 4 |
public void append(String msg) {
if (win==true){textarea.append(msg+"\n");}
else{System.out.println(msg);}
} | 1 |
@Override
public Tile getTile() {
return tile;
} | 0 |
public AnswerCombination getAnswerCombinationFromGameMaster(Combination<Colors> attempt) {
return master.answer(attempt);
} | 0 |
@Test
public void testSerialization() throws IOException{
ByteArrayOutputStream byteOutput = new ByteArrayOutputStream();
ObjectOutputStream objOutput = new ObjectOutputStream(byteOutput);
objOutput.writeObject(alan);
objOutput.close();
ObjectInputStream objInput = new ObjectInputStream(new ByteArrayInputStr... | 1 |
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.