text:
Q: how to store an array in jquery cookie? I need to store an array in a jQuery cookie, any one help me please?

A: Still not exactly sure what you need but i hope this will help.
This is a sample that will allow you to access the items on any page, its just a sample!
It uses the cookieName to identify it across the pages.
//This is not production quality, its just demo code.
var cookieList = function(cookieName) {
//When the cookie is saved the items will be a comma seperated string
//So we will split the cookie by comma to get the original array
var cookie = $.cookie(cookieName);
//Load the items or a new array if null.
var items = cookie ? cookie.split(/,/) : new Array();

//Return a object that we can use to access the array.
//while hiding direct access to the declared items array
//this is called closures see http://www.jibbering.com/faq/faq_notes/closures.html
return {
    "add": function(val) {
        //Add to the items.
        items.push(val);
        //Save the items to a cookie.
        //EDIT: Modified from linked answer by Nick see
        //      http://stackoverflow.com/questions/3387251/how-to-store-array-in-jquery-cookie
        $.cookie(cookieName, items.join(','));
    },
    "remove": function (val) {
        //EDIT: Thx to Assef and luke for remove.
        indx = items.indexOf(val);
        if(indx!=-1) items.splice(indx, 1);
        $.cookie(cookieName, items.join(','));        },
    "clear": function() {
        items = null;
        //clear the cookie.
        $.cookie(cookieName, null);
    },
    "items": function() {
        //Get all the items.
        return items;
    }
  }
}

So on any page you can get the items like this.
var list = new cookieList("MyItems"); // all items in the array.

Adding items to the cookieList
list.add("foo");
//Note this value cannot have a comma "," as this will spilt into
//two seperate values when you declare the cookieList.

Getting all the items as an array
alert(list.items());

Clearing the items
list.clear();

You can add additional things like push and pop quite easily.
Again hope this helps.
EDIT
See bravos answer if you having issues with IE

A: Check out my implementation (as a jquery plugin):
(function ($) {
    $.fn.extend({
        cookieList: function (cookieName) {
            var cookie = $.cookie(cookieName);

            var items = cookie ? eval("([" + cookie + "])") : [];

            return {
                add: function (val) {
                    var index = items.indexOf(val);

                    // Note: Add only unique values.
                    if (index == -1) {
                        items.push(val);
                        $.cookie(cookieName, items.join(','), { expires: 365, path: '/' });
                    }
                },
                remove: function (val) {
                    var index = items.indexOf(val);

                    if (index != -1) {
                        items.splice(index, 1);
                        $.cookie(cookieName, items.join(','), { expires: 365, path: '/' });
                     }
                },
                indexOf: function (val) {
                    return items.indexOf(val);
                },
                clear: function () {
                    items = null;
                    $.cookie(cookieName, null, { expires: 365, path: '/' });
                },
                items: function () {
                    return items;
                },
                length: function () {
                    return items.length;
                },
                join: function (separator) {
                    return items.join(separator);
                }
            };
        }
    });
})(jQuery);

Usage:
  var cookieList = $.fn.cookieList("cookieName");
  cookieList.add(1);
  cookieList.add(2);
  cookieList.remove(1);
  var index = cookieList.indexOf(2);
  var length = cookieList.length();

A: I got error when I try to use almog.ori's script in IE 8
    //This is not production quality, its just demo code.
    var cookieList = function(cookieName) {
    //When the cookie is saved the items will be a comma seperated string
    //So we will split the cookie by comma to get the original array
    var cookie = $.cookie(cookieName);
    //Load the items or a new array if null.
    var items = cookie ? cookie.split(/,/) : new Array();

    //Return a object that we can use to access the array.
    //while hiding direct access to the declared items array
    //this is called closures see http://www.jibbering.com/faq/faq_notes/closures.html
    return {
        "add": function(val) {
            //Add to the items.
            items.push(val);
            //Save the items to a cookie.
            //EDIT: Modified from linked answer by Nick see
            //      https://stackoverflow.com/questions/3387251/how-to-store-array-in-jquery-cookie
            $.cookie(cookieName, items.join(','));
        },
        "remove": function (val) {
            //EDIT: Thx to Assef and luke for remove.
            indx = items.indexOf(val);
            if(indx!=-1) items.splice(indx, 1);
            $.cookie(cookieName, items.join(','));        },
        "clear": function() {
            items = null;
            //clear the cookie.
            $.cookie(cookieName, null);
        },
        "items": function() {
            //Get all the items.
            return items;
        }
      }

}

after a few hours digging the error, i only realised that indexOf in
"remove": function (val) {
                //EDIT: Thx to Assef and luke for remove.
                indx = items.indexOf(val);
                if(indx!=-1) items.splice(indx, 1);
                $.cookie(cookieName, items.join(','));        },

is not support in IE 8.
and so I add in another code base from here How to fix Array indexOf() in JavaScript for Internet Explorer browsers
it works,
"remove": function (val) {
    //EDIT: Thx to Assef and luke for remove.
    /** indexOf not support in IE, and I add the below code **/
    if (!Array.prototype.indexOf) {
        Array.prototype.indexOf = function(obj, start) {
            for (var i = (start || 0), j = this.length; i < j; i++) {
                if (this[i] === obj) { return i; }
            }
            return -1;
        }
    }
    var indx = items.indexOf(val);
    if(indx!=-1) items.splice(indx, 1);
    //if(indx!=-1) alert('lol');
    $.cookie(cookieName, items.join(','));
},

just in case anyone found the script is not working in IE 8, this might help.

A: I don't know if this will help someone but I also needed the function that checks if the item already there so I do not add it again.
I used the same remove function and alter it to be contain function:
"contain": function (val) {
//Check if an item is there.
if (!Array.prototype.indexOf) {
    Array.prototype.indexOf = function(obj, start) {
        for (var i = (start || 0), j = this.length; i < j; i++) {
            if (this[i] === obj) { return i; }
        }
        return -1;
    };
}
var indx = items.indexOf(val);
if(indx>-1){
    return true;
}else{
    return false;
}
},

for some reason the code above does not always work. so here is the new one that works:
"contain": function (val) {
//Check if an item is there.
if (!Array.prototype.indexOf) {
    Array.prototype.indexOf = function(obj, start) {
        for (var i = (start || 0), j = this.length; i < j; i++) {
            if (this[i] === obj) { return i; }
        }
        return -1;
    };
}
var indx = items.join(',').indexOf(val);
if(indx > -1){
    return true;
}else{
    return false;
}
},

A: This implementation provides independent access for multiple controls on the page:
(function ($) {
    $.fn.extend({
        cookieList: function (cookieName) {

            return {
                add: function (val) {
                    var items = this.items();

                    var index = items.indexOf(val);

                    // Note: Add only unique values.
                    if (index == -1) {
                        items.push(val);
                        $.cookie(cookieName, items.join(','), { expires: 365, path: '/' });
                    }
                },
                remove: function (val) {
                    var items = this.items();

                    var index = items.indexOf(val);

                    if (index != -1) {
                        items.splice(index, 1);
                        $.cookie(cookieName, items.join(','), { expires: 365, path: '/' });
                    }
                },
                indexOf: function (val) {
                    return this.items().indexOf(val);
                },
                clear: function () {
                    $.cookie(cookieName, null, { expires: 365, path: '/' });
                },
                items: function () {
                    var cookie = $.cookie(cookieName);

                    return cookie ? eval("([" + cookie + "])") : []; ;
                },
                length: function () {
                    return this.items().length;
                },
                join: function (separator) {
                    return this.items().join(separator);
                }
            };
        }
    });
})(jQuery);

A: I slightly adjusted the example to use JSON encoding and secureJSON decode, making it more robust and save.
It depends on https://code.google.com/p/jquery-json/
/*
 * Combined with:
 * http://www.terminally-incoherent.com/blog/2008/11/25/serializing-javascript-objects-into-cookies/
 * With:
 * https://code.google.com/p/jquery-json/
 *
 */
(function ($) {
    $.fn.extend({
        cookieList: function (cookieName, expireTime) {

            var cookie = $.cookie(cookieName);
            var items = cookie ? $.secureEvalJSON(cookie) : [];

            return {
                add: function (val) {
                    var index = items.indexOf(val);
                    // Note: Add only unique values.
                    if (index == -1) {
                        items.push(val);
                        $.cookie(cookieName, $.toJSON(items), { expires: expireTime, path: '/' });
                    }
                },
                remove: function (val) {
                    var index = items.indexOf(val);

                    if (index != -1) {
                        items.splice(index, 1);
                        $.cookie(cookieName, $.toJSON(items), { expires: expireTime, path: '/' });
                    }
                },
                indexOf: function (val) {
                    return items.indexOf(val);
                },
                clear: function () {
                    items = null;
                    $.cookie(cookieName, null, { expires: expireTime, path: '/' });
                },
                items: function () {
                    return items;
                },
                length: function () {
                    return items.length;
                },
                join: function (separator) {
                    return items.join(separator);
                }
            };
        }
    });
})(jQuery);

A: Nice piece of code for what I am doing at the moment, but found a bug.  I was saving a list of integers (IDs) to the cookie.  However when the cookie is first read it typecasts to strings.  I previously save (int) 1, and later when the cookie is retrieved on a page reload is designates it as "1".  Thus when I try to remove (int) 1 from the list it won't index a match.
The fix I applied is to change the "val" expressions to val.toString() prior to adding or indexing the items.  Thus items is an array of strings.
"add": function(val) {
    //Add to the items.
    items.push(val.toString());
    //Save the items to a cookie.
    $.cookie(cookieName, items.join(','));
},

"remove": function (val) {
    //EDIT: Thx to Assef and luke for remove.
    if (!Array.prototype.indexOf) {
        Array.prototype.indexOf = function(obj, start) {
            for (var i = (start || 0), j = this.length; i < j; i++) {
                if (this[i] === obj) { return i; }
            }
            return -1;
        };
    }

    var indx = items.indexOf(val.toString());
    if(indx!=-1) items.splice(indx, 1);
    //Save the items to a cookie.
    $.cookie(cookieName, items.join(','));
},

A: This is how you store and retrieve an array in cookie using json and jquery.
//Array
var employees = [
                {"firstName" : "Matt", "lastName" : "Hendi"},
                {"firstName" : "Tim", "lastName" : "Rowel"}
];

var jsonEmployees = JSON.stringify(employees);//converting array into json string
$.cookie("employees", jsonEmployees);//storing it in a cookie

var empString = $.cookie("employees");//retrieving data from cookie
var empArr = $.parseJSON(empString);//converting "empString" to an array.

