method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
3370e1d4-b684-477e-a0ba-693e6a3a0e72 | 2 | public Iterable<WeightedDirectedEdge> pathTo(int v)
{
if (!hasPathTo(v))
return null;
LinkedList<WeightedDirectedEdge> stack = new LinkedList<WeightedDirectedEdge>();
for (WeightedDirectedEdge e = edgeTo[v]; e != null; e = edgeTo[e.from()])
stack.addFirst(e);
return stack;
} |
70e52ab0-8f35-4793-bf9a-8f62f7cd1aa3 | 7 | public void findShape(ShapeModel model, Integer posX, Integer posY) {
ShapeModel shape;
if (model.score > this.maxShape.score) {
for (Integer checkY = 0; checkY < model.height; checkY++) {
for (Integer checkX = 0; checkX < model.length; checkX++) {
shape = checkShape(model, posX, posY, ch... |
7ffb9244-1e70-4a1a-b847-5907679697f8 | 6 | public boolean TeleportPlayerToPlayer(ProxiedPlayer src, ProxiedPlayer dst) {
if (src == null) {
ErrorMsg("TeleportPlayerToPlayer: src is null!");
return false;
}
if (dst == null) {
ErrorMsg("TeleportPlayerToPlayer: dst is null!");
return false;
}
if (src.getName() == dst.getName()) {
Error... |
3befa38d-eb96-4826-9b95-b063aefbd69d | 1 | @Test
public void removeBillByDateTest(){
Household hh = null;
try {
hh = familyService.findHousehold(0);
} catch (InstanceNotFoundException e) {
fail("Household not found");
}
int billOld = hh.getBills().size();
billService.createBill(hh);
Calendar date = Calendar.getInstance();
date.add(Cale... |
ca622755-13f1-4b7f-bdbe-835e6a7c2b32 | 4 | public VuePiece[][] getVue() {
VuePiece[][] tabVues = new VuePiece[8][8];
for (int i = 0; i < 8; i++) {
for (int j = 0; j < 8; j++) {
if (this.tabPieces[i][j] != null && this.tabPieces[i][j].estVivant()) {
tabVues[i][j] = new VuePiece(this.tabPieces[i][j]... |
087dad57-e615-4fbc-aec6-82146829c1b2 | 0 | private void menuExitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuExitActionPerformed
System.exit(1);
}//GEN-LAST:event_menuExitActionPerformed |
ae4ff648-0f14-4ae4-94ab-02a948dd5f93 | 7 | Point determineClosestCentre(Point p, Point centreA, Point centreB) {
//loop counter variable
int l;
//stores the distance between p and centreA
double distanceA = 0.0;
for (l = 0; l < p.dimension; l++) {
//centroid coordinate of the point
double centro... |
57fe4ab7-aacc-4ca3-9d2c-9fccde9ddb5a | 0 | public void print() {
System.out.println(toString());
} |
7e7d1b55-d2ad-40ce-b332-eabf0a4677a2 | 1 | @Test
public void SortingEV_test() {
try{
double x = 2;
SortingEVFilter sort = new SortingEVFilter(true, true);
double [][]mat1= {{1.0,2.0}, {3.0,1.0}};
double []vec1= {1.0,4.0};
sort.passEigenValues(vec1, mat1);
double []result = sort.getEigenValues();
double[] exp={4.0,1.0};
Assert.assertArray... |
ca9d0c13-5e59-4ae3-abfa-02883c5bcc16 | 1 | private String getName(CommandSender sender) {
String name = "";
if (isPlayer(sender)) {
Player player = (Player) sender;
name = player.getName();
}
return name;
} |
9eb565a1-f96d-45fd-8fd9-9cfe92c6a5e8 | 0 | public String getTrainingName() {
return trainingName;
} |
c0db425f-89a4-4e7b-8777-b6e57fec7608 | 4 | private void addToCharBuffer (int in) {
int a;
// 7 bit buffer
for (a=1;a<inChar7.length;a++) {
inChar7[a-1]=inChar7[a];
}
if (in==0) inChar7[6]=false;
else inChar7[6]=true;
// 8 bit buffer
for (a=1;a<inChar8.length;a++) {
inChar8[a-1]=inChar8[a];
}
if (in==0) inChar8[7]=false;
else inChar8[... |
aaffe6d3-fa16-48a8-addc-e6f872d3924a | 3 | public static ArrayList<Velo> getAllVelo() {
Statement stat;
ArrayList<Velo> velos = new ArrayList<>();
try {
stat = ConnexionDB.getConnection().createStatement();
stat.executeUpdate("use nemovelo");
ResultSet res = stat.executeQuery("select * from velo");
... |
485f3082-785a-4593-b24d-d5f700a132cd | 8 | public static Matrix read (BufferedReader input) throws java.io.IOException {
StreamTokenizer tokenizer= new StreamTokenizer(input);
// Although StreamTokenizer will parse numbers, it doesn't recognize
// scientific notation (E or D); however, Double.valueOf does.
// The strategy here is to dis... |
3672fb91-a12d-4e97-b3ce-08c472f40339 | 7 | public void mouseDragged(MouseEvent e){
Point clickPoint = e.getPoint();
if(barrierFlag && clickPoint.x >= 0 && clickPoint.y >=0
&& clickPoint.x <= screen_width && clickPoint.y <= screen_width) {
if(e.getButton() == MouseEvent.BUTTON1 || e.getButton() == 0) {
GridBoard.this.setBarrierPosition(... |
cb038ec3-d41f-4cb8-9864-467f29eeb22a | 3 | Actor(String URL, StringBuilder sourceCode) throws IOException {
int tableStart = 0;
int tableEnd = start;
int ulStart = 0;
int ulEnd = start;
boolean flag = true;
while (flag) {
tableStart = sourceCode.indexOf("<table", tableEnd + 10);
if (tableStart != -1) {
tableEnd = sourceCode.i... |
904e0f5b-b1a9-41de-bda5-2567fcded1b9 | 7 | public static String replace(HashMap<String,String> string2replace, String filePath)
{
String outcome = "";
String newFile = "";
int count = 0;
try
{
if (string2replace.isEmpty() || filePath.equals(""))
{
outcome = "The list for replaci... |
ecfcdcf0-da65-4092-a5ae-3ee38cad9526 | 0 | public PersistentCanvas getCanvas() {
return canvas;
} |
9fead33b-dd2e-4768-9fe0-36a311753c89 | 7 | public boolean runTrace(Trace trace) {
this.getWorkflowPlaces().forEach(Place::clearToken);
List<Event> currentTrace = trace.getEventsList();
in.putToken();
for (Event currentActivity : currentTrace) {
// if out place has a token but trace is not finished
if (out.... |
0dddcb42-cd70-426d-a5fd-27948e40f004 | 5 | public Deck(){
int count = 0;
for(int i = 0; i < 13; i++){
Card testcard = new Card();
testcard.setSuit("Heart");
testcard.setRank(count);
deckCards[i] = testcard;
count++;
}
count = 0;
for(int i = 13; i < 26; i++){
Card testcard = new Card();
testcard.setSuit("Diamond");
testcar... |
15498f26-a704-470e-a081-abf0a99b1987 | 2 | public A delete(A a) {
assert a != null;
Node n = find(a);
if (n == null) {
throw new NoSuchElementException(a + " not found");
} else {
if (n.right() == null) {
sentinel.setLeft(n.left());
} else {
sentinel.setLeft(n.right());
findMin();
sentinel.lef... |
ec764ca4-4602-4880-98e4-6cf82af5a480 | 4 | public String getSubstrings()
{
//TODO complete the stub to return null
int len = wordy.length();
String substrings = "";
for (int i = 0; i < len; i++)
{
String piece = "";
String lastLet = "";
if (i+1 < len)
{
p... |
14777f52-8519-44e6-bcb8-67e5ffc85770 | 9 | @Override
public Success<Statement> parse(String s, int p) {
// Parse the "for".
Success<String> resFor = IdentifierParser.singleton.parse(s, p);
if (resFor == null || !resFor.value.equals("for"))
return null;
p = resFor.rem;
p = optWS(s, p);
// Parse the... |
9515bc49-aceb-4a7b-b98f-19c926716cf0 | 2 | public void dump(FileOutputStream out) throws Exception {
for (int i : MPI_len)
out.write(i & 0xff);
for (int i : MPI_string)
out.write(i & 0xff);
} |
38fde545-cf91-4da8-a07a-3876286d934c | 3 | public void setInteiro(TInteiro node)
{
if(this._inteiro_ != null)
{
this._inteiro_.parent(null);
}
if(node != null)
{
if(node.parent() != null)
{
node.parent().removeChild(node);
}
node.parent(this... |
b501799b-fa0d-424e-b15a-22fb03fa724b | 4 | public CheckResultMessage checkFileName() {
if (fileNameSections.length != fileNameSectionsNumber
|| !fileNameSections[0].equals(fileType)) {
return errorNameFormat();
}
if (fileNameSections.length == 4) {
// 记录期数
monthDate = fileNameSections[3];
} else if (fileNameSections.length == 3) {
// 记录... |
d98b4674-adb9-47f8-8aed-b85c8cd93438 | 9 | private void loadBioPAXMappingsFromXMLNode(Node graphElement) {
NodeList moleculenodes = graphElement.getChildNodes();
for (int i = 0; i < moleculenodes.getLength(); i++) {
Node spesmapnode = moleculenodes.item(i);
// GraphData/Molecules/Molecule
if (spesmapno... |
02a895cc-9482-49d1-a155-badc96d23500 | 4 | public List<String> findFinish(List<String> listWithAllOutgoingStrings, List<String> listWithAllIncomingStrings) {
List<String> possibleFinish = new ArrayList<String>();
int listSize = listWithAllOutgoingStrings.size();
for (String s1 : listWithAllIncomingStrings) {
boolean contain... |
96eb457e-715c-4542-af6a-e6e1b255570b | 1 | public void testSetIntoIntervalEx_Object_Chronology4() throws Exception {
MutableInterval m = new MutableInterval(-1000L, 1000L);
try {
StringConverter.INSTANCE.setInto(m, "/P1Y", null);
fail();
} catch (IllegalArgumentException ex) {}
} |
47200380-c72d-4d5f-b280-ba3ee78a2fb7 | 0 | public double getSecond()
{
return second;
} |
640d9037-42ea-40ac-a772-27e28bbbd5f9 | 6 | public static void STARTUP_ADDRESS_EXAMPLE() {
{ Object OLD_$MODULE$_000 = Stella.$MODULE$.get();
Object OLD_$CONTEXT$_000 = Stella.$CONTEXT$.get();
try {
Native.setSpecial(Stella.$MODULE$, Stella.getStellaModule("/STELLA/XML-OBJECTS/ADDRESS-EXAMPLE", Stella.$STARTUP_TIME_PHASE$ > 1));
... |
f69e5208-29ba-4a92-98e9-5a1d9539db3f | 1 | @Override
public void fire() {
if(timeSinceLastShot > timeBetweenShots) {
firing = true;
timeSinceLastShot = 0;
}
} |
ae5badc7-7a06-4aa2-bc48-f8a145f75267 | 1 | public JSONArray getJSONArray(String key) throws JSONException {
Object object = get(key);
if (object instanceof JSONArray) {
return (JSONArray)object;
}
throw new JSONException("JSONObject[" + quote(key) +
"] is not a JSONArray.");
} |
91f517f7-4319-49a9-9c02-2311bd281753 | 0 | public Long getId() {
return id;
} |
93e66e3d-e9f5-4479-88ec-c08b82fc1e0d | 7 | void scaleImages(String nameOfChangedImage) {
if (SnapshotGallery.sharedInstance().isEmpty()) {
return;
}
if (EventQueue.isDispatchThread())
setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
float w = 0, h = 0;
Insets insets = getInsets();
int w1 = insets.left + insets.right;
int h1 = ins... |
42a3b7f7-3491-4ede-a985-a0b6ee926ebb | 2 | public void loadTiles(File folder){
parent.dp.clearTiles();
//Vector<String> tempImgs = new Vector<ImageIcon>();
File[] listOfFiles = folder.listFiles();
/*for (File file : listOfFiles) {
if (file.isFile()) {
if(file.getName().substring(file.getName().length() - 3, file.getName().length()).equals(... |
64fa7b18-875d-480a-91d3-b3f0c7a38a75 | 6 | private void populateItems(String mapName) throws FileNotFoundException, IllegalArgumentException
{
items = new ArrayList<Placeable>();
Scanner scanner = new Scanner(new File(mapName));
pane.setStyle("-fx-background-image: url('" + scanner.nextLine() + ".png')"); //get background url
while(scanner.hasNextLine(... |
96784220-59d0-4833-8428-89fe6c9a884a | 0 | public Maze(String filePath){
map = new ArrayList<List<Integer>>();
readMaze(filePath);
} |
8ebcb181-5504-4055-bf98-7f0a63f679b5 | 1 | public String toString() {
Iterator<Cluster> it = this.list.iterator();
Cluster c;
String string = this.size() + " cluster/s:\n";
while (it.hasNext()) {
c = it.next();
string += " " + c.getInstances() + "\n";
}
return string;
} |
84e10e0d-a05b-45af-97e3-0467aa01818d | 0 | public static void main(String[] args) {
System.out.println(2147483647);
System.out.println(-2147483648);
System.out.println(9223372036854775807L);
System.out.println(-9223372036854775808L);
} |
69460590-174a-4f8a-98d5-5a86aab6a6e4 | 3 | @Override
public void ejecutar(Stack<Valor> st, MemoriaDatos md, Cp cp)
throws Exception {
if (st.size() < 2)
throw new Exception("CLONAR(" + tam.toString() + "): faltan operandos");
Valor dest = st.pop();
Valor orig = st.pop();
if (dest instanceof Entero && orig instanceof Entero) {
md.clonar((... |
8bbcc8be-72f6-44b4-b7c0-4ffa521af3f9 | 3 | public void move() {
if (currentAnimation != null) {
long currentTime = App.getTime();
if (currentTime - lastFrameTime > 1000.0f / currentAnimation.getFPS()) {
if (++currentFrame >= currentAnimation.getTotalFrames()) {
currentAnimationNumLoops++;
currentFrame = 0;
}
lastFrameTime = current... |
033f70c3-7aac-4edc-becd-4d143178ace6 | 1 | protected Expr copyInto(Expr expr) {
expr = (Expr) super.copyInto(expr);
final DefExpr def = def();
if (isDef()) {
expr.setDef(null);
} else {
expr.setDef(def);
}
return expr;
} |
4b112c65-0f53-46dd-8d92-57b4173a5ee9 | 7 | public int removeElement(int[] A, int elem) {
Arrays.sort(A);
int length = A.length;
if (length == 0) return 0;
else if (length == 1)
{
if (A[0] == elem) return 0;
else return 1;
}
int start = binarySearch(A,0,length,elem);
if (start == -1) return length;
i... |
b924a01e-ce7d-4e5b-9b71-0fce3b284365 | 6 | private boolean compleixResDomini(Clausula c, ClausulaNom cn, Quadricula q) {
if( !this.cjtRestGS.ComprovarRes(c, cn)) return false;
if (!cjtRgraula.ComprovarRes(c, cn)) return false;
if (!cjtRass.ComprovarRes(c,cn)) return false;
if (!cjtRula.ComprovarRes(c,cn)) return false;
... |
a05509fa-d99e-4b2d-9c1b-243c5872e06c | 5 | public Connector getConnector(int x, int y) {
for (Connector connector : connectors) {
double ax = connector.getFrom().getLocation().getX();
double ay = connector.getFrom().getLocation().getY();
double bx = connector.getTo().getLocation().getX();
double by = conne... |
a867b55c-6eff-432a-8900-44c9807dc72c | 7 | public static void compress(InputStream fins, OutputStream outs) {
int value = 1;
byte[] pattern = new byte[0];
byte[] byteArray = new byte[8192];
boolean isEmpty = true;
Map<Byte, byte[]> dictionary = new TreeMap<>();
boolean patternAlreadyExist;
int numberOfByte... |
dbccbda4-c13b-4cfb-aa41-0d55a78dba04 | 0 | public Double getPeakTrack() {
return peakTrack;
} |
413668ec-daff-490c-afec-acb14e3ce681 | 5 | public boolean sDown(){
boolean change = false;
for(int i =0 ; i < 4 ; i++){
for (int j = 3 ; j > -1 ; j--){
//MOVING
if(mDown(i, j))
change = true;
}
//SUMMING
if (aDown(i))
change = true;
}
//GEN A NEW TILE
if(change)
genTile();
return change;
} |
8ced2c05-7bd2-418a-b21a-fdc58b1561ed | 5 | public String getCampoProducto(String clave, beansProducto prod){
if(clave.trim().equals("nombre"))
return prod.getNombre();
if(clave.trim().equals( "precio"))
return Integer.toString(prod.getPrecio());
if(clave.trim().equals("categoria"))
return prod.getCategoria();
if(clave.trim().equals("existencias... |
c32d4dec-e3a5-4015-a841-948e6bd907e5 | 6 | private void checkParameters(int[] pointerParam, Object[] tapeParam) {
if (pointerParam == null || tapeParam == null) {
throw new NullPointerException("Pointer and Tapes must not be null");
}
if (pointerParam.length == 0 || pointerParam.length != tapeParam.length) {
throw new InvalidParameterException("Po... |
7e815301-e40b-4007-ba45-2b67da402fd8 | 7 | public String toString() {
switch (type) {
case START_FLUSH:
return "FLUSH[type=START_FLUSH,viewId=" + viewID;
case STOP_FLUSH:
return "FLUSH[type=STOP_FLUSH,viewId=" + viewID + "]";
case ABORT_FLUSH:
... |
1d1ba2dc-8eb1-40e0-80e1-860d8d2facae | 4 | public static void UpperCreator(){
try {
if(conn == null || conn.isClosed()){
conn = DatabaseConnection.getConnection();
}
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
try{
conn.setAutoCommit(false);
PreparedStatement stm... |
d06c6d01-5860-4282-99ff-9c8337d00ef5 | 6 | private static void parseComplexKey(String key,Map node,Object value){
if(StringUtils.isBlank(key)){
return;
}
if(!key.contains(".")){
node.put(key, value);
return;
}
if(key.startsWith(".") || key.endsWith(".")){
throw new InvalidPr... |
bc5ee793-76ba-4746-872d-2c00ed2c5239 | 2 | CachedValue(V payload, long keepAliveTimeMsecs) {
if (payload == null) {
throw new IllegalArgumentException("Cannot accept null values.");
}
if (keepAliveTimeMsecs < 0) {
throw new IllegalArgumentException("Invalid keepAliveTime" + keepAliveTimeMsecs);
}
this.payload = payload;
this.... |
abda950e-e1d4-4115-bb93-cf328c18cdfd | 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);
... |
d3633e75-1eae-4a40-abd6-55a098d2c303 | 7 | private boolean r_Step_5a() {
int v_1;
int v_2;
// (, line 100
// [, line 101
ket = cursor;
// literal, line 101
if (!(eq_s_b(1, "e"))) {
return false;
}
// ], line 101
bra = cursor;
// or, line 102
lab0: do {
v_1 = limit - cursor;
lab1: do {
// call R2, line 102
if (!r_R2()) {
... |
59388fa2-087d-4922-a7c0-d825c56bc629 | 8 | @GET
@Produces("text/html; charset=UTF-8")
public String createBOM(@QueryParam("url") String urlString) throws IOException, InterruptedException {
BOMFactory bomFactory = new BOMFactory();
URL url;
try {
url = new URL(urlString);
} catch(MalformedURLException e) {
... |
b0c3e332-2c4e-44ff-9c8e-131e3cf72b39 | 1 | public GameEnding(boolean youWin,final Game game){
setSize(WIDTH,HEIGHT);
setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
setLocationRelativeTo(null);
setLayout(new BorderLayout());
JLabel label= new JLabel(youWin? victory :defeat);
add(label,BorderLayout.CENTER);
JPanel panel = new JPanel();
pane... |
7337452e-40b9-4f99-ba81-d0b7c16919ba | 8 | public void run() {
while (true) {
for (int i = 0; i < Server.projectiles.size(); i++) {
Projectile p = Server.projectiles.get(i);
p.update();
for (int j = 0; j < Server.MAX_USERS; j++)
{
Users u = Server.user[j];
if (u != null)
{
if (p.getX() > u.getX()-2 && p.getX() < u.getX(... |
dce1f085-24f1-4bc6-8fff-4e6d9ae081d6 | 1 | public void dumpExpression(TabbedPrintWriter writer)
throws java.io.IOException {
/*
* There are special cases where a cast isn't allowed. We must cast to
* the common super type before. In these cases instanceof always return
* false, but we want to decompile even bad programs.
*/
Type superType = i... |
3ecdee92-6517-4d6e-a5cd-48de71f2a6e5 | 3 | public static Set<Edge> getAll(Coordinates c, Ship ship, Ship completelyConnectedShip) {
Set<Edge> adj = new HashSet<Edge>(ship.nodeMap.get(c).getAdjacent());
Set<Set<Node>> adjNodeSets = new HashSet<Set<Node>>();
for (Edge e : adj) {
adjNodeSets... |
6e7388a0-a1a0-4477-a1f9-1f9cbcdf2799 | 1 | public void shuffle(Object a[]) {
int n = a.length;
for (int i = 0; i < n - 1; i++)
exchange(a, i, i + randomMod(n - i));
} |
e9b1b259-b9f4-47b0-a920-e179dfbcbdcf | 9 | public void mainMenu() {
System.out.println("");
int choose;
do {
System.out.println("1.开户 \n2.存款 \n3.取款 \n4.余额查询 \n5.修改密码 \n6.转账 \n0.退出");
if (in.hasNextInt()) {
choose = in.nextInt();
switch (choose) {
case 1:
... |
fe9ed658-72d5-4488-8b1b-70a0040c07b1 | 8 | private synchronized void dropPacket(Packet pnp)
{
increaseDroppedPktCounter(); // increase the counter of dropped packets
// First: check if the new incoming packet is a control packet or not.
int src_outputPort;
String src_outputPort_str;
int dst;
String dst_str;
... |
293c1adb-3cc6-4e12-ae6d-9a6491265db8 | 0 | public void resetGrowth() { growth = 0; } |
07ebe038-e8fb-4d78-8dfe-fcddb178bb07 | 1 | protected void btnRemoverEnderecoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnRemoverEnderecoActionPerformed
if(JOptionPane.showConfirmDialog(rootPane, "Você tem certeza que deseja"
+ " Remover o item ? ","",JOptionPane.OK_CANCEL_OPTION) == 0){
listaEnderecos... |
67ce6005-329e-44de-b9db-a8b991414b1e | 9 | private boolean test1Redo() throws UtilityException, SocketException, UnknownHostException, IOException, MessageAttributeParsingException, MessageHeaderParsingException{
int timeSinceFirstTransmission = 0;
int timeout = timeoutInitValue;
while (true) {
// redo test 1 with address and port as offered in the cha... |
06a882fc-efd8-45e7-a4aa-c7e75c1dcae0 | 9 | public boolean setInputFormat(Instances instanceInfo) throws Exception {
super.setInputFormat(instanceInfo);
m_AttIndex.setUpper(instanceInfo.numAttributes() - 1);
if (!isNumeric() && !isNominal()) {
throw new UnsupportedAttributeTypeException("Can only handle numeric " +
"or nominal attribu... |
523b93f4-4175-4f0c-8da5-bbf1c9cf45b0 | 4 | public static void getSimilarDocuments(String fileName,String dirName) throws IOException{
File dir = new File(dirName);
if (dir.isDirectory()) {
String[] fileNames = dir.list();
File fich=new File(DIRNAME+"/similarities/"+FILE+".sim");
FileOutputStream ps=new FileOutputStream(fich);
PrintWriter ecrivain... |
d32fa8c6-5bfa-4eb8-a2e7-3ddabf160737 | 1 | public void sendPacket(Object o) throws IOException {
//System.out.println("Server Sending Data: " + o + "(" + address.toString() + ":" + port + ")");
try {
ByteArrayOutputStream byteStream = new ByteArrayOutputStream(5000);
ObjectOutputStream os = new ObjectOutputStream(new Buff... |
f93a6cb5-3ca9-4ffc-b949-09b1316ea679 | 6 | private static void supprimerCours(Etudiant etudiant, Cours cours) {
Inscription etudiantInscription; // L'inscription d'un etudiant
Inscription tempEtudiantInscription; // Variable temporaire de l'inscription d'un etudiant
Inscription coursInscription; // L'inscription a un cours
Inscription t... |
4e88bb3c-bdba-4a73-bea2-d6042517895d | 9 | protected void loadFields(com.sforce.ws.parser.XmlInputStream __in,
com.sforce.ws.bind.TypeMapper __typeMapper) throws java.io.IOException, com.sforce.ws.ConnectionException {
super.loadFields(__in, __typeMapper);
__in.peekTag();
if (__typeMapper.isElement(__in, ApexClass__typeInfo)) {
... |
da86f435-91de-4de1-8b91-22253f6aaf79 | 8 | private void count(int ix, int iy) {
if (ix == 0) {
if (iy == 0) {
doCornerLeftTop(ix, iy);
} else if (iy == yMax) {
doCornerLeftBottom(ix, iy);
} else {
doBorderLeft(ix, iy);
}
} else if (ix == xMax) {
... |
41e5877f-077c-4cde-b892-a37d40889a68 | 5 | public void handleLeftClick(double x, double y, SUIComponent concerned){
if(cancel.equals(concerned))
frame.goTo(new PlayConfigPanel(frame));
else if(host.equals(concerned))
frame.goTo(new HostPlayPanel( new SmashServer( new SmashGame(frame.getProperties()), map), frame));
else if(map_set.equals(concerned))... |
2975c426-f566-437a-abb0-dcae6cec53a6 | 7 | public void run() {
byte[] receiveData = new byte[10000];
while(true && !this.stop) {
try {
DatagramPacket receivePacket = new DatagramPacket(receiveData, receiveData.length);
getServer().receive(receivePacket);
ByteArrayInputStream bis = new ByteArrayInputStream(receivePacket.getData());
ObjectI... |
84a180c3-22a7-4fc7-93ba-9398a1182b88 | 2 | private static int method172(int arg0, int arg1) {
int k = Region.method176(arg0 + 45365, arg1 + 0x16713, 4) - 128 + (Region.method176(arg0 + 10294, arg1 + 37821, 2) - 128 >> 1) + (Region.method176(arg0, arg1, 1) - 128 >> 2);
k = (int) (k * 0.29999999999999999D) + 35;
if (k < 10) {
k = 10;
} else if (k > 60)... |
7a086a71-2d75-45f3-b6f3-137b10d09189 | 4 | public List<Tuple<Integer,Integer>> getPath ( Tuple<Integer,Integer> start, Tuple<Integer,Integer> goal ) {
List<Tuple<Integer,Integer>> o = new ArrayList<Tuple<Integer,Integer>>();
// Don't run A* for a trivial case
if ( start.equals(goal) ) {
o.add(goal);
return o;
}
// Check to see if we already ... |
5092505c-898a-4f21-a473-dcff4b3c88b4 | 8 | * @return Stella_Object
*/
public static Stella_Object deobjectifyTree(Stella_Object self) {
{ Surrogate testValue000 = Stella_Object.safePrimaryType(self);
if (testValue000 == Logic.SGT_STELLA_CONS) {
{ Cons self000 = ((Cons)(self));
{ Cons result = Stella.NIL;
{ Stella_... |
65e75f69-cdea-40ef-b182-d74d73587015 | 0 | public Clip getClip() {
return clip;
} |
5fcf580f-f536-41da-bd50-27100bf723e1 | 0 | @Override
public void warning(JoeException someException) {
System.out.println(someException.getMessage()) ;
this.errorOccurred = true;
} // end method warning |
ae03b035-8b46-40d6-9c97-f35dd0844893 | 7 | private static int partion(int[] n, int start, int end) {
int tmp = n[start];
while (start < end) {
while (n[end] >= tmp && start < end) {
end--;
}
if (start < end) {
n[start++] = n[end];
}
while (n[start] < tmp && start < end) {
start++;
}
if (start < end) {
n[end--] = n[start]... |
84805608-a1c5-40b4-a729-8a61b06181a6 | 0 | public void setDate(String date) {
this.date = date;
} |
8e7fd934-8b2e-442f-bbca-8e62e4333899 | 3 | public String toString(){
String line="";
line = this.left;
line+=" -> ";
int ct =0;
for( String s: right){
if( ct == dot){
line += ".";
}
line+=s+" ";
ct++;
}
if( ct == dot){
line += ".";
}
return line;
} |
610effdb-3c0c-429e-bb6b-085a8bca8076 | 9 | int StartDFS ()
{
cParent = -1;
System.out.println ("Starting DFS traversal from first node");
System.out.print ("Visiting nodes - ");
for (Node node : nodes)
if ((node.GetPrdCnt ()) == 0) // only start from nodes without predecessors
{
if (cParent == -1)
cParent = node.GetSeqNo ();
... |
d3b02b1b-09c3-45ec-b54e-83d43594f852 | 5 | public static void main(String[] args) {
// String name = "BPRABHAT";
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
System.out.print("Please enter user name : ");
String name = null;
try {
name = reader.readLine();
} catch (IOException e) {
e.printStackTrace();
}
... |
00d00f95-0225-4a8b-aa5e-74b0895cb87a | 1 | public void draw(Graphics g)
{
if (team)
{
g.setColor(Color.black);
}
else
g.setColor(Color.white);
g.fillOval(where.x + 16, where.y + 16, 48, 48);
} |
acda8b14-bf6e-4337-a932-41ada652aeb3 | 0 | public static void showResult(){
System.out.println("自分で駒を数えて勝敗判定してちょ!");
} |
f8954cd7-75ce-4c8a-8e61-69d517fe5c22 | 9 | protected Background(
String name, String costumeTex, String portraitTex,
int standing, int guild, Object... args
) {
this.name = name ;
if (costumeTex == null) this.costume = null ;
else this.costume = Texture.loadTexture(COSTUME_DIR+costumeTex) ;
if (portraitTex == null) this.portrait = null... |
92ff330f-b50c-4fc9-a330-a6ea51e80a80 | 5 | public boolean locationInsideHitbox(double x, double y) {
Iterator<Rectangle> it = hitboxes.iterator();
while(it.hasNext()) {
Rectangle rec = it.next();
if(x > rec.x && x < rec.x + rec.width && y > rec.y && y < rec.y + rec.height) {
return true;
}
... |
03d51493-4e35-4038-9cae-71aad35df4d5 | 7 | public U1A4_SleepView(SingleFrameApplication app) {
super(app);
initComponents();
// status bar initialization - message timeout, idle icon and busy animation, etc
ResourceMap resourceMap = getResourceMap();
int messageTimeout = resourceMap.getInteger("StatusBar.messageTimeout"... |
72c9996c-f58c-41cf-a83e-f8001a67d042 | 3 | @Override
public Component getListCellRendererComponent(JList list, Object value,
int index, boolean isSelected, boolean cellHasFocus) {
// Assumes the stuff in the list has a pretty toString
setText (value.toString ());
// here the highlighting of every second row is defined
if ( ( index + 2 ... |
9b26db99-cfde-4ec6-9333-049eff12e924 | 2 | public Object elementAt(int i) {
if (i < 0 || elements <= i)
return null;
return objects[i >> ABITS][i & (ASIZE - 1)];
} |
12f0dbb4-33b4-4458-a4ff-334b9d1d1a91 | 4 | private void PopulatePatientTable()
{
ResetPatientTable();
ResetVRTable();
ResultSet rs = dbQuery.Doctor_GetPatientList(this.user.DoctorID, txt_FirstName.getText(),
txt_LastName.getText(),
txt_PatientID.getText(),
"2013-01-01 00:00:00",
"2015-01-01 00:00:00");
// "YYYY-MM-dd HH:mm:SS");
... |
7cb80238-7fc7-4155-8c5e-408a21b9f3d5 | 8 | public static MessageTCP getTCPInput(BufferedInputStream input, int argNum, boolean size) throws IOException{
byte[] inputBuff = readFile(input);
byte[] resultBuff = null;
System.out.println(new String(inputBuff, "UTF-8"));
Scanner sc = new Scanner(new ByteArrayInputStream(inputBuff));
String[] args = new Str... |
412f1806-9f98-4591-9fa4-9373f09369da | 4 | public void dfs(Node rt)
{
Stack<Node> s = new Stack<Node>();
if(rt != null) s.add(rt);
while(!s.isEmpty())
{
Node tNode = s.pop();
System.out.print(tNode.value+" ");
if(tNode.right!=null)
s.add(tNode.right);
if(tNode.left!=null)
s.add(tNode... |
d3deb60e-47e0-4cdf-b319-ce0dcbb9cb08 | 5 | public Updater(ThreadGroup threadGroup, JarInputStream in) {
super(threadGroup);
this.manifest = in.getManifest();
JarEntry entry;
try {
while ((entry = in.getNextJarEntry()) != null) {
byte[] bytes = IOUtil.read(in);
if (entry.getName().endsWi... |
a7202d26-ea35-42dc-b38c-c92f0afb70ea | 7 | @SuppressWarnings("deprecation")
@EventHandler(priority = EventPriority.MONITOR)
public void burningBlocks(BlockBurnEvent event){
Block b = event.getBlock();
int i = 0;
if(!event.isCancelled()){
for(i = 1; i <= plugin.canjoin.size(); i++){
if(plugin.canjoin.get(i)){
i = plugin.canjoin.size()+1;
... |
3bd9c0e6-4821-4d6c-add8-2bc574a4862a | 7 | public boolean continueUntilFinished() {
while (running) {
if (!stepInPending && !stepOutPending && !stepOverPending) {
savedEnvironmentStackSize = environmentStack.size();
}
ByteCode code = program.getCode(pc);
code.execute(this);
this... |
a81736a3-4793-4858-bb5f-2a167f08089e | 4 | private MapObject[] getNearObjects(int x, int y)
{
MapObject[] nearObjects = new MapObject[4];
nearObjects[0] = x < grid.length-1 ? grid[x+1][y].getObject() : null;
nearObjects[1] = x > 0 ? grid[x-1][y].getObject() : null;
nearObjects[2] = y > 0 ? grid[x][y-1].getObject() : null;
nearObjects[3] = y < grid[x... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.