Posts

html - Javascript that validates user entries and then displays any error via pop up box for option forms? -

im having difficult time trying create javascript file validate sample form options , quantities. im trying when person fills out form , theres error, want pop why. if good, typical display summary of items ordered, numbers of each item, cost of each item , total cost. so in short, if customer orders something, want display show ordered , how total tax. <!doctype html public "-//w3c//dtd xhtml 1.1//en" "http://www.w3.org/tr/xhtml11/dtd/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>products & services</title> </head> <body> <h1>pc products</h1> <form action="" name="products" method="post"> <table summary="feedback"> <tr> <td>processors: <select name="product1"> <option>select device</option> <option...

javascript - Google Timeline memory-leak when redrawing chart -

here chart https://jsfiddle.net/damiantt/t2skaegg/2/ <script type="text/javascript" src="//www.google.com/jsapi"></script> <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script> <input id="draw" type="button" value="draw" onclick="drawchart();" /> <div id="chart_div_container" style="overflow-x: auto;min-height:0%;"> <div id="chart_div" style="overflow: visible;min-height:0%;"></div> </div> <script type="text/javascript"> google.charts.load('current', { 'packages': ['timeline', 'table'] }); var initwidth = $('#chart_div').innerwidth(); var colormap; function drawchart() { $('#chart_div').off...

php - Why am I rendering HTML code? -

i doing small project in php using notepad++, using xampp , rendering fine until did php include above tag. before rendering before render , showing entirely html code after render . here code - <?php include 'database.php'; ?> <!doctype html> <html> <head> <meta charset="utf-8"> <title>shout !</title> <link rel="stylesheet" href="css/style.css" type="text/css"/> </head> <body> <div id="container"> <header> <h1>shout it! shoutbox</h1> </header> <div id="shouts"> <ul> <li class="shout"><span>10:15pm - </span>brad : hey guys to.</li> <li class="shout"><span>10:15pm - </span>brad : hey guys to.<...

excel - Euro symbol not showing (VBA) -

i'm trying write if statement checks input (a currency) , assigns correct symbol dollar amount. code below, every currency works except euro, works if dollar amount letters, , not numbers. missing obvious? if note_currency = "" note_denomination = "$" + note_denomination elseif note_currency = "eur" note_denomination = "€" + note_denomination elseif note_currency = "jpy" note_denomination = "¥" + note_denomination elseif note_currency = "gbp" note_denomination = "£" + note_denomination else note_denomination = "$" + note_denomination end if okay figured out - kind of. tried sub in excel , same thing happens me. using symbol , chr(128) shows blank cell. what found worked if know range have these numbers, change cell's format type text ( @ ): range("a1:a100").numberformat = "@" then, when run code, euro symbol shows if use note_...

c++ - Constructing a pair with an rvalue -

in this: vector<pair<string,int>> vp; string s; int i; while(cin>>s>>i) vp.push_back({s,i}); i'm curious last line. pair constructed in call push_back , therefore moved, not copied, correct? if had instead been written this: vector<pair<string,int>> vp; string s= ...; int i= ...; pair<string,int> p{s,i}; vp.push_back(p); while construction of pair involves same resources, pair named, p , therefore no longer rvalue , therefore move semantics no longer used, , therefore pass value, causing copy made, right? this implies me possible, constructing objects inside arg lists performance improvement; can verify? the pair constructed in call push_back , therefore moved, not copied, correct? the temporary pair constructed , bound rvalue reference argument of push_back . moved argument vector . vp.push_back({s,i}); is equivalent to: vp.push_back(std::pair<std::string, int>{...

Log user IP with PHP -

currently i'm using script log users ip adresses: $userip = $_server['remote_addr']; however, after bought anti-ddos http proxy, returns proxy ip instead. $_server['remote_addr'] -> 198.12.12.102 i'm using cloudflare proxy, i've entered proxy's ip inside ip field in cloudflare , selected 'bypass cloudflare network'. well, yes, if request proxied, php sees proxy's address. in case, and in case , should @ alternative http headers. proxy may, should , add original ip address http header, x-forwarded-for , available in $_server['http_x_forwarded_for'] . usually it's security risk pay attention these headers; if know your proxy you control explicitly adds header on your behalf should use it.

c# - PdfArray.remove() is not removing all annotations -

i want remove annotations pdf. i'm using code: void removeannotations(string inputpath,string outputpath) { pdfreader pdfreader = new pdfreader(inputpath); pdfstamper pdfstamper = new pdfstamper(pdfreader, new filestream(outputpath, filemode.create)); pdfdictionary pagedict = pdfreader.getpagen(1); pdfarray annotarray = pagedict.getasarray(pdfname.annots); (int = 0; < annotarray.size; i++) { annotarray.remove(i); } pdfstamper.close(); } when first create annotarray , has 217 items. after for-loop of annotarray.remove() , has 108 items, , can still see callouts , lines on pdf generated @ outputpath . it's not clear me remaining items have in common, why skipped annotarray.remove() . how can remove every annotation? suppose have 10 elements in array: array = [a, b, c, d, e, f, g, h, i, j] you loop on array this: for (int ...