Posts

Showing posts from March, 2014

arrays - Algorithm balanced K-D tree with O(kn log n) -

i tried implement balanced k-d tree o(kn log n), used presorted k arrays (sorted arrays each index) o(kn log n), , median balanced tree. the problem faced median value @ level ,for example median x axis, maybe chosen again @ subsequent level, example y axis. i tried solve dividing y sorted array 2 arrays using chosen x value pivot, way wouldn't yield balanced tree. any idea how k-d balanced tree o(kn log n)? edit quoted wiki https://en.wikipedia.org/wiki/k-d_tree alternative algorithms building balanced k-d tree presort data prior building tree. maintain order of presort during tree construction , hence eliminate costly step of finding median @ each level of subdivision. 2 such algorithms build balanced k-d tree sort triangles in order improve execution time of ray tracing three-dimensional computer graphics. these algorithms presort n triangles prior building k-d tree, build tree in o(n log n) time in best case.[5][6] algorithm builds balanced k...

javascript - display text using ajax and php -

i'm trying simple thing in ajax not work. want display text when click on input button ajax.js jquery(document).ready(function($) { $('#insertform').change(function(){ //on recupere la valeur de l'attribut value pour afficher tel ou tel resultat var req=$('#insertform').val(); //requête ajax, appel du fichier function.php $.ajax({ type: "post", url: "lib/function.php", data: "insertform="+req, datatype : "html", //affichage de l'erreur en cas de problème error: function(xmlhttprequest, textstatus, errorthrown) { alert(xmlhttprequest + '--' + textstatus + '--' + errorthrown); }, //function s'il n'y pas de probleme success:function(data){ $('.coucou').empty(); $('.coucou').prepend(data.coucou) } }); }); }); html.php <div class="coucou"></div> <button type="button" class="btn btn-succ...

html5 canvas - taking a 'snapshot' of babylonjs scene sometimes works, sometimes doesn't -

i trying take 'snapshot' of babylon3d scene ... in other words: trying clone babylon3d canvas when user presses button, , append new <canvas> <body> .. works, other times not. however, if use simple canvas (ie. using fillrect), cloning/appending works expected. i have set test on plunker demonstrate problem: plunker : press button on , on again see how sporadic behaves when there babylon scene. and note : can toggle between simple canvas , babylon canvas within _jquery(document).ready(...) handler. thanks, shannon this because version 2.3.0 of babylonjs : engine initialize webgl preservedrawingbuffer = false default. you need initialize engine passing {preservedrawingbuffer: true} object third parameter. forked plnkr but unfortunately kill canvas' performances. see more here. i'm not specialist of babylonjs, , didn't find way make call scene.render method use flag method proposed @capse. there babylon.tools.cre...

python - GRASS parser() error -

i'm trying use grass on python 2.7, i'm having problems @ setting script on idle, i'm getting error @ parser() function: here script: import os import sys gisbase = os.environ['gisbase'] = 'c:\program files (x86)\grass gis 7.0.1rc1' gisrc = 'c:\grassdata' gisdbase = 'c:\grassdata' location = 'newlocation' mapset = 'tc' ld_library_path = 'c:\program files (x86)\grass gis 7.0.1rc1\lib' path = 'c:\program files (x86)\grass gis 7.0.1rc1\etc';'c:\program files (x86)\grass gis 7.0.1rc1\etc\python';'c:\program files (x86)\grass gis 7.0.1rc1\lib';'c:\program files (x86)\grass gis 7.0.1rc1\bin';'c:\python27';'c:\program files (x86)\grass gis 7.0.1rc1\python27';'c:\program files (x86)\grass gis 7.0.1rc1\msys' pythonlib = 'c:\python27' pythonpath = 'c:\program files (x86)\grass gis 7.0.1rc1\etc\python' sys.path.append(os.path.join(os.environ['...

ruby on rails - Unique multiple key index issue in production (Heroku PostgreSQL) -

i facing issue have tried solve myself don't what's wrong. french models, controllers... have french names. i developing app association makes call in french "maraudes" every night : driving around meet people. i have maraude model : class maraude < activerecord::base default_scope -> { order(date: :desc) } validates :date, presence: true, uniqueness: { scope: :type_maraude } validates :type_maraude, presence: true end my maraudes have :date , :type_maraude attributes, , want them define every maraude, every maraude has unique [:date, :type_maraude] combination. in order this, created migration : class addindextomaraudes < activerecord::migration def change add_index :maraudes, [:date, :type_maraude], unique: true end end it working in development. in production (heroku), have created maraude dated 2016-02-02 type (maraude salariés 1) , when trying create other maraude @ same date different type followin...

