text stringlengths 14 410k | label int32 0 9 |
|---|---|
@Override
public void launchContainers() throws Exception {
String noOfContainers = getJobConfiguration().getProperty(SingularConstants.KEY_NO_OF_CONTAINERS);
String containerClassName = getJobConfiguration().getProperty(SingularConstants.KEY_CONTAINER_CLASS);
String containerCores = getJobC... | 7 |
public boolean isDebugMode() {
return getConfig().getBoolean("angry-debug", false);
} | 0 |
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
String method = request.getParameter("method");
String data = request.getParameter("data");
request.setAttribute("data", request.getParameter(... | 9 |
private static int[] getMinPrefMaxSumSize(int[][] sizes) {
int[] retSizes = new int[3];
for (int i = 0; i < sizes.length;
i++) {
if (sizes[i] != null) {
int[] size = sizes[i];
for (int sType = LayoutUtil.MIN;
sType <= L... | 9 |
public byte[] decodeBytes() {
byte[] res = new byte[decodeInt()];
for (int i = 0; i < res.length; i++) {
res[i] = decodeByte();
}
return res;
} | 1 |
public boolean isEqual(LiteralLabel value1, LiteralLabel value2) {
if (value1.getDatatype() instanceof XSDBaseNumericType && value2.getDatatype() instanceof XSDBaseNumericType) {
Long n1, n2;
n1 = null;
n2 = null;
Object v1 = value1.getLexicalForm();
Object v2 = value2.getLexicalForm();... | 8 |
void createXML(String xml, int orders, int robots, int shelves,
int pickers, int maxOrder, int maxStock, boolean randOrder,
boolean randStock) {
Warehouse wh = new Warehouse();
// Creating Orders
if (orders > 0) {
this.orders = orders;
if (maxOrder <= 0) {
maxOrder = 4;
}
Orders x = new Ord... | 7 |
public static double get(String util) {
double weighting = (util.matches("[+-]?\\d*(\\.\\d+)?"))? Double.parseDouble(util) : new Random().nextDouble();
if (util.equals("random") || util.equals("next")) {
weighting = new Random().nextDouble() + MIN;
}
else if (util.equals("previous")) {
weighting = P... | 8 |
static void stepRK(ArrayList<Body> v, double dt) {
for (int i = 0; i < v.size(); i++) {
v.get(i).setF(Body.forces(v.get(i), v, i));
}
ArrayList<Body> supp = new ArrayList<Body>();
for (int i = 0; i < v.size(); i++) {
Body b = v.get(i);
double x = b.p.x;
double y = b.p.y;
double z = b.p.z;
... | 4 |
public static void adjustToSameSize(Component... comps) {
Dimension best = new Dimension();
for (Component comp : comps) {
Dimension size = comp.getPreferredSize();
if (size.width > best.width) {
best.width = size.width;
}
if (size.height > best.height) {
best.height = size.height;
}
}
fo... | 4 |
public void setSecondElement( E newSecond ) {
if ( newSecond == null ) {
throw new NullPointerException();
}
this.secondElement = newSecond;
} | 1 |
public void setPendingStage( int pendingStage ) {
if ( pendingStage <= 0 || pendingStage > shipBlueprintIds.length )
throw new IndexOutOfBoundsException( "Attempted to set 1-based flagship stage "+ pendingStage +" of "+ shipBlueprintIds.length +" total" );
this.pendingStage = pendingStage;
} | 2 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
CarType other = (CarType) obj;
if (name == null) {
if (other.name != null)
return false;
} else if (!name.equals(other.name))
return ... | 6 |
private final void draw1(byte[] is, int[] is_74_, int i, int i_75_,
int i_76_, int i_77_, int i_78_, int i_79_,
int i_80_, int i_81_, int i_82_, int i_83_,
aa var_aa, int i_84_, int i_85_) {
aa_Sub3 var_aa_Sub3 = (aa_Sub3) var_aa;
int[] is_86_ = ((aa_Sub3) var_aa_Sub3).anIntArray5201;
int[] is_87_ ... | 9 |
public Card(String s) {
switch (s.charAt(0)){
case 'J':
this.value=11;
break;
case 'Q':
this.value=12;
break;
case 'K':
this.value=13;
break;
case 'A':
this.value=14;
break;
default:
this.value=(s.charAt(0)-'0');
}
switch (s.charAt(1)){
case 'S':
this.suit=0;
break;
... | 8 |
private void initializeTransitionCycle(TabListWidget... listWidgets) {
SelectionTransition previousTransition = null;
for (int i = 0; i < listWidgets.length; i++) {
SelectionTransition transition = new SelectionTransition(listWidgets[i]);
if(previousTransition != null)
transition.setPrevious(previousTrans... | 3 |
public void findDocumentFrequency(){
for(String uniqueToken : tokenList){
for(Text t : textList){
if(t.getTokens().contains(uniqueToken)){
if(!documentFrequency.containsKey(uniqueToken)){
documentFrequency.put(uniqueToken, 0);
}
documentFrequency.put(uniqueToken, documentFrequency.get(uni... | 4 |
@Override
public void undo() {
} | 0 |
private String setBudgetType(Budget budget) {
return (budget instanceof AnnualBudget) ? ANNUAL : MONTHLY;
} | 1 |
public Object nextContent() throws JSONException {
char c;
StringBuffer sb;
do {
c = next();
} while (Character.isWhitespace(c));
if (c == 0) {
return null;
}
if (c == '<') {
return XML.LT;
}
sb = new Str... | 7 |
public static ArrivalBoardingActivityEnumeration fromString(String v) {
if (v != null) {
for (ArrivalBoardingActivityEnumeration c : ArrivalBoardingActivityEnumeration.values()) {
if (v.equalsIgnoreCase(c.toString())) {
return c;
}
}
}
throw new IllegalArgumentException(v);
} | 3 |
public static double[][] removeRowColumn(double[][] origMatrix, int row, int col){
double[][] destMatrix = new double[origMatrix.length-1][origMatrix.length-1];
int p = 0;
for( int i = 0; i < origMatrix.length; ++i)
{
if ( i == row)
continue;
int q = ... | 4 |
public boolean init(Sim_port output, AllocPolicy policy, int resourceID)
{
if (output == null || policy == null || resourceID < 0) {
return false;
}
outputPort_ = output;
policy_ = policy;
resourceID_ = resourceID;
resIdObj_ = new Integer(resourceID);
... | 3 |
@Override
public Iterator<Cell<V>> iterator() {
return new Iterator<Cell<V>>() {
private MutableCell<V> cell = new MutableCell<V>();
private int count;
private int current = -1;
@Override
public boolean hasNext() {
... | 5 |
public Matrix getIndentity(){
if(width == height){
float[][] values = new float[width][width];
for(int i = 0; i < width; i++){
for(int j = 0; j < width; j++){
if(i == j){
values[i][j] = 1;
}else{
values[i][j] = 0;
}
}
}
return new Matrix(values, width, width);... | 4 |
public void insertString(int offs, String str, AttributeSet a) throws BadLocationException {
// return immediately when selecting an item
if (selecting) {
return;
}
// insert the string into the document
super.insertString(offs, str, a);
// lookup and select a... | 2 |
public int getFTG() {
return ftg;
} | 0 |
void runBinGobbler() {
FileOutputStream redirectWriter = null;
running = true;
try {
// Create buffer
byte buffer[] = new byte[BUFFER_SIZE];
int num = 0;
// Create redirect file (if any)
if (redirectTo != null) redirectWriter = new FileOutputStream(redirectTo);
// Read input
while ((num = i... | 7 |
public void move()
{
int dx = 0;
int dy = 0;
switch (direction)
{
case Up:
dy = -Block.HEIGTH;
break;
case Down:
dy = Block.HEIGTH;
break;
case Left:
dx = -Block.WID... | 5 |
private boolean canBuild(Player player, Block block) {
if (player.hasPermission(STPermission.ADMIN.getPermission())) {
return true;
}
final Town town = plugin.getTown(block.getChunk());
if (town == null) {
if (block.getLocation().getBlockY() <= new TownUtils(plug... | 4 |
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
TradeOrder other = (TradeOrder) obj;
if (count != other.count)
return false;
if (resourceType == null) {
if (other.resourceType != null)
... | 7 |
public static Matcher matchInFile(File f, Pattern pattern) throws FileNotFoundException {
Scanner sFile = new Scanner(f);
while (sFile.hasNextLine()) {
String line = sFile.nextLine();
Matcher m = pattern.matcher(line);
Boolean found = m.find();
if(found) {
sFile.close();
return m;
}
}
... | 2 |
protected boolean xObstacleAhead(double time) {
for (StaticObject so : AppFrame.getFrameDesign().getStaticObjects()) {
if (checkXObstacle(so, time)) {
if (obstacleReaction(so)) {
if (currentHorizontalSpeed > 0) {
this.currentCoord.setX(so.g... | 6 |
public void createPlayersProjectile2(int x, int y, int offX, int offY, int angle, int speed, int gfxMoving, int startHeight, int endHeight, int lockon, int time, int slope) {
//synchronized(c) {
for(int i = 0; i < Config.MAX_PLAYERS; i++) {
Player p = Server.playerHandler.players[i];
if(p != null) {
C... | 5 |
void rotate(Node n, Side s, boolean first) {
final Side o = (s == Side.L) ? Side.R : Side.L ;
final Side nS = n.side ;
final Node
p = n.parent,
x = kidFor(n, o),
y = n,
a = kidFor(x, o),
b = kidFor(x, s),
c = kidFor(y, s) ;
if (first && heightFor(b) > heightFor(a)) {
... | 4 |
public static void main(String[] args) {
CodeConfiguration conf = new CodeConfiguration(null);
conf.setAvailableHardwareThreads(2);
conf.setLoggingEnabled(true);
// DON'T SET CONFIGURATION PARAMETERS BEHIND THIS LINE !!!
IEvaluator evaluator = conf.getEvaluator();
Linked... | 8 |
private static void transform(final MethodEditor method) {
if (CounterDecorate.VERBOSE > 1) {
System.out.println("Decorating method " + method);
}
final MemberRef rcfield = new MemberRef(Type
.getType(CounterDecorate.COUNTER_MAIN), new NameAndType(
CounterDecorate.COUNTER_RCNAME, Type
.getType(C... | 7 |
private static void displayUserAwards(BufferedReader reader, VideoStore videoStore) {
try {
System.out.println("Please enter the max number of user you would like to see in each category");
int amount = readInt(reader, 1, -1);
System.out.println();
System.out.prin... | 3 |
public boolean isDraw() {
return theHouse.hasBust() && player.hasBust()
|| theHouse.getScore() == player.getScore();
} | 2 |
public void printPrevPopulation(){
for(String[] d : this.prevPopulation){
for(String s : d){
System.out.print(s + ", ");
}
System.out.println();
}
} | 2 |
public boolean startDragComponent(Point p) {
// disable DnD for some cases :
// - child of a compound dockable, in hidden state
// - child of a maximized compund dockable
// - maximized dockable
DockableState.Location targetLocation = target.getDockKey().getLocation();
if(targetLocation == DockableState.Lo... | 8 |
public boolean isOptOut() {
synchronized (optOutLock) {
try {
// Reload the metrics file
configuration.load(getConfigFile());
} catch (IOException ex) {
if (debug) {
Bukkit.getLogger().log(Level.INFO, "[Metrics] " + ex.g... | 4 |
protected void acceptSocket() {
try {
Socket socket;
socket = serverSocket.accept();
boolean equal = false;
for (EziPeer p : peers) {
if (p.getSocket().getInetAddress().equals(socket.getInetAddress())) {
equal = true;
... | 5 |
@Override
public MovementAction testAction(Creature c) {
Direction action = this.checkForDirt(c);
if (action != null){
currentDirection = action;
return Direction.convertDirToAct(action);
}
int value = -1;
int dist = -1;
Sensor s = c.getSensor();
if (currentDirection != null){
value = (int) s.ge... | 8 |
public void visitCastExpr(final CastExpr expr) {
print("((" + expr.castType() + ") ");
if (expr.expr() != null) {
expr.expr().visit(this);
}
print(")");
} | 1 |
public static void main(String[] args) throws Exception {
Thread t = new Thread(new ADaemon());
t.setDaemon(true);
t.start();
TimeUnit.MILLISECONDS.sleep(100);
} | 0 |
private void addToAdjBuffer (double in) {
double lossAverage=25.0;
if (NOISY) lossAverage=60.0;
// If the buffer average percentage difference is more than lossAverage then we have lost the signal
if (absAverage()>lossAverage) {
if (display==true) {
// Tell the user how many bits were received
String... | 5 |
@Override
public void move(GameBoard board, Control control) {
int[][] overall = new int[7][4];
startState = new int[7][6];
for (int n = 0; n < 7; n++) {
for (int m=0; m<6; m++) {
startState[n][m] = board.get_state(n, m);
}
}
for (int i=0; i<4; i++) {
int[] scores = eval(board, control, startSta... | 6 |
* @see InitStmt
*/
public void initLocals(final Collection locals) {
final LocalExpr[] t = new LocalExpr[locals.size()];
if (t.length == 0) {
return;
}
final Iterator iter = locals.iterator();
for (int i = 0; iter.hasNext(); i++) {
t[i] = (LocalExpr) iter.next();
}
addStmt(new InitStmt(t));
... | 2 |
@Override
protected Class<?> loadClass(final String name, boolean resolve) throws ClassNotFoundException {
Class<?> clazz = null;
synchronized (this) {
clazz = findLoadedClass(name);
}
if (clazz == null) {
clazz = withClassLoaders(new AbstractClassLoaderClos... | 7 |
private boolean jj_2_13(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_13(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(12, xla); }
} | 1 |
public void moveOnX(int xMoveSize) {
int casePositionX = 0, casePositionYup = 0, casePositionYdown = 0;
int caseSize = GameVue.getCaseSize();
switch(xMoveSize) {
case 10 :
casePositionX = (player.getxPosition() + caseSize + xMoveSize - 1) / caseSize;
... | 7 |
public CancelInvoiceResponse(Map<String, String> map, String prefix) {
if( map.containsKey(prefix + "responseEnvelope" + ".timestamp") ) {
String newPrefix = prefix + "responseEnvelope" + '.';
this.responseEnvelope = new ResponseEnvelope(map, newPrefix);
}
if( map.containsKey(prefix + "invoiceID") ) {
... | 6 |
private static void validerReponse(Reponse reponse) throws ChampInvalideException, ChampVideException {
if (reponse.getMessage() == null || reponse.getMessage().isEmpty())
throw new ChampVideException("La réponse ne peut être vide");
if (reponse.getSujet() == null)
throw new Cham... | 4 |
private Connection getConnection() {
try {
Class.forName("org.sqlite.JDBC");
} catch (ClassNotFoundException e) {
Utilities.outputError("Could not find sqlite drivers");
return null;
}
try {
return DriverManager.getConnection("jdbc:sqlite:" + m_databaseFile.getAbsolutePath());
} catch (SQLE... | 2 |
public void replaceFood() {
for (int[] i : foodSpawnCells) {
getCell(i).setFood(5);
}
} | 1 |
protected Game(String cfgPath) {
try {
introduceParameterName(getClass(), "TIME_LIMIT");
setParameter("TIME_LIMIT", "0"); //infinite turn time
if(cfgPath == null) {
board = loadConfigFile(null);
if(board == null) //if a Board was not created by loadConfigFile when you passed loadConfigFile 'null'
... | 6 |
public static void setBreedingAge(int newBREEDING_AGE)
{
BREEDING_AGE = newBREEDING_AGE;
} | 0 |
public org.omg.CORBA.portable.OutputStream _invoke (String $method,
org.omg.CORBA.portable.InputStream in,
org.omg.CORBA.portable.ResponseHandler $rh)
{
org.omg.CORBA.portable.OutputStream out = null;
java.lang.Integer __method = (java.lang.Integ... | 3 |
private void closeButtonActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_closeButtonActionPerformed
{//GEN-HEADEREND:event_closeButtonActionPerformed
try
{
echoClient.close();
} catch (IOException ex)
{
Logger.getLogger(ChatGui.class.getName()).l... | 1 |
public static boolean isValidXML(String path) throws IOException {
File f = new File(path);
if (f.exists() && !f.isDirectory()) {
// check if XML
String extension = "";
int i = path.lastIndexOf('.');
if (i > 0) {
extension = path.substring(i + 1);
if (extension.equalsIgnoreCase("XML")) {
... | 4 |
private boolean uhattuAlhaalta(int pelaajaNumero, int x, int y) {
int i = 1;
while(x+i < 8 && kentta[x+i][y].onTyhja()) i++;
if(x+i == 8) return false;
if(kentta[x+i][y].getNappula().omistajanPelinumero() != pelaajaNumero) {
if(i == 1 && kentta[x+i][y].getNa... | 8 |
public Node<Integer> mergeSort(Node<Integer> head) {
if (head == null)
return null;
if (head.next == null)
return head;
Node<Integer> slow = head;
Node<Integer> fast = head;
while (fast.next != null && fast.next.next != null) {
slow = slow.next;
fast = fast.next.next;
}
Node<Integer> sec = s... | 4 |
public void join() {
cleanUp();
super.join();
} | 0 |
@Override
public String encode(Response response) throws EncoderException {
MessageDigest md5 = null;
try {
md5 = MessageDigest.getInstance("MD5");
} catch (Exception e) {
System.out.println(e.toString());
e.printStackTrace();
return "";
}
if (response.getResponse() == null)
return "";
char... | 5 |
public void setObjectShape(Object o){
objectShape = o;
} | 0 |
* @param options
* @return StringWrapper
*/
public static StringWrapper shellCommand(Stella_Object command, Cons options) {
if (((Boolean)(OntosaurusUtil.$BLOCK_SHELL_COMMANDp$.get())).booleanValue()) {
throw ((StellaException)(StellaException.newStellaException("Execution of `shell-command' is blocke... | 6 |
private void mapFileReAccessRequirements( HypertextAccessFile htaccess,
URI requestedURI,
File requestedFile,
Map<String,BasicType> optionalReturnSettings,
Environment<String,BasicType> session,
String authType ) {
// Finally: store some session data for the ca... | 3 |
public static Header createOAuthHeader(Token token) {
return new BasicHeader(AUTH.WWW_AUTH_RESP, "OAuth " +
(token == null || !token.valid() ? "invalidated" : token.access));
} | 2 |
public double removeMax() {
if ( _heap.size() == 0 )
return -1.0;
else
_size--;
//store root value for return at end of fxn
double retVal = peekMax();
//store val about to be swapped into root
double foo = _heap.get( _heap.size() - 1);
//swap last (rightmost, deepest) leaf with root
swap( 0, _hea... | 4 |
public void testToStandardSeconds() {
Period test = new Period(0, 0, 0, 0, 0, 0, 7, 8);
assertEquals(7, test.toStandardSeconds().getSeconds());
test = new Period(0, 0, 0, 0, 0, 1, 3, 0);
assertEquals(63, test.toStandardSeconds().getSeconds());
test = new Period(... | 1 |
private int bruteEst(GameState state, Card card) {
int est = 0;
//We see if the brute will actually knock somebody out or not
for(Player p : state.getPlayerList())
{
if(!p.getFaction().equals(card.getFaction()))
{
for(Card c : p.getHand())
{
if(c.getValue() >= card.getValue())
est++;... | 4 |
private void handleInputFile(Object input)
{
Configuration[] configs = null;
AutomatonSimulator simulator = getSimulator(automaton);
/* if (input instanceof InputBox)
{
InputBox tt=(InputBox) input;
if (getObject() instanceof TuringMachine)
tt.addSimulator(automaton, simulator, true);
else
tt.a... | 2 |
public void hit(Player player) {
if (player.getHand().size() < 5 && deck.size() > 0) {
deck.get(deck.size() - 1).flip();
player.getHand().add(deck.get(deck.size() - 1));
deck.remove(deck.size() - 1);
player.refreshImage();
refreshImage();
}
} | 2 |
public static void forceFocusToAccept() {
KeyboardFocusManager focusManager = KeyboardFocusManager.getCurrentKeyboardFocusManager();
Component focus = focusManager.getPermanentFocusOwner();
if (focus == null) {
focus = focusManager.getFocusOwner();
}
if (focus != null) {
FocusListener[] listeners = focu... | 4 |
public DefaultTempFile(String tempdir) throws IOException {
file = File.createTempFile("NanoHTTPD-", "", new File(tempdir));
fstream = new FileOutputStream(file);
} | 0 |
public void createTable(byte[] table)
{
boolean isSystemTable = ForemanConstants.TableIdentifier.getIdentifierFromName(table) != null;
boolean tableExists = tableExists(table);
if (!tableExists && !isSystemTable)
{
instance.hset(ForemanConstants.TableIdentifier.TABLE.getId(), table, ForemanConstants.TableId... | 4 |
public void mergeUnsortedWithSortedList(ArrayList<node> unsorted,ArrayList<node> sorted){
if(unsorted.size()>0){
while(unsorted.size()>0){
for(int i = 0;i<=sorted.size();i++){
if(i==sorted.size()){
sorted.add(unsorted.get(0));
... | 5 |
public static JulianDate jauCal2jd(int iy, int im, int id) throws JSOFAIllegalParameter
{
int ly, my;
long iypmy;
double djm0, djm;
/* Earliest year allowed (4800BC) */
final int IYMIN = -4799;
/* Month lengths in days */
final int mtab[]
= {31, ... | 9 |
public Iterator<ResultSet> getIteratorFromQuery(String query)
{
Iterator<ResultSet> ret = null;
Connection connection = null;
Statement statement = null;
try
{
Class.forName(driver);
connection = DriverManager.getConnection(url, username, passwd);
statement = connection.createStatement();
final ... | 9 |
private void GestionSelection() {
// Initialisation
boolean trouve = false;
ListIterator<Forme> it = model.getCalqueCourant().listIterator();
while (it.hasNext())
it.next(); // On déroule la liste pour commencer par la fin
// Vérification de la touche contrôle
if ( !model.getControlPressed() ) {
m... | 8 |
public WikiPagePath getFullPath(WikiPage suiteSetup) {
if (suiteSetup.getName().equals(SuiteResponder.SUITE_SETUP_NAME)) {
return new WikiPagePath (SuiteResponder.SUITE_SETUP_NAME);
}
if (suiteSetup.getName().equals(SuiteResponder.SUITE_TEARDOWN_NAME)) {
return new WikiPagePath (SuiteResponder.SUITE_TEARDOW... | 4 |
public Dimension preferredLayoutSize(Container parent) {
synchronized (parent.getTreeLock()) {
Insets insets = parent.getInsets();
int totalWidth = maxWidth - insets.left - insets.right;
int height = 0;
int width = 0;
int maxHeightOfThisLine = 0;
int componentCount = parent.getComponentCount();... | 4 |
@Test
public void EnsureLeadingSlashIsRemoved() {
String path = "/x/y";
String newpath = Path.trimSlashes(path);
assertEquals("x/y", newpath);
} | 0 |
public final void setBounds(float var1, float var2, float var3, int var4, int var5, int var6, float var7) {
this.vertices = new Vertex[8];
this.quads = new TexturedQuad[6];
float var8 = var1 + (float)var4;
float var9 = var2 + (float)var5;
float var10 = var3 + (float)var6;
var1 -= var... | 4 |
public synchronized Request getNextBlockRequest(Peer peer, int[] piecesFrequencies){
RequestExtended recoveredRequest = recoverRequest(peer);
if (recoveredRequest != null){
associateRequest(peer,recoveredRequest);
return recoveredRequest;
}
Integer piece... | 9 |
private void sequentialTraverse(FineNode<T> curr, Operation<T> operation) {
if (curr != null && curr == root && curr.getLeft() == null && curr.getRight() == null) {
operation.empty(curr);
return;
}
if (curr == null || curr.getValue() == null) {
return;
}
operation.start(curr);
sequentialTraverse(cu... | 6 |
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jMenu1 = new javax.swing.JMenu();
jMenu2 = new javax.swing.JMenu();
jMenuItem1 = new javax.swing.JMenuItem();
jMenu3 = new jav... | 0 |
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((email == null) ? 0 : email.hashCode());
result = prime * result
+ ((endereco == null) ? 0 : endereco.hashCode());
result = prime * result + ((id == null) ? 0 : id.hashCode());
result = prime * result + (... | 4 |
private void countEdges() {
int edges = 0;
if (getState() == States.ARR_ADJ)
for (int i = 0; i < N; i++)
for (int j = 0; j < N; j++)
if (arr_adj[i][j] != 0)
edges++;
this.M = edges;
} | 4 |
private void readData() {
byte[] timeBuffer = new byte[8];
StringBuilder sb = new StringBuilder();
Formatter formatter = new Formatter(sb, Locale.US);
ByteArrayInputStream inStream = new ByteArrayInputStream(
outStream.toByteArray());
DataInputStream reader = new DataInputStream(inStream);
try {
for ... | 2 |
private void handleBidSubmission(TACMessage msg) {
Bid bid = (Bid) msg.getUserData();
int status = NO_ERROR;
while (msg.nextTag()) {
if (msg.isTag("bidID")) {
int id = msg.getValueAsInt(Bid.NO_ID);
bid.setID(id);
} else if (msg.isTag("bidHash")) {
String hash = msg.getValue();
bid.setBidHas... | 9 |
public void driver() {
System.out.println("benz drive");
} | 0 |
@SuppressWarnings("unchecked")
public void saveMessage(HttpServletRequest request, String msg) {
List<String> messages = (List<String>) request.getSession().getAttribute(MESSAGES_KEY);
if (messages == null) {
messages = new ArrayList<String>();
}
messages.add(msg);
... | 1 |
public int getMaxSubArrayProduct(int[] a) throws IllegalArgumentException {
if (a == null || a.length == 0) { throw new IllegalArgumentException(); }
int _MAX_EndingHere = 1;
int _MIN_EndingHere = 1;
int maxSoFar = Integer.MIN_VALUE;
for (int i = 0; i < a.length; i++) {
/*
* If current ... | 6 |
public void updateAll(){
try{
DocumentBuilderFactory docFac = DocumentBuilderFactory.newInstance();
DocumentBuilder docB= docFac.newDocumentBuilder();
Document doc = docB.parse("/Users/djdrty/Desktop/KaneClub/players.xml");
Node players = doc.getFirstChild();
... | 8 |
@Override
public String getDescription(Hero hero) {
String base = String.format("Move through a wall of blocks.");
StringBuilder description = new StringBuilder( base );
//Additional descriptive-ness of skill settings
int initCD = SkillConfigManager.getUseSetting(hero, this,... | 6 |
@Override
public void actionPerformed(ActionEvent e)
{
if ("bStartCasual".equals(e.getActionCommand()))
{
Main.frameMM.setVisible(false);
Main.currentGame = new OneFlower(GameMode.CASUAL);
Main.currentGame.start();
}
else if ("bStartHard".equals(e.getActionCommand()))
{
Main.frameMM.setVisible(f... | 4 |
@Override
public List<Cotacao> filterGrid(String filter) {
List<Cotacao> lista = service.findAll();
if ("".equals(filter) || filter.equals("*")) {
return lista;
}
List<Cotacao> filtro = new ArrayList<Cotacao>();
for (Cotacao cotacao : lista) {
if (... | 4 |
public Date getDeclareDate() {
return declareDate;
} | 0 |
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.