method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
f4e77e59-3285-4c41-ba79-65f9871f5486 | 5 | public void actionPerformed(ActionEvent action) {
if(action.getSource().equals(connect)) {
int desired = 48;
try {
pf.setString("connect_hostname", serverName.getText());
pf.setInt("connect_port", Integer.parseInt(portNum.getText()));
pf.setInt("listen_port", Integer.parseInt(localServerPortnum.... |
4107a353-c2b6-49ff-b911-75212663a2ef | 0 | public String getSumbitIp() {
return this.sumbitIp;
} |
c2682a99-e014-473f-bf96-a329b2ea920c | 5 | private static double[] getSupportPoints(int lineNumber, double[] lowPrices) {
double[] sPoints = new double[lineNumber];
for(int i =0;i<lineNumber-1;i++){
double price = 999999999;
for(int j=-5;j<=0;j++){
if((i+j>=0) && (i+j<lineNumber-1) && lowPrices[i+j]<pri... |
d2f35471-1098-4761-ac0f-b660491c011a | 9 | public boolean execute() {
try {
updateGraph();
System.out.print(name+": ");
// initialize output streams
FileOutputStream fos = null;
PrintStream pstr = System.out;
if( baseName != null )
{
String fname = fng.nextCounterName();
fos = new FileOutputStream(fname);
System.out.println("writing to file "+... |
6e91983b-42fc-4564-873d-6a14b5a10f72 | 3 | public Actor getActor(int x, int y){
for (Actor actor : actorList){
if (actor.getPosX() == x && actor.getPosY() == y){
return actor;
}
}
return null;
} |
65079e01-01f2-4a1f-aea4-2ad6c4144db3 | 9 | public void run() {
// Call to
// /api/0.1/getBugs?b=36.17496&t=61.03797&l=-9.9793&r=31.54902&ucid=1
// Reply is something like: putAJAXMarker(552542, 6.971592, 50.810296,
// 'Strassensystem auf Friedhof fehlt [TobiR, 2010-08-09 23:30:37
// CEST]', 0);
try {
S... |
d463f543-be22-49c7-8b8d-00ed0d0db462 | 5 | public void draw(Graphics2D g) {
for(
int row = rowOffset;
row < rowOffset + numRowsToDraw;
row++) {
if(row >= numRows) break;
for(
int col = colOffset;
col < colOffset + numColsToDraw;
col++) {
if(col >= numCols) break;
if(map[row][col] == 0) continue;
... |
f8ad3a7f-fc84-47a9-9220-45b5c3c7242d | 3 | @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onSignChange(final SignChangeEvent changing) {
final List<String> worldFilters = this.worlds.get(changing.getBlock().getWorld().getName());
if (worldFilters == null) return;
final String[] lines = changing.g... |
dfd7c954-396c-46e8-a184-0791123dbdcc | 9 | public boolean isConvex() throws TypeOverflowException {
int signPlus = 0,
signMinus = 0;
double z;
int n = vertices.size();
for (int i = 0; i < n; ++i) {
int j = (i + 1) % n;
int k = (i + 2) % n;
z = (vertices.get(j).x - vertices.get(i).x) * (vertices.get(k).y - vertices.get(j).y);
z -= ... |
26893a90-5f4d-488a-ad3b-bc25e1a31ce7 | 6 | public ArrayList<ConnectedComponent> findTrajectory()
{
ArrayList<ConnectedComponent> traj = new ArrayList<ConnectedComponent>();
boolean searched[][] = new boolean[_height][_width];
for (int x = 50; x < _width - 50; x++)
for (int y = _groundLevel - 1; y > _height * 0.1; y--... |
f117c9ca-eb2d-4382-8bbc-e287e1f56802 | 9 | private boolean safe(boolean[][]board, int i, int j) {
int d45x = j + i, d135x = j - i;
for (int k = 0; k < board.length; k ++) {
if (board[i][k]) return false;
if (board[k][j]) return false;
if (d45x - k >= 0 && d45x - k < board.length && board[k][d45x - k]) return f... |
f04e82cc-8fc8-4da2-a515-3ee86decf1ad | 1 | public static void clearLowInventoryTable(DrugInventoryPage drugP){
int rows= drugP.getLowInventoryTable().getRowCount();
for(int i=0;i<rows;i++){
drugP.getLowInventoryTable().setValueAt("",i,0);
}
} |
b38b6864-cb23-475d-8cb4-10f17b43a26a | 2 | private Repository getRepository(String organizationName, String repositoryName) throws IOException {
for (Repository repository : getRepositories(organizationName)) {
if (repository.getName().equals(repositoryName)) {
return repository;
}
}
// We... |
08abde70-fdd2-4785-abc2-7f11dfe9fdf8 | 3 | public static void combatinitialize() {
int enemyInit; //enemies Initiative
int playerInit; //Players Initiative
Random rnd = new Random();
do{
enemyInit = rnd.nextInt(10) + 3; //Randomize chance Variable for enemy Initiative
playerInit = rnd.nextInt(10) + 1; //Randomize chance Variable for Player Initia... |
dec939e8-622b-41b1-8b0f-f598ddced40c | 2 | private void addFleatingSpring() {
if (getModel().getView().isClicked()) {
double x = getModel().getView().getLastMousePosition().x;
double y = getModel().getView().getLastMousePosition().y;
Mass fleatingMass = new MoveableMass(x, y, 1);
if (myCurrentMass == null)... |
149e9d13-7fcb-4845-a3aa-e705a38c9f6f | 6 | public static void main(String[] args) {
// TODO Auto-generated method stub
// set variables for port, socket
final int port = 3344;
Socket sock = null;
// set variables for RSAKeySize, public key, private key
final int RSAKeySize = 1024;
PublicKey pubKey = null;
PrivateKey priKey = null;
Key serverPu... |
c4e61481-a13c-4684-936c-91bac6822d99 | 3 | public void addItem(int type){
for(int i = 0; i < invCount; i++){
if(inv[i].type == 0){
inv[i].type = type;
if(invCount < inv.length)invCount++;
break;
}
}
} |
85ab2a9d-ab1e-4981-85d3-062d237cf4a7 | 6 | private String getVariablesList() {
StringBuilder list = new StringBuilder();
for ( int i = 0; i < sqlVariables.size(); i++ ) {
if ( i % 5 == 0 && i != 0 )
list.append( "\n" + TAB + TAB + TAB );
switch ( databaseType ) {
case H2:
case ORA... |
6f95d521-0068-43c4-a17b-ce57303dae37 | 0 | public void PaymentHandler(){} |
cea3d6a1-fe3e-4597-93ea-41739a4729ea | 9 | public static void export(ResolveReport resolved,String output,String classpath,String pattern,String pathprefix) throws IOException {
File outputPath = new File(output);
if( !outputPath.exists() )
outputPath.mkdirs();
if( !outputPath.exists() || !outputPath.isDirectory())
throw new RuntimeExceptio... |
84504ecc-407a-4aa3-b141-cd7d9d93b289 | 2 | private static void eliminarTienda()
{
boolean salir;
Integer idTienda;
do
{
try
{
System.out.print( "Introduce el Id de la tienda: ");
idTienda = Integer.parseInt( scanner.nextLine());
Tienda.eliminar( idTienda);
System.out.println( "- Tienda id " + idTienda + " eliminada del registr... |
bd7dbe32-b2fe-41dd-b828-e2ad7b419cc4 | 5 | private Piece checkCase(Piece[] B,int X, int Y,boolean isCapture) {
if (!(Utils.isVoid(B,X,Y))) {
Piece obstacle = Utils.getPiece(B,X,Y);
//Warning : pawn can move only to capture vertically
if ((isCapture) && (obstacle.isWhite()!=null) && (isWhite()!=obstacle.isWhite())) {
possibleMoves.add(obstacle.get... |
e10fc2ba-4c17-4ed4-8bcc-41e14756bfd2 | 9 | public static String pad(String s) {
if (s.length() == 0) return " ";
char first = s.charAt(0);
char last = s.charAt(s.length()-1);
if (first == ' ' && last == ' ') return s;
if (first == ' ' && last != ' ') return s + " ";
if (first != ' ' && last == ' ') return " " + s;... |
544c5d5d-ad75-4c71-bb9e-cf9d055f6ea4 | 0 | public FlacPicture(PropertyTree parent) {
super(MediaProperty.PICTURE, parent);
} |
45392646-1406-4b0a-a0a5-a1db4ed82e0e | 6 | public void addAP(MapleClient c, byte stat, short amount) {
MapleCharacter player = c.getPlayer();
switch (stat) {
case 1: // STR
player.getStat().setStr(player.getStat().getStr() + amount);
player.updateSingleStat(MapleStat.STR, player.getStat().getStr());
... |
52aa432c-6b4c-4101-9f91-8e475b1abc16 | 7 | public void startElement(String uri, String localName, String qName, Attributes attributes) {
String value;
if (qName.equals("eblast")) {
if ((value = attributes.getValue("port")) != null) mSettings.setPort(Integer.valueOf(value));
if ((value = attributes.getValue("maxpeers")) != null) mSettings.setMaxPeers(I... |
9c38a6b4-3240-4b68-928b-5f097c9684f0 | 3 | private void setTimerDelay() {
switch (gameState.getDifficultyLevel()) {
case GameState.DIFFICULTY_EASY:
changePinTimer.setInitialDelay(randomGen.nextInt(10000) + 10000);
changePinTimer.restart();
break;
case GameState.DIFFICULTY_MEDIUM:
... |
9b5cdd16-b704-492c-8375-237c2ed11d1a | 0 | public int getRound()
{
return round;
} |
919cbf68-3319-4e48-8b7f-d0326caf51bd | 7 | @Override
public Object invoke(Object proxy, Method method, Object[] args)
throws Throwable {
Class declaringClass = method.getDeclaringClass();
if (declaringClass == Object.class) {
if (method.equals(hashCodeMethod)) {
return proxyHashCode(proxy);
} else if (method.equals(equalsMethod)) {
return... |
8241d96e-d66c-4225-a99f-19ad9a33eeda | 9 | public static <E> Map<E,int[][]> intTwoDArrayMapCopy(Map<E,int[][]> map) {
Map<E,int[][]> copy = null;
if (map instanceof HashMap<?,?>) {
copy = new HashMap<E,int[][]>();
} else if (map instanceof TreeMap<?,?>) {
copy = new TreeMap<E,int[][]>();
}
for (E e... |
1412117d-5251-487e-a8ff-c15bc1e74ba7 | 4 | Power(String name, int properties, String imgFile, String helpInfo) {
this.name = name ;
this.helpInfo = helpInfo ;
this.buttonTex = Texture.loadTexture(IMG_DIR+imgFile) ;
this.properties = properties ;
} |
e4c6ee96-d37d-4dd6-bffd-e7a7defa702a | 0 | @Override
public void execute(VirtualMachine vm) {
super.execute(vm);
((DebuggerVirtualMachine) vm).enterFunction();
((DebuggerVirtualMachine) vm).saveFunctionArgs(functionArgList);
((DebuggerVirtualMachine) vm).saveFunctionAddress(address);
} |
4fe56392-1342-46fd-b3a1-8f614fa01a21 | 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();
... |
d1a68107-1ced-4340-9500-b27c00480e7e | 5 | @Override
public boolean execute(RuleExecutorParam param) {
Rule rule=param.getRule();
String compareValue=rule.getValue();
try {
if(!Util.isNullOrEmpty(compareValue)){
Class<? extends RuleExecutor> methExe= Thread.currentThread().getContextClassLoader().loadClass(compareValue.trim()).asSubclass(RuleEx... |
c767111e-3d12-491b-b7f4-581a98ef3b7b | 1 | public String getLstServicios() {
String lista = "";
for (Servicio s : lstServicios) {
lista += s;
}
return lista;
} |
874f7d8e-b42c-449a-bfdf-71135aa9f17f | 5 | @Override
public void onEnable() {
reloadPlugin();
joinListener = new PlayerJoinListener(this);
moveListener = new PlayerMoveListener(this);
if (getConfig().getBoolean("options.allow-plugin-metrics", true)) {
try {
metrics = new Metrics(this);
me... |
01ff49dd-7d46-4369-a049-8217206f1f21 | 3 | public NodeId (byte[] bytes) {
Objects.requireNonNull(bytes);
if (bytes.length != 20) {
throw new IllegalArgumentException("invalid length");
}
this.bytes = Arrays.copyOf(bytes, bytes.length);
this.hash = Arrays.hashCode(bytes);
// Hex String
String... |
6a2a1d3c-6057-41f5-8912-6e573c36331a | 5 | @Override
public void run() {
while (cloudMap.getNoMaps()<CloudMapPanel.sampleSize && !stop) {
cloudMap.addMaps( 1 );
try {
Thread.sleep( 5 );
}
catch (InterruptedException e) {
e.printStackTrace();
}
}
... |
cb1e7aca-a802-4cb5-8c3d-420ece77c4cf | 0 | public int getInvalidRxCount() {
return invalidRxPackets;
} |
778add1f-0c31-43ef-a6f4-f09810c2326a | 4 | private JMenu createFillMenu(){
fill = new JMenu("Fill");
algorithmZatravki = new JCheckBoxMenuItem(new AbstractAction() {
@Override
public void actionPerformed(ActionEvent arg0) {
// TODO Auto-generated method stub
if(algorithmZatravki.isSelected()){
algorithmZatravki.setSelected(false);
... |
e5d10035-67ee-49ad-8012-7ece5f27cf41 | 6 | @Override
public boolean useItem(Player player, int type) {
Block block = Block.blocks[type];
if (block == Block.RED_MUSHROOM && minecraft.player.inventory.removeResource(type)) {
player.health += 4;
if (player.health > 30) {
player.health = 30;
}
... |
9401a922-ceea-49d1-b337-cf4378ecb4ff | 6 | @Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof OAuthToken)) return false;
OAuthToken that = (OAuthToken) o;
if (secretKeySpec != null ? !secretKeySpec.equals(that.secretKeySpec) : that.secretKeySpec != null)
return false;
... |
11345377-f47c-4669-8d16-818ca4c09aee | 4 | private Submission is_rankier( List<Submission> input ) {
if ( input.isEmpty() ) return null;
Submission winner = null;
for ( Submission s : input ) {
if ( winner == null ) {
winner = s;
}
else {
if ( s.card.rank() > winner.car... |
54ea5d82-a5fa-40c4-8f2b-7a87cf856241 | 1 | public void warn(final String msg) {
if(disabled) return;
else logger.warning(msg);
// System.out.debug(route_name + "-" + connection_id + "[warn]: " + msg);
} |
fcec3b8c-920a-4813-8420-f7a9af61a4f2 | 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... |
26887adf-641e-47da-9018-37fc0264df2e | 8 | public int stepthrough(int i) {
switch(sim40.memory[i]) {
/* stop */
case 0: this.isProgramTerminated = true;
return i;
/* print, printb, printch */
case 1: case 2: case 3:
this.stdStream.getOutput().add(result(i));
++i;
break;
default:
/* jump, comp, xcomp, ycomp, jineg, jipos, jizero, j... |
cc72d66d-135c-4a92-b42a-6876cdce1e0b | 8 | private Vector<String> getNext() throws ServerException {
if (m_exhausted) return null;
try {
if (m_rs.next()) {
Vector<String> result = new Vector<String> ();
Integer recordKey = m_rs.getInt(1);
result.add(m_rs.getString(2));
D... |
1c51acf5-10a0-400d-8135-352693e738c7 | 3 | public static Collection getDatas(Collection result, ResultSet rs, Class clazz) {
try {
while (rs.next()) {
//创建类的实例
Object vo = clazz.newInstance();
//获取本对象的属性
Field[] fields = clazz.getDeclaredFields();
//获取父类的属性
// Field[] superFields = clazz.getSuperclass().getDeclaredFields();
/... |
7ef2a75b-2113-435a-b50a-fccf079ef0ed | 8 | private void search(int step){
searchCount++;
if(searchCount%100000==0){
System.out.println("Search count:"+searchCount);
}
int estimate=lowerBound(curPancakes);
if(step+estimate>curPancakes.size()*2) return;
if(isSorted(curPancakes) && step<minSwap){
minSwap=step;
finalResults=new ArrayLi... |
984eadd9-6bd8-480f-a52f-ac83d8e67c19 | 8 | public void leavePercentageOutSplit(String filename, int percentage, boolean random) {
List<Bookmark> trainLines = new ArrayList<Bookmark>();
List<Bookmark> testLines = new ArrayList<Bookmark>();
Set<Integer> indices = new HashSet<Integer>();
int currentUser = -1, userIndex = -1, userSize = -1;
for (int i = 0... |
de2db3ae-aba8-4a8d-b16b-dfe76ba44b38 | 0 | public EncryptionPropertiesType getEncryptionProperties() {
return encryptionProperties;
} |
154c7693-0d2b-41e3-8eaf-ee999271c86b | 4 | @Override
public boolean containsAll(Collection<?> c) {
int count = 0;
for(Object o : c) {
if(this.contains(o)) {
count++;
}
}
if(count == c.size()) {
return true;
}
return false;
} |
58750307-4554-4129-96a0-cdc9650ca5ac | 6 | @Override
public void quickPlay( boolean priority, boolean toStream, boolean toLoop,
String sourcename, FilenameURL filenameURL, float x,
float y, float z, int attModel, float distOrRoll,
boolean temporary )
{
SoundBuffer b... |
65ec7b63-ace2-4762-9f4e-157f68f0f3f9 | 4 | public String toString() {
String output = "suited: \n";
for (int i = 0; i < suitedPreFlop.length; i++) {
for (int j = 0; j < suitedPreFlop[i].length; j++) {
output += "\t" + suitedPreFlop[i][j];
}
output += "\n";
}
output += "\nunsuited: \n";
for (int i = 0; i < unsuitedPreFlop.length; i++) {
... |
7a1216d2-3bd0-4988-ab74-1030a0c8a392 | 0 | @Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + bitsPerSample;
result = prime * result
+ (int) (frameDataStart ^ (frameDataStart >>> 32));
result = prime * result + Arrays.hashCode(md5);
result = prime * result + numChannels;
result = prime * result +... |
deb400c0-0015-4008-b8a2-e9423422d2c9 | 8 | * @param destination the array to hold the conversion
* @param destOffset the index where output will be put
* @param options alphabet type is pulled from this (standard, url-safe, ordered)
* @return the number of decoded bytes converted
* @throws NullPointerException if source or destination arrays ar... |
5f86142b-14c6-496c-b66a-91f5a4b7c64e | 3 | private void fireDebuff()
{
int[] debuffList = getDebuffs();
ArrayList <Integer> numDebuffs = new ArrayList<Integer>();
for (int i = 0; i < debuffList.length; i++){
if (Math.random() <= Data.debuffChance[debuffList[i] ] ){
numDebuffs.add (debuffList[i]);
... |
c097829d-dcf9-4263-9bad-0395885b251b | 1 | public void fillDialogFields(StockItem stockItem) {
if (stockItem != null) {
barCodeField.setText(stockItem.getId() + "");
getNameField().setText(stockItem.getName());
String priceString = String.valueOf(stockItem.getPrice());
priceField.setText(priceString);
... |
d4f9cc7f-2478-42d3-84d4-696170a248a1 | 4 | public String compareCountryRank(Stats previousStats)
{
if(previousStats == null)
return "";
if(previousStats.getCountryRank() < 1)
return "";
double delta = previousStats.getCountryRank() - getCountryRank();
if(delta == 0D)
return "";
return "<font color=" + (delta >= 0 ? "green" : "red") + ">(" + ... |
356cc3b2-e929-4e95-94df-a0ce3c38cf25 | 9 | public String getAsString(FacesContext context, UIComponent component,
Object value) {
if (context == null || component == null) {
throw new NullPointerException();
}
try {
// If the specified value is null, return a zero-length String
... |
1b2fbe70-92d0-4d71-ad29-73761a8173af | 6 | public static void set(int addr, int val) {
val &= 0xFF;
if (Util.inRange(addr, 0, 0x00EF)) { // Zero page
mem[addr] = val;
return;
} else if (Util.inRange(addr, 0x00F0, 0x00FF)) { // Function registers
writeReg(addr, val);
return;
} else if (Util.inRange(addr, 0x0100, 0x7FFF)) { // Sound RAM
mem... |
1b387613-1b0b-41b5-a909-5c6756c77f5c | 5 | public void zoomImage()
{
//For clarity of code, create some variables to hold slide dimensions
//and original image dimensions
int slideWidth = hostSize.width;
int slideHeight = hostSize.height;
int originalWidth = getMainImage().getWidth(null);
int originalHeight = getMainImage().getHeight(null);
//De... |
ffd3e62e-e51d-4ba3-a704-bd131f23eaa0 | 9 | static void draw_sprites(osd_bitmap bitmap)
{
int offs;
if (zaxxon_vid_type == CONGO_VID)
{
int i;
/* Draw the sprites. Note that it is important to draw them exactly in this */
/* order, to have the correct priorities. */
/* Sprites actually start at 0xff * [0xc031], it seems to be static tho'*/... |
3c111a02-8932-4034-9430-6baf773563c9 | 7 | public static int[] loadSource(String filepath, int maxSources, boolean looping) {
// Load .wav data into a buffer.
int buffer = AL10.alGenBuffers();
int error = AL10.alGetError();
if(error != AL10.AL_NO_ERROR) {
System.err.println("Encountered AL error code " + error + "!");
System.exit(-1);
}
//Lo... |
62320504-3161-4ad5-a1c7-c462735521bf | 6 | @Override
public void crearFichero(String ruta)
{
FileInputStream from = null;
FileOutputStream to = null;
File toFile = new File(ruta + this.getMetadato("nombre") + this.getMetadato("extension"));
try
{
from = new FileInputStream(this.audio);
... |
3dd05e2b-2aef-4ee2-986f-7fcada3ec345 | 3 | public List<String> getAllValidAliases()
{
List<String> list = new ArrayList<>();
for(String alias : backingMap.keySet())
{
list.add(alias);
}
for(String alias : aliasesMap.keySet())
{
if(aliasesMap.get(alias).valid())
{
list.add(alias);
}
}
return list;
} |
226135bb-7b42-423b-93e3-165367520f15 | 9 | public final static boolean isLongOp(final Object obj0, final Object obj1) {
return (obj0 instanceof Long
|| obj1 instanceof Long
|| obj0 instanceof Integer
|| obj1 instanceof Integer
|| obj0 instanceof Character
|| obj1 instanceof ... |
29423f04-5bf4-4e8d-99a2-538b251de029 | 7 | public boolean moveEast(int w)
{
boolean moved = false;
if(isFighting==false && isConcious() && getEnergy()>0)
{
if(w==3 || w==4)
{
setX(getX()+1);
moved = true;
}
else if(w>=10)
{
updateLoc... |
d18b3fa0-4158-4a84-955d-1902f90e5092 | 1 | public static String toLanguageTag(Locale locale) {
return locale.getLanguage() + (hasText(locale.getCountry()) ? "-" + locale.getCountry() : "");
} |
b58ba7bd-4e74-4193-8595-861077c04335 | 9 | public Release calculateDelta(File aTopTempDir, File aTempXmlDir,
File aTempMD5Dir) throws Exception
{
int nbDeleted = 0;
int nbCreated = 0;
int nbModified = 0;
// create a temp release
File releaseTempDir = FileSystem.createTempDirectory("release-",
... |
c3a54f57-6245-410a-83d4-b37691244e1e | 2 | @Override
public String[] getTableRenameStatements(String oldTableName,Class<?>oldClass, String newTableName,Class<?>newClass)
{
String [] res = new String[2];
res[0] = "CREATE TABLE "+newTableName+" AS SELECT * FROM " +oldTableName+" WITH DATA";
res[1] = "DROP TABLE " + oldTableName;
return res;
} |
6fa49212-583c-4c83-8056-f79db0cfdbae | 4 | public static int getSailplaneTensionUnit() throws ClassNotFoundException {
int weightUnit = 0;
try{
//Class derbyClass = RMIClassLoader.loadClass("lib/", "derby.jar");
Class.forName(driverName);
Class.forName(clientDriverName);
}catch(java.lang.ClassNotFoundE... |
793c674e-77d2-47c8-8ebe-d0b84dfee41a | 3 | private boolean isWhitespace( int v ) {
return ( v == 0x20 || v == 0x09 || v == 0x0A || v == 0x0D );
} |
179fe910-7987-4572-85d2-35b06e473744 | 5 | @Override
protected boolean doStep() {
double minDeltaCost = Double.MAX_VALUE;
Move11 bestMove = null;
boolean moveFound = false;
Set<Move11> moves = generator.getMoves();
for (Move11 move : moves) {
if (move.getDeltaCost() < minDeltaCost &&
move.... |
029ff498-9cf6-43c5-9164-e3b97d218887 | 3 | public ConfigurationSection getConfigurationSection(String path) {
Object val = get(path, null);
if (val != null) {
return (val instanceof ConfigurationSection) ? (ConfigurationSection) val : null;
}
val = get(path, getDefault(path));
return (val instanceof Configura... |
6fedd957-5661-4a1d-85db-e6e3461ca179 | 7 | public static boolean copyFile(File from, File to, byte[] buf) {
if (buf == null) buf = new byte[BUFFER_SIZE];
FileInputStream from_s = null;
FileOutputStream to_s = null;
try {
from_s = new FileInputStream(from);
to_s = new FileOutputStream(to);
for(int bytesRea... |
5aa26768-fab1-4ae8-978b-0e549bc41f65 | 7 | public static void main(String[] args)
{
File dictionary = null;
File document = null;
String option = "";
if(args.length < 2 || args.length > 3)
{
System.out.println("Incorrect number of arguments!");
return;
}
dictionary = new File(args[0]);
if(!dictionary.isFile()){
System.out.printl... |
c81337c6-771c-4b26-b403-35469035da58 | 6 | public void connect() throws IOException {
if (level != 0) // otherwise disconnected or connect
throw new SocketException("Socket closed or already open ("+ level +")");
IOException exception = null;
Socket s = null;
for (int i = 0; i < ports.length && s == null; i++) {
try {
s = new Socket(host, port... |
c4f28d2f-0e9a-4f41-acfb-be5fdcd90e6c | 1 | public static boolean getKeyUp(int keyCode)
{
return !getKey(keyCode) && lastKeys[keyCode];
} |
428eb980-8f72-4260-bfe4-f0e2cfdb1145 | 9 | public static void boostByMarketingTagMatch(ScoredSolrDoc doc, String keyword, float boost) {
if (doc == null || keyword == null)
return;
if (boost <= 0)
boost = 5.0f;
List<String> keywordList = StringUtil.stringToStringList(keyword, "[ ]");
int keywordCount = keywordList.size();
// to keep the... |
733580c3-223a-4a12-b0bd-8f7db5d2053c | 6 | public static final boolean method983(int z, int x, int y) {
int l = Canvas_Sub1.anIntArrayArrayArray52[z][x][y];
if (l == -Class142_Sub10.anInt3361) {
return false;
}
if (l == Class142_Sub10.anInt3361) {
return true;
}
int i1 = x... |
850bf086-f516-44ba-a1b1-0754a7152ff6 | 7 | private void changeValueRandomly(Random r, int numOfValues,
int indexOfAtt,
Instance instance,
boolean useMissing) {
int currValue;
// get current value
// if value is missing set current value to nu... |
d4f1f645-4499-4144-a520-0f0ca5122b21 | 1 | private void paintEnemyPath(Graphics2D g2, Iterable<Point> enemyPath) {
g2.setColor(Color.gray);
for (Point currentGridPoint : enemyPath) {
g2.fill(new Rectangle(GlobalPositioning.getXPixel(currentGridPoint.getX()), GlobalPositioning.getYPixel(currentGridPoint.getY()),
B... |
4cd8ef7a-5687-46eb-92d8-8d2fad0cc641 | 9 | public static String getModifierKeyText() {
boolean isMac = (System.getProperty("os.name").startsWith("Mac"));
String text = "";
if ((MENU_SHORTCUT_KEY_MASK & InputEvent.SHIFT_MASK) == InputEvent.SHIFT_MASK) {
text = "Shift";
}
if ((MENU_SHORTCUT_KEY_MASK & InputEvent.CTRL_MASK) == InputEvent.CTRL_MASK)... |
1714cfe9-dd1b-46ce-9f40-b42a26ac66ce | 3 | public void setNextMessage() {
try{
clearMessageBoard();
message1 = message[currentMessageIndex].substring(0,message[currentMessageIndex].length() > 40 ? 40 : message[currentMessageIndex].length());
message2 = message[currentMessageIndex].length() > 40?message[currentMessageI... |
4cced1fb-24fa-42ec-b78c-b6bbaed7c56e | 5 | private static TobiiHeader readHeader(CSVReader reader) throws IOException {
TobiiHeader header = new TobiiHeader();
//
// SYSTEM PROPERTIES section
String line[] = reader.readNext();
assert(line[0].equalsIgnoreCase("System Properties:"));
line = reader.readNext();
assert(line[0].equalsIgnoreCase... |
6ffeba2b-2ad3-4dac-8944-06d072fcaea6 | 0 | @PersistenceContext
public void setEm(EntityManager em) {
this.em = em;
} |
5e9a1f11-4d81-489d-95d7-17236b490abf | 2 | private void initCharacterFlowPane() {
ColorUtil picker = new ColorUtil();
for (int k = 0; k < 10; k++) {
FlowPane content = new FlowPane();
TitledPane tPane = new TitledPane();
tPane.setText("Test_" + k);
/**
* Add content *
*/... |
dccb1557-8fa2-4f0d-94bc-6d3d16eb268b | 8 | public static boolean isSupportedOutputFormatType(String format, String type)
{
if (!isSupportedOutputFormat(format))
{
return false;
}
if (format == ThumbnailParameter.ORIGINAL_FORMAT
&& type == ThumbnailParameter.DEFAULT_FORMAT_TYPE)
{
return true;
}
else if (format == ThumbnailParameter.O... |
46063373-85aa-4527-bb57-462bd1ba4aad | 9 | static final int method1812(int i) {
anInt2122++;
if (Class213.aBoolean2510) {
return 6;
}
if (i != 5) {
LOCAL_PLAYERS_INDEXES_COUNT = -106;
}
if (Node_Sub38_Sub23.aCacheNode_Sub13_10343 == null) {
return 0;
}
int i_5_ = Node_Sub38_Sub23.aCacheNode_Sub13_10343.anInt9562;
if (Class251.method31... |
442e4b10-a55e-45a0-92a4-f824fae69175 | 1 | private List expand(List symbols) {
if (contexts == null)
return expandNoContext(symbols);
return expandContext(symbols);
} |
060a0fb1-c41c-4d6e-a217-c9d4ad0eba01 | 1 | static public TreeMap<Integer, TreeSet<Integer> > graphBuilder(String fichierTexte)
{
TreeMap<Integer, TreeSet<Integer> > tmpNoeuds = new TreeMap<Integer, TreeSet<Integer> >();
StringTokenizer tokenizer = new StringTokenizer(fichierTexte);
while (tokenizer.hasMoreTokens()) {
Integer token = Integ... |
c0293682-e6e1-4773-bbe7-7f60439bcfe6 | 7 | public static boolean isDouble(String DBL)
{
if (DBL.length() == 0)
return false;
if (DBL.startsWith("-") && (DBL.length() > 1))
DBL = DBL.substring(1);
boolean alreadyDot = false;
for (int i = 0; i < DBL.length(); i++)
{
if (!Character.isDigit(DBL.charAt(i)))
{
if (DBL.charAt(i) == '.')
... |
07b01157-8e56-4954-b921-c6641c53c595 | 2 | @Override
public void addMedia(String name, String year, String genre,
Object[] objects, int duration, int mediaType) throws SQLException {
CallableStatement stMedia = null;
CallableStatement stCreator = null;
try {
connection.setAutoCommit(false);
//parameters: username, password, name, year, genre, du... |
c5d5436c-73a3-4fdb-b924-b00e86fc5a85 | 4 | @Override
public void mouseMoved(MouseEvent e) {
if (state == 0) {
if (e.getX() > getWidth() / 2 + 16) {
user.setFacingRight(true);
} else {
user.setFacingRight(false);
}
if (user.getInHand() instanceof ProjectileShooter)
if (user.isFacingRight())
((ProjectileShooter) user.getInHand()).s... |
2afd37d3-97c8-4735-8309-a5d43d06abb0 | 0 | private void refFtActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_refFtActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_refFtActionPerformed |
68123f83-18db-4892-851e-1d10554d502c | 3 | public boolean equals(Network A){
boolean result = true;
if(numNodes == A.getNumNodes()){
for(int i=0; i<numNodes; i++){
if(!Arrays.equals(nodes.get(i).getInputs(), A.getNodes().get(i).getInputs())){
result = false;
}
}
}
else{
result = fa... |
ee9b286c-67f4-484c-8c29-0bf727f0e513 | 0 | @Override
public void documentAdded(DocumentRepositoryEvent e) {} |
b1b5dca0-bc78-44c6-85bf-cd8bec7cfd68 | 8 | public int step()
{
boolean found=false;
boolean growth=false;//used to check growth of the search
GridCell goal = GridCell.getgoalCell();
@SuppressWarnings("unchecked")
Vector<GridCell> temp = (Vector<GridCell>) edge.clone();
for(int i=0;i<temp.size();i++)//runs as many ti... |
79f85382-6996-4f9d-b453-fb38cda576ab | 3 | private static void copyPri(File inputFile, File outputFile,
boolean isOverWrite) throws IOException {
// 是个文件。
if (inputFile.isFile()) {
copySimpleFile(inputFile, outputFile, isOverWrite);
} else {
// 文件夹
if (!outputFile.exists()) {
outputFile.mkdir();
}
// 循环子文件夹
for (File child : ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.