text stringlengths 14 410k | label int32 0 9 |
|---|---|
public void setInstallDate(String installDate) {
this.installdate = installDate;
setDirty();
} | 0 |
private boolean isNumberDouble(String input) {
boolean res = true;
int i = 0;
if(input == null || input.isEmpty() || input.endsWith(".") || !input.contains("."))
res = false;
else{
i = 0;
while(i < input.length() && res){
if(!Character.isDigit(input.charAt(i)) && (input.charAt(i) != '.'))
res... | 8 |
public void playGameAsHost(ArrayList<User> gameUsers, HostGameTask hgt)
throws InterruptedException, IOException, InvalidKeySpecException,
NoSuchAlgorithmException, NoSuchPaddingException,
NoSuchProviderException, InvalidKeyException, BadPaddingException,
IllegalBlockSizeException {
EncryptedDeck encDeck;... | 1 |
@EventHandler
public void onInventoryClose(InventoryCloseEvent e)
{
if (e.getInventory().getName().equals(Message.REWARD_CLAIM_INVENTORY_NAME.toString()))
{
for (ItemStack itemStack : e.getInventory().getContents())
if (itemStack != null)
e.getPlayer().getWorld().dropItemNaturally(e.getPlayer().getLoc... | 4 |
@Override
public void clearObservers() {
readers.clear();
} | 0 |
public void setGoToList(ArrayList<String> goToList) {
this.goToList = goToList;
} | 0 |
@Override
public boolean validCapture(Point startPosition, Point endPosition){
Point difference = new Point();
difference.setLocation(endPosition.getX() - startPosition.getX(), endPosition.getY() - startPosition.getY());
if(this.getColor() && (Math.abs(difference.getX()) == 1 && (difference.getY() == 1))){
... | 6 |
@Override
public void bindTexture(TextureManager textureManager) {
// If skin changed, or if no skin texture is yet loaded...
if (skinBitmap != newSkinBitmap || textureId < 0) {
synchronized (this) {
if (skinBitmap != newSkinBitmap || textureId < 0) {
... | 9 |
public void run() {
long time = System.currentTimeMillis();
while ( true ) {
long thisTime = System.currentTimeMillis();
if ( thisTime - time < FPS_TIME ) {
continue;
}
int len = SceneDirector.getLength();
int last = len - 1;
for ( int i = 0; i < len; i++ ) {
Scene sc... | 3 |
@Override
public int getSamples(byte[] buffer) {
byte[] cvBuffer = null;
provider.getSamples(buffer);
if(attenuationCv != null) {
cvBuffer = new byte[buffer.length];
attenuationCv.getSamples(cvBuffer);
}
int index = 0;
for(int i = 0; i < bu... | 5 |
private boolean doConditionalAction(GenericLittleMan<?> littleMan) {
boolean isComplete2 = littleManConditionalAction.doAction(littleMan);
if (isComplete2) {
resetConditionalActionStep();
}
return isComplete2;
} | 2 |
public List<String> getCyclingPeptideStrings(int stringLength, String peptide) {
List<String> peptideMassList = new ArrayList();
for (int i = 0; i < peptide.length(); i++) {
StringBuilder stringBuilder = new StringBuilder();
if ((stringLength + 1) == peptide.length()) {
... | 4 |
private Component cycle(Component currentComponent, int delta) {
int index = -1;
loop : for (int i = 0; i < m_Components.length; i++) {
Component component = m_Components[i];
for (Component c = currentComponent; c != null; c = c.getParent()) {
if (component == c) {
index = i;
break loop;
}
... | 8 |
@Override
public void executeMsg(Environmental host, CMMsg msg)
{
if((msg.sourceMinor()==CMMsg.TYP_SPEAK)
&&(!noRecurse)
&&(affected instanceof MOB)
&&(msg.amISource((MOB)affected))
&&(msg.source().location()!=null)
&&(msg.source().charStats().getMyRace().bodyMask()[Race.BODY_MOUTH]>=0))
{
noRecurse=... | 7 |
@Override
public void reset() {
super.reset();
weight = 0;
gravityForce.set(0, 0, 0);
setTotalForce(gravityForce);
} | 0 |
public void doAddUser(){
if( (newName.getText().length() > 0 && newSurname.getText().length() > 0 && newFisCod.getText().length() > 0 &&
newUserName.getText().length() > 0 && newPwd.getText().length() > 0 && confNewPwd.getText().length() > 0) && (confNewPwd.getText().equals(newPwd.getText()) ) ){ //T... | 8 |
void onFocusOut () {
hasFocus = false;
if (itemsCount == 0) {
redraw ();
return;
}
if (focusItem != null) {
redrawItem (focusItem.index, true);
}
if ((getStyle () & (SWT.HIDE_SELECTION | SWT.MULTI)) == (SWT.HIDE_SELECTION | SWT.MULTI)) {
for (int i = 0; i < selectedItems.length; i++) {
redrawItem (sele... | 4 |
public void run() {
if (drawFlames) {
processFlameDrawing();
} else {
super.run();
}
} | 1 |
public void nondeterministicPreCanonicalization(NamedGraph g) throws Exception{
//Get triples
ArrayList<Triple> triples=g.getTriples();
//Get C14N Predicate
String c14n=Ontology.getC14NPredicate();
//Count and substitute blank nodes
substituteBlankNodes(triples);
//Perform a one-step deterministi... | 9 |
private void setParam() {
if (anon) {
try {
ctx.init(null, null, null);
} catch(KeyManagementException e) {
throw new AuthFailureException(e.getMessage());
}
} else {
try {
TrustManager[] myTM = new TrustManager[] {
new MyX509TrustManager()
};
... | 6 |
public void setRAMBufferSizeMB(double mb) {
if (mb > 2048.0) {
throw new IllegalArgumentException("ramBufferSize " + mb + " is too large; should be comfortably less than 2048");
}
if (mb != DISABLE_AUTO_FLUSH && mb <= 0.0)
throw new IllegalArgumentException(
"ramBufferSize should be > ... | 6 |
@Override
@SuppressWarnings({ "nls", "boxing" })
protected void initialize(Class<?> type, Object oldInstance,
Object newInstance, Encoder enc) {
// Call the initialization of the super type
super.initialize(type, oldInstance, newInstance, enc);
// Continue only if initializin... | 7 |
public int isMissingMeta(File mp3){
try {
String title, artist, bpm;
AudioFile f = AudioFileIO.read(mp3);
Tag tag = f.getTag();
if(tag == null){
return 9;//No tag what a drag.
}
artist = tag.getFirst(FieldKey.ARTIST);
title = tag.getFirst(FieldKey.TITLE);
bpm = tag.getFirst(FieldKey.BPM);
... | 5 |
public static void asm_andwf(Integer befehl, Prozessor cpu) {
Integer w = cpu.getW();
Integer f = getOpcodeFromToBit(befehl, 0, 6);
Integer erg = w & cpu.getSpeicherzellenWert(f);
if(getOpcodeFromToBit(befehl, 7, 7) == 1) {
cpu.setSpeicherzellenWert(f, erg, true);
}
else {
cpu.setW(erg, true);
}
... | 1 |
@EventHandler
public void onPlayerLogin(final PlayerLoginEvent event) {
String player = event.getPlayer().getName();
/**
* Check if the player is banned.
*
* Kick with the appropriate message if so.
*/
if (this.plugin.isBanned(player)) {
event... | 4 |
public void paint(Graphics g) {
super.paint(g);
for(int i = 0; i < area.entities.size(); i++) {
area.entities.get(i).render(g);
}
if(area.isEmpty(hold))
hold.render(g);
else
g.drawImage(Images.cross, (int)hold.x - 16 - View.x, (int)hold.y - 16 - View.y, null);
g.setColor(new Color(192, 192, 1... | 2 |
public static Rectangle stringToRectangle(String s, Rectangle defaultValue)
{
if (s == null) return defaultValue;
String[] sa = s.split(" +");
if (sa.length != 4) return defaultValue;
int[] ia = new int[4];
for (int i = 0; i < 4; i++)
try
{
ia[i] = Integer.parseInt(sa[i]);
}
catch (NumberF... | 4 |
public boolean equals( Object other ) {
if ( _set.equals( other ) ) {
return true; // comparing two trove sets
} else if ( other instanceof Set ) {
Set that = ( Set ) other;
if ( that.size() != _set.size() ) {
return false; // different sizes, no need ... | 6 |
public static void init(){
if(initialized) {System.err.println("Init done"); return; }
//System.err.println("Doing init");
initialized=true;
t = get_t();
// Get OS if that is important
if(isWindows()){
_SYS = OS.WIN;
}else if(isMac()){
_SYS = OS.MAC;
}else if(isUnix()){
_SYS = OS.LIN;
}... | 9 |
protected boolean ready() throws IOException {
if (reader == null) return false; // No reader? then we are not ready
if (nextLine != null) return true; // Next line is null? then we have to try to read a line (to see if one is available)
readLine();
return nextLine != null; // Line was read from the file? Then ... | 2 |
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Salesman other = (Salesman) obj;
if (!Objects.equals(this.salesman, other.salesman)) {
return... | 3 |
@Override
public boolean canMove(Board board, Field currentField, Field emptyField) {
return validSetupForMove(currentField, emptyField) && currentField.inDiagonalPathWith(emptyField) && board.clearPathBetween(currentField, emptyField);
} | 2 |
public static ArrayList<Planet> forPlanet(SimulatedPlanetWars simpw){
ArrayList<Planet> asw = new ArrayList<Planet>(2);
// Find the biggest fleet to attack with
int maxShips = 0;
for (Planet p : simpw.MyPlanets()){
if (p.NumShips() > maxShips){
maxShips = p.NumShips();
asw.add(0,p);
}
}
// Fi... | 5 |
static void checkMethodDesc(final String desc) {
if (desc == null || desc.length() == 0) {
throw new IllegalArgumentException(
"Invalid method descriptor (must not be null or empty)");
}
if (desc.charAt(0) != '(' || desc.length() < 3) {
throw new Illeg... | 9 |
public CourseDatabaseManager() {
try {
Class.forName(driver);
conn = (Connection) DriverManager
.getConnection(url, user, password);
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.p... | 2 |
@Override
public int compare( Method a, Method b )
{
int c0 = a.getName().compareTo( b.getName() );
if (c0 != 0)
{
return c0;
}
Class<?>[] pa = a.getParameterTypes();
Class<?>[] pb = b.getPa... | 6 |
private void drawSetupMode(Graphics2D g) {
switch (setupMode) {
case 1:
if(!numAIChosen){
drawString(g, "Number of AI: ", 30, 25, 645, Color.BLACK);
}else{
drawString(g, "Number of players: ", 30, 25, 645, Color.BLACK);
}
break;
case 2:
drawString(g, "Player " + (turn + 1), 40, 25, 625, Col... | 8 |
@Override
public void exception(String msg, Throwable t) {
StringBuilder message = new StringBuilder();
message.append("An exception occured in the garbage collector!").append("\r\n");
message.append("\t").append("reason: ").append(msg).append(".");
if (t != null)
log.log(Level.SEVERE, message.toString(), t... | 1 |
public double teaTypeSplitInfo() {
double result = 0.0;
double blackTeaSize = 0.0;
double whiteTeaSize = 0.0;
double greenTeaSize = 0.0;
for (Tea t : trainingSet) {
if (t.getTeaType().equals(Tea.BLACK_TEA)) {
blackTeaSize++;
}
if (t.getTeaType().equals(Tea.GREEN_TEA)) {
whiteTeaSize++;
}
... | 4 |
public Gezin(int gezinsNr, Persoon ouder1, Persoon ouder2) {
if (ouder1 == null) {
throw new RuntimeException("Eerste ouder mmag niet null zijn");
}
if (ouder1 == ouder2) {
throw new RuntimeException("ouders hetzelfde");
}
this.gezinsNr = gezinsNr++;
... | 3 |
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Thai thai = (Thai) o;
if (age != thai.age) return false;
if (dumb != thai.dumb) return false;
if (name != null ? !name.equals(thai.name) : thai.name != null) return false;
... | 9 |
public String getAssignee() {
return assignee;
} | 0 |
private static Move BackwardLeftCaptureForBlack(int r, int c, Board board){
Move backwardLeftCapture = null;
if(r<Board.rows-2 && c<Board.cols-2 && (
board.cell[r+1][c+1].equals(CellEntry.white)
|| board.cell[r+1][c+1].equals(CellEntry.whiteKing)
... | 5 |
public void setAction(final Action newAction)
{
final Action oldAction = getAction();
if (oldAction != null)
{
removeActionListener(oldAction);
oldAction.removePropertyChangeListener(getPropertyChangeHandler());
final Object o = oldAction.getValue(ActionDowngrade.ACCELERATOR_KEY);
... | 9 |
public void listen() {
SSLSocket s = null;
SSLServerSocket serverSocket = null;
try {
System.out.println(DropboxConstants.SERVER_PORT);
//serverSocket = new ServerSocket(DropboxConstants.SERVER_PORT);
serverSocket = (SSLServerSocket)this.sslserversocketfactory.createSe... | 7 |
public boolean verificationComptabilite(String cheminAccesATester){
boolean aRetourner = false;
try{
Image img = ImageIO.read(new File(cheminAccesATester));
BufferedImage envTest = (BufferedImage)img;
int nbrPixel = envTest.getHeight()*envTest.getWidth();
if( (nbrPixel/3) >= GestionFichier.fichierEnFlux... | 3 |
@Override
public XValue invoke(XRuntime runtime, XExec exec, int id, XValue thiz, XValue[] params, List<XValue> list, Map<String, XValue> map) {
switch (id) {
case 0:
return thiz;
case 1:
return add(runtime, thiz, params[0]);
case 2:
return indexOf(runtime, thiz, params[0]);
case 3:
return substr... | 6 |
@Override
public void openFrame(JInternalFrame f) {
//System.out.println("openFrame");
super.openFrame(f);
updateDesktopSize(false);
} | 0 |
@Override
public int hashCode() {
int result = id;
result = 31 * result + (begdate != null ? begdate.hashCode() : 0);
result = 31 * result + (begtime != null ? begtime.hashCode() : 0);
result = 31 * result + (enddate != null ? enddate.hashCode() : 0);
result = 31 * result + (... | 5 |
public String getAttributeEnumeration(String name, String aname)
{
Object attribute[] = getAttribute(name, aname);
if (attribute == null) {
return null;
} else {
return (String) attribute[3];
}
} | 1 |
@Override
public String adiciona(HttpServletRequest request,
HttpServletResponse response) {
HttpSession session = request.getSession();
session.removeAttribute("usuarioLogado");
return "/WEB-INF/paginas/logout.html";
} | 0 |
@EventHandler(priority = EventPriority.MONITOR)
public void onPlayerChat(PlayerChatEvent e)
{
IrcClient client = Parent.Manager.getCurrentClient();
for(String s : client.getMcEcho_ActiveChannels())
{
try{ client.PrivMsg(s, IrcColor.formatMCMessage(ChatManagerUtils.ParseMessag... | 3 |
private static void editInfo() {
MainMenuUI mainMenu = new MainMenuUI();
int option = mainMenu.editInformation();
switch (option) {
case 1:
editProduct();
break;
case 2:
editCategory();
break;
case 3:
editUser();
break;
case 0:
break;
default:
mainMenu.showOptionNotValid();
}
... | 4 |
private void convertFrequencies() {
for (Entry<Double, Long> ent : frequencies.entrySet()) {
if (freq_s.containsKey(ent.getValue())) {
freq_s.put(ent.getValue(), freq_s.get(ent.getValue())+ent.getKey());
}else{
freq_s.put(ent.getValue(),ent.getKey());
}
}
} | 2 |
public static void main(String[] args)
{
System.out.println(HanziToPinYinHead.getFirstLetter("I love u"));
System.out.println(HanziToPinYinHead.getFirstLetter("我爱北京天安门 匡乔顺龙万友谊栾"));
System.out.println(HanziToPinYinHead.getFirstLetter("I love 北京天安门"));
} | 0 |
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int tests = sc.nextInt();
String[] input = new String[tests];
for(int i = 0 ;i<tests;i++){
input[i] = sc.next();
}
solve(input);
sc.close();
} | 1 |
public static String getTipoVariavel (String ip, String comunidade, String objeto) throws IOException, NoSuchObjectException, NoSuchInstanceException {
// Inicia sessaso SNMP
TransportMapping transport = new DefaultUdpTransportMapping();
Snmp snmp = new Snmp(transport);
transport.listen(... | 8 |
public static void main(String[] args) {
int arr2[]={1,11,111,2,334,45454,56,56,45};
quick n1=new quick();
n1.sort(arr2);
for(int i=0;i<arr2.length;i++)
{
System.out.println(arr2[i]);
}
} | 1 |
@Override
public void rotate(int angle) {
Tile[][] trans;
int xtrans = 0, ytrans = 0;
switch (angle) {
case ROTATE_90:
trans = new Tile[bounds.width][bounds.height];
xtrans = bounds.height - 1;
break;
case ROTATE_180:
... | 5 |
public boolean isLive() {
return isLive;
} | 0 |
public String genStream(linkedList add)
{
//Generate the key
String myStream;
myStream = glbKey;
char temp = 0;
//Generate type character
if (blIsBase)
temp = (char) (temp|2);
//Generate server active bit
if(canServer)
temp = (char) (temp|4);
//Generate the willing to connect bit
if(add!= nu... | 8 |
public void start()
{
mRunning = mGenerate = true;
while (mRunning)
{
while (mGenerate)
generate();
render();
mViewer.repaint();
try
{
Thread.sleep(10);
}
catch (InterruptedException e)
{
e.printStackTrace();
}
}
mViewer.stopWindow();
} | 3 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
InternalStorage other = (InternalStorage) obj;
if (capacity != other.capacity)
return false;
if (dataTransferRate != other.dataTransf... | 6 |
public static int getWidth(String s)
{
int curLine = 0;
int maxLine = 0;
char[] chars = s.toLowerCase().toCharArray();
for(char c : chars)
{
if(c == 'i' || c == 'l' || c == 't' || c == 'v')
{
curLine += 7;
}
else if(c == '.' || c == ',')
{
curLine += 2;
}
else if(c == '\n')
{
... | 9 |
public WeaponPanel(String name) {
setSize(new Dimension(585, 300));
setLayout(null);
try {
this.sprite = new EditSprite(System.getProperty("resources") + "/sprites/" + name + ".png");
maxDir = this.sprite.getMaxDir();
maxFrame = this.sprite.getMaxFrame();
} catch(Exception e) {
sprite = null;
}... | 3 |
public static void update(String eDatabase, String table,String column, String VALUES, String where){
Connection gCon = null; // general connection to MYSQL
Connection eCon = null; // connection to database
Statement eStatement = null; // statements for the eDatabase
try{
// Register J... | 8 |
@Override
public void handleGridEvent(GridEvent e) {
if(e.getSource().equals(builder)) {
if(admode.equals(AddDelMode.Add)){
if(mode.equals(EditorMode.Background)) {
builder.setBackgroundAtSelector(splitter.getSelectorPoint());
} else if(mode.equals(EditorMode.Object)) {
builder.setObjectAtSelect... | 8 |
public DatagramPacket GetPacket()
{
return dPacket;
} | 0 |
static int process(String line) {
String[] splts = line.trim().split(" ");
int n = Integer.parseInt(splts[0]), m = Integer.parseInt(splts[1]);
long c = Long.parseLong(splts[2]);
if(n == 0 && m == 0 && c == 0)
return 0;
long[] cons = new long[n];
boolean[] state = new boolean[n];
long p = 0;
... | 9 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
ClaveDeReferenciable other = (ClaveDeReferenciable) obj;
if (end == null) {
if (other.end != null)
return false;
} else if (!end.equals(... | 9 |
public static int createTexturedDisplayList(Model m) {
int displayList = glGenLists(1);
glNewList(displayList, GL_COMPILE);
{
glBegin(GL_TRIANGLES);
for (Model.Face face : m.getFaces()) {
if (face.hasTextureCoordinates()) {
glMaterial(G... | 8 |
public static void moveRightText(OutlinerCellRendererImpl textArea, JoeTree tree, OutlineLayoutManager layout) {
Node currentNode = textArea.node;
if (textArea.getCaretPosition() == textArea.getText().length()) {
// Get Next Node
Node nextNode = tree.getNextNode(currentNode);
if (nextNode == null) {
t... | 4 |
@Before
public void setUp() throws Exception
{
// set up the Players with predefined behaviour.
_paperPlayer = new Player("Paperman");
_paperPlayer.setDrawOutput(Output.Paper);
_rockPlayer = new Player("Rocker");
_rockPlayer.setDrawOutput(Output.Rock);
_scissorP... | 0 |
@XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "SPKISexp", scope = SPKIDataType.class)
public JAXBElement<byte[]> createSPKIDataTypeSPKISexp(byte[] value) {
return new JAXBElement<byte[]>(_SPKIDataTypeSPKISexp_QNAME, byte[].class, SPKIDataType.class, ((byte[]) value));
} | 0 |
private void checkPermissions() {
String name = player.getStatus();
if (name.equals("Create")) {
permitGoverning(false);
permitNationName(false);
permitTravel(false);
permitPropose(false);
permitCoup(false);
permitNewGov(false);
permitJoin(false);
permitVoteTaxe... | 6 |
public void paint(Graphics2D g) {
g.setColor(foregroundColor);
g.setFont(xLabelFont);
if (recalculateBounds) {
initializeBounds(g);
}
// if (allowMouseDragSelection && mouseIsBeingDragged) {
// int xStart = round(mouseDragStart.x*xFactor);
// int xEnd = round(mouseDragEnd.x*xFactor);
// int rec... | 7 |
public void warn(Event event) {
switch (event.getTypeEvent()) {
case BUMP:
if (state == State.START)
state = State.PLUCK_BUMPED;
else
ignore();
break;
case USECLAWS_END:
if (state == State.PLUCK_BUMPED)
state = State.PLUCK_CAUGHT;
else
ignore();
break;
case ROTATE_END:
if (s... | 9 |
@Override
public Sentence doProcess(Sentence st) {
String prevTag = null;
boolean changed = false;
Eojeol[] eojeolSet = st.getEojeols();
for (int i = 0; i < eojeolSet.length; i++) {
String[] tags = eojeolSet[i].getTags();
prevTag = "";
changed = false;
for (int j = 0; j < tags.length; j++... | 6 |
private double get_w_value(int idx, int label_idx) {
if (idx < 0 || idx > nr_feature) {
return 0;
}
if (solverType.isSupportVectorRegression()) {
return w[idx];
} else {
if (label_idx < 0 || label_idx >= nr_class) {
return 0;
... | 8 |
public static Creature parseFile(File f){
Creature result = null;
try {
Scanner sc = new Scanner(f);
String name = sc.nextLine();
int level = Integer.parseInt(sc.nextLine());
int initiative = Integer.parseInt(sc.nextLine());
int speed = Integer.parseInt(sc.nextLine());
String[] abbs = sc.nextL... | 6 |
public static String formatTime(long time) {
time /= 1000;
String seconds = Long.toString(time % 60) + "s";
if (time < 60) {
return seconds;
}
String minutes = Long.toString((time % 3600) / 60) + "m ";
if (time < 3600) {
return minutes + seconds;
... | 3 |
public static void insertPrimitiveSuper(Surrogate newsuper, List supers) {
{ boolean foundP000 = false;
{ Surrogate sup = null;
Cons iter000 = supers.theConsList;
loop000 : for (;!(iter000 == Stella.NIL); iter000 = iter000.rest) {
sup = ((Surrogate)(iter000.value));
if (S... | 7 |
private int hexDigit(int value){
if(value>='0' && value<='9')
return (value-'0');
else if(value>='a' && value<='f')
return (value-'a')+10;
else if(value>='A' && value<='F')
return (value-'A')+10;
else
return -1;
} | 6 |
private void parseArgs(String[] args) {
if (args != null && args.length > 0) {
for (String arg : args) {
if (arg.startsWith("-") && arg.lastIndexOf("=") != -1) { // -config="server.config"
arg = arg.substring(1, arg.length());
String[] keyValue... | 6 |
@Override
public double getMissingMoney(double priceInEuros) {
if (priceInEuros < 0)
throw new IllegalArgumentException("ERR00034452b");
if (priceInEuros > totalAmountInEuros)
return priceInEuros - totalAmountInEuros;
else
return 0;
} | 2 |
protected void openDocument() throws XPathException {
if (writer==null) {
makeWriter();
}
if (characterSet==null) {
characterSet = UTF8CharacterSet.getInstance();
}
// Write a BOM if requested
String encoding = outputProperties.getProperty(OutputK... | 9 |
private static int resolveFirstDayOfWeek(String firstDayOfWeek) {
if (firstDayOfWeek.equalsIgnoreCase("sunday")) {
return SUNDAY;
}
else if (firstDayOfWeek.equalsIgnoreCase("monday")) {
return MONDAY;
}
else if (firstDayOfWeek.equalsIgnoreCase("tuesday")) ... | 7 |
private void readParameterAnnotations(int v, final String desc,
final char[] buf, final boolean visible, final MethodVisitor mv) {
int i;
int n = b[v++] & 0xFF;
// workaround for a bug in javac (javac compiler generates a parameter
// annotation array whose size is equal to t... | 4 |
public static Object mlmpVehicleSpawn(int type, World world, double x, double y, double z, Entity thrower, Object currentEntity) throws Exception
{
Class mlmp = getClass("ModLoaderMp");
if (!isMLMPInstalled() || mlmp == null)
{
return currentEntity;
}
Ob... | 7 |
public static void enableEvent(Cuboid c, CuboidEvent event) {
if (c == null || event == null) return;
if (c.getEvents().contains(event)) return;
c.getEvents().add(event);
} | 3 |
private void storeWrite() { try {
if (localstorefile==null) return;
PrintWriter writer=new PrintWriter(
new FileWriter(new File(localstorefile)) );
for (Enumeration e=localstore.keys(); e.hasMoreElements(); ) {
String k = (String)e.nextElement();
Object o = localstore.get(k);
if (o instanceof Integer)... | 6 |
public boolean isGravityDebugStatus() {
if(frame == null) buildGUI();
return gravityDebugStatus.isSelected();
} | 1 |
public static ArrayList<Ticket> showAll() {
ArrayList<Ticket> tickets = new ArrayList<Ticket>();
Database db = dbconnect();
try {
db.prepare("SELECT * FROM ticket ORDER BY TID");
ResultSet rs = db.executeQuery();
while(rs.next()) {
tickets.add(TicketObject(rs))... | 2 |
public boolean doneCheck(UQuest plugin, Player player){
try{
Quester quester = plugin.getQuestInteraction().getQuester(player);
//gatherObectives(plugin, player, quester);
int doneAmount = 0;
for(Objective objective : this.objectives){
if(objective.doneCheck(player, quester.getTracker(plugin, objectiv... | 4 |
protected static Output getInstance() {
if (instance == null) {
new Output();
}
return instance;
} | 1 |
public String getClassType(int i) throws ClassFormatException {
if (i == 0)
return null;
if (tags[i] != CLASS)
throw new ClassFormatException("Tag mismatch");
String clName = getUTF8(indices1[i]);
if (clName.charAt(0) != '[') {
clName = ("L" + clName + ';').intern();
}
try {
TypeSignature.checkT... | 4 |
public Response changerEtatDuneAnomalie(String nomProjet,
String sujetAnomalie, Note note, UriInfo uri,String newEtat) throws Exception {
URI uriReponse;
Response reponse;
Projet projet;
Anomalie newAnomalie;
int index;
long idToRemove = -1;
projet = dao.getProjet(nomProjet);
if(projet != null){
i... | 8 |
@Override
public void actionPerformed(ActionEvent e) {
for(int i=0; i<10; i++){
if(levelItems[i]==e.getSource())
{
canvas.load(i);
break;
}
}
if(reset == e.getSource())
{
canvas.reset();
}
if(load == e.getSource())
{
int returnVal = fc.showOpenDialog(null);
... | 8 |
public static void main(String[] args) throws SocketException {
instance = new UDPChat();
} | 0 |
@Override
public void dump(Map<String, Object> into) throws IOException {
super.dump(into);
{
StringBuilder request = new StringBuilder(requestHeaders);
request.append(EOL);
if (requestExcerpt != null) {
request.append(new String(requestExcerpt, re... | 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.