method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
1a0a699f-8758-4b3a-a140-61d8e7b99bd7 | 4 | 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... |
7b360f27-0b2a-47d9-b2f1-5910f996d119 | 2 | 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... |
c5d65db5-6b6b-4a34-b988-2cf422d09bbf | 4 | 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... |
f8771393-3eb8-4118-81e8-8ea07dfec0cc | 7 | @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... |
d389a398-5173-49a6-8f0c-d8253dc66173 | 3 | 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... |
637ebb13-d1a5-4539-9c33-b16ce9d9697b | 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... |
e85d9fa0-272a-49ec-88ba-fc8aabb2ce99 | 8 | 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... |
322eee77-159a-417a-ba7b-cf327ed2e84e | 2 | public void actionPerformed(ActionEvent e) {
if (e.getSource() == converter) {
berekenMensualiteit();
} else if (e.getSource() == create) {
createTable();
}
activateButtons();
} |
3c71525d-e78c-4e97-9a4f-18725ed5a6c9 | 6 | @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 ... |
952d496e-db11-4223-a4db-329f059f5235 | 5 | @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);
... |
fcdf477f-e08f-4e59-a162-8ccd43291f74 | 7 | 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.... |
4e70a49d-8383-4c0f-9454-0c42d75f89ed | 0 | @Override
public void windowClosing(WindowEvent e)
{
// System.exit(0);
super.windowClosing(e);
System.exit(0);
} |
ebddb60f-2a0b-4708-a906-23232cfc17e4 | 0 | public void setPlainValue(byte[] value) {
this.plainValue = value;
} |
b53c465c-a496-4f1f-854a-f361b4e80e59 | 9 | 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") || ... |
a135d748-0b07-438f-bfde-5d851fb5bae9 | 6 | 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... |
ddca1f76-3b51-4f49-8ceb-eb2646c2844e | 9 | 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 (... |
b7f4a940-25bc-4255-979f-ed050a6b809d | 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:
... |
8555eadb-eb7d-4c70-8953-eb987ab21652 | 8 | 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... |
a57ffd0e-1abb-4b03-90a2-0efd036ba2bb | 7 | 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)) {
{ ... |
1ade01b8-658d-4ced-83ee-ea270001a569 | 7 | public void computeColorManagers() {
double maximumValue = 0;
double minimumValue = 0;
for (List<PointWithHamma> pointWithHammaList : solver.getFlyingPointsWithHama().values()) {
for (PointWithHamma pointWithHamma : pointWithHammaList) {
if (pointWithHamma.getHamma()... |
5575dc3f-f508-4b1d-ac7e-cd5eb1553b63 | 7 | private void resizeScreenIfNeeded() {
TerminalSize newSize;
synchronized(resizeQueue) {
if(resizeQueue.isEmpty())
return;
newSize = resizeQueue.getLast();
resizeQueue.clear();
}
int height = newSize.getRows();
int width = newS... |
d3b150ac-d365-4e7d-bb31-ddbc7dd78717 | 8 | 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... |
902338ae-4bba-471b-88a9-8a45b3d1cbab | 7 | 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... |
3f967e5f-1fe0-44ac-81ef-21a0411e04fb | 5 | 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... |
a5730ade-066d-4ae2-bdc2-6aeb7c6b4600 | 3 | 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... |
bc65f138-6cfa-4d4c-9f76-0a8f6b192577 | 6 | 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... |
5c6bcef7-53d2-4805-9a46-341dfe0a0a39 | 7 | @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... |
cc0c88ec-9cf0-40d6-bd63-69e152f1af48 | 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"));
} |
9ba43bbf-590f-4ada-8c53-664fc821603e | 3 | 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,... |
ff0ed208-bce9-4172-b711-cc020a9a938f | 2 | 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");
}
} |
3b0cf0f5-570e-4e64-a563-6fc8081646c7 | 8 | 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 ... |
5fd03f5c-a6e6-4449-aa02-72989fcf3629 | 4 | 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... |
e61226a3-6dfc-4233-bd6f-2c904263e10c | 5 | 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;
} |
3b26be2b-4a39-4184-803b-eafbeb263263 | 7 | 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... |
d449cbd0-568e-43ca-9de8-8da68878ca87 | 8 | @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... |
b0ee092b-11ad-4388-addf-37e4f01c2bd2 | 3 | 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");
/* ... |
80e46425-1c33-4f1d-ab3e-389734d7a7cf | 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... |
b5e5e290-c776-4fb3-8525-40c8da0df1a4 | 2 | 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.");
}
} |
43fda009-2f7d-472b-bb2e-b07994d28374 | 9 | 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... |
b3e68020-9632-4a5e-b6f0-b04c3f53c0eb | 0 | private Xpp3Dom getCurrentTestCase() {
return currentTestCase.get();
} |
0efa1dbf-8ca2-4df9-8942-24da77d405eb | 1 | public void setPath(String path) {
this.path = path;
if (this.path != null) {
this.path_list = new ArrayList();
parsePath(this.path_list, this.path);
}
} |
76bc24b2-add0-4859-bdff-5410afeeb96a | 0 | public void onTimeChanged(int time)
{
timeButton.setText(TimeManager.getTimeString(time));
} |
88fb0e20-acd6-4f79-951d-c9c143cf7805 | 5 | 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.... |
b40b7a6b-9117-4cd0-a2ec-ed3f6acb6f67 | 8 | 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... |
a150758d-10c9-4da5-aa06-7b971820ef82 | 0 | public static void main(String[] args) {
MainWindow mainWindow = new MainWindow();
mainWindow.setVisible(true);
} |
4d6515d0-ef40-47d5-b3a4-ff6fb67ce05b | 9 | @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... |
318101a2-296a-4ea9-b97f-f1b7f1f20f67 | 6 | 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... |
e0109b1c-c714-4c61-8925-dee24523074d | 4 | private void loadJniResources() {
boolean wasLoadSuccessful = loadX64ResourcesFromSysPath();
if (!wasLoadSuccessful) {
wasLoadSuccessful = loadWin32ResourcesFromSysPath();
if (!wasLoadSuccessful) {
setLibDirectory();
wasLoadSuccessful = copyAndLoadX64FromTemp();
if (!wasLoadSuccessful) {
wasLoa... |
d42a67d6-c2cf-4d67-a03c-ad224c9bee6a | 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)) {
... |
b34bbd9d-af31-49fd-9d04-1dc3eda8c472 | 7 | @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... |
05a95139-02a1-4290-b603-06796268a44d | 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()... |
be2d8d1a-137d-4941-85dd-78ae2d541746 | 5 | 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... |
9a6fb9ab-bf38-4ac9-817d-ce0a6c0a14d4 | 3 | @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... |
789b51f7-35d9-48fe-a069-2e245b63c8ea | 6 | 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,... |
31e880fc-2c7d-411d-840c-5c984513bfd4 | 1 | public void visitAttribute(final Attribute attr) {
checkState();
if (attr == null) {
throw new IllegalArgumentException(
"Invalid attribute (must not be null)");
}
cv.visitAttribute(attr);
} |
fc5350da-bea3-4e09-a929-8269f5947a52 | 8 | @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(... |
952d6d81-2e96-4ed2-bffd-d655721c004e | 5 | 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... |
05c983f8-a80d-447d-b7b2-f5a2b637b998 | 3 | 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... |
31dd2c76-be68-43df-bfe0-d8d3496b8c3d | 2 | 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... |
7c2d6997-dd32-4410-b1be-e8db2dbe0f71 | 8 | 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... |
e6bef7fd-fe7d-4100-a780-de6d54754d0e | 3 | 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'): ");
... |
faef66d0-ee67-4d75-a56b-d7567a3ebd2c | 7 | @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... |
c2a1441b-abd9-4f50-b81e-3fb681d0355b | 2 | @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;
} |
089e7e80-d2f1-4351-8cf2-0602e7696420 | 5 | 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;
}
... |
9f3abf42-4268-4940-9059-0805aeeda6a0 | 8 | 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=... |
6a380e70-7544-468a-9cbe-8c8a55c64acd | 6 | 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... |
483399b1-2e45-44bf-8210-eeb140481f72 | 5 | 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... |
eeff8a3a-38e4-4085-97c7-29fe3759067d | 1 | 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);
}
} |
e5378477-bd8f-498d-827b-afcda884b76e | 3 | 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... |
51261881-43c5-45ad-b683-ca8a3802a47b | 6 | 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... |
dddd46c2-ced1-41c5-b755-88a8e07557bc | 7 | @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
... |
2b1abbe4-0313-4a62-a376-3243713d472e | 6 | 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... |
2bd40902-6698-411a-9e71-fe6b36ceffb1 | 9 | @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... |
42ce9ddc-73e9-4742-afc0-9e32cef05005 | 6 | @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... |
39b6a9d5-3e07-444d-a1e7-006c1407a52d | 3 | 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();
} |
273bb986-0234-4ac8-a1d1-535458dff88c | 0 | @EventHandler
public void onPlayerQuit(PlayerQuitEvent event) {
Player player = event.getPlayer();
parentarena.playerLeave(player, "Ϸر,");
} |
6e48b94f-54ce-493a-bb09-c0507464ff92 | 6 | @Override
public String saveAnswer(Question question) {
if (question == null) {
return "Не передан объект вопроса";
}
if (question.getIdTest() == null) {
return "В переданом объекте отсутствует ссылка на тест";
}
if (question.getIdQuestion() == null) {... |
74203bfb-7ae2-4162-bd45-213c01ddb981 | 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... |
42647322-737f-42cc-a309-b95ee82c09c1 | 5 | 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... |
327b44dd-3f23-4bb3-8263-c707400b258e | 9 | 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 < ... |
405116da-59ba-4045-b381-0be01791c1a2 | 5 | @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();
}... |
6f4a6f9b-5232-4d69-9766-75c75973cbee | 8 | 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 ... |
9acb8c1f-4e4b-4f35-8904-54070b494c23 | 0 | @Override
protected void onBinaryMessage(ByteBuffer arg0) throws IOException {
// not implemented
} |
f759e55d-1184-4190-a812-db2a8e3c25ac | 0 | public IdleAction(Being b) {
being = b;
} |
5858f4b7-19c0-44c9-aca8-1e1b2044fe43 | 5 | 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 {
... |
e408c89f-a8d2-43d2-825d-e44fc4dc220c | 7 | 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:
... |
10534834-2c7f-453a-a41f-07f8d69a97eb | 2 | 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; ... |
97e72438-d2bb-4ecb-a6b8-b7e739a91e4c | 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... |
f1e5eab0-eb55-4eef-9df3-b668406536db | 0 | public LaucherModule(){
setAuthor("Sinrel Group");
setName("minecraft game laucnher");
setVersion("1.0.0");
} |
b35b574c-285c-4385-8b46-022fb9490f4d | 1 | public AnnotationVisitor visitAnnotation(
final String desc,
final boolean visible)
{
return new SAXAnnotationAdapter(getContentHandler(),
"annotation",
visible ? 1 : -1,
null,
desc);
} |
d6d0077d-5d49-45dc-afd1-68bd8a60a14b | 5 | 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... |
40325e82-587a-4543-96d7-da688777cea0 | 0 | public void removeTreeSelectionListener(TreeSelectionListener l) {
treeSelectionListeners.remove(l);
} |
deca700a-5615-4ac6-b80b-68d59f971163 | 4 | 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 ... |
518127b8-4e91-442c-9cf8-b1d21e6493e4 | 6 | 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... |
b6f25d30-4749-4054-9665-cad883332934 | 5 | 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) )
;
} |
2bc4c834-e9b1-484b-a5bf-84aede0663b3 | 2 | public final void setFName(String fname) {
if(fname == null || fname.isEmpty()){
throw new IllegalArgumentException();
}
this.fName = fname;
} |
e0450eea-a9d0-4caa-a289-34402658f076 | 8 | 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()... |
de0e7208-545a-4cf6-b444-9ad51ae62c60 | 3 | 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... |
9590ef1d-fb22-409f-baf0-6ae2dc5edee5 | 0 | public boolean isProperty() {return prop;} |
3571b556-5ddc-4ab9-8ce9-bd4f8cc271e8 | 9 | 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.