Posts

Showing posts from March, 2015

point cloud library - PCD Sample Data -

i looking sample point cloud scenes work unable find free sample pcd data apart pcl documentation few files. source when can find free pcd files work with? working on ground , pedestrian recognition. check community data repositories links on page http://pointclouds.org/media/

android - how to launch foreground app from a background service when screen is off -

my company owns android app. have number of internal alpha users not active on app. use once in while. able collect more , more data of our app's upcoming releases , test reliability, want create background service our employees can install on phones. this service should able launch our app , run scenarios, when no 1 using phone, , phones have sufficient battery , wifi connectivity. i able launch app background service when screen on. wondering if there way through can launch app background service when phone's screen locked. is possible run foreground app background service on android when screen locked. if there no direct straightforward way, if make background service/app device administrator, can somehow setting policies.

How to sort array as same key value using PHP -

i need 1 help. need sort array per key value using php. i explaining array below. $clients=array(array("clinet_id"=>9,"company"=>3,"id"=>4),array("clinet_id"=>9,"company"=>3,"id"=>6),array("clinet_id"=>9,"company"=>3,"id"=>7),array("clinet_id"=>10,"company"=>2,"id"=>4),array("clinet_id"=>10,"company"=>2,"id"=>8)); echo json_encode($clients); here need sort array per client_id means same client_id merge 1 array id comma separated string. explaining expected output below. $templatearr[9]=array('3' =>4,6,7) $templatearr[10]=array('2' =>4,8) means should $templatearr[clinet_id]=array(company =>id1,id2,...,) format. please help. code this: $tmp = array(); foreach ($clients $k => $v) { if(!isset($tmp[$v['clinet_id']])){ $tmp

java - https://graph.facebook.com/v2.10/me/photos?access_token=xxxxxx returning error -

i trying posts of specific facebook brand page using following curl command https://graph.facebook.com/v2.10/me/photos?access_token=xxx getting following error { "error": { "message": "an active access token must used query information current user.", "type": "oauthexception", "code": 2500, "fbtrace_id": "dh1t17dmqr+" } } i have used following curl command active access token https://graph.facebook.com/oauth/access_token?type=client_cred&client_id=xxx&client_secret=yyy facebook app have been created page admin , client id & client secret used app access token. earlier using page-id instead of "me" identifier post using above curl , working fine specific facebook account. where page-id id of specific facebook page post want get. now, same configuration not working other page. the page restricted age or location, have use user token or pa

typescript - Why @Input() in angular 4 behaving like two way data binding not one-way? -

according knowledge input 1 way communication. changes made @input() variable inside child not reflected in parent component. i have empty array in app component. app component have 2 child components. 1 form component(to add new entries) , second list component(to show entries) . empty array passed form comp of input. change in input() array inside form component reflects in root component. , list component gets updated. here code: app.component.ts @component({ selector: 'app-root', template: `<div> <app-form [formelements]="serverelements"> </app-form> <app-list *ngfor = "let server of serverelements" [listserver]="server"> <app-list> </div>` }) export class appcomponent { serverelements = []; } app-form.component.html <div class="row"> <div class="col-xs-12"> <p>add new servers or blueprints!</p> <label>server

java - Running "hbase shell" giving error in OSX -

getting following error when trying run hbase shell in osx(version: 10.11.4): warning: -j-dfile.encoding=utf-8 argument ignored (launched in same vm?) warning: -j-xx:maxpermsize=1024m argument ignored (launched in same vm?) warning: -j-xmx4096m argument ignored (launched in same vm?) typeerror: can't convert pathname string require @ org/jruby/rubykernel.java:1071 require @ file:/usr/local/cellar/hbase/1.2.6/libexec/lib/jruby-complete-1.6.8.jar!/meta inf/jruby.home/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36 (root) @ /usr/local/cellar/hbase/1.2.6/libexec/bin/hirb.rb:118 i installed hbase brew : brew install hbase as given in solution here , trying set path variables following: ➜ ~ export hbase_home=/usr/local/cellar/hbase/1.2.6/libexec ➜ ~ export path=$hbase_home/bin:$path i have jruby-complete-1.6.8.jar in $hbase_home/lib , stated here . still same error continues. edit 1 ➜ rvm list: rvm rubies ruby-2.1.2 [ x8

android - open links in an in-app WebView -

i want implement in app browser links in app open in in-app browser ( same facebook app handle links). i have created new activity takes url , open , don't how initiate when link inside textview clicked (i have spannable text inside textview handles hashtagging). thanks. you can use library. library intend do. https://github.com/thefinestartist/finestwebview-android

javascript - Redirect to url, If Jwplayer error loading media -

i embedded jwplayer on page sometime video cant loaded, can me how make redirect new url if jwplayer cant load file this code: <script type='text/javascript'> jwplayer('player').setup({ file: 'http://blog.com/stream.m3u8', image: 'http://blog.com/streamimage.png', title: 'streaming title', width: '100%', height: "100%", aspectratio: '16:9', skin: 'glow', mute: 'true', ga: '{}' }); </script> this code change source video, need make redirect new url use header location jwplayer().onerror(function(){ jwplayer().load({file:"http://jwplayer.com/errorfile.mp4", image:"http://blog.com/streamimage-error.png"}); // }); like this: <?php header("location: http://www.example.com/"); ?> /* redirect browser */ please me to redirect using javascript

How to use TimeAgoPipe of MomentModule from typescript file in angular 2 -

this question has answer here: angular2-moment pipe in javascript 1 answer i want use moment.js displaying age of marker shown in google map in ionic 2 app. have installed moment.js npm install --save angular2-moment the doc of angular2-moment explains how use amtimeago template. couldn't find using type script file. decided try myself. first imported timeago pipe in app.module.ts , provided it import { timeagopipe } "angular2-moment"; ........... providers: [ ............. timeagopipe ] but when create constructor of timeagopipe below importing file in component following error. code : import { timeagopipe } "angular2-moment"; ........... constructor(private timeagopipe: timeagopipe) {} error : uncaught (in promise): error: no provider changedetectorref you need add import { changedetectorref } '@angul

html5 - How to display a 5secend video before page load in html? -

i have simple html5 landing page , want show 5secend video before main page. popup or want display video without borders,playback buttons etc. , load main page. greetings! tried <script> function opencolorbox(){ $.colorbox({iframe:true, width:"80%", height:"80%", href: "http://as2.asset.aparat.com/aparat-video/325cc0361862066dc06e8fb1fc7ec8a77684093-240p__39060.mp4"}); } settimeout(opencolorbox, -5000); $.colorbox({ overlayclose: true }); </script> a simple page loads video in bootstrap modal window. hope gives start! <!doctype html> <html lang="en"> <head> <title>page title</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css&

python - to_latex: Incorrect Encoding for Strings (with Backslashes) -

i have dataframe df looks this: | | b | ... | ------------------------- | a\b\c | 2 | ... | | p\y\c | 9 | ... | | a\d\x | 4 | ... | calling to_latex on dataframe returns strings a\textbackslashb\textbackslashc , error latex. are there options or common encoding strategies this? edit: using escape=false returns a\b\c error latex.

java ee - After upgrade WildFly 8.2.1 to 10.0.0 "WELD-001304: More than one context active for scope type javax.enterprise.context.SessionScoped" -

i have web application working fine on our machines, , fine on many different installations. 1 customer have strange problems , not have idea reasons. environment: wildfly 10.0.0 own ear java 8 ui jsf/richfaces. jpa postgres 9.6.2-3 windows browser: firefox , internet explorer problem: the customer did not had problems older version, using wildfly 8.2.1 , postgres 9.3. since update 10.0.0, 1 of 3 servers produces 500 error messages in browser, based on exceptions: 2017-07-20 15:14:40,642 error [io.undertow.request] (default task-43) ut005023: exception handling request /ws/elresolver: org.jboss.weld.exceptions.illegalstateexception: weld-001304: more 1 context active scope type javax.enterprise.context.sessionscoped @ org.jboss.weld.manager.beanmanagerimpl.internalgetcontext(beanmanagerimpl.java:720) [weld-core-impl-2.3.2.final.jar:2.3.2.final] @ org.jboss.weld.manager.beanmanagerimpl.getcontext(beanmanagerimpl.java:687) [weld-core-impl-2.3.2.final.jar:2.3.

Reading and writing to files C++ -

this question exact duplicate of: feof() , fscanf() stop working after scanning byte 1b char. because 'esc' in ascii? can do? 1 answer i've got problem regarding output/input files. here program: #include <bits/stdc++.h> using namespace std; int main() { file * out; out=fopen("tmp.txt", "w"); for(int i=0; i<256; i++) { fprintf(out, "%c", char(i)); } fclose(out); file * in; in=fopen("tmp.txt", "r"); while(!feof(in)) { char a=fgetc(in); cout<<int(a)<<endl; } fclose(in); } and here output: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 -1 why stopping quickly? mean char(26) eof ? how write file (of type) overcome problem? i'm looking way freely write values (of range, can char , in

python - How to ignore very first value in a CSV file? -

i have csv file (node.csv) following data: 0 1 2 3 4 0 12.0 12.5 11.0 10.0 nan 1 15.0 18.0 nan 15.0 17.0 2 20.0 nan 20.0 28.0 27.0 #####this output following format of data: sensor_values = {0: {0: 12.0, 1: 15.0, 2: 20.0}, 1: {0: 12.5, 1: 18.0, 2: np.nan}, 2: {0: 11.0, 1: np.nan, 2: 20.0}, 3: {0: 10.0, 1: 150.0, 2: 28.0}, 4: {0: np.nan, 1: 15.0, 2: 27.0} } of course, above data clearer picture. actual data in file following: ,0,1,2,3,4 0,12.0,12.5,11.0,10.0,np.nan 1,15.0,18.0,np.nan,15.0,17.0 2,20.0,np.nan,20.0,28.0,27.0 there absolutely no problem when try print data in file using pandas dataframe output looks 1 wrote above. problem arises when try load data list using following code: import pandas pd #some other code sensor_values = pd.read_csv('node.csv') #or using instead of read_csv - #sensor_values = pd.dataframe.from_csv('node.csv

cluster computing - Elasticsearch query result consensus across replica nodes -

i'm working on project uses elasticsearch primary data store sensitive data needs resilient corruption. indexes split 5 shards 2 replicas across 3 machines. is there built in way send queries 3 nodes , check consensus? need code explicitly in client or can data node happen connect handle me? also, elasticsearch perform parity/integrity checks on source , index data, aside potentially slow startup check when index.shard.check_on_startup enabled? or need handled fault tolerant fs or in hardware raid-5/10?

linux - How do I configure my "mv" command to include "-i" option even when I forgot it? -

i want configure mv command implicitly include "-i" default. sometimes forgot use , mess files... adding answer include unaliasing option, need add ~/.bashrc or ~/.zshrc based on login shell permanent alias. alias mv="mv -i" then can source take effect on current login source ~/.bashrc or logoff , login again or open new shell interactive behavior sometimes, if want disable behavior temporarily, can \mv file1 file2

excel - Select multiple folders - VBA -

Image
i'm using macro merge csv files one. macro working good, have 1 block, allows select folder csv files merge. two questions: can choose more 1 folder merge? (in 1 folder have lot of csv files.). how can choose other initial directory choose folders? need use folders server. code block: 'browse folder csv files set oapp = createobject("shell.application") set ofolder = oapp.browseforfolder(0, "select folder csv files", 512) if not ofolder nothing foldername = ofolder.self.path if right(foldername, 1) <> "\" foldername = foldername & "\" end if now availability choose 1 folder from: i love choose more this: selecting multiple folders not possible @ all. selecting two folders @ same time not work. you can select … multiple files in one folder (see @funthomas answer ) or one folder only. here how select one folder: public sub selectfolder() dim fdl filedialog

android - Need help to make site with webView with external link handling like "magnet" -

Image
i have made simple app website webview. it's torrent site. post magnet link in site. want when click on magnet link torrent app bit-torrent catch address automatically. plus other external site link open in external browser chrome. i have followed online tutorial here (stackoverflow) old , used shouldoverrideurlloading , google says method deprecated in api level 24. here https://developer.android.com/guide/webapps/webview.html have followed google use code.(modified match site) not working. please me this. private class mywebviewclient extends webviewclient { @override public boolean shouldoverrideurlloading(webview view, string url) { if (uri.parse(url).gethost().equals("www.example.com")) { // web site, not override; let webview load page return false; } // otherwise, link not page on site, launch activity handles urls intent intent = new intent(intent.action_view, uri.parse(url)); startactivity(intent); return true; }

mongodb - Reference is not checking exact type -

i defined model mentioned below: var questionschema = new schema({ askedby: {type:objectid, ref:'user'}, relatedcourses: [ {type: objectid, ref:'course'} ] }) module.exports = mongoose.model('question', questionschema, 'questions') (because of bug) @ time of saving/creating new document of type question, relatedcourses field assigned array of object ids other 'course', , mongoose didn't produce error, , saved document. it took sometime dig , find error. my question is, why mongoose not checking exact schema type? need of mentioning 'course' in ref field when objectid sufficient? i found mongoose-id-validator, doing required type validation.

node.js - Passport strategy for authenticating with LinkedIn using the OAuth 1.0a API return undefined email on save User -

i beginner in node.js development , trying build application based on express framework. implemented passport-local passport-facebook , passport-linkedin users sign , log in application linking multiple social account single user account in mongodb (from tutorial ). my problem undefined e-mail field when using passport-linkedin if can firstname , lastname correctly authenticated user. passport.js passport.use(new linkedinstrategy({ consumerkey : configauth.linkedinauth.consumerkey, consumersecret : configauth.linkedinauth.consumersecret, callbackurl : configauth.linkedinauth.callbackurl, passreqtocallback : true // allows pass in req our route (lets check if user logged in or not) }, function(req, token, tokensecret, profile, done) { // asynchronous process.nexttick(function() { // check if user logged in if (!req.user) { user.findone({ 'linkedin.id' : profile.id }, function(err, user) { if (err) return done(err); if (user) {

c - How to pass structures to functions whose parameter type has two asterisks -

let there structure called employee : struct employee { int basicsalary; int bonus; int netsalary; }; let there function prototype follows : int calc_netsalary(struct employee**,int); let variable array of structures declared in main function follows : struct employee emp[100]; let function called in main follows : for (i = 0; < n; i++) { emp[i].netsalary = calc_netsalary(emp[i],n); // warning here } let function definition follows : int calc_netsalary(struct employee** emp,int n) { int i; for(i = 0; < n; i++) { emp[i]->netsalary = emp[i]->basicsalary + emp[i]->bonus; } return emp[i]->netsalary; } i don't know pass argument function expects parameter 2 asterisks (in place of emp above). getting warning passing argument 1 of ‘calc_netsalary’ incompatible pointer type . know must silly mistake did or not clear concepts of pointers. please ! expanding on comment: the calc_netsalary fu

selenium - How to save Firefox webdriver session in python -

to save chromedriver session, used snippet of code: from selenium import webdriver selenium.webdriver.chrome.options import options options = options() options.add_argument('user-data-dir= path save session') driver = webdriver.chrome(executable_path='path chromedriver.exe', chrome_options=options) i tried same thing firefox doesn't seem work: from selenium import webdriver selenium.webdriver.firefox.options import options options = options() options.add_argument('user-data-dir= path save session') driver = webdriver.firefox(executable_path='path geckodriver.exe', firefox_options=options) is right way go or did miss something?

rxjs - Angular 2 & Vanilla JS : Wait for images to load before making http calls -

i using service upload images on server. here : addpictures(files: file[], folder: string): observable<parse.object[]> { let haserror = false; (let file of files) { let [type, ext] = file.type.split('/'); if (type.tolowercase() !== 'image' || !environment.imgexts.includes(ext.tolowercase())) { haserror = true; } } if (haserror) { return observable.throw('invalid extension detected'); } let observables: observable<parse.object>[] = []; (let file of files) { // size let img = new image(); img.onload = () => { // create parse document let parseimg = { url: '', type: file.type, width: img.width, height: img.height }; // upload on amazon , add db observables.push(this.addpicture(parseimg, file, folder)); console.log('pushing array'); } img.src = window.url.createobjecturl(file); } console.log('forkjoin'); return observable.forkjoin(observables);

javascript - Cordova unable to post data to server using ajax -

i developing phonegap cordova application , want post data server using ajax not able to, getting error. my example code is: <script> $(document).ready(function() { $('#frm').submit(function() { var username = $('#textinput').val(); var username = $.trim(username); var password = $('#passwordinput').val(); var password = $.trim(password); { alert('please enter username'); return false; } else if(password =='') { alert('please enter password'); return false; } else { var user = $('[name=username]').val(); var pass = $('[name=password]').val(); $.ajax({ type: 'post', url: 'http://eqfree***p.com/log_sb.php', rossdomain: true, beforesend : function() {$.mobile.loading('show')}, complete : function() {$.mobile.

swift - How do I update a UITableView on a timer while scrolling -

my problem complicated explain best explain it. i'm doing swift application tableview. in tableview, have data store in local (dictionnary, arrays, var, ...). so, in tableview i'm refreshing datas every 0.01 second. then, when scroll tableview refresh stopped , don't want it. want "continue refresh". someone can explain how can it? search on stackoverflow , answer : thread. understood thread in c it's vague me in swift. if have exercise train multithreading in swift can post ! thanks time. p.s: can post code don't think it's necessary question. edit: there code timer , update override func viewdidload() { timer = timer.scheduledtimer(timeinterval: 0.01, target: self, selector:#selector(viewcontroller.updatetimer), userinfo: nil, repeats: true) } func updatetimer () { var j = 0 _ in rows { if (rows[j]["activ"] as! bool == true ) { rows[j]["timer"] = (rows[j]["timer"] as! double + 0

r - Testing Recommendation systems: How to specify how many items were given for the prediction. `calcPredictionAccuracy` function -

i trying test binary recommendation systems created recommenderlab package. when run calcpredictionaccuracy function following error: error in .local(x, data, ...) : need specify how many items given prediction! have performed numerous searches , can't seem find solution issue. if try add given argument error changes to: error.ubcf<-calcpredictionaccuracy(p.ubcf, getdata(test_index, "unknown", given=3)) error in .local(x, ...) : unused argument (given = 3) here quick @ code: my data set binary.watch.ratings affinity.matrix <- as(binary.watch.ratings,"binaryratingmatrix") test_index <- evaluationscheme(affinity.matrix[1:1000], method="split", train=0.9, given=1) # creation of recommender model based on ubcf rec.ubcf <- recommender(getdata(test_index, "train"), "ubcf") # creation of recommender model based on ibcf comparison rec.ibcf <- recommender(getdata(test_index, "train"), &quo

url rewriting - URL redirect with wrong param web.config -

i have url coming in third party bit wrong. using "?" twice in there. https://www.abcsite.com/?data=w35vtqiavxwfi4gmesj8egcg1cdf2at%2buf3d?utm_source=external%20system&utm_campaign=external%20system&utm_medium=ex.com&utm_content=mmb one question mark @ start correct " https://www.abcsite.com/?data " and 1 in middle "3d?utm_source=extern" i want redirect using url rewrite/redirect , fix/replace 2nd ? &. want using web.config. any appreciated. if have question or not clear please let me know. thanks.

jquery - Wordrepss Ajax Load More unsual grid -

i create unsual grid ajax load more plugin creating ul li blog posts, make row 4 elements row 3 elements 4 , 3 elements rows again , again. how can that, far in css i've set 25% width li. since it's loading in ajax js script counter dosn't want work. please help. something this? make sure correct number of posts go rows. * { box-sizing: border-box; } ul { padding: 0; list-style: none; margin: 0; } .row { display: flex; width: 100%; } .row:nth-child(odd) { background: red; } .row:nth-child(even) { background: blue; } .post { height: 50px; border: thin solid black; } .row:nth-child(odd) .post { width: 25%; } .row:nth-child(even) .post { width: 33%; } <div class="container"> <ul class="row"> <li class="post">post</li> <li class="post">post</li> <li class="post">post</li>

haskell - LiquidHaskell: Trying to use assume keyword, but data type is not numeric -

i'm trying write specifications data.ratio module. far have: module spec data.ratio import ghc.real data.ratio.denominator :: ghc.real.integral => r : ghc.real.ratio -> {x:a | x > 0} the code i'm verifying is: {-@ die :: {v:string | false} -> @-} die msg = error msg main :: io () main = let x = 3 % 5 print $ denominator x if denominator x < 0 die "bad ending" else putstrln "good ending" the code judged safe, because denominator never returns negative value. i found strange because have written x <= 0 postcondition, according documentation of data.ratio module impossible. apparently liquid haskell not compare postcondition implementation of denominator . my understanding since function implementation not checked, i'm better off using assume keyword: assume data.ratio.denominator :: ghc.real.integral => r : ghc.real.ratio -> {x:a | x > 0} however, get: error: bad type specification assu

security - What is the registry key for option "Use smart filter" under "Miscellaneous" section in IE11 -

i looking registry key of option "use smart filter" available under "miscellaneous" section of "security settings trusted sites zone" popup of "trusted sites". internet explorer version used : ie11 please navigate to: 1. tools -> internet options. 2. click on security tab -> choose trusted sites. 3. now, click on custom level button 4. security settings trusted sites zone popup appears. the above popup mean , there option "use smart filter" under "miscellaneous" section of "security settings trusted sites zone" popup of "trusted sites". https://msdn.microsoft.com/en-us/library/dn479870.aspx i came across above link not available. please tell me registry key of option "use smart filter" in ie11. and, how disable same "trusted sites" via registry command.

json - i have some marker, every marker with it's info. window , how can i customize them in one info window on javascript -

i have marker, every marker it's info. window , how can customize them in 1 info window, , every time re-assign data when click on different one? on javascript self.getcontent = '<div class="window-content" style="background-color:#a0785c;padding:5px;color:#fff;text-transform:uppercase; border-radius:5px;"><div class="title"><h4 style="color:#38c3ea;">' + self.title + "</h4></div>" + '<div class="extrcontent"> ( ' + self.lat + ' , ' + self.lng + " ) </div>" + '<div class="extrcontent"> city ->' + " " + self.city + "</div>" + '<div class="extrcontent"> street ->' + " " + self.street + "</div>" + '<div class="extrcontent">' + self.checkinscount + " checkins </div></div>"; }); self.getco

java - How can I execute a plug-in, declared on parent pom.xml, on a spesific child pom.xml in Maven? -

i working on java ee project consists of parent project, , list of sub-projects (modules). have declared , configured plug-in on parent project's pom.xml within <pluginmanagement> tag follows: parent pom.xml ... <pluginmanagement> <plugins> <!-- inmem-db-plugin --> <plugin> <groupid>com.btmatthews.maven.plugins.inmemdb</groupid> <artifactid>inmemdb-maven-plugin</artifactid> <version>${version.inmemdb-plugin}</version> <inherited>true</inherited> <executions> <execution> <id>rundb</id> <goals> <goal>run</goal> </goals> <configuration> <monitorkey>inmemdb</monitorkey> <monitorport>11527</monitorport> <daemon>true</daemon> <type>derby</type>

Compile error: Argument not optional vba excel -

i'm trying write code input image after checking info in each sheet of workbook. since added each code stoped working , started giving me compile error message, code works without each want automatic. can u guys help? pt-br: estou tentando montar um código onde ele verificar todas planilhas e insere imagem conforme os dados em determinada célula. o código funciona sem o loop mas quero que seja todo automático e desde que inclui o each aparece esse erro de compilação. se puderem me ajudar com o que se trata agradeço. sub foreachws() dim ws worksheet each ws in activeworkbook.worksheets call worksheet_selectionchange next ws end sub sub worksheet_selectionchange(byval target range) on error resume next if target.column = 2 , target.row = 1 ' onde clicar para buscar imagem buscarimagemtavares (target.value) end if end sub sub buscarimagemtavares(produto string) on error resume next 'autor: tavares if range(&quo

excel - DAX: Calculated Column with Multiple Tables Filter -

Image
this relates adding calculated column table fetches rows 2 other tables based on criteria. consider model this: i want come calculated column called 'budget material consumption' in table 'actual material utilization'. should calculate how material should have been utilized in order produce products sold per standard recipe table. i wanted use following formula not working: =calculate( sum(recipe[rm_qty]) * sum(sales[qty]) , filter(recipe, recipe[rm_id]=utilization[rm_id]) , filter(sales,sales[product_id]=recipe[product_id]) ) hope able explain query fine. regards.

asp.net - C# - NReco.PdfGenerator non english character not rendering -

i using nreco.pdfgenerator library generate pdf html. working fine english language. required include non-english language(marathi) , in case not working expected. rendering black boxes. this action method: public actionresult assesment_downloadresultsummarydata(string htmlcontent){ var htmltopdf = new htmltopdfconverter(); var margins = new pagemargins(); margins.bottom = 10; // margins.left = 5;margins.right = 5; margins.top = 10; htmltopdf.margins = margins; htmltopdf.customwkhtmlpageargs = "--enable-smart-shrinking --encoding <encoding>"; htmltopdf.pagefooterhtml = $@"page <span class=""page""></span> of <span class=""topage""></span><br />"; //htmltopdf.orientation = nreco.pdfgenerator.pageorientation.portrait; html

jsf - PrimeFaces does not render -

primefaces not render though renders example code (i borrowed code primefaces website). <ui:fragment xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:p="http://primefaces.org/ui" xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:pe="http://primefaces.org/ui/extensions"> <div style="height:500px"> <h:form> <p:growl id="msgs" showdetail="true" /> <p:dashboard id="board" model="#{dashboardview.model}"> <p:ajax event="reorder" listener="#{dashboardview.handlereorder}" update="msgs" /> <p:panel id="sports" header="sports"> <h:outputtext value="sports content" />

javascript - Apply function to current click and remove function for other click -

trying apply function adddiv() current clicked element , it's working fine, it's not removing function adddiv() on click. when click on text, adddiv() function applied div tag , added sample text, need apply adddiv() function on current clicked tag. can me? here link: https://jsfiddle.net/a0l2jj1y/1/ html <div> tesing 1 </div> <div> tesing 2 </div> <div> tesing 3 </div> js $(function(){ function adddiv(){ $('<div class="txt"/>').text('sample text added').appendto('.clicked'); } $(document).on('click', function(event){ var clickedtag = event.target event.stoppropagation(); $('.clicked').removeclass('clicked'); if($(clickedtag).text().length >= 1){ $(clickedtag).addclass('clicked'); adddiv(); } else { // need remove adddiv(); } }); });

elixir - How can I get the "base url" of a Phoenix app? -

when run phoenix app locally, base url requests http://localhost:4000 . in production, it's https://example.com/ . i want pass base url along javascript. how can it? note: i don't want check conn ; want set during compilation or boot, not @ request time. i know can check application.get_env(:myapp, myapp.endpoint)[:url][:host] % , doesn't include scheme ( http or https ) or port. if have piece several places, can, i'd rather not. you can use myapp.endpoint.url() the link 1.3 docs since documents functions generated in app's endpoint callbacks, function available @ least since 1.2 (i haven't checked earlier).

java - Throwing ResourceAccessException vs HttpClientErrorException for RestTemplate client in Spring -

using spring 4.3.1 on apache tomcat 8.5, have implemented rest server handles get, post & put requests. post request handled in form: @post @consumes({mediatype.application_xml, mediatype.application_json}) @transactional public response postmethod(final mydomain object) { domainhandler.createdomain(object); return response.status(201).entity(object).build(); } during handling post request on server side, webapplicationexception thrown, handled by: @provider public class webexceptionmapper implements exceptionmapper<webapplicationexception> { @override public response toresponse(webapplicationexception exception) { int httpstatus = exception.getresponse().getstatus(); errormessage em = new weberrormessage(exception.getmessage()); return response.status(httpstatus).entity(em).build(); } } on client side: response = rest.exchange(requesturl, method, requestentity, mydomain.class); the resourceaccessexception

media player - Voice does not record when playing video in video view in android -

i developing application want start recording voice on button click, , want star playing video in video view @ same time. app works on androdi 4.2 , android 5.1 not work on latest device android 7.0. here code public class mainactivity extends activity { button start,stop,play; boolean recording=false; string press_value="exit"; private static final string audio_recorder_folder = "audiorecorder"; boolean let_start_recording=true; imageview startiv,profileiv; boolean recording_is_in_progress=false; videoview vv ; mediaplayer mplayer; relativelayout mainrel; ///new media player string audiosavepathindevice = null; mediarecorder mediarecorder ; random random ; string randomaudiofilename = "abcdefghijklmnop"; public static final int requestpermissioncode = 1; mediaplayer mediaplayer ; @suppresswarnings("deprecation") @override protected void oncreate(bundle savedinstan