Posts

How to understand 2 main() functions after using uftrace to profile the C++ program? -

i trying uftrace profile following simple c++ program: #include <iostream> class { public: a() {std::cout << "a created" << std::endl;} ~a() {std::cout << "a destroyed" << std::endl;} }; int main() { a; return 0; } the profile result this: # uftrace a.out created destroyed # duration tid function 2.026 [ 4828] | __cxa_atexit(); [ 4828] | main() { [ 4828] | __static_initialization_and_destruction_0() { 89.397 [ 4828] | std::ios_base::init::init(); 0.768 [ 4828] | __cxa_atexit(); 93.029 [ 4828] | } /* __static_initialization_and_destruction_0 */ 94.425 [ 4828] | } /* main */ [ 4828] | main() { [ 4828] | a::a() { 11.104 [ 4828] | std::operator <<(); 10.825 [ 4828] | std::basic_ostream::operator <<(); 24.514 [ 4828] | } /* a::a */ [ 4828] | a::~a() { 0.978 [ 4828] | ...

plot - When plotting a curve in R, a piece of the curve gets cut off, not sure why -

i trying plot formula. x approaches 0 right, y should approaching infinity, , curve should going upwards close y-axis. instead gets cut off @ y=23 or so. my_formula = function(x){7.9*x^(-0.5)-1.3} curve(my_formula,col="red",from=0 ,to=13, xlim=c(0,13),ylim=c(0,50),axes=t, xlab=na, ylab=na) i tried play from= parameter , , got needed when put from=-4.8 have no idea why works. in fact x doesn't less 0, , from/to should represent range of x values, they? if explain me, amazing! thank you! by default, curve chooses 101 x-values within (from, to) range, set default value of n argument. in case means there aren't many values close enough 0 show full behaviour of function. increasing number of values plotted n=500 helps: curve(my_formula,col="red",from=0 ,to=13, xlim=c(0,13),ylim=c(0,50),axes=t, xlab=na, ylab=na, n=500)

android - The ListView is showing duplicate data -

this how display listview, i'm not sure whether correct method or not showing listview this. problem listview have duplicate data when "condimentdescription" having more 1 data, following code, kindly advise. the listview show this, not want. this want public list<orderlist> getorderlist() { list<orderlist> orderlist = new arraylist<orderlist>(); try { string selectquery = "select t2.id,t2.productcode,t2.price,t2.qty,t3.description,t4.condimentdescription tempcs t1 \n" + "left outer join tempcsdetail t2 on t1.docno=t2.docno\n" + "left outer join mproduct t3 on t2.productcode=t3.code \n" + "left outer join tempcscondiment t4 on t2.seqno=t4.seqno"+ "where t1.docno=" + tablepagedocno + "\n"; sqlitedatabase db1 = db.getreadabledatabase(); ...

c# - How can i get a specific GameObjects to array without using FindGameObjectsWithTag? -

in first script clone gameobjects: using system; using unityengine; using random = unityengine.random; using system.collections; using system.collections.generic; using system.linq; public class cloneobjects : monobehaviour { public gameobject objecttocreate; public int objectsheight = 3; [hideininspector] public gameobject[] objects; // tracking properties change private vector3 _extents; private int _objectcount; private float _objectsize; private list<gameobject> clonelist = new list<gameobject>(); /// <summary> /// how far place spheres randomly. /// </summary> public vector3 extents; /// <summary> /// how many spheres wanted. /// </summary> public int objectcount; public float objectsize; public static float largestsize = 0; // use initialization void start() { clone(); //objects = gameobject.findgameobjectswithtag("cl...

SQL: Split string by delimiter multiple times into new columns -

i have ids , corresponding strings this: id place 234 usa_ny_buffalo i want split place string 3 strings each own column: id country state city 234 usa ny buffalo when try splitting string this: select id, split(place,"_") mytable i id place 234 usa 234 ny 234 buffalo is possible split string first "_", split second string again " _ " ? if string have country,state , city try like. select substring_index('usa_ny_buffalo', '_', 1) country, substring_index(substring_index('usa_ny_buffalo', '_', 2), '_', -1) state, substring_index(substring_index('usa_ny_buffalo', '_', 3), '_', -1) city;

java - Comparing Json Template with JSON Response -

(the following has been edited make understandable.) we want compare actual json object expected json object, complication json objects may contain other json objects. using net.sf.json api this. have tried following approaches: we have tried json objects' keys lists (to preserve keys' order) , indexes of keys in lists. we have tried adding (flattening) keys , values in json objects pair of map objects. in case, had problems duplicate keys in nested json objects. addressed making values in map lists of values json objects. after discussion team, need modify approach follows: (the following has not been edited ...) now wanna compare key , values in result json , expected json (must need check format) while traversing each key in result json parallelly want check same(key , value) in expected json. first of all, if preserving order of keys in json objects because order important meaning of json, abusing json. json specs make clear order of key in js...

python - Is there an machine learning algorithm that combines classification and regression into one -

