Posts

class - c++ how to call function with subclass, having superclass pointer -

i have 3 classes, a, b , c: class { public: virtual bool sm(b b) = 0; virtual bool sm(c c) = 0; }; class b : public { bool sm(b b) { //code } bool sm(c c) { //code } }; class c : public { bool sm(b b) { //code } bool sm(c c) { //code } }; and vector<a*> objects , stores b or c objects. (for example generates randomly) can call somehow for(int = 0; < objects.size(); i++) { for(int j = i; j < objects.size(); j++) { objects[i].sm(objects[j]); } } without dynamic cast or something? because there can bit more of b-c classes , bag thing, , may there better way it? solution odelande said , understood, solution problem #include <iostream> #include <vector> class b; class c; class { public: virtual bool sm(a* a) = 0; virtual bool sm(b* b) = 0; virtual bool sm(c* c) = 0; }; class b : public { public: bool sm(a* a) { return a->sm(this); } bool sm(b* b) { std::cout ...

ruby on rails - How to pass parameters to the controller with the proper key -

i'm trying figure out how store id on controller side delete store. currently code params on controller side sends store.id(1) value key format. need retrieve store_id: instead. {..."controller"=>"home", "action"=>"delete_store", "format"=>"1"} what need: {..."controller"=>"home", "action"=>"delete_store", "store_id"=>"1"} html/erb: <h4>your stores:</h4> <% @my_stores.each |store| %> <p><%= store.name %><%= link_to "x", delete_store_path(store.id), method: :delete %></p> <% end %> controller: class homecontroller < applicationcontroller ... def delete_store # current code, have # current_user.stores.where(store_id: params[:format] ) # make proper need # current_user.stores.where(store_id: params[:store_id] ) end end you can in ...

listview - android exendable list on screen's foreground -

:d i got exependable listview on top of layout, controlled fragment , below imageview. what want : when expend list, image don't move goes in background what happen : image go down as list expends. i tryed use linear layout weight param. same results any idea? <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:background="@color/colorbackground" android:fillviewport="false" android:id="@+id/container" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_gravity="center" android:orientation="vertical" > <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:id="@+id/linearlayout2"> <fragment android:id="@+id/pl...

tensorflow - distributed data reader across multiple machines -

is there distributed data reader tensorflow? if not, suggested way handling big datasets on multiple machines? the distributed inception example here pre-segments data on multiple machines , each workers grabs subset of data available subsets. supported method? also seems of data readers described in here thread safe couldn't find distributed solution. we don't have general solution distributed data reading in tensorflow, , it's bit of hard problem since there many different possible requirements around latency, size, , sharding. i'd interested in proposals or patches though!

javascript - Node js post data is undefined -

this in app.js file... var routes = require('./routes'); var user = require('./routes/user'); var reg = require('./routes/register'); var bodyparser = require('body-parser'); app.use(bodyparser.json()); app.use(bodyparser.urlencoded({ extended: true })); ... ... app.get('/', routes.index); app.get('/users', user.list); app.get('/register', reg.register); app.post('/signup', reg.postregister); in register.js file rendering new page using get , , trying access post data page using post function... exports.register = function (req, res){ res.render('register.jade', { title: 'register' }); } exports.postregister = function (req, res) { console.log(req.body.reg_name); } the get works, , post function called console logs undefined , cannot figure out why. html file register.js trying access... form(name="login", method="post", action='/signup', enc...

meteor - Flow Router not working with google maps? -

for strange reason whenever try route google maps flow router layout never renders. google maps template i'm using looks this: <template name="map"> {{> googlemap name="map" options=mapoptions}} </template> is glitch flowrouter?

c++ - Compilation of x264 project -

i had downloaded source of x264 library site http://www.videolan.org/developers/x264.html the version of x264 148. for compilation of shared dlls using following command under msys environment: ./configure --disable-cli --enable-shared --prefix=. the result following: platform: x86_64 byte order: little-endian system: windows cli: no libx264: internal shared: yes static: no asm: yes interlaced: yes avs: no lavf: no ffms: no mp4: no gpl: yes thread: win32 opencl: yes filters: crop select_every debug: no gprof: no strip: no pic: yes bit depth: 8 chroma format: after execution of make have following error: common/win32thread.o:win32thread.c:(.text+0x60): undefined reference `_beginthreadex' common/win32thread.o:win32thread.c:(.text+0x60): relocation truncated fit: r_x86_64_pc32 against undefined symbol `...