Posts

ajax - function has stopped working once bootstrap was added to file -

i have hash_gen function passes hash number post next file. function set in operation once submit button pressed delivering text var called parm_x . that function called with: <input style="display:none;" name="parm_x" id="hash_gen"> after submit button. function is: function hash_gen() { var url = "hash_gen.php"; new ajax(url, { method: 'post', oncomplete: function(response) { $("hash_gen").value = response; } }).request(); } hash_gen(); hash_gen.php works fine. the function has stopped giving value once bootstrap elements , validator elements added. where problem? thanks the default syntax id selector $("#id") . $("#hash_gen").value = response;

linux - Passing hex to bash command in C -

i'm trying port bash script c. i'm having trouble passing hex string bash command. have far. char buffer[512]; char mp_fmt[] = "\x00\x00\x00\x00\x00\x09\x01\x10\x00\x00\x00\x01\02\x00\x01"; sprintf(buffer,"echo -e \"\x00\x00\x00\x00\x00\x09\x01\x10\x00\x00\x00\x01\02\x00\x01\" | nc 192.168.01.22 500"); //sprintf(buffer,"echo -e \"%s\" | nc 192.168.01.22 500"); system((char *)buffer); when run this, compiler returns test.c:7:5: warning: embedded ‘\0’ in format [-wformat-contains-nul] sprintf(buffer,"echo \"\x00\x00\x00\x00\x00\x09\x01\x10\x00\x00\x00\x01\02\x00\x01\" | nc 192.168.01.22 500"); but when run other sprintf that's commented out, doesn't complain not working because device isn't responding. also in bash script, how done , response device. echo -e "\0\0\0\0\0\x9\x1\x10\0\0\0\01\02\0\x01" | nc 192.168.01.22 500 thanks reading long post. doin...

javascript - Add a number only when a radio button is selected -

i want add number total amount based on radio button select if user selects radio button value = "serfeeadd" need check it, , add total can't figure out why not working when remove scope = this , use $scope directly kinda works, need value assigned variable. i trying build magento wristband designer app built stuck part . the code has been modified provide guys overview more can let me know. var app = angular.module('wdwristbanddesigner', []); app.controller("fontctrl", maincontroller); function maincontroller($scope){ //scope var scope = this; scope.foo = function(){ if (scope.serialisationfeecheck == 'serfeeadd') { scope.serialisationfee = 10; console.log(scope.serialisationfeecheck); } else { scope.serialisationfee = 0; }; } }; <section class="wd-section" ng-controller="fontctrl fs"> <input type="radio" name="serialno"...

html - How to trigger click event using JavaScript on querySelectorAll -

this question has answer here: what queryselectorall, getelementsbyclassname , other getelementsby* methods return? 7 answers in jquery have following code $("li#credit").trigger('click'); this code triggers click event on li has id credit. now using javascript document.queryselectorall("li#credit").click(); i getting error: click() not function the page working have multiple elements id "credit", need trigger click event on <li> has id credit. queryselectorall returns nodelist object ( source ) , not dom element. nodelist object contains dom elements. your code needs change first element , call click() : document.queryselectorall("li#credit")[0].click(); if want trigger .click() event elements can for loop for(var = 0; i<elems.length; i++) { elems[i].click(); } ...

java - Two dimensional array- Session -

i have 2 dimensional matrix want add session . add integer session object syntax is session.setattribute("mat", mat); int matr = (integer) session.getattribute("mat"); searched lot syntax add int[][] session . firstly can add, if yes idea on how go forward it? try below 1 :- int[][] 2darr = new int[2][3]; session.setattribute("2darr", 2darr ); int[][] 2darrfromsession = (int[][]) session.getattribute("2darr");

javascript - do the opposite of a regex split -

i have string so: var string = "{{ \"foo {0}\" | i18n:[\"bar\"] }}"; what want values in quotes, can achieve regex /".*?"/ . but when sprint, doesn't return what's in quotes, outside of them. string.split(/".*?"/); returns [ '{{ ', ' | i18n }}' ] you'll need use .match you want capture things inside quotes, you'll add capturing expression. var exp = /"(.*?)"/; string.match(exp);

Appropriate place to store custom properties in Jenkins `config.xml` -

i'm programmatically generating jenkins config.xml job configuration files, , store/attach metadata xml dom, ignored jenkins, not removed or marked "obsolete data". simple key/value pairs, things client tool build date, user, etc. where in xml structure appropriate put such thing? i've tried putting under /project/properties branch, data gets culled server when post new job. or there plugin allow (i tried metadata plugin, overwrote sections)? update: spoke quickly! job config updates after post, gets pruned on next jenkins build. for still wondering this, able add custom properties under root <project> tag post'ing updated config.xml. looked this: <project> ... <mycustomtag> <customprop>foo</customprop> </mycustomtag> ... </project> i combined of custom properties under 1 custom tag separate them rest of config , avoid accidental name collisions regular config props. jenkins versio...