Posts

Showing posts from February, 2011

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...

excel - Put a fill color in a specific cell -

my program loops through each row of data in sheet. when errors, want put fill color on specific cell. is there way put fill color in cell without using range? on error goto stop 'doing exit sub stop: msgbox("error!") 'something fill cell sheets("data").cells(rowdata,1).color = red you can this cells(rowindex, columnindex).interior.color = rgb-code cells(rowindex, columnindex).interior.colorindex = indexno

php - How to run a curl script multiple times using windows command prompt -

i total novice @ scripting, , need in curl scripting. need access url multiple times using curl script in windows command prompt, need calling curl script multiple times. there way : (a) access url request multiple times using single curl script, (b) or way in command prompt call single curl script multiple times? to execute curl program 3 times, try... for /l %i in (1,1,3) your_curl_script the last number in (1,1,3) controls looping count. note: solution (b) option. put curl code inside batch file , call batch file x number of times. dos command line different, such: for /l %i in (1,1,3) your_batch_file

php - StrPos always returns False? -

i've been working on basic search engine. operates checking if word exists. if does, returns link. know of suggest create database phpmyadmin don't remember password make mysql_connect command work. anyway here code: <?php session_start(); $searchinput = $_post['search']; var_dump($inputpage1); var_dump($searchÄ°nput); $inputpage1 = $_session['ponetext']; $inputpage2 = isset($_session['ptwotext']) ? $_session['ptwotext'] : ""; $inputpage3 = isset($_session['pthreetext']) ? $_session['pthreetext'] : ""; if (strpos($inputpage1, $searchinput)) { echo "true"; } else { echo "false"; } ?> when search word, word page, weather exists or not, returns false. know why? from php documentation : warning: function may return boolean false, may return non-boolean value evaluates false. please read section on booleans more information. use === operator testing re...

javascript - Pass parameters to actionresult from jsonresult -

