Invalid JSON:Unexpected non-whitespace character after JSONat line 2, column 1
| {"QuestionId": 24391412, "AnswerCount": 1, "Tags": "<android><android-activity>", "CreationDate": "2014-06-24T16:07:11.783", "AcceptedAnswerId": "24392104", "Title": "Move from an activity to another one in View Class in Android", "Body": "<p>I have an activity that has two classes like these:</p>\n\n<pre><code>public class StartActivity extends Activity {\n .\n .\n .\n}\n\npublic class StartView extends View {\n .\n .\n .\n}\n</code></pre>\n\n<p>I want to go from this Activity to another one with click on one image.Is there any method (such startActivity method in Activity Class) in View Class that I can use it in the Second Class?</p>\n", "Lable": "No"} | |
| {"QuestionId": 24400162, "AnswerCount": 2, "Tags": "<java><formatting>", "CreationDate": "2014-06-25T04:23:20.090", "AcceptedAnswerId": null, "Title": "How can I format in java?", "Body": "<p>This is what I currently have so far</p>\n\n<pre><code>public String toString() {\n return this.make + \" \" + this.model + \" \" + this.year + \" $\"\n + this.price + \" \" + this.mpg;\n}\n</code></pre>\n\n<p>I need to format it to these specifications</p>\n\n<ol>\n<li>Make: left-justified and will be no more than 10 characters long</li>\n<li>Model: left-justified starting in column 11 and will be no more than 10 characters long</li>\n<li>Year: left-justified and starting in column 21</li>\n<li>Price: will be output according to the following money format $99,999.00</li>\n<li>MPG: will be output according to the following format: 99.0.</li>\n</ol>\n\n<p>Please help, I'm lost.\nThanks</p>\n", "Lable": "No"} | |
| {"QuestionId": 24450793, "AnswerCount": 1, "Tags": "<android><android-layout>", "CreationDate": "2014-06-27T11:31:25.967", "AcceptedAnswerId": null, "Title": "How to create a custom check box by inflating a layout", "Body": "<p>I want to create a custom check box view, by inflating a layout, I want to manipulate the views in the layout based on the check box status (checked/unchecked), also I want to add custom xml attributes for that view.</p>\n", "Lable": "No"} | |
| {"QuestionId": 24629730, "AnswerCount": 1, "Tags": "<php><caching><optimization><opcode>", "CreationDate": "2014-07-08T10:41:41.997", "AcceptedAnswerId": null, "Title": "No performance gain after enabling Opcode caching", "Body": "<p>I have a bunch of php services running behind the message queue and my symfony controller are accessing these services to get the data. I am doing some benchmark testing to evaluate the performance of Opcode caching. The problem is that the performance gain I am attaining after enabling any of the Opcode caching (zend opcache or apc) is negligible. I am using 'ab' utility for benchmark testing. </p>\n\n<p>So the total response time (without any opcode caching) is 66 seconds and the same for zend opcode cache is 54 seconds. The total response time in case of APC is 64 seconds. I am making 50000 request with no concurrent request for the benchmarking.</p>\n\n<p>Please any advice what could be preventing the Opcode caching to gain significant performance.</p>\n\n<p><strong>EDIT 1</strong>\nCall to the <code>apc_cache_info()</code> returns the following:</p>\n\n<pre><code>array (size=14)\n 'nslots' => int 4099\n 'ttl' => int 0\n 'nhits' => float 0\n 'nmisses' => float 0\n 'ninserts' => float 0\n 'nentries' => int 0\n 'nexpunges' => float 0\n 'stime' => int 1404812585\n 'mem_size' => float 0\n 'file_upload_progress' => int 1\n 'memory_type' => string 'mmap' (length=4)\n 'cache_list' => \n array (size=0)\n empty\n 'deleted_list' => \n array (size=0)\n empty\n 'slot_distribution' => \n array (size=0)\n empty\n</code></pre>\n", "Lable": "No"} | |
| {"QuestionId": 24801344, "AnswerCount": 1, "Tags": "<asp.net><web-services><iis>", "CreationDate": "2014-07-17T10:40:09.313", "AcceptedAnswerId": "24801825", "Title": "Calling a WebService from an ASP.net application", "Body": "<p>I have a WEB application on multiple servers (Windows 2008). However on a windows 2012 server, I receive the following error</p>\n\n<pre><code> Compilation Error\n\nDescription: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. \n\nCompiler Error Message: BC30002: Type 'myservice.units.AFMService' is not defined.\n\nSource Error:\n\n\n\nLine 8: Dim oService As New myservice.units.AFMService\n</code></pre>\n\n<p>The code is not precompiled, I simply copied the code from one server to another. All other pages/calls work correctly.</p>\n\n<p>The Web.config has the following line</p>\n\n<pre><code><add key=\"myservice.units.AFM\" value=\"http://xxxxxx/xxxx/x/xxx.asmx\"/\n</code></pre>\n\n<p>Any Ideas on what I could check?</p>\n", "Lable": "No"} | |
| {"QuestionId": 24842313, "AnswerCount": 3, "Tags": "<bash><stdin><pipeline><rm>", "CreationDate": "2014-07-19T16:08:55.317", "AcceptedAnswerId": "24842347", "Title": "Why won't rm remove files passed in from find or sed?", "Body": "<p>I want to pipeline the below commands but the last cmd \"rm -rf\"is not working i.e. Nothing deleted :</p>\n\n<pre><code>find /home/mba/Desktop/ -type d -name \"logs\" | sed 's/$/\\/\\*/' | rm -rf\n</code></pre>\n\n<p>No error is returned.</p>\n", "Lable": "No"} | |
| {"QuestionId": 24850489, "AnswerCount": 2, "Tags": "<java><nullpointerexception><jax-rs><jndi>", "CreationDate": "2014-07-20T12:26:58.407", "AcceptedAnswerId": "24918874", "Title": "Root resource from other .jar file cannot be looked up in JAX-RS application", "Body": "<p>I am trying to build an application ear file with the following structure:</p>\n\n<pre><code>app.ear\n--> lib\n -- app-domain.jar\n -- app-api.jar\n -- app-common.jar\n ...\n--> META-INF\n -- application.xml\n -- glassfish-application.xml\n -- MANIFEST.MF\n-- app-ejb.jar\n-- app-rs.war\n</code></pre>\n\n<p>The app-api.jar file contains my remote interfaces like</p>\n\n<pre><code>@Remote\npublic interface LanguageService {\n\n /**\n * @return all languages known to the system\n */\n List<Language> loadLanguages();\n</code></pre>\n\n<p>The implementation is contained in the app-ejb.jar file and looks like this:</p>\n\n<pre><code>@Stateless\n@Remote(LanguageService.class)\n@Path(\"/language\")\npublic class LanguageServiceImpl extends ValidatingService implements LanguageService {\n\n @PersistenceContext(unitName = \"kcalculator\")\n EntityManager em;\n\n @GET\n @Produces(\"application/json\")\n @Override\n public List<Language> loadLanguages() {\n CriteriaQuery<Language> query = createLoadLanguageQuery();\n return em.createQuery(query).getResultList(); \n }\n</code></pre>\n\n<p>And finally I want to provide this as an JAX-RS web service and thus have my implementation of the javax.rs.Application class in the app-rs.war file, which looks like this:</p>\n\n<pre><code>@ApplicationPath(\"/resources\")\npublic class MyApplication extends Application {\n\n @Override\n public Set<Class<?>> getClasses() {\n Set<Class<?>> s = new HashSet<Class<?>>();\n s.add(LanguageServiceImpl.class);\n return s;\n }\n</code></pre>\n\n<p>This deploys without any problem, the application class is also detected. However, when i finally access the web service an internal server error occurs due to a NPE. </p>\n\n<p>The LanguageServiceImpl cannot be looked up, the log contains the following entry:</p>\n\n<pre><code>Caused by: javax.naming.NameNotFoundException: No object bound to name java:module/LanguageServiceImpl!com.kcalculator.ejb.LanguageServiceImpl\n at com.sun.enterprise.naming.impl.GlassfishNamingManagerImpl.lookup(GlassfishNamingManagerImpl.java:741)\n at com.sun.enterprise.naming.impl.GlassfishNamingManagerImpl.lookup(GlassfishNamingManagerImpl.java:715)\n at com.sun.enterprise.naming.impl.JavaURLContext.lookup(JavaURLContext.java:167)\n at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:471)\n ... 63 more\n</code></pre>\n\n<p>Hence the file is considered a Pojo, and so the reference to the entity manager is not initialized, which finally results in the Nullpointer exception.</p>\n\n<p>I am kinda stuck, as annotating the bean class and giving it a mapped name is not working. Putting my application class into the ejb.jar file does not solve the problem either.</p>\n\n<p>Can anyone point out what i am missing here?</p>\n\n<p>Additional comment:\nWhat I found out in the meantime: If I add a stateless session bean to my app-rs.war file and register it in MyApplication, it works without any problem. There injecting the LanguageService works, too. So it seems the problem is related to the fact that the service implementing bean class is located in another artifact.</p>\n", "Lable": "No"} | |
| {"QuestionId": 25009269, "AnswerCount": 1, "Tags": "<android><camera>", "CreationDate": "2014-07-29T06:19:52.503", "AcceptedAnswerId": "25011944", "Title": "Issue at taking images from camera and uploading to server", "Body": "<p>I have an application that is using camera, when I camera capture a photo, my application is crashing. Then I want upload the image...</p>\n\n<pre><code>if (requestCode == CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE) // TODO camera code\n {\n if (resultCode == RESULT_OK)\n {\n String imageId = convertImageUriToFile(imageUri,CameraActivity);\n new LoadImagesFromSDCard().execute(\"\"+imageId);\n }\n else if (resultCode == RESULT_CANCELED)\n {\n Toast.makeText(this, \"Picture was not taken\", Toast.LENGTH_SHORT).show();\n }\n else \n {\n Toast.makeText(this, \"Picture was not taken\", Toast.LENGTH_SHORT).show();\n }\n }\n\n\npublic class LoadImagesFromSDCard extends AsyncTask<String, Void, Void> {\n\n private ProgressDialog Dialog = new ProgressDialog(NewEntry.this);\n\n Bitmap mBitmap;\n\n protected void onPreExecute() {\n Dialog.setMessage(\"Loading image from Sdcard..\");\n Dialog.show();\n Toast.makeText(getApplicationContext(), \"Loading image from Sdcard\", Toast.LENGTH_SHORT).show();\n }\n\n protected Void doInBackground(String... urls) {\n\n Bitmap bitmap = null;\n Bitmap newBitmap = null;\n Uri uri = null; \n\n try {\n uri = Uri.withAppendedPath(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, \"\" + urls[0]);\n bitmap = BitmapFactory.decodeStream(getContentResolver().openInputStream(uri));\n Toast.makeText(getApplicationContext(), \"try block\", Toast.LENGTH_SHORT).show();\n if (bitmap != null) {\n newBitmap = Bitmap.createScaledBitmap(bitmap, 170, 170, true); \n bitmap.recycle();\n Toast.makeText(getApplicationContext(), \"bitmap not null\", Toast.LENGTH_SHORT).show();\n if (newBitmap != null)\n {\n mBitmap = newBitmap;\n Toast.makeText(getApplicationContext(), \"newBitmap not null\", Toast.LENGTH_SHORT).show();\n }\n }\n } catch (IOException e) {\n cancel(true);\n Toast.makeText(getApplicationContext(), \"catch block\", Toast.LENGTH_SHORT).show();\n }\n return null;\n }\n\n protected void onPostExecute(Void unused) \n {\n\n Dialog.dismiss();\n if(mBitmap != null)\n {\n }\n //showImg.setImageBitmap(mBitmap);\n Toast.makeText(getApplicationContext(), \"mBitmap not null\", Toast.LENGTH_SHORT).show();\n }\n }\n</code></pre>\n\n<p>Please help me and suggest me about this issue: when I camera capture a photo, my application is crashing. However afterwards I want to upload the image...\nlog cat</p>\n\n<pre><code>07-29 11:54:59.173: E/AndroidRuntime(4253): FATAL EXCEPTION: main\n07-29 11:54:59.173: E/AndroidRuntime(4253): Process: com.ebiz.eis.realtimedar, PID: 4253\n07-29 11:54:59.173: E/AndroidRuntime(4253): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=1, result=-1, data=null} to activity {com.ebiz.eis.realtimedar/com.ebiz.eis.realtimedar.NewEntry}: java.lang.NullPointerException\n07-29 11:54:59.173: E/AndroidRuntime(4253): at android.app.ActivityThread.deliverResults(ActivityThread.java:3432)\n07-29 11:54:59.173: E/AndroidRuntime(4253): at android.app.ActivityThread.handleSendResult(ActivityThread.java:3475)\n07-29 11:54:59.173: E/AndroidRuntime(4253): at android.app.ActivityThread.access$1300(ActivityThread.java:139)\n07-29 11:54:59.173: E/AndroidRuntime(4253): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1258)\n07-29 11:54:59.173: E/AndroidRuntime(4253): at android.os.Handler.dispatchMessage(Handler.java:102)\n07-29 11:54:59.173: E/AndroidRuntime(4253): at android.os.Looper.loop(Looper.java:136)\n07-29 11:54:59.173: E/AndroidRuntime(4253): at android.app.ActivityThread.main(ActivityThread.java:5086)\n07-29 11:54:59.173: E/AndroidRuntime(4253): at java.lang.reflect.Method.invokeNative(Native Method)\n07-29 11:54:59.173: E/AndroidRuntime(4253): at java.lang.reflect.Method.invoke(Method.java:515)\n07-29 11:54:59.173: E/AndroidRuntime(4253): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)\n07-29 11:54:59.173: E/AndroidRuntime(4253): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)\n07-29 11:54:59.173: E/AndroidRuntime(4253): at dalvik.system.NativeStart.main(Native Method)\n07-29 11:54:59.173: E/AndroidRuntime(4253): Caused by: java.lang.NullPointerException\n07-29 11:54:59.173: E/AndroidRuntime(4253): at com.ebiz.eis.realtimedar.NewEntry.onActivityResult(NewEntry.java:418)\n07-29 11:54:59.173: E/AndroidRuntime(4253): at android.app.Activity.dispatchActivityResult(Activity.java:5446)\n07-29 11:54:59.173: E/AndroidRuntime(4253): at android.app.ActivityThread.deliverResults(ActivityThread.java:3428)\n07-29 11:54:59.173: E/AndroidRuntime(4253): ... 11 more\n</code></pre>\n", "Lable": "No"} | |
| {"QuestionId": 25013263, "AnswerCount": 1, "Tags": "<wordpress><custom-post-type>", "CreationDate": "2014-07-29T10:34:45.253", "AcceptedAnswerId": "25013775", "Title": "Display the similar posts to a custom post", "Body": "<p>I have a custom post type 'events'. On 'single-events.php ' i want to display the similar posts related to this .\nI am using the following code but the problem is it is also displaying the current post. How do i get rid of current post, please help me out.</p>\n\n<pre><code> <?php\n $args = array( 'post_type'=>'events',\n 'tax_query' => array(\n\n array(\n 'taxonomy' => 'Event type',\n 'field' => 'slug',\n 'terms' => $type,\n )\n )\n );\n $postslist = get_posts( $args );\n\n\n ?>\n</code></pre>\n", "Lable": "No"} | |