method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
95f63cd4-fd2b-4fd2-80a9-3d78650972a0 | 1 | private void selectionDidChange() {
if (mOwner != null) {
mOwner.selectionDidChange();
}
} |
fc9d7c0e-4cbc-4d40-905c-d5d15c51c2d8 | 2 | public boolean getKilpi(Pelihahmo h){
if (h == h1){
return getNappaimenTila(KILPI1);
} else if (h == h2){
return getNappaimenTila(KILPI2);
} else {
return false;
}
} |
f9eee122-6961-4d56-98ae-f954580298b4 | 7 | public static void cast() {
if (!Bank.isOpen()) {
if (Widgets.get(1370, 0).validate()) {
Widgets.get(1370, 20).click(true);
Task.sleep(700, 800);
Timer failSafe = new Timer(25000);
while ((Inventory.getCount(Variables.leatherUsing) > 1 ... |
c15a76e3-399b-4741-82d2-80e2dc126053 | 9 | @Override
protected List< ? extends Component> createBrickComponents() {
ArrayList<Component> components = new ArrayList<Component>();
String tooltip = getTooltip();
// label
if ( control.getLabel() != null ) {
label = new JLabel();
label.setName(getName()+"/label");
... |
0942110d-7e3b-4caa-8187-4d2522592f9c | 6 | public static String escapeJavaScriptString(String input) {
StringBuilder retVal = new StringBuilder(input.length() + 10);
for (int i = 0; i < input.length(); i++) {
char c = input.charAt(i);
switch (c) {
case '"':case '\\':
retVal.append('\\')... |
d017e533-b6fe-40a4-af87-17f6e7f5df21 | 8 | private void changePosition() {
float vSqrt = (float) (v * Math.sqrt(2));
if (BlinkTheGame.left) {
if (BlinkTheGame.up) {
setXY(x - v, y - v);
} else if (BlinkTheGame.down) {
setXY(x - v, y + v);
} else {
setXY(x - vSqrt, y);
}
} else if (BlinkTheGame.right) {
if (BlinkTheGame.up) {
... |
886f49e5-951d-4e50-8dc7-6788e246008d | 3 | public void flipV() {
for (Connector c : connectors) {
if (c.getPosition() == Position.top)
c.setPosition(Component.Position.bottom);
else if (c.getPosition() == Position.bottom)
c.setPosition(Position.top);
}
} |
de5c2baf-631e-4d46-83a3-dbfb1d7a877c | 0 | @Remove
public void remove() {
System.out.println("PersonAddressManagerBean:remove()");
} |
57dd832b-0119-4b70-bfea-17765992ae28 | 0 | public void setUserAgent(String userAgent) {
this.userAgent = userAgent;
} |
8ebdd16f-9153-46fc-a2b8-62af3cab5a29 | 1 | synchronized void shutdown() {
try {
mServerSocket.close();
} catch (Exception exception) {
Log.error(exception);
}
} |
48595250-5cf7-461d-bbee-dd88b17603e0 | 4 | public ConvertiblePair(Class<?> sourceType, Class<?> targetType) {
if (sourceType == null) {
throw new IllegalArgumentException("Source type must not be null");
} else if (targetType == null) {
throw new IllegalArgumentException("Target type must not be null");
}
this.sourceType = sourceType;
this.targe... |
4bea320d-91fd-4cdc-81b1-f022efd0e994 | 9 | @Test
public void test() {
// Test insertion order
LRUCache<Integer, String> cache = new LRUCache<Integer, String>(10);
int i;
for (i = 0; i < keys.length; ++i) {
cache.put(keys[i], values[i]);
}
i = 0;
for (Iterator<Integer> iter = cache.keySet().iterator(); iter.hasNext();) {
... |
02125f63-d438-434a-b8f8-8bf04ca8b875 | 0 | private void reduction(){
int gcd = getGCD(numerator, denominator);
numerator = numerator / gcd;
denominator = denominator / gcd;
} |
5ca5e716-8b4b-4d01-8f80-14dc08230889 | 4 | private static void creerTblRegion() {
if (!m_regInit) {
try (BufferedReader br = new BufferedReader(new FileReader(Constant.m_regionList))) {
String sCurrentLine;
m_lstRegNom.clear();
m_tblRegions.clear();
while ((sCurrentLine = br.rea... |
7c4308a4-15f6-4cc6-b6ac-3dc9d31099ce | 3 | @Override
public HandshakeState acceptHandshakeAsServer( ClientHandshake handshakedata ) throws InvalidHandshakeException {
// Sec-WebSocket-Origin is only required for browser clients
int v = readVersion( handshakedata );
if( v == 7 || v == 8 )// g
return basicAccept( handshakedata ) ? HandshakeState.MATCHED... |
8d8621c3-bf39-4396-a55f-0699f79a32be | 6 | public ArrayList<ArrayList> allMoves() {
ArrayList<ArrayList> a = new ArrayList<ArrayList>();
for (int i = 0; i < pMoves().size(); i++) {
a.add(pMoves().get(i));
}
for (int i = 0; i < nMoves().size(); i++) {
a.add(nMoves().get(i));
}
for (int i = 0; i < bMoves().size(); i++) {
a.add(bMoves().get(i)... |
8247e8c0-1fd1-4b12-ac01-cbeba1c6cff9 | 2 | public void render()
{
Graphics g = screen.getGraphics();
g.setColor(Color.black);
g.fillRect(0, 0, pixel.width, pixel.height);
//show the black screen with countdown
if(swappingNow)
{
int secondsLeft = (int) ((timerPos / (1000/(tickTime*computerSpeed)) + 1));
String secString = " seconds";
if... |
5daf2b2e-3fdf-4563-8dd0-e492979a0df4 | 7 | public void validate(FacesContext context, UIComponent component,
Object toValidate) {
boolean isValid = true;
String value = null;
if ((context == null) || (component == null)) {
throw new NullPointerException();
}
if (!(component instanceof UIInput)) {
return;
}
if (null == toValidate) {
re... |
a69725e9-06f9-4c63-bd3a-7613f3aceb87 | 9 | public boolean hasNext() {
// simple: check the current list for a successor
if (listHasNext()) {
return true;
}
// already reached the tree map iterator ?
if (_mapIterator != null) {
while (_mapIterator.hasNext()) {
_currentList = (PropertyList)_mapIterator.next... |
db9a3515-0cb2-4c9e-bb7e-04b7367ac9c4 | 4 | public void drawGameOption(Graphics g){
g.setFont(defaultFontSmall);//设置字体
for(int i = 0; i<gameOption.length; i++){
g.setColor(Colors.colorList[i]);
g.fillRect(820 , 100 + i * 80, 75, 30);
g.setColor(Color.white);
g.drawString(gameOption[i], 825 , 120 + i * 80);
if( i == this.gameOptionCursor){
... |
992487ef-b520-4831-8353-771c56f8dcc4 | 5 | private Image createNoiseImage(final double WIDTH, final double HEIGHT, final Color DARK_COLOR, final Color BRIGHT_COLOR, final double ALPHA_VARIATION_IN_PERCENT) {
int width = WIDTH <= 0 ? (int) PREFERRED_WIDTH : (int) WIDTH;
int height = HEIGHT <= 0 ? (int) PREFERRED_HEIGHT : (int) HEIGHT;
do... |
608f936d-c422-47c8-92d0-d4484448217d | 2 | public void Compile()
{
glLinkProgram(program);
if (glGetProgrami(program, GL_LINK_STATUS) == 0)
{
System.err.println(glGetProgramInfoLog(program, 1024));
System.exit(-1);
}
glValidateProgram(program);
if (glGetProgrami(program, GL_VALIDATE_STATUS) == 0)
{
System.err.println(glGetProgra... |
2a64f9f9-2ceb-47c2-b356-ce0adfd4ad21 | 7 | protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String quizName = request.getParameter("Field1");
String quizCategory = request.getParameter("Field2");
String quizAuto = request.getParameter("Field3");
String quizOrder = request.getParameter... |
a6a0f18a-6e7b-42ea-9da3-f5b9ae026862 | 5 | public static ArrayList<String> createListBody(String sender, String user_name, ResourceBundle domBundle) {
ArrayList<String> body = new ArrayList<String>();
String select_query = createSelectQuery(sender, user_name);
DatabaseDao dbdao = new DatabaseDaoImpl(domBundle);
ResultSet rs;
ArrayList<HashMap<String, ... |
654b1e7f-8cea-47e7-a216-6aa165b32898 | 8 | static void P() {
int S1 = 0;
int S2 = 0;
int S3 = 0;
int SMax = 9;
int OMax = 0;
int OTemp = 0;
int OCounter = 0;
// code start
OTemp = S1+S2+S3;
// code end
OMax = OTemp;
OCounter = 1;
S3 = S3 + 1;
while (S1 <= SMax) {
S2=0;
while (S2 <= SMax) {
S3=0;
while (S3 <= SMa... |
75b18b5d-84a4-48df-8812-8edb9d47d159 | 2 | private void nameChanged() {
joinButton.setEnabled(false);
joinChatPressed = false;
String text = nameField.getText().trim();
name = text;
if (text.compareTo("") == 0) {
nameStatus.setText("");
return;
}
String message = null;
if ((message = checkName(text)) == null) {
name = text;
nameStatu... |
9f1b380f-2cac-455a-a5ba-988142d6f958 | 9 | @Test
public void computerSuggestion()
{
Player p = new ComputerPlayer();
p.seenAlmostEverything(1, game.getDeck());
ArrayList<String> ans = p.makeSuggestion(game.getDeck());
// Only one suggestion available
Assert.assertTrue(ans.contains("The Hacker") && ans.contains("SQL Injection") && ans.contains(... |
1982989e-f8a3-4d03-95de-23cc9d8748ff | 7 | protected static ArrayList<String> getNeighbors(String course){
String[] courseParts = course.split(" ");
String detailedLevel = courseParts[courseParts.length - 1];
String courseName = "";
for (int i = 0; i < courseParts.length-1; i++){
courseName += courseParts[i];
if (i != cours... |
ee952584-eb0a-48cb-8055-51a2b35be7dc | 1 | public List<Product> getProductsForPage() {
int firstProduct = (currentPage - 1) * NUM_PROD_PER_PAGE;
int lastProduct = firstProduct + NUM_PROD_PER_PAGE;
try {
return products.subList(firstProduct, lastProduct);
} catch (IndexOutOfBoundsException e) {
return products.subList(firstProduct, products.s... |
89ecf3d2-112e-481f-8845-c2aee62ea7af | 1 | public int hashCode() {
return (name != null ? name.hashCode() : 0);
} |
2ce8730d-3db9-4dd7-a8d5-150f07dd804e | 8 | public void coloringLadderByRandom(int startNum){
for(int i = 0; i < startNum; i++){
boolean leftColored = false, rightColored= false;
Random random = new Random();
int randomX = random.nextInt(startNum-2);//전체 개수-1(0에서 시작하니까) -1(마지막줄 그으면 안되니까)
int randomY = random.nextInt(startNum);
boolea... |
ad94036d-72a5-41e2-b1a8-7447c427a21a | 1 | public void setPlayerFruit(Player p, int fruitId){
Fruit f = getFruitById(fruitId);
if(!fruits.containsKey(p.getName()))
{
fruits.put(p.getName(), fruitId);
applyPassiveFruitEffects(p,f);
}
else{
fruits.remove(p.getName());
fruits.put(p.getName(), fruitId);
applyPassiveFruitEffects(p,f);
}
} |
f2962c9d-c5f5-42c4-8902-e0e140e824e8 | 5 | public void aproveTimesheetByTimesheetId(Time_Sheet t, ApprovalSheet approvalSheet) throws SQLServerException, SQLException {
Connection con = null;
con = getConnection();
con.setAutoCommit(false);
con.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
try
{... |
59a4c4db-c549-4906-9c99-1ebc4da6a55f | 2 | public static void loadPlayersHomes( BSPlayer player ) throws SQLException {
ResultSet res = SQLManager.sqlQuery( "SELECT * FROM BungeeHomes WHERE player = '" + player.getName() + "'" );
while ( res.next() ) {
String server = res.getString( "server" );
Location l = new Location( ... |
dcd6cde9-ac5c-4043-864b-41d854b34d36 | 8 | public static APDU createAPDU(ServicesSupported services, ByteQueue queue) throws BACnetException {
// Get the first byte. The 4 high-order bits will tell us the type of PDU this is.
byte type = queue.peek(0);
type = (byte) ((type & 0xff) >> 4);
if (type == ConfirmedRequest.TYPE_ID)
... |
3c5ce2e4-d9a7-44a6-91ce-57fa13a23b07 | 5 | private int [] combinar(int []left, int right[], int[] lista){
int nleft=left.length;
int nright=right.length;
int l=0,r=0,li=0;
while(l<nleft && r<nright){
if(left[l]<=right[r]){
lista[li]=left[l];
l++;
}
else{
lista[li]=right[r];
r++;
}
li++;
}
while(l<nleft){
lista[li]=l... |
d7db0d41-2cbb-456f-8d61-0c55aac2f13b | 7 | private void writeRow(Object[] values) {
Row row = sheet.getRow(rowIndex);
if (row == null) {
row = sheet.createRow(rowIndex);
}
rowIndex++;
Cell cell = null;
for (int cellIndex = 0; cellIndex < values.length ; cellIndex++) {
cell = row.g... |
281bc1ff-5a9a-4b96-ae30-99dfe692eaa5 | 9 | * @param client the connecting client
* @param newCharacter is this a new character
*/
public void init_conn(final Player player, final Client client, final boolean newCharacter) {
if (player == null) {
debug("ERROR!!!: Player Object is NULL!");
return;
}
if (use_cnames) {
// generate generic name ... |
78910395-74fb-48ac-b242-ed224f34090a | 0 | public Coordinate getPosition() {
return position;
} |
2346eca6-a758-4c26-921e-62fcdc32e900 | 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... |
4080d511-f59f-4489-ae7c-ed872455db71 | 5 | private final void method3426(byte i) {
anInt7219++;
try {
Field[] fields = this.getClass().getDeclaredFields();
if (i != 36)
aClass199_7221 = null;
Field[] fields_5_ = fields;
for (int i_6_ = 0;
(i_6_ ^ 0xffffffff) > (fields_5_.length ^ 0xffffffff);
i_6_++) {
Field field = fields_5_[i_6... |
98af9868-d1bf-4178-965e-ba76488418a2 | 5 | public NewDialog(Artistry artistry) {
this.artistry = artistry;
contentPane = new JPanel();
setLayout(null);
setSize(320, 240);
setTitle("New");
contentPane.setLayout(null);
JLabel widthLabel = new JLabel("Width: ");
widthLabel.setBounds(16, 16, 128, 24);
... |
c325afe2-3117-4df2-9f1c-19c501f23122 | 3 | public String extractBitSetasHex() {
int a;
StringBuilder out=new StringBuilder();
int idata[]=returnInts();
for (a=0;a<idata.length;a++) {
// Ensure the number consists of two characters
if (idata[a]<16) out.append("0");
out.append(Integer.toHexString(idata[a]));
if (a<idata.length-1) out.append(",... |
0fa5dba5-7b7e-418f-94af-f2cace54dbd6 | 8 | void menuComposeAlpha(int alpha_op) {
if (image == null) return;
animate = false; // stop any animation in progress
Cursor waitCursor = display.getSystemCursor(SWT.CURSOR_WAIT);
shell.setCursor(waitCursor);
imageCanvas.setCursor(waitCursor);
try {
if (alpha_op == ALPHA_CONSTANT) {
imageData.alpha = a... |
f9533ae8-412e-43a1-b79c-c046770ab261 | 5 | public ArrayList<Intersection> getNeighbors(Intersection intersection)
{
ArrayList<Intersection> neighbors = new ArrayList();
ArrayList<Road> roads = level.roads;
int x = intersection.x;
int y = intersection.y;
for (int i = 0; i < roads.size(); i++)
{
... |
054d9ded-db12-4f63-b066-487ee6b9774b | 2 | public void setAddress(InetAddress address) {
if (address == null) {
this.address = null;
} else if (!(address instanceof Inet4Address)) {
throw new IllegalArgumentException("only IPv4 addresses accepted");
} else {
this.address = address;
}
} |
dfb7a9a4-92c9-413e-bd75-d562603fce2e | 0 | public void setType(String value) {
this.type = value;
} |
439803bf-9851-48ff-b557-7cc792c6e339 | 7 | private static Alignment traceback(Sequence s1, Sequence s2, Matrix m,
byte[][] pointers, Cell cell) {
char[] array1 = s1.toArray();
char[] array2 = s2.toArray();
float[][] scores = m.getScores();
Alignment alignment = new Alignment();
alignment.setScore(cell.getScor... |
72f4962c-2e0e-4fa1-aa45-eddfdc4d9865 | 7 | private void postProcessPlotInfo(FastVector plotSize) {
int maxpSize = 20;
double maxErr = Double.NEGATIVE_INFINITY;
double minErr = Double.POSITIVE_INFINITY;
double err;
for (int i = 0; i < plotSize.size(); i++) {
Double errd = (Double)plotSize.elementAt(i);
if (errd != null) {
er... |
41b473a1-6c97-40f6-9dd5-c0a9669811ad | 4 | public int listxattrsize(ByteBuffer path, FuseSizeSetter sizeSetter) {
if (xattrSupport == null) {
return handleErrno(Errno.ENOTSUPP);
}
String pathStr = cs.decode(path).toString();
if (log != null && log.isDebugEnabled()) {
log.debug("listxattrsize: path=" + pa... |
38f94286-8729-4cac-9429-9cb48d2666c7 | 1 | public void dispose() {
Iterator<Color> e = fColorTable.values().iterator();
while (e.hasNext())
((Color) e.next()).dispose();
} |
da633937-d82b-4776-87ef-bc3eb1cce9a1 | 7 | private static void Move(IHI_PathfinderValues values)
{
values.tiles[values.X[values.binaryHeap[1]]][values.Y[values.binaryHeap[1]]] = 2;
values.binaryHeap[1] = values.binaryHeap[values.count];
values.count--;
short location = 1;
while (true)
{
... |
a96b20f1-5c45-4e59-bbd2-579eac2c68ad | 4 | public Token expr() throws ParentesiParsingException, OperazioneNonValidaException, ExtraTokenException, OperatoreMissingException, OperandoMissingException
{
Token x = andExpr();
if(!(point>text.size()-1))
{ while(peek().ritornaTipoToken().equals(Tok.OR))
{
consume();
Token y = andExpr();
boolean... |
04a60017-4f1e-427e-a762-ad08f7bc3670 | 6 | public void insertTileArray(int pg, int index, int oam[], int wid, int hgt, CHRTile[] tiles) {
if ((index % 32 + wid) > 32) {
// adjust wid so we dont wrap around
wid -= ((index % 32 + wid) - 32);
}
if ((index + (32 * hgt) > (30 * 32))) {
// adjust hgt so we dont mess up
hgt -= ((index + (32 * hgt)) /... |
f53c91db-149d-4ca1-b008-43794225a5f1 | 6 | public static int getPrice(int basePrice, int goldenNumber) {
Random random = new Random();
int randomNumber = random.nextInt(85) + 1;
int priceModifyer = (basePrice * randomNumber) / 100;
int price = basePrice - priceModifyer;
int goldenPrice;
int goldenChance = random.n... |
795f9e2e-313b-45b1-a8df-529762a4c580 | 2 | @Override
public void onKeyPress(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_SPACE) {
player.jump();
} else if (e.getKeyCode() == KeyEvent.VK_DOWN) {
player.duck();
}
} |
bbfe5227-1f84-4eec-b057-b8d2b3221810 | 6 | public boolean intersectsRect(Rectangle rect)
{
// To save CPU, we can test if the rectangle intersects the entire
// bounds of this label
if ( (labelBounds != null
&& (!labelBounds.getRectangle().intersects(rect)) )
|| labelGlyphs == null )
{
return false;
}
for (int i = 0; i < labelGlyphs.len... |
594125ad-895a-43c3-aee6-6ca3c7975bf9 | 9 | @Override
public void moveTowards(MapLocation mapLocation) {
Direction direction = rc.getLocation().directionTo(mapLocation);
if (canMakeProgress(direction)) {
moveToDirection(rc, direction);
stuck = false;
return ;
} else {
stuck = true;
stuckLocation = rc.getLocation();
}
if (stuck) {
... |
1324df66-89f4-41b6-a54a-a87492b81ef5 | 9 | @Override
public void actOnInput(int key) {
switch(key) {
case '1':
this.activate(new PlaceLandTileController(this.game, this.view, this.gameController));
break;
case '2':
this.activate(new AddDeveloperController(this.game, this.view, t... |
69ceff86-ecbc-4746-ae0a-320a7490d09f | 5 | public void loadLevel() {
SpriteSheet sprites = new SpriteSheet("/res/images/desk2.png", 1, 1);
Image desk = sprites.getSprite(0);
sprites = new SpriteSheet("/res/images/floorTile.png", 1, 1);
Image floor = sprites.getSprite(0);
for (int x = 0; x < WIDTH; x += 2)
for ... |
06c8bc39-c442-4e3e-b4f4-219fb119eb30 | 5 | private void updatePlayers(int packetSize, Stream stream) {
localEntityCount = 0;
entityUpdateCount = 0;
updateLocalPlayerMovement(stream);
updatePlayerMovement(stream);
updatePlayerList(stream, packetSize); // method91
parsePlayerUpdateFlags(stream);
for (int id ... |
8225335f-314f-4351-987a-4932e87af5b3 | 0 | public OutlinerDocumentListener[] getOutlinerDocumentListeners() {
return (OutlinerDocumentListener[]) outlinerDocumentListeners.toArray();
} |
d4d099b7-ddca-4aea-bc2b-69153b98b4b4 | 3 | private void updateInputArea() {
String html;
if (currentState == MasterMindGraphic.FEEDBACK){
String b = this.input.length() > 0 ? this.input.substring(0, 1):" " ;
String w = this.input.length() > 1 ? this.input.substring(1, 2):" ";
html = "<div id = 'inputArea'> "+constants.Input()+": "
... |
4dcc6d54-e4bb-4ca1-ab09-f2628a0e9d0e | 9 | public GridItem objectAt(int x, int y){
GridItem e = null;
if(x >= 0 && y >= 0 && x < size.width && y < size.height)
e= grid[x][y];
if(e == null)
for(Player p : players)
for(Bomb b : p.getBombs())
if((int)(b.getX()/ICON_SIZE) == x && (int)(b.getY()/ICON_SIZE) == y)
return b;
return e;
} |
c467208f-e17b-4acb-b438-8c7795c47fa0 | 7 | public void paintComponent(Graphics g)
{
BufferedImage spriteSheet = null,Hull;
BufferedImageLoader loader = new BufferedImageLoader();
try {
spriteSheet = loader.loadImage("images/Ship_Shop/shipshopparts.png");
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();... |
8de419df-acdf-4d05-93c8-f99f7b6fba03 | 2 | public void organizeCards() {
Tree<Card> organizedCards = new Tree<>();
for (int c = 0; c < this.getNumOrbitComponents(); c++) {
organizedCards.insert(((CardComponent)this.getSubComponent(c)).getCard(), true);
}
Iterator<Card> ci = organizedCards.iterator();
CardComp... |
181253c9-c3b8-46e7-9501-1f203a8b6f82 | 0 | public Iterator keys() {
return this.keySet().iterator();
} |
2cf30b6b-4d03-4da7-85b0-c5cdb558dcea | 8 | @SuppressWarnings("deprecation")
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {
if(ut.tc.speedFlag!=0)
{
int resultFlag=JOptionPane.showConfirmDialog(null,"Ѿ"+ut.tc.speedFlag+"ΣҪ "+(80+ut.tc.speedFlag*160)+"ңܹǷ" , "̳Ϣ",JOptionPane.YES_NO_OPTION );
if(resultFlag==JOptionPane.YES_OP... |
6d82c875-4930-4ede-9275-8379d643bbbb | 5 | private GameObjectDefinition getChildDefinition() {
int child = -1;
if (varBitId != -1) {
VarBit varBit = VarBit.cache[varBitId];
int configId = varBit.configId;
int lsb = varBit.leastSignificantBit;
int msb = varBit.mostSignificantBit;
int bit = Client.BITFIELD_MAX_VALUE[msb - lsb];
child = clien... |
3f3d08af-6a8a-4866-bd97-e93c9afcc470 | 4 | public void validate() {
if (currentZoom != documentViewModel.getViewZoom() ||
currentRotation != documentViewModel.getViewRotation()) {
refreshDirtyBounds();
currentRotation = documentViewModel.getViewRotation();
currentZoom = documentViewModel.getViewZoom();... |
8e76ca3b-3b37-477d-b999-065a6151c652 | 2 | public static void main(String args[]) {
final SynchronousQueue<String> queue = new SynchronousQueue<String>();
new Thread(new Runnable() {
@Override
public void run() {
String event = "FOUR";
try {
queue.put(event); // thread w... |
ca6ec73a-0a60-47d3-93ce-53064e94324f | 4 | @Override
public boolean registerBuilder(Class<? extends IPacketBuilder> builder) {
Object object = null;
try {
object = builder.newInstance();
} catch (InstantiationException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
}
BuildsPacket annotation = builder.ge... |
acb070a3-b5bf-4833-8be2-97b14efb6405 | 7 | protected void doWrite(PrintWriter writer, String courseID, String nickname, String assignID) throws IOException {
DietjeDatabase database = null;
Connection connection = null;
Map<String, Object> feedback = new LinkedHashMap<String, Object>();
try {
database = new DietjeDa... |
ab5deb57-ca0b-4dd6-a41d-548828b7f142 | 2 | private void jButton3ActionPerformed() {
String nameOfStreamer = JOptionPane.showInputDialog(null, "Enter the streamer's name: ");
if (nameOfStreamer == null || nameOfStreamer.isEmpty()) { return; }
TwitchStream.removeStream(nameOfStreamer);
TwitchStream.restartStreams();
} |
fe713dbf-91e0-4652-83ea-49acfbf5d26d | 9 | public static OrbitalElements getOrbitalElements(int elementIndex,
Calendar calendar) {
Calendar reference = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
reference.set(2000, 0, 1, 0, 0, 0);
reference.set(Calendar.MILLISECOND, 0);
double d = (calendar.getTimeInMillis() - reference.getTimeInMillis())
... |
35811391-1026-4ebe-adfc-c67489f2c1c1 | 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... |
90c63f12-9ebb-4d6a-aaf1-6c78703b4773 | 2 | public final Group createGameBoard() {
flow = new Timeline();
Group group = new Group();
Image image = new Image(getClass().
getResourceAsStream("socialite.jpg"));
int colCount = (int) (image.getWidth()
/ SlidingPuzzlePiece.getPuzzleSize());
int... |
1be79026-4998-4c05-b28a-0d3a5b417b0e | 3 | public static void getTraitStats(Tidy tidy, Document doc, Trait[] traits) {
try {
XPath xpath = XPathFactory.newInstance().newXPath();
XPathExpression expr = xpath.compile("//div[@id = 'bodyContent']/dl/dd/text() |" +
"//div[@id = 'bodyContent']/dl/dd/a/text()");
NodeList nodes = (Nod... |
3d6fdad8-a8b8-481e-a7ef-d3f709072863 | 2 | private void table_ticketMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_table_ticketMouseClicked
if (evt.getClickCount() == 2) {
JTable target = (JTable) evt.getSource();
int row = target.getSelectedRow();
final DetalleRegistro a = new DetalleRegistro(tableTic... |
53767efe-6d6d-4850-b93f-9eaec91f4284 | 8 | private String[] parseLocalNames() throws IOException, LexerException, ParserException {
Token token = this.nextToken();
if (!(token != null && token.getType()==TokenType.SEPARATOR && token.getValue().equals("|"))) {
this.pushToken(token);
return null;
}
List<String> names = new ArrayList<String>(... |
2d7fdefb-fa5b-4626-a8b1-349657d5a89f | 1 | private void addVertices(Vertex[] vertices, int[] indices, boolean calcNormals)
{
if(calcNormals)
{
calcNormals(vertices, indices);
}
size = indices.length;
glBindBuffer(GL_ARRAY_BUFFER, vbo);
glBufferData(GL_ARRAY_BUFFER, Util.createFlippedBuffer(vertices), GL_STATIC_DRAW);
glBindBuffer(GL_E... |
b56b4b07-6fd0-4c98-9167-d3e09c1e928e | 6 | @SuppressWarnings("unchecked")
public String Write(String contents, String header, List<String> tags) throws Exception{
XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
config.setServerURL(new URL(serverURL));
XmlRpcClient client = new XmlRpcClient();
client.setConfig(config);
Ma... |
c13310a9-f3a9-42f3-84a8-2514e75a9d07 | 5 | public BigInteger genPrime(int pBits){
BigInteger p;
do {
p = new BigInteger(pBits,rnd);
if (p.mod(BigInteger.valueOf(2)).equals(BigInteger.ZERO)) continue;
if (p.mod(BigInteger.valueOf(3)).equals(BigInteger.ZERO)) continue;
if (p.mod(BigInteger.valueOf(5)).equals(BigInteger.ZERO... |
94231eda-13d9-4cab-ad46-e4377df45117 | 9 | public void mouseDragged(MouseEvent e) {
//NIVEL 1............................................
if(bNivel1) {
for(Object lnkProducto : lnkProductos1) {
Producto proObjeto = (Producto) lnkProducto;
if(proObjeto.getAgarrado()) {
mPosX = e.getX... |
b12f5e5f-18f5-42b1-a97b-4b6e19e4bb59 | 1 | private static byte[] splitInSextets(byte[] block) {
byte[] copy = block;
final int nbBits = copy.length * 8;
final int nbSextets = nbBits / 6;
byte[] sextets = new byte[nbSextets];
for(int i = 0; i < nbSextets; i++) {
// verplaats twee posities naar rechts en maak ... |
c59cc6d5-79e6-40b9-97ee-e01ac54467a4 | 0 | public void setId(String id) {
this.id = id;
} |
887d0861-451b-42c4-aa4a-d1f93d907681 | 2 | @Override
protected void onStart() {
for(int i = 0; i < Settings.serversCount; i++){
final int i2 = i;
MineOS.getDesktop().addLinkIcon(Resources.getImageIcon("mc.png"), Settings.serverNames[i], new ActionListener() {
@Override
public void actionPerformed(ActionEvent arg0) {
try{
//Узнаем пут... |
13768025-8d20-4722-a08b-ee3595fa57f4 | 6 | public void drawString(String str,int x,int y,int type,float scale){
if(str==null){
return;
}
for(int i=0;i<(str.length());i++){
Texture t = map.get("A");
try {
t = map.get(str.charAt(i)+"");
t.bind();
} catch (Exception e) {
System.err.println("Image load crash on symbol \""+str.charAt(i... |
143bc3e2-e055-4154-86d2-f1c8438dba61 | 7 | private float addModifier(Modifier modifier, UnitType unitType, float result) {
FreeColObject source = modifier.getSource();
String sourceName;
if (source == null) {
sourceName = "???";
} else {
sourceName = Messages.getName(source);
if (unitType != nu... |
0fbad56b-1108-4532-bca3-cc7d7906b2e7 | 8 | @Override
public int attack(final NPC npc, final Entity target) {
final NPCCombatDefinitions defs = npc.getCombatDefinitions();
npc.setNextAnimation(new Animation(defs.getAttackEmote()));
switch (Utils.getRandom(5)) {
case 0:
npc.setNextForceTalk(new ForceTalk("Bwuk"));
break;
case 1:
npc.setNextFor... |
10cc88a0-d600-4661-8280-fe04d35c97a5 | 8 | public static AbstractNearByPlacesFacade getFacade(String publisher, String contextPath,
int displaySize) throws CitysearchException {
if (publisher == null) {
throw new CitysearchException("NearByPlacesFacadeFactory", "getFacade",
"Invalid Publisher Code.");
... |
f8f3c969-475f-4546-85f9-aa64af1d9979 | 2 | public int findPosNode(T x) {//return position of node
int pos=0;
Node<T> ele = _head;
while (ele != null) {
if (ele.getData().equals(x))
return pos;
else{
ele = ele.getNext();
pos+=1;
}
}
return -1;//nod... |
77752913-9011-40fa-bdcd-50bb90141725 | 5 | private void ParseOutElements(org.w3c.dom.Element parentElement) {
Node child = parentElement.getFirstChild();
while (child != null) {
if (! handleGeneralProperty(child)) {
String nodeName = child.getNodeName();
// Container specific properties: accept[ ], item[ ]
if (nodeName == "item") {
conta... |
33d10c0d-b2ad-46ad-8225-0f62d7ff1d4d | 1 | public void setVisible(boolean visible) {
if(frame == null) buildGUI();
frame.setVisible(visible);
log.exiting(getClass().getSimpleName(), "setVisible(boolean)");
} |
bc7af0ba-4190-40ed-a3c0-cb9a63f05bea | 8 | public static String stringFor_cl_sampler_info(int n)
{
switch (n)
{
case CL_SAMPLER_REFERENCE_COUNT: return "CL_SAMPLER_REFERENCE_COUNT";
case CL_SAMPLER_CONTEXT: return "CL_SAMPLER_CONTEXT";
case CL_SAMPLER_NORMALIZED_COORDS: return "CL_SAMPLER_NORMALIZED_COORDS... |
b2e6d00a-0c55-498c-888a-60c1e6d47ec8 | 7 | public boolean saveSettings()
{
String line = null;
BufferedWriter ini_file;
try
{
//open file
ini_file = new BufferedWriter( new FileWriter( JIPT_INI_PATH + JIPT_INI_FILENAME ) );
//write show Splash screen info
ini_file.write( "SPLA... |
3da3b210-3125-4817-9788-1bae9c51a92d | 4 | @Override
public boolean isAllowedToBorrow(Loan loan, StockController stockController) {
if (stockController.numberOfLoans(this) < 4) {
if (loan.getQuantity() < 25) {
if (CalendarController.differenceDate(loan.getStart(),
loan.getEnd()) < 8) {
... |
cb74122d-8a08-434d-835b-f84d33938704 | 0 | public static void compare(String dna1, String dna2) {
System.out.println("Difference = " + mss(dna1, dna2, true));
} |
ddc2da0d-9fff-4820-bbd0-fab6f1ed84dc | 7 | public String createParsedURI (String searchTerm, String mediaType){
/*
* Given a search term return the KAT URI.
* example @param: "linkin park in the end/", "music"
*/
String baseURI = Constants.KAT_SEARCH_BASE;
String parsedQuery = "";
String URI;
if (mediaType.toLowerCase().equals("movie... |
d75798e5-f621-4561-a525-71766e96485f | 8 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (!(obj instanceof TermStatus))
return false;
TermStatus other = (TermStatus) obj;
if (average == null) {
if (other.average != null)
return false;
} else if (!average.equals(other.av... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.