Posts

Showing posts from June, 2010

lambda - Processing a list of maps using Java 8 streams -

how can simplify code single lambda expression? idea there list of maps , create new list of maps, using filter on key. in example, want remap keeps keys "x" , "z". map<string, string> m0 = new linkedhashmap<>(); m0.put("x", "123"); m0.put("y", "456"); m0.put("z", "789"); map<string, string> m1 = new linkedhashmap<>(); m1.put("x", "000"); m1.put("y", "111"); m1.put("z", "222"); list<map> l = new arraylist<>(arrays.aslist(m0, m1)); list<map> tx = new arraylist<>(); for(map<string, string> m : l) { map<string, string> filtered = m.entryset() .stream() .filter(map -> map.getkey().equals("x") || map.getkey().equals("z")) .collect(collectors.tomap(p -> p.getke

search - Find the shortest path between two vertices a and b in a specified graph. Graph's properties are in the description. -

properties of graph: graph has v vertices , e edges. it connected, undirected , positive weighted. graph has 1 cycle. the goal find shortest path between 2 vertices , b in o(v) time. a link similar question if there's 1 appreciated. consider using breadth-first search , o(v+e) https://en.wikipedia.org/wiki/breadth-first_search

Incompatible types generics Java -

i did code: import java.util.linkedlist; public class node<t> { private t data; private linkedlist<t> children; public node(t data) { this.data = data; this.children = new linkedlist<t>(); } public t getdata() { return this.data; } public linkedlist<t> getchildren(){ return this.children; } } public class graph <t> implements network<t> { private node source; private node target; private arraylist<node> nodes = new arraylist<node>(); public graph(t source,t target) { this.source = new node(source); this.target = new node(target); } public t source() { return source.getdata(); } public t target() { return target.getdata(); } i error on source() , target(): required t found java.lang.object why? type of return of getdata() function it's t(generic type of return) private node source; private node target; these should node<t> . likewise on few of following lines. compiler

html - How can I make individual items on the nav bar stretch? -

in navagation bar, want hovered on elements stretch out , change color, seems whole navagation bar stretches. i've tried changing must hovered on trigger animation, nothing seems working. can identify , correct error? @keyframes mouse { 0% { background-color: #35b1c2; height: 40px } 100% { background-color: #2f9ebd; height: 60px } } ul { list-style-type: none; margin: 0; padding: 0; overflow: hidden; background-color: #35b1c2; } li { float: left; } li { display: block; color: white; text-align: center; padding: 14px 16px; text-decoration: none; } li:hover { animation-fill-mode: forwards; animation-duration: 0.5s; animation-name: mouse; } li { border-right: 1px solid #bbb; } li:last-child { border-right: none; } <ul> <li><a href="index.html">home</a></li> <li><a href="aboutme.html">about me</a>&

html - My php header code fails to serve the proper logo -

i have wordpress theme not recognizing logo. found header.php file. shows following code generates logo <?php siteorigin_north_display_logo(); ?> site origin north theme name. have added logo going appearance -> customize -> site identity area not show up. instead uses default logo name highline.png does know how can edit pulls image media library? not have experience php , got far of stackoverflow the rest of sections code below in case needed. <div class="site-branding"> <?php siteorigin_north_display_logo(); ?> <?php if ( siteorigin_setting( 'branding_site_description' ) ) : ?> <p class="site-description"><?php bloginfo( 'description' ); ?></p> <?php endif ?> </div><!-- .site-branding -->

data modeling - Dimensions without any link to the fact table -

i designing dimensional model there dimensions orders, product, shipment, returns, items. my goal calculate metrics @ day level , populate fact table. the metrics count of orders per day, total gross sales per day, total net sales per day. i have designed dimensions , problem facing how design fact table. need these 3 metrics, want fact table have below 4 fields in fact table have better performance. but thing worried okay if leave dimensions isolated without connecting fact table? please kindly advise me on this. appreciated. thank you. if want calculate metrics - count of orders per day,total gross sales per day, total net sales per day. can directly transactional table. if doing dimensional modelling fact table should have granular details, in case, should order line item. have link dimensions fact can perform aggregations @ different level , slicing/dicing on aggregated data show details. now, if doing above , still want show metrics @ daily level c

javascript - Unsure of how to make this calculator function work -

link codepen for math project due soon. i've tried apply dry concept, don't know how. started write function apply of numbers, halfway through realized there's no way work. anonymous functions need changed know that, yet can't right don't know way implement it. document.queryselector(".button").addeventlistener("click", function) { num = document.getelementbyid('something'); if (num != null && num === document.getelementbyid("zero")) { calculation = calculation.concat("0"); } else if (num != null && num === document.getelementbyid("one")) { calculation = calculation.concat("1"); } else if (num != null === && num document.getelementbyid("two")) { calculation = calculation.concat("2"); } else if (num != nul && num === document.getelementbyid("three")) { calculation = calculation.concat("3");

node.js - Why are MongoDB upserts so much slower than inserts (with a unique index)? -

i've been testing limits of mongodb see whether work upcoming project , i've noticed upserts quite slow compared inserts. of course, i'd expect them slower, not (almost) order of magnitude slower (7400 vs 55000 ops/sec). here's (nodejs native driver) bench-marking code used: (async function() { let db = await require('mongodb').mongoclient.connect('mongodb://localhost:27017/mongo-benchmark-8764824692947'); db.collection('text').createindex({text:1},{unique:true}) let batch = db.collection('text').initializeorderedbulkop(); let totalopcount = 0; let batchopcount = 0; let start = date.now(); while(1) { totalopcount++; batchopcount++; if(batchopcount === 1000) { // batch 1000 ops @ time await batch.execute(); batch = db.collection('text').initializeorderedbulkop(); batchopcount = 0; let secondselapsed = (date.now() - start)/1000; console.log(`(${math.round(totalopcoun

python - Couldnt see the result of computed field as a normal user in ODOO V8 -

Image
i have problem, have 2 float computed fields. result , value seen if logged in adminstrator, couldnt seen if logged in normal user. ive set security in modul here field : class overtime_details(models.model): _name='overtime.overtime_details' ovrtm = fields.float(compute=attd_check, string='overtime hour(s)') ttalmtp = fields.float(compute=overtype_count, string='total multiplier') and here picture when logged in normal user : then here picture when logged in administrator : and here security permission csv : id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink overtime_formsec,overtime_formsec,model_overtime_overtime,,1,1,1,1 overtime_employee_list,overtime_employee_list,model_overtime_overtime_details,,1,1,1,1 overtime_type_list,overtime_type_list,model_overtime_type_overtime,,1,1,1,1 overtime_type_hours,overtime_type_hours,model_overtime_hour_overtime,,1,1,1,1 and here attd_check function : @api.model

How to loop two array and compare it if same checkbox is checked Angular 2 -

Image
i have 1 array contain office list. array user selected list. want display officelist , if value in selected list same office list checkbox checked. how did it. code <div *ngfor="let item of officelist"> <div *ngfor="let officedata of alloffice.office"> <div *ngif="item.office_id == officedata.office_id"> <input #officearray type="checkbox" id="officearray" name="officearray" class="form-control" value="{{item.officename}}" checked> {{(item.officename == "" ? "--no data--" : item.officename)}} </div> <div *ngif="item.office_id != officedata.office_id"> <input #officearray type="checkbox" id="officearray" name="officearray" class="form-control" value="{{item.officename}}"> {{(item.officename == "" ? "--no data--" : item.off

New to Scala, better/idiomatic way than reduceLeft to find max (key,val) in collection? -

new-ish scala ... trying find best match collection of (key,value) pairs, best match defined highest frequency. method reduceleft ideal, collection size may smaller 2 (1 or 0), well-defined behavior small collections good. is there more idiomatic scala approach finding max? other sources explained reduceleft, makes sense , reads well, other approaches suggest different methods. is there better way extract lone item collection of size=1? assume have map unknown number of values, m:map[string,int] val vm = m.filternot{ case (k,v) => k.equals("ignore") } val size = vm.size val best = if(size>1) { val list = vm.map{ case (k,v) => keycount(k,v) } list.reduceleft( maxkey ) } else if(size == 1) { vm.tolist(0) //another source has suggested vm.head alternative } else { keycount("default",0) } where keycount , maxkey declared as, case class keycount( key:string, count:long ) { def max( a:keycount, z:keycount ) = { if( a.count>z.co

angular - Generate a child route and send parameters by url data from a table by pressing a <a> element -

i trying send url parameters belonging row of table, happen when click on display option, general idea of result of process following: localhost / 4200 / lista_documentos / viewpdf / title: code: date: state component.ts viewpdf; import { component, oninit } '@angular/core'; import { router, activatedroute, params } '@angular/router'; @component({ selector: 'app-view-pdf', templateurl: './view-pdf.component.html', styleurls: ['./view-pdf.component.css'] }) export class viewpdfcomponent implements oninit { constructor( private route: activatedroute, private router: router ) { } ngoninit() { let id = this.route.snapshot.params['id']; let fecha = this.route.snapshot.params['fecha']; let estado = this.route.snapshot.params['estado']; let codigo = this.route.snapshot.params['codigo']; } } <div id="panellistado" class="panel panel-default">

ios - Swift 3 upload Video to server -

i trying upload video server. can upload images fine when trying upload video have no clue on how approach this. use following uploading images: at "let image" throws error when select video album. func imagepickercontroller(_ picker: uiimagepickercontroller, didfinishpickingmediawithinfo info: [string : any]) { let imageurl = info[uiimagepickercontrollerreferenceurl] as! nsurl let imagename = imageurl.lastpathcomponent let documentdirectory = nssearchpathfordirectoriesindomains(.documentdirectory, .userdomainmask, true).first! let photourl = nsurl(fileurlwithpath: documentdirectory) let localpath = photourl.appendingpathcomponent(imagename!) let image = info[uiimagepickercontrolleroriginalimage]as! uiimage let data = uiimagepngrepresentation(image) if want upload small video 20 30mb can try code. if want upload large video suggest upload video on amazon server. first

angular - Angular2 - PrimeNG dataTable rowexpansion doesn't expand -

i have problem primeng's datatable. in previous question encouraged me use rowexpansion table - checked out , fits concept of app. however, cannot make work - cannot expand row. tried numerous concepts within template, nothing helped. i suppose problem lies within <ng-template let-vehicles ptemplate="rowexpansion"> line, might wrong. simplified code: vehicle.component.ts export class vehiclecomponent implements oninit { cols: any[]; ngoninit() { this.cols = [ { field: 'vehicle_id', header: "vehicle id" }, { field: 'dallassettings', header: 'dallas settings' }, { field: 'dallasupdated', header: 'dallas updated' }, { field: 'dallas_list', header: 'dallas list' } ]; public vehicles: generalvehicle[]; constructor(private vehicleservice: vehicleservice, private router: router) { this.vehicleservice.getvehicle().subscribe(vehicle => { th

user interface - Embedding JavaScript/HTML in AnyLogic application -

i'm developing java program in anylogic requires complex, dynamic interface. painfully tedious , downright unmaintainable in java, -- given wide array of ui-related libraries -- should relatively simple implement in javascript. i'm therefore trying embed web view java application using javafx's webbrowser , , webengine . i can load website per tutorial. however, when click in window nothing responsive: no links work, scrollbar doesn't respond, , menu items fail respond. missing something? there way inject click manually web page? (is embedding web browser sensible way accomplish i'm trying accomplish?) my problem tool-specific: environment use (anylogic v7.x) uses embedded jpanel draw shapes user not directly access. while shapes can added environment shape, don't receive normal input (e.g., mouse input) unless added jpanel instead. (adding them in way brings own complications managing zooms , translations manually, that's beyond scope of ques

speech recognition - UWP SpeechRecognition exception with file grammar -

i'm tring add custom srgr grammar speechrecognition in w10 uwp app. i've w10 creators update. app goes in exception on "recognizer.recognizeasync" without code , message when add grammar file below private async void button_click(object sender, routedeventargs e) { try { using (speechrecognizer recognizer = new speechrecognizer()) { var webgrammar = new speechrecognitiontopicconstraint(speechrecognitionscenario.websearch, "websearch", "web"); //recognizer.constraints.add(webgrammar); storagefile grammarfile = await storagefile.getfilefromapplicationuriasync( new uri("ms-appx:///grammar.xml")); recognizer.constraints.add(new speechrecognitiongrammarfileconstraint(grammarfile)); speechrecognitioncompilationresult compilat

javascript - AutomoComplete Method JSF Disable to remove first element -

project has developped jsf + spring . bir input alanım var. bu alan kullanıcıları user olarak tutuyor ve dolduruyor. : http://prntscr.com/etgdym first element commin session means user entering system comes first.after that, different users can added. : http://prntscr.com/etgeca what want first user added system can not deleted area. how can this? <p:autocomplete id="autocomp" value="#{ideabean.owners}" var="user" multiple="true" completemethod="#{ideabean.completeuser}" required="true" requiredmessage="bu alan boş bırakılamaz." itemlabel="#{user.fullname} (#{user.email}) " itemvalue="#{user}" converter="userconvertertwo" disabled="#{ideabean.createdidea}" forceselection="true&q

distillery - Do Ecto migration from a release of an elixir app -

i've made release of elixir application. starts run supervised task using db when app lunched. when db not migrated, task keep error , app terminated. i read http://blog.firstiwaslike.com/elixir-deployments-with-distillery-running-ecto-migrations/ , https://hexdocs.pm/distillery/running-migrations.html , , tried implement migration function following them, failed because app needs started load config of app , make command terminated. when run application.get_all_env(:my_app) without start app, returns empty list [] . there anyway run ecto.migrator.run(myapp.repo, path, :up, all: true) without start app? it enough load application application.load(:my_app) have access env - doesn't need started. a detailed guide on running migrations releases available in distillery documentation .

form design in web2py -

Image
is there way change form looks this: to form looks this:

Something Wrong With Label Using Macro Excel -

first of all, sorry post question here. question more mathematics, not programming don't know other place seek help. basically, code works label selection highlighted user using alphabet , number, 1a, 1b, 1c, 1d , etc. there 20 different styles (1 1 label 20 20 label) label selected cells. problem occurs when choose bigger number 5 first selection, , first selection finish @ 3a (the labeling this: start: 1a 1b 1c 1d 1e 2a 2b 2c 2d 2e 3a, next selection choose 2 second selection, labeling incorrect this: 3b 3c 3d 3e until 3z , continue till last cells number 8 correct labeling should this: 4a 4b 5a 5b 6a 6b. don't know wrong code , need you. thank in advance. these code , select style 1 2 only, different thing in code number: public a, b integer sub autolabel() 'to label cell in term of 1a , etc = 1 b = 1 end sub sub labeltest() dim cell range selection ' allign text centered between top , bottom of cell .horizontalalignment = xlcenter ' allign text cente

Why open() in python not use windows enviroment variables like a import -

i have file on desktop, full path: c:\users\evgeny\desktop\f.py but python ran from: c:\users\evgeny the problem is, can't exec(open('f.py').read()) i include first path enviroment variables, doesn't work. example, when import f works okay. enter image description here can possible run open('f.py') directory not using full path file? open() tool open any file on filesystem . not tool find python modules. python's import machinery complex (it can extended, adjusting how modules found or loaded) , out of box supports cached bytecode files different extensions ( .pyc , .pyd , in __bytecache__ directory or not), loading .zip files, , loading native extensions, series of configurable directories listed on sys.path . machinery there allow override modules different versions, putting them in different location on search path. the vast majority of use-cases open() function, however, not need machinery, want open cat pic

javascript - Adding labels and icons on google maps markers -

how can add labels 2 markers when click on marker shows more details , how can change icon of "access point 2" different marker function initialize() { var mylatlng = new google.maps.latlng(-26.322402,31.142249), map = new google.maps.map(document.getelementbyid('google-map-default'), { zoom: 14, center: mylatlng }), marker = new google.maps.marker({ position: mylatlng, map: map, title: "we here!" }); var accesspoint1 = new google.maps.latlng(-26.315402,31.123924), marker1 = new google.maps.marker({ position: accesspoint1, map: map, title: "access point 1" }); var accesspoint2 = new google.maps.latlng(-26.316700,31.138043), marker2 = new google.maps.marker({ position: accesspoint2, map: map, title: "access poi

angularjs - How to use diffrent function for different routes from one Controller in Angular JS? -

can define in ui-router routes function has call on particular routes 1 controller? have 2 functions in controller , both different. - app.controller('mainctrl',function($scope, $stateparams){ $scope.firstfunction = function () { $scope.firstvar = 'hello there'; }; $scope.secondfunction = function () { $scope.secondvar = 'i learning angular js!'; }; }) i want use firstfunction or secondfunction diffrent routes - adsyogiapp.config([ '$stateprovider','$urlrouterprovider', function ($stateprovider, $urlrouterprovider) { $stateprovider .state('app.first', { // route want use mainctrl's firstfunction url: "/firstpage", templateurl : 'views/firstpage.html', controller: "mainctrl" }) .state('app.second', { // route want use mainctrl's secondfunction

c# - how to refresh a page in asp.net using maessage box event -

what want is, when click message box "ok" button, reload whole page. code generating message box. scriptmanager.registerclientscriptblock(this, this.gettype(), "alertmessage", "alert('error!! try reloading page! ')", true); this code reloading page. response.redirect(request.rawurl); so, want catch event generated "ok" button of message box. , use reload page. try this. scriptmanager.registerclientscriptblock(this, this.gettype(), "alertmessage", "alert('error!! try reloading page! ');location.reload();", true); or this option chose reload or not. scriptmanager.registerclientscriptblock(this, this.gettype(), "alertmessage", "if(confirm("error!! try reloading page!")){location.reload();}", true);

json - xml to list conversion in web api c# -

i getting request in form of xml need converted list in c# using web api. here's request xml receive <ota_hotelinvcountnotifrq xmlns="http://www.zzz.com/ota/2015/03" timestamp="2015-03-10t09:41:51.982" version="1.2"> <inventories hotelcode="10001"> <inventory> <statusapplicationcontrol start="2015-03-16" end="2015-03-30" mon="0" tue="0" wed="0" thur="0" fri="0" sat="1" sun="1" invtypecode="dlx" allinvcode="false" /> <invcounts> <invcount counttype="2" count="17" /> </invcounts> </inventory> <inventory> <statusapplicationcontrol start="2015-03-16" end="2015-03-30" allinvcode="false" mon="1" tue="1" wed="1" thur="1" fri="1" sat="1" sun="1" invtypec

Get checkbox value in Excel Spreadsheet with PHP -

i need transform excel spreadsheets database entries , thought use phpexcel or phpspreadsheet that. single cells can read , build query, thing is, there checkboxes in spreadsheets , haven't found way values (state) of those. in spreadsheet checkboxes , labels positioned cells, not in cells. cell values empty. any ideas on how achieve this?

Azure Search SDK for Blob Storage - Deleting Files -

i have created application lists documents in azure storage container, , lets user mark specific files delete. this azure search application, process add "deleted" metadata property selected files, run indexer remove information index, , physically delete files. here's code process: serviceclient.indexers.run(documentindexer); var status = serviceclient.indexers.getstatus(documentindexer).lastresult.status; // loop until indexer done while (status == indexerexecutionstatus.inprogress) { status = serviceclient.indexers.getstatus(documentindexer).lastresult.status; } // if successful, delete flagged files if (status == indexerexecutionstatus.success) { deleteflagged(); } everything works fine, if put breakpoint on deleteflagged() call, forcing delay between running indexer , deleting files. without pause, indexer comes successful, , delete files, file contents haven't been removed index - still show in search results (the files have been physica

scala - S3 bucket name gets added to the S3 endpoint -

when trying access file s3 bucket using scala, bucket name gets added front of endpoint , endpoint becomes wrong , in-accessible. libraries: librarydependencies += "org.apache.spark" % "spark-core_2.11" % "2.0.0" librarydependencies += "org.apache.spark" % "spark-sql_2.11" % "2.0.0" librarydependencies += "org.apache.hadoop" % "hadoop-aws" % "2.8.0" code: sc.hadoopconfiguration.set("fs.s3a.endpoint", "[endpoint]") sc.textfile("s3a://[bucket_name]/testa.txt") enabling path style urls solves issue there no virtual hosts configuration done on server s3 installed. fs.s3a.path.style.access ( docs ) can set true enable path style urls.

php - How can I show recent blogbost from wp multisites on my mainpage -

i'm having trouble wordpress. i'm rather new wordpress , not familiar how works. said, i'm working on project in wordpress incluedes main site , couple of different sub sites. i'm using wordpress multisites. what want show latest blogpost every sub site on mainsite. i know how fix 1 site: <?php $the_query = new wp_query('posts_per_page=6'); ?> <?php while ($the_query -> have_posts()) : $the_query -> the_post(); ?> <a href="<?php the_permalink() ?>"><div class="col-md-3 col-xs-12"> <p><i class="fa fa-user"></i> <?php the_author(); ?> <i class="fa fa-clock-o"></i> <time><?php the_date(); ?></time></p> <?php $email = get_the_author_meta('', $author); ?> <?php $bild = get_avatar_url($email); ?> <img src="<?php echo $bild; ?>" id="avatarimg

Loop and remove empty element with jquery -

im close can't quite there. i want add class display:none div if spans inside empty. html: <div class="accordion-content default"> <div><span><?php the_field(''); ?></span><span><?php the_field('tenure1'); ?></span></div> <div><span><?php the_field(''); ?></span><span><?php the_field('tenure2'); ?></span></div> <div><span><?php the_field(''); ?></span><span><?php the_field('tenure3'); ?></span></div> <div><span><?php the_field(''); ?></span><span><?php the_field('tenure4'); ?></span></div> <div><span><?php the_field(''); ?></span><span><?php the_field('tenure5'); ?></span></div> <div><span><?php the_fie

Openshift doesn't copy docker container files to persistence volume -

i have created dockerfile creates pentaho docker image persistence volume (using volume directive) in biserver-ce/pentaho-solutions/system/ directory. when running locally pentaho docker container, files contained in directory present , persistence (adding plugins, project files etc etc) works fine. have given persistence volume same directory openshift template pentaho when creating instance, persistence volume allocated empty , nothing copied container image expecting. there way through openshift without having export , copy whole directory local docker container?

Android restrict fragments only one time go to back stack -

hello guys i'm using bottomnavigationview each item of navigation view open fragment store in back-stack, if item selected multiple times back-stack store latest instance of fragment. mean when pressing button fragment open 1 time only. such as, there 3 fragments..a,b,c fragment pattern: a-b-c-b-a-c-a-c back press output should be: c-a-b-exit but pattern- c-a-c-a-b-c-b-a-exit here code i'm using- @override public boolean onnavigationitemselected(@nonnull menuitem item) { switch (item.getitemid()){ case r.id.nav_home: mfragment = getsupportfragmentmanager().findfragmentbytag("fragment_home"); if(!(mfragment!=null && mfragment.isvisible())){ mfragmentmanager.popbackstackimmediate("fragment_home", fragmentmanager.pop_back_stack_inclusive); mfragmenttransaction = mfragmentmanager.begintransaction(); mfragmenttransaction.replace(r.id.container

javascript - How to get a month in different format in jquery -

this question has answer here: how change date format in javascript [duplicate] 5 answers how format javascript date 36 answers i using datepicker select dates calendar , works fine. however, dates given in numbered format when alert them: eg: 5-4-2017 how can month in wording instead? eg: 5-apr-2017 the jquery looks this: $("#txtto").datepicker({ numberofmonths: 1, onselect: function(selected) { txttodate = selected; var dt = new date(selected); dt.setdate(dt.getdate() - 1); $("#txtfrom").datepicker("option", "maxdate", dt); } }); and used dates: var date1 = $("#txtfrom").datepicker('getdate'), day_1 = date1.getdate(), month_1 = date1.getmonth() + 1, year_1

python - dynamic sorting template in django -

i have problem 1 idea (dynamic sort template in django) now have solution sorting data not because have couple of buttons adnotate sorting view , in way have sorted list of data. i tried use angularjs, think best way have problem too. example: <div ng-app="" ng-init="sort_by = 'updated_at'"> <button ng-click="sort_by = 'id'">id</button> <button ng-click="sort_by = 'created_at'">created_at</button> <button ng-click="sort_by = 'issuer'">issuer</button> <button ng-click="sort_by = 'handler'">handler</button> <p>{% verbatim angular %} {{sort_by}} {% endverbatim angular %}</p> {% fault in faults|dictsort:{{sort_by}} %} in theory can works. not. i try in way , in apostrophe , try block above {% verbatim angular %} , not working giving me error this: 'for' statements should use fo

Powershell to list files and have the user select one -

i have folder "d:\prod\transfert" containing list of files. i want write powershell script list files , let user chose one, script perform actions on selected file. idealy want path of selected file stored in variable. here output wanted : >select file : [1] file1.zip [2] file2.zip [3] file3.zip > all can right listing files no number before : get-childitem c:\prod\transfert | % { $_.fullname } thanks ! unless absolutely need console gui, can use out-gridview let user choose, this: get-childitem c:\prod\transfert | out-gridview -title 'choose file' -passthru | foreach-object { $_.fullname } edit ...and store in variable... $filenames = @(get-childitem c:\prod\transfert | out-gridview -title 'choose file' -passthru) the @() wrapper ensures array of filenames returned (even if 1 file or no files chosen). (the passthru relies on having powershell 3 or greater) edit 2 the choice menu below alter display type, depend

java - how to print SearchResult from the Youtube API result into textArea or TableView -

i'm developing jee desktop application , want integrate youtube api sample (cmd line) , show in javafx interfaces writing queryterm in text field wasn’t problem printing result of searchresult of api me hard part: // call api , print results. searchlistresponse searchresponse = search.execute(); list<searchresult> searchresultlist = searchresponse.getitems(); if (searchresultlist != null) { prettyprint(searchresultlist.iterator(), queryterm); } how can print result of search class tableview or textfield in javafx. please suggestions?

authentication - org.apache.catalina.realm.JAASRealm.authenticate Unexpected error java.lang.IllegalArgumentException: wrong number of arguments -

i'm trying create jaas authentication webapplication (running on tomcat 8, i'm getting error: 07-apr-2017 10:37:49.993 severe [http-apr-11080-exec-3] org.apache.catalina.realm.jaasrealm.authenticate unexpected error java.lang.illegalargumentexception: wrong number of arguments @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:62) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43) @ java.lang.reflect.method.invoke(method.java:497) @ javax.security.auth.login.logincontext.invoke(logincontext.java:755) @ javax.security.auth.login.logincontext.access$000(logincontext.java:195) @ javax.security.auth.login.logincontext$4.run(logincontext.java:682) @ javax.security.auth.login.logincontext$4.run(logincontext.java:680) @ java.security.accesscontroller.doprivileged(native method) @ javax.security.auth.login.logincontext

java - IntelliJ sbt project download sources behind proxy or from nexus server -

Image
i using sbt behind proxy, corporate nexus server. my setup works correctly, using cntlm java_opts="-dhttp.proxyhost=10.0.2.2 -dhttp.proxyport=3128 -dhttps.proxyhost=10.0.2.2 -dhttps.proxyport=3128" sbt_opts="-dsbt.override.build.repos=true" and nexus setup in ~/.sbt/repositories [repositories] local my-ivy-proxy-releases:http://company.com:8081/nexus/content/groups/ivy-releases/, [organization]/[module]/(scala_[scalaversion]/)(sbt_[sbtversion]/)[revision]/[type]s/[artifact](-[classifier]).[ext] my-maven-proxy-releases:http://company.com:8081/nexus/content/groups/mvn-repositories/ all works correctly, "titled problem", if managed sbt, fe: librarydependencies += "org.apache.spark" %% spark-core % "1.6.1" withsources()) can download sources: but if want use build in intellij "download sources" button: it give me connection error: what missing? looked @ intellij logs, dont tell much 2017-04-07

php - wordpress image url wrong in database -

did search it's not working in case. we have wordpress website migrated on few months ago , images displaying wrong link still. for example, 1 image on gallery has url of ' http://1.1.1.1/~websitename/wp-content/uploads/2015/03/image.jpg ' , should ' http://ournewwebsite.com/wp-content/uploads/2015/03/image.jpg ' i've changed post guid in db 1 particular post hasn't worked, need change other settings images? edit: i've found issue in postmeta table, images in string on these, there many follow format in html, need search , replace instances of ip address , not full path they're different... thanks in advanced try using plugin, https://wordpress.org/plugins/velvet-blues-update-urls/ update guid's , urls old new.

high availability - Using load balancer for HttpFS in HDFS -

after enabling ha hdfs in cloudera manager trying make httpfs role in hdfs highly available. have added instance of httpfs role in hdfs , set haproxy load balancer. haproxy stats page working , servers , colored green. problem arises when trying reconfigure hue. hue recognizes httpfs load balancer possibility in hdfs web interface role, not validate choice. cloudera bug, since cannot find errors in configuration? thank you!

javascript - AngularJS service does not return refence but value of object -

i find better use angularjs services communicate between 2 component rather using emit/broadcast techiques. have create simple userservice: (function(){ angular.module('userservice') .factory('userservice', userservicefn); userservicefn.$inject = []; function userservicefn(){ var user = { islogged: false, info: '' }; return { setuser: setuser, getuser: getuser, clearuser: clearuser }; function setuser(info){ user.islogged = true; user.info = info; }; function getuser(){ return user; }; function clearuser(){ user.islogged = false; user.info = {}; }; } })(); then can inject service ever need no current login status var user = userservice.getuser(); , example toggle login button < button ng-hide="user.islogged">login&

windows - C++ Threading CPU usage issue on older PC -

i need expert's advice , opinion on thread usage. have simple "plugin" dll has 2-3 threads, each of them started _beginthreadex() . a thread looks this: unsigned __stdcall thread(void* parguments) { while ( true ) { // sleep(3000); } _endthreadex( 0 ); return 0; } now, thread not have high cpu usage, works expected on new pc's, have discovered on older pc's dual core cpu's example running 2-3 instances threading method take lot of cpu. cannot explain myself why, , don't know do. i have tried createthread() also, not make change. can please guide me how create thread run same way on pc's ? if i'm doing wrong, please explain me what... thank you! _beginthreadex wrapper createthread. , if experience high cpu usage it's problem "do something" code has nothing method used create thread. inspect code profiler , race conditions. note snippet posted broken because loop has