method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
256d63cc-5408-4407-8472-4a300658afc7 | 7 | public byte[] encrypt(byte[] text, String key){
// System.out.println("encrypting");
byte[] textEncrypted = null;
try{
//keygenerator.init(bits); // 192 and bits bits may not be available
byte[] keyPadded = new byte[bits / 8];
for(int i = 0; i < bits / 8 && i < key.length(); i++){
keyPadded[i] = ... |
962f5f02-4b62-4696-8f2c-11d1e3f0ef90 | 5 | protected void checkForHitRight(Paddle paddle) {
if (ballX >= (paddle.getX() - ballSize)) {
if (ballY >= paddle.getY() - ballSize + 1
&& ballY <= paddle.getY() + paddle.getLength() - 1) {
hits2++;
dx = left;
dy = 0; // this is a direct hit
int paddleCenter = paddle.getY() + paddle.getLeng... |
e15ddf35-791d-4114-95ff-433337cb887d | 6 | protected void doPost(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
conn = DatabaseConnection.getConnection();
response.setContentType("text/html");
String name = request.getParameter("name");
String surname = request.getParameter("surname");
String number... |
14f72372-f8e5-4672-94af-2866f0d808ec | 3 | private Object formatKeys(List<Number> keys, JdbcBatchUpdateDefinition batchUpdateDefinition) {
if (batchUpdateDefinition.isReturnList()) {
return keys;
}
int length = keys.size();
// 将返回结果从List<? extends Number>转换为数组
Class<?> componentType = batchUpdateDefinition.getReturnComponentType();
if (!ClassHel... |
76e85467-e0f2-413d-b64e-07db290e493e | 9 | private void readEvents(BufferedReader reader) throws IOException {
for(int i=0; i<nEvents; i++) {
String line = reader.readLine();
String[] fields = line.split(":");
int id = Integer.parseInt(fields[0]);
String type = fields[1];
if(type.equals("O")) {
String name = fields[2];
int idBranch = In... |
c27777d0-73b7-45c9-8430-73ceedb08442 | 6 | private static void addElement(ArrayList<ArrayList<Integer>> rowIndexes, ArrayList<ArrayList<String>> colIndexes, ArrayList<Double> values,
ArrayList<Double> diag, int row, int col, double value) throws NumberFormatException {
boolean positionOcupied = false;
if (row == col) {
Double diagElem = diag.get(col... |
6a8ba1ab-6f6e-4a12-bfd8-235381dcbea6 | 2 | private ConnectionBDD() {
try
{
Class.forName("com.mysql.jdbc.Driver");
conn= (Connection) DriverManager.getConnection(url,login,passwd);
st= (Statement) conn.createStatement();
}
catch(ClassNotFoundException cnfe){
Logger.getLogger(Conne... |
18ce0d0c-c350-46f7-99d3-3bb0d800f1bb | 7 | public static void parseLine(String line, Species s) {
line= line.trim();
int k= line.indexOf('=');
if (k < 0)
return;
String attribute= line.substring(0,k).trim();
String value= line.substring(k+1).trim();
if (attribute.equals("Name")) {
s.setNa... |
53a446c0-b583-45bf-89c6-59d162183e24 | 4 | public static void main(String[] args) throws IOException
{
// get sheet
readExcel instance = new readExcel();
XSSFWorkbook riverside_jobs = instance.readWorkbook();
XSSFSheet sheet = riverside_jobs.getSheetAt(0);
// iterate through rows, construct full address, send to goog... |
f9cd6acf-220e-48ff-abe9-4779e01b0ccc | 1 | public void done() throws IOException {
w.flush();
if (file != null) {
w.close();
}
} |
31fe7300-e08f-4c67-a33e-b3b4b8812b8b | 8 | public void renderCollisionLayerTile(int xp, int yp, Tile tile) {
xp -= xOffset;
yp -= yOffset;
Sprite sprite = tile.getSprite();
for (int y = 0; y < sprite.SIZE; y++) {
int ya = y + yp;
for (int x = 0; x < sprite.SIZE; x++) {
int xa = x + xp;
if (xa < -sprite.SIZE || xa >= width || ya < 0 || ya >... |
0b363c36-e13f-46d9-9a69-3328601761ec | 1 | @Override
public void start()
throws Exception {
String name, surname, alias, email, role;
Date joined;
List<Author> authors= par.getMFESetup().getAuthors();
Iterator<Author> iter= authors.iterator();
while(iter.hasNext()) {
Author aut= iter.next();
name= aut.getName();
surname= aut.ge... |
145d6088-7a3f-427d-a6fe-14cd603b7c38 | 5 | public static void q4(String[] args) throws Exception{
//Question 9.4: Write a method to return all subsets of a set
SOP("Running q4");
if(args.length < 2){
SOP("ERROR: Must specify at least one element for the set");
return;
}
int[] mArray = new int[args... |
9c3ae2ab-3a8e-4539-87f2-4c2ecdf04ca6 | 6 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Position other = (Position) obj;
if (Double.doubleToLongBits(accuracy) != Double.doubleToLongBits(other.accuracy))
return false;
if (Double.... |
667d10fe-7996-4509-bc64-c2b0e5fc6ecc | 6 | public void update() {
if (!won && !dead) {
if (hasStarted) {
elapsedMS = (System.nanoTime() - startTime) / 1000000;
fromattedTime = formatTime(elapsedMS);
} else {
startTime = System.nanoTime();
}
}
checkKeys();
for (int row = 0; row < ROWS; row++) {
for (int col = 0; col < COLS; col... |
754e9043-262d-491c-acc3-d61748b22907 | 5 | private void insertArgument(int row) {
// Get the argument name
String argumentName = (String) JOptionPane.showInputDialog(
this, // owner
"Enter unique macro argument label", // Message
"Macro Builder", // Title
JOptionPane.PLAIN_MESSAGE);... |
1bbc2bab-48fd-423b-ad8b-49c1f29d242c | 8 | public static byte[] decodeBase64(byte[] base64Data) {
// RFC 2045 requires that we discard ALL non-Base64 characters
base64Data = discardNonBase64(base64Data);
// handle the edge case, so we don't have to worry about it later
if (base64Data.length == 0) {
return new byte[0]... |
e8475b21-1813-4498-9839-9db3e86eee63 | 2 | private QueueElement searchMax(){
QueueElement current = head;
QueueElement maxQueueElement = head;
while (current != tail.next()) {
if (current.getPriority() > maxQueueElement.getPriority()) {
maxQueueElement = current;
}
current = current.nex... |
a4fa35d9-05c2-4803-a340-09006109734c | 6 | public BigNumber add(BigNumber two) {
checkForDigitAmount(this, two); // Check to see if both BigNumbers being
// added have a difference in the number
// of digits
int carry = 0;
// BigNumber sum = new BigNumber("");
StringBuilder sb = new StringBuilder();
for (int i = digits.size() - 1,... |
bb26108e-eea6-4374-8515-5c6a9ff71a8c | 0 | @Override
public void keyPressed(KeyEvent e) {
} |
812224b7-3e08-40a2-b53e-2f775ff44eb6 | 6 | public void initGroup(String group, String[][] props) {
if (!isGroup(group)) {
RegistryGroup rg = new RegistryGroup();
for (int i = 0; i < props.length; i++) {
String[] prop = props[i];
if (prop == null || prop.length == 0) {
continue;
}
String propName = prop[0... |
24b81b9e-6bd8-445a-a74a-174fac6f8afd | 5 | public void save() throws IOException {
BufferedReader reader;
try {
reader = new BufferedReader(new FileReader(System.getProperty("resources") + "/database/factions"));
String line;
StringBuilder fileContent = new StringBuilder();
String newLine = null;
while((line = reader.readLine()) != null) {
... |
65d8416c-9f3c-4e06-830f-2cc63174c920 | 3 | public void calculateLeader(){
for(int i = 1; i <= sizeOfNetwork; i++){
if(!isSuspect(i)){
if(i>leader){
leader = i;
}
}
}
} |
4016679b-2588-4f89-af62-d228d3c7ba7b | 7 | public void setTurnHolder(Player turnHolder) {
Player oldTurnHolder = this.turnHolder;
System.out.println("Chiamata a setTurnHolder");
if (this.turnHolder == turnHolder) return;
if (turnHolder == null) throw new NullPointerException("turnHolder is null");
//Check that is active
if (!turnHolder.isActive(... |
8e6fa2d3-5aaf-451f-913e-39cdeb796c74 | 1 | public int bitrate()
{
if (h_vbr == true)
{
return ((int) ((h_vbr_bytes * 8) / (ms_per_frame() * h_vbr_frames)))*1000;
}
else return bitrates[h_version][h_layer - 1][h_bitrate_index];
} |
384d2c4f-4545-479f-a8f6-08a23f46df2f | 5 | protected int readBlock() {
blockSize = read();
int n = 0;
if (blockSize > 0) {
try {
int count = 0;
while (n < blockSize) {
count = in.read(block, n, blockSize - n);
if (count == -1)
break;
n += count;
... |
400c7949-7134-41e3-a467-3c5bfea7e71e | 0 | public static Hand Straight(Rank highCard) {
return new Hand(HandRank.Straight, null, highCard, Rank.Null, Rank.Null, Rank.Null, Rank.Null);
} |
41ca0748-3ded-4021-8ce4-41a08e753cf7 | 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... |
23590457-4016-4c20-9958-9126b71f51be | 4 | public int compare(Object a, Object b) throws ClassCastException
{
if(a == null){
return -1;
}
else if(b == null){
return 1;
}
else if(a == null && b == null ){
return 0;
}
else{
MessageBid bida = (MessageBid... |
4b258234-3a6b-4f71-9f38-7117619a9d9b | 0 | protected void interrupted() {
end();
} |
3ebf85bd-cd5f-4584-8d6c-297485a4d24b | 0 | public void setOpenHr(int i, int j, boolean k){
openHr[i][j]=k;
} |
dd678330-26d4-4894-8994-d6d19b304994 | 6 | public static void exportCapabilities(){
BufferedWriter file =null;
String nameFile = "UsiExporIlot";
try{
File dir = new File("export");
dir.mkdirs();
FileWriter fileWriter = new FileWriter("export\\" + nameFile + ".csv");
file = new Buf... |
4537e439-2f1b-417b-bb3e-b21e6ebe0b97 | 8 | private void editorPaneMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_editorPaneMouseMoved
int mousex=evt.getX();
int mousey=evt.getY();
int currentTab= this.editorPane.getSelectedIndex();
if (this.cursor==cursorTypes.WALL || this.cursor==cursorTypes.DOOR || this.cursor==... |
4aa8d931-799a-4461-a53f-3cfdc6d957f9 | 4 | private static byte[] toPDF(final byte[] tex) throws IOException {
// find command
synchronized (PDF_LATEX_ARGS) {
if (pdfLaTeX == null) {
final File mac = new File("/usr/texbin/pdflatex");
if (mac.canExecute()) {
pdfLaTeX = mac.getPath();
} else {
final String... |
5cfb9fcb-da7b-4680-922e-2934d6edf6da | 2 | @Override
public boolean apply(ICreature input) {
if (input == observer) {
return false;
}
double dirAngle = input.directionFormAPoint(observer.getPosition(),
observer.getDirection());
return abs(dirAngle) < (observer.getFieldOfView() / 2)
&& observer.distanceFromAPoint(input.getPosition())... |
f819a6b0-64d2-4093-8f4a-6b65a14757c8 | 6 | public boolean equals(Object obj)
{
if(obj instanceof MiniCompound)
{
MiniCompound miniCompound = ((MiniCompound)obj);
ArrayList<Element> copy = new ArrayList<Element>(miniCompound.elements.length); //populate ArrayList
copy.addAll(Arrays.asList(miniCompound.elements));
boolean matchFound = true;
... |
138fa040-7879-48d4-aad2-521cebd546e3 | 8 | @Override
public String displayText()
{
if(juggles.size()>0)
{
final StringBuffer str=new StringBuffer(L("(Juggling: "));
final SVector<Item> V=juggles.copyOf();
for(int i=0;i<V.size();i++)
{
final Item I=V.elementAt(i);
boolean back=false;
for(int ii=0;ii<i;ii++)
{
final Item I2=... |
73ef4bd4-f4e2-4572-8d95-6a289239660e | 7 | public void checkBricks() {
if (getFacedUpCount() < 2)
return;
ArrayList<BrickModel> facedUp = new ArrayList<BrickModel>();
for (BrickModel brick : bricks)
if (brick.getState() == State.FACE_UP)
facedUp.add(brick);
if (facedUp.size() > 2) {
... |
396d092f-bbf6-4236-9127-11282643bd6b | 3 | public String createSubForum(User invoker ,User moderator, String subForumName) {
if (!invoker.hasPermission(Permissions.CREATE_SUB_FORUM) || !TextVerifier.verifyName(subForumName, new Policy()) || moderator == null) return null;
SubForum newSF = new SubForum(subForumName, moderator);
subForums.add(newSF);
s... |
18072574-4741-49ab-b7d5-3a3c8f36ea39 | 5 | @Override
public boolean equals(Object other) {
if (other == null)
return false;
if (!(other instanceof HostInfo))
return false;
if (other == this)
return true;
HostInfo otherHost = (HostInfo) other;
if (this.address.equals(otherHost.address) && this.port == otherHost.port) {
return true;
} els... |
65f287f0-8c1d-44c3-a010-105421b9e8c2 | 0 | public JTextPane getLeftChatBox()
{
return leftChatBox;
} |
1c7dd513-54f9-4851-97f1-e60e69efad44 | 7 | MultiThreadMultiplier(LinkedList<int[][]> matrices) {
System.out.println("From multi! Size: " + matrices.size());
this.matrices = matrices;
if(this.matrices.isEmpty())
return;
if(this.matrices.size()%2 != 0)
this.matrices.add(this.getDummy());
LinkedList<MatrixThread> threads = new LinkedList<MatrixT... |
aaddd0e1-a811-4c3e-aca9-10bbe5b1ecb1 | 2 | @Override
public void move(Excel start, Excel end) {
// TODO Auto-generated method stub
if (start.getX() == begin.getX() && start.getY() == begin.getY())
{
begin = end;
setColoredExes();
}
} |
67affbf3-b540-46b9-9ac3-00bb8bd0cf6d | 4 | public int getData(int x, int y) {
if (x < 0 || y < 0 || x >= w || y >= h) return 0;
return data[x + y * w] & 0xff;
} |
121789c5-f7ff-48d0-83a2-23efb325306d | 2 | static int figureOutIndex(Dimension[] dimensions, int[] indexes) {
int index = 0;
for (int i = (dimensions.length - 1); i > 0; i--) {
int mult = dimensions[0].getSize();
for (int j = 1; j < i; j++) {
mult = mult * dimensions[j].getSize();
}
... |
5bc0099d-3a6d-4b95-bbe2-182cc3fce584 | 4 | private static int findMostNeg(int[] a){
int min = 0;
int minIndex = -1;
for(int i=l;i<=r;i++){
if(a[i]<min && used[i]==false){
min = a[i];
minIndex = i;
}
}
if(minIndex > 0) used[minIndex]=true;
return min;
} |
ab175f4f-49e7-449e-a94d-590b956ea726 | 2 | private void initialize() {
OK = GUITreeLoader.reg.getText("ok");
CANCEL = GUITreeLoader.reg.getText("cancel");
RESTORE_TO_GLOBAL = GUITreeLoader.reg.getText("restore_to_application_preferences");
LINE_TERMINATOR = GUITre... |
000c62c4-ec02-4d4e-8ed4-ac6f6b48e6fe | 7 | public void setPanelWmarkFrom(JPanel newPanelWmark) {
this.panelWmark.setSize((int)(newPanelWmark.getWidth()/this.stretchKoeffBigImage),
(int)(newPanelWmark.getHeight()/this.stretchKoeffBigImage)) ;
ShapeDrawComponent shapeComp=null;
ImageComponent imageComp=null;
Component comps[]=newPanelWmark.getComponents()... |
074a5c9d-d047-4875-a4cb-813813b8f2da | 2 | public static int setMin_period(int new_min_period) {
if (new_min_period > 0 && new_min_period <= max_period) {
min_period = new_min_period;
return min_period;
} else {
return -1;
}
} |
31c1803a-6a8d-40bd-a9e2-2f54db446a1b | 3 | @Override
public void setAsText(String text) throws IllegalArgumentException {
if (text == null || text.equals(""))
text = "0";
if (!StringUtils.hasText(text)) {
setValue(null);
} else {
setValue(Double.parseDouble(text));// 这句话是最重要的,他的目的是通过传入参数的类型来匹配相应的databind
}
} |
1abab448-15c5-45f0-8e2e-527606f0f1ef | 5 | public static void main(String[] args) {
//ObjectFactory objFact = new ObjectFactory();
String movie = "";
TrivPost item = null;
while(true)
{
movie = CLib.input("Movie ID:");
//JAXBContext context = null;
try {
/*context = JAXBContext.newInstance(Root.class);
File file = new File("./omdbapi... |
fc9eea6a-e808-4122-8b77-3705cf1e8bbb | 1 | @Override
public void execute(Player player, String[] args)
{
if(player.isAfk())
{
player.setAfk(false);
player.getChat().serverBroadcast(player.username + " is no longer afk.");
} else {
player.setAfk(true);
player.getChat().serverBroadcast(player.username + " is now afk...");
}
} |
16ef2ac4-f73e-41b5-b8ae-13d21b3411ac | 1 | public MethodInfo[] getMethods() {
if ((status & METHODS) == 0)
loadInfo(METHODS);
return methods;
} |
40ae1ce0-ef60-4fae-a41b-9fd7d1a8b9bb | 6 | public Decision takeDecision(IPersonToStrategy person, PersonalEnvironment personEnvir, Habitat settlement)
{
if (inDangerous(person))
{
return new TraderHealing();
}
if (person.getEquipment().howMoneyInCash() < 10) {
ChangeProfession decision = new ChangeProf... |
7fb55e58-f794-4fcd-b7ba-fffc758a9efc | 1 | public final Instruction getNextByAddr() {
if (nextByAddr.opcode == opc_impdep1)
return null;
return nextByAddr;
} |
2c1e0b62-28f1-4c2c-ac03-87f0070859d7 | 3 | public int sumLookback( int optInTimePeriod )
{
if( (int)optInTimePeriod == ( Integer.MIN_VALUE ) )
optInTimePeriod = 30;
else if( ((int)optInTimePeriod < 2) || ((int)optInTimePeriod > 100000) )
return -1;
return optInTimePeriod-1;
} |
8b6b161e-8990-470e-84f0-be1e7ef12d72 | 7 | public boolean equals(Object x)
{
if (! (x instanceof TypePlusCondition))
return false;
else
{
TraversalCondition c = (TraversalCondition)x;
return HGUtils.eq(startAtom, c.startAtom) &&
HGUtils.eq(linkPredicate, c.linkPredicate) &&
HGUtils.eq(siblingPredicate, c.siblingPredicate) &&
... |
6ebbad1a-1944-4d79-bd8c-77d628e990d2 | 8 | private void analyzeCurrentMemoryStatus() {
System.out.println("================= Current Memory Status =================");
System.out.println("## Current framework objects (TODO: add configurations)");
System.out.println("| Location \t | FrameworkObj \t| Inner object \t| retainedHeap \t| Reason (from mappe... |
8a8fb43d-6b04-4820-b248-34116853acec | 1 | public static void main(String[] args) {
if (args.length > 0) {
System.out.println("ㅎ2ㄹ ㅂㄱㄹ");
System.out.println("ㅎ2ㄹ ㅂㄱㄹ");
}
} |
f430ab40-f4b9-4301-88ee-5fe79ad2abc1 | 3 | public static void addChildsToNanoPostsInList(ArrayList<NanoPost> npList) {
for (NanoPost np : npList) {
np.getChilds().clear();
for (NanoPost npp : npList) {
if (np.isParentOf(npp)) {
np.addChild(npp);
}
}
... |
4bc8124d-9852-4c4a-96b0-a0197d8cf743 | 0 | @Override
public void setDef(String value) {this.def = value;} |
fd6ff0c7-0735-4ea4-a602-5a5fbd5fb8f9 | 3 | public Login() {
setTitle("Login");
setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
setResizable(false);
setModal(true);
int width = 300;
int height =135;
Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
int x = (screen.width-width)/2;
int y = (scr... |
9396260d-919c-49eb-9b1f-02331adf8f8f | 9 | @Override
public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel)
{
MOB target=this.getTarget(mob,commands,givenTarget);
if(target==null)
return false;
if(target.fetchEffect(ID())!=null)
{
mob.tell(L("You already healed by electricity."));
return false;
... |
46b49716-e005-43a3-89e1-033ed5b9151e | 5 | @Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof TipoPessoa)) {
return false;
}
TipoPessoa other = (TipoPessoa) object;
if ((this.id == null && other.id != null... |
8e20e726-585a-4fa5-925a-3f4283709418 | 3 | public void run()
{
int i = 0;
while(true)
{
// System.out.println("number : " + i++);
System.out.println("number : " + this.i++);
try{
Thread.sleep((long)Math.random() * 6000);
}
catch(InterruptedException e)
{
e.printStackTrace();
}
// if(50 == this.i)
if(50 == this.i)
... |
c45d0c16-f46b-4e41-bb19-c223d8c7a1f3 | 0 | public String displayInfo() {
super.displayInfo();
return "The lion is the king of the Jungle. Lions\nlive in the "+location;
} |
c24c23a9-0560-40b1-aa68-8037d4e43089 | 5 | private int maxChildPos( int pos ) {
int retVal;
int lc = 2*pos + 1; //index of left child
int rc = 2*pos + 2; //index of right child
//pos is not in the heap or pos is a leaf position
if ( pos < 0 || pos >= _heap.size() || lc >= _heap.size() )
retVal = -1;
//if no right child, then left child is only optio... |
166c1b0f-21b4-49f0-969f-a4986b095d4a | 2 | @Override
public void applyUIFileInTempAuthui(SkinPropertiesVO props, final UIFileTextVO uifile) throws IOException, InterruptedException {
if ((props == null) || (uifile == null)) {
IllegalArgumentException iae = new IllegalArgumentException("The props/uiFile must not be null!");
Ma... |
b80903af-3b67-466e-a558-dee0ee307fb4 | 1 | public List<Column> tableColumns(String schemaName, String tableName) throws SQLException {
String query = String.format(getColumnsStatement, tableName, schemaName);
ResultSet rs = statement.executeQuery(query);
List<Column> result = new ArrayList<Column>();
while (rs.next()) {
... |
58f137c0-66ee-4b03-96ae-f2fb6381d5d6 | 9 | public boolean handleEvent (Event event) {
if (event.id == Event.WINDOW_DESTROY ||
(event.id == Event.ACTION_EVENT && event.target == okayButton) ||
(event.id == Event.KEY_PRESS && event.key == 0x1b))
{
hide();
return true;
}
else return super.handleEvent (event);
} |
3b66559c-c66e-41dd-9e52-90660b1c2efe | 0 | @Override
public void setBirth(String birth) {
super.setBirth(birth);
} |
6ea9c1b9-2029-48ba-a149-3e7c8e3699d9 | 8 | @Override
public List<AssemblyLine> generate(Context context)
{
final List<AssemblyLine> lines = Lists.newLinkedList();
if (Compiler.debug)
{
lines.add(new Comment("Start condition"));
}
if (children.size() == 1)
{
context.setValue... |
39120184-c8f3-4ea8-b2c5-72ba507b92b0 | 5 | public void addFolder(String sent)
{
USBList hld = head;
Boolean exit = false;
while(hld != null && !exit)
{
if(hld.getName().equals(sent))
exit = true;
else
hld = hld.getNext();
}
if(hld == null || !exit)
return;
(hld.getWifiRC()).mkdirs();
} |
b84faa19-1920-4853-a4f4-5d4c43246cb8 | 5 | public final static String getAvailabilityString (int availabilityCode) {
switch (availabilityCode) {
case ROSTER_ABSENT: return "-";
case ROSTER_PARTICIPATES: return "T"; // Teilnehmer
case ROSTER_VACATION: return "U"; // Urlaub
case ROSTER_AVAILABLE: return "A"; // Arbeitet
case ROSTER_OFFICE... |
74f3496c-a757-4b06-b922-3df1a9c27a76 | 4 | @Override
public void actionPerformed(ActionEvent e) {
if (e.getSource() == exitButton)
System.exit(0);
// must have been the 'seek' button that was pressed,
// so clear the output area of any previous output...
report.setText("");
// retrieve the url from the input text field...
String host = hostInpu... |
724084f7-ef1e-4545-9bb1-f4a6be770a62 | 7 | public static ArrayList<Integer> getMaps(String searchTerm, String criterion) {
ArrayList<Integer> result= new ArrayList<Integer>();
searchTerm= searchTerm.trim();
if(searchTerm.isEmpty()) return result;
String query= "";
if(criterion.equals("giorno")){
query= findStoriesForDay(searchTerm);
}
if(criter... |
0d6f5e5b-9b06-4b19-83e5-a94d80cf8174 | 9 | public String FindMotif(Vector Set,Vector in,double cutoff,int[] Numbers) {
int size = in.size();
int Dim = Set.elementAt(0).toString().length();
int Pmatrix[][] = new int[Dim][21];
char template[] = new char[Dim];
int Number = 0 ;
Iterator list = in.iterator();
String temp = "";
int ... |
b5b22c3c-aa66-4c45-abda-5367b1a284d7 | 5 | final void method3651(za var_za) {
do {
try {
((OpenGlToolkit) this).aNativeHeap7730
= ((za_Sub1) (za_Sub1) var_za).aNativeHeap9770;
anInt7573++;
if (anInterface2_7797 != null)
break;
FloatBuffer class348_sub49_sub1
= new FloatBuffer(80);
if (!((OpenGlToolkit) this).aBoolean7775) {
... |
1a9f257d-a20a-4cf6-b434-10321e8107b9 | 1 | @Override
public boolean equals(Object other)
{
boolean result = false;
if (other instanceof MultiConnectionRoute)
{
MultiConnectionRoute that = (MultiConnectionRoute)other;
result = this.connections.equals(that.connections);
}
return result;
} |
b09f2fc3-b31a-4a3b-a927-dad27e4f9385 | 8 | public boolean teleport() {
if (Players.getLocal().getAnimation() == -1) {
Timer wait = new Timer(1);
final WidgetChild TELEPORT_TAB = Widgets.get(275, 46);
if (Tabs.ABILITY_BOOK.open() && !TELEPORT_TAB.visible()) {
WidgetChild magicTabButton = Widgets.get(275... |
1f5307ee-30bb-4269-9c1f-4b9bdec33d25 | 3 | public PlayerEntity(TileLevel level, Tile startingTile) {
super(level, startingTile);
standAnim = null;
moveAnim = null;
bumpAnim = null;
if(PlayerEntity.STAND_ANIMATIONS != null && PlayerEntity.MOVE_ANIMATIONS != null && PlayerEntity.BUMP_ANIMATIONS != null)
copyAnimations();
} |
5dad6e81-b66d-4b40-a279-91793c495d74 | 0 | private void jButtonNextActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonNextActionPerformed
ctrlCR.suivant();
}//GEN-LAST:event_jButtonNextActionPerformed |
111e8a9b-162b-4d5a-b9b6-6bfd31d47e11 | 2 | public static void main(String[] args) throws Exception {
ExecutorService exec = Executors.newCachedThreadPool();
CountDownLatch latch = new CountDownLatch(SIZE);
for (int i = 0; i < 10; i++)
exec.execute(new WaitingTask(latch));
for (int i = 0; i < SIZE; i++)
exe... |
f89e3d7a-ba17-483d-83a0-9307c253f307 | 8 | @Override
protected void reduce(Text key, Iterable<Text> values, Context context) throws IOException, InterruptedException {
if (times == 0) {
context.write(new Text("grandchild"), new Text("grandparent"));
times++;
}
int parentCount = 0;
... |
0e54769b-9b3f-4829-8cac-dbceb1b8e85f | 4 | @Override
public void paintComponent(Graphics graphics) {
super.paintComponent(graphics);
if (data == null) {
return;
}
final int xAxisSize = 40;
final int yAxisSize = 60;
final int yAxisLines = 10;
final... |
85450473-e1b6-4c3d-a5a4-542cff5b52e4 | 0 | public T getFoo()
{
return foo;
} |
3a0b25b1-995e-4e12-9bbc-0d650257d713 | 2 | @Override
public List<Person> meetCriteria(List<Person> persons) {
List<Person> malePersons = new ArrayList<>();
for (Person person : persons) {
if (person.getGender().equalsIgnoreCase("Male")) {
malePersons.add(person);
}
}
return malePersons;
} |
697a8e82-f8fb-4b67-9e23-d3786ff9497b | 0 | public boolean contains(String datum) {
return indexOf(datum) >= 0;
} |
d86bcd05-b116-4a4b-a742-14cac2db1cac | 4 | @Override
public synchronized void velocityChanged(float vx, float vy, float vz) {
long temp = System.currentTimeMillis();
long timeStamp = LastVelocityReadTime - temp;
LastVelocityReadTime = temp;
if(VelocityXSamples.size() >= NrOfSamples)
{
Vel... |
595bf661-b0bf-4985-9923-a9dbbeca04dc | 5 | public boolean deleteFilesFromSystem(ArrayList<String> deleteFileRequests)
{
boolean status = true;
if(deleteFileRequests != null)
{
for(String fileName : deleteFileRequests)
{
ArrayList<String> localfiles = fileInventoryManager.getLocalFiles();
if(localfiles != null)
{
boolean isLoc... |
cd5512c9-c89b-42a4-93ff-700da5b3df58 | 7 | public boolean addFrame(BufferedImage im) {
LogPrint.note(this, "addFrame");
if ((im == null) || !started) { return false; }
boolean ok = true;
try {
if (!sizeSet) {
// use first frame's size
setSize(im.getWidth(), im.getHeight());
... |
8270ba58-2324-487e-84a2-6218ab98a319 | 6 | public void sincronizarViewComModel(Servico model) {
if (model.getId() != null) {
txtItendificador.setText(model.getId().toString());
}
if (model.getTipoDeServico() != null) {
cbServicos.setSelectedItem(model.getTipoDeServico());
}
if (model.getCliente(... |
48cdfc1c-3e46-44cf-8e4f-cbed9b63413f | 3 | protected boolean parseArgs(String[] args)
{
boolean parsed = false;
if (args.length == 1)
{
init(args[0]);
parsed = true;
remote = false;
}
else if (args.length == 2)
{
if (!(args[0].equals("-url")))
{
showUsage();
}
else
{
init(args[1]);
parsed = true;
remote = tru... |
7c44341e-010b-437e-8c12-69b1b38bb6c6 | 3 | public static FileInputStream createInputStream(File file) throws IOException {
if (file.exists()) {
if (file.isDirectory()) {
throw new IOException("File '" + file + "' exists but is a directory");
}
if (!file.canRead()) {
throw new IOExceptio... |
9adc6d35-ad84-4476-ad44-e394b6ac8ba1 | 7 | private void handleBooleanProperty(final String name) {
String s = null;
try {
s = System.getProperty(name);
} catch (SecurityException x) {
if (DEBUG) debug("SecurityManager forbids reading system properties. Ignored");
}
if (s != null) {
s = s.trim().toLowerCas... |
7451f81c-572e-47d7-9c93-45532c875f3a | 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 ht... |
5b24d053-0012-4841-8743-887a888b8237 | 8 | public static Object escape(Object original) {
if (original instanceof Character) {
char u = (char) ((Character)original);
int idx = "\b\t\n\f\r\"\'\\".indexOf(u);
if (idx >= 0)
return "\\"+"btnfr\"\'\\".charAt(idx);
if (u < 32)
re... |
b51fea7e-9d89-43aa-b749-5929c33e74ae | 1 | public void kill(){
this.animation = deathAnim;
if(!dead){
dead = true;
SoundLibrary.playSound("catdead.wav");
deathAnim.start();
}
dead = true;
} |
c4e4e47e-2e96-4d6f-b307-5fd5c10d2bba | 5 | @Override
public void run() {
while (monitor.isAlive()) {
inputSemaphore.take();
switch (input.getChoice()) {
case ClockInput.SET_TIME:
setTime = input.getValue();
break;
case ClockInput.SET_ALARM:
... |
c420748a-1dd4-4438-8994-4d5742fa23cf | 8 | private void avoidFromEdge(int[][] currentTokens) {
//move currentTokens to the right if they are at right edge
while (x0 < 0 || x1 < 0 || x2 < 0 || x3 < 0) {
currentTokens[0][0]++;
currentTokens[1][0]++;
currentTokens[2][0]++;
currentTokens[3][0]++;
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.