text stringlengths 14 410k | label int32 0 9 |
|---|---|
@Override
public Object getValueAt(int row, int column)
{
PeerStatEntry e = data.get(row);
switch(column)
{
case 0:
return e.ip;
case 1:
return e.path;
case 2:
return e.state;
case 3:
return formatByteCount(e.bytesIn);
... | 8 |
public String goToAdminOrdersList() {
this.retrieveAllOrders();
return "adminOrdersList";
} | 0 |
public String nextString() throws IOException {
int p = peeked;
if (p == PEEKED_NONE) {
p = doPeek();
}
String result;
if (p == PEEKED_UNQUOTED) {
result = nextUnquotedValue();
} else if (p == PEEKED_SINGLE_QUOTED) {
result = nextQuotedValue('\'');
} else if (p == PEEKED_DO... | 7 |
public char getNextChar() {
try {
//Leemos un caracter y seteamos a nuestra variable currentChar de objeto
setCurrentChar((char) pr.read());
//Sumamos 1 al caracter en la línea
setNumeroDeCaracterEnLinea(getNumeroDeCaracterEnLinea()+1);
... | 4 |
private void YearBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_YearBoxActionPerformed
int m = MonthBox.getSelectedIndex() + 1;
int y = YearBox.getSelectedIndex() + (Calendar.getInstance().get(Calendar.YEAR) - CountYears);
int n = m != 2 ? m > 7 ? 30... | 7 |
@Override
public Calisan getCalisan(HashMap<String, String> values) {
try {
String ad = values.get("ad");
String soyad = values.get("soyad");
String telefon = values.get("telefon");
String resimURL = values.get("resimURL");
String kullaniciAdi = va... | 5 |
@Override
public SpellCheckResult check(String word) {
for (int j = 0; j < wordsInDictionary.length; j++) {
if (word.compareTo(wordsInDictionary[j]) == 0) {
return new SpellCheckResult();
} else if (word.compareTo(wordsInDictionary[j]) < 0) {
if (j == ... | 4 |
public void execute(MapleClient c, MessageCallback mc, String[] splitted) throws Exception {
if (splitted[0].equalsIgnoreCase("-1")) {
String playerName = splitted[1];
Connection con = DatabaseConnection.getConnection();
PreparedStatement ps;
int done = 0;
... | 9 |
private static void handleSendOfferExceeded(SerializableOfferExceeded pack) {
List<String> sellers = pack.commandInfo;
SelectionKey key;
// reset list in pack (no longer needed)
pack.commandInfo = null;
// send "offer exceeded" packet to each seller still logged in
for (String seller : sellers) {
key... | 2 |
void passf3(int ido, int l1, final double cc[], double ch[], final double wtable[], int offset, int isign)
{
final double taur=-0.5;
final double taui=0.866025403784439;
int i, k, ac, ah;
double ci2, ci3, di2, di3, cr2, cr3, dr2, dr3, ti2, tr2;
int iw1, iw2;
... | 4 |
private void raiseAlarm()
{
if (TimerPreferences.getInstance().getBoolean("mute", false))
{
System.out.println("Beeping");
SwingUtilities.invokeLater(new Runnable()
{
@Override
public void run()
{
... | 5 |
@PUT
@Path("/{idres}")
@Consumes(MediaType.LIBROS_API_RESENA)
@Produces(MediaType.LIBROS_API_RESENA)
public Resena updateResena(@PathParam("idres") String idres, Resena resena, @PathParam("idlibro") String idlibro) {
String username;
Connection conn = null;
Statement stmt = null;
String sql;
ResultSet rs... | 7 |
public static void main(String[] args) {
Locale.setDefault(Locale.US);
Scanner s = new Scanner(System.in);
int valid = 0;
double sum = 0;
for(;;){
if(valid == 2){
System.out.println("novo calculo (1-sim 2-nao)");
double input = s... | 7 |
public final ExecResults executeImpl(ExecCommands newCommands) {
validateCommands(newCommands);
if (!isExecFinishedAndDisabled) {
// from robot to battle
commands.set(new ExecCommands(newCommands, true));
print(newCommands.getOutputText());
} else {
// slow down spammer
try {
Thread.sleep(100)... | 8 |
public void startServer() {
if (!isStarted) {
isStarted = true;
try {
AddressProvider.host();
} catch (IOException ex) {
System.err.println("SERVER: Could not connect to swe.no. Only LAN connections possible.");
}
try ... | 5 |
public void cerrarSocket() {
try {
socketConServidor.close();
} catch (IOException e) {
e.printStackTrace();
}
} | 1 |
private boolean saveToFile(String filePath) {
try {
FileOutputStream saveFile = new FileOutputStream(filePath);
ObjectOutputStream oos = new ObjectOutputStream(saveFile);
// BufferedOutputStream save = new BufferedOutputStream(oos);
oos.writeObject(bg.getPath());
... | 6 |
protected GenericConverter getDefaultConverter(Class<?> sourceType, Class<?> targetType) {
return (targetType.isAssignableFrom(sourceType) ? NO_OP_CONVERTER : null);
} | 3 |
@Override
public void initResources() {
initialScreen = true;
bossLoaded = false;
myBarrierGroup = new SpriteGroup("barrier");
myPlayerGroup = new SpriteGroup("player");
myEnemyGroup = new SpriteGroup("enemy");
myProjectileGroup = new SpriteGroup("projectile");
myEnemyProjectileGroup = new SpriteGroup("... | 8 |
public boolean insertaUsuario(String login, String pass, String nombre, String categoria) {
boolean res = false;
Statement statement;
ResultSet resultSet;
try {
Connection con = DriverManager.getConnection(connectString, user, password);
statement = con.createSta... | 2 |
void calculateInfluences(DetailedMovie detailedMovie, ArrayList<DetailedMovie> detailedMovieInfByList, ArrayList<DetailedMovie> detailedMovieInfList)
{
try
{
queryUtility.calculateInfluences(detailedMovie, detailedMovieInfByList, detailedMovieInfList);
}
catch (QueryEva... | 5 |
@Override
public boolean equals(Object obj) {
if (obj instanceof Cell) {
return isAlive == ((Cell) obj).isAlive();
} else {
return false;
}
} | 1 |
public List<Motorcycle> getAllMotorcycles()
{
List<Motorcycle> Motorcycles = new ArrayList<Motorcycle>();
try
{
ResultSet rs = getMotorcycleStmt.executeQuery();
while (rs.next())
{
Brand brand = null;
if (rs.getString("brand").equals("Honda"))
brand = Brand.Honda;
if (rs.getString("b... | 9 |
boolean setSpeed(int speed) {
if (speed < 0 || speed > 16)
return false;
this.speed = speed;
return true;
} | 2 |
@Override
public void startUp() {
if (waitingGameScreen == null) {
logger.error(new NullPointerException(),
Helpers.concat("Tried starting game without there being default game screen given.",
"Make sure to set it with setCurrentGameScreen(GameScreen gameScreen)"));
Runtime.getRuntime().exit(0xDEAD... | 6 |
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
buttonGroup1 = new javax.swing.ButtonGroup();
buttonGroup2 = new javax.swing.ButtonGroup();
jDialog1 = new javax.swing.JDialog();
... | 6 |
@Override
protected Expression unary() throws ParsingException {
Expression result;
if (tokens[position].equals(Lexeme.NOT.s)) {
position++;
result = new Not(unary());
return result;
}
if (tokens[position].equals(Lexeme.FOR_ALL.s)) {
po... | 9 |
public void verticalFill()
{
int assignTileInt = 0;
switch (tileSet)
{
case INDOORS:
assignTileInt = assignTileIntIndoors;
break;
case OUTDOORS:
assignTileInt = assignTileIntOutdoors;
break;
}
int tileNum = currentArea[location.x][location.y];
for (int y = location.y; y<=getAreaHeigh... | 6 |
public synchronized void unregister(Cancelable current) {
TreeNode currentNode = findNodeInTaskTrees(current);
if (currentNode instanceof TreeNode) {
List currentChildren = currentNode.getChildren();
TreeNode currentParent = currentNode.getParent();
for (Iterator iter = currentChildren.ite... | 4 |
private void output(String outputDir) {
File file = new File(outputDir + File.separatorChar + "objectsInAllDumps.md");
if (!file.getParentFile().exists())
file.getParentFile().mkdirs();
try {
PrintWriter writer = new PrintWriter(new FileWriter(file));
writer.println("## Heap Dump");
... | 7 |
private static posCounter errorPosition(String mm){
int i = 0; //iterator for loop
int pi = 0; //positions index number
int in = 0; //boolean for values inside pre array
int con = 0;//holder for converted atoi values
int pri = 0;//iterator for previous digit ... | 9 |
private void ProcurarEquipa_ButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ProcurarEquipa_ButtonActionPerformed
try {
Equipa equipa = a.getEquipa(Escola_ComboBox1.getSelectedItem().toString(), Escola_ComboBox1.getSelectedItem().toString() + "-" + Equipa_ComboBox2.getSelecte... | 4 |
static void setup(CommandLine line) throws NumberFormatException {
if (line.hasOption("array_id")) {
parameterNumber = Long.parseLong(line.getOptionValue("array_id"));
}
if (line.hasOption("database")) {
databaseStem = line.getOptionValue("database");
}
if... | 4 |
public void changeState(){
deltaTime = 0;
state = state.next();
//state.print();
switch (state) {
case KKMMM:
US.setLamps(true, true, false);
Barat.setLamps(true, false, false);
Timur.setLamps(true, false, false);
TU.setLamp(true);
stateTime = Main.time[0];
break;
case HHMMM:
US.setLamp... | 8 |
public HttpResponse makeResponse(HttpRequest request, String rootDirectory, File file) {
// Handling PUT request here
boolean preexists = false;
if (file.exists()) {
preexists = true;
}
HttpResponse response = null;
if (file.getParentFile().exists() || file.getParentFile().mkdirs()) {
BufferedWr... | 8 |
public void setDirty() {
// EDebug.print("Change has come");
dirty = true;
} | 0 |
@Override
public int[] getInts(int par1, int par2, int par3, int par4)
{
int i1 = par1 - 1;
int j1 = par2 - 1;
int k1 = par3 + 2;
int l1 = par4 + 2;
int[] aint = this.parent.getInts(i1, j1, k1, l1);
int[] aint1 = IntCache.getIntCache(par3 * par4);
for (in... | 6 |
public void setCode_lab(String code_lab) {
this.code_lab = code_lab;
} | 0 |
private void fillInElementsOnProjectList(int projectID){
listOfElements.clear();
if (projectID >=1){
try{
ResultSet elementsOnProjectListResultSet = null;
Statement statement;
statement = connection.createStatement();
elementsOn... | 3 |
private boolean checkJpeg() throws IOException {
byte[] data = new byte[6];
while (true) {
if (read(data, 0, 4) != 4) {
return false;
}
int marker = getShortBigEndian(data, 0);
int size = getShortBigEndian(data, 2);
if ((marker & 0xff00) != 0xff00) {
return false; // not a valid marker
}
... | 8 |
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
// TODO add your handling code here:
Answer[] testans = new Answer[4];
int i = 0;
while (i <= 3)
{
testans[i] = new Answer("aa", false);
i++;
... | 1 |
@Override
public void updateIcon() {
if(isProperty()) {
if (isPropertyInherited()) {
setIcon(ICON_IS_PROPERTY_INHERITED);
} else {
setIcon(ICON_IS_PROPERTY);
}
} else {
if (isPropertyInherited()) {
setIcon(ICON_IS_NOT_PROPERTY_INHERITED);
} else {
setIcon(ICON_IS_NOT_PROPERTY);
}
... | 3 |
public static void main(String[] args){
Settings settings = new Settings();
File propFile =settings.getPropertiesFile();
boolean outcome = true;
if(propFile.exists()&&propFile.isFile()){
try{
propFile.delete();
} catch (Exception e){
Sy... | 4 |
public RdbToRdf(String dir) throws ClassNotFoundException {
if (!dir.endsWith("/")) {
dir = dir + "/";
}
File f = new File(dir);
if (!f.isDirectory()) {
f.mkdir();
}
dir = dir + "TDB/";
f = new File(dir);
if (f.isDirectory()) {
if (f.exists()) {
String[] m... | 6 |
@Override
public void validate() {
session = ActionContext.getContext().getSession();
User u1 = (User) session.get("User");
Criteria ucri = getMyDao().getDbsession().createCriteria(User.class);
ucri.add(Restrictions.eq("emailId", u1.getEmailId()));
ucri.add(Restrictions.eq("p... | 6 |
public static void main(String[] args) {
System.out.println(2147483647);
System.out.println(-2147483648);
System.out.println(9223372036854775807L);
System.out.println(-9223372036854775808L);
} | 0 |
@Override
protected Integer val00(Integer val) {
if(val<10) return 1;
if(val<20) return 2;
if(val<30) return 3;
if(val<40) return 4;
if(val<50) return 5;
if(val<60) return 6;
if(val<70) return 7;
if(val<80) return 8;
if(val<90) return 9;
return 10;
} | 9 |
@Test
public void populationRightSize(){
System.out.println(pop.getIndividuals().size());
while(pop.getNumberOfGenerations() < NUM_GEN){
pop.newGeneration();
assertEquals("population size", POP_SIZE, pop.getIndividuals().size());
}
} | 1 |
public boolean isExpired()
{
return timeout<(System.currentTimeMillis()/1000L);
} | 0 |
public static String GetRegionInformation(String Region) {
String regionString = null;
Document doc;
File Xml = new File("Regions.xml");
try {
if (!Xml.exists()) {
System.out.println("- Extracting Region.xml...");
InputStream is = Tools.class.getClass().getResourceAsStream(... | 5 |
public int getRepeat() {
return repeat;
} | 0 |
protected final void setAuthor(String author) {
this.author = author;
} | 0 |
public static void setWebRootPath(String webRootPath) {
if (webRootPath == null) {
return;
}
if (webRootPath.endsWith(File.separator)) {
webRootPath = webRootPath.substring(0, webRootPath.length() - 1);
}
PathKit.webRootPath = webRootPath;
} | 2 |
private Image unmarshalImage(Node t, String baseDir) throws IOException
{
Image img = null;
String source = getAttributeValue(t, "source");
if (source != null) {
if (checkRoot(source)) {
source = makeUrl(source);
} else {
source = mak... | 5 |
protected static OutputStream getStream(File file, int flags) throws IOException
{
OutputStream output = new FileOutputStream(file);
if ((flags & NBTSerializer.BUFFERED) != 0)
{
output = new BufferedOutputStream(output);
}
if ((flags & NBTSerializer.COMPRESSED) != 0)
{
output = new GZIPOutputStream(o... | 3 |
public void run() {
try {
boolean running = true;
while (running) {
try {
String line = null;
while ((line = _breader.readLine()) != null) {
try {
_bot.handleLine(line);
... | 9 |
public void draw(Graphics g) {
int i, p;
for (i = 0; i != 2; i++) {
setVoltageColor(g, volts[nCoil1 + i]);
drawThickLine(g, coilLeads[i], coilPosts[i]);
}
int x = ((flags & FLAG_SWAP_COIL) != 0) ? 1 : 0;
drawCoil(g, dsign * 6, coilLeads[x], coilLeads[1 - x... | 7 |
public void keyPressed(KeyEvent w) {
int code = w.getKeyCode();
if (code == KeyEvent.VK_A) {
i=0;
dx = -SPEED;
} else if (code == KeyEvent.VK_D) {
i=1;
dx = SPEED;
} else if (code == KeyEvent.VK_W) {
dy = -SPEED;
} else ... | 4 |
public boolean equals(char c) {
return this.id == c;
} | 0 |
public static float convertSpeedUnitIndexToFactor(int index) {
switch (index) {
case 0:
return KPH;
case 1:
return MPH;
case 2:
return MPS;
case 3:
return KN;
case 4:
retu... | 5 |
public void addPatient(Patient2 newPatient) {
if (this.isLast) {
Patient2 first = nextPatient;
nextPatient = newPatient;
nextPatient.isFirst = false;
nextPatient.nextPatient = first;
this.isLast = false;
} else {
nextPatient.addPati... | 1 |
public void paint(Graphics g) {
//Background
g.setColor(Color.black);
g.fillRect(0, 0, Run.window.getWidth(), Run.window.getHeight());
//
//Title
g.setFont(titleFont);
g.setColor(Color.white);
g.drawString(Run.TITLE, 50, 50);
//
//Buttons
g.setFont(buttonFont);
if (!hoveringStart) {
... | 3 |
public AcyclicSP(EdgeWeightedDigraph G, int s)
{
distTo = new double[G.V()];
for (int i = 0; i < G.V(); i++)
distTo[i] = Double.POSITIVE_INFINITY;
distTo[s] = 0;
edgeTo = new WeightedDirectedEdge[G.V()];
Topological topological = new Topological(G.digraph());
for (Integer v : topological.order())
re... | 2 |
@Override
public void mouseReleased(MouseEvent event) {
if (isEnabled()) {
Row rollRow = null;
try {
rollRow = mRollRow;
if (mDividerDrag != null && allowColumnResize()) {
dragColumnDivider(event.getX());
}
mDividerDrag = null;
if (mSelectOnMouseUp != -1) {
mModel.select(mSelectOn... | 4 |
public Date getNextDay(Date date) {
Calendar calendar = getStartOfDate(date);
calendar.add(Calendar.DAY_OF_MONTH, 1);
return calendar.getTime();
} | 0 |
public static boolean readConfig(String fileName,int nodeid) {
System.out.println("Reading config for"+nodeid);
nodeID=nodeid;
BufferedReader bReader = null;
int nodesCount=0;
try {
bReader = new BufferedReader(new FileReader(fileName));
String line = bReader.readLine();
boolean firstLine=true;
wh... | 8 |
private void printAll(TreeNode root, TreeNode parent, Node parentNode, int i) {
Node p;
int parentPosition = getRectNextLeft(i);
if (root != null && parent == null) {
p = makeNode(String.valueOf(root.key), new Point(parentPosition, getRectNextTop(0)), Node.COLOR_PARENT, i);
... | 4 |
public final static Entry<Integer,String> getNumberFollowedByString(final String str)
{
if((str==null)||(str.length()<2))
return null;
if(!Character.isDigit(str.charAt(0)))
return null;
int dex=1;
for(;dex<str.length();dex++)
if(Character.isLetter(str.charAt(dex)))
break;
else
if(!Character.... | 9 |
public RemoteConsoleServer(InputStream remoteClientIn, OutputStream remoteClientOut) {
this.remoteClientIn = remoteClientIn;
this.remoteClientOut = remoteClientOut;
inputStream = new FilterInputStream(remoteClientIn) {
private void checkRead() throws IOException {
i... | 8 |
@Override public void onInitSuccess(MidiAccess midiAccess) {
log("Web MIDI initialized.");
//list input ports
log("List of input ports:");
if (midiAccess.getInputs().size() == 0)
log("- (None)");
for (MidiInput mi : midiAccess.getInputs())
log("- " + mi.port.name);
//list output ports
log("List of o... | 6 |
public void sendToPlayer (Player player, Location location, float offsetX,
float offsetY, float offsetZ, float speed, int count)
{
try
{
Object packet = nms_packet63WorldParticles.newInstance();
Reflection.setValue(packet, "a", name);
Reflection.setValue... | 6 |
@Override
public void executeMsg(final Environmental myHost, final CMMsg msg)
{
super.executeMsg(myHost,msg);
if((affected!=null)
&&(affected instanceof MOB)
&&(msg.amISource((MOB)affected)||msg.amISource(((MOB)affected).amFollowing())||(msg.source()==invoker()))
&&(msg.sourceMinor()==CMMsg.TYP_QUIT))
{
... | 7 |
ByteVector put12(final int b, final int s) {
int length = this.length;
if (length + 3 > data.length) {
enlarge(3);
}
byte[] data = this.data;
data[length++] = (byte) b;
data[length++] = (byte) (s >>> 8);
data[length++] = (byte) s;
this.length =... | 1 |
public static void main(String[] args) throws ParserConfigurationException, SAXException, IOException
{
//Step 1:获得dom解析器工厂(工作的作用是用于创建具体的解析器)
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
//Step 2:获得具体的解析器
DocumentBuilder db = dbf.newDocumentBuilder();
//Step 3:解析一个xml文件,获得Document对象(根节点... | 1 |
@Override
public void rewind()
{
switch( channelType )
{
case SoundSystemConfig.TYPE_NORMAL:
if( clip != null )
{
boolean rePlay = clip.isRunning();
clip.stop();
clip.setFramePosition(0);
... | 5 |
public int genHeat(Element e) {
Random r = new Random();
switch(e) {
case ICE:
return -r.nextInt(5);
case GAS:
return -r.nextInt(200);
case WATER:
return r.nextInt(20)-10;
case FIRE:
return r.nextInt(75);
case TERRA:
return r.nextInt(30);
default:
return 0;
}
} | 5 |
@Override
public void print() {
System.out.println();
System.out.println("Matrix" + rows + "x" + cols);
System.out.println("-------------------------------------------------");
for (int i = 0; i < rows; i++) {
for (int j = 0; j < cols; j++) {
try {
... | 3 |
public int pop() {
return runStack.remove(runStack.size() - 1);
} | 0 |
public double expectedOccurences(String s)
{
double prob = 1.0;
for (int i = 0; i < s.length(); i++)
{
switch (s.charAt(i))
{
case 'A':
prob *= props[0];
break;
case 'T':
prob *= props[1];
break;
case 'G':
prob *= props[2];
bre... | 5 |
private SimpleNode findNodeABRI(SimpleNode node, final int value) {
SimpleNode ret = null;
if (this.root == null) {
throw new RuntimeException("Le noeud [" + this.min + "; " + this.max + "] est vide et ne contient donc pas " + value + " !");
}
if (node == null) {
... | 7 |
public static Usuarios sqlLeer(Usuarios usu){
String sql="SELECT * FROM usuarios WHERE idusuarios = '"+usu.getIdUsuario()+"' ";
if(!BD.getInstance().sqlSelect(sql)){
return null;
}
if(!BD.getInstance().sqlFetch()){
return null;
}
u... | 2 |
public void uimsg(String msg, Object... args) {
if (msg == "tabfocus") {
setfocustab(((Integer) args[0] != 0));
} else if (msg == "act") {
canactivate = (Integer) args[0] != 0;
} else if (msg == "cancel") {
cancancel = (Integer) args[0] != 0;
} else if (msg == "autofocus") {
autofocus = (Integer) ar... | 9 |
@Override
public Object getValue() {
// find and assemble date appropriately depending on property at this node and type of parent
// TODO: behavior should be configurable via registry (see comment at top of file)
// VirtualDateNode may only be used for datatype VariablePrecisionTime
VariablePrecisionTime r... | 6 |
public AxisAlignedBB getAxisAlignedBB(World par1World, int par2, int par3, int par4, int par5, float par6, int par7)
{
if (par5 != 0 && par5 != this.blockID)
{
AxisAlignedBB var8 = Block.blocksList[par5].getCollisionBoundingBoxFromPool(par1World, par2, par3, par4);
if (var8 ... | 6 |
private void deleteButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteButtonActionPerformed
int answer;
int selectedRow;
switch (jTabbedPane1.getSelectedIndex()) {
case 0:
selectedRow = bookTable.getSelectedRow();
if (select... | 9 |
@Override
public void learn(){
int examples = 0;
int max_neuron = Options.getOptions().getMaxNeurons();
while (( neurons.get(0).size() < max_neuron) && (examples < epochs) && !Options.getOptions().getStopped()) {
//We check the pause
checkPause();
//We print the current state
prin... | 5 |
@Override
public boolean equals( Object obj ){
if( obj == this ){
return true;
}
if( obj == null || obj.getClass() != getClass() ){
return false;
}
CapabilityName<?> that = (CapabilityName<?>)obj;
return id.equals( that.id );
} | 5 |
public void setQuestion(Question question)
{
this.question = question;
notifyListeners();
} | 0 |
@Override
public StringBuffer getOOXML( String catAxisId, String valAxisId, String serAxisId )
{
StringBuffer cooxml = new StringBuffer();
// chart type: contains chart options and series data
cooxml.append( "<c:bar3DChart>" );
cooxml.append( "\r\n" );
cooxml.append( "<c:barDir val=\"col\"/>" );
cooxml.a... | 6 |
@Override
public int hashCode(){
int res = 1;
int prime = 37;
for (RailwayVehicle it : this)
res = prime*res + (it==null ? 0 : it.hashCode());
return res;
} | 2 |
public void endPatchRunStatement(ScriptExecutable pScriptExecutable, boolean pWasSuccess) {
try {
if(pScriptExecutable instanceof ScriptSQL){
ScriptSQL lScriptSQL = (ScriptSQL) pScriptExecutable;
Connection lConnection = mDatabaseConnection.getLoggingConnection();
Ca... | 3 |
private void error(String error) {
synchronized (ui) {
if (this.error != null)
this.error = null;
if (error != null)
this.error = textf.render(error, java.awt.Color.RED);
}
} | 2 |
public List<Class<?>> getClassesFromJar(File file, ClassLoader classLoader)
{
final List<Class<?>> classes = new ArrayList<Class<?>>();
try
{
final JarFile jarFile = new JarFile(file);
Enumeration<JarEntry> enumeration = jarFile.entries();
while (enumerati... | 8 |
public Object [][] getDatos(){
Object[][] data = new String[getCantidad_Cuentas ()][colum_names.length];
//realizamos la consulta sql y llenamos los datos en "Object"
try{
if (colum_names.length>=0){
r_con.Connection();
String c... | 5 |
public String readFile(java.io.File file)
{
if(file.exists() && file.canRead())
{
JConsole c = new JConsole();
String data = "";
try
{
java.io.FileReader fs = new java.io.FileReader(file);
while(fs.ready())
{... | 5 |
@AfterClass
public static void tearDownClass() {
} | 0 |
public void visitIincInsn(final int var, final int increment) {
if (currentBlock != null) {
if (compute == FRAMES) {
currentBlock.frame.execute(Opcodes.IINC, var, null, null);
}
}
if (compute != NOTHING) {
// updates max locals
int n = var + 1;
if (n > maxLocals) {
maxLocals = n;
}
}
... | 7 |
private void doPaintBucketNoDia(int x, int y, int newCol, int currentCol)
{
// make sure it's on the image
if (x > -1 && y > -1 && x < this.getDrawingWidth()
&& y < this.getDrawingHeight() && this.getPoint(x, y) == currentCol)
{
this.drawPoint(x, y, newCol);
... | 5 |
public static int getMaxNumber(String what) {
int result = 0;
Connection con = DBUtil.getConnection();
Statement st = null;
ResultSet rs = null;
try {
st = con.createStatement();
rs = st.executeQuery("select * from mstx_max");
rs.next();
result = rs.getInt(what);
} catch (SQLException e) {
e.... | 7 |
public GameResult play() {
while (true)
{
Player player = gameManager.getNextPlayer();
Move move = player.getMove(board);
try
{
gameManager.applyMove(move, player, turnNumber);
turnNumber += 1;
}
catch (UnknownPlayerException e)
{
System.out.println("Unknown player at... | 5 |
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.