Posts

codeigniter - Unable to access an error message corresponding to your field name captcha.(captchacheck) -

i ve used solution found here http://www.mahbubblog.com/php/form-validation-callbacks-in-hmvc-in-codeigniter/comment-page-2/#comment-5996 . , working on ci 3.0 on mac, when tried deploying site ubuntu server produces "unable access error message corresponding field name captcha.(captchacheck)". please help... thanks function index(){ $this->load->library('form_validation'); $this->form_validation->set_rules('username', 'user name', 'trim|required|min_length[4]|xss_clean'); $this->form_validation->set_rules('firstname', 'first name', 'trim|required|min_length[4]|xss_clean'); $this->form_validation->set_rules('lastname', 'last name', 'trim|required|min_length[4]|xss_clean'); $this->form_validation->set_rules('email', 'your email', 'trim|required|valid_email'); $this->form_validation->set_rules('password', 'pa...

java - unable to render image in pdf :grails -

below code- applicationtaglib applicationtaglib = new applicationtaglib() string html = applicationtaglib.include(controller: 'survey', action: 'pdf', params: [id: id]) html = html.replaceall('&', '&') html = html.replaceall('&#', '&#') html = html.replaceall(' ', ' ') bytearrayoutputstream baos = new bytearrayoutputstream(); string baseurl = "http://localhost:8080/" itextrenderer renderer = new itextrenderer(); renderer.setdocumentfromstring(content); renderer.layout(); renderer.createpdf(baos); byte[] data = baos.tobytearray(); response.setheader("content-disposition", "attachment;filename=report.pdf") response.setcontenttype("application/pdf") outputstream out = response.getoutputstream(); out.write(data); out.flush(); out.close() in pdf action of survey contrller- ...

Sort the list without changing order in scala -

val = list((2,5,1),(3,8,4), (5,4,3) ,(9,1,2)) i want output different list in sorted order based on middle element of each tuple in list , first & third tuple's order should not changed. swapping second tuple only. expected answer is: list((2,1,1), (3,4,4) , (5,5,3), (9,8,2)) as shown below, can sort 2nd items separately , zip them together a.zip(a.map(_._2).sorted).map{ case((a,b,c), sortedb) => (a,sortedb,c)} // res = list((2,1,1), (3,4,4), (5,5,3), (9,8,2))

node.js - Selecting Subdocument array list only in mongoose -

my group collection goes this [ { "_id": "55fdbaa7457aa1b9bd7f7cf7", "group_name":"tango charli", "group_desc":"this group chatting", "group_admins": [ { "_id": "55ff7fca8d3f6607114dc57d", "user_id": "55ff7fca8d3f7607114dc57e", "name": "james", }, { "_id": "55ff7fca8d3f6607114dc57d", "user_id": "55ff7fca8d3f7607114dc57e", "name": "james", } ] }, { "_id": "55fdbaa7457aa1b9bd7f8de8", "group_name":"love zone", "group_desc":"this group making love , chatting", "group_admins": [ { "_id": "55ff7fca8d3f6607114dc57d", "user_id": ...

taking the sum of a TRUE/FALSE vector in r -

i working analyzing snp data fungus, , trying impute missing data changing ns genotype of more frequent allele....see below. newdata matrix of snps (rows)and fungal isolates(columns). genotypes each snp in 0, 1, , n format, , why trying impute missing genotypes. newdata_imputed=newdata (k in 1:nrow(newdata)){ u=newdata[k,] x<-sum(u==0) y<-sum(u==1) all_freq=y/(x+y) if (all_freq<0.5){ newdata_imputed[k,]=gsub("n",0,u) } else{newdata_imputed[k,]=gsub("n",1,u)} print(k) } however, keep getting error: [1] 295 [1] 296 error in if (all_freq < 0.5) { : missing value true/false needed it obvious code runs stops after encountering problem. please, can tell me doing wrong? newbie r, , advice appreciated. @akrun, reason why used loop because nested in loop..so after using code. newdata=as.data.frame(newdata) u=newdata all_freq <- rowsums(u==1)/rowsums((u==1)|(u==0)) indx <- all_freq < 0.5 indx1 <- indx & !is.na(indx) indx2 <- !i...

c++ - How to disable automatic mnemonics in a Qt application on KDE? -

in qt application on kde when add qpushbutton in designer , check it's text by: void mainwindow::on_pushbutton_clicked() { qdebug()<<ui->pushbutton->text(); } the output preceded & : &pushbutton this behavior not exist on windows. seems qt applications on kde automatically add shortcuts push buttons, not desired me. should note ampersands not created designer , can not see them in the .ui file. when button added widget, & placed somewhere in it's text. is possible disable automatic mnemonics of qt application in anyway? kdeplatformtheme plugin responsible it. a workaround add [development] autocheckaccelerators=false to ~/.config/kdeglobals , prevents kde automatically adding accelerators. related bug: https://bugs.kde.org/show_bug.cgi?id=337491

javascript - 'Log is not defined' error in fb share -

iam trying share page of website in facebook , iam using function share: var publish = { method: 'feed', message: 'getting educated facebook connect', name: 'connect', caption: 'the facebook connect javascript sdk', description: ( 'a small javascript library allows harness ' + 'the power of facebook, bringing user\'s identity, ' + 'social graph , distribution power site.' ), link: 'http://fbrell.com/', picture: 'http://fbrell.com/f8.jpg', actions: [ { name: 'fbrell', link: 'http://fbrell.com/' } ], user_message_prompt: 'share thoughts rell' }; fb.ui(publish, log.info.bind('feed call...