method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
442b8e60-cab3-4db2-aa17-80d1486c8275 | 0 | public Listener getListener(String name) {
return this.listeners.get(name);
} |
8c6abb55-85d6-4798-bd07-b52d1ca3f110 | 8 | private static void computeDerivatives(Image image, Mask gaussian, double[][] lx2, double[][] ly2, double[][] lxy) {
int w = image.getWidth(), h = image.getHeight();
Image gx = MaskUtils.applyMask(image,
MaskFactory.buildSobelMask(Direction.HORIZONTAL));
Image gy = MaskUtils.applyMask(image,
MaskFactory.b... |
83a18a6c-4c3f-4e38-a0cd-9668523e84a6 | 6 | @Override
public void ParseIn(Connection Main, Server Environment)
{
List<Integer> SendTo = new ArrayList<Integer>();
List<Integer> Failed = new ArrayList<Integer>();
int count = Main.DecodeInt();
for (int i = 0; i < count; i++)
{
SendTo.add(Main.DecodeInt()... |
639f43d3-98df-42bc-9056-f1c06229bd8e | 6 | public void actionPerformed(ActionEvent e) {
String[] args = getArgs(e);
String channel = args[0];
String sender = args[1];
String source = args[2];
String message = args[3];
if (isCommand("accountage", message))
{
if (a... |
c9af2450-b583-49f1-9b23-dc11731e874e | 0 | public Rectangle2D getBounds() {
return this;
} |
9ea6d67b-113b-4d8a-ad6e-add455dbaa27 | 2 | public void ClearGrid()
{
for (int r=0; r < ROWS; r++) {
for (int c=0; c < COLS; c++) {
colorGrid[r][c] = new Colors();
}
}
} |
33263bc2-9bcd-4783-9a43-1a788c43f7bf | 7 | public List<Log_record> GetLog(access_level acc_level, Date begin_dat, Date end_dat)
{
String all_file = "";
InputStream file_in = null;
try {
file_in = c.get("/var/log/sunprint/business/business.inf");
byte[] buf = new byte[1024];
int reded_buf_siz... |
35fa510f-7b9a-4962-a3e1-19c246d0b684 | 9 | public static boolean hasIntersection(final Collection a, final Collection b) {
if (a.size() < 50 && b.size() < 50) {
Iterator it = a.iterator();
while(it.hasNext())
if (b.contains(it.next()))
return true;
}
else if (a.size() < b.size()... |
b2650897-f669-40d0-992b-5ba581928401 | 0 | public void addText(String text) {
this.text.append(text);
} |
ee24309c-4270-40f6-be81-4596f4edf44d | 5 | public CustomPanel(int row, int col, Player p1, Player p2, TicTacToeBoard state) {
location = new Position();
location.row = row;
location.col = col;
chosen = false;
player1 = p1;
player2 = p2;
turnState = state;
addMouseListener(
new MouseAdapter() {
/**
* This is the mouseClicked ... |
a6614ceb-51b0-4cb3-96bb-7e12ba06d066 | 0 | protected ConnectionProcessor getConnectionProcessor() {
return connectionProcessor;
} |
7d44bb9a-e465-42fc-8741-d9ff18900b91 | 4 | @Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Troupes other = (Troupes) obj;
if (!Objects.equals(this.nom, other.nom)) {
return false;
... |
bd589614-d3ef-4c0c-8c97-ef1eedf8f971 | 7 | protected Item getPoison(MOB mob)
{
if(mob==null)
return null;
if(mob.location()==null)
return null;
for(int i=0;i<mob.location().numItems();i++)
{
final Item I=mob.location().getItem(i);
if((I!=null)
&&(I instanceof Drink)
&&(((Drink)I).containsDrink())
&&(((Drink)I).liquidType()==RawMate... |
8ae5e801-579d-4c90-82e0-c0f1cd7f7bb9 | 9 | public static void parseMeshRenderer(String line)
{
int intIndex;
intIndex = line.indexOf("path");
if (intIndex == -1)
System.out.println("MeshRenderers require a path!");
else
{
int t = intIndex + 4;
char c = "a".charAt(0);
St... |
c55c9751-ce80-4893-b61d-f4ea4075abb6 | 2 | public static String IPToString(int ip){
StringBuilder sb = new StringBuilder();
for(int i=3; i>=0; i--){
sb.append((ip & (0xFF << (i*8))) >>> (i*8));
if(i > 0)
sb.append('.');
}
return sb.toString();
} |
877e197d-d3f6-492c-88ea-1ee68e9aaae8 | 8 | private static boolean isDirectObservation(Term term) {
if (term.var != null) {
return true;
} else if (term.operation.isBehavorial()) {
// check whether it has hidden varable
boolean found = false;
for (int i=0; i<term.subterms.length; i++) {
if (term.subterms[i].var != n... |
e0e5523f-d916-4f81-a49b-d04f3ea3b0ef | 8 | public double compute( RowD1Matrix64F mat ) {
if( width != mat.numCols || width != mat.numRows ) {
throw new RuntimeException("Unexpected matrix dimension");
}
// make sure everything is in the proper state before it starts
initStructures();
// System.arraycopy(mat.d... |
317998bd-2f6e-48ed-bb75-0138177cf4c6 | 2 | private List<LightGrenade> getLightGrenadesOfGrid(Grid grid) {
final List<LightGrenade> lightGrenades = new ArrayList<LightGrenade>();
for (Element e : grid.getElementsOnGrid())
if (e instanceof LightGrenade)
lightGrenades.add((LightGrenade) e);
return lightGrenades;
} |
45a8963f-ad75-41fc-b1a7-44f05ad01d3a | 4 | public HashSet<BigInteger> getFactors(BigInteger n) {
HashSet<BigInteger> factors = new HashSet<BigInteger>();
while (true) {
for (BigInteger i : primes) {
if (n.remainder(i).equals(ZERO)) {
n = n.divide(i);
factors.add(i);
... |
fc092fba-9070-46fd-8d7e-73aa7cdc1773 | 0 | public String location() {
return "Acceptable only at select locations.";
} |
44c090b0-2bdb-4394-8da1-a7d721fe25d7 | 7 | final int method1714(int i, int i_2_) {
anInt5926++;
if (((Class239) this).aClass348_Sub51_3136.method3425(-114))
return 3;
if (((Class239) this).aClass348_Sub51_3136.method3422(674)
== Class10.aClass230_186) {
if ((i_2_ ^ 0xffffffff) == -1) {
if (((Class348_Sub51) ((Class239) this).aClass348_Sub51_... |
df9e5905-3394-4a03-85f2-bd8c8a6f49ec | 0 | public int getMax()
{
return seat.length;
} |
74cd81cf-ccff-45d7-a9d6-295f796e9fc2 | 1 | public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
try {
Spel spel = new Spel();
KiesOnderwerp ko = new KiesOnderwerp(spel);
spel.openPanel(ko);
ko.updateUI();
} catch (Exception e) {
e.printStackTrace();
}
}
}... |
5c6ab0c8-0ee3-4d25-ba21-5d1643a6f0dd | 6 | protected void checkEdge() {
if ((xmin < containerXMin || getXMax() > containerXMax) && run != 0) {
run *= -1;
}
if ((ymin < 0 || getYMax() > containerYMax) && rise != 0) {
rise *= -1;
}
} |
00a4a35d-4efd-410a-bcc6-448e91f753cf | 5 | private void readNext() //exclusively for token
{
current = next;
if(current != null)
buffer = new StringTokenizer(current);
StringTokenizer temp = null;
do
{
try
{
next = myInFile.readLine();
}
... |
db6e22ae-153e-4e48-ba55-4f0a56abb486 | 5 | @Override
public Response info(InfoRequest request) throws IOException {
Mac hmac=null;
try {
hmac = Mac.getInstance("HmacSHA256");
} catch (NoSuchAlgorithmException e) {
System.err.println("NoSuchAlgorithmException (HmacSHA256 not valid): " + e.getMessage());
return new HmacErrorResponse("Integrity che... |
9d991f94-a3e1-4d37-b5fa-4c1146a6c00a | 6 | public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
if(commandLabel.equalsIgnoreCase("playerlogger")){
if (args.length == 0) {
sender.sendMessage(ChatColor.RED+"Usage: /playerlogger reload");
return false;
} else if (args.length == 1){
//Reload
if (... |
3f1100ce-4c81-42cc-9577-e021c13e4676 | 4 | public void mouseClicked(int var1, int var2, int var3) {
boolean var4 = this.isEnabled && var1 >= this.xPos && var1 < this.xPos + this.width && var2 >= this.yPos && var2 < this.yPos + this.height;
this.setFocused(var4);
} |
0dc799c1-117a-4991-9a20-6b6e65730c81 | 8 | public double proximity(CharSequence cSeq1, CharSequence cSeq2) {
// really only need to create one of these; other can just it and add
ObjectToCounterMap<String> tf1 = termFrequencyVector(cSeq1);
ObjectToCounterMap<String> tf2 = termFrequencyVector(cSeq2);
double len1 = 0.0;
dou... |
402d6262-49c4-4cd7-930e-336830ecb5d0 | 5 | public void initializeForView(AutomatonPane view){
myView = view;
setLocationManually(myAutoPoint);
this.setDisabledTextColor(Color.BLACK);
this.setBackground(new Color(255, 255, 150));
this.addMouseMotionListener(new MouseMotionListener(){
public void mouseDragged(MouseEvent e) {
if (e.isPopupTr... |
fc771297-c6da-45e6-82c6-e0fd313dc353 | 6 | @Override
/**
* A button has been clicked.
*/
public void actionPerformed( ActionEvent e ) {
// get the action string
String action = e.getActionCommand();
// the user has chosen to add a file
if( actio... |
33e61b14-395e-49d6-b118-1ddc66dd1272 | 2 | public void clearShoppingCar(Map<?,?>shoppingCar){
shoppingCar.clear();;
} |
acdd892d-8f31-4cb0-836b-a4d9a3aa976f | 7 | public void unregisterListener(Listener listener){
listenerLock.lock();
try{
for(ListenerPriority priority : listeners.keySet()){
Set<RegisteredEventListener> toRemove = new HashSet<RegisteredEventListener>();
for(RegisteredEventListener regListener : listeners.get(priority)){
if(regListener.getLi... |
cb7d6de7-8d92-4d4b-aad0-26bd923b387e | 9 | private String multiLineCommentFilter(String line) {
if (line == null || line.equals("")) {
return "";
}
StringBuffer buf = new StringBuffer();
int index;
//First, check for the end of a multi-line comment.
if (inMultiLineComment && (index = line.indexOf("*/")... |
5141fdb6-339f-4cd4-ae6f-727da5a524d8 | 3 | public void connect() throws Exception {
if (!isDriverInitialized) {
try {
initDriver();
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
}
this.readFile();
try {
System.out.println(getDbURL());
... |
421048e9-e1ef-4924-b3b9-8a470be407ae | 2 | private void siftDown(int pos) {
if (2 * pos >= size) return;
int maxI = getMaxInd(2 * pos, 2 * pos + 1);
if (heap.get(maxI).compareTo(heap.get(pos)) > 0) {
swap(pos, maxI);
siftDown(maxI);
}
} |
aef4784b-8880-4ddf-bc5a-42aa605136cf | 9 | public List<char[]> getResult(Combination guess, int[] score) {
if(remainingCombos.size() == 0) {
ComboMaker builder = new ComboMaker(charSet, length);
for(char[] combo: builder) {
Combination test;
int[] testScore = new int[2];
try {
test = new Combination(combo, charSet);
testScore = tes... |
b8287a94-43e9-42eb-9411-46981f595001 | 0 | public QuestionCostLabel()
{
PriceManager.getInstance().addListener(this);
setText(INIT_TEXT + PriceManager.getInstance().getPrice());
setFont(DefaultUIProvider.getQuestionPriceFont());
// priceLabel.setBorder(DefaultUIProvider.getDefaultEmptyBorder());
} |
51dcf15d-c8c0-42ad-844d-0a6d2bdfdb05 | 9 | public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while(true){
int n = sc.nextInt();
int m = sc.nextInt();
if((n|m)==0)break;
int[] h = new int[n];
for(int i=0;i<n;i++)h[i]=sc.nextInt();
int[] w = new int[m];
for(int i=0;i<m;i++)w[i]=sc.nextInt();
int[] wh = new i... |
6c66df1b-b1f6-4fe3-8654-a55f83faabf6 | 0 | public ModeleApplication() {
// ArrayList<Metadonnee> listeMetaDonnees = new
// ArrayList<Metadonnee>();
metadonnee = new Metadonnee(new File("docs//test1.txt"));
liste = new Liste();
} |
05e1bda5-5fd0-4a31-a9fe-ca65915305d7 | 9 | @Override
public void run(){
stop = false;
play = true;
line.start();
while (!end){
if (play){
try {
while (((bytesRead = audioInputStream.read(bytes, 0, bytes.length)) != -1) && !stop && play) {
thi... |
ab456798-e013-4202-bb9c-2bfcd019e0d5 | 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... |
769160bf-7a5d-4196-8650-6e9e049d8820 | 8 | AbstractRegex parseClosure(StringStream stream) {
switch (stream.peek()) {
case '^':
stream.poll();
return new HatRegex();
case '$':
stream.poll();
return new DollarRegex();
}
AbstractRegex term = parseTerm(s... |
5ff5d7f2-a9d9-46e7-ba89-1ac08e4f73f2 | 1 | public static void main(String[] args) {
Sort_List s = new Sort_List();
// int[] list= {5,4,3,2,1};
// s.Merge(list);
ListNode head = null;
ListNode temp = new ListNode(0);
head = temp;
for (int i = 5; i > 0; i--) {
ListNode node = new ListNode(i);
... |
d86b2b6e-cb3b-4d84-a5f1-a7714c43ffb0 | 7 | private long rec(int i, int current) {
if (DP[i][current] != -1)
return DP[i][current];
if (i >= M.length()) {
return 1;
}
Integer x = M.charAt(i) - '0';
int next = 10 * current + x;
long res = 0;
if (next > 0 && next <= N) {
... |
4ac4b57b-ab9e-43d6-8763-b9f7ccc818b7 | 1 | @Test
public void ensureCoreBudgetItemsInBudgetContainsDifferentFormObjectTestTwo() {
List<CoreBudgetItem> coreBudgetItemList = new ArrayList<CoreBudgetItem>();
coreBudgetItemList.add(new CoreBudgetItem("Test Description", new BigDecimal("200")));
when(budgetFormData.getCoreBudgetItemsList... |
62d62f99-0b47-4fb2-a97c-58b060282ebe | 2 | public void onRemove(Player senderPlayer, String[] args) {
Block targetBlock = senderPlayer.getTargetBlock(null, 100);
if(targetBlock == null) {
senderPlayer.sendMessage(ChatColor.DARK_RED + "You must be looking at a block while using this command!");
return;
}
if(FancyRoulette.instance.tableManager.remo... |
e61d3461-6749-4d2e-8b76-1f620ec72350 | 5 | public void incColonists(Object args[]) {
final Background b = (Background) args[0] ;
final int
inc = (Integer) args[1],
index = Visit.indexOf(b, COLONIST_BACKGROUNDS) ;
int amount = colonists[index], total = 0 ;
for (int i : colonists) total += i ;
if (inc < 0 && amount <= 0) return ;
... |
8741ee88-8308-4104-a191-da7b663ea6ec | 8 | public static List<List<String>> GoGraph(Stack<WordNode> path, List<List<String>> result, String end, List<WordNode> nextNode, Stack<Integer> Soncount) {
int son = Soncount.firstElement();
while(!nextNode.isEmpty()) {
int nextNodeson = 0;
boolean noway = true;
WordNode currentNode = ne... |
d92dc4b8-63bf-4c93-81a2-6664eb48ef68 | 4 | protected void changeSelection(Collection<Object> added,
Collection<Object> removed)
{
if ((added != null && !added.isEmpty())
|| (removed != null && !removed.isEmpty()))
{
mxSelectionChange change = new mxSelectionChange(this, added,
removed);
change.execute();
mxUndoableEdit edit = new mxUnd... |
696e7839-ffd1-4e2b-a010-80c83a001651 | 6 | public static void solver(int input) {
int leftVal = 0;
int rightVal = 0;
boolean leftFlag = false;
boolean rightFlag = false;
int valIn = input;
while(leftFlag == false || rightFlag == false) {
//left
if(leftFlag == false) {
if(checkLeft(valIn)) {
leftVal = valIn;
... |
d91b809e-7aaf-401e-96c1-67388364986a | 4 | public void updateSubTypes() {
int offset = 0;
if (!isStatic()) {
subExpressions[offset++].setType(Type.tSubType(getClassType()));
}
Type[] paramTypes = methodType.getParameterTypes();
for (int i = 0; i < paramTypes.length; i++) {
Type pType = (hints != null && hints[i + 1] != null) ? hints[i + 1]
... |
73a6ad14-47b8-4ccf-b918-4e6c71d3735a | 4 | public static double[][] subtract(double A[][], double B[][]){
if(A.length != B.length || A[0].length != B[0].length)
return null;
double T[][] = new double[A.length][A[0].length];
for(int i = 0; i<T.length; i++){
for(int j = 0; j<T[0].length; j++){
T[i][j] = A[i][j]-B[i][j];
}
}
return T;
} //e... |
2e7af19d-846e-45e0-9b1c-41e1a29d4b55 | 3 | private String buildPath() {
StringBuffer builder = new StringBuffer();
if (this.protocol != null) {
builder.append(this.protocol);
}
if (this.host != null) {
builder.append("://");
builder.append(this.host);
}
if (this.port > 0) {
builder.append(":");
builder.append(this.port);
}
return ... |
2bbd088d-2f70-4ab7-80c5-7929dd87e356 | 0 | public Items getLast() {
return last;
} |
2d4c3228-144f-47e2-9ef0-16bef2cd5b30 | 9 | public String eventDescription(Event e){
//by Budhitama Subagdja
String desc = "";
desc = desc + "At (" + e.x + "," + e.z +") ";
desc = desc + "Health: " + e.curHealth + " ";
if(e.emeDistance<1){
desc = desc + "Enemy Detected! Distance: " + e.emeDistance;
}
desc = desc + "\n";
if... |
b5a1d784-0b22-4a0d-a5e4-fe788a900296 | 8 | public static void main(String args[]) {
Scanner scan = new Scanner(System.in);
System.out.println("Digite a palavra:");
String[] word = scan.nextLine().split("");
int errors = 0;
boolean right;
String[] player = new String[word.length];
player[... |
870369d3-2a48-42d9-8110-cfceaa1181b3 | 8 | private boolean checkAutoInsert() {
if (autoInsert && lastKeyPressedEvent != null) {
// down in the last row triggers auto-insert
if (prevRowIndex == (this.getRowCount()-1) && (lastKeyPressedEvent.getKeyCode() == KeyEvent.VK_DOWN)) {
this.invokeRowInsert();
r... |
4aec176e-f8b9-44e4-a386-9273a9929739 | 2 | @Override
public Object execute(HttpServletRequest request, HttpServletResponse response) throws Exception {
Contexto oContexto = (Contexto) request.getAttribute("contexto");
oContexto.setVista("jsp/mensaje.jsp");
ProfesorBean oProfesorBean = new ProfesorBean();
ProfesorDao oProfesor... |
f7bd07f9-894f-4e91-ad8f-ec9ba28d48ef | 2 | public void setName(String name) {
mName = name == null || name.length() == 0 ? " " : name; //$NON-NLS-1$
} |
f81ad19e-7ef5-45a7-83a0-29766e03871e | 5 | public void run()
{
if (!inputFile.exists())
{
return;
}
try
{
final FileReader reader = new FileReader(inputFile);
parser = new TencTokenMaker(reader);
parser.parse();
syntaxTreeBuilder = new A... |
26276813-47da-49b6-a39d-aa08f264bb46 | 7 | public void move(int xa, int ya) {
if (xa != 0 && ya != 0) {
move(xa, 0);
move(0, ya);
return;
}
//determine direction
if (xa > 0) {
dir = 1;
} else if (xa < 0) {
dir = 3;
} else if (ya > 0) {
dir = ... |
cf1cd1be-4177-49ba-95cb-ccc84c7d7275 | 9 | int insertKeyRehash(char val, int index, int hash, byte state) {
// compute the double hash
final int length = _set.length;
int probe = 1 + (hash % (length - 2));
final int loopIndex = index;
int firstRemoved = -1;
/**
* Look until FREE slot or we start to loop
... |
052ac6df-85fc-4c81-b523-6bf65387322c | 4 | private static int produceValue(ArrayList<Integer> values)
{
// Calculates the average value
int average = getAverageValue(values);
//System.out.println("Average: " + average);
// Finds and removes additional 0:s
// And recalculates the average value (if needed)
if (removeZeros(values, average))
aver... |
2b783b1f-f94a-48e2-9732-201c5656a2ce | 7 | private static void freq(File file) throws Exception { //t@C=eretweetƂɓxz쐬o
InputStreamReader isr = new InputStreamReader(new FileInputStream(file));
BufferedReader br = new BufferedReader(isr);
String head = br.readLine(); //擪s(URL)
int max = 0;
int min = Integer.MAX_VALUE;
HashMap<Integer, Integer> ... |
35e34f14-5323-4204-84a2-193965f20c77 | 1 | public static void sendMailSynchron(String subject, String content, String email, Boolean force) {
// 先判断是否开启发邮件功能,如果未开启,直接退出。
// String enable = "1";// PropertyManager.getInstance().getDbProperty(PropertyManager.DB_EMAIL_ENABLE);
// if (!force && !enable.equals("0")) {
// return;
// }
// 邮件服务器发送代码。
try {
... |
8a1b2055-0573-4e98-8082-066ea07a04eb | 6 | final void method2874(int i, boolean bool, Class348_Sub43 class348_sub43) {
try {
anInt8909++;
int i_94_
= (((Class348_Sub19_Sub1) (((Class348_Sub43) class348_sub43)
.aClass348_Sub19_Sub1_7077))
.aByteArray8984).length;
int i_95_;
if (bool
&& (((Class348_Sub19_Sub1) (((Class348_Sub... |
5602a4bb-d8e8-414c-b9f6-3aec9769e855 | 3 | public static void bubbleSort(int[] unsorted){
System.out.println("unsorted array before sorting : " + Arrays.toString(unsorted));
// Outer loop - need n-1 iteration to sort n elements
for(int i=0; i<unsorted.length -1; i++){
//Inner loop to perform comparision and ... |
2625713b-e28a-41fc-bfc5-0625280c9205 | 1 | @Override
public String toString () {
if ( this.socketFile == null ) {
return super.toString();
}
return super.toString() + " (socket: " + this.socketFile + ")";
} |
18d1cc95-3757-404b-bd20-3f3a6cd9212d | 0 | public void notifyAllRemoteListeners(Message message) {
distributedService.sendMessage(message);
} |
52d9dcb0-2081-4c80-9c63-d7ec276efba8 | 0 | public void delete(int id){
travelTripDao.delete(id);
} |
20b74565-8bef-4c7a-ae90-8b39feb66e7a | 1 | public DrawableImage(String imageURL)
{
this.imageURL=imageURL;
//Loading the image from URL into bufferedImage
ImageLoader=new BufferedImageLoader();
try {
bufferedImage=ImageLoader.loadImage(imageURL);
} catch (IOException e)
{
e.printStackTrace();
}
} |
69ed877a-ec9e-4a9a-9af3-07ae451774a2 | 3 | private void update(DocumentEvent e){
Integer key = null;
Document eventDocument = e.getDocument();
//find the key
for (Entry<Integer, Document> entry: textBoxDocuments.entrySet()){
if (entry.getValue() == eventDocument){
key = entry.getKey();
break;
}
}
//find textbox and value
JTextF... |
8d3ed302-b570-4fd9-bf4d-732cdd7ee19f | 8 | @Override
public void unInvoke()
{
final Physical P=affected;
super.unInvoke();
if((P instanceof MOB)&&(this.canBeUninvoked)&&(this.unInvoked))
{
if((!P.amDestroyed())&&(((MOB)P).amFollowing()==null))
{
final Room R=CMLib.map().roomLocation(P);
if(!CMLib.law().doesHavePriviledgesHere(invoker(), ... |
28e91c50-4b48-4e7c-9dd4-91a0751841b4 | 8 | static public void formatStandard(Writer w, Object obj) throws IOException{
if(obj == null)
w.write("null");
else if(obj instanceof String) {
w.write('"');
w.write((String) obj);
w.write('"');
}
else if(obj instanceof Character) {
w.write('\\');
char c = ((Character) obj).charValue();
switch(c) {
c... |
00ef3a84-28a6-4d45-b000-1135f3b2ab33 | 7 | public Set<ANode> getConnectedNodes(ANode root, int level) {
if (level < 0) {
throw new IllegalArgumentException();
}
if (level == 0) {
return Collections.singleton(root);
}
final Set<ANode> result = new HashSet<ANode>();
if (level == 1) {
for (ALink link : links) {
if (link.getNode1() == root)... |
7b52d84d-6e64-41b5-99e6-64499d83bede | 0 | public void eatDiamant(Diamant dia) {
stomache += dia.getPoints();
dia.setCatched();
} |
8e245ad8-dc22-4a88-bdaa-1769c0b46f38 | 5 | public static void setOccupance(int x, int y){
for(int a = 0; a < 80; a++){
for(int b = 0; b < 60; b++){
if(tile[a][b].preOccupied == true){
tile[a][b].occupied = true;
}else if((x/Tile.tileSize) == a && (y/Tile.tileSize) == b){
tile[a][b].occupied = true;
} else {
tile[a][b].occupied = ... |
cf0688da-785d-4ce5-b4c7-3963cb824ec7 | 4 | public void setPaused(boolean paused)
{
if (rp != null && rp.isGameOver())
{
gameIsPaused = false;
return;
}
gameIsPaused = paused;
if (rp != null && rp.getMenu() != null)
rp.getMenu().popMenu(gameIsPaused);
} |
931b1b80-7830-42c5-b7ba-1cb982a18c26 | 7 | @Override
public int doStartTag() throws JspTagException {
if (pages <= 0) {
return SKIP_BODY;
}
try {
JspWriter out = pageContext.getOut();
out.write("<table class='parameterRowB' border='1'><colgroup span='2' title='title' />");
if (head != ... |
f6dfa501-6988-493d-b155-ca555159b5ba | 6 | public static VcfInfoType parse(String str) {
str = str.toUpperCase();
if (str.equals("STRING")) return VcfInfoType.String;
if (str.equals("INTEGER")) return VcfInfoType.Integer;
if (str.equals("FLOAT")) return VcfInfoType.Float;
if (str.equals("FLAG")) return VcfInfoType.Flag;
if (str.equals("CHARACTER")) ... |
0524e68e-4fd4-49e7-820d-6a3b3b947147 | 1 | private void compute_pcm_samples7(Obuffer buffer)
{
final float[] vp = actual_v;
//int inc = v_inc;
final float[] tmpOut = _tmpOut;
int dvp =0;
// fat chance of having this loop unroll
for( int i=0; i<32; i++)
{
final float[] dp = d16[i];
float pcm_sample;
pcm_sample = (float)(((vp[7 + ... |
37ea3b70-af42-4395-9957-b542575c88fa | 9 | protected void _realSendMessage()
{
if(null == _m_scSocket)
return ;
if(!_m_scSocket.isConnected())
{
ALBasicSendingClientManager.getInstance().addSendSocket(this);
return ;
}
boolean needAddToSendList = false;
_lockBuf();... |
63e776a0-4186-46b6-a45a-3d607789ec95 | 9 | public Color colores(int i){
Color c;
switch (i) {
case 0:
c = new Color(153,153,153); //Gris
break;
case 1:
case 2:
case 3:
case 4:
c = new Color(195,255,104); //Verde
break;
case 5:
case 6:
... |
eefd565a-6f6a-47e9-bd97-2e52bac838b5 | 2 | public void testPropertySetMinute() {
LocalDateTime test = new LocalDateTime(2005, 6, 9, 10, 20, 30, 40);
LocalDateTime copy = test.minuteOfHour().setCopy(12);
check(test, 2005, 6, 9, 10, 20, 30, 40);
check(copy, 2005, 6, 9, 10, 12, 30, 40);
try {
test.minute... |
e6ba825e-c73c-4782-b432-4b714f5ea550 | 3 | public void readFromSave(DataTag tag){
reloadMap(tag.readString("map"));
GameTime = tag.readInt("gametime");
nightAlhpa = tag.readFloat("nightshade");
DataList list = tag.readList("content");
for(int i = 0; i < list.data().size(); i ++){
DataTag dt = list.readArray(i);
String uin = dt.readString("UIN... |
4147d8dc-f563-4cde-8430-3ff6f3d4f113 | 0 | public void driver() {
System.out.println("bmw drive");
} |
ee4e21b0-4c49-449f-9543-f192484c25dd | 4 | private String runAnOperation(int i, int j){
Double a=Double.parseDouble(calculatorSequence.get(i));
String s=calculatorSequence.get(i+1);
Double b=Double.parseDouble(calculatorSequence.get(j));
double z=0;
if (s.equals("+"))
z= Add(a,b);
if (s.equals("-"))
... |
2f6382d5-62d5-472f-b92a-79be0e404486 | 3 | public void deleteOrderInfo(int orderID) throws SQLException{
try{
databaseConnector=myConnector.getConnection();
stmnt=(Statement) databaseConnector.createStatement();
SQLQuery="DELETE FROM familydoctor.order WHERE orderID="+"'"+orderID+"'";
stmnt.executeUpdate(S... |
724c0bf9-2cad-44af-a027-43f98506ebb2 | 7 | public static void main(String[] args) throws IOException{
AdaptiveHuffmanTree aTree = new AdaptiveHuffmanTree();
int count = 0;
int read = 0;
String str = "";
while(StdIn.hasNextChar()){
char c = StdIn.readChar();
str = str+c;
if(aTree.characterInTree(c)){
char[] chs = (aTree.getCodeWordFor(c).t... |
c37110aa-dbaa-4371-8e38-bfd48815e816 | 9 | private JSONObject serveAsJson(IHTTPSession request, Session session) {
try
{
// get the handler class by URI
// for example, "/welcome/login" => "api.welcome.login"
String uri = request.getUri();
Class<?> cls = Class.forName("api" + uri.replaceAll("/", "."));
try
{
ApiHandler apiH... |
2f40e51e-4885-4857-81a8-36686c8242d0 | 9 | public void keyTyped(KeyEvent event) {
if (viewType == MULTI_TEXTFIELD_VIEW) {
char typed = event.getKeyChar();
if (! Character.isDigit(typed))
event.consume();
else if (event.getSource() != yearField) {
JTextField field = (JTextField) event.getSource();
String text = field.getText();
if (tex... |
4977f29a-23b6-4a6c-a3a9-5f0c32f316b2 | 2 | private static void method500(char arg0[]) {
for (int i = 0; i < 2; i++) {
for (int chars = Censor.aCharArrayArray621.length - 1; chars >= 0; chars--) {
Censor.method509(Censor.aByteArrayArrayArray622[chars], arg0, Censor.aCharArrayArray621[chars]);
}
}
} |
af6c76aa-7896-43c5-a3e9-a97170a34ac7 | 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... |
0acc7dba-1796-40d3-914b-f09937fcb9f9 | 2 | private int setupOrderPosition(int valuePosition, int startIndex, int endIndex) {
swap(valuePosition, endIndex);
int firstBiggerValuePosition = startIndex;
for (int i = startIndex; i <= endIndex; i++) {
if(array[i] <= array[endIndex]) {
swap(i, firstBiggerValuePositi... |
cebd24be-6e72-4429-b77d-9ff8bd6a9feb | 0 | public void loadDimension(Dimension dim){
this.current = dim;
attachChild(current);
} |
d290e183-b8f6-4e34-aa71-c29a5808fbb4 | 8 | public final TLParser.indexes_return indexes() throws RecognitionException {
TLParser.indexes_return retval = new TLParser.indexes_return();
retval.start = input.LT(1);
Object root_0 = null;
Token char_literal153=null;
Token char_literal155=null;
TLParser.expression_ret... |
8a32faf9-f41d-431b-92a8-f154bdefa2ad | 4 | private CtClass lookupClass0(String classname, boolean notCheckInner)
throws NotFoundException
{
CtClass cc = null;
do {
try {
cc = classPool.get(classname);
}
catch (NotFoundException e) {
int i = classname.lastIndexOf('.')... |
3ed923ce-2f0e-4356-9395-3668d90e7284 | 9 | public void BuscaHorarioAula(String anoletivo, Date datahorario) {
try {
hapmb = new HorarioAulaProfMatDao().RetornaHorarioProfMat(anoletivo, datahorario);
DefaultTableModel tabelahorario = (DefaultTableModel) jThorario.getModel();
tabelahorario.setNumRows(0);
for... |
1b71a42a-716f-441b-90a9-4c4c242aedb8 | 3 | @Override
public void onEndermanPickup(EndermanPickupEvent event) {
if (event.isCancelled()) {
return;
}
if (!this.config.yml.getBoolean("Enderman.Disable Pickup", true)) {
return;
}
if (!event.isCancelled()) {
event.setCancelled(true);
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.