Posts

Showing posts from July, 2015

html - Variable PHP inside a Div Modal -

i have php variavel named $table , , want show modal variable, it's no working <div class="modal-dialog modal-lg"> <div class="modal-content" value="'.$table.'"> </div> how can solve ? your php values have emitted server-side code. html markup alone won't interpret them. this: <div class="modal-content" value="<?php echo $table; ?>">

java - Deleting whitespaces before a certain characters with regex -

say, have string first line , need convert second line. "english ,spanish ,eastern japanese " "english,spanish,eastern japanese" as see, there several whitespaces before commas, each element may have spaces between variables, (like "eastern japanese"). so, need delete multiple whitespaces coming before commas. can trim last occuring whitespaces before using replaceall() method, no problem. you can remove excessive spaces replaceall : string s = "english ,spanish".replaceall("\\s+,",","); see ideone demo or trim() : system.out.println("english ,spanish ".replaceall("\\s+,",",").trim()); another demo and hint: if there spaces trim after , , add \\s* after , in pattern: .replaceall("\\s+,\\s*",",")

Selenium IDE : how to handle popup when popup name is dynamically generated -

how handle popup when name dynamically generating. please advice. usually, if it's new tab or window, using selectpopup trick. once you're done verifying want on popup, close | | selectwindow | null | to main window.

python: Convert from PNG to JPG without saving file to disk using PIL -

in program need convert .png file .jpg file don't want save file disk. use >>> pil import imag >>> ima=image.open("img.png") >>> ima.save("ima.jpg") but saves file disk. dont want save disk have converted .jpg object. how can it? you can trying using bytesio io: from io import bytesio def converttojpeg(im): bytesio() f: im.save(f, format='jpeg') return f.getvalue()

Informatica Data Quality Developer Tool Parameter file -

my project migrated power center idq developer , had move mappings idq developer. able migrate except parameter files. it seems layout , syntax parameter file different power center. there can supply sample of parameter file idq? sample shell script run mapping or application command line.

ruby - Using a rails engine in rspec -

how can create rails engine inside of spec test? using test gem. here trying module zan class engine < ::rails::engine isolate_namespace myengine end end and getting failure/error: class engine < ::rails::engine nameerror: uninitialized constant rails i've tried bundle exec rake spec same result. you need add rails dependency of gem, , require in spec helper: # your_gem.gemspec spec.add_development_dependency 'rails' # spec_helper.rb require 'rubygems' require 'bundler/setup'

How to handle/catch error from database trigger, in YII2 -

this trigger create or replace trigger trg_cek_pengurus before insert on tbl_pengurus each row declare v_cek number(2); begin if :new.jabatan = 1 or :new.jabatan = 2 select count(id) v_cek tbl_pengurus idkoperasi = :new.idkoperasi , jabatan = :new.jabatan; if v_cek > 0 raise_application_error (-20000, 'kepengurusan sudah ada'); end if; end if; end; / nah.., if trigger have return value good,:v doesn't :v set raise_application_error and controller public function actiontambahpengurus() { $model = new pengurus(); if ($model->load(yii::$app->request->post())){ $model->idkoperasi = yii::$app->user->identity->id; if($model->save()) return $this->redirect('kepengurusan'); } return $this->render('tambah-pengurus',[ 'model' => $model, ]); } and error sqlstate[hy000]: general error: 20000 ocistmtexecute: ora-20

javascript - How to using two <script> 's in single View Page -

i have write code onload function. have scritps execute in click function. in same script window.load=alert("loaded"); not working open new <script> window.load = alert("loaded"); </script> is working. whats wrong code.. thanks in advance. i think you. <!doctype html> <html> <body onload="myfunction()"> <h1>hello world!</h1> <script> function myfunction() { alert("page loaded"); } </script> </body> </html>

XPages Dialog boxes stacking -

