Agile Zone is brought to you in partnership with:
DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
  • submit to reddit
Allan Kelly10/30/14
654 views
0 replies

#NoProjects / #BeyondProjects - Agile Tour & Lean Kanban UK conference

The next few weeks sees me delivering my #NoProjects/#BeyondProjects presentation at two London conference - Agile Tour London (Friday this week) and Lean Kanban UK (3 & 4 November).

public class ThreadProc implements Runnable {

	boolean isRunning = true;
	Workbook testWorkbook;
	Random r = new Random();

	public ThreadProc(Workbook workbook)
	{
		this.testWorkbook = workbook;
	}

	public int randomNext(int Low, int High)
	{
		int R = r.nextInt(High-Low) + Low;
		return R;
	}

	public void kill()
	{
		this.isRunning = false;
	}

    public void run(){

    	while(this.isRunning)
    	{
            int row = randomNext(0, 100);
            int col = randomNext(0, 10);

            String s = testWorkbook.getWorksheets().get(0).getCells().get(row, col).getStringValue();

            if (s.equals("R" + row + "C" + col)!=true)
            {
                System.out.println("This message box will show up when cells read values are incorrect.");
            }
    	}
    }
  }


//........MainActivity.java........
//.................................
import java.io.File;
import java.util.Random;

import android.app.Activity;
import android.os.Bundle;
import android.os.Environment;
import android.view.Menu;

import com.aspose.cells.CellsHelper;
import com.aspose.cells.IWarningCallback;
import com.aspose.cells.WarningInfo;
import com.aspose.cells.WarningType;
import com.aspose.cells.Workbook;

public class MainActivity extends Activity {

@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		
try{
    Workbook testWorkbook = new Workbook();
    testWorkbook.getWorksheets().clear();
    testWorkbook.getWorksheets().add("Sheet1");

    for (int row = 0; row < 100; row++)
        for (int col = 0; col < 10; col++)
            testWorkbook.getWorksheets().get(0).getCells().get(row, col).setValue("R" + row + "C" + col);

    //Commenting this line will show a pop-up message
    testWorkbook.getWorksheets().get(0).getCells().setMultiThreadReading(true);

    ThreadProc tp = new ThreadProc(testWorkbook);

    Thread myThread1 = new Thread(tp);
    myThread1.start();

    Thread myThread2 = new Thread(tp);
    myThread2.start();

    Thread.currentThread().sleep(5*1000);
    tp.kill();
}
		catch (Exception e)
		{
			e.printStackTrace();
		}
	}

.........

}

John Walter10/29/14
13947 views
0 replies

Dev of the Week: Michael Hunger

Every week here and in our newsletter, we feature a new developer/blogger from the DZone community to catch up and find out what he or she is working on now and what's coming next. This week we're talking to Michael Hunger, Neo4j Developer Advocate and author of our upcoming Neo4j Refcard.

Troy Miles10/29/14
2405 views
0 replies

CodePen, AngularJS, and Jasmine!

Online Web editors, like JSbin, plnkr, and CodePen, are awesome. They allow you to easily work on an idea without all of the muss and fuss of having to spin up a server. You can also share the idea with friends or the entire Internet easily.

John Walter10/29/14
15300 views
0 replies

The Best of DZone: Oct. 22 - Oct. 29

If you missed anything on DZone this week, now's your chance to catch up! This week's best include navigating the DSL Jungle, a look at Google Analytics, a tutorial for updating your legacy code, and more.

Kevin Daly10/29/14
1576 views
0 replies

Don’t Expect Female Candidates to “Geek Out” With You When You Are Interviewing Them

Why are there not more women in software development? What can we do to improve this?

Illya Pavlichenko10/28/14
733 views
1 replies

Perfection Game + SSKML Retrospective

This article describes in detailes how to conduct a Retrospective created by combining two well-known formats "Perfection Game" and "Stop/Start/Keep/More/Less". Lots of images precise facilitation instructions will help you to understand how to use it during your next Sprint Retrospective.

Rob J Hyndman10/28/14
3350 views
0 replies

HTS with Regressors

The hts pack­age for R allows for fore­cast­ing hier­ar­chi­cal and grouped time series data. The idea is to gen­er­ate fore­casts for all series at all lev­els of aggre­ga­tion with­out impos­ing the aggre­ga­tion con­straints, and then to rec­on­cile the fore­casts so they sat­isfy the aggre­ga­tion con­straints.

