text stringlengths 14 410k | label int32 0 9 |
|---|---|
public static Path writeMatrix(double[][] matrix, Path path,
HamaConfiguration conf) {
SequenceFile.Writer writer = null;
try {
FileSystem fs = FileSystem.get(conf);
writer = new SequenceFile.Writer(fs, conf, path, IntWritable.class,
VectorWritable.class);
for (int i = 0; i < matrix.length; i++) {
... | 4 |
private SQLiteDriver(Plugin p, HashMap<String, String> c) {
plugin = p;
this.db = c.get("database");
this.prefix = c.get("prefix");
this.user = c.get("user");
this.pass = c.get("password");
this.dbg = (c.containsKey("debug")) ? this.parseBool(c.get("debug"), false) : false;
String dbPath = "jdbc:sqlit... | 5 |
public String delete(String id){
HttpClient httpClient = new DefaultHttpClient();
HttpDelete httpDelete = new HttpDelete(Url+"&id="+id);
String backRes = "-1";
try {
HttpResponse httpResponse = httpClient.execute(httpDelete);
int backCode = httpResponse.getStatusL... | 3 |
private static void printGridletList(GridletList list, String name,
boolean detail)
{
int size = list.size();
Gridlet gridlet = null;
String indent = " ";
System.out.println();
System.out.println("============= OUTPUT for " + name ... | 3 |
public PointGame findAStupidPlace() {
PointGame pointToPlace = null;
// High Priority: form a mill.
for (PointGame pt : Board.validPoints) {
if (!Board.isOccupied(pt) && hasMills(pt)) {
pointToPlace = pt;
//System.out.println(pointToPlace);
return pointToPlace;
}
}
for (PointGame pt : Board.... | 5 |
public static Hashtable getLargestConnectedSubgraph(GraphEltSet ges) {
int nodeCount = ges.nodeCount();
if(nodeCount==0) return null;
Vector subgraphVector = new Vector();
for(int i=0; i<nodeCount; i++) {
Node n = ges.nodeAt(i);
boolean skipNode=false;
... | 8 |
public List<Entity> getEntities(int x0, int y0, int x1, int y1) {
List<Entity> result = new ArrayList<Entity>();
int xt0 = (x0 >> 4) - 1;
int yt0 = (y0 >> 4) - 1;
int xt1 = (x1 >> 4) + 1;
int yt1 = (y1 >> 4) + 1;
for (int y = yt0; y <= yt1; y++) {
for (int x = xt0; x <= xt1; x++) {
if (x < 0 || y < 0... | 8 |
private void mergeReports() {
File firstReportDir = config.getMergeDirs().get(0);
ioUtils.copyDir(firstReportDir, config.getMergeDestDir());
String[] data = new String[config.getMergeDirs().size()];
for (int i = 0; i < data.length; i++) {
File dataFile = new File(config.getM... | 2 |
@Override
public Coordinates nextMove(GameBoard gb) {
oldTime = System.currentTimeMillis() - timeoutOffset;
timeoutHasOccured = false;
boardSize = gb.getSize();
int alpha = LOOSE;
Coordinates bestMove = null;
int bestScore = 0;
ArrayList<Coordinates> openCoo... | 7 |
void collisionCheck(){
inBounds();
for(collidableObject tempObj : listWrecks){
if(tempObj.isColliding(posX, posY)){ reset(); break; }
}
} | 2 |
@Override public void init() {
// 234 : 402 => 0.5820895522
// 402 : 234 => 1.7179487179
dayLeft = SplitFlapBuilder.create().prefWidth(146).prefHeight(250).flipTime(300).selection(SplitFlap.ALPHA).textColor(Color.WHITESMOKE).build();
dayMid = SplitFlapBuilder.create().prefWidth(14... | 9 |
public ListNode removeNthFromEnd(ListNode head, int n) {
if (n <= 0) {
return head;
}
ListNode first = head;
while (head != null && n > 0) {
head = head.next;
n--;
}
if (n != 0) {
return first;
}
ListNode c... | 6 |
private void toggleAutoRestart(int level, String[] keywords) {
if (isAccountTypeOf(level, ADMIN, MODERATOR)) {
if (keywords.length == 2) {
if (Functions.isNumeric(keywords[1])) {
Server s = getServer(Integer.parseInt(keywords[1]));
if (s.auto_restart) {
s.auto_restart = false;
sendMessage... | 4 |
public FiniteStateAutomaton() {
super();
} | 0 |
public void updateDiscDisplay(Disc disc) {
tDiscName.setText(disc.getName());
switch(disc.getManufacturer()) {
case INNOVA:
tManufacturer.setText("Innova");
break;
default:
tManufacturer.setText("?");
break;
... | 1 |
private void saveSession() {
if (this.lastTime != null && this.curRawData.getTime() - this.lastTime >= 0.001) {
if (this.i >= 99) {
this.curSession = new SessionDao().createOrUpdateSession(this.curSession);
this.slf4j.info("curSession :");
this.slf4j.info(" Session Id :" + this.curSession.getId());
... | 4 |
private void backClicked()
{
WindowStack ws = WindowStack.getLastInstance();
if (ws != null) {
ws.pop();
}
} | 1 |
private void revealArea(int position)
{
if (isFlagged(position)) {
return;
}
changeState(position, BoxState.SAFE);
for (int i : map.getNeighbors(position)) {
int v = map.getValueAt(i);
boolean recursivelyReveal = v == 0 && boxStates[... | 5 |
public void setMatrix(Matrix set, int i){
if(set.getRowDimension() == dimension){
XMatrix[i] = set.copy();
return;
}
else{
return;
}
} | 1 |
private void addIgnore(long target) {
try {
if (target == 0L)
return;
if (ignoreCount >= 100) {
pushMessage("Your ignore list is full. Max of 100 hit", 0, "");
return;
}
String targetName = TextClass.formatName(TextClass
.longToName(target));
for (int p = 0; p < ignoreCount; p++)
i... | 7 |
synchronized void shutdown() {
try {
mClientSocket.close();
} catch (Exception exception) {
Log.error(exception);
}
mServer.remove(this);
} | 1 |
@Override
public void run() {
try {
isRunning = true;
while (isRunning) {
Thread.sleep(5L);
if (network.hasMessageToSend()) {
writer.write(network.poll(EnumMessageType.SEND).toString() + "\r\n");
}
}
} catch (IOException | InterruptedException e) {
e.printStackTrace();
}
} | 3 |
static final Class348_Sub21 method199(int i) {
anInt8369++;
if (Class75.aClass262_1254 == null || r.aClass312_9716 == null)
return null;
r.aClass312_9716.method2328(Class75.aClass262_1254, 75);
Class348_Sub21 class348_sub21
= (Class348_Sub21) r.aClass312_9716.method2327((byte) -53);
if (class348_sub21 ==... | 7 |
public List<Integer> findMatchingPatterns() {
List<Integer> patternList = new ArrayList<Integer>();
int count = 0;
while (this.text.length() > 0) {
Tree.Node<String, Integer> parent = trie.getRoot();
for (int i = 0; i < text.length(); i++) {
if (isPatternP... | 4 |
public void setDrawable (Drawable drawable) {
if (drawable != null) {
if (this.drawable == drawable) return;
if (getPrefWidth() != drawable.getMinWidth() || getPrefHeight() != drawable.getMinHeight()) invalidateHierarchy();
} else {
if (getPrefWidth() != 0 || getPrefHeight() != 0) invalidateHierarchy();
... | 6 |
public static void init()
{
Date currentDate = new Date();
SimpleDateFormat df = new SimpleDateFormat("dd_MM_yy_hh_mm_ss");
outPutfolder = df.format(currentDate);
String strBrowserType = conf.getString("BrowserType");
if(strBrowserType.equals("InternetExplorer"))
{
System.setProperty("webdriver.ie.dr... | 2 |
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 List<MedicineDTO> getAllMedicines() throws SQLException {
Session session = null;
List<MedicineDTO> medicines = new ArrayList<MedicineDTO>();
try {
session = HibernateUtil.getSessionFactory().openSession();
medicines = session.createCriteria(MedicineD... | 3 |
public Object getData(){
return this.data;
} | 0 |
@Override
public synchronized void run() {
while (!done) {
try {
while (!paused) {
if (count > 0) {
Core.cycle(1);
count--;
updatecount--;
} else if (infloop) {
Core.cycle(1);
updatecount--;
} else {
tv.updateDisplay(); // update when we pause/stop running co... | 6 |
public static int smallestSuccessor( int n ) {
// get p, get c0 and c1
// p is the position of the first non-trailing zero
// c0 is the length of the trailing zeros
// c1 is the length the 1's left to the trailing zeros
//c0
int num = n;
int c0 = 0;
while ( isLastDigitZero( num ) ) {
c0++; ... | 4 |
private static boolean bestPermutation (Tour tour, int a, int b, int c, int d, int e, int f) {
City A = tour.getCity(a);
City B = tour.getCity(b);
City C = tour.getCity(c);
City D = tour.getCity(d);
City E = tour.getCity(e);
City F = tour.getCity(f);
double[] dist = new double[8];
... | 9 |
public int oneSidedBinarySearch(int[] arr, int K) {
int log2 = getLog(arr.length);
int currentI = 0;
while (log2 >= -1) {
System.out.println("currentI: " + currentI);
System.out.println("arr[currentI]: " + arr[currentI]);
if (arr[currentI] == K) {
return arr[currentI];
} else if (arr[currentI... | 4 |
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page ... | 7 |
public void uploadFiles(final String localDirectory, final Collection<String> filenames) throws IOException {
new Thread(new Runnable() {
@Override
public void run() {
try {
connect();
InputStream is;
for (String... | 2 |
@Override
public Iterator<AbstractPlay> iterator() {
return plays.iterator();
} | 0 |
public Id addOrComplete(Element<?> element) {
for (Element actual : elements) {
if (actual.isSameElementAs(element)) {
actual.completeWith(element);
return actual.getId();
}
}
// still there? one doesn't find it, so let's create it
... | 3 |
private void btnGoResaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnGoResaActionPerformed
if (txtDate.getText().equals("")) {
JOptionPane.showMessageDialog(null, "La date est obligatoire.", "Erreur", JOptionPane.ERROR_MESSAGE);
return;
}
String oeu... | 6 |
void updateStorage(double time, int site) {
println("st0 before= " + daStorageUsed[0]);
println("st1 before= " + daStorageUsed[1]);
int size = vUnreleased.size();
println("size=" + size + "; iMinClass=" + iMinClass);
ReleaseStorage rs1 = null, rs2 = null;
Vector<ReleaseStorage> vRemove = new Vector<Releas... | 9 |
public void buildTipMap() {
tipMap.clear();
for (AIColony aic : getAIColonies()) {
for (TileImprovementPlan tip : aic.getTileImprovementPlans()) {
if (!validateTileImprovementPlan(tip)) {
aic.removeTileImprovementPlan(tip);
continue;
... | 6 |
@Override
public void cover(ImageBit[][] list) {
ImageBit ib = new ImageBit();
for (int i = 0; i < 50; i++) {
for (int j = 0; j < 50; j++) {
ib = list[i][j];
if (ib.isCovered()) {
continue;
}
Leg... | 8 |
static GregorianCalendar datum (Component parent, String datumaanduiding){
try {
String[] datumSplit = datumaanduiding.split("-");
if (datumSplit.length != 3) {
JOptionPane.showMessageDialog(parent, "Ongeldige datum", "",
JOptionPane.ERROR_MESSAGE);
... | 6 |
public int getBalance() {
return this.balance;
} | 0 |
public void removeOnetimeLocals() {
StructuredBlock secondBlock = subBlocks[1];
if (secondBlock instanceof SequentialBlock)
secondBlock = ((SequentialBlock) secondBlock).subBlocks[0];
if (subBlocks[0] instanceof InstructionBlock
&& secondBlock instanceof InstructionContainer) {
InstructionBlock first = ... | 7 |
@Override
public boolean isWrapperFor(Class<?> iface) throws SQLException {
return connection.isWrapperFor(iface);
} | 1 |
public void doRun(int run) throws Exception {
if (getRawOutput()) {
if (m_ZipDest == null) {
m_ZipDest = new OutputZipper(m_OutputFile);
}
}
if (m_Instances == null) {
throw new Exception("No Instances set");
}
// Randomize on a copy of the original dataset
Instances runInst... | 8 |
private void setupNeighbours() {
int edgeCount = 0;
for(int i = 0; i < this.gridCellContents.size(); i ++)
{
//if reached end of row start again
if(edgeCount == xSize){
edgeCount = 0;
}
//adds below neighbour
if(i+xSize < this.gridCellContents.size())
{
this.gridCellContents.get(i).a... | 8 |
public static void resetBall(boolean global)
{
if (!global)
{
Game.countdown.setVisible(true);
for (int i = 3; i != 0; i--)
{ // Counts down from 3
Game.countdown.setText("" + i);
Game.countdown.setFont(Game.countdownFont1); // Big font
UPF.pause(750);
Game.countdown.setFont(Game.countdown... | 5 |
public static void boot() {
try {
// 1. Step: Init the application configuration.
ApplicationConfigurationManager.setup();
ApplicationConfiguration appConfig = ApplicationConfigurationManager.get();
int serverPort = Integer.parseInt(appConfig.getServerPort());
// 2. Init the server.
new Mine... | 6 |
protected String addIGameFeatures()
{
myIDisplay = new JTextArea(1, 5);
myIDisplay.setEditable(false);
return new String(DESCRIBE_I);
} | 0 |
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + port;
result = prime * result + ((protocol == null) ? 0 : protocol.hashCode());
result = prime * result + ((ssid == null) ? 0 : ssid.hashCode());
result = prime * result + ((uid == null) ? 0 : uid.hashCode());... | 5 |
public static void main(String[] args)
{
Scanner input = new Scanner(System.in);
Random randomizer = new Random();
int actual = randomizer.nextInt(10) + 1;
int guess = 0;
boolean answer = false;
int current_play = 1;
int attempts = 1;
int gameplays = 0;
System.out.println("Welcome to the Guess A... | 9 |
public void update() {
if (fired) {
v = c;
u = u + d;
fired = false;
} else {
//Simulate 1 ms frame step (can be repeated for larger frame step size)
v += 0.5f*((0.04f * v + 5.0f) * v + 140.0f - u + getI());
u += 0.5f*a * (b * v - u... | 4 |
public boolean recurSearch(int[] A, int target, int start, int end){
if(start > end) return false;
int center = (start + end)/2;
if(A[center] == target) return true;
if(A[center] > A[start] ){
if(A[start] <= target && target <= A[center])
return recur... | 8 |
@Override
public void propertyChange(PropertyChangeEvent evt) {
propertyName = evt.getPropertyName();
oldValue = evt.getOldValue() instanceof String ? (String) evt.getOldValue() : "";
newValue = evt.getNewValue() instanceof String ? (String) evt.getNewValue() : "";
} | 2 |
public static void listEmployeesProjectsPhoneNumbers(EntityManager entityManager) {
TypedQuery<Employee> query = entityManager.createQuery(
"select e from Employee e left join fetch e.projects p left join fetch e.phoneNumbers",
Employee.class);
List<Employee> resultList = query.getResultList();
entit... | 1 |
public boolean getBoolean(int index) throws JSONException {
Object object = this.get(index);
if (object.equals(Boolean.FALSE)
|| (object instanceof String && ((String) object)
.equalsIgnoreCase("false"))) {
return false;
} else if (object.equal... | 6 |
@Override
public void deposito(BigDecimal valor) {
switch(status) {
case Silver:
saldo = saldo.add(valor);
if(saldo.compareTo(new BigDecimal("200000.0")) == 0 || saldo.compareTo(new BigDecimal("200000.0")) == 1) {
status = Categorias.Platinum;
}
else if(saldo.compareTo(new BigDecimal("50000.0")) ==... | 9 |
@Override
public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel)
{
if(mob.location().getArea().properSize()<2)
{
mob.tell(L("This area is too small to cast this spell."));
return false;
}
if(!super.invoke(mob,commands,givenTarget,auto,asLevel))
return ... | 9 |
public void update() {
centerX += speedX;
speedX = bg.getSpeedX()*5;
getHeliBoy1().setBounds(centerX - 25, centerY - 25,50,60);
getHeliBoy2().setBounds(centerX - 25, centerY - 25,50,60);
if (getHeliBoy1().intersects(Robot.yellowRed) || getHeliBoy2().intersects(Robot.yellowRed)){
checkCollision();
}... | 4 |
@Override
public boolean removeAll(Collection<?> arg0) {
boolean result = list.removeAll(arg0);
if (result)
try {
save();
} catch (IOException ex) {
System.err.println("Autosave failed - " + ex.getMessage());
ex.printStackTrace(... | 3 |
private static void callOrderBook(){
try {
Vector<Vector<Double>> array = OrderBookAPI.HttpGetOrderBook();
int n = array.get(0).size();
DefaultTableXYDataset dataset = new DefaultTableXYDataset();
XYSeries data = new XYSeries("Bids", true, false);
for(int i=0; i<n; i++){
... | 8 |
public boolean GiveMoney(String player, int money) {
if (VaultEnabled) {
EconomyResponse resp = econ.depositPlayer(player, money);
if (resp.type == ResponseType.SUCCESS) {
Log(player + " has been given $" + resp.amount + " (new balance $" + resp.balance + ")");
return true;
} else {
Warn("Vault p... | 2 |
public static HashMap<String, Integer> rareWordMarker(String countFile,
String dataFile) throws IOException {
HashMap<String, Integer> wordToCount = new HashMap<String, Integer>();
FileReader in = new FileReader(countFile);
BufferedReader br = new BufferedReader(in);
StringTokenizer stk;
String input;
... | 6 |
public synchronized void release(Object user, MemoryManageable mm) {
if (user == null || mm == null)
return;
//System.out.println("+-+ MM.release() user: " + user + ", mm: " + mm);
HashSet inUse = locked.get(user);
if (inUse != null) {
boolean removed = inUse.remove(mm);
... | 4 |
@Override
public void handlePinEvent(PinEvent event) {
// only process listeners and triggers if the received interrupt event
// matches the pin number being tracked my this class instance
if (this.pin.getPin().equals(event.getPin())) {
if (event.getEventType() == PinEventType.D... | 9 |
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Policestation)) {
return false;
}
Policestation other = (Policestation) object;
if ((this.policeStationID == nu... | 5 |
public String toString(){
String str ="distSegment: "+distSegments.size()+"\n";
str+="Active State ("+pActiveState+", "+tActiveState+")\n";
str+="Predictive State ("+pPredictiveState+", "+tPredictiveState+")\n";
str+="Learn State ("+pLearnState+", "+tLearnState+")\n";
if(this.distSegments.size()>0){
int... | 9 |
private boolean wincheck3() {
for (int column = 0; column < (gv.getColSize()-THREE); column++) {
for (int row = 0; row < (gv.getRowSize()-THREE); row++) {
if (cells[row][column].getValue() != 0
&& cells[row][column].getValue() == cells[row + 1][column + 1]
... | 6 |
public Component getComponents() {
if(!sort) {
setPositions();
return Header;
}
else if(HashTable == null) {
return null;
}
boolean HeaderSet = false;
for(int i = 0; i < 28; i++) {
if(HashTable... | 7 |
private static void quicksortusingmedianpivot(int l, int k) {
// TODO Auto-generated method stub
if(l==k){
return;
}
if (k>l){
int i=l+1; // startelement
int j=l+1; //
int temp;
int arrayr[] = new int[3];
arrayr[0] = array[l];
arrayr[1] = array[k];
arrayr[2] = array[(l+k)/2];
Arrays.sort(arr... | 7 |
public void test_06_fisher_vs_chi2() {
int n11 = 25, n12 = 5;
int n21 = 15, n22 = 15;
int k = n11;
int D = n11 + n12;
int N = n11 + n12 + n21 + n22;
int n = n11 + n21;
// Chi square approximation (without Yates correction)
double pChi = FisherExactTest.get().chiSquareApproximation(k, N, D, n);
if (v... | 3 |
public Component draw() throws ParseException {
final JFrame item = new JFrame();
item.setAlwaysOnTop(true);
item.setSize(new Dimension(300, 250));
item.setResizable(false);
item.setTitle("Order conformation");
JPanel popUp = new JPanel();
popUp.setLayout(new GridBagLayout());
popUp.setBorder(BorderFact... | 4 |
public double getSuojakilvenHalkaisija(){
if (suojakilpi){
return getMahdSuojakilvenHalkaisija();
} else {
return vartalo.getHalkaisija();
}
} | 1 |
@Override
protected void paintComponent(Graphics g) {
// use all pictures from the array
g.drawImage(backgroundImages[currentBackground % backgroundImages.length], 0, 0, null);
g.setColor(Color.GREEN);
g.drawString(String.format("Score: %d\t Level: %d \tLives: %d", score, level, he... | 3 |
public BigDecimal kurtosis_as_BigDecimal() {
boolean hold = Stat.nFactorOptionS;
if (nFactorReset) {
if (nFactorOptionI) {
Stat.nFactorOptionS = true;
} else {
Stat.nFactorOptionS = false;
}
}
BigDecimal kurtosis = BigDecimal.ZERO;
switch (type) {
case 1:
case 12:
BigDecimal[] bd = thi... | 5 |
public void performInterferenceTestBeforeRemove() {
if(!Configuration.interferenceIsAdditive) {
return;
}
if(newAdded) {
testForInterference();
newAdded = false;
}
} | 2 |
public void updateNums()
{
for(int i = 0; i < fleet.size(); i++)
{
Ship ship = fleet.get(i);
for(int x = ship.x; x < ship.x+ship.xSize; x++)
for(int y = ship.y; y < ship.y+ship.ySize; y++)
sea[x][y] = SHIP;
}
} | 3 |
public void adjustChildren() {
//Will crash if it exceeds around 2k objects for some reason and doesn't have size limit
if(noChildren() && props.size() + rects.size() > size && container.getWidth() > 80) {
propChildren = new PropQuad[4];
addChildren(0);
} else if(!noChildren() && props.size() + rects.size()... | 6 |
private static boolean isNameUnique(String name, ArrayList list) {
for (int i = 0, limit = list.size(); i < limit; i++) {
if (name.equals(list.get(i).toString())) {
return false;
}
}
return true;
} | 2 |
private Node addToTree(Node root, int v) {
if (root == null) {
return new Node(v);
}
Node curr = root;
Node prev = null;
int left = -1;
while (curr != null) {
if (curr.v < v) {
prev = curr;
curr = curr.right;
left = 0;
} else if (curr.v == v) {
return root;
} else {
prev = cu... | 5 |
public static void saveGif(BufferedImage[] images, String fname) {
new File("output images/").mkdir();
try {
new File("output images").mkdir();
ImageOutputStream output = new FileImageOutputStream(new File("output images/" + fname));
GifSequenceWriter writer = new Gif... | 3 |
private String funcionarioCargo() {
String cargo = null;
int opcao = 0;
boolean confirma = false;
boolean valido = false;
String resposta;
in = new Scanner(System.in);
while (!confirma) { // enquanto o usua... | 8 |
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 Ex1() {
System.out.println("Inside Mustang()");
name = "Ford";
year = "1976";
color= "Black";
} | 0 |
public void update() {
String latestTweet = getLatestTweetFrom(twitterQuery);
if (latestTweet == null) {
return;
}
clearBoard();
String [] lines = splitToLines(latestTweet, CHARACTERS_IN_LINE - colorCodes.length());
int noOfLines = lines.length;
if (noOfLines > 0) {
int signIndex =... | 8 |
public void paint(Graphics arg0) {
Graphics2D g2d = (Graphics2D) arg0;
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
if (show) {
g2d.setColor(Constants.BLACK_TRANS);
g2d.fill(Constants.CHATBOX_AREA);
g2d.setColor(Color.PINK);
g2d.setFont(Constants.PAINT_TI... | 3 |
public static void main(String[] args) {
// Queue<TaskArg> taskQueue = new LinkedBlockingQueue<TaskArg>();
try {
UIManager.setLookAndFeel(new NimbusLookAndFeel());
} catch (UnsupportedLookAndFeelException e) {
e.printStackTrace();
} catch (Throwable e) {
... | 8 |
public ZeroFilter(final ConnectionProcessor proc, final Properties config) {
super(proc, config);
} | 0 |
public List<KeyRegistrationRecord> getPeers(String inBase64Key) {
long start = System.currentTimeMillis();
List<KeyRegistrationRecord> out;
int maxFriendsToReturn = 26;
try {
maxFriendsToReturn = Integer.parseInt(System.getProperty(EmbeddedServer.Setting.MAX_FRIENDS_RETURNED.getKey()));
} catch( Except... | 2 |
private void savePath(Vector<Integer> Row)
{
//Path-Objekt erstellen
Path P = new Path();
//Der Weg beginnt mit der aktuellen Position
P.addPoint(position);
for(int z=0; z<Row.size(); z++)
{
//Vector I enthaelt den Weg von 0 bis z
Vector<Integer> I = new Vector<Integer>();
for(int u=0; u<=z;... | 2 |
private boolean jj_3R_47()
{
if (jj_scan_token(LEFTB)) return true;
if (jj_3R_9()) return true;
if (jj_scan_token(COMMA)) return true;
if (jj_3R_9()) return true;
if (jj_scan_token(RIGHTB)) return true;
return false;
} | 5 |
private void processEncodedTable(Decoder dec) throws ASN1DecoderFail {
/*
Table ::= SEQUENCE {
name TableName,
fields SEQUENCE OF FieldName,
fieldTypes SEQUENCE OF FieldType,
rows SEQUENCE OF SEQUENCE OF NULLOCTETSTRING
}
*/
dec=dec.getContent();
// Get all stuff
String tableName=dec.... | 6 |
public static final FieldObjectInstantiator getResolver(final Class<?> field_origin, final Class<?> resolver_enclosing_class, final String resolver_function) throws NoSuchMethodException {
if (resolver_function == null) {
return getDefaultInstantiator(field_origin);
} else {
for (final Method method : Reflect... | 9 |
public void update() {
if(XboxController.controller != null)
XboxController.update();
if (gameStates[currentState] != null)
gameStates[currentState].update();
} | 2 |
public boolean isLastState(State state) {
if (state == null) return false;
reSortSubProcesses();
SubProcess sp = state.getSubProcess();
if (sp == null || !this.subProcesses.contains(sp)) return false;
if (this.subProcesses.indexOf(sp) == this.subProcesses.size() - 1) return true;
return false;
} | 4 |
private void testParseText() {
String TEXT = "A beginning is the time for taking the most delicate care that the balances are \n" +
"correct";
StanfordParser sp = new StanfordParser("parser");
ArrayList<ArrayList<Tuple>> parsedText = sp.parseText(TEXT);
assert parsedText.... | 4 |
@Override
public double getImportance(List<Example> exampleCollection) {
// assume winner 1 as positive, winner 2 as negative
double startEntropy = getEntropy(exampleCollection);
double entropyReminder = 0;
List<AttributeValue> aValueList = getAttributeValues();
List<Double> entropyList = new ArrayList<Dou... | 5 |
@Override
public void handle(SocketChannel channel, Packet packet) {
if (packet instanceof GameInfoPacket) {
handleGameInfo((GameInfoPacket)packet);
} else if (packet instanceof PlayerJoinGamePacket) {
handleJoinGame((PlayerJoinGamePacket)packet);
} else if (packet instanceof SpawnPacket) {
handleSpawn(... | 7 |
public void doRender(Graphics2D g, double interpolation, long renderCount) {
// Call the superclass' doRender, including the user defined render() function
super.doRender(g, interpolation, renderCount);
float opacity = (float)__getOpacity();
if (opacity <= 0.001) {
return; /... | 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.