Posts

c - redefinition; previous definition was 'typedef' error -

i got following error: error c2365: 'decimal' : redefinition; previous definition 'typedef' for following definition in header file: enum data_type {decimal, hexa, string}; i understood error occur duplicate definitions, there isn't known defintion that, , there aren't including files in header file. which other reasons can cause error? somewhere in included header files, or files include ad infinitum, there definition of decimal typedef. do not go looking it! well, if want aren't going able it. rename enum sensible dt_decimal. if want keep using decimal , avoid error there 2 strategies. 1 use namespaces, put names different namespace other pesky definition. the other (old school) way use masking macro definition.

c++ - Difference between Copy Constructor and Assigment Operator -

this question has answer here: what's difference between assignment operator , copy constructor? 8 answers i'm having little trouble copy constructor. i have class, contains 2 structures, , 2 pointers first structure ( let's i'm having linked list of first structure, , each contains linked list of second structure ). seem work fine. ... when make instance of class using copy constructor ( deep copy, every element copied, each instance has it's own linked lists ) using myclass a,b; // operations b ( ); it works ok. then... myclass a,b; // operations b = a; also seems work, destructor goes amok, , tries free element multiple times, sending this: * error in `./a.out': double free or corruption (!prev): 0x000000000258a540 * along ==backtrace== , ==memory map==, ending killing program sigabrt signal. so, when copy constructor work...

r - Error in xy.coords(x, y, xlabel, ylabel, log) -

i getting error following execution : library(adegenet) library(ape) dat <- haplogen(seq.l=1e4, repro=function(){sample(1:4,1)}, gen.time=1, t.max=3) plot(dat, main="simulated data") #error in xy.coords(x, y, xlabel, ylabel, log) : # 'x' list, not have components 'x' , 'y' #calls: plot -> plot -> plot.default -> xy.coords same code works in rweb online !! i think problem package. tried updating package , following error. ** preparing package lazy loading error : object ‘renderprint’ not exported 'namespace:shiny' error: lazy loading failed package ‘adegenet’ * removing ‘~/r/x86_64-pc-linux-gnu-library/2.14/adegenet’ * restoring previous ‘~/r/x86_64-pc-linux-gnu-library/2.14/adegenet’ warning in install.packages : installation of package ‘adegenet’ had non-zero exit status also have similar problems other plots same packages loaded. code: dat <- haplogen(seq.l=1e4, repro=function(){sample(1:4,1)}, gen.time=1, t...

javascript - How to assign speed parameter to callback functions -

i've been trying figure out how assign speed callback function, couldn't. in program. html: <button type="button" id="trigger">try</button> <div id="box"></div> <div id="bottom"></div> css: body { position: absolute; background-color: white; height: 1000%; } #box { position: absolute; height: 300px; width: 400px; top: 100px; left: 0px; margin: 0px; padding: 0px; border-color: black; background-color: black; opacity: 0; } #bottom { position: absolute; bottom: 0px; height: 100px; width: 100%; background-color: black; } js: $(document).ready(function () { $("#trigger").click(function () { var ele = document.getelementbyid('bottom'); var pos = ele.getboundingclientrect(); var x = pos.left; var y = pos.top; $("#box").animate({ left: "100px", opacity: "1" }, "slow...

php - Sef URL CSS Problems -

i try create search engine friendly urls this;: rewriterule ^m/([0-9]+)$ my.php?id=$1 however, gets page without css. if write this: rewriterule ^([0-9]+)$ my.php?id=$1 it gets page css without problem. how can solve it? when write css references this: <link rel="stylesheet" type="text/css" href="style.css"> it's relative url. on http://example.com/ , points http://example.com/style.css , on http://example.com/my/1 points http://example.com/my/style.css , doesn't exist. using absolute url fixes this: <link rel="stylesheet" type="text/css" href="/style.css">

c - How the expression evaluates? -

this question has answer here: evaluation of c expression 8 answers why isn't “k” incremented in statement “m = ++i && ++j || ++k” when “++i&&++j” evaluates true? [duplicate] 5 answers can 1 draw precedence tree expression , please explain side effects..values after expression evaluation in c. int i=-3, j=2, k=0, m; m= ++i || ++j&&++k; according me output should -2 3 1 1 gnu c compiler printing -2 2 0 1? want know how? because j won't evaluated due short circuit evaluation : m= ++i || ++j && ++k; ↑ at stage, m evaluated 1 regardless of right side of || . why? because 1 || anything 1.

vb.net - Entity Framework 6 Linq results for master-detail -

i'm trying create master-detail model using following tables: orders ordid date custid ======================================== 1 01.01.2014 1 2 02.02.2014 2 3 03.03.2014 2 4 01.01.2014 4 orderdetails id ordid prodid quantity ======================================== 1 1 1 2 2 1 2 1 3 2 3 3 4 2 4 5 now want have orders datagridview , orderdetails datagridview. orders dgv should this: orders ordid date customer status ============================================ 1 01.01.2014 custone 100% 2 02.02.2014 custtwo 62.5% and details dgv (filtered on selected order): orderdetails id prod quantity status ====================================== 1 prodone 2 100% 2 prodtwo 1 100% 3 prodthree 3 0% 4 prodfour 5 100% lets statu...