Posts

Showing posts from January, 2015

Bulk Insert statements MYSQL Stored Procedure -

i have stored procedure need, amongst other things, able multiple inserts particular table. the number of inserts table can vary. the stored procedure being called via jdbc. passing parameters single insert statement stored procedure easy. there way can pass array of values stored procedure, , loop through array perform insert statements? i'm pretty new stored procedures, in advance help.... this achieved including in transaction , automatically rollback if goes haywire. done in jdbc setting connection autocommit false, , autocommiting conn.setautocommit(false); conn.commit();

matlab - How to decrease the size of an image by decreasing the pixels -

i trying decrease size of image reducing pixel values present @ width, height , colorchannel. tried make 0 (means black) value of file size increased. can suggest how can decrease size wihout using imresize. you can decrease size of image decrasing quality parameter (is equal 75 in example below) sharp('input.jpg') .resize(300) .quality(75) .tofile('result.jpg', function(err, info) { if(err) console.error(err); console.log(info); });

php - Constructor is not called in RegisterUser trait: Laravel 5.2 -

i have constructor in trait registersusers . can find trait in below mentioned path vendor\laravel\framework\src\illuminate\foundation\auth\registersusers.php here problem is, constructor not being called...below code. private function __construct( \app\caching\cachecollection $cachedata ) { $this->cachecollection = $cachedata; } did faced similar issue before ? if class use ing trait has constructor, constructor provided trait not used. override precedence class methods override trait methods override inherited methods (class > trait > base). if have constructor in class, need remove it. a few other notes: first, if @ possible, don't want modify files in vendor directory. changes make in there erased next time composer update , , won't able deploy changes unless you're committing vendor directory repository (not idea). should make new trait use es trait, , includes additional constructor. in classes, use new trait, not registersus

c++ sorting by making array of indices -

i have project create scheduling program , 1 part of requires sorting. know how regular bubble sort project asks me way... sort() — function sort floats array data[], creating array of sorted indices. sort() function not sort data, fills the array indx[] data[indx[0]], data[indx[1]], ..., data[indx[num_events - 1]] values of data[] in ascending order. this code have right here sorts data doesn't way supposed done. needs way because not using objects , indices of different arrays need correspond. cant figure out make sort indices. appreciated. void sort(float data[], int indx[], int len){ float temp; //this loop declare array of indices //as passed in empty (int = 0; < len; i++){ indx[i] = i; } (int = 0; < len - 1; i++){ (int j = 0; j < len - 1; j++){ if (data[j] > data[j+1]){ temp = data[j]; data[j] = data[j+1]; data[j+1] = temp; } } } } try instead: void sort(float dat

How to connect these 2 statements in python -

