method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
7bce83ef-ea10-452f-8ef1-a6fc26fac0cc | 7 | @Override
public void run(int interfaceId, int componentId) {
if (stage == -1) {
sendEntityDialogue(SEND_1_TEXT_CHAT,
new String[] {
NPCDefinitions.getNPCDefinitions(npcId).name,
"The trip will cost you 30 coins." }, IS_NPC,
npcId, 9827);
stage = 0;
} else if (stage == 0) {
sendDia... |
c2109172-839b-4d67-a201-14e9578b0a89 | 8 | private int phraseFreq() throws IOException {
// reset state
final PostingsAndPosition[] postings = this.postings;
for (PostingsAndPosition posting : postings) {
posting.freq = posting.postings.freq();
posting.pos = posting.postings.nextPosition();
posting.upTo = 1;
}
int freq = 0... |
31a3044a-711c-4206-bed3-6ebbcfd47c5d | 2 | @Override
public void init(){
// Build a polygon list
double [][]distDataProp = new double[][] {{.25,.45, .20},{.56, .89, .45}, {.6, .3,.7}};
List<Polygon> polygons = new ArrayList<Polygon>();
for(int i = 0; i < distDataProp.length -1; i++){
for(int j = 0; j < distDataProp[i... |
d6d03d76-ae87-46ab-ba91-465c84d0f129 | 3 | static Boolean othersHasBeenTo(HashSet<String> cluster, String bid, String uid) {
for (String user: cluster) {
if (!user.equals(uid)) {
if (ubScore.getCount(user, bid) != 0) {
return true;
}
}
}
return false;
} |
454dcff0-19d2-47c3-b9d7-3cb6705b85c3 | 8 | @Override
public boolean equals(Object athat) {
if (this == athat) return true;
if (!(athat instanceof News)) return false;
News that = (News)athat;
return
( this.title.equals(that.title) ) &&
( this.content.equals(that.content) ) &&
( this.publisher.equals(that.publis... |
65733dba-8cbb-4f2d-885b-0d9ee88c89ef | 7 | @SuppressWarnings("unchecked")
BitSet lookupValue(String variable, boolean plurals) throws ScriptException {
if (logMessages)
viewer.scriptStatus("lookupValue(" + variable + ")");
Object value = variables.get(variable);
if (value != null) {
if (value instanceof Token[]) {
value = expression((Token[]) v... |
f970d2b7-8000-4692-be20-c91f9cde916d | 3 | protected void fall() {
if (normalPhysics && falling) {
if (velY > maxVelY) velY = maxVelY;
velY += world.getGravity();
}
} |
ff26b948-5c1f-4b0b-a324-9cf30c1cbe3b | 1 | private static void changeCol(int аrray[][], int col1, int col2) {
int help;
for (int i = 0; i < аrray.length; i++) {
help = аrray[i][col1];
аrray[i][col1] = аrray[i][col2];
аrray[i][col2] = help;
}
} |
e40af5f5-df1f-4d94-9292-aa13d550c7e3 | 6 | public JavaClient() {
// XXX Later for chess
//ResModel.init(this.getClass());
this.view = new ClientViewPanel();
// Add listeners
view.getFrame().addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent winEvt) {
if(thread !... |
a3f376f7-8a13-4d9d-9f69-036f223d3126 | 4 | public void keepItem2() {
for(int i = 0; i < playerItems.length; i++) {
int highest = 0;
int value = (int)Math.floor(GetItemShopValue(playerItems[i]-1, 0, i));
if(value > highest && playerItems[i]-1 != keepItem && playerItems[i]-1 != -1) {
highest = value;
keepItem2 = playerItems[i]-1;
keepItemAm... |
7aa09981-7ee4-4849-ab4d-dde2f78547a8 | 5 | public void ExpandLevel(int xExpand, int yExpand) {
render = false;
HashMap<Integer,HashMap<Vector2i,Tile>> LayerMap = new HashMap<Integer,HashMap<Vector2i,Tile>>();
HashMap<Vector2i,Tile> TileMap = new HashMap<Vector2i,Tile>();
Vector2i Tc;
for(int layer = 1; layer <= Layers; layer++) {
for(int yt = 0;... |
c48125d3-be05-440f-904f-ce6003251b37 | 4 | @Override
public void setBoolean(long i, boolean value)
{
if (ptr != 0) {
Utilities.UNSAFE.putInt(ptr + sizeof * i, value == true ? 1 : 0);
} else {
if (isConstant()) {
throw new IllegalAccessError("Constant arrays cannot be modified.");
}
... |
770920d1-eff9-4a93-8afb-5a178a60e29c | 7 | private void dhcpDiscover(){
int discoverTime = -1;
// create discover packet
LOG.info("create discover packet");
byte[] discoverMessage = createDiscoverMessage();
DatagramPacket discoverPacket = null;
try {
discoverPacket = new DatagramPacket(discoverMessage... |
e6e66ab7-5095-4451-b16a-c75247fa48ff | 9 | public void doAutoAction(){
isChevron = false;
isExxon = false;
isShell = false;
isTexaco = false;
DPHreader dphReader = DPHreader.getInstance();
ArrayList<String> userChoices = dphReader.readAnswers(GasDecisionProcess.getUserDPH(), ID);
isUserResponded = true;
int answe... |
3085bc50-d9a6-4835-b9db-0eb44a17a571 | 4 | @Override
public void addNodeToOutline (NodeImpl node, int level) {
// for appendage, we need to consider the current node's level
// and the node-to-be-added's level
int levelDelta = level - currentLevel ;
// in case we need to go back up the outline
int climbCounter = 0 ;
Node tempNode = null ;
... |
65c487d5-86c6-4dea-8a3c-e007c0569a10 | 2 | protected static boolean triangleEdgeTest( float[] v0, float[] v1, float[] u0, float[] u1, float[] u2, int i0,
int i1 )
{
float ax = v1[i0] - v0[i0];
float ay = v1[i1] - v0[i1];
// Test edge u0:u1 against v0:v1
boolean tf = edgeEdgeTest( v0, u0, u1, i0, i1, ax, ay );
if ( tf )
return true;
... |
af4faaca-9c00-435d-875f-caf8b09aac75 | 2 | @Test
public void testStartingPositionsEqualToNumberOfPlayers() {
int count = 0;
for (Element e : grid.getElementsOnGrid())
if (e instanceof PlayerStartPosition)
count++;
assertEquals(count, game.getPlayers().size());
} |
5e4c84d4-9809-4611-84e7-e96cf71492cc | 7 | public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page ... |
129a2e42-6fd8-4f96-b4af-498711fd919a | 8 | public Collection read (Kryo kryo, Input input, Class<Collection> type) {
Collection collection = create(kryo, input, type);
kryo.reference(collection);
int length = input.readInt(true);
if (collection instanceof ArrayList) ((ArrayList)collection).ensureCapacity(length);
Class elementClass = this.elementClass... |
2bf731e7-5643-462c-8522-7ffa79c93a43 | 3 | public void read() {
// do not read if protocol has terminated. only write of pending data is
// allowed
if (_protocol.shouldClose()) {
return;
}
SocketAddress address = _sChannel.socket().getRemoteSocketAddress();
logger.info("Reading from " + address);
ByteBuffer buf = ByteBuffer.allocate(BUFFER_SI... |
c16751a6-22c6-4b7c-b750-09e0fbcce966 | 5 | private boolean complExpAritmetica() {
boolean erro = false;
if (!opSecundario()) {
erro = true;
} else {
if (!acabouListaTokens()) {
nextToken();
if (!termoAritmetico()) {
erro = true;
} else {
... |
c4c8ca5e-cfab-4358-a9c3-aaf99ca0fdc0 | 7 | private String justifyLine(ArrayList<String> line, int indent) {
if (line.size() == 1) {
return line.get(0);
}
String result = "";
int l = charsIn(line);
if (line.size() - 1 + l == _textWidth || !_justify) {
return lineToString(line);
}
dou... |
2740ebe7-8f2d-4a40-9858-7955f88bcc9f | 7 | @EventHandler
public void onSignClick(PlayerInteractEvent event)
{
Player player = event.getPlayer();
if(!player.hasPermission("woolrush.sign"))
return;
Block block = event.getClickedBlock();
if(block==null)
return;
if((block.getType().equals(Material.WALL_SIGN)) || (block.getType().equals(Material.SI... |
a734dd2f-b802-4d80-99c0-dafbb2c7f714 | 6 | @Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof OAuth)) return false;
OAuth oAuth = (OAuth) o;
if (consumerKey != null ? !consumerKey.equals(oAuth.consumerKey) : oAuth.consumerKey != null)
return false;
if (consumerSecr... |
0279ef97-273a-4e85-bf39-21588f9cec19 | 6 | public static String escape(String string) {
StringBuffer sb = new StringBuffer();
for (int i = 0, length = string.length(); i < length; i++) {
char c = string.charAt(i);
switch (c) {
case '&':
sb.append("&");
break;
cas... |
ebc98d2a-3a14-431a-a585-89eae907a362 | 8 | private boolean verifyChapPassword(String plaintext)
throws RadiusException {
if (plaintext == null || plaintext.length() == 0)
throw new IllegalArgumentException("plaintext must not be empty");
if (chapChallenge == null || chapChallenge.length != 16)
throw new RadiusException("CHAP challenge must be 16 byt... |
5d76e99c-fe26-4465-966d-3ecb50a2e7c7 | 6 | public ArrayList<Report> getReports(int cabin_id) {
ArrayList<Report> rp = new ArrayList<Report>();
ResultSet rs = null;
try{
statement = connection.createStatement();
String sql = "select * from reports where cabin_id = " + cabin_id + " order by report_date desc";
rs = statement.executeQuery(sql);
w... |
c9bc0c87-7b57-4c90-b9c0-7e17c67c48b1 | 2 | public static void renameFile(String srcPath, String aimPath) throws UtilException {
File srcFile = new File(srcPath);
if (!(srcFile.exists()))
throw new UtilException("原始文件不存在:" + srcPath);
File aimFile = new File(aimPath);
if (aimFile.exists())
throw new UtilException("目标文件已存在:" + aimPath);
srcFile.... |
926e9723-7744-421e-8c43-8d1902911ad2 | 0 | public void removeSprite(Sprite sprite) {
sprites.remove(sprite);
} |
1a17abe9-2044-463a-ab71-fa40f3305f6a | 8 | @SuppressWarnings("unchecked")
public static <T extends Number> SparseMatrix mulSparseMatrixWithSparseMatrix(SparseMatrix a, SparseMatrix b, Class<T> type) {
SparseMatrix result = null;
try {
if (a == null || b == null) {
throw new NullPointerException();
}
int size = a.getSize();
... |
9669247d-4694-4493-8718-3726ac517755 | 7 | private java.util.logging.Level mapJULLevel(int level) {
java.util.logging.Level julLevel = null;
switch (level) {
case SEVERE:
julLevel = java.util.logging.Level.SEVERE;
break;
case WARNING:
julLevel = java.util.logging.Level.WARNING;
break;
case INFO:
julLevel = java.util.logging.Lev... |
92c07a98-2a52-41af-9501-03e38a8fad60 | 4 | public static String encodeBytes(byte[] source)
{
int off = 0;
int len = source.length;
int len43 = len * 4 / 3;
byte[] outBuff = new byte[(len43) // Main 4:3
+ ((len % 3) > 0 ? 4 : 0)]; // Account for padding
int d = 0;
int e = 0;
int len2 = len - 2;
for (; d < len2; d += 3, e += 4)
encode3to4... |
0fca4d2b-a0c6-4614-b31d-f49b0d2d16d7 | 8 | @Override
public void propertyChange(PropertyChangeEvent evt) {
if(evt.getSource() == initalGold)
{
if((int)initalGold.getValue() < 0)
{
initalGold.setValue(new Integer(0));
}
}
else if(evt.getSource() == initalCardDraw)
{
if((int)initalCardDraw.getValue() < 0)
{
initalCardDraw.setValu... |
6ce0130a-be22-4fc4-afd9-0e87a5759b1b | 9 | @Override
public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel)
{
MOB target=mob;
if((auto)&&(givenTarget!=null)&&(givenTarget instanceof MOB))
target=(MOB)givenTarget;
if(target==null)
return false;
if(target.fetchEffect(ID())!=null)
{
mob.tell(targ... |
894c05bb-a37e-42ae-9c33-c9a5d7d546be | 9 | final private boolean jj_scan_token(int kind) {
if (jj_scanpos == jj_lastpos) {
jj_la--;
if (jj_scanpos.next == null) {
jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken();
} else {
jj_lastpos = jj_scanpos = jj_scanpos.next;
}
} else {
jj_scanpos... |
7c10b265-8185-4790-bcff-925f76af9040 | 4 | public Object nth(int position) {
SListNode currentNode;
if ((position < 1) || (head == null)) {
return null;
} else {
currentNode = head;
while (position > 1) {
currentNode = currentNode.next;
if (currentNode == null) {
return null;
}
... |
bcfca187-0564-49f0-8d10-819a33f767d5 | 9 | public boolean sendQMessages() throws PostServiceNotSetException{
if (this.postservice == null){
throw new PostServiceNotSetException();
}
boolean atLeastOneUpdated = false;
switch (Athena.shuffleMessage){
case 1:
Object[] arrayx = this.getVari... |
bca2be07-eb80-4d6c-af1b-3107d8f84bfc | 5 | @Override
public void loadCustom()
{
usedGroups.clear();
unusedGroups.setAll(CraftingGroups.values());
JsonValue jGroups = asset.getObject().get("groups");
if(jGroups != null && jGroups.isArray())
{
for(JsonValue v: (JsonArray) jGroups)
{
if(v.isString())
{
try
{
CraftingGroups... |
0dbfb5ec-5d75-43a3-ac37-130f6b31c5b0 | 3 | private void browseHistory(KeyEvent e) {
int c = e.getKeyCode();
String command = "";
if (c == KeyEvent.VK_UP)
command = CommandHistory.getPrevious();
else if (c == KeyEvent.VK_DOWN)
command = CommandHistory.getNext();
if ( command.length() == 0)
... |
e0d497d5-e96d-43b7-905d-fb5132fe684d | 3 | @Override
protected void checkBeforeParse(Method method) throws DaoGenerateException {
super.checkBeforeParse(method);
MapperBy mapperBy = method.getAnnotation(MapperBy.class);
if (mapperBy == null
&& (ClassHelper.isTypeList(method.getReturnType()) && ClassHelper.getReturnGenericType(method) == null)) {
... |
59d8bc85-8506-4b9d-bf9d-61ee0a7df847 | 4 | public void read(final ProtocolDecoder decoder) throws Exception
{
// Read until protocol has enough data to decode
buffer.clear();
do
{
channel.read(buffer).get(timeout_ms, MILLISECONDS);
}
while (buffer.position() < decoder.getResponseSize(buffer));
// Prepare to decode
buffer.flip();
if ... |
561645e3-4b34-4ce5-a2e5-0ed5da4a5163 | 0 | protected String protectedMethod()
{
return "protected";
} |
64e2754c-1850-4bc3-891f-7c6aae64603f | 3 | private boolean reachedMaxRaises() {
int historySize = actionHistory.size();
if(historySize < maxNumberOfRaises)
return false;
for(int i = maxNumberOfRaises; i >= 1; i--) {
if(actionHistory.get(historySize - i) != Action.RAISE)
return false;
}
return true;
} |
c74536d2-2bee-47f2-8395-f5e43a584171 | 9 | public static int testPrivate(int testNum)
{
String inputFilename = String.format("tests/testP%02d.crx", testNum);
String outputFilename = String.format("tests/testP%02d.rea", testNum);
String expectedFilename = String.format("tests/testP%02d.out", testNum);
Scanner s = null;
try
{
s = new Scanner(new ... |
a0132231-0fb8-42e8-b89c-c31e0eb7a6fd | 7 | public AsyncImportResult(Document asyncImportResultXml)
{
Element elem = ((Element)(asyncImportResultXml
.getElementsByTagName("status")).item(0));
String statusText = XmlUtils.getElemText(elem);
if (statusText.equals("created")){
... |
ce3ee0d8-735a-438e-954b-4f708a69448a | 7 | public String convertHTMLCode2Unicode(String text) {
StringBuffer newString = new StringBuffer();
int textLen = text.length();
for (int i = 0; i < textLen; i++) {
char charAtI = text.charAt(i);
if (i + 2 < textLen && charAtI == '&' && text.charAt(i + 1) == '#' && text.charAt(i + 2) == '7') {
int indexO... |
d25df15c-017e-491a-a93d-430d8cb56171 | 5 | @Override
public void caseAParaPassoComando(AParaPassoComando node)
{
inAParaPassoComando(node);
{
List<PComando> copy = new ArrayList<PComando>(node.getComando());
Collections.reverse(copy);
for(PComando e : copy)
{
e.apply(this);
... |
99de5d3e-ea9d-49f4-8549-1aa0a150f397 | 9 | @Override
public void setXML(String str)
{
final XMLLibrary xmlLib = CMLib.xml();
final List<XMLLibrary.XMLTag> xml = xmlLib.parseAllXML(str);
final String[] codes=getStatCodes();
for (final String code : codes)
{
String val=xmlLib.getValFromPieces(xml,code.toUpperCase());
if(val==null)
val="";
... |
2cfadcdd-8ebb-4b27-91e7-85909952729c | 9 | private void setupUI() {
setBackground(Color.WHITE);
updateScale();
updateNameTableTiles(true);
setMinimumSize(new Dimension(currentPixelArrayWidth * MIN_SCALE, currentPixelArrayHeight * MIN_SCALE));
// setPreferredSize(new Dimension(currentWidth, currentHeight));
... |
0197d724-d411-4b8e-a0a9-2bab5996d769 | 5 | protected Node<T> getGreatest(Node<T> startingNode) {
if (startingNode == null)
return null;
Node<T> greater = startingNode.greater;
while (greater != null && greater.id != null) {
Node<T> node = greater.greater;
if (node != null && node.id != null)
... |
1cc09ff7-fad2-4aa3-8027-8a0eafefd4b8 | 1 | private static int factorial(int number) {
if (number == 1) {
return 1;
} else {
return number * factorial(number - 1);
}
} |
7f508334-0d0a-4ccd-8d3a-06c1f30baf9d | 7 | @EventHandler
public void WitherPoison(EntityDamageByEntityEvent event) {
Entity e = event.getEntity();
Entity damager = event.getDamager();
String world = e.getWorld().getName();
boolean dodged = false;
Random random = new Random();
double randomChance = plugin.getZombieConfig().getDouble("Wither.Poison.D... |
b8da9081-022d-41a0-8d47-898474dd8f0e | 6 | public void writeUntil(final int end, final CodedOutputStream output)
throws IOException {
while (next != null && next.getKey().getNumber() < end) {
ExtensionDescriptor extension = next.getKey();
if (messageSetWireFormat && extension.getLiteJavaType() ==
... |
98d4ed73-1430-4f5e-a430-8a08b20b9b0e | 8 | private String getComerMover(int fila, int columna, int turno){
if((this.fila+2==fila||this.fila-2==fila)&&(this.columna-1==columna||this.columna+1==columna)){
return getCaballo(turno);
}else if((this.fila+1==fila||this.fila-1==fila)&&(this.columna-2==columna||this.columna+2==columna)){
... |
f4b317ca-d16e-47e0-bebb-399bd7734d2a | 2 | public void update() {
steps--;
float newX, newY;
float percentage = ((float) steps / (float) maxSteps);
width = width * percentage;
height = height * percentage;
newX = startX - ((int) width / 2);
newY = startY + (endY - startY) - ((endY - startY) * percentage)... |
3eee6038-aff9-43e3-9344-06abf17caed9 | 8 | protected LoginResult charcrRaceStart(final LoginSessionImpl loginObj, final Session session)
{
MOB mob=loginObj.mob;
session.setMob(loginObj.mob);
if(CMSecurity.isDisabled(CMSecurity.DisFlag.RACES))
{
Race newRace=CMClass.getRace("PlayerRace");
if(newRace==null)
newRace=CMClass.getRace("StdRace");
... |
aeca385b-e60b-4114-87f4-39f413843dde | 3 | public void handleCreateFile(FolderWatcherQueue s) {
Connection con = DBManager.establishConnection();
DBManager db = new DBManager();
db.serverInsert(con, FileFunctions.getRelativePath(s.getFullPath()),
db.getTimeStamp(s.getDate()));
if (FileFunctions.isDirectory(s.getFullPath())) {
File[] files = new F... |
f2cf87dc-a755-468e-b1b0-4073ce84f0e0 | 8 | private void removeDuplicateRoutePaths() {
// get rid of any duplicate routes, because it seems to happen?
ListIterator li;
if (_paths != null) {
li = _paths.listIterator();
if (li.hasNext()) {
RoutePath keep = (RoutePath) li.next();
while (li.hasNext()) {
RoutePath check = (RoutePath) li.next(... |
2bcf6261-c1a6-4169-a87c-340015a1d7c2 | 2 | public void testPropertySetDayOfMonth() {
MonthDay test = new MonthDay(4, 6);
MonthDay copy = test.dayOfMonth().setCopy(12);
check(test, 4, 6);
check(copy, 4, 12);
try {
test.dayOfMonth().setCopy(33);
fail();
} catch (IllegalArgumentExcept... |
4ac52c08-03ef-4500-8882-74bd2431efa7 | 5 | public static X509Info x509FromKeyStore(KeyStore keyStore, String password) {
try {
char[] pwchars = password.toCharArray();
X509Certificate cert = null;
Key key = null;
Enumeration<String> aliases;
aliases = keyStore.aliases();
while (... |
593f9052-cf43-4d2e-b3bf-07263f39cbd7 | 5 | private void dataToAlbum(String key, String value) {
if (key.toString().equals("name"))
album.setName(value);
if (key.toString().equals("genre"))
album.setGenre(value);
if (key.toString().equals("year"))
album.setYear(value);
if (key.toString().equals("artist")) {
String[] artists = value.split(", "... |
701a5fd0-576d-4314-b009-e40838f637f9 | 3 | public boolean killHuman(Human human) {
if (null == human) {
return false;
}
Iterator<Integer> iter = this.playground.keySet().iterator();
while (iter.hasNext()) {
Integer potentialVictimKey = iter.next();
Human potentialVictim = this.playground.get(potentialVictimKey);
if (potentialVictim == ... |
255b98c5-cb5c-4f9f-9df9-331fb6486f16 | 3 | private int getMaxInd(int pos1, int pos2) {
if (Math.min(pos1, pos2) >= size)
throw new ArrayIndexOutOfBoundsException(String.format(
"Invalid data: %d, %d", pos1, pos2));
if (Math.max(pos1, pos2) >= size) return Math.min(pos1, pos2);
return he... |
50f7a3aa-5636-49f7-8a1f-5c45e3f83290 | 4 | public void SetOver(boolean isOver) {
boolean test = false;
if (test || m_test) {
System.out.println("GameBoardGraphics :: SetOver() BEGIN");
}
m_isOver = isOver;
if (test || m_test) {
System.out.println("GameBoardGraphics :: SetOver() END");
}
} |
173eed8a-f6f3-42dc-bff7-d2876736863a | 6 | public boolean withinRange(RangeType rangeType, int value) {
switch (rangeType) {
case HUMIDITY:
return (humidity[0] <= value && value <= humidity[1]);
case TEMPERATURE:
return (temperature[0] <= value && value <= temperature[1]);
case ALTITUDE:
return... |
589f1f43-6f01-4066-9866-7bcb1d5068d8 | 0 | public void setMsgType(int msgType) {
MsgType = msgType;
} |
3fb75689-2ab2-4eea-87bd-0a608f03db4f | 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... |
483028e9-5b0d-430b-aaf1-0d4d0eb61c05 | 0 | public void bossDeath() {
bossliving = false;
endGame(EndReason.END_REASON_SUCCESS);
} |
2f9d8614-eea8-40ac-a766-0733932b1825 | 1 | public void visit_fstore(final Instruction inst) {
stackHeight -= 1;
if (stackHeight < minStackHeight) {
minStackHeight = stackHeight;
}
} |
bc3191df-4e58-426f-a8e4-a184be8af1a2 | 4 | public AlignmentAction(String nm, int alignment) {
super(nm);
m_alignment = alignment;
String icon;
switch (alignment) {
case StyleConstants.ALIGN_RIGHT:
icon = "align_right16.gif";
break;
case StyleConstants.ALIGN_LEFT:
icon = "align_left16.gif";
brea... |
50cb0125-d852-4e77-b81d-6905417f4a1e | 9 | public void createRotation(int centerX, int centerY, float angle, Roi roi)
/*
Put a rotation (over angle) flow field in flow, and
include the part within the current ROI.
Only the v.v within the roi will be valid.
*/
{
Rectangle r=null;
if (roi instanceof Roi)
r = roi.getBoundingRect();... |
07a9db6b-cf58-4843-9242-95693a95a613 | 7 | public static final Object getLoadNewClassInstance(final CMObjectType classType, final String path, final boolean quiet)
{
if((path==null)||(path.length()==0))
return null;
try
{
final String pathLess=makeDotClassPath(path);
if(classes.containsKey(pathLess))
return (classes.get(pathLess)).newInstanc... |
9173af0c-6df6-4e43-96ba-01017ffd225c | 9 | @Override
public void valueUpdated(Setting s, Value v) {
String setting = s.getName();
if (setting.equals(Text)) {
if (!loopFlag_) {
loopFlag_ = true;
if (textArea_ != null && v != null)
textArea_.setText(v.getString());
} else
loopFlag_ = false;
} else if (setting.equals(Trigger)) {
tr... |
c00665b8-3b16-462d-b6a1-d672349e7f9c | 1 | public void unFlagAll(){
unFlag();
if(children!=null){
children.get(0).unFlagAll();
children.get(1).unFlagAll();
}
} |
88f78208-1121-4e92-a06d-e2ec175c174b | 4 | private static void runText(String args[])
{
GameEngine engine = new GameEngine("mosquito.xml");
// TextInterface ti = new TextInterface();
// ti.register(engine);
// ti.playGame();
if(args.length < 7)
{
printUsage();
System.exit(-1);
}
Text t = new Text(engine);
engine.getConfig().setSelected... |
1783a9de-2ebf-48ce-9b7d-a38e22bc04e8 | 0 | @Override
public PermissionType getType() {
return PermissionType.OP;
} |
3e1d7bac-3615-4564-af1c-00eb22df6cea | 7 | String ChangeExcitationFilter(int Current_Item){
int Move_Item=Current_Item;//-Global.Exci_Previous_Item;
//if (Move_Item<0) {Move_Item=Move_Item+6;}
String CI=Integer.toString(Current_Item);
Global.Exci_Previous_Item=Current_Item;
try{
if (Move_It... |
618a98ef-545a-467b-a6c9-cb22f321d6e7 | 7 | @Override
public void executeMsg(final Environmental myHost, final CMMsg msg)
{
super.executeMsg(myHost,msg);
if((affected!=null)
&&(affected instanceof MOB)
&&(msg.amISource((MOB)affected)||msg.amISource(((MOB)affected).amFollowing())||(msg.source()==invoker()))
&&(msg.sourceMinor()==CMMsg.TYP_QUIT))
{
... |
01a565a1-7e09-4f96-b76d-b9c4eace7207 | 5 | public final Collection getCollection(Identifier ident) {
if (ident instanceof PackageIdentifier)
return packs;
else if (ident instanceof ClassIdentifier)
return clazzes;
else if (ident instanceof MethodIdentifier)
return methods;
else if (ident instanceof FieldIdentifier)
return fields;
else if (... |
5d0002e4-24d4-4565-92d2-ce5585f60948 | 8 | private boolean readProperties(Properties props) {
//Use Proxy
if("true".equals(props.getProperty(USE_PROXY))) {
useProxy_flag = true;
}
else {
useProxy_flag = false;
}
//HTTP Settings
httpProxyHost = props.getProperty(HTTP_PROXY_HOST);
... |
16114a32-7a4c-49e4-af73-e635c99a9066 | 6 | final Class367 method3832(int i, byte i_58_) {
anInt9900++;
if (i_58_ >= -57)
method3832(-96, (byte) 20);
int i_59_ = i;
while_237_:
do {
do {
if ((i_59_ ^ 0xffffffff) != -4) {
if ((i_59_ ^ 0xffffffff) != -5) {
if ((i_59_ ^ 0xffffffff) == -9)
break;
break while_237_;
}
} e... |
5d591db2-a5da-4463-9574-b59c5be5b11e | 1 | public static Generation initFirstGeneration(List<Element> items, int sop) {
Generation gen = new Generation();
for (int i = 0; i < sop; i++) {
Chromosome chromosome = new Chromosome();
chromosome.insertRandom(items);
gen.addChromosome(chromosome);
}
return gen;
} |
cbb5dc3c-089a-481e-9108-0e1af618a080 | 9 | public List<String> fetchCategories(String userId, String type){
List<String> unsubCat = new ArrayList<String>();
ResultSet rs=null;
Connection con=null;
PreparedStatement ps=null;
List<String> result=new ArrayList<String>();
try{
String sql;
if(type.equals("NotSubscribed")){
sql="SELECT DISTI... |
783d5134-4ad3-44f3-b748-fe487f3fbb27 | 5 | private void lastNameTextFieldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_lastNameTextFieldKeyTyped
lastNameLabel.setForeground(Color.black);
int strLength = lastNameTextField.getText().length();
char c = evt.getKeyChar();
if (strLength == 30 || !(Character.isAlphabetic(c) |... |
4dc6f3aa-ca70-4197-9ef1-d1565d8e831b | 0 | public void setCharSet(String charSet) {
this.charSet = charSet;
} |
cbac7b06-5b90-473c-8dd7-430e65fa2239 | 8 | private void buildTabs(){
// Get the active games
byte[] activeGameIds = GameFactory.getActiveGameIds();
// Only run when the active games has changed
if(Arrays.equals(activeGameIds, activeGames))
return;
// Store the active games
activeGames = activ... |
f535194d-8461-46e4-b97f-6c0a4b0db5fd | 5 | @Override
protected void waitTillProcessingDone() {
if (inferenceWorker == null) {
return;
}
if (inferenceWorker.isDone()) {
return;
}
while (true) {
synchronized (inferenceWorker) {
try {
inferenceWorker.wait(10);
} catch (InterruptedException ie) {
... |
10cce5a1-5254-492c-91c9-358377ad5a1d | 9 | public int longestCommonSubsequence(String A, String B) {
// write your code here
if(A == null || A.length() == 0 || B == null || B.length() == 0) {
return 0;
}
int lenA = A.length();
int lenB = B.length();
int[][] commonS = new int[lenA+1][lenB+1];
for(i... |
86535254-3a69-4796-a372-d6a71f122037 | 4 | void setInputs(GtexExperiment gtexExperiment) {
Gtex gtex = gtexExperiment.getGtex();
for (String gid : gtex.getGeneIds()) {
List<Entity> entities = entitiesByGeneId.get(gid);
if (entities != null) {
double value = gtexExperiment.getValue(gid);
if (!Double.isNaN(value)) {
for (Entity e : entiti... |
30960c87-e96d-4781-8c33-1b98c0add2de | 1 | private Set<String> getUserName() {
HashSet<String> returnset = new HashSet<String>();
Iterator<Session> iterator = chatroomUsers.iterator();
while (iterator.hasNext()) {
returnset.add(iterator.next().getUserProperties().get("username").toString());
}
System.out.print... |
c97376ce-adcf-4f6a-b813-e2b634a823b0 | 6 | @Override
public List<JDK> loadDefaultJDKOnSystem() throws LoadDefaultJDKException, DefautJDKInstalledNotFoundException {
String fincCommand = "find /usr/local/java/ -name javac";
ArrayList<JDK> list = new ArrayList<JDK>();
try {
List<String> commands = new ArrayList<String>();
commands.add("bash");
... |
ab8bbf0c-29a2-4b18-826a-938ab8ee0d05 | 8 | public void paste() throws ShareException {
if (filelist == null)
throw new ShareException(ShareException.Error.FILELIST_NOT_YET_SET);
if (pwd == null)
pwd = filelist;
if (cut_buffer == null)
throw new ShareException(ShareException.Error.NOTHING_TO_PASTE);
if (pwd.equals(cut_buffer))
throw new ... |
f3dc3d90-1c0b-4799-a9d5-bcfbf5e7f4f7 | 2 | public void print1(String name) {
synchronized (this) {
for (int i = 0; i < 20; i++) {
System.out.printf("%s %s\n", name, i);
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
} |
1a06b84e-6bf8-4348-b3c3-a9b206624619 | 9 | @Override
public ArrayList<Move> generateMovesForThisPiece(Chessboard chessboard) {
final String positionPiece = chessboard.getPositionPiece(this);
final int getX = Helper.getXfromString(positionPiece);
final int getY = Helper.getYfromString(positionPiece);
int toX = getX, toY = getY;
// Avance d'une case
... |
27c8aa22-87ac-4994-a582-1812d97088eb | 1 | public static void main(String[] args) {
try {
UserDAO wtf = new UserDAO();
wtf.removeAll();
RoleDAO wth = new RoleDAO();
wth.removeAll();
User u = createUsers();
// showAllUser();
Role r = createRoles();
// showAll... |
bed62d6b-58ca-4b5b-8d53-11e7debb4cf0 | 8 | public static RubyHash buildEnvironment(Ruby runtime, HttpServletRequest req) throws IOException {
RubyHash env = new RubyHash(runtime);
log.debug("Creating Rack environment");
env.put(runtime.newString(REQUEST_METHOD), runtime.newString(req.getMethod()));
// I can't se... |
2216c015-63a0-4e6b-81b9-68af35d5c673 | 2 | public WebFrame(String myHtmlFile) {
setTitle("Help Browser");
JPanel mainpanel = new JPanel(new BorderLayout());
Hyperactive hyper = new Hyperactive();
myBrowserDisplay.setEditable(false);
myBrowserDisplay.addHyperlinkListener(hyper);
JScrollPane htmlscrollpane = new JScrollPane(myBrowserDisplay);
mainp... |
45fa809b-3f1a-4ce9-8d3b-76b44e19bd92 | 6 | public void fill(int xPos, int yPos, int w, int h, int col, int amount){
for(int y = 0; y < h; y++){
int yPix = y+yPos;
if(yPix < 0 || yPix >= height)continue;
for(int x = 0; x < w; x++){
int xPix = x+xPos;
if(xPix < 0 || xPix >= width)continue;
int merged = merge(col, pixels[xPix + yPix * wi... |
a2fc4879-5c3f-491d-b0e9-0b4a8bc259b4 | 7 | @Override
public List<Message> make(Message oMsg, Parse parse) {
ArrayList<Message> sMsgs = new ArrayList<Message>();
// 送信許可
AuthorizeSender as = new AuthorizeSenderImpl(parse.getDomBundle(), parser, oMsg.getSender());
if (!as.isAuthorized()) {
MakeWarning mw = new MakeWarningImpl();
sMsgs.add(... |
18cab203-ea36-42b9-b691-d4d3ad52394a | 9 | public float getFactor(){
switch(this){
case grams:
return 1;
case kilograms:
return 1000;
case ounces:
return .03527396211f;
case pounds:
return 453.59233f;
case fluidOunces:
return 1;
case pints:
return 16;
case quarts:
return 32;
case gallons:
return 128;
case liters:
r... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.