text stringlengths 14 410k | label int32 0 9 |
|---|---|
private boolean sendFile(java.nio.channels.FileChannel fchan, long pos, long lmt, FileWrite fw) throws CM_Stream.BrokenPipeException
{
final java.nio.channels.WritableByteChannel iochan = (java.nio.channels.WritableByteChannel)chanmon.iochan;
final long sendbytes = lmt - pos;
try {
//throws on closed channel ... | 8 |
public String getAppenderName() {
return appenderName;
} | 0 |
@Override
public void addFilter(PropertyFilter filter) {
if (filter != null) {
filters.add(filter);
} else {
throw new IllegalArgumentException("Provided PropertyFilter was null.");
}
} | 1 |
public void run() {
Player player = (Player) sender;
if (arena.isIngame()) {
player.sendMessage(OITG.prefix + ChatColor.RED + "A game is already in progress in that arena, choose another.");
return;
}
if (arena.isClosed()) {
player.sendMessage(OITG.pre... | 7 |
public void setIcon()
{
try {
ByteBuffer[] icons = new ByteBuffer[2];
icons[0] = loadIcon("Icon_16.png", 16, 16);
icons[1] = loadIcon("Icon_32.png", 32, 32);
Display.setIcon(icons);
} catch (IOException ex) {
ex.printStackTrace();
}
} | 1 |
public List<CartaFianza> buscarCartaFianza(String codCartaFianza, String strProveedor) {
List<CartaFianza> listaResultado = new ArrayList<CartaFianza>();
for (CartaFianza bean : listaCartaFianza) {
if (bean.getCodCartaFianza().equals(codCartaFianza)) {
if (strProveedor == null || strProveedor.equ... | 9 |
public void mergeList(Integer a[], int start1, int end1, int start2, int end2) {
int temp[] = new int[end1 - start1 + end2 - start2 + 2];
int ptr1 = start1, ptr2 = start2, ptrmain = 0;
while (ptr1 <= end1 && ptr2 <= end2) {
if (a[ptr1] < a[ptr2]) {
temp[ptrmain++] = a... | 7 |
public void doCommand( final Command command ) {
final boolean changed = command.perform();
System.out.println( "CommandControl.doCommand(): " + command.getClass() + " " + changed );
if( changed && command instanceof UndoableCommand ) {
final boolean oldCanUndo = canUndo();
undoStack.add( (UndoableComman... | 3 |
@Override
public void writeUIFile(UIFileTextVO uifile) throws IOException {
if (uifile == null) {
IllegalArgumentException iae = new IllegalArgumentException("The uiFile must not be null!");
Main.handleUnhandableProblem(iae);
}
UIFileWriter.writeUIFile(uifile, this.u... | 1 |
public void setName(String name) {
this.name = name;
} | 0 |
@Override
public Connection getConnection() throws SQLException {
if (this.isClosed()) {
throw new SQLException("Connection pool is closed");
}
// Immediately return if a connection is available
Connection conn = this.waitAndGet(0);
if (conn != null) {
... | 7 |
private void writeList() {
for ( Column column : table.getColumns() ) {
if ( column.isSearchId() ) {
write( TAB + "public " );
write( "List<" + table.getDomName() + "> getListBy" );
write( toTitleCase( column.getFldName() ) );
write( "(... | 2 |
public static List<String> findFile(String inFilepath, Filtro isFiltro) {
List<String> fileFound = new ArrayList();
File directorioInicial = new File(inFilepath);
File[] gdbArray = directorioInicial.listFiles(isFiltro);
for (File archivo : gdbArray) {
if... | 2 |
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
// construct the query from the client's QueryString
String picid = request.getQueryString();
String query;
if ( picid.startsWith("thumb") )
query =
"select thumbnail f... | 5 |
public static boolean login(String username, String pass){
Employee bean = new Employee();
bean.setUsername(username);
bean = (Employee)DatabaseProcess.getRow(bean);
//if username cannot be found in the database
if(bean == null){
System.out.println(username+" not found!");
return false;
}
if(... | 3 |
public static SameAsService createNew() {
return new SameAsServiceImpl();
} | 0 |
public void setPlaymodes(Playmode[] playmodes){
if(playmodes != null){
for (Playmode playmode : playmodes) {
if(gameQueueMap.get(playmode.getPmID()) == null){
Queue<User> gameQueue = new LinkedList<>();
gameQueueMap.put(playmode.getPmID(), gameQueue);
}
}
}
} | 3 |
public int getCreatedDimensions() {
if (opcode == Opcode.MULTIANEWARRAY)
return iterator.byteAt(currentPos + 3);
else
return 1;
} | 1 |
public InstructionDecoder(){
m=new MyMap();
//Labels=new HashMap<String,Integer>();
} | 0 |
@Override
public Object invoke(Object proxy, Method m, Object[] args) {
try {
if (m == null || m.getName() == null) return null;
Class entityClass = Class.forName(ReflectionUtils.getNMSPackageName() + ".Entity");
if (m.getName().equals("a") && args.length == 1 && args[0] != null && classInstance(args[0].ge... | 7 |
private void refreshRec(File parentFile, TreeItem parentItem){
for(File child : parentFile.listFiles()){
if(child.isFile() && !isValidFormat(child.getName())){
continue;
}
FilePathTreeItem item = generateFileItem(child);
parentItem.add... | 5 |
public void endElement(final String namespaceURI,
final String localName,
final String qName)
throws SAXException {
charValue = charValue.trim();
if (t.findCriteria == C_FIND_ELEMENT_VALUE && t.b_TargetEntity && t.b_TargetNode){
... | 8 |
public void printGroupDataPK(String fpath) {
try {
FileReader rd = new FileReader(fpath);
BufferedReader br = new BufferedReader(rd);
Map<String, String> typemap = new HashMap<String, String>();
Map<String, String> groupmap = new HashMap<String, String>();
... | 7 |
@Override
public void setValueAt(Object value, int row, int col)
{
Physician p = phys.get(row);
int empID = p.getEmployeeId();
System.out.println("row: " + row + " col: " + col);
switch (col)
{
case 0:
p.setFirstName((String)value);
... | 7 |
private boolean processPlayerCommand(MapleClient c, MessageCallback mc, String[] splitted) {
DefinitionPlayerCommandPair definitionCommandPair = playercommands.get(splitted[0]);
if (definitionCommandPair != null) {
try {
definitionCommandPair.getCommand().execute(c, mc, split... | 6 |
public void updateProgress() {
setStage(getStage() + 1);
if (getStage() == 1)
player.getInterfaceManager().sendSettings();
else if (getStage() == 2)
player.getPackets().sendConfig(1021, 0); // unflash
else if (getStage() == 5) {
player.getInterfaceManager().sendInventory();
player.getHintIconsManage... | 7 |
@Override
public String toString() {
return "Taso: " + this.tasonNumero;
} | 0 |
public void setPrpPosId(Integer prpPosId) {
this.prpPosId = prpPosId;
} | 0 |
public int threeSumClosest(int[] num, int target) {
int maxDiff = Integer.MAX_VALUE;
int result = 0;
Arrays.sort(num);
for (int i = 0; i < num.length-2; i++) {
int left = i + 1;
int right = num.length - 1;
while (left < right) {
int su... | 5 |
public long skip(long n) throws IOException {
if(n == 0) return 0;
if(n > 0 && n < _bufferSize/2 && _dataInStream != null){
// Es besteht eine gute Wahrscheinlichkeit, dass die Zielposition noch gepuffert ist
int remaining = (int) n;
while(remaining > 0) {
int skipped = getDataInStream().skipBytes(rema... | 7 |
public final WaiprParser.triggersource_return triggersource() throws RecognitionException {
WaiprParser.triggersource_return retval = new WaiprParser.triggersource_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
Token char_literal32=null;
ParserRuleReturnScope sender31 =null;
ParserRuleRet... | 4 |
private void refreshAlarmList() {
List<Alarm> newList = new ArrayList<Alarm>(alarms);
if(selectedRadioButton.isSelected()) {
if(selectedHW != null) {
for(Iterator<Alarm> alarmIter = newList.iterator(); alarmIter.hasNext();) {
Alarm a = alarmIter.next();
if(!a.getTarget().getId().equals(selectedH... | 7 |
public static void main(String[] args) {
new Car().start();
} | 0 |
@Override
public void drawOpenGl() {
this.height = (int) Math.sqrt(RAM.MAX_LENGTH / 2);
this.width = 2 * this.height;
for (int i = 512; i < RAM.MAX_LENGTH; i++)
if (ram.memory_count_read[i] > max_read)
max_read = ram.memory_count_read[i];
for (int i = 512; i < RAM.MAX_LENGTH; i++)
if (ram.memory_cou... | 7 |
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof FragmentIonType)) return false;
FragmentIonType that = (FragmentIonType) o;
return !(label != null ? !label.equals(that.label) : that.label != null) && !(name != null ? !name.equals(that.name... | 5 |
public void getFirstLinks(ArrayList<Integer> theCodes) throws IOException{
boolean linkFound =false;
String temp = null;
String theUrl = "http://e-radio.gr/player/player.asp?sID=";
Document doc;
for(int code : theCodes){
linkFound=false;
theUrl = "http://e-radio.gr/player/play... | 7 |
private static int getMinElementInRotArrayHelper(int[] arr, int start,
int end)
{
if (end < start) return arr[0];
if (start == end)
{
return arr[start];
}
int mid = (start + end) / 2;
if (mid < end && arr[mid+1] < ar... | 7 |
public PruebaFacade() {
super(Prueba.class);
} | 0 |
public static boolean isDouble(String input)
{
try
{
Double.parseDouble(input);
return true;
}
catch(Exception e)
{
return false;
}
} | 1 |
public void run() {
String msg;
try {
// petla, ktora odczytuje wiadomosci z serwera i wypisuje je
while ((msg = in.readLine()) != null) {
System.out.println(msg);
}
} catch (IOException e) {
System.err.println(e);
}
} | 2 |
static final void method560(Class318_Sub4 class318_sub4, int i) {
try {
anInt8652++;
((Class318_Sub4) class318_sub4).aClass318_Sub1_6410 = null;
int i_11_ = (((Class318_Sub4) class318_sub4)
.aClass318_Sub3Array6414).length;
int i_12_ = 127 / ((i - 82) / 32);
for (int i_13_ = 0; (i_11_ ^ 0x... | 5 |
@FXML
void onRepositoryChanged(ActionEvent event) {
// TODO add your handling code here:
try {
String wrkDir = (String)ctrlRepository.getValue();
ResultSet rs = Repo.fetchByNeve(wrkDir);
String branch = new String();
ObservableList<String> branchList = ctrlBranch.getItems... | 7 |
private void calculateNextIndices() {
Integer[] nextArr = new Integer[v.size()];
Integer target = 0;
Integer startIndex = target;
Set<Integer> usedIndices = new HashSet<>();
while (notAllFilled(nextArr)) {
Integer nextIndex = null;
Edge curEdge = new Edge(points.get(v.get(startIndex)), points.get(v.get(... | 9 |
public void askNbJoueur() {
// Création de la fenêtre de choix
WinMenu nbMenu = new WinMenu("Combien de joueurs pour cette partie ?");
nbMenu.newItem("2 joueurs", 2);
nbMenu.newItem("3 joueurs", 3);
nbMenu.newItem("4 joueurs", 4);
// Affiche la fenêtre de choix
int nbJoueur = nbMenu.open();
// Si... | 3 |
public static void main (String[] args) {
Log.makeLog("Cyc-SOAP-client.log");
CycSOAPClient cycSOAPClient = new CycSOAPClient();
try {
cycSOAPClient.helloWorld();
for (int i = 0; i < 10; i++) {
Log.current.print((i + 1) + ". ");
Log.current... | 2 |
public static String getJsonFromAssets(String filePath) {
InputStream is;
Writer writer = new StringWriter();
char[] buffer = new char[8 * 1024];
try {
is = new FileInputStream(new File(filePath));
Reader reader = new BufferedReader(new InputStreamReader(is, "UTF... | 2 |
@Override
public void run() {
Player player = Bukkit.getPlayer(playerName);
if (player == null) {
return;
}
player.setSleepingIgnored(false);
BukkitTask task = plugin.getIgnoreSleepTasks().get(playerName);
if (task != null) {
task.cancel();
... | 2 |
private void moveIfInBounds(String s) {
if (s == "left") {
animationTimer.stop();
invalidate();
moveView(-movementDistance, 0);
repaint();
animationTimer.start();
} else if (s == "right") {
animationTimer.stop();
invalidate();
moveView(movementDistance, 0);
repaint();
animationTimer.st... | 4 |
public void updateQuality() {
if (sellIn > 0) {
quality++;
}
if(sellIn <= 10) {
quality++;
}
if(sellIn <= 5) {
quality++;
}
if (quality > 50) {
quality = 50;
}
if (sellIn <= 0) {
quality =... | 5 |
private void registerRenderer(IXMLElement xml) {
String name=null,description=null, className = null;
IXMLElement params=null;
Enumeration children = xml.enumerateChildren();
while (children.hasMoreElements()){
IXMLElement child = (IXMLElement)children.nextElement();
if (child.getName().equals("name"))... | 7 |
private static String relativizePath(final String dirStr, final String uriStr) {
// Pfad an Schrägstrichen auftrennen, mehrere aufeinander folgende werden zusammengefasst. (/bla////foo ist gleich /bla/foo)
final String[] dir = dirStr.split("/+", -1);
final String[] uri = uriStr.split("/+", -1);
int commonIndex... | 7 |
public Object deserialize(JsonElement json, Type typeOfT,
JsonDeserializationContext context) {
if (json.isJsonNull()) {
return null;
} else if (json.isJsonPrimitive()) {
return handlePrimitive(json.getAsJsonPrimitive());
} else if (jso... | 3 |
public void startSQL() {
try {
InputStream in = this.getClass().getResourceAsStream("/sols/Util/jdbc.properties");
Properties pp = new Properties();
pp.load(in);
url = pp.getProperty("jdbc.url");
user = pp.getProperty("jdbc.username");
pas... | 1 |
private void placeInterpolationParameters() {
interpolationParametersPanel.setLayout(gridBagLayout);
//Create GridBagConstraints
GridBagConstraints constraints = new GridBagConstraints();
constraints.anchor = GridBagConstraints.NORTHWEST;
constraints.insets = DEFAULT_INSETS;
... | 0 |
static double[][] multiply(double[][] A, double[][] B){
double[][] AB = new double[A.length][B[0].length];
for(int i = 0; i < A.length; i++){
for(int j = 0; j < B[i].length; j++){
for(int k = 0; k < B.length ; k++){
AB[i][j] += A[i][k]*B[k][j];
}
}
}
return AB;
} | 3 |
public static final void notEquals(Object obj, Object another, String message) {
isTrue((obj == null && another != null) || (obj != null && obj.equals(another)), message);
} | 3 |
private static String initialise(Token currentToken,
int[][] expectedTokenSequences,
String[] tokenImage) {
String eol = System.getProperty("line.separator", "\n");
StringBuffer expected = new StringBuffer();
int maxSize = 0;
for (int i = 0; i < expe... | 8 |
public void run(){
while(true){
byte[] data = new byte[1024];
DatagramPacket packet = new DatagramPacket(data, data.length);
try {
socket.receive(packet);
} catch (IOException e) {
e.printStackTrace();
}
this.parsePacket(packet.getData(),packet.getAddress(),packet.getPort());
String messa... | 3 |
public boolean equals(Object o){
if(this == o) return true;
if(!(o instanceof VarDescr)) return false;
VarDescr d = (VarDescr) o;
return (this.addr == d.getAddr()) && (this.typ.equals(d.getTyp()));
} | 3 |
@EventHandler
public void onInteract(PlayerInteractEvent evt){
if(evt.getAction().equals(Action.RIGHT_CLICK_BLOCK)){
if(evt.getClickedBlock().getType() == Material.SIGN || evt.getClickedBlock().getType() == Material.SIGN_POST || evt.getClickedBlock().getType() == Material.WALL_SIGN){
if(((Sign) evt.getClicked... | 7 |
public static Object getMethodArrayValue(java.lang.reflect.Method _p,
Object _o, int _i[]) {
int n, k;
Object o = null;
n = (_i == null) ? 0 : _i.length;
try {
if (_p.getReturnType().equals(java.lang.Integer.TYPE)) {
o = _p.invoke(_o);
} else if (_p.getReturnType().equals(java.lang.Double.TYPE)) {
... | 9 |
public void feedTable(Object[] list) {
Object[][] data = { { "No Results Found!" } };
String[] columnNames = { "Error!" };
if (null != list && list.length > 0) {
// get fields from the first object in array, one object required to
// get columns,
// unless class is added as a parameter? might look bette... | 9 |
private void handleInferenceAnswerResult(CycList data) {
if (data.size() != 2) {
throw new RuntimeException("Got wrong number of arguments " + "from inference result (expected 2): " + data);
}
Object newAnswers = data.get(1);
if ((newAnswers == null) || (!(newAnswers instanceof CycList))) {
... | 6 |
public void toggleContainerHUD(HUD h) {
HUD hud = null;
boolean isOpen = false;
//see if the hud is currently open
for (int i = (huds.size() - 1); i >= 0; i--) {
hud = huds.get(i);
if (hud == h) {
isOpen = hud.getShouldRender();
b... | 6 |
public float retrieveSupplierAmount(String supName) throws SQLException{
float getAmount = 0;
try{
databaseConnector=myConnector.getConnection();
stmnt=(Statement) databaseConnector.createStatement();
SQLQuery="SELECT Amount FROM familydoctor.supplier WHE... | 4 |
public Element parseElement(CharSequence content) {
Map<String,String> styles = new HashMap<String, String>();
Matcher matcher = META.matcher(content);
if(matcher.find()) {
parseStyles(styles, matcher.group(2));
content = matcher.replaceFirst("");
}
Match... | 2 |
public void paint(Graphics g){
g.setColor(Color.BLUE);
g.fillRect(0,0,canvas_width,canvas_height);
g.setColor(Color.BLACK);
int count = 0;
while(count < grid_lines+1){
g.setColor(Color.BLACK);
g.drawLine(0,grid_size_y*count,canvas_height,grid_size_y*count);
g.drawLine(grid_size*count,0,grid_size*coun... | 5 |
public void addPatient(PatientCL newPatient){
if (this.nextPatient == patientListStart){
this.nextPatient = newPatient;
} else {
this.nextPatient.addPatient(newPatient);
}
} | 1 |
public void clearView(Class[] classesToIgnore) {
YIComponent view = controller.getView();
ArrayList comps = YUIToolkit.getViewComponents(view);
Iterator it = comps.iterator();
while (it.hasNext()) {
Object obj = it.next();
if (obj instanceof YIModelComponent) {
... | 6 |
public String nextValue() throws IOException {
if (tokenCache == null){
tokenCache = lexer.getNextToken();
lineCache = lexer.getLineNumber();
}
lastLine = lineCache;
String result = tokenCache;
tokenCache = null;
return result;
} | 1 |
@Override
public int flush(String path, Object fh) throws FuseException {
FileHandle handle = (FileHandle)fh;
if (handle == null)
return Errno.EBADSLT;
if (handle.hasClosed)
return Errno.EBADSLT;
//well... shouldn't happen, but it does happen...
if (!handle.write)
return 0;
//return Errno.EACC... | 4 |
public ConnectionLogger get_logger()
{
return logger;
} | 0 |
public Cell getCell(int[] cell) {
if ((cell[0] < height && cell[1] < width) && (cell[0] >= 0 && cell[1] >= 0)) {
return cells[cell[0]][cell[1]];
} else {
return null;
}
} | 4 |
public void broundMsg(Client sockector, Response msg) throws IOException{
byte[] msgs = CoderUtils.toByte(msg.getBody());
ClustersMessage messageFrame = sockector.getRequestWithFile().<ClustersMessage>getMessageHeader(msg.getRequestIndex());
if(messageFrame == null){
messageFrame = new ClustersMessage();
... | 3 |
private static void Trigger(){
if(_cmd.getArgs().length == 0){
return;
}
if(_cmd.getArg(0).equalsIgnoreCase("reload")){
if(_cmd.isPlayer()){
if(!_cmd.getPlayer().hasPermission(_Permission + ".reload")){
if(!_cmd.getPlayer().isOp()){
sendMessage("You do not have permission to run this command"... | 5 |
public void update(long dt)
{
if (Config.use_wasd) {
Coord newWASD = APXUtils.updateWASD();
if (!newWASD.equals(lastWASD)) {
lastWASD = newWASD;
map_click_ntf(lastWASD.x, lastWASD.y, 1, 0);
}
}
Gob pl = glob.oc.getgob(playergob);
Coord myCurrentCoord = null;
if(pl != null)
{
myCurren... | 7 |
boolean readMessage(ObjectInputStream ips) {
Message receive = null;
String name = nickname;
try {
Object fromServ = ips.readObject();
if (fromServ instanceof Message) receive = (Message) fromServ;
} catch (IOException | ClassNotFoundException e) {
e.printStackTrace();
}
if (receive instan... | 5 |
public LoginWindow(final MasterModel masterModel) {
super("MyCMS Login");
// this.intro = intro;
addWindowListener(new java.awt.event.WindowAdapter() {
@Override
public void windowClosing(java.awt.event.WindowEvent windowEvent) {
dispose();
masterModel.intro.rebirthIntro();
}
});
// Changed t... | 9 |
public static void main(String [] args) {
//Create a starting time
double startTime = System.currentTimeMillis();
String bigNum = "73167176531330624919225119674426574742355349194934" +
"96983520312774506326239578318016984801869478851843" +
"85861560789112949495459501737958331952853208805511" +
"1254069874... | 3 |
@Override
public void run(Request r) {
if (!isStarted()) {
return;
}
WebServer.logDebug("Site's Run Called on RequestID: " + r.getRequestID() + " For site " + getName());
boolean found = false;
for (String defaultDocument : getDefaultDocuments()) {
i... | 8 |
public int getStartStop() {
return this._startStop;
} | 0 |
private void setMarketPathToScale() {
graphInterval = (frameW - 2 * SIDE_BUFFER)
/ (marketComparison.size() - 1);
gridLines.clear();
float minimumPt = findMinimum(marketComparison.values());
float maximumPt = findMaximum(marketComparison.values());
// System.out.println("range: "+minimumPt+" --- "+max... | 2 |
public static String getJmeterVersion() {
String version = JMeterUtils.getJMeterVersion();
int hyphenIndex = version.indexOf("-");
int spaceIndex = version.indexOf(" ");
return (hyphenIndex != -1 & spaceIndex == -1) ?
version.substring(0, hyphenIndex) :
... | 1 |
public double getHeight() {
return height;
} | 0 |
public static void main(String[] args) {
String line = "";
String message = "";
int c;
try {
while ((c = System.in.read()) >= 0) {
switch (c) {
case '\n':
if (line.equals("go")) {
PlanetWars pw = new PlanetWars(message);
DoTurn(pw);
pw.FinishTurn();
message = "";
} e... | 4 |
private void setRandomColor() {
Random estrattore = new Random();
int estratto = estrattore.nextInt(7);
switch (estratto) {
case 0:
jLabel4.setForeground(Color.BLACK);
break;
case 1:
jLabel4.setForeground(Color.BLUE);
break;
cas... | 7 |
@Override
public Model getRotatedModel() {
Model model = animation.getModel();
if (model == null)
return null;
int frame = animation.sequences.frame2Ids[elapsedFrames];
Model animatedModel = new Model(true, Animation.isNullFrame(frame),
false, model);
if (!transformationCompleted) {
animatedModel.c... | 8 |
protected void genDeity(MOB mob, MOB M, int showNumber, int showFlag)
throws IOException
{
if((showFlag<=0)||(showFlag==showNumber))
{
mob.tell(L("@x1. Deity (ID): '@x2'.",""+showNumber,M.getWorshipCharID()));
if((showFlag==showNumber)||(showFlag<=-999))
{
final String newName=mob.session().prompt(L(... | 7 |
@Override
public boolean onCommand(CommandSender sender, Command command,
String label, String[] args) {
if (args.length == 1 && args[0].equalsIgnoreCase("help")) {
showHelp(sender);
return true;
}
if (args.length == 1 && args[0].equalsIgnoreCase("list")) ... | 6 |
public static void garbageDisposal() {
for (ArrayList orgs : organisms) {
for (int i = 0; i < orgs.size(); i++) {
Organism g = (Organism) orgs.get(i);
if (g.life.isDead()) {
g.life.kill();
orgs.remove(g);
i--;
}
}
}
} | 3 |
private void consoleCommands(String cmd){
if(cmd.equals("night"))
GameTime = 18000;
else if(cmd.equals("day"))
GameTime = 0;
else if(cmd.startsWith("need")){
String [] split = cmd.split("\\s+") ;
if(split.length == 3){
Item item = Items.getItemFromUIN(split[1]);
if(item != null){
ItemStac... | 5 |
public Parser(String in, Library lib) {
// init TOKENIZER
this.in = in;
read();
// init PARSER
this.lib=lib;
paramOPs=new Stack<OP>();
xchgOP=new Stack<OP>();
// initialize DV names accumulator
if (lib.resolver!=null)
accDV=new StringBuffer();
}; | 1 |
public String toCSV(){
return id+";"+date+";"+taille;
} | 0 |
public static void _drawHalfSphere(float r, int scalex, int scaley)
{
int i, j;
float[][] v = new float[scalex * scaley][3];
for (i = 0; i < scalex; ++i)
{
for (j = 0; j < scaley; ++j)
{
v[i * scaley + j][0] = r * (float) cos(j * 2 * PI / scale... | 4 |
@Override
public void handle(MouseEvent event) {
if (isSelected()) {
if (event.getButton() == MouseButton.PRIMARY) {
if (getGraphic() == null) {
for (ButtonEventHandler buttonEvent : buttonEventList) {
buttonEvent.onLeftClick(xPos, yPos);
buttonEvent.onFirstClick();
}
} else {
s... | 7 |
public static void incrementProgress(int progress) {
if (GlobalDialogs.progressDialogStatusBar != null) {
if (progress > 100 || GlobalDialogs.progressDialogStatusBar.getValue() + progress > 100) {
GlobalDialogs.progressDialogStatusBar.setValue(100);
} else {
... | 3 |
public boolean getBoolean(int index) throws JSONException {
Object object = get(index);
if (object.equals(Boolean.FALSE) ||
(object instanceof String &&
((String)object).equalsIgnoreCase("false"))) {
return false;
} else if (object.equals(Boolean.TRUE)... | 6 |
public static void Close(Connection a,Statement b){
if(b != null){
try{
b.close();
}catch(SQLException e){}
}
if( a!= null){
try{
a.close();
}catch(SQLException e){}
}
} | 4 |
@Override
public boolean equals(Object obj) {
if (!(obj instanceof Card))
return false;
Card cobj = (Card) obj;
return card == cobj.card && x == cobj.x && y == cobj.y;
} | 3 |
@EventHandler(priority = EventPriority.HIGHEST)
public void chatEvent(final AsyncPlayerChatEvent event) {
// Don't care about event if it is cancelled
if(event.isCancelled() || event.getPlayer() == null) {
return;
}
if(event.getMessage().charAt(0) == '#') {
//... | 6 |
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.