method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
aae3d928-7fdf-4dc3-8d26-be8d0ff12203 | 2 | * @return the given api command string with the binding environment for bookkeeping assertions
*/
public String wrapBookkeeping(String command) {
final String projectName = (project == null) ? "nil" : project.stringApiValue();
final String cyclistName = (cyclist == null) ? "nil" : cyclist.stringApiValue();... |
615ac606-3596-41d8-b9b0-f592762e7a39 | 8 | public ArrayList<Token> tokenize(char[] array){
ArrayList<Token> tokens = new ArrayList<Token>();
StringBuilder cur = new StringBuilder();
for(int i=0;i<array.length;i++){
if(CharUtil.isNumber(array[i])){ cur.append(array[i]); }
else {
if(cur.length() > 0 ){
tokens.add(new Token(cur.toString())... |
4b51720f-7884-44de-a509-1dce323fef4c | 6 | public static void main (String[] args)
{
int accumulator = 0;
String choice = "y";
while (choice.equalsIgnoreCase("y"))
{
//Welcome statement to the user.
System.out.println("Welcome to the Guess Number Game");
System.out.println("++++++++++++++... |
50c9ac1a-32c7-48f2-9fd5-80ec0f333315 | 6 | public static void testThis(String[] args)
{
boolean decode = false;
if (args.length == 0) {
System.out.println("usage: java Base64 [-d[ecode]] filename");
System.exit(0);
}
for (int i=0; i<args.length; i++) {
if ("-decode".equalsIgnoreCase(args[i])) decode = true;
else if ("-d".equalsIgnoreCase(... |
b0f878fa-0bad-408b-993f-17a854fcba81 | 0 | public static ArraysDataBase getStructureBase(){
return structuresBase;
} |
85034044-3e19-4dcc-8c9d-151d673c4697 | 9 | @Override
public boolean execute(SimpleTowns plugin, CommandSender sender, String commandLabel, String[] args) {
final Localisation localisation = plugin.getLocalisation();
if (!(sender instanceof Player)) {
sender.sendMessage(localisation.get(LocalisationEntry.ERR_PLAYER_ONLY_COMMAND))... |
b8636ce0-08d8-4d9f-89f6-2aa911ee6c36 | 4 | public static Preferences creerPrefConsole(){
String[] basePrefs = {"Conversation", "Musique", "Animaux", "Fumeur"};
Preferences listePrefs = new Preferences();
Scanner sc = new Scanner(System.in);
System.out.println("Répondez avec 'o' ou 'n'.");
for(String s : basePrefs){
System.out.print(s+" ? ");
... |
8912dd79-f8d9-4630-9ded-49f948e3728d | 2 | public void actionPerformed(ActionEvent e) {
if (e.getSource() == Cancel) {
this.dispose();
}
else if (e.getSource() == Ok) {
updateArgs();
this.dispose();
}
} |
e9bbf01e-f09c-40f4-aa9a-cfe331dc40e4 | 3 | @Action(name = "hcomponent.handler.onclick.param", args = {})
public void onClickAction(Updates updates, String param) {
HComponent<?> html = (HComponent<?>) Session.getCurrent().get(
"_hcomponent.object." + param);
if (html.getOnClickListener() != null)
ContentManager.requestParams(
"hcomponent.handle... |
493e08c1-3361-46bf-bd32-a76cbd3a6e67 | 5 | private Response handleRequest(String url) {
Response r = new Response();
try {
URL u = new URL(url);
HttpURLConnection conn = (HttpURLConnection) u.openConnection();
conn.setRequestMethod("GET");
conn.setRequestProperty("Accept", "application/json");
if (conn.getResponseCode() != 200) {
System.... |
9260e0d9-d733-4c64-8379-434f437c3740 | 0 | private GlobalTimes() {
} |
317593c3-3898-41d2-8e1c-5a32146ee7ed | 1 | private JTextArea getTextAreaMain() {
if (textAreaMain == null) {
textAreaMain = new JTextArea();
}
return textAreaMain;
} |
1e6ce7d7-685a-421f-9ad1-5409c85f7027 | 3 | public returnTypes deleteFile(byte[] fileID) {
String recID = Packet.bytesToHex(fileID);
for(BackupFile file : files) {
String comID = Packet.bytesToHex(file.getFileID());
if(comID.equals(recID)) {
new File (file.getFilename()).delete();
boolean success = files.remove(file);
if(success) {
upd... |
662d6acb-7485-4a0d-b3c1-16322e65e385 | 1 | public IPokemon getCorrectPokemon(boolean isPlayer) {
return isPlayer ? getPlayer().getPokemon() : enemy;
} |
b36505cc-f6af-4265-841c-ac48d8324584 | 6 | @Override
public void propertyChange(PropertyChangeEvent pce) {
String propName = pce.getPropertyName();
if (propName.equals("progress")){
int value = ((Integer)pce.getNewValue()).intValue();
if (value >= minValue && value <= maxValue){
setValue(value);
label.setText(" Выполнено :" + value +... |
4d8151b0-f415-46e8-a614-ae8b5357be97 | 0 | public TasoTest() {
} |
5c3d9531-7561-4dca-84f3-0f403708a43c | 6 | @Override
public void actionPerformed(ActionEvent e) {
if (e.getActionCommand().equals("Save")) {
finish();
} else if (e.getActionCommand().equals("Undo")) {
undoredo(e.getActionCommand());
setFocusOnTxtArea();
} else if (e.getActionCommand().equals("Redo")) {
undoredo(e.getActionCommand());
setFo... |
7de77933-1002-41fa-bb47-0e10e5ac3046 | 5 | public Book getBook(long id) {
Book book = null;
Connection con = null;
Statement stmt = null;
try {
DBconnection dbCon = new DBconnection();
Class.forName(dbCon.getJDBC_DRIVER());
con = DriverManager.getConnection(dbCon.getDATABASE_URL(),
... |
d5802e1a-2252-4f61-a693-fbe220a1fe9d | 1 | public void drawGrid(Graphics g) {
g.setColor(Color.black);
for (Point p: this.maze.cells) {
p = this.imagify(p);
g.drawRect(p.x, p.y, this.cellWidth, this.cellWidth);
}
} |
91174ade-b64e-4d85-945a-e702dafb423d | 4 | private int getLargestList(List<ArrayList<CellState>> lists){
int i = -1;
for(ArrayList<?> list: lists){
if(i == -1){
i = list.size();
}else{
if(i < list.size())
i = list.size();
}
}
return i;
} |
e4b93015-a9f2-4ddd-b7f3-4ee5bac71194 | 0 | private void okButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_okButtonActionPerformed
this.setVisible(false);
}//GEN-LAST:event_okButtonActionPerformed |
d85867b6-b6c2-4cde-9147-a2830dd313ef | 5 | public Class getTypeClass() {
switch (((IntegerType) getHint()).possTypes) {
case IT_Z:
return Boolean.TYPE;
case IT_C:
return Character.TYPE;
case IT_B:
return Byte.TYPE;
case IT_S:
return Short.TYPE;
case IT_I:
default:
return Integer.TYPE;
}
} |
c3494251-ec29-478e-97fe-9931174d0f47 | 2 | private static int getStart( String string )
{
for ( int i = 0; i < string.length(); ++i )
{
if ( isBreaker( string.charAt( i ) ) == false )
{
return i;
}
}
return -1;
} |
beed95c0-032b-401c-81f1-b350a59a003a | 2 | @Override
public void mouseClicked(MouseEvent arg0) {
if( arg0.getSource()==botonJugar){
this.dispose();
vJuego juego= new vJuego(null,JTBlancas.getText(),JTNegras.getText());
juego.setVisible(true);
}
if(arg0.getSource()==botonVolver)
{
this.dispose();
vInicio inicio= new vInicio();
inic... |
565d18d4-8f8f-4084-aa57-d9798bd20796 | 1 | @Override
public boolean allowSource( ConnectionableCapability item, ConnectionFlavor flavor ) {
if( item == this ){
return false;
}
return isComment( flavor );
} |
833b71c1-4c85-44e4-9e92-348f14087aba | 1 | private JButton getBtnClear() {
if (btnClear == null) {
btnClear = new JButton("Clear");
btnClear.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
textAreaMain.setText("");
}
});
btnClear.setBounds(10, 222, 89, 23);
}
return btnClear;
} |
1dca1b79-e57f-4484-b1cb-737dc94b1cc1 | 2 | public static void setPageSize(PrintService service, PrintRequestAttributeSet set, double[] size, LengthUnits units) {
PageOrientation orientation = getPageOrientation(service, set);
if (orientation == PageOrientation.LANDSCAPE || orientation == PageOrientation.REVERSE_LANDSCAPE) {
size = new double[] { size[1]... |
9a63f5eb-b4cc-4dca-b807-25a94ce96a37 | 0 | public String getCityCode() {
return cityCode.get();
} |
0c746fb7-aac6-4914-a67a-cd72da2318b3 | 2 | @Override
public int compareTo(Object ob){
Event e = (Event) ob;
if(this.time < e.getTime()){
return -1;
}
if(this.time > e.getTime()){
return 1;
}
return 0;
} |
762c36c1-590a-487a-b312-115ab9240aa0 | 4 | public static String concatenateUsingStringBuffer(String[] stringArray, String delimiter) {
if (delimiter == null || stringArray == null || stringArray.length == 0) {
return null;
}
StringBuffer result = new StringBuffer().append(stringArray[0]);
for (int i = 1; i < string... |
c4a56e84-f02f-4422-98c2-48dfeba5f49c | 2 | public void test_convertText() {
BaseDateTimeField field = new MockPreciseDurationDateTimeField();
assertEquals(0, field.convertText("0", null));
assertEquals(29, field.convertText("29", null));
try {
field.convertText("2A", null);
fail();
} catch (Illegal... |
c3d1f701-70fd-4b23-b56d-9215067e736d | 2 | public void updateID() {
if(ID == 0) {
int x = 1;
while(Item.validID(Integer.parseInt((itemTypeCombo.getSelectedIndex() + 1) + "" + x))) {
x++;
}
IDText.setText((itemTypeCombo.getSelectedIndex() + 1) + "" + x);
}
} |
cfccf77c-5588-43aa-9ac5-1043b35cf80d | 8 | public List<Aim> getDirections(Tile t1, Tile t2) {
List<Aim> directions = new ArrayList<Aim>();
if (t1.getRow() < t2.getRow()) {
if (t2.getRow() - t1.getRow() >= rows / 2) {
directions.add(Aim.NORTH);
} else {
directions.add(Aim.SOUTH);
... |
f3b35339-5cda-4fd5-85c3-cb86267305a9 | 9 | private static URI removeDotSegments(URI uri) {
String path = uri.getPath();
if ((path == null) || (path.indexOf("/.") == -1)) {
// No dot segments to remove
return uri;
}
String[] inputSegments = path.split("/");
Stack<String> outputSegments = new Stack<S... |
a64f450e-ae05-4b97-9790-ce557a3229f5 | 7 | protected void keyTyped(char par1, int par2)
{
this.serverName.textboxKeyTyped(par1, par2);
this.serverAddress.textboxKeyTyped(par1, par2);
if (par1 == 9)
{
if (this.serverName.getIsFocused())
{
this.serverName.setFocused(false);
... |
a6df8bbf-babd-49dd-901c-78dbb67d41ee | 9 | private String indexToMsg(int i) {
switch (i){
case 0: return "bid";
case 1: return "password";
case 2: return "name";
case 3: return "address";
case 4: return "phone";
case 5: return "email address";
case 6: return "sin or student #";
case 7: return "expiry date (yyyy/mm/dd)";
case 8: return "type... |
e9c2f75b-4d6b-4669-aa10-2d8f772da41c | 2 | public int pop() {
while (!isEmpty()) {
temp.push(super.pop());
}
int ret = temp.pop();
while (!temp.isEmpty()) {
push(temp.pop());
}
return ret;
} |
ca53e01c-7d15-4fd4-b0e6-4e246852888f | 9 | public AudioInfo(DataInputStream f) throws Exception {
byte [] buffer;
if (f.readInt() != 779248125) //['.', 'r', 'a', 0xfd]
throw new InvalidSequenceException("AudioCodec info has wrong header");
version = f.readShort(); //word Version (3, 4 or 5)
if (version < 3 || version > 5) throw new Unsupported... |
21b846c2-c65c-4107-b7df-a8e3357debc4 | 9 | public void contract(Edge edge) {
if (Debug.ON) {
System.out.println("Contracting ");
System.out.println("Choosing Edge " + edge.tail.id + " -- "
+ edge.head.id);
}
// THE FOLLOWING CODES MUST BE CHANGED WHEN DEALING WITH DIRECTED GRAPH
int group = -1;
if (edge.tail.gid != -1) {
group = edge.... |
3762210d-5ee1-4afd-acf1-9beeffd96457 | 8 | public void initPF() {
int allowed_width = winwidth + crop_left + crop_right;
int allowed_height = winheight + crop_top + crop_bottom;
// these came from the canvas constructor
viewnrtilesx=nrtilesx;
viewnrtilesy=nrtilesy;
if (prescale) {
scaledtilex = allowed_width / nrtilesx;
scaledtiley = allowed_h... |
1d57d369-a243-43bd-98b5-a5a5756348ea | 8 | public int func_27371_a(StatCrafting var1, StatCrafting var2) {
int var3 = var1.func_25072_b();
int var4 = var2.func_25072_b();
StatBase var5 = null;
StatBase var6 = null;
if(this.slotStatsItemGUI.field_27271_e == 0) {
var5 = StatList.objectBreakStats[var3];
var6 = StatLi... |
e61d00a2-b045-48d1-b6b0-5038c71161e3 | 3 | protected HttpParams getParams() {
final HttpParams params = new BasicHttpParams();
HttpConnectionParams.setConnectionTimeout(params, TIMEOUT);
HttpConnectionParams.setSoTimeout(params, TIMEOUT);
HttpConnectionParams.setSocketBufferSize(params, BUFFER_SIZE);
ConnManagerParams.set... |
82664259-7603-43d8-8570-fee8d553702c | 4 | static boolean fillEmptyCell (Cell[][] board) {
boolean flag = false;
for (int x = 0; x < 9; x++) {
for (int y = 0; y < 9; y++) {
if (board[x][y].getCellValue() == 0 && board[x][y].possibleValues.size() == 1) {
board[x][y].setCellValue(board[x][y].possibleValues.get(0));
flag = true;
}
}
}... |
3c981fe3-23f3-454b-a211-8ddd438c4811 | 1 | public final byte getBiomeID(){
if(currentChunk == null)return -1;
return currentChunk.getBiomeID((int)getX(), (int)getZ());
} |
cc8b748c-e5ff-4ce5-978f-067e101085fa | 5 | @Override
public void render() {
Gdx.gl.glClearColor(0, 0, 0, 1);
Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
spriteBatch.setProjectionMatrix(camera.combined);
if (!assetManagerController.update()) {
}else {
if (once) {
once = false;
}
... |
e73561af-a64a-41dd-86cf-dffecd45a4e5 | 0 | public JTextField getjTextFieldDateRapport() {
return jTextFieldDateRapport;
} |
fb046254-41d0-4098-b340-cf3fae97aded | 6 | private void pickChecker(int player, int column) {
if ((column < -1) || (column > NUM_POINTS)) {
System.err.println("Error, out of range.");
} else {
// column -1 means the table!
// So if a checker is transfered from the column -1, it is simply put in the game.
... |
9d2f7410-1420-4c6f-9181-79c81959f03d | 2 | public static void main(String[] args) {
BigInteger bi = new BigInteger("2");
bi = bi.pow(1000);
String s = bi.toString();
ArrayList<Integer> arr = new ArrayList<Integer>();
for(int i = 0; i < s.length(); i++)
{
arr.add((int) (s.charAt(i) - '0'));
}
int res = 0;
for(int i : arr)
{
... |
34bc7b65-5124-40cf-9bf6-3a91e05c9238 | 9 | public String nextToken() throws JSONException {
char c;
char q;
StringBuffer sb = new StringBuffer();
do {
c = next();
} while (Character.isWhitespace(c));
if (c == '"' || c == '\'') {
q = c;
for (;;) {
c = next();
... |
cd435f8f-2825-41ef-bac1-913800f12392 | 5 | private static void appendJSONPair(StringBuilder json, String key, String value) throws UnsupportedEncodingException {
boolean isValueNumeric = false;
try {
if (value.equals("0") || !value.endsWith("0")) {
Double.parseDouble(value);
isValueNumeric = true;
... |
bc4d2a2b-72da-42ed-9f40-db23d6356774 | 5 | public void update() {
long time = System.currentTimeMillis();
float delta = time - lastupdate;
lastupdate = time;
if (position.getX() > GAME_WIDTH || position.getX() < 0 || position.getY() > GAME_HEIGHT || position.getY() < 0 || schritte >= projectileMaxDistace) {
Server.pro... |
f50f2581-b857-4904-8988-1c1c430d076e | 2 | private DataBase getDataBaseByKey(String key) throws DBUnavailabilityException {
for (Pattern regexp : databases.keySet()) {
Matcher matcher = regexp.matcher(key);
if (matcher.find()) {
return databases.get(regexp);
}
}
throw new DBUnavailabili... |
841adf8d-a30f-490e-9273-081b3bcc8d90 | 2 | public boolean disconnect(){
try {
con.close();
} catch( SQLException e ){
if( debug ) System.out.println("Error in DataBaseConnection.disconnect(): "+e.getMessage());
return false;
}
return true;
} |
40ebf7ec-7a7b-49d4-bc7f-debb50366f57 | 2 | @Override
public void downloadPlaylist(final String playlistUrl, final String destinationFolder, final Mp3Metadata metadata) {
String playlistString = null;
try {
final long setId = getApi().resolve(playlistUrl);
final HttpResponse setResponse = getApi().get(new Request(String.format(Constants.PLAYLIST_URL, ... |
3ebc323a-c47c-4fcd-9cad-46d77ecaced3 | 3 | @Override
public void run() {
synchronized (numberOfActiveProducersLock) {
numberOfActiveProducers++;
}
Random rnd = new Random();
try {
for (int i=1; i<=maxItemsToProduce; i++) {
if (warehouse.isFull()) {
break; //stop producing when warehouse is full
}
int producedItem = rnd.next... |
7bf23d1d-77a6-4ecb-b6a2-d2d4573e7206 | 1 | public int getAttributeType(String name, String aname)
{
Object attribute[] = getAttribute(name, aname);
if (attribute == null) {
return ATTRIBUTE_UNDECLARED;
} else {
return ((Integer) attribute[0]).intValue();
}
} |
ff89480c-8ae8-4bc8-94ce-f90c35dc634c | 2 | private void addToTextArea() {
if (!(jTextField1.getText().equalsIgnoreCase("") || jTextField1.getText() == null)) {
jTextArea1.append(jTextField1.getText() + "\n");
}
control.sendMessage(jTextField1.getText());
jTextField1.setText(null);
} |
a1f64408-bc35-4277-a09a-243f3644f66b | 5 | public void setGridSize(int rows,
int columns, boolean preserveData) {
if (rows > 0 && columns > 0) {
Color[][] newGrid = new Color[rows][columns];
if (preserveData) {
int rowMax = Math.min(rows,this.rows);
int colMax = Math.min(columns,this.columns);
... |
a50050bd-331b-4757-bec1-cd269097a503 | 0 | public void removeVertex(Vertex v) {
vertices.delete(v);
adjacencyList.removeVertex(v);
} |
f11dd63f-c6b1-451b-aa72-741f49e3ffdd | 0 | private void maj_pos_robot(int x, int y, double teta) {
//mm vers pixel -> *119/600
terrain.robot.X = x*119/600;
terrain.robot.Y = y*119/600;
terrain.robot.teta = teta;
terrain.repaint();
} |
77f00c80-53ee-495a-8b75-ddb5728f2c41 | 0 | public MainFrame(String username, String ip, int port) {
super("Chat - " + username + " [" + ip + ":" + port + "]");
this.username = username;
this.ip = ip;
this.port = port;
packetFactory = new PacketFactory(ip, port);
doAesthetics();
setVisible(true);
... |
373a5e6c-ea14-496d-a5d3-1a00a85ba88c | 6 | @Override
public boolean equals(final Object obj) {
if(!(obj instanceof Edge)) {
return false;
}
final Edge o = (Edge) obj;
return start == o.start && end == o.end && dot == o.dot
&& lhs.equals(o.lhs) && Arrays.equals(rhs, o.rhs)
&& children.equals(o.children);
... |
1c6d8f5e-43fe-4bef-ba99-c6ad9c4bff2e | 5 | public IRegion getDamageRegion(
ITypedRegion partition,
DocumentEvent event,
boolean documentPartitioningChanged) {
if (!documentPartitioningChanged) {
try {
IRegion info =
fDocument.getLineInformationOfOffset(event.getOffset());
int start = Math.max(partition.getOffset(), info.getOffset());
... |
ac440110-a459-48dd-8d9d-1a248f7ce9b5 | 7 | @Override
public boolean equals(Object aObject) {
if (this == aObject) return true;
if (aObject == null || getClass() != aObject.getClass()) return false;
Vector4d vector4d = (Vector4d) aObject;
if (Double.compare(vector4d.w, w) != 0) return false;
if (Double.compare(vector4d.x, x) != 0) return ... |
fb9267c1-9779-41ee-b8ca-9a07efcb5b58 | 3 | public List<User> getFollowers(String email)
{
Connection connection = null;
List<User> followerList = new ArrayList<User>();
String query = null;
PreparedStatement statement = null;
try
{
connection = dataSource.getConnection();
query = "SELECT users.email, users.username FROM follows INNE... |
79d7c505-9b9c-4314-9de6-d8050e92ec23 | 7 | public void recieveCommand(Commands command) {
if (command == null) {
return;
}
switch (command.getType()) {
case Commands.LOGIN:
logon((LoginCommand)command);
break;
case Commands.LOGOUT:
logout();
break;
case Commands.WHISPER:
whisper((WhisperCommand)command);
break;
case Commands.... |
3506d028-5c5c-4c44-853b-13930b3a7eed | 0 | public int getInitialHeight() {
return initialHeight;
} |
38663ca7-1922-43be-8a20-0a9c5cdeb53e | 1 | public void pressbutton() {
Timetable_main_RWRAF.read(Homework_database_edit_1.getn());
int ID = (Timetable_main_RWRAF.getID());
String subject = (String)Subject.getSelectedItem();
String desc = DescField.getText();
String difficulty = (String)DiffField.getSelectedItem();
int time = Integer.parseInt((String)Timef... |
4540c797-e234-48e2-b370-964920e2409a | 7 | private byte[] crypt_raw(byte password[], byte salt[], int log_rounds) {
int rounds, i, j;
int cdata[] = (int[]) bf_crypt_ciphertext.clone();
int clen = cdata.length;
byte ret[];
if (log_rounds < 4 || log_rounds > 31)
throw new IllegalArgumentException("Bad number of rounds");
rounds = 1 << log_rounds;
... |
cea44067-93be-4f50-ae09-38bbc70d4f1a | 8 | public static boolean findPath(int[][] maze, int x, int y, int targetx, int targety) {
// base case or exit condition : reached the target
if(x == targetx && y == targety) {
return true;
} else {
// check if x and y are in the limits && x,y does not hit a wall
... |
0e17f0c8-f5e1-4eb1-b327-c1d337a8317d | 7 | private void quicksort(Integer menor, Integer maior) throws NaoOrdenavel {
Integer i = menor, j = maior;
Elemento pivo = elementos[menor + (maior - menor) / 2];
try {
while (i <= j) {
while (pivo.compareTo(elementos[i]) > 0) {
i++;
... |
d8f000d2-6c30-463a-9a59-27c8c84e58c6 | 4 | protected static boolean checkResource(Resource resource) {
boolean isValid;
if (isValid = resource != null) {
isValid = TYPES.contains(resource.getType());
isValid = isValid && resource.getProperty(HOST_PROPERTY) != null;
isValid = isValid && resource.getProperty(USE... |
dc5920d7-1e42-49a5-b07b-248889e22d46 | 8 | @Override
public Path compute(TSPInstance tsp, Path beginPath,
ComputationCallback callback) {
final int count = tsp.count();
if (count <= paramP) {
throw new IllegalArgumentException(
"Impossible to solve the tsp: tsp.count <= paramP! tsp.count = "
... |
7aeffe55-83e9-4479-939e-94f36fd7c99f | 2 | public static void loadImage(String url, String galleryName) {
try {
String src = prefixSrc;
src += galleryName;
src += "\\";
String imgName = getFileName(url);
src += getFileName(url);
addImgToXmlData(imgName, galleryName);
Buf... |
bf41d065-9bf2-4721-b28d-8f0ac371869a | 8 | public InputStream stream(String url) throws IOException {
int redirects = 0;
URLConnection conn;
do {
conn = LLHttpClient.connect(proxy(), "GET", url, connectTimeOut, readTimeOut, headers());
url = check(cookies(conn));
redirects++;
} while (follow && url != null && redirects < 5);
... |
efef6769-010f-4fc3-acec-d40e72d32493 | 0 | public List getAxiom() {
return axiom;
} |
5005a7e2-7a24-445a-a0f0-fd0e3e203c0d | 3 | public static boolean initNetworkType(int networkType)
{
boolean result = true;
switch(networkType)
{
case GridSimTags.NET_PACKET_LEVEL:
GridSimCore.NETWORK_TYPE = GridSimTags.NET_PACKET_LEVEL;
break;
case GridSimTags.NET_FLOW_LEVEL:
... |
6908f9d9-7ac4-4b78-bf50-d963ded89073 | 9 | private void cmd_take(final String arg, final Client client) {
final Player player = getPlayer(client);
final Room room = getRoom( player.getLocation() );
final String[] args = arg.split(" ");
debug("" + args.length);
// if there is no argument, report command syntax
if (arg.equals("")) {
send("Syntax... |
22de51ff-af99-4b93-97d9-4fd17bf267f6 | 2 | public Obstacle(String key, int x, int y) {
genObstacle tmp;
try {
tmp = (genObstacle) genObstacle.obsMapping.get(key);
} catch (IllegalArgumentException e) {
tmp = new genObstacle(-1,false,false,0); // ID = 0 collision, visible, hurting
}
if (tmp != null) {
super.n = tmp.getID();
super.collision... |
55ac4e4d-efeb-4781-92f5-18e41191d478 | 0 | @Override
public void restoreTemporaryToDefault() {tmp = def;} |
04d36904-a372-4d2b-bf9d-00f9f43cc862 | 7 | @Override
public void spring(MOB target)
{
if(target.location()!=null)
{
if((!invoker().mayIFight(target))
||(isLocalExempt(target))
||(invoker().getGroupMembers(new HashSet<MOB>()).contains(target))
||(target==invoker())
||(doesSaveVsTraps(target)))
target.location().show(target,null,null,CMMs... |
1c9a4c82-160a-4ad4-a406-27bda8e43f8a | 1 | @Override
public void mouseReleased(MouseEvent arg0) {
this.drag = false;
if(curTool == 3) {
hp.apply();
}
hp.setDrag(null);
view.updateHeightmap(hp.getTexture());
} |
82c45638-92ed-4c42-9c5d-f5baf8d53f56 | 0 | public void setAccessToken(String accessToken) {
this.accessToken = accessToken;
} |
14cc281c-873e-4b93-916e-669131619586 | 5 | public static void build() {
Plugin larvikGaming = Bukkit.getServer().getPluginManager().getPlugin("LarvikGaming");
list.plugin = Bukkit.getServer().getPluginManager().getPlugins();
list.pos = Bukkit.getServer().getPluginManager().getPlugins().length;
String fileDest = larvikGaming.getConfig().getString("FileDi... |
4113bbb1-30ab-4a04-8752-a678634bab1f | 5 | public void send() {
String msg = msg_box.getText();
if (msg == null || msg.equals("") || msg.equals("\n")){
msg_box.setText("");
return;
}
if(enterIsSend){
msg = msg.substring(0, msg.length()-1);
}
if (msg.startsWith("@")) {
String to = msg.split(" ")[0].substring(1);
msg = msg.substring(... |
27c6b0de-7531-4f18-af45-278c09c1880d | 0 | public String getGestureName() {
return gestureName;
} |
c82d119e-9c36-468a-9c56-da5d85b41d33 | 8 | @SuppressWarnings("resource")
static Fraction[][] getMatrix ( String filename ){
int rowBuffer = 30;
int columnBuffer = 30;
Fraction[][] matrixBuffer = new Fraction[rowBuffer][columnBuffer];
int rowCt = 0;
int columnCt = 0;
try {
Scanner sc = new Scanner( new File( filename... |
823a8562-a415-4bd0-b158-98d79c561652 | 0 | public Double[] getYVal() {
return yVal;
} |
7743d381-a147-465c-ba1c-fce818c56ff5 | 3 | List<byte[]> getPasswordBytes(boolean unicodeConversion) {
// TODO - handle unicodeConversion when we support version 5
if (this.passwordBytes != null || this.passwordString == null) {
return Collections.singletonList(this.passwordBytes);
} else {
if (isAlphaNum7BitString... |
8796f609-c029-4030-8514-584d0ecce7b3 | 9 | public void setBLXElement(BLXElement blxElement) {
super.setBLXElement(blxElement);
Element _myElement = blxElement.getDataElement();
//MasterTile Element not found set Defaults
if(_myElement == null) {
setGridLocation(TOP_LEFT);
setClosed(false);
setIsDirty(true);
return;
... |
4faf25b5-3cc6-49a3-a325-0541e6c84407 | 8 | private Method_GetDebugInfo(VirtualMachineImpl vm, PacketStream ps)
{
maxIndex = ps.readInt();
final SourceFile[] sourceFiles;
if(vm.isAtLeastVersion(2, 13))
{
int count = ps.readId();
sourceFiles = new SourceFile[count];
for(int i = 0; i < count; i++)
{
sourceFiles[i] = new SourceFile();
s... |
948c6fc3-24e5-40eb-83cf-c8506a1b6e3e | 8 | private void PageRedirect(String itemID, String itemType, String query, boolean DisplayGO, boolean organismdependentquery) {
if (applet == null || configuration == null)
return;
String wholeredirectionString = getRedirectionString(itemID, itemType, query, DisplayGO, organismdependentquery... |
5d60a1a7-c2db-4e37-b679-31b80088bc3b | 8 | private void getParameters(Keyword method, String[] argument) throws Exception {
parameters.put(Keyword.METHOD, method.toString().toLowerCase());
startType = TimeType.NONE;
endType = TimeType.NONE;
String key, value;
Keyword argType;
for (int i = 0; i < argument.... |
7b82c465-f470-4530-9167-18876f772156 | 0 | public ClientOutputThread(Socket socket)
{
this.socket = socket;
} |
0d055690-4e13-418a-88ea-670e4f05cd99 | 0 | @Override
public String getHouseNumber() {
return super.getHouseNumber();
} |
fe30213e-b578-4e51-9f6b-16dce19a9e45 | 8 | private void JoinTuples (Tuple tuple1 ,Tuple tuple2)
{
//increase count outcome tuples because this join produces a tuple
this.countOutcomeTuples++ ;
//Constructing a new bitmap for new integrated tuple
//==========================NEW READY BITS=======================================
int newReadyBits ;
in... |
839eb4c2-321f-4e44-81d6-baaa63da5406 | 7 | @Override
public boolean matches(Object argument) {
if (argument instanceof PropertyChangeEvent) {
PropertyChangeEvent event = (PropertyChangeEvent) argument;
return propertyName.equals(event.getPropertyName()) &&
((oldValue == null && event.getOldValue() == null) ||
(old... |
4a9ba68c-db62-468f-845a-f8f144a944d2 | 2 | public void go() {
int index = 0;
try {
while(index < 1330) {
new Thread(new Crawler(index)).start();
index++;
}
} catch(Exception ex) {}
} |
6f1caa0d-b88f-4775-9b5f-b10e912adfea | 3 | @Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof IDs)) return false;
IDs iDs = (IDs) o;
if (!Arrays.equals(ids, iDs.ids)) return false;
return true;
} |
290f78c3-dfa9-4120-8816-07766faba003 | 5 | public static void printLCS(int[][] c, int[] x, int i, int j) {
if(i == 0 || j == 0){
return;
}
if(c[i][j] != c[i - 1][j] && c[i][j] != c[i][j - 1]){
printLCS(c, x, i - 1, j - 1);
System.out.print(x[i - 1] +",");
}else if(c[i][j] == c[i - 1][j]){
printLCS(c, x, i - 1, j);
}else{
printLCS(c, ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.