Posts

Featured post

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