Invalid JSON:Unexpected non-whitespace character after JSONat line 2, column 1
| {"QuestionId": 13835353, "AnswerCount": 1, "Tags": "<grails><twitter-bootstrap><gsp>", "CreationDate": "2012-12-12T08:06:25.847", "AcceptedAnswerId": "13843143", "Title": "How to add style to the value attribute of submitToRemote?", "Body": "<p>In my application i use twitter bootstrap to add nice icons to buttons etc. With normal buttons and links i can achieve this by doing..</p>\n\n<pre><code><g:remoteLink .. code omitted .. class=\"btn\">\n <i class=\"icon icon-warning-sign\"></i> <g:message code=\"default.button.add.label\"/>\n</g:remoteLink>\n</code></pre>\n\n<p>This results in a nice button with a icon in front of the text..</p>\n\n<p>Now i want to use a submitToRemote:</p>\n\n<pre><code><g:submitToRemote .. code omitted .. value=\"${message(code: 'default.button.add.label')}\" class=\"btn\"/>\n</code></pre>\n\n<p>But i seem to fail in adding the</p>\n\n<pre><code><i class=\"icon icon-warning-sign\"></i>\n</code></pre>\n\n<p>to the value.. any hints or tips on how to achieve this?</p>\n\n<p>I tried several things like putting this style in the class attribute but this also fails.</p>\n\n<p>Any hints?</p>\n", "Lable": "No"} | |
| {"QuestionId": 13868582, "AnswerCount": 1, "Tags": "<iphone><xcode><uiwebview><ios6><storyboard>", "CreationDate": "2012-12-13T21:14:12.557", "AcceptedAnswerId": null, "Title": "Auto Adjust Storyboard Webview size according to navigation bar", "Body": "<p>I have a webview in a viewcontroller with a navigation bar and a toolbar. I have a hide toolbar and nav bar button, but when they hide the size of the webview doesn't adjust to fit the screen. I used this code: </p>\n\n<pre><code>-(IBAction)hide:(id)sender {\nmyView.frame = CGRectMake(0,0,320,480);\n[[[self navigationController] navigationBar] setHidden:YES];\n[[[self navigationController] toolbar] setHidden:YES];\n [self.view addSubview:myView];\n }\n\n -(BOOL)canBecomeFirstResponder {\n\nreturn YES;\n\n }\n\n -(void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event {\n\nif (event.subtype == UIEventSubtypeMotionShake) {\n\n myView.frame = CGRectMake(0,0,320,382);\n [[[self navigationController] navigationBar] setHidden:NO];\n [[[self navigationController] toolbar] setHidden:NO];\n [self.view addSubview:myView];\n\n}\n\n }\n</code></pre>\n\n<p>They hide properly but how can i adjust the size properly? Im using storyboard btw.</p>\n", "Lable": "No"} | |
| {"QuestionId": 14045532, "AnswerCount": 3, "Tags": "<bash><sed><awk>", "CreationDate": "2012-12-26T19:55:30.987", "AcceptedAnswerId": "14046171", "Title": "BASH replace char with other char to fill a word", "Body": "<p>I need to replace a selected character with as many copies of another character as necessary to fill up a determined space (exact 12 chars).</p>\n\n<p>Example, replace char '1' with zero or more char '0':</p>\n\n<pre><code>ABC1 => ABC000000000\nABC1JKL => ABC000000JKL\n1JKL => 000000000JKL\n1000 => 000000000000\nABCDEFGHIJKL1 => ABCDEFGHIJKL\n1ABCDEFGHIJKL => ABCDEFGHIJKL\nABCDEFGHIJKL => ABCDEFGHIJKL\n1EFG1 => undefined (do not bother with this case)\nEFG => undefined (do not bother with this case)\n</code></pre>\n", "Lable": "No"} | |
| {"QuestionId": 14045739, "AnswerCount": 1, "Tags": "<visual-studio-2010><opencv>", "CreationDate": "2012-12-26T20:15:30.960", "AcceptedAnswerId": "14047039", "Title": "Why is this while loop breaking while reading an avi file in opencv?", "Body": "<pre><code>int main(int argc, char* argv[]) {\nofstream file;\nfile.open(\"Motion.dat\");\nint frame_number = 0;\nCvCapture* capture = cvCreateFileCapture(\"Cricketc1.avi\");\nCvCapture* capture1 = cvCreateFileCapture(\"Cricketc1.avi\");\n\nIplImage* imgsize = NULL;\nIplImage *img1 = NULL;\nIplImage *img2 = NULL;\nIplImage *vidFrame = NULL;\nIplImage *imggray1 = NULL;\nIplImage *imggray2 = NULL;\nIplImage *imggray3 = NULL;\n\ncvNamedWindow(\"Video\", 0);\ncvNamedWindow(\"Video1\", 0);\nimgsize = cvQueryFrame(capture1);\nassert(imgsize);\nCvSize sz = cvGetSize(imgsize);\ncvReleaseCapture(&capture1);\nimggray1 = cvCreateImage(sz, IPL_DEPTH_8U, 1);\nimggray2 = cvCreateImage(sz, IPL_DEPTH_8U, 1);\nimggray3 = cvCreateImage(sz, IPL_DEPTH_8U, 1);\n\nwhile (true) {\n frame_number++;\n img1 = cvQueryFrame(capture);\n if(img1->imageData == NULL)\n break;\n cvCvtColor(img1, imggray1, CV_RGB2GRAY);\n\n img2 = cvQueryFrame(capture);\n if(img2->imageData == NULL)\n break;\n cvCvtColor(img1, imggray1, CV_RGB2GRAY);\n\n cvAbsDiff( imggray1, imggray2, imggray3 );\n CvScalar sumDiff = cvSum (imggray3);\n cout << sunDiff.val[0] << sunDiff.val[1] << sunDiff.val[2] << endl;\n cvWaitKey(40);\n}\ncvReleaseCapture(&capture);\ncvDestroyAllWindows();\nfile.close();\nsystem(\"Pause\");\nreturn 0;\n}\n</code></pre>\n\n<p>There are a total of 1251 frames in the video @ 25 fps.</p>\n\n<p>But the loop breaks at <code>frame_number</code> equal to 625, at line <code>if(img2->imageData == NULL)</code>.</p>\n\n<p>This error mainly comes up if I do any computation in between the while loop. A simple cvShowImage() will work just fine, but any other manipulation around it causes this error to show up.</p>\n\n<p>This is the error that comes up after that :\n<code>Unhandled exception at 0x00221de7 in getMotion2.exe: 0xC0000005: Access violation reading location 0x00000044.</code></p>\n\n<p>What is the problem ?</p>\n", "Lable": "No"} | |
| {"QuestionId": 14130290, "AnswerCount": 1, "Tags": "<android><oop>", "CreationDate": "2013-01-02T22:31:08.203", "AcceptedAnswerId": null, "Title": "android how to pass an object to a new class", "Body": "<p>I have the following Activity</p>\n\n<pre><code>public class BmiHistory extends Activity {\n\n\npublic Cursor cursor;\n\n@Override\npublic void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n //setContentView(R.layout.bmihistory);\n final DatabaseHandler databaseOpen = new DatabaseHandler(this);\n final SQLiteDatabase db = databaseOpen.getReadableDatabase();\n\n Cursor c1 = db.rawQuery(\"select * from bmi\", null);\n startManagingCursor(c1);\n c1.moveToFirst();\n this.cursor = c1; \n while(!c1.isAfterLast()) {\n System.out.println(c1.getString(2));\n c1.moveToNext();\n }\n c1.close();\n\n\n BmiGraph drawView = new BmiGraph(this);\n drawView.setBackgroundColor(Color.WHITE);\n setContentView(drawView);\n\n}\n\n\n}\n</code></pre>\n\n<p>I have the following class called from this activity</p>\n\n<pre><code>public class BmiGraph extends View {\n\nPaint paint = new Paint();\n\n\npublic BmiGraph(BmiHistory context) {\n super(context);\n // TODO Auto-generated constructor stub\n System.out.println(context.toString());\n}\n\npublic void onDraw(Canvas canvas) {\n paint.setColor(Color.BLACK);\n paint.setStrokeWidth(3);\n ...\n}\n\n\n}\n</code></pre>\n\n<p>My question is how can I make the data from the cursor in the Activity available to the second class in order to plot a graph?</p>\n\n<p>Many thanks</p>\n", "Lable": "No"} | |
| {"QuestionId": 14236658, "AnswerCount": 0, "Tags": "<php>", "CreationDate": "2013-01-09T13:48:00.493", "AcceptedAnswerId": null, "Title": "I want to fetch all the friends list from facebook by their email address?", "Body": "<blockquote>\n <p><strong>Possible Duplicate:</strong><br>\n <a href=\"https://stackoverflow.com/questions/4331666/how-to-get-facebook-friends-email\">How to get Facebook friends' email?</a> </p>\n</blockquote>\n\n\n\n<p>I want to fetch all the friends list from facebook. can any one lell me the way to get facebook friends list.i am developing a website, and i want there a option to invite my facebook frends by their email address.</p>\n", "Lable": "No"} | |
| {"QuestionId": 14351709, "AnswerCount": 1, "Tags": "<grails><spring-security><cas>", "CreationDate": "2013-01-16T05:05:22.747", "AcceptedAnswerId": null, "Title": "Issue while deploying new war for a groovy in grails application using CAS for user authentication", "Body": "<p>I am Facing a Problem. I have used CAS to authenticate the user log in for my application . How ever each time when i deploy the application war and browse i receive a Hibernate Exception error, and after continuously refreshing for 5,6 times login page appears. I am unable to track the issue. Please Help.</p>\n\n<p>Here is the log-</p>\n\n<pre><code>Could not synchronize database state with session\norg.hibernate.HibernateException: No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here\n at org.springframework.orm.hibernate3.SpringSessionContext.currentSession(SpringSessionContext.java:63)\n at org.hibernate.impl.SessionFactoryImpl.getCurrentSession(SessionFactoryImpl.java:574)\n at org.codehaus.groovy.grails.orm.hibernate.validation.HibernateDomainClassValidator.validate(HibernateDomainClassValidator.java:66)\n at org.codehaus.groovy.grails.validation.GrailsDomainClassValidator.validate(GrailsDomainClassValidator.java:126)\n at org.codehaus.groovy.grails.orm.hibernate.metaclass.ValidatePersistentMethod.doInvokeInternal(ValidatePersistentMethod.java:117)\n at org.codehaus.groovy.grails.orm.hibernate.metaclass.AbstractDynamicPersistentMethod.invoke(AbstractDynamicPersistentMethod.java:59)\n at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)\n at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)\n at java.lang.reflect.Method.invoke(Method.java:597)\n at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoCachedMethodSite.invoke(PojoMetaMethodSite.java:188)\n at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:52)\n at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:132)\n at org.codehaus.groovy.grails.plugins.orm.hibernate.HibernatePluginSupport$_addValidationMethods_closure19.doCall(HibernatePluginSupport.groovy:484)\n at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)\n at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)\n at java.lang.reflect.Method.invoke(Method.java:597)\n at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)\n at org.codehaus.groovy.runtime.metaclass.ClosureMetaMethod.invoke(ClosureMetaMethod.java:80)\n at org.codehaus.groovy.grails.orm.hibernate.support.ClosureEventListener.onPreUpdate(ClosureEventListener.java:264)\n at org.codehaus.groovy.grails.orm.hibernate.support.ClosureEventTriggeringInterceptor.onPreUpdate(ClosureEventTriggeringInterceptor.java:167)\n at org.hibernate.action.EntityUpdateAction.preUpdate(EntityUpdateAction.java:237)\n at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:88)\n at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)\n at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263)\n at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:168)\n at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)\n at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50)\n at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1027)\n at org.springframework.orm.hibernate3.HibernateAccessor.flushIfNecessary(HibernateAccessor.java:390)\n at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:407)\n at org.springframework.orm.hibernate3.HibernateTemplate.executeFind(HibernateTemplate.java:343)\n at org.codehaus.groovy.grails.orm.hibernate.metaclass.ListPersistentMethod.doInvokeInternal(ListPersistentMethod.java:53)\n at org.codehaus.groovy.grails.orm.hibernate.metaclass.AbstractStaticPersistentMethod.invoke(AbstractStaticPersistentMethod.java:64)\n at org.codehaus.groovy.grails.orm.hibernate.metaclass.AbstractStaticPersistentMethod.invoke(AbstractStaticPersistentMethod.java:57)\n at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)\n at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)\n at java.lang.reflect.Method.invoke(Method.java:597)\n at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoCachedMethodSite.invoke(PojoMetaMethodSite.java:188)\n at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:52)\n at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:132)\n at org.codehaus.groovy.grails.plugins.orm.hibernate.HibernatePluginSupport$_addQueryMethods_closure45.doCall(HibernatePluginSupport.groovy:619)\n at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)\n at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)\n at java.lang.reflect.Method.invoke(Method.java:597)\n at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)\n at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)\n at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1058)\n at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1070)\n at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:886)\n at groovy.lang.Closure.call(Closure.java:282)\n at org.codehaus.groovy.runtime.metaclass.ClosureStaticMetaMethod.invoke(ClosureStaticMetaMethod.java:59)\n at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite$StaticMetaMethodSiteNoUnwrapNoCoerce.invoke(StaticMetaMethodSite.java:148)\n at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.call(StaticMetaMethodSite.java:88)\n at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)\n at org.codehaus.groovy.runtime.callsite.StaticMetaClassSite.call(StaticMetaClassSite.java:55)\n at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120)\n at org.codehaus.groovy.grails.plugins.springsecurity.ReflectionUtils.loadAllRequestmaps(ReflectionUtils.groovy:72)\n at org.codehaus.groovy.grails.plugins.springsecurity.RequestmapFilterInvocationDefinition.loadRequestmaps(RequestmapFilterInvocationDefinition.java:64)\n at org.codehaus.groovy.grails.plugins.springsecurity.RequestmapFilterInvocationDefinition.reset(RequestmapFilterInvocationDefinition.java:51)\n at org.codehaus.groovy.grails.plugins.springsecurity.RequestmapFilterInvocationDefinition.initialize(RequestmapFilterInvocationDefinition.java:41)\n at org.codehaus.groovy.grails.plugins.springsecurity.AbstractFilterInvocationDefinition.findConfigAttributes(AbstractFilterInvocationDefinition.java:99)\n at org.codehaus.groovy.grails.plugins.springsecurity.AbstractFilterInvocationDefinition.getAttributes(AbstractFilterInvocationDefinition.java:81)\n at org.springframework.security.access.intercept.AbstractSecurityInterceptor.beforeInvocation(AbstractSecurityInterceptor.java:171)\n at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:106)\n at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)\n at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:378)\n at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:97)\n at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:378)\n at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:78)\n at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:378)\n at org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter.java:112)\n at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:378)\n at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)\n at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:378)\n at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:187)\n at org.codehaus.groovy.grails.plugins.springsecurity.RequestHolderAuthenticationFilter.doFilter(RequestHolderAuthenticationFilter.java:40)\n at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:378)\n at org.springframework.deerwalk.impl.CustomCasAuthenticationFilter.doFilter(CustomCasAuthenticationFilter.java:113)\n at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:378)\n at org.codehaus.groovy.grails.plugins.springsecurity.MutableLogoutFilter.doFilter(MutableLogoutFilter.java:79)\n at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:378)\n at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:79)\n at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:378)\n at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:167)\n at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)\n at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)\n at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)\n at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)\n at com.planetj.servlet.filter.compression.CompressingFilter.doFilter(CompressingFilter.java:270)\n at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)\n at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)\n at org.jasig.cas.client.session.SingleSignOutFilter.doFilter(SingleSignOutFilter.java:106)\n at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)\n at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)\n at org.jasig.cas.client.session.SingleSignOutFilter.doFilter(SingleSignOutFilter.java:106)\n at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)\n at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)\n at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)\n at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)\n at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)\n at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)\n at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)\n at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)\n at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)\n at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)\n at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)\n at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)\n at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)\n at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)\n at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)\n at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)\n at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)\n at java.lang.Thread.run(Thread.java:619)\n</code></pre>\n", "Lable": "No"} | |
| {"QuestionId": 14426004, "AnswerCount": 1, "Tags": "<android><android-contacts>", "CreationDate": "2013-01-20T15:23:20.410", "AcceptedAnswerId": null, "Title": "Reading the \"me\" contact card", "Body": "<p>Starting with some API, Google decided to add a \"me\" contact, describing info of the device's owner.</p>\n\n<p>How do you read the info of this contact? Is it even possible? And from which API can I assume it exists?</p>\n", "Lable": "No"} | |
| {"QuestionId": 14444625, "AnswerCount": 2, "Tags": "<javascript><google-maps><angularjs>", "CreationDate": "2013-01-21T18:04:31.190", "AcceptedAnswerId": "14445259", "Title": "AngularJS: map via Google Maps API v3 in a tab", "Body": "<p>I am trying to create a page with tabs (using AngularJS). There is a map (Google Maps API v3) in one of those tabs. When the map is in the tab in foreground everything seems to be OK. But when the map is loaded in the background tab and visible only after the tab is clicked the map is misplaced/cut off and when you try to manipulate with it it's functionality seems to be broken.</p>\n\n<p>I've searched for solutions and I found those tricks with </p>\n\n<pre><code>google.maps.event.trigger(map, 'resize');\nmap.setCenter(center);\n</code></pre>\n\n<p>but it's not working.\nCould you please have a look at <a href=\"http://jsfiddle.net/n4q7Y/5/\">http://jsfiddle.net/n4q7Y/5/</a> and tell me what I missed?</p>\n\n<p>Thank you.</p>\n", "Lable": "No"} | |
| {"QuestionId": 14445484, "AnswerCount": 2, "Tags": "<web-services><apache-camel><endpoint>", "CreationDate": "2013-01-21T19:06:21.173", "AcceptedAnswerId": null, "Title": "Webservice having \"No such operation: HTTP GET PATH_INFO\"", "Body": "<p>I currently have a SOAP web service and I am trying to access it's endpoint but I keep getting this error:</p>\n\n<pre><code><soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">\n <soap:Body>\n <soap:Fault>\n <faultcode>soap:Server</faultcode>\n <faultstring>\n No such operation: (HTTP GET PATH_INFO: /camel-example-reportincident/webservices/incident)\n </faultstring>\n </soap:Fault>\n </soap:Body>\n </soap:Envelope>\n</code></pre>\n\n<hr>\n\n<h2>UNIT TEST</h2>\n\n<pre><code>package org.apache.camel.example.reportincident;\n\nimport junit.framework.TestCase;\n\nimport org.apache.camel.CamelContext;\nimport org.apache.camel.impl.DefaultCamelContext;\nimport org.apache.cxf.jaxws.JaxWsProxyFactoryBean;\nimport org.jvnet.mock_javamail.Mailbox;\n\n/**\n * Unit test of our routes\n */\npublic class ReportIncidentRoutesTest extends TestCase {\n\nprivate CamelContext camel;\n\n// should be the same address as we have in our route\nprivate static String ADDRESS = \"cxf://http://localhost:8080/camel-example-reportincident/webservices/incident\"\n + \"?serviceClass=org.apache.camel.example.reportincident.ReportIncidentEndpoint\"\n + \"&wsdlURL=report_incident.wsdl\";\n\nprotected void startCamel() throws Exception {\n camel = new DefaultCamelContext();\n camel.addRoutes(new ReportIncidentRoutes());\n camel.start();\n}\n\nprotected static ReportIncidentEndpoint createCXFClient() {\n // we use CXF to create a client for us as its easier than JAXWS and works\n JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();\n factory.setServiceClass(ReportIncidentEndpoint.class);\n factory.setAddress(ADDRESS);\n return (ReportIncidentEndpoint) factory.create();\n}\n\npublic void testRendportIncident() throws Exception {\n // start camel\n startCamel();\n\n // assert mailbox is empty before starting\n Mailbox inbox = Mailbox.get(\"incident@mycompany.com\");\n assertEquals(\"Should not have mails\", 0, inbox.size());\n\n // create input parameter\n InputReportIncident input = new InputReportIncident();\n input.setIncidentId(\"123\");\n input.setIncidentDate(\"2008-08-18\");\n input.setGivenName(\"Claus\");\n input.setFamilyName(\"Ibsen\");\n input.setSummary(\"Bla\");\n input.setDetails(\"Bla bla\");\n input.setEmail(\"davsclaus@apache.org\");\n input.setPhone(\"0045 2962 7576\");\n\n // create the webservice client and send the request\n ReportIncidentEndpoint client = createCXFClient();\n OutputReportIncident out = client.reportIncident(input);\n\n // assert we got a OK back\n assertEquals(\"0\", out.getCode());\n\n // let some time pass to allow Camel to pickup the file and send it as an email\n Thread.sleep(3000);\n // assert mail box\n assertEquals(\"Should have got 1 mail\", 1, inbox.size());\n\n // stop camel\n camel.stop();\n}\n</code></pre>\n\n<p>}</p>\n\n<p>I am attempting to use CFX endpoint along with my camel routing and when I am putting the endpoint address in the route and then unit testing it I am getting a \"No endpoint could be found for: //path/to/endpoint\".</p>\n\n<p>I am assuming that the fact that I am getting an error when I try to access the endpoint url is the issue but I do not even know where to begin on figuring out how to fix it.</p>\n\n<p>When I hit my webservice on SOAP UI it runs fine as well. Any help would be greatly appreciated, and I can provide any info that is needed.</p>\n", "Lable": "No"} | |
| {"QuestionId": 14480173, "AnswerCount": 3, "Tags": "<xml><xslt><xml-namespaces>", "CreationDate": "2013-01-23T12:50:26.690", "AcceptedAnswerId": "14480656", "Title": "XSL output XML with no prefix without using the default namespace?", "Body": "<p>I have an XSL where I need to generate output along the lines of this:</p>\n\n<pre><code><moo xmlns=\"http://api.example.com\">\n <foo>1358944586848</foo>\n <bar>\n <a>1</a>\n <b>2</b>\n <c>3</c>\n </bar>\n</moo>\n</code></pre>\n\n<p>I could do it like this:</p>\n\n<pre><code><xsl:stylesheet version=\"2.0\"\n xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\"\n xmlns=\"http://api.example.com\">\n\n <xsl:template match=\"/\">\n <xsl:element name=\"moo\">\n <!-- and so on -->\n</code></pre>\n\n<p>However, I kind of hate using the xsl prefix in my xsl files cause I feel it clutters it up a lot. Selecting with XPath is easy anyways since you can set <code>xpath-default-namespace</code> to whatever you're transforming from if needed. But there is no <code>element-default-namespace</code> available as far as I can see, so how can I generate the wanted output in a good way?</p>\n\n<p>I know I can do this:</p>\n\n<pre><code><stylesheet version=\"2.0\"\n xmlns=\"http://www.w3.org/1999/XSL/Transform\">\n\n <template match=\"/\">\n <element name=\"moo\" namespace=\"http://api.example.com\">\n <!-- and so on -->\n</code></pre>\n\n<p>But then I have to set this namespace explicitly on every single element I create, or they will end up with the XSL namespace instead. So is there a clean way to create elements with a certain namespace (without a prefix) and not touching the default namespace of the xsl file?</p>\n\n<hr>\n\n<p><strong>Update:</strong></p>\n\n<p>Figured maybe <code>namespace-alias</code> could do something, but can't figure out how to use it. Tried this, but doesn't seem to make any difference in the output at all:</p>\n\n<pre><code><stylesheet version=\"2.0\"\n xmlns=\"http://www.w3.org/1999/XSL/Transform\"\nxmlns:out=\"http://api.example.com\">\n\n<namespace-alias stylesheet-prefix=\"out\" result-prefix=\"\"/>\n\n <template match=\"/\">\n <element name=\"out:moo\">\n <!-- and so on -->\n</code></pre>\n\n<p>The <code>namespace-alias</code> thing probably isn't doing what I think it is :p</p>\n\n<p><em><strong>The final solution I used, based on JLRishe's answer</strong></em></p>\n\n<p><em>remove-prefixes.xsl</em></p>\n\n<pre><code><?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<stylesheet version=\"2.0\" xmlns=\"http://www.w3.org/1999/XSL/Transform\">\n <template match=\"/\">\n <variable name=\"result\">\n <next-match />\n </variable>\n <apply-templates select=\"$result\" mode=\"remove-prefixes\" />\n </template>\n\n <template match=\"*\" priority=\"1\" mode=\"remove-prefixes\">\n <element name=\"{local-name()}\" namespace=\"{namespace-uri()}\">\n <apply-templates select=\"@* | node()\" mode=\"remove-prefixes\" />\n </element>\n </template>\n <template match=\"@*|node()\" mode=\"remove-prefixes\">\n <copy>\n <apply-templates select=\"@* | node()\" mode=\"remove-prefixes\" />\n </copy>\n </template>\n\n</stylesheet>\n</code></pre>\n\n<p><em>subject.xsl</em></p>\n\n<pre><code><!-- snip -->\n<import href=\"remove-prefixes.xsl\" />\n<!-- snip -->\n</code></pre>\n", "Lable": "No"} | |