method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
23e93808-d493-47b3-b33a-792ce6d2a635 | 9 | public final LogoParser.mult_return mult() throws RecognitionException {
LogoParser.mult_return retval = new LogoParser.mult_return();
retval.start = input.LT(1);
Object root_0 = null;
Token MULT45=null;
Token DIV46=null;
LogoParser.atom_return o1 =null;
LogoP... |
bbca97cb-792e-4faf-ac6a-bb73f2af0b5a | 6 | private Node expression() {
TokenType type = lookAhead(1);
if (type == TokenType.FUNCTION) {
return function();
} else if (type == TokenType.LBRACKET) {
return array();
} else if (type == TokenType.LBRACE) {
return dictionary();
}
/* added bu Jing Shu and Abdoul Diallo */
else if (type == Toke... |
23fb11af-96b1-438e-b362-ce2666518553 | 3 | private boolean bytesEndWith(byte[] ba, int str, int len, byte[] ew) {
if (len < LINE_SEP.length) {
return false;
}
for (int xa = 0, xb = (str + len - LINE_SEP.length); xa < LINE_SEP.length; xa++, xb++) {
if (LINE_SEP[xa] != ba[xb]) {
return false;
}
}
return true;
} |
21f10b08-6cb6-4704-bfd6-5af7adca597e | 2 | public static double acsc(double a){
if(a<1.0D && a>-1.0D) throw new IllegalArgumentException("acsc argument (" + a + ") must be >= 1 or <= -1");
return Math.asin(1.0/a);
} |
78245dbf-0a3c-432c-af43-74d8212b0d35 | 4 | protected long executeCreateWithAutoIncrement(String sql) throws SQLException{
Connection connection= null;
Statement statement= null;
ResultSet rs = null;
System.out.println(sql);
long autoIncKey = -1;
try{
connection = getConnection();
statement = connection.createStatement();
statement.executeUp... |
2f5b8328-cba0-461d-8d3d-f037431e90c6 | 3 | public boolean getAutenticacao(String nome, String senha) throws DaoException {
Connection conn = DbUtil.getConnection();
PreparedStatement statement = null;
ResultSet result = null;
int numReg = 0;
boolean autenticado = false;
try {
statement = conn.prepareStatement(VALIDAR_LOGIN_SENHA);
statement... |
43f06a1a-af22-4ecf-9d96-20785088fe24 | 0 | public NewAsset(){
} |
d4ce3733-fe4a-44a7-8e3d-805695d26dee | 6 | private Cell getChoice()
{
Cell choice = grid[0][0];
for(int i=0; i<9; i++)
{
for(int j=0; j<9; j++)
{
int oldSize = choice.getPosNumbers().size();
int newSize = grid[i][j].getPosNumbers().size();
if( (oldSize==0 && newS... |
354bcfeb-8117-4159-a112-b47b9ce649ba | 7 | private void focus() {
Body masterBody = null;
for (Body body : this.controller.getRoomState().getBodyList()) {
if (
(masterBody == null || masterBody.getProbability() < body.getProbability())
&& body.getProbability() >= this.bodyThreshold
) {
masterBody = body;
}
}
if (masterBody != ... |
319d5134-d8c9-471b-9a6e-51e2d515bd08 | 3 | public void makeRelationsButtonActionPerformed(ActionEvent evt)
{
System.out.println("In make relationships");
int k = stakeholders.size();
for (Iterator<Stakeholder> s = stakeholders.iterator(); s.hasNext();)
{
Stakeholder stakeholder = s.next();
int place = ... |
95f51b14-0db2-44fa-a5a5-10fdfb60f80e | 1 | public JPanel getLoadingstatusMenu() {
if (!isInitialized()) {
IllegalStateException e = new IllegalStateException("Call init first!");
throw e;
}
return this.loadingstatusMenu;
} |
0c4bfdd5-b8a4-4d3c-a92c-038b5771357a | 7 | public boolean stateEquals(MersenneTwisterFast other)
{
if (other == this) return true;
if (other == null)return false;
if (mti != other.mti) return false;
for(int x=0;x<mag01.length;x++)
if (mag01[x] != other.mag01[x]) return false;
for(int x=0;x<mt.length;x++)
if (mt[x] != other.m... |
f8093f8e-73d4-44b7-a050-661efb762237 | 4 | public Connection getConnectionInternal() {
try {
if (conn == null) {
Class.forName(driverClass);
conn = DriverManager.getConnection(connectionString, username.orNull(), password.orNull());
} else if (isExpired() || conn.isClosed()) {
resetConnection();
}
updateExpira... |
f135c7b2-9ed5-451c-a408-39e645c0bfad | 8 | public void readFields(DataInput in) throws IOException {
String data = new String(in.readLine());
try {
String tokens[] = data.split("[=]|[\\{]|[\\}]|[,]");
if(data.indexOf("Book") != -1 || tokens.length > 0) {
for( int i = 0; i < tokens.length ; i++) {
... |
a536bb5d-96f1-45f3-aff2-ee356a0dcebd | 6 | static final void method610() {
Object obj;
if (Class123.aFrame1950 == null) {
if (Class142_Sub8_Sub3.clientFrame != null) {
obj = Class142_Sub8_Sub3.clientFrame;
} else {
obj = Class112.signlink.applet;
}
} else {
o... |
cd8872f2-778a-4bec-b364-425d9ddfa32e | 9 | public void run() {
for(int i = 0;i < points;i++) {
Point2D.Float p = new Point2D.Float(rand(), rand());
debug(i + "", p.x + ", " + p.y);
for(int j = 0;j < 40;j++) {
Form form = chooseFormByWeight();
Color c = form.getColor();
form.compute(p);
debug(i + ", " + j, "----------------------------... |
d06c6929-aa74-4ac7-a8aa-6b73c728a884 | 6 | @Override
public void setComparators(TableRowSorter<PersonTableModel<Contestant>> sort) {
Comparator<String> strCompNoCase = new Comparator<String>() {
@Override
public int compare(String o1, String o2) {
return o1.compareToIgnoreCase(o2);
}
};
Comparator<Object> activeComp = new Comparator<Objec... |
05552c10-3d95-4de5-90d0-20cdc6f890d4 | 5 | public CheckResultMessage checkDayofMonth6() {
int r1 = get(6, 5);
int c1 = get(7, 5);
date();
if (checkVersion(file).equals("2003")) {
try {
in = new FileInputStream(file);
hWorkbook = new HSSFWorkbook(in);
if (!(getValueString(r1 + maxDay, c1 - 1, 4).equals(maxDay
+ "日"))) {
return e... |
9402bfa8-b9d9-457f-a076-20ab893c940e | 2 | public boolean insert(Grid g) {
free();
pane = g;
location.setLocation(g.insertAt());
if (location.x == -1) {
location.setLocation(-block.getMinX(), -block.getMinY());
}
calcShadowDrop();
if (maxFall.y > location.y) {
return false;
}
draw();
return true;
} |
33d992a8-1e78-43b4-b0cb-a6d425e15580 | 3 | public Map<String,String> getDestinations(String org) throws badSelectionException{
Map<String,String> destinations = new HashMap<String,String>();
if(!routes.containsKey(org)) throw new badSelectionException("The origin "+org+" is not in the routeMap");
Iterator<String> it = routes.get(org).iterator();
while(i... |
6508faaa-c31e-4b0e-966b-25c30a8a3a96 | 5 | protected boolean puedoUsarEsteConstructor(Constructor<?> constructor) {
Class<?>[] parameterTypes = constructor.getParameterTypes();
boolean ret = true;
for (Class<?> clazz : parameterTypes) {
ret = ret && this.hows.containsKey(clazz);
}
return ret;
} |
7577b913-a65f-4213-bfa6-3f1778058f69 | 2 | private void setupDialog() {
addToPanel(new JLabel("First"), 1, 1, 1, 1);
addToPanel(new JLabel("Second"), 2, 1, 1, 1);
addToPanel(new JLabel("Third"), 3, 1, 1, 1);
addToPanel(new JLabel("Fourth"), 4, 1, 1, 1);
addToPanel(new JLabel("Fifth"), 5, 1, 1, 1);
addToPanel(new J... |
dbf9026f-1d26-4dcc-be1e-9387729df87e | 9 | private static double toDouble(Object value)
{
if (value instanceof Number) {
return ((Number)value).doubleValue();
}
else if (value instanceof String) {
return ScriptRuntime.toNumber((String)value);
}
else if (value instanceof Scriptable) {
... |
cdac634c-3385-4506-a2a7-66d2d5affbe4 | 2 | @Override
public boolean reachesDestination(Packet p) {
// TODO Auto-generated method stub
Iterator<Edge> edgeIt = p.origin.outgoingConnections.iterator();
EdgeEtt e;
while(edgeIt.hasNext()){
e = (EdgeEtt) edgeIt.next();
if(e.endNode.equals(p.destination)){
etxLink = e.getEtx();
}
}
double ... |
d59aa6bf-93c0-45aa-8e5e-ea359eef4016 | 0 | @Basic
@Column(name = "FUN_FORMA_PAGO")
public String getFunFormaPago() {
return funFormaPago;
} |
5eb32cf8-7c5a-49b0-980f-fe617ac31df7 | 3 | public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
String line = "";
StringBuilder out = new StringBuilder();
while ((line = in.readLine()) != null && line.length() != 0) {
int[] ab = readInts(line);
long n = 1;
ab[1] = ... |
732e6aa2-fd85-4f61-9324-bb0547821db1 | 7 | protected void start(){
while(_map.getPlayerTanks().size() > 0 && _map.getEnemyTanks().size() > 0 && _map.getEnergy() > 0){
_view.printGameState("ROUND: "+_round);
for(Tank playerTank: _map.getPlayerTanks()){
Action playerAction = _pAI.doMove(_map.getGameEntities());
executeAction(playerAction, p... |
40cc1b59-16fe-48d4-90d9-c40821314b52 | 8 | @Override
public Tile getTile(Tile source, Direction dir) {
int x = source.getX();
int y = source.getY();
switch(dir) {
case NORTH:
y--;
break;
case SOUTH:
y++;
break;
case EAST:
x++;
break;
case WEST:
x--;
break;
}
if(x < 0)
x = tiles.length - 1;
else if(x > ... |
c5941226-34a7-4c96-ba65-d38842bbdedb | 3 | @OnMessage
public String onMessage(String message, Session UserSession) throws IOException {
username = (String) UserSession.getUserProperties().get("username");
Iterator<Session> iterator = chatroomUsers.iterator();
if (username == null) {
UserSession.getUserProperties().put("... |
c0f84658-d610-454e-a36c-3840fe5fba5c | 7 | public boolean getContainer(Container container, int rij, float tpf) {
String numberStorageCranesCounter = ""; // string leeg maken
switch (switchcase) {
case 0:
if (this.moveForward(false, tpf, rij, 4)) {
switchcase += 1;
}
... |
4e50c9a8-86e1-46cc-9d09-7a016b093aa7 | 6 | @Override
public Object getValueAt(int row, int col)
{
{
ProductionOrder po = Porder.get(row);
switch (col)
{
case 0:
return po.getID();
case 1:
return po.getPOrder();
case 2:
... |
8ef96f18-aa25-4ade-a50f-998be5a5f7c1 | 5 | @Override
public double directionFormAPoint(Point2D p, double axis) {
double b = 0d;
// use a inverse trigonometry to get the angle in an orthogonal triangle
// formed by the points (x,y) and (x1,y1)
if (position.getX() != p.getX()) {
// if we are not in the same horizontal axis
b = atan((position.getY(... |
a799717a-0662-4f86-a379-fd992ca1a344 | 9 | public static final boolean checkRunes(Player player, boolean delete,
int... runes) {
int weaponId = player.getEquipment().getWeaponId();
int shieldId = player.getEquipment().getShieldId();
int runesCount = 0;
while (runesCount < runes.length) {
int runeId = runes[runesCount++];
int ammount = runes[run... |
3c3899a5-c211-4116-818b-ef1878f718e4 | 9 | private double pointToObstacle(Polygon polygon, Point2D centre, Point2D front, boolean first)
{
int j = 0;
double minDistance = -1.0;
double dist = -1.0;
double px, py;
double x1, y1, x2, y2;
double m1, q1, m2, q2;
Line2D.Double beam = new Line2D.Double(centre, front);
for (int i = 0; i < polygon.npoi... |
6c8df205-c4b9-4fb3-b028-511f17693e2b | 2 | public synchronized void close() {
if (madeCycAccess) {
try {
getCycAccess().close();
} catch (Exception e) {
} // ignore
}
setCycAccess(null);
} |
aef7c5ad-4f73-4a81-9393-0c8f1419a795 | 6 | public void removeIncoerentTrees() {
HashSet<HashSet<Integer>> treeToRemove = new HashSet<HashSet<Integer>>();
HashSet<Integer> keyToRemove = new HashSet<Integer>();
Set<Integer> goodStates = FiniteTreesTable.keySet();
for (Entry<Integer, HashSet<HashSet<Integer>>> entryOfTable : FiniteTreesTable.entrySet()) {
... |
fca4071d-f837-438a-8c3d-9d521f1c42ea | 0 | public String getDescription() {
return description;
} |
5a98b89c-d9f7-4ec1-b11b-86a7bfa8dd42 | 8 | private MacWidgetsPainter<Component> getBackgroundPainter() {
MacWidgetsPainter<Component> retVal;
boolean windowHasFocus = WindowUtils.isParentWindowFocused(fTable);
boolean isColumnSelected = isColumnBeingPaintedSelected();
boolean isColumnPressed = isColumnBeingPaintedPressed();
... |
89414d86-8eb9-4c66-846c-7bf618859624 | 2 | @Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((colours == null) ? 0 : colours.hashCode());
result = prime * result + ((gridline == null) ? 0 : gridline.hashCode());
return result;
} |
fc50a733-30a7-4c60-9057-051dff0afd19 | 3 | public void inint(int n) {
d = new int[n][n];
for (int i = 0; i < n; i++)
for (int k = 0; k < n; k++)
if (i != k)
d[i][k] = INF;
} |
a5759e05-1b3b-475f-9a25-31770955b77c | 2 | public static String replaceWithWikiLink(String wikitext)
throws IOException {
String linkurl;
String linktext;
String backword;
String tail = "";
Matcher m;
while ((m = p_link.matcher(wikitext)).find()) {
if (m.group(5) == null) {
linkurl = URLEncoder.encode(m.group(3), "UTF-8");
linktext = m... |
e40a323e-2625-4c4b-a718-6f1b1dd38d8a | 0 | public Map<QName, String> getOtherAttributes() {
return otherAttributes;
} |
2c82c20b-5ba0-4394-a705-51493b873ae1 | 5 | public automataMensajes(String e,String d,String a,String m){
String r="";
msg=new message(e,d,a,m);
con=new conexion();
if(verify()){
if((r=determine())!=null){
if(r=="ambos"){
inboxTo(this.findUser("sales@empresa.com"));
... |
52ccebec-a5d4-4599-b249-ad475bb69f98 | 6 | public static List subList(List list, int start, int end) {
List newList = new ArrayList();
int normalizedSize = list.size() - 1;
if ((start < 0) || (start > normalizedSize) || (end < 0) ||
(start > end)) {
return newList;
}
for (int i = start; i < end && i <= normalizedSize; i++) {
newList.add(l... |
d2474eab-6fa3-45be-b67e-53086b9e509b | 2 | public static Date getDate(CSProperties p, String key) throws ParseException {
String val = p.get(key).toString();
if (val == null) {
throw new IllegalArgumentException(key);
}
String f = p.getInfo(key).get(KEY_FORMAT);
DateFormat fmt = new SimpleDateFormat(f == null ... |
aad526a0-2d99-4935-bc23-de0b1d16db45 | 9 | private IStatus doUndo(IProgressMonitor monitor, IAdaptable info,
IUndoableOperation operation) throws ExecutionException {
IStatus status = getUndoApproval(operation, info);
if (status.isOK()) {
notifyAboutToUndo(operation);
try {
status = operation.undo(monitor, info);
} catch (OperationCanceledEx... |
d72c48cb-f9c3-4756-ad8c-deb2190329ae | 7 | private void getPickupInstruction() {
currentState = new BrainState(BrainState.INSTRUCTION_PICKUP);
char read = (char) readAhead;
readNext();
if(checkCharacter(read, 'i')) {
read = (char) readAhead;
readNext();
if(checkCharacter(read, 'c')) {
read = (char) readAhead;
readNext();
if(checkCha... |
fae0c9a5-f116-4319-acc8-bf2e41247fde | 0 | synchronized public void adjustClock(Clock receivedTimeStamp) {
this.clock = Math.max(this.clock,
((LogicClock) receivedTimeStamp).clock) + 1;
} |
fc3dbaf6-285b-46d3-beda-7a4ed1a945e6 | 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... |
aeff2203-e628-4d6c-ba87-24ee978aa189 | 9 | public int handValue() {
handValue = 0;
for (int i=0; i<currentCardAmount; i++) {
if (hand[i].getNumber() >= 2 && hand[i].getNumber() <= 10) {
handValue += hand[i].getNumber();
} else if (hand[i].getNumber() >= 11 && hand[i].getNumber() <= 13) {
handValue += 10;
} else {
handValue += 11;
}
... |
3a526d7d-d7f0-4592-ae69-693c8fe01a42 | 3 | public Vector2d getPlayerSpawn() {
for (int y = 0; y < map.length; y++) {
for (int x = 0; x < map[0].length; x++) {
if (map[y][x] == 2)
return new Vector2d(x * BLOCK_SIZE + BLOCK_SIZE / 2, y * BLOCK_SIZE + BLOCK_SIZE / 2);
}
}
System.err.println("Spawn not found!");
return new Vector2d(0, 0);
} |
3b178e49-c16e-4ad2-81c0-43a40b10d583 | 0 | @Override
public Dimension getPreferredSize() {
return this.PREFERRED_DIMENSION;
} |
62454173-324f-46c4-8942-8375bff383d9 | 6 | private void parse(Node undefNode){
NamedNodeMap attrs = undefNode.getAttributes();
int lenght = attrs.getLength();
Node attr;
String name;
String value;
for(int i = 0 ; i < lenght ; i++){
attr = attrs.item(i);
name = attr.getNodeName();
value = attr.getNodeValue();
if(!name.equalsIgnoreCase(ENT... |
7273cb1d-4cbc-4757-ab15-431c63bdc796 | 9 | public void run() {
// initialization
System.out.println("Client1: initialization " + System.currentTimeMillis());
Messager messager = new Messager(Messager.Id_Client);
messager.initialization(serverIp);
TowerDefense_TransData towerDefense_TransData;
for (int i = 0; i < 3; i++) { // 3 round... |
b6e0f923-8872-4b72-b446-6d313fb59500 | 8 | private String startToneHunt (CircularDataBuffer circBuf,WaveData waveData) {
final int HighTONE=1212;
final int LowTONE=978;
final int toneDIFFERENCE=HighTONE-LowTONE;
final int ErrorALLOWANCE=40;
// Look for a low start tone followed by a high start tone
int tone1=xpa2Freq(circBuf,waveData,0);
... |
d5281fae-a9ff-4ca1-9ec4-238caaa62dd6 | 1 | public void addShift(Shift shift) {
if (listOfShifts == null) {
listOfShifts = new ArrayList<Shift>();
}
listOfShifts.add(shift);
} |
a7e8c8bc-957f-4b19-89cd-6ab4a2715c40 | 8 | private static AbstractConnectionText textFor( PathedGraphConnection connection, int i, float j ) {
switch( i ){
case 0:
return positionTest( connection, j );
case 1:
return distanceTest( connection, j );
case 2:
return shiftTest( connection, j );
case 3:
return angleTest( connection, j );... |
50f69abe-0fb3-4de1-8a78-3d2aea452b35 | 7 | public static Mat findContours(Mat frame) {
Mat contoursMat = preproc(frame);
Mat result = new Mat(contoursMat.size(), CvType.CV_8U, new Scalar(255));
List<MatOfPoint> contours = new ArrayList<>();
List<MatOfPoint> contoursGeneral = new ArrayList<>();
Imgproc.findContours(conto... |
60d2ad9b-48ae-498e-8b13-5e42a5d59321 | 5 | private void showPopup(MouseEvent e, final Integer select, final String man) {
JPopupMenu popupMenu = new JPopupMenu();
JMenuItem update = new JMenuItem("Update");
JMenuItem delete = new JMenuItem("Delete");
//Set deletefunction for employee, customer or product
delete.addActionL... |
60a196c5-1717-4bdc-8ea5-a602248d222c | 4 | private boolean normal(Publish p) {
boolean sent = false;
List<SubscriberParent> list = p.mapping.get(p.message.getClass());
if (list == null) {
return false;
}
for (SubscriberParent sp : list) {
Subscriber<?> s = sp.getSubscriber();
if (!predicateApplies(s, p.message)) {
continue;
}
s.rece... |
ee073b9b-66cb-4728-9bed-c918588affa9 | 7 | private void fillStackTrace0(List<StackTraceElement> stackTrace, boolean ifExcNotInit) {
XCallFrame cf = callFrame;
if (ifExcNotInit && cf.getModule().equals(rt.getModule("sys")) && cf.getMethodName().equals("__init__") && cf.getMethodClass().equals(rt.getModule("sys").getRaw(rt, "Exception"))) {
while (cf != nu... |
ded8cfa2-3014-4262-9b83-7ac5cbae4c5a | 0 | private String readInput() throws IOException {
return this.keyboard.readLine();
} |
12a37d7f-dfc5-4493-99c9-9d85f005a3a9 | 8 | protected void completeElement() {
if (getName().equals(XML_NODE)) {
// unify map child behaviour:
if (mapChild == null) {
mapChild = (NodeAdapter) userObject;
}
return;
}
if (getName().equals("font")) {
userObject = mMo... |
654e683b-3864-4628-8de7-ca79d59bafea | 0 | private void setEvent1(Event event) {
this.event = event;
} |
8f96735a-7d31-4c3d-a9f3-da6bf861e0e6 | 6 | public String getDefaultJavaPath () {
JavaInfo javaVersion;
if (OSUtils.getCurrentOS() == OS.MACOSX) {
javaVersion = JavaFinder.parseJavaVersion();
if (javaVersion != null && javaVersion.path != null)
return javaVersion.path;
} else if (OSUtils.getCurren... |
346a2e7e-af16-41a4-95e0-edae95c2f67a | 7 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Job other = (Job) obj;
if (name == null) {
if (other.name != null)
... |
aa6dd82f-900f-4a82-98b4-99180d065224 | 8 | private static boolean handleIsPawnPromotion(Board b, Move m, int color) {
if (color == Board.white) {
if ((m.start.rank == 1 && m.end.rank == 0) &&
b.currentPieceInPosition(m.start) == Board.whitePawn) {
return true;
}
} else if (color == Board.black) {
if ((m.start.rank == 6 && m.end.rank == 7) ... |
def48b9a-b40a-473f-a863-d340d985ce11 | 1 | public static void listFiles(String[] arr) {
int option;
for (int fileInList = 0; fileInList < arr.length; fileInList++) {
option = fileInList + 1;
System.out.println(option + " " + arr[fileInList].toString());
}
} |
7ac2eef9-9fde-4858-94d0-6398a830247b | 0 | private void addNewRow(AlgorythmFile data){
tableModel.addRow(new String[]
{
data.getAlgorythmName(),
data.getAlgorythmType(),
data.getAlgorythmFile().getName()
}
);
dataBase.addFile(data);
... |
04111716-2bfe-438e-ae5c-a4ddca48dcd1 | 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();
... |
07868b07-9a45-4949-b03e-2fdda972c4ae | 8 | public static ProfessorBean fetchProfessorInfo(int id) {
ProfessorBean bean = new ProfessorBean();
ResultSet rs=null;
Connection con=null;
PreparedStatement ps=null;
try{
String sql="SELECT S.P_ID, S.DEPTID, S.SUBJECTS, D.DEPTNAME "
+ "FROM PROFESSOR S, DEPARTMENT D WHERE S.DEPTID=D.DEPTID AND"
+... |
2739bd6e-adfd-4f98-b7be-13cbc6ab8932 | 0 | @Basic
@Column(name = "sort")
public int getSort() {
return sort;
} |
68d3ecef-7cc8-4e05-a9c2-2845c33f622e | 1 | public static void main(String[] args) {
String threadName = Thread.currentThread().getName();
System.out.println(threadName+" start!");
CustomThread1 t1 = new CustomThread1();
//t2时实现了接口线程,所以需要new Thread来运行
CustomThread2 t2 = new CustomThread2(t1);
Thread t22 = new Thread(t2);
try{
t1.start();
... |
0e94efed-6b23-4eb9-973b-8122fd98bfdc | 3 | public void visitFrame(final int type, final int nLocal,
final Object[] local, final int nStack, final Object[] stack) {
if (type != Opcodes.F_NEW) { // uncompressed frame
throw new IllegalStateException(
"ClassReader.accept() should be called with EXPAND_FRAMES flag");
}
if (mv != null) {
mv.visit... |
051f3745-be46-4f77-9d13-548d8d963b4e | 2 | @Override
public void run() {
Action<ChatAction> a = new ChatAction();
a.setPlayer(player);
try {
ChatAction c = a.waitForResponse();
player.sendMessage("You said " + c.getMessage() + "!");
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.pr... |
5d3667d2-2bff-493d-92ce-7b5304682379 | 7 | private String getStatusString() {
switch (getStatus()) {
case Watchable.NOT_STARTED:
return "Not started";
case Watchable.RUNNING:
return "Running";
case Watchable.NEEDS_DATA:
return "Needs Data";
case Watchable.PAU... |
46db0fa3-7905-45f5-a7a8-fca62ca800e6 | 5 | public void checkAnonymousClasses() {
if (methodFlag != CONSTRUCTOR
|| (Options.options & Options.OPTION_ANON) == 0)
return;
InnerClassInfo outer = getOuterClassInfo(getClassInfo());
if (outer != null && (outer.outer == null || outer.name == null)) {
methodAnalyzer.addAnonymousConstructor(this);
}
} |
e9bca0bc-4916-4d5e-9b8b-532b49e1d62f | 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;
... |
8ee937d3-ae3d-47d0-804c-9824071839a2 | 1 | @Override
public void add(OwnerDaoEntity ownerDaoEntity) throws DaoException {
PreparedStatement insertStmt = null;
Connection conn = openConnection();
try {
insertStmt = conn.prepareStatement(insertSql);
insertStmt.setString(1, ownerDaoEntity.getFirstName());
... |
a1cc74ab-2a17-4250-ade8-a1fc81bf468d | 0 | public static int luminance(int color)
{
int red = (color & RED_MASK) >> 16;
int green = (color & GREEN_MASK) >> 8;
int blue = (color & BLUE_MASK);
double y = 0.2126*red + 0.7152*green + 0.0722*blue;
return (int)y;
} |
6618e734-3320-4a0a-82fb-b1a40833b66a | 6 | public void overwriteTRNS(byte r, byte g, byte b) {
if(hasAlphaChannel()) {
throw new UnsupportedOperationException("image has an alpha channel");
}
byte[] pal = this.palette;
if(pal == null) {
transPixel = new byte[] { 0, r, 0, g, 0, b };
} else {
... |
7db8490b-65da-4dbd-868b-ecfe71b18d1b | 7 | public Map<NonTerminal,Set<LinkedList<Production>>> getInjectionChains() {
// inverted!!
// for instance: <A, {B->A, C->A}>
Set<LinkedList<Production>> chains = new ShareableHashSet<LinkedList<Production>>();
for (Production p : productions) {
if (p.isInjection()) {
LinkedList<Production> l = new Linked... |
a9991251-0e29-4080-b5eb-c8d6cfa76f8a | 7 | protected void initializeFromByteArray( byte[] barray )
{
// check first bytes to see if this is a zipfile (OOXML)
if( ((char) barray[0] == 'P') && ((char) barray[1] == 'K') )
{
try
{
// added "." fixes Baxter Open Bug [BugTracker 2909]
File ftmp = TempFileManager.createTempFile( "WBP", ".tmp" );
... |
6b04c6c3-800e-48d8-88c7-efdb08e82058 | 5 | public boolean subtypeOf(CtClass clazz) throws NotFoundException {
if (super.subtypeOf(clazz))
return true;
String cname = clazz.getName();
if (cname.equals(javaLangObject)
|| cname.equals("java.lang.Cloneable")
|| cname.equals("java.io.Serializable"))
... |
8cd3b5ac-d57f-49bd-8aa1-bae12b705396 | 6 | public byte[] encode(byte[] mHash, int emBits, byte[] salt) {
int sLen = salt.length;
// 1. If the length of M is greater than the input limitation for the hash
// function (2**61 - 1 octets for SHA-1) then output "message too long"
// and stop.
// 2. Let mHash = Hash(M), an octet string ... |
01a4e48f-24a8-4a37-aa77-36eeb9fb88e0 | 0 | @Test
public void out_by_right_ticket_when_in_a_car() {
Park park = new Park(10);
Car car = new Car();
Ticket ticket = park.in(car);
Assert.assertSame(car, park.out(ticket));
} |
6e53c73b-1f1e-456e-829f-14e7fc2ebf6b | 5 | public void paintIcon( Component c, Graphics g, int x, int y )
{
Color color = c == null ? Color.GRAY : c.getBackground() ;
// In a compound sort, make each succesive triangle 20%
// smaller than the previous one.
int dx = ( int ) ( size / 2 * Math.pow( 0.8, priority ) ) ;
int dy = des... |
54d881f7-c825-4c2c-a218-3b5b9600b2f8 | 6 | private void checkForBackwardRun(Object n, ArrayList array, int[] arrayTotal){
if (array.isEmpty()) {
array.add(n);
} else {
if (c2I((char)array.get(array.size()-1)) == c2I((char)n)+1
|| ((char)n == 'T' && c2I((char)array.get(array.size()-1)) == 0)){
... |
be441b10-ed9f-4b3a-a3df-bad0f08592a6 | 9 | public boolean newCharactersAllowed(String login, Session session, PlayerAccount acct, boolean skipAccountNameCheck)
{
switch(newCharNameCheck(login,session.getAddress(),skipAccountNameCheck))
{
case NO_NEW_PLAYERS:
session.println(L("\n\r'@x1' is not recognized.",CMStrings.capitalizeAndLower(login)));
ret... |
1ea540d4-1f89-4937-80b8-41dc459710dc | 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 acid."));
return false;
}
... |
5e266226-fcf2-4367-9267-4d30ed02d460 | 2 | public boolean openConnection(String address) {
try {
socket = new DatagramSocket();
ip = InetAddress.getByName(address);
} catch (UnknownHostException e) {
e.printStackTrace();
return false;
} catch (SocketException e) {
e.printStackTrace();
return false;
}
return true;
} |
8dd94ff1-717e-4571-8d68-5b8c040dd573 | 8 | @Override
public boolean onCommand(CommandSender cs, Command cmnd, String cmd, String[] args) {
if (!(cs instanceof Player)) return true;
Player p = (Player) cs;
if (args.length < 1) return help(p);
Class<? extends RCommand> commandClass = this.commandMap.get(args[0]);
if (c... |
9b39735d-da1e-4f2a-84ce-8929ff2a1746 | 3 | public List<BipolarQuestion> getResponseBipolarListParent(String teamType) {
List<BipolarQuestion> bipolarQuestionList = new ArrayList<BipolarQuestion>();
Element bipolarQuestionE;
BipolarQuestion bipolarQuestion;
for (Iterator i = root.elementIterator("bipolarQuestion"); i.hasNext();) {
bipolarQuestionE = (... |
47489a74-ccbe-4b05-a4bc-84c46c5d9b35 | 0 | void setQuestion(Question question)
{
questionTextArea.setText(question.getQuestion());
answerTextArea.setText(prepareAnswer(question));
} |
e5361dac-a7a7-4eb7-afe2-a696b2bcb996 | 6 | private Map<ForceFieldGenerator, Direction> getNearbyForceFieldgenerators(Position position) {
Map<ForceFieldGenerator, Direction> neighbours = new HashMap<ForceFieldGenerator, Direction>();
for (Direction dir : Direction.values()) {
Position newPos = dir.newPosition(position);
for (int i = 0; i < 3; i++) {
... |
51ebc6a6-8663-4286-b8ec-163a029d5409 | 2 | public void shuffle() {
Random rand = new Random();
for (int i = 0; i < cardPile.size(); i++) {
cardPile.add(rand.nextInt(i + 1), cardPile.removeLast());
}
if (component != null) {
component.updateTopCard();
}
} |
1269ecb1-8d82-445e-835f-0401740a511b | 3 | @Override
public Image getImage () {
if ( right ) {
return Sprites.PLAYER_RIGHT.getImage( walking ? Sprites.PLAYER_RIGHT.getFrame() : 0 );
} else {
return Sprites.PLAYER_LEFT.getImage( walking ? Sprites.PLAYER_LEFT.getFrame() : 0 );
}
} |
b7325b37-1e05-4756-a503-8e437331034a | 9 | public String sample_frequency_string()
{
switch (h_sample_frequency)
{
case THIRTYTWO:
if (h_version == MPEG1)
return "32 kHz";
else if (h_version == MPEG2_LSF)
return "16 kHz";
else // SZD
return "8 kHz";
case FOURTYFOUR_POINT_ONE:
if (h_version == MPEG1)
return "... |
e63073e8-e320-4fbc-8dc0-d9e96d8ea6ae | 9 | private static List<Holder> getList() throws Exception
{
List<Holder> list = new ArrayList<Holder>();
BufferedReader reader = new BufferedReader(new FileReader(new File(
ConfigReader.getJobinLabRNASeqDir() + File.separator + "pivotedSamplesAsColumns.txt")));
String top =reader.readLine();
StringT... |
10507df3-bdca-48c2-b6a9-09d62fb837d4 | 0 | @Column(name = "PCA_GRUPO")
@Id
public Integer getPcaGrupo() {
return pcaGrupo;
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.