Posts

questions that have no specific number of input tests on ACM -

questions that have no specific number of input tests on ACM - i'm trying submission on baskets of gold coins problem on acm-icpc live archive (https://icpcarchive.ecs.baylor.edu) number of problem 3576 i've written code , gave right reply when tried submit on website online justice didn't take (time limit exceeded error) thing it's not possible programme take more 3 minuets it's simple programme question didn't how many time must input had utilize loop don't know when end code wrote class="snippet-code-css lang-css prettyprint-override"> #include <stdio.h> int n,w,d,weight; int search(); int main(){ scanf("%d %d %d %d",&n,&w,&d,&weight); while((n>1 && n<=8000) && (0<w && w<=30) && (d<w)){ printf("%d\n",search()); scanf("%d %d %d %d",&n,&w,&d,&weight); } return 0; } int search(){ int n=n...

android - ACTION_CANCEL when touch size becomes too large? -

android - ACTION_CANCEL when touch size becomes too large? - i researching "in-pocket" smartphone interaction. using android implementation , have run next problem: whenever press fingers firmly against screen (which happens lot in utilize case), android issues action_cancel current motionevent , app (and in fact every app tried) stops receiving touch events until fingers lifted off screen. utilize lg g2 , samsung galaxy alpha testing. on g2, problem seems occur when getpressure() first exceeds 1.0 1 pointer. galaxy alpha, however, returns 1.0 getpressure() , behaves g2. other parameters vary seem cluster around values when action_cancel occurs. i have found few similar cases (e.g. motionevent.action_cancel blocking subsequent action_up on button) , no solution. tried requestdisallowintercepttouchevent() no avail. can tell logs, getevent , show pointer location developer options scheme ( viewrootimpl , exact) keeps reporting events after problem occurs, ...

Devise not working for multiple domains on login - Rails -

Devise not working for multiple domains on login - Rails - i have application respond multiple domain, each domain must have different users on user model validation email like: validates_uniqueness_of :email, scope: :domain_id, case_sensitive: false, allow_blank: true, if: :email_changed? this allow me register users same email on different domains, problem when 1 user registered in 1 domain same user can login domains in platform. wrong because user can login on domain registered. how can have working using devise? ruby-on-rails ruby-on-rails-4 devise

c++ - Using threads to sort two halves of an array, but only second half is being sorted -

c++ - Using threads to sort two halves of an array, but only second half is being sorted - i wrote quick programme sort 2 halves of 1 array, when test sort works fine 1 array, when split array 2 , pass half each thread sorting, when they're done , print array, sec half looks sorted. doing wrong? below sorting function , main. void *sort(void *object){ struct array_struct *structure; construction = (struct array_struct *) object; int *array = structure->partition; int size = structure->size; qsort(array, size, sizeof(int), cmpfunc); printf("sorted %d elements.\n", size); } and main, assume includes fine, , compilation fine also, not of code, parts pertaining problem. int main(int argc, char const *argv[]){ int segments = 2; pthread_t threads[segments]; int i, *numbers; //iterator i, , pointer int array 'numbers' numbers = randomarray(); //return array of size 50 filled random ints for(i = 0; < segments; i++){ struc...

excel - Calculation of average cost -

excel - Calculation of average cost - i have next table: transaction_date ticker cost shares trade_cost ave_cost total_shares total_cost 12/1/2014 aaa 1.50 1,000 1,500.00 1.50 1,000 1,500.00 12/1/2014 bbb 10.00 250 2,500.00 10.00 250 2,500.00 12/10/2014 bbb 11.25 200 2,250.00 10.56 450 4,750.00 12/12/2014 aaa 1.75 800 1,400.00 1.61 1,800 2,900.00 12/15/2014 ccc 32.00 100 3,200.00 1.00 3,200 3,200.00 i have calculate ave cost, total shares, , total cost. my formula total shares sec entry of bbb =sumif(b2:b4,b2,d2:d4) while formula total cost is =sumif(b2:b4,b2,e2:e4) next, sec entry of aaa on date 12/12/2014, total shares = sumif(b2:b5,b5,d2:d5) total cost = sumif(b2:b5,b5,e2:e5) dragging formula downwards require me manually alter range in sumif formula. how calculate running total shares , total cost @ every entry date without manually changing r...

vb.net - Grab username off twitter -

vb.net - Grab username off twitter - how can grab number of favorites off of page this? https://twitter.com/daltonmetzler4 like how can grab # of followers , number of favorites? you'll need utilize twitter rest api: https://dev.twitter.com/rest/public , understand how authenticate application oauth. followers: https://dev.twitter.com/rest/reference/get/followers/ids favorites: https://dev.twitter.com/rest/reference/get/favorites/list you can explore entire api twitter console: https://dev.twitter.com/rest/tools/console here's intro/tutorial twitter api: http://code.tutsplus.com/tutorials/building-with-the-twitter-api-getting-started--cms-22192 vb.net

internet explorer - Javascript palceholder did not work in IE9 -

internet explorer - Javascript palceholder did not work in IE9 - here code, $(document).ready(function() { // create "div" element , design using jquery ".css()" class. var container = $(document.createelement('div')).css({ padding: '5px', margin: '0'}); $(container).append('<input type=text class="input" id="tb1" placeholder="email" />'); $(container).append('<input type=text class="input" id="tb2" placeholder="email" />'); $(container).append('<input type=text class="input" id="tb3" placeholder="email" />'); $(container).append('<input type=text class="input" id="tb4" placeholder="email" />'); $('#main').before(container); // add together div elements "main" cont...