method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
6cd060f1-80f5-40c9-8d16-5a9b42948169 | 3 | public AnnotationVisitor visitAnnotation(
final String name,
final String desc)
{
if (values == null) {
values = new ArrayList(this.desc != null ? 2 : 1);
}
if (this.desc != null) {
values.add(name);
}
AnnotationNode annotation = new An... |
c5524b52-2b67-4aff-8728-5488c3b0d153 | 9 | private void CreateListeners() {
addMouseListener(
new MouseListener(){
public void mouseClicked(MouseEvent e){}
public void mouseEntered(MouseEvent e){}
public void mouseExited(MouseEvent e){}
public void mousePressed(MouseEvent e){
if (seeTrainPoints){
if (displayImage != null){
... |
992ffc46-76db-4991-841a-9121d0afbd78 | 6 | public int compareTo(Date date) {
if (this._y == date.getYear()) {
if (this._m == date.getMonth()) {
if (this._d == date.getDay()) {
return 0; // =
}
else if (this._d > date.getDay()) {
return 1; // >
... |
125981a7-c82b-4e19-82e0-ab17acc1fd67 | 9 | public String toString(){
int i;
String tmp = "";
tmp += this.clr==ChessBoard.RED?"RED":"BLUE";
switch(this.direction){
case Chessline.LEFT:
for(i=this.chess_num-1;i>=0;i--){
tmp+="("+(this.start_x-i)+","+this.start_y+")";
}
break;
case Chessline.DOWN:
for(i=this.chess_num-1;i>=0;i--)
... |
5e9d3339-16e7-42c7-95d7-cd1af576abce | 2 | @Override
public void onEnable(){
spawn = LocationParser.stringToLoc(PKSQLd.getUnparsedData("MAPSPAWN"));
new Damage(this);
new FireProjectile(this);
new Interaction(this);
new InventoryCancel(this);
new MapElementInteractions(this);
new PlayerSpawn(this);
CommandManager.loadAllCommands();
if(!Config... |
7c4ac234-4b2d-49cb-8871-26d87296bb00 | 6 | @SuppressWarnings("rawtypes")
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
AbstractEntity other = ... |
14c372b8-8ec9-4043-ac99-89f570c43491 | 8 | public String getHtml(WikiContext context) throws ChildContainerException {
try {
if (context.getAction().equals("confirm")) {
mPath = context.getPath();
mContainerPrefix = context.getString("container_prefix", null);
if (mContainerPrefix == null) {
... |
43784f95-88e4-4f45-a9fc-6d7541aaeacd | 6 | final Interface8 method3733(int i, int i_14_, int i_15_, byte[] is,
boolean bool) {
try {
anInt7565++;
if (i_14_ >= -2)
method3644();
if (aBoolean7873 && (!bool || aBoolean7869))
return new Class135_Sub2(this, i, is, i_15_, bool);
return new Class119_Sub2(this, i, is, i_15_);
} catch (Runt... |
611ab16e-9098-46d7-a24b-6a4c6929c806 | 6 | public static int[][] lenghtLCS(char[] x, char[] y){
// TODO Auto-generated method stub
int m = x.length;
int n = y.length;
int[][] c = new int[m + 1][n + 1];//保存LCS(Xi,Yj)的长度
for(int i=0; i<m; i++){
for(int j=0; j<n; j++){
if(x[i] == y[j]){
c[i + 1][j + 1] = c[i][j] + 1;
}else{
if(c[... |
dccfcde5-e18a-4b08-bb9b-f88183e688c3 | 2 | protected void assinarGravar() throws IOException, KeyStoreException{
int index = gCrlv.getTableGerenciarCrlvs().getSelectionModel().getLeadSelectionIndex();
if(index > -1){
XStream xstream = new XStream();
ModelCRLV c = gCrlv.getCrlv().get(index);
String xml = xstrea... |
2c2d8b32-a71f-4a96-91de-727c70557be0 | 0 | public void clearAll() {
undoStack.clear();
redoStack.clear();
} |
bb54b963-5309-4692-be3f-ee34e339b995 | 6 | static int fseek(InputStream fis, long off, int whence) {
if (fis instanceof SeekableInputStream) {
SeekableInputStream sis = (SeekableInputStream) fis;
try {
if (whence == SEEK_SET) {
sis.seek(off);
} else if (whence == SEEK_END) {
... |
068d60cf-9ea7-4623-a54a-69769aaf5b88 | 3 | public void mainMenu() {
System.out.println("Do you want to save a profile or start a test? SaP = Save StT = Start");
String choice = "";
try {
choice = cache.readLine();
} catch (IOException ex) {
System.out.println(ex.getMessage());
System.exit(-1);
... |
f98dd2a1-3516-4b91-b439-5618adeaf776 | 0 | public listByMonth()
{
this.requireLogin = true;
this.info = "list all appointments in a given month";
this.addParamConstraint("timestamp", ParamCons.INTEGER);
} |
fd14f536-e9bf-4cae-bcd3-da9d4a2a0da4 | 1 | public static void decode(String inputImagePath, String outputFilePath) {
//foto ophalen van disk
BufferedImage selectedImage = getImage(inputImagePath);
//kopie maken van geselecteerde foto zodat de foto aangepast kan worden in Java (userspace)
BufferedImage img = cloneImage(selectedIm... |
d95f5912-783b-48f9-a9e9-34665cc129eb | 4 | void getDirection(Position dir)
{
dir.x = dir.y = 0;
switch (this)
{
case LEFT:
dir.x = -1;
break;
case RIGHT:
dir.x = 1;
break;
case UP:
dir.y = -1;
break;
case DOWN:
dir.y = ... |
f2fd0aff-2e5d-4d0f-ab53-638bc2f5bdc4 | 6 | public void move(Point startMove, Point endMove, int canvasWidth, int canvasHeight)
{
if(((x1 + endMove.getX()-startMove.getX()) >= 0)
&& ((y1 + endMove.getY()-startMove.getY()) >= 0)
&& ((x2 + endMove.getX()-startMove.getX()) < canvasWidth)
&& ((y2 + endMove.getY()-startMove.getY()) < canvasHeight))
... |
9501a1f3-16ee-4a7c-9183-01ee21afda47 | 0 | public void restoreAttempts(){ ReconnectAttempts = 3; } |
17e9c24e-004e-4c75-b38a-77ba615ffbcc | 6 | public void paint(Graphics g) {
super.paint(g);
//Make the square objects
DrawSquareWithColour redSquare = new DrawSquareWithColour();
DrawSquareWithColour blueSquare = new DrawSquareWithColour();
DrawSquareWithColour greenSquare = new DrawSquareWithColour();
DrawSquareWithColour yellowSquare... |
9411146a-b579-44c1-9d8a-012ba70fb31e | 8 | @Override
int transition(int absState, int position, int vector) {
// null absState should never be passed in
assert absState != -1;
// decode absState -> state, offset
int state = absState/(w+1);
int offset = absState%(w+1);
assert offset >= 0;
if (position == w) {
if (sta... |
e01cdf43-c5a1-47e7-83fd-045bcdfaf2a4 | 4 | public String getUrlFormat(String wikiName) {
String url = this.wikis.get(wikiName);
if (url == null) {
return null;
}
else if (!(url.startsWith("http://") || url.startsWith("https://"))) {
return this.getUrlFormat(url);
}
else {
if (url.contains("%%SEARCHTERMS%%")) {
return url;
}
... |
ce5fadd1-a89f-4775-b552-998c408b29cf | 5 | private void btnSearchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSearchActionPerformed
String searchNum = txtSearchPartNo.getText();
if (searchNum != null && searchNum.length() > 0) {
for (int i = 0; i < this.partNums.length; i++) {
if (searchNum.eq... |
22374b16-d871-4ba9-af77-5638a1b6e172 | 2 | @Override
public List<LinkDirectionCity> load(Criteria criteria, GenericLoadQuery loadGeneric, Connection conn) throws DaoQueryException {
int pageSize = 10;
List paramList = new ArrayList<>();
StringBuilder sb = new StringBuilder(WHERE);
String queryStr = new QueryMapper() {
... |
6a7b85a9-4f05-472f-aa3d-031eb993a2de | 0 | protected void initDefaultCommand() {} |
d798ee82-8f6b-41a9-87ed-32254eb6d547 | 7 | public void plot(int x, int y, int val, boolean isMonochrome, boolean intensifyRed, boolean intensifyGreen, boolean intensifyBlue) {
if (isMonochrome) {
pix[y * SCREEN_WIDTH + x] = PPUConstants.NES_PALETTE[(val & 0x30)].getRGB();
} else if (intensifyRed || intensifyGreen || intensifyBlue) {
... |
09e01912-bc5c-47a4-afd0-bac684d86512 | 4 | private Object iceMethodCall(String methodName, Object[] args) {
// Figure the Class of each element of args[]:
Class[] parameterTypes = new Class[args.length];
for (int i = 0; i < args.length; i++) {
parameterTypes[i] = args[i].getClass();
}
try {
Method method = iceClass.getMethod(meth... |
b44717f4-489c-4a5c-bb1f-5c61ab99f36e | 0 | public static void main(String[] args) {
boolean t = true, f = false;
System.out.println(t & f); // false
System.out.println(t | f); // true
System.out.println(t ^ f); // true
System.out.println(!t); // false
} |
fb825ab2-5ff7-4fe2-b30d-faabaca43e74 | 9 | static public void main(String[] argv)
{
try {
Blocker blocker = (Blocker)Class.forName(BLOCKER_PACKAGE+argv[0]).newInstance();
StringDistanceLearner learner = DistanceLearnerFactory.build( argv[1] );
MatchData data = new MatchData(argv[2]);
MatchExpt expt = new MatchExpt(data,learner,b... |
a7b741cb-d3d5-4286-ac0a-1eab82b01593 | 2 | private void connect() throws ClassNotFoundException, SQLException
{
try
{
_connection = null;
_statement = null;
// Laedt den MySQL Treiber
Class.forName(DBDRIVER);
// Verbindung mit DB herstellen
String strPassword = this.readPassword();
_connection = DriverManager.getConnection(SERVERNAME, ... |
9080fcdf-8639-49d9-b356-8fc5fe8f13ce | 6 | public void specials(int xSpot, int ySpot, Entity e) {
if (xSpot == 1 && ySpot == 4) {
// level = new LongHall("/maps/longhall.png", screen);
// screen.setScreen(new GameScreen(level));
}
if (xSpot == 1 && ySpot == 4) {
GameScreen.DownStairs.xSpawn = 2;
GameScreen.DownStairs.ySpawn = 4;
Level new... |
2cae6a07-a1aa-4a0c-b6f2-68e7ddee2c1a | 6 | private static int Modification(int choosenMenu) {
switch (choosenMenu) {
case 1:
String oldLeagueName;
for (Iterator<String> it = listLeague.keySet().iterator(); it.hasNext();) {
String keyListLeague = it.next();
System.out.p... |
be2b9c13-11dd-4cbe-9a47-88cede75ca62 | 3 | @Override
public Product readObject() throws IOException {
if(receivedProducts == null){
try{
// receivedProducts = jdbcCon.getProductsfromDB(10);
receivedProducts = jdbcCon.getProductsFromIdRange(10,14);
} catch (SQLException e){
e.printStackTrace();
}
}
if(!receivedProducts.isEmpty()){
P... |
cb6a5144-e44a-4165-be50-4058d25e4abe | 0 | public List<String> getSearchedSites() {
return null;
} |
cc82ccd7-0b96-4e00-bf93-bd7fdc03a232 | 8 | private void unfilterPaeth(byte[] curLine, byte[] prevLine) {
final int bpp = this.bytesPerPixel;
final int lineSize = width*bpp;
int i;
for(i=1 ; i<=bpp ; ++i) {
curLine[i] += prevLine[i];
}
for(; i<=lineSize ; ++i) {
int a = curLine[i - ... |
b78ca302-4b64-45fb-84e5-88aafcc5a922 | 9 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Attendee other = (Attendee) obj;
if (firstName == null) {
if (other.firstName != null)
return false;
} else if (!firstName.equalsIgnoreC... |
0bbf74ff-c2f5-4518-bcc2-1fd4840315f2 | 5 | public void removePlayer(Location loc, Player play, Boolean isBreak){
if(isBreak){
if(this.hPlayerBreakBlock.containsKey(loc))
if(this.hPlayerBreakBlock.get(loc).contains(play))
this.hPlayerBreakBlock.get(loc).remove(play);
}
else{
if(this.hPlayerPlaceBlock.containsKey(loc))
if(this.hPlayerPlac... |
50dc113f-c39d-419a-8afd-5bf23c838f40 | 1 | public void prettyPrintJSON(JSONObject oldJSON){
try {
JSONTokener tokener = new JSONTokener(oldJSON.toString()); //tokenize the ugly JSON string
JSONObject finalResult = new JSONObject(tokener); // convert it to JSON object
System.out.println(finalResult.toString(4)); // To ... |
4b92130b-a77f-4e41-8259-f48614e0ef60 | 1 | @Override
public void mouseEntered(MouseEvent e) {
try {
setImg(ImageIO.read(new File("img/button/button.focus.png")));
} catch (IOException ex) {
ex.printStackTrace();
}
} |
6c20e586-990e-4281-935e-6ab81e8926ab | 9 | public String runMain(String className, String[] args, String stdin) {
Class<?> target;
try {
target = ByteClassLoader.publicFindClass(className);
} catch (ClassNotFoundException e) {
return "Internal error: main class "+className+" not found";
}
Method ... |
1f0cfa0a-6c1d-48de-b63d-c5950b6cf561 | 5 | private Program applyMutations(Program offspring) throws InvalidProgramException {
int numberOfMutationOps = mutationsOps.size();
for (Mutation m : mutationsOps) {
if (m instanceof KineticRateAlterationForProgram1 || m instanceof InsertionForProgramImpl ||
m instanceof DeletionForProgramImpl ||
random... |
530880e3-8fe9-4f7e-9e93-25f825284389 | 8 | @Test
public void testBogusFile() throws IOException {
final String filename = "test.wav";
final File file = File.createTempFile("testBogusFile", filename);
FileOutputStream out = new FileOutputStream(file);
final Random random = new Random();
for (int i=0; i<8*1024; i++) {
... |
2a194397-3c1b-4904-bef1-55139a4a26c6 | 4 | private void waitIncomingRequest() throws ShutdownRequestException {
try {
incomingSocket = welcomeServer.accept();
if(shutdownRequested)
throw new ShutdownRequestException();
fromClient = new BufferedReader(
new InputStreamReader(incomingSocket.getInputStream()));
String cmd = ... |
c3be61a2-83cb-4d3e-8aa7-d33839f04c54 | 9 | @Override
public void insertString(int offs, String str, AttributeSet a) throws BadLocationException {
char[] source = str.toCharArray();
char[] result = new char[source.length];
int j = 0;
String currentText = this.getText(0, this.getLength());
currentText.toCharArray();
for (int i = 0; i < resu... |
e412c1f0-4fbd-4b81-a214-c876d2573e5f | 0 | protected void doDestroy() {
writeLocks.clear();
readLocks.clear();
logger.info("Sync.destroy");
} |
3553c40b-d357-4679-bd58-9578c3584c06 | 2 | public void enable() throws IOException {
// This has to be synchronized or it can collide with the check in the task.
synchronized (optOutLock) {
// Check if the server owner has already set opt-out, if not, set it.
if (isOptOut()) {
configuration.set("opt-out", ... |
86719c32-6a06-409e-ad5a-46841941fc1d | 9 | private void initPreview(Component parent, ReportState state) {
//
// Save the report state
//
this.state = state;
//
// Create the report view
//
reportView = new ReportView();
reportView.setOpaque(true);
//
// Create the scroll... |
7365a3c7-8f20-4dd3-9a23-8812118ebdd8 | 5 | void setSortDirection (int value) {
if (value == sort) return;
boolean widthChange = value == SWT.NONE || sort == SWT.NONE;
sort = value;
if (widthChange) {
/*
* adding/removing the sort arrow decreases/increases the width that is
* available for the column's header text, so recompute the display text
*... |
461299b6-8462-45eb-9300-0cb68e057642 | 7 | public void run() {
try {
this.server = new ServerSocket(sconf.getPort());
while (true) {
this.socket = server.accept();
try {
Packet p = Packet.readSocket(socket);
PacketReader pr = p.getByteBufferReader();
PacketType ptype = GamePacketType.valueOf(p.getTypeID());
switch ((GamePa... |
cf3ef1be-3b92-45a6-9163-48befbc790d5 | 6 | public void letterGuessedByUser(String letter, int mode) {
switch (mode) {
case NORMAL_MODE:
lettersGuessed.add(letter);
feedbackToUser = feedbackFor(theAnswer);
updatePossibleAnswers();
break;
case HURTFUL_MODE:
lettersGuessed.add(letter);
feedbackToUser = mostCommonFeedback(generateFeedbackMa... |
00e0ab5e-c8c7-44a5-894c-2d03c0375b49 | 3 | private void btnExcluirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnExcluirActionPerformed
if (existeUsuarioSelecionado() && exclusaoConfirmada()) {
try {
excluir();
} catch (ValidacaoException ex) {
_unitOfWork.rollback();
... |
a02a21b2-27bf-43e9-b7db-7ed6471e6984 | 8 | public void putAll( Map<? extends Integer, ? extends Byte> map ) {
Iterator<? extends Entry<? extends Integer,? extends Byte>> it =
map.entrySet().iterator();
for ( int i = map.size(); i-- > 0; ) {
Entry<? extends Integer,? extends Byte> e = it.next();
this.put( e.get... |
0a06af61-7aad-41be-be8e-6fbdf6a1cece | 3 | public void removeLocallyDeclareable(Set set) {
if (type == FOR && initInstr instanceof StoreInstruction) {
StoreInstruction storeOp = (StoreInstruction) initInstr;
if (storeOp.getLValue() instanceof LocalStoreOperator) {
LocalInfo local = ((LocalStoreOperator) storeOp.getLValue())
.getLocalInfo();
... |
e61d9a0f-67f0-43a2-bbe9-7098b7e50678 | 2 | public void moveEnemies() {
for (Enemy e : getEnemyList()) {
if(e.isAlive()){
e.setPosX(e.getPosX() + e.speed);
}
}
} |
9e22242b-1de1-4ae1-91c4-d3fa1461dc86 | 1 | private void loadImages() {
try {
slate = ImageIO.read(this.getClass().getResource("computer.png"));
java = ImageIO.read(this.getClass().getResource("java.png"));
pane = ImageIO.read(this.getClass().getResource("pane.png"));
} catch (IOException ex) {
Logger.getLogger(Textures.class.getName()).log... |
a988c36f-a451-4c7e-b41f-115b3155b147 | 7 | @Override
public boolean okMessage(final Environmental myHost, final CMMsg msg)
{
if((affected!=null)
&&(affected instanceof Room)
&&(msg.amITarget(affected))
&&(newRoom().fetchEffect(ID())==null)
&&((msg.targetMinor()==CMMsg.TYP_LOOK)||(msg.targetMinor()==CMMsg.TYP_EXAMINE)))
{
final CMMsg msg2=CMClas... |
ce656cad-6ded-4349-a4bc-76ec97cae9d7 | 2 | @Override
public void keyReleased(KeyEvent e) {
if(e.getSource().equals(pfPassword)) {
if(e.getKeyCode() == KeyEvent.VK_ENTER) {
validatePassUser();
}
}
} |
125d6c76-83ce-4e32-a03c-ff91746c692d | 6 | public void currentBids(){
auctions.removeAll(auctions);
try {
Class.forName("com.mysql.jdbc.Driver");
} catch (ClassNotFoundException e) {
System.out.println("Where is your MySQL JDBC Driver?");
e.printStackTrace();
}
PreparedStatement ps = n... |
d6ac2bfa-7761-480e-9359-463f660b81a1 | 8 | @Override
public void setValueAt(Object value, int row, int col) {
if (data != null) {
Boolean readOnly = (Boolean) getYProperty().get(YIComponent.READ_ONLY);
if (readOnly == null || !readOnly.booleanValue()) {
Object rowObject = data.get(row);
... |
a59fe6bb-092d-4045-a540-110dc34df549 | 2 | @Override
public void salvar(Secao secao) throws LojaDLOException {
if (secao.getId() != null){
Secao secaoFinal = dao.obter(secao.getId());
secaoFinal.setNome(secao.getNome());
secaoFinal.setDescricao(secao.getDescricao());
} else {
if (dao.obter(seca... |
4475f346-63af-4a07-861f-ef62cdebf13f | 8 | public XConstPoolImpl(ObjectInput in) throws IOException{
int size = in.readUnsignedShort();
ints = new int[size];
for(int i=0; i<size; i++){
ints[i] = in.readInt();
}
size = in.readUnsignedShort();
longs = new long[size];
for(int i=0; i<size; i++){
longs[i] = in.readLong();
}
size = in.readUnsi... |
ec772327-0838-45aa-8983-8eb17a0815c7 | 6 | public boolean orMethod(Pair p) {
if (p == null) {
return false;
} else if (p.getCdr().getCar() == null) {// call has no expressions
return false;
}
if (p.getCar() != null && p.getCdr() == null) {// end of expressions
return Boolean.parseBoolean(run(((Pair) p.getCar())).toString());
} else if (Boolea... |
162eac7f-9b2e-43a7-aa42-f9d0223f71ef | 1 | private void createPlanTickets() throws Exception
{
//Here we are creating plan tickets those can be free sold between any two stations.
int maxStopSeq = this._route.getStops().size() - 1;
StopRangeGroup fullRangeGroup = new StopRangeGroup();
StopRange stopRange = new StopRange();
stopRange.start = 0;... |
c71eaec3-0d3e-43e8-9776-69baf076ef03 | 0 | public void SetOnBusTicks(int onBusTicks)
{
//set the tick time person got on the bus
this.onBusTicks = onBusTicks;
} |
e88e282a-9feb-409c-b071-91c0f14a02d4 | 9 | public static void main(String[] args) throws Throwable{
Escaner sc = new Escaner();
for (int c = 0, C = sc.nextInt(); c < C; c++) {
TreeSet<Tablero> noVisitar = new TreeSet<Tablero>();
TreeSet<Tablero> visitados = new TreeSet<Tablero>();
LinkedList<Tablero> cola = new LinkedList<Tablero>();
Tablero tab... |
d1fbbc59-3caf-4a39-ad62-e67b4445b250 | 0 | public static void setEventDesription(String eventDescription){
EventDescriptionWindow.eventDescription.append(eventDescription);
} |
a8658d63-520e-4d80-924d-15e60e433cbf | 2 | public double standardizedAllResponsesMean(){
if(!this.dataPreprocessed)this.preprocessData();
if(!this.variancesCalculated)this.meansAndVariances();
return this.standardizedAllResponsesMean;
} |
3dd82429-b079-4f62-b9b3-98119a0fd535 | 0 | public double get2CoordLat()
{
return markerRect.get2CoordLat();
} |
4dbfd0f9-81ca-4882-976d-ac60903a0fa0 | 6 | public void factory_order() {
draw_.clear();
discard_.clear();
int deck_size = 52;
if (has_jokers_) deck_size = 54;
for (int i = 0; i < size_; ++i) {
Suit temp;
if (i % deck_size < 13) { temp = Suit.SPADES; }
else if (i % deck_size < 26)... |
8c572127-b515-4fa1-829e-e9f6e4efbb08 | 0 | public OrderQuestView() {
super();
setLayout(null);
addAnswersTable();
colNum = 0;
rowNum = 0;
// quest = QuestFactory.createQuest(QuestType.ORDERQUEST);
} |
88167c48-4679-4020-9bf5-e70159695cd7 | 7 | protected String getDataType()
{
int offset = getOffsetInDataHeaderForDataName();
int maxLength = getDataNameMaxLength();
int nameLength = 0;
// skip first 0
while ( (0 != dataHeader[offset + nameLength]) && (nameLength < maxLength) )
nameLength++;
... |
179c7630-4857-48f3-8798-2bda0dd973c6 | 1 | public static void main(String[] args) throws InterruptedException, IOException {
String id = args.length == 0 ? "Dummy_"+System.currentTimeMillis() : args[0];
client = new NettyClient(id);
client.setListener(new PrintingListener());
client.connect("localhost", 1883);
beInteractive();
client.disconnect();
... |
802fc670-692d-42a3-ad47-33675d7526cc | 4 | @SuppressWarnings("unchecked")
public T getAdaptiveExtension() {
if (!hasAdaptiveAnnotation()) {
throw new IllegalStateException("Adaptive annotation not found in class : " + iFaceType);
}
Object instance = cachedAdaptiveInstance.get();
if (instance == null) {
synchronized (cachedAdaptiveInstance) {
... |
6a2528cf-7f83-45f3-850c-8599f5a9631b | 7 | public void choix_utilisateur() {
choix = sc.nextLine();
if (choix.equals("")) {
choix = "0";
System.out.println("Choix vide --- QUITTER");
}
System.out.println("------------------------");
int n = Integer.parseInt(choix);
switch(n) {
case 0 :
// QUITTER
System.out.println("Vous ve... |
c7da8e33-f32a-4ab2-8d6f-2c60c15f4ff9 | 5 | public boolean canPlace() {
// This only gets called just before entering the world, so I think I can
// put this here. TODO: Move the location-verification code from the
// TerrainGen class to here? ...Might be neater.
final World world = origin().world ;
for (Tile t : world.tilesIn(area(), f... |
d8bb0863-0059-49c2-b7fc-472535590a91 | 7 | public static Rule_QUOT parse(ParserContext context)
{
context.push("QUOT");
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... |
e4643815-e30a-4412-8ac2-10fc844d64d5 | 2 | public int fbMethod(int n)
{
if(n ==2 || n == 1)
{
return 1;
}
else
{
return fbMethod(n -2) + fbMethod(n -1);
}
} |
cbc524bb-5f4c-4256-afa6-d54c9f338169 | 5 | @Override
public Path shortestPath(Vertex a, Vertex b) {
Hashtable<Vertex,Integer> distance=new Hashtable<Vertex,Integer>();
Hashtable<Vertex,Vertex> path=new Hashtable<Vertex,Vertex>();
Hashtable<Vertex,Integer> heur = new Hashtable<Vertex,Integer>();
Iterator<Vertex> r = new Iterat... |
81c1a18f-e789-4a21-9c7f-4be862ed3603 | 4 | public void resizeMovingACorner(int corner, int posX, int posY){
int newWidth, newHeight;
if(corner == Drawable.TOP_LEFT_HAND_CORNER){
newWidth = getWidth() + (getOriginX()-posX);
newHeight = getHeight() + (getOriginY()-posY);
setWidth(newWidth);
setHeigth(newHeight);
this.moveOrigin(posX, posY);
... |
7dea2c09-8022-40e4-8a01-80c8ad3c4916 | 4 | public void paintComponent(Graphics g){
BufferedImage image = null;
if(data.orientation == 0){
if(focused){
image = topBgImageFocused;
}
else{
image = topBgImage;
}
}
else if(data.orientation == 1){
... |
fc297bca-ea01-40b3-a345-20284710bfbd | 5 | public void secondInterval() {
boolean test = false;
if (test || m_test) {
System.out.println("Timer :: secondInterval() BEGIN");
}
try {
Thread.sleep(SECOND);
} catch (Exception e) {
System.out.println("hey");
}
if (test || m_test) {
System.out.println("Timer :: secondInter... |
b06e7167-b44a-4382-bf6a-8d89a4cbd6fa | 2 | @Override
public boolean onCommand(CommandSender sender, org.bukkit.command.Command cmd, String[] args) {
if (!Commands.isPlayer(sender)) return false;
Player p = (Player) sender;
if (args.length == 0) {
channel.leaveChannel(p, PlayerChat.plugin.CustomChat.get(p.getName()));
return true;
} else {
ch... |
6a324e26-99dc-4f4a-ba61-a848f31c3431 | 1 | public static void main(String ... args) {
File f = new File("src/img/8000bce-600bce/East_Asia");
int length = f.listFiles().length;
for(int i = 0; i < length; ++i) {
System.out.println(f.listFiles()[i].getName());
}
} |
9e0e1124-184a-403e-9861-8c7b35166db6 | 0 | public List findBySampleCode(Object sampleCode) {
return findByProperty(SAMPLE_CODE, sampleCode);
} |
753cbbd8-ac43-4743-bfe9-633c449d5a4d | 1 | public static void main(String[] args) {
/*
Exceptions - Rules to Remember
* A try block may be followed by multiple catch blocks, and the catch blocks may be followed by a single
finally block
* A try block may be followed by either a catch or a finally block... |
2809ed3f-5355-4a19-8a96-6e0319a6d93a | 8 | public void receiveFirst() {
System.out.println("-- Bob --");
if (betray) {
System.out.println("ACHTUNG: Betrugsmodus aktiv!!!");
}
// Part 0 ---------------------------------------------------------------
// Hard coded ElGamal
BigInteger El_p_B = new BigInteger("778978896513566371469074... |
d9477380-d807-48d2-982f-e6b18aa65d50 | 9 | protected void FillBuff() throws java.io.IOException
{
if (maxNextCharInd == available)
{
if (available == bufsize)
{
if (tokenBegin > 2048)
{
bufpos = maxNextCharInd = 0;
available = tokenBegin;
}
else if (tokenBegin < 0)
bufpos = maxN... |
e99d6b67-6e57-4415-a155-2e9efcccf5e7 | 5 | public LinkedList<String> list() {
LinkedList<String> files = new LinkedList<String>();
if(carrierString!=null) {
if(carrierString.length()>0) {
files.add(CARRIER_PATCH.substring(CARRIER_PATCH.lastIndexOf("/")+1));
}
}
if(textColour!=null) {
... |
0a65a755-9f45-4e8b-8416-d61ab485f3dd | 4 | public static void writeFile(String fileName) {
if (fileName == null) // Go back to reading standard output
writeStandardOutput();
else {
PrintWriter newout;
try {
newout = new PrintWriter(new FileWriter(fileName));
}
catch (Exception e) {
... |
29b99917-bfc4-430c-949d-046acb770bbf | 7 | private synchronized void receiveAd(Sim_event ev)
{
if (super.reportWriter_ != null) {
super.write("receive router ad from, " +
GridSim.getEntityName(ev.get_src()));
}
// what to do when an ad is received
RIPAdPack ad = (RIPAdPack)ev.get_data();
... |
b793b4b2-3477-4e2e-9102-3e2bdb171bf8 | 2 | private static void writeXDRString(DataOutputStream dos, String s) throws IOException {
dos.writeInt(s.length());
dos.writeBytes(s);
int offset = s.length() % 4;
if (offset != 0) {
for (int i = offset; i < 4; ++i) {
dos.writeByte(0);
}
}
} |
8ed646f3-e337-462e-952a-4e0e538fda1f | 8 | public boolean equals(final Object o){
if(this == o)
{
return true;
}
if(!(o instanceof Type))
{
return false;
}
Type t = (Type) o;
if(sort != t.sort)
{
return false;
}
if(sort == Type.OBJECT || sort == Type.ARRAY)
{
if(len != t.len)
{
return false;
}
for(int i = off, j = t.off, en... |
9ab0459c-979a-46c8-80c7-f488b6158408 | 7 | public void abrirExtraccion(int id)
{
ArrayList nom;
String[] enlace;
String[] campos = new String[]{"id_enl_audio","id_proyecto","nombre_enlace"};
nom = extraccion.busquedaBD("enlaces_audio", "indice_enlaces_audioid_proyecto", campos, id);
for(int i=0;i<nom.... |
76d41ae8-c261-4eec-bb6d-cf3fd774146e | 1 | public static void main(String[] args)
{
List<Integer> numbers = new ArrayList<Integer>();
for (int i = 1; i <= 49; i++)
numbers.add(i);
Collections.shuffle(numbers);
List<Integer> winningCombination = numbers.subList(0, 6);
Collections.sort(winningCombination);
System.ou... |
0edfddf3-bb7e-4b13-9324-2ae65ad6023a | 7 | private boolean doubleMillDetection(GameBoard gamestate, GamePiece doubleMillPosition, Team doubleMillTeam){
if (doubleMillPosition.getP() % 2 == 1) { return false;} //double mill detection in this method does not consider the 4 middle square double mills.
Team emptyTeam = new Team();
emptyTeam.setTeamSymb... |
7918db95-1440-4566-b91d-6a82ded6361c | 9 | public static void main(String[] args) {
// TODO code application logic here
boolean validar=true;
int valor1=0;
int valor2=0;
double resultado;
char continuar;
int opcion=0;
Scanner teclado=new Scanner(System.in);
Operaciones oOp... |
1541ac2b-367c-4102-b83f-c150bc7c6adb | 0 | public static void main(String[] args) throws InterruptedException {
Semaphore s = new Semaphore(10);
s.acquire(); // ++
s.release(); // --
List<String> list = Collections.synchronizedList(new ArrayList<String>());
Map<String, String> map1 = Collections.synchronizedMap(new HashMap<String,String>()... |
dade4e2b-df86-4892-a32a-ddb13d1311e7 | 7 | public String getResourceTotal()
{
int cpu_count = 0;
long memoryAvailable = 0;
long diskAvailable = 0;
try
{
List<String> regionList = ControllerEngine.gdb.getNodeList(null,null,null);
//Map<String,Map<String,String>> ahm = new HashMap<String,Map<String,String>>();
//System.out.println("Region C... |
3e85801d-9970-466e-9355-606320991da6 | 0 | public final Object getSource() {
return source;
} |
9c23a7e4-e9e5-4dcd-9cc4-fd22b358a4fa | 6 | private static Map<String, String> loadSeedProducts(String seedFileName) throws Exception {
int totalRows = 0, badUPCCount = 0, badProductIdCount = 0;
Map<String, String> products = new LinkedHashMap<String, String>();
XSSFWorkbook wb = readFile(seedFileName);
for (int k = 0; k < 1; k++) {
XSSFSheet sheet... |
09256538-5969-4648-b2e1-0dc6f51c572a | 3 | public float getX(float percent) {
// No movement
if(pattern[0] == 0) { return (float)(0+offset[0]); }
// left to right
if(pattern[0] == 1) { return (float)(percent*600.0-50.0+offset[0]); }
// Right to left
if(pattern[0] == 2) { return (float)(percent*-600.0+50.0+offset[0]); }
// donno
/... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.