I stumbled into this issue, where i was generating an image using Highcharts and PhantomJS. URL: http://www.highcharts.com/component/content/article/2-articles/news/56-improved-image-export-with-phantomjs
I was using the JSON:
{'series': [{'data': [10, 9, 7, 4]}], 'chart': {'type': 'bar'}, 'xAxis': {'categories': ['5 - 10', '11 - 16', '17 - 22', '23 - 28']}, 'title': {'text': u'HistoData'}};
PhantomJS threw errors telling:
SyntaxError: Parse error
Highcharts.customCode.parsed
ReferenceError: Can't find variable: options
phantomjs://webpage.evaluate():63
phantomjs://webpage.evaluate():132
phantomjs://webpage.evaluate():132
Now, it took me a while to figure out, that the correct JSON was:
{'series': [{'data': [10, 9, 7, 4]}], 'chart': {'type': 'bar'}, 'xAxis': {'categories': ['5 - 10', '11 - 16', '17 - 22', '23 - 28']}, 'title': {'text': 'HistoData'}};
Now, there is no direct link to the error and the fix. Is there a better way to debug syntax issues ? It would be a pain in the ass to figure out what went wrong with the JSON chart data otherwise.
You could try using a json validator tool to make sure your json is in the correct format. e.g. http://jsonlint.com/
Related
I have an issue while i am trying to execute the XSLT program.Need your help to know why this exception issue is occurring.
Transformer Configuration Exception occurred when loading XSLT CreateTicket_new.xsl; details: Error checking type of the expression 'funcall(max, [AbsoluteLocationPath(ParentLocationPath(ParentLocationPath(ParentLocationPath(ParentLocationPath(ParentLocationPath(step("child", 19), step("child", 1, pred(!=(funcall(name, []), literal-expr(header))))), step("child", 41)), step("child", 37)), step("child", 42)), step("child", 3)))])'. See error logs for details
I am using XSLT 2.0 Version.
I am using from SAP PO tool.
i created following code but i get error "TCPDF ERROR: Error in 1D barcode string", what is wrong with this code?
$pdf->write1DBarcode(cooode($balance), 'C128C', '', '', '', 18, 0.4, $style, 'N');
code works fine when i add it in example here
$pdf->Cell(35,0,cooode($balance),0,0,'L',0); # eräpäivä
The most likely reason why you are getting this error is that the value being passed as the first parameter, ie. the result of cooode($balance) is not in a valid format according to the rules for the C128C encoding.
I'm taking a JSON string that's the result from polling the Foursquare venue API:
{
"id"=>"4e404742c65b4ec27606deb4",
"name"=>"Sarah's Cheesecake & Cafe",
"contact"=>{
"phone"=>"4134436678",
"formattedPhone"=>"(413) 443-6678"
},
"location"=>{
"address"=>"180 Elm St",
"lat"=>42.44345873,
"lng"=>-73.23804678,
"distance"=>1063,
"postalCode"=>"01201",
"city"=>"Pittsfield",
"state"=>"MA"
},
"categories"=>[
{
"id"=>"4bf58dd8d48988d16d941735",
"name"=>"Café",
"pluralName"=>"Cafés",
"shortName"=>"Café",
"icon"=>{
"prefix"=>"https://foursquare.com/img/categories/food/cafe_",
"sizes"=>[
32,
44,
64,
88,
256
],
"name"=>".png"
},
"primary"=>true
}
],
"verified"=>false,
"stats"=>{
"checkinsCount"=>7,
"usersCount"=>5,
"tipCount"=>0
},
"hereNow"=>{
"count"=>0
}
}
As you can tell, there are some non-standard characters in there such as Cafés and that's breaking my Mongoid based Model in this JRuby on Rails app. When trying to to create an instance with MyModel.create, here's what I get.
jruby-1.6.5 :012 > FoursquareVenue.create(hash)
Java::JavaLang::NullPointerException:
from org.jruby.exceptions.RaiseException.<init>(RaiseException.java:101)
from org.jruby.Ruby.newRaiseException(Ruby.java:3348)
from org.jruby.Ruby.newEncodingCompatibilityError(Ruby.java:3323)
from org.jruby.RubyString.cat(RubyString.java:1285)
from org.jruby.RubyString.cat19(RubyString.java:1221)
from org.jruby.RubyHash$5.visit(RubyHash.java:727)
from org.jruby.RubyHash.visitAll(RubyHash.java:594)
from org.jruby.RubyHash.inspectHash(RubyHash.java:721)
from org.jruby.RubyHash.inspect(RubyHash.java:745)
from org.jruby.RubyHash$i$0$0$inspect.call(RubyHash$i$0$0$inspect.gen:65535)
from org.jruby.RubyClass.finvoke(RubyClass.java:632)
from org.jruby.javasupport.util.RuntimeHelpers.invoke(RuntimeHelpers.java:545)
from org.jruby.RubyBasicObject.callMethod(RubyBasicObject.java:353)
from org.jruby.RubyObject.inspect(RubyObject.java:408)
from org.jruby.RubyArray.inspectAry(RubyArray.java:1483)
from org.jruby.RubyArray.inspect(RubyArray.java:1509)
... 420 levels...
from org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:75)
from org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:190)
from org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:179)
from org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:312)
from org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:169)
from usr.local.rvm.rubies.jruby_minus_1_dot_6_dot_5.bin.jirb.__file__(/usr/local/rvm/rubies/jruby-1.6.5/bin/jirb:17)
from usr.local.rvm.rubies.jruby_minus_1_dot_6_dot_5.bin.jirb.load(/usr/local/rvm/rubies/jruby-1.6.5/bin/jirb)
from org.jruby.Ruby.runScript(Ruby.java:693)
from org.jruby.Ruby.runScript(Ruby.java:686)
from org.jruby.Ruby.runNormally(Ruby.java:593)
from org.jruby.Ruby.runFromMain(Ruby.java:442)
from org.jruby.Main.doRunFromMain(Main.java:321)
from org.jruby.Main.internalRun(Main.java:241)
from org.jruby.Main.run(Main.java:207)
from org.jruby.Main.run(Main.java:191)
from org.jruby.Main.main(Main.java:171)
If I strip out all the odd characters, everything works as expected and no exception is thrown. What's the proper way of handling this? Can I enabled my Mongoid/MongoDB documents to work with UTF-8? do I need to "asciify" them somehow first if that's not possible?
Could be an encoding bug in JRuby's 1.9 mode. Does the same thing happen when you run it in 1.8 mode? Either way, a stacktrace should be filed as a bug at http://bugs.jruby.org. Thanks!
gem install bson_ext might help.
Source: MongoDB, Ruby and UTF-8
If you are using ubuntu, then you need to do some extra steps with spidermonkey/mongodb installation:
Most pre-built Javascript SpiderMonkey libraries do not have UTF-8
support compiled in; MongoDB requires this.
Source: Building for Linux
MongoDB and mongoid handle utf-8 properly. I was doing the same thing with the Foursquare API not long ago via the Quimby wrapper.
As a result, I would suspect the bug is closely related to the use of JRuby.
Have you set up JRuby to use UTF8?
require 'jcode'
$KCODE = 'u'
I've written this HAML:
%script{:src => "http://www.google.com/jsapi?key=mykey" :type => "text/javascript"}
Note the missing comma between :src and :type.
On my Production server (Dreamhost/Linux), I get the following logged exception when I try to view the page:
ActionView::TemplateError (compile error
/home/.kuce/sugarthrill_stage/site/releases/20090927200712/app/views/layouts/standard.haml:6: syntax error, unexpected ':', expecting ')'
haml_temp = _hamlout.push_script(haml_temp, false, false, false, false, false);_hamlout.open_tag("script", false, true, false, false, {}, false, false, nil, nil, :src => "http://www.google.com/jsapi?key=ABQIAAAAynKnt9hv30uxjfbUx9X4DBRU8FW8TmMUFf4GF0BysDPVLHB6-RQwlOJobSWKbilPiM4dB6xk_4JbgQ" :type => "text/javascript");
However, I don't see this error on my Development server (Local OS X, WeBRICK); I see the (correctly-rendered) page.
This is a bit disturbing. Is there any reason that this compilation error would be suppressed on development?
I've got a fix for this that I'll submit as soon as GitHub comes back online. It'll be released as part of Haml 2.2.6, which will be sent out some time today or tomorrow.
Thanks for the bug report!
Edit: This is now fixed in commit f1a6cc9.
Edit 2: This has now been released as part of Haml 2.2.6.
Well that is confusing. I probably can't help you, but I would suggest that if you want to see closer similarities to the way you develop to production systems you should use a server that is considered production ready, and if you can, the same server as your production box.
I just want to reference a resource dictionary in a referenced assembly.
Assembly name: ResourceTest.Content
Resource Dictionary Path: ./Dictionary2.xaml
This was working on SL3 Beta 1:
<ResourceDictionary Source="ResourceTest.Content;component/Dictionary2.xaml" />
I tried this in Blend 3+Sketchflow and this works (at design time):
<ResourceDictionary Source="pack://application:,,,/ResourceTest.Content;component/Dictionary2.xaml" />
But, either way, when I run from Visual Studio, I get the following error:
Attribute ResourceTest.Content;component/Dictionary2.xaml value is out of range. [Line: 10 Position: 44]
Attribute pack://application:,,,/ResourceTest.Content;component/Dictionary2.xaml value is out of range. [Line: 11 Position: 44]
Try adding a / before your Assembly name:
This should work ...