I'm trying to devise a (good) way to choose a random number from a range of possible numbers where each number in the range is given a weight.  To put it simply:  given the range of numbers (0,1,2) choose a number where 0 has an 80% probability...
Here's what I'm looking for:   I want to use the wonderful features of SIMPLE mode minification while disabling just one specific feature (disable local function inline).      UPDATE: The answer is NO, it's not possible given my setup. Bu...
I am working with dates that are on an API response. Date coming from API are in EST. I need to convert the EST (technically EDT) date to UTC and then compare with dates from another API response whose values are in UTC format  I am trying to do this...
I need to manage a groovy list object in my javascript function. I have a groovy block into a javascript function.  I tried with this:  var obj = ${mediaObjectInstanceList as grails.converters.JSON}[index];   and this:  var obj = ${mediaObjectInstanc...
Would like to pass directly from the controller to a JavaScript file.   TestControler.groovy  def list() {     render (view: "list", model:[theId: theId]) }   Test.js  function test() {    // do smth with theId }   Found solution have the ren...
Using groovy , you can run closure  like following :     instanceB.methodB({           methodA(3);           methodA(3);   });    //---- methodB definition    class B{        def methodB(Closure c){              c.delegate=new A(); //!!!---The questi...
i have a problem with this each loop  i have a select, you choose an option, press a button and the selected value is beamed via ajax as encodeURIcomponent to the backend, the answer updates this ul :  <g:each in="${items}"> <li clas...
I have a javascript function (very big one!) that I need its functionality in a Java (Groovy) class. It is a simple calendar converter. I can rewrite it in groovy but just want to know if it is possible to call javascript function from a java (groovy...
I have to write a javaScript function that return some data to the caller.  In that function I have multiple ways to retrieve data i.e.,    Lookup from cache Retrieve from HTML5 LocalStorage  Retrieve from REST Backend (bonus: put the fresh data back...
I have a simple web site (http://www.kousenit.com/twitterfollowervalue) that computes a quantity based on a person's Twitter followers.  Since the Twitter API only returns followers 100 at a time, a complete process may involve lots of calls.  At...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.