method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
0f59f6cc-e845-4576-b706-2344f3a9ca27 | 1 | public int[] getSelectedIndexes() {
int[] array = new int[getCount()];
int i = 0;
int index = firstSelectedIndex();
while (index != -1) {
array[i++] = index;
index = nextSelectedIndex(index + 1);
}
return array;
} |
f06d13d5-1daf-44cf-9d67-54ab7d910f26 | 9 | @Override
public String Imprimir_det_proceso(String iddgp, String idrp, String iddep) {
String cadena = "";
try {
this.conn = FactoryConnectionDB.open(FactoryConnectionDB.ORACLE);
String sql = "SELECT f.de_pasos, "
+ " f.nu_pasos ,s.es_autorizacion, rhfu... |
6cb5b3b1-d8c5-4437-b842-b13dc8540516 | 5 | private void psersistDimensions() throws IOException {
Set<Dimension> persistedDimensions = new HashSet<Dimension>();
Document dimensionXml = DocumentHelper.createDocument();
Element dimensionRoot = dimensionXml.addElement("dimensions");
Element dimensionElement;
Element levelEle... |
f91413a2-ab7a-422e-bcb5-86c7cd456f76 | 4 | public int removeElement(int[] A, int elem) {
// Note: The Solution object is instantiated only once and is reused by
// each test case.
int len = A.length;
int i = 0, j = 0;
for (; i < A.length; ++i, ++j) {
if (A[i] == elem) {
--j;
--len;
continue;
}
if (j >= 0 && A[i] != A[j]) {
A[j... |
9986666b-cc14-4520-b441-e4883c30dc4c | 9 | protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
String ubicacion = "";
InterfaceContratoDAO c = new Contr... |
b71e330b-eeb1-4fa2-893d-fcf05f906871 | 4 | public static boolean outsideAuburyShop() {
int x = Players.getLocal().getLocation().getX();
int y = Players.getLocal().getLocation().getY();
return x >= 3246 && y >= 3396 && x <= 3259 && y <= 3410 && !inAuburyShop();
} |
e163bd65-1736-45a2-a225-925412523b47 | 1 | public String getClassAlias(String className) {
ClassIdentifier classIdent = getClassIdentifier(className);
if (classIdent == null)
return className;
return classIdent.getFullAlias();
} |
33158060-f2b7-4987-8b7e-a4dc7ac3fa72 | 2 | public void deleteItemFromArticle(String id) {
Session session = HibernateUtil.getSessionFactory().openSession();
try {
session.beginTransaction().begin();
Article itemDelete = (Article) session.get(Article.class, id);
session.delete(itemDelete);
session.... |
b3aaceed-ced0-4c5d-9359-ebde5b71b297 | 9 | public static void index(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 wi... |
26ae460a-7c63-491f-a1d1-9b0456bacf41 | 4 | public int solution(int[] array) {
Map<Integer, Integer> map = new HashMap<Integer, Integer>();
for (int i : array) {
map.put(i, map.containsKey(i) ? map.get(i) + 1 : 1);
}
for (Entry<Integer, Integer> entry : map.entrySet()) {
if (entry.getValue() > array.length / 2) {
return entry.getKey();
}
... |
6b39f0f8-66cf-414b-ae76-4db4928108d9 | 1 | public long getWorldAge() {
if (world != null)
return world.getStepCount();
return 0;
} |
8ab5798d-158f-49c0-88f6-2d194178dcc9 | 0 | public FlyingAbility getFlyingAbility() {
return flyingAbility;
} |
c318f300-aa52-47b3-b7ce-2b2c5ba52e36 | 8 | private Client_Response angriff(SpielEreigniss Ereigniss) {
//***********wechsel der Phase????********************
if (Ereigniss.phasenwechsel)
return angriff_verlassen();
//***********Darf der Angriff durchgefuehrt werden???********************
if (!... |
7ef8d0d0-6795-4acd-82f0-09bba8fb9b30 | 5 | public void run() {
StringBuilder builder = new StringBuilder();
try {
SteamOwnedGamesResponse response = TwitchTools.GSON.fromJson(Utils.urlToString("http://api.steampowered" +
".com/IPlayerService/GetOwnedGames/v0001/?key=" + TwitchTools.settings.getSteamApiKey... |
01712deb-276d-455a-83f4-59f5b6fe9599 | 3 | @Override
public void updateIcon() {
if(isProperty()) {
if (isPropertyInherited()) {
setIcon(ICON_IS_PROPERTY_INHERITED);
} else {
setIcon(ICON_IS_PROPERTY);
}
} else {
if (isPropertyInherited()) {
setIcon(ICON_IS_NOT_PROPERTY_INHERITED);
} else {
setIcon(ICON_IS_NOT_PROPERTY);
}
... |
16bb4c4e-2e99-40b7-8904-fc480fc7c3ba | 6 | public final void setSuccs(Object newSuccs) {
if (succs == newSuccs)
return;
removeSuccs();
if (newSuccs == null)
return;
if (newSuccs instanceof Instruction[]) {
Instruction[] ns = (Instruction[]) newSuccs;
switch (ns.length) {
case 0:
break;
case 1:
succs = ns[0];
ns[0].addPredec... |
8c685406-07e5-4ddd-8078-637d09dfa1e1 | 1 | public void removePush() {
if (exprStack != null)
instr = exprStack.mergeIntoExpression(instr);
super.removePush();
} |
684da02c-9592-45ba-9413-0b25bdd53e0f | 6 | public int stochFLookback( int optInFastK_Period,
int optInFastD_Period,
MAType optInFastD_MAType )
{
int retValue;
if( (int)optInFastK_Period == ( Integer.MIN_VALUE ) )
optInFastK_Period = 5;
else if( ((int)optInFastK_Period < 1) || ((int)optInFastK_Period > 100000) )
... |
67bf75b5-ba27-4367-994e-dcc6e53c08a9 | 9 | public void moveToPlayer()
{
resetDirection();
int dx = player.getX()-getX();
int dy = player.getY()-getY();
// if( Math.abs(dx) < WeaponItem.range() && Math.abs(dy) < WeaponItem.range() ){
if( Math.abs(dx) < 30 && Math.abs(dy) < 30 ){
// Attack with delay 1500 ms inbetween slashes
if(getTimeStam... |
59543248-9a02-484b-8524-a77f3a6382ab | 6 | private void sortColComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_sortColComboBoxActionPerformed
// TODO add your handling code here:
Sorter sort = new Sorter(DATA_POINTS);
String optionChosen = sortColComboBox.getSelectedItem().toString();
int mode = sortD... |
7b50b161-7b75-49e8-b680-ba0dbe4f1650 | 0 | public Screen( JPanel event_processor ) {
add( event_processor );
event_processor.setFocusable( true );
} |
67f81822-d5bd-4b01-bf63-9be06a4de3df | 9 | public String process() throws IOException {
StringWriter result = new StringWriter();
int nesting = 0;
String line;
while ((line = StringHelper.readLine(reader)) != null) {
Matcher m = begin.matcher(line);
if (m.matches()) {
nesting++;
... |
39d9bdd4-223e-4c8b-9f93-8b16dcd71711 | 1 | private void register(Path dir) throws IOException {
if(!dir.getFileName().toString().startsWith(".")){
WatchKey key = dir.register(watcher, ENTRY_CREATE, ENTRY_DELETE, ENTRY_MODIFY);
keys.put(key, dir);
}
} |
e887cfcb-1280-4d34-80d7-128d3c338b95 | 9 | private boolean isDiagonalWin(int player) throws Exception {
boolean win = false;
if ((player < 0) || (player > TicTacToeBoard.PLAYER_O)) {
throw new Exception("Invalid player index -- must be 0 or 1");
}
String playerSymbol;
if( player == PLAYER_X) {
playerSymbol = X;
} else {
playerSymbol = O;
... |
e0937d7a-ef94-4ee5-a90e-8bb81d283f5f | 0 | public String getEmail() {
return Email;
} |
2f5540a3-7ccb-48e2-967f-048bc40ed5a7 | 6 | public void extraireBipartis() {
Fenetre.lePert.sommets = new ListeSommets();
for (int i = 0; i < sommets().size(); i++) {
Sommet leSommet = sommets().elementAt(i);
for (int j = 0; j < sommets().size(); j++) {
Sommet leSommet2 = sommets().elementAt(j);
if (leSommet.getSuccesseurs().isEmpty()) {
/... |
7484c6b2-5de3-4a3c-95cb-8a91e9ec22f4 | 0 | public LogFile getErrorLog() {return this.errorLog;} |
28ce1d34-15c1-4ad4-91bf-e7a47cf2fc19 | 3 | @Override
public boolean createCustomer(Customer customer) {
if (doc == null)
return false;
Element currRoot = doc.getRootElement();
Element parrentCusto = currRoot.getChild("customers");
Element newCusto = new Element("customer");
int id = 0;
for (Customer item : getCustomers()) {
if (item.getCustom... |
d35713df-667d-4d50-b6c2-fa5b86a03321 | 6 | private void jbuttonMostrarAsistenciaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbuttonMostrarAsistenciaActionPerformed
String str = String.valueOf(this.autocomboboxAsistencias.getSelectedItem());
if (str == null || str.isEmpty() || str.equals("") || str.equals("null")) {
... |
bad7a3cf-ed85-433d-a9a2-d0fb8009f0ab | 0 | @Before
public void setUp()
throws Exception
{
createInjector( new QuartzModule()
{
@Override
protected void schedule()
{
scheduleJob( TimedTask.class ).updateExistingTrigger();
scheduleJob( TimedTask.class ).updateExis... |
e4f1e8ac-9985-4ca2-b6c3-fcf6eabf1bdb | 8 | private void readCAIDAmap() throws Exception {
try {
FileReader fr = new FileReader(this.mapFilenameCAIDA1);
BufferedReader br = new BufferedReader(fr);
String str = br.readLine();
while (str != null) {
// if the string does not start with 'D' (direct link) or 'I'
// (indirect link), skip this ... |
36a16887-f88f-480a-9c79-2dd47a7fbcd3 | 2 | public void updatePlayerNames(){
playerCount=0;
for(int i = 0; i < maxPlayers; i++) {
if(players[i] != null) {
playersCurrentlyOn[i] = players[i].playerName;
playerCount++;
}
else {
playersCurrentlyOn[i] = "";
}
}
} |
64866551-4df8-498f-ab79-081b807979ce | 5 | private static void writeDistribution(HashMap<Double, Integer> distribution, LinkedList<String> columns, int numberEntries, String baseFilename) throws IOException
{
//
// Generate name for distribution
//
StringBuffer name = new StringBuffer();
java.util.Collections.sort(columns);
{
boolean first = ... |
d8bcaa3e-06e5-4b75-8c8d-1aff1593dc05 | 4 | public String gridToString () {
char[][] result = {{'x', 'x', 'x', 'x', 'x', 'x'},
{'x', 'x', 'x', 'x', 'x', 'x'},
{'x', 'x', 'x', 'x', 'x', 'x'},
{'x', 'x', 'x', 'x', 'x', 'x'},
{'x', 'x', 'x', 'x', 'x', 'x'},
{'x', 'x', 'x', 'x', 'x', 'x'}};
for(char c : this... |
05d54c44-e66e-47ab-9a2f-1b8853f81cac | 6 | @Override
public void actionPerformed(ActionEvent e) {
String cmd = e.getActionCommand();
for (int i = 0; i < COMPONENTS.getLength(); i++) {
if (e.getActionCommand().equals(COMPONENTS.get(i)))
panel.createComponent(COMPONENTS.get(i));
}
if (e.getActionComm... |
88540f30-d449-4c50-a4f5-728f2e82031e | 9 | public static void displayPrescription(PatientProfilePage profileP){
profileP.getPrescriptionList().setText("Unpaid Prescription List: \n");
BigDecimal tax = new BigDecimal(.07);
totalPrescriptionCost=BigDecimal.ZERO;
clearTable(profileP);
Patient p = Gui.getCurrentPatient();
BigDecimal coPay=p.getCoPay().d... |
c55834a9-3a02-4718-85f5-c560f67c8dcd | 6 | private void initStartAndEndFromHadoopConf()
throws StartOrEndNotSetException {
String startPointForElementStr = this.conf.get(SystemConf
.getStartPointForConfSetString());
String endPointForElementStr = this.conf.get(SystemConf
.getEndPointForConfSetString())... |
c6eb1d6c-7db4-4ac9-ac10-413284621f03 | 3 | public Transition transitionAtPoint(Point point) {
if (!valid)
refreshArrowMap();
Set arrows = arrowToTransitionMap.keySet();
Iterator it = arrows.iterator();
while (it.hasNext()) {
CurvedArrow arrow = (CurvedArrow) it.next();
if (arrow.isNear(point, 2))
return (Transition) arrowToTransitionMap.get... |
8ce2fd5e-4f8e-4102-b36b-22edae2e547d | 6 | @EventHandler
public void IronGolemWither(EntityDamageByEntityEvent event) {
Entity e = event.getEntity();
Entity damager = event.getDamager();
String world = e.getWorld().getName();
boolean dodged = false;
Random random = new Random();
double randomChance = plugin.getIronGolemConfig().getDouble("IronGolem... |
6ac40d57-1c65-425e-8a0e-f1fcd26d17d7 | 2 | @Override
public void fire() {
if(enabled) {
MobileNode mn = (MobileNode) this.node;
// Assemble an SMS and send it to the current anteanna
SmsMessage msg = new SmsMessage(mn.getNextSeqID(), destination, this.node, text, this);
Antenna a = mn.getCurrentAntenna();
if(a != null) {
this.node.send(msg... |
bf9989f6-69f6-4824-98a7-b3c1dd8d90c4 | 1 | public void mousePressed(MouseEvent e) {
GameAction gameAction = getMouseButtonAction(e);
if (gameAction != null) {
gameAction.press();
}
} |
5853ff7f-8058-421d-8b4e-b2c9e8748726 | 1 | public void mainAction()
{
ship s = getShipToRecieveAction();
if(getTurnDecay() == 4)
{
s.recievesDamage(-3.00);
modifyTurnDecay(-1);
}
else
{
s.recievesDamage(-1.00);
modifyTurnDecay(-1);
}
} |
1d4ab40c-a8ea-449a-8d49-5045bb6e5536 | 3 | public boolean isNameChange()
{
return !isDeletion() && !isCreation() && toName != null && !toName.equals(fromName);
} |
6b6165b8-de84-4433-a561-e04c9fac569a | 9 | @Override
public void endElement(String uri, String localName, String qName)
throws SAXException {
Logger.getLogger(UserHandler.class.getName()).log(Level.FINER,
String.format("Setting %s in new user to %s.", qName, content.toString()));
if (qName.equalsIgnoreCase(U... |
5e8d7491-0efa-451e-af1c-c85f49b2abeb | 9 | public String GetPageContent(String url) {
URL obj = null;
try {
obj = new URL(url);
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
try {
conn = (HttpURLConnection) obj.openConnection();
} catch (IOException e) {
// TODO Auto-gene... |
9ffeb55a-42d9-481f-81d1-2716927c1715 | 2 | @Override
public Component getListCellRendererComponent(JList<? extends ICPBrasilSignature> jlist, ICPBrasilSignature e, int i, boolean bln, boolean bln1) {
ICPBrasilCertificate cert = e.getSignerCertificate();
String text = null;
if(cert != null){
text = cert.getSubjectSimpleNam... |
715f8e2d-2387-4326-a0af-c4d561265360 | 3 | @Test
public void testIterator() throws Exception {
Object domainNode1 = new Object();
Object domainNode2 = new Object();
Object domainNode3 = new Object();
InternalNode<Object, Object> node1 = (InternalNode<Object, Object>) Mockito.mock(InternalNode.class);
Mockito.when(no... |
6f97f865-4148-41eb-9892-c9814f018edb | 7 | public LinkedList<LinkedList<Vertex>> _toVertexArray(boolean SHOULD_IGNORE_START_END_NODES){
// For the main store of vertices
LinkedList<LinkedList<Vertex>> mainResult = new LinkedList<LinkedList<Vertex>>();
LinkedList<Vertex> newResult = new LinkedList<Vertex>();
LinkedList<Vertex> currentLL = new LinkedLi... |
589763ec-a20e-4e8a-bd70-9b294a8712c5 | 5 | @Override
public int hashCode() {
int result = pcaPosId != null ? pcaPosId.hashCode() : 0;
result = 31 * result + (pcaGrupo != null ? pcaGrupo.hashCode() : 0);
result = 31 * result + (pcaSubgru != null ? pcaSubgru.hashCode() : 0);
result = 31 * result + (pcaGenerico != null ? pcaGene... |
b3262301-e4e5-44a2-a718-2f26d8323738 | 2 | public static CommandeFournisseur SelectCommandeFournisseurById(int id) throws SQLException {
String query = "";
CommandeFournisseur Commande = new CommandeFournisseur();
ResultSet resultat;
try {
query = "SELECT * from COMMANDE_FOURNISSEUR where ID_CMDFOUR =? ";
... |
ffb11e5c-decb-4c52-8abc-2262fa6facbe | 0 | public static double getPrice(CallInfo ci, IRule rule){
return rule.execute(ci.getStart(), ci.getEnd());
} |
d6f0b970-f199-4637-97a5-2b1ba9959174 | 7 | private void checkForKeyPress() {
if (defaultKeyMapping.takeScreenShot.isPressed()) {
File file = new File("screenshots");
if (!file.exists()) {
file.mkdir();
}
String fileName = System.currentTimeMillis() + ".png";
File screenshot =... |
6bb7f77d-6df8-422f-bfc9-05a5d3ed2414 | 3 | @Override
public boolean checkGuess(String question, String quess) {
for (WordsPair pair : newWordList) {
if (pair.getEngWord() == question) {
if (pair.getDkWord() == quess) {
return true;
}
return false;
}
... |
34db3709-b81f-407c-9a83-8719665981a2 | 4 | private void updateStatus() {
if (player.getY() >= 2)
if (keys[KeyEvent.VK_UP]) {
player.move(false);
}
if (player.getY() <= (height - 50))
if (keys[KeyEvent.VK_DOWN]) {
player.move(true);
}
} |
0f5718fa-7e34-4a00-bb18-2f6fda199dce | 4 | private void checkIgnoredFileForMarkup(File file) throws IOException {
if (!file.exists()) {
log.warning(String.format("Excluded file %s doesn't exist", file));
return;
}
try (BufferedReader is = new BufferedReader(new FileReader(file))) {
String line = null;
while ((line = is.readLine()) != null) {
... |
dd514486-1386-4771-bfaa-5550107444c2 | 2 | @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) // event has MONITOR priority and will be skipped if it has been cancelled before
public void onPlayerJoin(PlayerJoinEvent event)
{
final PlayerJoinEvent pjEvent = event;
// Check if player has unfulfilled ass... |
12d2cccb-4b56-4603-bc4a-47833410c859 | 1 | @Test
public void testPlayerCapturesTwoFlagsAndOnePlayerBoxedIn() throws InvalidActionException {
final GameEnded gameEnded = new GameEnded();
game.addEventListener(new Listener() {
@Override
public void handleEvent(Event event) {
if(event.getType() == EventType.END_GAME)
gameEnded.setToTrue(... |
043c61bd-7c0a-4202-ad0a-f8ef3ae5f47d | 1 | @Override
public void replica(Integer id, Box obj) throws RemoteException, NenhumServidorDisponivelException
{
h.put(id, obj);
try
{
System.out.printf("Received object %s from %s\n", obj.toString(), RemoteServer.getClientHost());
}
catch (ServerNotActiveExcep... |
5ad07dbf-60e5-4192-ac0c-b615eb48a5ea | 8 | public void movePointerTransition(Node nodo) {
TranslateTransition translateTransition = new TranslateTransition(Duration.millis(400), pointer);
translateTransition.setFromY(pointer.getTranslateY());
if ("newEventButton".equals(nodo.getId())) {
if (pointer.getTranslateY() > 100) {
... |
cff6cdd1-a94f-4e58-a00b-508bde28ad99 | 8 | private void deleteCategorie() {
int id_categorieTmp = -1;
System.out.println("ID :");
id_categorieTmp = Integer.parseInt(sc.nextLine());
CategorieDB.setConnection(con);
CategorieDB cat = null;
cat = new CategorieDB(id_categorieTmp);
try {
cat.read();
... |
cfc109d0-70f6-4258-998b-d578b2180eb1 | 1 | protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
try{
response.setContentType("text/html");
PrintWriter out = response.getWriter();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-mm-dd hh:mm:ss");
String address=reques... |
1d89ab4e-4679-4a33-a439-22cc5a9af1fd | 5 | private void restart() {
Scanner sc = new Scanner(System.in);
System.out.println("Play again? (Y or N)");
String res = sc.next();
switch(res.toUpperCase().charAt(0)) {
case 'Y' :
for(int i =0;i<this.player.length;i++) {
Game.clearConsole();
System.out.println("Captain " +player[i].name+", it is tim... |
b1f7c3de-57a4-4766-ae3a-d034eaa0628a | 6 | protected void receiveData(IRemoteCallObject rco) {
if (rco == null) throw new IllegalArgumentException("aRemoteCallObject is null");
try {
long callId = rco.getCallObjectId(); //..call id
IRemoteCallObjectMetaData meta = rco.getMetaDataObject(); //..meta data
IRemoteCallO... |
bd26f0b5-0c81-4aac-aad9-dddc49c63cd8 | 0 | protected Automaton createEmptyAutomaton(Document document) {
return new PushdownAutomaton();
} |
b37da831-f6ee-48dd-b200-b12635d69515 | 5 | public int maxArea(int[] height) {
int l = height.length;
if (l<2){
return 0;
}
int front = 0;
int end = l-1;
int result = 0;
while (front<end){
int value = (height[front]<height[end]?height[front]:height[end])*(end-front);
if (... |
f05b684e-e70f-4cd5-883a-95a0257ee7ce | 7 | public static void startTest(JFrame parent, List<String> algnames, int min, int max, int step, int repeat) {
ProgressDialog pd = new ProgressDialog(parent, false);
pd.setVisible(true);
pd.println("Testing started.");
Thread t = new Thread(() -> {
try {
Threa... |
59c7d2b3-f74c-469b-8fc1-9ad84813647a | 7 | public void shuffle(int deck){
//Pretty much complete, could be more efficient
ArrayList<Integer> shuffler = new ArrayList<Integer>();
int num;
while(shuffler.size()<decksize){
num = (int)(Math.random()*(double)(decksize));
boolean inYet = false;
for(int i = 0; i < shuffler.size();i++){
if(num == s... |
24cf6fc7-254a-4016-a2a4-7518afa259f7 | 8 | @Override
public void import2Vcs() {
try {
SvnOperationFactory svnOp = new SvnOperationFactory();
ISVNAuthenticationManager authManager = new BasicAuthenticationManager(configEntry.getVcsUser(), configEntry.getVcsPass());
svnOp.setAuthenticationManager(authManager);
... |
5b83de24-9342-4b56-9448-80818f8b0ce3 | 8 | public List<List<String>> checkCycle() {
List<String> erdRel = new ArrayList<String>();
erdRel.addAll(relationshipTypes.keySet());
for (int i = 0; i < erdRel.size() - 1; i++) {
String s = erdRel.get(i);
for (int j = i + 1; j < erdRel.size(); j++) {
String curr = erdRel.get(j);
List<String> cycleToBe... |
d1a1a017-f52c-4421-b47b-bc9eb0c95c72 | 1 | public static void main( String[] args )
{
int loopLimit = 10;
int count = 0;
while ( count < loopLimit )
{
System.out.println( count );
count = count + 1;// increase the count by one
}
} |
38d07c09-b290-4e36-a4e0-3c32d6d2ad95 | 4 | public void minusEquals(Matrix bmat){
if((this.numberOfRows!=bmat.numberOfRows)||(this.numberOfColumns!=bmat.numberOfColumns)){
throw new IllegalArgumentException("Array dimensions do not agree");
}
int nr=bmat.numberOfRows;
int nc=bmat.numberOfColumns;
for(in... |
6f4ad109-2c3b-4669-9693-8ebf59e6b8a6 | 5 | public Component getEditorComponent(final PropertyEditor editor)
{
String[] tags = editor.getTags();
String text = editor.getAsText();
if (editor.supportsCustomEditor())
{
return editor.getCustomEditor();
}
else if (tags != null)
{
// m... |
7aea21e1-aa9b-4632-a4e5-5340516f7e2d | 3 | private void searchPage(Request req) {
BufferedReader in;
try {
in = new BufferedReader(new InputStreamReader(req.url.openStream()));
String inputLine, content = "";
while ((inputLine = in.readLine()) != null)
content += inputLine;
in.close();
if (content.indexOf("<div class='searchresults'... |
e43d1320-069c-4764-a00b-0f144e4c22f4 | 0 | public int getAge() {
return Age;
} |
d527a01d-d6fb-43f0-84fb-cb99a04c5986 | 5 | @Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Reserva other = (Reserva) obj;
if (this.IdReserva != other.IdReserva && (this.IdReserva == null || !this.... |
32ee6287-8a71-44bf-8052-4c74031aa7aa | 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 fe... |
5b1592b1-ab88-4f7b-a94e-3308da432c0d | 2 | private Node determineNewSelectedNode(JoeTree tree) {
Node newSelectedNode = null;
// Find the range
Node firstNewSelectedNode = tree.getYoungestInSelection();
//int ioFirstNewSelectedNode = tree.getVisibleNodes().indexOf(firstNewSelectedNode);
Node lastNewSelectedNode = tree.getOldestInSelection();
//int ... |
05031c30-a64f-49ef-985a-080fe30d392e | 0 | public String getVenue() {
return venue;
} |
057feefa-6f00-427c-ae4e-8230ac3b5971 | 5 | @Override
public void run() {
logger.info("Starting monitor thread: " + this.getClass().getSimpleName());
T data = null;
try {
data = preRun();
this.cont = true;
} catch(Throwable t) {
logger.error("Exception occured in pre watcher run.", t);
this.cont = false;
}
try {
while(th... |
01e5b9a5-75e2-49c3-b076-79be2210170e | 5 | final int[][] method1274(int i, int j) {
if (j != 6) {
return null;
}
int ai[][] = super.aClass112_3320.method1036(-106, i);
if (super.aClass112_3320.aBoolean1822) {
int ai1[] = method1270(0, Class99.anInt1688 & i + -1, true);
int ai2[] = method1270(0,... |
5181cd5a-4a67-4000-ba88-b5010dbfff33 | 6 | private static boolean selectTests(){
System.out.println("Selecting songs...");
ArrayList<Integer> ids = dbModel.getAllSongIds();
if(ids.size() != insertCount){
reason = "The wrong amount of ids were returned";
failed = true;
return false;
}
... |
d4c93977-febe-4786-ad68-2d04e7adbd9a | 0 | @Override
public void startSetup(Attributes atts) {
super.startSetup(atts);
addActionListener(this);
} |
02ec7027-c9d9-4ada-87bd-7b97547204b7 | 7 | private static ArrayList<GregorianCalendar> parseInputToGregorianCalendar(String input[],
ArrayList<GregorianCalendar> defaultDate)
{
ArrayList<GregorianCalendar> result = new ArrayList<GregorianCalendar>();
SimpleDateFormat sdf = new SimpleDateFormat();
for (int i = 0; i < input.length; i++) {
sdf.applyPa... |
4d21301e-f47f-4f45-aaab-cf2711c04d99 | 1 | public void accept(NodeVisitor visitor) {
for (ClassNode c : classes) {
c.accept(visitor);
}
} |
60e3128f-69df-488f-a51e-cf9bca8a7953 | 3 | public void processBytes(byte[] in, int inOff, int len, byte[] out, int outOff)
{
if((inOff + len) > in.length)
{
throw new RuntimeException("output buffer too short");
}
if((outOff + len) > out.length)
{
throw new RuntimeException("out put buffer too ... |
d18e1e0e-acbb-4bf4-81f2-94f9630a54b5 | 0 | public void setEncryptedValue(EncryptedDataType value) {
this.encryptedValue = value;
} |
2453ad7d-312e-4d0a-bb32-31b21adbb834 | 5 | public boolean sRight(){
boolean change = false;
//i -> y | j -> x
for (int i = 0 ; i < 4 ; i ++){
for (int j = 3; j > -1 ; j--) {
//System.out.println("sRight> i: " + i + " j: " + j);
boolean tmp = mRight(j, i);
if (tmp == true)
change = true;
}
if(aRight(i))
change = true;
}
... |
ab0f5dd1-9b43-41e6-abcb-8e357e056868 | 4 | public static int findLongestSubWithoutRep(String s) {
if (s.length() == 0) {
return 0;
}
char[] arr = s.toCharArray();
int i = 0;
int maxlength = 1;
int begin = 0;
int tempLen = 0;
int tempBegin = 0;
HashSet<Character> hs = new HashSet<Character>();
while (i < arr.length) {
if (!hs.contains(a... |
ef328edb-38dd-497c-83f4-5c991b0aec1e | 8 | @Override
public boolean equals(Object obj) {
if(obj == this) return true;
if(! (obj instanceof Map)) return false;
final Map<K,V> asM = (Map<K,V>) obj;
if(asM.size() != size()) return false;
final Iterator<Map.Entry<K, V>> it = asM.entrySet().iterator();
try {
while(it.hasNext()){
final Map.Entry<... |
d0870a71-d6a3-48b8-8a6f-d6e195d96155 | 9 | public String getSignature() {
StringBuilder buffer = new StringBuilder(256);
boolean found = false;
if (this.lowerBounds != null) {
found = true;
if (this.lowerBounds instanceof ClassTypeDesc) {
ClassTypeDesc clazz = (ClassTypeDesc) this.lowerBounds;
... |
27990694-6bbe-4c08-aa99-502e57c14aaa | 5 | static private final int jjMoveStringLiteralDfa1_0(long active0)
{
try { curChar = input_stream.readChar(); }
catch(java.io.IOException e) {
jjStopStringLiteralDfa_0(0, active0);
return 1;
}
switch(curChar)
{
case 42:
if ((active0 & 0x100L) != 0L)
return jjStartNfaW... |
d3bf92ba-e165-4ed8-9d9f-4a55adb3dbe5 | 7 | public String getTypeString() {
switch(this.type) {
case 1: return "Manga";
case 2: return "Novel";
case 3: return "One Shot";
case 4: return "Doujin";
case 5: return "Manhwa";
case 6: return "Manhua";
case 7: return "OEL";
default: return "Manga";
}
} |
60604aaa-5d25-4af2-8fd5-0e7609233879 | 7 | public static String doubleToString(double d) {
if (Double.isInfinite(d) || Double.isNaN(d)) {
return "null";
}
// Shave off trailing zeros and decimal point, if possible.
String string = Double.toString(d);
if (string.indexOf('.') > 0 && string.indexOf('e') < 0
... |
73b758d8-0828-4ff2-a7d7-45bddcfad26f | 2 | private boolean addNumericId(String numericId) {
int id=-1;
try {
id=Integer.parseInt(numericId);
} catch (NumberFormatException e) {
throw new RuntimeException("Internal error, regex failed parsing what should be a numeric genre ID="+numericId);
}
String genre=GenreList.idToValue.get(id);
if(genre!=n... |
d65e0522-3ced-441d-a26a-5d9d75a9ae9c | 4 | private static void addCompatibilityWarning(HTMLElement root) {
for (Object o : root.getChildren()) {
if (o instanceof HTML) {
for (Object e : ((HTMLElement) o).getChildren()) {
if (e instanceof BODY) {
BODY body = (BODY) e;
((BODY) e).addObject(new Warning(
"You are using an incompati... |
75fca3ef-67b5-4912-9d36-0a6d80b5b56a | 6 | public boolean onCommand(CommandSender sender, Command command, String label, String[] args)
{
if (!(sender instanceof Player))
return false;
if (!sender.hasPermission(Permissions.PERM_CLAIM))
{
Util.sendMessage("&cYou don't have permission!", sender.getName());
return true;
}
Player player = (Play... |
9edc530d-550c-4a75-aa5c-c41fed047eb0 | 5 | @Override
public void store() {
Map<Class<? extends IUser>, List<Map<String, Object>>> description = new HashMap<Class<? extends IUser>, List<Map<String, Object>>>();
for (IUser m : this.usersToList()) {
Class<? extends IUser> c = m.getClass();
if (description.containsKey(c)) {
description.get(c).add(m... |
f8370b79-dfdb-403b-b0fa-cb9bb59008db | 8 | @Override
public boolean equals(Object obj)
{
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
SickEntry other = (SickEntry) obj;
if (days != other.days)
return false;
if (id != other.id)
return false;
if (start == null)
{
i... |
a62c90cb-6c39-4a0e-b28f-7be1f4c725bf | 0 | public int getPlayers(){
numberOfPlayers=1; // can set this up to ask for user input.
//Scanner input = new Scanner(System.in);
//System.out.prinln("How many players?: ");
//numberOfPlayers =input.nextInt();
return numberOfPlayers;
} |
0f01cdce-aa27-416f-aa44-dc634fe7d214 | 6 | @Override
protected Object decode(State state, IOBuffer buffer, Channel channel)
throws Exception
{
String line;
switch(state)
{
case HEADER_FIRST_LINE:
header = new HttpRequestHeader();
line = readLine(buffer);
String[] firstLine = line.split(" ");
header.setMethod(firstLine[0].trim());
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.