text stringlengths 14 410k | label int32 0 9 |
|---|---|
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
String line = "";
StringBuilder out = new StringBuilder();
BigDecimal a, b;
String[] w;
do {
line = in.readLine();
if (line == null || line.length() == 0)
break;
... | 9 |
public void msgMenu()
{
System.out.println("0.Sair");
System.out.println("1. Criar uma nova conta");
System.out.println("2. Depositar na conta");
System.out.println("3. Sacar da conta");
System.out.println("4. Consultar o saldo");
System.out.println("5. Cadastrar clie... | 0 |
@DELETE
@Path("delete/personne/{id}")
public String deleteById(@PathParam("id") String arg0) {
System.out.println("bien appelé ");
EntityManager manager = SingletonManager.getManager();
EntityTransaction t = manager.getTransaction();
t.begin();
String res = "nok";
try
{
Personne p = manager.find(Pers... | 9 |
@Override
public void drawCell(Outline outline, Graphics gc, Rectangle bounds, Row row, Column column, boolean selected, boolean active) {
if (row != null) {
StdImage image = getIcon(row, column, selected, active);
if (image != null) {
int x = bounds.x;
int y = bounds.y;
if (mHAlignment != SwingC... | 6 |
public JPanel getPWResetBtnChangesMenu() {
if (!isInitialized()) {
IllegalStateException e = new IllegalStateException("Call init first!");
throw e;
}
return this.pwResetBtnPanel;
} | 1 |
public Token determineToken(String st)
{
Token tok = new Token();
tok.setValue(st);
if (st.equals("("))
{
tok.setType(Token.TokenType.L_PAREN);
}
else if (st.equals(")"))
{
tok.setType(Token.TokenType.R_PAREN);
}
else if (Character.isDigit(st.ch... | 4 |
public FrameAddArraysData getDataWindow(){
return dataWindow;
} | 0 |
public static <T> T getTrackObjectAt(World world, int x, int y, int z, Class<T> type) {
TileEntity tile = world.getTileEntity(x, y, z);
if (tile == null)
return null;
if (type.isInstance(tile))
return (T) tile;
if (tile instanceof ITrackTile) {
ITrackI... | 4 |
public void signOut() throws SocketTimeoutException {
try {
clientSocket.Escribir("SALIR\n");
serverAnswer = clientSocket.Leer();
} catch (IOException e) {
throw new SocketTimeoutException();
}
System.out.println(serverAnswer);
} | 1 |
public void setRecursiveNotDirty()
{
super.setRecursiveNotDirty();
this.isAltitudeModeDirty = false;
if(this.location!=null && this.location.isDirty())
{
this.location.setRecursiveNotDirty();
}
if(this.orientation!=null && this.orientation.isDirty())
... | 8 |
public BufferedImage thresholdTransform(BufferedImage image,double threshold, int grayValue){
if(image == null){
return null;
}
int width = image.getWidth();
int height = image.getHeight();
//calculate color as RGB integer
int color = (grayValue << 16) | (grayValue << 8) | grayValue;
... | 8 |
@Override
public void onStop() {
try {
String user = Base64.encode(Environment.getDisplayName());
String timerun = Base64.encode(Long.toString((System.currentTimeMillis() - startTime)));
String profits = Base64.encode(Integer.toString(profit));
String killed = Base64.encode(Integer.toString(killCount)); ... | 5 |
@Override
public void execute() {
Map<String, Ban> bans = plugin.getController().getBans();
Player receiver = getReceiver();
// prepare values
HashMap<String, String> values = new HashMap<String, String>(2);
values.put("{amount}", String.valueOf(bans.size()));
// pu... | 2 |
@Override
public int hashCode() {
int result = id != null ? id.hashCode() : 0;
result = 31 * result + (email != null ? email.hashCode() : 0);
result = 31 * result + (name != null ? name.hashCode() : 0);
result = 31 * result + (surname != null ? surname.hashCode() : 0);
result... | 6 |
public MyCoastLines() {
String[][] coastLineArray = getCoastLineArray();
utmPoints = new MyUTMPoint[coastLineArray.length][];
for(int i = 0; i < coastLineArray.length; i++) {
utmPoints[i] = new MyUTMPoint[coastLineArray[i].length];
for(int j = 0; j < utmPoints[i].length ; j++) {
if(coastLineArray[i][j] ... | 4 |
public ConsoleListener(TotalPermissions p) {
plugin = p;
} | 0 |
public String getSaleid() {
return this.saleid;
} | 0 |
public static String getClean(String sport) {
if(sport!=null) {
List<Sport> sports = getAllSport();
for(Sport sp : sports) {
if(sp.name!=null && sp.name.compareTo(sport)==0)
return sp.getCleanName();
}
}
return null;
} | 4 |
public void saveConfig()
{
if (config == null || configFile == null)
return;
try
{
config.save(configFile);
} catch (IOException ex)
{
plugin.getLogger().log(Level.SEVERE, "Could not save data to " + configFile, ex);
}
} | 3 |
public static void main( String[] args ) throws java.io.FileNotFoundException, IOException
{
try{
String testFile;
if( args.length != 0 ){
testFile = args[0];
}
else{
testFile = "klein-programs\\tests02-parser\\08-print.kln";
}
SemanticAnalyzer analyzer;
S... | 3 |
public List findByAuther(Object auther) {
return findByProperty(AUTHER, auther);
} | 0 |
private void statementDecl() {
next(); // To check for all of the types
// if we've got modifiers, always do it...
// Other conditions: ident + [] or ident + ident
if (_token == TK_IDENT && (_defining || _nexttoken == TK_BRACKETS || _nexttoken == TK_IDENT)) {
// if ((_defining || _token == TK_IDENT) && (_next... | 6 |
private Nodo seleccion() {
ArrayList<Nodo> lis;
Nodo tem = new Nodo("if", Nodo.tipoToken.PalabraReservada);
if (aux.getTipo()==Nodo.tipoToken.ParentesisIzquierdo) {
aux=(Tokens2)tok.next();
} else {
error("Se esperaba (");
}
Nodo temR = new Nodo("C... | 8 |
public void setIcon() {
this.setIcon(this.imgIcon);
} | 0 |
@Override
public void run() {
if (binary) {
// Sanity check
if (lineFilter != null) throw new RuntimeException("Cannot apply line filter to binary output.");
runBinGobbler();
} else {
runLineGobbler();
}
} | 2 |
public void update () {
String path = null;
try {
path = new File(LaunchFrame.class.getProtectionDomain().getCodeSource().getLocation().getPath()).getCanonicalPath();
path = URLDecoder.decode(path, "UTF-8");
Logger.logDebug("Launcher Install path: " + path);//we need ... | 7 |
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Couleur other = (Couleur) obj;
if (this.id != other.id) {
return false;
}
if ... | 5 |
public boolean start() {
synchronized (optOutLock) {
// Did we opt out?
if (isOptOut()) {
return false;
}
// Is metrics already running?
if (taskId >= 0) {
return true;
}
// Begin hitting the se... | 5 |
private void createCScore() throws YouFailException{
//C: (4*examScore + 13.2) of all wESubjects and oESubject
//13.2
int tempScore = 0;
for(Subject thisWESubject:wESubjects){
tempScore += 4 * thisWESubject.abinote;
tempScore += thisWESubject.semesters[3].mark;
... | 5 |
public String toString() {
if (m_Instances == null) {
return "Bayesian logistic regression: No model built yet.";
}
StringBuffer buf = new StringBuffer();
String text = "";
switch (HyperparameterSelection) {
case 1:
text = "Norm-Based Hyperparameter Selection: ";
break;
... | 7 |
private void activarServiciosDeProveedor(LinkedList<Servicio> servicio) {
//Como estamos usando Singleton, entonces los cambios que se hagan aquí se conservarán:
VtnAgrega_oModificaProveedor vtnModificaProveedor = VtnAgrega_oModificaProveedor.getInstanciaVtnAgregaoModificaProveedor();
for (Serv... | 6 |
public void resetData(double[] x, double[] y){
this.nPoints = this.nPointsOriginal;
if(x.length!=y.length)throw new IllegalArgumentException("Arrays x and y are of different length");
if(this.nPoints!=x.length)throw new IllegalArgumentException("Original array length not matched by new array ... | 3 |
public static void main(String[] args) throws Exception
{
String str = "hello world wolcome nihao hehe";
char[] buffer = new char[str.length()];
str.getChars(0, str.length(), buffer, 0);
FileWriter f = new FileWriter("FileWriteOutFile.txt");
for(int i=0; i < buffer.length;i ++)
{
f.write(bu... | 1 |
public FactoryOfPlaysForCpuForPiece (Position position, Player cpu,int largestCapture){
loadPlays(position,cpu,largestCapture);
} | 0 |
public static void main(String[] args) {
// TODO Auto-generated method stub
ArrayList<Integer> m=new ArrayList<Integer>();
Scanner in=new Scanner(System.in);
int sum=0;
int n=in.nextInt();
long mint=in.nextLong();
for(int i=0;i<mint;i++){
m.add(in.nextInt());
}
... | 6 |
public void paintComponent (Graphics g)
{
super.paintComponent(g);
g.setColor(Color.BLACK);
x1 = (int)(CONSTANT_A*X_DIM);//determining the location to draw the outline of the calendar
y1 = (int)(CONSTANT_B*Y_DIM);
boxWidth = (int)(CONSTANT_C*X_DIM);//determining the dimensions of the box
int boxHeight ... | 9 |
public void deleteService(String id) {
long tempid = Long.parseLong(id);
Query q = em.createQuery("SELECT t from ServiceEntity t");
for (Object o : q.getResultList()) {
ServiceEntity p = (ServiceEntity) o;
if (p.getId() == tempid) {
p.setRooms(null);
... | 2 |
public static List<Point> getPointsOnLine (LineEquation line)
{
List<Point> ps = new ArrayList<Point>();
// x = ay + b
if (line.isX())
{
double y1 = line.getStart().y;
double y2 = line.getEnd().y;
if (line.getStart().y > line.getEnd().y) {
y1 = line.getEnd().y;
y2 = line.getS... | 4 |
@Override
public synchronized void start() {
if (D) Log.d(TAG, "start");
// Cancel any thread attempting to make a connection
for (ConnectThread ct : connectionAttempts.values()) ct.cancel();
connectionAttempts.clear();
// Cancel any thread currently running a connection
... | 5 |
@Override
public void run() {
while (true) {
if (pool != null) {
writer.println(System.currentTimeMillis() + ","
+ waitingJobs.size() + "," + runningJobs.size() + ","
+ pool.inUseVMCount() + "," + pool.availableVMCount());
writer.flush();
}
try {
Thread.sleep(1000);
} catch (Inter... | 3 |
public void debugPrint(){
System.out.println("Sentences:");
Iterator<String[]> it = sentences.iterator();
while(it.hasNext()){
String[] sentence = it.next();
for(int i = 0; i < sentence.length; i++){
System.out.print(sentence[i]);
System.out.print(" ");
}
System.out.println();
}
} | 2 |
public void permutations(int[] num){
if(list.size() == length){
result.add(new ArrayList<Integer>(list));
return;
}
for(int i = 0; i< length;i++){
if(flag[i])
continue;
if(i > 0 && num[i] == num[i-1] && !flag[i-1])
c... | 6 |
public Component getTreeCellRendererComponent(JTree tree, Object value,
boolean sel,
boolean expanded,
boolean leaf, int row,
... | 3 |
public boolean leave()
{
return false;
} | 0 |
void initInputFrame(final ClassWriter cw, final int access,
final Type[] args, final int maxLocals) {
inputLocals = new int[maxLocals];
inputStack = new int[0];
int i = 0;
if ((access & Opcodes.ACC_STATIC) == 0) {
if ((access & MethodWriter.ACC_CONSTRUCTOR) == 0) {
inputLocals[i++] = OBJECT | cw.addTy... | 6 |
public static long kadane(long[] comp) {
long sum = 0, max = 0;
int startRow = 0;
for (int i = 0; i < m.length; i++) {
sum += comp[i];
if (sum != 0) {
sum = 0;
startRow = i + 1;
} else if (max < i - startRow + 1)
max = i - startRow + 1;
max = Math.max(max, comp[i] == 0 ? 1 : 0);
}
retu... | 4 |
@SuppressWarnings("deprecation")
@EventHandler
public void onPlayerInteractBlock(PlayerInteractEvent event)
{
if(event.getPlayer().hasPermission("skeptermod.useitem.godsword") || (event.getPlayer().isOp()))
{
if(event.getPlayer().getItemInHand().getTypeId() == Material.IRON_SWORD.getId() && event.getPlayer().... | 7 |
public void scaleDown(){
switch (polygonPaint) {
case 0:
line.ScaleDown();
repaint();
break;
case 1:
curv.ScaleDown();
repai... | 7 |
public void visit_arraylength(final Instruction inst) {
stackHeight -= 1;
if (stackHeight < minStackHeight) {
minStackHeight = stackHeight;
}
stackHeight += 1;
} | 1 |
public boolean equals(Object o)
{
if (!(o instanceof CompressedGameBoard))
return false;
CompressedGameBoard b = (CompressedGameBoard) o;
return b.fst2c == fst2c && b.snd2c == snd2c && b.trd2c == trd2c && b.lst2c == lst2c && b.flags == flags;
} | 5 |
protected void addFollowerDependent(PhysicalAgent P, PairList<PhysicalAgent,String> list, String parent)
{
if(P==null)
return;
if(list.contains(P))
return;
if((P instanceof MOB)
&&((!((MOB)P).isMonster())||(((MOB)P).isPossessing())))
return;
CMLib.catalog().updateCatalogIntegrity(P);
final String ... | 9 |
private JSONWriter append(String string) throws JSONException {
if (string == null) {
throw new JSONException("Null pointer");
}
if (this.mode == 'o' || this.mode == 'a') {
try {
if (this.comma && this.mode == 'a') {
this.writer.write('... | 7 |
public void copie(HDD dirSource, HDD dirDest)
{
// on copie chaque fichier de source dans dest
// s'il existe dans dest, on teste la date de modification de fichier
// afin de copier uniquement les fichiers mofifiés
String nomficSRC;
String nomficDST;
File folder=new File(dirSource.getPath());
File[] fil... | 8 |
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.setContentType("text/html");
Cookie[] cookies = request.getCookies();
if (cookies != null) {
for (Cookie cookie : cookies) {
if (cookie.getN... | 4 |
private OpenResult openKey(String key, Integer accessType) {
if (METHOD_OPEN_KEY == null) {
METHOD_OPEN_KEY = getMethod(mRoot.getClass(), "WindowsRegOpenKey", int.class, byte[].class, int.class);
}
try {
return new OpenResult((int[]) METHOD_OPEN_KEY.invoke(mRoot, new Object[] { mRootKey, toCstr(key), access... | 2 |
protected void carregaTabelaTelefones(List<Telefone> lista){
this.modeloTabelaTelefone = new DefaultTableModel();
this.modeloTabelaTelefone.addColumn("DDD");
this.modeloTabelaTelefone.addColumn("Numero");
for(Telefone t : lista){
Vector v = new Vector();
... | 1 |
public PrimitiveUndoableCommentChange(Node node, int oldState, int newState) {
this.node = node;
this.oldState = oldState;
this.newState = newState;
} | 0 |
public Node removeDup(Node head) {
if (head == null) {
return null;
}
Node p = head;
while (p.next != null) {
Node q = p;
while (q.next != null) {
if (p.data == q.next.data) {
deleteNextNode(q);
}
q = q.next;
}
p = p.next;
}
return head;
} | 4 |
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
/** It can happen that the field is already filled in. So, there are 3 options:
* 1.- Empty
* 2.- Absolute Path
* 3.- Relative path to the genfit_sas home: jgui_examples/cur... | 7 |
@Override
public BufferedImage getObject(String name, Map<String, String> data) {
// If a cache of this object already exists, return it
if (cache.containsKey(name)) {
return cache.get(name);
}
// Load the image if there is no cache of it
BufferedImage loadedImage = FileManager.loadImage(data.get("fileLo... | 1 |
void initLabyrinthe(){
ArrayList<Arete> liste;
int j;
boolean flag;
sommets.add(aretes.get(0).s1);
for(int i=1;i<DIM*DIM;i++){
liste = selectAretes();
j=0;
flag = false;
while (!flag){
if (!sommets.contains(liste.get(j).s1)){
sommets.add(liste.get(j).s1);
flag = true;
}
else ... | 4 |
public static void getRatios(Unsigned m, Unsigned n, Unsigned t,
File fout, Unsigned xOver) {
BigInt.setRandSeed(1231538606138l);
int pairs = m.intValue();
double[] ratios = new double[t.intValue()];
for(int j = 1; j <= t.intValue(); j++) {
// generate m pairs of BigInts of length n*t
... | 7 |
public WaitingForOpponentDialog(Game game) {
this.game = game;
this.setLayout(new BorderLayout());
this.setModal(false);
this.setLocationRelativeTo(this.game.window.board);
this.setUndecorated(true);
this.setAlwaysOnTop(true);
this.setModal(true);
this.label.setBorder(BorderFactory.createEmptyBo... | 0 |
public boolean renderPistonExtension(Block par1Block, int par2, int par3, int par4, boolean par5)
{
int var6 = this.blockAccess.getBlockMetadata(par2, par3, par4);
int var7 = BlockPistonExtension.getDirectionMeta(var6);
float var8 = par1Block.getBlockBrightness(this.blockAccess, par2, par3, ... | 8 |
private static EnumOS getOs() {
String s = System.getProperty("os.name").toLowerCase();
if (s.contains("win")) {
return EnumOS.windows;
}
if (s.contains("mac")) {
return EnumOS.macos;
}
if (s.contains("solaris")) {
return EnumOS.solaris;
}
if (s.contains("sunos")) {
return EnumOS.solaris... | 6 |
public AstarSP(EdgeWeightedDigraph G, int s, int t) {
for (DirectedEdge e : G.edges()) {
if (e.weight() < 0)
throw new IllegalArgumentException("edge " + e + " has negative weight");
}
distTo = new double[G.V()];
edgeTo = new DirectedEdge[G.V()];
x = ... | 6 |
public Vector getRayIntersection(Edge ray) {
double closestDistance = Double.MAX_VALUE;
Vector closest = null;
double distance;
List<Vector> intersections;
Polygon polygon = new Polygon(new Vector(0, 0), new Vector(Tile.SIZE, 0), new Vector(Tile.SIZE, Tile.SIZE), new Vector(0, Tile.SIZE));
for(int i = 0; i ... | 6 |
@Override
public void run(){
while(true){
if (messageQueue.size() > 0){
pullStack();
}
}
} | 2 |
private TextLayout zoomTextLayout(TextLayout layout) {
TextLayout zoomed = new TextLayout(Display.getCurrent());
zoomed.setText(layout.getText());
int zoomWidth = -1;
if (layout.getWidth() != -1)
zoomWidth = ((int) (layout.getWidth() * zoom));
if (zoomWidth < -1 || zoomWidth == 0)
return null;
zoo... | 8 |
@Override
public void keyTyped(KeyEvent e) {
if ((e.getModifiersEx() & InputEvent.CTRL_DOWN_MASK) != 0) {
return;
}
char c = e.getKeyChar();
if (c == KeyEvent.VK_BACK_SPACE) {
return;
}
// TODO: This statement used to check \\v and \\t as well, but it was causing ... | 5 |
public void laheta(Palaute p) throws DAOPoikkeus {
try {
PalauteDAO dao = new PalauteDAO();
dao.tallennaPalaute(p);
} catch (DAOPoikkeus e) {
}
} | 1 |
public static File selectFileFromDialog(Component parent, String startPath, boolean showAllFiles) {
if (startPath == null || parent == null) {
throw new IllegalArgumentException("The arguments may not be null.");
}
LookAndFeel originalLookAndFeel = UIManager.getLookAndFeel();
... | 6 |
@Override
public Connection getConnection() throws DatabaseManagerException {
DataSource dataSource = getDbSource();
if(dataSource == null) {
throw new DatabaseManagerException("<connection> No Datasource. Cannot get a connection.");
}
try {
return dataSource.getConnection();
} catch (SQLException e) ... | 2 |
@Override
protected Void doInBackground() throws Exception {
List<ScriptInfo> locals = new ArrayList<ScriptInfo>();
ScriptClassLoader.loadLocal(locals, new File(Configuration.COMPILED_DIR));
for (ScriptInfo si : locals) {
firePropertyChange("script", null, si);
}
final List<ScriptInfo> defi... | 5 |
public String getDriver() {
if ( this.driver == null )
return "";
return driver;
} | 1 |
private void calculateG(AStarNode checkNode) {
int parentX = checkNode.getParent().getxCoord();
int parentY = checkNode.getParent().getyCoord();
int xCoord = checkNode.getxCoord();
int yCoord = checkNode.getyCoord();
if ((yCoord - 1 == parentY && xCoord == parentX)
|| (yCoord + 1 == parentY && xCoord == ... | 8 |
private void assertShallowTraceMatches(final Task<?> task, final Trace trace)
{
assertEquals(task.getName(), trace.getName());
assertEquals(ResultType.fromTask(task), trace.getResultType());
assertEquals(task.getShallowTrace().getStartNanos(), trace.getStartNanos());
// If the task has not been start... | 8 |
public String toString() {
StringBuilder sb = new StringBuilder();
for (Card card : this) {
sb.append(card.toString());
}
return sb.toString();
} | 1 |
public void setTicketStatus(String ticketStatus) {
this.ticketStatus = ticketStatus;
} | 0 |
@Override
public boolean onCommand(CommandSender cs, Command cmd, String s, String[] args) {
if (cmd.getName().equalsIgnoreCase("ircmessage")) {
if (!cs.hasPermission("royalirc.ircmessage")) {
RUtils.dispNoPerms(cs);
return true;
}
if (args... | 8 |
@Override
public IMatrix add(IMatrix other) {
//ako nisu jednake dimenzije, vrati iznimku
if (this.getColsCount() != other.getColsCount()
|| this.getRowsCount() != other.getRowsCount()) {
throw new IncompatibleOperandException(
"Matrices have not same dimensions.");
}
for (int row = 0; row < this.... | 4 |
public void getResultDP(int[][] mat) {
int n = mat.length;
int k = 1 << n;
int[][] f = new int[n + 1][1 << n];
for (int i = 0; i < n; ++i) {
for (int b = 0; b < (1 << n); ++b) {
for (int j = 0; j < n; ++j) {
int kk = (b >> j);
... | 4 |
@Override
public void update(int delta) {
super.update(delta);
setMoving(false);
if (Engine.isInputDown(Controls.MOVE_UP) && getCollidingEntity(Globals.DIRECTION_UP) == null) {
moveY(true);
}
else if (Engin... | 8 |
public static String getNameFromId(int figureId) {
String figureName = null;
switch (figureId) {
case Figure.FIGURE_ID_I:
figureName = "FigureI";
break;
case Figure.FIGURE_ID_T:
figureName = "FigureT";
break;
case Figure.FIGURE_ID_O:
figureName = "FigureO";
break;
case Figure.FIGURE_... | 7 |
@Override
public boolean _equals(DbData other)
{
List<DbRow> rows1 = this.getRow();
List<DbRow> rows2 = other.getRow();
if (rows1.size() != rows2.size()) {
return false;
}
for (int i = 0, len = rows1.size(); i < len; ++i) {
if (!rows1.get(i).equals... | 3 |
public void pan(int direction) {
GCThread.increaseGCFlag(5);
switch(direction) {
case 1:
double newUpperLeftY = upperLeftY+(utmHeight*0.1);
if(newUpperLeftY >= 6412239)
newUpperLeftY = 6412239;
zoom(upperLeftX, newUpperLeftY, utmWidth, utmHeight, false, 0, 0, 0, 0);
break;
case 2:
double n... | 8 |
public User[] loadUsers(ChatChannel channel){
User[] users = null;
try {
Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
String url = "jdbc:derby:" + DBName;
Connection connection = DriverManager.getConnection(url);
Statement statement = connection.createStatement();
String sqlStatement = ... | 2 |
public String getOwnerName(){
return human.getName();
} | 0 |
@Override
public boolean okMessage(final Environmental myHost, final CMMsg msg)
{
if(!(myHost instanceof MOB))
return super.okMessage(myHost,msg);
final MOB myChar=(MOB)myHost;
if(!super.okMessage(myChar, msg))
return false;
if((msg.amITarget(myChar))
&&(msg.targetMinor()==CMMsg.TYP_DAMAGE)
&&(msg.... | 8 |
public void onAnswerSideChanged(AnswerSide answerSide)
{
if (answerSide == null)
{
removeSelection();
return;
}
switch (answerSide)
{
case LEFT:
selectSingleScorePanel(AnswerSide.LEFT);
break;
ca... | 3 |
private static int getRemoteVersion() {
URL url = null;
try {
url = new URL(SERVER_URL + "version.txt");
} catch (MalformedURLException e2) {
e2.printStackTrace();
}
try {
URLConnection urlConnection = url.openConnection();
urlConnection.setAllowUserInteraction(false);
InputStream urlStream = ... | 6 |
private Constructor filterConstructorsUnsafe(Constructor[] constructors, Class[] parameterTypes)
{
outside2:
for(Constructor c : constructors)
{
if(parameterTypes != null)
{
Class[] p = c.getParameterTypes();
if(p.length != parameterTypes.l... | 6 |
public void print(final String txt) {
log(txt);
} | 0 |
@Override
public void mouseDragged(MouseEvent e) {
//throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
if (e.getSource().equals(EditingPane))
{
long hereIAm = System.currentTimeMillis();
... | 4 |
public Tileset getTileset() {
return tileset;
} | 0 |
@Override
public void render() {
glEnable(GL_BLEND);
if (texture != null) {
RenderAssistant.bindTexture(texture);
if (!stackTexture) RenderAssistant.renderRect(x, y, width, height);
else {
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_... | 5 |
public void scalarDivide(double Denominator) {
for (Entry<Integer, Double> entry : this.getVector().entrySet()) {
entry.setValue(entry.getValue()/Denominator);
}
} | 1 |
@RequestMapping("/comprar/{producto}")
public ModelAndView comprar(@PathVariable String producto) {
Stock stock = Stock.getInstance();
Integer availableStock = stock.obtenerStockDisponible(producto);
ModelMap model = new ModelMap();
model.put("producto", producto);
model.put("stock", availableStock)... | 0 |
private void getUserInformation(){
if(userId!=null){
try {
ResultSet userInfo = dataBaseConnector.getUserInformation(userId);
userInfo.next();
scores = userInfo.getInt("scores");
money = userInfo.getInt("money");... | 7 |
public MapEditor() {
//set frame properties
setTitle("Map Editor");
setSize(PREFERRED_WIDTH, PREFERRED_HEIGHT);
setBackground(Color.gray);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);// Close when closed.For reals.
//set the content of the frame
try{
File file=new File("purdue-... | 9 |
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.