i have data set , wherein want predict component , along components need predict proportions seems me classification+regression. there python library that? there deep learning method ? understand task can done in 2 separate step there way combine these operations. the solution format expect prediction must get class : 34% class b : 46% class u : 20% assuming classes exist z, , composition may have increase or decrease in number of classes. latent class regression the problem describing can solved latent class regression, or cluster-wise regression, or it's extension mixture of generalized linear models members of wider family of finite mixture models, or latent class models. it's not combination of classification (supervised learning) , regression per se, rather of clustering (unsupervised learning) , regression. basic approach can extended predict class membership using concomitant variables, makes closer looking for. in fact, using latent class models c...

replication - Agents on Author Dialog Options in AEM -

Image
i not able understand use case when can use ntlm domain, ntlm host, ssl,allow expired certs been used. any appreciated. ntlm microsoft's implementation of kerberos protocol. used when author , publishers have 1 or more of following conditions valid: not on same windows domain. don't share common ad provider. kerberos ports (for eg. 88) blocked. windows server being accessed via ip address rather it's host name. ntlm challenge-response protocol these ntlm host , domain names parameters used protocol identify client (which author server in case) along user name , password. in reality, never use in linux environment , use in modern windows network have better ad security options (like trusted domains , subnets). ssl options there workaround in situations publisher's https certificate has expired , want continue replication. assuming own publisher server in network, trust publisher server's identity , ignore expired certificated until renew...

How to add new class with existing class dynamically using Jquery/Javascript -

i need 1 help. need add 1 new class along existing class using jquery/javascript. explaining code below. <div class="fynd-space-itms"> <div class="col-sm-3"> <a href="javascript:void(0)" class="item-exhibitation maploc" onclick="keepsection();">ram</a></div> <div class="col-sm-3"> <a href="javascript:void(0)" class="item-parking maploc" onclick="keepsection();">raj</a></div> <div class="col-sm-3"> <a href="javascript:void(0)" class="item-offices maploc" onclick="keepsection();">ray</a> </div> </div> here need when user click on onclick event 1 new class add along existing class. suppose user clicked on ram , after clicking new class i.e-active add , total class name item-exhibitationactive maploc , same others i.e-item-parkingactive maploc,item-officesactiv...

docker - Verbose logging in Kubernetes deployment file -

iam new kubernetes , want know 'v' in following mean ? spec: containers: - args: - -v=9 it seems me denotes verbose logging , there documentation same regarding various levels of logging avbl values arg v can take ? kubernetes uses glog . available values 1-4, denoted in this doc

html5 - light slider issue 1920px resolution -

Image
i using lightslider plugin when using keyboard "ctrl -" added white gap space , 1920px resolutions right click white added white gap space body me. please visit site: http://brasilplay.streamrepublic.com/brasilplay_web01/ , screen shot: <script> $(document).ready(function() { $("#content-slider").lightslider({ loop:true, keypress:true }); $("#content-slider1").lightslider({ loop:true, keypress:true }); $("#content-slider2").lightslider({ loop:true, keypress:true }); $('#image-gallery').lightslider({ gallery:true, item:1, thumbitem:9, slidemargin: 0, speed:500, auto:true, loop:true, onsliderload: function() ...

php - Display ... in pagination -

i have pagination issue. pagination work fine. want display started 3 page after want display (....) , @ last point want display last page. here code: <?php $videocount= 1000; $page = (!isset($_get['page']))? 1 : $_get['page']; $prev = ($page - 1); $next = ($page + 1); /* max results per page */ $max_results = 50; /* calculate offset */ $from = (($page * $max_results) - $max_results); $last = $from + $max_results; /* query api total results.*/ //$total=107; $total_results = $videocount; $total_pages = ceil($total_results / $max_results); if($page==$total_pages ){ $last=$total_results ; }else{ $last=$last; } $pagination = ''; /* create prev link if there 1 */ if($page > 1) { $pagination.= '<li> <a href="?&page='.$prev.'"> <span class="prevbtn"><i class="fa fa-caret-left"></i> previous</span> </a></li>'; } /* loop through total pages */...

ios - Apple Rejected New Version of App -

hi can maybe me figure out issue is, my second version of app compiled xcode 8.2 installed on macbook , week made three changes app. 1) added image view 2) modified method uploads images server 3) compiled latest xcode but rejected following message we unable install app on ipad air. uirequireddevicecapabilities key in info.plist set in such way app not install on ipad air . in info.plist file there no uirequireddevicecapabilities ( see attached info.rar file plist file). i ran application on iphone 5s , worked, ran on vs simulators (ipad air 2, , ipad air) ipad air 2 ran easily, ipad air hanged @ splash screen (i doing no processing there), closed, if click on app icon again hang again third time clicked on app opened without issues here info.plst https://pastebin.com/bhscwvdr i using xamarin.ios 10.8 on windows 10 , using xcode 8.3 on mac mini os 10.3 edit 1: ipad air simulator working normal after restarted laptop, runs smoothly everytime ...

javascript - Pulling Data from a 3rd Party Webpage for an IOS app -

