text stringlengths 14 410k | label int32 0 9 |
|---|---|
private void multicast(Command com) {
try {
byte[] buffer = null;
if(com instanceof Send)
buffer = Utils.toByteArray((Send)com);
if(com instanceof Join)
buffer = Utils.toByteArray((Join)com);
if(com instanceof Leave)
buffer = Utils.toByteArray((Leave)com);
D... | 4 |
public static void main(String args[] ) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String line ;
while ((line = br.readLine()) != null) {
String tail = "";
if (line.contains("//")) {
int pos = line.index... | 2 |
private boolean canMoveDiagonal(Grid grid, Position pos) {
for (Element element : grid.getElementsOnGrid()) {
if (element instanceof Player
&& ((Player) element).getLightTrail().getPositions().contains(new Position(pos.getxCoordinate() - 1, pos.getyCoordinate()))
&& ((Player) element).getLightTrail().get... | 4 |
@Override
public boolean equals(Object obj)
{
if(this == obj)
return true;
if(!(obj instanceof VirtualIPAddress))
return false;
if(!super.equals(obj))
return false;
// same VNO
VirtualIPAddress that = (Virtual... | 7 |
public void saveSignals() {
final String signalsFilePath = dlgSignals.open();
if (signalsFilePath != null) {
Yaml yaml = new Yaml();
BufferedWriter stream = null;
try {
stream = new BufferedWriter(new FileWriter(signalsFilePath));
strea... | 3 |
@Override
public void updateProduct(Product product) throws SQLException {
Session session=null;
try{
session=HibernateUtil.getSessionFactory().openSession();
session.beginTransaction();
session.update(product);
session.getTransaction().commit();
}catch(Exception e){
e.printStackTrace();
}finall... | 3 |
public void keyReleased()
{ // keys released for avatar movement
if(key == CODED && keyCode == RIGHT)
{
rightKey = false;
}
if(key == CODED && keyCode == LEFT)
{
leftKey = false;
}
if(key == CODED && keyCode == UP)
{
upKey = false;
}
if(key == CODED && keyCode == DOWN)
{
d... | 8 |
public void actionPerformed(ActionEvent e) {
if (e.getSource() == converter) {
berekenMensualiteit();
} else if (e.getSource() == create) {
createTable();
}
activateButtons();
} | 2 |
@Override
public boolean equals(Object o)
{
if (!(o instanceof RGBColor)) return false;
if (this == o) return true;
final RGBColor comp = (RGBColor) o;
if (Float.compare(r, comp.r) != 0) return false;
if (Float.compare(g, comp.g) != 0) return false;
if (Float.compare(b, comp.b) != 0) return false;
if ... | 6 |
@Override
public boolean equals(Object obj) {
if (obj != null
&& (obj.getClass().equals(TCard.class)
|| obj.getClass().equals(Token.class))) {
if (this.ID == null || ((TCard) obj).ID == null) {
Debug.p("Comparing cards with null ID!", Debug.W);
... | 5 |
public void writeTofile(Network net) {
try {
BufferedWriter out = new BufferedWriter(new FileWriter("/Users/jackgraham/Documents/MatLab/test2.m"));
out.write("net = network;");
out.newLine();
out.write("net.numInputs=(" + net.getInputAmount() +");");
out.newLine();
out.write("net.numLayers=(" + net.... | 7 |
@Override
public void windowClosing(WindowEvent e)
{
// System.exit(0);
super.windowClosing(e);
System.exit(0);
} | 0 |
public void setPlainValue(byte[] value) {
this.plainValue = value;
} | 0 |
public static void clearFolder (File folder) {
if (folder.exists()) {
for (String file : folder.list()) {
if (new File(folder, file).isDirectory()) {
clearFolder(new File(folder, file));
}
if (file.toLowerCase().endsWith(".zip") || ... | 9 |
private boolean verifyNewTradeRoute() {
Player player = getFreeColClient().getMyPlayer();
// Check that the name is unique
for (TradeRoute route : player.getTradeRoutes()) {
if (route.getId().equals(originalRoute.getId())) continue;
if (route.getName().equals(tradeRouteN... | 6 |
public void thisMenuBarMouseReleased(java.awt.event.MouseEvent e)
{
Object src = e.getSource() ;
if ( src == jMenuFileLoad )
{
tbLoadButtonActionPerformed( null ) ;
}
else if ( src == jMenuFileReload )
{
tbReloadButtonActionPerformed( null ) ;
}
else if (... | 9 |
public String getPath(rpc.Helper.PathType type)
{
String ret = rpc.Helper.getRelativePath(this.getCurrentPackage(), type);
switch(type)
{
case eInterfaceHeader:
case eApiFolder:
case eProxyHeader:
case eStubBaseHeader:
ret = outputDir+"/api/" + ret;
break;
case eImplFolder:
case eParamsHeader:
... | 9 |
public TableStats (int tableid, int ioCostPerPage)
{
this.tableid = tableid;
this.ioCpstPerPage = ioCostPerPage;
Catalog catalog = Database.getCatalog();
DbFile dbFile = catalog.getDbFile(tableid);
TupleDesc tupleDesc = dbFile.getTupleDesc();
int numFields = tupleDesc.numFields();
MinMaxPair... | 8 |
public static Stella_Object convertToLiteral(Stella_Object renamed_Object) {
if (renamed_Object == null) {
return (renamed_Object);
}
{ Surrogate testValue000 = Stella_Object.safePrimaryType(renamed_Object);
if (Surrogate.subtypeOfP(testValue000, Stella.SGT_STELLA_LITERAL_WRAPPER)) {
{ ... | 7 |
public void computeColorManagers() {
double maximumValue = 0;
double minimumValue = 0;
for (List<PointWithHamma> pointWithHammaList : solver.getFlyingPointsWithHama().values()) {
for (PointWithHamma pointWithHamma : pointWithHammaList) {
if (pointWithHamma.getHamma()... | 7 |
private void resizeScreenIfNeeded() {
TerminalSize newSize;
synchronized(resizeQueue) {
if(resizeQueue.isEmpty())
return;
newSize = resizeQueue.getLast();
resizeQueue.clear();
}
int height = newSize.getRows();
int width = newS... | 7 |
public void storeDefinition(boolean isStatic, String variable, String value) {
int i1 = variable.indexOf("[");
if (i1 != -1) {
int i2 = variable.indexOf("]");
if (i2 != -1) {
int size = getArraySize(variable.substring(0, i1));
String index = variable.substring(i1 + 1, i2).trim();
int ix = 0;
S... | 8 |
public static boolean isIntensityParam(String accession) {
return INTENSITY_SUBSAMPLE1.getAccession().equals(accession) ||
INTENSITY_SUBSAMPLE2.getAccession().equals(accession) ||
INTENSITY_SUBSAMPLE3.getAccession().equals(accession) ||
INTENSITY_SUBSAMPLE4.getAc... | 7 |
public static Packet readPacketFromFile(String filename, Node serverNode) throws IOException, NullPointerException {
if (filename == null || serverNode == null) {
throw new NullPointerException();
}
BufferedReader bfr = new BufferedReader(new FileReader(filename));
String li... | 5 |
public VariableStack mapStackToLocal(VariableStack stack) {
VariableStack newStack;
int params = cond.getFreeOperandCount();
if (params > 0) {
condStack = stack.peek(params);
newStack = stack.pop(params);
} else
newStack = stack;
VariableStack after = VariableStack.merge(thenBlock
.mapStackToLoc... | 3 |
public WorldImage makeImage( ) {
WorldImage world = new RectangleImage( new Posn( 500, 325 ), 1000, 650, new White( ) );
if( level == 0 ) {
world = new OverlayImages( world, new FromFileImage( new Posn( 500, 325 ), "images/titlescreen.png" ) );
}
else if( level == 1 ) {
world = new OverlayImages( world... | 6 |
@Override
public void execute(CommandSender s, String[] args){
if(!open){
Broadcast.vote("The vote is not currently open.", s);
return;
}
if(args.length == 1){
String name;
if(s instanceof Player) name = ((Player)s).getName();
else name = "CONSOLE";
String cast = args[0];
VoteCast vote = nul... | 7 |
public boolean isCreatable() {
return (!is_abstract && !is_attribute && !name.equals("Class") && !name.equals("Attribute")
&& !is_enum && !is_enum_value && !name.equals("EnumerationType")
&& !name.equals("EnumerationLiteral"));
} | 7 |
private void notifyBlockOfNeighborChange(int var1, int var2, int var3, int var4) {
if (!this.editingBlocks && !this.multiplayerWorld) {
Block var5 = Block.blocksList[this.getBlockId(var1, var2, var3)];
if (var5 != null) {
var5.onNeighborBlockChange(this, var1, var2, var3,... | 3 |
public void printEntrypoints(){
if (this.entrypoints == null)
System.out.println("Entry points not initialized");
else {
System.out.println("Classes containing entry points:");
for (String className : entrypoints)
System.out.println("\t" + className);
System.out.println("End of Entrypoints");
}
} | 2 |
public void setValueRangeAndState(ConfigurationIntegerValueRange[] regionAndState) {
if(regionAndState != null) {
_regionAndState = regionAndState;
// Bei den Zuständen darf jeder Wert und jeder Name nur einmal vorkommen.
final Set<String> stateNames = new HashSet<String>();
final Set<Long> stateValues ... | 8 |
public void setSelectedColor(Color newColor) {
if (null == newColor) {
setSelectedIndex(-1);
return;
}
for (int i = 0; i < getItemCount(); i++) {
ColorValue cv = (ColorValue) getItemAt(i);
if (newColor.equals(cv.color)) {
setSelecte... | 4 |
public static Esstyp vonName(String s) {
if (s.equals("VEGETARIER")) return VEGETARIER;
if (s.equals("VEGANER")) return VEGANER;
if (s.equals("FLEXITARIER")) return FLEXITARIER;
if (s.equals("FISCHFRESSER")) return FISCHFRESSER;
if (s.equals("FLEISCHFRESSER")) return FLEISCHFRESSER;
return VEGETARIER;
} | 5 |
protected boolean isStraight(final Deck deck) {
usesLow = false;
usesAllCards = false;
for (Rank rank : Rank.values()) {
high = rank;
low = rank;
kickers.clear();
boolean fail = false;
for... | 7 |
@Override
public void collides(Entity... en) {
if (cullable) {
return;
}
for (Entity e : en) {
if (e == null || e.getBounds() == null || e == this || e.cull())
continue;
Polygon p = e.getBounds();
if (shape.intersects(e.getBounds())
|| shape.contains(e.getBounds())) {
takeDamage(e.doDama... | 8 |
public AngleDR Ds2tp(AngleDR r, AngleDR rz) throws palError {
double sdecz, sdec, cdecz, cdec, radif, sradif, cradif, denom, xi, eta;
double ra = r.getAlpha(), dec = r.getDelta();
double raz = rz.getAlpha(), decz = rz.getDelta();
String Errmsg = null;
TRACE("Ds2tp");
/* ... | 3 |
public static byte[] getData() {
try {
ExtendedByteArrayOutputStream buffer = new ExtendedByteArrayOutputStream();
buffer.putShort(cache.size());
for (int index = 0; index < cache.size(); index++) {
RSInterface rsi = cache.get(index);
if (rsi == null) {
continue;
}
buffer.write(Utilities... | 3 |
public static void play() {
try {
if(currentPlayback != null) {
currentPlayback.play();
System.out.println("Now playing: " + currentTrack);
}
} catch (MediaException e) {
System.out.println("Invalid media type.");
}
} | 2 |
private void updateCurrentLogFile()
{
// get the log file name from the file system
File logFolder = new File(slateComponent.getLogDirectoryName());
File[] listOfLogFiles = logFolder.listFiles();
numLogFiles = listOfLogFiles.length;
if (numLogFiles == 0)
{
return;
}
if ((RotationParadigm.Boun... | 9 |
private Xpp3Dom getCurrentTestCase() {
return currentTestCase.get();
} | 0 |
public void setPath(String path) {
this.path = path;
if (this.path != null) {
this.path_list = new ArrayList();
parsePath(this.path_list, this.path);
}
} | 1 |
public void onTimeChanged(int time)
{
timeButton.setText(TimeManager.getTimeString(time));
} | 0 |
public Cmd()
{
int nivelDeDificuldade = teclado.nextInt("Nivel de dificuldade [0 ou 1] >");
e = new Engine( nivelDeDificuldade );
e.init();
Util.println("Cima: "+KEY_UP+" | Baixo: "+KEY_DOWN+" | Esquerda: "+KEY_LEFT+" | Direita: "+KEY_RIGHT);
while( !e.isGameOver() )
{
drawArena();
switch( teclado.... | 5 |
protected synchronized void doStop()
throws InterruptedException
{
for (int l=0;l<_listeners.size();l++)
{
HttpListener listener =(HttpListener)_listeners.get(l);
if (listener.isStarted())
{
try{listener.stop();}
catch(Exce... | 8 |
public static void main(String[] args) {
MainWindow mainWindow = new MainWindow();
mainWindow.setVisible(true);
} | 0 |
@Override
public synchronized String[] readDirectoryEntries(SyndicateFSPath path) throws FileNotFoundException, IOException {
if(path == null) {
LOG.error("path is null");
throw new IllegalArgumentException("path is null");
}
SyndicateFSPath absPath = getAbso... | 9 |
public static void main(String[] args) {
StackArray[] stacks = {new StackArray(), new StackFIFO(), new StackHanoi()};
StackList stack2 = new StackList();
for (int i = 1; i < 15; ++i) {
stacks[0].push(i);
stack2.push(i);
stacks[1].push(i);
}
Ran... | 6 |
private void loadJniResources() {
boolean wasLoadSuccessful = loadX64ResourcesFromSysPath();
if (!wasLoadSuccessful) {
wasLoadSuccessful = loadWin32ResourcesFromSysPath();
if (!wasLoadSuccessful) {
setLibDirectory();
wasLoadSuccessful = copyAndLoadX64FromTemp();
if (!wasLoadSuccessful) {
wasLoa... | 4 |
@Override
public void undo() {
if (oldKey == null) {
if (newKey == null) {
// Do Nothing, since this should never happen.
} else {
node.removeAttribute(newKey);
}
} else {
if (newKey == null) {
node.setAttribute(oldKey, oldValue, oldReadOnly);
} else {
if (!oldKey.equals(newKey)) {
... | 4 |
@SuppressWarnings("CallToThreadDumpStack")
public static void main(String[] args) throws Exception {
System.out.println("model used: " + model);
DB db = new DB();
String sql_op;
try {
Tickets tickets = new Tickets();
Technicians technicians = new Technicians... | 7 |
public double getSimilarityScore(FeatureVector t1, FeatureVector t2) {
ArrayList<Feature> featureList1 = null;
ArrayList<Feature> featureList2 = null;
try {
//System.out.println("fv1:"+t1.getFeatureList().get(0).getId());
//System.out.println("fv2:"+t2.getFeatureList().get(0).getId()+" "+t2.getFeatureList()... | 7 |
private void removeComposedBlocks() {
List<GenericTreeNode<LayoutParserTreeElement>> list = this.layoutParser.XMLTree
.build(GenericTreeTraversalOrderEnum.PRE_ORDER);
for (GenericTreeNode<LayoutParserTreeElement> element : list) {
if (element.getData().elementType == LayoutParserTreeElement.ElementType.COM... | 5 |
@Override
public boolean equals(Object obj) {
if ((obj == null) || (!(obj instanceof HardwareAddress))) {
return false;
}
HardwareAddress hwAddr = (HardwareAddress) obj;
return ((this.hardwareType == hwAddr.hardwareType) &&
(Arrays.equals(this.hardwareAd... | 3 |
public String ValidarCampo(Prospecto BEEntidades){
// Nombre, ApellidosPaterno, ApellidoMaterno, Email, NroDocumento, Telefono
sb.append(Common.IsNullOrEmpty(BEEntidades.getNombre())? "nombre inválido,": "");
sb.append(Common.IsNullOrEmpty(BEEntidades.getApellidoPaterno())? "nombre inválido,... | 6 |
public void visitAttribute(final Attribute attr) {
checkState();
if (attr == null) {
throw new IllegalArgumentException(
"Invalid attribute (must not be null)");
}
cv.visitAttribute(attr);
} | 1 |
@SuppressWarnings("deprecation")
@EventHandler
public void onPlayerInteractBlock(PlayerInteractEvent event)
{
final Player player = event.getPlayer();
if(player.hasPermission("skeptermod.useitem.hellsword") || (event.getPlayer().isOp()))
{
if(player.getItemInHand().getTypeId() == Material.STONE_SWORD.getId(... | 8 |
public void applyModifiers(PlayerAttributes attr) {
for(int i = 0; i < 3; i++) {
if(equipped[i] != null && equipped[i] instanceof AttributeItem) {
attr.applyRaw(((AttributeItem) equipped[i]).getRawModifiers());
attr.applyRelative(((AttributeItem) equipped[i]).getRelativeModifiers());
}
}
for(ArmorIt... | 5 |
protected double calculatePressure(){
//The pressure of the condenser is the current pressure + input flow of steam - output flow of water.
ArrayList<Component> inputs = super.getRecievesInputFrom();
Iterator<Component> it = inputs.iterator();
Component c = null;
double totalInputFlowRate = 0;
while(it.hasN... | 3 |
private static void test_xor(TestCase t) {
// Print the name of the function to the log
pw.printf("\nTesting %s:\n", t.name);
// Run each test for this test case
int score = 0;
for (int i = 0; i < t.tests.length; i += 3) {
int exp = (Integer) t.tests[i];
int arg1 = (Integer) t.tests[i + 1];
int arg... | 2 |
private boolean handleMousePressed(MouseEvent e, int x, int y) {
Point ptBCP = new Point(0, 0); // Block center point
Cube3D iClosestBlock = world.get(0);
float sfDSquared = 0;
float sfAdjust = 0;
float sfMin = 100000000; // 2d distance to block closest to click.
// Find the closest block (a very simple so... | 8 |
public static void main(String[] args) throws IOException {
try {
host = InetAddress.getLocalHost();
} catch (UnknownHostException e) {
System.out.println("Host ID not found!");
System.exit(1);
}
userEntry = new Scanner(System.in);
do {
System.out.print("\nEnter name ('Dave' or 'Karen'): ");
... | 3 |
@Override
public void exec(CommandSender sender, String label, String[] args, Player player, boolean isPlayer) {
if (isPlayer) {
String p = player.getName();
String user = p.toLowerCase();
if (!player.hasPermission("stickii.use")) {
player.sendMessage(Cha... | 7 |
@SuppressWarnings("rawtypes")
public static final Class[] toClasses(Object[] args)
{
if(args.length <= 0)
return new Class[0];
Class[] value = new Class[args.length];
int iter = 0;
for(Object A : args)
{
value[iter] = A.getClass();
iter++;
}
return value;
} | 2 |
public static boolean wasActionOffensive(JSONObject action){
if(action == null) return false;
try {
String actiontype = action.getString("type");
switch (actiontype){
case "laser":
return true;
case "droid":
return true;
case "mortar":
return true;
default:
return false;
}
... | 5 |
public boolean next(Buffer _buf) throws Exception{
int i,j;
switch(state){
case SSH_MSG_KEXDH_REPLY:
// The server responds with:
// byte SSH_MSG_KEXDH_REPLY(31)
// string server public host key and certificates (K_S)
// mpint f
// string signature of H
j=... | 8 |
public boolean hasPermissions( CommunityAccount who, PublishedSwarm swarm ) {
if( swarm == null ) {
return false;
}
boolean canModerate = false;
if( who != null ) {
canModerate = who.canModerate();
}
if( canModerate ) {
return true;
}
if( swarm.isNeeds_moderated() && System.getPr... | 6 |
public void recharge(final MapleClient c, final byte slot) {
final IItem item = c.getPlayer().getInventory(MapleInventoryType.USE).getItem(slot);
if (item == null || (!InventoryConstants.isThrowingStar(item.getItemId()) && !InventoryConstants.isBullet(item.getItemId()))) {
return;
}
final MapleItemInformation... | 5 |
private Configuration(Tetromino tName, int tRotations, Point[] tCoords) {
name = tName;
coords = tCoords;
states = new Rotation[tRotations];
for (int i = 0; i < tRotations; ++i) {
states[i] = new Rotation(coords, i);
}
} | 1 |
private void comboCidadeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_comboCidadeActionPerformed
String item = String.valueOf(comboModelCidade.getSelectedItem());
if(item.equals("Selecionar ...") || item == "null"){
System.out.println("Olá");
if(listaChei... | 3 |
protected void changeOffsetDisplay()
{
if (ABS_HEX_MODE == offsetDisplayMode)
offsetDisplayMode = ABS_DECIMAL_MODE;
else if (ABS_DECIMAL_MODE == offsetDisplayMode)
offsetDisplayMode = REL_BASE_HEX_MODE;
else if (REL_BASE_HEX_MODE == offsetDispl... | 6 |
@Override
public boolean capturar(Posicao posicaoFinal) {
/* peao preto */
if (this.getCor().equals(Cores.preto)) {
if ((posicaoFinal.getLinha() == getPosicao().getLinha() - 1)
&& ((posicaoFinal.getColuna() == getPosicao().getColuna() + 1) || (posicaoFinal
... | 7 |
public static List<String> extractLinks(String url, LinkFilter filter) {
List<String> links = new ArrayList<String>();
try {
Parser parser = new Parser(url);
parser.setEncoding("gb2312");
NodeFilter frameNodeFilter = new NodeFilter(){
publi... | 6 |
@Test(groups = { "tck" })
public void test_factory_string_hours_minutes_colon() {
for (int i = -17; i <= 17; i++) {
for (int j = -59; j <= 59; j++) {
if ((i < 0 && j <= 0) || (i > 0 && j >= 0) || i == 0) {
String str = (i < 0 || j < 0 ? "-" : "+") + Integer.toString(Math.abs(i) + 100).sub... | 9 |
@Override
public void actionPerformed(ActionEvent e) {
if (e.getActionCommand() == Actions.SERVER.name()) {
server = new Server(PROTOCAL.NOPROTOCAL);
System.out.println("Server");
} else if (e.getActionCommand() == Actions.T2.name()) {
server = new Server(PROTOCAL.T2);
System.out.println("T2");
} els... | 6 |
public static boolean isConnectionFromBottom(Position posa, Position posb) {
return posa.getX() > posb.getX() && posa.getY() < posb.getY()
|| posa.getX() < posb.getX() && posa.getY() > posb.getY();
} | 3 |
@EventHandler
public void onPlayerQuit(PlayerQuitEvent event) {
Player player = event.getPlayer();
parentarena.playerLeave(player, "Ϸر,");
} | 0 |
@Override
public String saveAnswer(Question question) {
if (question == null) {
return "Не передан объект вопроса";
}
if (question.getIdTest() == null) {
return "В переданом объекте отсутствует ссылка на тест";
}
if (question.getIdQuestion() == null) {... | 6 |
public void testCollisionWhithBomb(){
for (int iw = 0; iw < weapon.size(); iw++) {
Weapon w = weapon.get(iw);
if(boss.getRect().intersects(w.getRect())){
weapon.remove(iw);
boss.hp--;
if(boss.hp == 0){
JOptionPane.showM... | 6 |
public Pong(GameStateManager gsm) {
super(gsm);
panel = new JPanel();
this.gsm = gsm;
timer = new Timer(10,this);
cd = new Timer(30, t1);
addKeyListener(new KeyAdapter() {
@Override
public void keyPressed(KeyEvent e) {
i... | 5 |
boolean whitelisted(String page, String user, String summary, String project) {
if (config.whitelistModel.contains(user + "#" + project)
|| config.tempwhitelistModel.contains(user + "#" + project))
return (true);
else {
int size = config.regexpwhiteModel.getSize(), i;
for (i = 0; i < ... | 9 |
@Override
public int loop() {
//6 hour paint thing (wann keep dem paints up)
//or whatever it is :/
if (Game.getClientState() != Game.INDEX_MAP_LOADED) {
return 1000;
}
if (client != Bot.client()) {
WidgetCache.purge();
Bot.context().getEventManager().addListener(this);
client = Bot.client();
}... | 5 |
public void beforeDie(List<CardFighter> battleField) {
// PROTECT_INFANTRY
if (this.getCard().getProtectInfantry() > 0) {
for (CardFighter cardFighter : battleField) {
if (!cardFighter.equals(this) && cardFighter.getCard().getType() == Card.TYPE_INFANTRY) {
cardFighter.defense ... | 8 |
@Override
protected void onBinaryMessage(ByteBuffer arg0) throws IOException {
// not implemented
} | 0 |
public IdleAction(Being b) {
being = b;
} | 0 |
public void runScript(InputStream stream) throws JStrykerException, IllegalArgumentException {
if (stream == null) {
throw new IllegalArgumentException("Stream cannot be null.");
}
try {
List<String> commands = parse(stream);
for (String command : commands) {
Statement statement = null;
try {
... | 5 |
public final int checkForNewline(byte[] data, int pos) {
// Note that pos pointing just past end of data is permitted.
assert pos >= 0 && pos <= data.length;
switch (this) {
case LF:
return pos < data.length && data[pos] == 10 ? 1 : 0;
case CR:
... | 7 |
public static String join(Object[] items, String delim) {
// Return an empty string for an empty list
if (items.length == 0)
return "";
// Otherwise build up the joined string
StringBuilder out = new StringBuilder();
// Put the delimiter after all but the last item
for (int i = 0; i < items.length - 1; ... | 2 |
public void priceUpdate(){
double bidMedian = bids.getMedian();
double askMedian = asks.getMedian();
price = (bidMedian + askMedian) / 2; // new price is average of their medians
price = (double)(Math.round(price * 100)) / 100; // rounds to 10th
double newBid = newPurchase(); // calls helper method to create new p... | 2 |
public LaucherModule(){
setAuthor("Sinrel Group");
setName("minecraft game laucnher");
setVersion("1.0.0");
} | 0 |
public AnnotationVisitor visitAnnotation(
final String desc,
final boolean visible)
{
return new SAXAnnotationAdapter(getContentHandler(),
"annotation",
visible ? 1 : -1,
null,
desc);
} | 1 |
protected void ensureSimpleValues(Map.Entry<String,Set<RDFNode>> prop, Class<?> expectedClass, Path path) {
for( RDFNode n : prop.getValue() ) {
if( !n.hasOnlySimpleValue() ) {
logPathError("Expected a simple value for "+prop.getKey(), path);
anyErrors = true;
}
if( n.simpleValue != null && !expected... | 5 |
public void removeTreeSelectionListener(TreeSelectionListener l) {
treeSelectionListeners.remove(l);
} | 0 |
public BorderDetectorDialog(final Panel panel, final String title) {
setTitle(title);
this.panel = panel;
setBounds(1, 1, 450, 150);
Dimension size = getToolkit().getScreenSize();
setLocation(size.width/3 - getWidth()/3, size.height/3 - getHeight()/3);
this.setResizable(false);
setLayout(null);
JPanel ... | 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 BasicStringType( String str ) {
super( BasicType.TYPE_STRING );
this.string = str;
if( str == null )
return;
// Try to parse number values
if( !parseIntegerType(str) && !parseDoubleType(str) )
;
if( !parseBooleanType(str) )
;
if( !parseUUIDType(str) )
;
} | 5 |
public final void setFName(String fname) {
if(fname == null || fname.isEmpty()){
throw new IllegalArgumentException();
}
this.fName = fname;
} | 2 |
private void dealCards(RuleChecker rc) throws IllegalMoveException{
ArrayList<Card> deck = Card.makeDeck();
for (int i = 0; i < 8 * 4; i++) {
players.get(i % 4).giveCard(deck.get(i));
}
for (Player p : players) {
boolean greatTaipan = p.informFirstDeal();
if (greatTaipan) {
rc.greatTaipan(p.getID()... | 8 |
private void displayRavagePatternAnalysis(){
set_tolerance(64);
System.out.printf("");
System.out.println();
System.out.println("SPACESHIP PATTERN MATCHING ANALYSIS WITH TOLERANCE LEVEL OF "+get_tolerance());
RavagePatternDetector ravagePattern;
List<RavagePatternDetector... | 3 |
public boolean isProperty() {return prop;} | 0 |
public void updateResolutionsByColumnByMergeIdUsingResolutionsByColumnAsJSONObject(
Integer mergeId, JSONObject resolutionsByColumnAsJsonObject) {
//Note: This also updates the merge's total conflict count.
//for each index in column_number, update the fields present (except for keys)
MergeModel merge... | 9 |
Subsets and Splits
SQL Console for giganticode/java-cmpx-v1
The query retrieves a limited number of text entries within a specific length range, providing basic filtering but minimal analytical insight.