method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
8ed1b8b1-7f40-43ec-bac7-bfbe3a0a6bc6 | 1 | @Override
protected TreeRow clone() {
try {
TreeRow other = (TreeRow) super.clone();
other.mParent = null;
other.mIndex = 0;
return other;
} catch (CloneNotSupportedException exception) {
return null; // Not possible
}
} |
aebe127b-a7ee-4640-9f27-77d8e1490801 | 2 | @Override
public void update(int delta) {
cube.move(SPEED*direction*delta,0, 0);
pos.add(SPEED*direction*delta,0, 0);
if(pos.x > 100){
pos.x = 100;
direction *= -1;
}
if(pos.x < -100){
pos.x = -100;
direction *= -1;
}
} |
917c6aaf-f770-419a-b60c-e0a5e71c4d28 | 6 | public static void stream_align(FlaggableCharacterString input_stream,
Vector<AlignmentTuple> alignments,
Vector<AlignmentTriplet> triplets) {
for (AlignmentTuple alignment : alignments) {
// copy strings
FlaggableCharacterString presented = alignment.getPresented();
FlaggableCharacterString trans... |
d1c3e644-6923-4c8d-b148-fbcc963a5aad | 3 | @Override
protected void UpdateProductPassingThrough()
{
List<Product> productsAtExit = new LinkedList();
for (NodeStartPoint entrancePoint : m_listNodeStartPoint)
{
for (Product product : entrancePoint.GetBallot().GetProduct())
{
if (Cont... |
7d718f7d-1467-4190-83c1-b703b3cb592e | 3 | public boolean HasItemAmount(int itemID, int itemAmount) {
int playerItemAmountCount = 0;
for (int i=0; i<playerItems.length; i++)
{
if (playerItems[i] == itemID+1)
{
playerItemAmountCount = playerItemsN[i];
}
if(playerItemAmountCount >= itemAmount){
... |
a3805fa4-5835-4de0-bbc3-31a1a2ea372c | 0 | public static void main(String[] args) {
ApplicationContext context = new ClassPathXmlApplicationContext(
"applicationContext.xml");
IMusicBox musicBox = (IMusicBox) context.getBean("musicBox");
musicBox.play();
} |
71ff3e82-24ca-4de3-9915-bad3699abe4d | 8 | public boolean isHigherOnActivitySeries(Element element)
{
if((this.isMetal() && !element.isMetal()) || (!this.isMetal() && element.isMetal()))
System.err.println("isHigherOnActivitySeries - One element is a metal and the other isn't!");
if(this.equals(element))
System.err.println("isHigherOnActivitySerie... |
44b1c967-b655-4ee2-93ea-2126bea47e8f | 7 | public void handle(HttpExchange exchange) throws IOException {
OutputStream responseBody = exchange.getResponseBody();
Headers responseHeaders = exchange.getResponseHeaders();
responseHeaders.set("Content-Type", "text/plain");
exchange.sendResponseHeaders(200, 0);
switch(exchang... |
7d30fd50-f1b9-46ed-a1c5-f9a8433f7a03 | 5 | TreeNode buildTreeWithPreorderAndInorder(int[] preorder, int[] inorder,
int startPreOrder, int endPreOrder, int startInOrder, int endInOrder) {
// if startPreOrder out of range of preorder
if (startPreOrder >= preorder.length)
return null;
TreeNode root = new TreeNode(preorder[startPreOrder]);
int indexR... |
1f7670d7-ca9e-49c5-8f6f-dbc693fe069c | 8 | private void printJoins(Vector<LogicalJoinNode> js, PlanCache pc,
HashMap<String, TableStats> stats,
HashMap<String, Double> selectivities) {
JFrame f = new JFrame("Join Plan for " + p.getQuery());
// Set the default close operation for the window,
// or else the progra... |
75530a39-cad4-4293-93cc-bb2152bc639e | 4 | @Override
public void deserialize(Buffer buf) {
super.deserialize(buf);
partyType = buf.readByte();
if (partyType < 0)
throw new RuntimeException("Forbidden value on partyType = " + partyType + ", it doesn't respect the following condition : partyType < 0");
maxParticipan... |
0cda879e-3dd8-4c32-905b-98fc5e5da885 | 2 | public static void drawCircle(Graphics g, int centerX, int centerY, int radius, Color color) {
g.setColor(color);
int x, y, d, dE, dSE;
x = 0;
y = radius;
d = 1 - radius;
dE = 3;
dSE = -2*radius+5;
simetry(g, x, y, centerX, centerY);
while (y > x) {
if (d < 0) {
d += dE;
dE += 2;
dSE... |
d98e8298-ca84-4736-ac78-56d3fbe2464e | 6 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
IdentNode other = (IdentNode) obj;
if (identName == null) {
if (other.ide... |
767883a4-c7df-44a2-8670-54fb81060969 | 4 | public void ge_or_logical(TextArea area,SimpleNode node,String prefix,int cur_end_num,int if_or_while)throws SemanticErr{
int or_num = node.jjtGetNumChildren();
SimpleNode left = (SimpleNode)node.jjtGetChild(0);
if(or_num==1)or_last=2;
else or_last=-1;
ge_and_logical(area,left,pr... |
83ec3bac-8a75-4c23-9b5a-6bf6dbe271a4 | 9 | @Override
public int castingQuality(MOB mob, Physical target)
{
if(mob!=null)
{
if(target instanceof MOB)
{
final Room R=((MOB)target).location();
boolean found=false;
if(R!=null)
for(int r=0;r<R.numInhabitants();r++)
{
final MOB M=R.fetchInhabitant(r);
if((M!=null)&&(M!=mo... |
17a76cca-8620-47ad-9f26-cb107c78e8bf | 0 | public static String getStringValue(String attr) {
return prop.getProperty(attr);
} |
603460a6-f11d-4fda-9dce-4b5fdd8227d4 | 1 | public String getStatusFrequencyOverPartOfDay() {
Map<String, Integer> map = analytic.getStatusFrequencyOverPartOfDay();
StringBuilder sb = new StringBuilder();
List<Entry<String, Integer>> entries = new ArrayList<Entry<String, Integer>>(map.entrySet());
Collections.sort(entries, new Comparator<Entry<String,... |
885fed9a-2f20-4f15-bf06-10f5738e2bf0 | 7 | double funct(double x[]) {
//RefreshDataHandles();
for (int j = 0; j < parameters.length; j++) {
try {
parameters[j] = x[j];
} catch (Exception e) {
throw new RuntimeException("Error! Parameter No. " + j + " wasn^t found" + e.toString());
... |
8ebc6dc4-202a-4264-90c8-a8fcc6cbb35d | 9 | protected boolean isPrimitiveValue(Object value)
{
return value instanceof String || value instanceof Boolean
|| value instanceof Character || value instanceof Byte
|| value instanceof Short || value instanceof Integer
|| value instanceof Long || value instanceof Float
|| value instanceof Double || v... |
59b067fd-ec75-487a-9b60-2987e9ca3c4b | 0 | public String getPackageName() {
return this.packageName;
} |
99f1c171-074e-4e38-8783-555d6601e9c6 | 3 | public Document getDocument(String filePath){
DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();
Document document = null;
try{
//DOM parse instance
DocumentBuilder builder = builderFactory.newDocumentBuilder();
//parse an XML file into a DOM tree
document = builder.parse(... |
a710a1eb-156e-4f0f-b6b8-09f3f4b531e3 | 0 | public Integer getTopDiskNo() {
return maxDisks - (disks.peek() - 1);
} |
7c06e9c2-a0d3-4204-93d9-9e3b56344d52 | 4 | @Override
public void close() {
if (readMonitor != stdin) {
try {
in.close();
} catch (IOException e) {
System.err.printf("Cannot close console input. %s: %s%n", getClass(), e.getMessage());
}
}
if (out != stdout) {
try {
out.close();
} catch (IOException e) {
System.err.printf("Ca... |
56de8d76-9cd1-4cb8-ac31-5d49a9a7bbfd | 7 | public void calculateStateSpace() {
/* Initialization */
PetriNet _net = petriNet;
//State _intialState=new State(_net.getState(), 0, null);
Trie _stateSpace = new Trie();
State _currentState;
State firstState;
firstState = new State(_net.getState(), 0, null, _ne... |
bda9ddff-46c0-4c41-b415-26dd5afb5c33 | 4 | private Boolean checkLookAndFeel(String name)
{
try {
UIManager.setLookAndFeel(name);
return true;
} catch (ClassNotFoundException ex) {
Logger.getLogger(Window.class.getName()).log(Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
... |
bdb81076-d7b6-420f-bee3-0e6b3d457c11 | 3 | private void waitForThread() {
if ((this.thread != null) && this.thread.isAlive()) {
try {
this.thread.join();
} catch (final InterruptedException e) {
e.printStackTrace();
}
}
} |
8f618e25-f132-4baa-b658-ecc845dfbfb9 | 4 | public ArrayList<Usuarios> getByNombre(Usuarios u){
PreparedStatement ps;
ArrayList<Usuarios> usuarios = new ArrayList<>();
try {
ps = mycon.prepareStatement("SELECT * FROM Usuarios WHERE nombre LIKE ?");
ps.setString(1, "%"+u.getNombre()+"%");
ResultSet rs = ... |
52af60e4-1082-49bc-aac3-aadb8adeda08 | 2 | private void newSolve(ArrayList<Solve> population, int ind1, int ind2) {
Random rand = new Random();
Solve a = population.get(ind1);
Solve b = population.get(ind2);
Solve c = new Solve();
Solve d = new Solve();
int j = rand.nextInt(chromosomesize);
for (int i = 0;... |
23c2864e-f394-4554-942f-666437ed2e26 | 1 | @Override
public boolean isObstacle(Element e) {
if (e instanceof PowerFailure)
return false;
return true;
} |
17403512-e3bf-4384-a2e5-d80f060a18eb | 9 | private boolean isMatch(final char current, final Element element) {
boolean rv = false;
if (element.isSpecial) {
switch(element.item) {
case '.':
rv = true;
break;
case 'd':
rv = Character.isDigit(current);
break;
case 'D':
rv = !Character.isDigit(current);
break;
... |
510313d2-a36f-4c29-8eae-f3129141618f | 5 | @SuppressWarnings({ "unchecked", "static-access" })
public static void readXml() {
try {
SAXReader saxReader = new SAXReader();
File file = new File(xml);
if (file.exists()) {
Document doc = saxReader.read(file);
Element rootEle = doc.getRootElement();
List<Element> list = (List<Element>) rootEl... |
5615102f-9887-40ea-bef2-d717dbfe1fca | 6 | public ClassGeneratorUtil(Modifiers classModifiers, String className, String packageName, Class superClass, Class[] interfaces, Variable[] vars, DelayedEvalBshMethod[] bshmethods, NameSpace classStaticNameSpace, boolean isInterface) {
this.classModifiers = classModifiers;
this.className = className;
if (packageNa... |
5797554b-f566-4028-b79b-63f3b6ebe4c5 | 1 | public Boolean update(String query) {
if(autoCommit){
return updateIntern(query, false);
}
this.queries += query+="\n";
return null;
} |
fa5103cf-2f96-4b86-88f3-00bf4749c4de | 8 | private void quaff()
{
Grid<GridActor> gr = getGrid();
Location loc = getLocation(); // stores the current location of player
Location next = loc.getAdjacentLocation(0); // it chooses up by default
if(Greenfoot.isKeyDown("right") || Greenfoot.isKeyDown("l")) // player choos... |
60bd7a31-1b8f-43d6-98f6-baaf7485728b | 3 | public Tree andExpressionPro(){
Tree firstConditionalExpression = null, secondConditionalExpression = null;
Symbol operator = null;
if((firstConditionalExpression = equalityExpressionPro()) != null){
if((operator = accept(Symbol.Id.PUNCTUATORS,"&&")) != null){
if((secondConditionalExpression = andExpres... |
fb1b36f8-64d1-44e2-8df0-7a2e66825af1 | 9 | private boolean canProceed() throws SSLException {
while (true) {
switch (mEngine.getHandshakeStatus()) {
case NEED_TASK:
runSSLTasks();
break;
case NEED_UNWRAP:
switch (mEngine.unwrap(mInboundData, mAppData).getStatus()) {
case BUFFER_OVERFLOW:
resizeAppDataBuffer();
bre... |
d5cbd811-8bc9-4e94-876b-c361e69fa25c | 0 | public int getCapacity() {
return buf.length;
} |
f5684a02-3eab-4b17-b980-7b224b199a4f | 5 | private boolean isRepairMats(ItemStack i) {
if(i.getData().getItemType().equals(Material.WOOD))
return true;
if(i.getData().getItemType().equals(Material.STONE))
return true;
if(i.getData().getItemType().equals(Material.IRON_INGOT))
return true;
if(i.g... |
3a4ffc4a-fb7a-4bf6-9880-34f91eeaa43a | 7 | public static void main(String[] args) {
if (System.console() == null) {
System.err.println("Error: Not connected to compatible console");
System.exit(1);
}
File rc = new File(System.getProperty("user.home"), ".acmbotrc");
boolean firstTime = !rc.exists();
SmartBot bot = new SmartBot(rc.getAbsolutePath(... |
faf1841c-4f65-4157-8745-91bf04bfb2cc | 9 | private boolean containsPrefixHelper(String s, int indexLow, int indexMid, int indexHigh){
if(LexiconArrayList.get(indexLow).startsWith(s) || LexiconArrayList.get(indexMid).startsWith(s) || LexiconArrayList.get(indexHigh).startsWith(s)){
return true;
}else if(s.compareTo(LexiconArrayList.get(indexLow)) < 0 || s.... |
9a9fc44f-1005-4387-bcd0-f5a879387f4a | 9 | @SuppressWarnings("unchecked")
WeekView(JFrame parent){
first = false;
// Sets look to that of the OS
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
}
catch (ClassNotFoundException e) {
}
catch (InstantiationException e) {
}
catch (IllegalAccessException e) {
}
c... |
2ea14a29-1493-48da-a741-7fdafa339cd0 | 2 | @EventHandler(priority = EventPriority.NORMAL)
public void onEntityChangeBlock(EntityChangeBlockEvent event) {
if (event.isCancelled())
return;
// plugin.debug(event.getEventName());
Block block = event.getBlock();
if (plugin.isProtected(block)) {
event.setCancelled(true);
plugin.debug("Blocking enty... |
ed7aa88c-2ffb-4f2c-9a24-77e2e4af66d3 | 7 | public void comen2(char []codigo){
int let=0;
//Para eliminar el comentario /*
while(let<codigo.length-1){
if(codigo[let]=='/' && codigo[let+1]=='*'){
codigo[let] = ' ';
codigo[let+1] = ' ';
let++;
let++;
... |
21deb0fb-96ba-4d23-8cc8-965f6324beb6 | 7 | private InfoDetail firstGranateForMe (InfoDetail me, List<InfoDetail> granates){
if(granates.isEmpty()){
return null;
}
InfoDetail granat=null;
for(int i=0; i<granates.size(); i++){
if(isForMe(me, granates.get(i))){
granat=granates.get(i);
... |
cba07b98-ec04-40b5-b165-0a723839c2e9 | 0 | public static void question8() {
/*
QUESTION PANEL SETUP
*/
questionLabel.setText("Which of these words best describe you?");
questionNumberLabel.setText("8");
/*
ANSWERS PANEL SETUP
*/
//resetting
radioButton1.setSelected(false);
r... |
dd349b8c-3595-4141-af93-000fd88679bb | 8 | public int getTexture(String par1Str)
{
TexturePackBase var2 = this.texturePack.selectedTexturePack;
Integer var3 = (Integer)this.textureMap.get(par1Str);
if (var3 != null)
{
return var3.intValue();
}
else
{
try
{
... |
9233298c-29fa-4302-bd10-e56bed0451ad | 4 | public String GrepUniqueID(String searchLink){
/*
* Gets the unique file ID (used to generate a .torrent location)
* This method also take server load/latency into account
*/
int searchLinkStart = 0;
int searchLinkEnd = 0;
int attempts = 0;
String uniqueID = "0000000000000000"; //loop atleast once.
... |
b9262f50-f133-4044-a4d2-26ed1da64d1d | 3 | private static Long getMaxColumnProduct(int numbers) {
int max = Integer.MIN_VALUE;
for (int c = 0; c < DATA[0].length; c++) {
for (int r = 0; r + numbers < DATA.length; r++) {
int sum = 1;
for (int offset = 0; offset < numbers; offset++) {
... |
04124512-12af-43ee-90e1-a4acb7ef4ce6 | 9 | @Override
public void run() {
int size = 1024;
GZIPOutputStream gzipOutputStream = null;
try {
gzipOutputStream = new GZIPOutputStream(this.output, size);
} catch (IOException e1) {
System.err.println("\t\t\tFileCompress:IOException occurred while instantiating the GZIPOutputStream.");
this.finished =... |
bf65d76a-195f-44ac-8d33-67204394c531 | 0 | public AutomatonPane getView(){
return myView;
} |
f36c0ae4-c1a5-415a-868d-b3ec351d2c40 | 0 | public SintomaFacade() {
super(Sintoma.class);
} |
c5228501-736d-4103-afd3-55ff14c054bd | 1 | public boolean equals(Vector2f r)
{
return m_x == r.GetX() && m_y == r.GetY();
} |
fcdd155a-997a-423d-a3df-85b8c76658fc | 5 | public String getInsertStatement(String book, int chapter) throws ParseException, IOException {
// String strBook = String.format("B%02d", book);
// String strChapter = String.format("C%03d", chapter);
// String strHtml = getOneChapterHtmlSource(ver, getBook/home/mark/bible/checking/bgpda/hb_1_0Cha... |
441913ce-ea02-47d6-a2d2-0292f2dfc28f | 7 | private void processAuctionEvent(AuctionEvent event) {
if (event.getType().equals(AuctionEvent.AUCTION_STARTED)) {
auctionList.add(event);
}
if (event.getType().equals(AuctionEvent.AUCTION_ENDED)) {
// AVG- Duration
if (avgAuctionDurationTimeEvent == null) {
Timestamp currentTimestamp = new Timesta... |
4c3a15ed-2e36-4f68-8343-2aaf3f6975e2 | 5 | public void startRippingSelected() {
if(getTabel().isTHSelected()) {
Stream[] streamsToRecord = table.getSelectedStream();
for( int i=0 ; i <streamsToRecord.length; i++) {
if (streamsToRecord[i] == null) {
JOptionPane.showInputDialog(trans.getString("exeError"));
} else {
if(!streamsToReco... |
eb4348e4-b838-4d6e-855e-ad5d91ad8225 | 5 | @Override
public String getTableName(String fileName) {
String line = "";
log.info("Start to read table name in "+fileName+"... ...");
//GET Table Name
try {
FileReader fr = new FileReader(new File(artificialFolderPath+"/"+fileName));
BufferedReader br = new BufferedReader(fr);
//#后为TableName
while ... |
e90091c4-3167-4678-89de-78b5b1bdd476 | 1 | @Override
public void actionPerformed(ActionEvent e) {
JButton reduire = (JButton) e.getSource();
System.out.println("Reduire vitesse");
new Thread(new Runnable() {
public void run() {
try { Main.service.diminuerVitesse(bus); }
catch (IOException e) { e.printStackTrace(); }
}
}).start();
} |
582d57b2-f68b-4522-8458-110a714edf19 | 3 | @Override
public void open() throws AudioException {
super.open();
DataLine.Info info = new DataLine.Info(
this.mTargetDataLineClass,
this.mAudioFormat
);
try {
if ( !this.mMixer.isOpen() ) {
this.mMixer.open();
this.mOpenedMixer = true;
}
this.mTargetDataLine = (TargetDataLine) this.m... |
fda96d90-d346-4920-82f2-14cafd52c328 | 5 | public void tick(Graphics2D g) {
for (Tank tank : GameState.getInstance().getPlayers()) {
if (tank.getNick() == null)
tank.setNick("Player");
}
if (inputReal.menu.clicked) {
inputReal.menu.clicked = false;
inputReal.releaseAll();
if (!menuTitle.isVisible()) {
menuTitle.setVisible(true);
m... |
b1965abf-1f3a-456e-bb38-181a1990caa2 | 0 | public static void main(String[] args) {
List<Integer> arrayList = new ArrayList<Integer>();
arrayList.add(10);
arrayList.add(3);
arrayList.add(7);
arrayList.add(5);
System.out.println("arrayList: " + arrayList);
List<Integer> linkedList = new LinkedList<Integer>(... |
388302c4-b95b-4d17-8814-a86a4ad30c73 | 8 | private static String initialise(Token currentToken,
int[][] expectedTokenSequences,
String[] tokenImage) {
String eol = System.getProperty("line.separator", "\n");
StringBuffer expected = new StringBuffer();
int maxSize = 0;
for (int i = 0; i < expe... |
2133dfd0-9a98-4d3b-b579-7a9911933318 | 1 | public static Connection getConnection() throws SQLServerException {
if (m_connection == null) // first time
{
SQLServerDataSource ds = new SQLServerDataSource();
ds.setApplicationName("jdbc:sqlserver://");
//ds.setServerName("10.211.55.8");
ds.setServerN... |
4fd00dd4-bd02-4aa8-b57a-f86e2aa07146 | 7 | final void A(int i, aa var_aa, int i_145_, int i_146_) {
aa_Sub3 var_aa_Sub3 = (aa_Sub3) var_aa;
int[] is = ((aa_Sub3) var_aa_Sub3).anIntArray5201;
int[] is_147_ = ((aa_Sub3) var_aa_Sub3).anIntArray5202;
int i_148_;
if (((SoftwareToolkit) this).height < i_146_ + is.length)
i_148_ = ((SoftwareToolkit) this).he... |
a8e7d814-f19f-4143-9f81-d4d71b10a278 | 8 | final public void Address() throws ParseException {
/*@bgen(jjtree) Address */
ASTAddress jjtn000 = new ASTAddress(JJTADDRESS);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
try {
AddExp();
jj_consume_token(AT);
Domain();
} catch (Throwable jjte000) {
if (jjtc000) {
... |
e0d2d1f5-6083-4578-805f-ab84714d4a1a | 1 | private PropertiesLoader(String propertiesFilePath) throws IOException {
properties = new Properties();
try(FileInputStream file = new FileInputStream(propertiesFilePath)) {
properties.load(file);
} catch (IOException e) {
String errMsg = String.format("Properties file i... |
054c9ae5-8ad3-4b9e-b42d-5bdcbfe8fe54 | 6 | public static void fillItemArr(double itemArray[][], int itemNumber[], boolean bError, Scanner scan){
for(int i=0; i<4; i++){
bError = true;
System.out.print("Insert cost of item " + itemNumber[i] + " ($): ");
while(bError){
if(scan.hasNextDouble()){
itemArray[0][i] = scan.nextDouble();
}
el... |
d14c68c4-d626-44f3-a639-097d7ad0f57a | 3 | public boolean equalsExpr(final Expr other) {
return (other != null) && (other instanceof InstanceOfExpr)
&& ((InstanceOfExpr) other).checkType.equals(checkType)
&& ((InstanceOfExpr) other).expr.equalsExpr(expr);
} |
7c728669-ef84-4131-b0b0-701ed11bd9a2 | 2 | public static String diffStr(String s1, String s2) {
// Create a string indicating differences
int minLen = Math.min(s1.length(), s2.length());
char diff[] = new char[minLen];
for (int j = 0; j < minLen; j++) {
if (s1.charAt(j) != s2.charAt(j)) {
diff[j] = '|';
} else diff[j] = ' ';
}
return new ... |
e6bf668c-1bf8-4131-ae01-32b73dfb402f | 3 | public void BacaCSVAll(String filePath) throws FileNotFoundException, IOException{
File theFile = new File(filePath);
FileReader readerFile = new FileReader(theFile);
BufferedReader bufReadFile = new BufferedReader(readerFile);
String readByte;
int pencacah = 0... |
87060742-01a2-4ee4-bfc6-9d3c94c9f648 | 0 | public The5zigModUser getUser() {
return user;
} |
e7a29628-1128-469b-9206-dff3e86f3aca | 8 | private final byte[] method2371() {
int i = 0;
for (int i_2_ = 0; i_2_ < 10; i_2_++) {
if (aClass80Array3969[i_2_] != null
&& (((Class80) aClass80Array3969[i_2_]).anInt1421
+ ((Class80) aClass80Array3969[i_2_]).anInt1407) > i)
i = (((Class80) aClass80Array3969[i_2_]).anInt1421
+ ((Class80) aClas... |
18c48c17-2f81-48cb-a03e-a5613c1702d6 | 0 | public void setLieu(String lieu) {
this.lieu = lieu;
} |
52518887-e975-4f54-af33-60844bcb30e3 | 9 | private static Result toResult(Object xml) throws IOException {
if (xml == null)
throw new IllegalArgumentException("no XML is given");
if (xml instanceof String) {
try {
xml = new URI((String) xml);
} catch (URISyntaxException e) {
xm... |
a811704c-964f-4f36-9623-253377d2bdc9 | 5 | private void addAllAttributes(String shaderText) {
final String ATTRIBUTE_KEYWORD = "attribute";
int attributeStartLocation = shaderText.indexOf(ATTRIBUTE_KEYWORD);
int attribNumber = 0;
while (attributeStartLocation != -1) {
if (!(attributeStartLocation != 0
... |
5da9a3a9-2d6b-4da7-9c71-db590d78da34 | 9 | @SuppressWarnings("unchecked")
private Collection<KnowledgePackage> downloadFromGuvnor(String packageId, String version) throws IOException, ClassNotFoundException{
UrlResource res=(UrlResource)ResourceFactory.newUrlResource(new URL(basePath+packageId+"/"+version));
if (enableBasicAuthentication){
res.s... |
462d3f80-8856-4195-961d-fd6dc3c83c75 | 8 | @Override
public boolean consumeFuel(int amount)
{
final List<Item> fuel=getFuel();
boolean didSomething =false;
for(final Item I : fuel)
{
if((I instanceof RawMaterial)
&&(!I.amDestroyed())
&&CMParms.contains(this.getConsumedFuelTypes(), ((RawMaterial)I).material()))
{
amount-=CMLib.materials... |
5b3a1392-9abe-4500-a471-8d8e40132b67 | 5 | private boolean isExcluded(String name) {
return name.startsWith(ClassMetaobject.methodPrefix)
|| name.equals(classobjectAccessor)
|| name.equals(metaobjectSetter)
|| name.equals(metaobjectGetter)
|| name.startsWith(readPrefix)
|| name.startsWith(write... |
db0d6ef2-f198-45db-85b7-10eafa4682a2 | 9 | private boolean r_Step_4() {
int among_var;
int v_1;
// (, line 140
// [, line 141
ket = cursor;
// substring, line 141
among_var = find_among_b(a_7, 18);
if (among_var == 0)
... |
3520a565-38a8-4661-86bb-3ab260fdd125 | 1 | public static void main(String[] args) {
try {
TextComponent text = (TextComponent) new BookReader().read("text.txt");
System.out.println(new ComponentConverter().componentToString(text));
System.out.print("Sentencis with the same words: ");
System.out.println(new SameWordsFinder(text).getSentenceCount())... |
e4a429fa-14c5-43be-b839-3ad532a163ad | 7 | public int countGenerators(String[] fragment, int W, int i0, int j0){
int n = fragment.length;
int m = fragment[0].length();
int result=0;
for(int l=1; l<=W; l++){
char[] string = new char[l];
boolean valid = true;
int filledCount = 0;
for(... |
071af8a3-08b6-4f06-899b-b30e22422418 | 2 | protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setCharacterEncoding("UTF-8");
request.setCharacterEncoding("UTF-8");
String msj_error = "Error al exportar consulta";
HttpSession ... |
922b9ee8-c6d1-4088-8a91-150cc9bb973e | 9 | private int fillbuf() throws IOException {
if (markpos == -1 || (pos - markpos >= marklimit)) {
/* Mark position not set or exceeded readlimit */
int result = in.read(buf);
if (result > 0) {
markpos = -1;
pos = 0;
count = result... |
dbec7c4c-fe28-4d5a-a87d-06fc8bfe8f66 | 0 | public Point getInitialResizePoint() {
return initialResizePoint;
} |
49b922f4-1159-4bde-80e9-0f26a6259874 | 8 | private String getMimeType(String request) {
if(request.endsWith(".html") || request.endsWith(".htm"))
return "text/html";
else if(request.endsWith(".css"))
return "text/css";
else if(request.endsWith(".js"))
return "text/javascript";
else if(request.endsWith(".jpg") || request.endsWith("... |
41495a7a-1b5c-4d79-8178-2abe4d1c61ad | 5 | private void pop(char c) throws JSONException {
if (this.top <= 0) {
throw new JSONException("Nesting error.");
}
char m = this.stack[this.top - 1] == null ? 'a' : 'k';
if (m != c) {
throw new JSONException("Nesting error.");
}
this.top -= 1;
... |
b5520b65-a2d6-4f6b-8bae-aae8bf1d9714 | 2 | public static int sum(List<? extends Number> numbers){
int sum = 0;
for(Number number: numbers){
sum += number.doubleValue();
}
return sum;
} |
8869bc9a-e790-4e0f-b1b0-d86f2e29313e | 5 | public String getFlagStr(){
if (this.getFlag()==1) return "SYN";
if (this.getFlag()==2) return "FIN";
if (this.getFlag()==3) return "PSH";
if (this.getFlag()==4) return "ACK";
if (this.getFlag()==5) return "SYN_ACK";
return "";
} |
e240c364-ed7c-4541-b44d-eb8f60997123 | 5 | @Override
public void run() {
if(inputFile.length() < inputSize/BYTESIZE) {
System.out.println("Input too short, check inputfile");
return;
}
byte[] bytesRead = getBytesFromFile();
BitString input = byteArrayToBitSet(bytesRead);
if (mode.equals(Driver.EVAL_FAIRPLAY_IA32)) {
input = input.getIA32Bi... |
8035c9f4-8d65-40e2-8903-2c52bed09a2e | 5 | private boolean moveable(int destx, int desty) {
if (destx<0||desty<0) {return false;}
if (destx>=Game.map.width||desty>=Game.map.height) {return false;}
if (Pathed(destx,desty)) {return true;}
return false;
} |
2bded864-e928-4ffa-b4ea-a9a4cd26d156 | 4 | public void deleteCustomer(int id) {
Connection con = null;
Statement stmt = null;
try {
DBconnection dbCon = new DBconnection();
Class.forName(dbCon.getJDBC_DRIVER());
con = DriverManager.getConnection(dbCon.getDATABASE_URL(),
dbCon.getDB... |
176fc95e-9dcd-4a4e-9c42-c10cbe8f6b5c | 0 | public String toString(String input) {
return _base+"^("+input+")";
} |
04d28db2-3089-41fe-a7c7-aad28df5d1c0 | 4 | public static String deleteWhitespace(String str)
{
if (isEmpty(str))
{
return str;
}
int sz = str.length();
char[] chs = new char[sz];
int count = 0;
for (int i = 0; i < sz; i++)
{
if (!Character.isWhitespace(str.charAt(i)))
... |
b7e58776-0249-499b-9b3b-eca85ab1f381 | 0 | public void testLigne(int lig, int col, String nom) {// a renommer en
// lecture
System.out.println("lig: " + lig + " col:" + col + " nom: " + nom);
setChanged();
notifyObservers();
} |
6c463601-ea07-4489-be39-71146197be0a | 0 | public static void main(String[] args) {
DeleteAll de = new DeleteAll();
de.delAll1(new File("D:/aaa"));
// de.delAll( "D:/aaa/sdagsda");
} |
703c8b19-c5bd-4ebd-96cd-7e691ecafc66 | 1 | @Override
public void notifyObservers() {
ModelChangedEventArgs args = new ModelChangedEventArgs(
this.getChildren());
for (IObserver observer : this.observers) {
observer.updateObserver(args);
}
} |
13ef1c5a-5d9c-42dc-9078-40255d267a5f | 8 | public static int evaluate(String [] expr) {
LinkedList<String> stack = new LinkedList<>();
String operators = "+-*/";
for(String symbol : expr ) {
if(!operators.contains(symbol)) {
stack.push(symbol);
} else {
if(stack.size() >=2) {
... |
f7eaea0f-9e40-4f8f-8ce4-45ae52773988 | 5 | @Override
public void run()
{
String input;
StringTokenizer idata;
int i, j;
int counter = 0;
input = Main.ReadLn(255);
while ((input != null) && !input.equals(""))
{
idata = new StringTokenizer(input);
i = Integer.parseInt(idata.n... |
b3d0f579-010e-4637-9359-64ce4f8af10e | 3 | public void toggleRowOpenState() {
boolean first = true;
boolean open = true;
for (int i = 0; i < mRows.size(); i++) {
Row row = getRowAtIndex(i);
if (row.canHaveChildren()) {
if (first) {
open = !row.isOpen();
first = false;
}
row.setOpen(open);
}
}
} |
981ff82a-5a1a-4cd2-a924-4ac1015c0032 | 4 | public JSONWriter key(String string) throws JSONException {
if (string == null) {
throw new JSONException("Null key.");
}
if (this.mode == 'k') {
try {
this.stack[this.top - 1].putOnce(string, Boolean.TRUE);
if (this.comma) {
... |
817a52ed-d624-44cc-abf8-9b3a9bf7fcf7 | 1 | public void updateUniforms(Matrix4f worldMatrix, Matrix4f projectedMatrix, Material material)
{
if(material.getTexture() != null)
material.getTexture().bind();
else
RenderUtil.unbindTextures();
setUniform("transform", projectedMatrix);
setUniform("color", material.getColor());
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.