Posts

Showing posts from September, 2012

ios - Why isn't core data maintaining persistance in this code? -

this code +(favouritesmodel *) savefavourites: (nsstring *) title and: (nsstring *) subtitle{ favouritesmodel *savedata = [[favouritesmodel alloc] init]; savedata.context = [savedata managedobjectcontext]; nsmanagedobject *task = [[favourites alloc] initwithcontext:savedata.context]; [task setvalue:title forkey:@"title"]; [task setvalue:subtitle forkey:@"subtitle"]; nsstring *titlestr = [task valueforkey:@"title"]; nsstring *subtitlestr = [task valueforkey:@"subtitle"]; [savedata.favouritesdata addobject:titlestr]; [savedata.favouritesdata addobject:subtitlestr]; appdelegate *appdelegate; [appdelegate savecontext]; return savedata; } the data want saved it's not persisting. i've used savecontext() method in "applicationwillterminate" in app delegate too. still if i'm quitting , reopening app, data not there. edit i'm using model class call method in 5 classes. what have add implement data persistence ?

CSS: fit image inside div -

Image
i want remove white line below following image: my css: #content { float: left; background:#fff; bottom:0; width:100%; overflow:hidden; } #container { position: relative; overflow:hidden; } #container img { width:100%; height:auto } my html: <div id="content"> <div id="container"> <img src="img/lib.jpg" width="100%"/> </div> </div> i tried many tricks non of them working in browsers img inline element default there space descenders on letters g, j. fix can add vertical-align: top on image. #content { float: left; background: #fff; width: 100%; } #container { border: 1px solid black; } #container img { width: 100%; vertical-align: top; } <div id="content"> <div id="container"> <img src="http://placehold.it/350x150"> </div> </div>

ember.js - Deleted records are not accessible -