A: Download the jQuery cookie plugin here: http://plugins.jquery.com/project/Cookie
Setting a cookie with jQuery is as simple as this, where we are creating a cookie called "example" with a value of ["foo1", "foo2"]
$.cookie("example", ["foo1", "foo2"]);

Getting the cookie's value is also very easy with jQuery. The following would show the value of the "example" cookie in a dialog window
alert( $.cookie("example") );

A: I added the "remove" action to whoever want to use it -
val is the index at which to start changing the array:
    "remove": function (val) {
        items.splice(val, 1);
        $.cookie(cookieName, items.join(','));
    }

A: just a little alternative to the "remove" function:
    "removeItem": function (val) {
        indx = items.indexOf(val);
        if(indx!=-1) items.splice(indx, 1);
        $.cookie(cookieName, items.join(','));
    }

where val is the value of an item in the array e.g:
   >>> list.add("foo1");
   >>> list.add("foo2");
   >>> list.add("foo3");
   >>> list.items();

   ["foo1", "foo2", "foo3"];

   >>> list.removeItem("foo2");
   >>> list.items();

   ["foo1", "foo3"];

A: Here is JSON implementation for working with cookie, much better way for storing arrays. tested from my end.
$.fn.extend({
  cookieList: function (cookieName) {
      var cookie = $.cookie(cookieName);

      var storedAry = ( cookie == null ) ? [] : jQuery.parseJSON( cookie );

      return {
          add: function (val) {

              var is_Arr = $.isArray( storedAry );
              //console.log(storedAry);

              if( $.inArray(val, storedAry) === -1 ){
                storedAry.push(val);
                //console.log('inside');
              }

              $.cookie( cookieName, JSON.stringify(storedAry), { expires : 1 ,  path : '/'});
              /*var index = storedAry.indexOf(val);
              if (index == -1) {
                  storedAry.push(val);
                  $.cookie(cookieName, storedAry.join(','), { expires: 1, path: '/' });
              }*/
          },
          remove: function (val) {

              storedAry = $.grep(storedAry, function(value) {
                return value != val;
              });
              //console.log('Removed '+storedAry);

              $.cookie( cookieName, JSON.stringify(storedAry), { expires : 1 ,  path : '/'});
              /*var index = storedAry.indexOf(val);
              if ( index != -1 ){
                  storedAry.splice( index, 1 );
                  $.cookie(cookieName, storedAry.join(','), { expires: 1, path: '/' });
               }*/
          }
          clear: function () {
              storedAry = null;
              $.cookie(cookieName, null, { expires: 1, path: '/' });
          }
      };
  }

});

A: You could serialize the arrays before storing as cookie and then deserialize when reading. ie with json?


text:
Q: How can I make Python wait when it cannot allocate memory? Sometimes a Python program stops with an exception like the following, when there is not enough memory:
OSError: [Errno 12] Cannot allocate memory

Can I make it wait until memory is available again instead of dying unrecoverably?
Or at least freeze until the user sends a SIGCONT or something to it?
It's not my program, so I prefer not to modify its source code, but I think it would still be cool if I can do that by modifying only the outmost calling part.
Thank you!

A: You can catch the OSError exception but this may not help your program to continue where it left off.
To do this well you need to interpose some code between Python and malloc.  You can do that using LD_PRELOAD as per the details here: How can I limit memory acquired with `malloc()` without also limiting stack?
The idea is you implement a wrapper for malloc which calls the real malloc and waits to retry if it fails.  If you prefer not to use LD_PRELOAD then building Python with your interposing code baked in is a possibility (but a bit more work).
The library you'll write for LD_PRELOAD will end up being usable with just about any program written in C or C++.  You could even open-source it.  :)

redpajama_set_name: RedPajamaStackExchange


text:
Q: want to remove my password or change in win10 during re-install of win10 my computer split user accounts into 2 but i got locked out of  the administrative account during the re-install. Now I cant add or update certain programs. Im  in the duplicate account but I don't have administrative rights

A: Resetting the Windows 10 Administrator password is actually a joke, Microsoft has no such thing as real security. Officially Microsoft suggests that you follow the article linked below and the steps that follow:
http://windows.microsoft.com/en-US/windows-live/account-reset-password-forgot-faq
Further if you are unable to get access that on your system, I suggest you to go to Windows Recovery Environment and use the Command Prompt there, which is elevated.
Follow the below steps:-
1)      Press Shift and Restart from the power icon (together)
2)      Select Troubleshoot.
3)      Go to Advanced Options.
4)      Select Command Prompt.
5)      Type "net user Administrator /active:yes"
6)      Hit Enter.
A user account with the name Admin will be created. Log in with that account and you will be able to access Admin privileges. You can also create more Administrator accounts with that account.
If those steps are a little too confusing, here's an excellent article with lots of photos, detailed steps and it's offered by a great source (How To Geek).
Now back to breaking Windows and its non-existent security, you can always use an offline software tool that cracks (discovers) or resets all the user account passwords on your computer. A couple tools capable of offline password cracking and resetting (respectively) are OPHCrack (How to Geek article here!) or if you simply want to reset a password without learning the current one, you could try something like Trinity which allows you to boot from a USB or CD/DVD like OPHCrack but rather than decrypting the password, it resets it to null or whatever you want it to be.
Good luck, have fun and don't use any of this information on a computer that doesn't belong to you, or more specifically you don't have permission to change/modify.


text:
Q: How to include a sass file in an index.js with webpack? This is my webpack config file
var path = require('path');
var MDC_DIR = path.resolve(__dirname, 'node_modules', '@material');

module.exports = {
    entry: "./index.js",
    output: {
        path: __dirname,
        filename: "bundle.js"
    },
    module: {
        loaders: [
            {
                test: /\.js$/,
                loader: "babel-loader",
            },
            {
                test: /\.scss$/,
                loader: "sass-loader!style-loader!css-loader",
                include: [
                    MDC_DIR
                ],
            }
        ],
    }
};

This is my index.js file
import * as mdc from 'material-components-web';
require('material-components-web/material-components-web.scss');

When I run webpack, it throws the following error:
ERROR in ./~/material-components-web/material-components-web.scss
Module parse failed: /Users/Me/project/mdc-babel-attempt/node_modules/material-components-web/material-components-web.scss Unexpected character '@' (17:0)
You may need an appropriate loader to handle this file type.
| //
|
| @import "@material/animation/mdc-animation";
| @import "@material/button/mdc-button";
| @import "@material/card/mdc-card";
 @ ./index.js 9:0-63

Which made me think it's not passing through the loader.
I even tried require('sass-loader!style-loader!css-loader!material-components-web/material-components-web.scss'); with no luck:
ERROR in ./~/sass-loader/lib/loader.js!./~/style-loader!./~/css-loader!./~/material-components-web/material-components-web.scss
Module build failed:
//
^
      Invalid CSS after "...load the styles": expected 1 selector or at-rule, was "var content = requi"
      in /Users/Me/project/mdc-babel-attempt/node_modules/material-components-web/material-components-web.scss (line 1, column 1)
 @ ./index.js 9:0-99

Been trying to do this for a week now, please help. Thanks in advance.

A: The MDC_DIR that you include in the rule, does not match the actual module. The module is material-components-web (just as you import it and as the error shows), but you only apply the rule for @material. You can remove the include option entirely, because you'll always need to handle Sass files to be able to use them with webpack.
The other issue is that your loader order is wrong. The loaders are applied in reverse order (from right to left), in your case that's:
css-loader -> style-loader -> sass-loader

You definitely want the sass-loader to be applied before the css-loader, because it transforms Sass to CSS, otherwise it will error on any Sass syntax that is not valid CSS. Even when you only use CSS syntax (without the extra Sass features) you'll get an error because style-loader transforms CSS to JavaScript, and that gets passed to sass-loader. The sass-loader expects Sass and JavaScript is not valid Sass syntax, therefore it will throw an error.
Your rule should be:
{
    test: /\.scss$/,
    loader: "style-loader!css-loader!sass-loader",
}

Or with the nicer webpack 2 syntax:
{
    test: /\.scss$/,
    use: ["style-loader", "css-loader", "sass-loader"],
}


text:
Q: A C# project cannot run on the other computers A quick question here lads, cannot run a visual studio project on another machine, receiving the CLR20r3 System.IO.DirectoryNotFound. The thing is that it has all resources needed inside the exe itself, and it's launching perfectly for me, both on debug and release versions, while crashing on any other machine. What can it possibly mean? Tried creating an installer, of course, same result. Works for me, doesn't work for others.
Thanks in advance.

A: Looks like the directory that you are trying to find is not present on the other machine.It would be hard to find and fix this error without knowing from where exactly the exception is thrown. Better add a try catch and log the exception somewhere like a text file or a remote database. Once you are able to get hold of the line where the exception is thrown and the actual exception, it would be lot easier to fix it. Hope it helps.

A: A silly mistake with not uploading properties with the project. And some weird problem with custom font, had to refer to it from properties directly. Case closed.


text:
Q: Android storing relative high amount of string_array in strings.xml will it affect the performance if i store about 1.5mb worth 100+ string_array data inside strings.xml?
Any other best method to store them?

A: I don't think there would be any noticeable performance problems with 1.5MB string.xml, except that your app would take up a little more RAM for the time it runs. It's fine, as long as it doesn't grow beyond, say 2-3 MBs, which might leave less RAM for other portions of your app.
Android will throttle the RAM anyway, so, if during your testing, you don't see any OutOfMemory errors, you are good to go.
But then, there might be other approaches, depending on what exactly your requirement is.


text:
Q: java.net.SocketException: Connection reset on Tomcat Only I know this has been asked before and I have tried looking at, at least 30 solutions on stackoverflow if not more, but nothing has worked so far.
I have a tomcat server which is querying into a REST api to fetch and store data. This is to avoid having to query for the data to the remote API every single time my app wants to load the data. The data changes only once in a while and hence this effort.
I have a simple code to connect
final URL url = new URL("https://remote.site.com/api/request?apikey=<some-key>");
HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
connection.setConnectTimeout(5000);
connection.setReadTimeout(5000);
connection.connect();
final InputStream inputStream = connection.getInputStream();
final InputStreamReader inputStreamReader = new InputStreamReader(inputStream);
final Gson gson = new Gson();
MyJSONResponse myJSONResponse = gson.fromJson(inputStreamReader, MyJSONResponse.class);