if ask == "yes" or ask == "yes": print("lets go, if dont know question can 'i dont know' leave gameshow") else: if ask == "no" or ask == "no": print("then go home") exit(ask) print("what capital of sarajevo?") if ask == "sarajevo" or ask == "sarajevo": print("correct, move on") else: if ask == "i don't know" or ask == "i don't know": print("sorry isn't correct, lost") exit(ask) whatever try end being printed for whole thing make sense, ask has provided user using input() . going assume is. below modified version of code. note not have case correctly. can convert whatever answer given lowercase using lower() method of strings. ask = input('please provide answer..\t') if ask.lower() == "yes": print("lets go, if dont know question can 'i dont know'"

amazon web services - Does AWS DynamoDB API pose a limit to number of records returned in a secondary index query? -

i'm woking dynamodb using java sdk. case here is, i've secondary index when queried might contain 1000+ records in returned result. i'm not sure if dynamodb returns result in paginated form or records @ once? thanks. dynamodb paginates results http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/queryandscan.html#pagination dynamodb paginates results query , scan operations. pagination, query , scan results divided distinct pieces; application can process first page of results, second page, , on. data returned query or scan operation limited 1 mb; means if result set exceeds 1 mb of data, you'll need perform query or scan operation retrieve next 1 mb of data. if query or scan specific attributes match values amount more 1 mb of data, you'll need perform query or scan request next 1 mb of data. this, take lastevaluatedkey value previous request, , use value exclusivestartkey in next request. approach let pr

java - Thread vs AlarmManager wich one has low battery usage -

what need in application stuff every 30 sec 18 hours per day want keep running device going sleep mode found 2 ways: using timer using alarmmanager type of alarmmanager.elapsed_realtime_wakeup using thread unfinished while-loop , sleep thread every 30 seconds. now using timers, works fine in api versions have 1 problem , that's battery usage. my question is, can use thread instead of timers? heard somewhere threads cannot run long times (5sec max), i'm not sure. , if can use thread, take lower power timers? , works api versions? here description of question http://www.vogella.com/tutorials/androidtaskscheduling/article.html

Reverse distance order with $near operator in MongoDB -

according mongodb documentation $near operator sort distance: $near sorts documents distance in order words, nearest reference point in query first element returned. is there way of reserve order? mean, return farthest element first. there sure way return furthest elements first, , use $geonear aggregation framework. there of course "catch", since asking antithesis of kind of search function typically used for. as initial pipeline stage, it's job return results mandatory projected "distance" field queried point. allows add $sort pipeline stage return "distance" in "descending order". being "largest" , therefore "furthest" distance point. basically in form this, , noting "catch": db.collection.aggregate([ { "$geonear": { "near": { "type": "point", "coordinates": [longitude,latitude] },

angular - Angular2 Edit and Update view -

i trying crud app. component code import {component} 'angular2/core'; import {formbuilder, validators, controlgroup} 'angular2/common'; function emailvalidator(control) { var email_regexp = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i; if (!email_regexp.test(control.value)) { return {invalidemail: true}; } } function mobilevalidator(control) { var mobil_regexp = /^[0-9]{10}$/; if(!mobil_regexp.test(control.value)){ return {invalidmobile: true}; } } @componeteemployeeform; createemployeejson; employees; employeecreate; constructor(createform: formbuilder){ this.createemployeeform = createform.group({ employeename: ["", validators.required], employeeemail: ["", validators.compose([emailvalidator])], employeemobile: ["", validators.compose([mobilevalidator])] }); this.employees = [{ &quo

spring - Thymeleaf - Conditional Attributes only showing for a split second in html -

i working on spring web application. tried write function checks whether if entered password correct. code controller: @requestmapping(value = "/login", method = requestmethod.post) public modelandview loginuser(@modelattribute user user) throws filenotfoundexception { if (patient.getpasswort().equals(patient.getpasswortconfirm())) { service.login(user); modelandview modelandview = new modelandview("mainpage"); modelandview.addobject("user", user); return modelandview; } else { modelandview modelandview = new modelandview("login"); modelandview.addobject("wrongpw", true); return modelandview; } } this code html page: <!doctype html> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"> <head> <link rel="shortcut icon" type="image/ico" href="image/favicon.ico" />

android - How to fill a C++ char[] with an JNI jobjectarray (Java String[])? -

i think question says all. work android ndk. cannot include std, no use of vectors please, plain , simple c++. here's have far: // filepaths = jobjectarray = java string[] int elementcount = env->getarraylength(filepaths); // should end being char[] filepaths in char *cppfilepaths[elementcount]; (int = 0; &lt elementcount; i++) { jstring jfilepath = (jstring) (env->getobjectarrayelement(filepaths, i)); const char *cppfilepath = env->getstringutfchars(jfilepath, 0); // not work! cppfilepaths[i] = cppfilepath; env->releasestringutfchars(jfilepath, cppfilepath); env->deletelocalref(jfilepath); } with code i'll end cppfilepaths containing elementcount entries of last string in filepaths . i searched lot , found out strcpy or memcpy , nothing worked far. this works now. have no idea, if it's okay directly use result of getstringutfchars , until no errors... const char *cppfilepaths[elementcount] = {}; (int = 0; &lt

Android Facebook GraphResponse get string from an array -

i'm getting confused on i'm reading through. i'm trying specific items array can show them on in view. i'm using facebook's graphresponse pull ids, names, accesstokens, etc. don't know how use getjsonarray() or getjsonobject() or when use either. i have request: graphrequest request = graphrequest.newgraphpathrequest( accesstoken, "/me/accounts", new graphrequest.callback() { @override public void oncompleted(graphresponse response) { // insert code here } }); bundle parameters = new bundle(); parameters.putstring("fields", "name,id,access_token"); request.setparameters(parameters); request.executeasync(); which should yield me this: { "data": [ { "name": "sample page 1", "id": "1234567890", "access_token": "sample_token" }, {

css - Current element hiding, after hover on it (opacity changed) -

i have block .cube class - implement red cube. .cube { position: absolute; top: 50px; left: 50px; width: 20px; height: 20px; background: red; transition: .3s opacity; } and pseudo-selector :before "border" around (actually it's more larger cube around .cube class). .cube::before { position: absolute; top: -10px; left: -10px; right: -10px; bottom: -10px; content: ''; background: black; z-index: -1; } on :hover change opacity in .cube class. .cube:hover { opacity: .5; } the question is: why .cube class on hover disappears, in turn, not "under" :before . it? here jsfiddle . thanks! .cube { position: absolute; top: 50px; left: 50px; width: 20px; height: 20px; background: red; transition: .3s opacity; } .cube::before { position: absolute; top: -10px; left: -10px; right: -10px; bottom: -10px; content: ''; background: black; z-index: -1;

jsf 2 - Don't show JSF messages on top of the page -

i'm showing validation messages on jsf page: <h:outputlabel value="nome"/> <h:inputtext id="idnome" value="#{cadastrarclientemb.clit.nome}" required="true" requiredmessage="digite o nome para continuar!"/> <h:message style="color:red; font-size:10px;" for="idnome"/> okay, it's working. great me. big problem validation messages showing @ top of page. how not showing messages @ top? thanks.

Alfresco 5.1 document root object -

my workflow.get.js file var workflow = actions.create("start-workflow"); workflow.parameters.workflowname = "activiti$trainerempanelment"; workflow.parameters["bpm:assignee"] = people.getperson("admin"); workflow.parameters["bpm:workflowdescription"] = "test"; workflow.parameters["bpm:workflowpriority"] = "2"; workflow.parameters["bpm:sendemailnotifications"] = true; workflow.parameters["initiator"] = people.getperson("admin"); var today = new date(); var duedate = today.getdate() + 1; workflow.parameters["bpm:workflowduedate"] = duedate; workflow.execute(document); when using webscript getting error the web script /alfresco/s/workflow/ has responded status of 500 - internal error. 500 description: error inside http server prevented fulfilling request. message: 06190087 wrapped exception (with status template): 06190504 failed execute sc

python - Trying renaming all files in a folder -

i trying script below rename files in folder.it working fine,but when trying run outside folder.it shows error. import os path=os.getcwd() path=os.path.join(path,'it') filenames = os.listdir(path) i=0 filename in filenames: os.rename(filename, "%d.jpg"%i) i=i+1 'it' name of folder in files lie. error:filenotfounderror: [errno 2] no such file or directory: '0.jpg' -> '0.jpg' print showing names of files when os.listdir(path) filenames of files in folder, not complete paths files. when call os.rename need path file rather filename. you can join filename parent folder's path using os.path.join . e.g. os.path.join(path, file) . something might work: for filename in filenames: old = os.path.join(path, filename) new = os.path.join(path, "%d.jpg"%i) os.rename(old, new) i=i+1

ios - How to present all CSS features in NSAttributedString -

in app need present html file in textview not in webview , , file has complex css, not text color, bold, etc. my css 1 below: table { width: 100%; } table td { padding: 10px; border-bottom: 1px solid #eee; box-sizing: border-box; } /* -------------------------------------------------- */ .btn { float: left; font-size: 11px; color: #fff!important; text-transform: uppercase; background: #a8353a; padding: 0 14px; margin: 10px 0 0!important; cursor: pointer; line-height:30px; } .btn:hover { background: #d8474e } /* -------------------------------------------------- */ ul li { list-style-type: square; margin: 10px 20px; } .allcaps { text-transform:uppercase; } /* -------------------------------------------------- */ .tablewithimages .image { width: 45%; } @media screen , (max-width: 768px) { .tablewithimages td, .tablewithimages .image { display:block; width:100%; padding: 10p

java - Sending http request through an open Browser -

i'm trying values out of response of call our server @ work. problem i'm facing if send same request through browser, preferably firefox, in i'm logged application send correct response if try same within browser session i'm not logged in redirected log in page. same happens if try set off request directly via httpurlconnection class. circumvent problem want send request through open browser session. code i'm using: string callpage() { url url; string address = "novalidresponse"; try { url = new url(getmapwidgeturl()); //function delivers request url httpurlconnection connect = (httpurlconnection) url.openconnection(); //connect.setinstancefollowredirects(false); connect.setrequestmethod("get"); bufferedreader in = new bufferedreader(new inputstreamreader(connect.getinputstream())); string source = ""; string line; while((line = in.readline()) != n

filter - MS-Excel copy specific cells in new worksheet after filtreing data -

i have worksheet "recalculated fs" columns : a, b, c, d, e ..ai want filter worksheet if ai = "yes" copy columns b , d in new worksheet "sheet2", have code copy columns , don't know how work column b , d, ps : want rename header of "sheet2" , b -- > columnb , c--> columnc sub tgr() dim wsdata worksheet dim wsdest worksheet set wsdata = sheets("recalculated fs") set wsdest = sheets("sheet2") wsdata.range("ai2", wsdata.cells(rows.count, "ai").end(xlup)) .autofilter 1, "yes" .currentregion.copy wsdest.range("a1") .autofilter end end sub help please ? need add filter 1 (ai column), filter 2 (column ak) , how can in code : option explicit sub tgr() dim wsdata worksheet dim wsdest worksheet set wsdata = sheets("recalculated fs") set wsdest = sheets("sheet2") ' set wsdata sheet active, allow filterring wsdata.select wsdata.range(&quo

firebase - Editing the user document in mongodb -

is bad practice allow editing of user document beyond changing password. noticed on yo's angular-fullstack there no function update user. on firebase user registered authentication stuff user info (name, telephone, address...) needs stored elsewhere. in other words, there reason have users document responsible authentication , have document non-authenticating fields? i not asking opinions please. factual issues storing authenticating fields , non-authenticating fields in same document. when prototyping application, wouldn't gonna find benefits in separating data in beginning. however, application grows, there few reasons separate out identity information. separation of concern authentication specific use case, make sense store separately, facilitate changes authentication mechanism in case authentication logic needs delegated external identity provider. this true domain tough, different services might handling different user related information. services

html - autocomplete by jquery in codeigniter textbox id not working -

i creating form in table , 1 add button ,one delete button , 1 submit button. when click add button 1 row created , when click delete button 1 row goes deleted. here view page <div style="overflow: scroll;"> <?php $attributes = array('class' => 'form-horizontal', 'id' => 'form'); echo form_open('digital/add_task', $attributes); ?> <table class="table" id="datatable"> <thead> <tr> <th>select</th> <!--<th>date</th>--> <th>types of work</th> <th>worked with</th> <th>director</th> <th>no of hours</th> <th>task</th> <th>task status</th> </tr> </thead> <tbody> <tr> <td><input type="checkbox" n

node.js - Node RED & NodeJs on CentOS7 startup fails / server unavailable -

i have problem node-rred on centos7. tried on different machines, , followed instructions on webside. brings me point, error on side. this steps followed: curl --silent --location https://rpm.nodesource.com/setup_4.x | bash - yum -y install nodejs yum install gcc-c++ make npm install -g --unsafe-perm node-red start: node-red after start console standing on line, example 25 feb 22:51:10 - [info] server running @ http://127.0.0.1:1880/ in documentation there should more.i tried different browsers on server address http://127.0.0.1:1880/ without success. so did miss? node-red has started correctly, next step connect node-red console pointing browser @ port 1880 on machine. the flow file name includes name of machine node-red running on in example machine name inst noltop , machine called sampleserver.sampledomain.com given have minimal install (which doesn't have web browser or x iirc) need use different machine view console. e.g. http://sampleserve

Alfresco Document management system in spring application -

i new alfresco document management system in spring, have done alfresco activity workflowbefore. want develop alfresco dms in spring. any body did please send me sample model application or related web site url. thank you. in case want connect alfresco repository private static session getsession(string serverurl, string username, string password) {sessionfactory sessionfactory = sessionfactoryimpl.newinstance(); map<string, string> params = new hashmap<>(); params.put(sessionparameter.user, username); params.put(sessionparameter.password, password); params.put(sessionparameter.atompub_url, serverurl); params.put(sessionparameter.binding_type, bindingtype.atompub.value()); list<repository> repos = sessionfactory.getrepositories(params); if (repos.isempty()) { throw new runtimeexception("server has no repositories!"); } return repos.get(0).createsession(); } you have add serverurl , username , password (in default admin , admin )

Javascript auto generate unique id for textbox -

in javascript got problem in create unique auto generate id in textbox. textbox must readonly. please help. id should pt1 <tr> <td>patient admissionid:</td> <td><input type="text" readonl placeholder="patient id"/></td> </tr> <div class="input-container"> <input type="text" id="pt1"> </div> <button id="addinput">add input</button>$('#addinput').on('click',function(){ var inputcount = $(".input-container").find($("input")); var uniqueinput = "pt"+inputcount.length + 1; $(".input-container").append("<input type='text' id='" +uniqueinput+ "'>"); }) working fiddle https://jsfiddle.net/wx38rz5l/657/

java - JDBC and Oracle DB : Escape ' (single quote) -

hello looks simple having issues here. firstly using statement#executebatch executing many update statements. each update statements have string value updated. these string have " ' " single quote. have tried adding 1 more single quote in front of per oracle doc adding '\\\' in front of single quote. first one, query gets stuck , not come out after 10 minutes. second 1 'batching: ora-00927: missing equal sign' error. what correct approach? note:- cannot use preparedstatement make use of jdbc parameters. please help. you may use q-quoted strin g eg q'['''''''']' this give following example statement stmt = con.createstatement(); stmt.addbatch("update tst set txt = q'['''''''']' id = 1"); stmt.addbatch("update tst set txt = q'['''''''']' id = 2"); stmt.addbatch("update tst set txt = q

Apply python logging format to each line of a message containing new lines -

i include id associated request every log line in log file. have mechanism retrieving request id via logging filter working fine. my problem when log line contains newline, line of course wrapped onto "bare" line. there way tell logging library split message, , apply format each element of split? import logging logger = logging.getlogger() handler = logging.streamhandler() formatter = logging.formatter( "%(requestid)s\t%(message)s") handler.setformatter(formatter) logger.addhandler(handler) logger.setlevel(logging.debug) logger.debug("blah\nblah") output: xxx blah blah desired output: xxx blah xxx blah though not best way go this, without changing lot of code. import logging class customhandler(logging.streamhandler): def __init__(self): super(customhandler, self).__init__() def emit(self, record): messages = record.msg.split('\n') message in messages: record.msg =

php - codeingniter3.0.6 is not working in Godaddy server only -

codeigniter 3.0.6 working in local , hostgator, not working in godaddy server. url http://domain.com/php/codeigniter-3.0.6/admin/login looks like. controller path: application/controller/admin/login.php error: severity: warning message: mkdir(): invalid path filename: drivers/session_files_driver.php line number: 117 rewriteengine on rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^(.*)$ index.php?/$1 [l,qsa] the best practices save session database. $config['sess_save_path'] = 'database' . but make sure create table called ci_sessions on application database.

c# - Delagate example whats the point -

like many other posts i've found on so, i'm trying head around delegates. example not classed duplicate because asking specific question particular example. public delegate void hellofunctiondelegate(string message); public class delegate { static void main() { hellofunctiondelegate del = new hellofunctiondelegate(goodnight); // delegate point goodnight method del("hello"); // invoke delegate } public static void goodmorning(string strmessage) { console.writeline(strmessage + " , morning!"); console.readkey(); } public static void goodnight(string strmessage) { console.writeline(strmessage + " , night!"); console.readkey(); } } so in example understand delegate reference function matches signature , if pass in goodmorning see: hello , morning! and if pass in goodnight see: hello

javascript - How to update data in Meteor and React? -

i started using meteor , react js in work , i'm beginner both of them. building blog , need update posts i'm having problems when updating data, data not saved in collection. have following collection: posts(title,slug,content,author,category , tags[]). fields need update are: title,content,author,category , tags[]. far i've tried solve no positive results. use astronomy schema. hope can give advice. here code: import ....other imports import { posts } '../../lib/collections.jsx'; class postmanager extends component { constructor(props) { super(props); this.state = { title: props.post.title, content: props.post.content, category: props.post.category, tags: props.post.tags, slug: props.post.slug, author: props.post.author, }; this.updatepost = this.updatepost.bind(this); } updatepost(event) { event.preventdefault(); const post = this.props.post; const title = this.state.title.defaultvalue; const slug = this.state.slug.d

batch file - Goto was unexpected at this time please -

im messing around secret file can type in , keep things myself here code @echo off echo please enter password continue set /p password="hello" if %c%==hello goto top if not %c%==goto passerror :passsuccess title matrix color 0a mode 1000 :top echo %random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random% goto top :passerror echo try again your problem c undefined. entering password password checking c . in case of spaces or no entry, use if "%varentered%"=="somevalue" goto ... for instance, if "%c%"=="" goto paserror or if not defined c goto ... as have

node.js - Mongoose Pre Save hook on Parent Object not executing -

i new mongoose method updating mongo. using nmap map network , provide visibility on servers , ports open (as part of largeer strategy). portion of strategy alos pulls information chef , vsphere linked in gui. portions simple single level objects , working fine, nmap portion has parent/child object model. object model has server object , port object - both of have addedon , updatedon dates. unfortunately mongoose hook pre save firing children objects (each of them) , not parent object - although parent object getting saved. i want parent object have addedon , updatedon dates. can't seem figure out. in advance a disclaimer, code below snipped out of larger application written in folktale, ramda , point free form. nodejs 5.1, mongoose 4.4.1 the port.js file const mongoose = require('mongoose'); const schema = mongoose.schema, objectid = schema.objectid; const portschema = new schema({ id : objectid, port : string,

excel - Hide & unhide columns on all sheets with If function VBA -

i trying hide/unhide specific columns on 1 sheet named vpl , hide/unhide different set of specific columns on remaining sheets in workbook. here code i've got far it's working on sheet named vpl , not hiding columns on other sheets when looping through remaining sheets in workbook. sub hideandunhideproduct2() 'are sure want run macro, when run box popup , ask yes or no dim varresponse variant varresponse = msgbox("this hide/unhide product 2 on sheets, want continue", vbyesno, "selection") if varresponse <> vbyes exit sub application.screenupdating = false 'hides/unhides product columns on sheets if vpl.columns("l:n").hidden = true 'unhides specified columns on specified sheet vpl.columns("l:n").entirecolumn.hidden = false 'unhides selected colunms 'unhides columns on sheets except ones specified below dim wsu worksheet each wsu in sheets if wsu.name <> "vpl" '<sheets skip

vb.net - What is an efficient way to manage a vb form which handles huge data(much higher than 2 gb) with access 2013 as database? -

i designing windows form using vb.net. internet states 2 gb limit .accdb file. required handle data lot larger 2 gb. best way implement this? there anyway regularly store data other access db , empty main database? (but create troubles in migrating data accdb windows form when demanded user?) edit: read somewhere splitting help. dont see how?- creates copy of database on local machine in network. you can use linked table of microsoft sql server 2012 express edition has 10 gb limit, the maximum relational database size 10gb . you can use mysql linked table , 2 tb limitation

Uncaught TypeError: Cannot read property 'split' of undefined when PrimeFaces HeadRenderer is turned off in order to make JSF use its own HeadRenderer -

i had disabled primefaces headrenderer reason mentioned in this post in order make jsf implementation use own headrenderer follows. <render-kit> <renderer> <component-family>javax.faces.output</component-family> <renderer-type>javax.faces.head</renderer-type> <renderer-class>com.sun.faces.renderkit.html_basic.headrenderer</renderer-class> </renderer> </render-kit> this working fine before primefaces upgraded. after upgrading primefaces 6.0 (along "primefaces extensions" same version), inclusion of javascript files leads problems like. uncaught typeerror: cannot read property 'split' of undefined this error comes within primefaces core.js file. unlike previous versions, there no primefaces.js replaced core.js , components.js . because of error, ajax calls doing paging, sorting, filtering in <p:datatable> , example, stopped working. any suggestion?

printing - VB.NET Print on each line of a rich textbox separately -

how can print line of richtext , second 1 , on? something : e.graphics.drawstring(textbox2.line(0), font, brushes.black, 30.23622, 139.165354) edit: now problem if not press enter text fills line , move on next one, doesn't count line. idea? you can use each loop this: for each line in richtextbox1.lines e.graphics.drawstring(line, font, brushes.black, x, y) y += e.graphics.measurestring(line, font).height next remembering increment y each line height of string

in place - Using perl one-liner in perl script -

i embedded 1 perl one-liner in 1 perl script , purpose of in-place replace 1 string each line of files name extension .ini, found every file backed .bak. since in one-liner, specify -i rather -i.bak , wonder why .bak file generated. foreach $dir (glob "*.ini") { system qq(perl -i -pe 's|default|utf-8|' $dir); } another question whether there better,concise perl script achieve same target (without .bak file backed up), regardless of one-liner or not. i think may looking @ old data files. far know, perl won't assume default file extension of .bak under circumstances if specify option -i attempt edit file in-place deleting input file after has been opened , creating new output file same name. old file remains readable until closed this technique doesn't work on windows, , error use bare -i option on platform there no need shell out second perl process edit files. can done this. internal variable $^i corresponds value of

android - can we call AIDL From remote device -

can call client aidl interface device. , if yes how? if no exact use of aidl in android suggestions appreciated. regards sumit can call client aidl interface device no. what exact use of aidl in android quoting the documentation , "it allows define programming interface both client , service agree upon in order communicate each other using interprocess communication (ipc)." app developer, use when implementing binding pattern services (e.g., bindservice() , onbind() ) between apps.

linux - How to replace strings on a static position and do not delete the blanks with sed -

i try create script template. in this, want replace strings on static position. after first sed try, default string corrupted. my script: #!/bin/sh # default record record="nnnnnnnnnnnnnnnnnnnn cccccccccccccccccccc bbbbbbbbbb 001" echo "$record" # read values configuration file var1="user name: sibob" # 20 var2=" berlin" # 20 var3="1983 [us]" # 10 record=`echo $record | sed -e "s/\(.\{0\}\)\(.\{20\}\)/\1$var1/" ` echo "$record" record=`echo $record | sed -e "s/\(.\{21\}\)\(.\{20\}\)/\1$var2/" ` echo "$record" record=`echo $record | sed -e "s/\(.\{54\}\)\(.\{10\}\)/\1$var3/" ` echo "$record" the result of script is: $ ./rename.sh nnnnnnnnnnnnnnnnnnnn cccccccccccccccccccc bbbbbbbbbb 001 user name: sibob cccccccccccccccccccc bbbbbbbbbb 001 user name: sibob cccc berlinbbbbbbb 001 user name: sibob cccc berlinbbbbbbb 001 user name: sib

hadoop - How to reduce number of mappers, when I am running hive query? -

i using hive , i have 24 json files total size of 300mb (in 1 folder), have created 1 external table(i.e table1) , loaded data(i.e 24 files ) external table. when running select query on top of external table(i.e table1), observed 3 mappers , 1 reducer running. after have created 1 more external table(i.e table2). i have compressed input files (folder contains 24 files ). example : bzip2 so compress data 24 files created extension “.bzip2” (i.e..file1.bzp2,…..file24.bzp2). after , have load compressed files external table . now, when running select query , taking 24 mappers , 1 reducer. , observed cpu time taking more time when compared uncompressed data(i.e files) . how can reduce number of mappers, if data in compressed format(i.e table2 select query )? how can reduce cpu time , if data in compressed format(i.e table2 select query )? how cpu time affect performance? the number of mappers can less number of files if files on same data node.

ruby on rails - Invalid date with Date.parse -

before user signs require him create challenge. this challenges_controller: def create @challenge = challenge.new(challenge_params) if current_user == nil session[:challenge_action] = challenge_params[:action] session[:challenge_deadline] = [params["challenge"]["deadline(3i)"], params["challenge"]["deadline(2i)"], params["challenge"]["deadline(1i)"]].join('/') redirect_to signup_path end end the parameters passed through: parameters: {"challenge"=>{"action"=>"run", "deadline"=>"2016-02-29"}, "button"=>""} the action , deadline parameters passed can see above. once new user created new challenge not created: argumenterror (invalid date): app/controllers/users_controller.rb:33:in `parse' app/controllers/users_controller.rb:33:in `create' this users_controller: def create @user = us

java - Is creating a lot of private classes bad style? -

i doing project in java has lot of methods require multiple return objects. have keep creating private classes encapsulate return objects. objects make sense fontresult in code return font name , font size example creating new objects each return type require feels wrong , somehow trying circumvent how java should written. wrong or fine this? should structuring code in more of tell-dont-ask approach? an example follows: string test = "hello"; stringresult result = getinformation(test); int length = result.length; private stringresult getinformation(string test) { int length = test.length(); char firstchar = text.charat(0); } private class stringresult { int length; char firstchar; stringresult(int length, char firstchar) { this.length = length; this.firstchar = firstchar; } } while necessary have "multiple return objects", sign indicating passing around information. possible situations: you pass lot of data 1 object other

javascript - Setting content of a textarea with innerHTML from an onclick event only works once -

i'm trying update content of <textarea> field when <button> clicked onclick="" event. my problem button works once. if change content of text area button doesn't work anymore. i've found several questions same problem use variable inputs or not random data. you can see example here: click on add test data button modify content of textarea repeat step 1.: button doesn't work console register done message <script> function addexample() { document.getelementbyid('fasta').innerhtml = 'acgt'; console.log('done'); } </script> <p> <button type="button" onclick="addexample();">add test data</button> </p> <textarea name="fasta" id="fasta"></textarea> i'm using firefox 44.0 on ubuntu 15.04. ps: i've found several questions same problem on use variable inputs or not random data.

Send C#/razor to javascript function -

how can make work: @foreach (var alert in model.alertsrelatedtobrand) { <li class="notifications-row"> <div class="notifications-icon notifications-icon-alert">&nbsp</div> <div class="notifications-text"><a>@alert.title</a></div> <a href="#" class="notifications-dismiss" onclick="onhidealertclick(@alert.id)">x</a> // here problem </li> } i want send id of each alert function if item clicked. your code appears correct use of @alert.id should output value existing onhidealertclick() function : onclick="onhidealertclick(@alert.id)" it's worth noting if id property integer, may want try wrapping parameter within single quotes pass along string seen below : onclick="onhidealertclick('@alert.id')"

spring - javax.servlet.ServletException: Could not resolve view with name in servlet with name 'dispatcher' -

javax.servlet.servletexception: not resolve view name i'm new spring mvc. got issue here. i'm trying view handler function. issue is returning error, have seen lot of times , solved. i'm totally stuck. please me? @requestmapping(value="/editcasetypes.htm", method = requestmethod.get) public modelandview loadeditcasetypepage(@modelattribute("addcasetypes") casetypesformbean casetypesformbean, modelmap model, httpsession session, httpservletrequest request) throws exception { string editthis="20"; if(!editthis.equals("") && editthis!=null){ casetypesformbean.setcasetypecd(integer.parseint(editthis)); casetypesbusinessdelegate.editcasetypetodb(casetypesformbean); } model.addattribute(casetypesformbean); return new modelandview("addcasetypes", model); } i'm adding header part of jsp: <body onload="init()"> <form:form modelattribute="addcasetypes&