Posts

Toolbar elements cutting due to 150% DPI - MFC C++ -

Image
the mfc application looks weird 150% dpi settings on windows 7. when display settings on windows 7 changed 150% following things happen: toolbar gets expanded lot making menu items invisible. in addition, black gap get's introduced between toolbar , application frame (as shown in new) the app used work fine while ago (as shown in old). many changes have been introduced app including integration of devexpress. nothing particularly changed in dpi settings. need in understanding why change might have occurred. , how rid of unwanted zoom effect / dpi effect.

java - How to add together elements of an Array List -

so i'm trying make cash register program takes in array of integer prices , adds them total sale price. here's snippet of code that's important do { system.out.print("enter integer price: $ "); int = in.nextint(); prices.add(i); system.out.println(); } while(in.hasnextint()); for(int i=0; i<prices.size(); i++) { int total = prices.get(i) + prices.get(i+1); } system.out.println(total); my error says "total cannot resolved variable" , earlier didn't when tried make increment in loop i+2 instead of i++. can have no idea how add these variables is right track? for(int i=0; i<prices.size(); i++) { int total = 0; int total = total + prices.get(i); } you're doing 2 things wrong here: int total = prices.get(i) + prices.get(i+1); you're declaring total inside for loop. outside default value of 0 . adding values of current iteration , next iteration. want total = total + prices.get(i); or total += prices...

emulation - emulate right click when you click -

right clicking mouse brings several choices, 1 being "open link in new window" now, enter code when left-clicks on link, emulates right click option mentioned. i've looked everywhere... is possible? thank you the attribute _target="blank" open in new tab or window. <a href="http://google.com" target="_blank">my link</a>

java - javaFX - resizing TextArea/other UI controls with main application window -

in javafx application need update handle window resizing. want when window gets bigger keep aligned same , have textarea grow proportionate window , similar when making smaller. i set min , max height fit buttons on right-hand side (decreasing spacing little gets smaller). i'm figuring out anchorpane not best option , hoping little guidance on better approach. text area using custom, extending styledtextarea (richtextfx api). last spec want text field , button under text aligned text area , think pane make distance between textfield , button cumbersome approach (i planning on not making resizable). image reference : text app image any appreciated. if makes difference, entire layout inside borderpane center. <?xml version="1.0" encoding="utf-8"?> <?import java.lang.*?> <?import javafx.geometry.*?> <?import javafx.scene.control.*?> <?import javafx.scene.layout.*?> <?import javafx.scene.layout.anchorpane?> <?i...

mysql - SQL c# determining type of sql server -

does know of way, programmatically, determine if sql server mysql or mssql installation? i've got app in c# has able connect either mysql or mssql. can connect either if know is, can't tell connection settings because server name, userid, password, , database name. i can have settings file store type of server, opens avenue user error i'd avoid. try connect mysql , if fails, handle error gracefully try connect mssql. loosely similar might work ... string finddbtype(string connectionstring) { try { // try connect mysql return "mysql"; } catch() { try { // try connect mssql return "mssql"; } catch() { return "cannot determine db type" } } } you want handle errors incorrect password separately, should started.

php - Get a value from object -

my query return stdclass of objects how can value of - affected_rows - object ( [affected_rows] => 0 [connect_errno] => 0 [connect_error] => [errno] => 0 [error] => [error_list] => array ( ) [field_count] => 0 [host_info] => localhost [stat] => uptime: 261195 threads: 5 questions: 14167 slow queries: 0 opens: 2969 flush tables: 1 open tables: 191 queries per second avg: 0.054 [thread_id] => 1593 [warning_count] => 0 ) [result:protected] => mysqli i tried pass objects array dont works thanks properties of object accessed -> var_dump($object->affected_rows);

parallel processing - Is there a constant-time algorithm for generating a bandlimited sawtooth? -

Image
i'm looking feasibility of gpu synthesized audio, each thread renders sample. puts interesting restrictions on algorithms can used - algorithm refers previous set of samples cannot implemented in fashion. filtering 1 of algorithms. bandpass, lowpass, or highpass - of them require looking last few samples generated in order compute result. can't done because samples haven't been generated yet. this makes synthesizing bandlimited waveforms difficult. 1 approach additive synthesis of partials using fourier series. however, runs @ o(n) time, , slow on gpu point gain of parallelism lost. if there algorithm ran @ o(1) time, eliminate branching , 1000x faster when dealing audible range. i'm looking dsf sawtooth. i've been trying work out simplification of fourier series hand, that's really, hard. because involves harmonic numbers, aka singularity of riemann-zeta function. is constant-time algorithm achievable? if not, can proven isn't? ...