Image
i got problem, dialog boxes stacking each time click button opens dialog. if i've clicked 3 times this: i couldn't find out how prevent this. no matter button click (ok partial refresh | abbrechen (cancel) full update) box each time click button. code of button opens dialog: <xp:button value="plan meeting" id="buttonplanmeeting"> <xp:eventhandler event="onclick" submit="true" refreshmode="complete"> <xp:this.action><![cdata[#{javascript:try { var c = getcomponent("dplanmeeting") c.show(); } catch(e) { dbar.error(location + e); }}]]></xp:this.action> </xp:eventhandler> </xp:button> code complete dialog box: <xe:dialog id="dplanmeeting" title="plan meeting" keepcomponents="true"> <xp:panel> <xp:text escape="true" id="mbplanmeeting"> <xp:this.value&g

java - Building scala with SBT to make JAR and folder with dependencies -

i have project in scala (a kind of test utility) used in sbt run way. demo want prepare in form not require sbt or scala preinstalled (only jvm ). first i've tried use sbt-assembly plugin lost fighting duplicate entries. i'm curious whether can compile to: single jar -file containing application itself; and lib directory containing raw set of dependency jars. i hope in such case easy run of main-class , class-path: ./lib/* fields in manifest - wrong? if correct, how can achieve this? update: @ last conquered (it seems so) sbt-assembly approach, question not urgent (though i'm still curious extend knowledge of using sbt). when execute sbt-assembly , depedencies, app , resources package single jar file. you can override config properties in runtime by: java -cp conf/:myappdemo.jar app.run.mainclass put config properties files in conf folder.

javascript - How to Filter the value pasted in TextArea -

have text area enter semicolon separated values, able process keyboard events , validating successfully.how validate same on copy paste. $(function () { var kpi = document.getelementbyid('<%=this.d.clientid%>').value; var tb = $('#<%= textbox.clientid %>'); $(tb).keypress(function (e) { var regex = new regexp("[0-9;]+$"); var str = string.fromcharcode(!e.charcode ? e.which : e.charcode); if (regex.test(str) && !($(this).val().match(/;{2,}/))) { var = $(this).val().match(/;/ig) || []; var len = as.length; if (len < kpi) { return true; } } e.preventdefault(); return false; }); $(tb).keyup(function (e) { var str = string.fromcharcode(!e.charcode ? e.which : e.charcode); if (($(this).val().match(/[;]{2,}/g))) { var shortenedstring = $(this).val().substr(0, ($(this).val().length

linux - how to issue command to server and issue a command with a delay for 5sec to DUT using single python file -

i want start linux server , issue command wait 5seconds , issue command on dut using python script. is possilbe within single python script or if @ use 2 python script how it? this doing 1)i have set ssh login withut password - working fine 2)start server command "ssh -i ~/.ssh/id_rsa server_name@ip-address < command >" - working fine 3)wait 5second - working fine 4)need start dut command - not working :( please me find solution using python not sure mean dut, commands accepted ssh command parametr: $ ssh -i ~/.ssh/id_rsa server_name@ip-address command and if want run command, wait , run second command, easiest way be: $ ssh -i ~/.ssh/id_rsa server_name@ip-address "command1; sleep 5; command2"

How do I find duplicates within two columns in a csv file, then combine them in Python? -

i working large dataset of protein-protein interactions, have in .csv file. first 2 columns interacting proteins, , order not matter (ie a/b same b/a, duplicates). there third column, source these interactions published. duplicate pairs can same source, or different sources. for duplicates 2 or more sources, how can combine them, in third column have of sources listed 1 interaction? (i.e. interaction a/b, duplicates a/b , b/a). here example of columns: interactor interactor b source b mary (2005) c d john (2004) b mary (2005) b steve (1993) d c steve (1993) in case, need interactor interactor b source b mary (2005), steve (1993) c d jo

regex - awk: comment a SQL statement -

i have huge file lines like insert mytable (),()... i'd replace lines beginning insert mytable by /* insert mytable (),()... */ i know there tons of possibilities, including vim search replace macro, i'd in command line. here's awk version: awk '{ gsub("^(insert.*)","/* & */"); print $0 }' this assuming insert first character on line. if there can leading spaces, use instead: awk '{ gsub("^([[:space:]]*insert.*)","/* & */"); print $0 }' this should work non-gnu awk's well. tested on linux , aix.

java - XSD FOR XML element multiple occurrences -

i'm new xsd , want generate xml below studentrecord occurring multiple times. i'm using jaxb generate classes on xsd <studentdetail> <studentinformation> <studentrecord> <name>abc</name> <class>4</class> <major>science</major> <grade>a</grade> </studentrecord> <studentrecord> <name>def</name> <class>4</class> <major>science</major> <grade>b</grade> </studentrecord> </studentinformation> my current xsd generates studentrecord once. <?xml version="1.0" encoding="utf-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/xmlschema" xmlns="http://webservice.com/ws" targetnamespace="http://webservice.com/ws" elementformdefault="qualified" attributeformdefault="unqualified"> <x

javascript - Index-Id always has the same value for every input -

so have dynamically created form index-id of inputs names championspell[] need know 1 thought of using index-id changes every inputs index same value when pressing add spell button. can test problem here http://89.69.172.125/test.php $(function() { $('body').on('click', '#addspell',function() { $( '<p><select name="change[]" id="change[]" onchange="val(this)"><option value="passive">passive</option><option value="q" selected>q</option><option value="w">w</option><option value="e">e</option><option value="r">r</option></select><label for="var"><input type="text" id="championspell[]" name="championspell[]" data-id="" readonly="true"><br><textarea type="text"

php - Searching for information about using info from form -

i modding system. , need information. situation - have got login form, , have got index file checks inputed data if ( username, password ). have created new select-box next inputs like: username:</p> password: </p> language: select box </p> i understood index.php file checks if username , password good, checks ain't using info... so, in order use language select box need use info not check. how use select-box value? tried doing $_post['language'], doesn't help. here index.php file https://jsfiddle.net/e40bsxox/1/ here html file https://jsfiddle.net/fd8x94j2/1/ in html file code have given select field name 'kalba'. in php file selected value using name as, in html file, <select type="language" id="kalba" name="kalba" class="text"> <option value="lt_lt" selected="selected">lietuvių</option> <option value="en_us">anglų</

iis - Calling shared drive folder using javascript -

i have 2 servers: , b. classic asp application deployed on server a. server b contains folder (scanneddocuments). have created shared drive on server point folder. share drive named q:. on ie 7, when try access file using javascript, using: window.open(file://q:/a.txt) it opens file. on ie 8 , above , versions of firefox, not opening. neither error generated nor file opening. i guess getting blocked browser's security features. please let me know how can open files on these browser versions. is there other way open remote file using javascript or using iis? ** edited ** tried creating virtual directory on iis , pointing shared drive. gives error: resource or directory not found. i using iis 7 @anant dabhi right - create simple ajax call server ant return file content. client (js). use instead of window.open(file://q:/a.txt) function getfile(filename) { $.ajax({ url: "/yourweb/file/get", data: { filename: fil

mysql - how to design mvc entity models -

its pain me design models. way iam progressing is: find out data involved create database data create entity models data manually ie without table2class conversion the reason told without table2class conversion is: need understand how on mysql/manually. beginner , feel hard each time put hand on area. consider example of saving rating employee , company. employee can rate self , several employees can rate company. database become: employeerating : id | employee_id | tag_id | rating companyrating : id | company_id | employee_id | tag_id | rating how design models scenario. don't it. below model wanted. [table("employee")] public class employee { [key] public int id { get; set; } ... public list<rating> ratings { get; set; } } [table("company")] public class company { [key] public int id { get; set; } ... list of list of rating can seperate each employee should come here } how design mode

objective c - NSEvent addGlobalMonitorForEventsMatchingMask:NSLeftMouseDownMask call two times -

i'm adding event nsleftmousedownmask function: mouselefclick = [nsevent addglobalmonitorforeventsmatchingmask:nsleftmousedownmask handler:^(nsevent *leftmousedown) { nslog(@"!!"); }]; when press first time it's call right when press second time function it's call 2 times , other clicks it's going right except second one. please me! thx!

r - Change label in ggpairs upper panel -

Image
do know how change labels in upper panel in ggpairs ( ggally package)? found how change size, font not label. here want shorten label ("set" pour setosa etc...). tried put in labels=c("set", "ver", "vir") or upper=list(params=list(size=8),labels=c("set", "ver", "vir")) doesn't work. ggpairs(iris, columns=c(2:4), title="variable analysis", colour="species", lower=list(params=list(size=2)), upper=list(params=list(size=8))) conceptually same @mike's solution, in 1 line. levels(iris$species) <- c("set", "ver", "vir") ggplairs(<...>) here's another, more flexible proposal if have many levels , not want abbreviate them hand: trim levels desired length. levels(iris$species) <- strtrim(levels(iris$species), 3) ggplairs(<...>) and way, width parameter vectorized: rm(iris) strtrim(levels(iris$species), c(1,

java - Why does crawling a folder in Linux gets faster with each iteration? -

i have program in need crawl specific folder delete contents. using files.walkfiletree method achieve same. on ubuntu 14.04, 64bit 4gb ram, although program runs fine, first time start crawling folder, takes long time. however, on subsequent crawls of same folder, time decreases drastically, , settles down. here output of simple system.currenttimeinmillis() calls check time spent: key : deletion tells time took crawl folder called 'output' , delete contents(around ~5000 files). copy tells time took copy contents of small folder on place. crawl tells time took crawl directory called 'content', parse ~5000 files create corresponding objects + deletion + copy [see above]. parse tells time took write contents of these ~5000 objects separate files. times in milliseconds. folder a on first time: deletion: 100100 copy: 53 crawl: 143244 parse: 4307 on second time: deletion: 486 copy: 3 crawl: 1424 parse: 4581 on third time: deletion: 567 copy: 16

php - Array shows values but print_r(array_values) is empty -

i'm getting response service , print_r() shows array seems different usual arrays. if print array_values it's empty. php: print_r($token); //result: array ( [{"access_token":"123","token_type":"bearer"}] => ) print_r(array_values($token)); //result: array ( [0] => ) why access_token , token_type values not listed in array_values ? the answer not json, it's not because have json type array. because there no value in array. //result: array ( [{"access_token":"123","token_type":"bearer"}] => ) that array has 1 index no value, hence array_values shows nothing. have created array incorrectlly :)

jquery - Truncate paragraph except image to show/hide rest with View more link -

hi newbie injavascript/jquery need help. have class including text , image. want in case text more 70 characters rest of hidden except image .moreover want @ end of truncated text see link view more on click expand full text.when text expanded link should become less doing opposite .im trying slidetoggle because seems smoother.. this tried di not manage either keep images or make view more link functional. assistance appreciated : var minimized_elements = $('.child_body').contents(':not(img)'); minimized_elements.each(function(){ var t = $(this).text(); if(t.length < 70) return; $(this).html(t.slice(0,70)+'<span>...</span><a href="#" class="more">view more</a>'); $("a.more").click(function(){ $("minimized_elements").slidetoggle(); }); });

Accessing Stanford Core NLP Coreference Chain output in Ruby -

i trying use stanford core nlp :coref_chain list of entity mentions out of text. when run code: text = 'angela merkel met nicolas sarkozy on january 25th in ' + 'berlin discuss new austerity package. sarkozy ' + 'looked pleased, merkel dismayed.' pipeline = stanfordcorenlp.load(:tokenize, :ssplit, :pos, :lemma, :parse, :ner, :dcoref) text = stanfordcorenlp::annotation.new(text) pipeline.annotate(text) puts text.get(:coref_chain) i output: {1=chain1-["angela merkel" in sentence 1, "merkel" in sentence 2], 3=chain3-["january 25th" in sentence 1], 4=chain4-["berlin" in sentence 1], 5=chain5-["nicolas sarkozy on january 25th" in sentence 1, "sarkozy" in sentence 2], 6=chain6-["a new austerity package" in sentence 1]} is hash? according documentation on stanford site, should able access these values through attribute names no combination has worked me. in fact, adding other

java - How can we put value on text field on output screen? -

i want put value in txtf1 @ output screen , it. how can put value on text field on output screen? import java.awt.color; import java.awt.textfield; import java.awt.event.actionevent; import java.awt.event.actionlistener; import javax.swing.jframe; import javax.swing.jpanel; import javax.swing.jtextfield; import javax.swing.swingconstants; public class demog extends jpanel implements actionlistener{ private textfield textf, txtf1; public void jhand(){ textf = new textfield(); textf.setsize(40, 40); textf.settext("20"); textf.seteditable(false); textf.setbackground(color.white); textf.setforeground(color.black); //textf.sethorizontalalignment(swingconstants.center); textf.setlocation(15, 15); //textf.addactionlistener(this); txtf1 = new textfield(); txtf1.setsize(40, 40); txtf1.gettext(); txtf1.seteditable(false); txtf1.setbackground(color.white); txtf1.setforeground(color.black); //txtf1.sethorizontalalignm

sql - ORACLE Trigger on INSERT and UPDATE for table containing the trigger condition -

i have configuration table records used control process in application. have table controlled application, it's not possible (no money, no time etc.). so, table managed client sql developer or so. ensure thet table filled need trigger, because check constraints don't work custom functions. trigger on insert works fine, have trouble trigger on update, because conditions trigger check in table error oracle, table being updated @ moment, trigger can't fired. table consists of following columns: id, source_system, target_system, table_id, valid_from, valid_through 1, 2, 3, 455, 01.12.2011. 02.11.2013 the condition following: can't have new record same source_system, target_system , table_id , dates overlap existing ones - new.valid_from , new.valid_through must outside existing period. example - both must < 01.12.2011 or > 02.11.2013. so question is, there way make work on update too? i've read using materialized v

android - Manually trigger click on Facebook Native Ad -

i using corona enterprise, , entire ui defined in corona's lua code. have setup facebook native ads, requested test ad, , used: nativead.getadcoverimage().geturl() nativead.getadcoverimage().getwidth() nativead.getadcoverimage().getheight() to download ad image , display @ correct ratio in lua code using: local function fbimagelistener(event) if event , event.response , event.response.filename print("received cover image") local testimage = display.newimagerect(maingroup, event.response.filename, system.temporarydirectory, e.coverwidth, e.coverheight) testimage.x, testimage.y = display.contentwidth * 0.5, display.contentheight * 0.5 end end network.download( e.coverurl, "get", fbimagelistener, "fbad.png", system.temporarydirectory) the problem have if add touch listener in lua code new display object, don't know how trigger "adclicked" function in fb sdk. i need put native ad corona display g

java - How can I find the target of a Java8 method reference? -

i want capture calls mock object public interface service { public string stringify(object o); } service = mockery.mock(service.class); mockery.allowing(service::stringify).with(42).will(() -> "42"); so inside allowing have function<object, string> is there reflecto-magic let me find service function created method reference? public withclause allowing(function<t,r> f) { object myservicebackagain = findtargetof(function); .... } i know function come these method references, i'm happy down-cast as necessary. this not same question related is possible convert method reference methodhandle? because, start isn't same question, in related area. , if can methodhandle, can't target it. using trick this post can find target. important method below findtarget . turns out, lambdas indeed capture targets, , can access them serializedlambda . however, pretty nasty reflection hack , it's break in future versions. no

Is it possible to click "OK" on an invisible pop up frame in selenium? python -

i need click "ok" on pop sign in costar.com. when frame pops up, freezes rest of window , does't allow me @ developer tools see elements. after looking @ source code, found invisible frame. if want see yourself: -go costar.com -click login -click login button you see type of invisible frame i'm talking about. using chrome search source code, can find invisible frame information searching "invisible" or "certificate". is possible interact frame? thank help. what getting alert you have switch alert , accept it alert = driver.switch_to_alert() alert.accept()

JQuery Tablesorter Pager: Get the currently viewed page number -

i have looked through documentation , few examples can't find answer this... how current page being viewed? it's purpose of limiting number of results returned database. thanks edit: updated name because realized how vague was if using original version of tablesorter (v2.0.5), page contained in: // table.config.page = zero-based index // value follows: var currentpage = $('table')[0].config.page; if using pager fork of tablesorter , can page ( demo ): // table.config.pager.page = zero-based page index var currentpage = $('table')[0].config.pager.page; or, if including page select in pager controls, use $('.gotopage').val() // one-based page index

Verify/validate User access for android app using facebook SDK at server side in PHP? -

i have android app. user can access app using facebook login. once user logged in, data/activity push web server using php. wanted validate user access app while accessing app. wanted check user app access status using access token when request comes php web server. main aim deny fake users request android web server security purpose. can me sort out problem . in advance.. <?php try{ require_once(dirname(__file__) . '\facebook-php-sdk\src\facebook\facebook.php' ); } catch(exception $o){ print_r($o); } $config = array( 'appid' => '123456', 'secret' => '5ca2b11ea4c8sdsdsd', 'allowsignedrequest' => false // optional should set false non-canvas apps ); $facebook = new facebook($config); $user_id = $facebook->getuser(); $user_id = '123456'; if($user_id) { // have user id, logged in user. // if not, we'll exception, handle below. try { $ret_obj = $facebook

html5 - Drop Down Navs not working with Bootstrap & Wordpress -

i'm using bootstrap create page templates wordpress site having trouble getting dropdown nav work when add child in wordpress menu screen. here header code... <body id="grad1"> <div class="mynavbar"> <div class="row"> <div class="col-md-3 col-sm-3 col-xs-1"> <img src="/wp-content/uploads/2015/07/logo_80px.png" class=" center-block space" alt="enter omnimark here"/> </div> <div class="col-md-6 col-sm-6 col-xs-0"> </div> <div class="col-md-3 col-sm-3 col-xs-1"> <img src="/wp-content/uploads/2015/07/omsemicircle.png" class=" center-block space" alt="enter omnimark here"/> </div> </div> </div> <nav class="na

Java - AWT: Making objects point to other objects -

i begginer java programmer awt, , i'm wondering how make enemy() point player() . here code far: player.java: import java.awt.color; import java.awt.graphics; public class player extends gameobject { public player(int x, int y, color color) { super(x, y, color); } @override public void tick() { x += velx; y += vely; } @override public void render(graphics g) { g.setcolor(color); g.fillrect(x, y, 32, 32); } } enemy.java: import java.awt.color; import java.awt.graphics; public class enemy extends gameobject { public enemy(int x, int y, color color) { super(x, y, color); } @override public void tick() { x += velx; y += vely; } @override public void render(graphics g) { g.setcolor(color); g.fillrect(x, y, 32, 32); } } so how can begin moving enemy() towards player() game works? you need reference gameobject s

MySQL and PHP inserting a date into a Date field -

i have date so: 07/15/2015 , trying insert date date database column. problem date database saves date 0000-00-00 how date save 2015-07-15 here code using insert: function insertcareer($connection, $date, $title, $text){ if($stmt = $connection->prepare("insert `careers` (date, title, text) values (?, ?, ?)")){ $stmt->bind_param('sss', $date, $title, $text); $stmt->execute(); $stmt->close(); echo 'career has been added <br>'; } } how can fix this? mysql not understand date in format you're providing it. considering ambiguous anyway ( d/m/y in europe, m/d/y in usa), should pass dates around y/m/d . select cast('07/01/2015' date); -- null select cast('2015/07/01' date); -- 2015-07-01 so use make work: $date = date('y-m-d', strtotime($date)); argh, b

regex - Extracting values from a regular expression & removing brackets in C# -

i'm trying take string of html , match instance of [image, h, w] h , w integers can 1200. this first foray learning regular expressions. here have far: regex r = new regex(@"\image, (\d+?), (\d+?)\]"); match match = r.match(controltext); but in regex tester not selecting final bracket, , in code not matching string should. so output want 'image, h, w', , there want parse h & w , store them in variable. i'm junior developer in second week @ first job , think i'm spending way time trying figure out. appreciated. tuple<int, int>[] imagesizes = (from match match in new regex(@"\[image, (\d+), (\d+)\]").matches(controltext) select new tuple<int, int>( int.parse(match.groups[1].value), int.parse(match.groups[2].value))).toarray(); example: string controltext = "[image, 1200, 100]abacaldjfal; jk[image, 289, 400]"; imagesizes [1200, 100], [289, 400] . edit: since

How to download a delayed file via HTTP in Ruby? -

i use following ruby function download various files via http: def http_download(uri, filename) bytes_total = nil begin uri.open( read_timeout: 500, content_length_proc: lambda { |content_length| bytes_total = content_length }, progress_proc: lambda { |bytes_transferred| if bytes_total print("\r#{bytes_transferred} of #{bytes_total} bytes") else print("\r#{bytes_transferred} bytes (total size unknown)") end } ) |file| open filename, 'w' |io| file.each_line |line| io.write line end end end rescue => e puts e end end i want download files ( csv , kml , zip , geojson ) this website . however, there some kind of delay set up. when click download link in browser takes bit until download window appears. suppose file needs processed on server before can served. how can modify script take delay account? i run

java - How to use the access_token to get contents of my App -

i need access podio app using access_token instead of being using username , password. code tried using username , password , working finr me. i'm using resourcefactory resourcefactory = new resourcefactory( new oauthclientcredentials("usedclientid","usedclientsecret"), new oauthusernamecredentials("abc@ggtd.com","test123")); apifactory apifactory = new apifactory(resourcefactory); itemapi itemapi = apifactory.getapi(itemapi.class); but need use accesstoken may not dependent on username , password accessing app. tried using url url = new url("https://podio.com/oauth/token?granttype=app&appid=88069&apptoken=6a83845c6656ff4678a5eec668a10aa3e7&clientid=usedclientid-79unji&redirecturi=https://podio.com/abcd/workappname/apps/usedclient&client_secret=jifs6qwsqjj99eddds1rmhmbkywahsmttylfw8gvefmmeaicyoodzdyc3yqdhbt"); httpurlconnection conn = (httpurlconnection) url.openconnection(); co

jsf - Log the number of submit button clicks though the form is invalid -

i trying log number of button clicks. 1. should log number of clicks though form invalid. field value1 in form integer. so, shall consider conversion errors. 2. action done @ backing bean i have tried listener on ajax. <h:form id="form"> <h:inputtext id="in" name="in" value="#{listenbean.value1}" autocomplete="off"> </h:inputtext> <h:commandbutton value="click me" action="#{listenbean.save}"> <f:ajax execute="@form" render="@form message eventcount" /> </h:commandbutton> <h:message for="in"/> button clicks: <h:outputtext id="eventcount" value="#{listenbean.eventcount}"/> </h:form> bean public void eventcount(ajaxbehaviorevent event) { //increment counter } public void save() { //save } issues: listener method not called wh

android - TextView.setVisibility(GONE) isn't working -

Image
i have seekbar textview shown above thumb when it's moving (as tooltip). also, there's edittext below seekbar: when i'm not moving seekbar's thumb, textview isn't shown. appears when move thumb or change number in edittext . want disappear when stop moving thumb, or after finish typing in edittext . i got disappear on stop-tracking problem sticks there if type in edittext . i tried: @override public void aftertextchanged(editable arg0) { textview.setvisibility(gone); } but doesn't seem work. when type appears, , sticks there, until move thumb. how can disappear after finish typing? you can try this: edittext.addtextchangedlistener(new textwatcher() { @override public void ontextchanged(charsequence s, int start, int before, int count) { } @override public void aftertextchanged(editable str) { new handler().postdelayed(ne

php - Make a custom login screen for the HWIOAuth Bundle using bootstrap -

{% extends '::base.html.twig' %} {% block content %} <div> {% if is_granted("is_authenticated_remembered") %} {{ 'layout.logged_in_as'|trans({'%username%': app.user.username}, 'fosuserbundle') }} | <a href="{{ path('fos_user_security_logout') }}"> {{ 'layout.logout'|trans({}, 'fosuserbundle') }} </a> {% else %} <a href="{{ path('fos_user_security_login') }}">{{ 'layout.login'|trans({}, 'fosuserbundle') }}</a> {% endif %} </div> {% type, messages in app.session.flashbag.all %} {% message in messages %} <div class="{{ type }}"> {{ message|trans({}, 'fosuserbundle') }} </div> {% endfor %} {% endfor %} <div> {% block fos_user_content %

java - Should I avoid using the annotation @Transactional when the transaction only reads data? -

i've migrated old style of transaction management transactionproxyfactorybean declarative transaction management recommended spring avoid exceptions transactions appear time time. for transactions save update delete added annotation: @transactional(propagation = propagation.required, rollbackfor = exception.class) it works me. the question is: should avoid using annotation @transactional when transaction reads data? example: public tradedata gettrade(long tradeid) throws exception { return em.find(tradedata.class, tradeid); } after reading this article, says: "better yet, avoid using @transactional annotation altogether when doing read operations, shown in listing 10:" i'm little confused , don't quite understand it. for read-only operations jdbc don't need @transactional because doesn't need transaction, hibernate does! can use @transactional(readonly = true) . sure don't update, delete, insert ac

audio - Remove Noise from wave -

i'm student. want t regarding how remove noises wave file in c#. there libraries or algorithms that??? have searched in internet did not meet answer. check out. may idea. http://www.codeproject.com/articles/837936/impulse-noises-detection-and-cancelation-in-music in mathlab environment. have try.. read beginning end.

Can I use a Django CMS placeholder inside an Apphook? -

i'm using django 1.7.8, django cms 3.1.2 , djangocms-blog , i'm trying add banners apphooked page consisting in group of blog entries. i've tried add placeholders template unsuccessful. below code i'm using on list. i've included placeholder called header-banners , doesn't show on cms frontend. is there way add placeholder inside apphooked page? thanks {% extends "base.html" %} {% load i18n cms_tags menu_tags %} {% block meta %} {% endblock meta %} {% block subnavbar %} <nav class="sub-navbar"> <div class="container"> {% language_chooser %} </div> </nav> {% endblock %} {% block content %} <div class="header-banner intro-banner blog-intro-banner"> <div class="container"> <div class="header"> <div class="item"> {% placeholder header-banners %} </div>

MySQLI prepared statement and show results of query for a date range entered with a PHP Datepicker on Form -

i trying execute mysqli prepared statement query mysql database , return results depending on data requested in form. have been able prepared statement work , brings data correctly. want able add 'date range' query , can't work. added date picker top of request form making from , to fields input type="date" . adds date fields in mm/dd/yyyy format. in database column i'm checking date type , it's in format yyyy-mm-dd . i've tried several different suggestions site , others i've come across searching errors. i've tried use strtotime , date , errors date in wrong format , fatal error can't construct dateperiod() . using php v5.5 read can use datetime::createfromformat along $string->format , use dateperiod , work fatal error call member function format() on non-object . please help. here code 'search form' <form action="../includes/test.inc.php" method="get"> <table border=&q

oracle - If-else for null condition SQL -

i going create livereport using 3 example inputs: document start date document end date emp id these 3 rows in sql table documentdata. what want reproduce following: if user not put value in "emp id" field, should show "document start date" , "document end date". otherwise, values corresponding "emp id" should shown. it may simple still need query. perhaps solution: -- should work select * documentdata case when :emp_id null 1 -- attention :emp_id introduced in stead of emp_id when emp_id = :emp_id 1 else 0 end = 1 the :emp_id should variable comes application (the field being altered user). 1 in case when statement acts true condition.

How to remove removed datanode details from hadoop cluster -

i used following property reduce dead node timeout. propertyname : dfs.heartbeat.recheck.interval value : 1 but when remove datanode cluster details not removed hadoop cluster.it in dead node state in cluster. please suggest way remove removed datanode details hadoop cluster. you can view live nodes or dead nodes alone using below hdfs commands hdfs dfsadmin -report -live hdfs dfsadmin -report -dead you can live node name or other particular details using below hdfs command hdfs dfsadmin -report -live | grep name: hope helps.

How to get request parameters in a Scalatra Servlet? -

i have working scalactra servlet. class myscalatraservlet extends myscalatrawebappstack { get("/") { response.getwriter().println("test") val scdate = com.example.app.scaladate.printdate() response.getwriter().println(scdate) val cmd = "spark-submit --jars /home/cloudera/desktop/sparkdisc/lib/dme.jar/..../discovery_2.10-1.0.jar hdfs:/user/cloudera/sample0.txt"//hard coded file path val output = cmd.!! // captures output response.getwriter().println(output) } } the file path hard coded. there can allow user enter in filepath parameters? appreicited! use get or post , can input parameter, this: import org.scalatra._ import scalate.scalatesupport import com.google.gson.gson import java.util.concurrent.timeunit import java.util.date class queue(var id: string, var act: string, var waitsec: int) { override def tostring = id + ", " + act + ", " + waitsec.tostring } class myscal

ios - AVFoundation Vs VideoToolbox - Hardware Encoding -

so more theoretical question/discussion, haven't been able come clear answer reading other posts , sources web. seems there lot of options: brad larson's comment avfoundation video decode acceleration videotoolbox if want hardware decoding on ios h.264 (mov) files , can use avfoundation , avassets, or should use videotoolbox (or other frameworks). when using these, how can profile/benchmark hardware performance when running project? - looking @ cpu usage in "debug navigator" in xcode? in short, i'm asking if avfoundation & avassets perform hardware encoding or not? sufficient, , how benchmark actual performance? thanks! if want decode local file on ios device - i'd use avfoundation. if want decode network stream (rtp or rtmp) use video toolbox - since have unpack video stream yourself. with avfoundation or video toolbox hardware decoding.