method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
1a8a65a4-6c86-4317-9db7-818c66ab98d2 | 1 | private boolean salvarXml() throws IOException{
boolean status;
File f = new File("xmls/", renavam+".xml");
if(f.exists())
f.delete();
status = f.createNewFile();
FileWriter x = new FileWriter(f, true);
x.write("<?xml version = \"1.0\" encod... |
b693777d-8966-43c7-964c-13aabe08419c | 1 | public void testWithEndMillis_long2() {
Interval test = new Interval(TEST_TIME1, TEST_TIME2);
try {
test.withEndMillis(TEST_TIME1 - 1);
fail();
} catch (IllegalArgumentException ex) {}
} |
9be84b95-227e-4ce9-a669-f81721d6b295 | 4 | public OTUltra(Main_Window caller, String reader_port) {
super(caller, reader_port);
myself = this;
this.caller = get_caller();
this.m_port = get_port();
connected = false;
processed = 0;
expected = 0;
Logger("Ultra opening !");
serial = new SerialIF(this.caller, myself, m_port, 0); //Configure se... |
57618fd6-0217-4d22-acb7-3a35e8304eda | 5 | public InputStream getThumbnailInputStream() {
if(playlist!=null)
return super.getThumbnailInputStream();
String url="";
if(album!=null)
url=album.getCoverURL();
if(artist!=null)
url=artist.getCoverURL();
if(url.length()==0)
return super.getThumbnailInputStream();
try {
return downloadAnd... |
043d61fc-cb69-4a3a-bb94-48fa8de54bf7 | 8 | public ArrayList<Vehicle> VehiclesForFranchise( int FranID)
throws UnauthorizedUserException, BadConnectionException, DoubleEntryException
{
/* Variable Section Start */
/* Database and Query Preperation */
PreparedStatement statment = null;
ResultSet result... |
742f96fe-8b6a-412d-876d-cd530a885443 | 4 | @Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((elseIfs == null) ? 0 : elseIfs.hashCode());
result = prime * result + ((exp1 == null) ? 0 : exp1.hashCode());
result = prime * result + ((stateSeq1 == null) ? 0 : stateSeq1.hashCode());
result = prime * resu... |
ce3215af-8f5b-496f-8128-3b92c1ad21b8 | 5 | public void keyPressed(int k) {
switch(k){
case KeyEvent.VK_ENTER:
select();
break;
case KeyEvent.VK_UP:
currentChoice--;
if (currentChoice == -1){
currentChoice = options.length - 1;
}
break;
case KeyEvent.VK_DOWN:
currentChoice++;
if (currentChoice == options.length){
currentCh... |
13803fab-3efc-44ea-a2eb-ff3f26ab30a4 | 2 | public void volcarDatos(ArrayList<Libros> libros){
DefaultTableModel model = (DefaultTableModel) jTable1.getModel();
while(model.getRowCount()>0)model.removeRow(0);
for(Libros l : libros){
Object[] fila = {
l.getCodigolibro(),
l.getNombrelibro(),
... |
900a13fd-2c97-4b5a-9e46-42646190b28e | 6 | @Override
public void actionPerformed(ActionEvent ae) {
String comando = ae.getActionCommand();
switch (comando) {
case "Depositar":
if (!Base.hasConnection()) {
Base.open("com.mysql.jdbc.Driver", "jdbc:mysql://localhost/quiniela", "tecpro", "tecpro");... |
de4a2f5f-735a-42f0-81e2-d3ed74306798 | 0 | private ParkManage(){
} |
4c093057-ca9d-47ab-a88b-42d9d5624ea6 | 9 | public void mouseClicked(MouseEvent e) {
//if the mouse was left clicked on
//the node then
if (m_clickAvailable) {
//determine if the click was on a node or not
int s = -1;
for (int noa = 0; noa < m_numNodes;noa++) {
if (m_nodes[noa].m_quad == 18) {
//then is on the screen
... |
d80e1304-df4e-4f74-ae41-7ab832b769fe | 0 | public void setCoordTransform(AffineTransform coordTransform) {
this.coordTransform = coordTransform;
} |
91b4e37b-f4aa-4a83-a84f-795c9c9b6d41 | 7 | public boolean equals(Object par1Obj)
{
if (!(par1Obj instanceof NBTBase))
{
return false;
}
NBTBase nbtbase = (NBTBase)par1Obj;
if (getId() != nbtbase.getId())
{
return false;
}
if (name == null && nbtbase.name != null || na... |
470c8b3e-1cf4-4333-8497-e6811af6a5c7 | 7 | protected void processRuleBlock(String block, Engine engine) throws Exception {
BufferedReader reader = new BufferedReader(new StringReader(block));
String line;
RuleBlock ruleBlock = new RuleBlock();
engine.addRuleBlock(ruleBlock);
while ((line = reader.readLine()) != null) {
... |
a63c94cf-e632-41ae-9366-3d3d0375c93e | 5 | @Override
public boolean execute(CommandSender sender, String identifier,
String[] args) {
String titleName = args[1];
String titleId = args[0];
if (sender instanceof Player) {
try {
if (DBManager.idExist(titleId)) {
sender.sendMessage("This id already exist.");
return false;
}
if (D... |
5a91095a-a820-4dde-81b4-829be97b6ade | 0 | private MineOS(){} |
d448c3a2-9892-453f-bfc2-35213df411a7 | 5 | private void setQuorums()
{
HashMap<FileServerInfo, Integer> servers = new HashMap<FileServerInfo, Integer>();
for(FileServerInfo f : serverIdentifier.values())
{
servers.put(f, (int) f.getUsage());
}
servers = (HashMap<FileServerInfo, Integer>) sortByComparator(servers);
int quorumSize = Math.round(s... |
c41c746c-f0b1-4fce-aecd-051d733657da | 6 | private boolean saveAll(UserScore userScore) throws SQLException {
PreparedStatement insertUserStmt = null;
PreparedStatement selectStmt = null;
PreparedStatement insertScoreStmt = null;
int result = 0;
try {
int playerId = getPlayerById(userScore.getUserName());
... |
6f74dfb2-01ce-4850-a356-0b7ba8847685 | 9 | @Override
public MultiLabelOutput inferenceProcedure(Instance instance)
throws Exception {
Instance tempInstance = DataUtils.createInstance(instance,
instance.weight(), instance.toDoubleArray());
Comparator<LabelCombinationExtended> probabilityComparator = new Comparator<LabelCombinationExtended>() {
... |
5aba1c75-f907-4c01-85eb-dac9f3a1f502 | 8 | public boolean valid() {
if (! super.valid()) return false ;
if (driven != null) {
if (driven.destroyed()) return false ;
if (! driven.canPilot(actor)) return false ;
}
//
// TODO: Put the passenger-delivery schtick into a different class. It's
// making a mess of things here.
... |
0f7012af-6448-48db-94b9-f71282c642b1 | 3 | public int[] createTileArray2(int numTiles)
{
arrTiles = new int[numTiles];
arrTilesCount = new int[numTiles];
int halfTiles = numTiles / 2;
int c = 0;
try
{
// First set of tiles
for (int n = 0; n < (halfTiles); n++)
{
arrTiles[n] =... |
7eecf7cf-0861-4e62-a501-bfcd50aeafee | 1 | public int doSalary(int sal){
if(this.salary != null)
return this.salary.doSalary(sal);
return sal;
} |
01078f17-e5f4-4fc8-b5bd-fe150600bbcf | 7 | public static boolean isValid(String content){
if(content != null && !content.isEmpty() && !content.equals("") && !content.equals("[false]") && !content.equals("null") && content.length() != 0 && content.length() < 500){
return true;
} else {
return false;
}
} |
867fe4df-85e1-4031-b9a6-08514e770a93 | 6 | @EventHandler
public void EnderDragonSpeed(EntityDamageByEntityEvent event) {
Entity e = event.getEntity();
Entity damager = event.getDamager();
String world = e.getWorld().getName();
boolean dodged = false;
Random random = new Random();
double randomChance = plugin.getEnderDragonConfig().getDouble("EnderD... |
f8b8d64b-641f-4e13-a2e7-f9fd1a15a558 | 5 | public static void main (String args[]) throws Exception
{
String hostname = HOSTNAME;
int port = PORT;
int timeToSleep = TIME_TO_SLEEP;
if(args.length > 0) {
List<String> argList = Arrays.asList(args);
if(argList.contains("-h")) {
int indexOf = argList.indexOf("-h");
... |
25ffb066-f39f-4c6d-8321-442d01fb0206 | 9 | public static List<Mensalidade> getListaMensalidadeEmAberto(String nome, Date data){
List<Mensalidade> lista = new ArrayList();
Connection conn = Conexao.getConexao();
PreparedStatement stmt = null;
ResultSet rs = null;
Mensalidade mens = null;
try {
... |
2cd69869-c1fd-4f42-8c91-ef329a709627 | 3 | public void setMinus(TMinus node)
{
if(this._minus_ != null)
{
this._minus_.parent(null);
}
if(node != null)
{
if(node.parent() != null)
{
node.parent().removeChild(node);
}
node.parent(this);
... |
383e1fc9-8e29-47bc-a2da-37dc23768c79 | 4 | public String[] ReadTargetPHPFileData() {
String[] FaultTypeOperators = null;
int count = 0;
Statement s = null;
ResultSet rs = null;
// Adapted from http://developers.sun.com/docs/javadb/10.2.2/ref/rrefclob.html
try {
if ((conn = setConn()) != null) {
... |
361e435c-3226-4da9-8c36-9a23eebe4665 | 1 | @Override
public List<Integer> update(Criteria beans, Criteria criteria, GenericUpdateQuery updateGeneric, Connection conn) throws DaoQueryException {
List paramList1 = new ArrayList<>();
List paramList2 = new ArrayList<>();
StringBuilder sb = new StringBuilder(UPDATE_QUERY);
String ... |
c4c419a6-2917-4811-8c95-3b3e58baf678 | 6 | private List<String> createCommand() throws MojoExecutionException {
List<String> cmd = new ArrayList<String>();
cmd.add(getCommandPath("createdb"));
if (host != null) {
cmd.add("-h");
cmd.add(host);
}
if (port != null) {
cmd.add("-p");
... |
e1423100-f89e-4744-b823-2fa65f467847 | 2 | @Override
public PreparedStatement prepare(String query) {
//Connection connection = null;
PreparedStatement ps = null;
try
{
//connection = open();
ps = connection.prepareStatement(query);
return ps;
} catch(SQLException e) {
if(!e.toString().contains("not return ResultSet"))
this.writeError... |
c4e27467-e367-48ed-9e8b-d07437ac1d6f | 8 | public static Node getNormalizedNode(String normalized){
if (normalized == "01"){
return new Node("NOTYPE",0);
}
else {
Node resultat = new Node("NOTYPE",0);
ArrayList<String> filsName = new ArrayList<String>();
int cut = 0;
int debutCut = 0, finCut = 0;
for (int i = 1; i<normalized.length(); i... |
a81efb31-9155-474a-a6c6-a630100dedc5 | 5 | private void selectSQLiteData() {
if (m_sqlTable == null) {
return;
}
ResultSet selectAll = m_sqlTable.select("*");
if (selectAll == null || countResults(selectAll) != 3) {
log("selectSQLiteData selectAll Failed!");
}
ResultSet selectSam = m_sqlTable.select("*", "name='SAM'");
if (selectSam ==... |
7de553f3-baf6-48a6-b5a3-9b7624c99a43 | 8 | private JTreeNode<T> convertList( JTreeNode<T> current, boolean isLeft){
if(current == null){
return null;
}
JTreeNode<T> left = convertList(current.getLeftNode(), true);
JTreeNode<T> right = convertList(current.getRightNode(), false);
if(left!=null && right==null){
left.setRightNode(current);
cur... |
dd26de63-d7cb-4b04-8d99-85ca7254abf3 | 6 | public static void main(String[] args) {
Integer philosophersAmount = 5;
Integer hungryAmount = 2;
Integer chairAmount = 5;
Integer runtime = 30; //in s
Table tisch = new Table(chairAmount);
List<Philosopher> philosophers = new ArrayList<Philosopher>();
List<Thread> philosopherThreads = new ArrayList<Th... |
961b4d2b-f281-4d3c-a710-ba34b6d65e0b | 8 | public void sendFile(String localFileName, String fileOnServer) throws IOException {
File file = new File(rootFolder, localFileName);
if(! file.exists()) {
throw new FileNotFoundException("File " + localFileName + " not found in the root folder " + rootFolder.getAbsolutePath());
}
if(file.isDirectory()... |
1000a14b-f209-4c73-a92a-3a564a7b434e | 6 | public boolean move(String input) {
// logically what is happening is this variable starts out false,
// gets changed to true if the player moved successfully, then is
// send back and it tells the program if the player has moved or not.
boolean moved = false;
switch (input) {
case "north":
moved = playe... |
839170ad-0d93-46c0-981e-b5444ff1316b | 4 | public void chargerLivraisons(String adresse)
{
this.vueAppli.afficherCurseurAttente();
try
{
if (this.itineraireInitial != null)
{
ParserXML livraisonParser= new ParserXML(adresse,TypeFichier.LIVRAISONS);
Pair<NoeudItineraire,ArrayList<PlageHoraire> > dataLIvr =
livraisonParser.genererLivr... |
04530adb-2fb2-4035-ab71-37af3770a042 | 0 | @Override
public void documentRemoved(DocumentRepositoryEvent e) {} |
4030aad7-684f-490e-be17-275b562e623a | 0 | public int getSoundNarration()
{
return soundNarration;
} |
de201e39-edcb-4a96-b64d-ef821a8769ac | 6 | private String munecoBasico(){
String muneco = "";
if(intentos == 5){
muneco = muneco + " O ";
}
if(intentos == 4){
muneco = muneco + " O <BR>"+
" / <BR>";
}
if(intentos == 3){
muneco = muneco + " O <BR>"+
" /| <BR>";
}
if(intentos == 2){
muneco = mun... |
089c5734-5ebb-4fa5-9c15-3221fc902002 | 1 | public static void info(String msg){
if(Settings.debug) System.out.println(info+" "+msg.trim());
} |
76e28a4d-990d-4ed7-a397-282afd0a115f | 6 | private void writeChars( int db, int ln, String sc )
{
RandomAccessFile f = ( db==0 ? fdbf : db==1 ? ffpt : fcdx );
int l = sc.length();
int ml = Math.min(ln,l);
try { f.writeBytes( (l==ml ? sc : sc.substring(0,ml)) ); }
catch (IOException e) { e.printStackTrace(); }
if(ln>l)
{
String s = new String(... |
8ce8550f-8b5e-46b1-8f0a-62721af052dc | 2 | @Override
public void endElement(String uri, String localName, String qName)
throws SAXException {
if (!localName.equals(BuilderProperties.getString("root_element"))) { //$NON-NLS-1$
if (parserFactory.hasDevice(localName)) {
devices.add(currentParser.getDevice());
currentParser = null;
}
}
... |
9020c38a-bd21-407f-92dd-11607e26b60e | 2 | public static void checkAutoBroadcastConfigYAML() {
File file = new File(path + "AutoBroadcast/config.yml");
if(!file.exists()) {
try {
file.createNewFile();
FileConfiguration f = YamlConfiguration.loadConfiguration(file);
f.set("Interval.Hours", 0);
f.set("Interval.Minutes", 0);
f.set("Inter... |
ee3916ff-c658-4ac0-a65c-11de6d9de0b8 | 2 | public String addIngredient() {
if (ingredient != null) {
try {
restClientBean.getIngredientClient().createIngredient(ingredient);
} catch (Exception e) {
e.printStackTrace();
}
}
return null;
} |
076d895e-7bed-40d3-9b8c-45d00f8348e6 | 3 | @Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final ProductBrand other = (ProductBrand) obj;
if (!Objects.equals(this.szBrandId, other.szBrandId)) {
... |
654d3472-abd7-47b9-94a6-e195cdc5e8e7 | 2 | @Override
public void doAction(Player player, Grid grid) throws InvalidActionException {
if (player.getRemainingTurns() <= 0)
throw new InvalidActionException("The player has no turns left!");
Position currentPos = player.getPosition();
Position newPos = new Position(currentPos.getxCoordinate(), currentPos... |
7b9d5d72-d82d-4c72-ae6e-ce522e61445b | 7 | @Test
public void testQueryOrder() throws FileNotFoundException{;
int count = 0;
for (Player p : myGame.getPlayers()){
if (count == 0){
assertEquals(p.getName(), "Test name");
count++;
}
else if (count == 1){
assertEquals(p.getName(), "Elessar Telcontal");
count++;
}
else if (count == 2){
as... |
5e6d5956-884a-4ece-8680-b51684e5e62b | 7 | public static long parseTimeInterval(String str) {
try {
int len = str.length();
char suffix = str.charAt(len - 1);
String numstr;
long mult = 1;
if (Character.isDigit(suffix)) {
numstr = str;
} else {
numstr... |
945270c3-5b8d-4ab1-873f-45922d90f50d | 4 | public final void reset() {
this.taskPool.addTask(new Runnable() {
@Override
final public void run() {
for (final DropTargetContainer<?, ?, ?> target : AbcMapPlugin.this.targets) {
target.clearTargets();
}
}
});
this.trackMap.clear();
this.instrumentToTrack.clear();
} |
53ce34df-c2ab-4e10-a2f5-f7156c6460dc | 0 | public String getFoundKey(){
return _key + "Found?";
} |
46912279-04a3-4f8c-8261-f76875e21152 | 8 | private void updatePropertyEditor_selected() {
HashSet<Vertex> selectedVertices = spm.getSelectedVertices();
HashSet<Edge> selectedEdges = spm.getSelectedEdges();
int numOfSelectedVertices = selectedVertices.size();
int numOfSelectedEdges = selectedEdges.size();
//if there was ... |
0f194553-0ece-4afe-a710-89571f4e6f90 | 6 | private void queryForTileBars(){
//TODO: BUGS EVERYWHERE IF THIS ISN'T RESET TOOK ME 5 HOURS TO FIGURE THIS OUT
selectedChapters = new ArrayList<>();
for(int i = 0;i < repository.size();i++){
selectedChapters.add(new ArrayList<Integer>());
}
//Reset all buttons text to the Magnify text.
for(int i = 0;... |
16970d59-e0d9-47b7-a8ab-f9abf4aebfb6 | 1 | public Onderwerp(final logic.Onderwerp onderwerp, final Spel spel) {
setOpaque(false);
setBorder(null);
setLayout(new MigLayout("", "[123px:176.00,grow,fill]", "[40.00][100px:149.00:100px,grow,fill]"));
try {
JLabel lblSteden = new JLabel(onderwerp.getNaam());
lblSteden.setHorizontalAlignment(SwingConstan... |
893d6530-bc35-4412-b4cb-5f810d30faa1 | 0 | public static String wrapper(String data){
return "<html>"+
head()+
"<body>"+
"<table id=\"hor-minimalist-b\">"+
thead()+
data+
"</table>"+
"</body>"+
"</html>";
} |
e2e3c9fe-9ad1-4e8f-a6f0-6142ece3f3ff | 0 | public MoveTest() {
} |
799d81c1-8f00-4537-acae-e7b4cf6e61fc | 8 | private void profile(String hostname, String jobId, boolean needMetrics, int sampleMapperNum, int sampleReducerNum) {
SingleJobProfiler profiler = new SingleJobProfiler(hostname, jobId, needMetrics, sampleMapperNum, sampleReducerNum);
job = profiler.profile();
finishedConf = job.getJobConfiguration();
new... |
55982100-a33c-4805-bbfd-92638be7fada | 8 | private void extractFileContent() throws Exception{
int first_frame, num_frames, looping_frames, frames_per_second; //data from file
int end_frame;
String description = "";
for( int i = 0; i < lines.size(); i++){
String line = lines.get(i);
line = line.trim();
if( line.len... |
3e636c3e-6f45-4db6-b143-1e133b8682e6 | 4 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Variable other = (Variable) obj;
if (rang != other.rang)
return false;
return true;
} |
b26c7391-25b5-4306-aa56-f436a323781a | 6 | public void testRemoveAllTCollection() {
int element_count = 20;
TIntList other = new TIntLinkedList();
for ( int i = 0; i < element_count; i++ ) {
other.add( i );
}
TIntList list = new TIntLinkedList( 20 );
for ( int i = 0; i < element_count; i++ ) {
... |
3f83fdb6-753b-401e-bd4c-6336b05aa63d | 4 | private ListNode findMid(ListNode head){
ListNode oneStep = head;
ListNode twoStep = head;
while(oneStep.next != null && twoStep.next != null && twoStep.next.next != null){
twoStep = twoStep.next;
if(twoStep == null){
break;
}
twoStep = twoStep.next;
... |
9cb52eb9-034a-4b99-9d2a-4fb585599100 | 3 | public void jump() {
if (jumped == true && jumpLimit == false) {
speedY += JUMPSPEED2;
jumpLimit = true;
}
if (jumped == false) {
speedY = JUMPSPEED;
jumped = true;
}
} |
a149f01f-f9de-440a-b0a0-89755653922c | 6 | private void hybrid(int ch, int gr)
{
int bt;
int sb18;
gr_info_s gr_info = (si.ch[ch].gr[gr]);
float[] tsOut;
float[][] prvblk;
for(sb18=0;sb18<576;sb18+=18)
{
bt = ((gr_info.window_switching_flag !=0 ) && (gr_info.mixed_block_flag !=0) &&
(sb18 < 36)) ? 0 : gr_info.block_type;
... |
9b14b4bb-9d68-4f40-a5ac-eea9b68bd80e | 5 | public Point move( String move ) {
Point moveCoords = new Point();
switch( move ) {
case "NORTH":
moveCoords.x = 0;
moveCoords.y = -1;
break;
case "EAST":
moveCoords.x = 1;
moveCoords.y = 0;
break;
case "SOUTH":
moveCoords.x = 0;
moveCoords.y = 1;
break;
case "WEST":
moveCoords... |
730f438d-6c93-498f-84ae-936733cbf01e | 2 | private void fillBoxes() {
for (int i = -20; i <= 20; i++) {
cmbYear.addItem(calendar.get(Calendar.YEAR) + i);
}
for (int j = 1; j <= 12; j++) {
cmbMonth.addItem(j);
}
cmbYear.setSelectedItem(year);
cmbMonth.setSelectedItem(month);
cmbYear.... |
e8237e9c-ba88-42be-8e7d-8fc02e41fbda | 2 | @FXML
protected void doubleClickPlaySelectedSong(MouseEvent mouseEvent) throws Exception {
if (mouseEvent.getButton().equals(MouseButton.PRIMARY)) {
if (mouseEvent.getClickCount() == 2) {
playSong();
}
//todo list index change
}
} |
63e01ca3-172a-4596-b230-d98aa0e66de7 | 3 | public boolean equals(Object o) {
Association other = (Association) o;
return (this.PID.equals(other.PID) && this.QID.equals(other.QID))
|| (this.PID.equals(other.QID) && this.QID.equals(other.PID));
} |
e606109f-b7f5-4707-845b-332694deddef | 8 | private void cmbBoxAgeLimitActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_cmbBoxAgeLimitActionPerformed
{//GEN-HEADEREND:event_cmbBoxAgeLimitActionPerformed
switch (cmbBoxAgeLimit.getSelectedIndex())
{
case 0:
switchLimitation = 0;
break;... |
e3569440-e86f-47c7-b7fe-d8eb0f06aad4 | 3 | public ArrayList<Boolean> solve()
{
double iterations = Math.pow(2,varCount); //2^varCount
double start = System.currentTimeMillis();
int tenth = (int) iterations/10;
for(int i = 0; i<(iterations);i++)
{
if(i%tenth == 0)
{
System.... |
1011c0b9-7a59-4590-aa4a-d269253b4470 | 4 | public static void setLookAndFeel(){
try {
// Set System L&F
UIManager.setLookAndFeel(
UIManager.getSystemLookAndFeelClassName());
}
catch (UnsupportedLookAndFeelException e) {
// handle exception
}
catch (ClassNotFoundException e) {
// handle except... |
8a32487e-9635-4555-be88-d9599ba620a2 | 6 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
City other = (City) obj;
if (cityName == null) {
if (other.cityName != null)
return false;
} else if (!cityName.equals(other.cityName))
... |
de561bd4-c389-4c9e-9c33-5f61be3404f6 | 1 | public void actionPerformed(ActionEvent e) {
if (sound != null) {
sound.play();
}
} |
68465910-c1dd-4bb9-847b-2962aae87006 | 0 | void flip() {
System.out.println("Flip trangle");
} |
504a8b71-08a2-4a1e-bf0a-99ce33501676 | 0 | public static void main(String[] args) throws InterruptedException {
MailUtil.sendMailSynchron("test", "这是一个测试", "289048093@qq.com",true);
Thread.sleep(5000);
} |
ed1b86e7-fb62-430a-9b6c-0528b210fd9a | 8 | @Override
public void handleAttribute(final char[] buffer, final int nameOffset, final int nameLen,
final int nameLine, final int nameCol, final int operatorOffset, final int operatorLen,
final int operatorLine, final int operatorCol, final int valueContentOffset,
final int value... |
ce392a62-3073-4e84-9694-6ce53ea78340 | 7 | private void factor() {
int n = LU.numRows();
// Internal CRS matrix storage
int[] colind = LU.getColumnIndices();
int[] rowptr = LU.getRowPointers();
double[] data = LU.getData();
// Find the indices to the diagonal entries
int[] diagind = findDiagonalIndices(n... |
979e08e0-7d27-4943-9092-d2e34e079760 | 0 | public static void initView(JToolBar toolbar,
final BuilderController controller) {
toolbar.add(new JButton(new TooltipAction("Hint",
"Adds one transition.") {
public void actionPerformed(ActionEvent e) {
controller.hint();
}
}));
toolbar.add(new JButton(new TooltipAction("Complete",
"Adds a... |
52c89a51-30e0-4fdb-8e8d-7572402588f3 | 0 | public ChoiceQuest()
{
super(QuestType.CHOICEQUEST);
goTo="";
} |
15eac18d-f1f4-4f11-8180-4f558d3ef4e2 | 0 | public ClientHanldler(Socket client) {
this.client = client;
} |
8f465862-8712-47b6-8dab-2d4fb735888c | 0 | public NickAlreadyInUseException(String e) {
super(e);
} |
0c397765-fa1f-4b07-924d-634de4df0263 | 8 | private boolean searchDownForNextSupersetNode( Node node, K key, Object[] ret ) {
while( true ) {
// Descend left subtree if it might have superset node.
if( node.mLeft != null && mComp.compareMaxes( key, node.mLeft.mMaxStop.mKey ) <= 0 ) {
node = node.mLeft;
... |
7d8ae941-2417-43cf-89af-e78cfe8fb2b7 | 9 | private BattleSelector newBattleSelector(List<BotList> initialBattles,
final ChallengeConfig challenge, final String challenger,
final Map<String, ScoreError> errorMap) {
final LinkedList<BotList> battleList = Lists.newLinkedList(initialBattles);
return new BattleSelector() {
@Override
p... |
eb1ceb1e-597f-412f-846f-f07fe93294ff | 3 | @Override
public void mark(int boardPosition, Cell[] cellBoard, int rows, int columns) throws IllegalMark {
//Find the row.
int boardPositionRow = boardPosition / columns;
//Find the column.
int boardPositionColumn = boardPosition % columns;
//Positi... |
45b4ed56-08a1-48ae-828b-e2601ee07ff3 | 9 | public static Picture readPictureFromTga(String path) throws Exception {
File f = new File(path);
if (!f.exists()) {
throw new IllegalArgumentException("File at " + path + " does not exist. " + f.getAbsolutePath());
}
FileInputStream in = new FileInputStream(f);... |
0aec35f0-09f0-43d6-b6ea-c9dca0b2fbc3 | 8 | public Pedido insertar(Pedido pedido) throws DAOExcepcion {
System.out.println("PedidoDAO: insertar()");
String query = "INSERT INTO pedido (id_usuario,fecha,estado,total) VALUES (?,?,?,?)";
Connection con = null;
PreparedStatement stmt = null;
ResultSet rs = null;
try {... |
ec5f0a70-5dd9-4afc-85a8-ef0e9342d06c | 8 | void mouseWheel(long time, int rotation, int modifiers) {
if (!viewer.getAwtComponent().hasFocus())
return; // XIE
hoverOff();
timeCurrent = time;
// Logger.debug("mouseWheel time:" + time + " rotation:" + rotation + " modifiers:" + modifiers);
if (rotation == 0)
return;
if ((modifiers & BUTTON_MODIFI... |
d3fc1c3b-149f-4adc-a254-9959c1f187b8 | 2 | public void draw(){
background(255);
fill(0);
for(int i = 0; i < 5; i++){
threads[(int) alpha[i]].draw();
if(threads[i].getLinha().getAlpha() == 0){
nextLine();
System.out.println("AQUI");
}
}
} |
0cb8d590-e4d8-4b2e-9fd9-4a5c911482fb | 6 | @Override
public double predict(int userID, int movieID) {
double rating = 0;
ArrayList<Double> sim = new ArrayList<Double>();
ArrayList<Double> rat = new ArrayList<Double>();
ArrayList<Double> avg = new ArrayList<Double>();
HashMap<Integer, Double> tempHashMap = similarities.get(userID);
//Fill the a... |
abc6979b-282b-4a50-8ea1-7140c0536c53 | 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... |
1cfa6c61-ef8f-4892-85d6-3da12c9a526a | 9 | private void jbRechercheActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbRechercheActionPerformed
try {
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
} catch (ClassNotFoundException ex) {
JOptionPane jOErreur = new JOptionPane("Driver... |
06d8e2f2-d45b-4752-9f77-95583b3d0032 | 6 | public void update() {
player.update();
player.checkAttack(enemies);
player.checkCoins(coins);
finish.update();
finish.checkGrab(player);
bg.setPosition(tileMap.getx(), 0);
tileMap.setPosition(
GamePanel.WIDTH / 2 - player.getx(),
GamePanel.HEIGHT / 2 - player.gety());
if(player.i... |
77392a9c-380a-4c7c-b8f3-9ca5f186d42b | 5 | private void addMTWCs(MTWData data, int x, int y, int dx, int dy) {
// Create set of tuples with coordinates - with annoying syntax
Set<Tuple<Integer, Integer>> set = new HashSet<Tuple<Integer, Integer>>();
// Trace in the given direction and it's opposite direction
Tuple... |
3592eda6-5d20-4b63-ab5e-cf09523ad466 | 9 | private void get(Player cmdSender, String... args) {
for (String arg : args)
switch (arg) {
case CMD_ARG_GETOPS:
cmdSender.chat("List of Operators:");
for (OfflinePlayer player : getServer().getOperators())
cmdSender.cha... |
ab0cdba0-266b-41f4-8dd5-a41cc223c47c | 3 | @RequestMapping("salvarProduto")
public ModelAndView salvarProduto(Produto produto,
@RequestParam(value = "grupoDoProduto") String[] grupoDoProduto,
@RequestParam(value = "temaDoProduto") String[] temaDoProduto,
HttpServletRequest request) {
ModelAndView mav = new ModelAndView("redirect:admin");
if (adm... |
034fb49b-925b-4f10-a9de-4d9a87faaaf2 | 4 | void insert(RedBlackNode z)
{
RedBlackNode y = nil;
RedBlackNode x = root;
while(x != nil)
{
y = x;
if(z.key.compareTo(x.key) < 0)
x = x.left;
else
x = x.right;
}
z.parent = y;
if(y == nil)
root = z;
else if(z.key.compareTo(y.... |
234125b3-3a7c-4689-8efd-d2c67b542618 | 3 | private void waitForThread() {
if ((this.thread != null) && this.thread.isAlive()) {
try {
this.thread.join();
} catch (final InterruptedException e) {
plugin.getLogger().log(Level.SEVERE, null, e);
}
}
} |
5dde0a36-303d-40a8-8d6f-95dae940ebe6 | 5 | public void listPlugins(CommandSender sender, String[] args) {
if (args.length > 1) {
sender.sendMessage(pre + red + tooMany);
return;
}
StringBuilder list = new StringBuilder();
List<String> pluginList = new ArrayList<String>();
for (Plugin pl : Bukkit... |
79b6aeaa-6fbc-4c5a-a4ea-e2b95eec4c2e | 3 | public ViewUserLogin()
{
setTitle("Login");
setLayout(new GridLayout(3,2));
setDefaultCloseOperation(EXIT_ON_CLOSE);
setVisible(true);
u=new JLabel("Username");
p=new JLabel("Password");
uname=new JTextField(20);
pass=new JPasswordField(20);
login=new JButton("Login");
cancel=n... |
9d90eaa8-dd07-48b8-be4a-cf9d5f597043 | 5 | public static void loadAccounts() {
try {
accounts.clear();
File accountsFile = new File(Configuration.ACCOUNTS_DIR + File.separator + "Accounts.txt");
if (!accountsFile.exists()) {
accountsFile.createNewFile();
return;
}
S... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.