method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
86d1ff03-edb3-47b8-b3f0-5c14bcd2d065 | 6 | public boolean isRespawnSafe(ArrayList<SpaceJunk> spaceJunk, ArrayList<Planet> planets) {
double x, y, h;
boolean ret = true;
for (int i = 0; i < spaceJunk.size(); i++) {
SpaceJunk sj = spaceJunk.get(i);
x = sj.xPosition - Game.SPACE_WIDTH / 2;
y = sj.yPositio... |
f83d42b3-2f6c-402f-a872-7b1c4f173915 | 4 | public byte[] getPackedCode(int bit) {
assert ((bit == 0) || (bit == 1)) : "getPackedCode: input isn't a bit!";
byte[] packed_code = new byte[NBYTESG + 1];
int i;
if (bit == 0) {
packed_code[0] = (byte) (perm + 1); // +1 to escape the leading 0 problem
for (i =... |
b7a490f0-eb4a-42cc-b744-ca1666a9f76e | 0 | public RecordList getRecordList() {
return recordList;
} |
456c2d71-887b-45a1-a720-3382ceb00ca1 | 8 | public static void main( String[] args ) {
// Create game window...
JFrame app = new JFrame();
app.setIgnoreRepaint( true );
app.setUndecorated( true );
// Add ESC listener to quit...
app.addKeyListener( new KeyAdapter() {
public void keyPressed( KeyEvent e ... |
f3c810cb-0a68-460d-93ff-43d308f8a72d | 7 | @Override
public boolean equals(Object obj)
{
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
FinderModeConfig other = (FinderModeConfig) obj;
if (mode != other.mode)
return false;
if (radiusSquared != other.radiusSquared... |
33f05d6d-a6b3-47fc-82d0-c5c82ae36656 | 7 | public void add(Component comp, Object constraints) {
super.add(comp, constraints);
componentsByContraints.put(constraints, comp);
contraintsByComponents.put(comp, constraints);
if(comp instanceof ToolBarPanel) {
ToolBarPanel panel = (ToolBarPanel) comp;
if(constraints.equals(BorderLayout.EAST) || constra... |
0902bfdd-f8ab-4df0-b95e-93febe5236ce | 3 | public void update(float tslf)
{
switch (gamestate) {
case 0:
menu.update(tslf);
break;
case 1:
world.update(tslf);
if(Keyboard.isKeyPressed(KeyEvent.VK_ESCAPE)) gamestate = 0;
break;
default:
break;
}
world.update(tslf);
} |
0c5728cb-75b0-4708-81fb-a87f804d1f00 | 5 | private Operator findI(O O, ArrayList<I> Iids){
for(I I:Iids){
if(I.id.equals(O.id)){
return I;
}
}
Operator curr = O.next;
while(curr != null){
if(curr.type == Operator.Type.I && O.id.equals(curr.id)){
... |
bb897ce5-d5e5-4a3f-8d1e-bfd5503b45f5 | 0 | @Override
public int hashCode() {
long longBits = Double.doubleToLongBits(this.value);
return (int)(longBits ^ longBits >>>32);
} |
e504e741-e6f5-4d7b-9775-1bc75f32a1b4 | 1 | public int calcTotalAmount() {
totalAmount = 0;
for (Account account : accounts) {
totalAmount += account.getAmount();
}
return totalAmount;
} |
ac26e0af-2693-4255-b968-7d28adff35b5 | 5 | private void prepareMatrix() {
for (int i = 0; i < K + 1; i++) {
M[i][0] = 1l;
M[i][i] = 1l;
for (int j = 1; j < i; j++) {
M[i][j] = M[i - 1][j] + M[i - 1][j - 1];
if (M[i][j] >= mod) M[i][j] -= mod;
}
}
for (int j... |
9ac2b61e-1246-4a3d-9b17-b1aa86ad6650 | 3 | @Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
PrintWriter out = response.getWriter();
String userName = "", password = "";
userName = request.getParameter("userName");
password = request.g... |
273e9345-6899-43e9-b44e-9a9c99977b8a | 8 | @SuppressWarnings("unchecked")
public static <K, V> Map<K, V> getMap(List<MapHelper> list,
Class<K> classK, Class<V> classV) {
Map<K, V> map = new HashMap<K, V>();
if (list != null) {
for (MapHelper h : list) {
Object en = h.getValue();
if (en instanceof String) {
String svalue = (String) en;
... |
4a2cb236-ff47-4c39-85de-4dbb8aac373b | 1 | public boolean isLaying() {
Layered layered = gob().getattr(Layered.class);
if (layered != null) {
return layered.containsLayerName("gfx/borka/body/dead/");
}
return false;
} |
1f6128ac-c48f-4dd2-9617-da5c0aac7146 | 8 | public Set<Map.Entry<Double,Double>> entrySet() {
return new AbstractSet<Map.Entry<Double,Double>>() {
public int size() {
return _map.size();
}
public boolean isEmpty() {
return TDoubleDoubleMapDecorator.this.isEmpty();
}
... |
15947ffc-4a4c-4705-9ffe-83abd2451197 | 9 | public NewCharNameCheckResult finishNameCheck(String login, String ipAddress)
{
if((CMProps.getIntVar(CMProps.Int.MUDTHEME)==0)
||((CMSecurity.isDisabled(CMSecurity.DisFlag.LOGINS))
&&(!CMProps.isOnWhiteList(CMProps.WhiteList.LOGINS, login))
&&(!CMProps.isOnWhiteList(CMProps.WhiteList.LOGINS, ipAddress))))
... |
f053b49f-18d6-4112-8fe6-949ab228a422 | 2 | public Collection<File> getClassPath(OperatingSystem os, File base) {
Collection<Library> libraries = getRelevantLibraries();
Collection result = new ArrayList();
for (Library library : libraries) {
if (library.getNatives() == null) {
result.add(new File(base, "launcher/" + library.getArtifac... |
8ce3a2d2-5646-43dd-904d-c406f1d093bd | 5 | public static Object retCheck(Object obj) throws NotSerializableException {
Object ret = obj;
/* Check if return object is serializable, if the return object is null,
* we should still pass it back, no matter a non-return method or the
* return value is null */
if ( (obj != null) && !(obj instanceof Seriali... |
9c8c2e27-d84c-4218-afbb-c2830ea74733 | 0 | public Blog getBlogDetail(long pBlogId) {
return (Blog) this.blogModelDao.findByPrimaryKey(pBlogId);
} |
6a2f0e14-23b7-46c3-8565-04a6c7807492 | 3 | public CourseFilterFrame(CourseModel model) {
super("Filter", model);
Dimension dim = new Dimension(200, 200);
this.setMinimumSize(dim);
this.setSize(dim);
model.addListener(this);
// Make a root node
initTree();
treeModel = new FilterTreeModel(root);
tree = new JTree(treeModel) {
public boolean ... |
b5414eb7-f425-4fda-a7e4-d788a6cdae3d | 2 | public void setDefaultColor(Color c) {
if (c == null)
c = Color.black;
if (! c.equals(defaultColor)) {
defaultColor = c;
setBackground(c);
forceRedraw();
}
} |
b7177a3d-d9bf-4453-a487-4b1d569a0e7f | 0 | public static void main(String[] args) {
Sleeper
sleepy = new Sleeper("Sleepy", 1500),
grumpy = new Sleeper("Grumpy", 1500);
Joiner
dopey = new Joiner("Dopey", sleepy),
doc = new Joiner("Doc", grumpy);
grumpy.interrupt();
} |
679d5e76-153e-42c6-bd8f-a657fdc2173a | 4 | public static SectionState state(FragKind kind )
{
switch ( kind )
{
case merged:
return SectionState.merged;
case almost:
return SectionState.almost;
default: case inserted: case aligned:
return disjoint;
}
... |
a996eaca-1f2a-4540-b329-3a10ec47b383 | 3 | public EntityFactionsList() {
setTitle("Factions List");
setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
setBounds(100, 100, 325, 500);
getContentPane().setLayout(new BorderLayout());
contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
getContentPane().add(contentPanel, BorderLayout.CENTER);
contentP... |
5f8cdeb2-e59e-48a4-a2d7-0cf2298c20b7 | 3 | private List<String> getAllJCheckBoxValue(JFrame ct){
List<String> list=new ArrayList<String>();
Component[] cs = ct.getContentPane().getComponents();//遍历内容控制面版
for(Component item : cs){
if(item instanceof JCheckBox){
if(((JCheckBox) item).isSelected()){
list.add(((JCheckBox) i... |
92be3dff-0485-4994-8233-bcb87f9028f4 | 0 | public int getMaxArena()
{
return config.getInt("CommonOption.MaxArena",5);
} |
e006010c-8e54-4f86-b2cc-b6aa85cc59c3 | 8 | public void render(Bitmap b) {
if(dir == 0) {
ImageManager.renderFromImage(entityType, b, (int)x, (int)y, 0, 16, ((animation_frame == 0) ? 1 : 0));
} else if (dir == 1) {
ImageManager.renderFromImage(entityType, b, (int)x, (int)y, 1, 16, ((animation_frame == 0) ? 1 : 0));
} else if (dir == 2) {
ImageMana... |
7baa7c34-1805-4e2e-a9b2-c95a628aec54 | 0 | public int getIdCliente() {
return idCliente;
} |
b380f291-81ea-4e6f-ac96-a43a4c82af87 | 0 | public int getPage() {
return page;
} |
3169d322-710e-4eef-ba0f-c3e1ba3c18a2 | 9 | public void geraMatrizScors(ArrayList<FieldCandidate> shortRecord,
ArrayList<ArrayList<FieldCandidate>> rowsCadidates, int idealNumColumn) {
ArrayList<ArrayList<FieldCandidate>> correctColumns = new ArrayList<ArrayList<FieldCandidate>>();
Score score = Score.getInstance();
Line line... |
e1d2258e-4e55-4a72-b70d-7b9b65c7178c | 3 | public void run() {
for (JButton b:controllers)
b.setEnabled(false);
while (year<endYear)
tick();
for (JButton b:controllers)
b.setEnabled(true);
System.out.println("History through "+year);
} |
9a151eab-2348-4bb1-b861-8299752d3eeb | 1 | public static void showTokens(List<Token> tokens) {
if(janelaLexico == null)
janelaLexico = new JanelaAnaliseLexica(tokens);
else
janelaLexico.refresh(tokens);
janelaLexico.setVisible(true);
} |
3dfdeb03-0d2e-4657-bc5f-27b59787bc78 | 8 | private void initProfiles() throws IOException {
if (profilespath.isEmpty())
return;
profiles = Profiles.read(new File(profilespath));
// Group the packages to be documented by the lowest profile (if any)
// in which each appears
Map<Profile, List<PackageDoc>> inter... |
91a985a4-9092-4760-ad25-7267069262f2 | 1 | public DefaultComboBoxModel<String> buildFrameBox() {
DefaultComboBoxModel<String> frameBoxModel = new DefaultComboBoxModel<String>();
hitboxes = new Rectangle[maxDir * maxFrame];
for(int x = 0; x<hitboxes.length; x++) {
frameBoxModel.addElement("Rect " + (x / maxDir) + ", " + (x % maxFrame));
hitboxes[x... |
a25a323d-f908-4b78-9bb0-c1f78cc985b6 | 0 | public boolean removeEntry(String variable, String lookahead,
String expansion) {
int[] r = getLocation(variable, lookahead);
boolean removed = entries[r[0]][r[1]].remove(expansion);
fireTableCellUpdated(r[0], r[1] + 1);
return removed;
} |
c659517b-085f-4e96-a126-300d4f4f140c | 6 | public static String makeTitle(HashMap<String,String> mp3, String template){
String x = template;
x = x.replaceFirst("%Track%", mp3.get("TrackNum")!=null ? mp3.get("TrackNum") : "NA");
x = x.replaceFirst("%Artist%", mp3.get("ArtistName")!=null||!mp3.get("ArtistName").isEmpty() ? mp3.get("ArtistName"):"");
x ... |
a8453fec-0b6d-4973-83a4-d1bdc1ddfd35 | 1 | @RequestMapping(value = "/new", method = RequestMethod.POST)
public String newPostItem(@ModelAttribute("contentForm") ContentForm contentForm,
BindingResult result,
HttpSession session) {
if (!result.hasErrors()) {
Content content = new... |
d8c915f9-0170-4230-9eb9-763c826eb4c6 | 7 | @Override
public boolean equals(Object obj) {
if(!super.equals(obj)) {
return false;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final SpdyFrameSynStream other = (SpdyFrameSynStre... |
02b68b19-3cc4-487b-b835-e04f81f056c3 | 6 | public void weaponCardFromInt(int inputWeapon)
{
switch (inputWeapon)
{
case 1: this.weapon =(Weapons.candlestick);
break;
case 2: this.weapon =(Weapons.crowbar);
break;
case 3: this.weapon =(Weapons.dagger);
break;... |
3e1cbd18-2bf5-4326-b016-52fc7730aedd | 9 | @Override
public boolean equals(Object obj)
{
if (this == obj) { return true; }
if (obj == null) { return false; }
if (getClass() != obj.getClass()) { return false; }
@SuppressWarnings("rawtypes")
Pair other = (Pair) obj;
if (first == null)
{
if (other.first != null) { return false; }
} else if ... |
39c4e546-837a-47c8-9fdd-8a43dabfb661 | 8 | private Component cycle(Component currentComponent, int delta) {
int index = -1;
loop : for (int i = 0; i < m_Components.length; i++) {
Component component = m_Components[i];
for (Component c = currentComponent; c != null; c = c.getParent()) {
if (component == c) {
index = i;
break loop;
}
... |
10f6d842-0b78-4e73-ab47-a041b31b08c1 | 3 | public void disposeFontResources() {
Set<Reference> test = refs.keySet();
Object tmp;
for (Reference ref:test) {
tmp = refs.get(ref);
if (tmp instanceof Font ||
tmp instanceof FontDescriptor) {
refs.remove(ref);
}
}... |
c2759dcd-0ed2-45ae-bd05-b33e51ebd82d | 0 | public BounceFrame()
{
setSize(DEFAULT_WIDTH, DEFAULT_HEIGHT);
setTitle("BounceThread");
comp = new BallComponent();
add(comp, BorderLayout.CENTER);
JPanel buttonPanel = new JPanel();
addButton(buttonPanel, "Start", new ActionListener()
{
public void actionPe... |
33017979-b5ed-40e1-9304-bb1d0789ffe6 | 4 | @Override
public V remove(Object key) {
int temp = index((K) key);
Entry<K, V> list = table[temp];
if (list != null) {
if (list.getKey().equals((K) key)) {
table[temp] = list.next;
list.next = null;
return list.getValue();
} else {
while (list.next != null) {
if (list.next.getKey().equ... |
f2f88d16-e908-44cb-ad45-f6ba2b121ce7 | 3 | @Override
public List<Action> process(Board board) {
List<Action> actions = new ArrayList<Action>();
for (int w = 0; w < board.w; w++)
for (int h = 0; h < board.h; h++)
if (board.cells[w][h])
actions.add(new PaintAction(w,h,0));
return actions;
} |
0d0c3b71-5cc0-4e14-941a-4530a20278ab | 0 | @Override
public String toString()
{
return "isPrivate()";
} |
b5fc0ce5-c713-429b-8501-3e1a8b97005e | 0 | public String getDoctorID(){
return doctorID;
} |
0ba8101c-e327-4e49-b5be-65656b0b95db | 3 | private void animate() {
new Thread(new Runnable() {
public void run() {
while(m_panel.getAnimationThread().isAlive()){
}
m_panel.updatePieces(getGame().getPieces());
if (!getGame().boardIsFull()) {
... |
fc575bbe-d4dc-4634-b514-a005de0567da | 2 | public void testPropertyCompareToHour() {
Partial test1 = new Partial(TYPES, VALUES1);
Partial test2 = new Partial(TYPES, VALUES2);
assertEquals(true, test1.property(DateTimeFieldType.hourOfDay()).compareTo(test2) < 0);
assertEquals(true, test2.property(DateTimeFieldType.hourOfDay()).com... |
8563af26-4728-47f2-ac61-759cb77c33a2 | 2 | public Grammar getGrammar()
{
Production[] p = editingGrammarModel.getProductions();
try {
p = CNFConverter.convert(p);
} catch (UnsupportedOperationException e) {
JOptionPane.showMessageDialog(this, e.getMessage(), "CNF Conversion Error",
JOptionPane.ERROR_MESSAGE);
return null;
}
try {
Gra... |
1bd10f66-0757-4f21-9716-ae2c3947b0c5 | 4 | public void compactEnd() {
final int compactSize = compactIndexUsed.cardinality();
if (compactSize == map.size()) {
return;
}
for (int i = 1; i < list.size(); i++) {
if (compactIndexUsed.get(i)) continue;
// to be removed
T t = list.get(i);
list.set(i, null);
map.remo... |
90c0acc9-62af-4ffb-aba2-7e4f0c3f8309 | 5 | public static IEncrypterDecryptor getInstance(ALGORITHMS algorithm)
throws NoSuchAlgorithmException, NoSuchPaddingException {
if (algorithm.equals(ALGORITHMS.TRIPLEDES)) {
if (tripleDescDESEncrypter == null) {
tripleDescDESEncrypter = new TripleDESEncrypter();
}
return tripleDescDESEncrypter;
} else... |
5fe6d105-1526-43bd-88b0-0c26de2379ca | 4 | public void fromByteHelper(Node currentNode, Bits bits) {
if (currentNode != null) {
if (currentNode.parent != null) {
if (currentNode.parent.right != null) {
bits.offerFirst(currentNode.parent.right == currentNode);
} else if (currentNode.parent.left != null) {
bits.offerFirst(currentNode.parent... |
0bd1bbb6-b6e0-473b-a8cd-893dc3449cc9 | 4 | private String obtemIdentificador(HttpServletRequest req) throws RecursoSemIdentificadorException{
String requestURI = req.getRequestURI();
String[] pedacosDaUri = requestURI.split("/");
boolean contextoCervejasEncontrado = false;
for(String contexto : pedacosDaUri){
if(contexto.equals("cervejas")){
cont... |
39ebc56a-2d84-494d-b20b-55bbce60243f | 2 | public void testWithers() {
LocalTime test = new LocalTime(10, 20, 30, 40);
check(test.withHourOfDay(6), 6, 20, 30, 40);
check(test.withMinuteOfHour(6), 10, 6, 30, 40);
check(test.withSecondOfMinute(6), 10, 20, 6, 40);
check(test.withMillisOfSecond(6), 10, 20, 30, 6);
che... |
cfdb6cb1-bcb8-4d6d-a03c-04f07d4e223a | 0 | public Map<Integer, BigDecimal> getPrices() {
return prices;
} |
0bb01b87-e156-4c1c-b817-a10316bfb492 | 6 | public void searchOneWayFlights() {
try {
Class.forName("com.mysql.jdbc.Driver");
} catch (ClassNotFoundException e) {
System.out.println("Where is your MySQL JDBC Driver?");
e.printStackTrace();
}
PreparedStatement ps = null;
Connection con ... |
83417c7a-7203-4568-870f-68b92fee1fa8 | 5 | private boolean checkOptimumInfini(Matrice delta)
{
boolean optimumIsInfini = true;
for(int i = 0; i<delta.getNbColumns(); i++)
{
if(delta.getValueAt(0, i) < 0)
{
for(int j = 0; j<this.Abarre.getNbLines(); j++)
{
... |
2eccaafc-b434-4846-a24e-2f2e1c7f85b5 | 6 | public static Stella_Object access_SampleContents_Slot_Value(SampleContents self, Symbol slotname, Stella_Object value, boolean setvalueP) {
if (slotname == Sample.SYM_SAMPLE_sampleAttr) {
if (setvalueP) {
self.sampleAttr = ((StringWrapper)(value)).wrapperValue;
}
else {
value = St... |
7e6722d2-17e6-425a-81f4-340b1b2edbba | 1 | public void deactivate()
{
try {
socket.getInputStream().close();
socket.getOutputStream().close();
socket.close();
GUI.println("Socket closed!!!");
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} |
a9be6660-7d5b-4201-800b-2253c22f6e67 | 2 | private char[] insertCharToStr(char ch, char[] s, int pos) {
int newLen = s.length + 1;
char[] result = new char[newLen];
// copy anything before position
for (int i = 0; i < pos; i++) {
result[i] = s[i];
}
for (int j = pos; j < s.length; j++) {
result[j + 1] = s[j];
}
result[pos] = ch;
return... |
72cdb739-8049-47a4-b446-cea4ee478db5 | 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... |
f877002a-4814-49d2-8a7c-ab37705950a2 | 4 | @EventHandler
public void onSignChange(SignChangeEvent evt){
if(evt.getLine(0).contains("Arena-") && Util.isNumeric(evt.getLine(0).replace("Arena-", ""))){
Arena a = ArenaManager.getManager().getArena(Integer.parseInt(evt.getLine(0).replace("Arena-", "")));
if(a != null){
String line2 = a.getSize() + " / "... |
e6a9dcba-a097-49b9-b1ca-64a6a19d27ee | 6 | public static int searchInsert(int[] source, int target) {
int start = 0;
int end = source.length;
int guard = end;
int index = 0;
if (end == 0) {
return index;
}
while (end >= start) {
// 防止end与start相加之后超过int的最大值
int middle = start + (end - start) / 2;
if (middle < guard) {
int temp = s... |
576676cc-d163-4eb4-a08f-3a2602769f44 | 3 | private String getUpdateSetClause(String dbColumnName, Object value) {
if (value instanceof Date) {
return dbColumnName + "='" + DaoUtils.DATE_FORMATTER.format(value)
+ "'";
} else if (value.getClass().isEnum()) {
return dbColumnName + "=" + EnumUtils.getId(value) + "";
} else if (value instanceof Str... |
82f02300-af37-4de4-9af5-dcfe3d3992a1 | 0 | public Member getMember() {
return member;
} |
13073b69-4c78-4351-91a9-2ba6d6fae4bb | 2 | public static boolean isMatchForPassword(String password, String confPassword) {
if (password == null || confPassword == null) return false;
return password.equals(confPassword);
} |
51bb7b35-a0a1-47bd-9e47-2644f3bda846 | 8 | public void executeRemotely(Command<?>... commands) {
CommandFacade facade = context.getBean("commandFacade", CommandFacade.class);
List<Command<?>> incomeCommands = Arrays.asList(commands);
CommandList commandsToServer = new CommandList(incomeCommands);
Command<List<... |
7d44e267-826b-4cd8-89bd-cc1baa7798c7 | 3 | @Override
public void run() {
Date dte = new Date();
Timestamp ts = new Timestamp(dte.getTime());
while (true) {
try {
while (true)
{
Thread.sleep(20000);
lastRTime = (ts.getTime()/1000) + 20000;
... |
26b4a813-f5f3-4bce-b8d3-dc44fd2eda94 | 4 | private static int getCoordinateOfCell(Field field, char coordinateName){
Scanner scanner = new Scanner(System.in);
int coordinate = 0;
System.out.println("Please enter cell " + coordinateName + " coordinate:");
while(true){
if(scanner.hasNextInt()) {
coordina... |
7c468f14-1790-4ef2-a605-42e229268436 | 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 Projeto)) {
return false;
}
Projeto other = (Projeto) object;
if ((this.id == null && other.id != null) || (thi... |
138cb401-06cd-4c4b-90c6-2882df1f06d1 | 5 | @Override
public void paint(Graphics g)
{
super.paint(g);
if (cache == null) cache = bufferOwner.getWaveData();
if (cache == null || cache.length == 0)
{
g.drawString("No wave data available at this time.",0,200);
return;
}
g.drawString(Integer.toString(cache.length),0,30);
final int height = 128,... |
83fdada7-97af-4e73-bbbe-df8ad7631bae | 6 | @Override
public QueryResult updateQuery(Query q) {
Statement st = null;
if(!q.isParsed()) {
q.parse();
}
try {
st = con.createStatement();
st.executeUpdate(q.getParsedQuery());
}catch (SQLException e) {
plugin.getLogger().log(Level.SEVERE, " Could not execute query!");
if(this.dbg) {
... |
7b150794-e9c0-41cf-b5e7-44cb8a73c315 | 3 | private void dribbleAwayOtherGoal(){
turnTowardBall();
if(distanceBall < 0.7){
if(canSeeOtherGoal){
if(distanceOtherGoal < 30) {getPlayer().kick(100, directionOtherGoal);
}
else{
getPlayer().kick(40, directionOtherGoal+5);
... |
b6d90b1c-badd-4c50-8129-79ade03019da | 1 | public static String getWebINFPath() {
String path = getWebClassesPath();
if (path.indexOf("WEB-INF") > 0) {
path = path.substring(1, path.indexOf("WEB-INF") + 8);
path = path.replace("/", File.separator);
return path;
}
return null;
} |
2124c3b8-6a47-456a-99fa-44636a2a9793 | 1 | public void newCustomer() {
Database db = dbconnect();
try {
String query = "INSERT INTO customer (firstName, lastName, username, password, telephone, email) VALUES "
+ "(?,?,?,?,?,?)";
db.prepare(query);
db.bind_param(1, this.c_firstname);
db... |
98db2a6a-6bf3-45a6-abd3-f16e51ab9314 | 8 | @Override
public void run(DetAdv da, GameVars gameVars)
{
Scanner inputReader = saveAndGetScanner(gameVars);
if (policeStationState == JUST_ENTERED)
{
System.out.println("The police force has been riddled with worthless cases lately.\nPeople will call the police over such stupid things nowadays.");
DetUti... |
0002b6eb-1a58-463d-a372-cf8356a7e191 | 0 | public boolean isOpen() { return this.open; } |
4ab311e3-d64f-4878-9e04-ca5de73dd41d | 9 | protected AttributeClassObserver newNumericClassObserver() {
switch (this.numericEstimatorOption.getChosenIndex()) {
case 0:
return new GaussianNumericAttributeClassObserver(10);
case 1:
return new GaussianNumericAttributeClassObserver(100);
ca... |
0c8b56a0-cfc6-495b-b42b-ae120b14df4b | 5 | public static void setB(Node[][] nodes){
for (int br=0;br<3;br++){
for (int bc=0;bc<3;bc++){
for (int n=0;n<9;n++){
int index1=(br*3+bc)*9+n+81*3;
for (int r=0;r<3;r++){
for (int c=0;c<3;c++){
int index2=(r+br*3)*81+(c+bc*3)*9+n;
nodes[index1][index2]=new Node(1);
}
}
... |
a488d50c-92e8-4105-87c7-34fc015fac71 | 4 | public void resize() {
if (getPrefWidth() > 0 && getPrefHeight() > 0) {
if (resizeable) {
size = getPrefWidth() < getPrefHeight() ? getPrefWidth() : getPrefHeight();
setPrefSize(size * getSymbolType().WIDTH_FACTOR, size * getSymbolType().HEIGHT_FACTOR);
} ... |
d33f23ba-bca4-4757-86f4-7b900cf66a13 | 5 | private void jTextArea2KeyPressed(java.awt.event.KeyEvent evt) {
if (KeyEvent.VK_ESCAPE == evt.getKeyCode()) {// 按ESC键,关闭聊天窗口
this.dispose();
} else if (KeyEvent.VK_ENTER == evt.getKeyCode()) {
enter = true;
} else if (KeyEvent.VK_CONTROL == evt.getKeyCode()) {
ctrl = true;
}
if (enter && ctrl) {// 如... |
ca23cca7-006c-4972-adf6-ec6e97ae659c | 9 | private Node<K,V> floor( V value ) {
if(value == null)
return null;
Node<K,V> node = mRoot;
Node<K,V> ret = null;
if(mValueComparator != null) {
Comparator<? super V> comp = mValueComparator;
while(node != null) {
... |
979653ba-2f3e-4b41-b0ad-ddd671ca87c7 | 6 | private static Image createIcon(Component component, Color color) {
int rgb = color.getRGB();
int[] pix = new int[12 * 12];
for (int x = 0; x < 12; x++) {
for (int y = 0; y < 12; y++) {
pix[x + y * 12] = ((x > 0) && (x < 11) &&
(y > 0) && (y < 11)) ? rgb : 0xff666666;
}
}
return component.creat... |
7b7ece8f-1ddd-4c17-931a-387967c7d5c4 | 0 | public String getIssueNo() {
return issueNo;
} |
bf7c6d35-bf56-4da5-b02a-6845c5835640 | 1 | public DalcSong() {
try {
mConnection = DBConnection.getConnection();
} catch (SQLServerException ex) {
}
} |
2d550b24-32e0-4bf6-a7ad-ca8100ace52d | 9 | private void login_buttonActionPerformed(ActionEvent evt) {
/*
* Pass the user name and password to the login system. The login system
* will indicate whether the login succeeded. If it did, hide the login
* screen and show the splash page according to the user's Role.
*/
String name =... |
6bfc32c6-12e4-4be8-9686-765501f55494 | 9 | @Override
public int read(ByteBuffer buffer) throws IOException {
if (engine.isInboundDone()) {
// We can skip the read operation as the SSLEngine is closed,
// instead, propagate EOF one level up
return -1;
}
decryptedIn.clear();
int pos = decry... |
6b57315f-90bb-4f31-8d07-2afa88b310cd | 0 | public final void restart() {
environmentStack = new Stack<FunctionEnvironmentRecord>();
environmentStack.add(new FunctionEnvironmentRecord());
savedEnvironmentStackSize = environmentStack.size();
savedArgs = new ArrayList<Integer>();
reasonForStopping = "";
stepOverPendi... |
3aa4aed4-71e2-4966-8d26-4b51db84bf2f | 1 | public String listaDeUsuarios(){
String lista= "";
for(int i = 0; i < usuarios.size(); i++){
lista = lista + usuarios.get(i).getNombre() + "<BR>";
}
return lista;
} |
0c7114d4-e9cc-4692-a0c4-eb73955c6caa | 9 | void insert(Object number, int timesPresent){
if(head == null){
Node newNode = new Node(number,timesPresent);
head = newNode;
tail = newNode;
}else{
Node temp = head;
if(size() != maxLength){
while(true){
if(temp.timesPresent < timesPresent){
Node newNode = new Node(number,timesPresen... |
2f2e973e-fa1c-41a9-bbf0-608e71986a91 | 4 | @Override
public void startElement(String uri, String localName, String qName, Attributes attrs) throws SAXException {
if (qName.equals("rowset")) {
String name = getString(attrs, "name");
oldRoles = name.equals("oldRoles");
newRoles = name.equals("newRoles");
} else if (qName.equals("row")) {
if (oldR... |
4de41799-f6b0-4e6d-964b-07348a48e0ad | 1 | public boolean isObjectWithinRange(Placeable obj, Placeable obj2) {
if (obj.distanceTo(obj2) <= range) {
return true;
}
return false;
} |
e9fb539a-98fa-416a-98ec-b6eb946812f0 | 8 | public void loadImagesFile(String fnm) /* Formats:
o <fnm> // a single image
n <fnm*.ext> <number> // a numbered sequence of images
s <fnm> <number> // an images strip
g <name> <fnm> [ <fnm> ]* // a group of images
and blank lines and comment lines.
... |
37fb8244-473b-47b2-98d1-490351bcf8ab | 4 | public void gestionDuClavier(KeyEvent ke) {
if(ke.getKeyCode() == KeyEvent.VK_RIGHT)
this.serpent.setNouvelleDirection(Serpent.Direction.VERS_LA_DROITE);
else if(ke.getKeyCode() == KeyEvent.VK_LEFT)
this.serpent.setNouvelleDirection(Serpent.Direction.VERS_LA_GAUCHE);
... |
a6bcb4c0-7574-4f95-8cc6-79563d41cb90 | 9 | @Override
@SuppressWarnings({"unchecked","rawtypes"})
public final boolean equals(final Object o) {
if (o==this) return true;
if (!super.equals(o))
return false;
if (o instanceof LegacyNumericRangeQuery) {
final LegacyNumericRangeQuery q=(LegacyNumericRangeQuery)o;
return (
(q.... |
12505425-ec40-41f3-af18-5661c84cf6c9 | 8 | private boolean actualizar(){
// Buffer que permite evitar el parpadeo cada vez que se limpia la pantalla,
// además es el objeto donde se intaran los sprites
BufferedImage pantalla=new BufferedImage(this.getWidth(),this.getHeight(), BufferedImage.TYPE_INT_RGB);
pantalla.getGraph... |
64445425-baf4-41d1-a2c1-33067551f70b | 5 | public void update() {
Set<LivraisonGraphVertex> tree = new HashSet<>();
for(Chemin chemin : chemins) {
tree.add(chemin.getOrigine());
tree.add(chemin.getDestination());
}
this.noeuds = new ArrayList<>(tree);
this.idToIndex = new HashMap<>();
int ... |
27a697e7-87ad-41d3-b726-86c6a5401d23 | 2 | public boolean isComment (char c) throws IOException
{
char temp = (char)sourceFile.read();
if ((c=='/') && temp=='/')
{
sourceFile.unread(temp);
return true;
}
sourceFile.unread(temp);
return false;
} |
ccc4b8d4-d03a-4673-adbe-ec8fd033866c | 4 | @Override
public WebSocketResponse endFirstUnitPlacement(GameClient gameClient, JSONObject value) {
//System.out.println("end first unitplacement");
int clientId = gameClient.getIdentifyer();
List<ClientMapChange> clientMapChanges = new LinkedList();
Iterator mapCha... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.