method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
4350ce9c-c5be-4ef1-b1ae-8e4fd4b5683f | 0 | public void SetBus(int bus)
{
this.bus = bus;
} |
f444892b-cc7c-4776-b5ec-b91809f27b8b | 5 | public static Decoder createDecoder(int encoding, CMsgReader reader) {
/*
if (encoding <= Encodings.encodingMax && createFns[encoding])
return (createFns[encoding])(reader);
return 0;
*/
switch(encoding) {
case Encodings.encodingRaw: return new RawDecoder(reader);
case Encodings.encodi... |
876735f8-f294-4744-b409-fd6e9d93afe9 | 6 | public int maxSubArray(int[] A) {
int max = 0;
int cur = 0;
boolean allZero = true;
int maxNegtive = Integer.MIN_VALUE;
for (int a : A) {
cur += a;
if (cur > max) {
max = cur;
}
if (cur < 0) {
cur = ... |
58d1911c-e3bc-4fa3-916e-9d28767a9db7 | 4 | @Override
public void run() {
int totalConsumedByThisConsumer=0;
try{
while(true)
{
Integer item =sharedQueue.retreiveItem();
if(item==null)
{
... |
67f1841c-9a7f-4994-a588-cdd812152356 | 5 | public static boolean isEqual(BufferedImage newImage,
BufferedImage previousImage) {
boolean equal = true;
if ((newImage != null) && (previousImage != null)) {
DataBuffer newDb = newImage.getData().getDataBuffer();
DataBuffer prevDb = previousImage.getData().getDataBuffer();
for (int i = 0; (i < newDb... |
48c19c06-14ac-483e-b8dc-2d0e6f2548d4 | 0 | private CharacterStorageInventory() {
characterList = new LinkedList<Character>();
} |
24dd6a97-4b8c-41aa-8a0c-0af07db03ca5 | 2 | protected static String[] parseAsStrings(String[] args) {
List<String> all = new LinkedList<String>();
List<String> one = new LinkedList<String>();
for (String arg : args) {
one.clear();
for (String a : arg.split(C.separator)) {
one.add(a);
}
all.addAll(one);
}
String... |
74d0eb48-5619-4409-aa12-c7a1536a2541 | 7 | private ClustersRequest parserRequest(String requestData) throws UnsupportedEncodingException{
// 解析握手信息
ClustersRequest requestInfo = new ClustersRequest();
String[] requestDatas = requestData.split("\r\n");
if(requestDatas.length < 0){
return null;
}
String line = requestDatas[0];
... |
2b7895d7-1ed6-49bc-9d1b-9ff722d89285 | 6 | private static int modifyInt(int rgb, int amount) {
int r = rgb & 0xFF0000 >> 16;
int g = rgb & 0x00FF00 >> 8;
int b = rgb & 0x0000FF;
int result = 0;
r += amount;
g += amount;
b += amount;
if(r < 0) {
r = 0;
}
else if(r > 255) {
... |
0abab83c-9562-435c-9245-42bf621fbe69 | 7 | public static String charToString(char[][] tMap, int player){
String[] board = new String[tMap[0].length];
String pboard;
//reset board
for(int i=0; i<tMap[0].length; i++)
board[i] = "";
if(player == 1){
pboard = "o";
}else{
pboard = "x";
}
//Concatenate horizontally
//make map into ro... |
fc74a702-e9b4-4c23-b688-fce33035ba1d | 2 | public static boolean isWraith (Entity entity) {
if (entity instanceof Zombie) {
Zombie wraith = (Zombie) entity;
LeatherArmorMeta meta;
ItemStack stack = new ItemStack(299, 1, (short) - 98789);
meta = (LeatherArmorMeta) stack.getItemMeta();
meta.setCo... |
46b678a6-c29c-4a92-92d4-9e84b116b836 | 4 | public void runProgram()
{
outputLine("Interpreting...");
program.clear();
variables.clear();
try
{
program = BareBonesInterpreter.InterpretString(input.getText(), variables);
}
catch (BareBonesSyntaxException e)
{
outputLine("Syntax Error:");
outputLine(e.getMessage());
outputLine("O... |
04a0a439-781b-45ed-96f5-78eed2581521 | 5 | public static void buildAssets(String directory) throws IOException {
if (!(directory.endsWith("/")||directory.endsWith("\\"))) {
//Logger.warning("Assets", "A slash was not added at the end of the asset output directory. Attempting to fix...");
directory = directory + "/";
}
... |
c9b2397d-1e3f-4d35-8a67-433f0e043bbb | 0 | public void setMed_depotLegal(String med_depotLegal) {
this.med_depotLegal = med_depotLegal;
} |
02b5e469-e343-4b4a-a881-483222fd9fff | 2 | public Object newArray(String type, int[] dimensions)
throws InterpreterException, NegativeArraySizeException {
if (type.length() == dimensions.length + 1) {
Class clazz;
try {
clazz = TypeSignature.getClass(type
.substring(dimensions.length));
} catch (ClassNotFoundException ex) {
throw new... |
0eff63b6-2d28-49e3-96de-82e7c269b890 | 9 | public boolean processFollow(MOB mob, MOB tofollow, boolean quiet)
{
if(mob==null)
return false;
final Room R=mob.location();
if(R==null)
return false;
if(tofollow!=null)
{
if(tofollow==mob)
{
return nofollow(mob,true,false);
}
if(mob.getGroupMembers(new HashSet<MOB>()).contains(tofollo... |
58641822-e629-4403-9615-dc9284221660 | 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... |
99fab107-b040-459c-8b75-f4014e483f45 | 2 | public void criarGerente(Usuario Gerente) throws SQLException, excecaoGerenteExistente, excecaoGerentePorDepartamento {
UsuarioDAO userDAO = new UsuarioDAO();
Usuario GerenteExistente = userDAO.selectGerente(Gerente.getNome(), Gerente.getTipo());
//VERIFICA SE HA ALGUM GERENTE CADASTRADO COM O ... |
51252a1f-eb90-4aaa-bdbf-59abca896072 | 2 | private void setUpButtonImage(JButton button, String image){
BufferedImage choosePageButtonImage;
try{
if(bookLayout == 1){
choosePageButtonImage = ImageIO.read(new File("resources/buttons/"+image));
}
else{
choosePageButtonImage = ImageIO.read(new File("resources/buttons" +bookLayout + "/"+image))... |
f068e194-a825-4049-8a19-47808ac1de27 | 9 | public DbSchema getSimpleSchema() throws WaarpDatabaseSqlException, IOException {
if (type == null) {
logger.warn("Structure non prête");
return null;
}
String schemaName = technicalDescription.getName();
int pos = schemaName.lastIndexOf('.');
if (pos > 0) {
schemaName = schemaName.substring(0, pos);... |
310abca8-0cd9-49a5-be4d-8bd3f3b50484 | 8 | private static boolean circleCircleResolve(CircleObject a, CircleObject b)
{
double t=-1;
Vector2f aPosition = a.getPosition().copy();
Vector2f bPosition = b.getPosition().copy();
Vector2f aVelocity = a.getVelocity().copy();
Vector2f bVelocity = b.getVelocity().copy();
double distanceSq = aPositio... |
e17febdb-6d80-45f3-9154-f6605c6e310e | 9 | public boolean allowParameters(int number) {
if ("for".equals(keyword.getKeyword()) && (number == 0 || number == 1)) {
return true;
} else if ("enum".equals(keyword.getKeyword()) && (number == 1 || number == 2 || number == 3)) {
return true;
} else if ("set".equals(keywor... |
281dc62f-4482-494f-813a-cf4ca8b7b968 | 8 | @SuppressWarnings("unchecked")
@Override
public void mousePressed(MouseEvent e) {
if (this.checkModifiers(e)) {
this.viewer = (VisualizationViewer<ILayoutVertex, ILayoutEdge>) e
.getSource();
this.layout = this.viewer.getModel().getGraphLayout();
final Point2D p = e.getPoint();
GraphElementAccesso... |
04d35e21-073d-4cfb-b8e6-6ce58642c369 | 6 | public void doAction() {
for (int i = 0; i < provider.getAvailableShare().length; i++) {
try {
if (accountmanager.diverShareSell(provider.getAvailableShare()[i].name,
playerbotname)) {
accountmanager.buyShare(playerbotname,
provider.getAvailableShare()[i].name, 5);
}
} catch (ShareExce... |
ab78c728-dcf9-4f3d-a6ab-0507b1bd3bfd | 5 | private void jButton_DepositActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_DepositActionPerformed
try {
ArrayList selectedIndices = new ArrayList();
for (int i = 0; i < jTable5.getRowCount(); i++) {
String id = (String) jTable5.getModel().getValueA... |
bac687df-511e-4137-be69-5ba9ab711bc8 | 8 | @Override
public SolveStep getStep(Sudoku s) {
for (int x=0; x<9;x++){//SCORRO OGNI BLOCCO
SudokuBlock sb = s.getBlock(x);
Freq[] freq = new Freq[10];
for (int i = 0; i < freq.length; i++) freq[i]= new Freq();
for (int r=0; r<sb.getSize();r++){
for (int c=0; c<sb.getSize();c++){
if (!sb.getCell... |
ba535311-5de0-4b5d-bf9b-80879e2c792f | 6 | public static void main(String [] args) {
Car car1 = new Car();
Car car2 = new Car();
Car car3 = new Car();
Car car4 = new Car();
Car car5 = new Car();
Car car6 = new Car();
Car car7 = new Car();
Car car8 = new Car();
Car car9 = new Car();... |
ca97658f-8eca-4cb1-adc1-fea09c893283 | 1 | public void fillDeclarables(Collection used) {
for (int j = 0; j < methods.length; j++)
methods[j].fillDeclarables(used);
} |
b1fddb3d-f98a-4c24-9c6d-e9b3c9c40bce | 7 | @Override
public ResultadoAvItem[] getresultadoAvItem(String refeicao, String data) {
List<ResultadoAvItem> resultList = new ArrayList<ResultadoAvItem>();
Iterator<List<AvaliacaoItem>> avaliacoes = avItens.values().iterator();
List<AvaliacaoItem> avs = null;
while(avaliacoes.hasNext()){
avs = av... |
cc43b95a-f7c6-46d0-a9dd-ba3477baa792 | 3 | public void printMergedNodes() {
Iterator<Integer> it = mergedNodes.keySet().iterator();
while (it.hasNext()) {
int vertex = it.next();
System.out.print(vertex + ":");
LinkedList<Integer> nodes = mergedNodes.get(vertex);
if (nodes != null) {
System.out.print("[");
for (int i : nodes) {
Syst... |
a5dc451e-18ed-4277-b772-17160b247ca5 | 3 | private void modifyReply(Map<String, Object> jsonrpc2Params) throws Exception {
Map<String, Object> params = getParams(jsonrpc2Params,
new NullableExtendedParam(Constants.Param.Name.REPLY_ID, false),
new NullableExtendedParam(Constants.Param.Name.TEXT, true));
int reply... |
8e99a3b5-93aa-4b9e-8060-8c5bdb3a059b | 7 | protected State<TransitionInput> exitCurrentState(State<TransitionInput> newState, State<TransitionInput>... submachineStates) {
if(currentState == null) {
return null;
}
State<TransitionInput> previousState = currentState;
if(submachine != null) {
submachine.exitCurrentState(getFirstState(submachineStat... |
2d26565b-3097-4fe7-9a01-8d0a5eb0aee9 | 3 | private void saveAllButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveAllButtonActionPerformed
for (int i = 0; i < tabs.getTabCount(); i++) {
SimPanel t = (SimPanel) tabs.getComponentAt(i);
if (t.isModified()) {
t.save(false);
}
... |
1a04f27d-4d32-4e3e-a24f-813ad06416f0 | 2 | public List<T> extractData(ResultSet rs) throws SQLException {
List<T> results = (this.rowsExpected > 0 ? new ArrayList<T>(this.rowsExpected) : new ArrayList<T>());
int rowNum = 0;
while (rs.next()) {
results.add(this.rowMapper.mapRow(rs, rowNum++));
}
return results;
} |
5b1e08c8-43c6-49e1-a9c9-9cede7fb8acb | 9 | public String nextToken() throws JSONException {
char c;
char q;
StringBuffer sb = new StringBuffer();
do {
c = next();
} while (Character.isWhitespace(c));
if (c == '"' || c == '\'') {
q = c;
for (;;) {
c = next();
if (c < ' ') {
throw syntaxError("Unterminated string.");
}
if... |
cfc64c70-df97-45fc-83a9-b39d3a46bdea | 5 | void readLinesCheck(String vcf, int numTests) {
Random random = new Random(20130218);
System.out.println("Opening file '" + vcf + "'");
FileIndexChrPos idx = new FileIndexChrPos(vcf);
idx.setVerbose(verbose);
idx.open();
// Get file size
long size = (new File(vcf)).length();
for (int i = 1; i < numTes... |
4f6a0b76-5ac0-497b-84d2-0eac3228d6ed | 2 | public int compareTo(ReviewJournal o) {
if (o.score == score)
return title.compareTo(o.title);
return score > o.score ? -1 : 1;
} |
4f87f657-2461-4af5-879c-116c60b69ee8 | 9 | private void handle(String role, String order) throws Exception {
//leader
if(role.equals("l1")){
//System.out.println("leader handle");
l1.setOrder(order);
l1.action();
}else if(role.equals("l2")){
//System.out.println("leader handle");
l2.setOrder(order);
l2.action();
}else if(role.equa... |
ff892355-f421-42ab-94da-1bfb89fd30a6 | 5 | public void morrisTraverse(TreeNode root) {
while (root != null) {
if (root.getLeft() == null) {
System.out.println(root.getData());
root = root.getRight();
} else {
TreeNode ptr = root.getLeft();
while (ptr.getRight() != null && ptr.getRight() != root)
ptr = ptr.getRight();
if (ptr.... |
626dcf75-7346-42e6-b2ca-7e5f4f2d455d | 8 | public static int curiousNumberDenom() {
int num = 1;
int den = 1;
for (int i = 10; i < 100; i++) {
for (int j = 10; j < 100; j++) {
if (isCurious(i, j)) {
num *= j;
den *= i;
}
}
}
for (int i = 2; i <= num; i++) {
while (true) {
if (num == 1) {
break;
}
if (num % i... |
0f936328-6d55-4aa9-8169-13acff1e32b1 | 7 | @Override
public void process(ChatSocket sock, ChatPacket packet) {
if (packet.getType() == PacketType.MANIFEST) {
ManifestMessage mfst = (ManifestMessage) packet.getPayload();
// For every persistence sequence number locally known...
for (int seq : sock.getPersistenceMan... |
7a7d6308-3bb8-478e-be9c-c662123ae222 | 8 | private void method393(int ai[], byte abyte0[], int i, int j, int k, int l, int i1, int j1, int k1) {
int l1 = -(l >> 2);
l = -(l & 3);
for(int i2 = -i1; i2 < 0; i2++) {
for(int j2 = l1; j2 < 0; j2++) {
if(abyte0[j++] != 0)
ai[k++] = i;
else
k++;
if(abyte0[j++] != 0)
ai[k++] = i;
... |
4e72a164-5c35-4f51-b335-14950d64e45f | 5 | @Override
public void run() {
Start.display("Initialized loop for " + this.getTempAlias());
// Run the loop while it's still open.
boolean running = true;
while (running) {
String message;
try {
message = (String) input.readObject();
if (CommandFormat.isCommand(message)) {
Comm... |
15421709-c8c4-4631-baef-8b346f66f53f | 1 | public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int num1 = Integer.parseInt(in.next());
double num2 = Integer.parseInt(in.next());
if (num2 == 0) {
System.out.println("Error: divide by zero!");
System.exit(0);
}
System.out.println(num1 / num2);
} |
78f0de9b-d081-4b5d-a29c-0534e3b16115 | 4 | public boolean optimal(int[] bowl, int bowlId, int round)
{
//System.out.println("Inside Optimal..");
int bowlScore=0;
bowlScore = buildDistribution(bowl, bowlId, round);
if (maxBowls[round] == 2) {
scoresSeen.add(bowlScore);
len[round]++;
return Math.random()>0.5;
}
... |
7bd64e16-c089-4b18-9c2c-404b61b060fb | 9 | private static String getSelectionString (Object selection) {
StringBuilder builder = new StringBuilder();
try {
XServiceInfo selectionServiceInfo = As.XServiceInfo (selection);
if (selectionServiceInfo.supportsService ("com.sun.star.text.TextRanges")) {
XIndexAccess indexAccess = As.XIndexAccess (se... |
b5510a37-3156-44c3-8d15-6318e52f9bdc | 1 | public void renderEntities(){
for (GameObject gameObject : entityList) {
gameObject.render();
}
} |
20cb4e5f-705c-4fa7-836b-48089e9d5318 | 5 | @Override
public void decreaseAmount(ResourceType resource) {
switch(resource){
case BRICK:
discardView.setResourceDiscardAmount(ResourceType.BRICK, --brickDiscardAmount);
updateButtons(brickDiscardAmount,brickMax,resource);
break;
case ORE:
discardView.setResourceDiscardAmount(ResourceType.ORE... |
6d4967bb-eb3d-49d7-917c-6b387bac7674 | 7 | public static void testValidity(Object o) throws JSONException {
if (o != null) {
if (o instanceof Double) {
if (((Double)o).isInfinite() || ((Double)o).isNaN()) {
throw new JSONException(
"JSON does not allow non-finite numbers.");
... |
aac226cd-7a53-453c-a980-7672c56de0ed | 9 | private static void filterCSV(String filename, LinkedList<String> filters, LinkedList<String> includes) throws IOException
{
FileReader fr = new FileReader(filename);
CsvReader csvIn = new CsvReader(fr, SEPARATOR);
csvIn.setSafetySwitch(false);
if(csvIn.readHeaders()) {
csvIn.readRecord();
System.out.... |
f386fa86-95ac-4bbd-8f63-3971e561b0fa | 6 | public String getFormTrackTitle(int formTrackNumber) throws SQLException
{
List<Track> trackRepTracks = new LinkedList<Track>();
for (Track t : getTracks())
if (t.getFormTrackNumber() == formTrackNumber)
trackRepTracks.add(t);
if (trackRepTracks.size() == 1)
if (trackR... |
7d4c18d9-ba3a-4856-a801-e6319e8334a9 | 7 | public static Properties readFile(Log log, File file) {
InputStream stream = null;
Properties properties = new Properties();
log.info("Reading from config file");
try {
if (file == null) {
log.warn("No config file given");
} else {
stream = new FileInputStream(file);
properties.load(stream);
... |
288fc6b1-1c8f-4702-a19c-10f571cbbf0d | 4 | public String getSuitAsString() {
switch (suit) {
case SPADES:
return "Spades";
case HEARTS:
return "Hearts";
case DIAMONDS:
return "Diamonds";
case CLUBS:
return "Clubs";
default:
... |
22176514-159a-426e-a72f-3b1846dfb140 | 8 | @Override
public void deserialize(Buffer buf) {
playerId = buf.readInt();
if (playerId < 0)
throw new RuntimeException("Forbidden value on playerId = " + playerId + ", it doesn't respect the following condition : playerId < 0");
playerName = buf.readString();
alignmentSid... |
93ba586d-a70c-4141-a2fb-371bfe08316a | 1 | @Override
public ContextKey createContextPartitionKey(int partition, String context, Class<?> contextType) {
return new ContextKey(partition, context, contextType);
} |
9c4b9685-7c14-4426-9c5e-2c1fea1eabab | 0 | public void setPlayerOneWin()
{
currentState = States.PlayerOneWin;
} |
ae285acd-44b9-4d0d-959f-eb15ae2475b5 | 0 | public void setboss(Player p) {
this.boss = p;
oldclass = plugin.getHero(p).getHeroClass();
} |
a6e98b12-0831-495a-afab-567f3627656c | 5 | public static void main(String[] args){
Scanner in = new Scanner(System.in);
int n = in.nextInt();
int b = in.nextInt();
ArrayList<Integer> result = new ArrayList<Integer>();
int index = 1;
while(n-->0){
int ni = in.nextInt();
int possible = 0;
for(int i=0;i<ni;i++){
int t = in.nextInt();
... |
a525602d-15cb-457b-8480-d54567e48c37 | 6 | public boolean getBoolean(int index) throws JSONException {
Object object = get(index);
if (object.equals(Boolean.FALSE) ||
(object instanceof String &&
((String)object).equalsIgnoreCase("false"))) {
return false;
} else if (object.equals(Boolean.TRUE)... |
422a2bb5-e480-4a01-aeb5-e25639554045 | 3 | public void send() {
if (!isConnected) {
JOptionPane.showMessageDialog(null, "還未連線,不能發送訊息!", "Error",
JOptionPane.ERROR_MESSAGE);
return;
}
String message = textField.getText().trim();
if (message == null || message.equals("")) { ... |
7495b134-0f70-414b-a59a-74d2d1cc6c5c | 7 | @Override
final public void computeGradient() {
//
final int last = this.frameidx;
//
// from last to first layer.
//
for (int l = this.structure.layers.length - 1; l >= 0; l--) {
//
if (l == this.structure.inputlayer) continue;
fin... |
fb004334-62ba-49a3-95cf-617696b6af84 | 5 | public void printOut() { // just a console printout for debugging
System.out.println("Task Name: " + taskName);
System.out.println("Duration(ms): " + calculateDuration());
if (taskParent != null) {
System.out.println("Parent: " + taskParent.getName());
} else {
Sy... |
8e92f2d1-7388-48ad-b67a-744574fdb32d | 1 | public boolean guardarCambios(){
File f;
f = new File("parametros.conf");
try {
FileWriter fw = new FileWriter(f);
BufferedWriter bw = new BufferedWriter(fw);
PrintWriter pw = new PrintWriter(bw);
pw.write("ruta_excel=>"+t... |
68e259de-d557-4962-9069-4129a44c076f | 0 | public static void main(String[] args) {
Parcel p = new Parcel();
p.ship("Tasmania");
Parcel q = new Parcel();
// Defining references to inner classes:
Contents c = q.contents();
Destination d = q.to("Borneo");
} |
baf33df5-85fc-46a8-9feb-210a12f0c789 | 8 | public boolean foodAhead() {
if (direction.equals(Direction.RIGHT)) {
return map.getTrailAt(x, (y >= h - 1 ? 0 : y + 1));
}
if (direction.equals(Direction.LEFT)) {
return map.getTrailAt(x, (y <= 0 ? h - 1 : y - 1));
}
if (direction.equals(Direction.UP)) {
return map.getTrailAt((x <= 0 ? w - 1 : x - 1... |
bf2fa26e-91b1-4834-8b1e-03960799efa5 | 0 | public FileReadException(String message) {
super(message);
} |
0c6a5ef3-98d2-4122-a1ce-9a572e410fc3 | 9 | private boolean jj_scan_token(int kind) {
if (jj_scanpos == jj_lastpos) {
jj_la--;
if (jj_scanpos.next == null) {
jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken();
} else {
jj_lastpos = jj_scanpos = jj_scanpos.next;
}
} else {
jj_scanpos = jj_... |
3265c788-9bdd-4c73-9e92-9f9263edc768 | 5 | String nextControlWord() throws StorageReaderException {
try {
String line = file.readLine();
while(line != null && (isCommentString(line) || !isControlWord(line))) {
line = file.readLine();
}
if(isEndOfBlock(line)) {
throw new EndOfBlockException(fileName);
}
return line;
} catch(IOExcept... |
ad05bd72-d51f-44cf-8959-d91783a5ade9 | 6 | public void map(Object key, Text value, Context context)
throws IOException, InterruptedException {
String line = value.toString();
if (line == null || line.equals(""))
return;
String[] lines = line.split("\t");
Post post = new Post(lines[0]);
String content = lines[1];
List<String> words... |
e0af873b-5319-477e-bf5f-a6688b8e219a | 0 | @Override public Iterator<String> iterator() {
return cookies.keySet().iterator();
} |
8324b27b-30a9-4079-8d2e-ee1983ebcda1 | 6 | private void txPesqNomeKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txPesqNomeKeyPressed
String nome = txPesqNome.getText();
if(nome.length()>0){
ConsultaController pc
= new ConsultaController();
modelo.setNumRows(0);
for (Consulta p : pc.listB... |
7e0f29cc-00fd-4cd1-8d14-35b76e5aeb3f | 1 | public static String gettext(AttributedCharacterIterator s) {
StringBuilder tbuf = new StringBuilder();
for(int i = s.getBeginIndex(); i < s.getEndIndex(); i++)
tbuf.append(s.setIndex(i));
return(tbuf.toString());
} |
23b740c5-90b7-476f-bd0f-d5977776e2b8 | 2 | public Move createMoveFromString(String instruction) {
String[] Split = instruction.split(" ");
String owner = Split[0];
int ID = Integer.parseInt(Split[1]);
Player player = null;
if(owner.equals(Character.toString('R'))) player = Player.Rom;
else if(owner.equals(Character.toString('C'))) player = P... |
784353fc-e967-42cd-a401-7d91fe228938 | 4 | @Override
public Balance addBusinessObject(Balance value) throws EmptyNameException, DuplicateNameException {
try {
return addBusinessObject(value, value.getUniqueProperties());
} catch (DuplicateNameException ex) {
String name = value.getName();
if (YEAR_BALANCE.... |
90d305be-7394-4b44-a5c2-87d33637b33a | 5 | public void mousePressed(MouseEvent paramMouseEvent)
{
if (TextButton.this.Clickable)
{
if ((TextButton.this.player != null) && (TextButton.this.sound != null))
{
TextButton.this.player.play(TextButton.this.sound);
}
if (TextButton.this.MousePressedBackgroundCo... |
81aaf9ac-3745-470c-921a-26a7507518ba | 7 | @Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result
+ ((backFace == null) ? 0 : backFace.hashCode());
result = prime * result
+ ((bottomFace == null) ? 0 : bottomFace.hashCode());
result = prime * result + ((coord == null) ? 0 : coord.hashCode());
result ... |
3d06a3b6-9019-42a1-8c35-b8f049bc076c | 8 | public static void delete(CommandSender sender, String [] args){
if(sender.hasPermission("battlegrounds.team.delete")){
//If missing parameters
if(args.length < 2+1){
sender.sendMessage(ErrorMessage.MissingParameters);
sender.sendMessage(ChatColor.YELLOW + usage);
}
else if(args.length ... |
33904c6b-cef1-4092-8419-910cca205aa6 | 0 | public Node<K> getRoot() {
return root;
} |
ef1f0903-6bb8-4c4c-ba5f-6b0ca4e0915d | 2 | @Override
public boolean isComponent(JsonObject jsonObject) {
return jsonObject.get("showdigitalclock") != null &&
jsonObject.get("showweather") != null &&
jsonObject.get("type").getAsString().equals("timeofdayclock");
} |
93e37f1f-aeb7-472e-b91c-466967c3e567 | 3 | @Override
public boolean doValidation() {
if(nameTextField.getText().isEmpty()){
addToValidationMassage("name is empty!");
return false;
}
if(priceTextField.getText().isEmpty()){
addToValidationMassage("price is empty!");
return false;
}
if(quantityTextField.getText().isEmpty()){
... |
09668d68-c4e3-4804-830c-49979efe36d5 | 4 | public void run() {
while (true) {
if (socket.isConnected()) {
try {
System.out.println("Listening on port " + socket.getPort() + " for incoming messages");
BufferedReader reader = new BufferedReader(new InputStreamReader(socket.getInputStream()));
String msg = reader.readLine();
System.out... |
b00d3974-d413-477e-8af4-e5068940925e | 6 | private float move(float p, int index, Float max, Float min) {
float value = 0f;
if((min != null && max != null) && allowed[index]) {
if(isInRange(p, max, min)) {
value = p;
} else if(p > max) {
value = max;
} else {
... |
92632f2a-3668-44f6-87c3-a4e59385f847 | 8 | public UserInfo setUserInfo(String username, String password, String newPassword, String name, String organization,
String position, String phone, String email, String extraInfo)throws XMPPException{
if(newPassword != null && newPassword.length() < 6)
throw new XMPPException(new XMPPError(XMPPError.Co... |
8f516d96-fba4-42d9-b95d-f32e9328832c | 1 | public Constant newFloat(final float value) {
key1.set(value);
Constant result = get(key1);
if (result == null) {
result = new Constant(key1);
put(result);
}
return result;
} |
64493d23-1177-4197-a6af-a9e18bb0b017 | 9 | @Override
public boolean okMessage(final Environmental myHost, final CMMsg msg)
{
if(!(affected instanceof MOB))
return true;
final MOB mob=(MOB)affected;
if((msg.targetMajor(CMMsg.MASK_MALICIOUS))
&&(((msg.source()==mob)&&(msg.target()!=null)&&(isTruceWith(msg.target().Name())))
||((msg.target()==mob)... |
b75ab94c-ad37-4309-b08e-7d581822ed5d | 6 | public void removeTask(Task task)
{
if (DEBUG) log("Find the taskWidget that contains the desired task");
TaskWidget target = null;
for (TaskWidget tw : taskWidgets)
{
if (tw.getTask() == task)
{
target = tw;
}
}
if (target == null)
{
if (DEBUG) log("Failed ... |
b4cfaf58-a3dc-4156-86be-f4659b045610 | 7 | public void addChatMessage(String s) {
if(!s.trim().isEmpty()){
for(Component l : main.getContentPane().getComponents()){
if(l instanceof JLabel && l != name && l != creator && l != players){
l.setLocation(l.getLocation().x, l.getLocation().y - 20);
if(l.getLocation().y <= 120){
main.getContent... |
c85f10e4-5834-4573-b95e-adbedbf6a44f | 3 | public void stopSpel(){ //stopt het spel en opent hoofdMenuPanel (als spel nog bezig is, eerst bevestiging via dialog)
if(spel.isSpelBezig() && toonStopDialog() == JOptionPane.NO_OPTION) return;
try{
spel.resetSpel();
} catch(Exception e){
toonError(e);
}
... |
f79151f0-810f-406a-9b2b-183a033bdb20 | 4 | public void setCityImageLocation(String forceName)
{
switch (forceName)
{
case "曹操": cityImageLocation = "/resources/caocaoCityColour.png";
cityImagePressedLocation = "/resources/caocaoCityPressedColour.png";
break;
case "刘备": ... |
ba3953f1-964c-4fe0-af0d-0b83153439f6 | 0 | private Object readDouble() {
return readFloat();
} |
a5146e1c-9986-4fdf-be1b-794066098f69 | 5 | public final void draw(byte i, boolean bool) {
anInt4696++;
if (i != -49)
method2022(null, 101);
if (bool) {
int width = (Class321.windowWidth > Class92.anInt1524 ? Class321.windowWidth : Class92.anInt1524);
int height = (((OpenGlToolkit.anInt7666 ^ 0xffffffff) > (Class348_Sub42_Sub8_Sub2.windowHeight... |
74500c52-fef7-4587-ab4f-315693229567 | 6 | public List<CarrierInfo> findOFDMCarriersWithinRange (double spectrum[],double sampleRate,int binCount,double multiFactor,int startBin,int endBin) {
List<CarrierInfo> cList=new ArrayList<CarrierInfo>();
int a;
double dPoint=-1.0;
for (a=startBin;a<endBin;a++) {
if (spectrum[a]>dPoint) dPoint=spectrum[a];
}... |
d728a553-fcbd-4cbd-b7a0-141f2186e477 | 8 | protected void initializeDictionaries() throws MojoFailureException {
// Read the dictionary files
try {
// Load the default dictionary
dictionary.addDictionary(getClass().getResourceAsStream("/eap6.dict"));
for (File f : dictionaryFiles)
dictionary.ad... |
d6d505ad-9cbe-4cfa-b2cd-3dd80b96830a | 7 | @Override
public String toString() {
String message = "";
// Include name into message
message += "Name:\n" + name;
// Include done or not
if (isDone) {
message += " [Done]\n\n";
} else {
message += "\n\n";
}
// Include description into message
if (!description.isEmpty()) {
messa... |
b6935937-257d-4306-8937-6c0554280fff | 0 | public Trame[] getTrame() {
return trame;
} |
8331bbcf-9c3f-4a95-b9ff-628d19f8b1bc | 7 | public static void back(double curMoney, int last) {
if ((totalDis - stations[last].dis) <= (galCapacity * milesPerGal)
&& curMoney != 0) {
if (curMoney < min)
min = curMoney;
} else {
for (int i = last + 1; i < stations.length; i++) {
double dis = stations[i].dis - stations[last].dis;
double ... |
221d9e4e-9b63-4cbb-bf2b-481174b7f796 | 5 | private void configureListeners() {
/*
* Changes to be done in text box on change of seletedDate ,
* selectedMonth and selectedYear in DatePicker.
*/
ChangeListener<Object> listener = new ChangeListener<Object>() {
@Override
public void changed(Ob... |
4e34beb4-955d-4031-abe2-cc4139aa1a14 | 7 | public List<HipchatUser> getStandupUsers()
{
List<HipchatUser> remaining_users = new ArrayList<HipchatUser>();
List<String> user_names = getSelectedRoom().getConnectedUsers();
List<HipchatUser> users = new ArrayList<HipchatUser>();
for ( String user_name : user_names )
{
HipchatUser user = findUser(user_n... |
6d5cd14b-a59d-4de0-b770-ba2e50eb1614 | 7 | private static String getPostionInBase64Table(char c) {
if((c >= 65 && c <= 90))// Gro�buchstabe
return c - 65 + "";
else if((c >= 97 && c <= 122))// Kleinbuchstabe
return c - 71 + "";
else if((c >= 48 && c <= 57))// Ziffern
return c + 4 + "";
else if(... |
d9453f7d-23af-41e6-acba-5f8992bcecdf | 5 | private ArrayList<Vertex<T>> getPath(
ArrayList<Tuple<Pair<Vertex<T>>, Double>> vertexPairs,
Vertex<T> src,
Vertex<T> dest )
{
ArrayList<Vertex<T>> path = new ArrayList<Vertex<T>> ();
Vertex<T> successor = dest;
Pair<Vertex<T>> tempPair = null;
// trace the path backwards from the d... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.