When I run this code from a Tomcat7 server on my MacBook it runs perfectly fine. I get the JSON and all is hunky dory. So I went ahead and ran this from inside the Tomcat7 server on my Ubuntu and I almost immediately get the SocketException.
I will concede that the data is a bit long, but I would expect it to wait for a few seconds before throwing this exception. But this exception is thrown on the line
HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();

which doesn't make sense to me.
To test further, I made a single class program containing just these lines of code and printing out the input stream I get from the remote api and ran this on my Ubuntu box and it runs perfectly fine. So there is nothing wrong with the Ubuntu box and it's internet connectivity. The Tomcat Server seems to be messing up something here.
I have been trying to do multiple things for 4-5 hours now with resetting the connection, not closing it in the finally block and other things but nothing seems to work.
Any help would really be appreciated.
Thanks
Edit:
Adding logs for timeout:
*** Init called
May 22, 2016 11:23:21 PM org.apache.http.impl.execchain.RetryExec execute
INFO: I/O exception (java.net.SocketException) caught when processing request to {s}->https://www.data.gov.in:443: Connection reset
May 22, 2016 11:23:21 PM org.apache.http.impl.execchain.RetryExec execute
INFO: Retrying request to {s}->https://www.data.gov.in:443
May 22, 2016 11:23:22 PM org.apache.http.impl.execchain.RetryExec execute
INFO: I/O exception (java.net.SocketException) caught when processing request to {s}->https://www.data.gov.in:443: Connection reset
May 22, 2016 11:23:22 PM org.apache.http.impl.execchain.RetryExec execute
INFO: Retrying request to {s}->https://www.data.gov.in:443
May 22, 2016 11:23:24 PM org.apache.http.impl.execchain.RetryExec execute
INFO: I/O exception (java.net.SocketException) caught when processing request to {s}->https://www.data.gov.in:443: Connection reset
May 22, 2016 11:23:24 PM org.apache.http.impl.execchain.RetryExec execute
INFO: Retrying request to {s}->https://www.data.gov.in:443
java.net.SocketException: Connection reset
    at java.net.SocketInputStream.read(SocketInputStream.java:196)
    at java.net.SocketInputStream.read(SocketInputStream.java:122)
    at sun.security.ssl.InputRecord.readFully(InputRecord.java:442)
    at sun.security.ssl.InputRecord.read(InputRecord.java:480)
    at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:946)
    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1344)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1371)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1355)
    at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:394)
    at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:353)
    at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:134)
    at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:353)
    at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:380)
    at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
    at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184)
    at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88)
    at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
    at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:107)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:55)
    at com.soulpatch.jersey.DataFetcher.init(DataFetcher.java:47)
    at com.soulpatch.jersey.DataFetcher.getBloodBanks(DataFetcher.java:86)
    at com.soulpatch.jersey.resources.BloodBanksResource.getBloodBanks(BloodBanksResource.java:28)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)
    at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144)
    at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161)
    at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$TypeOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:205)
    at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99)
    at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389)
    at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347)
    at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102)
    at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:326)
    at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
    at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
    at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
    at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
    at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
    at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
    at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305)
    at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154)
    at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:473)
    at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427)
    at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388)
    at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341)
    at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:313)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)

A: It seems, the site that I was hitting was the culprit. My server seems to work properly when I hit https://www.google.com.
So I believe it has to do with the SSL certificate resolution on my Tomcat.


text:
Q: Vim is missing on Lion I uninstalled brew and macports and reinstalled homebrew. I dont have vi under /usr/bin/ anymore. How can I fix this?
I tried using brew to install it but it says
Error: No available formula for vi
Apple distributes vi with OS X, you can find it in /usr/bin.

A: If you have Macports then use:

sudo port install vim

A: After a lot of searching around this worked for me:
brew install https://raw.github.com/Homebrew/homebrew-dupes/master/vim.rb


text:
Q: Inversion count using merge sort: Why must I copy the temp array back into the original array in the merge subroutine? I was looking at a piece of code on the web for inversion count using merge sort. The merge subroutine in the code takes two arrays as parameters, including arr[], the original array whose inversions need to be counted, and a temp array used for the sorting. But the only thing that the merge part actually returns is the number of inversions between the two arrays (it doesn't return an array). There's a for loop at the end of the subroutine that copies all of the values of the temp array back into the array arr[], so that arr[] becomes merged. The program only works correctly with this for loop, but I can't see why. Don't both of the arrays passed as arguments fall out of scope when the method returns? How does it affect anything to have arr[] change at the very end of the subroutine?
  static long mergeSort(int arr[], int array_size)
    {
        int temp[] = new int[array_size];
        return _mergeSort(arr, temp, 0, array_size - 1);
    }

    static long _mergeSort(int arr[], int temp[], int left, int right)
    {
        int mid = 0;
        long inv_count = 0;
        if (right > left) {

            mid = (right + left) / 2;

            inv_count = _mergeSort(arr, temp, left, mid);
            inv_count += _mergeSort(arr, temp, mid + 1, right);

            inv_count += merge(arr, temp, left, mid + 1, right);
        }
        return inv_count;
    }

    static long merge(int arr[], int temp[], int left, int mid, int right)
    {
       int i = left;
       int k = left;
       int j = mid;
       long mergeInvCount = 0;

       while (i < mid && j <= right) {
           if (arr[i] <= arr[j]) {
               temp[k++] = arr[i++];
           } else {
               temp[k++] = arr[j++];
               mergeInvCount = mergeInvCount + mid - i;
           }
       }
     while(i < mid) {
         temp[k++] = arr[i++];
           }
     while(j <= right) {
         temp[k++] = arr[j++];
       }
/* I don't get what this code is doing:*/
        for (i = left; i <= right; i++) {
            arr[i] = temp[i];
        }
         return mergeInvCount;
    }

    public static void main(String[] args) throws IOException
    {
        int coolArray[] = {5, 78, 2, 34, 56, 23, 45, 2, 65, 4, 2, 4};
        System.out.println(mergeSort(coolArray, 12));
    }
}

The code I'm confused about is near the bottom, below the comment.
Thanks so much for any help.

A: There are two ways to deal with but in any case you'd require some extra space.

*

*Either create temporary left and right subarray and make changes in the original array while sorting, Or

*The one used here, use a temporary array apply merge sort over it and copy the values back in the original array. Because if we won't copy back to the original array (the subarray will remain unsorted in the original array and hence when we will apply the merge on it, the inversions will be different than the actual count).
An alternate and perhaps, less confusing approach is the following one:
private static int mergeAndCount(int[] arr, int l, int m, int r)
{

    int[] left = Arrays.copyOfRange(arr, l, m + 1);
    int[] right = Arrays.copyOfRange(arr, m + 1, r + 1);

    int i = 0, j = 0, k = l, swaps = 0;

    while (i < left.length && j < right.length) {
        if (left[i] <= right[j])
            arr[k++] = left[i++];
        else {
            arr[k++] = right[j++];
            swaps += (m + 1) - (l + i);
        }
    }
    return swaps;
}

private static int mergeSortAndCount(int[] arr, int l, int r)
{
    int count = 0;

    if (l < r) {
        int m = (l + r) / 2;

        count += mergeSortAndCount(arr, l, m);

        count += mergeSortAndCount(arr, m + 1, r);

        count += mergeAndCount(arr, l, m, r);
    }

    return count;
}


text:
Q: How to create custom view of markers in google maps in swift How to show custom view markers in Google Maps

A: Here's the documentation on how to add markers.
Specifically, these few lines:
let position = CLLocationCoordinate2D(latitude: 10, longitude: 10)
let marker = GMSMarker(position: position)
marker.title = "Hello World"
marker.icon = GMSMarker.markerImage(with: .black) // or any image here
marker.map = mapView


text:
Q: Where do I have to go to find my promotional weapons? I've gotten as far as the citadel, and I haven't found my promotional weapons from playing the Kingdom of Amalur demo.
Where should I go to find my Chakram Launcher and Reckoner Knight armor?  If they should have been automatically added, how do I link my 2 EA accounts?
Just to round out the question, where is the other pre-order gear picked up from?

A: From a post on the Official Bioware Forums:

"Instructions for Single Player In-Game Item Requisition

*

*Log in with the same account you used to redeem your code in Origin or with the account you used to access the BioWare Social Network
  website.

*Allow the DLC to download and install.

*Run Mass Effect 3.

*Start a new game or load an existing one.

*The in-game items will be available once you gain access to the Normandy after completing the game's prologue.

*The items will appear on the Weapon Bench or in the Armor Locker located on the Normandy."

So you should find the weapon and the armor once you have access to the Normandy. Make sure that you're using the correct account and everything is working on that end.

A: The Chakram launcher should be available to you immediately. Once you find the first weapon bench you should be able to select it under the list of available assault rifles. Alternately, if you find a weapon during a mission, you can choose to change your loadout and equip the weapon that way.
If the weapon isn't showing up, it might be that it wasn't unlocked. In order to unlock the Chakram Launcher, you have to get to the end of the 45 minute timed segment of the Kingdomes of Amalur demo.
The Reckoner Knight armor should be available once you return to the Normandy after the Citadel section. If you go to the armory, there is an area that allows you to change your armor. The second slider down allows you to select the Reckoner armor.
Regarding your EA accounts, no additional linking should be necessary as long as you're playing with the same account/console that you played the demo on.

A: If none of the other suggestions work out (as they did not in my case) you have to contact EA customer support directly.
Once they look and see everything is legit, they are able to manually activate the promotional items.  I used Live Chat and everything was resolved in about 15 minutes.


text:
Q: Custom label circle at specific degree intervals In order to draw a circle with numeric labels at specific degree intervals, I use the following code.
\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[line cap=rect,line width=3pt]
\draw[] (0,0) circle [radius=8cm];
\foreach \angle [count=\xi] in {60,30,...,-270}
{
  \draw[line width=1.5pt] (\angle:7.8cm) -- (\angle:8.2cm);
  \node[font=\large] at (\angle:9cm) {\xi*12000};
}
\end{tikzpicture}
\end{document}

The labels should constitute products of the loop counter and the integer 12000 and shall, consequently, read 12000, 24000, 36000, etc. The current code, however, prints the multiplication literally as a string.
What would correct code look like?

A: There are two other ways without loading any extra package. Note that I did \xi*12 and added the 000 manually to ease and speed up the calculation and thus the compiling process.
With a \pgfmathtruncatemacro
\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[line cap=rect,line width=3pt]
\draw[] (0,0) circle [radius=8cm];
\foreach \angle [count=\xi] in {60,30,...,-270}{
\pgfmathtruncatemacro{\xx}{\xi*12}
  \draw[line width=1.5pt] (\angle:7.8cm) -- (\angle:8.2cm);
  \node[font=\large] at (\angle:9cm) {\xx 000};
}
\end{tikzpicture}
\end{document}

