Posts

javascript - Removing everything except numbers in a string -

i've made small calculator in javascript users enter interest rate , amount want borrow, , calculates how of incentive might get. the problem i'm worried users enter symbols, e.g. loan amount: £360,000 - interest rate: 4.6% i'm not worried decimal places these needed , don't seem affect calculation, it's symbols £ , % mess things up. is there simple way strip out these symbols code: <td><input type="text" name="loan_amt" style="background-color:#fff380;"></td> <td><input type="text" name="interest_rate" style="background-color:#fff380;"></td> function calculate() { var loan_amt = document.getelementbyid('loan_amt').value; //this how loan amount entered var interest_rate = document.getelementbyid('interest_rate').value; //this how interest rate alert (interest_rate); } note should use correct dom id refer ...

ajax - Force jQuery / Javascript to wait for php script to load -

i'm having trouble making ajax request wait php script load, script works in chrome not ie in both instances. on button press script should fire php script wait complete display alert has complete in ie alert box displays , script never runs. work in chrome expected. this attempt 1 function reloadcalls(){ $('#reload').prop('disabled', true); $('.ajax-progress-throbber').show(); $.ajax({ url: '/kpi/technet_proj/cron/proj_cron.php', success: function(r){ alert('calls loaded'); location.reload(); }, error: function(r){ alert('calls not loaded'); } }); } this attempt 2 function reloadcalls(){ $('#reload').prop('disabled', true); $('.ajax-progress-throbber').show(); $.ajax({ url: '/kpi/technet_proj/cron/proj_cron.php', success: function(){ alerts(); }, error: function(){ ale...

oracle - Exception in thread "main" java.sql.SQLException: Missing defines -

have done below sample jdbc program retrieving user details.now getting surprised same callable statement getting different result set same output parameter index.ideally should return same resultset object. when got resultset moving cursor -1 0. i retrieving data resultset same output param using column name getting following exception , exception in thread "main" java.sql.sqlexception: missing defines system.out.println("before loading connection"); drivermanager.registerdriver(new oracle.jdbc.oracledriver()); connection connection = drivermanager.getconnection( "jdbc:oracle:thin:@170.45.3.165:1541/testdb.mycomp.com", "admin", "admin123"); system.out.println("connection loaded " + connection); callablestatement callprocedure = connection .preparecall("{call admin_user.fetch_user_details(?,?)}"); callprocedure.setstring(1, "userid=te...

c++ - Data conversion for ARM platform (from x86/x64) -

we have developed win32 application x86 , x64 platform. want use same application on arm platform. endianness vary arm platform i.e. arm platform uses big endian format in general. want handle in our application our device. for e.g. // in x86/x64, int nintval = 0x12345678 in arm, int nintval = 0x78563412 how values stored following data types in arm? double char array i.e. char chbuffer[256] int64 please clarify this. regards, raphel endianess matters register <-> memory operations. in register there no endianess. if put int nintval = 0x12345678 in code have same effect on endianess machine. all ieee formats ( float , double ) identical in architectures, not matter. you have care endianess in 2 cases: a) write integers files have transferable between 2 architectures. solution: use hton*, ntoh* family of converters, use non-binary file format (e.g. xml) or standardised file format (e.g. sqlite). b) cast integer pointers. int = 0x18758...

css - Div clearfix remove white space -

Image
my website has header , menubar. i'd position them horizontally sticked each other this: header menu but happens is: header white space menu the code header: <div id="headersecure" class="clearfix"> <div class="headeritem"><a href="#">uitloggen</a></div> <div class="headeritem"><a href="#" onclick="loadx()">x</a></div> <div class="headeritem headerfoto"><a href="#" onclick="loadx(()">test</a></div> <div class="headeritem"><a href="#" onclick="loadq()">w</a></div> <div class="headeritem"><a href="#" onclick="loadqc()">contact</a></div> </div> the header css code: #headersecure { padding-left: 10%; ...

plot area width and height in HighCharts -

how can read width , height of plot area in highcharts chart? don't mean width , height of whole chart, of plot area, excludes x , y axes labels , borders. use chart.plotwidth , chart.plotheight .

html - How to stop images from showing the "blank document" icon while they are loading? -

Image
i have bunch of server-side generated images following html tags: <img width="75" height="75" src="/mycontroller/myaction/_ac=4d04359f-0d66-45d3-881c-b198e95a8215" data-idx="1"> the problem images show default "blank document" (or "missing image") icon , border while loading. looks this: after images loaded, icon of course disappears, , broder gets set 1 specified in css. i don't want create fancy preloaders , not, make "blank document" icon , default border go away. although user sees less second, still that's not because creates impression wrong images. how make icon not show while images being loaded? one idea set background images, cannot because images have transparent areas, , parts of background visible after image has been loaded. update workaround i noticed if not specify width , height, default missing icon , border not shown while image loading. workaround did following:...