text stringlengths 14 410k | label int32 0 9 |
|---|---|
private void readPartDec(StructureFile structure, Element element) throws SyntaxException {
DOMHelper.checkedAllAttributes(element, new String[] { "name", "center", "size" });
String partName = element.getAttribute("name");
Vector3 originCoord = ValueHelper.vectorFromString(element.getAttribute("center"));
Dime... | 6 |
private String nodeString(IntervalNode node, int level) {
if (node == null) return "";
StringBuffer sb = new StringBuffer();
for (int i = 0; i < level; i++)
sb.append("\t");
sb.append(node + "\n");
sb.append(nodeString(node.getLeft(), level + 1));
sb.append(nodeString(node.getRight(), level + 1));
ret... | 2 |
@Override
public void mutate() {
Population offspring = new Population();
for (int i = 0; i < population.getSize(); i += 2){
HiffIndividual ancestorOne = getAncestor();
HiffIndividual ancestorTwo = getAncestor();
int a;
int b;
synchronized ... | 6 |
@Test
public void singleDeleteSizeAndContent() {
a.insert(v);
a.delete(v);
assertNull(a.get(0));
assertEquals(0, a.getSize());
} | 0 |
private boolean filter(long a, long b) {
boolean x = a >= 0;
boolean y = b >= 0;
if(x && y) {
return a < b;
}
if(!x && y) {
return a > b;
}
if(x && !y) {
return a + b < 0;
}
... | 6 |
public void printlnSalidas(){
for(Nodo<Rama_Hoja> iterador = _salidasDelArbol.getHead(); iterador != null; iterador = iterador.getSiguiente()){
System.out.println(iterador.getDato().getIdentificador());
}
} | 1 |
protected void actionPerformed(GuiButton var1) {
if(var1.enabled) {
if(var1.id == 0) {
this.mc.displayGuiScreen(this.parentGui);
} else if(var1.id == 1) {
this.selectedSlot = this.slotGeneral;
} else if(var1.id == 3) {
this.selectedSlot = this.slotIte... | 5 |
public void connect(){
try {
Class.forName("com.mysql.jdbc.Driver").newInstance();
connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/ftp?characterEncoding=latin2","root","");
}
catch(ClassNotFoundException e){
System.out.println("ClassNorFo... | 4 |
private void verifica(int numOperatori,int numCasseFaiDaTe,double paramArrivi,
double paramOperatore,double paramFaiDaTe,double tempoSimulazione, int numProveRipetute) throws LimiteCasse,LimiteValori{
if(numOperatori>23||numCasseFaiDaTe>11){
throw new LimiteCasse();
}
... | 7 |
@Override
protected void _processWalks(WalkArray walkArray, int[] atVertices) {
int[] walks = ((IntWalkArray)walkArray).getArray();
long t1 = System.currentTimeMillis();
for(int i=0; i < walks.length; i++) {
int w = walks[i];
int atVertex = atVertices[i];
... | 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 |
private void createMainPanel() {
userList = new JList<>(usersModel);
userList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
userList.setSelectedIndex(0);
userList.setLayoutOrientation(JList.VERTICAL);
userList.setSelectionBackground( new Color(102, 153, 255) );
u... | 1 |
public Set<BankAccount> getReplacingAccounts(BiFunction<BigInteger,BigInteger,BankAccount> generator) {
Set<BankAccount> result = new HashSet<>();
for (BankAccount account: accounts)
result.add(generator.apply(account.getBalance().add(BigInteger.TEN),account.getCreditLimit()));
retur... | 1 |
int matchbalance(int soff, int poff) {
final int plen = p.length();
if (poff == plen || poff + 1 == plen) {
error("unbalanced pattern");
}
final int slen = s.length();
if (soff >= slen)
return -1;
final int b = p.luaByte(poff);
if (s.luaByte(soff) != b)
return -1;
final int e = p.lua... | 8 |
private <T> Method findMethod(T object, String method,
Class<?>[] parameters) {
Method[] allMethods = findAllMethods(object.getClass());
ArrayList<Method> allNamed = new ArrayList<Method>();
// make a list of all methods with the given name
for (Method elt : allMethods)
if (elt.getName().equals(method))... | 6 |
private static Vertex create(double x, double y) {
if (Double.isNaN(x) || Double.isNaN(y)) {
return VERTEX_AT_INFINITY;
}
if (_pool.size() > 0) {
return _pool.pop().init(x, y);
} else {
return new Vertex(x, y);
}
} | 3 |
public File getOldFile() {
return oldFile;
} | 0 |
private void drawBricks() {
byte[][] board = game.getBoard();
for (int r = 0; r < row - 1; r++) {
for (int c = 0; c < col - 1; c++) {
if (board[r][c] != 0) {
byte type = board[r][c];
typeColor(type);
g2.fillRect(c * square + square + 1, r * square + square
+ 1, square - 1, square - 1);... | 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 |
@Override
public void run() {
if (bots.isEmpty()) {
throw new IllegalStateException("At least one bot is necessary");
}
while (running()) {
Bot b = bots.poll();
try {
lastMessage = b.getNextMessage(lastMessage).trim();
... | 4 |
public void visitTableSwitchInsn(
final int min,
final int max,
final Label dflt,
final Label[] labels)
{
mv.visitTableSwitchInsn(min, max, dflt, labels);
if (constructor) {
popValue();
addBranches(dflt, labels);
}
} | 1 |
@Override
public int hashCode()
{
final int prime = 31;
int result = 1;
result = prime * result + ((dir == null) ? 0 : dir.hashCode());
result = prime * result + ((hexLoc == null) ? 0 : hexLoc.hashCode());
return result;
} | 2 |
protected void update(final Object arg, final int n) {
if (arg instanceof Throwable) {
((Throwable) arg).printStackTrace();
} else {
if (n % 100 == 0) {
System.err.println(n + " " + arg);
}
}
} | 2 |
public synchronized long getEditDelayMillis() {
removeExpiredReversions();
if (currentDelayCached)
return currentDelayMillis;
else {
long result = MAX_DELAY_MILLIS;
if (!recentReversionDelaysMillis.isEmpty()) {
long reversionDelayTotal = 0L;
int n = 0;
for (Long l : recentReversio... | 5 |
protected void insertHandled(Handled h, int index)
{
// Handled must be of the supported class
if (!getSupportedClass().isInstance(h))
return;
if (h != null && !this.handleds.contains(h))
{
// Removes all of the handleds after the index to another list
List<Handled> sublist = this.handleds.subList(... | 4 |
public void newNarration()
{
comboBoxNarration.removeAllItems();
comboBoxNarration.setModel(new DefaultComboBoxModel(listNarration.toArray()));
} | 0 |
@Override
protected void checkingNorms()
{
for ( Action action : getAllActions().values() )
action.setNormType(null);
if( makeTransformNorms == true )
{
transformNorms();
for( Norm norm : equivalentNorms.values() )
{
getPlayer().addRestrictNorm(norm.getName(), norm);
Action action = norm.... | 8 |
public static void computePsz()
{
for(int i = 0; i < DataInfo.numItems; i++)
{
int numrate = DataInfo.itemInfo[i].length;
double[] temp1 = new double[DataInfo.hidVariables];
double[] temp2 = new double[DataInfo.hidVariables];
double[] temp3 = new double[DataInfo.hidVariables];
for(int k = 0; k <... | 8 |
@Override
public void action()
{
Agent ag = getAgent();
if( ag instanceof ReflexAgent )
{
ReflexAgent ra = (ReflexAgent)ag;
Norm norm = ra.containsNorm(this, NormType.OBLIGATION);
if( norm != null )
{
setNormType(NormType.OBLIGATION);
execute();
if( !isCyclic )
done = true;
... | 9 |
public static void writeCollection(BusinessObject businessObject, File parentFolder, int depth){
String businessObjectName = businessObject.getName();
String businessObjectType = businessObject.getBusinessObjectType();
parentFolder.mkdirs();
File childFolder = null;
try{
... | 9 |
@Override
public SchlegelCompound transformResultString() {
// splitting result string into two. One contains the points, the other
// the edges.
int numberOfPoints = 0;
String pointsString;
String edgesString;
String facesString = "";
try {
String[] pointsAndEdges = resultString.s... | 7 |
public void addItemToInventory(Item item) {
if (item == null)
throw new IllegalArgumentException("Item can't be null!");
if (inventory.size() >= 6)
throw new IllegalArgumentException("The inventory is already full!");
// Checken of item niet in inventory van andere speler reeds voorkomt?
inventory.add(... | 2 |
public String getCity() {
return city;
} | 0 |
@Override
public double []calcArray(double a1[], double []a2)
{
switch(op)
{
case '+':
return calcArrayAdd(a1,a2);
case '-':
return calcArraySub(a1,a2);
case '*':
return calcArrayMul(a1,a2);
default:
break;
}
return null;
} | 3 |
public boolean matchesSub(Identifier ident, String subident) {
String prefix = ident.getFullName();
if (prefix.length() > 0)
prefix += ".";
if (subident != null)
prefix += subident;
if (firstStar == -1 || firstStar >= prefix.length())
return wildcard.startsWith(prefix);
return prefix.startsWith(wildc... | 4 |
public void actionPerformed(ActionEvent e)
{
for(int i = 0; i < Main.list.size(); i++)
{
//Main.list.get(i)
tempBall = Main.list.get(i);
if(tempBall.getStatic() == false)
{
if((tempBall.getVectorX() / Math.abs(tempBall.getVectorX())) * Math.abs(tempBall.getVectorX() - Ball.FRICTION) == 0)
... | 4 |
Marker(double lat, double lon)
{
idTrigger++;
id=idTrigger;
latitude = lat;
longtitude = lon;
} | 0 |
private static void diffImages(BufferedImage goodImage,
PixImage studentPixImage) {
BufferedImage studentImage = ImageUtils
.pixImage2buffer(studentPixImage);
int diffCount = 0;
System.out.println("The difference is:");
if (studentImage.getWidth() != goodImage.getWidth()) {
System.out.println("The wid... | 8 |
private void initDataSource(Configuration configuration) throws TorqueException {
log.debug("Starting initDataSource");
try {
Object dataSource = null;
Configuration c = configuration.subset(DATASOURCE_KEY);
if (c != null) {
for (Iterator i = c.getKeys(); i.hasNext();) {
Str... | 8 |
private Shape mLineStringShapeParser(Shape shape){
// Anadimos todos los nodos
Coordinate[] coor = shape.getCoordenadas(0);
for (int x = 0; x < coor.length; x++){
List<String> l = new ArrayList<String>();
l.add(shape.getShapeId());
shape.addNode(0,utils.generateNodeId(shape.getCodigoMasa(), coor[x], nu... | 3 |
public static void main(String[] args) {
Tank t1 = new Tank();
t1.level = 9;
System.out.println("1: t1.level: " + t1.level);
changeLevel(t1);
System.out.println("2: t1.level: " + t1.level);
} | 0 |
public void getNext(CAS aCAS) throws IOException, CollectionException {
JCas jcas;
try {
jcas = aCAS.getJCas();
} catch (CASException e) {
throw new CollectionException(e);
}
String doc;
// Removes everything in the order we added
doc = docsArray.remove(0);
jcas.setDocu... | 4 |
public void sayHello() {
System.out.println();
} | 0 |
protected double generateAmplitude(double time, double amplitude) {
double amp = amplitude;
if (time < this.attackTime) {
//the rate of growth of amplitude per sample
double deltaAmp = this.amplitude/(getSampleRate()*this.attackTime);
return amplitude + deltaAmp;
} else if (time < this.attackTime + de... | 5 |
@Override
public RsObject process(RsPlan plan, String objectName) throws RsParsingException {
boolean level = false;
RsToken token;
System.out.println("Processing unimplemented statement "+keyword);
while(true){
token=reader.nextToken();
if(token.endOfFile())
... | 9 |
@Override
public int hashCode() {
int result = idThreads;
result = 31 * result + (name != null ? name.hashCode() : 0);
result = 31 * result + (description != null ? description.hashCode() : 0);
return result;
} | 2 |
public ArrayList<Course> getAllCoursesOn(Day day) {
ArrayList<Course> crs = new ArrayList<Course>();
for (Course c : COURSES) {
for (int i = 0; i <= c.getTimeDayHolder().getDays().size() - 1; i++) {
if (c.getTimeDayHolder().getDays().get(i).getString().equals(day.getString())) crs.add(c);
}
}
... | 3 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Coordinate2D other = (Coordinate2D) obj;
if (x != other.x)
return false;
if (y != other.y)
return false;
return true;
} | 5 |
public Dysk produkujemyDysk(){
return new DyskDlaPC();
} | 0 |
private double setteBello(ICard card) {
// La carta che esamino è il sette bello
if (Rules.isSetteBello(card)) {
if (Rules.existPresa(card, table.cardsOnTable()))
;
return 1.0;
}
for (ICard tcard : table.cardsOnTable()) {
// Il settebello è tra le carte in gioco (sul tavolo)
if (Rules.isSetteBel... | 6 |
public BodyArmorSlots() {
this.armorItem = (BodyArmor) ItemFactory.create().buyItem(Constants.BASIC_BODY_ARMOR);
} | 0 |
@Override
public void update() {
if (Engine.getMainCamera().changed()){
recreateMesh();
}
} | 1 |
public Homework_database_add() {
initComponents();
Member_details_add.readarray();
Member_details default1 = Member_details_array.getMembers()[Member_loggedin.getNumber()];
Subject.removeAllItems();
Subject.insertItemAt(default1.getSubject1(), 0);
Subj... | 1 |
public int[] find(String name){
int mas = 0;
for (int i = 0; i < book.length; i++) {
if (book[i] != null && book[i].name.equals(name)) mas++;
}
int[] newmas = new int[mas];
for (int i = 0, j= 0; i < book.length; i++) {
if (book[i] != null && book[i].name.e... | 6 |
public static final double expectation(double ruleCount, int premiseCount,double[] midPoints, Hashtable priors){
double numerator = 0, denominator = 0;
for(int i = 0;i < midPoints.length; i++){
Double actualPrior = (Double)priors.get(new Double(midPoints[i]));
if(actualPrior != null){
if(actualPri... | 7 |
protected HttpClient createHttpClient(String aProxyUrl) throws MalformedURLException {
HttpClient client = super.createHttpClient();
// Set up the proxy. If there's anything wrong with the URL, throw the Exception.
HttpHost proxyHttpHost = null;
if (UtilityMethods.isValidString(aProxyUr... | 1 |
private ListNode merge(ListNode left, ListNode right) {
if (left == null) {
return right;
}
if (right == null) {
return left;
}
ListNode temp = new ListNode(0);
ListNode move = temp;
/**
* cause merge sort, every divided minimum... | 7 |
public static void loadDataFromFile(String fileName) {
Scanner previoustickers = null;
try {
previoustickers = new Scanner(new File(fileName));
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
String key = "";
String value = "";
while (previousticke... | 4 |
public int hash(String item) {
final byte[] data = item.getBytes();
final int length = data.length;
final int seed = 0x9747b28c;
// 'm' and 'r' are mixing constants generated offline.
// They're not really 'magic', they just happen to work well.
final int m = 0x5bd1e995;
fi... | 4 |
public static void main(String[] args) {
InputStream in;
OutputStream out;
leer_parametros(args);
if (archivo.equals("-"))
{
in = System.in;
out = System.out;
}
else
{
FileInputStream inFile;
FileOutputStream outFile;
try
{
inFile = new FileInputStream(archivo);
}
... | 9 |
public String getSimpleCode(){
String str = "";
if(statement.toString()!=null)
str = statement.getSimpleCode();
if(statements.toString()!=null){
str += statements.getSimpleCode();
}
return str;
} | 2 |
@Override
public boolean equals(Object o) {
if (!(o instanceof ID)) {
return false;
}
return name.equals(((ID) o).name);
} | 1 |
public boolean validateMessage(String message){
return (message.length() > 0 && !message.equals(lastMessage));
} | 1 |
private static Constructor<?> getConstructor(Class<?> clazz) {
Constructor<?> res;
Constructor<?>[] constructors = clazz.getDeclaredConstructors();
if ( constructors.length == 0 ) {
throw new ITestInitializationException(clazz, null);
}
res = constructors[0];
... | 8 |
@Override
public double calculateJuliaWithoutPeriodicity(Complex pixel) {
iterations = 0;
Complex[] complex = new Complex[2];
complex[0] = new Complex(pixel);//z
complex[1] = new Complex(seed);//c
Complex zold = new Complex();
if(parser.foundS()) {
pars... | 8 |
public String getOutput()
{
return myOutput;
} | 0 |
public static void startRemote2D(Remote2DGame game) {
if(System.getProperty("os.name").toLowerCase().indexOf("mac") != -1)
{
System.setProperty("apple.laf.useScreenMenuBar", "true");
System.setProperty("com.apple.mrj.application.apple.menu.about.name", "Remote2D");
System.setProperty("apple.awt.UIElemen... | 3 |
private TableColumn<S, ?> getNextColumn(boolean forward) {
List<TableColumn<S, ?>> columns = new ArrayList<>();
for (TableColumn<S, ?> column : getTableView().getColumns()) {
columns.addAll(getLeaves(column));
}
//There is no other column that supports editing.
if (co... | 8 |
private static void startCfResourceCalculator(String sampleDir, String sampleName, int size, int neighborSize,
boolean userBased, boolean resBased, boolean allResources, boolean bll, Features features) {
BookmarkReader reader = null;
String suffix = "cf_";
if (!userBased) {
suffix = "rescf_";
} else if (... | 6 |
public String nextToken() throws JSONException {
char c;
char q;
StringBuilder sb = new StringBuilder();
do {
c = next();
} while (Character.isWhitespace(c));
if (c == '"' || c == '\'') {
q = c;
for (;;) {
c = next();
... | 9 |
public void initPage(String req) {
search = req;
search.replaceAll(" ", "_");
try {
url = new URL(wiki+"/wiki/"+search);
} catch (MalformedURLException e) {}
} | 1 |
public void actionPerformed(java.awt.event.ActionEvent evt) {
if (evt.getSource() == saveButton) {
RegistroLaboratorios.this.saveButtonActionPerformed(evt);
}
else if (evt.getSource() == limpiarButton) {
RegistroLaboratorios.this.limpiarButtonActionPer... | 4 |
@Override
public void Insertar(Object value) {
Session session = null;
try {
Liga liga = (Liga) value;
session = NewHibernateUtil.getSessionFactory().openSession();
session.beginTransaction();
session.save(liga);
session.getTransaction().co... | 2 |
public synchronized void dopaint (Graphics g)
{ if (ShowLast)
{ Top=V.size()-PageSize+1;
if (Top<0) Top=0;
ShowLast=false;
}
if (ListingBackground!=null) g.setColor(ListingBackground);
else g.setColor(getBackground());
g.fillRect(0,0,W,H);
g.setColor(Color.black);
int h=Leading+Ascent;
... | 8 |
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 |
private YiTouGS initGS(ResultSet rs) throws SQLException {
YiTouGS yiTouGS = new YiTouGS();
yiTouGS.setId(rs.getString("id") == null ? "" : rs.getString("id"));
yiTouGS.setName(rs.getString("name") == null ? "" : rs.getString("name"));
yiTouGS.setEnname(rs.getString("enname") == null ? "... | 6 |
public static String pickupUniqueWords(CompositeText document) {
Set<String> words = new TreeSet<String>();
Iterator<?> iterator = document.createIterator();
while (iterator.hasNext()) {
TextComponent token = (TextComponent) iterator.next();
if (token.getName().equals(TextComponentName.TOKEN)) {
if (tok... | 7 |
public static List<Interval> insert(List<Interval> intervals, Interval newInterval) {
intervals.add(0, newInterval);
int index = 0;
for (int i = 1; i < intervals.size(); i++) {
Interval idx = intervals.get(index);
Interval cur = intervals.get(i);
if (idx.end < cur.start) continue;
... | 7 |
public CSVExporterDialog(Dictionary dictionary) {
dic = dictionary;
exported = false;
setBounds(100, 100, 450, 300);
getContentPane().setLayout(new BorderLayout());
contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
getContentPane().add(contentPanel, BorderLayout.CENTER);
contentPanel.setLayout(ne... | 3 |
private void jTextField3KeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextField3KeyPressed
// TODO add your handling code here:
if(evt.getKeyCode()==10){
if(modo.equals("Baja")){
if(jTextField3.getText().equals(""))
JOptionPane.showMessageDia... | 5 |
public void movePlayerXNegative(int PlayerID)
{
if(checkNoPlayerBoundsCollisionNegative(PlayerID) == true) players.get(PlayerID).moveBatNegative();
} | 1 |
@SuppressWarnings("unchecked")
@Override
public boolean equals(Object o) {
if (!(o instanceof BinaryTree)) {
return false;
}
if (o == this) {
return true;
}
BinaryTree<T> btr = (BinaryTree<T>) o;
if (size() != btr.size()) {
return false;
}
Iterator<Node<T>> it1 = iterator();
Iterator<Node<T... | 5 |
public void setReferRequestWrappers(
List<RequestWrapper> referRequestWrappers) {
this.referRequestWrappers = referRequestWrappers;
} | 0 |
public iXportSMS() throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException, URISyntaxException {
loadLib();
initialize();
bs = bm.getBackups();
for (Backup b : bs){
modelBackup.addElement(b.getName()+" ("+b.getDate()+")");
}
modelBackup.addElement("Custom sms dat... | 1 |
public ListNode deleteDuplicates(ListNode head) {
if( head == null || head.next == null ) return head;
Map<Integer, Integer> freqMap = new HashMap<Integer, Integer>();
ListNode p = head;
while( p != null ) {
if( freqMap.containsKey( p.val ) ) {
freqMap.put( p... | 7 |
public Backtracking(int taille, boolean allSolution,Gestion g){
//lancement du compteur
start=System.currentTimeMillis();
plat=new Plateau(taille);
this.taille=taille;
this.allSolution=allSolution;
this.g=g;
listePolyo=new ArrayList<Polyominos>();
listeSolution=new HashSet<Plateau>();
//ajout... | 4 |
public long doUpdate(Master master, UpdateRequest updateRequest) {
incrementAccessAndMaybeRecalibrate(master);
File f = updateRequest.getFile();
Location accessLoc = updateRequest.getLocation();
MasterMeta fm = master.map.get(f.getId());
boolean allSucceeded = true;
long maxDelay = -1;
Set<C... | 8 |
public static BLWorld get(World world){
if(world!=null){
for(BLWorld blworld:blworlds){
if(blworld.world.equals(world)){
return blworld;
}
}
}
return null;
} | 3 |
@EventHandler
public void BlazeHeal(EntityDamageByEntityEvent event) {
Entity e = event.getEntity();
Entity damager = event.getDamager();
String world = e.getWorld().getName();
boolean dodged = false;
Random random = new Random();
double randomChance = plugin.getBlazeConfig().getDouble("Blaze.Heal.DodgeCha... | 6 |
public void generate() {
this.elements = new ArrayList<Element>();
int size = this.cols * this.rows;
for (int i = 0; i < size; i++) {
Element element = null;
if (i <= this.rows || i % this.rows == 0 || (i + 1) % this.rows == 0 || size - this.rows < i) {
... | 8 |
private void updateStateDelete(List<Keyword> keywords, List<String> terms) {
//We should have come here by a keyword jump and the recipe shouldve been passed or set
if (keywords != null && !keywords.isEmpty()) {
for (Keyword kw : keywords) {
if (kw.getKeywordData().getType() == KeywordType.RECIPE) {
curr... | 6 |
private boolean invokeEvents(boolean valid)
{
E event = null;
// Take all events from the event queue and process them.
for (;;)
{
// Clear event, very important!
event = null;
// Enter blocking section with caution!
if (release.enter()) {
try {
event = eventQueue.poll();
}
f... | 7 |
public ECPoint decodePoint(byte[] encoded)
{
ECPoint p = null;
int expectedLength = (getFieldSize() + 7) / 8;
switch (encoded[0])
{
case 0x00: // infinity
{
if (encoded.length != 1)
{
throw new IllegalArgumentException("Incorre... | 9 |
public OutputNode parse() {
OutputNode outputNode = new OutputNode();
String ss;
while ( true ) {
ss = this.xp.getNextString();
if ( ss.equals("/Output")) {
return outputNode;
}
else if ( ss.equals("Name")) {
outputNode.setName(this.xp.getNextString());
this.xp.getNextString();
}
els... | 4 |
public Procesor produkujemyProcesor(){
return new ProcesorDlaLaptopa();
} | 0 |
public static String getSpell(String cnStr, boolean onlyFirstSpell) {
if (cnStr == null) {
return "";
}
char[] chars = cnStr.trim().toCharArray();
StringBuffer sb = new StringBuffer();
for (int i = 0, len = chars.length; i < len; i++) {
int ascii = getCnAscii(chars[i]);
if (ascii == 0){ //如果获取汉字的A... | 9 |
@Override
public void mark(int boardPosition, Cell[] cellBoard, int rows, int columns) throws IllegalMark {
//Find the row.
int boardPositionRow = boardPosition / columns ;
//Find the column.
int boardPositionColumn = boardPosition % columns;
if (boardPositi... | 2 |
public static PacketPlayOutEntityMetadata getMetadataPacket(DataWatcher watcher) {
PacketPlayOutEntityMetadata metaPacket = new PacketPlayOutEntityMetadata();
Field a = ReflectionUtil.getDeclaredField(metaPacket.getClass(), "a");
a.setAccessible(true);
try {
a.set(metaPacket... | 3 |
public void addRanges(int partId, PERangeList list) {
if (partId < 0 || partId >= rangesParts.length) {
throw new IndexOutOfBoundsException("Partition " +
partId + " does not exist");
}
if(rangesParts[partId] == null) {
rangesParts[partId] = new PERangeList();
}
rangesParts[partId].addAll(list);
... | 3 |
private void handleRecordsBatch(Map<String, Map<String, Object>> primaryKeysHashMap)
throws SQLException, ConfigurationException, ScriptException, InterruptedException
{
for (Pair<String, Map<String, Object>> pair : nameValuesBuffer)
{
Map<String, Object> nameValues = pair.ge... | 7 |
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.