i'm trying pull data single webpage don't host, , parse ios app. can pull data page or need access source code or backend stuff? i'm new sort of thing, unclear on how or begin. this webpage: https://studentaffairs.psu.edu/currentfitnessattendance/

Access 2016 Processes not being killed during Automation but same works for Access 2013/10/07 -

we have access automation software opening instance of ms access 2016 using com , fetching data of tables/reports etc access database. once done, close ms access database - calling database.close() assigning null value referenced variables calling closecurrentdatabase() of access application object finally calling quit() method of access application object assigning null value access application referenced variables calling gc.collect() & gc.waitforpendingfinalizers() in separate thread. doing of above kills ms access 2013 instances fails ms access 2016. processes linger on time , keep consuming ~50 mb ram , ~10% cpu though our automation completed , our code has quit. find these processes killed time later. this lingering on of processes causing high cpu / ram usage issues find more 50 instances open. is there known issue in ms access 2016 while closing or connect post activity (like connect server , send data) when application.quit called. would appreciate a...

angularjs - Why do I get undefined for this Angular scope? -

i use factory create objects particular module angular.module("mymodule").factory('myentity', .... and module accepts generated 'myentity' injected dependency: angular.module("mymodule").controller('myproductctrl', [ '$scope', 'myentity', '$rootscope', 'myapiservice' ... the module has following subscriber function used subscribe entity inside module this: myentity.subscribe(function(otherentity) { $scope.myreference = otherentity; }); at runtime, above $scope.myreference assigned expected object it's value when first module loaded ... , i've added function onto scope inside same module: $scope.mymodulefunction = function (product) { if (myreference.yadda) { ... } } ... above '$scope' undefined @ point function called via directive (in fact it's undefined once web page has been displayed). why might case?

c++ - Why wide variations of runtime exists when running UnionFind in Windows and Mac OS? -

recently attended courses data structure, learned performance of quickunion better quickfind when connecting 2 elements. when testing same code in gcc, windows 10 instead of mac os x, teacher's machine, got entirely different result of runtime didn't know why. here code of quickfind. #ifndef inc_03_quick_union_unionfind1_h #define inc_03_quick_union_unionfind1_h #include <cassert> using namespace std; namespace uf1 { class unionfind { private: int *id; int count; public: unionfind(int n) { count = n; id = new int[n]; (int = 0; < n; i++) id[i] = i; } ~unionfind() { delete[] id; } int find(int p) { assert(p >= 0 && p < count); return id[p]; } bool isconnected(int p, int q) { return find(p) == find(q); } void unionelements(int p, int q) { ...

file - How to detect if a filename exists (with any extension) in android -

i want return true if filename exists regardless extension. using following method: file file = new file(environment.getexternalstoragedirectory() + images/","filename.*"); if(file.exists()) { return true; } there jpg file in directory, if search "filename.jpg", returns true, in case of "filename.*" returns false. is there way return true if filename same extension? try file imagefolder = new file(environment.getexternalstoragedirectory() + "images/"); file[] listoffiles = imagefolder.listfiles(); (file file : listoffiles) { if (file.isfile()) { string[] filename = file.getname().split("\\.(?=[^\\.]+$)"); //split filename it's extension if(filename[0].equalsignorecase("filename")) // file exists ever want } }

node.js - Searching for public folder in routes path -

whenever different route visited other root, express not able find public folder containing stylesheets , javascript files, instead searches assets inside route path. appreciated. error when visiting http://localhost:3000/users/login/ gives - get /users/login/stylesheets/bootstrap.css 404 14.872 ms - 10418 /users/login/stylesheets/style.css 404 7.134 ms - 10418 /users/login/javascripts/bootstrap.js 404 57.890 ms - 10418 /users/login/javascripts/bootstrap.js 404 5.326 ms - 10418 app.js var express = require('express'); var path = require('path'); var favicon = require('serve-favicon'); var logger = require('morgan'); var cookieparser = require('cookie-parser'); var bodyparser = require('body-parser'); var app = express(); // modules var hbs = require('hbs'); var defaultlogger = require('express-logger'); var index = require('./routes/index'); var users = require('./routes/users')...

angularjs - ng-class multiple condition in on statement -

i need check if 2 things true decide class. have been trying find solution because believe should pretty common problem. maybe i'm searching wrong things. i want have 2 conditions in 1 statement, if called? i've tried similar things this: ng-class="{'in-behalf-of-background-color' : parameters.username == quote.inbehalfof } ,{'not-in-behalf-of-background-color' : ((parameters.username != quote.inbehalfof) && (quote.inbehalfof != 'null'))}" as can see want check parameters.username != quote.inbehalfof , if quote.inbehalfof != null in same condition. possible? try code; you want multiple condition define 1 object , define conditions key value pair {key1:value1, key2: value2} ng-class="{'in-behalf-of-background-color' : parameters.username == quote.inbehalfof, 'not-in-behalf-of-background-color' : ((parameters.username != quote.inbehalfof) && (quote.inbehalfof)) }"