method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
30a852f5-6847-45e2-95f4-9890cd690ba5 | 1 | final void assertAllTestCasesHaveRequiredElements(final Xpp3Dom results) {
new ForAllTestCases(results) {
@Override
void apply(Xpp3Dom each) {
for (final String requiredElement : REQUIRED_ELEMENTS) {
assertHasExactlyOneNamedNonEmptyElement(each, requir... |
28600527-da96-48cb-951d-64f806d90dee | 8 | public double getDirectionLength(String dir, double minPathLength) {
int xDiff = coordX - targetX;
int yDiff = coordY - targetY;
int tempDiff = 0;
double pathLength = 0;
if(dir.equals("up")) {
tempDiff = yDiff-1;
pathLength = Math.sqrt(xDiff*xDiff + tempD... |
8e597fcc-021a-4d22-9074-cd4c2fae6ed0 | 9 | public static double estimateGoalFanout(Proposition goal) {
{ Keyword testValue000 = goal.kind;
if (testValue000 == Logic.KWD_ISA) {
return (NamedDescription.estimateCardinalityOfExtension(Logic.getDescription(((Surrogate)(goal.operator)))));
}
else if ((testValue000 == Logic.KWD_FUNCTION... |
24cfec8b-4034-4b8d-a7e1-0be3f61d5c4d | 4 | public int countStars(String[] result) {
int n = result.length;
int ans = 0;
for(int i = 0;i < n;i++){
if(result[i].equals("ooo")){
ans += 3;
}else if(result[i].equals("oo-")){
ans += 2;
}else if(result[i].equals("o--")){
ans += 1;
}
}
return ans;
} |
64f6f715-2612-4b1f-938b-e84e04233dca | 7 | public Bundle worthAtLeast(double maximumPrice) {
double value = getValue();
if (value < maximumPrice) return null; //I want to cause null pointers if this ever happens.
Bundle divvy = this.times(maximumPrice/value); //good starting guess.
Bundle leftover = this.minus(divvy);//What I have left to allocate.
... |
f4fc7d75-dda3-40c9-bb07-ca0a23dca32f | 6 | public static void calculateTLZScore(ArrayList<Song> songs)
{
for(Song song: songs)
{
song.setTimeLength();
}
double sum=0;
double mean;
double var;
double sd;
double zScore;
int count=0;
for(int i=0; i<songs.size(); i++)
{
if(songs.get(i).getTimeLength()>0)
sum=sum+songs.get(i).getTime... |
8f4cca12-412d-4b80-98fa-04ed38c97e5c | 7 | @Override
public void actionPerformed(ActionEvent event) {
if(isAddComputer(event)){
String profile = view.getProfileName();
String computer = view.getNickName();
String homeFolder = view.getHomeFolder();
String serverName = view.getServerName();
String userName = view.getUserName();
String... |
deaa8a50-f07a-4fb6-941e-03dbfb73a191 | 4 | private static void addCatchPhiOperands(final SSAConstructionInfo info,
final Block block, final LocalExpr def) {
final Iterator handlers = block.graph().handlers().iterator();
// Iterate over all of the exception handlers in the CFG. If
// the block we are dealing with is a protected block (that is,
// is ... |
04940387-9620-4e69-90d6-ee26467d890b | 8 | private void executeIteration(int[] rgb, Mask mask, int width, int height) {
int[][] offsets = { { -1, -1 }, { 0, -1 }, { 1, -1 }, { -1, 0 }, { 1, 0 }, { -1, 1 }, { 0, 1 }, { 1, 1 } };
MaskIterator iterator = mask.iterator();
while (iterator.hasNext()) {
int pixelIndex = iterator.next();
int x = pixelInde... |
3f98e858-437a-4472-ad54-1d4becaffdac | 9 | @Override
public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
System.out.println("#####################################################");
System.out.println("start generating code ...");
for(TypeElement typeElement : annotations){
Generat... |
b957728b-7755-4f99-ab1b-1c912809fef4 | 8 | private static LongSet getIPBlocks()
{
LongSet group = (LongSet)Resources.getResource("SYSTEM_IP_BLOCKS");
if(group == null)
{
group = new LongSet();
final String filename = CMProps.getVar(CMProps.Str.BLACKLISTFILE);
final List<String> ipList = Resources.getFileLineVector(Resources.getFileResource(filen... |
7fdefa19-abe2-4c3e-8791-e35157b31934 | 8 | private boolean claimRegion(Player player){
//Make sure we have a worldguard instance
if (plugin.wg != null){
// Get WorldGuards Region Manager
RegionManager rm = plugin.getRegionManager(player);
// Make sure a RegionManager was found
if (rm != null) {
List<String> regionIds = plugin.ge... |
3ed7a8cf-4bd5-49b0-b3ac-b108b816261b | 1 | public JSONObject getFullFile() throws ReaderException {
if (this.json_obj instanceof JSONObject) {
return (JSONObject) this.json_obj;
} else {
throw new ReaderException("JSON file is not formatted properly.");
}
} |
493296f6-2dee-4516-a2e1-c5c4295ded58 | 9 | private void updateStatistics() {
numPink = numBlue = numGreen = numMale = numFemale = numTotal = 0;
synchronized (world) {
for (int i = 0; i < width; i++) {
for (int j = 0; j < height; j++) {
Organism o = world[i][j].visitor;
if (o == null)
continue;
if (o.getBaseColor().equals(Color.MA... |
e5be6811-b8e3-480b-a702-592bfd83579d | 3 | @SuppressWarnings("static-access")
private void ROUND6() {
enemises.clear();
System.out.println("Round6!!!!!!");
for (int i = 0; i < level.getWidth(); i++) {
for (int j = 0; j < level.getHeight(); j++) {
if ((level.getPixel(i, j) & 0x0000FF) == 2) {
... |
509d612a-b172-4933-a2dd-00dc25b18562 | 8 | private void chooseFormat(BufferedImage image) {
switch (image.getType()) {
case BufferedImage.TYPE_4BYTE_ABGR :
case BufferedImage.TYPE_INT_ARGB :
imageComponentFormat = ImageComponent.FORMAT_RGBA;
textureFormat = Texture.RGBA;
break;
... |
7c93a271-132a-4c65-a276-7800fcc1301a | 9 | public static void main(String[] args) {
// fill distances with max value at the beginning
Arrays.fill(distances, Integer.MAX_VALUE);
// set distances to direct children of the node
for (int i = 0; i < GRAPH_SIZE; i++) {
if (graph[NODE][i] > 0) {
// set the d... |
a01f15bc-bb64-4d67-beae-6b0f8148789c | 9 | public static void main(String[] args) {
Display display = new Display();
final Shell shell = new Shell(display);
shell.setLayout(new FillLayout());
Image originalImage = null;
// FileDialog dialog = new FileDialog(shell, SWT.OPEN);
// dialog.setText("Open an image file or cancel");
// String string = ... |
a9d9f326-07b3-4cb9-b7af-1abbae10382e | 9 | public static MavenVersion parse(String version) throws ParseException {
version = version.trim();
if (version.isEmpty()) {
throw new ParseException("Empty string", 0);
}
String[] dotSplit = version.split("\\.");
if (dotSplit.length > 3) {
throw new ParseE... |
35cd6a6a-92a7-42c1-92cc-69d5c330815f | 4 | public void zeroLessThan(float cutOff) {
for(int i=0; i < data.length; i++) {
double[] block = data[i];
for(int j=0; j < block.length; j++) {
if (block[j] != 0.0f && block[j] < cutOff) block[j] = 0.0f;
}
}
} |
ee4926d0-cd83-4c16-8a97-8f0a20d7a75c | 0 | public Distance(double conversionFactor, String name) {
super(conversionFactor, name);
} |
ffed36f9-b12c-4973-b5db-029848310b0c | 9 | public double getPesoLlaveEntera(int capa, int neurona, int llave){
double peso = 0;
switch (llave) {
case 0:
peso = this.getPeso(capa, neurona, THRESHOLD);
break;
case 1:
peso = this.getPeso(capa, neurona, EMBARAZOS);
break;
case 2:
peso = this.getPeso(capa, neurona, CONCENTRACION_G... |
16310b42-4f1a-4580-8f5a-81b830822f71 | 8 | private int checkForMultiple(List<Card> hand)
//TODO bugs bugs bugs
{
List<Card> newHand = new ArrayList<Card>();
for(int i = 0 ; i < 5 ; i++)
{
newHand.add(null);
}
int multipleReturn = 1;
int multipleCheck = 1;
int startValue = 0;
for (int i = 0 ; i < hand.size()-1 ; i++)
{
multipleCheck ... |
eb6049b0-57b8-4467-98e8-5fe6dca5c9d8 | 7 | public void setSource(File file) throws IOException {
File original = file;
m_structure = null;
setRetrieval(NONE);
if (file == null)
throw new IOException("Source file object is null!");
// try {
String fName = file.getPath();
try {
if (m_env == null) {
m_e... |
dec92915-8aef-4ef0-ba77-3e50b5113d0c | 1 | private static char lookupEntity(String val){
Character v=(Character)htmlEntities.get(val);
if(v==null) return (char)0;
return v.charValue();
} |
4b2086a9-f31b-4555-9f9c-ab22e7fc3973 | 5 | public final void setRange(double minValue, double maxValue)
{
// Check for unusual values
if (minValue == Double.NaN)
minValue = 0;
if (maxValue == Double.NaN)
maxValue = 0;
// conserve slider value
double[] sliderValues = new double[sliders.size()];
for (int i = 0; i < sliderValue... |
2111f085-af78-4848-8c5a-d8539b834ea8 | 5 | @Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final CidadeOrigem other = (CidadeOrigem) obj;
if (this.IdCidadeOrigem != other.IdCidadeOrigem && (this.IdCidad... |
a568130d-f456-4a43-be2a-8f488f22a694 | 6 | public void parsercommand(String componentType,String componentName, String command)
{
Component component= engine.getPowerPlantComponent(componentName);
if(component.getName() =="valve")
{
InfoPacket i = new InfoPacket();
i.namedValues.add(new Pair<String>(Pair.Label.cNme, component.getName()));
... |
662094fe-1681-429f-941d-5fe87e88bcb5 | 3 | private void linearize_recursive_single(ArrayList<LUSTree> seq, boolean use_combos){
//This is the end of a sequence
if (branches.isEmpty())
seqs.add(seq);
//Otherwise, branch
else{
int len = branches.size(), i = 0;
for (LUSTree node: branches){
//We need to copy the sequence, so it isn't o... |
df3aefd7-5fce-4682-bf47-a57d9e5ba79f | 6 | private Token scaenOpCodeOrLiteral(final CharStream line) throws AssemblerSyntaxException {
if (!CharUtils.isAlpha(line.getCurrentChar())) {
throw new AssemblerSyntaxException(
String.format("Opcodes or literals must start with alpha character at column %d!", line.getIndex()),
... |
ab521193-b0ac-4ab7-b82d-892eeb4d87db | 7 | public int findKiller() {
int killer = c.playerId;
int damage = 0;
for (int j = 0; j < Config.MAX_PLAYERS; j++) {
if (PlayerHandler.players[j] == null)
continue;
if (j == c.playerId)
continue;
if (c.goodDistance(c.absX, c.absY, PlayerHandler.players[j].absX, PlayerHandler.players[j].absY, 40)
... |
66abd352-1e33-41b6-89e1-99d12cd51cec | 1 | public String getSignatureAndPermissions(){
String s = getSignature();
for (String perm : permissions)
s += " " + perm;
return s;
} |
3b372882-bd4e-45ad-8e3b-e38414039489 | 4 | public <T extends Sprite<?>> Set<T> getSpritesOfType(Class<T> type) {
Set<T> result = new HashSet<T>();
for (Sprite<?> sprite : sprites) {
if (type.isInstance(sprite)) {
result.add(type.cast(sprite));
}
}
return result;
} |
c9c3f4b9-7ee7-42ca-a4c8-efc764c9c30d | 5 | private boolean QueryCompareFormatTwo(LinkedHashMap<String, List<String>> queryvalue, LinkedHashMap<String,List<String>> borrowlistvalue){
if( (borrowlistvalue.containsKey("name") && borrowlistvalue.get("name").equals((queryvalue.get("name")))) &&
(borrowlistvalue.containsKey("birthday") && borrowlistvalue.get... |
236bac50-ea8f-4cca-8806-40b100529c3f | 1 | final public String string(boolean requireEOF) throws ParseException {
Token t = null;
t = jj_consume_token(STRING);
eof(requireEOF);
{if (true) return t.image.substring(1, t.image.length()-1);}
throw new Error("Missing return statement in function");
} |
556bb3ba-8ad8-4aee-85ca-581832f05b39 | 7 | @Override
public AnnotationVisitor visitParameterAnnotation(final int parameter,
final String desc, final boolean visible) {
AnnotationNode an = new AnnotationNode(desc);
if (visible) {
if (visibleParameterAnnotations == null) {
int params = Type.getArgumentTy... |
87505405-80cf-437f-b3f7-4872d584c508 | 7 | private void loadFromFile()
{
JFileChooser jfc = new JFileChooser();
if( jfc.showOpenDialog(this) != JFileChooser.APPROVE_OPTION)
return;
if( jfc.getSelectedFile() == null)
return;
File chosenFile = jfc.getSelectedFile();
try
{
BufferedReader reader = new BufferedReader(new FileReade... |
753272fd-9972-4592-aa47-23506cb18695 | 7 | private void processKey(KeyEvent e) {
int keyCode = e.getKeyCode();
System.out.println("Key press:"+keyCode);
// termination keys
// listen for esc, q, end, ctrl-c on the canvas to
// allow a convenient exit from the full screen configuration
if ((keyCode == KeyEvent.VK_ESCAPE) || (keyCode == KeyEvent.VK_Q... |
0f9a181e-7020-4d08-b255-7118e2748c52 | 0 | public static The5zigMod getInstance() {
return instance;
} |
c4b7457f-aed0-4ff4-b6da-bebb0ebefdc8 | 8 | private void newPixelRun() {
final Thread current = Thread.currentThread();
//if(animated) DjVuOptions.err.println("bcr newPixelRun "+this);
if (source != null) {
for (int i = 0;;) {
if (threadArray[NEWPIXEL_THREAD] != current) {
break;
... |
77827ead-f1bf-488a-8858-52fab54d067e | 1 | private void initLayout() {
this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
this.add(Box.createRigidArea(new Dimension((FRAME_WIDTH / 100) * 2, FRAME_HEIGHT / 5)));
for (JLabel label : labels) {
setLabelParam(label);
this.add(label);
this.add(Box.creat... |
b41b583a-5e58-4892-9573-e2a7ac533fdb | 7 | public static void init(String Db){
if(StringHelper.isNullOrEmpty(Db) || Db.equalsIgnoreCase("Oracle")) {
IdentityCurrVal = "SELECT {0}.currval FROM DUAL";
IdentityNextVal = "{0}.nextval";
SelectVal = "SELECT * FROM {0}";
AppendWhereVal = "new Operation(\"ROWNUM\"... |
90975ef0-336f-4ce1-8d2e-78be7dcedf97 | 6 | public static LineNumberReader getPositionFileReader(String fileName) throws PositionFileException {
LineNumberReader reader = null;
String name = null;
if(fileName == null) {
JFileChooser fc = new JFileChooser(AppConfig.getAppConfig().getLastSelectedFileDirectory());
fc.setDialogTitle("Select input file... |
41f62bba-6ddc-4a8e-951c-c42c858192d4 | 8 | @Override
public Intersection findIntersect(Ray r) {
Vector o = r.getOrigin();
Vector d = r.getDirection();
Vector local_z = p2.sub(p1).norm();
Vector local_x = d.cross(local_z).norm();
Vector local_y = local_z.cross(local_x).norm();
Vector w = o.sub(p1);
Vector o_local = new Vector(w.dot(local_x), w.dot... |
ce8f925a-ca65-44b0-b7d6-8bb0338e2da3 | 0 | void loadTemplatesSimple()
{
Templates.addElement(loadTemplate("circle CCW", TemplateData.circlePointsCCW));
Templates.addElement(loadTemplate("circle CW", TemplateData.circlePointsCW));
Templates.addElement(loadTemplate("rectangle CCW", TemplateData.rectanglePointsCCW));
Templates.addElement(loadTemplate("rec... |
a2c39e7f-5385-4c52-9bca-fb386fb0d596 | 1 | public ClassroomPanel(DataStore ds) {
super();
this.cp = this;
this.dataStore = ds;
this.classrooms = dataStore.getClassrooms();
this.treenodes = new HashMap<ClassType, DefaultMutableTreeNode>();
this.addComponentListener(new ComponentAdapter() {
public void componentShown(ComponentEvent e) {
... |
23d63f46-f393-4798-a920-ee1a37c5afae | 5 | public String[] getCMD() {
if (!connected)
return null;
if (stability == NO_CONNECTION) {
return buildCMD(CMD.CONNECTION_LOST);
}
try {
String[] cmd = inFromClient.readLine().trim().split(SPLITTER);
if (stability != STABLE) {
stability++;
log("stability: " + stability);
}
if (cmd[0].... |
eb9bce57-bea3-47e9-a339-5924a68a85e9 | 5 | public static boolean isReservedClosedParen(String candidate) {
int START_STATE = 0;
int TERMINAL_STATE = 1;
char next;
if (candidate.length()!=1){
return false;
}
int state = START_STATE;
for (int i = 0; i < candidate.length(); i... |
e4dea9c4-c6f0-47f2-bf9c-286b9919df32 | 7 | private void displayTiles(Terminal term, int left, int top) {
for (int x = 0; x < this.screenWidth; x++) {
for (int y = 0; y < this.screenHeight; y++) {
int wx = x+left;
int wy = y+top;
if (Game.game.world.getDiscovered(wx, wy)) {
if (Game.game.player.canSee(wx, wy))
term.write(Game.game.wor... |
c65b7b2c-6d2b-4002-b100-de10fabf6244 | 7 | protected static Ptg calcNormdist( Ptg[] operands )
{
if( operands.length < 4 )
{
return new PtgErr( PtgErr.ERROR_VALUE );
}
try
{
//If mean or standard_dev is nonnumeric, NORMDIST returns the #VALUE! error value.
double x = operands[0].getDoubleVal();
double mean = operands[1].getDoubleVal();
... |
4e3798a2-56f0-4422-984e-d64f81f8d738 | 6 | private void checkActionsInContent() {
if (mInput.up() && currentSectionNumber > 0) {
changeSelectedSection(-1);
} else if (mInput.down() && currentSectionNumber < sections.length - 1) {
changeSelectedSection(1);
} else if (mInput.action()) {
mSection = new Se... |
ea93e526-3c07-4658-9636-48d119e1268e | 1 | @Override
public void mouseWheelMoved(MouseWheelEvent e) {
incrementStroke(e.getPreciseWheelRotation());
int size = getStrokeSize();
if (size < 0) {
stroke = 0;
}
detailsPanel.getStrokeSize().setText("Stroke size: " + stroke);
} |
2c8c9c71-f302-4f94-88f9-2121a1d7386c | 2 | private int getSelected(double x, double y)
{
for (int i = selindex+1; i < shapeList.size(); i++)
{
if (shapeList.get(i).contains(x, y))
{
shapeList.get(i).highlight(true);
return i;
}
}
return -1;
} |
2a3af916-788d-452a-a24e-50fe98a013c2 | 5 | public void countAnswers()
{
countA = 0;
countB = 0;
countC = 0;
countD = 0;
for (int key : database.keySet())
{
if(database.get(key).equals('A'))
{
countA += 1;
}
if(database.get(key).equals('B'))
{
countB += 1;
}
if(database.get(key).equals('C'))
{
countC += ... |
7e15cee5-3863-4980-94b0-97d3d275b8b3 | 9 | public static void main(String[] args) {
String usage = "java org.apache.lucene.demo.IndexFiles"
+ " [-index INDEX_PATH] [-docs DOCS_PATH] [-update]\n\n"
+ "This indexes the documents in DOCS_PATH, creating a Lucene index"
+ "in INDEX_PATH that can be searched with SearchFiles";
String indexPath = "inde... |
ac7ccc8a-57b9-4030-abab-d7a0c7bdbb5c | 4 | @Override
public Value evaluate(Value... arguments) throws Exception {
if (arguments.length != 2) {
throw new EvalException("add support only two argument!");
}
Value arr = new Value(arguments[0]);
Value val = arguments[1];
if (arr.getType() == ValueType.ARRAY) {
... |
b6373ebd-8ff2-4764-b696-0a6dcb11516e | 2 | @Override
public boolean isApplicable(Integer current, Integer target)
{
for (Conditional condition : conditions)
{
if (!condition.isApplicable(current, target))
return false;
}
return true;
} |
01b73401-a7ac-4be0-a8e9-d10543ad91a0 | 9 | public final void terminarPara() throws RecognitionException {
try {
// fontes/g/CanecaSemantico.g:862:2: ( ^( PARA_ . . . . ) )
// fontes/g/CanecaSemantico.g:862:4: ^( PARA_ . . . . )
{
match(input,PARA_,FOLLOW_PARA__in_terminarPara2358); if (state.failed) return... |
f69d0759-b50b-41d5-8b13-b034a5d44e30 | 4 | public static void affineMatrixFill(AlignmentGraphBasic d)
{
AlignmentGraphBasic e = new AlignmentGraphBasic(d);
AlignmentGraphBasic f = new AlignmentGraphBasic(d);
int x,y;
d.setMatrix(0,0,0);
for(x=1;x<d.getMatrixXLength();x++)
{
e.setMatrix(0, x,(e.getEffort()[0]+x*e.getEffort()[1]));
d.setMatrix(... |
df13d1db-e604-4459-8364-dce8d5dc1442 | 4 | public ArrayList<Product> getProducts(String filter) {
ArrayList<Product> products = new ArrayList<Product>();
try {
Connection conn = openConnection();
Statement stat = conn.createStatement();
Statement stat2 = conn.createStatement();
ResultSet rs = stat.executeQuery("select * from "
+ DB_PRODUCT_... |
9c797a29-9548-4e60-ad2a-5af980ff4b35 | 7 | private void calculatePath() {
Shape rectangle = new RoundRectangle2D.Float( x, y, width, height, arc, arc );
Triangle triangle = null;
AffineTransform at = new AffineTransform();
switch( tabLocation ) {
case TAB_AT_RIGHT:
if( anglePosition == NONE ) {
triang... |
b2389d3c-e9a1-42e9-92e6-6890d3385248 | 7 | private JSONWriter append(String string) throws JSONException {
if (string == null) {
throw new JSONException("Null pointer");
}
if (this.mode == 'o' || this.mode == 'a') {
try {
if (this.comma && this.mode == 'a') {
this.writer.write('... |
fce0eb46-34c0-4984-9f49-715211e64be8 | 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 Redirects)) {
return false;
}
Redirects other = (Redirects) object;
if ((this.url == null && other.url != null)... |
078a867c-beea-4803-9eee-84e0a947a09f | 2 | void close ()
throws USBException
{
if (fd < 0)
return;
try {
// make sure this isn't usable any more
int status = closeNative (fd);
if (status < 0)
throw new USBException (
"error closing device",
-status);
} finally {
// make sure nobody else sees the device
usb.remov... |
039bd48d-f0f5-4bd6-94bf-5a617307dfdb | 5 | public static int lengthOfLongestSubstring(String s) {
int max = 0;
int len = s.length();
int[] hash = new int[256];
int[] first = new int[len+1];
int[] next = new int[len];
first[len] = len;
for (int i = len - 1; i >= 0; i--) {
int index = hash[s.charAt(i)];
next[i] = index == 0 ? len : index;
h... |
573f41e9-7d73-442e-b702-00c6cf7b3267 | 9 | private void detached() {
// Transient session self-destructs after peer disconnects.
if (!connect) {
terminate ();
return;
}
// For delayed connect situations, terminate the pipe
// and reestablish later on
if (pipe != null && options.delay_at... |
668e8fec-e1e3-4425-a4b6-273b6c066294 | 6 | private Point getPointFromMyo(double pitch, double yaw) {
Point point = new Point();
double x, y;
if (topGreater) {
y = HEIGHT - (((pitch - info.getPitchBottom()) / (info.getPitchTop() - info.getPitchBottom())) * HEIGHT);
} else {
y = ((pitch - info.getPitchTop()) / (info.getPitchBottom() - info.getPitchT... |
248d19cf-08e2-450c-96ca-0be114c42429 | 9 | public static Object ungz(String string) {
//DetectRight.checkPoint("base64");
if (string == null) return null;
if (PHPSerializer.isSerialized(string)) return Functions.unserialize(string);
byte[] byt;
//DetectRight::checkPoint("GZDecode");
try {
byt = Functions.base64_decode(string);
byt = Functions.... |
30b0f9b5-d4be-4025-a69b-28a58aef08b0 | 0 | private void thisMouseClicked(MouseEvent e) {
x = e.getX();
y = e.getY();
repaint();
} |
90071a8c-c936-42ce-8bb3-17378ec8b580 | 6 | public Identifier getIdentifier(String fieldName, String typeSig) {
for (Iterator i = getChilds(); i.hasNext();) {
Identifier ident = (Identifier) i.next();
if (ident.getName().equals(fieldName)
&& ident.getType().startsWith(typeSig))
return ident;
}
if (superName != null) {
ClassIdentifier sup... |
6b01c4d9-4243-492b-9bae-0776d4fe287d | 2 | public static int[] GetUser(String username, String password){
try
{
String query = String.format("SELECT * FROM APPUSERS WHERE USERNAME = '%s' AND PASSWORD ='%s'", username, password);
int[] udetails = new int[2];
ResultSet rs = getQueryResults(query);
while (... |
c9f740d0-ca2c-4716-8e4a-a0e937819fc1 | 0 | public Network() {
stations = new ArrayList<String>();
} |
4954f920-e894-405f-806f-0a1f93830617 | 6 | static final String method1273(int[] is, boolean bool) {
anInt2161++;
StringBuffer stringbuffer = new StringBuffer();
int i = Class239_Sub1.anInt5850;
for (int i_24_ = 0; is.length > i_24_; i_24_++) {
Class321 class321
= Class348_Sub23_Sub2.aClass187_9036.method1408(-12637,
is[i_24_]);
if ((((Cl... |
8d4992e9-833c-4563-a763-9a0209fdc75f | 9 | public void launchNext(final int wexp, final int ah) {
Thread subExpThread;
subExpThread = new Thread() {
public void run() {
m_remoteHostsStatus[ah] = IN_USE;
m_subExpComplete[wexp] = TaskStatusInfo.PROCESSING;
RemoteExperimentSubTask expSubTsk = new RemoteExperimentSubTask();
expSubTs... |
a00acea8-7df6-459c-9f0c-0b32e59c9c38 | 0 | public GroupCommand(TotalPermissions p) {
plugin = p;
} |
0fd23461-8a20-468b-9dee-10207a66af9f | 3 | public List<ClassObj> getClassTable(PreparedStatement pre) {
List<ClassObj> items = new LinkedList<ClassObj>();
try {
ResultSet rs = pre.executeQuery();
if (rs != null) {
while (rs.next()) {
ClassObj item = new ClassObj();
i... |
b6c035f4-fe49-42c6-9261-78add93b6fcb | 3 | public String removeTags(String str)
{
//str.replaceAll("<+[^>]+>", "");
int index = 0;
String finalString = "";
while(index < str.length())
{
if(str.charAt(index) == '<')
{
while(str.charAt(index) != '>')
{
... |
dbada976-b7b5-445a-b13b-d5aaf41786b9 | 3 | private static ArrayList<Object> getWFIPathRec(mxAnalysisGraph aGraph, Object[][] paths, Object startVertex, Object targetVertex,
ArrayList<Object> currPath, mxCostFunction cf, mxGraphView view) throws StructuralException
{
Double sourceIndexD = cf.getCost(view.getState(startVertex));
Object[] parents = paths[s... |
f4942c44-e8a2-46a1-92c1-223a259c54a8 | 9 | @Override
public <T> ValueParser<? extends T> getParser(Class<T> clazz)
throws ParserFactoryException {
Class<? extends ValueParser<?>> parserCls = parserClasses.get(clazz);
if (parserCls != null) {
try {
@SuppressWarnings("unchecked")
ValuePar... |
d5f68041-5e9a-48fc-b9fc-72d1682564c6 | 4 | @Override
public MidiChannel[] getChannels() {
MidiChannel[] oldC = super.getChannels();
ArrayList<MidiChannel> rem = new ArrayList<MidiChannel>();
int ordinal = 1;
for (MidiChannel m : oldC) {
if (ordinal == Values.DRUMCHANNEL) {
ordinal++;
... |
c2c4cb73-db1f-4727-8ee8-aa4e1419bedf | 3 | public void dumpExpression(TabbedPrintWriter writer)
throws java.io.IOException {
Type flat = type.getCanonic();
int depth = 0;
while (flat instanceof ArrayType) {
flat = ((ArrayType) flat).getElementType();
depth++;
}
writer.print("new ");
writer.printType(flat.getHint());
for (int i = 0; i < de... |
7a3d852a-3e6d-4951-8428-438611c9452e | 8 | private boolean r_verb_suffix() {
int among_var;
int v_1;
int v_2;
int v_3;
int v_4;
// (, line 175
// setlimit, line 176
v_1 = limit - cursor;
// tomark, line 176
... |
de22fe92-ee18-4df9-bd42-cd65b958f78d | 1 | public String convertToString() {
String word = "";
for (Letter letter : letterChain) {
word += letter.getLetter();
}
return word;
} |
aa869fd5-f506-4496-8761-4aae70433706 | 0 | public String[] getCategories() {
return categories;
} |
5e1f824a-ee8b-4dae-a618-8b51d6d0ad5a | 6 | public int getMaxFilledBlock(){
int max = 1;
for (int step = 2; step < block.size(); step *= 2){
boolean stepIsReasonable = false;
for (int i = 0; i < block.size(); i += step){
boolean noDifference = true;
for (int k = i; k < i + step - 1; ++k){
... |
00d05d27-ef81-4f37-ab40-e0b9d7ebc2d7 | 8 | private String bindResourceAndEstablishSession(String resource) throws XMPPException {
// Wait until server sends response containing the <bind> element
synchronized (this) {
if (!resourceBinded) {
try {
wait(30000);
}
catch... |
30b2bad4-3f32-4720-a42e-013a81e5d551 | 2 | public int getRosterAvailabilityCode (Date date) {
// check roster's availability code for the date. Default is non available
for (RosterAvailability ra : rosterAvailability) {
if (ra.getDate().compareTo(date) == 0)
return ra.getAvailabilityCode();
}
return RosterAvailability.ROSTER_ABSENT;
} |
61b3ca80-48de-4e30-8414-2cd5376433c3 | 6 | public static void main(String[] args) throws Exception {
print("Memory allocated: " + memory + " MB");
if (Debug.splashlogo == true) {
JFrame preload = new JFrame("Loading...");
com.sun.awt.AWTUtilities.setWindowOpacity(preload, 0.8f);
preload.setBounds(450, 300, 528, 3... |
4ae49d79-9efa-45da-a0df-241c1e3eeef3 | 3 | static void unzip(File targetDir, File zipFile) {
int BUFFER = 4096;
try {
FileInputStream fis = new FileInputStream(zipFile);
ZipInputStream zis = new ZipInputStream(new BufferedInputStream(fis));
ZipEntry entry;
int count;
byte data[] = new b... |
c7f807d4-ff94-424f-a5e8-dba126100852 | 0 | public void runLogic(){
checkAces();
hitMe();
bust =checkBust();
} |
dc34cb9c-ccc8-4646-8537-14d49eb68705 | 3 | public synchronized void addEntry(int cashpointNr,double price, int abgKunden, String productNames, String pricelist, int queuesize){
BalanceEntry balanceEntry = null;
if(getBalanceEntry(cashpointNr) != null){
balanceEntry = getBalanceEntry(cashpointNr);
balanceEntry.addPrice(price);
balanceEntry.setAbKund... |
37a35b8a-5943-468d-a1c8-47bf2ba03ab8 | 0 | public NormalMove(Player player, Board board, Piece piece, Field from, Field to) {
super(player, board, piece, from, to);
} |
59b4e787-8af5-4d8b-b44b-c4f83e64cc67 | 9 | final public SimpleNode Start() throws ParseException {
/*@bgen(jjtree) Start */
SimpleNode jjtn000 = new SimpleNode(JJTSTART);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
try {
Expression();
jj_consume_token(LF);
jjtree.closeNodeScope(jjtn0... |
7820a6c9-3f37-4d6c-a9d0-8798f31374db | 0 | @XmlTransient
public Collection<Observacion> getObservacionCollection() {
return observacionCollection;
} |
6d48613b-a423-4f2d-9a3b-cc220481b399 | 4 | public static String getJRobinHomeDirectory() {
String className = Util.class.getName().replace('.', '/');
String uri = Util.class.getResource("/" + className + ".class").toString();
if(uri.startsWith("file:/")) {
uri = uri.substring(6);
File file = new File(uri);
// let's go 5 steps backwards
for(int... |
f7100d01-ba42-42f5-9153-24430105771e | 0 | String readLabel() {
return label;
} |
fce4254b-857e-4508-a087-22c100323b93 | 8 | private void persist(PersistAction persistAction, String successMessage) {
if (selected != null) {
this.setEmbeddableKeys();
try {
if (persistAction != PersistAction.DELETE) {
this.ejbFacade.edit(selected);
} else {
... |
b3f3ad18-6a58-468d-85c4-cc42d8152da4 | 6 | public static void act(Unit unit) {
// NOT cloaked.
if (!unit.isCloaked()) {
if (unit.getEnergy() > 10 && TechnologyManager.isWraithCloakingFieldResearched()) {
unit.cloak();
UnitActions.useTech(unit, TechnologyManager.CLOAKING_FIELD);
}
}
// CLOAKED.
else {
double nearestEnemyDist = xvr.ge... |
c7a33eb6-3cfb-4fe3-9571-b2b1759fee23 | 0 | public World getLoadedWorld() {
return loadedWorld;
} |
b7b8754b-a85f-480d-9543-04661541c61f | 9 | public int checkPTW()
{
if(cornerMap.get("P").equals("P")
&& cornerMap.get("T").equals("T")
&& cornerMap.get("W").equals("W"))
{
return SOLVED;
}
if(cornerMap.get("P").equals("W")
&& cornerMap.get("T").equals("P")
&& cornerMap.get("W").equals("T"))
{
return CW;
}
if(cornerMap.get("P... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.