Posts

Showing posts from October 8, 2018

Bench fees: typical procedure and rates for visiting students?

Image
Clash Royale CLAN TAG #URR8PPP up vote 3 down vote favorite Over the summer I visited a research station at a different university to collect data for my PhD work. I received an invoice (nearly two months after the fact) for bench fees related to my stay in the amount of $100/day. I used a few square feet of floor space in one of the labs and some outdoor space as well, but brought all my own equipment and materials. This is my first time visiting a different university, so this is new to me. The communication from the research station before my visit was exceptionally poor, not a single one of my emails (over the span of months) was replied to when I tried to communicate with my sponsor, but since they accepted my payment for lodging I showed up. I guess I should have assumed there would be fees on top of what I already paid associated with my stay, but as I mentioned I am new to this, and working in an interdisciplinary field so my advisor is not familiar with the custom

Why is Collections.sort() much slower than Arrays.sort()?

Image
Clash Royale CLAN TAG #URR8PPP up vote 11 down vote favorite 3 I tried to do a test, regarding Collection.sort() and Arrays.sort() . In the test, I created an array of int s of length 1e5 100 times, which contained random numbers from 1 to 1e5. I also created a list of type Integer , which contained the same values at the same positions as that of the array. Then I sorted the array using Arrays.sort() and the list using Collections.sort() . Here is the code: import java.util.* ; class TestClass public static void main(String args ) throws Exception double ratSum = 0 ; for(int j=0;j<100;j++) int A = new int[(int)1e5] ; List<Integer> L = new ArrayList<Integer>() ; for(int i=0;i<A.length;i++) int no = (int)Math.random()*(int)1e5 ; A[i] = no ; L.add(A[i]) ; long startTime = System.nanoTime() ; Arrays.sort(A) ; long endTime = System.nanoTime() ; Collections.sort(L) ; long endTime2 = System.nanoTime() ; long t1 = (endTime-startTime), t2 = (