BreezeJs and Chrome 33 - google-chrome

BreezeJS throws the following error on Chrome:
[Q] Unhandled rejection reasons (should be empty):
["Error: Illegal construction - use 'or' to combine …tp://localhost:6592/Scripts/breeze.min.js:5:9573)"]
0: "Error: Illegal construction - use 'or' to combine checks↵ at m (localhost:6592/Scripts/breeze.min.js:1:11658)↵ at r.isOptional (localhost:6592/Scripts/breeze.min.js:1:13100)↵ at k.getKey (localhost:6592/Scripts/breeze.min.js:2:5019)↵ at M [as _$interceptor] (localhost:6592/Scripts/breeze.min.js:1:7492)↵ at a.splice.h.computed.write (localhost:6592/Scripts/breeze.min.js:5:30754)↵ at dependentObservable [as id] (localhost:6592/Scripts/knockout-2.3.0.debug.js:1298:31)↵ at a.setProperty (localhost:6592/Scripts/breeze.min.js:5:31148)↵ at localhost:6592/Scripts/breeze.min.js:3:11420↵ at Array.forEach (native)↵ at q._updateTargetFromRaw (localhost:6592/Scripts/breeze.min.js:3:11058)↵ at k (localhost:6592/Scripts/breeze.min.js:5:9573)"
1: "Error: Illegal construction - use 'or' to combine checks↵ at m (localhost:6592/Scripts/breeze.min.js:1:11658)↵ at r.isOptional (localhost:6592/Scripts/breeze.min.js:1:13100)↵ at k.getKey (localhost:6592/Scripts/breeze.min.js:2:5019)↵ at M [as _$interceptor] (localhost:6592/Scripts/breeze.min.js:1:7492)↵ at a.splice.h.computed.write (localhost:6592/Scripts/breeze.min.js:5:30754)↵ at dependentObservable [as id] (localhost:6592/Scripts/knockout-2.3.0.debug.js:1298:31)↵ at a.setProperty (localhost:6592/Scripts/breeze.min.js:5:31148)↵ at localhost:6592/Scripts/breeze.min.js:3:11420↵ at Array.forEach (native)↵ at q._updateTargetFromRaw (localhost:6592/Scripts/breeze.min.js:3:11058)↵ at k (localhost:6592/Scripts/breeze.min.js:5:9573)"
length: 2
proto: Array[0]

Updated 3/1/2014
Ok, we think that this is fixed in Breeze v 1.4.9 ( or later) available now.
Previous post
This is a problem that we have been tracking. It appears to occur only on the minified version of Breeze in Chrome 33. We are planning a fix for later this week. Until then try using the unminified version.

Related

ITK(in ANTs) occurs error : no orthonormal definition found

