method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
d5e1e3e8-f032-4c4a-80ae-cdd5c4725daa | 0 | public void removePropertyChangeListener(PropertyChangeListener listener) {
propertyChangeSupport.removePropertyChangeListener(listener);
} |
f3faef4a-82a9-43aa-81da-a82bd7202eda | 6 | public <T> T findSimpleRefResult(String sql, List<Object> params,
Class<T> cls) throws Exception {
T resultObject = null;
int index = 1;
pstmt = connection.prepareStatement(sql);
if (params != null && !params.isEmpty()) {
for (int i = 0; i < params.size(); i++) {
pstmt.setObject(index++, params.get(i)... |
95c76037-9db6-48bc-8e02-f609f5abe21e | 5 | private void buildEdges() {
mEdges.clear();
System.out.println("BuildEdges...");
if (mPaths == null) {
return;
}
ListIterator li = mPaths.listIterator();
while (li.hasNext()) {
RoutePath rp = (RoutePath) li.next();
String color = rp.getColor();
ListIterator ti = rp.getPath().listIterator()... |
9f6d9845-5f40-4153-844d-ef08951e61b0 | 1 | public void testFactory_FromDateFields() throws Exception {
GregorianCalendar cal = new GregorianCalendar(1970, 1, 3, 4, 5, 6);
cal.set(Calendar.MILLISECOND, 7);
YearMonth expected = new YearMonth(1970, 2);
assertEquals(expected, YearMonth.fromDateFields(cal.getTime()));
try {
... |
71b02643-5b78-446f-9b07-a1b0863d8beb | 1 | public static void insertCouleur(String libelle) throws SQLException {
String query = "";
try {
query = "INSERT INTO COULEUR(COULIBELLE) VALUES(?);";
PreparedStatement pStatement = ConnectionBDD.getInstance().getPreparedStatement(query);
pStatement.setString(1, libel... |
4c7827fe-3741-4812-a65c-2762fc8a0f6f | 9 | public void testMow2() {
LawnService service = new LawnService();
URL resourceURL = getClass().getResource("/test2.txt");
try {
File testFile = new File(resourceURL.toURI());
LawnEntity lawn = service.mow(new TextFileLawnInformationVO(testFile.getPath()));
assertNotNull(lawn);
for (LawnMowerEntity mow... |
943b95fe-c671-4859-a3f9-b90680f9d243 | 3 | public int GetMove(int Place1,int Place2){ // Thanks to diablo for this! Fixed my npc follow code <3
if ((Place1 - Place2) == 0)
return 0;
else if ((Place1 - Place2) < 0)
return 1;
else if ((Place1 - Place2) > 0)
return -1;
return 0;
} |
71bf09ff-b18b-412a-b4fb-d925267b2a7e | 8 | public boolean checkCell(int dir, int[][] gameBoard){
try {
if (dir == 0)
return ((!isTunnel(this.x, this.y-1)) && (gameBoard[this.x][this.y-1] != 0));
else if (dir == 1)
return ((!isTunnel(this.x-1, this.y)) && (gameBoard[this.x-1][this.y] != 0));
else if (dir == 2)
return ((!isTunnel(this.x, this.y+1... |
b291313f-475f-434a-95b2-958d1684ad6f | 3 | private String CombinedToPN(String recieved)
{
// split the recieved code into 2 parts
String[] recieveds = new String[] {
recieved.substring(0, 7),
recieved.substring(7, 14),
recieved.substring(14, 21),
recieved.substring(21, 28)
};
// decode each part and join them to get the result byte
... |
a8ac1da8-1737-4bbf-98ce-f771ea7d4eee | 6 | public static void clusterByHistogram(Path baseDir, Path inputDir){
deleteAllJPEGFiles(baseDir);
deleteAllJPEGFiles(inputDir);
File[] baseFileList = baseDir.toFile().listFiles();
List<Mat> baseHistList = new ArrayList<>();
for(File baseImage : baseFileList) {
Mat baseHist = generatHist(baseDir, ba... |
e74fbab9-049b-4b30-bd0b-d0a798a94946 | 1 | public String generateCode(int length, int maxInt){
StringBuffer sb = new StringBuffer();
for (int i = 0; i < length; ++ i) {
sb.append(random.nextInt(maxInt+1));
}
return sb.toString();
} |
70626a89-7761-47e2-b434-993ddf891dbf | 6 | @Override
public void setValueAt(Object aValue, int rowIndex, int columnIndex){
itemModelo item= items.get(rowIndex);
if (aValue == null) {
this.setValueAt(0, rowIndex, columnIndex);
return;
}
String value = aValue.toString();
switch(columnIndex){
... |
9e12c8fd-1789-42ad-acf1-08bcc693b4d0 | 5 | public JSONObject extractCollectionColorsColors(Color[] colors, float[] weights, int limit, String colorFormat)
throws TinEyeServiceException
{
MultipartEntity postEntity = new MultipartEntity();
JSONObject responseJSON = null;
if (weights.length > 0 && colors.length != weights.leng... |
c1a2236c-6167-4d6e-a88a-d68bf223f915 | 3 | public String actualizarEstudiante(String nombre, String sexo, String programa) {
//<editor-fold defaultstate="collapsed" desc="actualizarEstudiante">
if (!nombre.isEmpty() && !sexo.equals(" ") && !programa.equals(" ")) {
estudianteSeleccionado.setNombre(nombre);
est... |
957ad05c-e059-4203-948e-8890b9af4132 | 7 | public void readTxtDiensttypen(String path) {
DBConnection dbc=DBConnection.getInstance();
// testumlauf.txt Data has to be in the project file in your
// workspace
File file = new File(path);
try {
BufferedReader diensttypen = new BufferedReader(new FileReader(file));
filename = file.... |
f93e6386-1fdf-497a-aef0-b91c66d09212 | 1 | public void addEdge(final GraphNode src, final GraphNode dst) {
if (FlowGraph.DEBUG) {
System.out.println(" ADDING EDGE " + src + " -> " + dst);
}
super.addEdge(src, dst);
} |
5802912e-b04a-494a-9a58-79977312cf94 | 2 | @Override
public Collection<?> getQuestions() {
// TODO Auto-generated method stub
for (int i = 0; i < 10; i++) {
lst.add(new Questions());
}
Collections.sort(lst);
return lst;
} |
b86b6ede-a5a5-4645-b7d3-a4ec0247a102 | 3 | @Override
public void run() {
ServerLogger
.info(RemoteResourcesServer.class,
RemoteResourcesLocalization
.getMessage(
RemoteResourcesMessages.RemoteResourcesServer_Info_StartingServer,
controlServerSocket.getInetAddress()
+ ":"
+ controlServerSocket
... |
e129eeed-43d1-4b7c-a279-1b0998f7da94 | 9 | public static AHCGraph getGraphFromCSVFile(String path){
AHCGraph graph = null;
BufferedReader br = null;
String line = "";
String cvsSplitBy = ",";
double max = -1000;
try {
br = new BufferedReader(new FileReader(path));
int rowNum = 0;
boolean isFirst = true;
while ((line = br.readLine()) !... |
d6e6e16f-07bf-4f60-99d0-a9ffa182dcfe | 6 | @Override
public void actionPerformed(ActionEvent e) {
if(e.getSource() == gestaoDestinosView.getjButtonSair()) {
sairButton();
} else if(e.getSource() == gestaoDestinosView.getjButtonVoltar()) {
voltarButton();
} else if(e.getSource() == ges... |
af80ddf6-238e-4e64-9aa9-ffc45cdab228 | 6 | public void handlePackReply(PackReplyOldBetHop message) {
// o sink nao deve manipular pacotes do tipo Relay
if(this.ID == message.getSinkID()){
return;
}
// o border e fonte nao devem manipular pacotes do tipo Relay
// necessaria verificacao de que o no ja recebeu menssagem
// de um determinad... |
ffbbc5e6-5e8b-4e1d-889d-f71522a2efbd | 9 | public PRectangle getPageBoundary(final int specifiedBox) {
PRectangle userSpecifiedBox = null;
// required property
if (specifiedBox == BOUNDARY_MEDIABOX) {
userSpecifiedBox = (PRectangle) getMediaBox();
}
// required property
else if (specifiedBox == BOUNDAR... |
c3836017-77dd-4fb2-8aae-5282285498c8 | 1 | private void complete() throws IOException {
this.storedCombinedCRC = bsGetInt();
this.currentState = EOF;
this.data = null;
if (this.storedCombinedCRC != this.computedCombinedCRC) {
throw new IOException("BZip2 CRC error");
}
} |
e398ab35-94b4-478e-90f3-5c4cb9fc4e30 | 0 | String readLabel() {
return label;
} |
fd6675d9-5ce4-4d6c-92e2-996cec5b31e3 | 4 | private boolean checkRules()
{
boolean cont = false;
int i=0;
for(Rule r: ARKS.Rules)
{
if(!r.done() && r.ruleFires(wm))
{
Conditional f = r.fireRule();
if(!wm.contains(f))
{
wm.add(f);
... |
889718ff-cb0f-4b87-b4fe-fe8c8b31d57d | 5 | public void drawDataPane() {
String[] names = { "instance.currentId:", "instance.selectedId:", "selectedX:", "selectedY:", "locked:", "hoverId:" };
Object[] values = { Main.currentId, Main.selectedId, Main.getSelectedX(), Main.getSelectedY(), Main.getSelected() != null ? Main.getSelected().locked : false, Main.hove... |
66370d4d-7c4e-42de-b5ab-bfaf5c07db67 | 6 | @Override
public String toString() {
StringBuilder sb = new StringBuilder("User(");
boolean first = true;
sb.append("firstName:");
if (this.firstName == null) {
sb.append("null");
} else {
sb.append(this.firstName);
}
first = false;
if (!first) sb.append(", ");
sb.appe... |
bca3ebb4-a4ef-41b6-a059-ab7b22e7460e | 3 | public int[] getPixelArray(int arraynumber, int arraysize)
{
Map<Integer, intArray> map = intarrays.get();
if (null == map) {
map = new HashMap<Integer, PDFVisualiseDifference.intArray>(3);
intarrays.set(map);
}
if(!map.containsKey(arraynumber))
map.put(arraynumber, new intArra... |
dffd0394-b194-467a-bd40-2a64338509b7 | 4 | private void showContextMenu(int selectedRow, TreePath selectedPath, MouseEvent e) {
m_lastSelectedTreeNode = (DefaultMutableTreeNode) selectedPath.getLastPathComponent();
if (!m_lastSelectedTreeNode.isRoot())
m_lastParentSelectedTreeNode = (DefaultMutableTreeNode) selectedPath.getParentPath().getLastPathCompone... |
d433e8ff-97ce-44b7-acea-4432df442a62 | 2 | public void addSetMethod(Field field, Method method) {
if(field == null) {
throw new IllegalArgumentException("Field cannot be null");
}
FieldStoreItem item = store.get(FieldStoreItem.createKey(field));
if(item != null) {
item.setSetMethod(method);
} else ... |
b430839c-8aa6-4b85-9f3d-f33534e5bce0 | 4 | private void btnRemoverActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnRemoverActionPerformed
Cliente tmp = null;
try{
tmp = dao.Abrir(this.idDoClienteSelecionado);
}catch(Exception ex){
JOptionPane.showMessageDialog(rootPane, ex.getMessa... |
f3924358-c449-4496-9f7f-7eb3bd3714be | 9 | public Item checkBlocking(String direction) {
Item blocking = null;
if (direction.equalsIgnoreCase("e")){
direction = "east";
} else if (direction.equalsIgnoreCase("w")){
direction = "west";
}else if (direction.equalsIgnoreCase("n")){
direction = "north";
}else if (direction.equalsIgnoreCase("s"))... |
6aa2d5c4-c225-4879-8987-ab17d66f67b1 | 1 | public void copyAttributes(Element fromElement, Element toElement) {
NamedNodeMap attributes = fromElement.getAttributes();
for(int i=0; i<attributes.getLength(); i++) {
Node item = attributes.item(i);
toElement.setAttribute(item.getNodeName(), item.getNodeValue());
}
... |
32344dbc-2a14-419c-8b28-26a80baea33c | 3 | public Integer Get_Maxwordid(){
Integer MaxwordId = new Integer(1);
Integer size = new Integer(Get_edgesetSize());
Iterator<SparseMatrix> it = t_edgeset.iterator();
while(it.hasNext()){
SparseMatrix current = it.next();
int currentw1 = current.getwordid1();
int currentw2 = current.getwordid2();
if (... |
0d30bd6e-481d-40c5-ac1f-c37b7fc842fc | 2 | protected void fillPanelFields(boolean sourceField) {
String selectedDir = openDirDialog();
if (selectedDir != null) {
if (sourceField) {
setSourceDir(selectedDir);
obfuscator.getFileFromSourceDir();
List<File> fileList = obfuscator.getProjectFiles();
projectPanel.repaintFileList(fileList);
} ... |
807e1532-a115-4368-a55b-be5559236cee | 8 | public boolean getNextState()
{
boolean S;
try
{
S = getInputWires().get(0).getValue();
} catch (Exception e)
{
System.out
.println("Error, S of the flip flop failed to calculate its value. Please check its connections");
S = false;
}
boolean R;
try
{
R = getInputWires().get(1).getV... |
77b5832b-ae0c-4193-bd85-afa3e7bcbddd | 9 | public String getCategoryLabel(CategoryEnum categoryEnum) {
switch (categoryEnum) {
case soup:
return CategoryEnum.soup.name();
case chicken:
return CategoryEnum.chicken.name();
case dessert:
return CategoryEnum.dessert.name();... |
85a7f8be-4224-4b6f-a71b-6acc8a5028d0 | 4 | private int getNextValidNumber(int[][] game, int x, int y, List<Integer> listOfNumbers) {
while (listOfNumbers.size() > 0) {
//remove the first element from the list and assign to variable
int num = listOfNumbers.remove(0);
//check if num exists in row, column, a... |
ffa300f7-62e4-4a72-ad39-02f52f834b0b | 9 | public boolean skipPast(String to) throws JSONException {
boolean b;
char c;
int i;
int j;
int offset = 0;
int length = to.length();
char[] circle = new char[length];
/*
* First fill the circle buffer with as many characters as are in the... |
327136d8-730c-485c-91f8-e9944960e415 | 6 | private void createBall(int x, int y)
{
//Schnitt mit Linien pruefen
for(int i=0; i<Lines.size(); i++)
{
float d = (float) Line2D.ptSegDist(Lines.elementAt(i)[0], Lines.elementAt(i)[1], Lines.elementAt(i)[2], Lines.elementAt(i)[3], x, y);
if(d < radius){return;}
}
//Schnitt mit anderen Baellen pruefen... |
05413115-5035-4a3f-b484-ce45d9fcc85a | 4 | public void visitRetStmt(final RetStmt stmt) {
final Iterator paths = stmt.sub().paths().iterator();
while (paths.hasNext()) {
final Block[] path = (Block[]) paths.next();
if (FlowGraph.DEBUG) {
System.out.println(" path = " + path[0] + " " + path[1]);
}
if (path[1] == oldDst) {
if (FlowGrap... |
4b4a3258-ff0c-4c7c-adbe-f3ab58261636 | 9 | int check(Matcher matcher, int i, CharSequence seq) {
int ch;
boolean left = false;
int startIndex = matcher.from;
int endIndex = matcher.to;
if (matcher.transparentBounds) {
startIndex = 0;
endIndex = matcher.getTextLength();
... |
6d6c8856-df41-47d7-9a4f-1ae42c57253d | 0 | public void setBiomeID(int x,int z,byte BiomeID){
biomeID[x][z] = BiomeID;
} |
b2549d58-a96c-45b2-9619-970e4e5890d8 | 0 | public String getPort() {
return port;
} |
e8fa5acf-5e43-4c3c-8961-8f3c7d3fd99b | 8 | public void method545(Stream buffer, Class29 class29) {
int i = buffer.getUnsignedByte();
anIntArray665[0] = i >> 4;
anIntArray665[1] = i & 0xf;
if (i != 0) {
anIntArray668[0] = buffer.getUnsignedShort();
anIntArray668[1] = buffer.getUnsignedShort();
int j = buffer.getUnsignedByte();
for (int k = 0;... |
4ff54d79-e372-4b38-8e77-27937517e8d7 | 7 | public Java2dCanvas(StyleConfig config, int width, int height) {
// 计算画布尺寸
int h;
int w;
if (config.getIsFixSize()) {
w = config.getCanvasWidth();
h = config.getCanvasHeight();
} else {
w = width;
h = height;
}
boolean isUseTranslucent = false;
if (config.getBackgroundColor() == null
&& ... |
d5f7f6bd-08c5-487b-8c39-15230f338b06 | 7 | public String getRawHeaders(String hostname) throws IOException {
String output = "";
Socket socket = null;
PrintWriter writer = null;
BufferedReader reader = null;
try {
socket = new Socket(hostname, PORT);
socket.setSoTimeout(2000);
socket.s... |
f20a896a-f8a5-4741-b229-151de9a8860d | 5 | @Override
public String getColumnName(int col) {
if (col == 0) {
return "Document";
} else if (col == 1) {
return "Line";
} else if (col == 2) {
return "Col.";
} else if (col == 3) {
return "Match";
} else if (col == 4) {
return "Replacement";
} else {
return "";
}
} |
735b6b0b-00ce-4922-ad44-047cd72e5920 | 6 | @Override
public String getColumnName(int columnIndex) {
switch (COLUMNS.values()[columnIndex]) {
case ID:
return java.util.ResourceBundle.getBundle("cz/muni/fi/pv168/autorental/gui/Bundle").getString("rents_table_id");
case CUSTOMER:
return java.util.ResourceBundle.getBundle("cz/muni/fi/pv168/autore... |
b5538dcf-2323-4c46-a4fe-fcd04d46fbac | 2 | public void addSeance(Seance seance) {
if (seance == null) {
throw new NullObjectInsertionException();
}
if (existSeance(seance)) {
throw new DuplicateInsertionException("this seance already added to sinema. Cannot be added second time.");
}
seances.add(seance);
} |
549a3325-d217-4063-b75e-b0aa37c11e82 | 4 | private void setupSlideButtons(int width,int height) {
//set up buttons
//previous button
BufferedImage previousSlideImage;
try{
if(collection.get(0).getTitle().equals("Sunward : The Inner System")){
previousSlideImage = ImageIO.read(new File("resources/buttons2/Previous.png"));
}
else
{
pre... |
7ae4ec29-569a-402f-bf0f-9c199375a622 | 0 | public State createState(Point point) {
return createTMState(point);
} |
16ca1253-f3b9-40e1-9310-eae7a2e703f1 | 2 | public boolean recallWord(Word w){
if (w == null) {
return false;
}
else if (useProbMem) {
// Probabilistically look up the word
return probMemRecallRate(w.getScore(time)) > rand.nextDouble();
}
else {
// Return just whether the word has a positive score
return w.getScore(time) > 0;
}
} |
bdb4c473-8752-46db-b19e-69340b47d4f7 | 0 | public List<T> findRange(int[] range) {
javax.persistence.criteria.CriteriaQuery cq = getEntityManager().getCriteriaBuilder().createQuery();
cq.select(cq.from(entityClass));
javax.persistence.Query q = getEntityManager().createQuery(cq);
q.setMaxResults(range[1] - range[0] + 1);
... |
47c66415-8380-457a-b409-fa0edf20e921 | 0 | public static void addUserIfNotExist(String uid) {
UserStorageAccess usa = new UserStorageAccess();
usa.addUserIfNotExist(uid);
} |
d89e6df7-8359-4a9b-a441-0d8b4b7ed67d | 5 | @Test
public void testSetSocketTimeoutCount() {
LOGGER.log(Level.INFO, "----- STARTING TEST testSetSocketTimeoutCount -----");
String client_hash = "";
String client_hash2 = "";
String client_hash3 = "";
try {
client_hash = server2.addSocket("127.0.0.1", port);
... |
7f4be747-3509-4066-8ab8-eb0bfe13c317 | 5 | public int lengthOfLongestSubstring(String s) {
if (s == null || s.equals(""))
return 0;
if (s.length() == 1)
return 1;
int[] flag = new int[256];//store the last position of char(index) showing up
Arrays.fill(flag, -1);
flag[s.charAt(0)] = 0;
int res = 0;
int start = 0;
for (int i = 1; i < s.leng... |
5f4c8974-2f6b-402e-81d1-74269c1e4897 | 0 | public static int defaultSCLangOSCPort() {
return DEFAULT_SC_LANG_OSC_PORT;
} |
88b3727e-3dfb-454e-bd0b-ba3707cc54eb | 3 | public String[] returnTaxedBill(String[] sItemList)
{
// Retrun Array contains result for UnitTest
String[] sRetArr = new String[sItemList.length+2];
fTaxSum = 0; fPriceSum = 0;
int i;
for(i=0;i<sItemList.length;i++)
{
String sItem= sItemList[i];
float dPrice ... |
aa06f1da-a889-4b98-ba15-e612ff9db75d | 8 | public void keyReleased(KeyEvent e){
if(e.getKeyCode() == KeyEvent.VK_LEFT){
key[0] = false;
}
else if(e.getKeyCode() == KeyEvent.VK_RIGHT){
key[1] = false;
}
else if(e.getKeyCode() == KeyEvent.VK_UP){
key[2] = false;
}
else if(e.getKeyCode() == KeyEvent.VK_DOWN){
key[3] = false;
... |
05c1e562-2baf-4c6f-af19-1b81c6cd094e | 8 | public void func_71909_a(World par1World, int par2, int par3, int par4, int par5, float par6, float par7, float par8)
{
byte byte0 = 0;
if (par5 == 2 && par1World.isBlockNormalCubeDefault(par2, par3, par4 + 1, true))
{
byte0 = 2;
}
if (par5 == 3 && par1World.isB... |
c0b5ac8d-7c02-4e15-8819-e826e2b73d1e | 5 | @Override
public void run () {
tiempoActual = System.currentTimeMillis();
while (vidas > 0) {
if (sonidillo) {
if (!fondoM.getLooping()) {
fondoM.setLooping(true);
fondoM.play();
}
... |
107a28ba-7749-4036-af81-59924c3d4b86 | 3 | private static void showMenu(BufferedReader br, ServiceInterface obj,
Scanner cs) throws IOException{
// TODO Auto-generated method stub
System.out.println("1 Register");
System.out.println("2 Login");
System.out.println("0 Exit");
int val = cs.nextInt();
if(val ==0)
System.exit(0);
else if(val ... |
881fba3a-d7eb-496b-b2ea-77a394d4b042 | 5 | private void moveAsFirstChild() {
JoeTree tree = targetNode.getTree();
CompoundUndoableMove undoable = new CompoundUndoableMove(tree.getSelectedNodesParent(),targetNode);
int currentIndexAdj = 0;
for (int i = tree.getSelectedNodes().size() - 1; i >= 0; i--) {
Node nodeToMove = tree.getSelectedNodes().get... |
13af2a55-d552-4708-8aaf-cabcd8e677ae | 8 | public String toString() {
if (m_Classifiers == null) {
return "Vote: No model built yet.";
}
String result = "Vote combines";
result += " the probability distributions of these base learners:\n";
for (int i = 0; i < m_Classifiers.length; i++) {
result += '\t' + getClassifierSpec(i) + ... |
a1b48b98-54e0-4ee7-9890-a0ca02328332 | 0 | public void setNombreHospital(String nombreHospital) {
this.nombreHospital = nombreHospital;
} |
e8aa49d1-95fb-4b80-bd03-4e29bd9a79c0 | 5 | public List<Availability> readCRMAvailabilitiesCSV(File csvFile) {
BufferedReader br = null;
String line = "";
List<Availability> availabilities = new ArrayList<Availability>();
try {
br = new BufferedReader(new FileReader(csvFile));
while ((line = br.readLine()) != null) {
// use comma as separ... |
26594a17-26e4-4d82-867f-eb81fa1d1429 | 5 | @Override
public boolean execute(WorldChannels plugin, CommandSender sender,
Command command, String label, String[] args) {
final Map<Flag, String> info = new EnumMap<Flag, String>(Flag.class);
info.put(Flag.TAG, WorldChannels.TAG);
if(!(sender instanceof Player)) {
... |
74b44f18-83e7-4fed-9dd7-685d8975453e | 7 | private void DFS(ArrayList<Boolean> initialState,
HashMap<Integer, Boolean> explored, ArrayList<String> resultArr,
ArrayList<String> stateNames)
{
int currentStateNumber = CircuitHelpers.binaryToDecimal(initialState);
// Check if the state has already been explored or not
if (explored.containsKey(currentSt... |
7d2237ce-a21c-457f-955a-a943226375b0 | 5 | public void setPrices(int posState, int numSymbols, int[] prices, int st) {
int a0 = com.swemel.sevenzip.compression.rangecoder.Encoder.getPrice0(_choice[0]);
int a1 = com.swemel.sevenzip.compression.rangecoder.Encoder.getPrice1(_choice[0]);
int b0 = a1 + com.swemel.sevenzip.compress... |
354aa0a4-5453-43cc-b085-5ff617247c46 | 4 | private void checkReceived() {
OnDemandData onDemandData;
synchronized (aClass19_1370) {
onDemandData = (OnDemandData) aClass19_1370.popHead();
}
while (onDemandData != null) {
waiting = true;
byte abyte0[] = null;
if (clientInstance.caches[0] != null)
abyte0 = clientInstance.caches[onDemandData... |
86b8e993-a343-4e57-afa3-120be9b2bef8 | 8 | public void addSeries(float[] values,
int seriesNumber, Comparable seriesKey) {
invalidateRangeInfo();
int i;
if (values == null) {
throw new IllegalArgumentException("TimeSeriesDataset.addSeries(): "
+ "cannot add null array of values.");
... |
921f08be-1cca-4f2b-aba7-4f09642873ab | 3 | @Override
public void rotateZMinus() {
if(orientation == Z) return;
orientation = (orientation == X ? Y : X);
for(int i = 0; i < others.length; i++) {
IntPoint p = others[i];
others[i] = new IntPoint(p.getY(), -p.getX(), p.getZ());
}
} |
18e359a7-40f3-461a-8c35-f6c426cac1c4 | 9 | @Override
public void unpackToFolder(File file, File folder) {
try {
folder.mkdir();
int[] gzipHeader = { 0x00, 0x00, 0x00, 0x00, 0x1F, 0x8B };
FileInputStream fis = new FileInputStream(file);
FileOutputStream fosHeader = new FileOutputStream(new File(folder,"bootloader"));
FileOutputStream fosGZip = ... |
d2160c0d-1ba5-480c-bc1c-0d396c6eb75f | 8 | public boolean onCommand(CommandSender sender, Player player, String[] args) {
if (!(sender instanceof Player)) {
sender.sendMessage("You must be a player!");
return false;
}
if (player == null) {
sender.sendMessage("You may not do this on the server side!");
return false;
}
if (args[0] == n... |
750549ec-ae89-4234-86ad-32dbf1725a12 | 1 | public void init() {
try {
imageSrc = new URL(getCodeBase(), imageFileName);
} catch (MalformedURLException e) {
}
buildUI();
} |
45aba3ed-462b-49f0-bf22-dd6271b579f0 | 0 | @Test
public void removingNonLastVertex() {
l.addVertex(v);
l.addVertex(k);
l.removeVertex(0);
assertTrue(l.getNeighbours(0).min().equals(k));
} |
7b0f2dc9-b10b-4303-aacb-3a6226876cf4 | 6 | public static boolean finishDebugRun(FreeColClient freeColClient,
boolean force) {
if (getDebugRunTurns() < 0) return false; // Not a debug run
if (getDebugRunTurns() > 0 && !force) return false; // Still going
// Zero => signalEndDebugRun was called
... |
57f7cef3-d101-469a-a65a-4adad15c1356 | 4 | protected void paintComponent(Graphics g) {
super.paintComponent(g);
if(width!=this.getWidth() || height!=this.getHeight()) {
width = this.getWidth();
height = this.getHeight();
displayBuffer = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
dBufferG = displayBuffer.createGraphics();
}
... |
3495bd3c-870b-4ac7-8e29-19739307d476 | 1 | public static String em(int[] r) {
String m = "";
for (int x = 0; x < r.length; x++) {
m = m + Integer.toString(r[x]) + ":";
}
return m;
} |
bc4e76cd-648a-48a8-a6b7-67b6bed9f0bf | 4 | private static String escapeContent( String raw )
{
char[] chars = raw.toCharArray();
StringBuffer sb = new StringBuffer(
Math.round((float)chars.length * 1.15f) );
for ( int i=0;i<chars.length;i++ )
{
if ( chars[i] == '<' )
sb.append( "<" );
else if ( chars[i] == '>' )
sb.append( ">" )... |
6239a08d-cb8a-452e-8676-be1a4e7b7c15 | 2 | private void initInsideFences() {
for(int i = 0; i < 20; i++) {
Fence newFence = initRandFence();
if(!(grid[newFence.getX()][newFence.getY()] instanceof Fence)) {
grid[newFence.getX()][newFence.getY()] = newFence;
}
else i--;
}
} |
c0187b85-0503-4a53-896d-aa099870987a | 7 | private static int getNaturalIndex(char note) {
switch(note) {
case 'a': return 0;
case 'b': return 2;
case 'c': return 3;
case 'd': return 5;
case 'e': return 7;
case 'f': return 8;
case 'g': return 10;
}
return -1;
} |
f33f9f0f-73ff-420b-a08b-cb276a87c2dc | 0 | public TimerButtonPanel()
{
timeButton = new JButton(INIT_TEXT);
timeButton.setFocusable(false);
timeButton.setFont(DefaultUIProvider.getDisplayFont());
setLayout(new BorderLayout());
add(timeButton, BorderLayout.CENTER);
setBorder(DefaultUIProvider.getDefaultEmptyB... |
d5b0bf52-a155-42c8-b9a8-5c342f6b84ea | 0 | @Override
public String getHiveJdbc() {
return "jdbc:hive2://192.168.178.41:10000/default";
} |
a96d0d3d-6849-42c5-8ec2-cd72a2ef52f4 | 3 | public String obtenerEstadoInicial() {
String eInicial = "";
for (int i = 0; i < automata.size(); i++) {
String transicEstado = (String) automata.get(i);
if (transicEstado.contains("*") && !transicEstado.contains("**")) {
String[] partirTransicEstado = transicEst... |
6872616e-e900-407a-adf4-fd06006375a9 | 4 | public void convertString()
{
char[] charGenArray = generationString.toCharArray();
for (char c : charGenArray)
{
int tempInt = (int)c;
System.out.println("- Tempory Integer -");
System.out.println(tempInt);
... |
6a836a2c-2dff-48da-8e6a-b05dc4ad6be8 | 2 | public void noVfNoT(double vi, double Δx, double a){
this.vi = vi;
this.Δx = Δx;
this.a = a;
this.vf2 = Math.sqrt(Math.pow(vi, 2) + (2*a*Δx));
if(vf2 + vi == 0){
this.t2 = (vf2-vi)/a;
}
else{
this.t2 = (2*Δx) / (vf2 + vi);
}
... |
ed68bff6-9e53-40be-9565-97f7fd088c4c | 2 | public static void showHelpDocs() {
if (FileUtil.control(Constants.PROGRAM_DOCS_PATH)) {
try {
Desktop.getDesktop().open(Constants.PROGRAM_DOCS_PATH.toFile());
} catch (IOException e) {
LOGGER.error(e);
}
}
} |
30c68850-0e99-4e9d-9f0f-35c221f1a9e7 | 2 | private double nopeusToisestaPois(Pelihahmo h){
Pelihahmo toka;
if (h == h1){
toka = h2;
} else {
toka = h1;
}
if (onkoNopeusToisestaPois(h)){
return Math.cos(hahmojenValinenKulma(toka) - nopeudenSuunta(h))*kokonaisnopeus(h);
... |
b6961833-8153-4682-8578-fb35839a8218 | 1 | @Override
boolean offerStop()
{
if (getPoints() < 12)
return false;
System.out.println("You have " + getPoints() + " points");
System.out.println("Would you like to stop? (true/false)");
boolean choice = in.nextBoolean();
setStop(choice);
return choic... |
415e3a09-af05-438b-8efe-f5e9492d3aa8 | 9 | private void btn_aceptarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_aceptarActionPerformed
if (lab_modo.getText().equals("Alta")){
if (camposCompletos()){
ocultar_Msj();
insertar();
menuDisponible(true);
... |
be2bcb00-9c75-4ae9-9d01-b3da94bf8600 | 1 | private String login(String[] msgArr) {
String ans=null;
user.User user = forumSystem.login(msgArr[1], msgArr[2], msgArr[3]);
if(user!=null){
ans="SUCC_"+user.getUsername();
this.user=user;
}
else ans="ERR_LOGIN";
return ans;
} |
7190945b-e96d-4454-8b6f-7b2dc71b92df | 9 | public ActionUser() {
atm = new Core();
setResizable(false);
// Обработка события при открытии окна
addWindowListener(new WindowAdapter() {
@Override
public void windowOpened(WindowEvent arg0) {
panel.setVisible(false); // Скрываем панель
// Пытаемся подгрузить данные с файла
try ... |
75eba8a7-6b80-47d0-9086-0bc44a1daac9 | 1 | public SignatureVisitor visitParameterType() {
endFormals();
if (seenParameter) {
declaration.append(", ");
} else {
seenParameter = true;
declaration.append('(');
}
startType();
return this;
} |
365cddcc-7351-41cb-9375-4e37667a8525 | 4 | public int getIndexTo(){
int numOfOptions=_map.mygraph.getCurr();
if(numOfOptions==0){
JOptionPane.showMessageDialog(null,"There isn't any location on the map!",
"Choose the end point",JOptionPane.ERROR_MESSAGE,null);
return -1;
}
String[] options=new Str... |
15060a17-7979-4a29-a451-2aae5350b33e | 5 | public FontMetrics getFontMetrics(Font font)
{
if(font == null)
throw new NullPointerException("font param must not"
+ " be null");
if(font.equals(lastFont) && fontMetrics != null)
return fontMetrics;
lastFont = font;
lastStyledFont = new Font(font.getFamily(),
(bold ? Font.BOLD : 0)
| (italic ... |
a09fb5f7-c4e6-466a-b458-b6a7dd824c52 | 6 | private void loop() {
/* While client is active */
while (m_IsClientActive) {
try {
final Message message = readMessage();
if (message == null) {
m_IsClientActive = false;
... |
e70c10ec-6473-4e58-8ff1-349e2ec7e7c4 | 8 | public void create(Laptops laptops) throws PreexistingEntityException, RollbackFailureException, Exception {
if (laptops.getComputadoraCollection() == null) {
laptops.setComputadoraCollection(new ArrayList<Computadora>());
}
EntityManager em = null;
try {
em = get... |
518b01b9-b537-4468-b8a3-8d9b871ad9cb | 2 | public void run()
{
while(keepSaving)
{
int min =5*60*1000;
try {
checkState();
save();
Thread.sleep(min);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.