Ayende Rahien10/28/14
4596 views
2 replies

Career Planning: Where do old devs go to?

What doesn’t make sense is the ratio that I’m seeing. Where are the people who have been doing software development for decades?



    
    Tags:


    
    Tags:
private List<Integer> getNeighbours(int num,int xsize,int ysize){
	List<Integer> neighbours = new ArrayList<Integer>();
	int max=xsize*ysize;
	int quo=num%xsize;
			
	int rowEnd = num+quo==num?num:(num+(xsize-quo));//works fine with most of the cases.		
	int rowBegin = rowEnd-xsize+1;
	int prevRowEnd = rowEnd-xsize<=0?rowEnd:rowEnd-xsize;
	int prevRowBegin = prevRowEnd-xsize+1;
	int nextRowEnd = rowEnd+xsize<=max?rowEnd+xsize:max;
	int nextRowBegin = nextRowEnd-xsize+1;		
			
	if(num-xsize-1>=prevRowBegin && num-xsize-1<prevRowEnd)    //North_West
		neighbours.add(num-xsize-1);
	if(num-xsize>0)             //North
		neighbours.add(num-xsize);			
	if(num-xsize+1>prevRowBegin && num-xsize+1<=prevRowEnd)             //North_East
		neighbours.add(num-xsize+1);
	if(num-1>=rowBegin)            //West
		neighbours.add(num-1);
	if(num+1<=rowEnd)               //East	
		neighbours.add(num+1);
	if(num+xsize-1>=nextRowBegin && num+xsize-1<nextRowEnd)        //South_West
		neighbours.add(num+xsize-1);
	if(num+xsize<=max)            //South
		neighbours.add(num+xsize);
	if(num+xsize+1>nextRowBegin && num+xsize+1<=nextRowEnd)     //South_East
		neighbours.add(num+xsize+1);
				
	return neighbours;
}
Arthur Charpentier10/27/14
3242 views
0 replies

Removing Uncited References in a Tex File (with R)

Usually, once you have revised the paper, some references were added, others were dropped. But you need to spend some time to check that all references are actually mentioned in the paper. I wanted to work on that manually this week-end, but @3wen suggested to write a simple R function to scan the tex f file (as well as the aux file actually) to remove uncited references.

Antonio Santiago10/26/14
3878 views
0 replies

7 reasons to use Yeoman's angular-fullstack generator

For my next project and, after looking for candidates and reading some hundreds of lines of documentation, I finally choose to work with the so called MEAN stack: mongodb, express, angular and node.

David Gelperin10/26/14
6760 views
1 replies

Prudent Agile

Today's Agile is reckless. Consider a prudent alternative.

Giuseppe Vettigli10/26/14
3010 views
0 replies

Andrews Curves

Andrews curves are a method for visualizing multidimensional data by mapping each observation onto a function. It has been shown the Andrews curves are able to preserve means, distance (up to a constant) and variances. Which means that Andrews curves that are represented by functions close together suggest that the corresponding data points will also be close together.

John Cook10/26/14
6708 views
1 replies

Experts vs Professionals

Working with professionals can be a joy. Not only can they solve your problem, they may help you see what problem you should solve. Experts, however, are not always so pleasant to work with.

Maarten Ectors10/26/14
7007 views
0 replies

Sentiment Analysis Beyond Tweets

Deep belief networks have made it possible to train computers to predict if a sentence is positive, negative or neutral. Most sentiment analysis captures headlines because tweets can be analysed. However are there business applications beyond social networking analytics? Here are five examples:

Mark Needham10/26/14
2323 views
3 replies

R: Linear models with the lm function, NA values and Collinearity

In my continued playing around with R I’ve sometimes noticed ‘NA’ values in the linear regression models I created but hadn’t really thought about what that meant. On the advice of Peter Huber I recently started working my way through Coursera’s Regression Models which has a whole slide explaining its meaning:

Benjamin Ball10/26/14
971 views
0 replies

The Best of the Week (Oct 17): Agile Zone

Make sure you didn't miss anything with this list of the Best of the Week in the Agile Zone (October 17 - October 24). This week's topics include what developers want recruiters to know, release schedules, pushing multiple Git repositories, validating configuration.