ANTs open source provides transform functions that can move(frequently referred as normalizing or registration in neuroscience) one's brain MR image to other's brain MR image.
But I got an error below : not all MR images but some MR images make below error. There NEVER exist any differences when I opened those MR images with image viewer like ITK-snap. It seems centain MR images that occurs those error must have mathematical or algebraic differences with images that does not occur error. How can I find out what the problem is?
Error message:
/opt/ANTs/bin/antsRegistrationSyNQuick.sh: line 464:
[[: _MR.nii: syntax error: invalid arithmetic operator (error token is
".nii")
antsRegistration call:
/opt/ANTs/bin//antsRegistration --verbose 1 --dimensionality 3 --float 0 --collapse-output-transforms 1 --output [ T1xPET,T1xPETWarped.nii.gz,T1xPETInverseWarped.nii.gz ]
--interpolation Linear --use-histogram-matching 0 --winsorize-image-intensities [ 0.005,0.995 ] --initial-moving-transform [ _MR.nii,_FBB.nii,1 ] --transform Rigid[ 0.1 ] --metric MI[ _MR.nii,_FBB.nii,1,32,Regular,0.25 ] --convergence [ 1000x500x250x0,1e-6,10 ] --shrink-factors 8x4x2x1 --smoothing-sigmas 3x2x1x0vox
Output:
All_Command_lines_OK Using double precision for computations.
Exception caught during reference file reading
itk::ExceptionObject (0x5559bfd38530) Location: "unknown" File:
/home/nuc/Desktop/a/build/ITKv5/Modules/IO/NIFTI/src/itkNiftiImageIO.cxx
Line: 1980
Description: ITK ERROR: ITK only supports orthonormal direction cosines. No orthonormal definition found!
file _MR.nii Exception Object caught:
itk::ExceptionObject (0x5559bfd38530) Location: "unknown" File:
/home/nuc/Desktop/a/build/staging/include/ITK-5.2/itkCenteredTransformInitializer.hxx
Line: 40
Description: ITK ERROR: CenteredTransformInitializer(0x5559bfd22e10): Fixed Image has not been set
The short explanation is that the nifti image has unexpected metadata. Perhaps damaged? Or the writing library is buggy? Or some extension to the standard is assumed?
The exception is thrown in NIFTI reader code. You can look at the preceding code to see all the checks made against the orientation matrix before the exception is reached.

Invalid JSON Expression

I am making use of non-static import
JsonPath jp = response.jsonPath();
System.out.println(jp.get("data?(#.id>14).employee_name").toString());
For a JSON as shown below:
{"status":"success","data":[{"id":"1","employee_name":"Tiger Nixon","employee_salary":"320800","employee_age":"61","profile_image":""},{"id":"2","employee_name":"Garrett Winters","employee_salary":"170750","employee_age":"63","profile_image":""}]}
When i am trying to run it , i am getting below error:
java.lang.IllegalArgumentException: Invalid JSON expression:
Script1.groovy: 1: expecting EOF, found '[' # line 1, column 31.
data[?(#.id>14)].employee_name
^
1 error
Can someone guide me why is this error being thrown ?
I doubt if that syntax is right, nonetheless, you should be using the below
Also note that the id is a string in your response so you will have to include it in quotes
js.get("data.find {it.id > '14'}.employee_name").toString();

Parsing JSON with json_read_dict

I am working on the scripting program with Prolog, where they talk through the pipe and JSON-formatted data. Everything works fine except the json_read_dict/2 relation.
?- json_read_dict(F, "[{\"offset\":22784,\"esil\":\"ebp,ebp,^=,$z,zf,=,$p,pf,=,$s,sf,=,$0,cf,=,$0,of,=,0xffffffff,rbp,&=\",\"refptr\":false,\"fcn_addr\":0,\"fcn_last\":0,\"size\":2,\"opcode\":\"xor ebp, ebp\",\"disasm\":\"xor ebp, ebp\",\"bytes\":\"31ed\",\"family\":\"cpu\",\"type\":\"xor\",\"type_num\":28,\"type2_num\":0,\"flags\":[\"entry0\",\"rip\"]}]\n\n").
ERROR: Arguments are not sufficiently instantiated
ERROR: In:
ERROR: [11] get_code(_1324,_1326)
ERROR: [10] json:json_value(_1356,_1358,_1360,json_options(null,true,false,string,'')) at /usr/lib64/swipl-7.6.4/library/http/json.pl:260
ERROR: [9] json:json_read_dict(_1404,"[{\"offset\":22784,\"esil\":\"ebp,ebp,^=,$z,zf,=,$p,pf,=,$s,sf,=,$0,cf,=,$0,of,=,0xffffffff,rbp,&=\",\"refptr\":false,\"fcn_addr\":0,\"fcn_last\":0,\"size\":2,\"opcode\":\"xor ebp, ebp\",\"disasm\":\"xor ebp, ebp\",\"bytes\":\"31ed\",\"family\":\"cpu\",\"type\":\"xor\",\"type_num\":28,\"type2_num\":0,\"flags\":[\"entry0\",\"rip\"]}]\n\n",[]) at /usr/lib64/swipl-7.6.4/library/http/json.pl:934
ERROR: [7] <user>
ERROR:
ERROR: Note: some frames are missing due to last-call optimization.
ERROR: Re-run your program in debug mode (:- debug.) to get more detail.
How it is possible to parse this output with SWI-Prolog?
The json_read_dict/2 predicate takes a stream or stream alias as first argument. You cannot call it with the first argument unbound, hence the instantiation error. Maybe you're looking for the functionality of the atom_json_dict/3 predicate?
?- atom_json_dict("[{\"offset\":22784,\"esil\":\"ebp,ebp,^=,$z,zf,=,$p,pf,=,$s,sf,=,$0,cf,=,$0,of,=,0xffffffff,rbp,&=\",\"refptr\":false,\"fcn_addr\":0,\"fcn_last\":0,\"size\":2,\"opcode\":\"xor ebp, ebp\",\"disasm\":\"xor ebp, ebp\",\"bytes\":\"31ed\",\"family\":\"cpu\",\"type\":\"xor\",\"type_num\":28,\"type2_num\":0,\"flags\":[\"entry0\",\"rip\"]}]\n\n", D, []).
D = [_19642{bytes:"31ed", disasm:"xor ebp, ebp", esil:"ebp,ebp,^=,$z,zf,=,$p,pf,=,$s,sf,=,$0,cf,=,$0,of,=,0xffffffff,rbp,&=", family:"cpu", fcn_addr:0, fcn_last:0, flags:["entry0", "rip"], offset:22784, opcode:"xor ebp, ebp", refptr:false, size:2, type:"xor", type2_num:0, type_num:28}].
Update
It seems that you get the json(illegal_json) syntax error due to the presence of a starting quote in the output that we're trying to parse. Try instead:
read_result(Out, Json) :-
read_string(Out, "", "", _, String),
atom_json_dict(String, Json, []).
Using your sample call:
?- with_command("/bin/ls", "ij", O).
O = _5058{bin:_4930{arch:"x86", binsz:38688, bintype:"mach0", bits:64, canary:true, checksums:_4926{}, class:"MACH064", compiled:"", crypto:false, dbg_file:"", endian:"little", guid:"", havecode:true, intrp:"/usr/lib/dyld", lang:"c", linenum:false, lsyms:false, machine:"x86 64 all", maxopsz:16, minopsz:1, nx:false, os:"macos", pcalign:0, pic:true, relocs:false, retguard:false, rpath:"", static:false, stripped:true, subsys:"darwin", va:true}, core:_4498{block:256, fd:3, file:"/bin/ls", format:"mach064", humansz:"37.8K", iorw:false, mode:"r-x", obsz:0, size:38688, type:"Executable file"}}.

How to use ES6 modules that import modules with relative paths in ClosureScript?

I am attempting to use Twitter's Bootstrap 4 (beta) in a ClojureScript app. Using the :npm-deps compiler option does not work due to CLJS-2369. So my next attempt is to use the :foreign-libs compiler option (see github.com/au-phiware/cljsbuild-bootstrap4):
:foreign-libs [{:file "node_modules/bootstrap/js/src/util.js"
:provides ["bootstrap.util"]
:module-type :es6}
{:file "node_modules/bootstrap/js/src/alert.js"
:provides ["bootstrap.alert"]
:requires ["bootstrap.util"]
:module-type :es6}]})
In code, I require the module as:
(ns cljsbuild-bootstrap4.core
(:require [bootstrap.alert :as alert]))
But I encounter this error:
events.js:160
throw er; // Unhandled 'error' event
^
Error: Can't resolve './util' in '~/cljsbuild-bootstrap4'
at onError (~/cljsbuild-bootstrap4/node_modules/enhanced-resolve/lib/Resolver.js:61:15)
at loggingCallbackWrapper (~/cljsbuild-bootstrap4/node_modules/enhanced-resolve/lib/createInnerCallback.js:31:19)
at runAfter (~/cljsbuild-bootstrap4/node_modules/enhanced-resolve/lib/Resolver.js:158:4)
at innerCallback (~/cljsbuild-bootstrap4/node_modules/enhanced-resolve/lib/Resolver.js:146:3)
at loggingCallbackWrapper (~/cljsbuild-bootstrap4/node_modules/enhanced-resolve/lib/createInnerCallback.js:31:19)
at next (~/cljsbuild-bootstrap4/node_modules/tapable/lib/Tapable.js:252:11)
at innerCallback (~/cljsbuild-bootstrap4/node_modules/enhanced-resolve/lib/Resolver.js:144:11)
at loggingCallbackWrapper (~/cljsbuild-bootstrap4/node_modules/enhanced-resolve/lib/createInnerCallback.js:31:19)
at next (~/cljsbuild-bootstrap4/node_modules/tapable/lib/Tapable.js:249:35)
at resolver.doResolve.createInnerCallback (~/cljsbuild-bootstrap4/node_modules/enhanced-resolve/lib/DescriptionFilePlugin.js:44:6)
Note: I also tried the following :foreign-libs option but received the same result:
:foreign-libs [{:file "node_modules/bootstrap/js/src"
:module-type :es6}]})
This is a problem with 1.9.946. No longer reproducible with 1.10.238.
checked from CLJS-2369

pprint in browser repl causes TypeError

Does anybody understand the following behavior inside a ClojureScript browser repl? (provided by the boot tool chain)
my.core> (require 'cljs.pprint)
nil
my.core> (cljs.pprint/pprint "one")
#object[TypeError TypeError: cljs.pprint is undefined]
No stacktrace available.
my.core> (cljs.pprint/pprint "one" "two" "three")
WARNING: Wrong number of args (3) passed to cljs.pprint/pprint at line 1 <cljs repl>
#object[TypeError TypeError: cljs.pprint is undefined]
No stacktrace available.
It looks, that there is no reference to cljs.pprint/pprint, however the repl knows about the arity of this function.
this might help as well:
my.core> (cljs.repl/dir cljs.pprint)
t_cljs$pprint28171
t_cljs$pprint28177
with-pprint-dispatch
with-pretty-writer
write
write-out
nil
cider-repl-toggle-pretty-printing did the trick.