method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
7b34832c-7e78-4507-9b53-1a1ecb159a49 | 1 | private void notifyOfSort(boolean restoring) {
for (OutlineModelListener listener : getCurrentListeners()) {
listener.sorted(this, restoring);
}
} |
c3fb9f96-ac66-40cc-9579-c4caec9651f8 | 6 | private void read(SocketChannelExtender socket) {
int result = socket.read(readBuffer);
if ((result & RES_CLOSE_SOCKET) != 0) {
closeSocketPair(socket);
readBuffer.clear();
return;
}
if ((result & RES_ALLOCATE_BUFFER) != 0) {
readBuffer = ... |
340a9c9b-6673-4f7a-95e6-20d17aab3488 | 7 | public synchronized void setBeanContext(BeanContext bc)
throws PropertyVetoException {
// Do nothing if the old and new values are equal
if ((this.beanContext == null) && (bc == null)) {
return;
}
if ((this.beanContext != null) && this.beanContext.equals(bc)) {
... |
8f1ab63b-042d-41b4-b9b0-d052b1fc9695 | 7 | private void scale(final float m, final float[] a, final int offa) {
int nthreads = ConcurrencyUtils.getNumberOfThreads();
if ((nthreads > 1) && (n > ConcurrencyUtils.getThreadsBeginN_1D_FFT_2Threads())) {
nthreads = 2;
final int k = n / nthreads;
Future<?>[] futures ... |
a2c24182-9e48-4e83-beda-15ccee7221d4 | 2 | @Override
public void selectionChanged(TreeSelectionEvent e) {
JoeTree tree = e.getTree();
Document doc = tree.getDocument();
if (doc == Outliner.documents.getMostRecentDocumentTouched()) {
if (tree.getComponentFocus() == OutlineLayoutManager.ICON) {
setEnabled(true);
} else {
setEnabled(false);... |
92852238-0f06-47bb-8e61-9f416d5dd545 | 2 | private Invoice createInvoiceObjectFromResponse(HttpResponse response) throws IOException, JSONException {
BufferedReader rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
StringBuilder content = new StringBuilder();
String line;
while (null != (line = rd.readLine())) {
... |
278a8fec-95bb-4f9d-aa46-ddbc78039251 | 1 | public void playSoundtrack() {
if (this.soundtrack != null) {// sometimes is not loaded at the first
// time
this.soundtrack.play();
// if(this.soundtrack.isPlaying()){
// this.soundtrack.setLooping(true);
// }
// long id = this.soundtrack.play();
// this.soundtrack.setLooping(id, true);
}
} |
524623c9-bad8-47fb-ae4a-57e5cbc1d0c5 | 0 | @Override
public <T> T unwrap(Class<T> arg0) throws SQLException {
return null;
} |
793916b8-d159-4629-ac46-2ab8a0a7c43c | 8 | public void activate(final boolean activate)
{
active = activate;
if (active && getCache() == null)
setCache(new LFUCache(0, 0));
// supply a really simple "all you can buffer"-filter
if (active && nwFilter == null) {
nwFilter = new NetworkFilter()
{
public void accept(final CEMI frame, f... |
bbd3c953-c22f-4b67-84a2-af0fa6ab1f49 | 9 | public InternetExplorerLauncher(BrowserConfigurationOptions browserOptions, RemoteControlConfiguration configuration, String sessionId, String browserLaunchLocation) {
String mode = browserOptions.get("mode");
if (mode == null) mode = DEFAULT_MODE;
if ("default".equals(mode)) mode = DEFAULT_MOD... |
d9ad6c22-7e51-436d-b716-9a2eeb5a6ca6 | 9 | private boolean checkValid(int x, int y) {
boolean[] row = new boolean[9];
boolean[] col = new boolean[9];
for (int i = 0; i < 9; i++) {
char rowChar = board[x][i];
char colChar = board[i][y];
if (rowChar != '.') {
if (row[rowChar - '1'])
return false;
else
row[rowChar - '1'] = true;
... |
1df69645-018d-45b2-a8d2-9684d8c4d672 | 4 | public void wdgmsg(Widget sender, String msg, Object... args) {
if(busy){return;}
if(sender == content) {
String request = (String)args[0];
if((Integer)args[1] == 1) {
open(request);
} else {
new WikiPage(ui.wiki, request, true);
}
} else if(sender == cbtn) {
ui.destroy(this);
} else {
... |
16b24c60-dd7e-4ae4-84bf-a55cfda5d4c5 | 2 | public void test_01() {
// Run
String args[] = { "-classic", "-ud", "0", "testHg3766Chr1", "./tests/test.mnp.01.vcf" };
SnpEff cmd = new SnpEff(args);
SnpEffCmdEff snpeff = (SnpEffCmdEff) cmd.snpEffCmd();
List<VcfEntry> results = snpeff.run(true);
// Check
Assert.assertEquals(1, results.size());
VcfEnt... |
d010f163-fa40-4cf7-b4df-a67f0988a458 | 2 | public static boolean hasSpace(){
for (Item item : inventory) {
if(item == null) return true;
}
return false;
} |
773d21dd-c5c8-49c2-9c0b-29bcf7d1acbc | 6 | private void handleStartProcess(String[] cmdLine){
if(cmdLine.length < 3){
System.out.println("invalid argument, see help for more information");
return;
}
int workerId;
try{
workerId = Integer.valueOf(cmdLine[1]);
}catch(Exception... |
eec885ce-183f-4a48-9abb-18e8a70f1406 | 5 | public void set(String name, Object value) {
try {
Scanner scan = new Scanner(this);
File temp = new File("temp");
PrintWriter pw = new PrintWriter("temp");
boolean used = false;
while(scan.hasNextLine()) {
String line = scan.nextLine()... |
bc87eee8-f106-4efb-94a4-c162ecce314b | 8 | public Compras() {
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 450, 366);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setLayout(null);
JButton btn_Cadastrar = new JButton("Cadastrar");
btn_Cadastrar.se... |
501c49f5-d024-4524-806c-0e5ab0139fdc | 9 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
IngredientList other = (IngredientList) obj;
if (ingredientList == null) {
if (other.ingredientList != null)
return false;
}
else if (... |
c5fe712b-0eee-4ad1-bd52-c70e782d74d2 | 9 | @Override
public void grantAbilities(MOB mob, boolean isBorrowedRace)
{
final PairList<Ability,AbilityMapping> onesToAdd=new PairVector<Ability,AbilityMapping>();
for(final Enumeration<Ability> a=CMClass.abilities();a.hasMoreElements();)
{
final Ability A=a.nextElement();
final AbilityMapping mapping = CM... |
6c7430ee-ae1d-4b31-b316-6bffcc4d79f9 | 9 | public tracuuphong(int khu, String phong, String loai, String quanly,DefaultTableModel tb) {
if(khu==0)khui="b5";
if(khu==1)khui="b6";
if(khu==3)khui="b7";
String maphong;
maphong= khui+"-"+phong;
if (phong.length() == 0) {
JOptionPane.showMessageDialog(null, "Ba... |
9fb801f0-e31e-4901-b87f-0b4e48cb4040 | 6 | public void keyPressed(KeyEvent e) {
int key = e.getKeyCode();
if (key == KeyEvent.VK_LEFT) {
battlefield.getMuzzle().setAngle(battlefield.getMuzzle().getAngle() - battlefield.getMuzzle().getSpeed());
}
else if (key == KeyEvent.VK_RIGHT) {
battlefield.getMuzzle().setAngle(battlefield.getMuzzle().getAngle(... |
28f5bdaa-1d66-434c-94b1-67ab5eda1671 | 9 | public void open ()
{
//Check for saving the current file
if (checkSaved ()){
final Lawgbook l = display.getLawgbook ();
File file;
//This crashed a few times with a nullpointerException
fileChooser.showOpenDialog(this); //I need to access a component for this to work. May have to move... |
ee147f4d-7f9b-4aeb-9fa8-8e1fd7706afe | 9 | protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
//On verifie le parametre email existe
String email = request.getParameter("email");
if (email ==null){
request.setAttribute("message", "Le emai... |
a9021495-d3ef-4bd4-b823-79b3d2fb1d7f | 0 | public void setClassName(String className) {
this.className = className;
} |
93ab6d0f-87ef-453e-a3ee-7857bbe56aa7 | 2 | private void initArrays() {
if (data == null || picsize != data.length) {
data = new int[picsize];
magnitude = new int[picsize];
xConv = new float[picsize];
yConv = new float[picsize];
xGradient = new float[picsize];
yGradient = new float[... |
582d7405-22de-464f-a8fb-480225c502ae | 6 | private void leftCtrlClickAction(int x, int y)
{
if (!isEditable())
{
leftShiftClickAction(x, y);
return;
}
if (isTile(x, y))
{
if (selection[x][y] == -1 && selt != 1)
{
selection[x][y] = getArrangementData(x, y)... |
ff7f22bc-3e79-4068-a04b-aa10163f6249 | 0 | public String getBilan() {
return bilan;
} |
cf7406bd-0c48-4afe-8dbc-010ddf3a2c66 | 2 | public void addSupportedFeatures(String supportsString) {
String[] stringFeatureReps = supportsString.replace("$Supports ","").split("\\s+");
for (String stringFeature : stringFeatureReps) {
try {
stringFeature = stringFeature.replace("\\|", "");
SupportsFeatu... |
fc1e7c28-98e5-461e-b9d9-860f3e8e0f36 | 1 | public void actionPerformed(ActionEvent event) {
// JFrame frame = Universe.frameForEnvironment(environment);
try {
getExpression().asCheckedString();
} catch (UnsupportedOperationException e) {
JOptionPane.showMessageDialog(getEnvironment(), e.getMessage(),
"Illegal Expression", JOptionPane.ERROR_MESS... |
c92c0f35-2c9a-4a98-b09a-d431598d4478 | 7 | public Deplacement PrecedentDeplacement(int i) {
Deplacement deplacementPrecedent = null;
Tour touractuelle = null;
int j =0;
for (Tour tour : historiqueToursJoueur) {
touractuelle = tour;
for (Deplacement deplacement : tour.getListDeplacement()) {
j++;
if(j == (i))
{
deplacementPreced... |
fd020324-b6de-4efd-b4a3-52a886b48080 | 2 | public static void testParametreReservation (String nomS, String dateS, String numS) throws BDException {
String requete = "select * from lesspectacles, lesrepresentations where lesspectacles.numS=lesrepresentations.numS and lesspectacles.numS="+numS+" and dateRep = to_date('"+dateS+"','dd/mm/yyyy hh24:mi') and nomS=... |
81a7c37e-388d-4f7e-88e6-4edc07b434bf | 2 | public void testForFields_time_HMm() {
DateTimeFieldType[] fields = new DateTimeFieldType[] {
DateTimeFieldType.hourOfDay(),
DateTimeFieldType.minuteOfHour(),
DateTimeFieldType.millisOfSecond(),
};
int[] values = new int[] {10, 20, 40};
Lis... |
34de5eb4-47cb-4256-a8ea-5f64173505d8 | 0 | @Override
public boolean isWebDriverType(String type)
{
return StringUtils.equalsIgnoreCase("phantomjs", type);
} |
ab6cccb9-b174-44bd-bd61-35320a818bc2 | 9 | public K findKey (Object value, boolean identity) {
V[] valueTable = this.valueTable;
if (value == null) {
K[] keyTable = this.keyTable;
for (int i = capacity + stashSize; i-- > 0;)
if (keyTable[i] != null && valueTable[i] == null) return keyTable[i];
} else if (identity) {
for (int i = capacity + st... |
ddedfd2a-48f1-475d-a0f0-e870545eeca1 | 3 | private void copyPixels(int destOff, int width, int height, int srcStep, int srcOff, int destStep, int src[], int dest[]) {
int quarterX = -(width >> 2);
width = -(width & 3);
for (int i = -height; i < 0; i++) {
for (int j = quarterX; j < 0; j++) {
dest[destOff++] = src[srcOff++];
dest[destOff++] = src... |
f9c041d0-fad0-4752-ae12-c9a6f804bf69 | 0 | public String getAddress2() {
return address2;
} |
eca29867-42c2-41c5-8cb6-80c120457760 | 3 | private void revealNeighbouringCards(Rectangle removedCardArea,
int rowOfRemovedCard) {
int previousRow = rowOfRemovedCard - 1;
int nextRow = rowOfRemovedCard + 1;
/*
* Stage 7 (20 Marks)
*/
int checkRow;
switch (rowOfRemovedCard) {
case 1:
checkRowOfNeighbours(removedCardArea, checkRow = 0,
... |
32f45301-c27a-4576-a9ad-6bdba29d6fa6 | 0 | public Long getId() {
return id;
} |
0472b5c5-cb1e-4d2c-b944-8aece044990e | 2 | public static DoHouseWork getSingleton(){
// needed because once there is singleton available no need to acquire
// monitor again & again as it is costly
if(singleton==null) {
synchronized(DoHouseWork.class){
// this is needed if two threads are waiting at the monitor at the
... |
0606b394-fb45-4c41-8321-90fd8a8d697f | 1 | public static void main(String[] args) throws IOException {
if (args.length == 1) {
Webserver web = new Webserver(args[0]);
web.run();
}
else
System.err.println(
"Usage: java javassist.tools.web.Webserver <port number>");
} |
5bdf2077-1fb6-4785-8d1c-d97065cf2992 | 8 | private void initGUI() {
setFocusable(true);
this.setBorder(null);
MouseAdapter mouseListener = new MouseAdapter() {
@Override
public void mouseEntered(java.awt.event.MouseEvent evt) {
mouseIsOverButton = true;
setBackground();
}
@Overr... |
32b1ba89-e01a-4c4b-a945-e389483b8f00 | 5 | @Override
public void onPluginMessageReceived(String channel, Player player, byte[] message) {
if(!channel.equals(MESSAGING_CHANNEL)) return;
DataInputStream in = new DataInputStream(new ByteArrayInputStream(message));
try {
String subchannel = in.readUTF();
if(subchannel.equals("Forward")) {
... |
fa1433b2-ee2e-458f-827a-09b0560174fc | 4 | public static void set(String key, Serializable value)
{
synchronized (data)
{
Serializable old = data.put(key, value);
if (((old == null) && (value != null)) || ((old != null) && (!old.equals(value))))
modified = true;
}
} |
397bc4df-2a67-4764-ad1c-1012293540cc | 0 | public GetQuestionsFromMySqlDatabase(String hostname, String databaseName, String username, String password)
{
this.hostname = hostname;
this.databaseName = databaseName;
this.username = username;
this.password = password;
} |
b7e10c7d-b410-4abd-bf12-b8f0361ab942 | 6 | void Stand_Up(float dt) {
int i;
int onfloor = 0;
float scale = 2.0f;
// touch the feet to the floor
for(i=0;i<6;++i) {
if(legs[i].ankle_joint.pos.z>0) legs[i].ankle_joint.pos.z-=4*scale*dt;
else ++onfloor;
// contract - put feet closer to shoulders
Vector3f df = new Vector3f(legs[i... |
56a4d986-40b8-4768-97c8-cfa106feb78b | 9 | @Override
public void run() {
List<UIEvent> lastEvents = Model.getModel().getInteractionStack().getLastEvents(2);
if (lastEvents.get(0).getEventType() != EventType.MOUSE_BUTTON_UP
|| lastEvents.get(0).getButton() != 1
|| lastEvents.get(1).getEventType() != EventType.MOUSE_BUTTON_DOWN
|| Model.getModel(... |
e40b87d4-108a-46a5-9a7a-edeac21dc8f3 | 5 | public static void main(String[] args) {
int matriceA[][] = {{1, 1, 1, 1, 1},
{2, 2, 2, 2, 2},
{3, 3, 3, 3, 3},
{4, 4, 4, 4, 4},
{5, 5, 5, 5, 5}};
int matriceB[][] = new int[matriceA.length][m... |
1b5b6a6b-5d44-4e60-9b0f-345096174780 | 6 | 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 ... |
342f882a-7658-4494-b090-451e6f8be29c | 0 | @Test
public void runTestApplicationLifecycle1() throws IOException {
InfoflowResults res = analyzeAPKFile("Lifecycle_ApplicationLifecycle1.apk");
Assert.assertEquals(1, res.size());
} |
f84790d6-436c-40fb-a9a7-1ace600a193a | 6 | public static Proposition normalizeValueFunction(Proposition self) {
{ Surrogate functionsurrogate = Logic.evaluateRelationTerm((self.arguments.theArray)[0], self);
int newargumentcount = self.arguments.length() - 1;
Proposition newproposition = null;
Proposition duplicate = null;
if (funct... |
ea2e677c-b300-43bd-98d5-480744560932 | 0 | public void setAdapt(boolean newAdapt)
{
adapt = newAdapt;
transformNeedsReform = true;
repaint();
} |
c69cb9bd-40a4-4c94-8039-c6f52e3f9120 | 5 | public static void Edit(){
FileReader pl=null;
String what;
String sCurrentLine="";
Scanner scan = new Scanner(System.in);
what = scan.nextLine();
System.out.println("Input file:\n");
try{
//pl = new FileReader(f);
pl = new FileReader("src/data");
} catch (FileNotFoundException e) {
System.... |
83ff76a7-59ef-42e7-bb84-2a486ad0753a | 5 | private ResGridlet cancelReservationGridlet(int reservationID)
{
ResGridlet rgl = null;
// Find in EXEC List first
int found = findGridlet(gridletInExecList_, reservationID);
if (found >= 0)
{
// update the gridlets in execution list up to this point in time
... |
151ff493-1f08-4f2e-91b5-4219b115e7d6 | 0 | public void setIpServer(String ip){
this.ipServer = ip;
} |
65d9a241-66ff-421e-bc76-a3140994a875 | 5 | public void saveHitbox() {
BufferedReader reader;
try {
reader = new BufferedReader(new FileReader(System.getProperty("resources") + "/database/entities"));
String line;
StringBuilder fileContent = new StringBuilder();
String newLine = null;
while((line = reader.readLine()) != null) {
String[] t... |
79915ac2-fe2f-48c2-b19e-9f78494951a2 | 1 | public boolean opEquals(Operator o) {
return (o instanceof LocalLoadOperator && ((LocalLoadOperator) o).local
.getSlot() == local.getSlot());
} |
8305abfe-e2da-43ec-8d06-fcdbda8a7cdd | 1 | public String operatorsToString(){
String str = new String();
for(Operator operand: operatorStack){
str = str + (operand.toString() + " ");
}
return str;
} |
bed1ba41-13d0-4dad-8cf4-a59a89ce4121 | 9 | public boolean isPrimitive() {
if (clazz.isPrimitive()) {
return true;
}
return is(Boolean.class) || is(Character.class) || is(Byte.class)
|| is(Short.class) || is(Integer.class) || is(Long.class)
|| is(Float.class) || is(Double.class) || is(Void.class);
} |
3c149965-c960-459c-a8a5-685d225d7c61 | 5 | private void sendFile(){
try {
FileReader fr = new FileReader(file);
long numBytes = file.length();
char[] cbuf;
byte[] buffer = new byte[PACKET_LENGTH];
System.arraycopy(ByteBuffer.allocate(4).putInt((int)numBytes/PACKET_LENGTH+2).array(), 0, buffer, 1, 4);
buffer[0]=2;
sendPacket(buffer);
se... |
d824812e-cea7-4aac-a28e-47307e311ebc | 1 | public void removeBit() {
if (length == 0) {
throw new IllegalStateException("no bits to remove");
}
// Shift the bits one place to the right, losing the rightmost bit.
bits = bits >> 1;
length--;
} |
2d745e32-1c7a-4c3b-9994-467ac8734d13 | 9 | public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
java.lang.String itemText = value != null ? value.toString() : "";
if( this.isViewerMode ) {
// Item for current contents preview tool
columnText.se... |
2d5d6470-44b2-41c8-9f15-c73f30396b81 | 0 | public static final int StateInit()
{
return 0;
} |
913dcb0b-52e8-4c12-8027-53cd29db7289 | 1 | private void Traversal(TreeNode root,ArrayList<Integer> list) {
if(root != null){
Traversal(root.left,list);
Traversal(root.right,list);
list.add(root.val);
}
} |
300b1b76-34ae-4b20-9f80-e495dbbddb21 | 7 | public LevelImporter() {
addWindowListener(new WindowAdapter() {
@Override
public void windowClosed(WindowEvent e) {
Game.get().display.getFrame().setVisible(true);
}
});
setResizable(false);
setTitle("Image to Maze");
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
setBounds(100, 100,... |
4f8d956f-e641-4515-9555-f9227ac3cdd9 | 1 | private static void shuffle(Agent[] agents) {
for (int i = 0; i < agents.length - 1; i++) {
int j = prng.nextInt(agents.length - i) + i;
Agent tmp = agents[j];
agents[j] = agents[i];
agents[i] = tmp;
}
} |
a84eee80-b8bb-4098-924c-c8df5cd0da63 | 3 | public int readInt(String pSection, String pKey, int pDefault)
{
//if the ini file was never loaded from memory, return the default
if (buffer == null) {return pDefault;}
Parameters params = new Parameters();
//get the value associated with pSection and PKey
String valueText = getValue(pSection, ... |
e6f4e1ec-ff21-488b-a618-6efafa86ea06 | 6 | private final boolean method730(AbstractToolkit var_ha, Class72 class72_0_) {
if (aClass105_1221 == null) {
if (anInt1230 == 0) {
if (Class101_Sub1.aD5684.method4(-7953, anInt1224)) {
int[] is = Class101_Sub1.aD5684.method6(-21540, anInt1220,
0.7F, anInt1224,
false, anInt1220);
... |
919cc671-0e44-417e-9964-af7d2e487ed0 | 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... |
f88b0b05-2ce3-4220-9f86-989185d51d2a | 7 | public int edmons_karp(int s, int t) {
int u, e;
mf = 0;
this.s = s;
Arrays.fill(p, -1);
while (true) {
f = 0;
Queue<Integer> q = new LinkedList<Integer>();
int[] dist = new int[V];
Arrays.fill(dist, INF);
dist[s] = 0;
q.offer(s);
Arrays.fill(p, -1);
while (!q.isEmpty())... |
f4149792-e2e2-47f9-9ec3-305b730c74b6 | 4 | private boolean interruptCalibration() {
duration += nanoTime() - startTime;
getEventHandler().handleEvent(new CalibrationMessage(epoch, sse, TimeUnit.MILLISECONDS.convert(duration, TimeUnit.NANOSECONDS)));
if (isWalking()) {
try {
sleep(5l);
startTime... |
81856d9a-0289-4480-8d98-1bd5af98419b | 1 | public void loadLower30DegreeSlope(Rectangle2D e) {
for(int x = 0; x < TileSet.tileWidth / 2; x++) {
platforms.add(new Platform(new Rectangle2D.Double(e.getX() + (2f * x), e.getCenterY() + x, 2f, 2f)));
//System.out.println("Lower " + platforms.get(platforms.size() - 1).getBox().getY());
}
} |
88f0172a-f453-41aa-bc5a-969cd3d0d080 | 0 | @Override
public void signalEndOfData() {
// Do nothing
} |
63868fb3-987a-448a-8595-8efda68c60a2 | 4 | private String decoderSerie(int u) {
long D=((u%this.M)*(Outils.inverseModulo(this.W, this.M))%this.M)%this.M;
String s=this.resoudreSacADosSuper(D,TAILLE_ENCODAGE-1);
char[] c=s.toCharArray();
char temp=c[this.sigma1];
c[this.sigma1]=c[this.sigma2];
c[this.sigma2]=temp;
String envers="";
for(int i=0;i<... |
6d43419a-3684-4968-8757-86b46748986b | 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... |
d49f37ae-e00d-469a-89ad-dacd9773866c | 8 | public DirectionalBorderDetectorDialog(final Panel panel, final String title) {
setTitle(title);
this.panel = panel;
setBounds(1, 1, 450, 250);
Dimension size = getToolkit().getScreenSize();
setLocation(size.width / 3 - getWidth() / 3, size.height / 3
- getHeight() / 3);
this.setResizable(false);
setL... |
0b054b16-6bb5-41a0-b6bc-43e39526ce06 | 2 | private void buildHeap( Collection<? extends E> c ) {
// move the elements of c into a complete binary tree
// rooted at top
heap = ( E[] ) c.toArray();
size = c.size();
// let cursor be the rightmost interior node
int cursor = ( size / 2 ) - 1;
// invariant: the children of cursor are val... |
dbb20023-bff0-4128-9f56-db8a53bd336c | 3 | @Override
public void reset() {
fp = null;
if (input.isConnected()) {
if (input.getSource() != null
&& input.getSource().getParent() != null) {
this.setName("plot of "
+ input.getSource().getParent().getName() + "."
+ input.getSource().getName());
hist = new Hist(input.getSource().getPa... |
4eb5fc4e-d166-49f4-8800-6e277c0fa7bd | 1 | public void updateStateBasedOnVelocity() {
if(vx > 0) {
setState(RIGHT);
}
else {
setState(LEFT);
}
} |
626b3f2c-04fa-45a5-8160-21c9f2d008fd | 9 | private boolean r_Step_4() {
int among_var;
int v_1;
// (, line 129
// [, line 130
ket = cursor;
// substring, line 130
among_var = find_among_b(a_6, 18);
if (among_var == 0)
{
return false;
... |
5d8419e1-25a8-4b28-8674-87403254bd2a | 1 | public static void main(String [] args) throws IOException {
// String start = "hit";
// String end = "cog";
// String [] dict = new String[]{"hot","dot","dog","lot","log"};
// HashSet<String> ds = new HashSet<String>(Arrays.asList(dict));
//
// long s1 = System.currentTimeMillis();
/... |
8588423e-9e07-49b4-aaf4-a4b3f18085f3 | 0 | @Override
public boolean supportsDocumentAttributes() {return false;} |
c9b597c4-3afe-4ad3-bfee-8c868e2d6390 | 5 | private ArrayList<Bar> createBars(){
//arrange data lowest to highest
Arrays.sort(data);
int intervalSize = 0;
if(numOfBars > 0) {
intervalSize = (getMaxNumber(data) / numOfBars);
}
int lowerLimit = 0;
int upperLimit = lowerLimit + intervalSize;
int count;
ArrayList<Bar> bars = new ArrayList<Bar... |
da707adb-db87-4e13-8f58-e83b50d76d28 | 5 | private int firstEvenIndexOf(Object elem) {
if (elem == null) {
for (int i = 0; i < size(); i = i + 2) {
if (get(i) == null) {
return i;
}
}
} else {
for (int i = 0; i < size(); i = i + 2) {
if (elem.equals(get(i))) {
return i;
}
}
... |
cfe9c41a-2134-41d4-8c73-08183acb46e0 | 0 | public void setRadius(double radius) {
_radius = radius;
} |
cd7bf18a-9d1a-4a9c-9a5a-6631f1787bab | 9 | public void ReadFile(Message inputMessage, int opID) {
if(AddSharedParentLocks(inputMessage.filePath, opID))
{
//Implement Later
int indexCounter = 1;
System.out.println("Master: trying to read "+inputMessage.filePath + indexCounter);
if (!chunkServerMap.containsKey(inputMessage.filePath + indexCounter)... |
6923ba30-d38d-404c-a0f3-1d8b5c3642c9 | 8 | @Override
public void run() {
try {
server = new ServerSocket(7000);
} catch (IOException e1) {
e1.printStackTrace();
}
try {
System.out.println(new Date() + " --> Server waits for client...");
socket = server.accept(); // blocking
System.out.println(new Date() + " --> Cl... |
a16f2e8f-632b-4735-adf6-4b8ac5311085 | 8 | private Class<?> ensureReplacedClass(Scriptable scope, Object obj,
Class<?> staticType) {
final Class<?> type = (staticType == null && obj != null) ? obj
.getClass() : staticType;
if (!type.isPrimitive() && !type.getName().startsWith("java.")
&& this.replacedClasses.add(type)) {
this.replaceJav... |
d519a131-927e-475b-9fae-18d8286d3c21 | 0 | public int[] getPixels() {
return pixels;
} |
25131623-5702-491b-ac75-0cd50a5cef17 | 9 | @Override
public void execute(CommandSender sender, String[] arg1) {
if (!CommandUtil.hasPermission(sender, PERMISSION_NODES)) {
sender.sendMessage(plugin.NO_PERMISSION);
return;
}
try {
if(plugin.getUtilities().chatChannelExists(arg1[0])){
sender.sendMessage(plugin.CHANNEL_ALREADY_EXISTS);
retu... |
c21eabe7-44e4-4702-853c-3e10e19ec39e | 0 | public boolean save(ArrayList aguardar){
return false;
} |
3cfbe530-2a86-4d36-8140-bb3b313bc5c8 | 0 | @After
public void tearDown()
throws Exception
{
this.scheduler.shutdown();
} |
6082349f-3b1a-4335-b5c9-7974d2d0b0f5 | 1 | public static void update() {
for(Keybinds keybinds : Keybinds.values()) {
keybinds.key.setHeld(keybinds.key.isPressed());
keybinds.key.update();
}
} |
8883ba5e-d12e-4d51-9e23-602b0d560a1b | 7 | public static int longestIncreasingSeq(ArrayList<Person> circus) {
Collections.sort(circus);
Hashtable<Person, Integer> hashtable = new Hashtable<Person, Integer>();
for (int i = 0; i < circus.size(); ++i) {
Person curr = circus.get(i);
if (!hashtable.containsKey(curr)) {
hashtable.put(curr, 1);
}
... |
2ee166a2-4b88-4452-ae98-3fa746956232 | 6 | @Override
public Object getValueAt(int rowIndex, int columnIndex) {
DetallePedido detalle = detalles.get(rowIndex);
switch(columnIndex){
case 0 : return detalle.getIdArticulo();
case 1 : {
try {
return ArticuloController.buscarArticulos(det... |
378508c5-bb10-4dee-acd8-4c7c07bc0b2f | 3 | private void closeChannel(){
try {
if(this.fileInput != null){
this.fileInput.close();
this.fileInput = null;
}
if(this.fileChannel != null){
this.fileChannel.close();
this.fileChannel = null;
}
}catch (IOException ex) {
ex.printStackTrace();
... |
f25b7e13-0563-4df6-873e-3476bc709e36 | 8 | public boolean isOpen(String direction) {
switch (direction) {
case "north":
if (this.north[1].equals("True")) {
return true;
} else {
return false;
}
case "east":
if (this.east[1].equ... |
a19e3c12-31b3-47f3-8ca8-9a0107a4a7f2 | 0 | @Override
public void startSetup(Attributes atts) {
super.startSetup(atts);
setEnabled(false);
addActionListener(this);
Outliner.documents.addTreeSelectionListener(this);
Outliner.documents.addDocumentRepositoryListener(this);
} |
dc207a4c-3466-480d-8e12-f2a2bc5ad006 | 4 | public void setEstrCaso(List<?> list)
{
for(PEstrCaso e : this._estrCaso_)
{
e.parent(null);
}
this._estrCaso_.clear();
for(Object obj_e : list)
{
PEstrCaso e = (PEstrCaso) obj_e;
if(e.parent() != null)
{
... |
63a3e4bf-d3bc-4b46-bc0e-e31378b7dd50 | 6 | * @param renamed_New
* @param old
* @return String
*/
public static String replaceSubstrings(String string, String renamed_New, String old) {
{ int stringlength = string.length();
int oldlength = old.length();
int newlength = renamed_New.length();
int nofoccurrences = 0;
int oldst... |
760370f5-cbf7-4a05-9d4e-a760a3817cd4 | 9 | static CtClass toPrimitiveClass(char c) {
CtClass type = null;
switch (c) {
case 'Z' :
type = CtClass.booleanType;
break;
case 'C' :
type = CtClass.charType;
break;
case 'B' :
type = CtClass.byteType;
break;
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.