Image
i wrote code filter results following image , once after filter want send model values of following field parameters controller method, can call method once click generate report button this view file @model project_name.models.searchvm .... @using (html.beginform()) { @html.antiforgerytoken() @html.validationsummary(true, "", new { @class = "text-danger" }) .... <div class="row"> <div class="col-xs-6"> <div class="form-group"> @html.labelfor(m => m.type, htmlattributes: new { @class = "control-label col-md-2" }) <div class="col-md-10"> @html.dropdownlistfor(m => m.type, model.typelist, "select type", new { @class = "form-control" }) @html.validationmessagefor(model => model.type, "", new { @class = "text-danger" }) ...

java - Digest authentication in Android using HttpURLConnection -

as question allready says, trying digest authentication in android. until have used defaulthttpclient , it's authentication method (using usernamepasswordcredentials , on), deprecated since android 5 , removed in android 6. switch defaulthttpclient httpurlconnection . trying achieve digest authentication, should work pretty simple explained here : authenticator.setdefault(new authenticator() { protected passwordauthentication getpasswordauthentication() { return new passwordauthentication(username, password); } }); but getpasswordauthentication gets never called reason. during search problem found different posts, saying digest authentication not supported httpurlconnection in android, posts 2010-2012, not sure if still true. using httpurlconnection digest authentication in our desktop java application, work. i found posts, talking okhttp . okhttp seems used android under hood (to more specific httpurlconnectionimpl ). httpurlconnectionimpl bit...

sql - TSQL - extend query consisting of cross apply and pivot -

this question based on previous question . need extend query can incorporate 2 other tables (running on server instance). in fiddle added 2 tables: create table lookup ([docid] varchar(10), [doctype] varchar(100), [partnumber] varchar(100), [internalid] varchar(100)); insert lookup ([docid],[doctype],[partnumber], [internalid]) values ('d0305415', 'doctypesub', 'x0455', null), ('d0157632', 'doctypemain', null, 'xy05570-xy05571'), ('d0181511', 'doctypemain',null, 'xy05572-xy05573'), ('d0157633', 'doctypemain', null, 'xy06380-xy06381'), ('d0156037', 'doctypesub', 'x0326', null), ('d0151874', 'doctypemain', null, 'xy05345'); create table links ([docidtop] varchar(10), [docidbottom] varchar(10)); insert links ([docidtop],[docidbottom]) values ('d0157632', 'd0305415'), ('d0181511', 'd030541...

Understanding CPU pipeline stages vs. Instruction throughput -

i'm missing fundamental re. cpu pipelines: @ basic level, why instructions take differing numbers of clock cycles complete , how come instructions take 1 cycle in multi-stage cpu? besides obvious of "different instructions require different amount of work complete", hear me out... consider i7 approx 14 stage pipeline. takes 14 clock cycles complete run-through. afaik, should mean entire pipeline has latency of 14 clocks. yet isn't case. an xor completes in 1 cycle , has latency of 1 cycle, indicating doesn't go through 14 stages. bsr has latency of 3 cycles, throughput of 1 per cycle. aam has latency of 20 cycles (more stage count) , throughput of 8 (on ivy bridge). some instructions cannot issued every clock, yet take less 14 clocks complete. i know multiple execution units. don't understand how length of instructions in terms of latency , throughput relate number of pipline stages. i'm missing fundamental re. cpu pipelines: @ ba...

sql - How to calculate query result on the bases of percentage -

i want calculate query result on bases of percentage, set admin panel of website. there 4 status same. gold, silver,bronze , medellin. current formula select * , isnull( case when rownumber <= (@totaltoppromoters*@gold/100) 1 when rownumber >= (@totaltoppromoters*@gold/100) , rownumber <= (@totaltoppromoters*@gold/100) + (@totaltoppromoters*@silver/100) 2 when rownumber>=(@totaltoppromoters*@silver/100) , rownumber<= (@totaltoppromoters*@gold/100)+(@totaltoppromoters*@silver/100) + (@totaltoppromoters*@bronze/100)then 3 when rownumber>=(@totaltoppromoters*@medallion/100) , rownumber <= (@totaltoppromoters*@gold/100)+(@totaltoppromoters*@silver/100) + (@totaltoppromoters*@bronze/100)+(@totaltoppromoters*@medallion/100) 4 end ,0) trophytype can guide me on this?

java - spring-data-mongodb dose not map integer values properly -

spring-data-mongodb 1.7.2.release auto save integer double mongodb. document object mapping ok. when read documents java.util.map, integer values turned double values :( possible make spring-data-mongodb save integer integer(x) not double in mongodb. bug? something this: @document public class foo { private integer count; ... } foorepository.save(fooinstance); in mongodb document, field 'count' saved double not numberint(x) if using class representation, can specify how going used. so, in case if use jackson mapping document in mongo db , in class use values int value; mapped that.

javascript - Can I use multiple versions of jQuery on the same page? -

a project i'm working on requires use of jquery on customers' web pages. customers insert chunk of code we'll supply includes few <script> elements build widget in <script> -created <iframe> . if aren't using latest version of jquery, include (most likely) <script> google's hosted version of jquery. the problem customers may have older version of jquery installed. while may work if it's @ least recent version, our code rely on introduced functionality in jquery library, there bound instances when customer's jquery version old. can't require upgrade latest version of jquery. is there way load newer version of jquery use within context of our code, not interfere with, or affect, code on customer's page? ideally, maybe check presence of jquery, detect version, , if it's old, somehow load recent version use our code. i had idea of loading jquery in <iframe> in customer's domain includes our <script...

c# - Telerik UI for MVC => DateTime bug -

i working telerik (kendo) ui asp.net mvc , using grid. problem have bug datetime type. here source: this part model: public class discussion { [datatype(datatype.date)] [displayformat(applyformatineditmode = true, dataformatstring = "{0:mm/dd/yyyy}")] public datetime date { get; set; } // more code... } this editor template(which comes telerik ui) @model datetime? <div style="background-color: red; color: aqua; font-size: 28px;"> @(html.kendo().datepickerfor(m => m) .format("mm/dd/yyyy")) </div> and in view (in grid) date property: columns.bound(model => model.date).width(150).format("{0:mm/dd/yyyy}"); the problem after create new element => http://prntscr.com/8iq7si in controller receive date value: {1.1.0001 г. 0:00:00} => http://prntscr.com/8iq8eq in rare cases date send, there bug format , modelstate never valid. p.s here generated html: <input data-val=...

c# - get ip address from client in server -

i using c# framework 4.0 windows form. program installed on server. there 4 light clients connect server. when 1 of these clients launches progam, how can ip addreess , computer name try this using system; using system.collections.generic; using system.linq; using system.text; using system.net; //include namespace string hostname = dns.gethostname(); // retrive name of host console.writeline(hostname); // ip string myip = dns.gethostbyname(hostname).addresslist[0].tostring(); for more details visit please: http://www.c-sharpcorner.com/uploadfile/167ad2/get-ip-address-using-c-sharp-code/ thanks

javascript - Image src outputs garbled text in Bootstrap Modal -

here code snippet: <a data-toggle="modal" class="comic-link" href="//files.explosm.net/comics/dave/adblocker2.png" data-target="#comicmodal"> <div class="thumb-home thumbnail"> <img id="comic" src="//files.explosm.net/comics/dave/adblocker2.png"> </div> </a> this javascript: $('a.comic-link').on('click touchstart', function() { var url = $(this).attr('href'); $(".comic-modal .modal-body").html('<img src="' + url + '"/>'); }); the images appear on webpage if click on link instead of images garbled text appears inside modal. there no errors in console. please let me know if need provide more details. update it happens explosm comics , not dilbert. does adding http: in front of url solve problem? in environment might not handling protocol-relative url properly.

c# - Processing requests at a maximum rate -

i'm using rx ensure our backend obeys third-party api's request limits. the implementation below utilizes simple subject<t> input queue tamed using james world's custom pace operator . this works, long throttledrequests not observed on main-thread enforced observeon(taskpoolscheduler.default) . as comment out line (line 61), program behaves if pace operator not used @ , request again processed fast queued up. can explain behavior? using system; using system.linq; using system.reactive.concurrency; using system.reactive.linq; using system.reactive.subjects; using system.reactive.threading.tasks; using system.threading; using system.threading.tasks; namespace consoleapplication1 { public static class observableextensions { /// <summary> /// james world's pace operater (see https://stackoverflow.com/a/21589238/88513) /// </summary> public static iobservable<t> pace<t>(this iobservable...

model view controller - ReportViewer export to Excel with password -

i had code in mvc exports out excel file how add password excel file? my code: public actionresult report(string id) { localreport lr = new localreport(); string path = path.combine(server.mappath("~/report"), "reportstatearea.rdlc"); if (system.io.file.exists(path)) { lr.reportpath = path; } else { return view("index"); } list<statearea> cm = new list<statearea>(); using (mydatabaseentities dc = new mydatabaseentities()) { cm = dc.stateareas.tolist(); } reportdatasource rd = new reportdatasource("mydataset", cm); lr.datasources.add(rd); string reporttype = id ; string mimetype; string encoding; string filenameextension; string deviceinfo = ...

mysql - SQL Subquery issue 3 -

i have issue sql code. when run code i'm getting such error mesage: ** subquery returned more 1 value. not permitted when subquery follows =, !=, <, <= , >, >= or when subquery used expression. ** i don't know how correct code run it? can somebothy @ , me it? thank help, select dbo.fra$.[guid], dbo.fra$.[last name], dbo.fra$.[first name], dbo.fra$.[hr manager last name], dbo.fra$.[hr manager first name], (select dbo.fra$.[business email address] dbo.fra$ t t.[hr manager id] = t.[emplid]) [hr manager e-mail], dbo.loc.descr [company name], dbo.fra$.[location code], dbo.loc.[address], dbo.loc.postal, dbo.loc.city, dbo.fra$.[national id], dbo.fra$.[current employee class desc] [current empl class], dbo.fra$.[contract type description] [contract type], dbo.fra$.[business title], case dbo.fra$.[current employee class desc] when 'operator' 10 when 'clerical worker' 22 when 'technician' 32 when 'supervisor'...

ios - Swift Memory Leak on NSArray -

Image
i'm developing app using singleton pattern , swift programming language. when profile app instruments, noticed there's memory leak pointing nsarray. instruments pointing following line of code (please check screenshot). can find why leak happening? tried initialize array workout as: workout = [] the leak wasn't reported. maybe has unarchiving? checkout answer here: swift decode array custom class memory leak seems bug. had same problem too. instead of directly assign value workout , can do: if let wo = nskeyedunarchiver.unarchiveobjectwithfile(utilities.getfileurl("workout")) as? [exceciseobject] { workout = wo.map { $0 } }

Alternative to MoreObjects in Java 8 -

i want rid of dependency: import com.google.common.base.moreobjects; is there simple and/or elegant way rewrite following tostring() function using java 8 native functions? @override public string tostring() { return moreobjects .tostringhelper(this) .add("userid", this.userid) .add("timestamp", this.timestamp) .tostring(); } you can use stringjoiner java.util package. example: @override public string tostring() { return new stringjoiner(", ", classname.class.getsimplename() + "[", "]") .add("userid=" + userid) .add("timestamp=" + timestamp) .tostring(); }

linux - JAVA Robot to type Norwegian characters -

i want type letters å,ø,æ using java awt robot. unable find keyevents these letters. using ubuntu , norwegian selected language. can type these letters keyboard when try keycode these given 0. can suggest how can write using java robot. based on solution of wolfgang steiner: public static void pressunicode(robot r, int key_code) { r.keypress(keyevent.vk_alt); for(int = 3; >= 0; --i) { // extracts single decade of key-code , adds // offset required vk_numpad key-code int numpad_kc = key_code / (int) (math.pow(10, i)) % 10 + keyevent.vk_numpad0; r.keypress(numpad_kc); r.keyrelease(numpad_kc); } r.keyrelease(keyevent.vk_alt); } this automatically goes through each decade of unicode key-code, maps corresponding vk_numpad equivalent , presses/releases keys accordingly. works every unicode character. to code of symbol following: char ch='ä'; int key_code = ch; system.out.println(key_code); edi...

javascript - Error processing resource while parsing KML with '°' symbol in IE -

i trying parse kml file contains data degree symbol , ie cannot recognize symbol. need either replace degree symbol hash code or have escape character. have verified lot of links non of them worked me.` geoxml3.fetchxml = function (url, callback) { function timeouthandler() { geoxml3.log('xhr timeout'); callback(); }; var xhrfetcher = new object(); if (!!geoxml3.fetchers.length) { xhrfetcher = geoxml3.fetchers.pop(); } else { if (!!window.xmlhttprequest) { xhrfetcher.fetcher = new window.xmlhttprequest(); // browsers } else if (!!window.activexobject) { xhrfetcher.fetcher = new window.activexobject('microsoft.xmlhttp'); // ie } } if (!xhrfetcher.fetcher) { geoxml3.log('unable create xhr object'); callback(null); } else { xhrfetcher.fetcher.open('get', url, true); if (xhrfetcher.fetcher.overridemimetype) { xhrfetcher.fetcher.overridemimetype('text/xml'); ...

amazon web services - How to launch a task ECS on AWS with PHP -

i try launch "taskdefinition" on ecs (ec2 container service) php sdk. i created taskdefinition. i created cluster. i created service. i thought next step "registercontainerinstance" when call method, have error : [aws\ecs\exception\ecsexception] error executing "registercontainerinstance" on " https://ecs.eu-west-1.amazonaws.com "; aws http error: client error: 400 clientexception (client): identity document provided, not valid. - {" __type":"clientexception","message":"an identity document provided, not valid."} this because don't send "instanceidentitydocument" , "instanceidentitydocumentsignature". but, don't know how 2 parameters. should launch ec2 manually before? is there way do not know? <?php namespace app\http\controllers; use aws\ecs\ecsclient; use illuminate\http\request; use app\http\requests; use app\http\controllers\con...

javascript - remove html using jquery hide/show -

in option (html) menu added "other". if article isn't listed returns input using jquery, not send $_post , work var_dump post :: ["link"]=> string(0) "" code (mvc - codeigniter) :: <div class="form-group"> <label class="col-md-4 control-label" for="assign_article">assign article menu</label> <div class="col-md-4"> <select name="link" class="form-control"> <?php foreach($get_data $showmenu) { ?> <option value="<?php echo $showmenu['id']; ?>"><?php echo $showmenu['title']; ?></option> <?php } ?> <option value="parent">other</option> </select> </div> </div> <!-- text input--> <div id="parentpermission" class="form-group...

http - XPage Stack Source database IBM Domino -

i have domino servers run xpage based applications. have issue http jvm errors can find in log time time can in anyway more debug on domino server can see database errors occurring in?: 21-09-2015 11:26:58 http jvm: com.ibm.xsp.webapp.facesservlet$extendedservletexception: com.ibm.xsp.facesexceptionex: unable document page name 39bcbe02fb280012c1257ce7006def2d 21-09-2015 11:26:58 http jvm: clfad0134e: exception processing xpage request. more detailed information, please consult error-log-0.xml located in d:/lotus/domino/data/domino/workspace/logs the code failing on trying open xpage associated specific document. it's looking form , can't find relevant xpage. follow answer on question per links to. without viewing logs, there's no way not have access server tell database, form or xpage.

java - How do I put the JMenuBar on top in mac and change the background of a JButton -

i building mac desktop application in java. want change background of jbutton , want make jmenubar in top. to put jmenubar on top added code: system.setproperty("apple.laf.usescreenmenubar", "true"); system.setproperty( "com.apple.mrj.application.apple.menu.about.name", "stack"); and worked! and change backgroud color used this: jbutton b = new jbutton("press me!"); b.setbackground(color.blue); b.setcontentareafilled(false); b.setopaque(true); b.setborderpainted(true); try { uimanager.setlookandfeel(uimanager .getcrossplatformlookandfeelclassname()); } catch (exception e) { } and worked! the problem when changed color jmenubar not in top. after little debugging know changing lookandfeel responsable. the complete code: import java.awt.color; import javax.swing.jbutton; import javax.swing.jframe; import javax.swing.jmenu; import javax.swing.jmenuba...

android - Permissions for getExternalCacheDir() and getCacheDir() -

my http library caching http responses. current implementation select directory cache data looks this: public static file getdiskcachedir(context c) { file dir = c.getexternalcachedir(); if (dir == null) dir = c.getcachedir(); return dir; } the idea use getexternalcachedir() first option because assume there more space available getcachedir() . official docs states free space in getcachedir() shouldn't large (1 mb?) you should have reasonable maximum, such 1 mb, amount of space consume cache files, , prune files when exceeding space. my maximum space 40 mb. so have 2 questions: should use getexternalcachedir() ? apps minsdk = 14. or should use getcachedir() ? if should use getexternalcachedir() permissions required? according official documentation: starting in kitkat, no permissions required read or write returned path; it's accessible calling app. applies paths generated package name of calling ...

Gerrit+Jenkins: communicate results of non-blocking jobs? -

i have 2 jobs , b. job triggering job b, not wait result. how can make job b communicate gerrit that has been done? do have use api? either use api: ssh -p 29418 review.example.com gerrit review --message "job b ran extremely well" <sha1> note 1: quotes may needed around actual gerrit call note 2: depending on branch strategy project might want include <change_id> after <sha1> , since 1 sha1 may present in different branches or make job wait job b's completion (one way turn on block until other projects complete ). the latter easier use , gives more possibilities reduced effort cost. former, however, has advantage of better customization.

arrays - Outputs how many times you input -

my goal output amount of how many times filled up. ex: filled 3 students, program should output 3 students too. need simple loop , array. hope me. i've been struggling analyzing put forloop. public static void main(string[] args) { nso = new nso (); int[]loop=new int[2]; string[]ask={"sure","not now"}; a.setname(joptionpane.showinputdialog("enter name: ")); a.setgender(joptionpane.showinputdialog("enter gender: ")); a.setaddress(joptionpane.showinputdialog("enter address: ")); a.setcourse(joptionpane.showinputdialog("enter course: ")); a.setage(integer.parseint(joptionpane.showinputdialog("enter age: "))); a.setbday(integer.parseint(joptionpane.showinputdialog("enter birth date: "))); int tanong=0; while(tanong==joptionpane.yes_option){ tanong = joptionpane.showoptiondialog(null,"do want input student...

ruby remove item from array based on another array -

i have 2 data, {:date=>"2015-09-23", :time=>["13:30"]} {:date=>"2015-09-23", :time=>["12:00"]} ...more and try remove from {:date=>"2015-09-21", :time=>["12:00", "12:30", "13:00", "13:30", "14:00", "14:30"]} {:date=>"2015-09-22", :time=>["12:00", "12:30", "13:00", "13:30", "14:00", "14:30"]} {:date=>"2015-09-23", :time=>["12:00", "12:30", "13:00", "13:30", "14:00", "14:30"]} {:date=>"2015-09-24", :time=>["12:00", "12:30", "13:00", "13:30", "14:00", "14:30"]} and output hope can get {:date=>"2015-09-21", :time=>["12:00", "12:30", "13:00", "13:30", "14:00", ...

command line - Remove TFS Local File Conflicts with CommandLine -

i trying update local copy tfs server project. there no workspace mapping (i have deleted previous mapping) in current copy. have create new workspace , mapped same local copy. now, whenever trying run tfs command says local file writable, therefore checkout getting failed. error: /project/test/css/v2/scss/utilities.scss: local file /protextsoftwarescan1/project/test/css/v2/scss/utilities.scss writable /project/test/css/v2/utilities.css: local file /protextsoftwarescan1/project/test/css/v2/utilities.css writable you need run tf resolve /auto:overwritelocal command resolve conflicts. the overwritelocal option overwrites file in workspace server version. used resolve conflicts arise writable file in workspace. please check edward's , grant's answer in link details: tfs conflict type: writable file - writable file same name exists locally

How to Display Specific User information in cakephp..? -

iam new cakephp , have problem element. how display each user account information when ever user loggedin click on myaccount link how show particular user details. myaccount link in element. finally how display specific user information when click on myaccount link. myaccount link in element file. if want display logged in users information in account page.then using session. cause in cakephp logged in user's stored session. in case can try var_dump($this->session->read('auth.user')); , here can see logged in users information. , can populate users information form it.

objective c - iOS pictures 1x 2x 3x convert? -

i coded app, done if go images.xcassets, looks need 1x 2x , 3x pictures. tested app on iphone 6 , runs fine. pictures in 1x boxes. ( universal app ). i guess if test on iphone 4 now, images big or other way, on ipad images small. think thats why need 1x 2x 3x, right? could tell me, how 1x pictures converted 2x , 3x? thanks help those images different screen dpi. e.g. retina in iphone 4 use 2x images , retina in iphone 6 plus use 3x images, while 1x images used on old non-retina devices ipad 2. if want use different sized image on iphone 5s , on iphone 6 need provide different asset , set in code.

php - PHPUnit - mock callback function -

here function uses zend db / tablegateway : public function listattestations($ssidx = null, $ssord = null, $ioffset = 0, $ilimit = 0) { try { $resultset = $this->tablegateway->select( function (select $select) use ($ssidx, $ssord, $ioffset, $ilimit) { if ($ssidx != null && $ssord != null) { $select->order($ssidx.' '.$ssord); } $select->join( 'f_travclient', 'syndic_client_id = f_travclient.travclient_id', array('syndic' => 'nom') ); $select->offset($ioffset); $select->limit($ilimit); } ); return $resultset; } catch (\exception $e) { throw new \exception($e); } } i use phpunit unit tests. perhaps, don't know how make function crosses previous method. thought function...

css - Pseudo-Element state - How to append a style to the state of after/before? -

Image
this question has answer here: how write :hover condition a:before , a:after? 6 answers before starting preview code want bit closer environment i'm in.. i'm trying generate menu different tab -sections " start, groups, help, etc. ". let's select centered tab-button , groups .. looks while hovered: as i'm entering 1 of pseudo-elements, i'm using build 45deg sides, hover style parent div switches off. pseudos still visible: note : i'm not able manipulate html markup. way can achieve changes site editing css .. let's have @ code: #header .nav-item { width: 33.33%; } #header .nav-item:hover::before, #header .nav-item:hover::after { display: inline-block; position: absolute; height: 50px; width: 50px; } #header .nav-item:hover::before { margin-left: -25px; background-image: -webkit-gradi...

java - Convert multiple json results to iterable -

i trying map json results iterable of class instance. if 1 object result convert json class instance using methods: private objectreader personreader = null; private objectreader getpersonreader() { if (personreader != null) return personreader; objectmapper mapper = new objectmapper(); return personreader = mapper.reader(person.class); } public person response2person(responseentity<string> response) { try { return getpersonreader().readvalue(response.getbody()); } catch (ioexception e) { throw new runtimeexception(e); } } what shoul getpersonsreader method convert json string, containing multiple results? public iterable<person> response2persons(responseentity<string> response) { try { return getpersonsreader().readvalue(response.getbody()); } catch (ioexception e) { throw new runtimeexception(e); } } the json string looks this: [ { "firstname": "foo"...

linux - Unix Terminal error - "cp: the -R and -r options may not be specified together." -

i have bash script running on os-x unix above command: cp -avr source destination the result following error: cp: -r , -r options may not specified together. when remove a flag works ok without errors. why , meaning of error? thanks, have @ man page cp : -a, --archive same -d r --preserve=all -r, -r , --recursive copy directories recursively so specifying -a , say: cp -drvr --preserve=all source destination you have both -r , -r , , since 2 same, warns you. fix that, remove -r : cp -av source destination

Connecting to a remote MySQl server on cygwin -

i try connecting remote mysql server on ip 10.198.161.41 when give mysql -u user -p -h 10.198.161.41 output: enter password: error 2003 (hy000): can't connect mysql server on '10.198.161.41' (111) the mysqld on 10.198.161.41 runs on port 4308 . should mentioned in command? there no my.cnf file in cygwin . what try? (info:the 10.198.161.41 windows machine , has mysqld running on it) if use mysql different port 3306 mysql default port must mention connect per below- mysql -u user -p -h 10.198.161.41 -p 4308 here small p denotes password , caps p port.

c++ - <!> Error during startup: Cannot load library in OMNET++ project while using sqlite3 -

i have omnet++ project, csw , references other omnet++ projects via project->properties->project references. the reference project cb_csw_vehicle works fine. marked project project->properties->omnet++->makemake->options->target shared library . have libcb_csw_vehicle.dll , used main project csw . simulations csw run, using cb_csw_vehicle without problems. the reference other project cb_csw_cloud , doesn't work. made same steps it: marked "create shared library" in omnet++->makemake->options->target checked project cb_csw_cloud in properties->project references of main project i can build main project csw . can build libcb_csw_cloud.dll . when run simulation project csw , receive error: <!> error during startup: cannot load library '../../../cb_csw_cloud/src//libcb_csw_cloud.dll': operation completed successfully. the difference between these 2 projects, cb_csw_cloud uses sqlite3 library. added p...

ios - Localize watchkit companion app display name -

i having issues localizing app display name on apple watch companion app. following guide lines have localize cfbundlename follow: cfbundledisplayname = "my app"; cfbundlename = "myapp"; i did every different language supported app, in apple watch companion app shown english cfbundledisplayname. any idea on how localize apple watch companion app name? thank helping i believe bug of ios9. reason clear, there no apps on appstore provides localized companion app title.

Clang + OpenMP on Linux uses only 1 CPU core -

i have following code: int main(int argc, char** argv) { const int64_t n = 10000000000; float* data = new float[n]; int64_t i; omp_set_dynamic(0); omp_set_num_threads(4); #pragma omp parallel for(i = 0; < n; ++i) data[i] = i*i; return 0; } if compile g++ during runtime code uses 4 cores: g++ -fopenmp -std=c++11 main.cpp if compile clang++3.7 during runtime code uses 1 core: clang++-3.7 -fopenmp -std=c++11 main.cpp in both cases have set: omp_num_threads=4 both compilers have been installed debian testing repository: sudo apt-get install g++-5 sudo apt-get install clang-3.7 so, ideas why clang uses 1 core? in advance. see this : openmp 3.1 supported, disabled default. enable it, please use -fopenmp=libomp command line option. it looks missed -fopenmp=libomp in compilation flags.