method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
9e2ac5c8-6fcb-454e-8b6d-fe065859b751 | 1 | public void Disconnect() {
try {
this.dbConnection.close();
}
catch (SQLException ex) {
System.out.println("Une erreur a été rencontrée lors de la fermeture de la connexion.\n" + ex.getMessage());
}
} |
b0081294-cd01-4ae2-b82b-727a02afe8d4 | 8 | public final JPoclASTParser.expr4_return expr4() throws RecognitionException {
JPoclASTParser.expr4_return retval = new JPoclASTParser.expr4_return();
retval.start = input.LT(1);
TypeTree root_0 = null;
Token char_literal93=null;
Token char_literal94=null;
JPoclASTPars... |
ce2425f0-0c9c-4973-a87b-051270783e95 | 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 Sample)) {
return false;
}
Sample other = (Sample) object;
if ((this.id == null && other.id != null) || (this.i... |
926e834b-d10c-4523-8258-7a78be3c3460 | 2 | @Override
public int compare(Player a, Player b) {
return a.hand.highCard.value < b.hand.highCard.value ?
-1 : a.hand.highCard.value == b.hand.highCard.value ? 0 : 1;
} |
5fd3e002-73ae-4b06-a1db-cd7edd8e7d2f | 2 | public Main(){
try{
Display.setDisplayMode(new DisplayMode(WIDTH, HEIGHT));
Display.setTitle(TITLE);
Display.create(new PixelFormat(0, 16, 1));
}catch(LWJGLException e){
e.printStackTrace();
}
init();
while(!Display.isCloseRequested()){
update();
render();
Display.update();
D... |
ec418c07-768c-4ace-9ad4-449d1fce37ee | 1 | public void actionPerformed(ActionEvent e)
{
alpha += -0.01f;
if (alpha <= 0) {
alpha = 0;
timer.stop();
}
repaint();
} |
b7c0e17e-8513-4158-8ca1-c5c35cb35d27 | 3 | private static void init() throws Exception {
graphQueue = new ArrayDeque<MyArrayList>();
unfinished_queue = new ArrayDeque<Long>();
unfinished_map = new HashMap<Long, UserEntry>();
System.out.println("Start");
HashSet<Long> finished = new HashSet<Long>();
loadFinished(finished);
System.out.println("... |
f1bd7ad8-99b6-424c-bd5e-24d953c14c82 | 5 | @Override
public boolean activate() {
return (!Bank.isOpen()
&& !validate(Constants.WAITFOR_WIDGET)
&& !Widgets.get(13, 0).isOnScreen()
&& Inventory.contains(Settings.itemOneID)
&& Inventory.contains(Settings.itemTwoID)
&& !Settings.usingHerb
);
} |
0f7c52b5-185a-4f5f-be84-c4976792c65e | 4 | public double messageNode2Factor(int factor, int node, int value) {
double result = 0;
// System.out.println("factor:" + factor + " node:" + node);
result += messageFactor2Node(node, node, value);
if (factor == potentials.chainLength() + node && factor > potentials.chainLength() + 1) {
// right factor f... |
24653c18-1dbd-44f6-a6ba-8d16af96110b | 1 | private void setModel() {
String[][] data = new String[NoE()][2];
for (int i = 0; i < NoE(); i++) {
data[i] = showCon.get(i).getVector();
}
String[] columnNames = {"Titel", "Interpret"};
table.setModel(new DefaultTableModel(data,columnNames){
private static final long serialVersionUID = 1L;
@O... |
f801097e-fe72-471a-9c9e-1107e71f1b60 | 0 | private ScoreManagerSingleton()
{
} |
2c3728d5-102b-4eae-af3f-e21c69c823dc | 7 | public DvfsDatas DVFSModes_PARSE(Element dvfsmodes)
{
DvfsDatas tmp_Dvfs_Datas = new DvfsDatas();
List liste_Mode = dvfsmodes.getChildren();
int nb_Mode = liste_Mode.size(); // == 2
System.out.println("nb mode == " + nb_Mode);
for(i... |
cd329f88-0d3b-40ef-b55f-55cc36ae98ba | 5 | @Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Sexo other = (Sexo) obj;
if (this.idSexo != other.idSexo && (this.idSexo == null || !this.idSexo.equals(o... |
f0d53e1d-87b9-4b2f-955b-1e3265152352 | 0 | public String getOpenEncoding() {
return openEncoding;
} |
7da2318d-a74a-468e-a3bd-b80f43754dc0 | 8 | public boolean equals (Object o) {
return (o.getClass().equals(this.getClass()) && (((((AbstractPair)o).component1 == null) &&
(this.component1 == null)) || ((this.component1 != null) && ((AbstractPair)o).component1.equals(this.component1)))
&& (((((AbstractPair)o).component2 ==... |
c5f88874-a8f0-4efb-b007-7480b73cf3c1 | 5 | public void odzyskajDane() {
File sciezka = new File("C:\\backupDB\\");
File[] lista = sciezka.listFiles();
int i = 0;
if (lista.length != 0) {
System.out.println("Lista dostępnych kopii bezpieczeństwa");
System.out.println(LINIA);
try {
... |
4c311477-488d-429f-af63-6ded15bd92dd | 2 | public ClassLoader getClassLoader() {
ClassLoader cl = getClassLoader0();
if (cl == null && !isBootstrapCl)
{
throw new IllegalStateException(
"ClassLoader has been garbage collected");
}
return cl;
} |
c978a625-6553-4f87-87c7-2af558395479 | 0 | public boolean accept(TMConfiguration tmc){
return tmc.isHalted();
} |
185f19fa-c495-424b-a530-e25b0e5adb5c | 2 | public DisplayObject removeChild(DisplayObject child) {
DisplayObjectImpl impl =
((ContainerImpl) overlay).removeChild(child.getOverlay());
if (impl != null) {
children.remove(child);
}
return (impl != null ? child : null);
} |
abe2fab3-5928-4ae0-a559-56b60a9d8835 | 9 | Class318_Sub1_Sub5_Sub1(AbstractToolkit var_ha, ObjectDefinition class51, int i, int i_7_,
int i_8_, int i_9_, int i_10_, boolean bool,
int i_11_, int i_12_, int i_13_, int i_14_) {
super(i_8_, i_9_, i_10_, i, i_7_, i_11_, i_12_);
do {
try {
aBoolean10130 = ((ObjectDefinition) class51).anInt874 !... |
b8f6b093-561e-43fe-bb6b-53967e9aee7c | 1 | private void nextQuestionButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_nextQuestionButtonActionPerformed
if(answersGroup.getSelection() == null) {
//Here we could show the dialog saying that user must select something
} else {
Knowledge.checkSimilarity... |
a72ecc93-549a-44fc-8dea-4288f39d7183 | 4 | public void run() {
// Either wait for the timeout or keep processing the inputs.
// Using Futures: http://stackoverflow.com/questions/2275443/how-to-timeout-a-thread
ExecutorService executor = Executors.newSingleThreadExecutor();
Future<Integer> ret = null;
Integer mpsNum = -1;
... |
3e1a2b3f-e242-41e4-9359-e5112222c908 | 4 | boolean numberIsLegal (int row, int col, int num) {
if (isLegalRow(row, col, num)&&isLegalCol(col, row, num)&&isLegalBox(row,col,num)) {
return true;
} else if (num == 0) {
return true;
} else {
return false;
}
} |
261c9751-f741-40fb-93ef-e2c0295da46a | 3 | @Override
public void emitCode(GluonOutput code) {
term.emitCode(code);
for (int i=0; i<terms.size(); i++){
code.code("PUSH EAX");
terms.get(i).emitCode(code);
switch (ops.get(i)) {
case ADD:
code.code("POP EBX");
code.code("ADD EAX,EBX");
break;
case SUBTRACT:
code.code("POP E... |
ea66fcfc-5368-4e8c-84d9-1b5398c51df8 | 6 | private void readDefList(ObjectModule module) throws SyntaxException {
int defCount = 0;
int defCountLineNum = 0;
int defCountOffset = 0;
calLocation();
if (scanner.hasNextInt()) {
// number of symbols defined in deflist
defCount = scanner.nextInt();
defCountLineNum = lineNum;
defCountOffset = o... |
05b430eb-b204-437b-ba08-f0517719a8ac | 7 | static boolean isValidToken(String token) {
if (token == null) {
return false;
}
if (token.length() == 0) {
return false;
}
if (token.length() > 255) {
return false;
}
if (token.indexOf('@') != -1) {
return false;
}
for (int i = 0... |
6dd4deac-033e-4c19-be98-f231f4267b13 | 7 | private static void sortFunction(Vector data, int begin, int end) { //the sorting algorithm used is Quick Sort, which sorts
int i=begin, j=end; //according to a pivotal point among the data
String pivot= (String) data.elementAt(end), swap, swap2; //the end of the data is considered as the pivotal po... |
754b33e3-cdc6-43ed-bec6-11e765f0e950 | 8 | public void animation() {
animationt--;
if (animationt >= 30) {
setImage(eel1);
}
else if (animationt < 30 && animationt >= 20) {
setImage(eel2);
}
else if (animationt < 20 && animationt >= 10) {
setImage(eel1);
}
else i... |
a5d6dcb7-e5e6-4b86-a2b1-a156b594bf7e | 3 | public static List<Prop> getValidProps(){
List<Prop> valid = new ArrayList<Prop>();
Prop instance = null ;
for( int i = 0 ; i < props.size(); i ++ ){
instance = props.get(i);
if( instance.getStatus() == PropStatus.ALIVE ){
if( (int)(System.currentTimeMillis()/1000) - instance.getStartTime() <= Consta... |
a661892c-0cf6-4761-a199-9e4ed850e12b | 0 | @Override
public String getDescription() {
return "(Extended property)";
} |
98826c07-45bc-4eed-9a2b-fa06bcdb380a | 0 | public int getCurrentLine() {
return environmentStack.peek().getCurrentLineNumber();
} |
87fa9c7f-8867-435c-9995-04a9858bfa48 | 3 | public double sampleVariance(int nt) {
if( (nt < 1) || (nt > n) ) return 0;
double mean = mean(nt);
double sum = 0;
for( int ns = 0; ns < numberOfSamples; ns++ ) {
double d = rankSum[ns][nt - 1] - mean;
sum += d * d;
}
double var = sum / ((numberOfSamples - 1));
return var;
} |
5b72c2ec-d112-49e7-baa3-50fa523d4f3b | 2 | public void testPropertySetMonth() {
YearMonthDay test = new YearMonthDay(1972, 6, 9);
YearMonthDay copy = test.monthOfYear().setCopy(12);
check(test, 1972, 6, 9);
check(copy, 1972, 12, 9);
test = new YearMonthDay(1972, 1, 31);
copy = test.monthOfYear().setCopy(2... |
5eb33d04-946d-464f-9180-5103ff8be9a6 | 0 | public int getY() {
return this.y;
} |
f1693c91-67e6-41d1-8a09-d31785ea5a29 | 9 | public static void main(String[] argv) throws IOException {
//First, get the command line parameters.
ICommandLineManager clm = new CommandLine(argv);
// Handles variables and settings from default.cfg
IVariablesManager vm = new VarsManager(clm);
// load before initing other s... |
a0d73edf-6d98-4f48-91fc-2e9e6dc44ec7 | 9 | public Employee(int idPracownika) {
if (idPracownika != 0 && idPracownika > 0) {
this.idPracownika = idPracownika;
try {
ResultSet resultSet =
ConnectionSingleton.getConnection(null).createStatement().
executeQuery("SELECT ... |
3464b5cf-a02a-475d-9c59-7ebf770b83b1 | 2 | private boolean pluginFile(String name) {
for (final File file : new File("plugins").listFiles()) {
if (file.getName().equals(name)) {
return true;
}
}
return false;
} |
23fcab25-da56-42c9-845b-26cea7fea072 | 4 | public String toString() {
StringBuffer result = new StringBuffer();
if (getTupleType().equals("I") || getTupleType().equals("Z")) {
int i = intTupleToInt(this);
result.append(i);
}
else {
result.append(getTupleType());
result.append("(");
boolean first = true;
for (V... |
3261893a-ab8e-424f-ace8-e01f4f2f649c | 0 | public int getId(){
return id;
} |
d75442d9-9ae5-4538-b445-1b90ec90c84a | 7 | @Override
public Object evaluate(ArrayList<Context1> pila) throws Exception {
int i;
Object temp = e.evaluate(pila);
Evaluator nuevo = null;
if(temp instanceof Double){
nuevo = new DoubleEvaluator((Double)temp);
}
if(temp instanceof String){
nuevo = new StringEvaluator((String)temp);
}
if(temp in... |
5eccbbc6-54ca-49d8-87c6-56f9a8019ef5 | 2 | public ProjectJournal getJournal() {
ProjectJournal journal = new ProjectJournal(allAccounts, getName(), "TMP");
for(Account account:projectAccounts.getBusinessObjects()){
for(Movement movement :account.getBusinessObjects()){
Transaction transaction = movement.getBooking().getTransaction();
journal.addBu... |
d567fbe0-6eac-4a3b-bcd4-fb5ded33630a | 3 | public String addItem(Item newItem){
if (newItem.getName().equalsIgnoreCase("Potion")){
potionCount++;
}
else if (newItem.getName().equalsIgnoreCase("MagicStone")){
stoneCount++;
}
else if (newItem.getName().equalsIgnoreCase("Ult... |
31a4c0bc-060a-404f-a9bc-e779721704db | 1 | void start() {
synchronized (this) {
if (me == null) {
me = new HackThread(this, "Minimap loader");
me.setDaemon(true);
me.start();
}
}
} |
cf637aab-021b-4430-9af0-dbea32d50e43 | 0 | @Override
public List<IautosSellerInfo> listIncompletedSellers() {
return this.getCfDao().listIncompletedSellers();
} |
d94e7329-771b-47d6-af6b-a06aaea9901b | 6 | private boolean validarDatos() {
//unicamente valido el numero de cuenta
boolean valido = false;
Validaciones val = new Validaciones();
if (jTextField1.getText().equals("") || jTextField2.getText().equals("")){
mensajeError("Ingrese un rango de Asientos (1 .. 99).");... |
00f29648-3f55-4ae4-bd10-b3ad2cd3d1c8 | 6 | public static int calculateRecicledPairs(String myLine) {
String[] split = myLine.split(" ");
int a = Integer.parseInt(split[0]);
int b = Integer.parseInt(split[1]);
int bDigits = String.valueOf(b).length();
int pairsFounds = 0;
Set<String> mySet = null;
for (int n = a; n < b; n++) {
mySet = new HashSe... |
d36ffdc7-dcab-4a7a-8ec2-fbe10b027c95 | 0 | public Area(int x, int y) {
super(x, y);
URL loc = this.getClass().getResource("/karel/themes/LTTPArea.png");
ImageIcon iia = new ImageIcon(loc);
Image image = iia.getImage();
this.setImage(image);
} |
aad01a41-22f8-428b-a7f6-b38300a9fe99 | 8 | @Override
public boolean okMessage(final Environmental myHost, final CMMsg msg)
{
if((myHost!=null)
&&(myHost instanceof MOB)
&&(msg.amISource((MOB)myHost)))
{
if(((msg.targetMinor()==CMMsg.TYP_LEAVE)
||(msg.sourceMinor()==CMMsg.TYP_ADVANCE)
||(msg.sourceMinor()==CMMsg.TYP_RETREAT)
||(msg.sourc... |
8301c5d2-f6b3-443e-bc1a-8e8c6c48ba8d | 0 | @Override
public void startSetup(Attributes atts) {
super.startSetup(atts);
addActionListener(this);
} |
9e7cf15e-26cf-49e1-8e83-a05b3e00290e | 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... |
27fb9e7c-66b9-4788-92b1-e73cf4bc375f | 0 | public CSVPermissionMethodParser(String fileName) {
this.fileName = fileName;
} |
6c543779-00d7-4235-8d9f-630892ece17e | 1 | private void drawScroller(int arg0, int arg1, int arg2, int arg3, int arg4) {// method30
scrollBar1.drawIndexedSprite(arg3, arg2);
scrollBar2.drawIndexedSprite(arg3, arg2 + arg0 - 16);
Graphics2D.fillRect(arg0 - 32, arg2 + 16, arg3, anInt1002, 16);
int k1 = (arg0 - 32) * arg0 / arg4;
... |
ece173a7-0c10-49a2-89f8-5a32dbf1863d | 9 | @Override
public void process() {
if (borkStage == 0) {
if (stage == 0) {
Magic.sendNormalTeleportSpell(player, 0, 0, new WorldTile(3114,
5528, 0));
}
if (stage == 5) {
sendInterfaces();
}
if (stage == 18) {
player.getPackets().closeInterface(
player.getInterfaceManager().hasRez... |
e8e8039e-f7c0-497b-ab6f-868e27365af7 | 2 | public void reloadConfig() {
if (configFile == null) {
configFile = new File(plugin.getDataFolder() + folderName, fileName);
}
config = YamlConfiguration.loadConfiguration(configFile);
// Look for defaults in the jar
final InputStream defConfigStream = plugin.getResource(fileName);
if (defConfigStream !... |
18fb339c-9ff0-419d-9986-6f6aa7e5f0a4 | 9 | private void init(final boolean log) {
miscLogin.setEnabled(false);
miscFps.setEnabled(false);
miscFloor.setEnabled(false);
setPreferredSize(new Dimension(Configuration.BOT_TOOLBAR_WIDTH, Configuration.BOT_TOOLBAR_HEIGHT));
setFloatable(false);
settings.add(accounts);
settings.addSeparator();
... |
0cda5d48-dd23-4a0a-a4f4-c4a04ae62960 | 5 | public Action addAction(Action action) {
// if no object ref we bail early.
if (action.getPObjectReference() == null) {
logger.severe("Addition of action was rejected null Object reference "
+ action);
return null;
}
// gen instance of state ... |
fc13e07c-fb57-44b7-8169-4537faff3d85 | 5 | public void OrdenarLista() {
Tarjeta temp;
for(int i = 0; i < vector1.length -1; i++){
for(int j = 0; j < vector1.length -1; j++){
if((vector1[j] != null && vector1[j+1] != null) && vector1[j].getNumeroDeTarjeta() > vector1[j+1].getNumeroDeTarjeta()){
temp = vector1[j];
vector1... |
03ade557-7100-43eb-b719-3f7b5d098378 | 6 | public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
response.setCharacterEncoding("UTF-8");
PrintWriter out = response.getWriter();
out.print("本网站有以下书籍: <br/> ");
Map<String, Book> map = DB.ge... |
c63377b4-3cd6-491c-9569-f0ecd2c5a7b8 | 1 | private void renderStandardUI(){
if(selectedEntity != null){
renderSelectedEntity();
}
renderExpBar();
renderHealthBar();
renderManaBar();
ActionBar.render();
} |
00204810-0105-43d5-8ca9-8a4933e61225 | 3 | private static void readMagicItemsFromFileToArray(String fileName,
ListItem[] items) {
File myFile = new File(fileName);
try {
int itemCount = 0;
Scanner input = new Scanner(myFile);
while (input.hasNext() && itemCount < items.length) {
// Read a line from the file.
String itemName = input.nex... |
90ec89cc-34f6-4c07-9035-6b4f7d11331a | 2 | public Indir<Resource> indir() {
if (indir != null)
return (indir);
indir = new Indir<Resource>() {
public Resource res = Resource.this;
public Resource get() {
if (loading)
return (null);
return (Resource.this);
}
public void set(Resource r) {
throw (new RuntimeException());
}
... |
6f796af7-30c7-43d1-9a8f-689252185317 | 6 | public HashSet<String> findMinimal(LinkedList<String> input){
LinkedList<String> best = new LinkedList<String>();
HashSet<String> all = new HashSet<String>();
boolean replacements = false;
for(String s: input){
all.add(s);
// Loop through each solution and see if it entails other solutions
for(String t... |
ee028d7b-7fe3-470c-9063-f49773525f52 | 1 | private void addFeeds() {
Match configFeeds = config.getMatch("feeds feed");
for ( Match feed : configFeeds.each() ) {
String name = feed.find("name").text();
String url = feed.find("url").text();
feeds.add( new Feed(name, url) );
}
feeds.add( new Ez... |
13c75020-cdc4-43a6-a7ed-4df496f9a505 | 8 | public void initPF() {
int allowed_width = winwidth + crop_left + crop_right;
int allowed_height = winheight + crop_top + crop_bottom;
// these came from the canvas constructor
viewnrtilesx=nrtilesx;
viewnrtilesy=nrtilesy;
if (prescale) {
scaledtilex = allowed_width / nrtilesx;
scaledtiley = allowed_h... |
94955b1b-8ec5-479f-8cec-532daf5822e0 | 2 | @SuppressWarnings("unchecked")
public Map<String, Object> getData() {
try {
final Map<String, Object> data = (Map<String, Object>) _attributes
.get("data");
return data;
} catch (Exception ex) {
if (_attributes.get("data") instanceof String) {
String s = (String) _attributes.get("data");
logg... |
f2a1f6d2-4c10-4a48-8ea8-ac8acac2cbc3 | 7 | protected void paint(Graphics gfx) {
//Logger.debug(this, "paint: entered for '" + label + '\'');
final int fontHeight = gfx.getFont().getHeight();
if (label != null) {
drawLabel(gfx, fontHeight);
}
if (imgUrl != null) {
if (ima... |
493a88f9-5991-4194-873a-7d68b648db2b | 4 | private void cpu() {
switch (this.getGeneratoreRouting().getNextRoute()) {
case IO:
if (this.getIo().isFree()) {
this.getIo().setFree(false);
this.getIo().setJob(this.getCpu().getJob());
this.getCpu().setJob(null);
... |
804aa59a-f4ff-42bd-a04a-0f3c571310e4 | 5 | public BULCS(String X, String Y)
{
this.X = X;
this.Y = Y;
len = new int[X.length()][Y.length()];
// base case
len[0][0] = 0;
if (X.charAt(0) == Y.charAt(0))
len[0][0] = 1;
for (int i = 1; i < X.length(); i++)
{
len[i][0] = len[i - 1][0];
if (X.charAt(i) == Y.charAt(0))
len[i][0] = 1;
... |
0e244d69-5722-4f49-913f-801ea08550df | 0 | public void setResources(int resources) {this.resources = resources;} |
395faeeb-3781-406e-a54c-f7aee1b202af | 3 | private Vec3D(double var1, double var3, double var5) {
if(var1 == -0.0D) {
var1 = 0.0D;
}
if(var3 == -0.0D) {
var3 = 0.0D;
}
if(var5 == -0.0D) {
var5 = 0.0D;
}
this.xCoord = var1;
this.yCoord = var3;
this.zCoord = var5;
} |
37ac434a-c703-4e58-9e76-a1c1d3aa1d7a | 7 | public static XMLNode parseText(String text) throws EOFException {
XMLNode currentNode = new XMLNode();
char[] c = text.toCharArray();
for (int i = 0; i < c.length; i++) {
if (c[i] == '/') {
if (currentNode.getParent().getName() == null)
return currentNode;
currentNode = currentNode.getPare... |
85beb2ad-c5b8-4e9c-92e6-0d59bfac5803 | 4 | @Override
public Collection<Coin> payback() {
// 金額の高い順にコインを1種類ずつ保持
ImmutableSortedSet<Coin> coinSet = ImmutableSortedSet.copyOf( //
Coins.descComparator(), //
Coins.getOneOfEach() //
);
Collection<Coin> payback = Lists.newArrayList();
Yen remain ... |
c648e1d7-5a94-42d8-8f28-715ac1c6e71e | 0 | public int delete(String value, String extend_uri) throws Exception {
ClientConfig config = new DefaultClientConfig();
client = Client.create(config);
client.addFilter(new LoggingFilter());
webResource = client.resource(address + "adminPanel" + extend_uri + "/"
+ value);
client.addFilter(new HTTPBasicAut... |
78fd3346-2773-4f8b-a8fb-93413c245231 | 9 | public LoginHandler(String account, String identification, String password, ConnectionHandler c)
{
myC = c;
String correctUserPass = "";
String correctUserID = "";
String correctUserAccount = "";
if (account == "customer") {
try {
correctUserPass = pullPassword(identification);
correctUserID = pullID... |
45acfadd-d316-4158-85ac-48c71b7ca5a7 | 9 | private static Hand isFourOfAKind(Card[] allCards) {
Hand h = new Hand();
int cardsALike = 0;
ArrayList<Card> fourALike = new ArrayList<>();
for (int i = 0; i < allCards.length; i++) {
Card firstCard = allCards[i];
for (int j = 0; j < allCards.length; j++) {
... |
f4216e16-43e4-4567-ad71-f79ae19c6ea9 | 5 | public void render(Graphics g)
{
//draw inventory here
g.drawRect(x, y, w, h);
for(int i = 0; i < size; i++) {
g.drawRect(x + 3 + (Game.TILESIZE + 2) * i, y + 3, Game.TILESIZE + 2, Game.TILESIZE + 2);
}
if(this.size > 0)
{
g.drawString(itemList... |
b3deec9d-9cf9-4282-a21c-4acc4480986c | 8 | void removeInternal(Node<K, V> node, boolean unlink) {
if (unlink) {
node.prev.next = node.next;
node.next.prev = node.prev;
}
Node<K, V> left = node.left;
Node<K, V> right = node.right;
Node<K, V> originalParent = node.parent;
if (left != null && right != null) {
/*
*... |
06a6deed-a960-4738-af05-aec4b86d5d28 | 5 | public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringBuilder sb = new StringBuilder();
int n = Integer.parseInt(br.readLine());
for(int i = 0; i < n; i++) {
String diet = br.readLine();... |
2dd9cfa8-a129-4cc7-b0d5-8a06fe0a1f01 | 5 | public GameOverJPanel(int score) {
this.score = score;
backgroundImage = new ImageIcon("res/Gameover.jpg").getImage();
this.repaint();
String str = "Score: " + score;
scoreLabel = new JButton(str);
playAgainButton = new JButton("Play Again?");
backToMenuButton = new JButton("Go back to Ma... |
723def84-cfb0-4536-ba17-f2066aa8b3e9 | 0 | public void sendFile(String destIP, String dest, String src) {
sendMessage( "FILE@"+destIP+"@"+dest+"@"+src );
Thread fsthd = new Thread( new FileSend() );
fsthd.start();
} |
591ffac4-9bb5-48b9-bd33-177f00cb26a5 | 5 | public void assignmentStatement()
{
String id;
SemanticRec varId;
SemanticRec exp;
SemanticRec symTable = new SemanticRec(RecordType.SYM_TBL, symboltables.peek().getScopeName(), ""
+ symboltables.peek().getNestingLevel(), "" + symboltables.peek().getTableSize());
... |
6ecf1683-041b-444c-868f-2afda6f34775 | 9 | private boolean checkRows(Player player) {
boolean isWinner = false;
if ((board[0][0].equals(player.getMark()) &&
board[1][0].equals(player.getMark()) &&
board[2][0].equals(player.getMark()))) {
winnerCombination[0] = "0 0";
winnerCombination[1] = ... |
ad47c5f2-111e-4418-9de3-ef689955f9fa | 7 | private List<Integer> sortPartition(List<Integer> list, int low, int high) {
// checking input parameter for null
if (list == null) {
return list;
}
int i = low, j = high;
// Get the pivot element from the middle of the list
int pivot = list.get(low + (high... |
5e1a8c1a-af91-47fd-a60a-8350061d620a | 3 | public TableModel getTableModel(){
return (comparatorNodeTableModel != null && comparatorNodeTableModel.getRowCount() != 0)? comparatorNodeTableModel :oldNode != null? oldNode.getNodeTableModel():newNode.getNodeTableModel();
} |
4efeea20-4963-433e-a48d-454b1e3983f7 | 0 | public int getInvocation()
{
return invocation;
} |
03340f7a-da0f-481d-8dbe-160e202cf8bb | 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... |
cd68273a-8b04-4612-87b0-a8815b579af2 | 1 | public void makeJButton(JButton jb, String src, String actionCommand) {
File imageCheck = new File(src);
try {
Image img = ImageIO.read(imageCheck);
jb.setIcon(new ImageIcon(img));
} catch (IOException ex) {
}
jb.setMargin(new Insets(0, 0, 0, 0));
jb.setBorder(null);
jb.setActionCommand(actionCo... |
6133776a-ef77-4c26-878d-7efdcb6b1ade | 7 | public static void main(String[] args) {
//custom colors
UIManager.put("nimbusBase", Color.BLACK); // Base color
UIManager.put("nimbusBlueGrey", Color.GRAY); // Secondary Color
UIManager.put("control", Color.DARK_GRAY); // Control
UIManager.put("OptionPane.messageForeground", Color.WHITE); //po... |
2208599b-5ee2-483e-86c6-8243ad574fe2 | 0 | @Override
public String getDesc() {
return "DeadlyInfect";
} |
01055715-57d4-40d7-a62e-d7b9fdb9073a | 5 | private boolean isLabelValid(String lbl) {
char[] label = lbl.toCharArray(); // Load the label into a character array
if (!Character.isLetter(label[0])) return false; // If the first character is not a letter, return error
if (label.length < 2) return false; // If the label is not at least 2 char... |
c102ffa7-8c37-4447-b90e-e26199128a67 | 8 | private void unfilterPaeth(byte[] curLine, byte[] prevLine) {
final int bpp = this.bytesPerPixel;
int i;
for (i = 1; i <= bpp; ++i) {
curLine[i] += prevLine[i];
}
for (int n = curLine.length; i < n; ++i) {
int a = curLine[i - bpp] & 255;
int b... |
9cdcd2d6-144a-483a-94cf-d3d6d574d50d | 2 | private
Map<String,String> getTextFieldIds(Tag fileTag) {
Map<String,String> tagToCustomFrame = new HashMap<String,String>();
Tag class_clone = null;
try {
class_clone = fileTag.getClass().newInstance();
} catch (InstantiationException|IllegalAccessException e1) {
Main.log(Level.SEVERE, "Can't clone f... |
27456720-1d2f-488d-b850-0fb62873f7a4 | 9 | public boolean login() throws LoginException {
if ("simple".equals(connectionAuth)) {
return super.login();
}else if ("bind".equals(connectionAuth)) {
log.debug("login using bind");
try {
if (callbackHandler == null) {
throw new Log... |
c098260b-8a25-4bf6-b67f-0b2ae55c81af | 5 | private boolean isNum(char c){
if(!isSpace(c) && !isOperator(c) && !isOpeningBracket(c) && !isClosingBracket(c) && !isEquationReference(c)){
return true;
}
return false;
} |
d2b5020c-bb47-4a53-bac6-6c9566220e45 | 0 | public List<TravelTrip> findAll(){
return travelTripDao.findAll();
} |
c09e76e2-3c7b-46f3-819b-d953a79a6d91 | 9 | void run(){
String[] kang = {"a", "b", "c", "d", "e", "f", "g", "h",
"i", "j", "k", "l", "m", "n", "o", "p", "q", "r",
"s", "t", "u", "v", "w", "x", "y", "z",
"ld", "mb", "mp", "nc", "nd", "ng", "nt", "nw", "ps", "qu", "cw", "ts"
};
Scanner sc = new Scanner(System.in);
int N = sc.nextInt(); sc.nextL... |
952d88d7-7944-4864-b673-bc35c1215721 | 1 | protected JPanel getFontSizePanel()
{
if (fontSizePanel == null)
{
fontSizePanel = new JPanel();
fontSizePanel.setLayout(new BorderLayout());
fontSizePanel.setPreferredSize(new Dimension(70, 130));
fontSizePanel.setBorder(BorderFactory.createEmptyBorde... |
7eb13258-97e9-4e16-8379-aef174f0e7cd | 6 | private void scanToNextToken () {
for (;;) {
while (peek() == ' ')
forward();
if (peek() == '#') while (NULL_OR_LINEBR.indexOf(peek()) == -1)
forward();
if (scanLineBreak().length() != 0) {
if (flowLevel == 0) allowSimpleKey = true;
} else
break;
}
} |
71798d36-1dd4-49d8-9992-cff18efffe38 | 4 | @Override
public Property deriveRequirements(Property property) throws PropertyException
{
if(property instanceof DelayProperty) {
// do NoS introduces delay?
if(getMin() != UNDEFINED) {
int maxDelay = ((DelayProperty) property).getMax();
if(maxDelay != UNDEFINED) {
// min delay introduced ... |
8ad41d26-cf2b-479e-817f-119b6dadde39 | 0 | public InTestLinkXmlRunListener(final String testerName) {
results = new Xpp3Dom("results");
this.testerName = testerName;
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.