Posts

Showing posts from March, 2014

matlab - How to Bode plot an array of transfer functions? -

Image
i have transfer functions corresponding llc converter. each 1 different, i'm changing single parameter visualize changes in frequency response. have this: v(1)=voutput; v(2)=voutput2; v(3)=voutput3; then plot them using: figure(1) optsv = bodeoptions('cstprefs'); optsv.frequnits = 'khz'; bode(v, optsv) the problem every transfer function being plotted in different chart: how can plot them in single chart? use bode(v(1),'r',v(2),'g',v(3),'b', optsv) where v1,v2,v3 various transfer functions. they plotted 3 lines 3 colors red, green, blue. edit, in reply comment: if write in comments many, can create figure, call hold on , , plot transfer functions in loop, this: first_tf = tf(1,[1,1]); %your example of many tf. v = [first_tf,2*first_tf,3*first_tf]; figure hold on j=1:length(tfdata(v)) bode(v(j)) end with output like:

C# unable to catch all exceptions -

i'm writing c# application (in linux mono shouldn't matter) , programming duplicati dlls. want program never crashes tried catch every exception. problem exception thrown , can't catch it. maybe thread?!? sidenote: testing purposes intentionally tried backup location don't have permission. if give permission, no error. the code looks following: try { interface = new interface(backend, options); result = i.backup(folders.toarray()); } catch (exception e) { //write log. //here no throw; !! } i following stack trace: error : system.exception: failed retrieve file listing: access path "/home/pi/test" denied. ---> system.unauthorizedaccessexception: access path "/home/pi/test" denied. @ system.io.directory.getfilesystementries (system.string path, system.string searchpattern, fileattributes mask, fileattributes attrs) [0x00000] in <filename unknown>:0 @ system.io.directory.getfiles (system.string path, system.str

javascript - Get all duplicate values from object array -

i have following object deserialised json data [{ "employeenumber": "169", "employeenumbererror": "", "employeefirstname": "saj" }, { "employeenumber": "169", "employeenumbererror": "", "employeefirstname": "carlton" }, { "employeenumber": "1002", "employeenumbererror": "", "employeefirstname": "stanley" }] i want duplicate 'employeenumber' object using javascript or jquery. can 1 me? try this $(document).ready(function() { var v = [{ "employeenumber": "169", "employeenumbererror": "", "employeefirstname": "saj" }, { "employeenumber": "169", "employeenumbererror": "", "employeefirstname": "c

unable to access google spreedsheets values using php -

i'm installed google api oauth2 php lib; here: https://code.google.com/p/google-api-php-client/ google spreadsheet api php lib; here: https://github.com/asimlqt/php-google-spreadsheet-client created credentials on api console using service account https://console.developers.google.com/ here php script used in combination above: require_once('vendor/autoload.php'); require_once('vendor/composer/autoload_classmap.php'); require_once('vendor/composer/autoload_real.php'); require_once __dir__.'/vendor/google/apiclient/src/google/auth/assertioncredentials.php'; use google\spreadsheet\defaultservicerequest; use google\spreadsheet\servicerequestfactory; use google\spreadsheet\spreadsheetservice; const g_client_id = 'my_client_id'; const g_client_email = 'email address'; const g_client_key_path = 'key.p12'; const g_client_key_pw = 'notasecret'; $obj_client_auth = new google_client (); $obj

Calabash - Android - Finding Ids and handling placeholders -

i'm new calabash, have spent day learning (including getting setup). one thing need how find ids ease. have android app, contains placeholder text username. i've tried following not working (i keep getting timeout error presume down not being able find): when enter "some@user.com" "username" so questions: 1- above correct if want enter email field username 2- if didnt have placeholder above how can obtain references or ids , use in then /^i enter "([^\"]*)" input field number (\d+)$/ many thanks. to find locators should use calabash console. if run calabash-android console your_app.apk once starts reinstall_apps , then start_test_server_in_background . once it's running can use calabash query syntax find elements want interact - https://github.com/calabash/calabash-ios/wiki/05-query-syntax . to started query("*") return on screen. query("id:'usernamefield'") return elem

c# - Odd LINQ/EF Behavior when Grouping by DateTime -

i have bit of code i've been using months without problem , today datetime overflow error. the original code looks this var payments = (from p in context.payments p.paymenttype == "direct" && p.exportfile == null group p new { p.customer, p.debtorid, p.receiptnumber, p.paymentdate } g select new { g.key.customer, g.key.debtorid, amount = g.sum(b => b.amount) * -1, receiptnumber = g.key.receiptnumber ?? default(long), paymentdate = g.key.paymentdate != null ? (datetime)g.key.paymentdate : datetime.minvalue }).tolist(); whats odd is, in particular instance, code selecting 1 row of data looks this: id customer debtorid amount receiptnumber exportfile paymenttype paymentdate 99 183245 672

asp.net mvc - How to make a .NET MVC Form inside a Modal using jQuery with validation -

i struggling knowing how put together. i've built forms inside .net mvc pages plenty of times, , without validation. , i've built forms using jquery, , without validation. , i've built forms inside of modal, never mvc. i understand original question because form inside modal i'll need use jquery handle submit. having heck of time figuring out how put these moving pieces together. far, i've not found tutorial (or combo of tutorials) puts together. here's need: inside of mvc view, there button opens modal. (this working fine.) once modal opens, contains form several text fields , dropdowns. each required. (to make fields required, define these in view's model, mvc form? or create requirements in jquery?) if user attempts submit form , empty or invalid, modal stays open , validation messages appear. (i understand, original question , not possible using straight mvc because of modal, , jquery needed. i'm lost here.) if user attempts

javascript - Google maps Icon -

i'm trying set google maps icon depending on integer. i.e. if variable 3 set icon brown image marker. i've followed tutorial found here https://developers.google.com/maps/documentation/javascript/examples/icon-simple , here how can change color of google maps marker? this code, images located in same directory when load page error saying unexpected identifier @ icon: image. whats problem? function getlocations(){ var data = <?php echo getjson(); ?>; var = 0; var locations = new array(); for(i; < data.length; i++){ var dataholder = [data[i].misc, parsefloat(data[i].lat), parsefloat(data[i].lng), parseint(data[i].status)]; locations.push(dataholder); } return locations; } function createmap() { var locations = getlocations(); var map = new google.maps.map(document.getelementbyid('map'), { zoom: 13, center: new google.maps.latlng(47.624561, -122.356445), maptypeid: google.maps.ma

asp.net mvc 4 - C# MVC Get Current View/Dynamic Template -

i trying return current dynamic view allow me append css class actionlink if current view same actionlink. as passing majority of links through specific route, in case pages, currentaction pages in cases, despite actual view or template being returned actionresult called. so example if url http://mytestdomain.com/sport currentaction sport , not pages. please see code below: routeconfig.cs routes.maproute("pages", "{maincategory}/{subcategory}/{pagename}", new { controller = "home", action = "pages", subcategory = urlparameter.optional, pagename = urlparameter.optional }); homecontroller public static mvchtmlstring menulink(this htmlhelper htmlhelper, string linktext, string actionname, string controllername) { var currentcontroller = htmlhelper.viewcontext.parentactionviewcontext.routedata.getrequiredstring("controller"); var currentaction = htmlhelper.viewcontext.parentactionviewcontext.routedata.getrequired

internet explorer - IE displaying timespan in jquery datatables using moment -

i've got working in firefox running in ie9-11 or chrome error's stating, "script438: object doesn't support property or method 'replace' file: moment.min.js, line: 6, column: 4546" below column code, { data: "calltime", title: "time", classname: "calltime", render: function (data) { return moment(data, string).format('hh:mm'); } }, i'm using datatables 1.10.4 , moment 2.10.3 wondering if solution change field datetime , format display/input time. i have tried doing "return moment(data).format('hh:mm');" displays "invalid date". couldn't find other way work switch output datetime.today + calltime , format datetime display time. now need figure out why search doesn't work either date or time fields.

c# - Getting "An item with this key has already been added" when performing a DeleteByQuery with Nest (Elasticsearch) -

i trying run delete query delete documents between 2 timestamps in index, , getting strange result. here code: // how index created if (!es.indexexists(indexname).exists) { es.createindex(descriptor => descriptor .index(indexname) .addmapping<mydocument>(m => m .mapfromattributes())); } // event object mapped public class mydocument { public long id { get; set; } public long eventtime { get; set; } [elasticproperty(index = fieldindexoption.notanalyzed)] public string eventtype { get; set; } public datetime createdat { get; set; } public idictionary<string, object> values { get; set; } // snip } // delete call ielasticclient es; es.deletebyquery<mydocument>(q => q .query(rq => rq .range(t => t.onfield("eventtime").greaterorequals(starttimestamp).lowerorequals(endtimestamp))); this throws exception saying "an item same key has been added". doing wr

java - How to attach documents to a SOAP with XOP using Spring? -

i had wsdl mtom , handle properly: there documentation available. ended with. not testing done on it, except saw working. byte[] document = ... ; datasource datasource = new bytearraydatasource(document, "application/octet-stream"); datahandler datahandler = new datahandler(datasource); response.setdocument(datahandler); now infrastructure people changed our xsd use xop because okay attachments in request , not in response our actual use case. changed our xsd , added xop.xsd . <xs:schema xmlns:xs='http://www.w3.org/2001/xmlschema' xmlns:tns='http://www.w3.org/2004/08/xop/include' targetnamespace='http://www.w3.org/2004/08/xop/include' > <xs:element name='include' type='tns:include' /> <xs:complextype name='include' > <xs:sequence> <xs:any namespace='##other' minoccurs='0' maxoccurs='unbounded' /> </xs:sequence> &l

javascript - d3 stopPropagation - "mousedown.log" -

i learning d3 , came across previous topic discussing stoppropagation(). jasondavies posted reply question , example here https://gist.github.com/jasondavies/3186840 . in example uses: .on("mousedown", function() { d3.event.stoppropagation(); }) .on("mousedown.log", log("mousedown circle")) i don't understand event "mousedown.log" , how triggered in example. here full code jasondavies's example: <!doctype html> <style> circle { fill: lightgreen; stroke: #000; } </style> <body> <script src="http://d3js.org/d3.v2.min.js"></script> <script> var svg = d3.select("body").append("svg") .style("float", "left") .attr("width", 480) .attr("height", 480) .on("mousedown", log("mousedown svg")) .on("mouseup", log("mouseup svg")) .on("click", log(

javascript - Uncaught TypeError: Cannot read property 'isSynchronized' of undefined -

i have problem sorting extjs grid. i'm using ext js version 5.1.1.451. the grid loads when try sort columns "uncaught typeerror: cannot read property 'issynchronized' of undefined" error. the method addcls triggered on mouse movement , when error occures, me.getdata() returns undefined , me constructor $observableinitialized: true component: constructor config: object destroy: () {} dom: null el: null events: object haslisteners: statics.prepareclass.haslisteners id: "ext-quicktips-tip" initconfig: () {} initialconfig: object isdestroyed: true lastbox: null managedlisteners: array[0] shadow: null this addcls method error occurs: addcls: function(names, prefix, suffix) { var me = this, elementdata = me.getdata(), hasnewcls, dom, map, classlist, i, ln, name; if (!names) { return me; } if (!elementdata.issynchronized) { me.synchronize(); } has encount

orgchart - How to add an Assistant or Staff Level in getOrgChart -

i'm analyzing orgchart use in specific project. there way add staff or assistance level? thanks you can use different color assistance , staff. here example: http://www.getorgchart.com/demos/box-color

javascript - Convert an array of objects into a nested array of objects based on string property? -

i stuck on problem trying convert flat array of objects nested array of objects based name property. what best way convert input array resemble structure of desiredoutput array? var input = [ { name: 'foo', url: '/somewhere1', templateurl: 'foo.tpl.html', title: 'title a', subtitle: 'description a' }, { name: 'foo.bar', url: '/somewhere2', templateurl: 'anotherpage.tpl.html', title: 'title b', subtitle: 'description b' }, { name: 'buzz.fizz', url: '/another/place', templateurl: 'hello.tpl.html', title: 'title c', subtitle: 'description c' }, { name: 'foo.hello.world', url: '/', templateurl: 'world.tpl.html', title: 'title d',

jquery - Typeahead returns data but doesn't display anything -

i have code retrieving locations , can see data returned fine using console.log. however, it's not being displayed anywhere user choose. can't figure out missing. <input id="cl_hotellocation" name="cl_hotellocation" type="text" placeholder="where to?" class="input-xlarge form-control typeahead"> var locations = new bloodhound({ datumtokenizer: function (datum) { return bloodhound.tokenizers.whitespace(datum.name); }, querytokenizer: bloodhound.tokenizers.whitespace, limit: 5, remote: { url: "/api/typeahead/search/", replace: function(url, query) { return url + query; }, filter: function (locations) { return $.map(locations, function (data) { console.log("1", data); return { tokens: data.tokens, symbol: data.locationid, nam

sqlite - Android Form Generator / Dynamic Interface Generator -

i wanted generate dynamic interface using values stored in sqllite know how generate json wanted generated values in sqllite . can 1 me please have followed link http://labs.makemachine.net/2010/04/android-form-generator/ .

Putty is not running using schedule task -

i using putty transfer files windows machine linux machine. able transfer, when run script , if run same script using schedule task credentials. if schedule task run using system account(system) or other user account, file transfer not happening. do need save session vales? putty saves session information in registry current user only, information not available other accounts mentioned. either need provide them exporting yours , importing them in other user's accounts or provide needed on shell command invoked copy files. latter sounds easier me in combination little script gets invoked task scheduler.

javascript - OpenLayers 3 WFS not visible -

i want display wfs layer (in gml format) on openstreetmap using openlayers 3.5.0. link of extrernal wfs layer: http://wms.pcn.minambiente.it/ogc?map=/ms_ogc/wfs/batimetrica.map&service=wfs&version=1.0.0&request=getfeature&typename=el.batimetrica.&srsname=epsg:4326 the way using follows: sourcevector = new ol.source.vector({ loader: function(extent) { $.ajax('http://wms.pcn.minambiente.it/ogc?map=/ms_ogc/wfs/batimetrica.map',{ type: 'get', data: { service: 'wfs', version: '1.0.0', request: 'getfeature', typename: 'el.batimetrica.', srsname: 'epsg:4326' }, }).done(loadfeatures); }, strategy: ol.loadingstrategy.tile(new ol.tilegrid.xyz({ maxzoom: 19 })), }); window.loadfeatures = function(response) { formatwfs = new ol.format.wfs(), sourcevector.addfeatures(formatwfs.readfeatures(response, {dataprojection: ol.proj.projec

c# - 404 Error While URL Routing with asp.net web Forms -

Image
i implementing url routing in asp.net web forms. this mapping class public class routeconfig { public static void registerroutes(routecollection routes) { routes.mappageroute( "user", "users/{id}", "~/modules/usermgmt/users.aspx"); routes.mappageroute( "leave", "leaveapply/{id}", "~/modules/leavemgmt/leaveapply.aspx"); } } i calling method in application start void application_start(object sender, eventargs e) { routeconfig.registerroutes(routetable.routes); } and anchor tag <a href="/users/18">users</a> its working fine when configure project " use visual studio development server " project properties. and working fine shown below when configure run project " use local iis web server " project properties. ie) i getting error shown below

Creating an Android app on facebook -

Image
i sorry stupid question, not find answer: where enter website on https://developers.facebook.com/apps ? i cannot find on page settings, nor page details. theree enough how-to's on internet, facebook seems change ui frequently. thank you peter click on "add new app" on top, select android.

php - Session variable to show a form or not -

i want show form if previous form filled , submitted. so, created session variable initialized when submit first form. : if( $flag) { $_session['id_essai'] = $id_essai; echo $_session['id_essai']; insertion_base($index_essai,$id_essai,$nom_local_essai,$nombre_traitements,$essai_ou_suivis,$thematique); } i can var in file because echo works , return value. after : if(isset($_session['id_essai'])) { echo' <div id="tab_traitement" class="excel"></div> <form action="#" method="post"> <button type="button" class="btn btn-default" id="submit_button_traitement">submit</button> </form> '; }else echo'pour saisir un traitement, vous devez d\'abord faire la saisie d\'un essai'; this index.php : <?php sess

ios - send message to apple regarding my app uploaded for review on iTunes -

i have uploaded app on itunes , status "waiting review" want send message apple regarding uploaded app.i don't option send message them on itunes. you can cancel submission reject binary state waiting review (can't find reject binary button) and edit itunes connect page adding additional remarks in "remarks" textfield used testers when try app. and reapply new review.

Reading 16 bit unsigned raw image in c++ -

i trying read 16 bits unsigned image (192*256) saved in raw format using following lines of code: file * pfile; pfile = fopen("d:\\s1.raw", "r"); unsigned short bufferimage[1][192*256]; fread(&bufferimage[0][0], 256*192*sizeof(unsigned short),1, pfile); however values stored in bufferimage not correspond pixels values in image. appreciate that.

java - org.hibernate.MappingException: Could not determine type for: (foo) -

i have 2 classes being managed hibernate, classa , classb . classa has reference classb . according documentation hibernate should able type through reflection. can't understand why doesn't work. missing fundamental here? this classa marked @entity annotation , holding reference classb . package dom; import javax.persistence.entity; import javax.persistence.id; @entity public class classa { private classb classb; private long id; public classa() {}; public classb getclassb() { return classb; } public void setclassb(classb classb) { this.classb = classb; } @id public long getid() { return id; } public void setid(long id) { this.id = id; } } this classb marked @enity annotation. package dom; import javax.persistence.entity; import javax.persistence.id; @entity public class classb { private long id; @id public long getid() { return id;

c# - ASP Hyperlinks not working in release -

i have following code in asp.net webforms app. code in c# it's asp aspect seem t having problems with. links work fine in debug, in release don't seem available links. <asp:table id="table1" runat="server" backcolor="#36a3e4" width="950px"> <asp:tablerow> <asp:tablecell verticalalign="middle" horizontalalign="center"><asp:hyperlink id="lnkshop" runat="server" forecolor="white" font-bold="true" navigateurl="shoplisting.aspx?cls=all">shop</asp:hyperlink></asp:tablecell> <asp:tablecell verticalalign="middle" horizontalalign="center"><asp:hyperlink id="hyperlink1" runat="server" forecolor="white" font-bold="true" navigateurl="~/faq.aspx">faq's</asp:hyperlink></asp:tablecel

twebbrowser - Need help for displaying HTML5 form elements into webbrowser in delphi -

i working on adding new form elements html5 input type email, url etc webbrowser . able save these controls html file in proper way. however, while loading html file webbrowser, not getting input type properly. getting input type "text" irrespective of whatever type setting. can me please. it worth pointing out have been conversing manasee , have seen code, answer aimed more @ similar problem. assuming have html5 file saved locally, start making sure when loaded internet explorer html5 elements behave expected. internet explorer (and twebbrowser) has tendency want use compatible view may render ie8 or earlier , stop html5 elements working. if doesn't behave html5 in ie missing something. suggest having both: <!doctype html> as first line of file and: <meta http-equiv="x-ua-compatible" content="ie=edge"> as first line in head. if ie renders file html5 embedded twebbrowser doesn't, indicates issue how file being

Start mysql server from java -

how start , stop mysql server java(osx) programtically?can provide code snippet this. non of code snippets given in stackoverflow working properly. i'm sorry, can't comment because not have enough reputation. what try running start script command line. means getting runtime , setting command tou need. i.e, runtime.getruntime.exec("sudo /usr/local/mysql/support-files/mysql.server start"); another possibility create proccesbuilder , set params need startup. hope helps.

PHP Cross-Origin Request Blocked -

just wanted find solution this. within system , make following call $("#page-form").submit(function(event){ $.ajax({ type: "post", url: "https://someotherurl/process.php", data: { 'mobnumber': $("#mobile").val() } }).done(function (response) { alert(response); }); }) now makes call php file on server. php file nothing @ moment, have <?php header("access-control-allow-origin: *"); header("access-control-allow-methods: put, get, post"); header("access-control-allow-headers: origin, x-requested-with, content-type, accept"); var_dump("1"); however getting cross origin request blocked error. why happening? as side note, have no access server running system a, has done on server php file sits. thanks update server seems have response headers cache-control no-cache connection

ruby on rails - Alternative for :id param -

i have resources :users , custom_id inside users table. i want use link_to "user", user method choosing custom_id provide link field param. my show action inside users_controller.rb : ... @user = user.find(custom_id: params[:id]) ... in form use: <%= link_to @user.name, @user %> because wrote in userscontroller: ... @user = user.find(custom_id: params[:id]) ...

ios - Unable to add image as Launchscreen which is compatible with all the iPhones -

i have added image uiimageview in launchscreen.xib file , made aspect fit screen of device. i've added image.png , image@2x.png , image@3x.png iphone 4/4s, 5/5s , 6 using image@2x.png leaves borders outside image. how specify image use make fit every device screen? in ios 8 , above don't need add conditions iphone or ipad. can set 1 image type of platform using size classes. just use size classes , set image view. better iphones , ipads. this comment apple : - size classes. size classes ios 8 enable designing single universal storyboard customized layouts both iphone , ipad. size classes can define common views , constraints once, , add variations each supported form factor. ios simulator , asset catalogs support size classes well.

javascript - How to fix a div in sortable grid in jquery -

Image
in above image hexagons movable, except blue centre hexagon. want fix blue hexagon @ centre, while other hexagon can move anywhere. don't understand how this. more clarity, want fix blue hexagon @ 7th position. my code is $("#sortable").sortable({ cursor: 'move', items: 'div.sort', }).disableselection(); html <div class="col-sm-12 margin-top-100 margin-left-100" id="sortable"> <div id="c_1" class="hexagon hexagon2 sort"> <div class="hexagon-in1"> <div class="hexagon-in2"> <div class="inner inner-left text-center"><i class="fa fa-eye"> </i></div><div class="inner inner-right text-center"><i class="fa fa-link"></i></div> </div> </div> </div> <div id="c_2" class

c# - Read and edit List with ini file -

i have list contains several names , want add or remove of names of ini file. prefer ini file if isn't possible or hard kind of config file fine. here code ini class if help. private string _filepath; [dllimport("kernel32")] private static extern long writeprivateprofilestring(string section, string key, string val, string filepath); [dllimport("kernel32")] private static extern int getprivateprofilestring(string section, string key, string def, stringbuilder retval, int size, string filepath); public clsini(string filepath) { _filepath = filepath; } public void write(string section, string key, string value) { try { writeprivateprofilestring(section, key, value, _filepath); } catch {} } public string read(string section, string key) { try { var sb = new stringbuilder(255); getprivateprofilestring(section, key, "", sb, 255, _filepath); return sb.tos

html5 - How to display data differently for different devices in MVC 5 -

suprisingly after numerous searches can't find solution or similar question, brain fart moment. want display data differently on different devices using media queries. so on large devices want show in table form , , on mobile devices custom "listview" . i can achieve creating 2 loops through model so: <div class="row display-large"> <!--table here--> @foreach (var emp in model) <!--each row--> </div> <div class="row display-small"> @foreach (var emp in model) <!--each custom list item--> </div> then using media queries, can show/hide relevant 1 (display-small/large). couldn't live myself doing this,it increases page size , bad practice, question how can achieve without duplicating html. thanks in advance. may can : create global var somewhere on server side public static class globalvars { public static bool islarge {get; set;} } add controller this

Laravel 5 Form request and user register -

the problem is, need simultaneously register user , enter table data forms , assign id i tried $data = request::all(); $user = new app\user(); $user->username = $data['name']; $user->email = $data['email']; $user->password = bcrypt($data['password']); $user->save(); how new user id? that record other data such as $question = new app\question(); $question->name_q = $data['name_q']; $question->body_q = $data['body_q']; $question->user_id = ? you should have relationship defined can insert data without creating objects of 2 different tables. lets first @ case , show how better way. $data = request::all(); $user = new app\user(); $user->username = $data['name']; $user->email = $data['email']; $user->password = bcrypt($data['password']); $user->save(); $question = new app\question(); $question->name_q = $data['name_q']; $question->bod

python - Django datetimefield invalid for certain locales -

i don't have date input formats defined, form field is: expiry_date = forms.datetimefield(widget=selectdatewidget, required=false) i'm using locales en (english) , zh-hans (simplified chinese). according pycharm debugger, post values identical in either language: self.request.post['expiry_date_day'] = u'25' self.request.post['expiry_date_month'] = u'9' self.request.post['expiry_date_year'] = u'2015' however error in zh-hans . in form.clean() method self.cleaned_data['expiry_date'] value missing, i'm guessing it's being stripped out due failing previous validation error. fixed : i fixed adding following settings: date_input_formats = ('%y-%m-%d', '%y/%m/%d') and apply specific datetimefield: expiry_date = forms.datetimefield(widget=selectdatewidget, input_formats=settings.date_input_formats,

function - EdgeStyle on a LayeredGraphPlot -

i'm using layeredgraphplot function of mathematica, , customize edges , vertex using edgestyle , vertexstyle . these 2 functions don't exist layeredgraphplot . in fact have list of weight edges, , want plot dashed edges smallest one, thick red edges biggest, , normal blue others. (and quite same vertex : more word used, darker vertex is) how can edgerenderingfunction , vertexrenderingfunction ? don't understand how pure functions can work in case.

Correctly assigning C# default String to F# variable -

as part of rewriting c# code in f# have come across situation not know how best handle default values of system.string type returned c# service. the c# equivalent of be: var mycsharpstring = csharpservice.getcsharpstring() ?? ""; simply put, if string returned getcsharpstring null or default(string), set " " instead. however, happen if try following statement in f#? let myfsharpstring = csharpservice.getcsharpstring in case getcsharpstring returns null or default(string), myfsharpstring default value of strings in f# (that is: " ")? or have explicitly null check, such as: let myfsharpstring = match csharpservice.getcsharpstring | val when val = unchecked.defaultof<system.string> -> "" | val -> val i have found myself checks such several times, , cannot on fact of how code needed such simple task. could enlighten me of whether such null checks needed in f# when dealing c# services returns system.string

wordpress theme installion error -

Image
i installed wordpress 4.2 on local server , copy theme wp-contat\themes. when run wordpress admin panel , select theme gives me error: warning: require_once( http://localhost/isee/wp-content/themes/isee/includes/db.php ): failed open stream: http request failed! http request failed! http/1.0 404 not found in d:\wamp\www\isee\wp-content\themes\isee\modules\careers.php on line 6 fatal error: require_once(): failed opening required ' http://localhost/isee/wp-content/themes/isee/includes/db.php ' (incpude_path='.;c:\php\pear') in d:\wamp\www\isee\wp-content\themes\isee\modules\careers.php on line 6

activerecord - Ruby on Rails Unique Ordered Query -

what trying is: find recent competencylog (completed_at) each competency on course member class member < activerecord::base has_many :competency_logs has_many :awards end class competencylog < activerecord::base belongs_to :member belongs_to :competency has_one :course, through: :competency end def course < activerecord::base has_many :competencies has_many :awards end class competency < activerecord::base belongs_to :course end i have managed ordered list course = course.find(params[:course_id]) current_member.competency_logs.where('competency_id in (?)', course.competency_ids).ordered from here have tried few different things limited no success. recommendations appreciated. looking of in database possible speed since called , depended on ever changing timestamps on competencylog the results want basically member.competency_logs.where('competency_id in (?)', course.competency_ids).uniq.pluck(:competency_id) but in

java - How to add multiple "Set-Cookie" header in servlet response? -

as per rfc http://tools.ietf.org/html/rfc6265#page-7 allowed have 2 headers same key of "set-cookie". example provided in rfc - ​​set-cookie: sid=31d4d96e407aad42; path=/; secure; httponly set-cookie: ​​lang=en-us; path=/; domain=example.com how​ ​i achieve same jetty(or other servlet container)? when call httpservletresponse.addheader way- ​httpservletresponse.addheader("set-cookie", "sid=31d4d96e407aad42; path=/; secure; httponly"); httpservletresponse.addheader("set-cookie", "lang=en-us; path=/; domain=example.com");​ i see second addheader() doesn't add new header. according javadoc method- adds response header given name , value. method allows response headers have multiple values. so seems multiple values of allowed not sure how go having multiple "set-cookie" in servlet response. setting cookies directly bit awkward, considering servlet api has methods working cookies. anyway, test

c++ - cannot able to create enum type as atomic -

#include <iostream> #include <atomic> using namespace std; typedef enum day{sun =0, mon, tue}day; int main() { atomic<day> a(sun); cout<<a<<endl; return 0; } the above code try create enum variable atomic type. getting following error. undefined reference std::atomic<day>::operator day() const does atomic have no support enum type? or mistake in syntax? using g++ compiler running on 32 bit ubuntu 12.0.4 machine. thank you. i've compiled same code online compiler supports c++11 & c++14. didn't issues. atomic isn't available before c++11 standards. for reference: http://ideone.com/fork/pe4gvt