Invalid JSON:Unexpected non-whitespace character after JSONat line 2, column 1
| {"QuestionId": 19767368, "AnswerCount": 2, "Tags": "<javascript><unit-testing><angularjs>", "CreationDate": "2013-11-04T12:04:27.857", "AcceptedAnswerId": "19767577", "Title": "angularJS: unit tests gives: Unknown provider: $httpProviderProvider <- $httpProvider", "Body": "<p>In one of my unit tests I'm trying to do</p>\n\n<pre><code>beforeEach(function () {\n angular.mock.inject(function ($injector) {\n $httpBackend = $injector.get('$httpBackend');\n mockUserResource = $injector.get('User');\n $httpProvider = $injector.get('$httpProvider'); // <-- problem\n $httpProvider.interceptors.push('myInterceptor');\n });\n});\n</code></pre>\n\n<p>(<a href=\"http://jsfiddle.net/8FRBS/2/\">demo</a>)</p>\n\n<p>Why is it not possible to inject $httpProvider ?</p>\n\n<p>The reason I'm doing this is because I don't load the file which adds all my interceptors, because I want to test them one by one!</p>\n", "Lable": "No"} | |
| {"QuestionId": 19865653, "AnswerCount": 2, "Tags": "<php><mysql><time>", "CreationDate": "2013-11-08T18:04:11.557", "AcceptedAnswerId": "19865857", "Title": "Converting MYSQL time to PHP time", "Body": "<p>I have a column of type time in mysql database, I want to convert it to php time object to be able to use it in some functions, I've tried to use strtotime function but that dosen't work with me,\nthis is my php code:</p>\n\n<pre><code>$result=mysql_query(\"select time,name from users where user_id='1'\");\nif($result)\n{\n $row=mysql_fetch_array($result);\n$time=$row['time'];\n $formatted_time=strtotime($time); \necho date('H:i:s',$formatted_time); \n}\n</code></pre>\n\n<p>but what I always get is:\n<code>01:00:00</code>\nI don't know where the 1 hour did come from!</p>\n\n<p>I know this question may be duplicated but all of answers are talking about using strtotime function which didn't work as you see.\ncould you help pleas?</p>\n\n<p>many thanx in advance </p>\n", "Lable": "No"} | |
| {"QuestionId": 19927577, "AnswerCount": 1, "Tags": "<c#><image><wcf><base64>", "CreationDate": "2013-11-12T11:10:47.003", "AcceptedAnswerId": null, "Title": "convert base64 string to image using asp.net c#", "Body": "<p>I'm using this function to convert base64 to image. </p>\n\n<pre><code>public Image Base64ToImage(string base64String)\n{\n // Convert Base64 String to byte[]\n byte[] imageBytes = Convert.FromBase64String(base64String);\n using (var ms = new MemoryStream(imageBytes, 0,imageBytes.Length))\n {\n // Convert byte[] to Image\n ms.Write(imageBytes, 0, imageBytes.Length);\n //Image image = Image.FromStream(ms, true);\n Image image = Image.FromStream(ms,true,true);\n return image;\n }\n}\n</code></pre>\n\n<p>but it is not working. please help me.</p>\n", "Lable": "No"} | |
| {"QuestionId": 19994870, "AnswerCount": 2, "Tags": "<python><string><list>", "CreationDate": "2013-11-15T06:30:27.590", "AcceptedAnswerId": null, "Title": "manipulating strings in a list", "Body": "<p>im just in a beginner cmpt course for python and just learning about lists. One of our questions is to make a function that will recieve something like this(may have more than just 2 values)\n['15--356', '9--24']\nand create this\n[15, 9, -1, 356, 24]\nwhere -1 will always be the middle value.</p>\n\n<p>I`m really lost on how to do this. A little guidance would be very appreciated.</p>\n", "Lable": "No"} | |
| {"QuestionId": 20114012, "AnswerCount": 0, "Tags": "<c#><.net><c><interop><pinvoke>", "CreationDate": "2013-11-21T06:30:24.453", "AcceptedAnswerId": null, "Title": "A little confusion on P/Invoking C functions", "Body": "<p>I am trying to create some bindings for some important functions in a library. Although I have a little confusion. Almost all of the main functions look like this(taken from a header):</p>\n\n<pre><code> KBResult (*EnumScreens) (\n IKB *thiz,\n IKCallback callback,\n void *callbackdata\n );\n\n\n KBResult (*GetScreen) (\n IKB *thiz,\n IKScreenID screen_id,\n IKScreen **ret_interface\n );\n\nKBResult KBResult_API KBResultError(\n const char *msg, /* message */\n KBResultResult result /* result */\n );\n</code></pre>\n\n<p>My first confusion, is how how I write that when KBResult is in the front of each? Do I need to include that? The second questions is how do I pinvoke types that look like these:</p>\n\n<pre><code> IKB *thiz,\n IKCallback callback,\n void *callbackdata\n</code></pre>\n\n<p>Since it isn't something easy like int, I have no idea how to write that. Would this be what marshalling is for? Turning it into a similar type? I have had a heck of a time trying to figure these out. I have tried every tool out there besides swig(That is only because it literally wouldn't generate anything, might be my lack of experience), and every tool came up with massive amounts of errors. So I am deciding to do this by hand. Can anyone give me a hand in understanding this?</p>\n", "Lable": "No"} | |
| {"QuestionId": 20115954, "AnswerCount": 2, "Tags": "<python><for-loop><stopiteration>", "CreationDate": "2013-11-21T08:36:29.957", "AcceptedAnswerId": "20116881", "Title": "Would a StopIteration make python slow?", "Body": "<p>As far as i know, monitoring exception will make a program slower.</p>\n\n<p>Would an iterator exception monitor, such as <code>StopIteration</code> make a <code>for</code> loop slower?</p>\n", "Lable": "No"} | |
| {"QuestionId": 20315945, "AnswerCount": 2, "Tags": "<html><css><html5><css3><transform>", "CreationDate": "2013-12-01T19:00:28.547", "AcceptedAnswerId": "20315984", "Title": "Transform text on Y axis without moving underline?", "Body": "<p>I'm trying to move text when text is hovered Y pixels on Y axis. What What is more I want to move just text, without underline. Any ideas how to achieve this?</p>\n\n<pre><code>#blah:hover {\ncolor:red;\ntransform: translateY(-20px);\n}\n</code></pre>\n\n<p><a href=\"http://jsfiddle.net/xUa8P/\" rel=\"nofollow\" title=\"JSFIDDLE\">http://jsfiddle.net/xUa8P/</a></p>\n", "Lable": "No"} | |
| {"QuestionId": 20362756, "AnswerCount": 1, "Tags": "<mongodb>", "CreationDate": "2013-12-03T22:11:27.607", "AcceptedAnswerId": "20364147", "Title": "MongoDB aggregation: How can I get a count of columns based on a criteria", "Body": "<p>I have the following documents:</p>\n\n<pre><code>{ \"col1\": \"camera\", \"fps\": 1, \"lat\": 3 },\n{ \"col1\": \"camera\", \"fps\": 3, \"lat\": 2 }\n{ \"col1\": \"camera\", \"foo\": 9, \"bar\": 7 }\n{ \"col1\": \"camera\", \"bar\": 8, \"bar\": 1 }\n{ \"col1\": \"camera\", \"check\": 4, \"lat\": 3 }\n</code></pre>\n\n<p>How can I get the following:</p>\n\n<pre><code>{ \"fps\": 2, \"lat\": 3, \"bar\": 3, \"check\": 1, \"foo\": 1 }\n</code></pre>\n\n<p>Where each of these values are the number of occurrences (count) of each key (fps appears 2, foo, appears once, etc)</p>\n", "Lable": "No"} | |
| {"QuestionId": 20392187, "AnswerCount": 1, "Tags": "<javascript><google-analytics><bigcommerce>", "CreationDate": "2013-12-05T05:29:42.317", "AcceptedAnswerId": null, "Title": "Updating Big Commerce to the new analytics.js", "Body": "<p>I'm working on a site and I updated the tracking code to the new analytics.js I transferred their site and everything is working except for conversion.\nIt's a Big Commerce site so I can't touch server side script but \nthis what they generate</p>\n\n<pre><code><script type=\"text/javascript\">\n$(document).ready(function() {\n if(typeof(pageTracker) != 'undefined') {\n pageTracker._addTrans(\n'358',\n'Backyard Toy Company ',\n'0.01',\n'0.00',\n'0.00',\n'Lakewood',\n'New Jersey',\n'United States'\n);\n pageTracker._addItem(\n'358',\n'1336',\n'test',\n'',\n'0.01',\n'1'\n);\n pageTracker._trackTrans();\n}\n});\n</script>\n</code></pre>\n\n<p>I updated the client side code to this</p>\n\n<pre><code> ga('require', 'ecommerce', 'ecommerce.js'); // Load the ecommerce plug-in.\n\n // START CUSTOM CODE\n function old2new() {\n // define object that can route old methods to new methods\n this._addTrans = addTrans;\n this._addItem = addItem;\n this._trackTrans = trackTrans;\n }\n\n function addTrans(orderID,store,total,tax,shipping,city,state,country) {\n // remap _addTrans\n ga('ecommerce:addTransaction', {\n 'id': orderID,\n 'affiliation': store,\n 'revenue': total,\n 'tax': tax,\n 'shipping': shipping,\n });\n }\n\n function addItem(orderID,sku,product,variation,price,qty) {\n // remap _addItem\n ga('ecommerce:addItem', {\n 'id': orderID,\n 'sku': sku,\n 'name': product,\n 'category': variation,\n 'price': price,\n 'quantity': qty\n });\n }\n\nfunction trackTrans() {\n ga('send', 'ecommerce'); \n}\n\n// instantiate converter using name of old Google tracking object\n// bigcommerce code will use this and be none the wiser\nvar pageTracker = new old2new();\n// END CUSTOM CODE\n</code></pre>\n\n<p>I'm sorry I'm a newbie, but I looked all over can't figure out why it's not working.</p>\n", "Lable": "No"} | |
| {"QuestionId": 20431545, "AnswerCount": 1, "Tags": "<loops><for-loop>", "CreationDate": "2013-12-06T18:58:36.500", "AcceptedAnswerId": "20431747", "Title": "What does this code do? (final exam)", "Body": "<p>int[][] x = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}; \nint i, j; </p>\n\n<pre><code> for (i = 0; i < 3; i=i+1) \n { for (j = 0; j < 3; j=j+1) \n System.out.print(x[i][j] + \" \"); \n System.out.println(); \n</code></pre>\n\n<p>Can you tell me the steps its doing..... im confused :C</p>\n", "Lable": "No"} | |