Posts

Featured post

C++: Boost interprocess memory mapped file error -

i'm trying create memory mapped file using this answer, i'm getting compile errors. code: namespace bi = boost::interprocess; std::string vecfile = "vector.dat"; bi::managed_mapped_file file_vec(bi::open_or_create,vecfile.c_str(), sizeof(struct rectangle) * data_size); typedef bi::allocator<struct rectangle, bi::managed_mapped_file::segment_manager> rect_alloc; typedef std::vector<struct rectangle, rect_alloc> myvec; myvec * vecptr = file_vec.find_or_construct<myvec>("myvector")(file_vec.get_segment_manager()); vecptr->push_back(random_rectangle); the struct this: struct rectangle{ rectangle(float *minarr, float *maxarr, int arr, int exp, int id){ this->arrival = arr; this->expiry = exp; this->id = id; for(int i=0; < 2; i++){ min[i] = minarr[i]; max[i] = maxarr[i]; } int arrival, expiry, id; float min[2]; float max[2]; } the error is: compiler not deduce template argu

redirect - Rails 4, Devise - after_sign_in -

i trying make app in rails 4. i trying follow along tutorial: http://sourcey.com/rails-4-omniauth-using-devise-with-twitter-facebook-and-linkedin/ i have moved after_sign_in_path omniauth callbacks controller application controller, can extend it. my current attempt in application controller is: def after_sign_in_path_for(resource) if !resource.email_verified? finish_signup_path(resource) elsif params[:redirect_to].present? store_location_for(resource, params[:redirect_to]) elsif request.referer == new_session_url profile_path(resource.profile) # or whatever route destination want else store_location_for(resource) || request.referer || root_path end end when try this, error: argumenterror in users::omniauthcallbackscontroller#linkedin wrong number of arguments (0 1+) it highlights line of above method: elsif request.referer == new_session_url i don't know error message means.

java - Android IDE issue arises when I try to move layouts within tabHost -

so i'm working on app, trying work on multiple layouts within tabhost. when try reorder layouts within tabhost creates ide error, , fails render. experienced java, first attempt @ working android studio. here's error execute command activetool: com.intellij.designer.designsurface.tools.selectiontool@3e7bfc0b sdk: android 6.0 - api 23 java.lang.arrayindexoutofboundsexception: 0 @ com.intellij.android.designer.model.radviewcomponent.updatetag(radviewcomponent.java:105) @ com.intellij.android.designer.model.radviewcomponent.updatetag(radviewcomponent.java:105) @ com.intellij.android.designer.model.radcomponentoperations$1.run(radcomponentoperations.java:96) @ com.intellij.openapi.application.impl.applicationimpl.runwriteaction(applicationimpl.java:931) @ com.intellij.android.designer.model.radcomponentoperations.movecomponent(radcomponentoperations.java:80) @ com.intellij.android.designer.designsurface.abstracteditoperation.execute(abstracteditoperation.java:49) @ com.inte

html - How to apply this sidebar to all pages using CSS? -

i have 4 different html web pages. html code below menubar want apply 4 pages. there way can using css instead of copying/pasting menubar html code on 4 of html web pages? 4 pages home, news, contact, about. whenever clicks on menubar item, redirect them 1 of 4 pages. , on 4 of pages, want menubar displayed. want create css file can link 4 pages , menubar displayed (code below). in advance! is there way can create css file @ least takes care of styling? , manually add menubar buttons each html page? <!doctype html> <html> <head> <style> body { margin: 0; } ul { list-style-type: none; margin: 0; padding: 0; width: 25%; background-color: #f1f1f1; position: fixed; height: 100%; overflow: auto; } li { display: block; color: #000; padding: 8px 0 8px 16px; text-decoration: none; } li a.active { background-color: #4caf50; color: white; } li a:hover:not(.active) { background-color: #555; col

java - how to remove space between jtextfield, jbutton and raisedbevel border -

i wants remove blank space or border space between jbutton , jtextfield added inside raisedbevel border tried code still gap between them import java.awt.*; import javax.swing.*; import javax.swing.border.border; public class main { public static void main(string args[]) { jframe f = new jframe("jpasswordfield "); f.setdefaultcloseoperation(jframe.exit_on_close); jpanel p=new jpanel(),pp=new jpanel(); jbutton b=new jbutton("o"); b.setborder(null); b.setborderpainted(false); b.setmargin(new insets(0,0,0,0)); border emptyborder = borderfactory.createemptyborder(); b.setborder(emptyborder); border raisedbevel=borderfactory.createraisedbevelborder(); pp.setborder(raisedbevel); jtextfield t=new jtextfield(20); t .setborder(javax.swing.borderfactory.createemptyborder()); t.setpreferredsize(new dimension(100, 25)); b.setpreferredsize(new dimension(25, 25)); pp.setbackground(color.black); pp.add(t);

Connect impala with odbc and php pdo, string fields are empty -

when use odbc only, run successfully $dsn = "dsn=dingdongimpala;host=172.168.1.100;port=21050;database=mmdb;"; $user = ''; $password = ''; $conn = odbc_connect($dsn, $user, $password); $result = odbc_exec($conn, "select succount,failedcount,appid t_mm_acc_date limit 1"); while($row = odbc_fetch_array($result)) { print_r($row); } the result is: array ( [succount] => 0 //int [failedcount] => 1 //int [appid] => 202361 //string ) but when use pdo access odbc, string type fields empty $dsn = "odbc:dsn=dingdongimpala;host=172.168.1.100;port=21050;database=mmdb;"; $user = ''; $password = ''; $cnx = new pdo($dsn, $user, $password); $result = $cnx->query("select succount,failedcount,appid t_mm_acc_date limit 1"); print_r($result->fetchobject()); the result is: stdclass object ( [succount] => 100 //int [failedcount] => 0 //int

.net - PictureBox image appears differently on different computers -

Image
what see: what customer sees: the images different sizes due different resolutions @ time screenshots taken. issue see logo cutoff text , button. i have tried many different resolutions on computer , image looks correct. has tried many different resolutions on computer , image cutoff. designer code: me.picturebox1.image = ctype(resources.getobject("picturebox1.image"), system.drawing.image) me.picturebox1.location = new system.drawing.point(12, 12) me.picturebox1.name = "picturebox1" me.picturebox1.size = new system.drawing.size(96, 56) me.picturebox1.sizemode = system.windows.forms.pictureboxsizemode.autosize me.picturebox1.tabindex = 0 me.picturebox1.tabstop = false it looks os text scaling set 125% or 150% on computer. affects layout of forms.