Django custom manager and queryset narrowed result -

i want able in template: request.user.notifications.unseen and show user unseen notifications has. so far, based on few posts found here, able develop this: class notificationqueryset(models.queryset): def unseen(self): return self.filter(is_read=false) class notificationmanager(models.manager): use_for_related_fields = true def get_query_set(self): return notificationqueryset(self.model) def unseen(self, *args, **kwargs): return self.get_query_set().unseen(*args, **kwargs) it works fine, shows 'unseen' notifications users. what thought specifying object relation, such user.notifications , argument passed function narrowing results user requesting it. so, how narrow results 1 user , not of them? edit models.py class usernotification(models.model): user = models.foreignkey(user, related_name='notifications') advertisement = models.foreignkey(advertisement) creation_date = models.datetimefiel...

Changing the color of selected items in react-select -

Image
i want change color of selected items in react select. selected items appear blue. want change color grey towards did following steps created file called mycomponent.scss $grey: #999; .select--multi { .select-value { background-color: $grey; color: $grey; }} and imported file component import 'react-select/scss/default.scss'; import './mycomponent.scss'; my hope override default color $grey variable. but color still blue. changing color of requires juggling of .css there lot of elements have changed. remember 4th number of rgba represents translucence. here elements need changed: div.select-control>.select-value { background-color: rgba(153, 153, 153, .08); border: 1px solid rgba(153, 153, 153, 0.24); color: #999; } div.select-control>.select-value>.select-value-icon { border-right: 1px solid rgba(153, 153, 153, 0.24); } div.select-control>.select-value>.select-value-label, .select-value>a { color: #999; } ...

ios - Mapview - protection against coordinates found nil -

