text stringlengths 14 410k | label int32 0 9 |
|---|---|
public String fractionToDecimal(int numerator, int denominator) {
StringBuffer ans = new StringBuffer();
Map<Long, Integer> map = new HashMap<>();
String sign;
if ((numerator == 0) || (numerator >= 0 && denominator > 0) || (numerator < 0 && denominator < 0)) {
sign = "";
} else {
sign = "-";
}
ans.a... | 9 |
public void run() {
boolean eof = false;
byte[] buffer = new byte[65536];
int timeout = 0;
while(!eof && !super.killed()) {
int read=0;
try {
read = in.read(buffer);
} catch (SocketTimeoutException ste) {
if(!super.killed()) {
timeout++;
if(timeout > 225) {
ptc.print... | 8 |
private void initializeLauncherMenuBar(JFrame launcherMainFrame, JFrame launcherLogWindow)
{
this.launcherMainFrame = launcherMainFrame;
this.launcherLogWindow = launcherLogWindow;
//int acceleratorMask = Toolkit.getDefaultToolkit().getMenuShortcutKeyMask();
// File menu
... | 5 |
public static void createStorageLocations () {
File cacheDir = new File(OSUtils.getCacheStorageLocation());
File dynamicDir = new File(OSUtils.getDynamicStorageLocation());
if (!cacheDir.exists()) {
cacheDir.mkdirs();
if (dynamicDir.exists() && !cacheDir.equals(dynamicD... | 8 |
public String getName() {
return name;
} | 0 |
public void menuReportes() throws IOException
{
int opcrepo = 0;
String tituloParaBuscar;
List<Pelicula> peliculasEncontradas;
InputStreamReader entrada = new InputStreamReader(System.in);
BufferedReader buf = new BufferedReader(entrada);
while (opcrepo != 5)
... | 9 |
public static Model loadFrom(String filename) throws IOException {
try (ObjectInputStream ois = new ObjectInputStream(new FileInputStream(filename))) {
final Model model = (Model) ois.readObject();
// everything went well, remember the original file
model.setBackingFile(filen... | 2 |
public boolean equals(
Object o)
{
if (o == null || !(o instanceof ASN1TaggedObject))
{
return false;
}
ASN1TaggedObject other = (ASN1TaggedObject)o;
if(tagNo != other.tagNo || empty != other.empty || explicit != other.explicit)
{
retur... | 8 |
public void saveRTF(Writer fileout, int depth, HashMap colorTable)
throws IOException {
String pre = "{" + "\\li" + depth * 350;
String level;
if (depth <= 8) {
level = "\\outlinelevel" + depth;
} else {
level = "";
}
String fontsize = ... | 9 |
protected int readInt(int min, int max) {
int result = min - 1;
while (result < min || result > max) {
try {
result = scanner.nextInt();
if (result > max || result < min) System.out.println(TRY_AGAIN_MSG);
} catch (InputMismatchException ex) {
... | 5 |
@Override
public void tick() {
if (--duration <= 0) {
remove();
return;
}
if (!move(xa, ya)) {
hit = true;
}
if (hit && !removed) {
remove();
}
} | 4 |
public void testMonthNames_monthEnd() {
DateTimeFormatter printer = DateTimeFormat.forPattern("MMMM");
for (int i=0; i<ZONES.length; i++) {
Chronology chrono = ISOChronology.getInstance(ZONES[i]);
for (int month=1; month<=12; month++) {
DateTime dt = new DateTime(... | 2 |
public void setOptions(String[] options) throws Exception {
// Other options
String minNumString = Utils.getOption('M', options);
if (minNumString.length() != 0) {
m_minNumObj = Integer.parseInt(minNumString);
} else {
m_minNumObj = 2;
}
m_binarySplits = Utils.getFlag('B', options)... | 7 |
public void initializeNetwork()
{
PrintWriter out = null;
Random rng = new Random();
try
{
out = new PrintWriter("rover_netwrok.dot");
}
catch (Exception e)
{
System.err.println(e.getMessage());
}
network.setDirected(true);
network.setWeighted(true);
out.println("digraph G {");
for (in... | 5 |
@Override
public void executeMsg(Environmental host, CMMsg msg)
{
if((affected instanceof MOB)
&&(stubb==null)
&&(msg.amISource((MOB)affected))
&&(!CMath.bset(msg.sourceMajor(),CMMsg.MASK_ALWAYS)
&&(msg.othersCode()!=CMMsg.NO_EFFECT)
&&(msg.othersMessage()!=null)
&&(msg.othersMessage().length()>0)))
... | 7 |
public void saveXml(File file) {
try {
if (!file.exists()) {
file.createNewFile();
}
FileOutputStream fileStream = new FileOutputStream(file);
String empty = "<library></library>";
for (int i = 0; i < empty.length(); i++) {
fileStream.write(empty.charAt(i));
}
fileStream.close();
} catc... | 7 |
public GuideUserAction predict(DependencyStructure gold, ParserConfiguration config) throws MaltChainedException {
CovingtonConfig covingtonConfig = (CovingtonConfig)config;
DependencyNode leftTarget = covingtonConfig.getLeftTarget();
int leftTargetIndex = leftTarget.getIndex();
int rightTargetIndex = covington... | 9 |
public static void Timeline(File directory) {
if (!directory.isDirectory()) {
System.err.println("Timeline(File directory): directory.isDirectory() == false");
return;
}
File[] files = directory.listFiles();
System.out.println("Reading input from " + directory.get... | 9 |
public int getDownloadSpeed(){
return 0;
} | 0 |
public void defuzz(String [] params){
if(params.length!=fuzzyEngine.getLinguisticVariableCollection().size()){
System.out.println("--Invalid params--\n");
return;
}
if(!linguisticVariableCollectionCheck()){
return;
}
if(!rulesCheck()){
... | 8 |
public Action parseActionByte(int actionByte) {
Action action = Action.DO_NOTHING;
switch (actionByte) {
case 0:
action = Action.DO_NOTHING;
break;
case 1:
action = Action.OUTPUT_MAX_HEIGHT;
break;
case 2:
action = Action.OUTPUT_MAX_LAUNCH_HEIGHT;
break;
case 3:
action = Action.OUTPUT_L... | 5 |
public AmmoItem(int ID, String name, boolean stackable, int amount, int price, boolean usable,
int weaponType, float vigorCost, String weaponName, float weaponDamage, Resistance resistance,
float breakChance, int weapon, ProjectileType ammoType, String ammoName) {
this.ID = ID;
this.name = name;
this.stacka... | 1 |
public Vector2D truncate(double max){
double mag = FastMath.sqrt(x * x + y * y);
if(mag > Double.MIN_VALUE && mag > max){
double f = max / mag;
x *= f;
y *= f;
}
return this;
} | 2 |
public void setElement(int x, int y, int value){
if(x <= this.x && y <= this.y){
mat[x-1][y-1] = value;
}
} | 2 |
public ParameterizedTypeImpl(Type ownerType, Type rawType, Type... typeArguments) {
// require an owner type if the raw type needs it
if (rawType instanceof Class<?>) {
Class<?> rawTypeAsClass = (Class<?>) rawType;
checkArgument(ownerType != null || rawTypeAsClass.getEnclosingClass() == null... | 8 |
public void countFitness() {
this.fitnessArr = new ArrayList<Double>();
for (int i = 0; i < population.size(); i++) {
this.fitnessArr.add(this.population.get(i).getFitness());
if (this.bestFitOnGeneration < this.population.get(i).getFitness()) {
this.bestFitOnGeneration = this.population.get(i... | 2 |
void validate() throws validate_failed, pval_error, make_key_error
{
//if (tol==0) throw new validate_failed();
int i=1;
node s=startNode;
boolean success=true;
long diff;
while((s=s.nextNode()).getId()!=startNode.getId())
{
i++;
if (i>common.maxNodes)
{
if (tol==0)throw new validate_failed... | 7 |
public static String numberToString(Number number)
throws JSONException {
if (number == null) {
throw new JSONException("Null pointer");
}
testValidity(number);
// Shave off trailing zeros and decimal point, if possible.
String string = number.toString();
... | 6 |
public void addRow(String name, ImageIcon icon, String recipient, int value) {
gridC.gridx = NAME_COL;
gridC.anchor = GridBagConstraints.WEST;
gridC.fill = GridBagConstraints.NONE;
gridC.weightx = 1.0;
JLabel nameLbl = new JLabel(name);
this.add(nameLbl, gridC);
gridC.gridx = RECIPIENT_COL;
gri... | 2 |
public static String milisecondsToTime(int miliseconds) {
String sec = "";
if(miliseconds / 1000 > 0) sec = secondsToTime(miliseconds/1000);
miliseconds %= 1000;
StringBuilder sb = new StringBuilder();
if(!sec.equals("")) sb.append(sec);
if(miliseconds > 0) sb.ap... | 3 |
@Test
public void charTest(){
for (char input= 'A'; input <= 'z'; input++){
if (input >= 'A' && input <= 'Z'){
System.out.println( input + " is char.");
}else if (input >= 'a' && input <= 'z'){
System.out.println( input + " is char.");
}el... | 5 |
public DefaultComboBoxModel<String> buildSelectCombo() {
DefaultComboBoxModel<String> model = new DefaultComboBoxModel<String>();
if(!MapPanel.actors.isEmpty()) {
for(int x = 0; x<MapPanel.actors.size(); x++) {
model.addElement(MapPanel.actors.get(x).getID());
}
}
return model;
} | 2 |
public V insert(K key, V value) {
int cmp = key.compareTo(this.key);
if (cmp < 0) {
if (left == null) {
left = new BinaryTreeNode<K, V>(key, value);
return null;
}
return left.insert(key, value);
}
if (cmp > 0) {
... | 4 |
public static void main(String[] args)
{
Vector vector = new Vector();
vector.add("hello");
vector.add("world");
vector.add("hello world !");
for(int i = 0 ;i < vector.size();i++)
{
System.out.println(vector.get(i));
}
} | 1 |
public void repaint()
{
if (frame == null) return;
Dimension dim = component.getPreferredSize();
if (dim.getWidth() > component.getWidth()
|| dim.getHeight() > component.getHeight())
{
frame.pack();
}
else
{
f... | 3 |
private void runEPD(ATMCell cell){
boolean cellDropped = false;
if (cell.getData().equals("")) {
this.dropSamePacketCell = false;
double totalDropProbability = 1.0;
int size = cell.getPacketData().getSize() / (48*8) + 1;
for (int i = 0; i < size; i ++) {
double dropProbability = 0.0;
... | 9 |
@SuppressWarnings("WeakerAccess")
public void executeSaveAs() {
open = FileChooser.chooseFile(null, "Save", JFileChooser.FILES_ONLY);
if(open == null) {
JOptionPane.showConfirmDialog(newFile, "Something went wrong while saving!(ERR:3)\nAborting saving!");
return;
}
if(!instance.saveToFile(open)) {
JOp... | 2 |
public void testPropertySetCopyMonth() {
LocalDate test = new LocalDate(1972, 6, 9);
LocalDate copy = test.monthOfYear().setCopy(12);
check(test, 1972, 6, 9);
check(copy, 1972, 12, 9);
test = new LocalDate(1972, 1, 31);
copy = test.monthOfYear().setCopy(2);
... | 2 |
public static void create(String zipFilename, String... filenames) throws IOException
{
try (FileSystem zipFileSystem = createZipFileSystem(zipFilename, true))
{
final Path root = zipFileSystem.getPath("/");
//iterate over the files we need to add
for (String fil... | 4 |
private void checkServerCertPath(
X509Certificate[] paramArrayOfX509Certificate)
throws CertificateException {
try {
CertPathValidator localCertPathValidator = CertPathValidator
.getInstance(CertPathValidator.getDefaultType());
... | 7 |
public static void loadPortals(String fileName) throws IOException {
Scanner file = new Scanner(new File(fileName));
boolean check = true;
int count = 0;
file.nextLine();
while (check){
try {
String d = file.next();
if (d.charAt(0)=='P'){
int x = file.nextInt();
int y = file.nextInt();
... | 4 |
public RequeteRenommer() throws SQLException {
tableaux.clear();
srids.clear();
taillePixel.clear();
nomCouches.clear();
nouveauNom.clear();
tableaux=FenetreRenommer.getTableauTailles();
// comparaison=ConnexionVector2Points.getArrayy4();
for(int fg=0;fg<tableaux.size();fg++){
String test3... | 8 |
private void setModelType(String modelType) {
this.modelType = modelType;
if (modelType.equals("SI")) {
setSI();
} else if (modelType.equals("SEI")) {
setSEI();
} else if (modelType.equals("SIR")) {
setSIR();
} else if (modelType.equal... | 6 |
public void mouseWheelMoved(MouseWheelEvent e)
{
if(e.getWheelRotation() > 0)
{
mouseActions.WheelDown();
}
else if(e.getWheelRotation() < 0)
{
mouseActions.WheelUp();
}
} | 2 |
public boolean isEmpty(Entity e) {
for(int i = 0; i < entities.size(); i++) {
if(entities.get(i).collides(e)) {
return false;
}
}
return true;
} | 2 |
public boolean isMoving() {
return moving;
} | 0 |
public SQLPermissionWorld(String n) {
super(n);
} | 0 |
public void setName(String name) {
this.name = name;
} | 0 |
protected static Ptg calcSign( Ptg[] operands )
{
if( operands.length != 1 )
{
return PtgCalculator.getNAError();
}
double dd = 0.0;
try
{
dd = operands[0].getDoubleVal();
}
catch( NumberFormatException e )
{
return PtgCalculator.getValueError();
}
int res = 0;
if( new Double( dd ).isN... | 6 |
public static DataSourceType get(String s) {
if (s.equalsIgnoreCase(STR_COUNTER)) {
return COUNTER;
} else if (s.equalsIgnoreCase(STR_ABSOLUTE)) {
return ABSOLUTE;
} else if (s.equalsIgnoreCase(STR_GAUGE)) {
return GAUGE;
} else if (s.equalsIgnoreCase(STR_DERIVE)) {
return DERIVE;
} else {
thr... | 4 |
private Object getRussianUndoName(String undoPresentationName) {
if (undoPresentationName.contains("deletion")) return "Отменить удаление";
if (undoPresentationName.contains("style")) return "Отменить";
if (undoPresentationName.contains("addition")) return "Отменить ввод";
return undoPresentationName;
} | 3 |
public int click(Unit selected)
{
if(!disabled)
{
switch(iD)
{
case 0:
selected.showAttack();
break;
case 1: case 2: case 3: case 4:
System.out.println(text + " was clicked. Not yet im... | 9 |
public void keyPressed(KeyEvent e) {
//If 'N' key is pushed reset the game.
if (e.getKeyCode() == KeyEvent.VK_N) {
try {
resetGame();
} catch (InterruptedException e1) {
e1.printStackTrace();
}
}
//If "Enter" is pushed reset only if the game is over
if (e.getKeyCode() == KeyEvent.VK_ENTER && ... | 5 |
public void appendSamples(int channel, float[] f)
{
short s;
for (int i=0; i<32;)
{
s = clip(f[i++]);
append(channel, s);
}
} | 1 |
public Object invoke(Object proxy, Method method, Object[] args) throws LuaException
{
synchronized(obj.L)
{
String methodName = method.getName();
LuaObject func = obj.getField(methodName);
if ( func.isNil() )
{
return null;
}
Class retType = method.getReturnType();
... | 5 |
@SuppressWarnings("deprecation")
public void sendDebug(String msg) {
if (FreeForAll.getInstance().isDebugMode()) {
Player p;
p = Bukkit.getServer().getPlayerExact("bionicangel1098");
if (p != null) {
p.sendMessage("FFA DEBUG: " + msg);
}
}
} | 2 |
private Criteria[] prepareCompanyUpdate(Criteria criteria, AbstractDao dao) throws DaoException {
Integer idCompany = Integer.decode(ConfigurationManager.getProperty("db.company.id"));
Criteria[] crit = new Criteria[]{new Criteria(), new Criteria()};
crit[0].addParam(DAO_ID_USER, idCompany);
... | 1 |
public Quadrivalent(HaploStruct[] haplostruct) throws Exception {
super();
boolean ok = haplostruct!=null && haplostruct.length==4 &&
haplostruct[0]!=null && haplostruct[0].getChrom()!=null;
for (int h=1; h<4; h++) {
ok = ok && haplostruct[h]!=null &&
... | 7 |
public static void createIcons() {
// Create a buffered image from the commented image.
Image notCommentedImage = ICON_IS_NOT_PROPERTY.getImage();
BufferedImage image = new BufferedImage(TRUE_WIDTH, BUTTON_HEIGHT, BufferedImage.TYPE_INT_ARGB);
Graphics2D g = image.createGraphics();
g.drawImage(notCommentedI... | 0 |
public int getTopY(){if(dir=='u'||dir=='d')return y-22; return y-12;} | 2 |
public ArrayList<FailureEvent> generateFailure() {
if(events == null) {
events = new ArrayList<FailureEvent>();
// create a temp array
fieldArray = new String[MAX_FIELD];
try {
if (fileName.endsWith(".gz")) {
readGZIPFile(fileName);
}
... | 5 |
private boolean covers(Location loc, int x, int y)
{
return (x>= loc.getX() && x <= loc.getX() + bsImageWidth) &&
(y>= loc.getY() && y <= loc.getY() + bsImageHeight);
} | 3 |
private void setPreferredClasses() {
if (!_classLocked) {
_classBox.removeActionListener(_classListener);
_classBox.removeAllItems();
Vector<BaseClass> preferred = _character.getRankedClasses(16);
Vector<BaseClass> average = _character.getRankedClasses(15);
... | 4 |
public static void exportSegment(){
BufferedWriter file =null;
String nameFile = "UsiExportZone";
try{
File dir = new File("export");
dir.mkdirs();
FileWriter fileWriter = new FileWriter("export\\" + nameFile + ".csv");
file = new BufferedWriter(f... | 6 |
@Override
public void actionPerformed(ActionEvent e) {
try {
Object objectSource = e.getSource();
if (objectSource instanceof JMenuItem) {
JMenuItem sourceMenuItem = (JMenuItem) e.getSource();
if (sourceMenuItem == restartMenuItem) {
... | 8 |
public void update() {
if (np == 0) {
recontrol(4);
for (int i=0; i<4; ++i) {
c[i].x = 0.0;
c[i].y = 0.0;
}
} else if (np == 1) {
recontrol(5);
for (int i=0; i<5; ++i) {
c[i].x = p[0].x;
c[i].y = p[0].y;
}
} else {
recontrol(np + 4);
// Initialization:
final int m... | 9 |
public int getWidth() {
return width;
} | 0 |
public void setNodeHtml(NodeList nl,String html)
{
try
{
for(int i=0;i<nl.getLength();++i)
{
setNodeHtml(nl.item(i).getChildNodes(),html);
if(!(nl.item(i) instanceof org.w3c.dom.Element))
continue;
org.w3c.dom.Element el=(org.w3c.dom.Element)nl.item(i);
String elid=el.getAttribute("... | 9 |
public static void main(String args[]) throws Throwable {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
boolean[] primos=new boolean[2005];
primos[0]=primos[1]=true;
for(int i=0;i<primos.length;i++)if(!primos[i])for(int j=i+i;j<primos.length;j+=i)primos[j]=true;
for(int c=0,C=parse... | 9 |
public Location findLoc(String searchParamaters) {
for(LocString locString : strings) {
if(locString.getString().replaceAll("\"","").toLowerCase().equalsIgnoreCase(searchParamaters.toLowerCase())) {
return new Location(locString.getX(), locString.getY(), locString.getZ());
... | 3 |
public static String getPrimePermutations() {
for(int i = 1000; i <= 9999; i++) {
if(i != 1487 && isPrime(i)) {
for(int dif = 1; dif <= (9999 - i) / 2; dif++) {
if(isPermutation(i, i + dif) && isPermutation(i, i + 2 * dif) &&
isPrime(i + dif) && isPrime(i + 2 * dif))
return String.valueOf(i) +... | 8 |
private void beatHeart(Thread thread)
{
while (curThread == thread)
{
try
{
long hbTime = System.currentTimeMillis();
int id = invoke("loginService", "performLCDSHeartBeat", new Object[] { accountID, sessionToken, heartbeat, sdf.format(new Date()) });
cancel(id); // Ignore result fo... | 5 |
public void clicked(int mode, int color, int sz, int tileIndex, int pixelIndex){
switch(mode){
case DO_NOTHING_MODE:
// nothing
break;
case DRAW_PIXEL_MODE:
paintPixelArea(color, sz, tileIndex, pixelIndex, true);
break;
case DRAW_LINE_MODE:
... | 8 |
public ArrayList<Boolean> getSoundInventoryList()
{
return soundInventoryList;
} | 0 |
public Integer newTicket() {
Database db = dbconnect();
String noEmployee = null;
Integer ticket_id = null;
try {
String query = "INSERT INTO ticket "
+ "(customer_CID, employee_EID, CategoryID, StatusID ,"
+ "Topic ,Problem ,Note, So... | 2 |
public String getId() {
return id;
} | 0 |
@Override
public void initActions() {
controls.clearBindings();
Action down = new AbstractAction() {
@Override
public void actionPerformed(ActionEvent e) {
selected++;
if(selected > options.length - 1)
selected = 0;
}
};
controls.storeAction("down", down);
Action up = new Abst... | 4 |
@RequestMapping(value = "del", method = RequestMethod.POST)
@ResponseBody
public Map del(@RequestParam int[] id) {
Map<String, Object> map = new HashMap<>();
List<String> l1 = new ArrayList<>();
List<String> l2 = new ArrayList<>();
List<String> l3 = new ArrayList<>();
f... | 5 |
public void setValueMAC(byte[] value) {
this.valueMAC = value;
} | 0 |
@Override
public int getColumnCount() {
if (alphabet != null)
return alphabet.size()+1;
return 1;
} | 1 |
public AddPatch(java.awt.Frame parent, PatchEntry curr, String currVersion, List<String> versions, String currCategory) {
super(parent);
initComponents();
if(curr!=null) {
setTitle("Edit Entry");
jButton2.setText("OK");
item = new PatchEntry();
ite... | 6 |
public void setId(Long id) {
this.id = id;
} | 0 |
public String getMobile() {
return Mobile;
} | 0 |
public Strat get(int r, int ix){
if (r == 0){
if (ix < tStrats.size())
return tStrats.get(ix);
}else if (r == 1){
if (ix < zStrats.size())
return zStrats.get(ix);
}else if (r == 2){
if (ix < pStrats.size())
return pStrats.get(ix);
}else if (r == 3){
if (ix < rStrats.size())
... | 8 |
public Class<?> getColumnClass(int column) {
Object object = data[0][column];
if (object == null)
return String.class;
return object.getClass();
} | 2 |
public void enableSensor(String sensor_id) throws NotFoundException, IllegalAccessError, SocketTimeoutException {
try {
clientSocket.Escribir("ON " + sensor_id + '\n');
serverAnswer = clientSocket.Leer();
} catch (IOException e) {
throw new SocketTimeoutException();
}
if(serverAnswer.contains("527 ERR"... | 3 |
public boolean setConnect4Button(JButton newConnect4) {
boolean test = false;
if (test || m_test) {
System.out.println("GameSelecter :: setConnect4Button() BEGIN");
}
m_connect4 = newConnect4;
if (test || m_test) {
System.out.println("GameSelecter :: se... | 4 |
@Override
public Set<String> checkConflict(String resource, String transaction,
LockType requestType) {
ResourceLock thisLock = locksOfR.get(resource);
// There is no lock on this resource.
if (thisLock == null || thisLock.getType() == null)
return new HashSet<Strin... | 9 |
private boolean cellExists(int xCoordinate, int yCoordinate) {
return xCoordinate >= 0
&& xCoordinate < getBoardWidth()
&& yCoordinate >= 0
&& yCoordinate < getBoardHeight();
} | 3 |
public double messageFactor2Node(int factor, int node, int value) {
double best = Double.NEGATIVE_INFINITY;
double current = 0;
if (factor == node) {
return Math.log(potentials.potential(node, value));
}
else if (factor == potentials.chainLength() + node -1) {
// left factor n' -> f -> n
for (int v... | 7 |
public static void main( String[] args ) throws SQLException {
Factory factory =Factory.instance;
UserDao userDao = factory.getUserDao();
userDao.addUser(new User("Yuriy", "Anax@gmail.com"));
userDao.addUser(new User("Anax", "blabla@gmail.com"));
userDao.addUser(new User("Vitman", "vit... | 1 |
@Override
public void setYearsExperience(int yearsExperience) {
super.setYearsExperience(yearsExperience);
} | 0 |
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
try {
SQLConnection MyCon = new SQLConnection();
Connection c = MyCon.getConnection("journal");
Statement stmt = c.createStatement();
String name = MyCo... | 5 |
public static Spell selectSpell(Mage player) {
/*
* Initialisation stage
*/
Spell[] spells = player.getSpells(); //The array of spells
String[] names = new String[spells.length]; //The array with the names of the spells
int[] tabs = new int[names.length]; //An array of the amount of tabs needed for eac... | 9 |
public void info(final String msg) {
if(disabled) return;
else logger.info(msg);
// System.out.debug(route_name + "-" + connection_id + "[info]: " + msg);
} | 1 |
public IsoGrid(){
TextureLoader tx = new TextureLoader();
Texture testTex = tx.getTexture("assets/iso_grass.png");
Texture testTex2 = tx.getTexture("assets/iso_grass2.png");
Texture flowers = tx.getTexture("assets/iso_grass3.png");
Texture flower = tx.getTexture... | 8 |
public boolean timeTIsClear()
{//Checks if all of timeT is null
for (int i = 0; i < DataBase.timeT.length; i++) {
for (int j = 0; j < DataBase.timeT[0].length; j++) {
for (int k = 0; k < DataBase.timeT[0][0].length; k++) {
for (int l = 0; l < DataBase.timeT[0][0][0].length; l++) {
if (DataBas... | 5 |
public void setMainState() {
mainState = keyMapper.poll();
} | 0 |
public ArrayList<Rental> getAllrentals(){
try {
if(conn == null || conn.isClosed()){
conn = DatabaseConnection.getConnection();
}
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
ArrayList<Rental> rentalList = new ArrayList<Rental>... | 5 |
public int validoiJaPoista(String id) throws ValidointiPoikkeus{
Validator validoi = new Validator();
System.out.println(id);
validoi.validateInt(id, "ID", "Tuotteen id", true, false);
if(validoi.getVirheet().size() > 0 || !virheet.getMap().isEmpty()) {
virheet = validoi.getVirheet();
System.... | 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.