Posts

Showing posts from March, 2011

ckeditor - scayt_ plugin stores lot of values in localstorage in chrome browser -

Image
a lot of values stored in local storage session.i want remove values localstorage session. can please me out? you can disable storing data in localstorage using next option: config.scayt_disableoptionsstorage = 'all' and can find more information option following next link: https://docs.ckeditor.com/#!/api/ckeditor.config-cfg-scayt_disableoptionsstorage wiki

java - Where is the web.xml for Ehcache 3? -

i trying implement basic webpage caching, having trouble finding resources explanations. keep finding code no explanations or or explanations (in docs) no code. can provide simple tutorial? far can tell steps follows: implement listener 4.1 directions (couldnt find 3.0 version this) add ehcache.xml (wrote own simple one) add paths web.xml- here 2.7 version (couldn't find 3.0 version) does know find correct files ehcache 3.0 implementation? the web filter doesn't exist anymore in ehcache 3. specific. however, can implement own. listeners have been removed well. won't need them. the first step configure ehcache. have @ documentation , samples . then, cache pages. recommend use simplified version of ehcache 2 filter . wiki

javascript - How to enlarge images in Ruby on Rails? -

i have working ruby on rails app. users exchange photos , messages(microposts). users see enlarge photos clicking on them. it supposed similar wordpress when users click on dimension indicated (for ex. 3024 *4032), see bigger photos. i think achieve goal need use java script. right if user post big picture, program makes smaller(see file below indication size). i keep option @ same time add new one: enlarge photo after clicking on it. is possible user click on adjusted photo , make larger in ruby on rails? files related below: // app/models/micropost.rb class micropost < activerecord::base belongs_to :user default_scope -> { order(created_at: :desc) } mount_uploader :picture, pictureuploader validates :user_id, presence: true validates :content, presence: true, length: { maximum: 3440 } validate :picture_size private # validates size of uploaded picture. def picture_size if picture.size > 5.megabytes errors.add(:p

c# - AllowHtml Could Not Be Found -

Image
i using mvc 5 , allowhtml attribute not being found when use in view model. please tell me doing wrong because have searched internet , seems though doing right. the error edit: added code using system; using system.collections.generic; using system.linq; using system.threading.tasks; using system.componentmodel.dataannotations; using system.web.mvc; namespace studentgovernment_v2.models.bill { public class billtexteditmodel { public int id { get; set; } public string name { get; set; } [allowhtml] public string text { get; set; } } } make sure you've referenced proper version of system.web.mvc namespace in web.config use allowhtmlattribute . since image shows red squiggly line below namespace, check if web.config files (in project root folder & views folder) has reference depending on mvc version used (i used mvc version 5.0 example here): [project root]\web.config <system.web> <pages validatere

javascript - Regular expression for check number and + -

sorry useless question! i need regular expression check type of string +7 i try .replace(/^+[0-9][^\d]/g, '') give me type of math symbols, need first symbol + second 1 number 1 - 9 your regex needs be ^\+[0-9][^\d] if want match numbers starting + can use /\+\d+/g note match +73ab , return +73 if want numbers can use /\b\+\d+\b/g wiki

java.lang.IllegalArgumentException: ResourceLoader must not be null in Spring -

i want run https://github.com/spring-projects/spring-security-kerberos on machine (via intellij idea). module trying build , run sec-server-spnego-form-auth , keep getting java.lang.illegalargumentexception: resourceloader must not null java.lang.illegalstateexception: applicationeventmulticaster not initialized - call 'refresh' before multicasting events via context , comes because of first error, guess. any ideas might wrong here? stacktrace: 2017-08-22 13:28:44.457 error 15064 --- [ main] o.s.boot.springapplication : application startup failed java.lang.illegalargumentexception: resourceloader must not null @ org.springframework.util.assert.notnull(assert.java:112) @ org.springframework.boot.autoconfigure.autoconfigurationsorter.<init>(autoconfigurationsorter.java:53) @ org.springframework.boot.autoconfigure.enableautoconfigurationimportselector.selectimports(enableautoconfigurationimportselector.java:72) @ org.sprin

oracle - How to access BI Publisher reports using Report link on Mobile Device -

Image
i have problem accessing bi reports on mobile devices. currently, have plugged in report link application below: $('#reportpath').val() + 'members/member balances (combined - per member).xdo?_xpf=_xpt=0_xdo=%2f~weblogic%2ffundmaster%2freports%2fmembers%2fmember%20balances%20(combined%20-%20per%20member).xdo_xmode=3_paramsmember_id='$('#member_id').val() +'&_paramsbase=' + $('#xirootpath').val() + '&_paramsscheme_id=' + $('#scheme_id').val() + '&_paramsap_id=' + json.accountingperiodid + '&_xt=member%20balances%20(combined)&_xf=analyze&_xana=view&_xautorun=false&_paramsadmin=3347&id='+ $("#username").val() + '&passwd=' + $("#password").val() + '&_paramsblankimage=' + alternativeurl +'&_paramsalternativeurl=' + alternativeurl + '&_paramsorientation=' + orientation; thus reports can viewed below: but

wordpress - Get data from one url by using custom url pattern wp -

can suggest me this- example.com/topic/a-1.html using url want data example.com/topic?page=a&number=1 in wp. tried wp rewrite functions not helped me. & tried too. rewriteengine on rewriterule ^([^/] )/([^/] ).html$ /topic?page=$1&num=$2 [l] reply. if set permalinks in options , links in site have form site.com/page , if need delivery get parameter can anyway, adding @ end of get request site.com/page?id=1&page=2 wiki

unity3d - How to Rename a Unity Project? -

i want change name of unity project else such unity editor shows new name @ top or when open script using visual studio, shows new name @ top of vs. how that? does changing project name change game's name (the name appears on top left corner of game window)? does changing project name change name of game's executable file? to change unity project name : change unity project folder name (the parent folder of 'assets' folder) remove file .sln or .csproj suffixes under project folder. (unity regenerate them) does changing project name change game's name (the name appears on top left corner of game window)? no! change game's name go edit > project settings > player > product name , change new name. does changing project name change name of game's executable file? no! when comes create build game (by file > build settings ), unity asks file name. name becomes name of executable file (on pc). how o

ajax - updating student information in symfony -

i developping application , got problem in front-end part. it's related symfony , ajax . using session variable in order add student school before sending form of school server (back-end). using ajax. not how debug it. tried posted in net not work. able add student school not able update student information. that's seem easy it's not thought. here ajax call using in schoolcreate.html.twig : function ajax () { $.ajax({ type: 'post', url: "{{ path('student_add') }}", data: $('#addstudent').serialize(), success: function (response) { var htmltodisplay = response.trim(); $('#students').html(htmltodisplay); } }); } my modal used create school: <div class="modal-body"> {{ render(controller('appbundle:school:addstudent')) }} </div> addstudent : public function addstudentaction(

android - Room Persistence Library: attempt to re-open an already-closed object -

everything working fine when using 1.0.0-alpha5 version of room persistence library. but, after updating 1.0.0-alpha9 version, getting error: java.lang.illegalstateexception: attempt re-open already-closed object: sqlitedatabase: /data/data/package_name/databases/app_db how can solve this? edit: i using mvp architecture dagger 2. have got databasehelper class initializes roomdatabase: @singleton public class databasehelper { private final appdatabase appdatabase; @inject public databasehelper(@applicationcontext context context) { appdatabase = room.databasebuilder(context, appdatabase.class, "app_db").build(); } public list<difficultyentity> getalldifficulties() { return appdatabase.difficultydao().getalldifficulties(); } my roomdatabase: @database(version = 22, entities = { difficultyentity.class, // .... }) @singleton public abstract class appdatabase extends roomdatabase { public abstract difficultydao diff

javascript - How to set minTime without closing the current datetimepicker? -

i'm using datetimepicker trent richardson; i'd give users calendar, both dates , times restricted differently each supplier; e.g. supplier x may available mon 9am-5pm , wed 3pm-5pm - i'd users able select dates/times within these ranges. the way i've done restrict day of week via beforeshowday; using onselect update mintime , maxtime. however: once mintime updated, datetimepicker window close. i'd remain open ideally; otherwise @ least trigger window re-open automatically. i've tried .trigger('click') doesn't seem work is possible have more 1 timeslot per day - e.g. allow user select 9am-11am, , 2pm-3pm on mondays is there smarter way overall? relevant code below onselect: function(datetext, inst){ var ele = $(this); ele.datetimepicker("option", "mintime", '11:00 am'); }); wiki

reactjs - Adding custom elements on react native swiper tiles -

i using react-native-deck-swiper project, question how add custom parameters images, custom html elements tiles. there way add these cards array? currently cards array structured like: cards: ["1","2","3"] is there way structure can pull in custom parameters so: cards: [{name:"1", image:"imageurl", age:"43"},{name:"2", image:"imageurl", age:"22"}] i appreciate help you can make card component, , pass data props: const cards = [ { name: "1", image: "imageurl", age: "43" }, { name: "2", image: "imageurl", age: "22" }, ]; const card = props => <view> <image source={props.image} /> <text> {props.name}, {props.age} </text> </view>; <deckswiper cards={cards} rendercard={props => <card {...props} />} />; wiki

symfony - Symfony2/Doctrine QueryBuilder multiple andwhere() fail -

bonjour, i having problem simple request querybuilder : $query->where('ec.codemodeprelevement in (:cbmode)') ->setparameter('cbmode', $modes) ->andwhere('ec.idstatuspaiement = :status') ->setparameter('status', echeancesstatut::__en_attente_paiement__) ->andwhere($query->expr()->eq('ec.idproduit',1)) ->andwhere('ec.idproduit = :idproduit') ->setparameter('idproduit', 1 ) ; this return me no result if in database no user corresponding : user status = 1 codeproduit = 1 , modepaiement = vm or vmmano. ihave verified possible mistakes of typo. , users corresponding in database exist. i have tried remove id produit filter "works" have result: $modes = array('vm','vmmano'); $query->where('ec.codemodeprelevement in (:cbmode)') ->setparameter('cbmode', $modes)

.net - Compiling C# to Native? -

i think i'm confused compiling .net byte-code native code, or maybe i'm confused end result. please bear me try sort through think understand can me figure out i'm missing. what i'd compile application written in c# down regular native code i'd if had written in c. reasoning has nothing performance, rather degree of protection. understand end-goal not impossible (or difficult) circumvent, feel reversing x86 assembly more difficult reversing reflector gives me. right if throw c# application reflector, source-code back. typically when throw unmanaged c/c++ applications idapro , use hexrays decompiler, don't quite same degree of decompilation , have resort wading through x86 disassembly understand logic flow. it's understanding such great decompilation comes reflector due application being in msil instead of more terse native code hexrays tries decompile. i have no concerns client machine still needing .net runtimes, i'm not trying circumven

code conversion from itext 2 to itext 5.5 -

i generating pdf using itext 2 , below code string xhtml = toxhtml(xml).replaceall("<br>", "<br/>"); itextrenderer renderer = new itextrenderer(); renderer.setdocumentfromstring(xhtml); renderer.layout(); file temp = file.createtempfile("test", ".pdf"); temp.deleteonexit(); outputstream os = new fileoutputstream(temp); renderer.createpdf(os); os.close(); but, when place itextpdf-5.5 jar.i getting below error type com.lowagie.text.documentexception cannot resolved. indirectly referenced required .class files i know of methods deprecated. tried using document class but, did n't work. do need find alternatives createpdf method in new api or there way can make jar not refer 'lowagie' deprecated. on appreciated itext 2 packages starting com.lowagie , while itext 5 packages starting com.itextpdf . replacing jar won't work in such place. have replace im

arduino - Converting Data Types from integer to char* -

i working on school project includes list of i2c ids match particular sensors using. //do, ph, electric conductivity, temperature int channel_ids[] = {97, 99, 100, 102}; the problem trying connect particular api uses different numbers represent channels , character pointer. // 70 id temperature api trying connect to. char *gtapi_channelid="70" i want create if statement looks like: if (gtapi_channelid == "70") { channel_ids="102"; } but not know how when channel_ids integer , gtapi_channelid character pointer. thanks wiki

ember.js - template is not a function - EmberJs/ROR Application -

i'm getting error when loading app via browser. not sure what's wrong. ember:7062 uncaught typeerror: template not function @ renderlegacytemplate (ember:7062) @ renderview (ember:7026) @ renderview (ember:33679) @ class.render (ember:33702) @ emberrenderer_createelement [as createelement] (ember:35727) @ emberrenderer.renderer_rendertree [as rendertree] (ember:7699) @ emberrenderer.scheduledrendertree (ember:7774) @ invoke (ember:879) @ queue.flush (ember:944) @ deferredactionqueues.flush (ember:749) this error might related (server side): actioncontroller::routingerror (no route matches [get] "/ember-template-compiler.map"): wiki

osx - How to conduct automation testing in a custom Excel add-in in Mac -

the application excel add-in consists of manifest file, xml file. on launching manifest file, add-in appeared new tab. contains custom functionalities. need automate these functionalities. there automation tools can automate this. please me on this. wiki

Matlab - quadprog - Variable values zero or larger than particular value -

i trying use quadprog in matlab solve quadratic problem particular constraints. here they: 1.) x has weights vector, sum of x has 1. includes constraint, values of x have interval <0,1> 2.) x * vector1 = particular value. (vector1 known) everything works great , setting constraints wasn't hard.... vector x contains approximately 6000 variables. makes values of of variables less 10^-4. make them 0 or higher value (for example 0.01). possible? if extract 20 biggest values , make new weight vector depending on sum of values result of quadprog, second constraint not satisfied anymore. minimum of 1/2*x h x totally bad. there other way need? thanks lot :) wiki

vb.net - Get hashed Password using same concept in c# , vb give different results -

i have vb code apply hashing string , tried same concept using c# give me different result although when debug code using same value , values of myhash,bytearray,hasharray in c# project same vb project final returned string different here code in vb: dim hashkey(23) byte public function stringhash(byval strstring string) string if strstring.trim = "" return "" try generatekey() dim myhash hashalgorithm = new mactripledes(hashkey) dim bytearray() byte bytearray = asciistringtobytearray(strstring) dim hasharray() byte hasharray = myhash.computehash(bytearray) hasharray = removequotes(hasharray) return bytearraytoasciistring(hasharray) catch ex exception return "" end try end function public function generatekey() byte() integer = 0 hashkey.length - 1 hashkey(i) = * 3 + 19 next return hashkey end function public function asciistringtob

Unable to use vagrant ssh on a custom box -

i have created custom vagrant box, based on the official ubuntu/xenial64 vagrant box , message when attempt use vagrant ssh : ==> default: machine you're attempting ssh configured use ==> default: password-based authentication. vagrant can't script entering ==> default: password you. if you're prompted password, please enter ==> default: same password have configured in vagrantfile. the change box provision nginx. use... vagrant package --vagrantfile <path_to_vagrantfile> --output nginx.box ... <path_to_vagrantfile> is, in case, /home/blackslate/.vagrant.d/boxes/ubuntu-vagrantslash-xenial64/20170822.0.0/virtualbox/vagrantfile . follow with: vagrant box add nginx nginx.box i create new directory , use vagrant init nginx create new instance of box. whole process described in this question . when use vagrant up , appears running expected: vagrant bringing machine 'default' 'virtualbox' provider... ==> default: im

python - Extracting and parsing dates in a pandas dataframe -

i trying convert messy notebook dates sorted date series in pandas. 0 03/25/93 total time of visit (in minutes):\n 1 6/18/85 primary care doctor:\n 2 sshe plans move of 7/8/71 in-home servic... 3 7 on 9/27/75 audit c score current:\n 4 2/6/96 sleep studypain treatment pain level (n... 5 .per 7/06/79 movement d/o note:\n 6 4, 5/18/78 patient's thoughts current su... 7 10/24/89 cpt code: 90801 - psychiatric diagnos... 8 3/7/86 sos-10 total score:\n 9 (4/10/71)score-1audit c score current:\n 10 (5/11/85) crt-1.96, bun-26; ast/alt-16/22; wbc... 11 4/09/75 sos-10 total score:\n 12 8/01/98 communication referring physician... 13 1/26/72 communication referring physician... 14 5/24/1990 cpt code: 90792: medical servic... 15 1/25/2011 cpt code: 90792: medical servic... i have multiple dates formats such 04/20

php - How to set array key same as value -

i have question seems obvious can't reproduce yet. well, let's have array: $array = ('apple', 'orange', 'banana'); so have same array same keys values, this: array( 'apple' => 'apple', 'orange' => 'orange', 'banana' => 'banana' ); how that? $array = array('first','second','third'); $newarray = array(); foreach($array $value) { $newarray[$value] = $value; } or initialize array wanted to: $array = array( 'first' => 'first', 'second' => 'second' ); wiki

ios - Zoom a view controller in swift -

i creating ios application (swift) have multiple labels in view controller. not using scrollview. need zoom view controller on pinch gesture. know have found solutions scroll view, don't want implement scrollview in view controller. appreciated! thank you. updated: i have implemented scrollview in view controller. have added view in scrollview , view contains labels, issues facing are: zoom not stay static. release fingers, scrollview automatically zoomed original was. when view controller in original state, app crashes. here code: @iboutlet weak var scrollview: uiscrollview! @iboutlet var viewthis: uiview! override func viewdidload() { super.viewdidload() scrollview.delegate = self //let gesture = uipinchgesturerecognizer(target: self, action: #selector(pinchaction(sender:))) //self.view.addgesturerecognizer(gesture) // additional setup after loading view. let scrollviewframe = scrollview.frame let scalewidth = scrollviewframe.s

javascript - Uploading both original and resized images with ng-file-upload -

i'm trying app both save in server resized image , original file. this i've tried far: html: <a ng-model="originalpic" ngf-select="uploadphototest($file)" ngf-resize="{width: 1170, type: 'image/jpeg'}" ngf-resize-if="$width > 1000" ngf-model-options="{updateon: 'change drop paste'}" ngf-fix-orientation="true"> upload image </a> js: $scope.uploadphototest = function (file) { $scope.fileext = file.name.substring(file.name.lastindexof('.'), file.name.length); $scope.uniqueportrait = $scope.fairnameonly + "-" + moment().format('dd-mm-yyyy-hh-mm-ss') + $scope.fileext; upload.imagedimensions(file).then(function(dimensions){ if (dimensions.width < 1170){ $scope.sizeerror = true; }else{ fileor = $scope.originalpic; upload.upload({ url: 'uploadtest.php', data: {

ios - Swift 3 pass values to Controller on UICollectionViewCell button click -

Image
i beginner in ios development , have implemented following screen using uicollectionview : collectionviewcell file code is: import uikit class eventcell: uicollectionviewcell{ var classevent: event? @iboutlet weak var eventtitle: uilabel! @iboutlet weak var eventteams: uilabel! @iboutlet weak var eventtime: uilabel! @iboutlet weak var eventteamoneimage: uiimageview! @iboutlet weak var eventteamtwoimage: uiimageview! @iboutlet weak var leaderboardbutton: uibutton! var datasourceitem: any?{ didset{ guard let event = datasourceitem as? event else { return } classevent = event eventtitle.text = "match \(event.matchno) (\(event.matchstage))" eventteams.text = "\(event.teamone.nameattr) vs \(event.teamtwo.nameattr)" eventtime.text = "\(event.geteventlocktimeasstring())" eventteamoneimage.loadimageusingcache(withurl: event.teamone.flagphoto) eventteamtwoimage.loadimageusingcache(withurl:

javascript - Should data functions be properties of a data array? -

i have dataset , functions manipulate data. store data , functions in logical structure readable , easy use without violating practices. i see 2 options: 1. define data array , add manipulation functions array, possible because array kind of object. example: var dataset = [1, 2, 3, 4]; var dataset.add = function (newdata) { if (newdata === baddata) { console.log('bad data!'); return; } dataset.push(newdata); }; pros : cleaner, more readable, easier use cons : modifying array object, means not behave expected, should not try copy object example, or document fact doing causes lose it's functions. 2. define new object , define data property of object along manipulation functions. example: var dataset = { data: [1, 2, 3, 4], add: function (newdata) { if (newdata === baddata) { console.log('bad data!'); return; } data.push(newdata); } }; pros: object works e

mongodb - How to fix Flask-Pymongo Server TimeOut Error? -

i trying connect mongodb using flask-pymongo. if uri 'mongodb://username:password@localhost/db' getting error this. if use pymongo instead flask-pymongo working fine. can me doing wrong. [wsgi:error] [pid 11570:tid 140000932448000] [client 75.145.147.36:61878] mod_wsgi (pid=11570): target wsgi script '/var/www/flaskapp/flaskapp.wsgi' cannot loaded python module., referer: http://104.196.184.145/ [wsgi:error] [pid 11570:tid 140000932448000] [client 75.145.147.36:61878] mod_wsgi (pid=11570): exception occurred processing wsgi script '/var/www/flaskapp/flaskapp.wsgi'., referer: http://104.196.184.145/ [mon aug 21 19:47:24.659190 2017] [wsgi:error] [pid 11570:tid 140000932448000] [client 75.145.147.36:61878] traceback (most recent call last):, referer: http://104.196.184.145/ [mon aug 21 19:47:24.659213 2017] [wsgi:error] [pid 11570:tid 140000932448000] [client 75.145.147.36:61878] file "/var/www/flaskapp/flaskapp.wsgi", line 7, in <

Understanding Scala mutable set val reference -

in book "programming in scala", third edition, saw example not understand. understand it, typed scala interpreter: scala> import scala.collection.mutable import scala.collection.mutable scala> val movieset = mutable.set("hitch", "poltergeist") movieset: scala.collection.mutable.set[string] = set(poltergeist, hitch) scala> movieset res3: scala.collection.mutable.set[string] = set(poltergeist, hitch) <<< res3 scala> movieset += "shrek" res4: movieset.type = set(poltergeist, shrek, hitch) <<< res4 my understanding when doing += on mutable.set, set should mutate in-place (i.e. variable assigned should not change), reference changed res3 res4. also, understood "val movieset" create value cannot changed. shouldn't cause "val movieset" remain res3 reference, , not change res4? the res3 , res4 additional references same object, generated scala shell whenever typ

javascript - How to find the type of content inside req.body? -

as per https://developer.mozilla.org/en-us/docs/web/api/request/request type of body can of either type: arraybuffer blob formdata json text is there way receiving side know type is? reason ask since getting post message 3rd party req.body empty. // code console.info("headers: ", req.headers); // shows headers console.log("data: ", req.body); // shows nothing however, after further inspection, seems need process data follows (since using readablestream): // code 3rd party library req.on('data', function (chunk) { data += chunk; }); req.on('end', function () { var messagedata = json.parse(data); console.log("data: ", messagedata); //shows data } you could people use express , body parser library avoid having loads of boilerplate code parsing them. wiki

symfony - if Security denies access for a Certain Role , Trigger a Jquery Function in Symfony3 -

i have notification popup want trigger if security denies access role_user use path admin_only , configured , works perfectly, on : security.yml access_control: - { path: ^/login$, role: is_authenticated_anonymously } - { path: ^/admin_only, role: role_admin } access_denied_url: /home and have jquery function on twig file rendering /home action let's call accessdeniedjq . question how check , ( action in controller or on twig ) redirection has happened , access denied , in other words how check if exception raised jq function starts. when framework internal redirect (or can't know if there http redirect) best bet use url query string let code aware of it. here suggestion append similar redirected=true in url become /home?redirected=true using function taken answer @ jquery querystring url function geturlvars() { var vars = [], hash; var hashes = window.location.href.slice(window.location.href.indexof('?') + 1).split(

wordpress - Meta tags showing dynamically but share button can't read open graph -

i have problem in wordpress site. trying add social share in single page addthis html inline button. have not used plugin because post showing database(it's not wordpress post). have added code addthis <div class="addthis_inline_share_toolbox"></div> <script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-599ab21e622f447a"></script> meta tag: used meta tag dynamically. there sample. <meta property="og:title" content="the title"/> <meta property="og:description" content="the description"/> <meta property="og:type" content="article"/> <meta property="og:site_name" content="demo"/> <meta property="og:image" content="https://www.w3schools.com/html/pic_mountain.jpg"/> now, when post open in single page, meta tags have changed dynamically. can see inspect element

Android - Create app with OpenGL or Canvas? -

i want create app android this one . which topics need learn develop it? (especially simulation part) would need learn opengl or canvas ? wiki

tsql - SQL Server does not choose to use index although everything seems to suggest it -

Image
something wrong here , don't understand what. it's worth mention, there searched value not in table, existing value there no problem. though, why first query require clustered key search primary key not used in query, while second can run on index directly. forcing query use index with(index(indexname)) work, why optimizer not choose use itself. the column piece_num not in other index , not primary key. set statistics io on declare @vcheventnum varchar(50) set @vcheventnum = '54235dds28kc1f5sjqmwz' select top 1 fwt.weight, fwt.test_result fin_weight_tests fwt with(nolock) fwt.piece_num @vcheventnum + '%' order fwt.dttm_insert desc select top 1 fwt.weight, fwt.test_result fin_weight_tests fwt with(nolock) fwt.piece_num '54235dds28kc1f5sjqmwz' + '%' order fwt.dttm_insert desc set statistics io off i let both queries run in 1 batch: i

graph - Shortest path that satisfies specific edge contraints -

suppose have graph weighted edges , want find shortest path, additional caveat, there additional constraints must satisfied based on other properties of previous edges. best example can think of flight or bus type. nodes cities , edges flights/routes, , example, edge weights price. want find cheapest ticket, can't take bus or plane leaves before current bus/plane arrives. in example, might have list of tuples (city1, city2, price, duration, departure) , goal find cheapest "feasible" route in order take edge e departure_time>culmative_time. cannot think of or efficient solution. use dijkstra's algorithm. however, every time travel new vertex along edge, update cumulative time vertex. any edge heading out of vertex no longer being offered (total time exceeds it's offered time), deleted. any edge heading out of vertex not offered will offered in due time, add time required wait along time of travel next vertex, if edge found next cheapest edge.

javascript - Handlebars Failover Content With Lookup Helper -

i looking render handlebars partial via lookup helper. isn't problem, can code: {{> (lookup . 'type') }} however, if variable type doesn't render value in partials directory, 500 error throws. handlebars supports failover content. such as: {{#> mypartial }} failover content {{/mypartial}} my question is, can combine lookup failover? i hoping like: {{#> (lookup . 'type') }} failover content {{/(lookup . 'type')}} i don't think there way combine dynamic lookup helper partial block . however, think can come custom helper job us. all our helper needs take partial name , try find partial name in handlbars.partials map. if finds partial, return result of calling partial template current data context. otherwise, our helper return template within block (the failover content). handlebars.registerhelper('partialresolver', function (partialname, options) { var partial = handlebars.partials[partialname];

charts - c3.js: possible to label x axis and multiple y axes? -

is possible define values x-axis values in c3.js chart has multiple y values? i trying create mixed bar- , line- chart 2 y-axes , custom labels x-axis. the result should this: desired-output i have referred c3.js examples guide attempts: c3js.org/samples/axes_y2.html , c3js.org/samples/axes_x_tick_values.html able produce mixed line , bar chart 2 y-axes. when add in labels x-axis, however, lose second y axis: i can chart show 2 y-axes: <html> <head> <link href="https://cdnjs.cloudflare.com/ajax/libs/c3/0.4.10/c3.min.css" rel="stylesheet" type="text/css"> </head> <body> <div id="chart"></div> <script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/c3/0.4.10/c3.min.js"></script> <script> var chart = c3.generate({ bindto: '#c