Invalid JSON:Unexpected non-whitespace character after JSONat line 2, column 1
| {"QuestionId": 22029302, "AnswerCount": 3, "Tags": "<objective-c><sprite-kit><skspritenode>", "CreationDate": "2014-02-26T00:37:23.617", "AcceptedAnswerId": "22035567", "Title": "Make SKSpriteNode flash white with SKAction colorizeWithColor", "Body": "<p>Ok so I have a sprite thats suppose to flash white when hit by something, I'm using this </p>\n\n<pre><code>SKAction *changeColorAction = \n[SKAction colorizeWithColor:[SKColor whiteColor] colorBlendFactor:1.0 duration:1];\n</code></pre>\n\n<p>What happens is the sprite flashes, but instead of white, it just turns transparent.\nIf I use any other color like redColor, blueColor, ect.. It works perfect.</p>\n\n<p>How can I get it to actually turn white?</p>\n\n<p>Thanx for the help!!! :D </p>\n", "Lable": "No"} | |
| {"QuestionId": 22036232, "AnswerCount": 1, "Tags": "<java><facebook><facebook-graph-api>", "CreationDate": "2014-02-26T08:55:17.937", "AcceptedAnswerId": null, "Title": "how to get user Access token in facebook using java", "Body": "<p>How to get user AccessToken of fb using <code>REST API</code> programatically in <code>java</code> using emailid and password for multiple user.I am making <code>javaFX</code> Desktop application to post a message in all the user wall. here any other api is available to get Access token at run time. I have also use Facebook4j api but not get any solution to getting User access Token not App Access Taken.</p>\n\n<p>Here I see the code that is using access Token</p>\n\n<pre><code>FacebookClient facebookClient = new DefaultFacebookClient(MY_ACCESS_TOKEN);\n</code></pre>\n\n<p>But it's not showing how to get User Access Token using desktop Application.\nIt is possible or not?</p>\n", "Lable": "No"} | |
| {"QuestionId": 22102016, "AnswerCount": 2, "Tags": "<mysql><charts><average><intervals>", "CreationDate": "2014-02-28T17:34:47.997", "AcceptedAnswerId": "22102406", "Title": "MySQL get average grouped by intervals", "Body": "<p>I have a xy chart of a power curve. Power on the <strong>y</strong> axis and wind on <strong>x</strong> axis.</p>\n\n<p>I get the values from a MySQL table. </p>\n\n<p>How can I get the average Power between intervals of 1 in thew wind column. </p>\n\n<p>Exemple:</p>\n\n<pre><code>Wind | Power\n10.2 1245\n10.2 1245\n9.7 1145\n8.7 1001\n11.1 1345\n9.3 1100\n10.6 1284\n8 987\n5.5 352\n...\n</code></pre>\n\n<p>What I need is:</p>\n\n<pre><code>Wind | Avg(Power)\n0-1 ...\n1-2 ... \n2-3 ...\n... \n</code></pre>\n\n<p>Thank you in advance</p>\n\n<p><strong>EDIT:</strong></p>\n\n<p>Thank you all for your answwers!</p>\n\n<p>For my particular case the wind is always between 0 and 25 m/s. \nThe intervals that I need to get the average power from are 0.5.</p>\n\n<p>So:</p>\n\n<pre><code>0 - 0,25\n0,25 - 0,75\n0,75 - 1,25\n1,25 - 1,75\n... - 25\n</code></pre>\n", "Lable": "No"} | |
| {"QuestionId": 22122800, "AnswerCount": 1, "Tags": "<jquery><css><jquery-mobile>", "CreationDate": "2014-03-02T01:38:40.037", "AcceptedAnswerId": null, "Title": "How to set label colour in JQuery Mobile", "Body": "<p>I have to three labels in my page. I need to need to give a different text colour of different label, but when I override this class it makes all label red.</p>\n\n<pre><code>.ui-body-c label {\n color: red !important;\n}\n</code></pre>\n\n<p><a href=\"http://jsfiddle.net/GZaqz/5/\" rel=\"nofollow\">http://jsfiddle.net/GZaqz/5/</a></p>\n\n<pre><code><label class=\"labelClass\" id=\"openSubmenu\">Move to Second Page:</label>\n\n<label class=\"\" id=\"\"> to Page:</label>\n</code></pre>\n", "Lable": "No"} | |
| {"QuestionId": 22182282, "AnswerCount": 1, "Tags": "<memory><cuda><constants><global>", "CreationDate": "2014-03-04T20:27:04.210", "AcceptedAnswerId": "22182697", "Title": "Cuda kernel with global memory vs Cuda kernel with constant memory", "Body": "<p>I have two kernels for doing a matrix multiplication, one uses global memory and the second one uses constant memory. I wanted to use the Cuda profiler to test the speed of both kernels.</p>\n\n<p>I tested both on a 1.3 device and on a 2.0 device. I was expecting the kernel with constant memory to be faster on the 1.3 device and the global memory kernel to be faster on the 2.0 device because of the use of cache for global memory on those devices but I found that in both devices the global memory kernel is faster. Is this due to memory coalescing on global memory? If so is there a way to make the constant kernel faster?</p>\n\n<p>I'm using matrixes of 80x80 and Block size of 16.</p>\n\n<p>Here is the global memory kernel</p>\n\n<pre><code>__global__ void MatMulGlobKernel(const Matriz A, const Matriz B, Matriz C) {\n\nfloat Cvalor = 0;\nint row = blockIdx.y * blockDim.y + threadIdx.y;\nint col = blockIdx.x * blockDim.x + threadIdx.x;\n\nif(fil > A.height || col > B.width) return;\n\nfor (int e = 0; e < A.width; ++e)\nCvalor += A.valores[row * A.width + e] * B.valores[e * B.width + col];\n\nC.valores[row * C.width + col] = Cvalor;\n}\n</code></pre>\n\n<p>A.valores, B.valores and C.valores reside in global memory. </p>\n\n<p>Now here is the constant memory kernel.</p>\n\n<pre><code>__global__ void MatMulConstKernel(const Matriz A, const Matriz B, Matriz C) {\n\nfloat Cvalor = 0;\nint row = blockIdx.y * blockDim.y + threadIdx.y;\nint col = blockIdx.x * blockDim.x + threadIdx.x;\n\nif(fil > A.height || col > B.width) return;\n\nfor (int e = 0; e < A.width; ++e)\nCvalor += A_const_valores[row * A.width + e] * B_const_valores[e * B.width + col];\n\nC.valores[row * C.width + col] = Cvalor;\n}\n</code></pre>\n\n<p>A_const_valores and B_const_valores reside in constant memory while C.valores resides in global memory. </p>\n\n<p>This is the profiler result for the 1.3 device (Tesla M1060)</p>\n\n<p>Const kernel 101.70us</p>\n\n<p>Global kernel 51.424us</p>\n\n<p>and for the 2.0 device (GTX 650)</p>\n\n<p>Const kernel 178.05us</p>\n\n<p>Global kernel 58.144us</p>\n", "Lable": "No"} | |
| {"QuestionId": 22298389, "AnswerCount": 0, "Tags": "<java><php><android><encryption><cryptography>", "CreationDate": "2014-03-10T11:03:23.193", "AcceptedAnswerId": null, "Title": "AES-Rijndael 128 encryption in Java", "Body": "<p>I have a snippet in PHP that encrypts a plain String using AES 128 encryption.</p>\n\n<p>I have a problem to use this in Java as I do not have any experience on cryptography.</p>\n\n<p>Take a look at the PHP snippet here:</p>\n\n<pre><code>function encrypt_text($decrypted)\n{\n $thePassKey = \"MY_KEY_SOME_GIBBERISH_KEY\";\n\n # Add PKCS7 padding.\n $str = $decrypted;\n // Gets the block size of the specified cipher\n // MODE: CBC\n // CIPHER NAME: RIJNDAEL_128\n $block = mcrypt_get_block_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC);\n\n echo \"Encryption: \".MCRYPT_RIJNDAEL_128.\"<br/>\";\n echo \"Mcrypt Mode: \".MCRYPT_MODE_CBC.\"<br/>\";\n echo \"Block: \" . $block.\"<br/>\";\n\n if (($pad = $block - (strlen($str) % $block)) < $block){\n $str .= str_repeat(chr($pad), $pad);\n }\n\n // Returns the size of the IV belonging to a specific cipher/mode combination\n $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC);\n\n $iv = '';\n for($i = 0; $i < $iv_size; $i++){\n $iv .= \"\\0\";\n }\n\n // mcrypt_encrypt: Encrypts plaintext with given parameters\n // base6_encode: Encodes data with MIME base64\n return base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $thePassKey, $str, MCRYPT_MODE_CBC, $iv));\n}\n</code></pre>\n\n<p>From the above snippet, I've managed to get the requirement it needs to encrypt a string which are:</p>\n\n<blockquote>\n <p>Encryption mode: rijndael-128</p>\n \n <p>Mcrypt mode: cbc</p>\n \n <p>Block: 16</p>\n</blockquote>\n\n<p>So, how do I do exactly this but with Java? I'm implementing it in an android app, if that helps.</p>\n", "Lable": "No"} | |
| {"QuestionId": 22370311, "AnswerCount": 1, "Tags": "<jsf><spring-security><session-timeout><icefaces-3><icefaces-1.8>", "CreationDate": "2014-03-13T06:01:56.983", "AcceptedAnswerId": null, "Title": "on session time UI hangs in icefaces 3.3", "Body": "<p>I am facing a issue with <code>iceface 3.3</code> when <code>session timeout</code>: </p>\n\n<p>[1] session timeout<br>\n[2] user do a activity.<br>\n[3] error in firebug - empty respose from server<br>\n[4] UI hangs forever<br>\n[5] user hit F5<br>\n[6] redirect to login page<br>\n[7] user input credential<br>\n[8] redirect to a xml error page </p>\n\n<pre><code><partial-response>\n <error>\n <error-name>\n class org.icefaces.application.SessionExpiredException\n </error-name>\n <error-message>\n <![CDATA[ Session has expired ]]>\n </error-message>\n </error>\n <changes>\n <extension aceCallbackParam=\"validationFailed\">{\"validationFailed\":false}</extension>\n </changes>\n </partial-response>\n</code></pre>\n\n<p>[9] user hit refresh ..user redirect to a normal application </p>\n\n<p>This use to work fine in <code>1.8</code>... i am now trying it with <code>3.3</code> \nDuring debugging i figured out one major difference between 1.8 and 3.3 </p>\n\n<p>in <code>1.8</code> when session timeout and user do a activity the response to this request is of the form: </p>\n\n<pre><code>response.status = 200 \nresponse.reponseXML = <sessionTimeOut><sessionTimeOut/> \n</code></pre>\n\n<p>where as in <code>3.3</code> when session timeout and user do a activity the response is: </p>\n\n<pre><code>reponse.status = 302 with response.header.location = login page \nsince status is 302 browser itself make a request for login page. \n</code></pre>\n\n<p>To <code>icefaces javascript code</code> the response that it got looks like </p>\n\n<pre><code> response.status=200 \n reponse.responseXML=null \nresponse.reponseHTML=<HTML CODE OF LOGIN PAGE> \n</code></pre>\n\n<p>and in <code>jsf.js</code> the response handler just logs a error if <code>reponseXML</code> is null. </p>\n\n<p>So thats why icefaces does not redirect or show popup. </p>\n\n<p>Now does anybody having a fix or a work around for this ?</p>\n\n<p>I am using <code>icefaces 3.3, glassfish 3.1, spring 3.0.1</code> </p>\n", "Lable": "No"} | |
| {"QuestionId": 22417502, "AnswerCount": 1, "Tags": "<ruby-on-rails><ruby><activerecord><gem>", "CreationDate": "2014-03-14T23:20:51.887", "AcceptedAnswerId": null, "Title": "Rails Gem does not set the setter method", "Body": "<p>I tried to put up a Ruby Gem based on Railscast Episode 033 Making a Plugin. I got the gem created and uploaded to Rubygems.org as <code>stringify-time</code>, but the setter method is not working.</p>\n\n<p><a href=\"https://github.com/the4dpatrick/stringify-time-gem\" rel=\"nofollow\">The GitHub Repo</a></p>\n\n<p>The main part of the gem</p>\n\n<pre><code>module StringifyTime\n def stringify_time(*names)\n names.each do |name|\n define_method \"#{name}_string\" do\n read_attribute(name).to_s(:db) unless read_attribute(name).nil?\n end\n\n define_method \"#{name}_string=\" do |time_str|\n begin\n write_attribute(\"#{name}\", Time.zone.parse(time_str))\n rescue ArgumentError\n instance_variable_set(\"@#{name}_invalid\", true)\n end\n end\n\n define_method \"#{name}_invalid?\" do\n instance_variable_get(\"@#{name}_invalid\")\n end\n end\n end\nend\n\nActiveRecord::Base.send(:extend, StringifyTime)\n</code></pre>\n\n<p>A attribute symbol is passed in and getter and setter methods are created. The getter method works, but when I try to update the attribute through the form, the data is not saved.</p>\n\n<p>using the <code>stringify_time</code> method in the Task model</p>\n\n<pre><code>class Task < ActiveRecord::Base \n validates_presence_of :name \n stringify_time :due_at \n\n # def due_at_string \n # due_at.to_s(:db) \n # end \n\n # def due_at_string=(due_at_str) \n # self.due_at = Time.parse(due_at_str) \n # rescue ArgumentError \n # @due_at_invalid = true \n # end \n\n def validate \n errors.add :due_at, 'is invalid' if due_at_invalid? # @due_at_invalid \n end \nend\n</code></pre>\n\n<p>When I uncomment the setter method I wrote manually, then I can edit the attribute.</p>\n", "Lable": "No"} | |
| {"QuestionId": 22678863, "AnswerCount": 1, "Tags": "<php><wordpress>", "CreationDate": "2014-03-27T05:18:07.577", "AcceptedAnswerId": "22679032", "Title": "Count wordpress code error", "Body": "<p>Whats wrong with this code?</p>\n\n<p>The count is working ok, but i this code is something wrong, can someone help me?</p>\n\n<p>Thanks</p>\n\n<pre><code><div <?php if (($count%3)==0) {post_class(\"$term_list one-third column ultimo\")}\nelse {post_class(\"$term_list one-third column\")} ?> >\n</code></pre>\n", "Lable": "No"} | |
| {"QuestionId": 22732942, "AnswerCount": 0, "Tags": "<ios><xcode>", "CreationDate": "2014-03-29T15:22:12.513", "AcceptedAnswerId": null, "Title": "Xcode build error, sys/_types/_int8_h file not found", "Body": "<p>When I builded my ios project with xcode. I get the following error, how can I fix it:\n<img src=\"https://i.stack.imgur.com/GnGMZ.png\" alt=\"\"></p>\n", "Lable": "No"} | |