method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
c1084021-7305-4be1-bae3-d774f3a12640 | 7 | public static void startupSdbc() {
{ Object old$Module$000 = Stella.$MODULE$.get();
Object old$Context$000 = Stella.$CONTEXT$.get();
try {
Native.setSpecial(Stella.$MODULE$, Stella.getStellaModule("/SDBC", Stella.$STARTUP_TIME_PHASE$ > 1));
Native.setSpecial(Stella.$CONTEXT$, ((Module)(... |
eb7d09ab-694f-4610-9cd6-a412e8802de3 | 0 | public String getSenha() {
return senha;
} |
15d0ceb7-3130-46d6-a7b4-34d64854ebd7 | 6 | public static HashMap<String, HashMap<String, Integer>> getMap(String filePath) throws Exception
{
HashMap<String, HashMap<String, Integer>> map =
new HashMap<String, HashMap<String,Integer>>();
BufferedReader reader = filePath.toLowerCase().endsWith("gz") ?
new BufferedReader(new InputStreamReader(
... |
0375c82f-9d98-410c-aeec-4dd573df8f1b | 0 | public Component getDefaultComponent(Container container) {
return getFirstComponent(container);
} |
3d71a8a2-4879-49f5-b0a3-3bac60f6f642 | 1 | public Integer getTripLength() {
if (river == null)
return 0;
return river.getTripLength();
} |
00384cec-aa73-46be-bf8b-875d1a0b5046 | 0 | public String getTitle() {
return title;
} |
6edc08d0-467d-410d-8358-6182a4278bb7 | 1 | public void test_add_long_int() {
assertEquals(567L, MillisDurationField.INSTANCE.add(567L, 0));
assertEquals(567L + 1234L, MillisDurationField.INSTANCE.add(567L, 1234));
assertEquals(567L - 1234L, MillisDurationField.INSTANCE.add(567L, -1234));
try {
MillisDurationField.INST... |
20c26bc8-935e-4196-b4da-6f50f53fe5db | 6 | private void nextButtonActionPerformed(java.awt.event.ActionEvent evt) {
ArrayList<Worker> workers = new ArrayList<Worker>();
boolean allGood = true;
for (JPanel tab : this.workerTabs) {
ArrayList<Day> workerDays = new ArrayList<Day>();
JTextField nameArea = (JTextField) tab.getComponent(2);
if (nameArea... |
91fcb4d0-240d-4de7-a066-728725ccb06f | 4 | public boolean chunkCorrectRepDegree(byte[] fileID, int chunkNo) {
for(BackupChunk chunk : backedUpChunks) {
if(Packet.bytesToHex(chunk.getFileID()).equals(Packet.bytesToHex(fileID)) && chunkNo == chunk.getChunkNo()) {
if(chunk.getRepDeg() < chunk.getWantedReplicationDegree()) {
return false;
}
}
... |
2c84906d-9d97-400f-8e46-25892f63b7ab | 1 | public List<Object> getSPKISexpAndAny() {
if (spkiSexpAndAny == null) {
spkiSexpAndAny = new ArrayList<Object>();
}
return this.spkiSexpAndAny;
} |
a32a52ad-16e0-4c47-bea1-89686bec913b | 3 | public ArrayList<String> getExternalUsersByMeetingID(int meetingID){
ArrayList<String> externalUsersReturn = new ArrayList<>();
for(ExternalUser externalUser : externalUsers){
if(externalUser.getMeetingID() == meetingID && !externalUsersReturn.contains(externalUser.getEmail())) externalUser... |
0c3c14ab-d0a1-4ea6-af60-5be908b4dbe3 | 1 | @Override
public void characters(char ch[], int start, int length) throws SAXException {
StringBuffer buf = (StringBuffer) characters_stack.peek();
buf.append(new String(ch, start, length));
if (isVerboseEnough(VERBOSITY_DEBUG)) {
System.out.println(" characters: [" + new String(ch, start, length) + "]");... |
62afd5d9-219a-40d2-af8f-5623edf4a0dd | 0 | @Override
public String getCur() {return String.valueOf(cur);} |
9a61c643-9024-42e4-870b-d8b0eba8ff02 | 1 | @Override
public String describeNode() {
// since this is a simple object, we can include it in the description
return super.describeNode()+(this.getFile()==null?"":this.getFile().getName());
} |
e0faf714-1b4a-4014-99ac-ee33b594ef79 | 4 | private void chequePayementButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_chequePayementButtonActionPerformed
// TODO add your handling code here:
try {
// TODO add your handling code here:
orderDataAccessorObject.deleteOrderInfo(Integer.parseInt(paymenO... |
af2da40e-c9a1-4cb5-bb5a-d0a008f12cd7 | 6 | public static int getIndentationLevel(String wikiString)
{
int characterPosition = wikiString.indexOf('1');
//if (characterPosition < 3) return 0;
for (int i=0; i<validPositions.length; i++)
{
if (characterPosition==validPositions[i])
{
if (noCharactersPrecedeItemCharacter(wikiStri... |
d0ae570d-7eab-4cab-9096-be337a0badde | 6 | public static void writeSQL (String host, String port, String db, String user, String newPW) {
try {
if ("".equals(host) || "".equals(port) || "".equals(db) || "".equals(user) || "".equals(newPW)) {
Error_Frame.Error("Please fill in completely");
} else {
... |
eaa980de-3d2a-484e-b111-47b675f95bea | 1 | public void add(String aword)
{
for ( int i = quantity; i>0; i--)
{
list[i] = list[i-1];
list[0] = aword;
quantity++;
}
} |
d4a7d879-5c2e-456a-8e41-e070869b6cca | 2 | @Override
protected void onInit() throws IOException
{
if (socket == null)
{
socket = protocol.getChannels().newSocket();
socket.configureBlocking( false );
socket.connect( address );
while (!socket.finishConnect()) {
/... |
2b8f43a4-7fba-4716-8ec4-5d18bbbb0e15 | 4 | public static void loadFileNames(String pathToSprite,
String xmlOfSpriteType,
ArrayList<Integer> uniqueIDList,
ArrayList<String> names)
throws Inval... |
ac7e8f79-a0b7-469f-a61d-fa3ff5d3ddcd | 6 | public void setContent(String[] con)
{
this.content.clear();
int pad = Settings.get(SetKeys.GUI_CMP_FONT_PADDING, Integer.class) + Settings.get(SetKeys.GUI_CMP_BORDER_SIZE, Integer.class);
int yoff = pad;
int maxx = 0;
int maxh = Settings.get(SetKeys.WIN_HEIGHT, Integer.class) - this.getPixelY();
... |
51254aa0-a1de-48eb-b59c-35e79068b832 | 6 | public static long solution1(HashMap<Integer, Integer> resource, Integer preEle) {
boolean hasLeft = false;
for(Integer ele : resource.keySet()) {
if(resource.get(ele)!=0) {
hasLeft = true;
}
}
if(!hasLeft) return 1;
long count = 0;
for(Integer ele : resource.keySet()) {
if(ele==preEle || re... |
349e5fb1-73fb-4309-abde-3c3927d49410 | 5 | void heapify( int i, int heapsize )
{
int l, r, largest;
l = left( i );
r = right( i );
c.IncCompare();
if( l <= heapsize && points.greater(l, i) ){
largest = l;
} else
largest = i;
c.IncCompare();
if( r <= heapsize && points.greater(r, largest) ) {
largest = r;
}
if( lar... |
00136a48-35d8-41a1-ab05-6cc3c054afa6 | 8 | @Override
public Object getValueAt(int rowIndex, int columnIndex) {
Object res = null;
Person person = listPerson.get(rowIndex);
switch (columnIndex) {
case 0:
res = person.getId();
break;
case 1:
res = person.getFirstName();
break;
case 2:
res = person.getLastName();
break;
c... |
deeb9dd1-46d8-4804-8c9f-b1ebf12952fd | 7 | public static void main(String[] args) {
int salida=0;
InputStreamReader isr = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader (isr);
crearMenu();
while (salida!=5){
try {
salida= Integer.parseInt(br.readLine().toString());
switch (salida) {
case 1:crearRegistro();
... |
678f9cd0-9709-48f2-b659-aa7b079c57cd | 4 | public static byte[] decodeFromFile( String filename )
throws java.io.IOException {
byte[] decodedData = null;
Base64.InputStream bis = null;
try
{
// Set up some useful variables
java.io.File file = new java.io.File( filename );
byte[] bu... |
249074a6-8881-45a0-ae45-e8a22beb3d87 | 0 | public void setSelected(boolean isSelected) {this.isSelected = isSelected;} |
5528ec95-3463-48b5-9b4b-d0f8b29571dc | 7 | private void insertBreakInMLC(ActionEvent e, RSyntaxTextArea textArea,
int line) {
Matcher m = null;
int start = -1;
int end = -1;
try {
start = textArea.getLineStartOffset(line);
end = textArea.getLineEndOffset(line);
String text = textArea.getText(start, end-start);
m = p.matche... |
3f078cc2-c5b6-41e5-a120-d95a5a710866 | 2 | public void Imprimir()
{ if (VaciaLista())
{
System.out.println( "vacia" +Nombre);
}
//fin del primer if
else
{
System.out.print( "La " + Nombre +" es: ");
NodosProcesos Actual = PrimerNodo;
while (Actual.siguiente != PrimerNodo)
{
System.out.print (Actual.datos + " ");
... |
cfc3767d-60ff-4355-bdae-a8ea28ad97bf | 2 | public Double[] getMouseUp() {
drawPiece = true;
while (!StdDraw.mousePressed()) {
// Wait for mouse press
draw();
}
drawPiece = false;
while (StdDraw.mousePressed()) {
// Wait for mouse release
// We don't support click-drag mechanic
}
return new Double[] {StdDraw.mouseX(), StdDraw.mouseY()};... |
049f150a-9eeb-4df6-91ad-6e669bdabf5e | 8 | private void someTalking(CounterActionFactory CAF) {
CloudComment cc = CAF.createCloudComment("");
SkinSwitch ss = CAF.createSkinSwitch(0);
InputBox answerBox = CAF.createInputBox();
// retrieve serialized data
String favMovie = (String) Serializer.deserialize(null, "favmovie.dat");
String favSpot = (Str... |
38c0fd3f-06ac-4367-8002-b9ba6826521b | 2 | public int getWordIndex(String word,TrieNode root){
for(char ch : word.toCharArray()){
if((root=root.getAdj(ch))==null) return -1;
}
return root.index;
} |
2a880287-ac4d-4305-8d28-2ce49205b87a | 4 | private Task[] getTaskListResponse(HttpURLConnection connection) throws Exception {
int responseCode = connection.getResponseCode();
if (responseCode == 200) {
InputStream inputStream = connection.getInputStream();
BufferedReader reader = new BufferedReader(new InputStreamReader(
inputStream));
retur... |
a3473fa1-482c-4e72-9b0d-1cb30712cf24 | 2 | public void init() {
//TODO generate general init
//String.format() cannot be used in GWT
for (int i = 0; i < 10000; i ++) {
String digits = String.valueOf(i);
StringBuilder sb = new StringBuilder();
for (int j = 0; j < 4-digits.length(); j ++) {
sb.append('0');
}
sb.ap... |
7dbd44d5-2ece-436a-b701-9be8d161a78a | 8 | private void checkAndPlace(int x, int y, int id){
if(getTile(x - 1, y) == Tile.rockTile) setTile(x - 1, y, id);
if(getTile(x + 1, y) == Tile.rockTile) setTile(x + 1, y, id);
if(getTile(x, y + 1) == Tile.rockTile) setTile(x, y + 1, id);
if(getTile(x, y - 1) == Tile.rockTile) setTile(x, y - 1, id);
if(getTil... |
062a80c2-68cd-461f-9efb-165bb0a8e807 | 5 | private synchronized void leaveGame(ClientGameTread cgt) {
if(gameStarted) {
if(cgt.playerState.isActive()) {
finishGame(cgt.ct.getNickname());
}
} else {
for(PlayerState ps : players) {
if(ps.getNickname().equals(cgt.ct.getNickname()))... |
7c5798c7-7922-481c-adba-714a460e4ad0 | 1 | public Vector[][] getAnimation(int maxTime){
Vector res[][] = new Vector[maxTime][beings.size()];
for(int i = 0; i < maxTime; i++){
res[i] = getArray();
timeStep();
}
setToZero();
return res;
} |
705d2c95-e0e2-4b28-84b8-3074d67f0e50 | 5 | private void initialize() {
frame = new JFrame();
frame.setBounds(400, 300, 200, 170);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
panel.setSize(200, 150);
frame.getContentPane().add(panel, BorderLayout.CENTER);
panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
txtpnLogin = new JLab... |
5f47c2cc-afe7-49a9-a8e1-5b312e90cf55 | 1 | public String readAll() {
if (!scanner.hasNextLine())
return "";
String result = scanner.useDelimiter(EVERYTHING_PATTERN).next();
// not that important to reset delimeter, since now scanner is empty
scanner.useDelimiter(WHITESPACE_PATTERN); // but let's do it anyway
... |
a15e3927-2f6f-480c-a430-069772c4476b | 5 | private void handleTouchCommands(ClientHandler handler, String command)
throws SocketTimeoutException, IOException, CacheException {
/*
touch <key> <exptime> [noreply]\r\n
*/
String cmdData[] = command.split(" ");
String cmd = cmdData[0];
String key = cmdData[1];
int exptime = Integer.parseInt(cmdDa... |
7f306c7c-c7ff-4116-af9e-65345939ba3b | 7 | public /*synchronized*/ void run()
{
Peer l_tmp_peer = null;
int l_tmp_error_count = 0;
this.Receiver_enabled = true;
while( this.Receiver_enabled )
{
try {
l_tmp_peer = Recv();
while( this.Receiver_peers.contains(l_tmp_peer))
this.Receiver_peers.remove(l_tmp_peer);
this.Re... |
84c94a55-7ee8-4041-bff8-9b4f074768d1 | 5 | public static HashMap<String, Integer> rankFromStdDev(HashMap<String, Double> stdevs) {
if (stdevs == null || stdevs.size() < 2) return null;
int numColors = TextureHeatMap.MAX_TEXTURES-1;
// accounts for rounding operation
double scale = numColors / HeaderLabel.DISAGREE_MAX * 100;
... |
79f0b9c9-6942-4f71-8b48-8b210238ee9f | 0 | public RoomState getCurrentRoom(){
return currentRoom;
} |
69dfda28-335a-45ce-ada3-9131d1067a88 | 6 | private boolean loadDataCoordinatesFromFileCache(int id)
{
try {
// file name:
String fName = DATA_CACHE_FOLDER + "/DataCoordinate_" + FESVo.getDataType(id).name() + "_ID_" + this.srdsSource.srdsSrcID;
// file object:
File file;
... |
7a1ce2dc-9b4f-4671-96f2-c6d736abdd05 | 1 | public String pop() {
int i = getFirstArgEndIndex();
if(i == -1) return "";
else {
String firstArg = arg.substring(0, i);
this.arg = arg.substring(i).trim();
return firstArg;
}
} |
2b6d68f8-3940-4b1d-8bf4-8329c9de5fee | 1 | public void useTimeUnit() {
System.out
.println("-----------Use TTimeUnit.SECONDS.sleep()-------------");
System.out.println("Sleep for 5 seconds.");
try {
TimeUnit.SECONDS.sleep(5); // Same as Thread.sleep(5000);
System.out.println("woke up.");
} catch (InterruptedException e) {
e.printStackTrace(... |
f638e17c-79b1-4ba1-b4b1-e8fd55864f1b | 4 | private void addUniform( String uniformName, String uniformType, HashMap<String, ArrayList<GLSLStruct>> structs )
{
boolean addThis = true;
ArrayList<GLSLStruct> structComponents = structs.get( uniformType );
if ( structComponents != null )
{
addThis = false;
for ( GLSLStruct struct : structComponents )... |
4ef61682-e788-4c02-b9ab-a87f3857f36f | 3 | public void renderButton(){
glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
int mx = Mouse.getX();
int my = Main.HEIGHT - Mouse.getY();
if(mx < 128 && my < 32){
if(Input.checkForClick(0)){
isOpen = true;
}
glColor4d(1, 1, 1, 1);
}else{
glColor4d(0.6, 0.6, 0.6, 0.6... |
2f4de23e-f1a4-4624-9bf9-3178df1bdec5 | 3 | public void setRight(PExp node)
{
if(this._right_ != null)
{
this._right_.parent(null);
}
if(node != null)
{
if(node.parent() != null)
{
node.parent().removeChild(node);
}
node.parent(this);
... |
e4b01b76-a001-4b0b-98ca-f7c52f2831b5 | 8 | private void apply() {
int[][] config = new int[3 + levels.getSelectedIndex()][];
try {
config[0] = memorySettings.getConfiguration();
config[1] = l1Instruction.getConfiguration();
config[2] = l1Data.getConfiguration();
if (levels.getSelectedIndex() > 0)
config[3] = l2Data.getConfiguration();
if... |
da80e6c5-833d-4b76-8b4f-c0bea27c3577 | 4 | static private void initLoad(JButton load, JPanel panel) {
load.setToolTipText("To load a new image");
load.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
BufferedImage newImage = null;
String new... |
c05cc9db-5a0e-4a94-a912-7c8c6246b824 | 1 | public PluginMenuItemBuilder(Map<String,Constructor<? extends ICreature>> mc,
ActionListener listener) {
menu = new JMenu();
this.constructors = mc;
this.listener = listener;
} |
68b07a73-3579-4f4e-b59a-f0cd7028e4c5 | 8 | public void valueChanged (ListSelectionEvent lse) {
System.out.println (lse);
if (! lse.getValueIsAdjusting()) {
removeListSelectionListener (this);
// remember everything selected as a result of this action
HashSet newSelections = new HashSet();
... |
7a22ffbf-e802-4d0a-a17e-5561825c4474 | 5 | @EventHandler(priority = EventPriority.HIGHEST)
public void onHangingBreak(HangingBreakEvent event){
if (event.isCancelled()) return;
String worldName = event.getEntity().getLocation().getWorld().getName();
String worldN = plugin.getIfMainWorld(worldName);
if (worldN != null){
//World is a copy world
if ... |
6edc2a28-981b-46a8-9e1b-fa4f146a101c | 3 | public static double Phi(double z) {
if (z < -8.0) return 0.0;
if (z > 8.0) return 1.0;
double sum = 0.0, term = z;
int i=3;
for (; sum + term != sum; i += 2) {
sum = sum + term;
term = term * z * z / i;
}
return 0.5 + sum * phi(z);
} |
64b11a2a-72b2-43e1-ba13-84383168f9cf | 8 | @Override
public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel)
{
MOB target=mob;
if((auto)&&(givenTarget!=null)&&(givenTarget instanceof MOB))
target=(MOB)givenTarget;
if(target.fetchEffect(this.ID())!=null)
{
mob.tell(target,null,null,L("<S-NAME> <S-IS-... |
c0063d83-261c-4e1a-b28f-62128c1fa2d0 | 1 | public AnnotationVisitor visitAnnotation(final String desc,
final boolean visible) {
cp.newUTF8(desc);
if (visible) {
cp.newUTF8("RuntimeVisibleAnnotations");
} else {
cp.newUTF8("RuntimeInvisibleAnnotations");
}
return new AnnotationConstantsCollector(cv.visitAnnotation(desc,
visible), cp);
} |
729852c3-3868-486a-ab23-8e082bfe0203 | 1 | public static void main(String args[]) throws FileNotFoundException
{
BankComputer firstBank = new BankComputer("A");
BankComputer secondBank = new BankComputer("B");
initializeBanksAndATMs(firstBank, secondBank);
String choice = "";
Scanner in = new Scanner(System.in);
while(!cho... |
ab4ecc78-6c42-4f92-bf02-0cd081415f36 | 2 | public ArrayList<String> find_baseNumOfCowork(){
HashMap<String, String[]> coauthorSet = DataLoad.loadCoauthor();
Collection<String> collection = coauthorSet.keySet();
Iterator<String> iter = collection.iterator();
while(iter.hasNext()){
person = iter.next();
temp = coauthorSet.get(person);
if(temp.len... |
9f8ae7cf-6b46-42a2-bf0e-bc6ad3dea09d | 1 | private List<String> getScores() {
List<Integer> scoresInInteger = prefs.getScores();
List<String> scores = new ArrayList<String>();
for (Integer aScoreInInteger : scoresInInteger) {
scores.add(aScoreInInteger.toString());
}
return scores;
} |
1758c9dd-1fc4-4445-808e-80bb471d3711 | 3 | private void showMatrix(AffineTransform at) {
double[] matrix = new double[6];
at.getMatrix(matrix); // { m00 m10 m01 m11 m02 m12 }
int[] loRow = {0, 0, 1};
for (int i = 0; i < 2; i++) {
System.out.print("[ ");
for (int j = i; j < matrix.length; j += 2) {
... |
cfaaa58e-4b57-4ade-a9f8-7e7f3a57eb4a | 3 | private boolean jj_3R_24() {
if (jj_scan_token(TYPE)) return true;
if (jj_3R_72()) return true;
if (jj_scan_token(IS)) return true;
return false;
} |
8418f1d5-4a8e-4f2c-94d6-fb215f37126e | 7 | private synchronized static int allocateColix(int argb) {
// double-check to make sure that someone else did not allocate
// something of the same color while we were waiting for the lock
if ((argb & 0xFF000000) != 0xFF000000)
throw new IndexOutOfBoundsException();
for (int i = colixMax; --i >= Graphics3D.SP... |
30032167-1de8-4f37-a129-ad0277e4e13f | 8 | public void setCam(int xCam, int yCam)
{
xCam /= distance;
yCam /= distance;
int xCamD = this.xCam - xCam;
int yCamD = this.yCam - yCam;
this.xCam = xCam;
this.yCam = yCam;
g.setComposite(AlphaComposite.Src);
g.copyArea(0, 0, width, height, xCamD, yCa... |
6c8f99f5-2328-4d98-9188-1ab6bd78c382 | 7 | public int shallOverwriteFile(File file) {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
while (true) {
try {
sysOut.println(bundle.getString("overwrite_help"));
sysOut.print(bundle.getString("overwrite_this_file") + " " + file.getC... |
f1be191c-9c5e-4263-90e3-ec29b731ca4a | 2 | public void hurt(Level level, int x, int y, Mob source, int dmg, int attackDir) {
int damage = level.getData(x, y) + dmg;
level.add(new SmashParticle(x * 16 + 8, y * 16 + 8));
// level.add(new TextParticle("" + dmg, x * 16 + 8, y * 16 + 8, Color.get(-1, 500, 500, 500)));
if (damage >= 10) {
int count = random... |
b50a8926-c79a-4b36-827f-62bef15ec2dc | 9 | public static int rotatedSearch(int[] values, int start, int end,
int x)
{
if (values[start] == x) {
return start;
}
else if (values[end] == x) {
return end;
}
else if (end - start == 1) {
return -1;
}
int middle = (start + end) / 2;
... |
78e20d52-1c54-411c-96aa-9799f217a527 | 0 | private void jButtonValiderActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonValiderActionPerformed
//Récupération de la méthode controleur 'valider'
this.ctrl.valider();
}//GEN-LAST:event_jButtonValiderActionPerformed |
9f34aa52-2f62-42c8-a477-01adee86e1eb | 2 | public void stop() {
this.stop = true;
if (this.thread != null && this.thread.isAlive()) {
this.thread.interrupt();
}
this.thread = null;
} |
21d4953e-0bd1-4cb5-adb8-2bd52c8b4761 | 7 | 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 StringBuffer();
for (;;) {
if (c == '<' || c == 0) {
... |
faf04c62-5590-405d-9208-f9ecf2e40452 | 1 | private void jjAddStates(int start, int end)
{
do {
jjstateSet[jjnewStateCnt++] = jjnextStates[start];
} while (start++ != end);
} |
ed6a5540-6c5c-4ffc-a49a-ecfe7a8dd28f | 5 | private void createEvents() {
btnChords.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
switchToChords();
}
});
btnLyrics.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
switchToLyrics();
}
});
btnSave.addAction... |
fcc4b952-6d54-4f07-bd6f-32769abeb083 | 4 | private static void add_Enemy_Launcher(War war) {
EnemyLauncher launcher = null;
Queue<EnemyLauncher> launchers = war.getLaunchers();
while (true) {
launchers = war.getLaunchers();
launcher = null;
System.out.println("Enter new Launcher ID: ");
String id = scanner.next();
for (EnemyLauncher l : lau... |
529a0073-4634-4765-a019-89b1286b98ff | 4 | private void JBEditarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JBEditarActionPerformed
this.zerarModelo();
int codigo;
try{
int index = JTListaPaciente.getSelectedRow();
if(index >= 0){
codigo = (int) JTListaPaciente.getValue... |
18241605-874b-4ce2-b498-22c1a938c44c | 5 | public Link(int _x, int _y){
x=_x;
y=_y;
direction='d';
attackTimer = 0;
tick=0;
Lhp=10;
currframe=0;
maxframe=1;
damage = 10;
up=new BufferedImage[2];
down=new BufferedImage[2];
left=new BufferedImage[2];
right=new BufferedImage[2];
heroCash=0;
//setHasKey(false);
setHasSword(false);
stab=new Buffered... |
f6b1ca10-67d2-4316-b608-2f9bff4b9f0f | 6 | @Override
public void run() {
options.isSmithing = false;
if (ctx.skillingInterface.opened() && ctx.skillingInterface.close()) {
return;
}
//ArtisanArmourer.setStatus("Search for chute");
// Deposit current
for (GameObject chute : ctx.objects.select().id(ID_CHUTE).nearest().first()) {
if (ctx.came... |
9cc4f761-06e0-4c84-b276-ddee939d75fb | 3 | private void zigzagTravel(TreeNode node, List<List<Integer>> result, boolean isLeft, int level){
if(level == result.size()){
result.add(new ArrayList<Integer>());
}
TreeNode left = node.left;
TreeNode right = node.right;
List<Integer> list = result.get(level);
addToList... |
ed808ed3-46d0-47d1-acd2-c5f6cc4244d4 | 7 | private void processRectangle(RdpPacket_Localised data,
RectangleOrder rect, int present, boolean delta) {
if ((present & 0x01) != 0)
rect.setX(setCoordinate(data, rect.getX(), delta));
if ((present & 0x02) != 0)
rect.setY(setCoordinate(data, rect.getY(), delta));
if ((present & 0x04) != 0)
rect.setCX... |
04892175-ec44-4e0b-acb1-197a6f92a408 | 5 | public void setCurrentView(Object viewName) throws NoSuchElementException {
// Make sure we have the view.
if (!views.containsKey(viewName)) {
// Let the developer know that we don't.
throw new NoSuchElementException("There is no view by the name: "
+ viewName);
}
// Are they the same?
boolean sam... |
3b377ee0-bdbe-4b6e-b083-9b8bd2ab0085 | 8 | public List<Integer> getTrainImgIds(
HashMap<Integer, RawImageInstance> rawInstance, int zeroImageSize,
int oneImageSize) {
if (trainImgIds == null) {
// shuffle
ArrayList<Integer> allIds = new ArrayList<Integer>(
rawInstance.keySet());
Collections.shuffle(allIds, new Random(System.currentTimeMill... |
b038c8e2-294f-41c1-8b40-b8b61b50bfe0 | 1 | public void done()
{
if(!moving)
{
Game.paths.clearPaths();
done = true;
moved = true;
pX = x;
pY = y;
listButtons(false);
Game.gui.unitUpdate(this);
}
} |
299926bc-858a-4289-840e-501f6783905b | 6 | protected synchronized void notifyModificationToClients(String targetFileName, RemoteControllerInterface exceptedController) {
if (storedDocuments.containsKey(targetFileName)) {
for (RemoteControllerInterface controller : readers.get(targetFileName)) {
if (controller != exceptedContr... |
3e18668a-ea63-4162-8ccf-ec78594f8247 | 0 | public String getTarget() {
return target;
} |
1303eeb6-84c1-4096-8776-2aab0cee3c26 | 4 | @Override
public void reduce(String key, Iterable<String> values, Context context) {
int num = 0;
for(String value:values){
num += Integer.parseInt(value);
}
if(DEBUG && debugCount == 50) {
try {
//50 ms delay for every 50 reductions
Thread.sleep(50);
... |
0a80cf67-84c9-4958-b89a-b6adec2eee97 | 4 | public Chunk loadChunk(World var1, int var2, int var3) throws IOException {
DataInputStream var4 = RegionFileCache.getChunkInputStream(this.worldDir, var2, var3);
if(var4 != null) {
NBTTagCompound var5 = CompressedStreamTools.func_1141_a(var4);
if(!var5.hasKey("Level")) {
Syste... |
c9ee27e3-5a94-4db5-8e9f-a040debccd0e | 4 | public short open_device()
{
// Check if the connection is established
if (connection == null)
{
MsgDumperCmnDef.WriteErrorFormatSyslog(__FILE__(), __LINE__(), "Thread[%s]=> The connection is NOT established", facility_name);
return MsgDumperCmnDef.MSG_DUMPER_FAILURE_MYSQL;
}
if (!table_created)
{
//... |
70b94508-f188-4dfb-a842-33ce1d552efe | 2 | private void renderNodes() {
for (int i = 0; i < width; i++) {
for (int j = 0; j < height; j++) {
gc.add(new GImage("blank.png", (i*2+1)*IMG_SIZE, (j*2+1)*IMG_SIZE));
}
}
} |
a2b83122-2660-4c1f-8b58-8c46dc7b662b | 4 | * @return The element being removed or null if no such element is in the list.
*/
public E remove(E e) {
Node<E> curr = head;
E temp;
if (head == null) {
return null;
}
//Because we only have a next pointer and we must fix the pointers to remove the desired ... |
99dbde42-f009-4dd5-82c4-ea58886212fa | 4 | public T newProjectile(actor.Actor ship){
T projectile = null;
try {
projectile = getCtor().newInstance(ship);
} catch (IllegalArgumentException e) {
e.printStackTrace();
} catch (InstantiationException e) {
e.printStackTrace();
} catch (Illega... |
468458f4-b625-40a8-b3d8-3b88363847cb | 1 | public static BufferedImage loadImage(String s) {
BufferedImage img = null;
try {
img = ImageIO.read(new File(s));
} catch(IOException e) {
e.printStackTrace();
}
return img;
} |
53d53937-c024-4cea-9e87-0bb174236e02 | 8 | private void despatchMessage(final LegacyOCPMessage message)
throws LinkMessageException {
OCPMessageHandler handler = null;
if (message instanceof LinkMessage) {
// Link message, handle it internally
handleMessage(message);
} else if (message instanceof Call... |
4d43166a-d7bf-4cd4-bb69-92122f7cb583 | 7 | public static void startClientThreads(String[] hosts, String command, boolean isLogTest) {
//put ClientThreads in an arrayList for easier management
ArrayList<LoggingClientThread> lct = new ArrayList<LoggingClientThread>();
String tempCommand = command;
//start each client thread and wait for
//them to finish... |
6f376deb-bf80-495f-8571-16c249ba8d39 | 6 | public boolean attackEntityFrom(DamageSource par1DamageSource, int par2)
{
if (!this.worldObj.isRemote && !this.isDead)
{
this.setForwardDirection(-this.getForwardDirection());
this.setTimeSinceHit(10);
this.setDamageTaken(this.getDamageTaken() + par2 * 10);
... |
50a48d06-eeb6-4e33-8963-e16cc4a714a6 | 3 | public static void runwpfile(String filename)
{
System.out.println(filename);
StringBuilder sb = new StringBuilder();
File file = new File(filename);
String res=null;
try {
FileInputStream fis=new FileInputStream(file);
int c;
while((c = fis.read())>=0)
{
sb.append((char)c);
}
res = ... |
e6ca597f-83f3-4a6c-b38c-411de406064c | 1 | synchronized public static org.omg.CORBA.TypeCode type ()
{
if (__typeCode == null)
{
__typeCode = org.omg.CORBA.ORB.init ().create_string_tc (0);
__typeCode = org.omg.CORBA.ORB.init ().create_sequence_tc (0, __typeCode);
__typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (pgrid.service.... |
6102004f-627d-4a8c-92ed-c4dbf25e1d94 | 7 | private static String getTarget(String s) {
boolean onMod = s.toUpperCase().contains(" ON ");
boolean withMod = s.toUpperCase().contains(" WITH ");
if (!(onMod || withMod)) {
return "";
}
if (s.toUpperCase().split(" ON ").length > 1) {
s = s.toUpp... |
4cd74ead-d007-4ea6-bbb6-f8e0fe46fb49 | 6 | final private void handleMergeException(Throwable t, MergePolicy.OneMerge merge) throws IOException {
if (infoStream != null) {
message("handleMergeException: merge=" + merge.segString(directory) + " exc=" + t);
}
// Set the exception on the merge, so if
// optimize() is waiting on us it sees th... |
50640932-5e68-4b43-920f-fe003a55741c | 1 | public boolean save() {
try {
this.config.save(configFile);
} catch (Exception e) {}
return true;
} |
6d08d872-3343-4a1e-8e95-6783a8e8461b | 2 | public int bitSize() {
return (this.sort == LONG) || (this.sort == DOUBLE) ? 2 : 1;
} |
024a4be0-ba85-4040-bd8e-5715d5a88cd6 | 2 | private short makeChecksum(Object d) {
short checksum = 0;
String data = d.toString();
byte[] dataBytes = data.getBytes();
for (int i = 0; i < dataBytes.length; i++) {
checksum += (short) dataBytes[i];
}
while ( checksum / 0xff != 0) {
checksum = (short) (checksum & 0xff + checksum >> 8);
}
che... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.