Posts

How do I get the template type of a given element at runtime in C++? -

i'm designing simple array class capability of holding type of object, vector can hold multiple types of data in 1 object. (this learning purposes.) i have empty base class called container : class container {}; and templatized subclass called object : template <class t> class object : public container { t& object; public: object(t& obj = nullptr) : object(obj) {} }; i have array class holds vector of pointers container s use hold object s: class array { std::vector<container *> vec; public: template <class t> void add_element(const t&); auto get_element(int); }; add_element stores elements object s , puts them vec : template <class t> void array::add_element(const t& element) { vec.push_back(new object<t>(element)); } get_element removes element it's object , passes caller. problem lies. in order remove element object , need know type of object is: auto array::get_element(int i) { return (object</* ??? */> *...

Symfony/Doctrine: How does addJoinedEntityResult work for a one-to-many relationship? -

i have following problem. guess misunderstanding. after googling hours without finding solution post here. i have native query in doctrine: $rsm = new resultsetmapping; $rsm->addentityresult('acme\commentbundle\entity\comment', 'c'); $rsm->addfieldresult('c', 'comment_id', 'id'); $rsm->addfieldresult('c', 'slug', 'slug'); $rsm->addfieldresult('c', 'comment', 'comment'); $rsm->addfieldresult('c', 'created', 'created'); $rsm->addjoinedentityresult('acme\accountbundle\entity\worker', 'w', 'c', 'komments'); $rsm->addfieldresult('w', 'worker_id', 'id'); $rsm->addfieldresult('w', 'worker_name', 'name'); $rsm->addjoinedentityresult('acme\commentbundle\entity\document', 'd', 'c', 'documents'); $rsm->addfieldresult('d', 'document_...

javascript - FB.login not firing for HTML5 iOS web app -

this non native solution, responsive website i'm building. works fine in browser, nothing happens when call fb.login(); $(function() { $.getscript("https//connect.facebook.net/en_us/all.js", function() { fb.init({ appid : fbappid, status : true, cookie : true, oauth : true }); alert(fb); // [object object] fb.getloginstatus(function(response) { alert(response.status); // if ios simulator logged facebook // says "connected" // if ios simulator not logged in // says "unknown" }); fb.login(function(res) { // never gets here on ios simulator // works fine on browsers }); } }); the problem when i'm not logged facebook, i'm trying app pop open facebook looking screen. never gets inside of fb.login, though same code works in browser. thanks can help! it turns out, can't call fb.init , fb.login() on mobile browser. trying save loading sdk until user needed login, guess have use hover intent or else. once loaded sdk on page load, did fb.log...

opengraph - How can I customize Facebook open graph notifications -

when using facebook open graph, notifications on right side of page indicates url accessed from. there way remove this? when go "activity log" show phrase "user on " , display object again right. foursquare or instagram notifications don't display object again. can't find customization features anywhere , if can point me in right direction great. thanks you can customize open graph well. try text template. see complete picture here .

reverse engineering - How to decompile an Android .apk file? -

i decompile on mac os x, android .apk file. it's possible have difficulties. jd gui down. solution? you dont need jd-gui, there several options so, use ded, comes script can run. uses jasmin-classes , soot, helps in making class files more efficient. use apktool manifest.xml

iphone - if([aString writeToFile: @"outfile" atomically: YES]) -

for code like if([astring writetofile: @"outfile" atomically: yes]) i wondering if atomically parameter or parameter name? parameter name variable called. guess call parameter parameter general term in opinion. i think correct thing it's method name, it's part of it. can have parameters in between kind of split up. and btw 1 of things love in objective c, code gets readable :)

javascript - jQuery bind/change to Drop Down Form -

i had longer post describing trying do, don't think necessary i'm making simple. i'm working on getting zurb foundation work datatables. it's been pretty easy except drop down menu. i've had bit of tough time getting working js novice. here general syntax of foundation drop down. <label for="customdropdown">dropdown label</label> <select style="display:none;" id="customdropdown"> <option select="selected">this dropdown</option> <option>this option</option> <option>look, third option</option> </select> <div class="custom dropdown"> <a href="#" class="current">this dropdown</a> <a href="#" class="selector"></a> <ul> <li class="selected">this dropdown</li> <li>this option</li> <li>look, third option</li> </ul> </div> where i...