method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
40aa743c-09fb-43ac-b8b9-a96290c8f456 | 0 | public SearchFilterTest() {
super(new File(new File("tests"), "work"));
} |
ad42fcb6-845b-462c-a3fd-e2b7bf1108a5 | 7 | private boolean isASCII(byte[] data, int start) {
// look at the first 4 bytes
for (int i = start; i < start + 4; i++) {
// get the byte as a character
char c = (char) (data[i] & 0xff);
if (c >= '0' && c <= '9') {
continue;
} else if (c >=... |
c4411e2b-2126-4bf8-8ea1-59104f4fcc2f | 5 | private void syncDir(String pathname) {
File f = new File(pathname);
if (! f.getName().equals(SystemProperties.getInstance().getDatabaseName())) {
File[] listfiles = f.listFiles();
for (int i = 0; i < listfiles.length; i++) {
if (!stop) {
File item = listfiles[i];
if (! item.isHidden()) {
... |
b458afb4-c76c-4031-85e8-aa37443c2084 | 6 | public boolean getBoolean(int index) throws JSONException {
Object object = this.get(index);
if (object.equals(Boolean.FALSE) ||
(object instanceof String &&
((String)object).equalsIgnoreCase("false"))) {
return false;
} else if (object.equals(Boolean.... |
39ae39b5-9991-40f6-bbb3-4483bc90d094 | 8 | @Override
public boolean handle(Request request, Response response) {
// get the series
BasicSeries series = null;
try {
String id_ = request.path.substring(
request.path.lastIndexOf('/')+1);
int id = Integer.parseInt(id_);
Series s = Profile.getInstance()
.getSeries().getById(id);
if ... |
22ce2f6d-93ad-426a-ab40-7365a6237488 | 4 | static public boolean validOptions(String[][] args, DocErrorReporter err) {
for (int i = 0; i < args.length; ++i) {
if (args[i][0].equals("-output")) {
outfile = args[i][1];
} else if (args[i][0].equals("-see")) {
refInlineName = args[i][1];
} else if (args[i][0].equals("-See")) {
refBlockName = ... |
4d54b7c1-8979-48fc-8fd4-9406be96b11a | 7 | private void fixTransitions() {
HashSet<SinglePair> actToDiscard = new HashSet<SinglePair>();
HashSet<SinglePair> obsToDiscard = new HashSet<SinglePair>();
for ( SinglePair sa : transitions[0].keySet() ) {
if ( rMatrix.get( sa ) == null ) {
actToDiscard.add( sa );
... |
d33f5f8d-c6a5-4386-92ab-6bc6ccbef7ab | 3 | public static void main(String argv[]) {
try {
File fXmlFile = new File("data/sp_data_school_day_1.gexf");
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
Document doc = dBuilder.parse(fXmlFile);
//optional, but recommend... |
7656b0f6-84c0-4b2c-8c90-75776f1df0dc | 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 fe... |
c295519e-b618-4341-971e-91abcb8c234f | 3 | private String printWeapon(Weapon weapon) {
String wpn = "";
switch (weapon) {
case ROCK:
wpn = "rock";
break;
case PAPER:
wpn = "paper";
break;
case SCISSORS:
wpn = "scissor";
... |
e888cddd-f06f-451b-967d-369b82161a1c | 1 | void printRow() {
for (V v : vars) {
w.print(", " + v.valueString());
}
w.println();
} |
dcbee44e-2a3f-44bc-b4d1-7ff814b6b350 | 1 | public void removeCodeAt(final int i) {
if (this.isDeleted) {
final String s = "Cannot change a field once it has been marked "
+ "for deletion";
throw new IllegalStateException(s);
}
code.remove(i);
this.setDirty(true);
} |
8494e31c-121e-4cff-ab6e-b6d16554fa65 | 8 | public ItemStack getItems(Inventory inv, ItemStack itemStack) {
ItemStack itemStackC;
int amount = itemStack.getAmount();
for (int x = 0; x < inv.getSize(); x++) {
if (amount == 0) {
break;
}
itemStackC = inv.getItem(x);
if (itemSta... |
0750933a-0f23-4f5e-becf-274e06634261 | 3 | protected boolean checkWin() {
if (players2.numWolves() == 0) // humans win
{
bot.sendMessage(gameChan, getFromFile("VILLAGERS-WIN", NARRATION));
bot.sendMessage(gameChan, getFromFile("CONGR-VILL", NARRATION));
} else if (players2.numWolves() * 2 >= players2.numAlive()) // wolves win
{
if (players2.num... |
8e090136-9505-4a0b-82b6-8379a7bad4d6 | 7 | protected void writeToStream(final InputStream in, final OutputStream out)
throws XMPPException
{
final byte[] b = new byte[BUFFER_SIZE];
int count = 0;
amountWritten = 0;
do {
// write to the output stream
try {
out.write(b, 0, count);
} catch (IOException e) {
throw new XMPPExce... |
a4701f0d-4d39-4813-9d2a-07b293eae8d7 | 7 | static final boolean method2446(char c, byte i) {
if (i != 105)
anInt10503 = 124;
anInt10508++;
if ((c < 48 || c > 57)
&& ((c ^ 0xffffffff) > -66 || (c ^ 0xffffffff) < -91)
&& (c < 97 || c > 122))
return false;
return true;
} |
184bf588-7a81-4641-9f59-2b80265e61e9 | 2 | @Override
public boolean execute(Player player) {
if (!this.hasSecondWord()) {
GameEngine.gui.println("Drop what?");
return false;
}
String name = this.getSecondWord();
if (player.getInventory().hasItem(name))
{
player.getCurrentRoom().getI... |
76e9499d-4041-43b1-bfc0-124bc3bdc4bf | 1 | public static JSONLiteral create(boolean value) {
return value ? TRUE : FALSE;
} |
416030ff-339d-43cb-9ff3-eb76c85f87d9 | 5 | public static boolean isInArray(String needle, boolean case_sensitive, String... haystack) {
if (case_sensitive) {
for (String s : haystack) {
if (needle.equals(s)) return true;
}
return false;
} else {
for (String s : haystack) {
if (needle.equalsIgnoreCase(s)) return true;
}
return false... |
eb06d37f-c3fe-458f-855e-565321ac25b4 | 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 = pre... |
79a00d33-7332-40cc-9f94-65afe54c042d | 8 | public boolean equals( Object other ) {
if ( ! ( other instanceof TObjectFloatMap ) ) {
return false;
}
TObjectFloatMap that = ( TObjectFloatMap ) other;
if ( that.size() != this.size() ) {
return false;
}
try {
TObjectFloatIterator ite... |
faa23c07-986a-4065-a4fe-b4520880ab29 | 2 | public void testDefaultPassWord(){
Client c =Client.getInstance();
try {
c.connect(url,userName,userPassword);
} catch (XmlRpcException e) {
fail();
} finally {
try {
c.close();
} catch (XmlRpcException e) {
fail(e.getMessage());
}
}
} |
99016d3c-058d-4afc-9f5e-20b5601e2dd0 | 5 | @Test
public void testClientMessagingNoPush() {
System.out.println("testClientMessagingNoPush");
try {
assertTrue(c.registerToServer(GlobalConstants.IP_LOOPBACK));
} catch (Exception ex) {
fail("Registration from client to server failed - " + ex);
}
... |
5abe0d0c-d9f6-49c1-b3b9-ae67a70ab096 | 4 | protected void doGet(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
if (!request.getParameterMap().isEmpty()) {
List<String> fouten = new ArrayList<>();
try {
long docentNr = Long
.parseLong(request.getParameter("docentNr"));
Docent docent = doc... |
3f4b5848-f937-439f-89c4-ac80141bc8ef | 5 | protected void generateLanguageModel() {
double totalWord = 0;
for (_Doc d : m_corpus.getCollection()) {
if (d instanceof _ParentDoc)
continue;
_SparseFeature[] fv = d.getSparse();
for (int i = 0; i < fv.length; i++) {
int wid = fv[i].getIndex();
double val = fv[i].getValue();
totalWord +... |
cb903d3b-e40f-484b-b135-fe4021c2ead1 | 1 | protected void calcDIR_CrtDate() {
byte[] bTemp = new byte[2];
for (int i = 16;i < 18; i++) {
bTemp[i-16] = bytesOfFAT32Element[i];
}
Integer temp = byteArrayToInt(bTemp);
DIR_CrtDate = (temp & 0b11111) + "." + ((temp & 0b111100000) >> 5) + "." + (((... |
d41780e4-3064-4a40-891b-fa017219fb5b | 5 | public void addFile(InputStream stream) throws InvalidMidiDataException, IOException {
Sequence seq = MidiSystem.getSequence(stream);
for( Track t : seq.getTracks()) {
for( int i = 0; i < t.size(); i++) {
MidiEvent event = t.get(i);
MidiMessage m = event.getMessage();
/*
* We do not wan... |
0577e70d-64bd-4640-81a4-2af5413f28d0 | 9 | private void buildGamePlateau(String dataFilename)
{
HashMap<CouleurPropriete,Groupe> groups = new HashMap<>();
groups.put(CouleurPropriete.bleuCiel,new Groupe(CouleurPropriete.bleuCiel,50));
groups.put(CouleurPropriete.bleuFonce,new Groupe(CouleurPropriete.bleuFonce,200));
... |
db0e9690-2899-4913-8851-c3cb5849dd32 | 7 | public static Rule_CR parse(ParserContext context)
{
context.push("CR");
boolean parsed = true;
int s0 = context.index;
ArrayList<Rule> e0 = new ArrayList<Rule>();
Rule rule;
parsed = false;
if (!parsed)
{
{
ArrayList<Rule> e1 = new ArrayList<Rule>();
int s1 = c... |
c26e95ad-c886-4090-a242-a48a310d311e | 3 | public boolean executeMove(Board board) {
boolean success = false;
int h = Util.firstEmptyPosition(board, this.getCol());
//Check whether column is valid
if (!Util.isColumnValid(board, this.getCol()) ||
(h <= Util.ERRORTHRESHOLD) || (h >= board.getHeight())) {
success = false;
} else {
board.se... |
f5598ba4-341c-459c-b2ec-bb80a23683dc | 4 | public static void main(String[] args) throws IOException{
Data data1 = new Data(10, 2, 2013);
Data data2 = new Data(11, 2, 2013);
Corrida corrida1 = new Corrida(1, 58, 58);
Corrida corrida2 = new Corrida(2, 58, 58);
Etapa etapa1 = new Etapa(data1, corrida1, "GP... |
d0c23ede-deb8-44c6-b51b-4056e5c92d28 | 9 | private String parseTagComponent(Tokens tokens) {
String currentToken = tokens.getNextToken();
// keep parsing the file until we find the end of the component
while(!EOF(currentToken) && !(compare(currentToken,"cfcomponent") == 0 && compare(tokens.getPreviousToken(),"/") == 0)) {
currentToken = tokens.g... |
9832294a-5bd4-459a-bac3-dd07b1a077c8 | 2 | public SimulatedAnnealingOutput() {
super("Templado simulado");
initComponents();
s = dc.generateRandomSchedule(2, 3, 5, 6);
sched = dc.printScheme(0, 0, s);
for (RoomOutput[] sched1 : sched) {
for (int m = 0; m<sched[0].length; m++) {
a... |
54df7cc6-2206-43d0-9154-ea1d583408e8 | 6 | private void preCheckInstruction() {
if (_captureMode && _captureOut != null) {
try {
// log in the same format as other emulators use to make an easier side-by-side comparison
// format is: ProcessCounter 3 bytes for Opcode Instruction (readable) (after value if stor... |
8bb6624f-f20f-4e94-8987-78ef99654455 | 1 | public void registerPlaceable(Placeable p) {
if (!placeables.containsKey(p.getId())) {
placeables.put(p.getId(), p);
}
} |
b86d53ff-f601-4ebb-9052-68cb0c03a29e | 8 | private void getDatabaseData(User user){
try
{
ArrayList<Activity> actList = factory.getActivities();
for(Activity activity : actList){
activities.put(activity.getKey(), activity);
}
plans = factory.getWorkoutPlansForUser(user);
for(WorkoutPlan plan : plans){
ArrayList<PlanElement> planEl... |
81f44eb6-48bb-4ef4-9043-dde2d4578580 | 2 | public boolean isBookable(){
return (capital!=null && intrest!=null && !isPayedOff());
} |
0398b697-67dd-4dd8-90b7-8018f2502625 | 4 | @Override
public void increaseComplexity() {
if (level == 6) {
SoundEffect.stopMusic();
levelType = LEVEL_MID;
SoundEffect.MUSIC_2.loop();
}
if (level == 11) {
SoundEffect.stopMusic();
levelType = LEVEL_COMPLEX;
SoundEffect.MUSIC_3.loop();
}
if (level == 19) {
if (!isWin)
winTextTime... |
c1b62a5f-613c-4960-b76b-e06533c8254b | 4 | public void calcScore(Frame [] frame, int [] accumScore, int frameNum) {
while (thisIndex <= frameNum) {
// Optimised by jwlee
int basic = addFirstSecond(frame[thisIndex]);
int bonus = 0;
if (frame[thisIndex].isStrike())
bonus = strikeBonus(frame, thisIndex, frameNum);
if (frame[thisIndex].isSpare... |
27c77e60-85fc-4266-856e-bddfc9a6df65 | 8 | @Override
public void endElement(String uri, String localName, String qName) throws SAXException {
if (qName.equals("rowset")) {
if (requiredSkills) {
requiredSkills = false;
} else if (skillBonusCollection) {
skillBonusCollection = false;
} else if (skills) {
skills = false;
response.add(sk... |
f4e15130-c4ba-4238-b02c-b6b1512bc210 | 9 | private BottomPanel() {
//create leftmenu
leftMenu = new JList(menuOptions);
leftMenu.setPreferredSize(new Dimension(65,435));
leftMenu.setBorder(BorderFactory.createEtchedBorder());
leftMenu.setBackground(new Color(235,235,235));
leftMenu.setForeground(Color.BLACK);
JPanel menuLabel = new ... |
3e386d0f-3cd7-4ba6-86b3-b8acc60b89c8 | 0 | public void SetDirection(char newDirection)
{
this.direction = newDirection;
} |
74964836-fe78-4e85-b1d9-6eea416c5b9b | 8 | public void newMixer( Mixer m )
{
if( myMixer != m )
{
try
{
if( clip != null )
clip.close();
else if( sourceDataLine != null )
sourceDataLine.close();
}
catch( SecurityException e... |
2517bb56-5905-40b9-8cbf-a09c3ee8eee4 | 8 | private boolean r_postlude() {
int among_var;
int v_1;
// repeat, line 75
replab0: while(true)
{
v_1 = cursor;
lab1: do {
// (, line 75
... |
0a8eedf8-8916-45b0-81e7-3acb58fad725 | 9 | public Rule(eGame gme) {
switch (gme) {
case FiveStud: {
this.MaxNumberOfPlayers = 4;
this.NumberOfCards = 5;
this.NumberOfJokers = 0;
this.CommunityCards = 0;
break;
}
case FiveStudOneJoker: {
this.MaxNumberOfPlayers = 4;
this.NumberOfCards = 5;
this.NumberOfJokers = 1;
this.Communit... |
789e577a-c440-40fa-8644-997e063aec24 | 9 | public static boolean isValidUrl(String url) {
if (StringUtils.startsWith(url, "#"))
return false;
if (StringUtils.endsWithIgnoreCase(url, "jpg"))
return false;
if (StringUtils.endsWithIgnoreCase(url, "jpeg"))
return false;
if (StringUtils.endsWithIgn... |
ea7b7028-22a0-45a2-903a-becb8678401f | 8 | @Override
public String listarElementos(Class<?> claseElemento) {
int contadorAux = 0, i = 0;
String retorno = "";
while (i < TAMANO_T && contadorAux < contadorRegistros) {
if (tabla[i] != null) {
IteradorLista iterador = tabla[i].getIteradorLista();
while (iterador.getNodoActual() != null) {
IKe... |
87050825-3de2-41a8-a908-78e3b5464525 | 0 | public String getName() {
return name;
} |
11228cc6-aab6-4302-9427-80c781cdd135 | 3 | public Calculator(String exp) {
Stack<AbstractExpression> stack = new Stack<AbstractExpression>();
char chArray[] = exp.toCharArray();
AbstractExpression left = null;
AbstractExpression right = null;
for (int i = 0; i < chArray.length; ++i) {
switch (chArray[i]) {
... |
1a3cee07-e7f9-413b-ba3d-01c372a0f442 | 2 | public void addArg(CLineArg arg) {
if(!args.containsKey(arg.getKey())) {
args.put(arg.getKey(), arg);
if(arg.isRequired()) {
reqBalance--;
}
}
} |
56e8331a-5c65-4b50-a228-cfc1da59d3b5 | 9 | @Override
public void run() {
options.status = "Take ingots";
if (ctx.skillingInterface.isProductionInterfaceOpen()) {
ctx.skillingInterface.cancelProduction();
return;
}
if (ctx.skillingInterface.opened()) {
if (ctx.skillingInterface.getAction().equals("Take")) {
if (ctx.skillingInterface.selec... |
937dc51f-32ef-48fe-b3ab-420f812a6179 | 1 | public String toString() {
String res = "HashMap :";
for (int i = 0 ; i < this.size() ; i++)
res += "\n\t" + this.keys.get(i) + "\t==>\t" + this.values.get(i);
return res;
} |
24614c0b-4139-48ef-bbb4-ff04f00a427f | 8 | @Override
public void keyPressed(KeyEvent e) {
switch (e.getKeyCode()) {
case KeyEvent.VK_UP:
if(snake.getDirection() != Direction.DOWN)
snake.setDirection(Direction.UP);
break;
case KeyEvent.VK_DOWN:
if(snake.getDirection() != Direction.UP)
snake.setDirection(Direction.DOWN);
break;
case K... |
f2cae72c-5391-40e4-979c-42ea6926e692 | 2 | public Wall(Position position, int length, Direction direction) {
super(position);
if (length <2)
throw new IllegalArgumentException("Length has to be at least 2!");
if (direction == null)
throw new IllegalArgumentException("Direction can't be null!");
this.length = length;
this.direction = direct... |
5c5074d4-d79a-4f2c-b27e-3085c641650e | 6 | public static Bookmark loadData() throws FileNotFoundException, IOException{
Bookmark loadedBookmark = null;
ObjectInputStream input = null;
//Open input stream
input = new ObjectInputStream(new FileInputStream("bookmarks.data"));
if(input != null){
//Read bookmark from file
Object obj = null;
tr... |
53c87c05-6c58-4337-a6bc-7e2aae64ffef | 8 | public static void validateConfiguration()
{
int err = 0;
if ((RUN_STATS == null) && (CONVERT_FA == null)) {
if (hadoopBasePath == null) { err++; System.err.println("ERROR: -out is required"); }
if (STARTSTAGE == null && hadoopReadPath == null) { err++; System.err.println("ERROR... |
25cd6593-2c23-4305-a1bb-efb7c1fff94b | 8 | private void VerbindenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_VerbindenActionPerformed
//Variable um den Thread bei Aufruf von "Trennen" anzuhalten und wieder zu starten. 1 heißt verbunden, 0 heißt getrennt
schleife=1;
//Variable damit Verbindung w... |
70e2c25a-d83d-405c-8e57-bf49e8665bdc | 1 | public void initDeck() {
for (int i = 0; i < deck.length; i++)
deck[i] = i;
} |
ef6345b9-0af7-409f-abfc-6591f3aa15dc | 6 | public static Object[][] dataForTable(DateTime beginDate, DateTime endDate, BigDecimal startingAmount, BigDecimal goal, int buttonChoice, ArrayList<BigDecimal> have)
{
int size = 0;
Object[][] data = null;
Model mod = new Model();
switch(buttonChoice)
{
case 1:
size = Model.weeks(Model.howMa... |
e7236fdd-0477-45f4-b504-8e389de1cda5 | 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... |
a3d71d09-1929-4053-b4bd-b3873c3681e7 | 2 | public static Connection establishConnection() {
// Connection string for your SQL Database server.
String connectionString = "jdbc:sqlserver://ah0sncq8yf.database.windows.net:1433"
+ ";"
+ "database=db_like"
+ ";"
+ "user=MySQLAdmin@ah0sncq8yf"
+ ";" + "password=almeta%6y";
Connection conne... |
40b58ca0-39ab-4b72-b945-c7a7f597b5d2 | 3 | private void doLoop() {
for (ITickable e: updateList) {
e.update(delta);
}
for(ITickable e: tempAddUpdateList){
updateList.add(e);
}
for (ITickable e: tempRemoveUpdateList) {
updateList.remove(e);
}
tempRemoveUpdateList = new ArrayList<ITickable>();
tempAddUpdateList = new ArrayList<ITickable>(... |
22b605d1-fc1b-4773-a70b-d417306d595a | 0 | private void clearbutttonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_clearbutttonMouseClicked
// TODO add your handling code here:
editorarea.setText("");
}//GEN-LAST:event_clearbutttonMouseClicked |
4abca6c9-72d5-4fc4-a4c2-faa7a50e3750 | 0 | public void setQuantityPurchased(int quantityPurchased) {
this.quantityPurchased = quantityPurchased;
} |
333c9ae9-99dd-47fb-b1da-c556c08e71f6 | 6 | protected void calculateEdgeTiles(Point paramPoint, int paramInt)
{
int i = 0; int j = this.gridsize.width - 1; int k = 0; int m = this.gridsize.height - 1;
int n = Math.max(i, paramPoint.x - paramInt);
int i1 = Math.min(j, paramPoint.x + paramInt);
int i2 = Math.max(k, paramPoint.y - paramInt);
i... |
366e8fdd-d6bd-44ae-b77c-c45cb7092e6a | 5 | public static boolean validate(WidgetChild... wc) {
if (wc == null || wc.length == 0)
return false;
for (WidgetChild c : wc) {
if (c == null || !c.validate())
return false;
}
return true;
} |
cb8735b9-483e-4fdc-bf36-4d60e14d1068 | 5 | public void addClass(Class<?> cls) {
if(cls.isArray() || cls.isAnnotation() || cls.isPrimitive()) {
return;
}
if(cls.isInterface()) {
interfaces.add(cls.getName().replace('.', '/'));
} else {
classes.add(cls.getName().replace('.', '/'));
}
} |
7b004224-5f42-46df-9f9b-72aa3e33cd28 | 2 | @Override
public String getText()
{
if((txt.getText() == null) || (txt.getText().equals("")))
return null;
else
return txt.getText();
} |
f1ba504d-dc19-496b-be5b-5557ac50e44f | 1 | public boolean update(int n){
x = Math.min(x + n,xMax);
if (x<0)
x = 0;
return (x==xMax);
} |
cbe38e74-dfc4-49ee-b4ed-f06b03ccb165 | 8 | public void afterPropertiesSet() throws Exception {
Assert.hasText(eventTypePackageName, "eventTypePackageName is must be specified");
Assert.notEmpty(statement, "statement is empty");
configuration = new Configuration();
configuration.addEventTypeAutoName(eventTypePackageName);
_instance = EPService... |
0a771f85-a07b-44ee-a125-10510926af86 | 9 | @Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
UserManager other = (UserManager) obj;
if (group... |
c7ad3cf9-f11b-4b4f-a5ba-69d2c2ff831b | 5 | @Override
public Movie readFrom(Class<Movie> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream) throws IOException, WebApplicationException {
Movie movie = new Movie();
JsonParser parser = Json.createParser(ent... |
eb6142e8-ccc3-4135-a259-01d8264e2784 | 5 | static final Entity method1353(int i, int i_4_, int i_5_,
Class var_class) {
Class357 class357
= Message.aClass357ArrayArrayArray2029[i][i_4_][i_5_];
if (class357 == null)
return null;
for (Class148 class148 = ((Class357) class357).aClass148_4396;
class148 != null;
class148 = ((Clas... |
3a32b1cb-23b0-42b3-a5e3-941c54b54fba | 6 | private static void visitPointerLabelPlusReg(MemoryStateCreator mem, PointerLabelPlusRegContext tree) {
switch (tree.getChild(1).getText()) {
case "A":
mem.addRegisterA_pointerPlusLiteral(0); break;
case "B":
mem.addRegisterB_pointerPlusLiteral(0); break;
case "C":
mem.addRegisterC_pointerP... |
5b0e78bd-cfbf-4722-b9c0-d7a64626c76c | 3 | static double[][] inverse(double[][] A){
double[][] B;
double detA = det(A);
if(A.length == 1){
B = new double[1][1];
B[0][0] = 1/detA;
}else{
B = new double[A.length][A.length];
B = transpose(cofactor(A));
for(int i = 0; i < B.length; i++){
for(int j = 0; j < B.length; j++){
B[i][j] = B... |
7ec6fc94-f40f-49d3-8492-53cfc4bba895 | 0 | public static void main(String[] args) throws ClassNotFoundException, UnsupportedLookAndFeelException, IllegalAccessException, InstantiationException
{
// UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
UIManager.setLookAndFeel(WebLookAndFeel.class.getName());
BrainPanel... |
ccd8eba8-23e9-4c54-aefe-d97d4fd63184 | 9 | static final void method607(int i, String[] strings, short[] is, int i_64_,
boolean bool) {
try {
if (bool != false)
aFloat1136 = 0.5791872F;
if (i > i_64_) {
int i_65_ = (i_64_ - -i) / 2;
int i_66_ = i_64_;
String string = strings[i_65_];
strings[i_65_] = strings[i];
strings[i] = string;
s... |
c89f6010-578d-49aa-bf90-d15a8402afe5 | 1 | public void NotifyServerStatusChanged() {
for (IServerStatusChangedNotification sscn : serverStatusChangedNotificationListeners) {
sscn.onServerStatusChanged();
}
} |
575e8190-4799-435b-8d09-3d373e7a1626 | 3 | void checkPoint() throws FileNotFoundException{
/*
* save the index
*/
PrintWriter indexSave = new PrintWriter(new File("testData/indexCheckpoint/index"));
Iterator<Entry<String, long[]>> iter = index.entrySet().iterator();
while(iter.hasNext()){
Entry<String, long[]> entry= iter.next();
ind... |
1984b6d6-37f5-4d22-a13d-324243be7a9e | 9 | final static String getXYZFromMatrix(Matrix4f mat, boolean allPositive) {
String str = "";
float[] row = new float[4];
for (int i = 0; i < 3; i++) {
mat.getRow(i, row);
String term = "";
if (row[0] != 0)
term += (row[0] < 0 ? "-" : "+") + "x";
if (row[1] != 0)
term +=... |
4edf237a-fc96-4c8d-b893-6146b89852fe | 8 | public CEMILData request(final KNXAddress dst, final Configuration c)
{
final Cache cache = c.getCache();
if (cache == null || !(dst instanceof GroupAddress))
return null;
final LDataObject o = (LDataObject) cache.get(dst);
if (o == null)
return null;
// check if there is an expiration timeout for a st... |
bf41b4e5-d2e6-4b4c-be15-c0c46c775cad | 7 | private void openLink(String urlString) {
if (urlString.startsWith("www.")) {
urlString = "http://" + urlString;
}
try {
URL url = new URL(urlString);
URI uri = url.toURI();
Desktop desktop = Desktop.isDesktopSupported() ? Desktop.getDesktop() : null;
if (desktop != null && desktop.isS... |
e8f77593-a379-4e05-b3f9-70a43a649695 | 6 | @Override
public void run()
{
for (int i = 1; i < columns; i++)
{
for (int k = 0; k < frames; k++)
{
scrollToVisible(table, k, i);
if (result[i][k] == -1)
table.getModel().setValueAt("X", k, i);
else
table.getModel().setValueAt(result[i][k], k, i);
try {
if (!(propWin == n... |
6ea0d3e5-f292-4965-9dcb-9c3bb1f28d83 | 9 | public void issue_Age() { // This is the original function - just changed its name to issue_Age: issue oldest ready instructions first
int count = 0; //count the number of instructions to issue in current cycle
ROB_entry[] currentCycleIssuedInstr=new ROB_entry[machineWidth];
for (Iterat... |
10fb33f5-ccbf-4644-ad96-3e65afcd1be8 | 2 | public Annotation getAnnotation(String type) {
Annotation[] annotations = getAnnotations();
for (int i = 0; i < annotations.length; i++) {
if (annotations[i].getTypeName().equals(type))
return annotations[i];
}
return null;
} |
f8ab8aac-29d7-4d66-b2d7-a9c79c70dc6a | 2 | public static Bool valuseOf(Boolean isTrue) {
for (Bool bool : values()) {
if (Objects.equals(isTrue, bool.isTrue)) {
return bool;
}
}
return null;
} |
bf7dd679-cc0e-45d8-80ba-3ed4842e5733 | 3 | public static String getClearTitle(String row_text) {
String clearTitle = "", href_1, href_2;
for (Matcher m_href = p_wikiparen.matcher(row_text); m_href.find(); m_href = p_wikiparen
.matcher(clearTitle)) {
href_1 = m_href.group(2);
href_2 = m_href.group(3) == null ? href_1 : m_href.group(3);
clearTitl... |
e74346fd-fdc1-4e5b-af48-e6e0ea5a3eee | 4 | private static void compareGbAudio(GbAudio a, GbAudio b) {
for (int i = 0; i < Math.min(a.soValues.length, b.soValues.length); i++) {
if (a.soValues[i] != b.soValues[i]) {
System.out.println("diff so " + i + ": " + a.soValues[i] + " " + b.soValues[i]);
break;
}
}
for (int i = 0;... |
87e33412-8884-4cee-8c18-2ccb88453d44 | 7 | private static Configuration readArgs(final String[] args) throws IOException
{
Configuration config = null;
String url = null; // you can set the destination as -site
String file = null; // name of the properties file
for (int i = 0; i < args.length; i++)
{
... |
9437cc6b-03ae-4e3f-a2d9-912a9289e236 | 8 | @Override
public User getUserByID(String id) {
Connection conn = null;
PreparedStatement stmt = null;
User user = null;
ResultSet rs = null;
try {
conn = dataSource.getConnection();
stmt = conn.prepareStatement("SELECT USER_ID,USER_PASSWORD,USER_DATE F... |
025c72e1-5d52-4b18-ad35-87163d10e2b5 | 1 | public void actionPerformed(ActionEvent e) {
if (data.getPassedWordsIdList().size() < data.getWordList().size()) {
frame.getContentPane().removeAll();
frame.initComponents();
frame.repaint();
frame.revalidate();
}
else {
frame.getConten... |
60c8bf60-b2b0-4535-95e2-20f0b1faef2b | 6 | public Object getValueAt(int row, int col) {
Movement movement = rekening.getBusinessObjects().get(row);
if (col == 0) {
return movement.getTransactionString();
} else if (col == 1) {
return Utils.toString(movement.getDate());
} else if (col == 2) {
if... |
d1c8de14-ff03-4256-92e5-379bb82f19ea | 3 | public String getItemName(int itemSlot)
{
if(itemSlot > 5 || itemSlot < 0)
{
return null;
}
if(inv[itemSlot] == null)
return null;
return inv[itemSlot].getName();
} |
c703ef55-94d4-4391-845a-6421e0679970 | 1 | public PropertyManager(String filename) {
InputStream stream = PropertyManager.class.getClassLoader().getResourceAsStream(filename);
try {
PROPERTIES.load(stream);
} catch (IOException e) {
e.printStackTrace();
}
} |
17f92126-3a74-46d5-818d-8f149142b287 | 1 | @Override
public boolean recordDeath(Player player, String deathMsg, Location loc, String items, int exp) {
String data = deathMsg + "|" + Long.toString(System.currentTimeMillis()) + "|"
+ items + "|" + Integer.toString(exp) + "|" + loc.toString();
try {
ArrayList<String> l = (ArrayList<String>) this.co... |
4c3930fb-5ea9-496d-9fdf-97a7d4374c70 | 6 | @Override
public void paintComponent(Graphics g) {
super.paintComponent(g);
Graphics2D g2d = (Graphics2D)g;
int currentPass = 0;
int passesToComplete = 1;
for(Entity c : entities) {
if(c.renderPass < currentPass) {
currentPass = c.renderPass;
}
else if(c.renderPass > passesToComplete) {
pass... |
667254aa-01af-4b5d-bb25-89416ef6bfe3 | 0 | public Cliente(String nome, String endereco)
{
this.nome = nome ;
this.endereco = endereco ;
} |
3fc94136-89a3-4394-b8b3-64d460b04b55 | 0 | public static Forme T() {
ArrayList<Vecteur> liste = new ArrayList<>();
liste.add(new Vecteur(1, 0));
liste.add(new Vecteur(1, 1));
liste.add(new Vecteur(1, 2));
liste.add(new Vecteur(0, 1));
Vecteur<Integer> _centre = new Vecteur(1, 1);
return new Forme("T", lis... |
c6cc05f6-a2e2-45ac-9551-8efff0ef4c63 | 1 | public void visit_ixor(final Instruction inst) {
stackHeight -= 2;
if (stackHeight < minStackHeight) {
minStackHeight = stackHeight;
}
stackHeight += 1;
} |
8c6b3211-d8b9-4f8e-9b17-9dfa34ce6424 | 0 | protected void setResizable(boolean _resizable) {
this.isResizable = _resizable;
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.