method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
6de30785-8aaf-4018-b9ab-0a3e90f27fc5 | 3 | private static void sort(int[] array) {
// TODO Auto-generated method stub
for(int i = 0; i < array.length - 1; i++){
for(int k = 0; k < array.length - 1 ; k++){
int temp;
if(array[k] > array[k+1]){
temp = array[k];
array[k] = array[k+1];
array[k+1]=temp;
}
}
}
} |
8fba8458-2f84-4ee3-a6fa-f8c40327a416 | 9 | protected ArrayList<Placement> densityMapping(Field[][] map, int c) {
shootDensity.clear();
for (int y = 0; y < map.length; ++y) {
for (int x = 0; x < map[y].length - shipValue + 1; ++x) {
int tmp = 0;
for (int z = 0; z < shipValue; ++z) {
... |
98bcd902-f9f3-41e6-8092-98c7207bfd1c | 6 | public Map<String, Integer> splitAndCount() throws EmptyLineException {
String delims = ", :.-=+/*";
for (int i=0; i<arrayOfStrings.size(); i++){
String splitString = arrayOfStrings.get(i);
if (splitString.isEmpty()) {
throw new EmptyLineException("Empty line");
}
StringTokenizer st = new StringToke... |
23d6adf9-e1fc-40a8-aa3b-c132a68b431a | 8 | private boolean r_tidy_up() {
int among_var;
// (, line 183
// [, line 184
ket = cursor;
// substring, line 184
among_var = find_among_b(a_7, 4);
if (among_var == 0)
{
... |
3c46026d-2c1a-4c86-96f0-027b995953e6 | 8 | public Sudoku(boolean autoPossBasic, boolean autoPossAdvanced,
boolean autoFillBasic, boolean autoFillAdvanced, boolean possAsNum,
boolean initialPoss, int initNumbers, int size,
final MouseListenerMethod m, int difficulty) {
super(new GridBagLayout());
this.size = si... |
a64cfe54-9216-424b-a87e-f82d92d4b29f | 8 | @Override
public int[] find(final String[] criteria) throws RecordNotFoundException {
final List<Integer> results = new ArrayList<Integer>();
for (int n = 0; n < this.contractors.size(); n++) {
if (!this.isRecordDeleted(n)) {
this.lock(n);
boolean match = true;
for (int i = 0; i < criteria.length; ... |
bb4d5c31-e4d7-4cd7-adc3-040dba0d711f | 2 | @Override
public void initialize(Vertex start) {
initializeSingleSource(start);
for (int i = 0; i < vertices.getSize(); i++) {
heap.insert(vertices.get(i));
}
for (int i = 0; i < edges.getSize(); i++) {
edges.get(i).setVisited(false);
}
} |
576d4de1-32fb-4855-a787-485005ffcf44 | 6 | public void checkForRightInput(int rs, int cs) {
boolean isTooBig = checkForTooBigInput(rs, cs);
if(isTooBig) {
showTooBigInputError();
}
if(rs > 0 && cs > 0 && !isTooBig) {
model = new GameSimulator(rs, cs);
createNewWindow();
}
if(rs == 0 || cs == 0) {
showCharacterInputError();
}
} |
e8ca90b8-b60d-4ef5-a7f9-cfd410204aca | 3 | @Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null || getClass() != obj.getClass()) {
return false;
}
final POSTerminal other = (POSTerminal) obj;
return Objects.equals(this.terminalID, other.terminalID);
} |
b12bbe79-9392-4a81-b04f-fef1bab6f570 | 4 | public boolean newLibrary( Class libraryClass )
throws SoundSystemException
{
initialized( SET, false );
CommandQueue( new CommandObject( CommandObject.NEW_LIBRARY,
libraryClass ) );
comman... |
4457c2e6-e82d-4f21-97e1-4fa0fcf9023b | 7 | public static boolean adjoinTaxonomyNodeIntervalP(TaxonomyNode node, Interval interval) {
{ Cons intervalstoremove = Stella.NIL;
{ Interval renamed_Int = null;
Cons iter000 = node.intervals;
for (;!(iter000 == Stella.NIL); iter000 = iter000.rest) {
renamed_Int = ((Interval)(iter000... |
8694ec85-26c6-434d-8f4b-b36094c6181a | 0 | @Basic
@Column(name = "zip")
public String getZip() {
return zip;
} |
4a8c2619-643d-4bbb-ab7b-deb9c7e3ef82 | 9 | private void dfs(int x,int y){
if(dist<0) return;
grid[y][x] = 1;
for (int i=-dist;i<=dist;i++){
for(int j=Math.abs(i)-dist;j<=dist-Math.abs(i);j++){
int newx = x+i;
int newy = y+j;
if(newx>=0&&newx<width&&newy>=0&&newy<height&&field[n... |
c279b67a-d903-4569-830a-14d35e8c85c9 | 0 | public JuliaPanelDouble(double a, double b)
{
left = -2;
right = 2;
top = -1;
bottom = 1;
cA = a;
cB = b;
} |
fc296c72-87f4-49b1-af2f-7ac1f5b102c5 | 4 | public int getInt(int index, int length) {
// User input.
List<String> words = this.getParser().getInput();
if (!words.isEmpty()) {
try {
index = Integer.parseInt(words.get(0));
// Index out of bounds.
if (index >= 0 && index < len... |
625e4d73-5f1d-432e-8c26-1b4178f986a4 | 5 | public void parseEncoding(PDFObject encoding) throws IOException {
differences = new HashMap<Character,String>();
// figure out the base encoding, if one exists
PDFObject baseEncObj = encoding.getDictRef("BaseEncoding");
if (baseEncObj != null) {
baseEncoding = getBaseEncodi... |
5530d005-eaa7-496d-92fc-dd4de7f416a4 | 4 | public void testCaseSensitiveMetaData() {
DataSet ds;
final String cols = "COLUMN1,column2,Column3\r\n value1,value2,value3";
Parser p = DefaultParserFactory.getInstance().newDelimitedParser(new StringReader(cols), ',', FPConstants.NO_QUALIFIER);
// check that column names are case sens... |
555ea372-6ea0-4450-8c26-1e19b2fb24e2 | 9 | public void paint(Graphics g, Shape a) {
Color oldColor = g.getColor();
fBounds = a.getBounds();
int border = getBorder();
int x = fBounds.x + border + getSpace(X_AXIS);
int y = fBounds.y + border + getSpace(Y_AXIS);
int width = fWidth;
int height = fHeight;
int sel = getSelectionState();
if( ! hasPi... |
ef5ab2b8-7e3e-4b60-9a3b-c50df589044b | 5 | @Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof SiteBoundaryDataset)) {
return false;
}
SiteBoundaryDataset other = (SiteBoundaryDataset) object;
if ((this.dat... |
c0b83685-ef95-4787-9e28-98d4400c8f85 | 7 | public static Locale toLocale(Object value) throws ConversionException {
if (value instanceof Locale) {
return (Locale)value;
} else if (value instanceof String) {
List elements = split((String)value, '_');
int size = elements.size();
if (size >= 1 &&
... |
58833fa1-4514-43f7-bf35-4d8199b1850c | 0 | public Date getBookingDate() {
return bookingDate;
} |
799127dd-4563-4397-be55-87090e618feb | 7 | private void resize() {
width = getSkinnable().getWidth();
height = getSkinnable().getHeight();
size = width < height ? width : height;
if (width > 0 && height > 0) {
if (aspectRatio * width > height) {
width = 1 / (aspectRatio / height);
} els... |
3ee43097-f6f6-4ced-9648-61030c1ad9ff | 0 | static public double[] getMarker(int x, int y)
{
double lat = latitude - yToMap[zoomIndex]*y + imageSizeH/2*yToMap[zoomIndex];
double lon = longtitude + xToMap[zoomIndex]*x - imageSizeW/2*xToMap[zoomIndex];
double [] coords = {lat, lon};
return coords;
} |
8b5311e4-d285-4346-aacf-4c50f531c09d | 2 | @Override
public void bougerPierre(int x, int y) {
if (donjon.getPosition(x, y).estVide()) {
e = donjon.getElementMobile(x, y);
if (e == null) {
setX(x);
setY(y);
}
}
} |
64f98586-b7b7-4865-adc7-b6360ec9d46c | 5 | private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
String url = "jdbc:mysql://db4free.net:3306/";
String driver = "com.mysql.jdbc.Driver";
String userName = "komunikator";
String password = "pawel01";
String login1 = "";
String password1 = "";
String loginTB = jTextField1.getText();
... |
5ab137b6-bf2b-4f21-824e-53c9b6ae4884 | 5 | @Override
public ShadeRec clone() {
ShadeRec sr = new ShadeRec(world);
sr.hitAnObject = hitAnObject;
sr.material = material == null ? null : material.clone();
sr.worldHitPoint = worldHitPoint == null ? null : worldHitPoint.clone();
sr.ray = ray == null ? null : new Ray(ray.ge... |
0aa892f4-22f3-489a-abc8-042edf52d527 | 5 | private int findHeaderEnd(final byte[] buf, int rlen) {
int splitbyte = 0;
while (splitbyte + 3 < rlen) {
if (buf[splitbyte] == '\r' && buf[splitbyte + 1] == '\n' && buf[splitbyte + 2] == '\r' && buf[splitbyte + 3] == '\n') {
return splitbyte + 4;
... |
1fc00d32-af92-4bd9-b728-e67d8aadffc3 | 2 | public void hauptPhase() {
aktuellerSpieler = spieler1;
System.out.println("hauptphase");
while(laenderGraph.getAnzahlLaender(spieler1.getFraktion()) != 0 && laenderGraph.getAnzahlLaender(spieler2.getFraktion()) != 0) {
int verfuegbareEinheiten = ermittleVerstaerkung(aktuellerSpieler);
aktuellerSpie... |
21f3339e-0abd-447a-a739-6526c176f932 | 0 | public void loadModule(Module module){
module.setModuleManager(this);
module.onStart();
modules.add(module);
DebugUtils.info("Module " + module.getName() + " loaded");
} |
fbc1554c-e012-4c63-99e8-71c5648e3dcc | 9 | public boolean canLoot(MapleCharacter player, int itemid) {
if (player.isAdmin()) {
return true;
}
int i = 0;
if (!player.isGenin() && Items.isSummonBag(itemid)) {
return false;
}
switch (itemid) {
case 4000241:
i = 1;
... |
23cd40c1-c58e-46b7-8802-3073ee38b26d | 8 | public void actionPerformed(ActionEvent __event) {
try {
Object OBJ = __event.getSource();
Object read;
File file;
if (OBJ == _save || OBJ == _saveb) {
file = selectFile(_objectfile);
... |
88e37c99-5d5d-44ca-b675-bba4e5ba7f38 | 6 | @Override
public void start(Stage primaryStage) {
primaryStage.setTitle("Asystent Inwestora");
primaryStage.setMinHeight(600);
primaryStage.setMinWidth(800);
primaryStage.setMaximized(true);
// primaryStage.setFullScreen(true);
tabs = CreateT... |
dc95cb20-b0c7-437d-b5f7-676d5fe10633 | 4 | private void validate(Budget budget, BudgetBreakdown budgetBreakdown) throws Exception {
if(budgetCalculation == null) {
throw new Exception("BudgetCalculation is null");
}
if(budget == null) {
throw new Exception("Budget is null.");
}
if(budget.getSala... |
7d86b989-3fee-4a18-9367-e9cbe578fa27 | 4 | private boolean method322(int z, int x, int y, int offsetZ) {
if (!method320(x, y, z))
return false;
int _x = x << 7;
int _y = y << 7;
return method324(_x + 1, _y + 1, heightMap[z][x][y] - offsetZ)
&& method324((_x + 128) - 1, _y + 1, heightMap[z][x + 1][y]
- offsetZ)
&& method324((_x + 128) - ... |
91e282bc-1207-4d6d-9b5d-8298bbc8c005 | 8 | @Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final ValueType other = (ValueType) obj;
if (this.javaType != other.javaType && (this.javaType == null || !this... |
a0ab7491-d52b-4c94-be2f-2b522ab5e960 | 3 | private void requestBearerToken() throws IOException
{
// Do the OAUTH2 Authenticate
String oAuthTokenUrl = "https://api.twitter.com/oauth2/token";
URL tokenURL = new URL(oAuthTokenUrl);
HttpsURLConnection con = (HttpsURLConnection) tokenURL.openConnection();
con.setDoOutput(true);
con.setDoI... |
e1df8ed2-ab54-42c5-95d1-61dd6d81360f | 3 | public void update(GameContainer gc, StateBasedGame arg1, int delta)
throws SlickException {
super.update(gc, arg1, delta);
Input input = gc.getInput();
if(input.isMousePressed(Input.MOUSE_LEFT_BUTTON) && inputEnabled) {
Vector2 mousePos = new Vector2(input.getMouseX(), input.getMouseY());
mousePos = ... |
e0300fed-f958-43eb-a422-b9d0ffb3fa24 | 9 | private Component parseComponentContent(NodeList childNodes)
{
Component component = new Component();
for (int count = 0; count < childNodes.getLength(); count++)
{
Node node = childNodes.item(count);
if ("attribute".equals(node.getNodeName().toLowerCase()))
... |
ada9a9d6-2067-4503-9b5b-5eb17a5ae06f | 6 | private void calcAngle() {
final double directionToAim = this.getAngle(this.location,
this.getAim());
if (this.direction != directionToAim) {
final double directionAtZero = this.direction - this.direction;
double directionToAimAtZero = directionToAim - this.direction;
if (directionToAimAtZero <= -PI)... |
8f64947c-7757-4d38-8331-7fdef74749d9 | 0 | public void setReplacement(String replacement) {this.replacement = replacement;} |
fd45e820-7ff7-492d-9ceb-8520ed146315 | 9 | public Component getComponentForDataSection(TaskObserver taskObserver, String dataSectionName) throws InterruptedException
{
if (dataSectionName == DATA_SECTION_GENERAL) { return getGeneralPanel(taskObserver); }
else if (dataSectionName == DATA_SECTION_SKILLS) { return getSkillsPanel(taskObserver); ... |
8b525d13-786d-4495-a13a-30510e0626aa | 9 | public static void iterateOverMethods(Class<?> clz,Class<?> goUpto,ReflectionCallback<Method> callback) {
try{
for(Class<?> c=clz; c!=null && (goUpto==null || goUpto.isAssignableFrom(c)) ; c=c.getSuperclass()) {
for(Method m : c.getDeclaredMethods()) {
m.setAccess... |
bb95cafb-0bb6-4bae-a767-f7c4bf254044 | 9 | @Override
public String turnHardwareOn() {
String output = "";
mHardwareLayer.turnHardwareOn();
boolean compareFiles = false;
if (mMode == MachineMode.MANUAL){
try {
PrintWriter writer = new PrintWriter("Manual.DAS.csv", "UTF-8");
writer.p... |
cb8527c6-6d47-42c2-a9af-e789b6921ce4 | 9 | private void printDirListing(OutputStream out) {
// 4 kbyts - should be set-up before!
byte[] dir = new byte[4096];
int p = 0;
int adr = 0x801;
// Load address
dir[p++] = (byte) (adr & 0xff);
dir[p++] = (byte) (adr >> 8);
adr += label.length() + 5;
dir[p++] = (byte) (adr & 0xff);
... |
7b958084-fef1-4a9c-a683-3d5307dfb666 | 3 | private void render() {
remove(gc);
gc.removeAll();
for (int i = 0; i < width; i++) {
for (int j = 0; j < height; j++) {
if (lab.getWalkways()[i][j]) {
gc.add(new GImage("blank.png", i*16, j*16));
} else {
gc.add(new GImage("wall.png", i*16, j*16));
}
}
}
add(gc);
} |
a5066508-2aa1-44ad-ad14-9e1c971ff044 | 5 | public void setColumnData(int i, Object value) throws Exception {
if (i == 0)
fileID = (String) value;
else if (i == 1)
projID = (String) value;
else if (i == 2)
format = (String) value;
else if (i == 3)
fileName = (String) value;
else if (i == 4)
location = (String) val... |
d2b718af-8b7d-4abf-92f6-d1a63091c94d | 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... |
81f3596f-3dd7-48d4-b10f-b2fcf5d4c343 | 9 | static long f(int n) {
Arrays.fill(a, inf);
a[0] = 0;
long B = inf;
for (long t = 1; B == inf; t *= 10) {
Arrays.fill(b, inf);
for (int add = 0; add < L; ++add)
if (a[add] != inf) {
for (int m = 0; m < 10; ++m) {
... |
f268ab1b-01eb-4df4-a12f-5af444b1c617 | 6 | final Class367 method3832(int i, byte i_64_) {
if (i_64_ >= -57)
aClass209Array9795 = null;
int i_65_ = i;
while_234_:
do {
do {
if (-4 != (i_65_ ^ 0xffffffff)) {
if ((i_65_ ^ 0xffffffff) != -5) {
if (8 == i_65_)
break;
break while_234_;
}
} else
return ... |
2e3dfbbd-3488-43af-93f9-1891b3d62073 | 0 | public void setAlgorithm(String value) {
this.algorithm = value;
} |
eeb907b0-2962-498a-ae70-3cd6a976f84c | 1 | private boolean greater(Key i, Key j)
{
if (i.compareTo(j) > 0)
return true;
return false;
} |
edfdaa70-dd8f-442c-9b68-89bfcb2af68b | 7 | protected void cloneFix(StdArea areaA)
{
me=this;
basePhyStats=(PhyStats)areaA.basePhyStats().copyOf();
phyStats=(PhyStats)areaA.phyStats().copyOf();
properRooms =new STreeMap<String, Room>(new RoomIDComparator());
properRoomIDSet=null;
metroRoomIDSet =null;
parents=areaA.parents.copyOf();
children=ar... |
f681ae01-212f-4900-88b3-3fccee891b1d | 9 | public boolean isMatch(String s, String p) {
int i = 0;
int j = 0;
int star = -1;
int mark = -1;
while (i < s.length()) {
if (j < p.length()
&& (p.charAt(j) == '?' || p.charAt(j) == s.charAt(i))) {
++i;
... |
6d2dfdcb-877e-4212-ab0b-2ecb8475238c | 2 | public void close() throws IOException {
if (socket != null) socket.close();
if (streamIn != null) streamIn.close();
} |
c2827f18-3367-4d16-af81-027418983a77 | 8 | public void actionPerformed(final ActionEvent EVENT) {
if (EVENT.getActionCommand().equals("flip") && flipping) {
previousSelectionIndex = currentSelectionIndex;
currentSelectionIndex++;
if (currentSelectionIndex >= selectedSet.size()) {
currentSelectionIndex = 0;
}
nextSelectionIndex = currentSele... |
dacc60ae-98c3-484b-98a0-1dfca62f16d7 | 8 | public void processOrder(String input) throws Exception {
String tokens[] = getTokenizedData(input);
DataValidator validator = new DataValidator();
if (validator.validateInput(tokens)) {
String fileName = tokens[0].trim();
RestaurtantDetailsLoader proc = new RestaurtantDetailsLoader();
restaurantMap = ... |
c5894331-052c-47f5-995b-ace6851316d0 | 2 | public void tickDownTileStatuses(int currentPlayerIndex)
{
for (int y = 0; y < this.getGridHeight(); y++) {
for (int x = 0; x < this.getGridWidth(); x++) {
grid[x][y].tickDownStatuses(currentPlayerIndex);
}
}
} |
50d066fa-3eb1-4419-ab10-484b917fab63 | 1 | final void send(SocketChannel socket, ByteBuffer data) {
synchronized (mPendingWriteData) {
LinkedList<ByteBuffer> list = mPendingWriteData.get(socket);
if (list == null) {
list = new LinkedList<>();
mPendingWriteData.put(socket, list);
}
list.add(data);
}
synchronized (mPendingChanges) {
m... |
781f1fd3-eb75-42cf-b752-2273505e90f4 | 6 | public String stringTypeValue(keyTypeValues value)
{
String val = "string";
switch (value)
{
case BOOLEAN:
{
val = "boolean";
break;
}
case DOUBLE:
{
val = "double";
break;
}
case FLOAT:
{
val = "float";
break;
}
case INT:
{
val = "int";
break;
... |
7d369d52-5e53-4f71-b194-857d9e0dfe5a | 4 | public static void main(String[] args) {
String line = "";
String message = "";
int c;
try {
while ((c = System.in.read()) >= 0) {
switch (c) {
case '\n':
... |
def6bda4-f59d-40fa-931b-58ca9d9d3c98 | 6 | private void attack(Civilization c) {
if (c.cities.size()>0&&cities.size()>0) {
City best=cities.get(0),target=c.cities.get(0);
int attackGuess=aggression*best.population/100*(strength+getBonus(target.CENTER)-best.CENTER.distanceTo(target.CENTER)*distanceWeight);
int defendGuess=c.aggression*target.populatio... |
91e1c05a-8a97-4d9e-8752-7c8f66310117 | 0 | public static void main(String[] args) {
CameraCaptureTester tester = new CameraCaptureTester();
tester.run();
} |
07d0bdc0-616b-40c4-ba64-0a849671f2a0 | 2 | public static void main(String[] args)
{
Graph G = null;
try
{
G = new Graph(new In(args[0]));
}
catch (Exception e)
{
System.out.println(e);
System.exit(1);
}
Bipartite b = new Bipartite(G);
if (b.isBipartite())
System.out.println(args[0] + " is bipartite");
else
System.out.println... |
723edba9-129b-418b-b1f6-f4c8939e39b7 | 1 | public static void main(String[] args) {
Pattern pat = Pattern.compile(".*?xx");
Matcher mat = pat.matcher("yyxxxyxx");
while(mat.find()){
System.out.println("Start:"+mat.start());
System.out.println("Group..:"+mat.group());
}
} |
f92bc667-38e8-4248-901a-8af9c8f729f8 | 8 | public boolean attemptToMove(double delta, Tile[] tiles) {
// Store our already (hopefully) collision-free position
px = x;
py = y;
float timeslicesRemaining = 1.0f;
int numberOfTimesSubdivided = 0;
boolean collided;
Collision collision = new Collision();
Collision bestCollision = new Collision();
... |
b92f7005-3c93-44eb-bc80-88321818041f | 0 | public JButton getjButtonNew() {
return jButtonNew;
} |
0244427a-90ea-4e94-8fc0-a2cbb2c2d52b | 6 | public static void openWorkbench(Player player) {
//has to have the use permission
if (!permission.has(player.getWorld(), player.getName(), "portables.workbench.use")) {
return;
}
//has to be holding the material
if (permission.has(player.getWorld(), player.getName(), "portables.workbench.has")) {
//Doe... |
7b6eeaad-59f8-4d59-a2fa-2d8c9a088a83 | 5 | protected void processChange(Rectangle paramRectangle)
{
Rectangle localRectangle1 = getBounds();
if (this.BufferSize != null) {
localRectangle1.setSize(this.BufferSize);
}
if (paramRectangle.intersects(localRectangle1))
{
paramRectangle = paramRectangle.intersection(localRectangle1);
... |
cffc74a9-04fd-4a2f-83fa-ce4ff513a6b1 | 1 | public static void main(String[] args) {
HttpClient httpClient = HttpClientBuilder.create().build();
try {
HttpPost request = new HttpPost("http://localhost:8080/register");
StringEntity params =new StringEntity("userJson={\"id\":\"100\",\"age\":\"20\",\"name\":\"Purnima\"}");
// request.addHeader("cont... |
1679dcac-c208-4e8b-9054-2fa456dd369c | 0 | public EventCommentType(final String name) {
super(name);
} |
e4f67902-3cce-45d9-8df8-ef449ce19724 | 5 | public static void main(String[] args) {
Employee e1 = new Employee("Tom", "Tommerson", "555-55-5555");
Employee e2 = new Employee("Sneaky", "Sneakerson", "444-55-5555");
Employee e3 = new Employee("Sally", "Sallerson", "333-55-5555");
Employee e4 = new Employee("Bill", "Billerson", "44... |
dbed752d-5dbb-4a87-8ab1-031bb43fd965 | 1 | public boolean deliverToMemory(boolean isRead) { //If isRead, first stage of read operation, otherwise write.
if (isRead) {
return memory.notifyRead(addressBus.read());
}
fireOperationUpdate(""); //Reset control line GUI display as data is written into MBR
return memory.notifyWrite(addressBus.read(), dataBu... |
7329938f-c192-4c1f-820f-e00fca479706 | 1 | public ResultSet executeSQLQuery(String sqlStatement) {
try {
// Datenbankverbindung herstellen
connect = connectDB();
// PreparedStatement für den SQL-Befehl
myPreparedStatement = connect.prepareStatement(sqlStatement);
// SQL-Befehl wird ausgeführt
myResultSet = myPreparedStatement.executeQuery... |
685b2d4d-b64c-4331-9964-fa028c3316f7 | 1 | @SuppressWarnings("static-access")
@EventHandler(priority = EventPriority.HIGH)
public void onPlayerDropItem (PlayerDropItemEvent event) {
Random rand = new Random();
int possessionChance = rand.nextInt(5);
final ItemStack droppedStack = event.getItemDrop().getItemStack();
final ... |
8c736045-e873-4b13-81ca-a1c1494a8b23 | 8 | public static void internalComponents0(Collection<Class<?>> comps, Class<?> model) {
for (Field f : model.getDeclaredFields()) {
f.setAccessible(true);
Class<?> fc = f.getType();
if (!fc.isPrimitive() && !fc.getName().startsWith("java.") && isComponentClass(fc)) {
... |
9ee9548a-0eb1-4e33-b051-a13058c2b207 | 0 | @Override
//TODO: Need to put error check, make sure there is only one letter popping and placing
// More error check?
protected boolean checkAutomaton() {
// TODO Auto-generated method stub
//return true for now
return true;
} |
8e916d52-cdc8-41bb-8a08-9948b062cc3b | 8 | BitMatrix buildFunctionPattern() {
int dimension = getDimensionForVersion();
BitMatrix bitMatrix = new BitMatrix(dimension);
// Top left finder pattern + separator + format
bitMatrix.setRegion(0, 0, 9, 9);
// Top right finder pattern + separator + format
bitMatrix.setRegion(dimension - 8, 0, 8,... |
b4487676-d5c4-4464-b220-68c5dd7ca490 | 6 | /* */ public Object getDestroyPacket()
/* */ {
/* 83 */ Class<?> PacketPlayOutEntityDestroy = Util.getCraftClass("PacketPlayOutEntityDestroy");
/* */
/* 85 */ Object packet = null;
/* */ try {
/* 87 */ packet = PacketPlayOutEntityDestroy.newInstance();
/* 88 */ Field a =... |
dad7b56a-401b-4cc2-9106-bec8e55a7e45 | 0 | public JSONWriter endArray() throws JSONException {
return this.end('a', ']');
} |
d805d70a-bb4e-4b78-ba41-2f8b8bada4c2 | 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... |
8b65a403-17d1-4112-bda7-0ed0645aae64 | 9 | private void checkBody() throws Exception {
Token token;
while(iterator < tokenList.size()) {
token = tokenList.get(iterator++);
if(token.getType() == TokenType.BOOL_TYPE || token.getType() == TokenType.CHAR_TYPE ||
token.getType() == TokenType.INT_TYPE) {
checkVarDeclaration();
} else if(token... |
80986740-97ff-4543-a88d-726e41c917da | 7 | @Override
public <T> Invoker<T> refer(final Class<T> type, final TpURL tpURL) throws RpcException {
// 获得一个 服务类 对应的 remote 请求代理
T referProxy = doRefer(type, tpURL);
// 将这个请求代理进行包装,生成一个Invoker 具有远程调用外部service的能力
final Invoker<T> target = proxyFactory.createProxyInvoker(referProxy, type, tpURL);
// 生成一个Abstrac... |
741adc1b-908a-4f4f-83cc-effc9eccb36b | 0 | public static void start() throws IOException
{
new Listener();
} |
c48461a4-c0b6-44a8-b916-a6daf54b16ad | 9 | @Override
public void run() {
if(state==GameState.Running){
while (true) {
robot.update();
if (robot.isJumped()) {
currentSprite = characterJumped;
} else if (robot.isJumped() == false && robot.isDucked() == false) {
currentSprite = anim.getImage();
}
ArrayList projectiles = robot.getProjec... |
bd99bba1-64c8-48e0-8620-9ca35dbed432 | 8 | public boolean blockLeftClick(Block block, Player player) {
// If the block we're clicking is a chest, no point doing anything
if(block.getType() == Material.CHEST)
return true;
// Get the material in the hand
Material inHand = player.getItemInHand().getType();
// They're not interacting with a block
if(... |
f2921e72-8fb6-4b34-ab08-98af240e7295 | 3 | private boolean isPasswordAndConfirmEquals() {
boolean result = false;
boolean passwordAndConfirmIsValid = isPasswordValidate() && isConfirmValidate();
if(passwordAndConfirmIsValid) {
result = this.password.equals(this.password_confirm) ? true: false;
}
return resul... |
d62de868-6f21-4494-ba3f-5d1caa191744 | 9 | public static void main(String[] args) {
LinearAlgebraScanner input = new LinearAlgebraScanner();
boolean done = false;
System.out.println("Howdy!");
System.out.println("This heres the greatest calculator ever");
System.out.println("created with 10 functions or less.");
w... |
70cfccbe-f11f-49ff-ad7d-14de46a3f0eb | 0 | static void actionLikeA(A a) {
a.action();
} |
a606e5da-985e-4aab-8b84-62e2f2677d01 | 4 | private void descripcionmedicamentosFieldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_descripcionmedicamentosFieldKeyTyped
// TODO add your handling code here:
if (!Character.isLetter(evt.getKeyChar()) && !Character.isISOControl(evt.getKeyChar()) && !Character.isWhitespace(evt.getKeyChar()))... |
db72b3a8-43b1-478f-ac51-ea438ab3ac87 | 6 | public void foreachPoms(POMHandler handler) {
init();
// process the ignored pom files
for (String pomPath: pomOptions.keySet()) {
POMOptions options = getPOMOptions(pomPath);
if (options.isIgnore()) {
File pom = new File(baseDir, pomPath);
... |
11407bfd-6e01-4578-b8f8-2b672d1ea645 | 2 | @Override
public int hashCode() {
int result = userSession != null ? userSession.hashCode() : 0;
result = 31 * result + (watcherSession != null ? watcherSession.hashCode() : 0);
return result;
} |
dc3673f0-a717-4e2c-a1d2-f9ed0b13e1a3 | 5 | private boolean zzRefill() throws java.io.IOException {
/* first: make room (if you can) */
if (zzStartRead > 0) {
System.arraycopy(zzBuffer, zzStartRead,
zzBuffer, 0,
zzEndRead-zzStartRead);
/* translate stored positions */
zzEndRead-= zzStartRe... |
b7d3e21d-de88-4b54-ab5c-db7458077d94 | 7 | public static void startupExplanations() {
{ Object old$Module$000 = Stella.$MODULE$.get();
Object old$Context$000 = Stella.$CONTEXT$.get();
try {
Native.setSpecial(Stella.$MODULE$, Stella.getStellaModule("/LOGIC", Stella.$STARTUP_TIME_PHASE$ > 1));
Native.setSpecial(Stella.$CONTEXT$, (... |
1765a02b-eb2f-4205-ae9a-1f0831bd1b15 | 2 | public int setCurrent(Piece piece, int x, int y) {
int result = board.place(piece, x, y);
if (result <= Board.PLACE_ROW_FILLED) { // SUCESS
// repaint the rect where it used to be
if (currentPiece != null) repaintPiece(currentPiece, currentX, currentY);
currentPiece = piece;
currentX = x;
currentY... |
2e7ff77d-0406-4101-a1b7-98eda775fc5d | 6 | public void visit(
final int version,
final int access,
final String name,
final String signature,
final String superName,
final String[] interfaces)
{
StringBuffer sb = new StringBuffer();
appendAccess(access | ACCESS_CLASS, sb);
AttributesIm... |
d3483ee0-7ca1-44b4-8dc5-cb623106f677 | 6 | @SuppressWarnings("unchecked")
public Object newMetadata() {
if (modelData.containsKey(id)) {
Object model = modelData.get(id);
Object w;
try {
w = DynamicClassFunctions.classes.get("DataWatcher").newInstance();
} catch (Exception e) {
DisguiseCraft.logger.log(Level.SEVERE, "Could not construct a... |
2cdc0c90-e227-49db-abac-bfa68971e530 | 5 | public static boolean getBoolean(Object value) {
try {
String v = getString(value);
if ("1".equals(v)) {
return true;
} else if ("0".equals(v)) {
return false;
} else if ("Y".equals(v)) {
return true;
} else if ("N".equals(v)) {
return false;
} else {
return Boolean.parseBoolean(... |
c59c912e-6c5b-4434-8171-5f0104eb3f27 | 3 | public int getSum() {
aapneForbindelse();
double sum = 0;
int okter = -1;
try {
setning = forbindelse.prepareStatement(sqlGetSum);
setning.setString(1, brukernavn);
res = setning.executeQuery();
while (res.next()) {
sum = re... |
08ba7c73-85dd-47e2-a94a-ffc8932f967a | 4 | public JSONObject toJSONObject(JSONArray names) throws JSONException {
if (names == null || names.length() == 0 || this.length() == 0) {
return null;
}
JSONObject jo = new JSONObject();
for (int i = 0; i < names.length(); i += 1) {
jo.put(names.getString(i), this.... |
9e70abf1-9258-454b-85d6-614f06cde387 | 7 | @EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
public void rates(CreatureSpawnEvent event)
{
if (P.p().shouldIgnoreNextSpawn() || P.p().shouldAbilitiesIgnoreNextSpawn())
return;
if (!P.p().getPluginIntegration().canApplyAbilities(event.getEntity()))
{
P.p().abilitiesIgnoreNextSpawn... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.