method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
2ddc470e-8a7c-4de8-86e5-197176d4374c | 6 | private void listSubjectMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_listSubjectMouseClicked
//disable all text fields
dateTextField.setEditable(false);
toTextField.setEditable(false);
fromTextField.setEditable(false);
subjectTextField.setEditable(false);
... |
f0da809e-d3f8-4450-ac3c-107ae931b6b6 | 7 | protected String getRedoText() {
if (!canRedo()) {
return "Cannot redo.";
}
int i = insertionPoint;
if ((i < maxInsertionPoint) && (edits.get(i).isSignificant())) {
String description = edits.get(i).describeRedo();
if (!description.equals("redo")) {
... |
219cce29-7b70-401c-8f7e-4e13968c7445 | 8 | public boolean attributesMatched(String uri, String localName, String name,
Attributes atts) {
if ((atts == null || atts.getLength() == 0)
&& (parsedAttributeName == null || parsedAttributeName
.isEmpty())) {
return true;
}
if (atts == null) {
return false;
}
if ((atts.getLength() > 0 && pa... |
ac46249d-b4fc-42e3-a0c0-842e598d5133 | 2 | @Test
public void testStartPosition() {
System.out.println("testStartPosition");
Tile[][] MapTemplate = new Tile[5][5];
for (int j = 0; j < 5; j++) {
for (int k = 0; k < 5; k++) {
MapTemplate[j][k] = new Tile('W');
}
}
map.MapArray=MapTemplate;
MapTemplate[2][2].setType('G');
... |
48c7c422-7d5f-4c94-aaff-3e39ca0a59ef | 5 | @FXML
private void seidelResultClick(MouseEvent me) {
int curMethod = 2;
if (me.getButton().equals(MouseButton.PRIMARY)) {
if (coef == null || free == null || results[curMethod] == null) {
return;
}
if (curMode[curMethod]) {
curMode[curMethod] = false;
seidelResult.setText(VECTOR + results[cur... |
f47909b5-8a9f-4bde-b5e1-829f9abda841 | 0 | public RegularToAutomatonTransitionTool(AutomatonPane view,
AutomatonDrawer drawer, REToFSAController controller) {
super(view, drawer);
this.controller = controller;
} |
6a7be0de-cf95-45ac-88a0-4d46bd13f4c4 | 5 | @Test(expected=BadPostfixException.class)
public void evaluatePostfix4() throws DAIndexOutOfBoundsException, DAIllegalArgumentException, NumberFormatException, NotEnoughOperandsException, BadPostfixException
{
try
{
postfix.addLast("5");
String result = calc.evaluatePostfix(postfix);
}
catch (... |
6ef005ae-fafa-4c61-905d-5a0f91bb178f | 3 | private void play() {
int counter = 0;
passCards();
System.out.println("Trump: " + pack.getTrump() + ";");
while (!isGameEnded()) {
System.out.println("Pack: " + pack.getCardAmount());
System.out.print(currentPlayer.getName() + ": ");
currentPlayer.... |
2dc8106b-9201-4970-ac06-243f2bf03736 | 4 | public boolean addSong(String email, Song song) {
String id = "song" + getSongs().size() + 1;
Song newSong = new Song(id, song.getTitle(), song.getLyrics(),
song.getSpeed());
if (!song.getArtists().isEmpty()) {
for (Artist a : song.getArtists()) {
newSong.addArtist(createArtist(a.getName()));
}
}... |
787c1067-c19a-420b-b91e-d46bdd41375d | 3 | static void checkUnqualifiedName(int version, final String name,
final String msg) {
if ((version & 0xFFFF) < Opcodes.V1_5) {
checkIdentifier(name, msg);
} else {
for (int i = 0; i < name.length(); ++i) {
if (".;[/".indexOf(name.charAt(i)) != -1) {
throw new IllegalArgumentException("Invalid " + m... |
19757978-ba3b-4a31-a7f2-da08c37ff84d | 0 | public String getPeerUsername()
{
return target.getUsername();
} |
9ca3a639-07b6-4976-a621-178dfe91e6ad | 4 | public void setFaceDir(double faceDir) {
if (faceDir > 359) {
while (faceDir > 359) {
faceDir = faceDir - 360;
}
}
if (faceDir < 0) {
while (faceDir < 0) {
faceDir = faceDir + 360;
}
}
this.faceDir = ... |
2068432e-4f14-4025-89f0-a1f914179fd9 | 3 | * @return Returns true if the given cell is locked.
*/
public boolean isCellLocked(Object cell)
{
mxGeometry geometry = model.getGeometry(cell);
return isCellsLocked()
|| (geometry != null && model.isVertex(cell) && geometry
.isRelative());
} |
feaed914-01bd-4bbd-8b1d-a4e0a14f970b | 9 | public ArrayList<Integer> obtenerJugadasGanadorasDeHoy(ArrayList<Integer> boletosDeHoy, ArrayList<Integer> numerosGanadores, int loteria_id){
Verificadora verificadora = new Verificadora();
Connection cn = conexion.Conectar();
PreparedStatement pst;
ResultSet rs;
String query;
... |
29736622-c410-4a4b-929e-5daefb9f4672 | 5 | @Override
public void setCell(int x, int y, boolean live) {
if (y<0 || y>=getHeight()) return;
if (x<0 || x>=getWidth()) return;
if (live)
world[y][x] = 0;
} |
206013f9-6560-47df-a4cf-6dbc20818be8 | 6 | public boolean collision(double d, boolean isDy) {
int tileX;
int tileY;
if (isDy) {
tileX = (int) (v.getX()) >> 5;
tileY = (int) (v.getY() + d) >> 5;
} else {
tileX = (int) (v.getX() + d) >> 5;
tileY = (int) (v.getY()) >> 5;
}
... |
b530998b-7ca6-4b88-9f04-95b723bc9a61 | 9 | @Override
public CPUStatus getCPUStatus() throws RemoteException {
try
{
/* establish a Session */
establishSession();
int RunningNum = 0;
int BlockingNum = 0;
int InterruptNum = 0;
int ContextSwitchNum = 0;
float UserPercent = 0;
float SystemPercent = 0;
float IdlePercent = 0;
fl... |
4d9c99fb-3edc-4159-8118-7ab65e88272b | 0 | public DumpCommand(TotalPermissions p) {
plugin = p;
} |
6a9e6716-b8a7-47cc-b866-06cca02c2f40 | 9 | private Boolean isPartOfTernaire ( MCDLien mcdLien ) {
// la cardinalité est 1,1 sur ce lien
Boolean ternaire = false ;
MCDAssociation association = ( MCDAssociation ) mcdLien.getElement ( Constantes.MCDENTITE1 ) ;
MCDLien entiteLink = null, ws_lien = null ;
String v0_name, v1_name, entite0_name =... |
bba2fa1f-218b-4c0f-8fec-04898e90cb10 | 9 | public void set(Protocol con, Component widget, JSONObject obj, Map styleMap) throws JSONException {
if (obj.has("item")) {
JSONArray array = obj.getJSONArray("item");
for (int j = 0; j < array.length(); j++) {
JSONObject itemObj = array.getJSONObject(j);
... |
d642d2c5-9de7-4a76-8f67-6a17cb933848 | 3 | public int indexOf(final AbstractInsnNode insn) {
if (check && !contains(insn)) {
throw new IllegalArgumentException();
}
if (cache == null) {
cache = toArray();
}
return insn.index;
} |
e2292c38-e9fa-4d0e-9d49-8c962eb50590 | 4 | @Override
protected void paintComponent(Graphics g)
{
super.paintComponent(g);
Graphics2D g2d = (Graphics2D) g;
g2d.setColor(Color.BLACK);
g2d.setFont(font);
g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
int width = g.getFontMetrics().charWidth('a');... |
382cc68b-9be7-4fd9-bd43-f7ea65b52b9c | 7 | @Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
try {
if (sender instanceof Player) {
Player player = (Player)sender;
int rank = 1;
try {
rank = HyperPVP.getStorage().readInt32("SELECT rank FROM users WHERE username = '" + player.ge... |
7cff4eab-e12a-48ab-a194-b90c64772826 | 2 | private PrintWriter fluxSortant() {
if (emetteur != null) {
try {
return new PrintWriter(emetteur.getOutputStream());
} catch (IOException e) {
System.out
.println("Problème de récupération du flux sortant sur le client.");
}
}
return null;
} |
96ba01b7-9783-4cae-9a6a-2d527872c3ec | 2 | public void render(Screen screen) {
if (time >= lifeTime - 6 * 20) {
if (time / 6 % 2 == 0) return;
}
int xt = 8;
int yt = 13;
// screen.render(x - 4, y - 4 - 2, xt + yt * 32, Color.get(-1, 555, 555, 555), random.nextInt(4));
// screen.render(x - 4, y - 4 + 2, xt + yt * 32, Color.get(-1, 000, 000, 000), ... |
679dd984-ffbf-4830-af98-839a87f8de4a | 7 | private JPanel createJvmPanel() {
JPanel total = new JPanel(new BorderLayout());
total.setBorder(BorderFactory.createEmptyBorder(8, 8, 8, 8));
JPanel panel = new JPanel(new BorderLayout());
total.add(panel, BorderLayout.CENTER);
DefaultTableModel tableModel = new DefaultTableModel() {
public boolean isC... |
711a31c3-318e-49bc-b214-89393b6116e2 | 0 | public float getFOV() {
return cam.getFOV();
} |
dba2b8ba-a1cc-42cc-a030-d2aece6d6d6c | 3 | public JSONArray toJSONArray(JSONArray names) throws JSONException {
if (names == null || names.length() == 0) {
return null;
}
JSONArray ja = new JSONArray();
for (int i = 0; i < names.length(); i += 1) {
ja.put(this.opt(names.getString(i)));
}
re... |
24910a1a-6b92-4920-8ed2-97a0da8c619a | 0 | public int getCurrentBits() {
return currentBits;
} |
11166660-ba86-49f6-b9af-7cf2fcda37cf | 4 | public void recursivePrint(TreeNode root, int parentPosition, Node innerNode, Node p, int i) {
Node innerParent;
int position;
if (root != null) {
int height = heightRootToNode(root);
int nextTop = getRectNextTop(height);
if (innerNode != null)
... |
bdaf7d36-7906-44e0-82df-6ae180858302 | 7 | private static String htmlFilter(String message){
if(message == null) return null;
int len = message.length();
StringBuffer result = new StringBuffer(len + 20);
char aChar;
for(int i =0; i< len; i++){
aChar = message.charAt(i);
switch (aChar) {
case '<': result.append("<"); break;
... |
f99b3212-6af4-467f-b7ef-a2b4b9c45a9c | 8 | public String CalcMAC(byte strInput[]) {
int i, ii;
int lenInput;
byte newMAC[] = new byte[16];
byte tempmac[] = new byte[8];
byte strMAC[] = new byte[8];
byte tempstr3[] = new byte[8];
int j, k;
byte temp1[] = new byte[1], temp2[] = new byte[1];
lenInput = strInput.length;
i = lenInput % 8;
if(i... |
6d63b7eb-4d15-40d0-81e2-607302dadc0e | 8 | public int compare(String o1, String o2)
{
String s1 = (String)o1;
String s2 = (String)o2;
int thisMarker = 0;
int thatMarker = 0;
int s1Length = s1.length();
int s2Length = s2.length();
while (thisMarker < s1Length && thatMarker < s2Length)
{
... |
0af2d42a-d677-4151-ac59-ea7abe0fc544 | 5 | public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page ... |
11a927f3-61e5-4015-8d0a-2fba441fd661 | 7 | public CheckResultMessage checkTotal1(int i) {
int r1 = get(2, 2);
int c1 = get(3, 2);
int r2 = get(4, 2);
BigDecimal sum = new BigDecimal(0);
if (checkVersion(file).equals("2003")) {
try {
in = new FileInputStream(file);
hWorkbook = new HSSFWorkbook(in);
for (int j = 1; j < r2 - r1; j++) {
... |
533a1b2b-9eb9-4262-825a-20573c744062 | 8 | private void getReminderDateTime(String command, TaskData t) {
Object obj = reminderParser.parse(command);
if (obj == null) {
reminderDateTime = null;
reminderMinutes = null;
} else if (obj instanceof LocalDateTime) {
reminderDateTime = (LocalDateTime) obj;
} else if (obj instanceof Integer) {
remin... |
05a0c4c1-c415-4227-8fd5-392cc0c401c1 | 1 | @Test
public void testCreatingAddressBookWithNullLabelShouldFail() {
try {
new Book(null);
fail("Was expecting an Exception when no label is provided.");
} catch (IllegalArgumentException iae) {
Assert.assertEquals("Please provide a value for Label as it is a non-nullable field.", iae.getMessage());
}
... |
75474d73-7640-44ee-b78e-18c8d6968cb6 | 2 | public String toString() {
StringBuilder bookString = new StringBuilder();
Iterator<String> it = keywords.iterator();
bookString.append("-Book- \n").append("author: ").append(author).append('\n');
bookString.append("# pages: ").append(pageNum).append('\n');
bookString.append("... |
20007645-1434-435d-9394-fb1f97e7a0b3 | 6 | public static Object sub(Object o1, Object o2){
if (o1 instanceof List){
List newList = new ArrayList((List)o1);
if (o2 instanceof List){
newList.removeAll((List)o2);
} else {
newList.remove(o2);
}
return newList;
}
if (o1 instanceof String || o2 instanceof String){
return o1;
} ... |
007772fc-2776-4ae7-86ba-c83f4c9006b0 | 2 | private PathSet lookupPaths(Class<?> clazz) {
PathSet paths = pathMap.get(clazz);
if (paths == null) {
paths = new PathSet(clazz);
pathMap.put(clazz, paths);
}
return paths;
} |
0b34194f-bf62-45c4-922f-83380713b12c | 2 | public static final int typeIndex(Class type) {
Class[] list = primitiveTypes;
int n = list.length;
for (int i = 0; i < n; i++)
if (list[i] == type)
return i;
throw new RuntimeException("bad type:" + type.getName());
} |
d64330d4-e1a9-4ab3-bffd-dab185a7e08a | 3 | public boolean contains(double posX, double posY)
{
return (posX >= (x - 5) && posX <= (x + width + 5) && posY >= (y - 5) && posY <= (y + height + 5));
} |
548557f8-232f-42df-b5f5-1c98d9734631 | 1 | public void dumpInstruction(TabbedPrintWriter writer)
throws java.io.IOException {
writer.println("break" + (label == null ? "" : " " + label) + ";");
} |
ebe2f7a9-28f2-43d3-bfdc-d0a5ba870f04 | 0 | public void setjButtonClose(JButton jButtonClose) {
this.jButtonClose = jButtonClose;
} |
c0df2fdb-b912-4c89-b777-6a445546a9d2 | 0 | private int readComplexValue
(ResTable_Map map,
byte[] remainingData,
int offset) throws IOException {
map.name = readUInt32(remainingData, offset);
offset += 4;
return readValue(map.value, remainingData, offset);
} |
859808e6-05ad-41a0-9f79-0ab1576cb904 | 9 | static ArrayList<Pair> surround(Pair start) {
// System.out.printf("start is (%d, %d)", start.x, start.y);
ArrayList<Pair> prlist = new ArrayList<Pair>();
for (int i=0; i<4; i++) {
Pair tmp0 = new Pair(start);
Pair tmp;
if (i==0) {
if (start.x>0) {
tmp = new Pair(tmp0.x-1,t... |
9dbddc1a-cd1e-4cc2-af8f-357a227eb5df | 8 | public static void main(String[] args) {
//TODO Make tests have less ugly code
GameWindow window = new GameWindow();
panel = new RenderPanel() {
long lastRender = 0, lastSec = 0;
int tickCount = 0, tickSec = 0, renderSec = 0, currTick = 0,
currRender = 0;
public void onTick() {
tickCount+... |
813a9707-8d34-4ea8-a41a-8f4fe363dbcc | 0 | public ParagraphInputDialog(String paragraph)
{
super();
setTitle("Podaj opis");
setSize(794,458);
getContentPane().setLayout(null);
textArea = new JTextArea();
textArea.setText(paragraph);
textArea.setBounds(20,20,740,500);
scrollPane = new JScrollPane(textArea);
scrollPane.setBounds(20,20,740... |
6175e372-bedb-43d6-940e-1767f7f9bdbd | 8 | public String getDisplayValue() {
StringBuilder buf = new StringBuilder();
appendValue(buf, value);
appendValue(buf, adr1);
appendValue(buf, adr2);
appendValue(buf, adr3);
appendValue(buf, (city != null ? city : "")+(city != null && stae != null ? ", " : "")+(stae != null ? stae : ""... |
449f34c7-3133-481b-9eb1-d37750b48bc6 | 7 | public static int[] convertBase(int[] digits, int baseA, int baseB, int precisionB) {
//check for bad input
if(baseA < 2 || baseB < 2 || precisionB <1)
return null;
for(int i=0; i<precisionB ; i++){
if(digits[i] < 0 || digits[i] >= baseA)
return null;
}
... |
d1ab003a-53b3-457d-b987-abeb39e49160 | 4 | public boolean checkForHorizontalStrike(String input) {
for (int i = 0; i < boardSize; i++) {
int count = 0;
for (int j = 0; j < boardSize; j++, count++) {
if (boardArray[i][j].equalsIgnoreCase(input)) {
continue;
}
brea... |
69973343-0b01-4aea-a0d4-f73d6718edfd | 8 | public DbTable LoadTableContent(DbTable table) {
//Baseline table contents
for(int i =0; i<100; i++)
{
record = new DbTableRecord();
//Primary key
StringBuffer primaryKeyValue = new StringBuffer();
for(String pk:table.get_tableDefinition().getPkColumns())
{
primaryKeyValue = primaryKe... |
30a9571d-98f1-41b4-8116-7cecf233ed26 | 8 | private boolean check() {
if (N == 0) {
if (first != null) return false;
}
else if (N == 1) {
if (first == null) return false;
if (first.next != null) return false;
}
else {
if (first.next == null) return false;
}
... |
025e033a-aa69-4a12-8429-7abf5c3a095b | 7 | @Override
public int compare(Object o1, Object o2)
{
if ((o1.getClass() != Vertex.class && o1.getClass() != Point.class) ||
(o2.getClass() != Vertex.class && o2.getClass() != Point.class))
return 0;
Vertex v1 = (Vertex)o1;
Vertex v2 = (Vertex)o2;
if (v1.X(... |
1a2742ac-18ca-42a2-bde0-160529153053 | 8 | public void inferYBoundsFromSeries() {
if (seriesElements.size()==0) {
axes.setDataBounds(0, 1, 0, 1);
}
else {
double ymin = seriesElements.get(0).getMinY();
if (ymin > 0)
ymin = 0;
double ymax = seriesElements.get(0).getMaxY();
for(int i=1; i<seriesElements.size(); i++) {
double ... |
c8129f8a-8e23-4b25-9397-f08d76f9419b | 6 | private String getCountersLink(String taskDetailsJsp, boolean isMapper) {
Document mapDetails = HtmlFetcher.getHtml(taskDetailsJsp);
Element tr = null;
if(useHistory) {
tr = mapDetails.getElementsByTag("tbody").first().child(1);
}
else {
for(Element elem : mapDetails.getElementsByTag("tbody").fir... |
01b7d03b-f9cb-4a2f-9fa5-342970bb4516 | 1 | private static int sumOfSquares(int n) {
if (n <= 0) {
return n;
} else {
return (n * n + sumOfSquares(n - 1));
}
} |
fc99498e-c66b-43d9-990e-20fb5ac59a20 | 3 | @Override
public boolean removeAllUsers() {
FileWriter writer = null;
try {
writer = new FileWriter(OnlineUsers.directory+OnlineUsers.flatfileData);
writer.write("");
} catch (Exception e1) {
log.log(Level.SEVERE, "Exception setting all offline from " + OnlineUsers.directory+OnlineUsers.flatfileData, e1... |
973bc3ef-36f3-4d71-8ad5-aa6eec806f97 | 7 | public Color getColor(int x){
switch(x){
case 1: BlockColor = Color.BLACK;
break;
case 2: BlockColor = Color.GREEN;
break;
case 3: BlockColor = Color.BLUE;
break;
case 4: BlockColor = Color.ORANGE;
break;
case 5: BlockColor = Color.MAGENTA;
break;
case 6: BlockColor = Color.BLUE;
... |
0ca5ffff-4b49-4312-a632-487dc9961452 | 8 | public static double countRuns(Board b)
{
int run = 0;
//LEFT/RIGHT
for (int i = 0; i < 4; i++){
for (int j = 0; j < 3; j++){
if (nextNum(b.boardState[i][j], b.boardState[i][j+1])){
run++;
}
if (nextNum(b.boardState[i][j+1], b.boardState[i][j])){
run++;
}
}
}
//UP/DOWN
for... |
d46f9dc5-dc94-4861-8961-4b5b32cac90c | 0 | private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
nuevo.setVisible(false);
}//GEN-LAST:event_jButton3ActionPerformed |
0e2bcedc-8213-4b51-a628-56af8d3e8ca4 | 6 | private static void mousePressed(Point pressedMousePosition) {
Point eventPosition = Camera.untranslatePoint(pressedMousePosition);
Model pressed = OurWorld.getModel(eventPosition);
if (!rollPlate.contains(new Point(Mouse.getX(), Display.getHeight() - Mouse.getY()))) {
if (pressed!=null ... |
af2c37b9-bdaf-4aac-9a3c-7db4339393a8 | 1 | public Effect getFirstEffectOnPosition(Position position) {
List<Effect> effectsOnPosition = getEffectsOnPosition(position);
if (!effectsOnPosition.isEmpty())
return getEffectsOnPosition(position).get(0);
return null;
} |
b1c50b8b-dfc9-4b1d-b2d6-c4335cfdcac7 | 7 | public boolean getCanSpawnHere()
{
if (this.worldObj.rand.nextInt(3) == 0)
{
return false;
}
else
{
if (this.worldObj.checkIfAABBIsClear(this.boundingBox) && this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).size() == 0 && !this.worldObj.... |
c65dc78a-441e-4ec2-a5ea-e8f516b481b4 | 5 | @Override
public void keyReleased(KeyEvent e)
{
// TODO Auto-generated method stub
switch (e.getKeyCode())
{
case KeyEvent.VK_DOWN:
{
downPressed=false;
}
break;
case KeyEvent.VK_UP:
{
upPressed=false;
}
break;
case KeyEvent.VK_RIGHT:
{
rightPressed=false;... |
bba6030d-00ef-417c-9d4d-2ad2c28b78c5 | 3 | public String toString()
{
String plateauAsciiArt = " 0 1 2 3 4 5 6 7 \n";
for (int numeroDeLigne = 0; numeroDeLigne < NOMBRE_DE_LIGNES; numeroDeLigne++)
{
plateauAsciiArt += numeroDeLigne + " ";
for (int numeroDeColonne = 0; numeroDeColonne < NOMBRE_DE_COLONNES; numeroDeColonne++)
{
if (this.cas... |
94864b5e-a1f9-4b17-826e-1284cd3ca104 | 4 | public VariableTable registerVarDecl(DeclResult type, ArrayList<String> varList) {
VariableTable vTable = new VariableTable();
switch (type.getType()) {
case VAR:
for (String identi : varList) {
vTable.registerVar(identi);
}
break;
case ARRAY:
for (String identi : varList) {
vTable.registerA... |
9a7146c1-4ddb-4d9a-b8a7-d700a2315efb | 1 | public ResultSet getAllComponentOfType(String category, int processorType){
ResultSet res = null;
try{
String query = "Select componentId as 'Id', componentDescription as 'Component', componentPrice as 'Price',"+
" componentCategoryName as 'Device', componentBrandName as 'Brand' from components" +
... |
1605e364-c4f8-4ff5-acb4-1436401ff160 | 2 | public void setNametextZoomedFont(String font) {
if ((font == null) || font.equals("")) {
this.nametextZoomedFont = UIFontInits.NAMEZOOMED.getFont();
} else {
this.nametextZoomedFont = font;
}
somethingChanged();
} |
d25f44c6-0140-4081-ac93-4d726bc89f1d | 9 | public void tick(long c64Cycles) {
while (cycles < c64Cycles) {
// Run one instruction! - with special overflow "patch" -
// Always fake 'byte ready' for fast read!
// boolean o = overflow;
if (byteReady && chips.byteReadyOverflow) {
// Set overflow and clear byte ready!
overflo... |
687e911c-fd59-426b-bf44-5f266e7a22f4 | 7 | public void testExhaustive(){
Random r= new Random();
int trials = 1000;
for(int i = 0; i < trials; i++)
{
int c1 = r.nextInt(10), r1= r.nextInt(10);
int c2 = r.nextInt(10), r2 = r.nextInt(10);
Matrix m1 = new Matrix(r1,c1);
Matrix m2 = new Matrix(r2,c2);
//Test multiplication bound... |
95cb8ee6-90bd-421a-a287-b197db4232c3 | 1 | public static GameData load(File f)
{
GameData gD = new GameData();
try
{
DataFile dF = new DataFile();
dF.load(new FileInputStream((new StringBuilder()).append(f.getAbsolutePath()).toString()));
gD.dir = f.getAbsolutePath();
gD.mode = dF.getProperty("mode");
}
catch(Exception e)
{
}
r... |
170ac6f0-6934-4824-ac9b-432d855acdb5 | 6 | @Override
public void run(){
while(true){
int result=-1;
// for each thread
// check if namenodelocation is available
for(Task t : taskQueue){
try {
if(t instanceof MapperTask){
result = ((MapperTask) t).performOperation();
}
else if(t instanceof ReducerTask){
result =... |
ff8e8a05-2269-4f7d-a64d-52469a5a720e | 4 | public void update()
{
if(this.pwidth != this.getWidth() || this.pheight != this.getHeight())
if(this.currentGui != null)
{
this.currentGui.setBounds(0, 0, this.getWidth(), this.getHeight());
this.currentGui.init();
}
this.pwidth = this.getWidth();
this.pheight = this.getHeight();
if(this.c... |
2c6e11dc-079d-4db8-979f-4019fb957092 | 1 | public void mergeBreakedStack(VariableStack stack) {
if (breakedStack != null)
breakedStack.merge(stack);
else
breakedStack = stack;
} |
b12939fc-d591-4d84-ade5-8fef10023c55 | 0 | public String getAlias() {
return alias;
} |
721fe5b5-d62f-41e2-b824-5e9abb610605 | 5 | @EventHandler (priority = EventPriority.HIGHEST)
public void onPlayerLogin (PlayerLoginEvent event) {
reloadConfig();
if (getConfig().getString("Player."+event.getPlayer().getName()+".CR") == null)
getConfig().set("Player."+event.getPlayer().getName()+".CR", "Default");
if (getConfig().getString("Player."+eve... |
5f274b33-595f-4874-8c3e-7be473d975e1 | 5 | public Logcat() {
mLogcatBeans = new ArrayList<LogcatBean>();
Process.getInstance().getProcessesFromDaemon();
final FrameLogCat logCatFrame = new FrameLogCat();
logCatFrame.setVisible(true);
DaemonExecute.getInstance()
.setCommand(DaemonCommands.LOGCAT, new DaemonCallback() {
@Override
public v... |
6ce5cad1-d96f-412c-acdb-d2e64531ade6 | 2 | private int collectRows(HashSet<Row> set, int index) {
Row row = getRowAtIndex(index);
int max = mRows.size();
set.add(row);
index++;
while (index < max) {
Row next = getRowAtIndex(index);
if (next.isDescendantOf(row)) {
set.add(next);
index++;
} else {
break;
}
}
return index;
... |
397bf315-3727-4a99-97f5-93b65d89c854 | 6 | public void paint(Graphics g) {
w1.draw(g);
w2.draw(g);
Color c = g.getColor();
g.setColor(Color.RED);
g.drawString("missiles count: " + missiles.size(), 10, 50);
g.drawString("explosions count: " + explosions.size(), 10, 70);
g.drawString("enemyTanks count: " + enemyTanks.size(), 10, 90);
g.drawStri... |
202db2c3-0b52-41b5-99ee-b929b148c055 | 9 | private float[][] unrollLoop(int beg, int len, boolean loop, boolean pingpong)
{
// FEATURE SUGGESTION: this could possibly do some anticlick stuff --GM
// some thresholds...
// TODO: not require such a huge mixSpill value
if(!loop)
{
beg = this.length;
len = 1;
}
int mixSpill = (c5speed<<... |
9479b0b2-90ef-4349-8196-854797b64f84 | 4 | public void appendBlock(StructuredBlock block, int length) {
SlotSet succIn = new SlotSet();
SlotSet succKill = new SlotSet();
VariableSet succGen = new VariableSet();
block.fillInGenSet(succIn, succKill);
succGen.addAll(succKill);
if (this.block == null) {
this.block = block;
lastModified = block;
... |
0fa60991-eb38-44c0-988e-8e33e91c8ee6 | 1 | synchronized public
Element getElementForPage(String pageURL) {
String searchXPath = String.format(ELEMENT_BY_URL_XPATH, pageURL);
List<Element> result = queryXPathList(searchXPath);
return result.size()>0?(Element)result.get(0).clone():null;
} |
7fe0d61d-aef4-4de3-aa80-3f04855e6f27 | 4 | public final int update(short[] var1, int var2) {
if(this.seek >= (float)this.data.data.length) {
return 0;
} else {
for(int var3 = 0; var3 < var2; ++var3) {
int var4 = (int)this.seek;
short var5 = this.data.data[var4];
short var6 = var4 < this.data.data... |
f439f9ac-13e5-4b64-bc24-2f7e5bf808ef | 0 | @Override
public void setNationality(String nationality) {
super.setNationality(nationality);
} |
b3d2beed-5e61-40d5-9632-fda416ae535a | 1 | @Override
public int getCount(ArrayList<FilterBean> hmFilter) throws Exception {
int pages;
try {
oMysql.conexion(enumTipoConexion);
pages = oMysql.getCount("usuario", hmFilter);
oMysql.desconexion();
return pages;
} catch (Exception e) {
... |
426bde9a-db58-45e7-a9a9-9b49c4f4122b | 8 | public CreateRandomTime(String connectStr, String userName, String pass,
String outputTable, Time t1StartTime, int t1DurationMillis,
Time t2StartTime, int t2DurationMillis,
Time t3StartTime, int t3DurationMillis,
String experiment) throws SQLException {
this.... |
6c2a564c-2782-4649-ac10-7d7ea02b15e2 | 4 | * @parameter pos, position of the private array where is the shape to be
* returned
*/
public MyShape getShape(int pos) {
try {
if ((pos >= 0) && (pos < 100) && (pos < this.getShapeCount())) {
return this.shapes[pos];
} else {
throw null;
}
} catch (NullPointerException NullPointerE... |
a8a7e913-f70d-4ab7-8c67-02ac7fc3a384 | 2 | public static void main(String[] args) throws ClassNotFoundException
{
//Class 类是java反射的入口点
//获取类的class对象
// Class<?> classType = Class.forName("java.lang.String");
Class<?> classType = Class.forName(args[0]);
Method[] methods = classType.getDeclaredMethods();
for(Method method : methods){
... |
b4ba4fe4-e204-4ca7-9b10-f37c18a22f32 | 0 | public String toString()
{
return path;
} |
73e26a68-f950-457a-9fff-20e8898070e5 | 3 | private void writeDescriptions() {
DefaultTreeCellRenderer treeCellRenderer = new DefaultTreeCellRenderer();
treeCellRenderer.setLeafIcon(null);
treeCellRenderer.setOpenIcon(null);
treeCellRenderer.setClosedIcon(null);
instructionDescriptionTree.setCellRenderer(treeCellRenderer);... |
125b755b-3aa4-418f-9bb6-68d28857a818 | 3 | public void setCondicao(PExpLogica node)
{
if(this._condicao_ != null)
{
this._condicao_.parent(null);
}
if(node != null)
{
if(node.parent() != null)
{
node.parent().removeChild(node);
}
node.parent... |
0b9dc9ca-c9e8-40c5-afbb-bdd95784788e | 0 | public int getId() {
return id;
} |
514da52c-755c-475e-b604-7a9e5ccb0973 | 8 | public static void envoyerCommande(String nomB,String nomC, ArrayList<String> listeIdProduits) throws IOException {
try {
gbu = (IGestionBoutiques) Naming.lookup("rmi://localhost/GestionBoutiques");
} catch (NotBoundException ex) {
Logger.getLogger(ConnexionThreadClientCommandes... |
01fbbd6d-0b20-417d-bcb0-e1a331a4b8ab | 9 | @Override
public void update(Object obj)
{
if (obj instanceof Vendedor)
{
Vendedor editar = (Vendedor) obj;
Vendedor vendedor;
for (int i = 0; i < vendedores.size(); i++)
{
vendedor = vendedores.get(i);
if (vendedor.... |
a943bafe-0e71-4a8f-9755-fc89974c5c54 | 0 | public static void main(String[] args) {
} |
c7b67b99-bce0-4d23-b253-eb22f6506004 | 8 | private String getLoadReplacementSignature(int opcode) throws BadBytecode {
switch (opcode) {
case AALOAD:
return "(Ljava/lang/Object;I)Ljava/lang/Object;";
case BALOAD:
return "(Ljava/lang/Object;I)B";
case CALOAD:
return "(Ljava/lang/Object;I)C";
... |
58bd3f19-0f02-469f-8486-2614c9c41043 | 7 | public boolean containsValue(Object value) {
Entry tab[] = table;
if (value == null) {
for (int i = tab.length ; i-- > 0 ;) {
for (Entry e = tab[i] ; e != null ; e = e.next) {
if (e.value == null) {
return true;
... |
29efeb86-f67e-4dfe-a5c0-a2773c12ea17 | 9 | public void start() {
Random random = new Random();
int finishY = track.getFinishY();
int startY = track.getStartY();
int tracks[] = track.getTracks();
for (int t=0; t<turtles.length; t++) {
turtles[t].setTrackX(tracks[t]);
turtles[t].jumpTo(tracks[t], startY)... |
f6c9ff9e-24b0-405e-9a5c-c78ad3410aed | 9 | @Override
public boolean handleDownloadDirCommand(String providedCommandLine,
PrintStream outputStream,
IServerStatusInterface targetServerInterface)
{
boolean retVal = false;
String[] commParts = GenericUtilities.splitBySpace(providedCommandLine);
if(commParts != null && commParts.length >= 2)
{
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.