method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
f5f7b668-b3a1-40ba-b1ac-decab196864b | 3 | public static void professionalDetails(BufferedReader inp) throws IOException {
@SuppressWarnings("unused")
ProfessionalBean professionalBean = new ProfessionalBean();
/* private Integer prfId;
private IndustryTbl industryTbl;
private TechnologyTbl technologyTbl;
private int exmMgId;
... |
8cb4a16b-29c8-4339-9f3c-92bcc5ed2305 | 7 | public static void startupCollections() {
{ Object old$Module$000 = Stella.$MODULE$.get();
Object old$Context$000 = Stella.$CONTEXT$.get();
try {
Native.setSpecial(Stella.$MODULE$, Stella.$STELLA_MODULE$);
Native.setSpecial(Stella.$CONTEXT$, ((Module)(Stella.$MODULE$.get())));
i... |
63c4e828-0d17-4d8d-8d98-65bae6bba149 | 6 | private String wrapWithJson() {
if (isString) {
return "\"" + this.string + "\"";
} else if (isObject) {
StringBuilder sb = new StringBuilder();
for (int i = 0; i < this.keys.size(); i++) {
sb.append(",\"").append(this.keys.get(i)).append("\":").append(this.array.get(i).wrapWithJson());
}
return ... |
69e8ce5f-d7db-4b85-864a-03a2db1b4d04 | 1 | public boolean ModificarAfecta(Afecta p){
if (p!=null) {
cx.Modificar(p);
return true;
}else {
return false;
}
} |
ab9ad25f-d3f1-4d2d-80af-c53a4b9245a4 | 5 | public static BufferedImage drawBG(EyeTrack owner) {
Experiment exp = owner.getGameState().getSettings().getExperiment();
double fullWidth = owner.getSize().getWidth();
double fullHeight = owner.getSize().getHeight();
double w = exp.getPixelWidth();
double h = exp.getPixelHeight();
double insetX = 0.5*(... |
0db758cc-003b-4bc3-b2df-50a6f970044b | 9 | public long[] solve(int[] X, int[] Y, int[] Z) {
long[] result = new long[X.length];
for (int i = 0; i < Z.length; i++) {
double x = X[i];
double y = Y[i];
double z = Z[i];
System.out.println(String.format("[%d]---%f-%f-%f", i, x,y,z));
if (y... |
fd61e0a4-03a4-4ff8-bb0e-faeb7b08772e | 5 | @Test
public void testFind() {
List<Integer> list = new ArrayList<>();
Random random = new Random();
for (int i=0; i<1000_000; i++) {
list.add(random.nextInt(10_000));
}
long curTime = 0;
curTime = System.currentTimeMillis();
int max1 = Integer.MIN_VALUE;
for (int i=0; i<100_000; i++) {
int cu... |
06010a15-272d-4fad-8b8b-31c1cba5b419 | 9 | public void run() {
try {
resultSocket = serverSocket.accept();
if (dbg) System.out.println("Client connected!");
InputStream is = resultSocket.getInputStream();
DataInputStream ois = new DataInputStream(is);
int count, lcounter = 0, size;
... |
7963f761-2864-4599-8df5-6696e0f53879 | 3 | @Override
public void actionPerformed(ActionEvent e) {
OutlinerDocument doc = (OutlinerDocument) Outliner.documents.getMostRecentDocumentTouched();
OutlinerCellRendererImpl textArea = doc.panel.layout.getUIComponent(doc.tree.getEditingNode());
if (textArea == null) {
return;
}
Node node = textArea.n... |
f9a65c43-15e6-458b-8406-2e885134d69b | 5 | public V checkBaseInterfaces(Class c) {
Map<Class, V> possibles = new HashMap<Class,V>();
for (Class base = c; base != Object.class; base = base.getSuperclass()) {
for (Class itf : base.getInterfaces()) {
V val = lookup.valAt(itf);
if (val != null) possibles.p... |
f31ab6f6-d220-4f5d-97f4-345de3872867 | 9 | public void pay(BankBillet billetParam, Date paidAt, BigDecimal paidAmount) throws CobreGratisBadRequestException, CobreGratisUnauthorizedException, CobreGratisForbiddenException, CobreGratisNotFoundException, CobreGratisUnprocessibleEntityException, ClientHandlerException, UniformInterfaceException, CobreGratisTooMany... |
360a2647-a15b-414e-8837-b71325400fb8 | 2 | public void setUsertileImagePadding(int[] padding) {
if ((padding == null) || (padding.length != 4)) {
this.usertileImage_Padding = UIPaddingInits.USERTILE_IMAGE.getPadding();
} else {
this.usertileImage_Padding = padding;
}
somethingChanged();
} |
589c30a9-a644-49b7-92f1-22c20eb86fe7 | 4 | private void crearPitStops() {
//Se crea una lista con los nombres de los pilotos, luego se crea una
//lista con los nombres de las pistas y se envian al cuadro de dialogo
//de PitStop Mannager.
String locationsdir = ruta + "\\GameData\\Locations";
ArrayList esena = new ArrayList... |
e9d70928-3ed3-4018-9ec8-6d4b543edca7 | 4 | public boolean judgeIfIn(){
return (this.location_x <= this.active_area_x && this.location_y <= this.active_area_y && this.location_x > 0 && this.location_y > 0)? true : false ;
} |
6e483183-cc00-4cbe-a425-03a7da5e5bd6 | 1 | public Map<Integer, Map<String, Double>> getReadLine(String classPath)throws IOException,FileNotFoundException{
Map<Integer, Map<String, Double>> classMap = new HashMap<Integer, Map<String, Double>>();
InputStreamReader inputReader = new InputStreamReader(
new FileInputStream(classPath), "GBK");
BufferedReade... |
0cfd466c-50da-40d2-b7ba-25d71a1e16cb | 8 | public void go() {
try {
PrintWriter writer = new PrintWriter(new FileOutputStream("xkcdImages.txt"));
for(int i = 1; i <= 1330; i++) {
if(i == 100 || i == 404 || i == 1037) {
System.out.println("Skipping " + Integer.toString(i));
continue;
}
File file = new File("XKCD/" + Integer.to... |
4fae6113-9a7b-451a-a36e-2a0d21b17f96 | 0 | public void setSampleCode(String sampleCode) {
this.sampleCode = sampleCode;
} |
b4fa38a4-3bdb-4895-aec7-67ac5d381f87 | 7 | public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new FileReader(args[0]));
String s;
while ((s = br.readLine()) != null) {
String[] a = s.split(";");
String[] b = a[0].split(",");
String[] c = a[1].split(",");
List<String> t = new LinkedList<String... |
29363509-64b0-4f98-8e82-dc205f93384c | 1 | public static EntityType lookup(String name) {
if (_entityNames.containsKey(name))
return _entityNames.get(name);
else
return NONE;
} |
8ed37b48-21d2-4a77-a49a-127816a00f56 | 2 | public void init(byte[] a)
{
int k = a.length;
this.i = 0;
while (this.i < 256)
{
this.Table[this.i] = this.i;
this.i++;
}
this.j = 0;
this.i = 0;
while (this.i < 256)
{
this.j = ((this.j + this.Table[this.i]) + (a[this.i % k] & 0xff)) % 256;
this.Swamp(this.i, this.j);
this.i... |
c0df46df-8a66-459c-9b3c-5bd3fd0cfb69 | 3 | public Object getValueAt(int row, int col) {
if(row>-1 && col>-1 && data!=null)
return data[row][col];
else
return null;
} |
8c2069ad-7e12-4ad1-81b7-f337f9833555 | 5 | @SuppressWarnings("deprecation")
@EventHandler
public void interact(PlayerInteractEvent event){
Player p = event.getPlayer();
if(plugin.setting.containsKey(p.getName())){
if(event.getAction()==Action.RIGHT_CLICK_BLOCK){
Location l = event.getClickedBlock().getLocation();
if(p.getItemInHand().getTypeId(... |
ccc23aef-4e34-44c8-bf7d-37fe6bb0a8e2 | 4 | private List<Position> removeObstaclesFromPositionList(List<Position> positions) {
final List<Position> newPositions = new ArrayList<Position>(positions);
for (Position pos : positions)
for (Element e : getGrid().getElementsOnPosition(pos))
if (e instanceof Obstacle && ((Obstacle) e).isObstacle(this))
... |
804f3b49-8f08-4f9b-8005-73448045532f | 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... |
d6f344a0-2811-49d6-896c-b9a119467f39 | 9 | final int method545(int[] is, int i, int i_120_, int i_121_, int[] is_122_, int i_123_, int i_124_, Random random, String string, int i_125_, int i_126_, GLSprite[] glsprites, int i_127_, int i_128_, int i_129_) {
anInt801++;
if (string == null) {
return 0;
}
random.setSeed((long) i_127_);
int i_130_ = 192... |
ca94cce2-4bb9-4b47-8068-2cbd3e4c87fb | 0 | @Override
public void destroy() {
parent = null;
node = null;
} |
9951aa32-8e75-4956-8eca-12340ac90e01 | 9 | private void updateComponent(String event) {
if (null != project) {
if ((null == event) || Project.EVENT_PERIODS.equals(event)) {
periodsTextField.setValue(project.getPeriods());
} else if ((null == event)
|| Project.EVENT_INTEREST_RATE.equals(event)) ... |
b0e85fb6-d6ca-443b-aff4-0876ff53e3cd | 4 | @Override
public void execute() {
seq(new WalkToSegment(0, 8));
seq(new WalkToSegment(-1, 8));
seq(new WalkToSegment(36, 16));
seqMove(new OverworldInteract(5));
seq(new SkipTextsSegment(4)); // pewter skip text
for (int i=0;i<35;i++) {
seqButton(Move.SELECT | Move.RIGHT);
}
seqButton(Move.SELECT | ... |
a93c3d6e-bfbd-4ded-8752-685a19f621f2 | 5 | public Writer write(Writer writer) throws JSONException {
try {
boolean b = false;
Iterator keys = keys();
writer.write('{');
while (keys.hasNext()) {
if (b) {
writer.write(',');
}
Object k = ke... |
c7e13bdf-987f-4329-8d3e-66872d563487 | 6 | public static Digraph dag(int V, int E) {
if (E > (long) V*(V-1) / 2) throw new IllegalArgumentException("Too many edges");
if (E < 0) throw new IllegalArgumentException("Too few edges");
Digraph G = new Digraph(V);
SET<Edge> set = new SET<Edge>();
int[] vertices... |
34a37807-9cf1-4998-93d1-58471cbdcb2b | 2 | private void jButtonRemoveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonRemoveActionPerformed
Iterator<SignatureFile> it = this.model.getSelectedFiles().iterator();
while (it.hasNext()) {
this.model.remove(it.next());
}
this.model.fireTableDataCha... |
2e8becfc-4cd1-46fa-99af-648279f3e8c4 | 2 | @Override
public void paintComponent(Graphics g)
{
super.paintComponent(g);
if (piece != null)
{
g.setColor(piece.color);
for (Point block : piece.body)
{
g.fillRect(block.x*(blockSize+2)+blockSize, blockSize*3 - block.y*(blockSize+2)+blockSize, blockSiz... |
b820dace-910e-4db6-b8d7-87a0f83d61a8 | 9 | public static void main(String[] args) throws Throwable {
// Checks if the correct number of arguments are provided.
// Terminate if false.
try {
//Case 1: When user has provided:
// 1. Path to the target image.
// 2. Path to the tile images directory.
if (args.length == 2) {
new Main(... |
ea71a763-4baf-457f-9902-33a5c352b74c | 6 | public static void main(String[] args) throws IOException{
Scanner in = new Scanner(System.in);
int n = in.nextInt();
int m = in.nextInt();
long result = 0;
ArrayList<Long> batches = new ArrayList<Long>();
long cnt = 1;
long init = in.nextLong();
long pos=0;
int N = n;
while(n-->1){
p... |
51f426e9-1057-4a58-8273-2368ae266b22 | 4 | public DebuffButton (int id){
if (id == 0){ //stun
bg[0] = new GreenfootImage ("Debuff/stunned.png");
bg[1] = new GreenfootImage ("Debuff/stunned.png");
bg[2] = new GreenfootImage ("Debuff/stunned.png");
name = "Stun";
}else if (id == 1){... |
8a14413a-6278-495e-b4b6-e742c03a47a2 | 1 | public void testGetDurationConverter() {
DurationConverter c = ConverterManager.getInstance().getDurationConverter(new Long(0L));
assertEquals(Long.class, c.getSupportedType());
c = ConverterManager.getInstance().getDurationConverter(new Duration(123L));
assertEquals(ReadableDur... |
bce0f3d0-e99a-4468-b56b-2fbcd12b9d09 | 9 | public String createExperimentIndexEntry(ResultProducer rp)
throws Exception {
if (m_Debug) {
System.err.println("Creating experiment index entry...");
}
// Execute compound transaction
int numRows = 0;
// Workaround for MySQL (doesn't support transactions)
/* if (m_Connection.... |
b937e729-fe82-4fc7-8a80-2a1742f1886d | 8 | public String [] getOptions() {
String [] options = new String [21];
int current = 0;
options[current++] = "-L"; options[current++] = "" + getLearningRate();
options[current++] = "-M"; options[current++] = "" + getMomentum();
options[current++] = "-N"; options[current++] = "" + getTrainingTime(); ... |
6d29a688-21df-4143-ab6f-79af82952f99 | 5 | public static void maxCopies(Deck d){
if(d.repeated){
System.out.println("maxCopies doesn't deal with repeated decks yet");
}else{
Map<String, Integer> copies = new TreeMap<String, Integer>();
for(int i=0; i<d.cards.size(); i++){
String s = d.cards.get(i);
if(! CardsInfo.has(s, "Basic")){
if(... |
afff94ff-14ea-4bec-88ce-0d64b3fc19be | 3 | public void method275(int z) {
anInt442 = z;
for (int x = 0; x < mapSizeX; x++) {
for (int y = 0; y < mapSizeY; y++) {
if (groundTiles[z][x][y] == null) {
groundTiles[z][x][y] = new GroundTile(z, x, y);
}
}
}
} |
db113334-9309-43f1-b0b3-59387a5b3e0e | 7 | @Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final AffectationEnseignantDTO other = (AffectationEnseignantDTO) obj;
if (!Objects.equals(this.id, other.id)) ... |
6bce1aa4-f2bb-4957-ae6a-8d672dbb57ec | 6 | public void move() {
// ################# Y AXIS #####################
// negative acceleration (gravity factor)
// int acceleration = 1;
//
// if(velocity!=0){
// if(velocity<=-1)
// acceleration=1;
// if(velocity>=1)
// acceleration=1;
// // gravity, count slows down the gravity so it doesnt reduc... |
29de3660-a178-476b-a0c1-19f22bb7d2ed | 2 | public int storeItem(Item tempItem){
for(int count = 0; count < 20; count++){
if(backpack[count] == null){
backpack[count] = tempItem;
return 0;
}
}
return 1;
} |
19e5d9a0-7d2c-473f-8596-6b5ec7ea4910 | 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://... |
ff9c1829-bf55-4f5a-9856-8ff62c0f16cd | 2 | public boolean setGridLine(Combination<Colors> attempt, AnswerCombination answer) {
if (this.additionalAttemptPossible) {
this.grid.add(new Row(attempt, answer));
if (this.grid.size() == Board.SIZE) {
additionalAttemptPossible = false;
}
else {
this.additionalAttemptP... |
e58cfc84-cd68-4f56-ad0c-ebe572a00f16 | 7 | public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
MovingObjectPosition movingobjectposition = getMovingObjectPositionFromPlayer(par2World, par3EntityPlayer, true);
if (movingobjectposition == null)
{
return par1ItemStack... |
ea88a2e4-a7e5-41c7-97ab-f73b2f3d9b83 | 6 | public ArrayList<Gebruiker> getAlleKlantenOuderDan2010(){
if(alleKlantenOuder.isEmpty() && ouderAutos.isEmpty()) {
alleKlantenOuder = new GebruikersDAO().getAlleGebruikersDB();
ouderAutos = new AutosDAO().getAlleAutosDB();
int x = 0;
for(Auto a: ouderAutos){
if(a.getBouwjaar() > 2010... |
17df7eb9-a917-4aa2-9715-f92d4bdd9f18 | 9 | public static BufferedImage gaussFilter(BufferedImage image, int filter[][] ) {
BufferedImage ret = makeEmptyGrayImageFromImage(image);
int w = image.getWidth();
int h = image.getHeight();
int windowSize = filter.length;
int norm = 0;
for (int i = 0; i < windowSize; ++i) {
for (int j = 0; j < windowS... |
e294378c-033e-473b-9eda-33cfd9b84d68 | 4 | public void btnConfirmar() {
if (!procedimentoEscolhido.getDes_nomeexame().equals("")) {
listDescricaoExames.add(procedimentoEscolhido);
if (clienteSelecionado != null && profissionalSelecionado != null && descricaoExames != null) {
salvarSolicitacao();
salvarListaSolicitacao();
... |
8d6bbf4c-95d6-4f28-adc1-1f8e3a59dff2 | 4 | @Override
public void keyPressed(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_LEFT) {
hahmo.liiku(Suunta.Lansi);
} else if (e.getKeyCode() == KeyEvent.VK_RIGHT) {
hahmo.liiku(Suunta.Ita);
}
else if (e.getKeyCode() == KeyEvent.VK_UP) {
hahmo.liik... |
47521e5a-aa05-4862-bfe3-969193c90089 | 3 | public void sample(Gene gene, Marker marker, String type, ChangeEffect changeEffect) {
Variant seqChange = changeEffect.getSeqChange();
// Different seqChange? Clean the cache
if (prevSeqChangePos != seqChange.getStart()) {
latestTypes.clear();
prevSeqChangePos = seqChange.getStart();
}
// Make sure w... |
3219f32a-8f91-4cdc-ab7d-d6d2d6dcac12 | 6 | public void set_category(String cat){
this.category=cat;
switch(this.category){
case "all":
this.category_nr=0;
break;
case "Light":
this.category_nr=1;
break;
case "Medium":
this.category_nr=2;
break;
case "Heavy":
this.category_nr=3;
break;
case "Tank Destroyer":
t... |
971379a3-fb99-4af6-abb0-9712994bed63 | 7 | private static Set<NonTerminal> getProductiveNonterminals(Set<Production> productions) {
Set<NonTerminal> productive = new ShareableHashSet<NonTerminal>();
int oldSize = 0;
int newSize = 0;
do {
for (Production p : productions) {
if (p.reject) {
continue;
}
boolean all = true;
for ... |
f98b194f-1caa-4bda-aa2a-b74ca1e08f0a | 5 | private void componentListKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_componentListKeyReleased
if(evt.getKeyCode() == KeyEvent.VK_C && evt.isControlDown()){
this.getDiagramPanel().copySelectedElements();
}
if(evt.getKeyCode() == KeyEvent.VK_V && evt.isControlDown()){
... |
16c29925-20d3-4240-a221-94e34a4bda98 | 7 | public static void main(String[] args) throws Throwable {
mon = new int[22];
for (int i = 0; i < mon.length;) {
i++;
mon[i-1]=i*i*i;
}
// System.out.println(Arrays.toString(mon));
mat = new long[10001][22];
for(int i=0;i<mat.length;++i){
for(int j=0;j<mat[i].length;++j){
if(i==0)mat[i][j]=1;
... |
bf163073-8adc-45ab-8341-cdc882ab6220 | 0 | public int GetStartBusStop()
{
//get the person start bus stop
return startBustop;
} |
91ca98a2-3c0f-43be-868d-892f62746639 | 1 | public static double romberg(double epsilon, double extremoIzq, double extremoDer, Funcion fun) {
int n = 0;
//Calcula t(h)
double t0 = rombergGradoN(extremoIzq, extremoDer, fun, 0, n);
//Calcula r1(h)
double r1 = rombergGradoN(extremoIzq, extremoDer, fun, 0, ++n);
//Reca... |
c5059cca-c91a-48e1-bf8a-dcf74a3b302c | 8 | JScrollPane newLabyPanel(final Labyrinth laby) {
//final Labyrinth laby = new Labyrinth(20,20);
JPanel panel = new JPanel() {
public void paintComponent(Graphics g) {
super.paintComponent(g);
Graphics2D g2 = (Graphics2D) g;
//Draw solution
... |
c619c7e8-2116-4a9d-9398-24f1be1e35c8 | 9 | public static String base2Encode(byte[] bytes) {
StringBuilder sb = new StringBuilder(bytes.length);
for (byte b : bytes) {
sb.append((b & 0x80) == 0 ? '0' : '1');
sb.append((b & 0x40) == 0 ? '0' : '1');
sb.append((b & 0x20) == 0 ? '0' : '1');
sb.append((b... |
35fb586c-125d-495a-b7c2-f68afbbf6b58 | 5 | public static boolean writeCSV(RiverDB riverDB, String absolutePath) {
// create output file
FileWriter outputStream = null;
try {
outputStream = new FileWriter(absolutePath);
outputStream.write("Nr.,Land,Fluss,Einstieg,Ausstieg,Entfernung,Km,WW,WW Stufe,Info,Min,Max,Einheit,Teilnehmer,Favor... |
13727ba4-50af-451e-a21f-0aebbc87fc38 | 3 | private String getFieldsList(SelectMethod selectMethod, Field... fields)
{
switch (selectMethod)
{
case NORMAL:
return new FieldsPart(Arrays.asList(fields)).toSql();
case COUNT:
return " COUNT(" + new FieldsPart(Arrays.asList(fields)).toSql() +... |
9f02b377-9d12-4ae2-831f-e37cdc779888 | 2 | * @see StackExpr
* @see StackManipStmt
*/
public void visit_dup(final Instruction inst) {
// 0 -> 0 0
db(" dup");
if (Tree.USE_STACK) {
saveStack();
final StackExpr s0 = (StackExpr) stack.pop1();
final StackExpr[] s = new StackExpr[] { s0 };
manip(s, new int[] { 0, 0 }, StackManipStmt.DU... |
a08bd6c9-45d2-43b3-8b99-a842daa53ab0 | 1 | @Test
public void addingSingleNeighbourToVertexByVertex() {
l.addVertex(v);
l.addVertex(k);
l.addEdge(v, k);
assertTrue(l.getNeighbours(0).contains(v)
&& l.getNeighbours(0).contains(k));
} |
c86ef17f-fdfd-4d32-ad8b-aa701bf81e0b | 7 | public static String parseCommonMultiple(String originContent, String[] flagment, String[] contentKey, int index) {
StringBuilder finalContent = new StringBuilder();
finalContent.append("array (");
if (!originContent.isEmpty()) {//内容不为空
String[] contentChunk = originContent.split("\\... |
7cd3fbc7-555a-4ddd-be48-6d7e460f37c1 | 8 | private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed
boolean estornou = false;
if (TbParcelas.getSelectedRow() > -1) {
if (TbParcelas.getValueAt(TbParcelas.getSelectedRow(), 6).toString().equals("PAGA")) {
if (Int... |
b5682d94-4cdb-4b7b-b663-9e39a639fe7b | 3 | public void tick() {
if (inputDelay > 0)
inputDelay--;
else if (input.attack.clicked || input.menu.clicked) {
game.setMenu(new TitleMenu());
}
} |
5ba9fb67-78ad-4531-ab97-873b81a929a2 | 9 | private void sampleTopics(InstanceList docs, boolean init) {
// resample topics
int ndMax = -1;
int[] wordCounts = (init) ? new int[W] : null;
for (int d=0; d<D; d++) {
FeatureSequence fs = (FeatureSequence) docs.get(d).getData();
int nd = fs.getLength();
if (init) {
z[... |
37274e96-7257-45e0-a264-12c13ec0c1da | 9 | @Override
public void visitDocument(String key, Object value) {
paths = DocUtils.split(key, '/');
infoList = new ArrayList<GetVisitor.VisitorInfo>();
//String[] decrPaths = new String[paths.length];
String decrPath = "";
for (int i = 0; i < paths.length; i++) {
d... |
fdfd1ff6-05ed-4a16-a812-9297d16caf0d | 4 | @Override
public void run()
{
log.info("working");
if(rx.method().equals("POST") && Helpers.authorize(rx))
{
String raw_post = rx.body();
CartRequest cr = null;
try
{
cr = Main.g.fromJson(raw_post, CartRequest.class);
}
catch(Exception e)
{
log.error(e.toString(), e);
... |
8cabf1eb-adaf-452b-83a8-68d839d36a70 | 2 | @Override
public void repaint(Rectangle bounds) {
super.repaint(bounds);
// We have to check for null here, since repaint() will be called during
// initialization of our super class.
if (mProxies != null) {
for (OutlineProxy proxy : mProxies) {
proxy.repaintProxy(bounds);
}
}
} |
1f0addc3-198f-4879-8f1e-3622aad7bdd9 | 8 | Value optimizeValue(Value s) {
if(s instanceof ConstantValue) {
} else if(s instanceof VariableAssign) {
} else if(s instanceof Expression) {
Expression exp = (Expression) s;
if(exp.value.equals("+")) {
List<Value> opr = new LinkedList<Value>();
boolean firstConst = false;
for(i... |
e8f95231-53ab-4f35-a376-cda900df32ec | 0 | @Override
public void setYearsExperience(int yearsExperience) {
super.setYearsExperience(yearsExperience);
} |
1ef4a8d8-252d-4844-a651-ea618ccb9df3 | 4 | public void setThemes(String newTheme)
{
for(int loop = 0; loop<gems.size(); loop++)
{
Gem temp = (Gem) gems.get(loop);
temp.setNewImage(newTheme+"Gem.png");
}
karel.updateGemsInBag(newTheme);
f... |
6044b968-aeba-4bde-8f75-411584bc0865 | 7 | public static String getResults(String inputText)
{
char[] w = new char[501];
Stemmer s = new Stemmer();
StringBuilder tt=new StringBuilder();
char[] args=inputText.toCharArray();
for(int i=0;i<inputText.length();){
int ch = args[i++];
if (Character.i... |
303e2361-934a-4ec4-8e76-da418f44df9f | 7 | private static void RTcounter(File file) throws Exception { //邾
InputStreamReader isr = new InputStreamReader(new FileInputStream(file));
BufferedReader br = new BufferedReader(isr);
String line = br.readLine(); //擪s(URL)
@SuppressWarnings("unused")
String key = line;
int count = 0;
int dataMin = Integ... |
8bcd1b67-5f7f-4869-847d-7be3f6a37b98 | 7 | @Override
public Piece getPieceAt(Location location)
{
Piece result = null;
if (location.equals(redMarshalLocation) && gameStarted && !gameOver) {
result = redMarshal;
} else if (location.equals(redFlagLocation)) {
result = redFlag;
} else if (location.equals(blueFlagLocation)) {
result = gameOver ? ... |
fe29b2f5-db20-4f6a-84cc-2cbb6ab056d7 | 9 | private void printButton(int m) {
switch (m){
case 0:
button1.setText(Board.O);
button1.setIcon(image2);
button1.setEnabled(false);
break;
case 1:
button2.setText(Board.O);
button2.setIcon(image2);
button2.setEnabled(false);
break;
case 2:
button3.setText(Board.O);
button3.setIc... |
7ec43d91-3669-40c3-a5df-3b4348c098e6 | 2 | @Test
public void reverseInsertAndDeleteTest(){
long start = System.currentTimeMillis();
for (int i = 1000000; i >= 0; i--){
heap.insert(i);
}
for (int i = 0; i < 1000000; i++){
assertEquals(heap.extract_min().value, i);
}
long end = System.cur... |
2e9e4286-8b3e-4b22-b2dc-2518b6502dba | 8 | public String getRequestAccessUrl(String approvalPrompt, boolean viewPrivate, boolean write, String state)
{
String url = "https://www.strava.com/oauth/authorize?client_id=" + clientId + "&response_type=code&redirect_uri=" + redirectUri;
StringBuilder sb = new StringBuilder(url);
if (viewP... |
adfcc444-9d3a-4d2d-8852-c548b3b5f253 | 1 | public int getTotalFrequency() {
int total = 0;
for (Occurrence occ : docsList.toArray()) {
total += occ.getTermFrequency();
}
return total;
} |
2ad6d792-d8b2-48b4-b90d-90e66423adbc | 3 | public boolean inRange(int x, int y, int w, int h){
return (this.x > x && this.y > y && this.x <= x+w && this.y <= y+h);
} |
6cdabdf3-ed51-44b6-998c-4a0e3f9a361d | 7 | public void reloadPvP() {
debug = getConfig().getBoolean("settings.debug", false);
debugMsg("Reloading config");
boolean anyPvPBroadcast = false;
for(World w : Bukkit.getServer().getWorlds()){
if((Boolean) getValue(pvpWorlds,w.getName(),"enabled") == true) {
... |
b7e3f592-b603-4919-a74b-8020e1649c14 | 0 | public void setLastActiveDate(Date lastActiveDate) {
this.lastActiveDate = lastActiveDate;
} |
e4968638-6830-47fe-b47a-d5480c682803 | 1 | public void setValueAt(Object aValue, int row, int col) {
//data[rowIndex][columnIndex] = (String) aValue;
try {
Audience element = audienceResultList.get(row);
element.setColumnData(col, aValue);
fireTableCellUpdated(row, col);
} catch(Exception err) {
err.toString();
} ... |
052f5a5e-a94d-45d2-b9f4-7a2adeae9728 | 6 | String listFilesForFolder2(String train, String gender, final File folder) {
for (final File fileEntry : folder.listFiles()) {
if (fileEntry.isDirectory()) {
listFilesForFolder(gender, fileEntry);
} else {
String result = readFile(train, gender, fileEntry.getN... |
faf83ca1-39c8-4122-969d-692b26ce70cb | 8 | private void saveFile() {
if (isOpeningFile) { return; }
File file;
if (blueJInterface == null) {
FileChooser fileChooser = new FileChooser();
FileChooser.ExtensionFilter filter = new FileChooser.ExtensionFilter("FXML files (*.fxml)", "*.fxml");
fileChooser.ge... |
a942c42b-8ba6-470d-9f75-376f19ec590e | 6 | public static void main(String[] args) {
Apple ap = Apple.jonatan;
System.out.println(ap.name());
System.out.println(Apple.reddel.ordinal());
switch (ap){
case jonatan:break;
case reddel:break;
case winesap:break;
case cortland:break;
... |
b9300583-65ca-49f4-95ed-1c825c55e6d4 | 0 | private void removeSelection()
{
leftScorePanel.setSelected(false);
rightScorePanel.setSelected(false);
} |
57b79019-9981-424f-8c59-fa4ab0f9f73b | 1 | public static void close() {
try {
in.close();
}
catch (IOException e) {
e.printStackTrace();
throw new RuntimeException("Could not close BinaryStdIn");
}
} |
71026821-f9f1-4730-be58-d16772f4a322 | 9 | private boolean impliesCodeSource( CodeSource codeSource )
{
ProtectionDomain pd = domain != null ? domain.get() : null;
if( pd == null )
{
return false; // is void - why did I have true?
}
// The CodeSource is not normalized, if the PD was created by a domain
... |
40cb3c8b-9d8e-40e1-8f9b-c44d732b247b | 9 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
final ReinitializeDeviceRequest other = (ReinitializeDeviceRequest) obj;
if (password... |
881308be-86ce-4e6a-a0eb-5cb10be2cc6c | 6 | public WebElement getElement(String elementIdentfier){
String indentifierType;
String identifierTxt = null;
WebElement webElement = null;
try{
if (elementIdentfier.split(",").length > 1) {
// path is other than id
indentifierType = elementIdentfier.split(",")[0];
identifierTxt = elementIdent... |
6c4085d4-9334-4c3b-a798-df1111ffc51c | 7 | public static void write(RenderedImage image, File file, boolean borderless) {
if (!borderless) {
if (image instanceof BufferedImage) {
BufferedImage bi = (BufferedImage) image;
int x = bi.getMinX();
int y = bi.getMinY();
int w = bi.getWidth();
int h = bi.getHeight();
for (int i = x; i < x ... |
2a7220ea-c067-44b8-a1f5-f6c441627291 | 0 | @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "PGPKeyPacket", scope = PGPDataType.class)
public JAXBElement<byte[]> createPGPDataTypePGPKeyPacket(byte[] value) {
return new JAXBElement<byte[]>(_PGPDataTypePGPKeyPacket_QNAME, byte[].class, PGPDataType.class, ((byte[]) value));
... |
37fcf671-35c7-40f1-9a7d-f81b04653086 | 8 | public static void DogTrack(int N) throws FileNotFoundException {
String []track = new String [N];
String []autofill = {"F", "S", "R"};
DogTag []dogArray = new DogTag[autofill.length];
String []imagination = reimagine(autofill);
int adv_lngth = 0;
System.out.println(Arra... |
6202e5e0-a3f7-431a-8019-5337bd5d07b4 | 8 | public BoolExpr add_partitioned_theorem(Context ctx, HashMap<String, Expr> symbolTable) throws Z3Exception{
// a, l1, u1, l2, u2
Expr a = this.a_inputs.get(0).to_smt(ctx, symbolTable );
Expr l1 = this.a_inputs.get(1).to_smt(ctx, symbolTable );
Expr u1 = this.a_inputs.get(2).to_smt(ctx, symbolTable );
Expr l2 ... |
ad9b4c5c-9758-4345-bd47-5ba526235f64 | 6 | public boolean getPlaneLayout() {
boolean hasAisle = false;
Cell[][] dim = new Cell[rows][columns];
for (int i = 0; i < rows; i++) {
Cell[] row = new Cell[columns];
for (int j = 0; j < columns; j++) {
CellType ct = CellType.SEAT;
... |
317689fc-5dda-4653-ab33-84ba2791d4b2 | 9 | @Override
public void cover(ImageBit[][] list) {
ImageBit ib = new ImageBit();
for (int i = 0; i < 50; i++) {
for (int j = 0; j < 50; j++) {
ib = list[i][j];
if (ib.isCovered()) {
continue;
}
LegoUtil.co... |
a5dc4d9a-eb77-427a-9def-91ddccb14ea5 | 0 | public int getProgression() {
return this.progressBar.getValue();
} |
07ebb5ad-e2a6-4a53-9751-051e1aa18a6a | 4 | public void body() {
// if it is a local RC, then use its resource entity ID
int id = -1;
if (localRC_) {
id = resourceID_;
}
// otherwise, use my entity ID
else {
id = super.get_id();
}
// register to central/main GIS if no regio... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.