Posts

javascript - Modal mostly keeps quiting immediatly -

i trying include modal in code. when clicking button/href, different file should shown in modal. took code here . now, after loading animation (or after few ms) modal closes. weird part when press button few times, work , file shown. here code (the relevant part): // modal var modal = document.getelementbyid('mymodal'); // button opens modal var btn = document.getelementbyid("mybtn"); // <span> element closes modal var span = document.getelementsbyclassname("close")[0]; // when user clicks on button, open modal btn.onclick = function() { modal.style.display = "flex"; }; // when user clicks on <span> (x), close modal span.onclick = function() { modal.style.display = "none"; }; // when user clicks anywhere outside of modal, close window.onclick = function(event) { if (event.target == modal) { modal.style.display = "none"; } }; /* modal (background) */...

javascript - how to give "same as the above" in form entries -

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> <form method="post" class="form-group"> <label>first name</label><input type="text" name="fname" class="form-control"> <label>last name</label><input type="text" name="lname" class="form-control"><br> <label>i ready</label><input type="checkbox" name="ch"><br><br> <label>address</label><input type="text" name="address" class="form-control"> </form><br><br> <form method="post" class="form-group"> <label>same above</label><input type="checkbox" name="chd"><br><br> <label>first name</label><input type="t...

security - How secure is PHP session_start $_SESSION value as login verification? -

if user logs in , passes security checks (username, password, 2fa... whatever) , hypothetical php login system like: session_start(); $_session['logged_in_userid'] = 1; how safe rely on existence of $_session value 'logged_in_userid' proof person did pass full security check? not very, i'm thinking. if xss determine phpsessid, , manually add own local cookies. not going automatically assumed logged in when visit same system? if - resolution record, @ login time, in _session the: remote_addr, http_user_agent , x_forwarded_for , compare @ each request time not _session logged_in_userid _session remote_addr etc etc found in current _server vars? or flawed also? it secure but need stuff make sure can't 'hijack' session xss example mentioned: static protected function preventhijacking() { if(!isset($_session['ipaddress']) || !isset($_session['useragent'])) return false; if ($_session['ipaddress...

php - Billing form - Request for more information if entered data match with a number -

can me? i'm trying create billing info form, , if customer enter example 5120293213632438 i'll use 'substr' first 6 numbers, if 6 numbers match 512029 , 537030 , 432049 , etc... i'll request more info -> vat number , id. <form action="validate.php" method="post"> <p>credit card number : <input type="text" name="cc" /></p> <p><input type="submit" value="next"></p> </form> validate.php <?php $vbv = substr($_post['cc'], 6); if($vbv == '512029') $flag = strstr($bin, $needle); echo "ok"; else echo "i'm not vbv"; ?> <?php ini_set('display_errors', 1); $array=array(512029, 537030, 432049); //array of start 6 digits want match $cc='5120293213632438';//credit card no's want match. if(in_array(substr($cc, 0,6),$array)) { echo "first 6 digit matched...

visual c++ - While creating private pool WinBioOpenSession() is failing and returning WINBIO_E_CONFIGURATION_FAILURE -

i'm creating bio metric project in visual studio 2008 using mfc application in vc++ i'm getting following difficulties. please help i'm trying create private pool using winbioopensession() method function returning winbio_e_configuration_failure should do? bool cprivatepoolbiodlg::enrollfingerprint() { winbio_unit_schema *unitschemaarray = null; size_t unitschemacount = 0; winbio_unit_id unitidarray[1]={}; size_t unitidcount = arraysize(unitidarray); winbio_session_handle sessionhandle; hresult hr; // = s_ok; //enumarating devices... hr = winbioenumbiometricunits(winbio_type_fingerprint,&unitschemaarray,&unitschemacount); if(failed(hr)) { cstring m; m.format(_t("unable enumarate device 0x%08x"),hr); afxmessagebox(m); return 0; } //enumaration success... unitidarray[0] = unitschemaarray[0].unitid; //opening session... hr = winbioopensession(winbio_type_fingerprin...

nlp - Wapiti/CRF++ dataset format -

to on safe side , see fruits of hard work, features of data needs correctly formatted? i have dataset , template , manually tagged ner. as far training crf++ concerned, testing generated model yields 0% correct results. results same using wapiti. question, should template file modified? or imperative add pos tags in training dataset well. additionally, if model should discount word casing while labeling, should training dataset reflect in entirety, lower casing enforced. not affect sentences derive meaning uppercasing. bit unclear in respect. ps - targeting model like, http://cliff.mediameter.org/ , ner labeled irrespective of casing. can't use model. the training data small ( hardly 47 sentences ) , format incorrect because sentences end empty lines, yours end space-tab-space, might make crf++ learn whole file single sentence. try http://paste.ubuntu.com/24537692/ also, share test data?

NGinx: set localhost/project to project git folder -

i working on small website in free time. development, keep git repositories in ~/git. possible configurate nginx if go localhost/a or localhost/b, use ~/git/a , ~/git/b respectively? i using fedora , tried single repo, keep getting 404: /etc/nginx/nginx.conf user nginx; worker_processes auto; error_log /var/log/nginx/error.log; pid /run/nginx.pid; events { worker_connections 1024; } http { log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; include /etc/nginx/mime.types; default_type application/octet-stream; server { li...