Posts

javascript - Backbone: Best way to handle variable common to all models -

i'm developing first backbone single page app project , i'm facing issue. basically have menu (html select input element) implemented view. value used control pretty every other data requests since specifies kind of data show in other views. right handle dom event , trigger global event every model can catch , keep track internally of new value. that's because value needed when requesting new data. doesn't solution because a) end writing same function (event handler) in every model , b) several models same variable. var metrics = backbone.collection.extend({ url: "dummy-metrics.json", model: metricsitem, initialize: function () { this.metric = undefined; }, setmetric: function (metric) { this.metric = metric; globalevents.trigger("metric:change", this.get(metric)); } }); var globalcomplexity = backbone.collection.extend({ url: function () { var url = "http://asd/global.jso...

xml - XSLT - check attribute is exist or not -

i'm new xslt. may simple question, example : xml <doc> <sec id="sec_2" sec-type="norm-refs"> </doc> i need know there <sec> node containing attribute sec-type='node-refs' , exist or not in original xml document. this simple xpath: //sec[@type="norm-refs"] the @ symbol indicates want attribute matches, not element. square brackets indicate want matches selector returns comes before square brackets.

c++ - Use Octave in msvc 2010 -

i using octave within msvc 2010. first downloaded octave latest version @ link . after installing, tried run simple code: #include <iostream> #include<octave-3.6.4\octave\oct.h> #include<octave-3.6.4\octave\config.h> #include<octave-3.6.4\octave\octave.h> using namespace std; int main (void) { std::cout << "hello octave world!\n"; system("pause"); return 0; } note added these links project well: c:\software\octave-3.6.4\include\octave-3.6.4\octave--->includ. dir., c:\software\octave-3.6.4\include--->includ. dir. c:\software\octave-3.6.4\lib--->lib. dir. c:\software\octave-3.6.4\lib\octave\3.6.4--->lib dir. i added 1 , 2 additional inc dir!! c:\software\octave-3.6.4\lib\octave\3.6.4--->additional lib. dir in linker. first, got error cannot find math.h in program files while file in program files (x86). so, changed to: c:\program files (x86)\microsoft visual studio 10.0\vc\include\math.h , ...

asp.net mvc - Can an Html.Actionlink pass the selected value of a dropdownlist? -

i have mvc razor page have 2 html action links work fine separately, not together. before looking jquery option, wanted make sure wasn't missing obvious. hoping keep things simple adding second parameter relevant html.actionlink. i making transition web pages mvc, gathered have far looking @ examples on microsoft asp.net learning resources , other posts. these current (relevant) sections of cshtml page. first action (filter dropdown): @ top of page have dropdown can filter form 1 column value. itself, works great. @using (html.beginform()) { <p> filter campus: @html.dropdownlist("searchbyfilter", new selectlist(viewbag.names)) <input type="submit" value="filter" /> </p> } second action (sort column): in header row of table, have action link, when user clicks column header, controller serves table sorted appropriately. i'm showing single column out of table show how works. <th> ...

javascript - Joomla - how to Unset JS file from head using info given by user in template parameters -

i've unset both js , css files manually joomla template html head using usual method below. unset($this->_scripts['/media/jui/js/bootstrap.min.js']); unset($this->_stylesheets['/media/jui/js/bootstrap.min.css']); my question this. possible store file , path info variable , use variable in place of path/file in above examples? , if so, might way this? the reason? want give users of template ability enter multiple files/paths separated comma template parameters, store these various files/paths array, loop through array (unsetting/removing each 1 html head of template). the purpose? 1 needs remove js html head , bottom of page reduce page load times, page transition flickers/white blinking, etc. in case don't want use plugin. i'd rather give users fine grained control if possible built template. of course, i'll have place in template parameters user add whatever js remove header bottom. the code i'm using? // grab js file paths use...

How to control master volume with c# wpf applications? -

i trying control master volume wpf applications, did research on this, , of solutions window form applications, can't apply on wpf. they're both c#, wpf don't have handle, made solution unusable. here see here know how control master volume in wpf application? -- have plan b this, if there not convenience way this. maybe achieve coding virtual key press? pressing mute key on keyboard programmatically? thank you!

java - JPA AccessType.Property failing to retrieve value from nested classes -

i'm attempting parse json @entity in order persist data in table. confirmed parsing works have run issue when attempting persist data. in order retrieve needed value in nested classes (two deep) using @access(accesstype.property) annotation on "helper" method. my best guess entity object being created prior retrieving value nested classes , when attempts retrieve "nested" value class instances null. result unable map value persistence field. below ascertain important part of exception: exception description: method [getnestedhref] on object [com.something.dotcom.bleep.parsers.hierarchyv2] triggered exception. internal exception: java.lang.reflect.invocationtargetexception target invocation exception: java.lang.nullpointerexception mapping: org.eclipse.persistence.mappings.directtofieldmapping[nestedhref-->schema.tbl_hierarchy.href] descriptor: relationaldescriptor(com.something.dotcom.bleep.parsers.hierarchyv2 --> [databasetable(schema.tbl_hiera...