method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
2f7e5db6-a2d1-4615-bb64-5458d7756c87 | 8 | protected int retonarQuantidadeDeVizinhos(int linha, int coluna) {
int vizinhos = 0;
// Esquerda
if (coluna > 0) {
if (tabuleiro[linha][coluna - 1]) {
vizinhos++;
}
}
// Direita
if (coluna < totalColunas - 1) {
if (tabuleiro[linha][coluna + 1]) {
vizinhos++;
}
}
// Acima
if ... |
f4b76fd8-018e-425a-8dd0-575830a48fd0 | 0 | public void setServiceType(String serviceType) {
this.serviceType = serviceType;
} |
30012346-8479-432a-9687-cb7e2f1535e8 | 3 | private void replace(int[][] temp, int oldValue, int newValue) {
for(int y = 0; y < temp[0].length; y++) {
for(int x = 0; x < temp.length; x++) {
if(temp[x][y] == oldValue) {
temp[x][y] = newValue;
}
}
}
} |
591e728b-9728-4976-b956-1f89b3edb6b1 | 0 | public Instance get(int i) {
return this.instances.get(i);
} |
bea8acb0-0411-4ce8-a1a4-9c7da98761d7 | 7 | public void printEvents(Boolean tourneyHeld) {
System.out.println();
System.out.println("List of events");
for (int i = 0; i < eventCount; i++) {
System.out.print(events[i].getName() + ",");
System.out.print(events[i].getPlayDistance() + ",");
System.out.print(events[i].getPlayTo() + ",");
System.out.... |
fe4ee73c-46d1-4ffb-a22c-48030b4c9b74 | 8 | private boolean changeCoordinates(Dimension dim, Directions d)
{
if(dim.height == 0 || dim.height == this.height -1 || dim.width == 0 || dim.width == this.width -1)
{
return false;
}
switch (d)
{
case UP:
{
dim.setSize(dim.w... |
4926438a-897e-4015-b20c-c9bc77cab612 | 0 | public SocketServer(String address, int port) {
lock = new ReentrantLock();
connectionId = 0;
//..
doSetActive(false);
setEndPoint(new EndPoint(port, address));
setConnections(new CopyOnWriteArrayList<ISocketServerConnection>());
setInitial(false);
} |
aff8aa00-0ead-4a7c-8d5c-94147176fdbf | 6 | public void print(String path)
{
List<String> list = getFileList(path);
if (list == null)
{
return;
}
int length = list.size();
for (int i = 0; i < length; i++)
{
String result... |
c9e8fe52-9ca5-4b3a-bf32-3ec5642b3328 | 6 | public static boolean checkInputValidity(String input) { //Used to make sure the input is a valid choice
boolean validity = false;
if (input.equalsIgnoreCase("dog")) {
validity = true;
} else if (input.equalsIgnoreCase("stats")) {
validity = true;
} else if (in... |
bbd93f3e-3d8f-41c0-b2f7-ff0cbd7727db | 6 | public final void creaCamino(final String actuales) {
String[] indices = actuales.split(",");
double pesoActual = calculaPeso(indices);
if ((indices.length >= (nVert - 1)) || (pesoActual > pesoMin)) {
if (indices.length == (nVert - 1)) {
if (pesoActual < pesoMin) {
... |
248d2b1e-4082-407c-870b-4957c4abfc5b | 8 | final FEMFunction _compileArrayAsFunction_() throws IllegalArgumentException {
if (!this._arrayEnabled_) throw this._illegal_(null, " Wertlisten sind nicht zulässig.");
this.skip();
if (this._compileType_() == ']') {
this.skip();
return FEMArray.EMPTY;
}
final List<FEMFunction> list = new ArrayList<>();... |
8a150ee3-d1a2-443a-b3bd-84a05494fc3d | 8 | private void transform(ScriptOrFnNode tree)
{
initOptFunctions_r(tree);
int optLevel = compilerEnv.getOptimizationLevel();
Map<String,OptFunctionNode> possibleDirectCalls = null;
if (optLevel > 0) {
/*
* Collect all of the contained functions into a hashtable... |
92807c69-fd18-43f2-a735-577d169133b1 | 4 | public static final boolean isWhitespace(char c) {
return ((c == ' ') || (c == '\t') || (c == '\r') ||
(c == '\n') || (c == '\f'));
} |
1f1113e5-2999-44b6-ae32-8ec4d4cc1810 | 3 | private void buildField() {
for (int i = 0; i < field.getWidth(); i++) {
for (int j = 0; j < field.getHeigth(); j++) {
GuiField displayField = new GuiField(this.field, game, field.getFields()[i][j], j, i);
add(displayField);
displayedFields.add(display... |
2fea6f60-36a3-45db-8110-edd94f76d3f1 | 9 | public static void main(String[] args) {
if (args.length < 1) {
System.err.println("usage: <executable> <part name> [-noBRAMContent]\n");
DeviceLookup.printAvailableParts(System.err);
System.exit(1);
}
String partname = args[0];
boolean ignoreBRAMContent = false;
if (args.length > 1 && args[1].eq... |
f257b4bf-46b3-4ec6-924d-240c14c61472 | 1 | @Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((color == null) ? 0 : color.hashCode());
return result;
} |
be0a375e-e9b8-449d-bc49-34016159339b | 8 | static private ImageAccess split(ImageAccess in, int type1, int type2, int length) {
int nx = in.getWidth();
int ny = in.getHeight();
ImageAccess out = new ImageAccess(nx, ny);
ComplexWaveFilter wf = new ComplexWaveFilter(length);
if (nx >= 1 ) {
double rowin[] = new double[nx];
double rowout[] =... |
441d5286-09cc-4708-8a7f-56054e432ee6 | 6 | public void removeTask(Task t) {
try {
String filepath = System.getProperty("user.home")
+ "/.TODO-group9/savedata.xml";
DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
Document doc = docBuilder.parse(filepath);
... |
5fb73555-d2d1-4848-b184-e176c59c99f7 | 3 | private void clearFields() {
for(int i = 0; i < evaluationResults.length; i++) {
evaluationResults[i].setText("");
}
for(int i = 0; i < evaluationComments.length; i++) {
evaluationComments[i].setText("");
}
for(int i = 0; i < evaluationScores.length; i++)
{
evaluationScores[i].setValue(evaluationSc... |
6e1506ae-7a28-461b-92da-65f3c7fd61da | 0 | public int getSkillId() {
return skillId;
} |
97f9ab59-6124-453e-a214-9646e7a6cd00 | 4 | public static TypedBlock[] makeBlocks(MethodInfo minfo, CodeAttribute ca,
boolean optimize)
throws BadBytecode
{
TypedBlock[] blocks = (TypedBlock[])new Maker().make(minfo);
if (optimize && blocks.length < 2)
if (blocks.length == 0 || blo... |
3e0c507c-60ca-408c-9aa3-d18e03e8801b | 0 | public static void push(MultipleLayerLruCache cache, String index, StringCache info){
cache.put(index, info);
} |
eb586c6c-ab80-4707-af51-bcf21448b09f | 8 | public PrimitiveOperator combineMidNLeftOnRight(PrimitiveOperator other) {
boolean[] newTruthTable = new boolean[8];
// the other gate is on the left side - on the LSB
newTruthTable[0] = truthTable[((other.truthTable[0]) ? 1 : 0) | 0]; //000
newTruthTable[1] = truthTable[((other.truthTable[1]) ? 1 : 0)... |
8902bb83-f81f-4533-96cd-e4d562cf8c0f | 8 | @Override
public Object execIdCall(IdFunctionObject f, Context cx, Scriptable scope,
Scriptable thisObj, Object[] args)
{
if (!f.hasTag(FUNCTION_TAG)) {
return super.execIdCall(f, cx, scope, thisObj, args);
}
int id = f.methodId();
switch ... |
75805992-d9e3-4a8f-aed1-9d83ec187f22 | 8 | public void testAddMultipleThingsAndGetThemAndThenRemoveThemAndStuff() throws Exception {
WorldUpdateBuilder ub = new WorldUpdateBuilder();
final SimpleWorldObject o0 = new SimpleWorldObject(128, 64, 32, Long.MAX_VALUE, 1);
final SimpleWorldObject o1 = new SimpleWorldObject(128, 128, 32, Long.MAX_VALUE, 2);
... |
a927dd08-3db6-4663-8585-6fab86871fa3 | 3 | @Override
public void updateLong() {
super.updateLong();
if(generationTimerEnd == 0) {
resetGenerationTimer();
}
if(generationTimerEnd <= System.currentTimeMillis() && this.isActivated()) {
placeableManager.playerAddItem("Wood", 1);
... |
14c214d7-ed29-432b-84c3-de23da887033 | 8 | double treeNodeSplitCost(treeNode node, Point centreA, Point centreB) {
//loop counter variable
int i;
//stores the cost
double sum = 0.0;
for (i = 0; i < node.n; i++) {
//loop counter variable
int l;
//stores the distance between p and cent... |
40f94c27-8a7e-426e-83f5-d11e4ccbaab2 | 7 | public static void setAverageScoreMap(ValueChart chart){
LinkedHashMap<String,IndividualEntryMap> listOfEntryMaps = chart.listOfEntryMaps;
LinkedHashMap<String,HashMap<String,Double>> listOfWeightMaps = chart.listOfWeightMaps;
HashMap<String,Double> maxWeightMap = chart.maxWeightMap;
// ... |
785dfc29-82c1-4159-95c7-f991e3d07754 | 5 | public Boundsheet[] getBoundSheets()
{
if( ptga == null )
{
try
{
initPtga();
}
catch( Exception e )
{
;
}
}
if( ptga instanceof PtgRef3d )
{
PtgRef3d p3d = (PtgRef3d) ptga;
Boundsheet b = p3d.getSheet( getWorkBook() );
Boundsheet[] ret = new Boundsheet[1];
ret[0] = b;
... |
8cd66377-cc79-4d0d-a1f7-df702065de77 | 6 | public static Project readProject(File f) {
BufferedReader reader = null;
Node[]nodes=null;
try {
reader = new BufferedReader(new FileReader(f));
String[]tokens;
String line = null;
while ((line = reader.readLine()) != null) {
tokens=line.split("\\s+");
if(tokens.length == 1){//fi... |
c9913662-bd24-4934-a469-4fcbe91404c0 | 2 | public void sendDeadline(){
JSONObject o = new JSONObject();
try {
o.put("message", "endturn");
sendMessage(o);
} catch (JSONException e){}
catch (IOException e){
Debug.error("Error writing to graphics: " + e.getMessage());
}
} |
b7246a64-5f9d-4b36-b3a5-36fb8397d508 | 9 | public DijkstraAlgorithm(IWeightedGraph<N, Number> graph, N source, N target) {
for(N node : graph) {
nodes.put(node, new Node<N>(node, Double.MAX_VALUE));
}
nodes.get(source).distance = 0;
HashSet<N> nodesToVisit = new HashSet<N>();
nodesToVisit.add(source);
while(!nodesToVisit.isEmpty()) {
dou... |
cbc7fb33-556f-4442-aa52-d3ec66f0e394 | 5 | private long checkClientTimeouts(int timeout) {
//we may need to notify the listener of disconnected clients
Set<Integer> disconnectedClientIds = new HashSet<Integer>();
long oldestClientCommunicationTime = -1;
synchronized(CONNECTION_LOCK) {
//if the server isn't running just return a sentinel value
if(... |
5dcb58bf-009e-4075-ae55-e1fbac4363c7 | 5 | @Override
public void startEditing(Object cell, EventObject evt)
{
if (editingCell != null)
{
stopEditing(true);
}
mxCellState state = graphComponent.getGraph().getView().getState(cell);
if (state != null)
{
editingCell = cell;
trigger = evt;
double scale = Math.max(minimumEditorScale, grap... |
a27239b5-ad44-40d5-9414-d20025fba169 | 5 | private void writeToFile() {
String fileName = "SavedGame.txt";
PrintWriter pW = null;
Card card;
try {
pW = new PrintWriter(fileName);
pW.println(cardWidth);
pW.println(cardHeight);
pW.println(userCard.getCardStatusInformation()); // what is this?
for (int i = 0; i < NUMBER_OF_ROWS; i++) {
... |
1a7eafb0-9d25-4cfd-8cd6-c4aadd8cfbfd | 1 | void checkStartCode() {
if (!startCode) {
throw new IllegalStateException(
"Cannot visit instructions before visitCode has been called.");
}
} |
918a3ae2-61b9-4d46-b243-619b16de3d22 | 6 | private void setUpFractalPanel()
{
fractalPanel = new FractalPanel();
fractalPanel.setLayout(new OverlayLayout(fractalPanel));
fractalPanel.setView(-5, 2, -2, 2);
glassPane = new GlassPane();
glassPane.setOpaque(false);
glassPane.setBounds(fractalPanel.getBounds());
... |
84b9da5d-e5b6-44b6-85e1-46c0072303d2 | 0 | public void setQueryRes(String queryRes) {
this.queryRes = queryRes;
} |
bab058cb-7983-4f1f-b2a6-3f4075c52373 | 4 | static ManagedObjectReference findSnapshotInTree(VirtualMachineSnapshotTree[] snapTree, String snapName) {
for (int i = 0; i < snapTree.length; i++) {
VirtualMachineSnapshotTree node = snapTree[i];
if (snapName.equals(node.getName())) {
return node.getSnapshot();
} else {
VirtualMachineSnapshotTree[]... |
20110112-7877-4db2-aef7-e2444c26184a | 2 | @Override
public String toString() {
String itemSetContents = "";
int num = this.itemSet.size();
for (int i = 0; i < this.itemSet.size(); i++) {
itemSetContents = itemSetContents + this.itemSet.get(i).toString();
if (i < num - 1) {
itemSetContents = itemSetContents + ",";
}
}
return "{" + itemS... |
ed6f01da-33fa-4392-b98d-8af1fc93800e | 5 | public SecuredMessageTriggerBean executeIncident(SecuredMessageTriggerBean message) throws GranException {
String text = message.getDescription();
SecuredTaskBean task = message.getTask();
SecuredUDFBean duplicateUdf = AdapterManager.getInstance().getSecuredFindAdapterManager().findUDFById(task.... |
c2ec7d19-57e8-4341-b7b2-0268364ebedd | 1 | public void input(String string) {
this.statusDisplay.setText("");
myTarget=string;
treePanel.setAnswer(null);
treePanel.repaint();
derivationModel.setRowCount(0);
myStepAction.setEnabled(false);
if (myParser.solve(string))
{
progress.setText("String is Accepted!");
////System.out.println(myParser... |
5cd2de7e-06c0-464b-9288-ca18315e9f78 | 0 | public Spielgrenze(Rectangle masse, IntHolder unit) {
super(masse, unit);
} |
45e51134-0e07-4f9b-b3c1-b695b62083b9 | 6 | private void cyclicCircularGradientFillRaster(int[] pixels, int off,
int adjust,
int x, int y,
int w, int h) {
// Constant part of the C factor of the quadratic e... |
b18b6a18-971f-4776-8617-7956db1fee08 | 6 | private void redirectStdin()
{
try {
String line = null;
while(stdin.ready()) {
line = stdin.readLine();
servin.println(line);
if(line.equalsIgnoreCase("stop")) {
stop = true;
break;
}
// Somewhat hack-ish
if(line.contains("allow") || line.contains("reset") || line.equals("backup")) {
... |
82806ca6-84b1-452b-8371-991b5b64650d | 6 | @Override
public void run() {
System.out.println("启动服务器中,打开端口" + server.getPort());
try {
socket = new ServerSocket(server.getPort());
} catch (IOException e1) {
e1.printStackTrace();
return;
}
while (server.isRunning()) {
try {
System.out.println("等待请求");
Socket client = socket.accept()... |
db62af61-3ada-4fde-a10e-cb0bc13ed660 | 9 | @Override
public void mousePressed(MouseEvent e) {
boolean rightClicked = (e.getModifiers() & InputEvent.BUTTON3_MASK) == InputEvent.BUTTON3_MASK;
if(!rightClicked)
return;
tree.setSelectionPath(tree.getPathForLocation(e.getX(), e.getY()));
DialogNode node = getSelectedNode();
if(node == null ... |
c4a710af-72c4-47c8-98cc-14bf1e84f21a | 7 | public Coords generateSpawn() {
Random randomGenerator = new Random();
Coords res = null;
int max = 5;
for (int x = 0; x <= max; ++x) {
int randx = randomGenerator.nextInt(this.rows - 1);
int randy = randomGenerator.nextInt(this.cols - 1);
if (x == max) // 5x nic nahodne nenasel -> jde sekvencne
... |
efeeb88e-8c21-40d0-9eba-15427827e7eb | 3 | private int countUntilFailed( final UndoStack<Object> stack, final long failNumber ) throws InterruptedException {
final Object e = new Object();
int count = 0;
try {
while( true ) {
stack.add( e );
count += 1;
if( count > failNumber ) {
break;
}
}
}
catch( final Throwable t ) {
... |
6a1575ff-aa48-441f-bfc2-011e6aa5c05e | 5 | private void handleTextLineElement(Attributes atts) {
int i;
if (page == null || currentTextRegion == null)
return;
//ID
String id = null;
if ((i = atts.getIndex(ATTR_id)) >= 0) {
id = atts.getValue(i);
}
//Create line
currentLine = currentTextRegion.createTextLine(id);
//Coords
if ((... |
7cc094a9-bda5-44f7-9cd4-5b223b2e4b9d | 5 | public void edit(Carpart carpart) throws NonexistentEntityException, Exception {
EntityManager em = null;
try {
em = getEntityManager();
em.getTransaction().begin();
carpart = em.merge(carpart);
em.getTransaction().commit();
} catch (Exception ex) ... |
0a1bdd5d-6f76-4fb6-ae3b-1afd4be78c7e | 0 | public KeyStroke getKey() {
return KeyStroke.getKeyStroke('c');
} |
1da17618-3317-414c-bf8e-23aa5b96fa9b | 2 | public static synchronized boolean wavesave(byte abyte0[], int i) {
if (i > 0x1e8480) {
return false;
}
if (Signlink.savereq != null) {
return false;
} else {
Signlink.wavepos = (Signlink.wavepos + 1) % 5;
Signlink.savelen = i;
Signlink.savebuf = abyte0;
Signlink.waveplay = true;
Signlink.s... |
38e98651-112a-4cf6-bbee-e33c28a04a05 | 1 | public void run() {
EventLoopGroup bossGroup = new NioEventLoopGroup();
EventLoopGroup workerGroup = new NioEventLoopGroup();
System.out.println("in HttpServRun");
try {
ServerBootstrap b = new ServerBootstrap();
b.option(ChannelOption.SO_BACKLOG, 1024);
... |
792e9905-4fba-4168-b40f-e0c231b8a9f9 | 9 | public void draw(GraphicsHandler g, int screenWidth, int screenHeight) {
int tileSize = 16;
int seperation = 10;
int panelWidth = inventoryItems.length * (tileSize + seperation) + seperation;
int panelHeight = tileSize + seperation * 2;
int x = screenWidth / 2 - panelWidth / 2;
int y = screenHeight - pan... |
4bac4bc6-3bec-474e-9d4a-7790c443f517 | 3 | public CharacterObject GetChar(String name)
{
int i = 0;
CharacterObject ob = (CharacterObject)Char_objects.Get(i);
while(ob != null)
{
ob = (CharacterObject)Char_objects.Get(i);
if(ob == null || ob.GetName().equals(name))
break;
i... |
f48f1cce-63a2-4b17-add0-1b017a92f574 | 3 | @Override
public ICacheable get(Object key) {
ICacheable c = null;
if(null != mMemLruCache){
c = mMemLruCache.get(key);
}
if(null != c) {
System.out.println(TAG+" get key "+key+" from mMemLruCache");
return c;
}
if(null != mDiskLruCache){
c = mDiskLruCache.get(key);
System.out.println(TAG... |
cb7b5539-4fef-41b0-adaf-f0aedc96317a | 3 | public void deal(){
List<Card> hand;
List<List<Card>> sets;
hand = new ArrayList();
for (Card card: FiveCardStud.deck.cards){
// check to see if card is already dealt
if(FiveCardStud.deck.usedCardIndex.contains(card)){
continue;
// if... |
f043c910-ee03-45d8-8025-f8aaa655a6b7 | 4 | public void update(){
MansionArea previousRoom = roomView.room;
//reset the RoomView, which will cause the entire view to recompute
roomView = new RoomView(player.getBandit().getName(), player.getBandit().getArea(), player.getBandit().getFace(), 0, 0, width, height, 0);
//special condition needed to redraw t... |
30062da9-f53e-412e-8f1a-5a474d1644c8 | 2 | public void modificarExtraccion(String ruta,String nom_pro, ArrayList enl_img, ArrayList enl_aud, ArrayList enl_vid, ArrayList enl_doc, ArrayList enl_otr, ArrayList enl_rec, ArrayList enl_sin_rec)
{
int cont=0;
while (cont < this.proyectos.size() && this.proyectos.get(cont).getNombreProyecto() != no... |
57db6050-3c61-4084-844b-ac0686035edc | 8 | private void saveExperiment() {
int returnVal = m_FileChooser.showSaveDialog(this);
if (returnVal != JFileChooser.APPROVE_OPTION) {
return;
}
File expFile = m_FileChooser.getSelectedFile();
// add extension if necessary
if (m_FileChooser.getFileFilter() == m_ExpFilter) {
if (!e... |
9c6cbabd-f9cb-4761-a964-cf455bcaf56e | 5 | public void mousePressed(MouseEvent event) {
double x = event.getX() + cam.getX();
double y = event.getY() + cam.getY();
int xPos = (int) (x / Cell.CELL_WIDTH);
int yPos = (int) (y / Cell.CELL_HEIGHT);
if (xPos > 0 && xPos < theMap.getHeight() && yPos > 0 && yPos < theMap.getWidth()&&theMap.getCrayons()>... |
66b54c02-234b-4ea5-a997-81be90c23f0e | 6 | public static void main(String[] args) throws Exception {
String cmd = args[0].intern();
if (cmd == "render") {
PosixArgs opt = PosixArgs.getopt(args, 1, "aw:f:s:");
boolean aa = false;
String font = "SansSerif";
int width = 100, size = 10;
for... |
fc8a1e0d-8758-47a8-8657-a34f91664e93 | 6 | @Override
public void run() {
Socket sock;
while(running){//tcp listener main loop
try {
sock = servSock.accept();
System.out.println("client has connected");
addClientToList(sock);
} catch (Exception e) {
if(!(e instanceof InterruptedException)){
e.printStackTrace();
... |
7764599e-34a6-4dfe-ac01-8f3280ebcf1a | 4 | private static UUID getCachedUUID(String playerName) {
// Already found
if (cachedUUIDs.containsKey(playerName))
return cachedUUIDs.get(playerName);
// Search for lowercase matches
for (final String loggedName : cachedUUIDs.keySet()) {
if (loggedName.equalsIgnoreCase(playerName)) {
... |
5929dc2a-c842-4692-a053-b3c286964829 | 8 | private int clear() {
int lines = 0;
for (int j = 0; j < height; j++) {
// Assume full row
boolean full = true;
for (int i = 0; i < width; i++) {
if (getBlock(i, j) == null) {
full = false;
break;
}
}
// Continue to next row if not full
if (!full) {
continue;
}
line... |
9a522694-e890-4403-9bbc-2ec32a951c77 | 4 | @Override
public void run() {
// System.out.println("InputNode: " + this.inputNode.getName() + " File: " + this.inputNode.getFile());
this.sender = new SocketSender( this.inputNode.getSingleNext().getSocketPort() );
Thread t1 = new Thread(this.listener);
t1.start();
Thread t2 = new Thread(this.sender);
t2.... |
4617aa77-4c48-4168-97d9-a87370f98e9b | 0 | public boolean toDelete(){
return this.markedForDelete;
} |
df281bbd-7ec7-4dfa-bb2e-df1767097d51 | 5 | private HashMap<String, Integer> computeLocalVarOffset(VariableTable localVarTable) {
HashMap<String, Integer> addr = new HashMap<String, Integer>();
int offset = (allocator.getRegNumber() + 2) * 4; // useless, just to
// make
// code logic simple
int maxReg = 0;
for (int reg : regMap.values())... |
1513adce-e39f-41e1-b20e-039b6c80461e | 1 | public void addPlayer(Player player) {
if (player == null) throw new IllegalArgumentException("Cannot add a null valued player");
players.add(player);
} |
7b2a7ffb-aee8-4786-96b2-9b907bd1f4e6 | 7 | @Override
public int hashCode() {
int result = solPosId;
result = 31 * result + (solTipoSolicitud != null ? solTipoSolicitud.hashCode() : 0);
result = 31 * result + (solEstado != null ? solEstado.hashCode() : 0);
result = 31 * result + (solFechaHora != null ? solFechaHora.hashCode() ... |
77ee3113-c91f-4774-b075-8684263dfa96 | 7 | private boolean r_Step_1c() {
int v_1;
int v_2;
// (, line 93
// [, line 94
ket = cursor;
// or, line 94
lab0: do {
v_1 = limit - cursor;
lab1: do {... |
42f544e3-efdd-4bbb-a147-90a0699945c7 | 9 | @Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof Prefix)) {
return false;
}
Prefix other = (Prefix) obj;
if (label == null) {
if (other.label != null) {
return false;
}
} else if (!label.equal... |
714a5792-a8e1-4717-85c0-eec234b471e2 | 5 | public void startGame(Map map) {
if (map.getMap() != null)
this.map = map.getMap();
if (map.getCollisionMap() != null)
this.collisionMap = map.getCollisionMap();
for (int x = 0; x <= collisionMap.getWidth() - 1; x++) {
for (int y = 0; y <= collisionMap.getHeight() - 1; y++) {
if (collisionMap.getRGB(... |
dd394a50-4c3c-444c-8e58-a8ffa2c75ce2 | 3 | public static void addConnectedClient(String btName, String btAddress)
{
boolean wasAdded = false;
for(int i = 0;i<=5;i++)
{
if(wasAdded == false)
{
if(clientsTable.getModel().getValueAt(i, 0).equals(null))
{
clientsTable.getModel().setValueAt(btName, i, 0);
clientsTable.getModel().set... |
b89a1509-5321-4e9f-b112-f0b541b3a3ed | 1 | public void testDividedBy_int() {
Days test = Days.days(12);
assertEquals(6, test.dividedBy(2).getDays());
assertEquals(12, test.getDays());
assertEquals(4, test.dividedBy(3).getDays());
assertEquals(3, test.dividedBy(4).getDays());
assertEquals(2, test.dividedBy(5).getDa... |
023c9929-0b7a-4561-b4ea-6869142e89bd | 7 | private void calculateCoefficients()
{
int N = pos1D.length;
a = new double[N];
b = new double[N];
c = new double[N];
d = new double[N];
if (N == 2) {
a[0] = pos1D[0];
b[0] = pos1D[1] - pos1D[0];
return;
}
double[] h = new double[N - 1];
for (int i = 0; i < N - 1; i++)
{
a[i] = p... |
ca1794b6-5c72-4cd9-9b71-1e7ce314af0a | 1 | public Object getValue(Object self) {
Object value = property.getValue(self);
if (value == null) {
return null;
}
return valueProperty.getValue(value);
} |
60937c9d-52ad-4b5e-b686-e2a7c3aabeb1 | 3 | public void setEqualizer(Equalizer eq)
{
if (eq==null)
eq = Equalizer.PASS_THRU_EQ;
equalizer.setFrom(eq);
float[] factors = equalizer.getBandFactors();
if (filter1!=null)
filter1.setEQ(factors);
if (filter2!=null)
filter2.setEQ(factors);
} |
6a61b0ff-5854-4a78-8b8b-b82306291f02 | 4 | public int hashCode(){
// EDebug.print("The Hash is that is hashed, is truly hashed");
int ret = 0;
for (Object o: states)
ret+= ((State) o).specialHash();
for (Object o:transitions)
ret+=((Transition) o).specialHash();
for (Object o: myNotes)
ret+=((Note) o).specialHash();
ret+=finalSta... |
da802500-27fe-451c-bcaa-fa3ab31ce478 | 0 | public Id3PictureType getId3PictureType() {
return this.pictureType;
} |
4423087e-dd4f-4025-94c3-52077969e81c | 8 | public int ladderLength(String start, String end, Set<String> dict) {
if (start.equals(end))
return 0;
Queue<String> queue = new LinkedList<String>();
queue.add(start);
int level = 0;
while (!queue.isEmpty()) {
int size = queue.size();
for (int i = 0; i < size; i++) {
String cur = queue.remove();... |
a0806c3c-01a5-4081-a638-b9ebaa173f32 | 2 | private void setPath(final String path) throws IOException {
if (path == null) {
throw new InvalidPathException(path, NULL_PATH);
}
this.path = path;
File file = new File(path);
if (!file.exists()) {
file.createNewFile();
}
} |
6812d9f3-a3f8-46bb-92da-c3aa41aac05a | 5 | public void transition(){
if(currentNode == null)
currentNode = Head;
PriorityQueue<Node> mytemp;
Node tempNode;
int projectedGoodness;
mytemp = currentNode.makeChildren();
while(mytemp.peek() != null){
tempNode = mytemp.poll();
projectedGoodness = tempNode.getGoodness();
projectedGoodness = proje... |
dda45c1d-947a-4f90-9355-956f3013dd93 | 9 | public static void main(String[] args) {
list = new ArrayList<>(Arrays.asList(1, 2, 3, 4, 5, 6));
list2 = Collections.unmodifiableList(list);
new Thread(new Runnable() {
@Override
public void run() {
for (int i=0; i<list.size(); i++) {
... |
52bbc49f-57d0-4ea9-96ba-eb6d5ff2a4f8 | 1 | private void updatedownload(Download download) {
int gid = download.gid;
if (downloads.containsKey(gid)) {
downloads.put(gid, download);
} else {
addToList(download);
}
} |
7dde9121-afb4-4147-9889-9737cc157228 | 9 | private static boolean messWith(Record record) {
boolean found = false;
boolean foundSound = false;
boolean foundSilent = false;
boolean foundBSD = false;
for (VariableField field : record.getVariableFields()) {
String s = field.toString();
DataField data... |
68358d51-64a2-42df-b2bc-00a0858b7679 | 4 | public ArrayList<Integer> generateKingDestinations( int position ) {
ArrayList<Integer> destinations = new ArrayList<Integer>();
if ( canCastleKingSide( position ) ) {
destinations.add( position + 2 );
}
if ( canCastleQueenSide( position ) ) {
destinations.add( position - 2 );
}
fo... |
33981b7d-e95a-4cb5-9e41-e82e308caf44 | 1 | public void init(final Properties azotProperties) {
if(azotProperties != null) {
VERBOSE = toBoolean(azotProperties, "azot-verbose", false);
DEBUG = toBoolean(azotProperties, "azot-debug", false);
INTERACTIVE = toBoolean(azotProperties, "azot-interactive", false);
DUMP = toBoolean(azotProperties, "azot-du... |
422330ed-c03f-45f8-9c8d-c783fa387f11 | 3 | @Override
public void actionPerformed(ActionEvent e) {
OutlinerDocument doc = (OutlinerDocument) Outliner.documents.getMostRecentDocumentTouched();
OutlinerCellRendererImpl textArea = doc.panel.layout.getUIComponent(doc.tree.getEditingNode());
if (textArea == null) {
return;
}
Node node = textArea.n... |
3f521ae5-93ef-42fd-96f9-249f07c9b5df | 2 | public static String addUser(Channel channel, Client client, boolean self) {
PacketBuilder buffer = new PacketBuilder(SendOpcode.ADD_USER.getValue());
buffer.writeByte(0x00);
buffer.writeString(channel.getName());
buffer.writeByte(0x00);
buffer.writeString(client.getName());
buffer.writeByte(0x00);
buffe... |
9d1fcf83-5b16-40e7-bdd6-64f72c9ff167 | 2 | private URL buildSearchString(String searchString)
{
URL result = null;
try
{
searchString = URLEncoder.encode(searchString, CHARSET).replaceAll("[ \t\n\f\r]", "+");
String url = URL + URL_ARG_SEARCH + searchString + URL_ARGS + URL_ARG_AUTH;
_logger.debug(url);
result = new URL(url);
}
catch (Uns... |
c4f476fe-b06a-4efe-8e2f-0c48c3931745 | 2 | @Test
public void testTimeStep_MONTHLY_MEAN_subdivide() throws Exception {
printDebug("----------------------------");
printDebug("Monthly Mean with subdivide: " + this.toString());
printDebug("----------------------------");
// Data
CSTable t = DataIO.table(r, "obs");
... |
d4a325f5-410a-49c7-8fc5-1c7b0bf9c2a8 | 3 | public void process(Client sockector){
ConcurrentLinkedQueue<HashMap<String,String>> msgs = sockector.getBizObjects();
if(msgs.isEmpty()){
return;
}
HashMap<String,String> msg = msgs.poll();
while(msg != null){
msg.put(Constants.FILED_IP, sockector.getIp());
Response rm = ClustersService.getInstan... |
b31a2719-0387-465e-aac9-02da9857a1c8 | 8 | static private ImageAccess merge(ImageAccess in, int type1, int type2, int length) {
int nx = in.getWidth();
int ny = in.getHeight();
ImageAccess out = new ImageAccess(nx, ny);
ComplexWaveFilter wf = new ComplexWaveFilter(length);
if (nx >= 1 ) {
double rowin[] = new double[nx];
double rowout[] = ne... |
0a3fdbe7-4232-4576-907a-132f8322ac9f | 3 | public static void downloadFile(File file, String urlString) throws MalformedURLException, IOException
{
BufferedInputStream in = null;
FileOutputStream fout = null;
try
{
URLConnection connection = new URL(urlString).openConnection();
in = new BufferedInputStream(connection.getInput... |
72e47283-7f3f-4aed-b38e-9816d0ef0c63 | 1 | public static void main(String[] args) {
try {
studyDatasetBaseLyon();
} catch (Exception ex) {
Logger.getLogger(EntryPoint.class.getName()).log(Level.SEVERE, null, ex);
}
} |
7f2d1ff6-bb8d-482b-94bc-9cee1243b731 | 0 | private void increCapa(){
int newsize = element.length * 2;
element = Arrays.copyOf(element, newsize);
} |
2fde2454-b98c-49b8-81c1-fe6a6d796ce1 | 0 | public void setMcEcho_ActiveChannels(String[] set){ McEcho_ActiveChannels = Arrays.asList(set); } |
8bb5d544-6c36-48b4-ad99-0358c989948a | 9 | public static Mode forBits(int bits) {
switch (bits) {
case 0x0:
return TERMINATOR;
case 0x1:
return NUMERIC;
case 0x2:
return ALPHANUMERIC;
case 0x3:
return STRUCTURED_APPEND;
case 0x4:
return BYTE;
case 0x5:
return FNC1_FIRST_POSI... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.