method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
191c6725-0d7b-471f-b2b7-8f72bbc4843a | 2 | public void addMessage(String message) {
boolean scrollDown = isChatAtBottom();
if (!isFirst)
textArea.append("\n" + message);
else {
textArea.append(message);
isFirst = false;
}
if (scrollDown) {
moveChat2Bottom();
}
} |
276f75ca-548c-4895-a3f2-fef72e794140 | 4 | @Override
public void startListening() {
if (this.state == ServerState.Running) return;
this.state = ServerState.Running;
this.serverRunner = new Thread(new Runnable() {
@Override
public void run() {
while (state == ServerState.Runnin... |
ed2319eb-89b2-44d5-8495-d4c7db9f01a5 | 1 | public void makeDeclaration(Set done) {
if (constant != null) {
constant.makeDeclaration(done);
constant = constant.simplify();
}
} |
0549ca8e-440f-47d8-9ccc-610bc9a26280 | 3 | private synchronized ByteBuffer unwrap() throws SSLException {
int rem;
do {
rem = inData.remaining();
engineResult = sslEngine.unwrap( inCrypt, inData );
engineStatus = engineResult.getStatus();
} while ( engineStatus == SSLEngineResult.Status.OK && ( rem != inData.remaining() || engineResult.getHandsha... |
6136418a-bd13-4a49-a6ed-04de5be29050 | 7 | public int availableMissile(){
mCurTime=System.nanoTime();
if(missileTime<=1500000000l){
if(mSparks){
if(index==3){
temp = User.getMissile1Pos();
rot.rotX(Math.PI/2);
temp.mul(rot);
new WrapParticles(75,20,1,init,last,10000,temp,sceneBG).run();
}
if(index==4){
temp = User.... |
fece87c0-6545-414d-8995-1f722e86eb5c | 3 | private void init(Stage primaryStage) {
Group root = new Group();
Scene scene = new Scene(root);
primaryStage.setResizable(true);
primaryStage.setScene(scene);
primaryStage.setTitle("Draw App");
final MainWindow mainWindow = new MainWindow();
root.getChildren().add(mainWindow);
Reader reader;
if (T... |
be5f1ed4-8e1e-4c51-af2f-3da801ccc3c9 | 5 | private int determineCurrentFrame() {
boolean animationJustCompleted = false;
if (animinationStartTime == -1)
animinationStartTime = System.nanoTime() / 1000000;
long currentTime = System.nanoTime() / 1000000;
// Check if the animation has exceeded its specified overall dur... |
3d834f01-1351-48b8-88ee-106728d0594e | 9 | public ValueRepresentation evaluateVariable(XPathContext context) throws XPathException {
Controller controller = context.getController();
Bindery b = controller.getBindery();
boolean wasSupplied;
try {
wasSupplied = b.useGlobalParameter(
getVariableQName(... |
4063fcaa-0325-4940-8634-a5b2167c8154 | 2 | public DistanceBall(Ball b, double referencePoint) {
double xVelocity = b.getXVelocity();
double yVelocity = b.getYVelocity();
double centerX = b.getCenterX();
double centerY = b.getCenterY();
double radius = b.getRadius();
this.numberMoves = Math.abs((int) Math.floor(distance(referencePoint, xVelocity, cen... |
94e5c9ee-912e-4c5f-9238-26effbf5c685 | 2 | public static Language createNew(Connection con, String id, String name, String persPron)
{
Language lang = null;
try
{
PreparedStatement ps = con.prepareStatement(
"INSERT INTO " + tableInfo.tableName
+ " VALUES (?, ?, ?)",
Statement.RETURN_GENERATED_KEYS);
ps.setString(1, id);
ps.setStr... |
ccfa31bf-7049-4806-88c3-c407a9a3ee3e | 8 | public ReflectionCache(Class<?> serviceInterface) {
if (!serviceInterface.isInterface()) {
throw new ClassFormatError(String.format("Class '%s' is not an interface!", serviceInterface.getName()));
}
Method[] methods = serviceInterface.getMethods();
methodIdToName = new HashM... |
08b98cb2-58d0-4ca8-98f0-0a42f1d28ce1 | 9 | public int translate(int va, int size, boolean inst, boolean priv, boolean read) {
int paL1, entryL1, typeL1, pa;
boolean validAlign;
if (isFault()) {
//フォルト状態がクリアされず残っている
throw new IllegalStateException("Fault status not cleared.");
}
//TODO: アドレス以外の条件が... |
7f44452a-1583-408e-abb5-2524d5d78bae | 1 | @Override
public void first (String host, String db_name, String user, String pw) {
try {
this.host = host;
this.db_name = db_name;
this.user = user;
this.pw = pw;
connect();
} catch (SQLException ex) {
... |
df349747-6a9c-4193-9e49-5735a30ec33b | 9 | public void playerPlays(Card card) {
if (card == null) {
/* 1) den exei na paiksei kai dn exei traviksei karta
* 2) den exei na paiksei kai exei traviksei karta
* 3) katw einai 7 ari kai den exei 7 na paiksei = pairnei 2
* 4) katw einai 7 ari alla einai apo ton... |
770cfcc0-f9c8-4370-9dbc-da8c6785ea1a | 4 | public List getIPEntriesDebug(String s) {
List<IPEntry> ret = new ArrayList<IPEntry>();
long endOffset = ipEnd + 4;
for (long offset = ipBegin + 4; offset <= endOffset; offset += IP_RECORD_LENGTH) {
// 读取结束IP偏移
long temp = readLong3(offset);
// 如果temp不等于-1,读取IP的地点信息
if (temp != -1) {
IPLocation ip... |
c2a64947-fb90-4a8d-af5a-e2eb800c655f | 9 | @Override
public Status live() {
super.live();
// Insects will only act every ANTACTIONDELAY milliseconds
if (this.getTimeManager().getCurrentDate().getTime() - this.lastTime < Consts.ANTACTIONDELAY
&& this.lastTime != 0) {
return null;
}
InsectBo... |
fa0cf245-00dd-4c01-bb15-23f1d3f540bc | 4 | public boolean isValid() {
if (this.port == null || this.port.isEmpty()) {
return false;
}
if (this.ip == null || this.ip.isEmpty()) {
return false;
}
return true;
} |
12b9037e-60d0-4cc3-bb65-efd83d81e617 | 3 | public int[] PlusOne(int[] digits){
int carry =1,sum=0;
int[] result = new int[digits.length];
for(int i = digits.length -1; i>=0; i--){
sum = carry+digits[i];
carry = sum/10;
result[i] = sum%10;
}
if(carry == 1){
int[] plusone = new int[digits.length+1];
plusone[0] = carry; int i = 1... |
ca0e791b-1a0a-43f6-bf9a-436cb4ad305d | 1 | double acceptanceProbability(int energy, int newEnergy, double temperature){
if(newEnergy < energy) return 1;
return Math.exp((energy - newEnergy) / temperature);
} |
c6486a57-18f8-4891-ac1b-a7500d63c35c | 6 | private static void add(Map<Class<?>, Class<?>> forward,
Map<Class<?>, Class<?>> backward, Class<?> key, Class<?> value) {
forward.put(key, value);
backward.put(value, key);
} |
fc89f555-82f2-4e85-ba50-acb0c370104c | 3 | String commandLineStr(boolean splitLines) {
StringBuilder argsList = new StringBuilder();
argsList.append("SnpEff " + command + " ");
int size = argsList.length();
for (String arg : args) {
argsList.append(arg);
size += arg.length();
if (splitLines && (size > COMMAND_LINE_WIDTH)) {
argsList.append... |
551398ee-fa43-4a69-ba59-10aa8f8009eb | 7 | private static void parseFiles(final Map<String, String> args, final CommandLineArguments result)
throws ParseException
{
if (args.containsKey("binary"))
{
result.binary = Boolean.parseBoolean(args.get("binary"));
}
if (args.containsKey("dir"))
{
final File directory = new File(args.get("dir"));
... |
376ff0f3-cdb8-4b40-bf4c-8a1ecd803da6 | 9 | public boolean hasCycles() {
// check for cycles
boolean[] bDone = new boolean[m_nNodes];
for (int iNode = 0; iNode < m_nNodes; iNode++) {
// find a node for which all parents are 'done'
boolean bFound = false;
for (int iNode2 = 0; !bFound && iNode2 < m_nNodes; iNode2++) {
if (!bDone[iNode2]... |
07df811a-e446-468e-848a-dad5fd8a1682 | 7 | public void searchForSMClasses(Class clazzLocation, Field[] lof){
//System.out.println("NOW LOOKING AT:" + clazz.getName());
JSONObject jObj = new JSONObject();
for(Field f: lof){
//Get generic type.
Class genericType = getFieldGenericType(f);
//If SM objec... |
47bcfcc7-571d-4179-a232-69dcde8a1d2f | 2 | public byte[] toByteArray(){
try{
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ObjectOutput out = null;
out = new ObjectOutputStream(bos);
out.writeObject(this);
byte[] yourBytes = bos.toByteArray();
try{
bos.close();
out.close();
}catch(Exception e){System.out.println("A M... |
f0ce776a-7716-4a34-8403-e59a6b1a33cb | 8 | @SuppressWarnings({"unchecked"})
protected void doEncodeAll(FacesContext ctx) throws IOException {
String strValue = null;
try {
if (getSubject() != null) {
// Get the principal to print out
Object principal;
if (type == null) {
... |
251e6fe0-502e-4916-a8e8-100b64418c81 | 4 | static double[][] minor(double[][] A, int i, int j){
double[][] minor = new double[A.length-1][A.length-1];
int n = 0, m = 0;
for(int k = 0; k < A.length; k++){
if(k == i)
continue;
for(int l = 0; l < A.length; l++){
if(l == j)
continue;
minor[n][m] = A[k][l];
m++;
}
n++;
m = ... |
818a75e2-d328-45a7-8ef2-c279453b83f5 | 1 | public ImprovedStack reverse() {
ImprovedStackImpl output = new ImprovedStackImpl();
output.list.array = new Object[size()];
for (int i = size() - 1; i >= 0; i--) {
output.push(list.get(i).getReturnValue());
System.out.println(list.get(i).getReturnValue());
}
return output;
} |
e9322daf-b506-41c6-920c-6a0bd756fc3e | 2 | private void initStreamOrSource() throws FileNotFoundException {
if (dataSourceStream != null) {
final Reader r = new InputStreamReader(dataSourceStream);
setDataSourceReader(r);
addToCloseReaderList(r);
} else if (dataSource != null) {
final Reader r = ne... |
d40e15e7-4828-4714-b548-a734001dc911 | 1 | public void delete(String query){
try {
this.statement.executeUpdate(query);
} catch (SQLException ex) {
Logger.getLogger(DatabaseConnection.class.getName()).log(Level.SEVERE, null, ex);
}
} |
a8f29299-9f07-4b0f-9915-c3e6a1de65c5 | 9 | private ParameterSweep readParameter(Configuration configFile,
String paramName, String paramSweep, String paramType,
String paramValue, int paramNum) {
ParameterSweep sweep = null;
if (paramSweep.equalsIgnoreCase("list")) {
List<Object> values = configFile.getList(paramValue);
sweep = new ListSweep<>... |
948921db-bd65-4284-bf67-3986cfde2de6 | 6 | public void update(GameTimer gameTime)
{
// Make a copy of the master screen list, to avoid confusion if
// the process of updating one screen adds or removes others.
_ScreensToUpdate.clear();
for (GameScreen screen : _Screens)
{
_ScreensToUpdate.add(screen);
}
boolean otherScreenHasFocus = false;
... |
171fd56c-ca6e-4d9a-a516-b359dab46eca | 9 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
ZapposSearchResponse other = (ZapposSearchResponse) obj;
if (currentResultCount != ot... |
5c51dbf6-4a4a-498a-97c8-0943e4ce647e | 2 | public float readFloat() throws IOException {
int code = readNextCode();
float result;
switch (code) {
case Codes.FLOAT:
result = is.readRawFloat();
break;
default: {
Object o = read(code);
if (o instanceof F... |
bab0c5e6-a646-4f50-816a-6d96b443cdb9 | 0 | @Override
public void componentMoved(ComponentEvent e) {} |
f1f0a8fc-bc1f-4270-bf89-89167d7a37a1 | 5 | private void commit() {
LinkedList<Vec2> pointsList = new LinkedList<>();
for (Curve curve : draftform.getCurves()) {
for (draftform.Vec2 dVec : curve.linearize(curve.recommendedSubdivisions()))
pointsList.add(new Vec2(dVec.getX(), dVec.getY()));
pointsList.removeLast();
}
Vec2[] points = new Vec... |
940b9766-0c23-4bf9-a4e0-eec947589d73 | 1 | public void togglePaused(){
paused = !paused;
if (paused) {
pauseObjects();
numAsteroids = asteroids.size();
}
} |
c25422c2-d27b-472c-ad4a-50ab31351fe0 | 0 | @Override
public void keyReleased(KeyEvent e) {} |
0a480947-0ae1-4a16-8122-7b11795cf680 | 9 | protected static Object getParamArg(Class cl)
{
if (! cl.isPrimitive())
return null;
else if (boolean.class.equals(cl))
return Boolean.FALSE;
else if (byte.class.equals(cl))
return Byte.valueOf((byte) 0);
else if (short.class.equals(cl))
return Short.valueOf((short) 0);
els... |
6ea1df08-d77f-41e3-b192-8477c77f144e | 3 | public void preencher()
{
list = new ArrayList();
jlist = new JList(new DefaultListModel());
adicionar = new JButton("Adicionar");
adicionar.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent arg0)
{
if (pesquisa.getSelectedIndex() >= 0)
inserir();
}
});
r... |
ceec63d4-3236-42b5-abb6-b3a2c59f108f | 7 | public Content getCrossClassLink(String qualifiedClassName, String refMemName,
Content label, boolean strong, String style,
boolean code) {
String className = "";
String packageName = qualifiedClassName == null ? "" : qualifiedClass... |
62f9bba4-a22f-4ebe-8655-6b6a90f149da | 6 | protected KeyListener createKeyListener() {
return new KeyListener() {
public void keyPressed(KeyEvent e) {
if (e.getKeyChar() == KeyEvent.CHAR_UNDEFINED || e.getKeyCode() == KeyEvent.VK_DELETE) {
if (editMode)
handleKeyPressed(e.getKeyCode... |
99386dfd-53c5-4906-85f8-0c97650042b0 | 6 | private int getBonuses() {
int bonus = 0;
if (developments.isDevelopmentBought(DevelopmentList.ARCHITECTURE)) {
for (int i = 0; i < monuments.length; i++) {
if (monuments[i].isFull()) {
bonus++;
}
}
}
if (developments.isDevelopmentBought(DevelopmentList.EMPIRE)) {
for (int i = 0; i < citie... |
42772666-f264-4d6e-af63-cc888f0fe9d0 | 2 | public static void main(String s[]) throws IOException
{
FileInputStream fis = new FileInputStream("/Users/arun/Hack/file-ip-test.txt");
Scanner sc = new Scanner (fis, "UTF-8");
ArrayList<bean1> al = new ArrayList<bean1>();
log("Input from file:");
while(sc.hasNextLine())
{
String s1;
S... |
82963136-3579-4198-995b-11d8a5c0fed0 | 1 | public void register(){
try {
Class.forName("com.mysql.jdbc.Driver");
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
} |
82e41eda-822a-45a0-a620-adeafd288392 | 1 | public AnnotationVisitor visitParameterAnnotation(
final int parameter,
final String desc,
final boolean visible)
{
return new SAXAnnotationAdapter(getContentHandler(),
"parameterAnnotation",
visible ? 1 : -1,
parameter,
... |
67720cd5-e209-41d7-984b-5ca3623664f6 | 6 | private static void generatedConsolidatedHTML(final Map<File, AnalysisData> processedWorkflows) {
try {
final File globalAnalyze = new File("global-analyze.html");
final FileWriter gaWriter = new FileWriter(globalAnalyze);
gaWriter.write("<html>");
gaWriter.write("<body>");
// Consolidated analyze
... |
e8a08d18-665b-4947-82e3-4f7680ea524d | 9 | public List<THandler> readClass(Class<?> clazz) {
List<THandler> handlers = new ArrayList<THandler>();
ClassHelper classHelper = new ClassHelper(clazz);
TClassMeta classMeta = metadataReader.readClass(clazz, classHelper);
if(classMeta == null) {
return handlers;
}
... |
68d524ab-a91d-44dc-b26b-9974c630a4c0 | 4 | @Test
public void findsCorrectDefaultInputs()
{
assertTrue(settings.getControl(KeyEvent.VK_RIGHT) == Input.PLR1RIGHT &&
settings.getControl(KeyEvent.VK_LEFT) == Input.PLR1LEFT &&
settings.getControl(KeyEvent.VK_UP) == Input.PLR1UP &&
settings.getControl(Ke... |
174f1c26-bbf9-42a5-98a8-6bd8e5fac079 | 9 | public String tokenType(int priorState){
switch(priorState){
case 0:
return "ESPACIO";
case 8:
return "IF"; //Palabra reservada if
case 11:
return "ELSE"; //Palabra reservada else
case 1:
return "ID"... |
f2af7c84-ad69-47fa-be10-d12eacadcb0c | 0 | public void initTextures(AssetManager assetManagere){
Glass.glassTexture = assetManagere.loadTexture("Textures/Blocks/glass.png");
} |
d36e1f56-3c4e-4320-9e1d-ed2b32399034 | 9 | public int layoutProjectedRectangle(ArrayList<Rectangle> rectangles){
/*
0 is no intersections.
1 is ground intersection
2 is wall intersection
*/
Rectangle projectedRectangle=new Rectangle((int)(_xcor+_xvel),(int)(_ycor+_yvel+GRAVITY+ 0.99),PLAYER_WIDTH,PLAYER_HEIGHT);
for(int i = 0; i < rectangles.size... |
6d6c0391-d86c-4701-9ae7-e6b7faa7b2a6 | 6 | public AbsGameObject getMapObject(EnGameObjectType gameObjectType, Coordinate coordinate) {
AbsGameObject absGO = null;
switch (gameObjectType) {
case EXIT:
absGO = new Exit(coordinate);
break;
case MONSTER:
absGO = new Monster(coo... |
867d2044-22b1-4c0f-bc1b-5e4e9061eb74 | 1 | public void setTilesetImageFilename(String name) {
if (name != null) {
tilebmpFile = new File(name);
tilebmpFileLastModified = tilebmpFile.lastModified();
}
else {
tilebmpFile = null;
}
} |
a9db90da-7ada-45da-977c-af1870ced612 | 9 | @Override
public boolean onCommand(CommandSender sender, Command command, String commandlabel, final String[] args) {
if(sender instanceof Player) {
Player player = (Player) sender;
// Valid command format
if(args.length >= 1) {
// casino add
if(args[0].equalsIgnoreCase("add")) {
cm... |
f453cea7-ab4f-4b0f-902e-6528045ab9a7 | 9 | public final void update() {
// timestamp of last update
float secondsSinceLastUpdate = ((float) World.getWorld().getCurrentTS() - lastUpdateTS) / 1000;
lastUpdateTS = World.getWorld().getCurrentTS();
if (secondsSinceLastUpdate == 0f) {
return;
}
applyForces();
posSpeed.x += posAccel.x * secondsSince... |
f53a9e9e-8bcf-46eb-b062-3d8a736122d2 | 4 | public void test_20_Nmers_read_write() {
String testFile = "/tmp/nmer_test.bin";
int nmerSize = 32;
int numNmers = 100000;
try {
// Initialize
FileOutputStream os = new FileOutputStream(new File(testFile));
Random rand = new Random(20100825);
ArrayList<Nmer> list = new ArrayList<Nmer>();
// Crea... |
0ff0592f-3615-4517-9fc9-315a719fc173 | 0 | public String toString()
{
return super.toString() + ": \"" + getLabel() + "/" + getOutput() + "\"";
} |
18cef091-4946-4fce-8e40-ea99b61859b6 | 8 | public static SubmitBatch_Result submitBatch(Database database, SubmitBatch_Param params) {
Logger.getLogger(API.class.getName()).log(Level.FINE, "Entering API.submitBatch()");
SubmitBatch_Result result;
try { // validate user
ValidateUser_Result vResult = validateUser(datab... |
929a001e-6c68-4af2-a91d-7d1dabed911f | 7 | public PointPathFinding trouverPoint(PointPathFinding point, double diffX, double diffY, ArrayList<PointPathFinding> visites) {
double x = point.getX();
double y = point.getY();
int cout = point.getCout();
PointPathFinding trouve = getPointExistant(x+diffX, y+diffY, visites);
if(... |
eea0fd4a-7214-40c6-90e1-c1bbd9e54e5f | 0 | @Override
public void restoreTemporaryToDefault() {tmp = def;} |
7a43b9d9-87d2-4bb8-8c99-db6f1aea3967 | 8 | public static String escapeXml( String str ) {
if ( str == null ) {
return str;
}
int len = str.length();
if ( len == 0 ) {
return str;
}
StringBuffer encodedBuffer = new StringBuffer();
// parse string and encode characters
for (int i = 0; i < len; i++) {
char chr= str.charAt(i);
if ( ... |
884c80b6-048b-4550-ab81-43f0df4be2ea | 5 | public void drawCurrentBlock(Graphics g){
//画指针
g.setColor(Color.red);
switch(this.current_type){
case 0:
g.drawRect(pointer_y * 10 + 50, pointer_x * 10 + 50, 10, 10);
break ;
case 1:
g.drawImage(grass, pointer_y * 10 + 50, pointer_x * 10 + 50, 10, 10, this);
break ;
case 2:
g.drawImage(this.... |
9fe26510-334f-41a0-88c2-e07853e0d618 | 9 | public static void main(String[] args) throws Throwable{
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
for (String line ; (line=in.readLine())!=null;) {
int cantL = Integer.parseInt(line);
if(cantL == 0 )break;
boolean pass = true;
int nocturnas=0;
int total=0;
for (in... |
b4f2a962-2fb8-4131-85c5-9275f0b71b51 | 5 | private void findFile(File file, String filename)
{
if (file.isDirectory() && isApplication(file) == false)
{
// System.out.println("Checking Directory: " + file);
File[] files = file.listFiles(this);
if (files != null)
{
for (int i = 0; i < files.length; i++)
{
findFile(files[i], filenam... |
c5519186-fedc-4852-a0ef-7360f639dfe6 | 3 | public JSONArray toJSONArray(JSONArray names) throws JSONException {
if (names == null || names.length() == 0) {
return null;
}
JSONArray ja = new JSONArray();
for (int i = 0; i < names.length(); i += 1) {
ja.put(this.opt(names.getString(i)));
}
re... |
2ad7c79e-ca29-4828-913c-b185670e367d | 1 | public E poll()
{
if (count == 0) return null;
E r = peek();
head = (head + 1) % elements.length;
count--;
modcount++;
return r;
} |
830b9dcf-2f02-4178-9b3a-c4b20142adde | 2 | @Override
public void startDocument() throws SAXException {
try {
response = clazz.newInstance();
} catch (InstantiationException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
}
} |
5d32cf32-799c-41f8-ac18-388dce1d75a5 | 8 | private static void Poda_CreaArbol(Nodo ini, int limite) {
if(limite==0){
ini.calcula_utilidad();
}
else{
ArrayList<Nodo> sucesores= ini.getSucesores();
if(ini.esHoja()){
ini.calcula_utilidad();
}
else{
Iterator<Nodo> it=sucesores.iterator();
while(it.hasNext()&&ini.alfa<ini.beta){
... |
6a34ba46-5334-426f-85f2-27821be491b6 | 5 | public static String getDateFormatPattern( String ifmt )
{
if( ifmt.equals( "14" ) )
{
return "m/d/yy";
}
if( ifmt.equals( "15" ) )
{
return "d-mmm-yy";
}
if( ifmt.equals( "16" ) )
{
return "d-mmm";
}
if( ifmt.equals( "17" ) )
{
return "mmm-yy";
}
if( ifmt.equals( "22" ) )
{
... |
32458e26-dc15-4f5b-a4ab-54b42b44c8e5 | 7 | public String login() {
Application app=new ConnectClass().connect();
try
{
app.label("Markets").verify();
app.label("Login").tap();
}
catch(MonkeyTalkFailure ex)
{
System.out.println("Login Page");
}
app.input("701").enterText(user);
app.input("702").enterText(passwo... |
694c27fd-056f-4be6-9f3c-364e11c6a2ff | 4 | @Override
public void run() {
Object o;
try {
while ((o = obInputStream.readObject()) != null) {
Order rOrder = (Order) o;
if(warehouse.authUser(rOrder.getUsername(),rOrder.getPassword())){
warehouse.addOrder(rOrder);
outThread.sentOrder(rOrder);
} else {
System.out.println("Käuferanf... |
c5c53037-e950-4e06-aefb-0873300e336e | 9 | public void log(String text, LOG_TYPES type) {
if (!can)
return;
switch (type) {
case DEBUG:
if (ConstantHandler.LOG_DEBUG)
out.println("DEBUG: " + System.nanoTime() + " " + text);
break;
case EVENT:
if (ConstantHandler.LOG_EVENT)
out.println("EVENT: " + System.nanoTime() + " " + text);
... |
21dc6b4d-f36b-4c82-90a1-805ef6fabc3a | 5 | public static float[][] generator(int rows, int cols){
float edgefraction[][] = new float[rows][cols];
//Edge fraction (random numbers between 0-1)
for (int i = 0; i < rows; i++){
for (int j = 0; j < cols; j++){
Random rnd = new Random();
edgefraction[i][j] = rnd.nextFloat();
}
}
//Norm... |
8e371b47-0fe8-452d-8b3f-b3914c67384c | 0 | public void setBoxId(int boxId) {
this.boxId = boxId;
} |
20529e93-2556-4e79-a4f7-25386bca7ef9 | 5 | private static Class[] getClassType(String desc, int descLen,
int start, int num) {
int end = start;
while (desc.charAt(end) == '[')
++end;
if (desc.charAt(end) == 'L') {
end = desc.indexOf(';', end);
if (end < 0)
... |
f8c0ac3b-dcab-4fd8-9302-9e5549192bf1 | 9 | protected void loadFields(com.sforce.ws.parser.XmlInputStream __in,
com.sforce.ws.bind.TypeMapper __typeMapper) throws java.io.IOException, com.sforce.ws.ConnectionException {
super.loadFields(__in, __typeMapper);
__in.peekTag();
if (__typeMapper.isElement(__in, CreatedBy__typeInfo)) {
... |
80a3946c-1d6d-40de-8cd3-528e9d5f0ed9 | 1 | @Override
public void draw(Graphics page) {
planeImage.drawImage(page, xLocation, yLocation);//Draws the plane on the component
//Draws the collision Border
if(this.getBorderVisibility())
{
drawCollisionBorder(page,xLocation,yLocation,planeImage.getWidth(),planeImage.getHeight());
}
} |
317ce0c5-6a0d-43da-ae9a-c06e44bcfe08 | 6 | public void changeHighScore(int newscore, String name){
if (newscore > first){ //if the new score is the first one on the new table
this.fifth= this.forth;
this.forth= this.third;
this.third= this.second;
this.second= this.first;
this.first= newscore;
this.fifthHighScore.setText("5." + (this.forthHi... |
80da818a-a6ac-4643-8eb1-b71a6f42da9e | 4 | public boolean removeWhen(SingleObject bl){
boolean remove=bl.inRange(stage.player)
|| !bl.inArea(-20,stage.getWidth()+20,-50,stage.getHeight()-100)
|| stage.second()>16;
if(remove && grade=='f'){
stage.getSound("audio/f_explode.wav").play();
stage.impact=true;
... |
24ecf018-ca97-4f5c-8170-c400570c1a7c | 7 | @Override
public boolean okMessage(final Environmental myHost, final CMMsg msg)
{
if(!super.okMessage(myHost,msg))
return false;
if(affected==null)
return true;
if(!(affected instanceof MOB))
return true;
if(msg.target()==affected)
{
if((msg.tool()!=null)
&&(CMLib.dice().rollPercentage()>... |
90ebbee4-de0f-4b5f-819a-5a7b12e9d00c | 7 | @Override
public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel)
{
final MOB target=this.getTarget(mob,commands,givenTarget);
if(target==null)
return false;
if(!super.invoke(mob,commands,givenTarget,auto,asLevel))
return false;
boolean success=proficienc... |
589dd7e0-fbf1-44cf-82dd-e8a459359b05 | 3 | public void run() {
Object o;
try {
while ((o = obInputStream.readObject()) != null) {
Order rOrder = (Order) o;
controllerCoustomerShop.setreceivedOrder(rOrder);
}
} catch (ClassNotFoundException | IOException e) {
e.printStackTrace();
} finally {
try {
obInputStream.close();
} catch... |
79e1a25a-155b-4460-a538-0cd08663a5df | 0 | public String getCalle() {
return Calle;
} |
b5759046-3d3e-40ad-badf-eefefda8310a | 8 | public int compare(Problem a, Problem b) {
int result = 0;
Problem pa = (Problem)a;
Problem pb = (Problem)b;
if (sortField.equals("host_name")) {
result = pa.getHost().getHostName().compareTo(pb.getHost().getHostName());
}
else if (sortField.equals("pretty_name") || sortField.equals("server_name")) {
... |
39882611-8602-4dc0-8aa9-d228c4b37114 | 9 | public static byte[] decodeBytes(byte[] encdata, int encoff, int enclen, com.grey.base.utils.ByteChars arrh)
{
if (enclen == 0) return null;
int enclimit = encoff + enclen;
int rawoff = 0;
int datalimit = enclimit;
int paddinglen = 0;
int linecnt = 0;
// count pad chars - there's no legal encoded sequen... |
359d30e4-c464-45c7-88d9-e0abd11cb134 | 6 | public static void main(String[] argv)
{
try
{
Controllers.create();
}
catch (Exception e)
{
e.printStackTrace();
System.exit(0);
}
int count = Controllers.getControllerCount();
System.out.println(count + " Controllers Found");
for (int i = 0; i < count; i++)
... |
024a8586-e922-470a-a192-fa4b891943df | 7 | static AdjGraph segmentArrangement(Line[] segs, List<Point> ps) {
int n = segs.length;
TreeSet<Point> set = new TreeSet<Point>(); // JavaのリストにはC++のuniqueがないので…
for (int i = 0; i < n; i++) {
set.add(segs[i].a);
set.add(segs[i].b);
for (int j = i + 1; j < n; j+... |
87b69114-2710-443d-8b53-46f58be226ba | 9 | @Override
public List<Map<String, ?>> Listar_dat_actual(String ID_TRABAJADOR) {
List<Map<String, ?>> lista = new ArrayList<Map<String, ?>>();
try {
this.cnn = FactoryConnectionDB.open(FactoryConnectionDB.ORACLE);
String sql = "SELECT * FROM RHVD_NEW_TRABAJADOR \n"
... |
eb16bd3a-e210-455d-85b7-a073e489d3a7 | 8 | static Method[] getMethodList(Class clazz) {
Method[] methods = null;
try {
// getDeclaredMethods may be rejected by the security manager
// but getMethods is more expensive
if (!sawSecurityException)
methods = clazz.getDeclaredMethods();
} cat... |
e5e9be7d-aa23-4628-81f5-797e4b906c21 | 2 | public GeometricNodeEnumeration(Node n){
if(sNLE == null){
sNLE = new GeometricNodeListEnumeration(n);
}
else{
sNLE.resetForNode(n);
}
if(sNLE.hasMoreElements()){
nI = sNLE.nextElement().iterator();
}
} |
854f7fd1-d9f5-4ccc-adb9-8d19bbca6927 | 9 | public void determineValues(Instances inst) {
int i;
AttributeStats stats;
int attIdx;
int min;
int max;
int count;
m_AttIndex.setUpper(inst.numAttributes() - 1);
attIdx = m_AttIndex.getIndex();
// init names
m_Values = new HashSet... |
6353eefd-3b8d-4090-aa33-b4e17f81c4ff | 2 | private ByteBuffer getReader(int bytes)
{
ByteBuffer reader = buffers[readerIndex];
if (readerPosition + bytes > reader.limit())
{
if (readerPosition == reader.limit()) {
reader = nextReader();
}
else {
reader = nextCompactedReader(bytes);
}
}
return reader;
} |
2bfcef95-6597-4e80-84f7-8ed530a9785b | 3 | public void run()
{
try
{
this.MPrio.acquire();
this.MReading.acquire();
this.MPrioR.acquire();
if(this.counter == 0)
this.MWriting.acquire();
this.counter++;
this.MPrioR.release();
this.MReading.release();
System.out.println("Lecture");
Thread.sleep(100);
... |
6ace6061-b805-4908-b64d-93a977d414de | 1 | @Override
public Message postMessage(Message msg) throws JSONException, BadResponseException {
Representation r = new JsonRepresentation(msg.toJSON());
r = serv.postResource("intervention/" + interId + "/message", msg.getUniqueID(), r);
Message message = null;
try {
message = new Message(new JsonReprese... |
ea92f476-11d2-429e-80f7-ff0b57c28019 | 6 | public Jagd(JSONObject setup) {
super("Wörterjagd");
try {
letterMin = setup.getInt("min");
} catch (JSONException e) {
}
try {
letterMax = setup.getInt("max");
} catch (JSONException e) {
}
try {
percent = setup.getInt("Prozent");
} catch (JSONException e) {
}
try {
luck = setup.getB... |
6fbd2054-1d6c-49a5-9d2a-c6a3d14b4e48 | 0 | public String getCode() {
return code;
} |
a9f10a39-9b05-45f5-bde2-239d28967cb9 | 9 | private void finishText() {
if (currentText != null) {
String strValue = currentText.toString();
if (currentTextContent != null) {
if (DefaultXmlNames.ELEMENT_Unicode.equals(insideElement)) {
currentTextContent.setText(strValue);
}
else if (DefaultXmlNames.ELEMENT_PlainText.equals(insideEl... |
02c49bd7-236c-40a3-b3b3-b30c73722b0b | 3 | public static ProgressRateEnumeration fromString(String v) {
if (v != null) {
for (ProgressRateEnumeration c : ProgressRateEnumeration.values()) {
if (v.equalsIgnoreCase(c.toString())) {
return c;
}
}
}
throw new IllegalArgumentException(v);
} |
b678dcc7-f6c6-43a3-b96a-608c3cd37668 | 6 | @Override
public void run() {
long lastTime = System.nanoTime();
double nsPerTick = 1000000000D / 60D;
long lastTimer = System.currentTimeMillis();
delta = 0D;
while (running) {
long now = System.nanoTime();
delta += (now - lastTime) / nsPerTick;
lastTime = now;
// If you want to limit frame r... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.