Using the in-built functionality evaluate
\documentclass[margin=10pt]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[line cap=rect,line width=3pt]
\draw[] (0,0) circle [radius=8cm];
\foreach \angle [count=\xi, evaluate=\xi as \xx using int(\xi*12)] in {60,30,...,-270}{
  \draw[line width=1.5pt] (\angle:7.8cm) -- (\angle:8.2cm);
  \node[font=\large] at (\angle:9cm) {\xx 000};
}
\end{tikzpicture}
\end{document}

And here's the result in both cases:

A: The fp package has what you need - try the code below.
\documentclass{standalone}
\usepackage{tikz,fp}
\begin{document}
\begin{tikzpicture}[line cap=rect,line width=3pt]
\draw[] (0,0) circle [radius=8cm];
\foreach \angle [count=\xi] in {60,30,...,-270}
{
  \FPeval{\result}{round(\xi*12000,0)}
  \draw[line width=1.5pt] (\angle:7.8cm) -- (\angle:8.2cm);
  \node[font=\large] at (\angle:9cm) {\result};
}
\end{tikzpicture}
\end{document}

A: A way to do this with MetaPost (coding included in a LuaLaTeX program for typesetting convenience).
It makes use of the freelabel macro for circular labelling, which is provided by the Metafun format of MetaPost, and of the numprint LaTeX package for number formatting.
\documentclass[border=2mm]{standalone}
\usepackage{luamplib, numprint}
  \mplibtextextlabel{enable}
  \mplibsetformat{metafun}
  \mplibnumbersystem{double}
\begin{document}
  \begin{mplibcode}
    beginfig(0);
      u = 3cm; len = 4bp; pair radius, hmark;
      draw fullcircle scaled 2u;
      freelabeloffset := 6bp;
      for i = 1 upto 12:
        angl := 90-30i;
        radius := u*dir angl; hmark := .5len*dir angl;
        draw (-hmark -- hmark) shifted radius;
        freelabel("\numprint{" & decimal(12000i) & "}", radius, origin);
      endfor;
    endfig;
  \end{mplibcode}
\end{document}