i have mapview downloads records off cloudkit. coordinates of each record based on forward geocoder, users add address (ex: new york, ny) , lats , lons obtained current model follow: class place: nsobject { var name: string var address: string var comment: string? var photo: uiimage? var rating: int var location: cllocation? var identifier: string var record: ckrecord! init(record: ckrecord) { self.record = record self.name = record.valueforkey(placename) as! string self.address = record.valueforkey(placeaddress) as! string self.comment = record.valueforkey(placecomment) as? string if let photoasset = record.valueforkey(placephoto) as? ckasset { self.photo = uiimage(data: nsdata(contentsofurl: photoasset.fileurl)!) } self.rating = record.valueforkey(placerating) as! int self.location = record.valueforkey(placelocation) as? cllocation self.identifier = record.recordid.recordname } // mark: map annotation ...

javascript - how to use split() function in classic ASP for mass inputs textbox? -

i trying use split function in classic asp using javascript. need have big text box can keep group of bar-code numbers of products. once submit button clicked these bar-code numbers needed split each , every character term bar-code numbers (in loop). instance, if have 5 bar-code numbers, have split first bar-code number each , every character/number, keep array , continue same process 5 bar-code numbers. wanted display result of split-ted numbers paragraph myself check if working. below code working on. doesn't show me when click button. not being able figure out logical error or missing. how fix it? didn't find helpful solution when doing research. <p id="demo"></p> <form name="submitticket" action="<%=request("script_name")%>" method="post"> <input type="hidden" name="action" value="sendform"> <table cellpadding="0...

Using self as the first argument in ruby instance methods -

this string#dasherize activesupport::inflector : def dasherize(underscored_word) underscored_word.tr('_', '-') end it replaces underscores in string dashes. 'puni_puni'.dasherize # => "puni-puni" the receiver used argument method. activesupport::inflector.dasherize(puni_puni) # => "puni-puni" when try similar, doesn't work: module newdash def new_dasherize(underscored_word) underscored_word.tr('_', '-') end end string.include newdash t = "t_e_s_t" t.new_dasherize # => argumenterror: wrong number of arguments (0 1) t.new_dasherize(t) # => "t-e-s-t" how can replicate behavior, , technical term it? you can in couple different ways. lclk mentioned 1 way, setting self default underscored_word in argument list. way referencing self directly module newdash def new_dasherize self.tr('_', '-') end end string.include newdas...

angular - Using a pre-minified Javascript library with jspm? -

i trying package management jspm, , in cases bundled minifed version of library loaded systemjs instead of each individual source files (and don't want bundling myself jspm cli). for example, doing following: jspm install angular2 and have small application based on angular2. when @ happens on network, browser loads whole bunch of files part of angular2, although in particular case use angular2.dev.js, part of angular2 module installed jspm (and maybe in production load else). is there way jspm (basically replace bower + script tag)?

java - Implementing Custom hibernate type -

i trying implement hibernate mapping sample schema (order entry) provided oracle default installation orderentry schema has several table 1 of them customer table having few columns customtyped columns example custom type created following statement ; create or replace type "cust_address_typ" object ( street_address varchar2(40) , postal_code varchar2(10) , city varchar2(30) , state_province varchar2(10) , country_id char(2) ); and customer table created below statement create table oe.customers ( customer_id number (6) not null , cust_first_name varchar2 (20 byte) constraint cust_fname_nn not null , cust_last_name varchar2 (20 byte) constraint cust_lname_nn not null , cust_address oe.cust_address_typ , ) i came know need implement usertype interface here when try retrieve giving error org.hibernate.mappingexception: property mapping has wrong number of columns: com.dto.oe.customers.cust_addressdata type:...

DIY: Video Streaming Server -

i'm looking modern resources setting video streaming server. preferably open source solutions. my searching on has lead lot of dead ends. need build own instead of paying service. to setup own video streaming server should started following components: a linux distribution familiar with a free , open source server solution such naviserver ffmpeg (see streaming guide ) reeoncode files / streams desired resolutions/codecs etc. prepare streams correct restreaming vlc (see wiki ) prepare streams correct restreaming (rtsp, udp, http, http-live, dash) prepare files correct restreaming maybe content management solution serve streams such openacs however, please note: question broad, hence broad answer. it depends on requirements , given infrastructure. need script tasks such preparing streams http live streaming or other formats. if possible maybe add more details questions (formats, codecs, platforms, file restreaming or stream restreaming, real-time...

algorithm - Big O(n logn) is not preferable over the O(n^2) -

any algorithms example when prefer big o(n^2) time complexity on o(n logn)? have seen question somewhere did not find answer. for large problem, o(n log n) beat o(n^2). small problem, constant factors hidden big-o notation may cause prefer o(n^2) algorithm. instance, o(n log n) quicksort faster o(n^2) insert sort, quicksort implementations switch insert sort when partitions small (less ten elements).

php - Fatal error: Call to undefined method DoctrineModule\Authentication\Adapter\ObjectRepository::setIdentityValue() -

i'm trying implement authentication module in zf2 application, did found in official docs, i'm getting error: fatal error: call undefined method doctrinemodule\authentication\adapter\objectrepository::setidentityvalue() in docroot/module/login/src/login/controller/indexcontroller.php on line 33 i put in module.config.php: 'doctrine' => array( 'driver' => array( __namespace__ . '_driver' => array( 'class' => 'doctrine\orm\mapping\driver\annotationdriver', 'cache' => 'array', 'paths' => array(__dir__ . '/../src/' . __namespace__ . '/entity') ), 'orm_default' => array( 'drivers' => array( __namespace__ . '\entity' => __namespace__ . '_driver' ) ) ), 'authentication' => array( 'orm_default' ...

android - Change SQLite to MySQL -

i have mysql database( xampp server) , i've found code uses sqlite database. cursor cursor = builder.query(**mdatabaseopenhelper**.getreadabledatabase(), columns, selection, selectionargs, null, null, null); on should change mdatabaseopenhelper.getreadabledatabase() if want use code mysql database? if want use mysql , cannot use sqlite . please refer this . have write php script in order perform data operation , use json .

iphone - Offline Ad-Hoc deployment of iOS apps -

i have registered 80 devices apple developer account. want able deploy app them in environment both xcode , device have no internet connection. problem being if deploy app via xcode, device must have network connection verify developer profile. (installed automatically when deploying app via xcode) how can this? can setup xcode , devices internet connection, after initial setup, developers have able make changes code , re-deploy app onto devices without network connection. it takes while compile, build,sign , package app ad hoc deployment, install via itunes. steps: in xcode set scheme's device generic ios device . then in top menu: product -> archive. ...it takes while compile... in organizer (pops after build completes, or found in window -> organizer) select build , click export button on right hand side (under big upload app store... button). select save ad hoc deployment , continue. ...you should .ipa file... open .ipa file, should open itu...

Laravel & Meteor password hashing -

i have 2 applications, 1 in laravel 5.2 , 1 in meteor. want collect hashes passwords compatible both platforms. the database stores hashes separately password laravel. meteor_password meteor. both platforms use bcrypt 10 rounds default, meteor appears sha256 plain password before bcrypt. if meteor creates password hash abc , can sha256 plain password, , compare abc using laravel's internals, i.e. auth::attempt() $sha256 = hash('sha256', $request->get('password'), false); this works. laravel authenticates user. however, if register new user in laravel, , store hash meteor_password , when authenticating against hash in meteor, fails error message "login forbidden". this error appears mean incorrect credentials. i'm creating hash in same way did when verified in laravel. $meteor_password = bcrypt(hash('sha256', $plain, false)); it seems strange it'd work 1 way , not other assume i'm missing something. ...

visual c++ - C++ what is wrong with my function call -

have following code in main method: int main(int argc, char* argv[]) { color c1(10,1,2); hsl h=converttohsl(c1); return 0; } with following converttohsl method: hsl converttohsl(color const& c) { return hsl(0,0,0); } and getting build errors in project. color class defined follows: color::color(){} color::color(float r,float g,float b){ this->r=r; this->g=g; this->b=b; } color::~color(void){} hsl defined follows: hsl::hsl() {} hsl::hsl(float h,float s,float l) { this->h=h; this->s=s; this->l=l; } hsl::~hsl(void){} with converttohsl method mentioned. what possibly wrong? c1 isn't declared. did mean color c1(10,1,2);

Android Data Binding ListView item fails onClick -

i have listview adapter : adapter public class menuadapter extends baseadapter{ private list<viewdatabinding> bindings = new arraylist<>(); public menuadapter(){ firstbinding binding = firstbinding.inflate(inflater); firstmodel model = ...; binding.setmodel(model); bindings.add(binding); secondbinding secondbinding = secondbinding.inflate(inflater); secondmodel secondmodel = ...; binding.setmodel(secondmodel); bindings.add(secondbinding); } ... @override public view getview(int position, view convertview, viewgroup parent) { return bindings.get(position).getroot(); } ... } first.xml (first layout binding) <?xml version="1.0" encoding="utf-8"?> <layout xmlns:android="http://schemas.android.com/apk/res/android"> <data> ... </data> <relativelayout ...

npm i –g tries to install to /-g folder location -

for reason if this: npm –g karma-cli i this: npm err! addlocal not install /users/me/foo/–g no idea happening, used work well. use --global instead. reason works.

How to execute pkg.refresh_db in a salt state? -

i have following sls file: python: pkg.installed: - pkgs: - python2_x64 how can edit file make sure pkg.refresh_db executed prior attepting install python? i can manually run refresh this: salt -g 'os:windows' pkg.refresh_db pkg: module.run: - name: pkg.refresh_db python: pkg.installed: - pkgs: - python2_x64

linux - Why does CAP_NET_RAW not work with SO_BINDTODEVICE? -

i have following simple test program create udp socket , bind specific interface so_bindtodevice can bind() inaddr_any recieve udp broadcasts on interface. //filename: bindtest.c #include <sys/socket.h> #include <netinet/in.h> #include <stdio.h> #include <unistd.h> #include <string.h> #include <stdlib.h> #include <errno.h> #define my_port (333) #define my_device "enp0s3" #define buffersize (1000) /* global variables */ int sock; struct sockaddr_in sa; struct sockaddr_in my_addr; char buffer[buffersize]; int main(int argc, char *argv[]) { unsigned int echolen, clientlen; int rc, n; char opt_buffer[1000]; struct protoent *udp_protoent; struct timeval receive_timeout; int optval; socklen_t opt_length; sleep(1); /* create udp socket */ if ((sock = socket(af_inet, sock_dgram, ipproto_udp)) < 0) { printf ("%s: failed create udp socket (%s) \n", argv[0], strerror(errno)); exit (...

php - move_uploaded_file() is not working but file is uploaded? -

so i'm trying create code creates , publishes file webroot, modifies , writes file, , change location of file directory/folder using move_uploaded_file() this code far $myfile = fopen($_post['title'].".txt", "w"); move_uploaded_file($myfile,'$dir/$title.txt'); fwrite($myfile, $_post['textarea11']); fclose($myfile); the code doesn't work, i've tried echoing move_uploaded_file() , returned nothing, file uploaded it's location wasn't changed. $dir defined $dir = __dir__.'/../uploads/'; , $title define $title = $_post['title']; move_uploaded_file() can used if submitting multipart form , want save uploaded file. what need this: http://php.net/manual/en/function.rename.php

c# - Extracting attached email from a journal item with EWS API - embedded Item Id is null -

i have been experimenting day no avail. i can retrieve journal item exchange mailbox, , access attachment itemattachment : emailmessage mailitem_journal = emailmessage.bind(_service, item.id, _propsjournalitem); itemattachment itemattachment = mailitem_journal.attachments[0] itemattachment; itemattachment.load(); item attacheditem = itemattachment.item; the item contained inside of type ipm.note i.e. email. need bind emailmessage object can access email specific properties, e.g. torecipients not available otherwise. id of attacheditem null, causes following fail emailmessage mailitem = emailmessage.bind(_service, attacheditem.id, _propsemaildetail); value cannot null i tried binding itemattachment expected did not work, throwing error invalid id i guessed maybe id null because email embedded within email , isn't "in" folder "have" id, tried using item.save store in mailbox, in hope retrieve normal: attacheditem.save(_folderit...

Swift game error message -

i following ios game tutorial. cannot figure out wrong here. error on these 2 lines. let newangle = percent * 180 - 180 cannon.zrotation = cgfloat(newangle) * cgfloat(m_pi); 180.0 //error "use of unresolved identifier 'percent'" the tutorial uses: cannon.zrotation = cgfloat(newangle) * cgfloat(m_pi)/ 180.0 but changed error suggested import spritekit class gamescene: skscene { var cannon: skspritenode! var touchlocation:cgpoint = cgpointzero override func didmovetoview(view: skview) { /* setup scene here */ cannon = self.childnodewithname("cannon") as! skspritenode } override func touchesbegan(touches: set<uitouch>, withevent event: uievent?) { /* called when touch begins */ touchlocation = touches.first!.locationinnode(self) } override func touchesmoved(touches: set<uitouch>, withevent event: uievent?) { touchlocation = touches.first!.locationinn...

Swift: Location on image filtering out certain parts of the image -

Image
i want have pop records have pain on abdomen (much myidb app. popup has image of body , tap on there. red marker shows selection , cannot place mark outside body. how can set filter not allow input outside image section? i found answer: stackoverflow answer alpha value of touch location. save image transparent area outside want touch , quite simple determine if area want touched.

grepl with loop in R -

saw posts around general expression if 'value' contains 'char' how can done on length vector? v1 <- c('123','456','789','4433','77666') v2 <- c('9999','9998','91239','9987','8877666','789','100') but when function want return ('t','f','t','f','t') df<-0 for(i in 1:length(v1)) { for(j in 1:length(v2)) df[i]<-grepl(i,j) } any appreciated - thanks!

php - IS NOT NULL giving null values -

i have following php code using pdo. want rows empty values not appear in results. how achieve this, , doing wrong below? <?php require_once 'dbconfig.php'; try { $conn = new pdo("mysql:host=$host;dbname=$dbname", $username, $password); echo "connected $dbname @ $host successfully."; $sql = 'select * as_questions answer not null'; $q = $conn->query($sql); $q->setfetchmode(pdo::fetch_assoc); } catch (pdoexception $pe) { die("could not connect database $dbname :" . $pe->getmessage()); } as above suggested 2 persons (fred -ii , alex anderi) please change query below:- $sql = "select * as_questions answer !=''";

Amazon API using PHP mysql -

i'm developing web application using php download amazon products,categories , upload products, categories amazon store. want categories , sub-categories amazon. can't find function categories api. can please me download categories. also, please let me know whats data limit 24 period? or how many records can download @ once? i think you're looking browsenodelookup operation in product advertising api.

Python JSON dummy data generation from JSON schema -

i looking python library in can feed in json schema , generates dummy data. have worked similar library in javascript dummy-json. library can same in python. is searching for? https://pypi.python.org/pypi/jsonschema

Retrieve Facebook profile from Xamarin client -

i basic user information facebook after user has logged in. i've looked @ documentation in how to: work authentication , under "how to: retrieve authenticated user information" section, shows how .net backend code using httpclient make call accesstoken: var fbrequesturl = "https://graph.facebook.com/me/feed?access_token=" + credentials.accesstoken; since mobile client has accesstoken mobileservices, can client make call directly facebook endpoint, or client sdk provide built-in functionality? i've been following xamarin.forms sport project , way user information google hard-coding google endpoint , making call user info. note: xamarin.forms sport uses mobile services, not mobile app, not sure if makes difference. it sounds you're doing server-directed login: making call backend login dance facebook. in this, client application making call .auth/login/facebook, opens browser or web authentication broker enter credentia...

php - copy text from link to clipboard when clicked -

i returning values database search hyperlinked redirect search.php . change code instead of redirecting search.php , text of link copied clipboard when user clicks mouse , user remain on same page. easy solution appreciated. here code using. while($row = mysql_fetch_assoc($find_parts)) { $name = $row['name']; $id = $row['id']; echo "<a href='search.php?id=$id'>$name</a><br />"; } basically want name copied clipboard when link clicked i'd add comment unfortunately don't have quite enough rep yet. i'd recommend zeroclipboard . uses mix of flash , javascript , should able need.

How to integrate Spring to a Dynamic Web Project in Eclipse with JSP? -

i have looked everywhere , have not found site can show how can integrate spring web dynamic jsp project built in eclipse. references have found, outdated or using new spring boot , thymeleaf, default not recognize jsp. i pretty sure, question may sound silly many spring programmer rock stars, me kind of big pain. can one, please direct me web site, or book can integrate spring? real reason because want integrate spring security. after reading bunch of forums, books reviews , talking spring veterans migrated standards jsp ee portal new spring mvc. here top 2 books found indispensable wants port current jsp projects spring. spring mvc: beginner's guide ( http://amzn.to/1profs8 ) 2.- mastering spring mvc 4 ( http://amzn.to/1qc4uxg )

javascript - Ionic, hide and show element from side menu -

i new ionic. need hide elements side menu. example html markup: <ion-side-menus enable-menu-with-back-views="false"> <ion-side-menu-content> <ion-nav-bar class="bar-stable"> <ion-nav-back-button> </ion-nav-back-button> <ion-nav-buttons side="left"> <button class="button button-icon button-clear ion-navicon" menu-toggle="left"> </button> </ion-nav-buttons> </ion-nav-bar> <ion-nav-view name="menucontent"></ion-nav-view> </ion-side-menu-content> <ion-side-menu side="left"> <ion-header-bar class="bar-stable"> <h1 class="title">menü</h1> </ion-header-bar> <ion-content> <ion-list> <ion-item menu-close ng-click="login()"> login </ion-item> ...

scala - Efficient grouping by key and StatCounter -

i aggregating values parameter below using apache-spark , scala. keeps adding values "list" there more efficient way list key , statcounter? val predictorrawkey = predictorraw.map { x => val param = x._1 val val: double = x._2.todouble (param, val) }.mapvalues(num => list( num) ) .reducebykey((l1, l2) => l1 ::: l2) .map { x => x._1, statcounter(x._2.iterator)) for starters shouldn't use reducebykey group values. more efficient omit map side aggregation , use groupbykey directly. fortunately statcounter can work in streaming fashion , there no need group values @ all: import org.apache.spark.util.statcounter val pairs = predictorrawkey.map(x => (x._1, x._2.todouble)) val predictorrawkey = pairs.aggregatebykey(statcounter(nil))( (acc: statcounter, x: double) => acc.merge(x), (acc1: statcounter, acc2: statcounter) => acc1.merge(acc2) )

android - ViewPager fragment is not working in 2nd time inside navigation drawer fragment properly -

Image
i have navigation drawer in there 1 fragment tab viewer . in tabviewer, using viewpager in fragment . code viewpager viewpager = (viewpager) rootview.findviewbyid(r.id.pager); viewpager.setadapter(new tabspageradapter(((fragmentactivity)getactivity()).getsupportfragmentmanager())); pagerslidingtabstrip tabsstrip = (pagerslidingtabstrip) rootview.findviewbyid(r.id.tabs); tabsstrip.setviewpager(viewpager); the tabs coming in first click in navigation drawer content second time title of tabs coming without layout. layout not coming , swipe not working between different tabs? why working first time not rest? attaching images 2 different click on same navigation drawer fragment. first click layout coming perfectly. this in 2nd attempt click on same fragment background coming without layout content. help rid of problem. use getchildfragmentmanager() instead of ((fragmentactivity)getactivity()).getsupportfragmentmanager()

javascript - template function not interpolating component bindings -

i'm using 1.5 components, don't think matters though. i'm trying single = binding between parent controller , child directive isolate scope. child isolate scope interpolating binding literally; instead of vm.data interpolating data defined in controller, it's coming out literally vm.data string. if try 1 way binding @ then, again, "interpolated" value results in {{vm.data}} literally. how can string defined in parent controller child component's template? angular .module('app', []) .controller('ctrl', function () { this.str = '<0>, blah, <1>'; }) .component('appcomponent', { restrict: 'e', controller: 'ctrl vm', template: '<div><app-str appstr-data="{{vm.str}}"></app-str></div>' }) .component('appstr', { bindings: { appstrdata: '@' }, restrict: 'ea', template: function($eleme...

robotframework - Finding elements inside an iframe without a iframe id using robot framework -

html looks this <iframe src="/apex/cscfga__configureproduct?linkedid=a0w8e000000lpa5uac&amp;configid=a0z8e000000nbgmua4&amp;returl=/a0w8e000000lpa5uac&amp;isdtp=vw" width="100%" height="100%" onload="hideloading()" frameborder="0" style="height: 737px;"></iframe> select frame doesnt work without id.how should robot script recognise iframe(without id)? my script looks ${iframe}= execute javascript window.document.getelementsbytagname('iframe')[2] log ${iframe} but returns 'none' please suggest how identify iframe. select frame work type of locator. example, if it's iframe on page can this: select frame xpath=//iframe if there multiple iframes on page, need try find ancestor uniquely identifiable , frame relative that. for example, given following html: <div class="spreadsheet_container"> <div> ...

c# - Entity Framework 6 SaveChanges() override not consistently detecting changes -

i've extended class in order add last modified timestamp record if there material changes being made it. done code similar this . here's problem. savechanges() firing both changes, second 1 isn't getting loop: no objects detected needing changes. however, record does updated ef through base.savechanges() call. here's extension mastertable: namespace audittestef { public interface ihasauditing { datetime lastmodifiedon { get; set; } int lastmodifiedby { get; set; } } public partial class mastertable : ihasauditing { } public class audittestentitieswithauditing : audittestentities { public int testinguseris = 1; public override int savechanges() { foreach (objectstateentry entry in (this iobjectcontextadapter) .objectcontext .objectstatemanager .getobjectstateentries(entitystate.added | entitystate.modified)) { ...

asp.net - Disable web.config inheritance for individual child applications -

is there way of disabling child web.config inheritance individual child applications? i aware of inheritinchildapplications="false" applied root web.config , affects child web applications. if need disable inheritance single web application (or specific list of child applications) , keep others? add root web.config before closing </configuration> element: <location path="myapp" inheritinchildapplications="false" /> where myapp child application wish disable configuration inheritance for.

graphite - How to convert running total metric to change per time window? -

Image
i'm working metric represents running total. peaks 30 seconds apart, making me think count stored every 30 seconds. goal able see delta in running total per "$window" (template variable, ex: 1min, 30min). if window 30 seconds , difference between 2 consecutive counts 5, i'd see "5" datapoint. if window 1min, delta between 3 peaks. my understanding derivative help, produces constant 0 line. suppose has pointy-nature of graph. i've been playing hitcount , persecond , don't seem getting right numbers. advice? edit: i'm trying out summarize(derivative(summarize(my.metric, "30s")), "$window") . idea enforce minimum resolution of 30s (since have 1 datapoint per 30s) summarize(my.metric, "30s") . then, use derivative rate of change, , summarize templated $window sum rates of changes interval i'm interested in. comments? using summarize(derivative(summarize(my.metric, "30s")), "$w...

php - Symfony3 - "Unrecognized field" exception when I want to pull entries based on the value of a Many-to-One relation property -

want display records entity, records have loginid value equal current user's id. in events entity, loginid many-to-one property. have following events entity: namespace vendor\mybundle\entity; use doctrine\orm\mapping orm; use symfony\component\httpfoundation\file\uploadedfile; use symfony\component\validator\constraints assert; /** * events * * @orm\table(name="events") * @orm\entity */ class events { /** * @var string * * @orm\column(name="eventname", type="string", length=255, nullable=false) */ private $eventname; /** * @var string * * @orm\column(name="location", type="string", length=255, nullable=false) */ private $location; /** * @var \datetime * * @orm\column(name="startdate", type="datetime", nullable=false) */ private $startdate; /** * @var \datetime * * @orm\column(name="en...