text stringlengths 14 410k | label int32 0 9 |
|---|---|
public void setURI(String value) {
this.uri = value;
} | 0 |
public void visitEnd() {
if (!subroutineHeads.isEmpty()) {
markSubroutines();
if (LOGGING) {
log(mainSubroutine.toString());
Iterator it = subroutineHeads.values().iterator();
while (it.hasNext()) {
Subroutine sub = (Subroutine) it.next();
log(sub.toString());
}
}
emitCode();
}... | 4 |
public void listTickers(){
List<String> tickers = new ArrayList<String>();
while(true){
this.tUI.printGuide1();
while(true){
String s = this.inputScanner.nextLine();
if(s.isEmpty()){
break;
}
tick... | 4 |
protected String checkFolder(String folderPath) {
File dir = new File(folderPath);
if (!dir.exists()) {
return("The music folder '"+folderPath+"' does not exist.");
} else if (!dir.isDirectory()) {
return("The music folder '"+folderPath+"' must be a directory.");
} else if (!dir.canRead()) {
return(... | 3 |
public Byte toByteHelper(Bits bits, Node currentNode) {
if(currentNode == null){
//The byte we're looking for isn't in the tree. Return null.
return (Byte) null;
}
// Determine if currentNode has data.
if (currentNode.data != null) {
// If it does, return that data. Yay.
return (Byte) currentNode.da... | 3 |
public void createTransitions(State currrentState, Boolean startState) {
HashSet<Transition> outgoing = getOutgoingTransition(currrentState);
State newSrcState = getMatchingState(currrentState);
Block newSrcBlock = StateToBlock.get(currrentState);
this.VisitedBlocks.add(newSrcBlock);
for (Transition ... | 6 |
private String getDescription() {
String desc = "@BatchUpdate(" + this.getParsedSql().getOriginalExpression() + ")";
if (this.isReturnId()) {
desc = desc + ",@ReturnId()";
}
return desc;
} | 1 |
public final String getMethodName(int identifier) {
String mname = getReflectiveMethods()[identifier].getName();
int j = ClassMetaobject.methodPrefixLen;
for (;;) {
char c = mname.charAt(j++);
if (c < '0' || '9' < c)
break;
}
return mname.... | 3 |
public E get(int i) {
if (i >= size || i < 0)
return null;
Stack<Node> stack = new Stack<Node>();
int counter = 0;
Node node = root;
while (true) {
if (node != null) {
stack.push(node);
node = node.left;
} else {
node = stack.pop();
if (counter++ == i)
return node.data;
... | 5 |
public boolean checkGoal(State state) {
for (int k = 0; k < state.getData().size(); k++) {
for(int m = 0; m < state.getData().get(k).size(); m++) {
if (state.getData().get(k).get(m).equals("$") || state.getData().get(k).get(m).equals(".")) {
return false;
}
}
}
endTime = System.nanoTime();
... | 5 |
public int recalculateLevel() {
int addedlevels = 0;
int requiredExp = getExpRequirement(level);
while (exp >= requiredExp) {
exp -= requiredExp;
if (exp < 0) { exp = 0; } // so that experience is never below 0
addedlevels++;
addLevel();
... | 2 |
private List<Oeuvre> loadOeuvres() {
List<Oeuvre> lu = new ArrayList<Oeuvre>();
try {
// String req = "SELECT * FROM oeuvre";
String req = "SELECT * FROM OEUVRE";
Statement statement = DB.getConnexion().createStatement();
ResultSet rs = statement.executeQue... | 5 |
public boolean setElement(int index, E element) {
LinkedElement<E> elem = findElement(index);
if (elem != null) {
elem.setObj(element);
return true;
}
return false;
} | 1 |
private void init(InputStream in) throws IOException {
if (in == null) {
throw new IOException("Couldn't find input source");
}
bitStream = new BufferedInputStream(in);
bitStream.mark(Integer.MAX_VALUE);
} | 1 |
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://down... | 6 |
boolean deelverzamelingVan(Verzameling V) {
boolean deelverzameling = false;
for(int i = 0; i < elementen.length; i++) {
for(int j = 0; j < V.elementen.length; j++) {
if(elementen[i] == V.elementen[j]) {
deelverzameling = true;
break;
} else {
deelverzameling = false;
}
}
if(!de... | 4 |
@Override
public void tick() {
if (strict) {
boolean temp = false;
for (boolean input : inputs) {
if (input && temp) {
output = false;
return;
} else if (input) {
temp = true;
}
}
} else {
byte num = 0;
for (boolean input : inputs) {
if (input) {
num++;
}
}... | 8 |
private String getMnemDataErrorMessage() {
ArrayList<String> rawLines = currentMnemonic.getRawLines();
int noOfLines = rawLines.size();
int maxLineLength = 0;
String msg = "";
for (String str : rawLines) {
str = str.replaceAll("\\s+$", "");
if (str.length() > maxLineLength)
maxLineLength = str.len... | 4 |
public String[] kapaliMasaIsimleriGetir(){
ArrayList<String> s = new ArrayList<>();
for(int i=0;i<bilgisayarlar.size();i++){
if(bilgisayarlar.get(i).getAcilisSaati()==null){
s.add(bilgisayarlar.get(i).getMasaAdi());
}
}
String [] ss = new ... | 3 |
public void addCategory(Category cat)
{
this.categories.add(cat);
} | 0 |
public String getChannelsAsToolTipText() {
String text = "";
if (channels.size() > 1) {
text = channels.toString();
text = text.substring(1, text.length() - 1).replace(", ", ",");
text = text.replace(",", "<br>");
text = "<html>" + text + "</html>";
} else if (channels.size() == 1) {
text = channel... | 2 |
public Color getColor(String id) {
Color color = Color.BLACK;
for(int i=0;i<identity.size();i++) {
if(identity.get(i).equals(id)) {
color = colors.get(i)[0];
}
}
return color;
} | 2 |
@Override
public String getDesc() {
return "Default";
} | 0 |
private void debug(int[] query) {
// new SGM().run("Q3.4");
// new TJSGM().run("Q3.1");
// new PRM().run("Q3.1");
System.out.print("How many rounds you want? ");
int round = scanner.nextInt();
TJSGM tjsgm = new TJSGM();
long[][][][] result = new long[1][round][query.length][4];
for (int j = 0; j < round;... | 7 |
public void cargarComboHorario(){
Usuario u = new Usuario();
ArrayList<String> listado = u.listarHorarios();
if(listado !=null){
for (int i = 0; i < listado.size(); i++) {
Horario.addItem(listado.get(i));
}
... | 2 |
private void checkInvariants()
{
assert (wordsInUse == 0 || words[wordsInUse - 1] != 0);
assert (wordsInUse >= 0 && wordsInUse <= words.length);
assert (wordsInUse == words.length || words[wordsInUse] == 0);
} | 3 |
public Prefab(int x1, int y1, int x2, int y2){
this.x1 = x1;
this.x2 = x2;
this.y1 = y1;
this.y2 = y2;
if (x2 > x1){
width = x2 - x1;
} else {
width = x1 - x2;
}
if (y2 > y1){
height = y2 - y1;
} else {
height = y1 - y2;
}
height++;
width++;
} | 2 |
public void update(double dt) {
xPos+=xVel*dt;
yPos+=yVel*dt;
xVel+=xAccel*dt;
yVel+=yAccel*dt;
setAccel(dt);
Ball b=null;
for(int i=0;i<MainClass.balls.size();i++) {
b=MainClass.balls.get(i);
if(b!=null && id<b.id && collides(b)) {
bounce(b,i);
}
}
if(xPos-radius<MainClass.wa... | 8 |
public Magic constructMagic(int i, LivingThing l) {
if (i == 0) {
String name = "Fire Magic 1";
Magic fire1 = new Magic(true, Color.ORANGE, l, 5, 3, 1, name);
Damage fire1Dam = new Damage(5, 0, 0, 0, 0, 0, 0, 0, false, false, false);
fire1.setDamage(fire1Dam);
return fire1;
} else if (i == 1) {
S... | 9 |
private static boolean hasSubTags(Object obj, Class<?> objClass) throws XMLStreamException {
for (Field field : Introspection.getFieldsWithAnnotation(objClass, XmlTag.class, true)) {
try {
Introspection.makeFieldAccessible(field);
Object content = field.get(obj);
if (content != null) {
if (Collect... | 7 |
public static void main(String[] args) {
Directories.foldervalidator();
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
info.getClassName();
... | 6 |
public int demaLookback( int optInTimePeriod )
{
if( (int)optInTimePeriod == ( Integer.MIN_VALUE ) )
optInTimePeriod = 30;
else if( ((int)optInTimePeriod < 2) || ((int)optInTimePeriod > 100000) )
return -1;
return emaLookback ( optInTimePeriod ) * 2;
} | 3 |
public void reset()
{
countsValid = false;
for(Class key : counters.keySet()) {
Counter count = counters.get(key);
count.reset();
}
} | 1 |
private void testValue(DateTimeField fieldA, DateTimeField fieldB,
String method, long millis, long valueA, long valueB) {
if (valueA != valueB) {
failValue(fieldA, fieldB, method, millis, valueA, valueB);
}
} | 1 |
@Override
public void validate() {
if (getEmail().isEmpty()) {
addActionError("Please Enter Email Address");
}
else if (getPassword().isEmpty()) {
addActionError("Please Enter Password");
}
else{
User user = (User) myDao.getDbsession().get(User.... | 5 |
public boolean isActivated(SkiPass sp) {
Date currentDate = new Date(System.currentTimeMillis());
return (currentDate.before(sp.getActivationDate()) ? false : true);
} | 1 |
private static PaymentResponse read(String xml) throws InternalApiException {
try {
Persister persister = new Persister();
return persister.read(PaymentResponse.class, xml);
} catch (Exception e) {
throw new InternalApiException(e);
}
} | 1 |
public static void makeGrid(Container parent,
int rows, int cols,
int initialX, int initialY,
int xPad, int yPad) {
SpringLayout layout;
try {
layout = (SpringLayout)parent.getLayout();
} ... | 6 |
@Override
public void start() throws ConsoleException {
if(isStarted) throw new ConsoleException("Console has already been run");
isStarted = true;
completer.getStrings().clear();
completer.getStrings().addAll(commands.keySet());
String line;
try {
while(i... | 9 |
public static int getClosestColor(int red, int green, int blue) {
if(red < 0 || red > 255)
throw new IllegalArgumentException("getClosestColor: red is outside of valid range (0-255)");
if(green < 0 || green > 255)
throw new IllegalArgumentException("getClosestColor: green is outs... | 8 |
private Map<String, Class<?>> getExtensionClasses() {
Map<String, Class<?>> classes = cachedClasses.get();
if (classes == null) {
synchronized (cachedClasses) {
classes = cachedClasses.get();
if (classes == null) {
classes = loadExtensionClasses();
cachedClasses.set(classes);
}
}
}
r... | 4 |
private void save(final JFrame frame) {
final JFileChooser chooser = new JFileChooser(new File(GuiUtils.CURRENT_DIRECTORY));
chooser.setSelectedFile(new File("scsync.config"));
if (JFileChooser.APPROVE_OPTION == chooser.showSaveDialog(frame)) {
final Gson gson = new GsonBuilder().setPrettyPrinting().serializeN... | 2 |
public void mouseReleased(MouseEvent me)
{
if (this.isEnabled())
{
if (tools.getSelectedDrawingTool() == Toolset.TOOL_SELECTION)
{
undo();
}
if (!this.wasDragged)
{
if (selection.height != 0 && selection.widt... | 5 |
public void removeDeadBodies() {
for (int i = rigidBodies.size() - 1; i >= 0; i--) {
RigidBody rigidBody = rigidBodies.get(i);
if (rigidBody.getLifeTime() > 0
&& rigidBody.getAge() > rigidBody.getLifeTime()) {
physicsController.removeRigidBody(rigidBody);
graphicsController.removeRigidBody(rigidBod... | 3 |
public String encode(String plain, String pass){
//initialize plaintext and password
plainText = plain;
password = pass;
//generate P array from password
KeyGenerator kg = new KeyGenerator(password);
pArray = kg.getPArray();
//make sure the whole text is in pieces of 16 bytes or 128 bits (the block ... | 9 |
public List findByContestId(Object contestId) {
return findByProperty(CONTEST_ID, contestId);
} | 0 |
public String getNombre() {
return nombre;
} | 0 |
public void remove(int key) {
HashPrinter.tryRemove(key);
/** Run along the array */
int runner = 0;
int hash = (key % table.length);
while (table[hash] != null && runner < table.length) {
if (table[hash].getKey() == key) {
break;
}
runner++;
hash = ((key + runner * runner) % table.len... | 6 |
public void setVar(List<?> list)
{
for(PVar e : this._var_)
{
e.parent(null);
}
this._var_.clear();
for(Object obj_e : list)
{
PVar e = (PVar) obj_e;
if(e.parent() != null)
{
e.parent().removeChild(e);
... | 4 |
public static boolean toggleMute(CommandSender s, Player p, String pName) {
if (p == null) {
if(!PlayerChat.plugin.Mute.contains(pName)) {
Messenger.tell(s, pName + " is offline or does not exist.");
return true;
} else {
PlayerChat.plugin.Mute.remove(pName);
Messenger.tell(s, "You have unmu... | 4 |
public static void main(String[] args) {
ListNode head = new ListNode(1);
ListNode tmpHead = head;
for (int i = 2; i <= 5; ++i){
ListNode tmp = new ListNode(i);
tmpHead.next = tmp;
tmpHead = tmp;
}
Rotate_List rl = new Rotate_List();
L... | 1 |
private static void createFile(String filePathName) throws IOException {
File file = new File(filePathName);
boolean exists = file.exists();
if (!exists) {
file.createNewFile();
}
} | 1 |
protected void update(CheckedFrequencyTable freq, int symbol) throws IOException {
// State check
if (low >= high || (low & MASK) != low || (high & MASK) != high)
throw new AssertionError("Low or high out of range");
long range = high - low + 1;
if (range < MIN_RANGE || range > MAX_RANGE)
throw new Assert... | 9 |
public void updateAvaliableTexturePacks()
{
ArrayList arraylist = new ArrayList();
selectedTexturePack = field_77314_a;
arraylist.add(field_77314_a);
Iterator iterator = func_77299_i().iterator();
do
{
if (!iterator.hasNext())
{
... | 7 |
public void StartGame(boolean isGameHost, int slots,
HostGameTask hgt) throws InvalidKeyException, BadPaddingException,
IllegalBlockSizeException, InvalidSubscriptionException,
InterruptedException, IOException, InvalidKeySpecException,
NoSuchAlgorithmException, NoSuchPaddingException,
NoSuchProviderExce... | 4 |
public void setAsyncRunner(AsyncRunner asyncRunner) {
this.asyncRunner = asyncRunner;
} | 0 |
public void setIssuer(String value) {
this.issuer = value;
} | 0 |
private void actualizarProcesos(){
if (!a.getNivel1().isEmpty()) {
if ((a.getNivel1().get(0).getRafaga()<=a.getQuantum())) {
a.getNivel1().remove(0);
actualizarTabla1();
}else{
a.getNivel1().get(0).setRafaga(a.getNivel1().get(0).getRafaga()-a.getQuantum()... | 5 |
private int getLevelValue(String name)
{
while (true)
{
Integer levelValue = (Integer) name2levelMap.get(name);
if (levelValue != null)
return levelValue.intValue();
if (name.length() == 0)
{
break;
}
... | 4 |
public boolean isMatch2(String s, String p) {
// Start typing your Java solution below
// DO NOT write main() function
if (p == null)
return s == null;
if (s == null)
return false;
if (p.length() == 0)
return s.length() == 0;
if (p.charAt(0) != '*') {
if (s.length() > 0
&& (s.charAt(0) =... | 9 |
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 Object getValueAt(int row, int col) {
Ingredient i = (Ingredient)(data.get(row));
try {
switch (col) {
case 0 :
return new Boolean(add[row]);
case 1 :
String t = data.get(row).getClass().getName();
return t.substring("ca.strangebrew.".length(),t.length());
... | 4 |
public synchronized List<Long> getNodesIds(int pos) {
if (nodes.size() > pos)
return nodes.get(pos);
else
return null;
} | 1 |
public void connect(TreeLinkNode root) {
if (root == null || root.getLeft() == null || root.getRight() == null) {
return;
}
if (root.getLeft() != null) {
root.getLeft().setNext(root.getRight());
}
if (root.getRight() != null && root.getNext() != null) {... | 6 |
public void run() {
try
{
int count = 0;
String edge_id = null;
while((edge_id == null) && (count < 30))
{
edge_id = ControllerEngine.gdb.getResourceEdgeId(resource_id, inode_id, region, agent);
Thread.sleep(1000);
}
if... | 6 |
public void mergeAddr(FlowBlock succ) {
if (succ.nextByAddr == this || succ.prevByAddr == null) {
/*
* Merge succ with its nextByAddr. Note: succ.nextByAddr != null,
* since this is on the nextByAddr chain.
*/
succ.nextByAddr.addr = succ.addr;
succ.nextByAddr.length += succ.length;
succ.nextB... | 4 |
public Complex[] getWavefunctionCoeffs(int index, double energy) {
ComplexMatrix mx = getPropagationMatrix(index, energy);
if (index == 1) {
return new Complex[]{Complex.fromDouble(0), mx.getElem(1, 0)};
}
return new Complex[]{mx.getElem(0, 0), mx.getElem(1, 0)};
} | 1 |
public Object getTransferData(DataFlavor flavor)
throws UnsupportedFlavorException, IOException {
if (flavor.equals(FLAVORS[0])) { // RTF
return new ByteArrayInputStream(data==null ? new byte[0] : data);
}
else if (flavor.equals(FLAVORS[1])) { // stringFlavor
return data==null ? "" : RtfToText.getPlain... | 6 |
public Manifest getManifest()
{
return _manifest;
} | 0 |
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((decodedValue == null) ? 0 : decodedValue.hashCode());
result = prime * result + ((encodedValue == null) ? 0 : encodedValue.hashCode());
result = prime * result + ((symmetricKey == null) ? 0 : symmetricKey.hash... | 3 |
public void checkOneLetterOff(String queueHead)
{
for(int i =0; i<allWords.size(); i++)
{
String currentWrd = allWords.get(i);
//compares length and if greater than one skips the wordaddWords();
if(currentWrd.length() == queueHead.length() )
{
//looks at length of word and compares chars
num... | 7 |
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://down... | 6 |
@Override
public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel)
{
final Physical target=this.getAnyTarget(mob,commands,givenTarget,Wearable.FILTER_ANY);
if(target==null)
return false;
if(target instanceof Item)
{
}
else
if(target instanceof MOB)
{
... | 7 |
public Updater(Plugin plugin, int id, File file, UpdateType type, boolean announce) {
this.plugin = plugin;
this.type = type;
this.announce = announce;
this.file = file;
this.id = id;
this.updateFolder = plugin.getServer().getUpdateFolder();
final File pluginFile... | 9 |
public boolean load(String audiofile) {
try {
setFilename(audiofile);
sample = AudioSystem.getAudioInputStream(getURL(filename));
clip.open(sample);
return true;
} catch (IOException e) {
return false;
} catch (UnsupportedAudioFileException e) {
return false;
} catch (LineUnavailableException... | 3 |
static public boolean isColliding(math.Supportable lhs, math.Supportable rhs){
List<Vector3f> simplex = new java.util.ArrayList<Vector3f>();
Vector3f support = getSupport(lhs,rhs,Vector3f.UNIT_X);
simplex.add(support);
Vector3f direction = support.negate();
int loopCounter = 0;
... | 4 |
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://down... | 6 |
public static void testMap(){
HashMap<String, String> map = new HashMap<String, String>();
HashMap<String, String> map1 = new HashMap<String, String>();
HashMap<String, String> map2= new HashMap<String, String>();
HashMap<String, String> map3 = new HashMap<String, String>();
HashMap<String, String> map4 = ... | 1 |
private static CellRangeAddress mergeRegion(Doc doc) {
String attr[][] = doc.getAttr();
Td td = (Td) doc;
CellRangeAddress cra = null;
int rowspan = 0;
int colspan = 0;
for (int x = 0; x < attr.length; x++) {
if ("rowspan".equals(attr[x][0]) && (!"".equals(attr[x][1]))) {
rowspan = Integer.parseInt(... | 9 |
public void updateCurrentQuiz() {
try {
String statement = new String("UPDATE " + DBTable + " SET "
+ "name=?, url=?, description=?, category=?, userid=?, israndom=?, isonepage=?, opfeedback=?, oppractice=?, raternumber=?, rating=?"
+ " WHERE qid=?");
PreparedStatement stmt = DBConnection.con.prepareS... | 1 |
protected boolean unsingMe(MOB mob, MOB invoker)
{
if(mob==null)
return false;
final Ability A=mob.fetchEffect(ID());
if((A instanceof Song)
&&((invoker==null)||(A.invoker()==null)||(A.invoker()==invoker)))
{
final Song S=(Song)A;
if(S.timeOut==0)
S.timeOut = System.currentTimeMillis()
+... | 9 |
public void testFormatAppend_PrinterParser_Printer_null_null_Parser() {
PeriodPrinter printer = new PeriodFormatterBuilder().appendYears().appendLiteral("-").toPrinter();
PeriodParser parser = new PeriodFormatterBuilder().appendWeeks().appendLiteral("-").toParser();
PeriodFormatterBuilder bld = ... | 1 |
private String loadKeyOfAction(String value) {
if (actionMap == null) {
actionMap = new HashMap<String, String>();
actionMap.put(propertiesLoader.loadProperty(Action.ADVANCE.getKey()), Action.ADVANCE.getKey());
actionMap.put(propertiesLoader.loadProperty(Action.LEFT.getKey()), Action.LEFT.getKey());
actio... | 1 |
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://downl... | 6 |
private static void setColor(ColorType c, int newColor) {
switch (c) {
case PLAYER:
currentPlayerColor = newColor;
break;
case WALL:
currentWallColor = newColor;
break;
case SLOW_WALL:
currentSlowWallColor = newColor;
break;
case OBJECT:
break;
case PROJECTILE:
break;
... | 5 |
public static float arrayMax(float[] array){
if(array == null || array.length == 0)
return 0;
float max = 0;
for(int i=0; i<array.length;i++){
if(array[i] > max){
max = array[i];
}
}
return max;
} | 4 |
private static int initOriginal(final Display display, Composite inComposite) {
final Composite originalCompsite = new Composite(inComposite, SWT.BORDER);
int heightHint = 0;
try {
original = new Image(display, Resource.class.getResourceAsStream(IMAGE_PATH));
if (original.getImageData().depth != 8 && origi... | 3 |
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://down... | 6 |
public boolean isFull()
{
boolean full = true;
for (int x=0; x<3; x++)
{
for (int y=0; y<3; y++)
{
int[] pos = { x, y };
Player curr = getPlayerAtPosition(pos);
if(curr==null)
{
// Emp... | 4 |
void turboBoost() {
} | 0 |
public static ProtocolFileData getFileDataInBinary(byte[] fileInBytes,
int length) throws TagFormatException {
byte[] subStart = Arrays.copyOfRange(fileInBytes, 0, 11);
byte[] subEnd = Arrays.copyOfRange(fileInBytes, length - 12, length);
byte[] endOfTransfers = Arrays.copyOfRange(fileInBytes, 0, 16);
byte... | 3 |
private int lootArea() {
int lootFound = 0;
for (Survivor currentSurvivor : this.raidSettings.getTeam()) {
final int X = currentSurvivor.getSkills().getScavengingSkill(), MIN = Skills.LEVEL_MIN, MAX = Skills.LEVEL_MAX;
double coeff = 1 + ((X - MIN) / ((double) MAX - MIN));
double rand = BitingDeathGame.ge... | 4 |
public static ArrayList<StringSequence> formatToStringSequence(ArrayList<String> input)
{
ArrayList <StringSequence> output = new ArrayList<StringSequence>();
String description= "";
StringBuffer currentSequence = new StringBuffer();
//String sequence="";
for(int i=0;i<input.size()... | 5 |
public byte[] getPayload() {
return payload;
} | 0 |
public boolean rankup(Player p) {
if (!p.hasPermission(PERMISSION_RANKUP)) {
p.sendMessage(translate("rankup.no-permission"));
return false;
}
Rank current = ranks.getCurrentRank(perms, p);
if (current == null) {
p.sendMessage(translate("rankup.no-curr... | 6 |
private URL makeUrl(String txt) {
try {
txt = URLEncoder.encode(txt.trim(), "UTF-8");
String url;
url = GOOGLE_URL.replace("%lang%", lang.get());
url = url.replace("%txt%", txt);
return new URL(url);
} catch (MalformedURLException ex) {
... | 2 |
public T getCurrent() {
if(type == TIMED_SEQUENCE) {
if(elapsed >= delay) {
sequence.pollFirst();
elapsed = 0;
}
return sequence.peekFirst();
}
else if(type == RANDOM_SEQUENCE) {
int r = Application.get().getRNG().ne... | 4 |
public Matrix solve (Matrix B) {
if (B.getRowDimension() != m) {
throw new IllegalArgumentException("Matrix row dimensions must agree.");
}
if (!this.isNonsingular()) {
throw new RuntimeException("Matrix is singular.");
}
// Copy right hand side with pivoting
int n... | 9 |
@Override
public int hashCode() {
int hash = 3;
hash = 37 * hash + (this.tag_alter_preservation ? 1 : 0);
hash = 37 * hash + (this.file_alter_preservation ? 1 : 0);
hash = 37 * hash + (this.read_only ? 1 : 0);
hash = 37
* hash
+ (this.grouping_identity_byte != null ? this.grouping_identity_byte
... | 8 |
public int[] shuffle(int data[], int len) {
if (len <= 1) {
return null;
}
for (int i = 0; i < ROUNDS; i++) {
int mid = (len - 1) / 2;
int[] tmpData = new int[len];
for (int j = 0; j < len; j++) {
if (j <= mid) {
tmpData[2 * j] = data[j];
} else {
tmpData[2 * j - len + 1] = data[j]... | 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.