given model parent, hasmany childs. how can track deleted childs? if ember keeps track of them, how access them? i have complex form, user can add/edit/delete childs, have 1 place persists/cancel parent. in place persist/rollback childs. i can manually keep track of deleted records, if ember keeps track of them, prefer use ed ;-) i'm playing that, it's not working: dirtytasks: ember.computed.filterby('model.childs.@each.content', 'isdirty', true), deletedtasks: ember.computed.filterby('model.childs.@each.content', 'isdeleted', true), changedtasks: ember.computed.union('dirtytasks', 'deletedtasks'), dirtytasks: ember.computed.filterby('model.childs.@each', 'isdirty', true), deletedtasks: ember.computed.filterby('model.childs.@each', 'isdeleted', true), changedtasks: ember.computed.union('dirtytasks', 'deletedtasks'), dirtytasks: ember.computed.filterby('model.chi

How to clone repository with Git under Windows proxy? -

proxy requires autenfication. tried using global variables: http_proxy , https_proxy. not seems git able them. if pass them parameters works: git clone repository_url aut_params also git able use them if specify them in git\mingw64\gitconfig in following way: [credential] helper = manager [http] proxy = http://user:pass@proxy.com:8080 sslverify = false [https] proxy = https://user:pass@proxy.com:8080 sslverify = false okay, git sees credentials. if try clone again, says failed connect proxy.com port 8080: bad access i figured ssl certificate matter(git giving other error before, saying certificates, not sure if i'll able reproduce again). so if this: git config --global http.sslverify false it works! clones repository. if specify sslverify = false in gitconfig(as above), not works, resulting error(also written above). how to tell git sslverify false always? i have big project uses git download large amount of repositories in cmake scri

javascript - angularjs typehead with toArrayFilter -

i using angularjs typehead auto-complete: <input class="form-control reason-select" type="text" ng-model="selectedname" typeahead="name.kod name.value name in list | toarray | filter:$viewvalue | limitto:8"> based on typehead example , using toarray filter beacuse list object , not array ref - notarray . list - { "0": { "kod": 107, "value": "john doe", }, "1": { "kod": 3994, "value": "jane doe", } } it works fine choose option kod displayed instead of value . thanks help. typeahead="name.kod name.value name in list" means "name.kod" shown user "name.value" saved in $viewvalue. so in case, working perfect need reverse variables if want show value i.e.jane doe save kod i.e.3994 . hope helps

javascript - How to make google chart same size with its container -

i'm trying develop custom donut component sap businessobjects design studio using google donut chart. it's dom(document object model). i want make donut chart responsive because of compatibility other components. this, in classic dom used bootstrap "col-md-6" div container: google.charts.load('current', { 'packages': ['corechart'] }); google.charts.setonloadcallback(drawchart); function drawchart() { var data = google.visualization.arraytodatatable([ ['year', 'sales', 'expenses'], ['2000', 1000, 400], ['2001', 1170, 460], ['2002', 660, 1120], ['2003', 1030, 540], ['2004', 1000, 400], ['2005', 1170, 460], ['2006', 660, 1120], ['2007', 1030, 540], ['2008', 1000, 400], ['2009', 1170, 460], ['2010', 660, 1120], ['2011', 1030, 540] ]); var

sockets - laravel Echo does not listen to channel and events -

to broadcast event on channel used laravel echo , redis , socket-io . this event : class chatnewmessage implements shouldbroadcast { use interactswithsockets, serializesmodels; public $targetusers; public $message; public function __construct ($message) { $this->targetusers = $message->chat->users->pluck('user_id'); $this->message = $message; } public function broadcaston () { $userchannels = []; foreach ($this->targetusers $id) { $userchannels[] = 'user-channel.' . $id; } return $userchannels; } public function broadcastas() { return 'newmessage'; } } for socket.io server i'm using laravel-echo-server , below configuration: { "authhost": "http://api.pars-app.dev", "authendpoint

django - Tastypie api working with postman but not with python requests -

i have tastypie api api key authentication. its working both ways request, post request, not working. url = http://localhost:8000/api/path/?api_key=key&username=username in view, when tried print request.user, regular/real user when request comes postman. python requests, anonymous user. with python requests, doing this: url = http://localhost:8000/api/path/?api_key=key&username=username d = {"some": "data"} r = requests.post(url, data=json.dumps(d), headers={"content-type": "application/json"}) code provided postman: post /api/v1/abc/?api_key=somekey&username=something http/1.1 host: localhost:8000 content-type: application/json cache-control: no-cache postman-token: {"something":"something"} please let me know questions. my resource api authentication not working: class userresource(modelresource): class meta: queryset = user.objects.all() fields = ['username', 'em

c++ - STM32F4 AES Functions Always Return 0 -

i m using stm32f4 project. project has aes encryption , decryption parts. using standard peripheral librarys. standard peripheral library has cryp.h . use library aes process. i generate codes this , codes following lines. uint8_t aes256key[32] = {0x60,0x3d,0xeb,0x10,0x15,0xca,0x71,0xbe, 0x2b,0x73,0xae,0xf0,0x85,0x7d,0x77,0x81, 0x1f,0x35,0x2c,0x07,0x3b,0x61,0x08,0xd7, 0x2d,0x98,0x10,0xa3,0x09,0x14,0xdf,0xf4}; uint8_t iv_1[16] = {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07, 0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f}; uint8_t plaintext[aes_text_size] = {0x6b,0xc1,0xbe,0xe2,0x2e,0x40,0x9f,0x96, 0xe9,0x3d,0x7e,0x11,0x73,0x93,0x17,0x2a, 0xae,0x2d,0x8a,0x57,0x1e,0x03,0xac,0x9c, 0x9e,0xb7,0x6f,0xac,0x45,0xaf,0x8e,0x51, 0x30,0xc8,0x1c,0x46,0xa3,0x5c,0xe4,0x11,

python - abs(double complex) in Cython -

how absolute value double complex variable? def f(): cdef double complex aaa = 1 + 2j cdef double bbb = abs(aaa) the second assignment highlighted yellow in cython -a html output: aaa converted python object prior applying abs() . how call abs() on c/cpp level? ps understand cdef extern "complex.h": double abs(double complex) would solve it, see following instructions in generated c/cpp file: #if cython_ccomplex #define __pyx_c_abs_double(z) (::std::abs(z)) #endif and like, supposed choose correct header include ( <complex> or "complex.h" or custom code) depending on compilation flags. how utilize instructions? more useful contribution : the following semi-tested addition fix "cython/compiler/builtin.py". should pretty obvious add it: builtinfunction('abs', none, none, "__pyx_c_abs{0}".format(pyrextypes.c_double_complex_type.funcsuffix), #u

php - Send form data with JWT -

actually have 2 websites , 1 suppose receive data not parametered in https , not be. can use jwt technique send form data 1 server 2 on http connnection. i'm thinking of big textarea messages. first website receives data https connection stores in jwt , sends curl second server http connection. know it's not original purpose of jwt think partice? risk encounter errors during encoding , decoding en large amounts of text? i suggest use rsync . can work on ssh connection protect data , smart enough sync changed files. jwt not designed send large amount of data between servers. in fact format transmit claims between servers or between client , server. claims can digitally signed (jws - see rfc7515 ), encrypted (jwe - see rfc7516 ) or both (signed encrypted). compact used in web context.

javascript - Angularjs localStorage: Cannot read property '$default' of undefined -

i'm working ionic , angularjs , need save data in localstorage installed ngstorage bower , imported in index.html, have got error when initialize $localstorage typeerror: cannot read property '$default' of undefined here how initilized it $localstorage = $localstorage.$default({ carrello: [] }); here method add data localstorage $scope.adddisco = function(index, carrello){ $scope.selecteddisco = $scope.listadischi[index]; storageservice.add($scope.selecteddisco); } and here factory app.factory ("storageservice", function ($localstorage) { var _getall = function () { return $localstorage.things; }; var _add = function (thing) { $localstorage.things.push(thing); } var _remove = function (thing) { $localstorage.things.splice($localstorage.things.indexof(thing), 1); } return { getall: _getall, add: _add, remove: _remove }; }) i work $window.sessionstorage never worked type of data storage every ideas welcome. ty

javascript - Angular Directive template throw an error -

i have problem in angular directive templating. 'use strict'; function homedirective() { return { controller: 'homecontroller', template: require('./views/home.html'), restrict: 'aec', scope: true } } module.exports = homedirective; i have template in views folder.my views <div> <p>this home page.you can nevigate page</p> <p>the content {{test}}</p> </div> the error following <div> ^ parseerror: unexpected token @ wrapwithpluginerror (c:\users\dat-asset-110\desktop\test code\anguler_test_structure\node_modules\gulp-browserify\index.js:44:10) it working when use 'use strict'; function homedirective() { return { controller: 'homecontroller

angular - Styling a child component differently in another component -

i trying style alert box (from bootstrap) [which component] different when shows in 1 of components. other places use default styling. i able achieve want using: encapsulation: viewencapsulation.none in parent component. want avoid , learn using best practice. can shed light of how can achieved without modifying encapsulations ? in posts users mention use :host , ::content css properties far unable make use out of them. i believe common scenario , there should way it. you can use /deep/ in parent like :host /deep/ some-grand-child { color: blue; } to make selectors cross component boundaries without setting viewencapsulation none .

powershell command to terminate/cancel a script -

is there powershell command available terminate powershell script? have used exit 1 , doesn't me. have tried throw gave error. script have tried. want script stop when service status stopped. $emagent1 = get-wmiobject win32_service | where-object {($_.name -eq 'oim12cagent') -or ($_.name -eq 'oimagent12c2agent') -or ($_.name -eq 'oimagent10gagent') -or ($_.name -eq 'gfarmem10gagent') -or ($_.name -eq 'gfarmem11gagent')} | format-list name | out-string $agentname1 = $emagent.split(":")[1].trim() $emstatus1 = get-wmiobject win32_service | where-object {$_.name -eq $agentname} | format-list state | out-string $agentstatus1 = $emstatus.split(":")[1].trim() if ($agentname1 -eq $null) { $agentname1 = "unavailable" } else { $agentname1 = "$agentname1" } if ($agentstatus1 -eq "stopped") { exit 1 } else { } use get-service instead since it's faster , easier use

pdf generation - PdfDocument detect page height android -

using loops m generating content pdf document page , increment downwards using baseline = baseline + linespacing; for (x,y) positions problem : m unable find when should loop break? use if (baseline > pageheight) {break;} and start new page writes beyond pageheight (how know? because see cutoff text @ end of page) (i m not using itext) is there better solution ending page? maintain variable private float currenttopy; save current position of page private static final float left_margin = 10f; private static final float page_height = 792f; private static final float page_width = 595f; private static final float top_bottom_margin = 5f; private void createpdfpage() throws ioexception { page = new pdpage(); document.addpage(page); currenttopy = page_height - top_bottom_margin; currentpagenumber = currentpagenumber + 1; } private void addnewline(int numberoflines) { currenttopy = currenttopy - (numberoflines * new_line); } and everytim

qt - Qml listView mirroring layout currrent Index -

i working listview component , have trouble currentindex property. want action on oncurrentindexchanged: but when use layoutmirroring.enabled: true currentindex not updated anymore. there no action in oncurrentindexchanged , currentindex equal 0 time. i've tried use layoutdirection: qt.righttoleft problem same ( no currentindex updates when listview moved). i've read listview documentation , there information, if use snapmode: listview.snaptoitem you need add highlightrangemode: listview.strictlyenforcerange in order currentindex update properly. maybe there similar mirror layout? here whole code: listview { id: id_couplingcontrolview model: id_multicouplingmeasurepopup.p_icouplingscount orientation: listview.horizontal snapmode: listview.snaptoitem highlightrangemode: listview.strictlyenforcerange //to update currentindex list moved preferredhighlightbegin: id_multicouplingme

Find specific cell of a celltable with Selenium xpath -

Image
i have celltable , have multiple rows , dynamic table, screenshot attached .. what want find row column contains useren@lim.mobi , click checkbox. i trying xpath not experience here , if can please thanks here html code of specific cell i don't know exact html of table form xpath difficult. should //*[contains(text(),'useren@lim.mobi ')]/../td[2] for following table, if have find corrosponding contact company, how it. https://www.w3schools.com/html/html_tables.asp //*[contains(text(),'magazzini alimentari riuniti')]/../td[2]

r - Code isn't plotting level 0 of a factor in ggplot's geom_bar() -

my final plot doesn't show 0 level factor a. header data: month b mayo 20 6.9 mayo 16 16.3 mayo 14 19.8 mayo 12 12.6 mayo 9 19.5 mayo 8 65.4 mayo 18 11.7 mayo 17 22.8 mayo 15 34.3 mayo 13 36.9 mayo 11 43.7 mayo 10 21.6 mayo 21 20.9 mayo 7 7.3 mayo 22 32.3 mayo 19 17.8 mayo 0 96.0 structure of data.frame: 'data.frame': 17 obs. of 3 variables: $ month : chr "mayo" "mayo" "mayo" "mayo" ... $ : factor w/ 18 levels "0","7","8","9",..: 15 11 9 7 4 3 13 12 10 8 ... $ b: num 6.9 16.3 19.8 12.6 19.5 65.4 11.7 22.8 34.3 36.9 ... my r code ggplotting: ggplot(data,aes(x = a, y = b)) + geom_bar(stat="identity",size=1.5,colour = "black",fil

sql - command timeout through SqlHelper in aps.net 2.0 -

i have application works asp.net 2.0, want increase command timeout using sqlhelper class; dsdata = sqlhelper.executedataset(connectionstring, system.data.commandtype.storedprocedure, spname, m_sqlparam) i can't find example on this, or should change sqlhelper code? you can use sqlcommand.commandtimeout property below sqlcommand command = new sqlcommand(querystring, connection); command.commandtimeout = 20; your sqlhelper looks custom wrapper (or) repository class sqlcommand . in such case, can either change code base in sqlhelper class (or) have executedataset() method accept argument timeout

javascript - aggregation project mongodb output not expected -

i'm coding complex query in javascript. , i'm using aggregation. i'm using 2 tables. invoice, travel this code. invoice.aggregate([ // filter documents invoice of 2016 { $match: { executed: { $gte: startdate, $lte: enddate }, "modelholder.name": 'travel' } }, // $lookup working alone, not taking input function 1 of aggregate { $lookup: { from: "travels", localfield: "modelholder.id", foreignfield: "_id", as: "datafromtravels" } }, // filter date of reservation , date of arrival $match: { $or: [ { 'datafromtravels.from.date': { $gte: departdate, $lte: enddate } }, { 'datafromtravels.to.date': { $lte: arrivaldate },

grails3 - Grails 2.5.1 application sporadically loses context root -

we have handful of applications deploying same tomcat server (currently working on upgrading grails 3, may obe in next few months, it's been plaguing quite time now) , 2 of applications lose relative context root path. let's have "app1" , "app2" deploy server:port/app1 , server:port/app2 . app1 works fine, app2 (~20% of time, maybe) deploy , <g:link/> links (or other generated links, such asset locations) generate relative server root... application correctly deployed under /app2 , links point bad locations. e.g., <g:link controller='hello' action='index'/> generate link /hello/index rather /app2/hello/index . i don't know relevant code post is, we've compared our other applications , have found nothing noticeably different in 2 exhibiting behavior. it's these 2 (out of dozen) applications ever break in manner. any ideas on causing or appreciated. edit: plugins in use: compile "org.springf

ide - Is there any Visual Studio extension to switch to related files? -

Image
suppose architecture functionality - "component" - scattered across many related files. example there html template, javascript file, css file etc. belonging together. should common in non-trivial project. the more technical layers used, more need switch between related files. in current project have 6 layers need edited 1 functionality. since files grouped technical layers, not near each other. makes trivial task of switching files time-consuming. is there known visual studio extension situation? for designers (winforms/wpf/...) similiar feature existed (go designer, go code). just idea how like: having in context menu ok well. maybe lucky , exists? you can switch between related files (commercial) tabs studio extension if have common part in file name. on how create custom title , path rules see tab grouping documentation.

sorting an array in the order of the value of another array in php -

is there better way sort $datas array in order of $tabdocids values ? foreach ( $tabdocids $ordered_id ) { foreach ( $datas $doc ) if ($doc->docid == $ordered_id) $ordered [] = $doc; } $datas=$ordered; one way rome... #for collect $ordered = array_flip($tabdocids);//too keep order $tabdocids array_map(function ($doc) use ($tabdocids,&$ordered){ if(in_array($doc->docid,$tabdocids)){ $ordered [$doc->docid] = $doc; } },$datas); $datas=array_values($ordered); [updated after comment @kris roofe] sorted. or without sorting $datas = array_filter($datas,function ($doc) use ($tabdocids){ return (bool)in_array($doc->docid,$tabdocids); });

javascript - relative path method to read external json file with jquery -

as showen on title want read json file in jquery relative path method. first of all, beginer on job , it's can stupid thing try. i have external json file, want turned file in script. json file must have external because of, can changed somereason after developing , regular changing according process. here json file. { "revisiondate": "21 april 2016", "documentname": "1658mc", "department": "sales", "description": "available", "link": "href=1658mc.pdf" }, { "revisiondate": "16 april 2016", "documentname": "vcx16b", "department": "enginnering", "description": "not available", "link": "href=vcx16b.pdf" }, { "revisiondate": "15 march 2016", "documentname": "ab36f", "department":

cordova - Ionic 2 Tabs/Footer and InAppBrowser -

i use simple function open webpage in inappbrower : lauchpage(url) { this.platform.ready().then(() => { console.log('ready'); this.iab.create(url); }) } but browser launching in fullscreen tabs hidden. way open inappbrowser in specific area in app. example in <ion-content> ? you try using themeable browser , customizing it's height (i haven't tested plugin, since can customize it, it'll fit need). but since you're creating page on page, if clicks tabs, page still continue working in background, advise use platform.resume() close page if in app clicked. hope helps :d

javascript - ngStorage safe to use? -

i have simple doubt ngstorage. when use ngstorage $localstorage or $sessionstorage objects , keys readable in browser development tools. how ever wonder if there way manipulate them on fly? if example, save session params user in $localstorage possible write on $localstorage browser dev tools or via console , update. manipulate storage during have site open? you shouldn't use $localstorage or $sessionstorage data don't want user manipulate himself. regular user has access same tools you, yes can open developer console , edit whatever in $localstorage or $sessionstorage. you should use ngstorage things preferences, user can edit as wants, you'd have more convenient interface in application.

Python - Sorting a Tuple-Keyed Dictionary by Tuple Value -

i have dictionary constituted of tuple keys , integer counts , want sort third value of tuple (key[2]) so data = {(a, b, c, d): 1, (b, c, b, a): 4, (a, f, l, s): 3, (c, d, j, a): 7} print sorted(data.iteritems(), key = lambda x: data.keys()[2]) with desired output >>> {(b, c, b, a): 4, (a, b, c, d): 1, (c, d, j, a): 7, (a, f, l, s): 3} but current code seems nothing. how should done? edit: appropriate code sorted(data.iteritems(), key = lambda x: x[0][2]) but in context from collections import ordered dict data = {('a', 'b', 'c', 'd'): 1, ('b', 'c', 'b', 'a'): 4, ('a', 'f', 'l', 's'): 3, ('c', 'd', 'j', 'a'): 7} xxx = [] yyy = [] zzz = ordereddict() key, value in sorted(data.iteritems(), key = lambda x: x[0][2]): x = key[2] y = key[3] xxx.append(x) yyy.append(y) zzz[x + y] = 1 print xxx print yyy print zzz z

matlab - Is there any way to obtain different shuffled in randperm? -

i have matrix [1 2 3 4] , want shuffle randperm in few times want obtain different matrices. example for i=1:4 m(i,:)=randperm(4); end will give me 4 rows 4 columns want every row different every other one; e.g. this: m(1,:)=[1 3 4 2] m(2,:)=[2 3 1 4] m(3,:)=[2 1 4 3] m(4,:)=[4 3 2 3] you can check existing rows see if current permutation exists m = zeros(4, 4); counter = 1; while counter < 4 new = randperm(4); if ~ismember(new, m, 'rows') m(counter, :) = new; counter = counter + 1; end end another (memory intensive) approach generate all permutations , randomly select n of them allperms = perms(1:4); n = 4; m = allperms(randsample(size(allperms,1), n), :);

PHP - Merge arrays | Numbers of arrays not known because arrays coming by loop -

apologies if posted already. struggling array_merge function. works fine when use this. array_merge($array1,$array2); in case both arrays mysql result. see following code understanding better. $getfilelist = 'select * fileartist fid in (210,209)'; // fetching 2 rows $file = $db->query($getfilelist); $file_tot = count($file); for($i=0;$i<$file_tot;$i++) { $artist = explode(',', $file[$i]['artist']); // because artist names saved `a,b` in first row , `a,c,d` in second. } print_r($artist); this prints this. array // artist in first row ( array[0] => array[1] => b ) array // artist in second row ( array[0] => array[1] => c array[2] => d ) i want array should - array ( array[0] => array[1] => b

java - Android application crashes on Volley JsonObject POST request -

i'm trying write splash screen attempts authenticate users' credentials if exist in sharedpreference, application shuts down without warning on line request added requestqueue. should resolve issue? file preffile = new file("/data/data/"+getpackagename()+"/shared_prefs/"+getpackagename() +"_preferences.xml"); system.out.println(preffile.tostring()); if(preffile.exists()) { system.out.println("found preference file"); final sharedpreferences pref = new securepreferences(getapplicationcontext()); map<string, string> authparams = new hashmap<string, string>(); authparams.put("key", pref.getstring("key","")); authparams.put("action", "validate"); system.out.println("now authenticating"); jsonobjectrequest authrequest = new jsonobjectrequest(request.method.post, auth_url, new

c# - How to call WebAPI from a MVC Controller in a different project? -

i have create web api existing mvc project , make api controllers calling service layer , models, contained in separate projects in same solution, create , map dtos. layout of projects solution in vs ( ignore bookservice.cs . trying webapi tutorial , put in same solution temporarily). i have been reading on webapi , how functions past 2 days, not being able grasp understanding on how create api controllers mvc project without referencing it? have make views @ end, in main project calling uri, confused @ point. it me out lot if can please clarify how tackle or point me tutorial or sort of source learn process of working web api. thank you. the web api project separate "website", need host individually. mvc project make requests web api using httpclient . since web api separate, won't able utilize helpers url.routeurl , etc. urls web api actions. need know full uri web api, including it's domain. there no way programmatically ascertain information

r - Colours don't show up in diagram -

i have code should render diagrams few colours, when code in used don't see colours df <- data.frame(col1 = c( "cat", "dog", "bird"), col2 = c( "feline", "canis", "avis"), stringsasfactors=false) uniquenodes <- unique(c(df$col1, df$col2)) library(diagrammer) cols <- setnames(rep("green", length(uniquenodes)), uniquenodes);cols["canis"]<-"red" nodes <- create_node_df(n=length(uniquenodes), nodes = seq(uniquenodes), type="number", label=uniquenodes, fillcolor=cols) edges <- create_edge_df(from=match(df$col1, uniquenodes), to=match(df$col2, uniquenodes), rel="related") g <-create_graph(nodes_df = nodes, edges_df = edges, attr_theme = null) render_graph(g) taking same code used; need change definition of nodes nodes <- create_node_df(n=length(uniquenodes), nodes = seq(uniquenodes), type="number", label=uniquenodes, color=

javascript - How to control order of rendering in vue.js for sibling component -

i have following kind of code: <div> <compa /> <compb /> </div> how make sure first compa rendered after compb rendered. why want have dependency on few elements of compa , , style of compb depends on presence of elements. why in details : i have complex ui design, 1 box become fixed when scroll. not go above screen when scroll, fixed once start scrolling , start touching header. using jquery-visible find if div particular id visible on screen, if not visible, change style , make box fixed. following code should give idea doing: methods: { onscroll () { if ($('#divid').visible(false, false, 'vertical')) { // div compa, want make sure rendered first , visible this.isfixed = false } else { this.isfixed = true } } }, mounted () { window.addeventlistener('scroll', this.onscroll() } }, destroyed () { window.removeeventlistener('scroll', this.onscroll) } i dont want make in sa

Load all layer information from OpenStreetMap -

i'm trying load points of sertain layer openstreetmap. can't find such command in overpass api. possible? can achieve nodes bounding box: <osm-script output="json"> <query type="way"> <bbox-query {{bbox}}/> </query> <recurse type="way-node" into="waynodes"/> <query type="node" into="nodes"> <bbox-query {{bbox}}/> </query> <!-- added auto repair --> <union> <item/> <recurse type="down"/> </union> <!-- end of auto repair --> <print/> </osm-script> openstreetmap doesn't have "layer" concept in contrast other gis data. for loading existing information have query every element type, i.e. nodes , ways , relations . that's all. overpass turbo (a nice web frontend overpass api) default when using wizard.

html - Kendo UI Menu glitch with custom styles -

i using kendo ui in of projects, there problem menu custom styles. example have created here. http://dojo.telerik.com/ebavo use fullscreen reproduce it. cannot figure out when bug appears, click on menus, scroll top-bottom, delete selected items etc. can see in chrome. there video problem https://youtu.be/nekgw_eeqe0 i wrapping menus in modal window overflow: visible . chrome 57.0.2987.110 have ideas how fix styles?

python - Use struct in SWIG argout typemap -

i want call c function python, should create , initialize struct. want struct converted python object return value in python. here example files (based on accessing c struct array python swig ) achieve want, i.e. create_struct() creates , initializes struct, can used in python. john bollinger helping fix bugs. example.h #include <stdint.h> struct foo { uint8_t a[4]; }; void create_struct(struct foo** new_struct); example.c #include <string.h> #include "example.h" void create_struct(struct foo** new_struct){ struct foo* foo = (struct foo*) malloc(sizeof(struct foo)); uint8_t tmp[4] = {0,1,2,3}; memcpy(foo->a, tmp, 4); *new_struct = foo; } example.i %module example %{ #define swig_file_with_init #include "example.h" %} // define input , output typemaps %typemap(in) uint8_t a[4] { if (!pybytes_check($input)) { pyerr_setstring(pyexc_typeerror, "expecting bytes parameter"); swig_fail; }

Show two wordpress product categories with one url -

i trying make url show multiple product categories inside woocommerce shop. wanted show small vegetable , fruit together. i have following hierarchy: fruit small-fru medium-fru big-fru vegetable small-veg medium-veg big-veg and tried these urls: http://my-url.com/product-category/fruit/small-fru+vegetable/small-veg/ http://my-url.com/product-category/small-fru+small-veg/ but did not worked. there solution this?

How to parse argv in prolog -

when i'm trying pass list prolog program, string in argv. need recover list somehow string or find way pass list. thanks. edit: i've tried opt_arguments, got error: "error: validate_opts_spec/1: type error: flag_value' expected, found term' (an atom) (unknown type 'term' in option 'transactions')". on linux: $ swipl [a,b,c] welcome swi-prolog (threaded, 64 bits, version 7.5.1-31-gd53ee81) ... and then ?- current_prolog_flag(argv, argv),argv=[l|_],atom_to_term(l,t,[]). argv = ['[a,b,c]'], l = '[a,b,c]', t = [a, b, c]. after @boris comment, here better way, in sense covers both cases $ swipl [a, b, c] welcome swi-prolog (threaded, 64 bits, version 7.5.1-31-gd53ee81) ... ?- current_prolog_flag(argv, argv),atomic_list_concat(argv,atom),atom_to_term(atom,term,[]). argv = ['[a,', 'b,', 'c]'], atom = '[a,b,c]', term = [a, b, c].

linux - Cannot find shared library even with LD_LIBRARY_PATH set, while setting ld.so.conf works -

the program fails find shared library path of library included in $ld_library_path (also exported correctly). however, after add path /etc/ld.so.conf , execute ldconfig , program runs without error. why happen?

owl api - Replace current super class of an individual with the inferred superclass -

greetings professor ignazio palmisano, kindly have question in regards owl-api v5 scenario: i have owl ontology contains individuals , defined classes (has equivalent axioms). i add new individual "x" subclass of thing, , add individual properties. i initialise reasoner , precomputeinferences() goal: if new individual "x" classified under existing defined class, want retrieve inferred class , replace current individual superclass thing inferred superclass. main question: 1) kindly best way this? sub question: 2) have save new inferred ontology , deal asserted, in order retrieve class? not since interest replace current individual superclass inferred superclass. i trying find how this, came across: entitysearcher.gettypes(owlindividual, owlontology), retrieves original asserted superclass not inferred. thanks time. sincere regards. in order replace asserted class inferred 1 (or ones - there might more one), need following:

c# - There was an error parsing the query. [ Token line number = 1,Token line offset = 39,Token in error = ( ] -

i'm working in winforms application. requirement loading data sql on demand(i.e load 100 records page, when moves page). tried below sqlcommand throws exception @ place of "row_number()" syntax in below command, select * (select * , row_number() (order [id]) rownum [tblvgtest] [id]) temp rownum between 0 , 100 please let me know, there mistakes in command or provide suggestion scenario. thanks you forgetting using over() clause row_number . try following query. select * (select * , row_number() on (order [id]) rownum [tblvgtest] ) temp rownum between 0 , 100 i have removed where clause not having criteria. can put if it's required you.

maven - Exact description of parent inheritance -

both official documentation , nexus book have superficial description. there details on merging plugin configuration, that's all. i noticed weird behavior: namely adding <resources>/<resource> element seems override parent declarations rather doing append or merge. can find more detailed description of merge algorithm somewhere on web, or reading source code way find out? if it's code can point look, or should check effective-pom mojo calls?

ios - Data passing from model not showing in UI after using Alamofire -

so have created model download data (images, title, desc) using alamofire. having problem pass data , update in viewcontroller . if put functions in viewcontroller's viewdidload working fine. want use mvc model. here code model: class pagecontrollerview { var _titlename : string! var _titledesc : string! var _image : uiimage! var titlename : string { if _titlename == nil { _titlename = "" print("titlename nil") } return _titlename } var titledesc : string { if _titledesc == nil { print("tittledesc nile") _titledesc = "" } return _titledesc } var image : uiimage { if _image == nil { print("image view nill") _image = uiimage(named: "q") } return _image } func getpagecontrollerdata(_ page : int) { alamofire.request("\(bas

python - Tkinter Prior key giving error -

def keypress(self,event): if event.keysym in self.keys: # event type 2 key down, type 3 key self.keys[event.keysym] = event.type == '2' def looper(self): if self.keys['up']: self.canvas.yview_scroll(-2,'units') if self.keys['down']: self.canvas.yview_scroll(2,'units') if self.keys['left']: self.canvas.xview_scroll(-2,'units') if self.keys['right']: self.canvas.xview_scroll(2,'units') if self.keys['prior']: p = p -.01 self.draw() if self.keys['next']: p = p +.01 self.draw() when run program comes error keyerror: prior. want recognize when press pageup/down keys can zoom in/out. without prior/next runs fine , operates should when press up/down/left/right cursor keys.

java - Spring Cloud Data Flow app with separate sink and source -

i have application deploy using scdf. receives message (sink), processes asynchronously through non deterministic or simple pipeline system. @ end, might or migh not produce output. if output produced produce message (source) other applications consume. application can not splitted more 1 jvm, more 1 instance can running no problems. have found examples have source , sink on same app, connected end end, wich not case. has solve problem, hints? you might looking @ similar discussed here: https://github.com/spring-cloud/spring-cloud-dataflow/issues/915 .

configuration - How to configure MySQL data source for PhpStorm? -

Image
i have legacy php project using mysql. phpstorm discovers there mysql queries inside project, , asks me provide data source them. this opens window: yet totally confused on how provide credentials mysql database. expected mask enter mysql host, username, password , target database name. yet cannot find in here. how configure mysql data source in phpstorm? to create new source projet, click on green "+" icon , select mysql in list of drivers. should display fields database info including username , password.

How to append values in a excel sheet's column to a different list using openpyxl in python? -

from openpyxl import * wb = load_workbook('excel.xlsx') table=[] sheet_name=wb.get_sheet_by_name('input_sheet') indx_row, row in enumerate(sheet_name.iter_rows()): cell_ind,cell in enumerate(row): if indx_row==0: table.append(cell.value) print table output:['col1','col2','col3','col4'] now want crate lists names col1, col2,col3,col4 col1=[] col2=[] col3=[] col4=[] dynamically since excel sheet changing. want append corresponding column values corresponding column lists.how can this? openpyxl provides iter_cols() method , columns property columnar access.

ios - NSInternalInconsistencyException in App Delegate -

i new ios, using swift. code crashing nsinternalinconsistencyexception, not sure why happening , how trace issue. here stack trace. fatal exception: nsinternalinconsistencyexception 0 corefoundation 0x1869111b8 __exceptionpreprocess 1 libobjc.a.dylib 0x18534855c objc_exception_throw 2 corefoundation 0x18691108c +[nsexception raise:format:] 3 foundation 0x1873c902c -[nsassertionhandler handlefailureinmethod:object:file:linenumber:description:] 4 uikit 0x18cfcdae0 -[uipageviewcontroller queuingscrollview:didendmanualscroll:torevealview:direction:animated:didfinish:didcomplete:] 5 uikit 0x18d09fcbc -[_uiqueuingscrollview _notifydelegatedidendmanualscroll:torevealview:direction:animated:didfinish:didcomplete:] 6 uikit 0x18d09fa14 __78-[_uiqueuingscrollview _enqueueanimatedscrollindirection:withview:completion:]_block_invoke.299 7 uikit

xml - Spring Integration WS Outbound Gateway POC - XMLMarshalException -

i developing poc on spring integration following usecase. subscribing input message (a) remote jms queue transforming input message (a) (b) invoking remote webservice (b) , receiving response my spring-int config xml has following <int-ws:outbound-gateway id="marshallinggateway" request-channel="mdmintinputchannel" reply-channel="mdmintoutputchannel" uri="ws-endpoint" marshaller="marshaller" unmarshaller="marshaller"/> <oxm:jaxb2-marshaller id="marshaller" contextpath="com.veeaar.ws.types.jaxb"/> have jaxb generated source in spring integration proj workspace. while executing in sts 3.8.3, following error being thrown. not sure wrong in code. resolving highly appreciated. thanks. caused by: org.springframework.oxm.marshallingfailureexception: jaxb marshalling exception; nested exception javax.xml.bind.marshalexception - linked exception: [exception [eclipsel