method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
ddb13f78-de5e-4cbb-b7d0-4e30536e9baa | 4 | public void stringdisplay(GUIContext container, Graphics g) throws SlickException {
char str = 0;
g.setColor(Color.black);
for ( int row=0; row<table.rows; ++row ) {
for ( int col=0; col<table.columns; ++col ) {
str = table.getLetters()[row*table.columns + col];
String word = String.valueOf(str);
i... |
8b8dafae-292a-47b1-ba5c-81fee88c9518 | 8 | public void execute() {
Process proc = null;
ProcessBuilder pb = new ProcessBuilder(getCommand());
if (StringUtils.isNotBlank(getWorkingDirectory())) {
pb.directory(new File(getWorkingDirectory()));
}
addLogMessage("Executing command: " + StringUtils.join(getComman... |
cd652c1f-8e16-4948-8a1e-2d6e1e8ced45 | 9 | public static void main(String[] args) {
// TODO Auto-generated method stub
int[] D = new int[101];
for(int i=0;i<101;i++) {
D[i] = 1;
}
int[] C = new int[101];
C[0] = 1;
C[1] = 1;
for(int i=2;i<101;i++) {
C[i] = C[i-2]+D[i];
}
int[] B = new int[101];
for(int i=0;i<101;i++) {
if(i < 5) {
... |
83f7b65e-608b-447b-bbf4-440519094d7a | 9 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
final ChangeOfBitString other = (ChangeOfBitString) obj;
if (referencedBitstring == n... |
07a5f40a-2e70-4d64-b61d-e457cfcd1abc | 9 | public void loadPuzzle (String difficulty) {
File file;
/* Uses if statements to check the difficulty level passed */
if (difficulty.equals("Easy")) {
file = new File("easy9x9.txt");
} else if (difficulty.equals("Medium")) {
file = new File("medium9x9.txt");
} else if (difficulty.equals("Hard")) {... |
96263f07-9505-40cc-8ca8-4530e619bd32 | 1 | public int queueLengthIter(){
PatientCL temp = this;
int count = 0;
while (temp != null){
temp = temp.nextPatient;
count++;
}
return count;
} |
0ce5d257-6fdc-4f64-81fa-4be563664a2b | 8 | public void help(Help query) throws IOException, Error, ClassNotFoundException{
Help.HelpType helpType = query.getHelpType();
switch(helpType){
case DESCRIBE:
this.printTableDescribe(query.getTableName(), query.isNormalUser());
break;
case CREATE:
this.printDescriptions("CREATE");
break;
c... |
706dcfcf-e0d2-4fd3-8abb-b8daf62ce05e | 1 | private void addMultipleSelectionToJList()
{
myStringJList.setSelectionModel(new DefaultListSelectionModel()
{
public void setSelectionInterval(int index0, int index1) {
if (isSelectedIndex(index0))
super.removeSelectionInterval(index0, index1);
else
super.addSelectionInterval(index0, index1);... |
13064f36-2181-4f0b-a9da-d2e69f720dab | 3 | public static void majCaddieLifetime (String val) throws BDException {
String requete = "update config set duree_vie_cad =";
if (val.compareTo("SESSION") == 0)
requete+="-1";
else if (val.compareTo("NOLIMIT") == 0)
requete+="-2";
else
requete+=val;
Statement stmt = null;
ResultSet rs = null;
Con... |
225a6f5c-81de-41d1-896a-de8bb1c2a7b6 | 7 | public void openFrom(TaskManager tks, InputStream is)
throws FileNotFoundException, IOException {
Scanner sc = new Scanner(is);
if (!sc.hasNext()) {
// create empty
//save(tks);
} else {
// read in full
String token = sc.next();
... |
ffc347d0-06c2-4ac2-8201-8879c49bdae5 | 0 | public Result getResult() {
return result;
} |
b839d020-f5ad-4df5-8dd7-f8fe8dadae64 | 3 | public void toggleNyanCat()
{
JTextArea help = ((JTextArea)((JViewport)helpPane.getComponent(0)).getView());
while(nCEnabled)
{
try { Thread.sleep(500); }
catch(Exception e) { e.printStackTrace(); }
if(help.getText().equals(Resources.NC_1))
help.setText(Resources.NC_2);
else
help.setTe... |
a2280dec-c3b2-4156-8fb4-f2f90654ebaa | 2 | @BeforeClass
public static void setUp() {
board = new Board();
try {
board.loadConfigFiles("CR_ClueLayout.csv", "CR_ClueLegend.txt");
} catch (IOException e) {
e.printStackTrace();
} catch (BadConfigFormatException e) {
e.printStackTrace();
}
} |
fcf1b52e-0544-4cfd-89f6-860c843c4e63 | 1 | private void restoreDevice_androidButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_restoreDevice_androidButtonActionPerformed
if (selectedDevice != null) {
JOptionPane.showMessageDialog(null, parser.parse("showRestoreManagerMsg"), parser.parse("showRestoreManagerMsgTitle"), J... |
93492c5c-888d-41a5-9931-4d6a09bf54fa | 5 | public void Distribute(ConfigFile cfg)
//public void XConsumePackets(int TIME, Queue<RouterPacket> []inputBuffer, PriorityQueue<Event> pQ,int PULSE, Event current)
{
//temporary hold the queue from distribution calculations
Queue tmp = null;
//double discard = 0;
int discard = 0... |
d335bce2-91b2-4b9f-b008-d7277e0c1a3a | 8 | protected void beforeRun() {
_state = EnRunningStates.WaitingForDependencies;
logInformation();
_threadPool.notifyWaiting();
boolean fulfilled = false;
if (_fulfilledDependencies == null || _fulfilledDependencies.length != _dependencies.length) {
_fulfilledDependenci... |
ef1f4903-592b-4002-a112-4956b5dbf343 | 7 | private void checkMove6 () {
if (row != 0 && col != 7 && Othello.board[row-1][col+1] == null) {
for (int i=row, j=col; i<8 && j>=0; i++, j--) {
if (Othello.board[i][j]==player) {
list[6] = new Possible(row-1, col+1, i, j); break;
}
else if (Othello.board[i][j] == null) break;
}
}
} |
508e28da-1de8-4a0b-8263-251ada4b4e0b | 9 | private void handleTransmission(boolean blnRes)
{
this.setSysMsg(EzimLang.WaitingForResponse);
this.jbtnYes.setVisible(false);
this.jbtnNo.setVisible(false);
this.jbtnClose.setVisible(true);
EzimFrxList.getInstance().put(this.id, this);
// let the user choose where to save the incoming file
if (blnRes)... |
fb956a0b-565c-4395-99dd-2710fb30c5dc | 7 | public final static Block[] getBlocksFromByteArray( byte[] bbuf, int type )
{
int SIZE = 0;
switch( type )
{
case Block.BIG:
SIZE = 512;
break;
case Block.SMALL:
SIZE = 64;
}
if( bbuf == null )
{
return null;
}
// int sz = LEOFile.getSizeInBlocks(bbuf.length,SIZE);
int len = (b... |
4c8069fe-c226-480e-bd79-2e73448350e5 | 1 | private String getmsg() {
if (parent instanceof Window) {
String str = ((Window) parent).cap.text;
return "Drop all items from the " + str.toLowerCase()
+ " to ground?";
}
return "Drop all items to ground?";
} |
6ae43849-86bc-4f3f-878d-ae9a44e6582d | 0 | public void afterPhase(PhaseEvent event)
{
} |
6a649e3a-03a2-4f18-b884-05f2710435f9 | 8 | public boolean shinBone(Item one, Item two, long locationOne, long locationTwo)
{
if((one.fitsOn(locationOne)&&two.fitsOn(locationTwo))
&&(!one.fitsOn(locationTwo))
&&(!two.fitsOn(locationOne)))
return true;
else
if((two.fitsOn(locationOne)&&one.fitsOn(locationTwo))
&&(!two.fitsOn(locationTwo))... |
5f29c90d-827a-4be6-993c-58adb923d260 | 2 | public static boolean isBlank(String str){
return str == null || "".equals(str.trim()) ? true : false; // 使用trim()修剪str
} |
99937b6f-d0ca-4a84-8c6e-f8a6c9705261 | 1 | @Override
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
temp = "";
if (qName.equalsIgnoreCase(XMLTag.BANK)) {
deposit = new BankDeposit();
}
} |
2b22eaf6-3dcc-4ad0-a27d-977af89b12b7 | 7 | private VariableType type() {
if(testStandardTypes()) {
return getValType();
} else if (whenToken(TokenType.SARRAY)) {
int linum = getLineNumber();
expectToken(TokenType.SLBRACKET);
int lvalue = number();
expectToken(TokenType.SRANGE);
int rvalue = number();
expectToken(TokenType.SRBRACKET);
... |
b5672d17-a9e0-40b9-987c-2592403761ef | 6 | @Override
public void run() {
listener.onStatusChanged(NetworkListener.ON_CONNECT, null);
while (true) {
try {
final int status = dis.readInt();
switch (status) {
case NetworkListener.ON_SEED_RECEIVED:
case NetworkLi... |
88a0eb96-ec90-4fc7-9c67-47434aa0e974 | 2 | @Override
public String toString() {
String result = "\t" + typeName + " (" + rank + ")\n";
result += "\t\tRequires:\n";
for (ApiRequirement skillRequirement : requiredSkills) {
result += "\t\t\t" + skillRequirement + "\n";
}
result += "\t\tBonuses:\n";
for (ApiBonus skillBonus : boneses) {
result +=... |
b726373c-9b9a-49ce-a0e2-01a7c70d9517 | 6 | public final void reorganize() {
mRoot.all(mOutside);
// Determine the union of all contained bounds
int x = 0;
int y = 0;
int width = 0;
int height = 0;
for (T one : mOutside) {
int otherWidth = one.getWidth();
if (otherWidth > 0) {
int otherHeight = one.getHeight();
if (otherHeight > 0) {... |
3ff00cef-9779-4c34-ab07-093437dad1b4 | 2 | public void configCheck() {
new File(directory).mkdir();
if (!file.exists()) {
try {
OKLogger.info("Attempting to create configuration file...");
file.createNewFile();
addDefaults();
OKLogger.info("Configuration file successfull... |
aef5c1a7-23ca-489c-96da-02bc55eed094 | 7 | public static HashMap<String, EventTypeTags> addNewEventTypes(
Connection dbCon, String[] eventTypeUuids, String uniqueTypes[],
String[][] eventTypeTags) throws MobbedException {
HashMap<String, EventTypeTags> eventTypeMap = new HashMap<String, EventTypeTags>();
HashMap<String, String> tagMap = null;
UUID e... |
18607cdc-93b3-4737-b0aa-7eb77cfcd322 | 9 | public ResultSet query() {
query = "";
switch (peticion) {
case "selecciones":
query = Consultas(1);
break;
case "ciudades":
query = Consultas(2);
break;
case "estadios":
query = Consult... |
dd5214a2-61fb-44cd-84b7-ecc9cc387e2d | 4 | public static int getRange(int min, int max) {
if (random == null) {
init();
}
if (max < min) {
return 0;
}
int range = max - min + 1;
if(range == 1) {
return min;
} else if (range <= 0) {
return 0;
... |
9cc7fa8d-d61f-4484-9a5e-f6b8fb2b732e | 6 | private String unescape(String s){
if (s.indexOf('\\') == -1){
return s.substring(1, s.length()-1);
}
StringBuffer sb = new StringBuffer(s.length());
for (int i=1; i<s.length()-1; i++){
char c = s.charAt(i);
if (c == '\\'){
char c1 = s.charAt(++i);
int index;
if (c1 == '\\' || c1 == '\"'){
... |
3f7ab8b4-0640-4307-8bb4-9ea7a1280664 | 4 | public static void main(String[] args) throws IOException
{
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int[] array = new int[20];
for (int i = 0; i < 20; i++)
{
array[i] = Integer.parseInt(reader.readLine());
}
int maxi... |
68581e60-c9eb-40cc-bc4d-1ad69ff96d6b | 7 | private static boolean fourflush_check(List<Card> ai_hand){
boolean four_flush = false;
int counter = 1, h = 0;
char temp_suit;
for(h = 0; h < 2; h++){
temp_suit = ai_hand.get(h).getSuit();
for(int j = h + 1; j < 5; j++){
if(temp_suit == ai_hand.get(j).getSuit())
counter++;
}
if(c... |
6baa7306-701b-4898-8f78-d3a6df8a6f8a | 6 | public static ArrayList<String> getDirectoryListing(String url) throws IOException {
Document doc = Jsoup.connect(Unity.url + Unity.folder + "/" + url).get();
Elements extracted_links = doc.select("a[href]");
ArrayList<String> links = new ArrayList<String>();
for (int i = 0; i < extracted_links.size(); i++) {
... |
f728c915-f049-476b-a6a8-2a8d7d71447b | 4 | @Override
/**
* makes the given little man perform this conditional action. When the
* little man is done performing the action, the test resets itself.
*
* @return whether this conditional action is completed. The action is
* completed if the test has passed and the action has been complet... |
5f3131bc-3898-4b49-90f9-eed25cbd96c9 | 0 | public void connect(){
client.getSession().connect();
} |
a6b54dd3-2daf-45f7-863c-53ce4e801327 | 4 | @Override
public void keyTyped(KeyEvent e) {
if (open) {
if (e.getKeyChar() == KeyEvent.VK_BACK_SPACE && currentMessage.length() > 0) {
currentMessage = currentMessage.substring(0, currentMessage.length() - 1);
} else {
if (currentMessage.length() < MAX_MESSAGE_LENGTH) {
currentMessage += e.getKey... |
f17abcae-6ff2-4595-8dac-73340c4a8444 | 7 | public static <T extends Comparable<T>, E> String delete(Node<T,E> toBeDeleted){
String output = null;
Node<T,E> toBeDeletedParent = toBeDeleted.getParentNode();
if(toBeDeleted.getParentNode() !=null){
T toBeDeletedValue = toBeDeleted.getValue();
T parentLeftNodeValue = toBeDeletedParent.getLeftNode()!=... |
e37bc577-d36b-46ef-8674-3b5e39947374 | 7 | boolean isPermutation(String s1,String s2){
boolean isPermutation=false;
HashMap<String,Integer> s1Map=new HashMap<String,Integer>();
HashMap<String,Integer> s2Map=new HashMap<String,Integer>();
for(int i=0;i<s1.length();i++){
String v=Character.toString(s1.charAt(i));
if(s1Map.containsKey(v... |
e866c1a4-4fc5-47aa-935c-186fa52906c4 | 6 | public MySinglyLinkedList sumReverse(MySinglyLinkedList one, MySinglyLinkedList two) {
MySinglyLinkedList ret = null;
MySinglyLinkedList retStart = null;
int carry = 0;
preProcess(one, two);
while (one != null && two != null) {
if (ret == null) {
int sum = one.value + two.value + carry;
carry =... |
c7e600be-636b-4084-97c2-fe29765e6baf | 8 | protected void clearErrorAndTaskList(CTabItem item) {
SymitarFile file = (SymitarFile) (item).getData("file");
if (file != null) {
// Remove from error list
for (TableItem eItem : tblErrors.getItems()) {
if (((SymitarFile) eItem.getData("file")).equals(file))
eItem.dispose();
}
for (TableItem... |
14bca06b-4fa0-4c8e-9b5e-1554be66e3d2 | 8 | public final String[][] getStrsStarting(String tagStartersToGet)
{
final PairVector<String,String> strBag = new PairVector<String,String>();
tagStartersToGet = tagStartersToGet.toUpperCase();
for(final Enumeration<?> e=propertyNames(); e.hasMoreElements();)
{
final String propName = (String)e.nextElement();... |
307ab912-d0b4-4bae-8ee0-7353002b8dcb | 6 | public void checkIfPressed(int x, int y) {
//Gdx.app.log("A", x+"X, Y"+y+", TX"+Tbounds.x+", TY"+Tbounds.y);
if(Tbounds.contains(x, y)) {
topHover = true;
if(Gdx.input.isButtonPressed(Buttons.LEFT)) {
if(!(currentSelections>=MxSelections)) {
pressed(+1);
}
}
} else {
topHover = false;
... |
fee401c3-6e3b-45fe-a6a8-ce38a14c4c05 | 7 | private ArrayList<Song> parseContent(String content, ArrayList<Song> results) {
//splits at every song found
String[] rawSongs = content.split("upload_id");
//rawSongs[0] is just some html code
for(int i=1; i<rawSongs.length; i++) {
Song s = new Song();
//find the name
Pattern p = Pattern.compile("\"up... |
efa60dd5-c333-4b05-b880-e385cc7cad0e | 8 | @Override
public int compareTo (JavaInfo o)
{
if (o.major > major) return -1;
if (o.major < major) return 1;
if (o.minor > minor) return -1;
if (o.minor < minor) return 1;
if (o.revision > revision) return -1;
if (o.revision < revision) return 1;
if (o.bui... |
27a8f610-8c5c-433c-af76-a601f6daf55c | 6 | private BranchInstruction makeProperBranch(Cmp c, BasicBlock t) {
switch (c.getType()) {
case eq:
return new Bne(t);
case neq:
return new Beq(t);
case lt:
return new Bge(t);
case lte:
return new Bgt(t);
case gt:
... |
f64fe1cf-5793-4c06-aa99-611f7cbcdd2a | 0 | public boolean isDeleted() {
return deleted;
} |
8079783c-f73f-4982-b8d2-de03a2df8e4f | 6 | public FreeSignupPage enterCoachReferral(Boolean value, String coachId) {
/*
if (value=false){
int cbSize = coachReferral.size();
for(int i=0; i < cbSize ; i++ ){
String sValue = coachReferral.get(i).getAttribute("value");
if (sValue.equalsIgnoreCase("6")){
coachReferral.get(i).click();
... |
0a25ea76-5fb7-4bd9-a4ad-413602e686a5 | 3 | @Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final SalesTerritory other = (SalesTerritory) obj;
if (!Objects.equals(this.idTerritory, other.idTerritory)) {
... |
95641849-2ca1-4176-9309-f91a1e90ac84 | 7 | private byte[] deflateImageData(PngByteArrayOutputStream inflatedImageData, int strategy, Integer compressionLevel) throws IOException {
byte[] result = null;
int bestCompression = Deflater.BEST_COMPRESSION;
if (compressionLevel == null || compressionLevel > Deflater.BEST_COMPRESSION || compressionLevel < Deflat... |
b95d48a5-fdbe-4d20-834c-cbf4d5ebd957 | 0 | public Bar(int a, int b, String s, double x, float f) {
super(a, b, s, x, f);
baz();
} |
2e448aee-e01a-4e9d-9f0b-19115f2dbf13 | 4 | @Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
if (method.getDeclaringClass() == Object.class) {
if ("getClass".equals(method.getName()))
return array.type.type();
else
return method.invoke(this, args);
}
MethodMode... |
d270e0d0-2030-44b8-b9c8-9f28380c45d9 | 1 | public InputStream openClassfile(String classname) {
if(this.classname.equals(classname))
return new ByteArrayInputStream(classfile);
else
return null;
} |
9cee0370-2a08-456d-b4d2-bf48587a695b | 3 | public void displayInfo(int ID, Integer CurrentLife) {
removeAll();
addCandyInfo(cb.getCandy());
addMoneyInfo(cb.getMoney());
if (CurrentLife > 0) {
Units obj = d.searchUnit(ID);
JLabel info = new JLabel(new ImageIcon("res/Info/"
+ ((Integer) (ID % 100)).toString() + ".png"));
... |
bec48f90-987a-460f-94ae-767d8d20877e | 9 | @Override
protected String buildHeader() {
String header = options().header();
if (options().copyHeader()) {
Configuration def = getDefaults();
if ((def != null) && (def instanceof FileConfiguration)) {
FileConfiguration filedefaults = (FileConfiguration) de... |
eca2bdfc-433b-44a2-a998-4492b030bb02 | 9 | public String[] getOptions() {
Vector options = new Vector();
if ( (getUrl() != null) && (getUrl().length() != 0) ) {
options.add("-url");
options.add(getUrl());
}
if ( (getUser() != null) && (getUser().length() != 0) ) {
options.add("-user");
options.add(getUser());... |
3c858243-83c5-4c13-88d3-f23f71f14d7d | 4 | private boolean validateShortTime(String timeString)
{
// Add space to the end to ensure proper matching
timeString = timeString.toLowerCase() + " ";
// Assert format
if (!timeString.matches("(\\d+h )?(\\d+m )?(\\d+s )?(\\d+ms )?"))
{
return false;
}
... |
9612eb17-e667-4763-b434-31848c292303 | 7 | public Service(Server server, String key, String type, Map<?, ?> config) throws Exception {
log.info("Setting up the service for {}", key.length() == 0 ? "*" : key);
this.server = server;
this.key = key;
this.type = type;
log.debug("Finding the name");
Object obj = config.get("name");
if (!(obj inst... |
a5d24d86-e009-4901-ab9c-5dae5dee93cc | 0 | @Override
public void setActive(boolean value) {
doSetActive(value);
} |
b28f1a27-2fbe-4da7-a624-a43712410d4b | 5 | private void modifyField(Inspector inspector, String[] cmd) {
String fieldName = cmd[1];
String newValue = cmd[2];
try {
Field field = inspector.getFieldByName(fieldName);
if (field == null)
throw new NoSuchFieldException();
else
field.setAccessible(true);
/* Check which type to parse the val... |
245ad3cb-882e-4aaf-af99-a83a1062b3e1 | 6 | public static void updateNowTimestamp(Keyword kbaction) {
if (kbaction == Logic.$LAST_KB_ACTION$) {
return;
}
if (kbaction == Logic.KWD_UPDATE_PROPOSITION) {
if (Logic.descriptionModeP() ||
((!(((Module)(Stella.$MODULE$.get())) == ((Context)(Stella.$CONTEXT$.get())))) ||
((B... |
92f2dfa1-54ad-4c89-8068-b1fb65a2f24a | 8 | public void XbIDX9Neg (int n, int newNumber, String Step2){
int minus = 256;
String ff;
int ln;
switch(n)
{
case 0:
Step2 = Step2.replace("xb", "E1");
minus = minus - newNumber;
ff = Integer.toHexString(minus);
ln = ff.length();
if(ln == 1)
ff =... |
314a8094-4153-41e1-98d3-cf96d973f043 | 0 | public void setBlood(int blood) {
this.blood = blood;
} |
92e2a0ba-8652-48d9-9a1a-20b61cf67bb5 | 6 | public String renderPagination(PaginationInfo paginationInfo,String jsFunction){
StringBuffer strBuff = new StringBuffer();
int firstPageNo = paginationInfo.getFirstPageNo();
int firstPageNoOnPageList = paginationInfo.getFirstPageNoOnPageList();
int totalPageCount = paginationInfo.... |
992bd7c0-fbb5-438c-871f-5337986027d5 | 3 | public Person(String name){
if (name == null) {
throw new NullPointerException("null name");
} else if (name.isEmpty()) {
throw new IllegalArgumentException("empty name");
}
synchronized (people){
if (people.containsKey(name)) {
throw n... |
cd09b960-0d15-4cd3-9622-af2035957afc | 7 | private Node[] parseLiteralArrayElements() throws IOException, LexerException, ParserException
{
List<Node> nodes = new ArrayList<Node>();
Token token;
for (token = this.nextToken(); token != null; token = this.nextToken()) {
if (token.getType() == TokenType.SEPARATOR && token.getValue().equals(")"))
... |
5c2d11ac-ee35-48f3-9f16-2620abe333cc | 4 | public void setCondition(Expression cond) {
this.cond = cond;
if (type == POSSFOR) {
/*
* We can now say, if this is a for block or not.
*/
if (cond.containsMatchingLoad((CombineableOperator) incrBlock
.getInstruction())) {
type = FOR;
incrInstr = incrBlock.getInstruction();
incrBlock... |
caf57500-3412-4562-97ad-b27ff2ff4242 | 9 | public static void main(String[] args) {
// default values
int portNumber = 1500;
String serverAddress = "localhost";
String userName = "Anonymous";
// depending of the number of arguments provided we fall through
switch (args.length) {
// > javac Client username portNumber serverAddr
case 3:
server... |
2658d14b-8a7e-4ffe-b9f4-86ed5b26a83e | 1 | @Override
public void setTypeMap(Map<String, Class<?>> map) throws SQLException {
connection.setTypeMap(map);
} |
cf2b4151-4811-4012-9a13-7e8805272d4a | 9 | protected static boolean menuPrincipal(boolean prems) {
if (prems) {
System.out.println("Tapez 'aide' ou '?' pour voir le détail des commandes.");
System.out.println("Commandes disponibles : trajets, membre, aide (?), quitter.");
System.out.println("Que voulez vous faire ?");
}
System.out.print(">");
S... |
1cf9c26f-b06a-434a-a7c1-b540728d7bde | 0 | @Override
public void startSetup(Attributes atts) {
super.startSetup(atts);
} |
42f6f7d7-f410-4101-800e-319d64c4d4ec | 8 | private void finishRound(boolean serverWinRound) {
if (serverWinRound) serverWinCount++;
else clientWinCount++;
final boolean serverWin = (serverWinCount == MAX_ROUNDS);
final boolean clientWin = (clientWinCount == MAX_ROUNDS);
if (serverWin || clientWin) {
/... |
8bb3fd7b-1f27-4ff2-837d-501a0a18ebf5 | 2 | public void removeHero(Hero hero)
{
System.out.println("remove hero "+hero+" "+hero.getX()+" "+hero.getY());
mapWidget.objectAt(hero.getY(), hero.getX()).setLayer(hero.stackLevel(), null);
mapWidget.objectAt(hero.getY(), hero.getX()).setLayer(4, null);
WorldMapObject o = p2o.get(hero.getX(), hero.getY());
if... |
24a10186-6a22-4c35-a46c-d433b2245af7 | 6 | public boolean movesremaining() {
for (int i = 0; i < bricks.length; i++) {
for (int j = 0; j < bricks[0].length; j++) {
if (bricks[i][j].state == true) {
boolean playing = remaining(i, j, 1);
if (bricks[i][j].color >= 6 && bricks[i][j].color <= 8)
playing = true;
if (playing)
return... |
78010ffa-5632-4ff0-a511-9985019ff040 | 5 | public static void DoTurn(PlanetWars pw) {
//notice that a PlanetWars object called pw is passed as a parameter which you could use
//if you want to know what this object does, then read PlanetWars.java
//create a source planet, if you want to know what this object does, then read Planet.java
Planet... |
1c9e158f-df5f-4fb6-8407-b145614a579f | 8 | @Override
public void update(float tpf) {
float speed = fast ? walkSpeed * 2 : walkSpeed;
Vector3f camDir = cam.getDirection().clone().multLocal(speed);
Vector3f camLeft = cam.getLeft().clone().multLocal(speed);
camDir.y = 0;
camLeft.y = 0;
walkDirection.set(0, 0, 0)... |
65be71ca-b525-4c37-a32a-e4771483041f | 8 | @EventHandler(priority = EventPriority.LOWEST)
public void onEntityDamageByEntity(EntityDamageByEntityEvent e){
if(e.getEntity() instanceof Player){
Player p = (Player) e.getEntity();
if(ArenaManager.getArenaManager().isInArena(p)){
Arena arena = ArenaManager.getArenaManager().getArenaByPlayer(p);
... |
ee75550d-51be-40ea-81e0-324afdc129b1 | 0 | public void removeAll() {
mongoImageTemplate.remove(new Query(), Image.class);
} |
28b7ea44-13d3-4ff7-8f97-d33e0a9dc70e | 4 | public boolean isEmpty() {
return word.isEmpty() && definition.isEmpty() && notes.isEmpty() && category.isEmpty() && tags.isEmpty();
} |
bb7b96d5-0607-4cbc-9712-25b873cf9f76 | 0 | public boolean isAbsolutePath() {
return this.is_absolute_path;
} |
2e594bb9-13d3-42e7-a983-23c337ffb0d9 | 6 | private void initializePlayers(int playerNum) {
// 2 or 3 player games have 5 cards per player, 4 or 5 have 4 cards per player.
int playerHandSize = 4;
if (playerNum < 4) {
playerHandSize = 5;
}
this.playerArray = new Player[playerNum];
this.P1 = new Player("Amy", playerHandSize);
this.playerArray[0... |
0fad177b-eb52-4589-b922-f91c622baf9c | 3 | @Test
public void testUser1() {
User stanford = User.getUserByUsername("stanford");
ArrayList<User> stanfordFriends = stanford.getFriendList();
assertEquals(stanfordFriends.size(), 3);
for (int i = 0; i < stanfordFriends.size(); i++) {
assertTrue(stanfordFriends.get(i).username.equals("berkeley") ||
st... |
2cb1d743-2614-41fe-af1a-8e80aaf9249f | 3 | public void buttonClicked(int id)
{
switch(id)
{
case 0:
SpellEntry spell = getClickedSpell();
if (spell != null)
{
spell.currentSpell.cast(thePlayer.level);
thePlayer.isCasting = false;
uncheckAllButtons(-1);
}
break;
case 1:
thePlayer.isCasting = false;
break;
}
} |
88085e31-a6c9-4de0-be38-b0e71d2d7265 | 9 | public void handleLeftClick(double x, double y, SUIComponent concerned){
if(cancel.equals(concerned))
frame.goTo(new PlayConfigPanel(frame));
else if(join.equals(concerned) && list.getSelected()!=-1){
String ip = ServersList.getServerIP(servers.getServers().get(list.getSelected()));
if(!NetworkUtils.isReac... |
a0497fb0-be2d-4b1f-819f-fb048252fcb0 | 7 | public void compFinalResult() {
do {
iStage++;
compAllocation();
if (compDistribution()) {
/* deadline can not be satisfied */
if (!bDeadline) {
System.out.println("THE DEADLINE CAN NOT BE SATISFIED!");
return;
} else {
System.out.println("\nNEW ROUND WITHOUT CHECKING:");
dEv... |
d2557808-cea6-413e-8728-bba2dadc8245 | 0 | public CasePanel(PumpingLemma l, PumpingLemmaInputPane p)
{
myPane = p;
myLemma = l;
myCases = new ArrayList();
setLayout(new BorderLayout());
add(new JLabel("Cases:"), BorderLayout.NORTH);
add(initTable(), BorderLayout.CENTER);
add(initButtons(), BorderLayout... |
e04df2cc-ab63-4761-9df7-9246a476c999 | 7 | final boolean method350(byte byte0) {
if (childIDs == null) {
return anInt568 != -1 || anIntArray590 != null;
}
for (int i = 0; childIDs.length > i; i++) {
if (childIDs[i] != -1) {
ObjectDefinition objectDefinition = Class40_Sub3.objectDefinitionForID(chil... |
8540b7b8-b1b0-4111-872c-5d16cb0a5263 | 1 | public String getSampleCommand() {
if (sampleCommand == null)
sampleCommand = command;
return sampleCommand;
} |
05588615-033e-4066-9faf-181ac966c9f3 | 4 | public static Bot load() {
Bot bot = null;
String jsonString = "";
try {
DataInputStream dataInputStream = new DataInputStream(new FileInputStream("bot.dat"));
try {
jsonString = dataInputStream.readLine();
} catch (IOException e) {
// ... |
4445f6b5-2257-4ec8-bba5-7da08bc414a5 | 1 | public boolean mouseClicked(int x, int y){
System.out.println("Works");
if(rect.contains(x, y)){
return true;
}
return false;
} |
884270af-5a7c-4aa7-9ffe-1c841dabd772 | 8 | public boolean isIndirectlyPoweringTo(World par1World, int par2, int par3, int par4, int par5)
{
int i = par1World.getBlockMetadata(par2, par3, par4);
if ((i & 8) != 8)
{
return false;
}
int j = i & 3;
if (j == 2 && par5 == 2)
{
retu... |
7d85b008-8270-4177-9a12-2e595a1b14a9 | 8 | public boolean simpan(){
boolean adaKesalahan = false;
Connection cn = null;
try{
Class.forName(Koneksi.driver);
} catch (Exception ex){
adaKesalahan = true;
JOptionPane.showMessageDialog(null,"JDBC Driver tidak ditemukan atau rusak\n"+ex,"Kesalahan",JOption... |
208f3744-4013-4862-9963-c26612b40554 | 8 | public PricingVector (double[] basicScheme, double[] newScheme)
{
// Initializing auxiliary variables
boolean startFlag = false;
int start = -1;
int end = -1;
String type = "";
double currentValue = 0;
double previousPricing = 0;
double previousValue = 0;
// For all the minutes of... |
f47aa4c5-6dd5-4255-8454-7aa27e22cc3f | 2 | public String chooseHeadChild(String parentCategory, Map<String, String> edges, Sentence sentence) throws IDrefNotInSentenceException {
//smaller is better!
int bestEdgeQuality = Integer.MAX_VALUE;
String bestChildRef = null;
int curEdgeQuality;
for (Map.Entry<String, String> edge : edges.entrySet()) {
... |
25736301-6d37-4a13-ac19-e2ccc9fb3a48 | 0 | public String toString()
{
return super.toString() + ": " + getUnprocessedInput() + "--" + getOutput();
} |
dc98ffa5-a653-4b13-847a-cf3a5f290dcd | 1 | private void setLatitude(double latitude) {
double lat = LatLngTool.normalizeLatitude(latitude);
if (Double.isNaN(lat))
throw new IllegalArgumentException("Invalid latitude given.");
this.latitude = lat;
this.latitudeInternal = doubleToLong(lat);
} |
0c0faf60-b579-4666-9d92-3547d0beb637 | 9 | void updateSubTreeAfterNNI( double[][] A, node v, edge rootEdge,
node closer, node further, double dcoeff, direction d )
{
edge sib;
switch ( d )
{
case UP: //rootEdge is below the center edge of the NNI
//recursive calls to subtrees, if necessary
if ( null != rootEdge.head.leftEdge )
... |
cfcb7049-e40c-4f38-957e-620dee895b18 | 9 | public int atoi(String str) {
long result =0l;
int ans = 1;
String val = str.trim();
int length = val.length();
if(length == 0)
return 0;
int index = 0;
if(val.charAt(index) == '+' || val.charAt(index) == '-'){
ans = (val.charAt(index) == ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.