text:
Q: Transfer a text value from a drop down list into it's respective database ID - sql insertion and php I'm having trouble converting a drop down list value (:Artist, text) into its respective ID (Artist_ID, num) and inserting it into the event table. Same problem with Venue_ID.
<?php
        $artist =
                'SELECT Artist_ID
                 FROM artist
                 WHERE :Artist = Artist_Name
                ';
        $venue =
                'SELECT Venue_ID
                 FROM venue
                 WHERE :Venue = Venue_Name
                ';
        $stmt = $pdo->prepare(
               'INSERT INTO event(Event_Date, Artist_ID, Venue_ID, Price)
                VALUES (:Event_Date, $artist, $venue, :Price)');

        $stmt->bindparam('Artist_ID', $_POST[$artist], PDO::PARAM_STR);
        $stmt->bindparam('Venue_ID', $_POST[$venue], PDO::PARAM_STR);
        $stmt->bindparam('Date', $_POST[':Date'], PDO::PARAM_STR);
        $stmt->bindparam('Price', $_POST[':Price'], PDO::PARAM_STR);
        $stmt->execute();
        $newId = $pdo->lastInsertId();
        exit;
?>

This is the code for the drop down list:
<select name='Artist' id=':Artist'>
<?php
     $stmt = $mysqli->prepare(
      'SELECT Artist_Name
       FROM artist
       ORDER BY Artist_Name');
       $stmt->execute();
       $stmt->bind_result($Artist);
       $stmt->store_result();
       while($stmt->fetch())
           echo("<option> {$Artist} </option>");
?>
</select>

The artist and venue tables have text values that are assigned a primary key ID which is stored into the event table with the artists date and price.
Any help would be appreciated, thanks.

A: try this, select the artist id as well and pass it in your dropdown as the value like this:
<select name='Artist' id=':Artist'>
<?php
     $stmt = $mysqli->prepare(
      'SELECT Artist_Name, Artist_ID
       FROM artist
       ORDER BY Artist_Name');
       $stmt->execute();
       $stmt->bind_result($Artist, $ID);
       $stmt->store_result();
       while($stmt->fetch())
           echo("<option value=\"$ID\"> {$Artist} </option>");
?>
</select>

I think you also need to update the POST elements in your code, but I'm not sure what you're doing with the :Artist type vars in the first part.  If you use the id's as the value (as i did here) then the posted value will be the id of the name they chose, you don't need to query it.
<?php
    $artist = $_POST['Artist'];
    $venue = $_POST['venue'];

    $stmt = $pdo->prepare(
           'INSERT INTO event(Event_Date, Artist_ID, Venue_ID, Price)
            VALUES (:Event_Date, :Artist, :Venue, :Price)');

    $stmt->bindparam(':Artist', $artist, PDO::PARAM_STR);
    $stmt->bindparam(':Venue', $venue, PDO::PARAM_STR);
    $stmt->bindparam(':Event_Date', $_POST['Date'], PDO::PARAM_STR);
    $stmt->bindparam(':Price', $_POST['Price'], PDO::PARAM_STR);
    $stmt->execute();
    $newId = $pdo->lastInsertId();
    exit;

?>


text:
Q: Is the ring $A=\mathbb{Z}[T_{\alpha}]$, a ring, such that any ring can be expressed as a subring/quotient ring of $A$? Is the ring $A=\mathbb{Z}[T_{\alpha}]$, a ring, such that any ring can be expressed as a subring/quotientring of $A$?
The only rings I am concerned about are commutative rings with 1.
This question occured to me when reading local fields by Serre. In Thm 7 of Chapter II he states that

But if the theorem is proved for one ring $A$, it is also valid for every subring and every quotient ring. As it is true for every polynomial ring $\mathbb{Z}'[T_{\alpha}]=\mathbb{Z}[p^{-1}; T_{\alpha}]$ it holds for $\mathbb{Z}[T_{\alpha}]$ hence for all rings.

implying that every ring can be interpreted as a subring or quotient ring of $\mathbb{Z}[T_{\alpha}]$. How could one formally proof this?
I am aware how to construct the rational, real and complex numbers as well as any extensions from this, but have never gotten in touch with the thought of constructing all and every ring. Or is it just implied by the fact that i can construct $\mathbb{C}$ as an algebraic closed ring and all its extensions?

A: Every ring $A$ is  canonically the quotient of a polynomial ring, namely: $$ \mathbb Z[T_a\vert a\in  A]   \twoheadrightarrow A: T_a\mapsto a                                                  $$

A: It's similar to the statement about any group as the quotient of a free group.
Let $T_{\alpha} = \{\bar{x_0}, \bar{x_1}, \dots \}  $ be a set of 'letters'  for generators of $\{x_0, x_1, \dots \} \subset A$ and define a map $\mathbb{Z}[T_{\alpha}] \to A$ by $\bar{x}  \mapsto x$ for each $\bar{x} \in T_{\alpha}$. This is a surjective homomorphism, so...


text:
Q: Which permission is needed to configure GCP Cloud SQL meintenance notification settings? In GCP Cloud SQL, the instance sometimes will have to reboot for maintenance.
The doc mentions we can receive a maintenance notification email.
However, I cannot enable it even if I follow the instruction.
The setting page I am referring to is this.
In the setting page I can choose the project but the production project I want to configure doesn't show up in the list. However, other projects such as development or staging are shown up.
Our organization configures IAM settings to prevent employees to see the real production data. So I guess I don't have enough permission to configure it.
I already obtained cloudsql.editor for the production project but I still don't see the project in the list.
The problem is I don't know which permission is exactly needed to set up the CloudSQL maintenance notification. I don't find it is mentioned in the doc.
Does someone know which permission I still need?

A: Role you mentioned is not enough to use Cloud SQL. To be able to administer this feature you need (besides having cloudsql.editor role) some roles that are required for general GCP use such as:

*

*resourcemanager.projects.get

*resourcemanager.projects.list

*serviceusage.quotas.get

*serviceusage.services.get

*serviceusage.services.use

Have a look at the documentation describing roles for Cloud SQL use; it describes all the permissions that you need to perform specific tasks.
To check if you have those for the production project run this gcloud command:
gcloud projects get-iam-policy <YOUR GCLOUD PROJECT>  \
--flatten="bindings[].members" \
--format='table(bindings.role)' \
--filter="bindings.members:<YOUR SERVICE ACCOUNT>"


text:
Q: Android emulator API 1.6, Manage Applications > (see screenshot) I've noticed a strange app on my Android Emulator (1.6)
Does anyone know what this is?  I can't un-install it, and "Force Quit" doesn't seem to do anything.
It doesn't appear to take up any memory, but it has all kinds of permissions.
I don't know how to research this, because I don't read that language.
My specific questions are:
Has anyone seen this on their emulator?
Is it some kind of virus or Trojan, etc.?
Only one screen shot(Dont'ask for more, stackoverflow wont let me.):
http://img834.imageshack.us/i/weirdapp.png/

A: It's Google Pinyin Input Method, a way to input Chinese character using Pinyin.
You can see more options about this at Settings->Locale & Text.
So, no, that's not a virus or trojan.


text:
Q: Intuition for torsion of a chain complex and application to lens spaces I have read a bit about the torsion of an acyclic complex.  One of my concrete hopes was that I could understand why $L(7,1)$ and $L(7,2)$ are not homeomorphic - I am under the impression that classifying lens spaces was I problem that motivated Reidemeister to introduce torsion.
All of the definitions of torsion that I have seen are totally opaque to me.  How do people think of the torsion of a chain complex and how in trying to classify lens spaces could I have been led to defining/computing torsions?

A: Consider the special case   of  the simplest complex of   real vector spaces $\newcommand{\pa}{\partial}$
$$0\to U_0 \stackrel{\pa}{\to} U_1\to 0.$$
(Ultimately everything can be reduced to this simple situation via some algebraic tricks.)
This complex is acyclic iff $\pa$ is an isomorphism.     By chossing bases in $U_0$ and $U_1$ appropriately we can  represent  $\pa$ as the identity matrix.
Assume this complex is acyclic and set $n=\dim U_0=\dim U_1$.
The torsion arises when $U_0$ and $U_1$ have additional data attached to them. Assume that $L_0$ and $L_1$ are lattices in $U_0$ and respectively $U_1$ such that $\pa(L_0)\subset L_1$. (These are  finitely generated  Abelian subgroups that span their respective ambient spaces.  $\newcommand{\bZ}{\mathbb{Z}}$ $\newcommand{\bR}{\mathbb{R}}$ Think of the subgroup $\bZ^n$ of $\bR^n$.)
A $\bZ$-basis  $\newcommand{\ue}{\underline{\mathbf{e}}}$ $\newcommand{\uf}{\underline{\mathbf{f}}}$ $\ue_i$ of $L_i$  is also an $\bR$-basis of $U_i$.  By choosing  $\bZ$-bases $\ue_0$, $\ue_1$ of $L_0$ and respectively $L_1$ we can represent $\pa$ as an $n\times n$ matrix $M(\pa,\ue_0,\ue_1)$.
Observe that if $\uf_0$ and $\uf_1$ are  other  $\bZ$-bases of $L_0$ resp $L_1$, then
$$|\det M(\pa,\ue_0,\ue_1)|=|\det M(\pa,\uf_0,\uf_1)|=|L_1/\pa L_0|,  $$
where $|S|$ denotes the cardinality of the set $S$.
We see that if  the associated  complex  is obtained from a complex of Abelian groups we can associated an invariant, the above determinant, or the order of the quotient $L_1/\pa L_0$. The  torsion of this complex is the  defined (up to a sign) to be the number
$$\tau(\pa,L_0,L_1):=\pm \frac{1}{\det M(\pa,\ue_0,\ue_1)} =\pm \frac{1}{|L_1/\pa L_0|}. $$
The  chain complexes that appear in topology  often come equipped with such lattices. Think of simplicial homology with local coefficients, or the chain complex associated  to a $CW$-decomposition. You get  one such invariant for every triangulation and every choice of local coefficients. For the Reidemeister torsion, the local coefficients are Abelian and correspond to  group morphisms $\pi_1\to \mathbb{C}^*$.
It turns out that for smooth manifolds the resulting invariant is independent of the triangulations used to define the torsion.
This is only the beginning of the story and I have omitted  many  important details. It should help you navigate the first part of my book on torsion where you will find many other descriptions and applications.


text:
Q: Spring Concordion and Sonar won't work : jar conflict? I work on a Gwt/Spring project with maven/jenkins/sonar. For my functionnal tests, I use concordion over gwt-test-utils.
Everything works great except while running the sonar analysis.
Here's the exception for each of these tests :
org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.sc.r.repository.MyRepository com.sc.r.BootstrapData.myRepository;
   nested exception is java.lang.IllegalArgumentException: Can not set com.sc.r.repository.MyRepository field com.sc.r.BootstrapData.myRepository to $Proxy110

It seems like a jar conflict, but without more informations i don't know.
Due to the "exotic" nature of my configuration, i understand that no one could directly help me.
But how would you investigate if you were in my position ? What should i look for or where should i look ?
Thanks

A: What makes you think it's a dependency conflict? Can't see much from the exception that would describe it as a conflict.
If you definitely know it's a conflict issue try doing :
mvn dependency:tree

And isolate the replica jars and remove them from the dependencies in maven using the excludes tag.


text:
Q: Looking for inequalities that relate $\sum_{k=1}^n x_k/(x_k+1)$ and $\sum_{k=1}^n x_k$ I'm working on a problem about the convergence of series. As such, I would like to ask for inequalities that relate $\sum_{k=1}^n x_k/(x_k+1)$ and $\sum_{k=1}^n x_k$ where $x_k \ge 0$ for all $k$. My desired inequality is of the form $$\sum_{k=1}^n x_k \le f$$
where $f$ is a function depends on $\sum_{k=1}^n x_k/(x_k+1)$ and $\sum_{k=1}^n x_k$, and $f$ is independent of $n$.
Thank you so much!


text:
Q: Spring Upgrade cause issues dispatcherServletRegistration We are trying to upgrade Spring boot app from 1.5.9 to 2.2.7. We use the following Servlet Registrations in the app:
@Bean
public ServletRegistrationBean dispatcherServletRegistration() {
    ServletRegistrationBean registration = new ServletRegistrationBean(new DispatcherServlet());
    Map<String, String> params = new HashMap<String, String>();
    params.put("org.atmosphere.servlet", "org.springframework.web.servlet.DispatcherServlet");
    params.put("contextClass", "org.springframework.web.context.support.AnnotationConfigWebApplicationContext");
    registration.setInitParameters(params);
    return registration;
}

@Bean
public ServletRegistrationBean configureJerseyForRESTfulWebService() {
    ServletRegistrationBean registration = new ServletRegistrationBean(new ServletContainer(), "/service/*");
    registration.addInitParameter(ServletProperties.JAXRS_APPLICATION_CLASS, JerseyConfig.class.getName());
    registration.addInitParameter("com.sun.jersey.api.json.POJOMappingFeature", "true");
    return registration;
}

@Bean
public FilterRegistrationBean securityFilterRegistration() {
    FilterRegistrationBean registration = new FilterRegistrationBean();
    registration.setFilter(new SecurityFilter());
    registration.addUrlPatterns("/*");
    registration.setName("SecurityFilter");
    registration.setOrder(1);
    return registration;
}

After the upgrade, we are getting the following errors during startup and service unable to run:
Parameter 0 of method errorPageCustomizer in org.springframework.boot.autoconfigure.web.servlet.error.ErrorMvcAutoConfiguration required a bean of type 'org.springframework.boot.autoconfigure.web.servlet.DispatcherServletPath' that could not be found.

The following candidates were found but could not be injected:
    - Bean method 'dispatcherServletRegistration' in 'DispatcherServletAutoConfiguration.DispatcherServletRegistrationConfiguration' not loaded because DispatcherServlet Registration found servlet registration bean dispatcherServletRegistration

Action:

Consider revisiting the entries above or defining a bean of type 'org.springframework.boot.autoconfigure.web.servlet.DispatcherServletPath' in your configuration.

Any hint how to resolve theses errors/issues. If possible please share any code example, thanks


text:
Q: Error java.lang.NumberFormatException: For input string: "test@admin.co" How Can I Solve This Error?
Here is My Data Class
data class SsnRequest(
private val ssn: String,
private val customer_id: Int,

)
And This is APIService
@POST(AppConstants.PRODUCT_BY_SSN)
suspend fun getSimBySSN(
    @Path("id") salesManagerId: Int,
    @Body ssn: SsnRequest
): Response<SSNResponse>

A: I think you passing string!
check your data passing to data class
or change your data class like below :
data class SsnRequest(
private val ssn: String,
private val customer_id: String,


text:
Q: Can I run Azure DevOps pipeline without committing it? I am planning to experiment building a pipeline using Azure DevOps. One thing that I noticed early on is, after azure-pipelines.yml created, I have to commit this first before being able to run it. But I want to experiment on it which revolves around trial and error. Doing multiple commit just to test things out are not feasible.
In Jenkins I can just define my steps and try to run it without committing the file.
Is this also possible to do in Azure DevOps?

A:
But I want to experiment on it which revolves around trial and error. Doing multiple commit just to test things out are not feasible.

Yes it is - you just use a different code branch. That will allow you the freedom to make as many changes as you need, while putting the pipeline together and trying it out, without committing to the master branch.
Then when you're happy with the way the pipeline is running, you can merge your branch into the master branch which the pipeline normally uses.

A: You cannot run YAML pipelines without committing them, but you can create classic pipelines and run them without committing anything pipeline-related to the repository (except for the source code you want to build). Classic pipelines  can later be turned (or copy-pasted, to be exact) into yaml pipelines with view YAML -option.
https://learn.microsoft.com/en-us/azure/devops/pipelines/get-started/pipelines-get-started?view=azure-devops#define-pipelines-using-the-classic-interface

A: If you're on your own branch, or in a repository without any other developers making changes then you can

*

*Make a change

*use git commit --amend to overwrite your previous commit with the new file

*use git push --force-with-lease to push that up to Azure DevOps

That will hide your commit history while experimenting


text:
Q: Android PackageManager enable any application I have developed an application in which I have enabled that any application which we have can be installed manually
But my problem is that I only want to enable my own package name and rather not any other application package name.
Here is the code I have used.
try {
    PackageManager pm1 = getPackageManager();

    pm1.setComponentEnabledSetting(new ComponentName("com.service",
    "com.service.EnableActivity"),
    PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
        PackageManager.DONT_KILL_APP
    );
} catch (SecurityException e) {
    e.printStackTrace();
}

here "com.service" is the package name that I install and "com.service.EnableActivity" is my first app launcherActivity.
Log
java.lang.SecurityException: Permission Denial: attempt to change component state from pid=3354, uid=10056, package uid=10058 at
android.os.Parcel.readException(Parcel.java:1322) at
android.os.Parcel.readException(Parcel.java:1276) at
android.content.pm.IPackageManager$Stub$Proxy.setComponentEnabledSettingIPackageManager.java:2217)

But when I use the same application packagename and classname then it's working fine.

A: Add this code in your both applications mainfest.
<manifest
  .......
  .......
  .......
  android:sharedUserLable="...."
  android:sharedUserID="...">

because it need a userid to be same
This will help you.

A: Looking at the platform I see the following:
<!-- Allows an application to change whether an application component (other than its own) is
     enabled or not. -->
<permission android:name="android.permission.CHANGE_COMPONENT_ENABLED_STATE"
    android:label="@string/permlab_changeComponentState"
    android:description="@string/permdesc_changeComponentState"
    android:protectionLevel="signatureOrSystem" />

Note that because this is "signatureOrSystem" (and it is declared in the system) it can only be used by apps that are signed with the system signature, in other words you need to be an Android vendor (HTC, Samsung, Motorola, etc). See this for more info:
http://developer.android.com/guide/topics/manifest/permission-element.html
UPDATE:
Gurjinder Singh Pabla has the right answer, if you are trying to change the enabled state of your own components or applications then you need to ensure that they have the same user id, which is set in the AndroidManifest. You only need to be a Vendor if you want to disable other packages that have different user ids. You can see the check in the Android source in PackageManagerService.java is:
final int uid = Binder.getCallingUid();
final int permission = mContext.checkCallingPermission(
            android.Manifest.permission.CHANGE_COMPONENT_ENABLED_STATE);
final boolean allowedByPermission = (permission == PackageManager.PERMISSION_GRANTED);

// ...

if (!allowedByPermission && (uid != pkgSetting.userId)) {
    throw new SecurityException(
        "Permission Denial: attempt to change component state from pid="
        + Binder.getCallingPid()
        + ", uid=" + uid + ", package uid=" + pkgSetting.userId);
}


text:
Q: Drop Shadow in DrawRect I made this cool pie chart and now I'd like to drop a shadow under it.
Is there anyway I can do it with DrawRect ?

I'd like to do it right under the pie chart (drawn using DrawRect).
Suggestions are welcome

A: Have a look at BNPiechart here - http://bynomial.com/blog/?p=104 . The code is open source.You can use it directly.If you do not want to use the library, you can refer the code for creating the shadow.


text:
Q: get single object from string using java I want to read single object from string . Here is my output string  :
{\"session\": {\"application_id\":\"xxxx\",\"nonce\":\"xxxxx\",\"user_id\":\"xxxxx\",\"created_at\":\"xxxxx\",\"token\":\"xxxx\",\"id\":\"xxx\"}}

i want to get "token" from this string . how can i read it?
i had tried using below code :
JSONObject element = new JSONObject(<string object i.e. response>);
String token = object.getString("token");

but getting below error :
constructor JSONObject in class JSONObject cannot be applied to given types;
required: no arguments
found: String
reason: actual and formal argument lists differ in length

Can anybody help me for this?

A: You are probably using the wrong import.
It seems that you use com.google.gson.JSONObject instead of org.json.JSONObject.
Edit:
Furthermore your code is wrong. You need element.getJSONObject("session").getString("token") not object.getString("token")
Edit:
Since the OP still has problems here some tested code:
import org.json.JSONObject;

public class JsonTest
{
    public static void main( String[] args )
    {
        String json = "{\"session\": {\"token\":\"xxxx\"}}";
        JSONObject jObject= new JSONObject(json);
        String token = jObject.getJSONObject("session").getString("token");
        System.out.printf("Token %s" , token);
    }
}


text: Q: Web.config Transformation- VS Extension I was using a visual studio extension named "FAST KOALA" in the past to help myself for debugging easily an asp.net web application by transforming environment variables in web.config based on project configuration in Visual Studio 2015. Now, we use Visual Studio 2017 and that extension doesn't support VS 2017 yet. I'm looking for an extension that can help me transform web.config file when debugging (F5) in VS 2017 version. FYI- I know VS supports web.config transformation when publishing code from VS


text:
Q: How to calculate the distance between an array and a matrix Consider a matrix A and an array b. I would like to calculate the distance between b and each row of A. For instance consider the following data:
A <- matrix(c(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), 3, 5, byrow=TRUE)
b <- c(1, 2, 3, 4, 5)

I would expect as output some array of the form:
distance_array = c(0, 11.18, 22.36)

where the value 11.18 comes from the euclidean distance between a[2,] and b:
sqrt(sum((a[2,]-b)^2))

This seems pretty basic but so far all R functions I have found allow to compute distance matrices between all the pairs of rows of a matrix, but not this array-matrix calculation.

A: I would recommend putting the rows a A in list instead of a matrix as it might allow for faster processing time. But here's how I would do it with respect to your example
A <- matrix(c(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), 3, 5, byrow=TRUE)

b <- c(1, 2, 3, 4, 5)

apply(A,1,function(x)sqrt(sum((x-b)^2)))


text:
Q: How to insert window.load function to existing code I need the page to wait until all images are loaded and ready before displaying them. Where in the code below will I insert $(window).load(function(){ }?
Code
function adshandler() {
var d = new Date();
var cache = d.getTime();
$.getJSON("check_time.php?cache=" + cache, function(update) {
    if (update.count === true) {
        location.reload();
    }
});
}
setInterval(adshandler, 600000);


text:
Q: Electric density on the edge of a hollow spherical conductor Suppose I have a sphere with radius $R$ and charge $Q$ and another hollow sphere with inner radius $2R$ and outer radius $3R$ with charge $2Q$, both of them are conductive.
I want to calculate the charge density on the surfaceses of the 2 spheres. for the inner one its easy because the desity is uniform its just $$\sigma = \frac{Q_{in}}{\text{Area}} = \frac{Q}{4\pi R^2}$$
but for the outer sphere i had a problem. i said that the charge of the inner surface is $q$ and then the outer one must be $2Q-q$. and then i tried to use gauss law for a point between $2R$ and $3R$. then
$$\frac{Q_{in}}{\epsilon_0} = \oint _V E \cdot dA$$
$$\frac{q+Q}{\epsilon_0} =4\pi r^2 \left( \frac{kQ}{r^2} + \frac{kq}{r^2}\right)$$
$$k(q+Q) = r^2\left( \frac{kQ}{r^2} + \frac{kq}{r^2}\right) = k(q+Q)$$
and then I basically did nothing.
What did I do wrong? How can I find the density of the outer sphere? thank you!

A: If you have a spherical conductor with inner and outer radii $2R$ and $3R$ and total charge $2Q$, then all charges stay on the outer suface, so the surface charge density would be $\sigma=\frac{2Q}{4\pi(3R)^2}$. If you have other charges $q$ in addition to $2Q$, then the total charge on the outer surface would be $2Q+q$ and the density is $\sigma=\frac{2Q+q}{4\pi(3R)^2}$. Since the sphere is conductor, NO charge can stay on the inner surface.


text:
Q: Is there a way of showing Salesforce a bunch of codes and it telling me how many exist already? Basically I upload products into SF every week - we have had an issue with our product tool and basically may need to load in thousands that are missing.
We identify every product with a 'module code' (e.g. GDGE0758CAR) - Is there an app or a method of being able to show SalesForce hundreds / thousands of these codes and it tell me how many of them exist already? Possibly an app or anything really.
Kind regards
Paul

A: For text fields, there is a configuration option to use it as an external id.

Upserting Records
Using the upsert operation, you can either insert or update an existing record in one call. To determine whether a record already exists, the upsert statement or Database method uses the record's ID as the key to match records, a custom external ID field, or a standard field with the idLookup attribute set to true.

*

*If the key is not matched, then a new object record is created.

*If the key is matched once, then the existing object record is updated.

*If the key is matched multiple times, then an error is generated and the object record is neither inserted or updated.


text:
Q: Proguard in Android Studio: Running proguardRelease complains of unresolved references I'm trying to use Proguard for my release in Android Studio.
I have the classic problem that everyone has which is the "Unresolved references to classes or interfaces".
Like I read everywhere, I tried to add -dontwarn command to the proguard-project.txt file but it doesn't change anything.
Maybe my setup just ignore the proguard-project.txt file? Everything seems ok but I'm new to Android Studio, gradle and proguard so maybe I'm missing something! Any help is appreciated.
Here are my files:
proguard-project.txt
-dontwarn org.apache.**

project.properties
proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt

# Project target.
target=android-15
android.library=false

Current warning I receive
Warning:org.apache.commons.compress.archivers.sevenz.Coders$1: can't find referenced class org.tukaani.xz.X86Options
Warning:org.apache.commons.compress.archivers.sevenz.Coders$1: can't find referenced class org.tukaani.xz.PowerPCOptions
Warning:org.apache.commons.compress.archivers.sevenz.Coders$1: can't find referenced class org.tukaani.xz.IA64Options
Warning:org.apache.commons.compress.archivers.sevenz.Coders$1: can't find referenced class org.tukaani.xz.ARMOptions
Warning:org.apache.commons.compress.archivers.sevenz.Coders$1: can't find referenced class org.tukaani.xz.ARMThumbOptions
Warning:org.apache.commons.compress.archivers.sevenz.Coders$1: can't find referenced class org.tukaani.xz.SPARCOptions
Warning:org.apache.commons.compress.archivers.sevenz.Coders$BCJDecoder: can't find referenced class org.tukaani.xz.FilterOptions
Warning:org.apache.commons.compress.archivers.sevenz.Coders$BCJDecoder: can't find referenced class org.tukaani.xz.FinishableWrapperOutputStream
Warning:org.apache.commons.compress.archivers.sevenz.Coders$BCJDecoder: can't find referenced class org.tukaani.xz.FilterOptions
Warning:org.apache.commons.compress.archivers.sevenz.Coders$BCJDecoder: can't find referenced class org.tukaani.xz.FinishableOutputStream
Warning:org.apache.commons.compress.archivers.sevenz.Coders$LZMADecoder: can't find referenced class org.tukaani.xz.LZMAInputStream
Warning:org.apache.commons.compress.archivers.sevenz.DeltaDecoder: can't find referenced class org.tukaani.xz.DeltaOptions
Warning:org.apache.commons.compress.archivers.sevenz.DeltaDecoder: can't find referenced class org.tukaani.xz.FinishableWrapperOutputStream
Warning:org.apache.commons.compress.archivers.sevenz.DeltaDecoder: can't find referenced class org.tukaani.xz.DeltaOptions
Warning:org.apache.commons.compress.archivers.sevenz.DeltaDecoder: can't find referenced class org.tukaani.xz.UnsupportedOptionsException
Warning:org.apache.commons.compress.archivers.sevenz.LZMA2Decoder: can't find referenced class org.tukaani.xz.LZMA2Options
Warning:org.apache.commons.compress.archivers.sevenz.LZMA2Decoder: can't find referenced class org.tukaani.xz.LZMA2InputStream
Warning:org.apache.commons.compress.archivers.sevenz.LZMA2Decoder: can't find referenced class org.tukaani.xz.FinishableWrapperOutputStream
Warning:org.apache.commons.compress.archivers.sevenz.LZMA2Decoder: can't find referenced class org.tukaani.xz.LZMA2Options
Warning:org.apache.commons.compress.archivers.sevenz.LZMA2Decoder: can't find referenced class org.tukaani.xz.FinishableOutputStream
Warning:org.apache.commons.compress.archivers.sevenz.LZMA2Decoder: can't find referenced class org.tukaani.xz.LZMA2Options
Warning:org.apache.commons.compress.compressors.lzma.LZMACompressorInputStream: can't find referenced class org.tukaani.xz.LZMAInputStream
Warning:org.apache.commons.compress.compressors.xz.XZCompressorInputStream: can't find referenced class org.tukaani.xz.XZ
Warning:org.apache.commons.compress.compressors.xz.XZCompressorInputStream: can't find referenced class org.tukaani.xz.XZInputStream
Warning:org.apache.commons.compress.compressors.xz.XZCompressorInputStream: can't find referenced class org.tukaani.xz.SingleXZInputStream
Warning:org.apache.commons.compress.compressors.xz.XZCompressorInputStream: can't find referenced class org.tukaani.xz.XZ
Warning:org.apache.commons.compress.compressors.xz.XZCompressorOutputStream: can't find referenced class org.tukaani.xz.XZOutputStream
Warning:org.apache.commons.compress.compressors.xz.XZCompressorOutputStream: can't find referenced class org.tukaani.xz.LZMA2Options
Warning:org.apache.commons.compress.compressors.xz.XZCompressorOutputStream: can't find referenced class org.tukaani.xz.XZOutputStream
Warning:org.apache.commons.compress.compressors.xz.XZCompressorOutputStream: can't find referenced class org.tukaani.xz.LZMA2Options
Warning:org.apache.commons.compress.compressors.xz.XZCompressorOutputStream: can't find referenced class org.tukaani.xz.XZOutputStream
Warning:org.codehaus.jackson.map.ext.DOMSerializer: can't find referenced class org.w3c.dom.bootstrap.DOMImplementationRegistry
Warning:org.joda.time.DateMidnight: can't find referenced class org.joda.convert.FromString
Warning:org.joda.time.DateTime: can't find referenced class org.joda.convert.FromString
Warning:org.joda.time.DateTimeZone: can't find referenced class org.joda.convert.FromString
Warning:org.joda.time.DateTimeZone: can't find referenced class org.joda.convert.ToString
Warning:org.joda.time.Days: can't find referenced class org.joda.convert.FromString
Warning:org.joda.time.Days: can't find referenced class org.joda.convert.ToString
Warning:org.joda.time.Duration: can't find referenced class org.joda.convert.FromString
Warning:org.joda.time.Hours: can't find referenced class org.joda.convert.FromString
Warning:org.joda.time.Hours: can't find referenced class org.joda.convert.ToString
Warning:org.joda.time.Instant: can't find referenced class org.joda.convert.FromString
Warning:org.joda.time.LocalDate: can't find referenced class org.joda.convert.FromString
Warning:org.joda.time.LocalDate: can't find referenced class org.joda.convert.ToString
Warning:org.joda.time.LocalDateTime: can't find referenced class org.joda.convert.FromString
Warning:org.joda.time.LocalDateTime: can't find referenced class org.joda.convert.ToString
Warning:org.joda.time.LocalTime: can't find referenced class org.joda.convert.FromString
Warning:org.joda.time.LocalTime: can't find referenced class org.joda.convert.ToString
Warning:org.joda.time.Minutes: can't find referenced class org.joda.convert.FromString
Warning:org.joda.time.Minutes: can't find referenced class org.joda.convert.ToString
Warning:org.joda.time.MonthDay: can't find referenced class org.joda.convert.FromString
Warning:org.joda.time.MonthDay: can't find referenced class org.joda.convert.ToString
Warning:org.joda.time.Months: can't find referenced class org.joda.convert.FromString
Warning:org.joda.time.Months: can't find referenced class org.joda.convert.ToString
Warning:org.joda.time.MutableDateTime: can't find referenced class org.joda.convert.FromString
Warning:org.joda.time.MutableDateTime: can't find referenced class org.joda.convert.ToString
Warning:org.joda.time.MutablePeriod: can't find referenced class org.joda.convert.FromString
Warning:org.joda.time.Period: can't find referenced class org.joda.convert.FromString
Warning:org.joda.time.Seconds: can't find referenced class org.joda.convert.FromString
Warning:org.joda.time.Seconds: can't find referenced class org.joda.convert.ToString
Warning:org.joda.time.Weeks: can't find referenced class org.joda.convert.FromString
Warning:org.joda.time.Weeks: can't find referenced class org.joda.convert.ToString
Warning:org.joda.time.YearMonth: can't find referenced class org.joda.convert.FromString
Warning:org.joda.time.YearMonth: can't find referenced class org.joda.convert.ToString
Warning:org.joda.time.Years: can't find referenced class org.joda.convert.FromString
Warning:org.joda.time.Years: can't find referenced class org.joda.convert.ToString
Warning:org.joda.time.base.AbstractDuration: can't find referenced class org.joda.convert.ToString
Warning:org.joda.time.base.AbstractInstant: can't find referenced class org.joda.convert.ToString
Warning:org.joda.time.base.AbstractPeriod: can't find referenced class org.joda.convert.ToString
Warning:org.springframework.http.client.CommonsClientHttpRequest: can't find referenced class org.apache.commons.httpclient.HttpMethodBase
Warning:org.springframework.http.client.CommonsClientHttpRequest: can't find referenced class org.apache.commons.httpclient.URI
Warning:org.springframework.http.client.CommonsClientHttpRequest: can't find referenced class org.apache.commons.httpclient.URIException
Warning:org.springframework.http.client.CommonsClientHttpRequest: can't find referenced class org.apache.commons.httpclient.HttpMethodBase
Warning:org.springframework.http.client.CommonsClientHttpRequest: can't find referenced class org.apache.commons.httpclient.methods.EntityEnclosingMethod
Warning:org.springframework.http.client.CommonsClientHttpRequest: can't find referenced class org.apache.commons.httpclient.methods.ByteArrayRequestEntity
Warning:org.springframework.http.client.CommonsClientHttpRequest: can't find referenced class org.apache.commons.httpclient.methods.EntityEnclosingMethod
Warning:org.springframework.http.client.CommonsClientHttpRequest: can't find referenced class org.apache.commons.httpclient.HttpClient
Warning:org.springframework.http.client.CommonsClientHttpRequest: can't find referenced class org.apache.commons.httpclient.URIException
Warning:org.springframework.http.client.CommonsClientHttpRequest: can't find referenced class org.apache.commons.httpclient.HttpMethodBase
Warning:org.springframework.http.client.CommonsClientHttpRequest: can't find referenced class org.apache.commons.httpclient.URI
Warning:org.springframework.http.client.CommonsClientHttpRequest: can't find referenced class org.apache.commons.httpclient.HttpClient
Warning:org.springframework.http.client.CommonsClientHttpRequest: can't find referenced class org.apache.commons.httpclient.HttpMethodBase
Warning:org.springframework.http.client.CommonsClientHttpRequest: can't find referenced class org.apache.commons.httpclient.HttpClient
Warning:org.springframework.http.client.CommonsClientHttpRequest: can't find referenced class org.apache.commons.httpclient.HttpMethodBase
Warning:org.springframework.http.client.CommonsClientHttpRequest: can't find referenced class org.apache.commons.httpclient.HttpClient
Warning:org.springframework.http.client.CommonsClientHttpRequest: can't find referenced class org.apache.commons.httpclient.HttpMethodBase
Warning:org.springframework.http.client.CommonsClientHttpRequest: can't find referenced class org.apache.commons.httpclient.URIException
Warning:org.springframework.http.client.CommonsClientHttpRequest: can't find referenced class org.apache.commons.httpclient.methods.EntityEnclosingMethod
Warning:org.springframework.http.client.CommonsClientHttpRequest: can't find referenced class org.apache.commons.httpclient.methods.RequestEntity
Warning:org.springframework.http.client.CommonsClientHttpRequestFactory: can't find referenced class org.apache.commons.httpclient.HttpClient
Warning:org.springframework.http.client.CommonsClientHttpRequestFactory: can't find referenced class org.apache.commons.httpclient.MultiThreadedHttpConnectionManager
Warning:org.springframework.http.client.CommonsClientHttpRequestFactory: can't find referenced class org.apache.commons.httpclient.HttpClient
Warning:org.springframework.http.client.CommonsClientHttpRequestFactory: can't find referenced class org.apache.commons.httpclient.HttpConnectionManager
Warning:org.springframework.http.client.CommonsClientHttpRequestFactory: can't find referenced class org.apache.commons.httpclient.params.HttpConnectionManagerParams
Warning:org.springframework.http.client.CommonsClientHttpRequestFactory: can't find referenced class org.apache.commons.httpclient.methods.GetMethod
Warning:org.springframework.http.client.CommonsClientHttpRequestFactory: can't find referenced class org.apache.commons.httpclient.methods.DeleteMethod
Warning:org.springframework.http.client.CommonsClientHttpRequestFactory: can't find referenced class org.apache.commons.httpclient.methods.HeadMethod
Warning:org.springframework.http.client.CommonsClientHttpRequestFactory: can't find referenced class org.apache.commons.httpclient.methods.OptionsMethod
Warning:org.springframework.http.client.CommonsClientHttpRequestFactory: can't find referenced class org.apache.commons.httpclient.methods.PostMethod
Warning:org.springframework.http.client.CommonsClientHttpRequestFactory: can't find referenced class org.apache.commons.httpclient.methods.PutMethod
Warning:org.springframework.http.client.CommonsClientHttpRequestFactory: can't find referenced class org.apache.commons.httpclient.methods.TraceMethod
Warning:org.springframework.http.client.CommonsClientHttpRequestFactory: can't find referenced class org.apache.commons.httpclient.MultiThreadedHttpConnectionManager
Warning:org.springframework.http.client.CommonsClientHttpRequestFactory: can't find referenced class org.apache.commons.httpclient.HttpConnectionManager
Warning:org.springframework.http.client.CommonsClientHttpRequestFactory: can't find referenced class org.apache.commons.httpclient.params.HttpConnectionManagerParams
Warning:org.springframework.http.client.CommonsClientHttpRequestFactory: can't find referenced class org.apache.commons.httpclient.HttpClient
Warning:org.springframework.http.client.CommonsClientHttpRequestFactory: can't find referenced class org.apache.commons.httpclient.HttpMethodBase
Warning:org.springframework.http.client.CommonsClientHttpRequestFactory: can't find referenced class org.apache.commons.httpclient.HttpConnectionManager
Warning:org.springframework.http.client.CommonsClientHttpResponse: can't find referenced class org.apache.commons.httpclient.HttpMethod
Warning:org.springframework.http.client.CommonsClientHttpResponse: can't find referenced class org.apache.commons.httpclient.Header
Warning:org.springframework.http.client.CommonsClientHttpResponse: can't find referenced class org.apache.commons.httpclient.HttpMethod
Warning:org.springframework.http.client.CommonsClientHttpResponse: can't find referenced class org.apache.commons.httpclient.Header
Warning:org.springframework.http.client.CommonsClientHttpResponse: can't find referenced class org.apache.commons.httpclient.HttpMethod
Warning:org.springframework.http.client.CommonsClientHttpResponse: can't find referenced class org.apache.commons.httpclient.Header
Warning:org.springframework.http.client.CommonsClientHttpResponse: can't find referenced class org.apache.commons.httpclient.HttpMethod
Warning:org.springframework.http.client.CommonsClientHttpResponse: can't find referenced class org.apache.commons.httpclient.Header
Warning:org.springframework.http.converter.feed.AbstractWireFeedHttpMessageConverter: can't find referenced class com.google.code.rome.android.repackaged.com.sun.syndication.io.WireFeedInput
Warning:org.springframework.http.converter.feed.AbstractWireFeedHttpMessageConverter: can't find referenced class com.google.code.rome.android.repackaged.com.sun.syndication.io.FeedException
Warning:org.springframework.http.converter.feed.AbstractWireFeedHttpMessageConverter: can't find referenced class com.google.code.rome.android.repackaged.com.sun.syndication.feed.WireFeed
Warning:org.springframework.http.converter.feed.AbstractWireFeedHttpMessageConverter: can't find referenced class com.google.code.rome.android.repackaged.com.sun.syndication.io.WireFeedOutput
Warning:org.springframework.http.converter.feed.AbstractWireFeedHttpMessageConverter: can't find referenced class com.google.code.rome.android.repackaged.com.sun.syndication.feed.WireFeed
Warning:org.springframework.http.converter.feed.AbstractWireFeedHttpMessageConverter: can't find referenced class com.google.code.rome.android.repackaged.com.sun.syndication.io.WireFeedInput
Warning:org.springframework.http.converter.feed.AbstractWireFeedHttpMessageConverter: can't find referenced class com.google.code.rome.android.repackaged.com.sun.syndication.io.FeedException
Warning:org.springframework.http.converter.feed.AbstractWireFeedHttpMessageConverter: can't find referenced class com.google.code.rome.android.repackaged.com.sun.syndication.feed.WireFeed
Warning:org.springframework.http.converter.feed.AbstractWireFeedHttpMessageConverter: can't find referenced class com.google.code.rome.android.repackaged.com.sun.syndication.io.WireFeedOutput
Warning:org.springframework.http.converter.feed.AbstractWireFeedHttpMessageConverter: can't find referenced class com.google.code.rome.android.repackaged.com.sun.syndication.feed.WireFeed
Warning:org.springframework.http.converter.feed.AbstractWireFeedHttpMessageConverter: can't find referenced class com.google.code.rome.android.repackaged.com.sun.syndication.io.FeedException
Warning:org.springframework.http.converter.feed.AbstractWireFeedHttpMessageConverter: can't find referenced class com.google.code.rome.android.repackaged.com.sun.syndication.io.WireFeedInput
Warning:org.springframework.http.converter.feed.AbstractWireFeedHttpMessageConverter: can't find referenced class com.google.code.rome.android.repackaged.com.sun.syndication.feed.WireFeed
Warning:org.springframework.http.converter.feed.AbstractWireFeedHttpMessageConverter: can't find referenced class com.google.code.rome.android.repackaged.com.sun.syndication.io.FeedException
Warning:org.springframework.http.converter.feed.AbstractWireFeedHttpMessageConverter: can't find referenced class com.google.code.rome.android.repackaged.com.sun.syndication.feed.WireFeed
Warning:org.springframework.http.converter.feed.AbstractWireFeedHttpMessageConverter: can't find referenced class com.google.code.rome.android.repackaged.com.sun.syndication.io.WireFeedOutput
Warning:org.springframework.http.converter.feed.AbstractWireFeedHttpMessageConverter: can't find referenced class com.google.code.rome.android.repackaged.com.sun.syndication.feed.WireFeed
Warning:org.springframework.http.converter.feed.AtomFeedHttpMessageConverter: can't find referenced class com.google.code.rome.android.repackaged.com.sun.syndication.feed.atom.Feed
Warning:org.springframework.http.converter.feed.RssChannelHttpMessageConverter: can't find referenced class com.google.code.rome.android.repackaged.com.sun.syndication.feed.rss.Channel
Warning:org.springframework.http.converter.feed.SyndFeedHttpMessageConverter: can't find referenced class com.google.code.rome.android.repackaged.com.sun.syndication.feed.synd.SyndFeed
Warning:org.springframework.http.converter.feed.SyndFeedHttpMessageConverter: can't find referenced class com.google.code.rome.android.repackaged.com.sun.syndication.io.SyndFeedInput
Warning:org.springframework.http.converter.feed.SyndFeedHttpMessageConverter: can't find referenced class com.google.code.rome.android.repackaged.com.sun.syndication.io.FeedException
Warning:org.springframework.http.converter.feed.SyndFeedHttpMessageConverter: can't find referenced class com.google.code.rome.android.repackaged.com.sun.syndication.feed.synd.SyndFeed
Warning:org.springframework.http.converter.feed.SyndFeedHttpMessageConverter: can't find referenced class com.google.code.rome.android.repackaged.com.sun.syndication.io.SyndFeedOutput
Warning:org.springframework.http.converter.feed.SyndFeedHttpMessageConverter: can't find referenced class com.google.code.rome.android.repackaged.com.sun.syndication.io.SyndFeedInput
Warning:org.springframework.http.converter.feed.SyndFeedHttpMessageConverter: can't find referenced class com.google.code.rome.android.repackaged.com.sun.syndication.io.FeedException
Warning:org.springframework.http.converter.feed.SyndFeedHttpMessageConverter: can't find referenced class com.google.code.rome.android.repackaged.com.sun.syndication.feed.synd.SyndFeed
Warning:org.springframework.http.converter.feed.SyndFeedHttpMessageConverter: can't find referenced class com.google.code.rome.android.repackaged.com.sun.syndication.io.SyndFeedOutput
Warning:org.springframework.http.converter.feed.SyndFeedHttpMessageConverter: can't find referenced class com.google.code.rome.android.repackaged.com.sun.syndication.feed.synd.SyndFeed
Warning:org.springframework.http.converter.feed.SyndFeedHttpMessageConverter: can't find referenced class com.google.code.rome.android.repackaged.com.sun.syndication.io.FeedException
Warning:org.springframework.http.converter.feed.SyndFeedHttpMessageConverter: can't find referenced class com.google.code.rome.android.repackaged.com.sun.syndication.io.SyndFeedInput
Warning:org.springframework.http.converter.feed.SyndFeedHttpMessageConverter: can't find referenced class com.google.code.rome.android.repackaged.com.sun.syndication.feed.synd.SyndFeed
Warning:org.springframework.http.converter.feed.SyndFeedHttpMessageConverter: can't find referenced class com.google.code.rome.android.repackaged.com.sun.syndication.io.FeedException
Warning:org.springframework.http.converter.feed.SyndFeedHttpMessageConverter: can't find referenced class com.google.code.rome.android.repackaged.com.sun.syndication.feed.synd.SyndFeed
Warning:org.springframework.http.converter.feed.SyndFeedHttpMessageConverter: can't find referenced class com.google.code.rome.android.repackaged.com.sun.syndication.io.SyndFeedOutput
Warning:org.springframework.http.converter.feed.SyndFeedHttpMessageConverter: can't find referenced class com.google.code.rome.android.repackaged.com.sun.syndication.feed.synd.SyndFeed
Warning:org.springframework.http.converter.json.MappingJackson2HttpMessageConverter: can't find referenced class com.fasterxml.jackson.databind.ObjectMapper
Warning:org.springframework.http.converter.json.MappingJackson2HttpMessageConverter: can't find referenced class com.fasterxml.jackson.core.JsonFactory
Warning:org.springframework.http.converter.json.MappingJackson2HttpMessageConverter: can't find referenced class com.fasterxml.jackson.core.JsonGenerator
Warning:org.springframework.http.converter.json.MappingJackson2HttpMessageConverter: can't find referenced class com.fasterxml.jackson.databind.ObjectMapper
Warning:org.springframework.http.converter.json.MappingJackson2HttpMessageConverter: can't find referenced class com.fasterxml.jackson.core.JsonEncoding
Warning:org.springframework.http.converter.json.MappingJackson2HttpMessageConverter: can't find referenced class com.fasterxml.jackson.databind.JavaType
Warning:org.springframework.http.converter.json.MappingJackson2HttpMessageConverter: can't find referenced class com.fasterxml.jackson.core.JsonEncoding
Warning:org.springframework.http.converter.json.MappingJackson2HttpMessageConverter: can't find referenced class com.fasterxml.jackson.core.JsonGenerator
Warning:org.springframework.http.converter.json.MappingJackson2HttpMessageConverter: can't find referenced class com.fasterxml.jackson.core.JsonEncoding
Warning:org.springframework.http.converter.json.MappingJackson2HttpMessageConverter: can't find referenced class com.fasterxml.jackson.core.JsonFactory
Warning:org.springframework.http.converter.json.MappingJackson2HttpMessageConverter: can't find referenced class com.fasterxml.jackson.core.JsonGenerator
Warning:org.springframework.http.converter.json.MappingJackson2HttpMessageConverter: can't find referenced class com.fasterxml.jackson.core.JsonEncoding
Warning:org.springframework.http.converter.json.MappingJackson2HttpMessageConverter: can't find referenced class com.fasterxml.jackson.databind.ObjectMapper
Warning:org.springframework.http.converter.json.MappingJackson2HttpMessageConverter: can't find referenced class com.fasterxml.jackson.databind.JavaType
Warning:org.springframework.http.converter.json.MappingJackson2HttpMessageConverter: can't find referenced class com.fasterxml.jackson.core.JsonEncoding
Warning:org.springframework.http.converter.json.MappingJackson2HttpMessageConverter: can't find referenced class com.fasterxml.jackson.core.JsonGenerator
Warning:org.springframework.http.converter.json.MappingJackson2HttpMessageConverter: can't find referenced class com.fasterxml.jackson.databind.JavaType
Warning:org.springframework.http.converter.json.MappingJackson2HttpMessageConverter: can't find referenced class com.fasterxml.jackson.core.JsonEncoding
Warning:org.springframework.http.converter.xml.SimpleXmlHttpMessageConverter: can't find referenced class org.simpleframework.xml.core.Persister
Warning:org.springframework.http.converter.xml.SimpleXmlHttpMessageConverter: can't find referenced class org.simpleframework.xml.Root
Warning:org.springframework.http.converter.xml.SimpleXmlHttpMessageConverter: can't find referenced class org.simpleframework.xml.Serializer
Warning:there were 276 unresolved references to classes or interfaces.
         You may need to add missing library jars or update their versions.
         If your code works fine without the missing classes, you can suppress
         the warnings with '-dontwarn' options.
         (http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedclass)

A: Experience here is coming from Eclipse and not Android Studio.  I will typically have my proguard.cfg file in a location at the root level with the project.  And the line inside my project.properties referencing the file would look something like this:
proguard.config=proguard.cfg

while you have this:
proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt

Do you also have a file names proguard-android.txt?  I am unfamiliar with the style convention there in your command line.  Perhaps it is a matter of not finding the right file?