method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
3eb178b1-74e3-4731-82e1-601e9b7dc1ba | 5 | public Wizard(String password) throws IOException {
// Netzwerk initialisieren
LOG.debug("initializing ConnectionListener...");
cl = new ConnectionListener(Settings.getPortNumber(), password, packetqueue);
LOG.debug("initializing done");
// Warten auf Start Kommando. bis dahin B... |
4d9944bd-4e99-4504-acdb-e118ada5b32c | 3 | public static String unobfuscatePasswd(byte[] obfuscated) {
DesCipher des = new DesCipher(obfuscationKey);
des.decrypt(obfuscated, 0, obfuscated, 0);
int len;
for (len = 0; len < 8; len++) {
if (obfuscated[len] == 0) break;
}
char[] plain = new char[len];
for (int i = 0; i < len; i++) ... |
965f1e3a-5389-46da-95f7-6eebb2e42e0e | 7 | public void write(int bits, int width) throws IOException {
if (bits == 0 && width == 0) {
return;
}
if (width <= 0 || width > 32) {
throw new IOException("Bad write width.");
}
while (width > 0) {
int actual = width;
if (actual > t... |
fa3710b7-708f-47a5-aa2f-91181258ba05 | 7 | public static void main(JSONObject data)
{
String pr_string="";
payment = data;
Service.WriteLog(payment.toString());
try {
pr_string = payment.getString("params");
File fXmlFile = new File("/home/terminal/lib/print/print.xml");
DocumentBuilderFac... |
20f4e1b6-6139-4a99-8d9a-2c174fb2bcde | 5 | public String encode(String plain)
{
int[] key_num=Cadenus.generate_order(key);
// int last_digit=key_num[key_num.length-1];
char[][] trans_block=Gromark.build_trans_block(key_num,key);
char[] keyed_alphabet=build_keyed_alphabet(trans_block,key_num);
//int primer=get_num(key_num);
//int[] num_k=generate_nu... |
b1108b5f-fa8b-4dcf-8111-e5de5edbba02 | 0 | public void unloadDimension(){
current.removeFromParent();
current = null;
} |
ed775268-8bd3-4ca4-8a4d-b2debbc81fe1 | 8 | private void string(String value) throws IOException {
String[] replacements = htmlSafe ? HTML_SAFE_REPLACEMENT_CHARS : REPLACEMENT_CHARS;
out.write("\"");
int last = 0;
int length = value.length();
for (int i = 0; i < length; i++) {
char c = value.charAt(i);
String replacement;
if... |
f8b372d9-ef13-49ed-973e-db21769ba6ea | 4 | public void makeMuscles() {
Mass one;
Mass two;
double restLength;
double constant;
double amplitude;
NodeList nodes = myDoc.getElementsByTagName(MUSC);
for (int i = 0; i < nodes.getLength(); i++) {
restLength = -1;
constant = 1;
Node springItem = nodes.item(i);
NamedNodeMap nodeMap = spring... |
e032fe59-b148-4be7-8a00-544ee7e08fd2 | 9 | public void load(String fileLoc)
{
Scanner sc = null;
try
{
File file = new File("src/res/maps/" + fileLoc);
if (!file.exists())
{
System.out.println("No File! " + fileLoc);
return;
}
sc = new Scanner(file);
{
tileWidth = sc.nextInt();
tileHeight = sc.nextInt();
mapW... |
f02dc986-7e60-45c2-ad9a-736248a280b4 | 4 | public void movie(int level,int x,int y,int w,int h,char[][] board){
if(x-1>0){//can left
// board[x-1][y];
movie(level+1,x-1,y,w,h,board);
}
if(x+1<w){//can right
}
if(y-1>0){//can up
}
if(y+1<h){//can down
}
} |
6d4a0706-c56a-4acb-b4ab-b881f6517241 | 6 | public void startSimStepMode() {
if (turn < 73000 && endSim == false) {
year = turn / 3650;
day = turn / 10;
turnByDay = turn % 10;
// Updates the time on the GUI
time = "Turn: " + turnByDay + " Day: " + day + " Year: " + year;
simGUI.setTime(time);
// Colony ants take their turn first... |
be52d3c0-ef3f-49b0-8bc8-9ebde3ba039d | 9 | protected List<String> getHeaderBodyText(String type, List<String> text)
{
List<String> resultTextList = new ArrayList<String>();
boolean foundNonHeaderLine = false;
int currentIndex = 0;
String currentLine;
while (currentIndex < text.size()
&& ((type.equals(G... |
c0cbf890-f64b-438d-b31c-4c86852927dc | 2 | public static double chiSquareMode(int nu) {
if (nu <= 0) throw new IllegalArgumentException("The degrees of freedom [nu], " + nu + ", must be greater than zero");
double mode = 0.0D;
if (nu >= 2) mode = nu - 2.0D;
return mode;
} |
3bfe2f2b-60ce-454b-8d44-87e4420e1abb | 5 | private static void add_Iron_Dome(War war) {
IronDome dome;
Queue<IronDome> IronDomes = war.getIronDomes();
while (true) {
dome = null;
System.out.println("Enter Iron Dome ID: ");
String id = scanner.next();
for (IronDome idome : IronDomes) {
if (idome.getDomeId().equalsIgnoreCase(id)) {
dome... |
3282e561-b7a2-450a-878e-a2f976083e3f | 7 | public static List<Integer> MergeTwoSortedLists(List<Integer> one, List<Integer> two) {
List<Integer> mergedList = new ArrayList<Integer>();
int i1 = 0, i2 = 0, s1 = one.size(), s2 = two.size();
while (i1 < s1 || i2 < s2) {
if (i1 < s1 && i2 < s2) {
if (one.get(i1) < two.get(i2)) {
mergedList.add(one.... |
ac5b3375-7866-4ea1-8967-7b878d69f28b | 8 | private String formatTime(long millis){
String formattedTime;
String hourFormat = "";
int hours = (int)(millis / 3600000);
if(hours >= 1){
millis -= hours * 3600000;
if(hours < 10){
hourFormat = "0" + hours;
}
else{
hourFormat = "" + hours;
}
hourFormat += ":";
}
String minut... |
58fe5a56-8eaf-48e4-8281-5f9f0da066d5 | 0 | public String toString(String input) {
return name + calc(input);
} |
ccc28c76-399b-434a-a42d-9be2f0b35bd4 | 5 | public ArrayList<String> anagrams(String[] strs) {
ArrayList<String> rst = new ArrayList<String>();
Map<String, List<String>> classSet = new HashMap<String, List<String>>();
for (int i = 0; i < strs.length; i++) {
String standard = getStandard(strs[i]);
List<String> ele = classSet.get(standard);
if (el... |
1b7dee65-06b3-46cf-a580-11d3db87ba1d | 8 | public void addToManager(int workerId, int managerId) {
boolean workerExists = false;
boolean managerExists = false;
Employee manager = null;
for (Employee employee : staff) {
if (employee.getId() == workerId) {
workerExists = true;
}
i... |
067ccae8-f7a3-48a8-8f82-d797050d9199 | 7 | public VolumeID setDriveType(int n) throws ShellLinkException {
if (n == DRIVE_UNKNOWN || n == DRIVE_NO_ROOT_DIR || n == DRIVE_REMOVABLE || n == DRIVE_FIXED
|| n == DRIVE_REMOTE || n == DRIVE_CDROM || n == DRIVE_RAMDISK) {
dt = n;
return this;
} else
throw new ShellLinkException("incorrect drive type... |
083ee688-4ba7-4469-9eca-c84fcc547709 | 2 | @RequestMapping(value = {"/CuentaBancaria/id/{idCuentaBancaria}"}, method = RequestMethod.GET)
public void read(HttpServletRequest httpRequest, HttpServletResponse httpServletResponse, @PathVariable("idCuentaBancaria") int idCuentaBancaria) {
try {
ObjectMapper jackson = new ObjectMapper();
... |
87478750-f38d-40a9-ba8c-9c2a6db1accf | 5 | @Override
public void add(T element) { // sorted insert
LLNode<T> newNode = new LLNode<T>(element);
current = head;
while (current!=null){
if (current.compareTo(newNode)>0){
if (current==head){ //add to front
newNode.setLink(head);
head=newNode;
break;
} else { //add in middle... |
b055ac12-19a1-4332-8091-0cfe3e12dcbc | 7 | public double getCurrentActivityFracComplete() {
switch (this.currentStatus) {
case NOT_STARTED:
return 0.0;
case RUNNING:
case PAUSED:
case CANCELLING:
return this.taskMonitor.getCurrentActivityFractionComplete();
case ... |
58da038d-cc5b-41c3-9ad2-8af2653a8e31 | 9 | public void destroy(Integer id) throws IllegalOrphanException, NonexistentEntityException {
EntityManager em = null;
try {
em = getEntityManager();
em.getTransaction().begin();
Aplicacao aplicacao;
try {
aplicacao = em.getReference(Aplicaca... |
508dd28b-5e27-4c99-990a-b9150f67da9a | 2 | public void countOut() {
if (this.type != NodeType.INPUT) {
double out = 0.0;
for (int i = 0; i < getIncomingLinks().size(); i++) {
out += getIncomingLinks().get(i).getWeight() * getIncomingLinks().get(i).getIn_node().getPotential();
}
double newPo... |
bc846031-9f95-4946-8b8a-e8a7542a71a8 | 8 | public void msgChannel (IRCMessage m)
{
// System.out.println("APP: chan");
if (m.getPrefixNick().startsWith("s-")) // server msg
{
int tableID = 0;
String msg = m.params[1];
Scanner s = new Scanner(msg);
if (s.hasNext(tablePattern))
{
tableID = s.nextInt();
if ((tableID < 0) ... |
e283c931-b837-4f98-b4af-49be8fbaa2b3 | 5 | @Override
public boolean equals(Object o) {
if (!(o instanceof TextureRegion)) return false;
TextureRegion t = (TextureRegion) o;
return file.equals(t.file) && x == t.x && y == t.y && width == t.width && height == t.height;
} |
94f22428-3bbd-4f2b-a75a-da4a5098f54e | 3 | boolean isValid() {
return !(Double.isInfinite(x) || Double.isNaN(x) ||
Double.isInfinite(y) || Double.isNaN(y) );
} |
16888e37-1088-42b3-bb73-4d48b55a97e7 | 1 | public void downdload(String rep, String file){
System.out.println("Downloading file");
try{
ftp.downloadFile(rep, fileRep+file);
System.out.println("File downloaded");
}
catch(Exception e){
e.printStackTrace();
}
} |
5a1a790a-f8d8-43c2-a1ad-7e97733940d6 | 4 | public boolean findAtSW(int piece, int x, int y){
if(x==7 || y==0 || b.get(x+1,y-1)==EMPTY_PIECE) return false;
else if(b.get(x+1,y-1)==piece) return true;
else return findAtSW(piece,x+1,y-1); // there is an opponent
} // end findAtSW |
abe5e32e-0b05-4ba9-bf02-e92792e19a73 | 0 | @Override
public void setAddress(Address address) {
super.setAddress(address);
} |
ba67297a-5bf0-42c3-8153-81ad72da2404 | 8 | private void consolidate() {
// Initialize array by making each entry NIL.
int arraySize = ((int) Math.floor(Math.log(n) * oneOverLogPhi)) + 1;
Entry array[] = new Entry[arraySize];
if (min != null) {
for (Entry w : min.nodelist()) {
// Find two roots x and y in the root list with the s... |
714f491d-1960-47b7-b0ca-6ca0c663c487 | 5 | public MyriadSocketReader(SocketReaderParameters parameters) {
// read input parameters from job config
this.nodePath = parameters.getDGenNodePath().getAbsolutePath();
this.outputBase = parameters.getOutputBase().getAbsolutePath();
this.datasetID = parameters.getDatasetID();
this.stage = parameters.getStage()... |
70dd0353-193e-4f16-994a-1bbe15498b4c | 9 | protected void paintComponent(Graphics g) {
super.paintComponent(g);
if (ziel != null && player != null) {
Rectangle zielRec = new Rectangle((int) ziel.getX() - 10,
(int) ziel.getY() + 25, 20, 20);
Rectangle playerRec = new Rectangle(spieler.playerx + 25,
spieler.playery + 100, 25, 20);
g.drawRec... |
ad79ea57-5c3c-4b1e-a2c0-897a2ab85dda | 8 | private void aceptSelectActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_aceptSelectActionPerformed
boolean error = false;
String errorString = "";
Object[] what = new Object[7];
what[0] = conectionBoolean.isSelected();
if (!userSelectData.getText().equalsIgnore... |
813416a1-793a-49fe-ad93-3350cf53fda4 | 5 | public void miseAJourEtatsBateaux() {
this.etatBateaux.setVisible(manuel || this._partie.isAutomatique());
this.etatBateaux.removeAll();
this.bateaux.setVisible(manuel || this._partie.isAutomatique());
this.bateaux.removeAll();
Iterator ite = this._partie.getCasesBateaux... |
91df9132-c004-4344-9307-f9a7658adec4 | 8 | static String getModifiersText(int modifiers) {
StringBuffer buf = new StringBuffer();
if ((modifiers & InputEvent.SHIFT_DOWN_MASK) != 0) {
buf.append("Shift ");
}
if ((modifiers & InputEvent.CTRL_DOWN_MASK) != 0) {
buf.append("Ctrl ");
}
if ((modifiers & InputEvent.META_DOWN_MASK) != 0) {
buf.app... |
8c2bb55a-5153-4506-9b4d-1e5d1104fbb2 | 7 | static String d(String s, String t) {
int[][] b = new int[s.length()+1][t.length()+1];
for (int i = s.length() - 1; i >= 0; i--) {
for (int j = t.length() - 1; j >= 0; j--) {
if (s.charAt(i) == t.charAt(j)) {
b[i][j] = b[i+1][j+1] + 1;
} else {
b[i][j] = Math.max(b[i+1][j], b[i][j+1]);
}... |
145e1425-ebb1-483f-a466-30ef50d1704a | 9 | static private String getTypeFromUnit(String s){
for (int i = 0; i < weightUnits.length; i++) {
if (weightUnits[i].unit.equalsIgnoreCase(s) ||
weightUnits[i].abrv.equalsIgnoreCase(s)) {
return "weight";
}
}
for (int i = 0; i < volUnits.length; i++) {
if (volUnits[i].unit.equalsIgnoreCase(s... |
ccdaaeb1-4752-4bce-a9bf-3b681b56e84f | 7 | public boolean addUserToTopic(final String topicKey,
final String userKey,
final String userName,
final String channelToken) throws TopicAccessException {
assert topicKey != null && topicKey.trim().length() > 0... |
c6d26344-8f04-47ee-8b55-86e0f9e05a22 | 2 | public void setOption(String option, Collection values) {
if (option.equals("or")) {
isOr = true;
matchers = (IdentifierMatcher[]) values
.toArray(new IdentifierMatcher[values.size()]);
} else if (option.equals("and")) {
isOr = false;
matchers = (IdentifierMatcher[]) values
.toArray(new Identi... |
8064f5ee-29a6-42ac-9de3-4059b68a301b | 1 | public FileConfiguration get() {
if (config == null) {
reload();
}
return config;
} |
b0c86940-7a31-4e73-b55e-44ef7ef09e1a | 7 | public int read(int width) throws IOException {
if (width == 0) {
return 0;
}
if (width < 0 || width > 32) {
throw new IOException("Bad read width.");
}
int result = 0;
while (width > 0) {
if (this.available == 0) {
this... |
5b321e38-77cf-41c5-a3b2-e1384cbfb28a | 8 | public RemoteServer(final int port) {
// check annotated functions
LOG.info("Loading declared functions...");
Set<Method> methods = Classes.listAllAnnotatedMethods(Server.class, Function.class);
methods.addAll(Classes.listAnnotatedMethods(getClass(), Function.class)); //add this one so that it is available out... |
09a54038-3b14-485c-931d-97731649edf2 | 3 | @Override
public boolean onKeyUp(int key) {
Iterator<IGameScreen> it = screens.iterator();
while(it.hasNext()) {
IGameScreen screen = it.next();
if(screen.onKeyUp(key)) {
return true;
}
}
if(camera.onKeyUp(key)) {
... |
a9ac4087-5e07-4283-b4ff-15569915c11c | 2 | public List<Message> DisplayAllMessagesSent (String S){
List<Message> listemsg = new ArrayList<>();
String requete = "select * from message where Sender ='"+S+"'";
try {
Statement statement = MyConnection.getInstance()
.createStatement();
... |
1b5e2618-7b77-4574-9c48-cf57ddd94349 | 9 | public static void startShell() {
Listener listen = new Listener();
System.out.print(" >>");
Scanner in = new Scanner(System.in);
String line = null;
String response = null;
Client client = null;
while ((line = in.nextLine()).length() > 0) {
try{
client = null; // for garbage collection if previous... |
9b1ab2ac-c23d-49b4-9f8d-d1afbbf55dc7 | 3 | private boolean isDrawed(List<Point> points, Point p) {
for (Point point : points) {
if (p.x == point.x && p.y == point.y) {
return true;
}
}
return false;
} |
a98a6a15-b4a4-4b2f-909f-4f9bff8aaff7 | 1 | public final void setStoreNo(String storeNo) {
if(storeNo.length() != 5){
throw new IllegalArgumentException();
}
this.storeNo = storeNo;
} |
e08befc8-32ad-4787-97d2-ae22798a9565 | 1 | @Override
public void testStarted(Description description) {
resetCurrentFailure();
final Xpp3Dom testCase = new Xpp3Dom("testcase");
setCurrentTestCase(testCase);
testCase.addChild(createTester(testerName));
testCase.addChild(createTimeStamp(new Date()));
// This is ... |
e669e179-777d-41b8-8e06-212608f78d03 | 3 | private void loadBackups() {
new Thread() {
@Override
public void run() {
DefaultListModel model = new DefaultListModel();
File backupDir = new File(System.getProperty("user.home") + "/.androidtoolkit/backups");
if (debug)
... |
128d3403-f0fe-4c26-ac15-8f44b51f97b0 | 0 | public void setShopUrl(String shopUrl) {
this.shopUrl = shopUrl;
} |
cd3f0f87-b323-4bee-ae8a-6e03ce39cb42 | 7 | public static boolean createSocket(String host, int port) {
// Open socket on given host and port number
try {
clientSocket = new Socket(host, port);
input = new BufferedReader(new InputStreamReader(System.in));
os = new PrintStream(clientSocket.getOutputStream());
is = new DataInputStream(client... |
675da0d7-4ebf-4f7b-a462-4d6dc362dc34 | 7 | protected void cellsResized(Object[] cells)
{
if (cells != null)
{
mxIGraphModel model = this.getGraph().getModel();
model.beginUpdate();
try
{
// Finds the top-level swimlanes and adds offsets
for (int i = 0; i < cells.length; i++)
{
if (!this.isSwimlaneIgnored(cells[i]))
{
... |
c42ea165-489f-43c1-b4d8-9a35893ffb64 | 4 | @Test
public void removeTest() {
final int n = 1_000;
Array<Integer> seq = emptyArray();
for(int k = 0; k < n; k++) {
assertEquals(k, seq.size());
for(int i = 0; i < k; i++) {
final Array<Integer> seq2 = seq.remove(i);
assertEquals(k - 1, seq2.size());
final Iterator<... |
27747178-2373-44fd-b5fe-fe05b341cffa | 4 | boolean isTaskStillValid(Task t)
{
if (t.px < px || t.px >= px + sx)
return false;
if (t.pz < pz || t.pz >= pz + sz)
return false;
return getChunk(t.px, t.pz) == beingPaintedChunk;
} |
8814ae4d-38a1-4e3f-9af2-e81d25c7f800 | 9 | private static void printBinaryFeature(Tagger tagger, HarvardInquirer harvardInquirer, String s) {
List<TaggedToken> tagged = tagger.tokenizeAndTag(s);
boolean containsHostileWord = false;
boolean containsNegativeWord = false;
boolean containsFailWord = false;
// System.out.prin... |
2fad7594-9a3b-4a5f-be8e-b190602ec53d | 2 | public Timestamp getOrdertimeByOrdernumber(Statement statement,String ordernumber)//根据订单号获取预定进入时间
{
Timestamp result = null;
sql = "select ordertime from ParkRelation where ordernumber = '" + ordernumber +"'";
try
{
ResultSet rs = statement.executeQuery(sql);
while (rs.next()) {
result = rs.getTimes... |
08c74ade-2ab0-419e-afd6-99cfcbb23746 | 7 | public static boolean isContinuous(List<Location> l){
List<Location> copy = new ArrayList<Location>(l);
sortLocation(copy);
int dir = getDirection(copy);
if(dir == INVALID_DIR)
return false;
Location prevLoc = null;
for(int i=0;i<copy.size();i++){
Location curr = copy.get(i);
if(prevLoc!=null){
... |
2b9ac58c-de85-411d-a5c6-7e2210f36e5a | 0 | @Column(name = "CUE_NATURALEZA")
@Id
public String getCueNaturaleza() {
return cueNaturaleza;
} |
9ac9838c-3f3c-49ee-aae4-5c6e11e95981 | 8 | public static boolean isScramble(String s1, String s2) {
//if exactly the same
if (s1 == s2) {return true;}
int size = s1.length();
int value1 = 0;
int value2 = 0;
//compare if s1 and s2 contains the same chars
for (int i = 0; i < size; i++) {
value1 += (s1.charAt(i)) - 'a';
value2 += (s1.charAt(i) ... |
e648da30-00a6-4fb9-8815-bb7abe550171 | 0 | public void add(String name, String ip, int port) {
System.out.println(name + ":" + ip + ":" + port);
ClientInfo a = new ClientInfo(name, ip, port);
client_list.add(a);
} |
146b47d4-3040-43a3-8541-f7bf6aaff834 | 0 | @Override
public Message toMessage(Session session) throws JMSException {
Message message = session.createMessage();
setMessageProperties(message);
message.setJMSType(TYPE);
return message;
} |
4d0d0b60-1f04-4b58-92d7-d7bafa01e88e | 7 | private Set<Trace> getTracesFromNode(ProcessNode node, int steps) {
Set<Trace> traces = new HashSet<Trace>();
if (node instanceof EndNode || steps == 0) {
Trace newTrace = new Trace();
traces.add(newTrace);
return traces;
}
if (node instanceof ActivityNode) {
return getTracesFromActivityNode((... |
d4b57fec-3013-4f15-8473-6f2b65973517 | 1 | public static void enumCompareTo(opConstant constant)
{
System.out.println(constant);
for(opConstant c : opConstant.values())
{
System.out.println(constant.compareTo(c));
}
} |
f9892205-5915-4607-9133-1bdab26e3519 | 1 | private boolean isEquals(String str1, String str2, boolean ignoreCase) {
if (ignoreCase) {
return str1.equalsIgnoreCase(str2);
} else {
return str1.equals(str2);
}
} |
42504e0a-41a3-495a-9c90-d2c7e2886617 | 8 | private void download(final String id, final String title, final int lastRow) throws IOException, InterruptedException{
Runnable dl = new Runnable() {
@Override
public void run() {
Result songURL = null;
try {
songURL = JGroovex.getSongURL(id).result;
} catch (IOException e1) {
model... |
c6cb3163-d1fc-4574-8c28-ac4c5024232b | 4 | public void processPacket(OggPacket packet) {
SkeletonPacket skel = SkeletonPacketFactory.create(packet);
// First packet must be the head
if (packet.isBeginningOfStream()) {
fishead = (SkeletonFishead)skel;
} else if (skel instanceof SkeletonFisbone) {
SkeletonF... |
6238d7e6-332d-4e62-8150-fbc27c82a614 | 4 | public Server getServer(int port) {
logMessage(LOGLEVEL_TRIVIAL, "Getting server at port " + port + ".");
if (servers == null || servers.isEmpty())
return null;
ListIterator<Server> it = servers.listIterator();
Server desiredServer;
while (it.hasNext()) {
desiredServer = it.next();
if (desiredServer.... |
61551aea-6bf6-4dd8-9dba-9c1312eb913d | 9 | public boolean skipPast(String to) throws JSONException {
boolean b;
char c;
int i;
int j;
int offset = 0;
int length = to.length();
char[] circle = new char[length];
/*
* First fill the circle buffer with as many characters as are in the
... |
ab4e2fb1-36af-41f2-81f7-94e2ad01a30d | 5 | private void loadItemTypes(String fn) {
String line;
String parts[];
try {
InputStream in = getClass().getResourceAsStream(GameController.CONFIG_DIR + fn);
BufferedReader br = new BufferedReader(new InputStreamReader(in));
String name = "";
int c... |
51956fa0-0c99-4096-bc46-d8c7a05432d2 | 2 | public static void deleteCarte(Carte carte) {
Statement stat;
try {
stat = ConnexionDB.getConnection().createStatement();
stat.executeUpdate("delete from carte where id_carte="+ carte.getId_carte());
} catch (SQLException e) {
while (e != null) {
... |
efedf9eb-383a-4f0c-b356-14b8de0ed4c7 | 3 | @Override
public WriteMsg write(FileContent data) throws RemoteException,
IOException, NotBoundException {
masterLogger.logMessage("===>> Write '" + data.fileName + "' request");
if (!files.contains(data.fileName)) {
// create new file and set meta data
files.add(data.fileName);
filePrimReplica.put(da... |
4e8d1dde-9c19-4ab3-996d-ec15cdcdd360 | 0 | public void setCell(int x, int y, boolean isAlive) {
setCellAt(x, y, isAlive);
} |
3f3d5687-fa33-4c3f-bfe2-c6d5a3ce4b22 | 0 | public static void main(String[] args) {
int i = 1234567890;
float f = i;
System.out.println(i - (int) f); // -46
} |
12441ddc-510a-4d6c-a38c-04b40d2cedea | 7 | private static void spawn() {
if(numOfMonsters > 0) {
switch (monsterIndex) {
case 0: @SuppressWarnings("unused")
WaterBalloon waterballoon = new WaterBalloon(spawnLocation.getXVector() + random.nextInt(10),
spawnLocation.getYVector() + random.nextInt(10));
break;
case 1: @SuppressWarnings("un... |
14de6123-fa6f-4762-bf1c-c32b73ac2951 | 3 | public void subsetsWithDupRec(int [] num, int start, Stack<Integer> stk){
for(int i = start; i < num.length; ++i){
// if(i > start && num[i] == num[i-1]) continue;
stk.push(num[i]);
res.add(new ArrayList<Integer>(stk));
// start from i+1 instead of "start+1", in certain level, start won't... |
2213149c-744e-43ed-b0f6-88222fcc7827 | 0 | public Builder(String tilte, String auther) {
this.title = tilte;
this.auther = auther;
} |
414e12ca-dddd-4ea6-814b-c798a919226f | 2 | void deleteSuccess(String s) {
System.out.println("deleteSuccess");
if (this.selFile.exists()) {
this.result.setText("<HTML><font color='red'>Error In Deleting \" " + this.selFile.getName() + " \" " + s + "</font></html>");
} else if (!this.selFile.exists()) {
this.result.setText("<HTML><font color='green'... |
35c7ee2a-9918-44fd-a46a-98c43096dbdd | 0 | public static String getNumOS() {
return numOS;
} |
73c14faf-0b84-4e20-8d88-6e75f92d4106 | 5 | public static void main(final String[] args) throws Exception {
String[] colNames = null;
OrderBy orderby = null;
// delimited by a comma
// text qualified by double quotes
// ignore first record
final Parser pzparser = DefaultParserFactory.getInstance().newDelimitedPars... |
bb47ccd5-bd9f-4bd8-841a-f9714149187b | 3 | public static ArrayList<Method> getSetters(Class theClass){
Method[] methods=theClass.getMethods();
ArrayList<Method> setters = new ArrayList<Method>();
if(methods==null)
return setters;
for(int i=0;i<methods.length;i++){
if(isSetter(methods[i].getName()))
setters.add(methods[i]);
}
return setters... |
0bbd6e84-9b9b-4ab3-ae01-4963df94549b | 4 | protected Dimension getLargestCellSize(Container parent,
boolean isPreferred) {
int ncomponents = parent.getComponentCount();
Dimension maxCellSize = new Dimension(0,0);
for ( int i = 0; i < ncomponents; i++ ) {
Component c = parent.getCompo... |
ec2c43f8-8a26-46ef-b6fc-1a7bd5fef1c3 | 1 | public void setName( String name ) {
if( name == null )
throw new IllegalArgumentException( "name must not be null" );
this.name = name;
} |
0a32a9ac-de5d-4ac5-95f3-728762cf6e3f | 6 | public static List<TerritoireCase> createTerritoires(int nbPlayer) {
List<TerritoireCase> terris = new LinkedList<TerritoireCase>();
try {
// Creation des territoires
PreparedStatement ps = conn.prepareStatement("SELECT * FROM territoire WHERE plateau = ?");
ps.setInt(1, nbPlayer);
ResultSet rs =... |
3f44140a-16e0-4150-bed7-7b8642e07caf | 9 | public void reproduction() {
Stack<Case> casePossible = new Stack<>();
for (int x = Math.max(0, conteneur.getX() - famille.getSpecs().getPorteSpore()); x < Math.min(conteneur.getX() + famille.getSpecs().getPorteSpore(), conteneur.getContainer().getPlateau().length); x++) {
for (int y = Math.... |
d90b3ea4-a428-4281-bf33-5c67bc67c17e | 7 | public void setEditBrush(int b){
brushtype = b;
switch(brushtype){
// 1x1
case 1: sigmund = new onebrush(); break;
//2x2
case 2: sigmund = new twobrush(); break;
//3x3
case 3: sigmund = new threebrush(); break;
//Glider
case 4: sigmund = new gliderbrush();... |
402e4b9f-6243-4e88-b741-2d538ba068af | 3 | @Override
public Processo updateProcesso(Processo newProc,Processo oldProc) throws Exception{
if(oldProc.getSituacao() == 0){
ColTramite colTramite = new ColTramite();
TramiteProcesso tramite = new TramiteProcesso();
tramite = colTramite.retrieveTramiteProcesso(oldProc.getDtAbertura());
if(tramit... |
72a4ae17-57ff-4791-8549-0b2b69f41ac6 | 5 | @Override
public int hashCode() {
int result = (int) (driverId ^ (driverId >>> 32));
result = 31 * result + (firstName != null ? firstName.hashCode() : 0);
result = 31 * result + (lastName != null ? lastName.hashCode() : 0);
result = 31 * result + (autoPlate != null ? autoPlate.hashC... |
9efbbd4c-f5b3-4cfb-8367-b94e9f1f452b | 7 | public EDTView(SingleFrameApplication app) {
super(app);
initComponents();
init();
this.donner1.setVisible(false);
// status bar initialization - message timeout, idle icon and busy animation, etc
ResourceMap resourceMap = getResourceMap();
int messageTimeout = ... |
b8871954-ac32-4a7a-98ae-a67d6fa10f51 | 8 | public AbstractBeanTreeNode generateNewDefaultArrayElementNode() {
if (null == this.children) {
this.children = new Vector<AbstractBeanTreeNode>();
}
AbstractBeanTreeNode arrayChildNode = null;
Class<?> componentType = this.getObjType().getComponentType();
Object arr... |
b42bc665-de71-4326-a296-4d31555d5711 | 0 | public ProtocolKeepAlive(String username, String status) {
mUserName = username;
mStatus = status;
} |
87c0cc6e-c5a8-4e5d-97eb-aea3e2484442 | 4 | public static void deleteRecursive(File dir) {
if(dir.exists() && dir.isDirectory()) {
for(File f : dir.listFiles()) {
if(f.isDirectory()) {
deleteRecursive(f);
}
else {
f.delete();
}
}
}
} |
2089c248-4542-49dd-b7b7-2ce166e1a1eb | 8 | private int arg_list(String funcdef){
tokenActual = analizadorLexico.consumirToken();
Simbolo simb = analizadorSemantico.tablaDeSimbolos.obtenerSimbolo(funcdef, GLOBAL_SCOPE);
int numParams;
if(simb!=null){
if(simb.existePropiedad("numparams")){
numParams = In... |
f3f9d97f-ec4d-4e40-8886-5a0accb3f696 | 9 | public boolean evaluateInput(MachineInput machineInput) {
if(inputAdapter==null) {
throw new IllegalStateException("No InputAdapter specified prior to calling evaluateInput()");
}
boolean inputIgnored = false;
inputAdapter.queueInput(machineInput);
while(inputAdapter.hasNext()) {
TransitionInput transi... |
b5643041-aee4-4719-85df-0f6cfe88b171 | 6 | @Override
public void validate() {
if (uname == null) {
addActionError("Please Enter User Name");
}
if (email == null) {
addActionError("Please Enter Email Address");
}
if (pwd == null) {
addActionError("Please Enter Password");
... |
4ff7901a-8160-4494-829a-fbe377493f06 | 9 | public void update() {
time++;
if(time % (random.nextInt(50) + 30) == 0) {
xa = random.nextInt(3) - 1;
ya = random.nextInt(3) - 1;
if(random.nextInt(4) == 0){
xa = 0;
ya = 0;
}
}
if(walking) animSprite.update();
else animSprite.setFrame(0);
if (ya < 0) {
animSprite = up;
dir = Dire... |
6114fef4-dfd6-47d6-94af-81c70d5d9906 | 0 | public void setServiceDate(String serviceDate) {
this.serviceDate = serviceDate;
setDirty();
} |
dfcab7ed-fed9-48e4-bde8-18d2bac2995e | 8 | @Override
public boolean okMessage(final Environmental myHost, final CMMsg msg)
{
// In this case, we use the instance of an event to trigger
// the initial filling of the deck with cards, since, once
// this object is capable of handling events, it must already
// be "in the world" and ready to receive cards... |
21d3be23-314e-4e6c-91ca-58e96699b551 | 4 | public void validate(Secao secao){
if (secao == null || secao.equals("")){
throw new SaveException("Seção não pode ser vazia.");
} else {
if(secao.getNome() == null || secao.getNome().equals("")){
throw new SaveException("Nome da seção não pode ser vazio.");
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.