Posts

Showing posts from July, 2014

spring boot - loading dynamic image from local source -

i have saved images local path of pc , saved file name db. want load image db , show html page using java script , thymemleaf. browser says not allowed load local resources , made servlet in spring boot. not showing image. servlet @webservlet("/admin/imgservlet") public class adminimageservlet extends httpservlet { private static final long serialversionuid = 1l; @override public void doget(httpservletrequest request, httpservletresponse response) throws ioexception { string urlimage = request.getparameter("admin"); response.setcontenttype("image/jpeg"); servletoutputstream out; out = response.getoutputstream(); fileinputstream fin = new fileinputstream("c:/users/public/documents/" + urlimage); bufferedinputstream bin = new bufferedinputstream(fin); bufferedoutputstream bout = new bufferedoutputstream(out); int ch = 0; while ((ch = bin.read()) != -1) {

java - The error doesn't happen while importing in the local Database -

Image
i importing json files database. java.lang.nullpointerexception files. on tracing error, see error occurs in last_name column of database. of names "heldeweg, m.a.","schlössels, r.j.n.","seerden, r.j.g.h." and last names heldeweg, schlössels, seerden which extract names array. but when try import same files local database, files imported without issues. don't seem know how trace error causing java.lang.nullpointerexception error. i added screenshot of error. tell me part of code @ identify location of error? thanks help!!!

Android webview javascript Interface not working properly -

really not have ideal why doesn't work. basically, trying this. public void testjs() { final webview webview = (webview) findviewbyid(web); // webview.getsettings().setdomstorageenabled(true); webview.getsettings().setjavascriptenabled(true); webview.addjavascriptinterface(new jsinterface(webview), "sample"); webview.setwebchromeclient(new webchromeclient() { @override public boolean onjsalert(webview view, string url, string message, jsresult result) { /* whatever need here */ log.e("chrome", "asdf"); return super.onjsalert(view, url, message, result); } }); webview.loadurl("javascript:window.sample.doechotest();void(0);"); } and jsinterface public class jsinterface { webview mappview; public jsinterface(webview appview) { this.mappview = appview; }

javascript - Fire event on repeat done in AngularJS -

hello trying fire event on repeat done in angularjs, following code: following html code <li ng-repeat="y in names | limitto: 6" repeat-done="ratingwithng()"> <a href="<?php echo $this->config->item('search_url');?>{{y.hosurl}}"> <div class="hospital-card"> <img src="{{y.profile_image}}" width="" height="" /> <h3 class="vlcc-name">{{y.clinic_name}}</h3> <div class="doc-rete"> <div id="rateyo-hos" class="mc-doc-rating">3</div> </div> <p class="hospital-specialist">{{y.localty }} {{y.city }}</p> <p class="vlcc-experince">{{y.clinic_type }}</p> <p class="vlcc-address">{{y.hos_time }} </p> </div> </a> </li> following angularjs code: var app = angular.module('myapp',

upload video to youtube using php -

i beginner in php. want upload video on youtube using php. http error 404 occurs while running demo . here demo link used . http://www.codexworld.com/upload-video-to-youtube-using-php/ and created oauthclientid , oauthclientsecret google accounts. , put under config file. <?php // oauth configuration $oauthclientid = 'xxxxx'; $oauthclientsecret = 'xxxxxxx'; $baseuri = 'http://example.com/upload-video-to-youtube-using-php/'; $redirecturi = 'http://example.com/upload-video-to-youtube-using-php/youtube_upload.php'; define('oauth_client_id',$oauthclientid); define('oauth_client_secret',$oauthclientsecret); define('redirect_uri',$redirecturi); define('base_uri',$baseuri); // include google client libraries require_once 'src/google/autoload.php'; require_once 'src/google/client.php'; require_once 'src/google/service/youtube.php';

rest - java:Tomcat 9 status code 200 but response message null -

i have http client sends request restful web service , receives response. working when deployed in tomcat 8. when tried deploy same client , server in tomcat versions 8.5 , above, server receives response code 200 response message null instead of ok. below client code snippet httpclient = httpclientbuilder.create().build(); postrequest.setentity(new urlencodedformentity(urlparameters)); httpresponse response = httpclient.execute(postrequest); httpentity entity = response.getentity(); system.out.println("response server "); system.out.println(response.getstatusline().getstatuscode()); system.out.println(response.getstatusline().getreasonphrase()); and server code snippet response @post @path("/download/{filename}") @produces(mediatype.application_octet_stream) public response getfile(@pathparam("filename") string file) { try { file downloadfile = new file(&qu

android - Load album art into Glide using Listview -

code load album art if(cursor != null && cursor.movetofirst()){ int titlecolumn = cursor.getcolumnindex(mediastore.audio.media.title); int idcolumn = cursor.getcolumnindex(mediastore.audio.media._id); int artistcolumn = cursor.getcolumnindex(mediastore.audio.media.artist); int albumcolumn = cursor.getcolumnindex(mediastore.audio.media.album); long albumid = cursor.getcolumnindex(mediastore.audio.albums.album_id); { long thisid = cursor.getlong(idcolumn); string thistitle = cursor.getstring(titlecolumn); string thisartist = cursor.getstring(artistcolumn); string thisalbum = cursor.getstring(albumcolumn); glide.with(this) .load(albumid) .asbitmap() .into() //how return value? medialist.add(new songinfo(thisid, thistitle, thisartist, thisalbum, //bitmap variable)); } while

use postman call eureka REST api register return 400 Bad request -

Image
why receive 400 error bad request ? eureka server url http://localhost:8761/eureka/apps/service1 , have start use postman send post request register, headers set: "content-type", "application/json", request body :{ "instance": { "hostname":"tpdeva13", "app":"service1", "ipaddr":"tpdeva13", "vipaddress":"tpdeva13", "securevipaddress":"tpdeva13", "status":"up", "port":{ "$":8889, "@enabled":"true" }, "datacenterinfo":{ "@class":"com.netflix.appinfo.instanceinfo$defaultdatacenterinfo", "name":"tpdeva13" } } } after send request, server return 400 bad request, can't find error ?

sql - Run VB Application in Windows Task Scheduler -

i have application have function same dts (transfer data as400 sql server). need application run according schedule made. application runs if open it, if put in task scheduler, shows error: error [hy000][ibm][system access odbc driver]missing system name needed connection. this script use make connection as400. runs without error if run (not in scheduler). know how fix it? public sub takeconnectionas400() _inifile.baca("config.ini", "as400") system = _inifile.system uid = _inifile.uid pwd = _inifile.pwd dbq = _inifile.dbq db_as = "driver={client access odbc driver (32-bit)};system=" & system & ";uid=" & uid & ";pwd=" & pwd & ";dbq=" & dbq & "" conn_as = new odbcconnection(db_as) try if conn_as.state = connectionstate.closed conn_as.open() end if catch ex exception msgbox(err.description, msgboxstyle

php - Invalid argument supplied for foreach() Laravel 5.3 -

i have 2 table(interview , interviewtrack) in 1 form. here's savehandler code far : public function savehandler(request $request, $obj) { try { db::begintransaction(); $obj->fill($request->all()); if (!$obj->save()) { throw new validationexception($obj->errors()); } foreach($request->interviewtracks $interviewtrack) { \log::info($interviewtrack); if (empty($interviewtrack['id'])) { $interviewtrack = new interviewtrack(); } else { $interviewtrack = interviewtrack::find($interviewtrack['id']); } $interviewtrack->interview()->associate($obj); $interviewtrack['interview_id'] = isset($interviewtrack['interview_id']); $interviewtrack->status = $interviewtrack['status']; $interv

android - Can onViewCreated be called before Activity onCreate finishes? -

Image
i trying redesign fragments remove dependencies onattach , onactivitycreated overrides , instead activity later on in onviewcreated override. are there cases in android application lifecycle onviewcreated fragment called before activity oncreate finishes. example know that: @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); } will not result in fragments onattach being called (assuming fragment added fragment manager programmatically later on), in rare cases configuration updates fragment manager can recreate fragments in super.oncreate causes onattach called before oncreate activity has finished. oncreate() system calls when creating fragment. within implementation, should initialize essential components of fragment want retain when fragment paused or stopped, resumed. oncreateview() called create view hierarchy associated fragment. the system calls when it's time fragment draw user interface first time

c# - WPF INotifyPropertyChanged without burning base class -

i'm trying find simple approach data binding in wpf. i'm using inotifypropertychanged interface , works fine if it's implemented on abstract base class , inherited objects have bound members. public partial class mainwindow : window { public static mainwindow instance; private readonly vm _vm; public mainwindow () { initializecomponent(); datacontext = _vm = new vm { button1 = new vm.observablebutton(button1, new list<string> { "paused", "logging" }, false), button2 = new vm.observabletogglebutton(button2, new list<string> { "log all", "log vba" }, false), }; } private class vm { public abstract class observableobject : inotifypropertychanged { public event propertychangedeventhandler propertychanged; protected virtual void onpropertychanged ([callermembername] string propname = "&qu

calendar - iOS EventKit connect with GoogleAcc -

i'm going build calendar ios , want events google account. question is, there way connect eventkit google account if login google account using google oauth2 sdk ? far understood, need add account on system layer, didn't find possibility how this. cause don't want write own wrapper google calendar sdk instead of delegating work eventkit thanks.

python 2.7 - Performing tasks on input given by entry and updating label constantly -

so im little new tkinter , making gui. 1 of problems having when got value entry widget. not labels associated entry widget update after had done arithmetic it. example var = tk.stringvar entry1 = tk.entry(root, textvariable = var) entry1.pack() var label1 = tk.label(root, text = var) label1.pack() i looked around before asking , found connect variables. tried still not update after first time. how label update everytime new value entered in entry. if 2 entered 4 displayed. if entered 5 label should update automatically , 10 should dislplayed. in case im multiplying two. label should update until close program. thanks having alot of trouble figuring out appreciated def enter_hit(event): do_something_with(var.get()) var = tk.stringvar entry1 = tk.entry(root, textvariable = var) entry1.pack() label1 = tk.label(root, text = var) label1.pack() entry1.bind("<return>",enter_hit) when hit enter on entry1 , calls enter_hit. var , it's text can

java - Map.clear() then add map to List -

i try traverse excel2007 data using poi.jar based on jdk1.6 .but when seem find strange phenomenon when traverse row(stored hashmap ()) , add row data java.util. arraylist . and starting next iterator,i first clear row data invoking map.clear(), when again invoking arraylist.add() method,this row data overridden older data. map<string, string> cellforrow = = new hashmap<string, string>(); list<map<string, string>> rowforsheet = new arraylist<map<string, string>>(); (int j = 0; j < sheet.getphysicalnumberofrows(); j++) { row = sheet.getrow(j); if (j == 0) {// first row title titlerow = row; continue; } if (row != null && titlerow.getphysicalnumberofcells() > 0) { // cellforrow = new hashmap<string, string>(); cellforrow.clear();

java - Junit test case not compiling on the fly in eclipse -

i writing junit using mockito, powermock api's. every time need run maven command compile project execute every single line code change in test case. why happening . eclipse should auto compile right on fly, , must able run junit test case

javascript - Express res.download() and Ajax `POST` -

i using expressjs res.download() ( http://expressjs.com/en/api.html ) to send .exe installer file. don't know if need use blob or file javascript apis? i triggering call via post action in ajax: $('#download-form').validate({ submithandler: function (form) { $.ajax({ type: $(form).attr('method'), url: $(form).attr('action'), data: $(form).serialize(), success: function (data) { // alert(data); }, progress: function(e){ //make sure can compute length if(e.lengthcomputable) { //calculate percentage loaded var pct = (e.loaded / e.total) * 100; //log percentage loaded console.log(pct); } //this happens when content-length isn't set else { console.warn('content length not reported!'); } }

java - Configuring data access layer properties files in Spring Integeration testing environment -

i setting test environment spring web application. use .properties files , environment configure persistence layer properties shown below(i have skipped code brevity): persistenceconfig.java @propertysources({ @propertysource(value= "classpath:/com/hp/properties/persistence/mysqldb.properties"), @propertysource(value = "classpath:/com/hp/properties/persistence/hibernate.properties")}) public class persistenceconfig { @autowired environment env; @bean public localcontainerentitymanagerfactorybean entitymanagerfactory(){ localcontainerentitymanagerfactorybean em = new localcontainerentitymanagerfactorybean(); em.setdatasource(datasource()); em.setpackagestoscan(new string[] {"com.hp.model.entity"}); jpavendoradapter vendoradapter = new hibernatejpavendoradapter(); em.setjpavendoradapter(vendoradapter); em.setjpaproperties(hibernateproperties()); return em; } private properties hibernateproperties(){ properties p

javascript - Firebase App Script getData() optQueryParameters with integer error -

so i'm looking using google spreadsheet display data firebase. how ever data can times big google sheets handle. i wanted limit data last 10 records. i wanted order key , last 10 records. var records = base.getdata("path/foo", {"limittolast": 10 , "orderby":"key"}); the problem documentation shows optqueryparameters supported no show how use them. above closest have gotten. still not work , errors edit: so have been keeping @ , think got order sorted not limittolast var records = base.getdata("path/foo", { ".indexon": "key", ".limittolast":"2"}); has 1 got limittolast work on app script? edit2: here latest version have used: var records = database.getdata("40274400", {"limittolast": 1 , "orderby":"$key"}); how ever can't limittolast work. sends error with: error limittolast must integer (line 135). yes know integer w

Creating a custom exception class and custom handler class in Laravel 5.3 -

before code, let me explain aim. web app displays vehicles sale. have need custom 404 page display 12 of latest vehicles added database if user tries access page doesn't exist. i have following... app\exceptions\customexception.php <?php namespace app\exceptions; use exception; class customexception extends exception { public function __construct() { parent::__construct(); } } app\exceptions\customhandler.php <?php namespace app\exceptions; use exception; use app\exceptions\handler exceptionhandler; use illuminate\contracts\container\container; use app\project\frontend\repo\vehicle\eloquentvehicle; use illuminate\foundation\exceptions\handler; use illuminate\support\facades\view; class customhandler extends exceptionhandler { protected $vehicle; public function __construct(container $container, eloquentvehicle $vehicle) { parent::__construct($container); $this->vehicle = $vehicle; } /** * re

neo4j - Filtering out nodes on two cypher paths -

Image
i have simplified neo4j graph (old version 2.x) image 'defines' , 'same' edges. assume number on define edge property on edge the queries run are: 1) find nodes defined both , b -- requried result: c, c, d start a=node(885), b=node(996) match (a-[:define]->(x)<-[:define]-b) return distinct x above works , returns c , d. want c twice since defined twice. without distinct on x, returns paths b. 2)find nodes not (defined both a,b or defined both a,b connected via same edge) -- required result: g something like: r1: match (a-[:define]->(x)<-[:define]-b) return distinct x r2: match (a-[:define]->(e)-(:similar)-(f)<-[:define]-b) return e,f (nodes defined - (r1+r2) ) 3) find 'middle' nodes not have matching calls both , b --required result: c,g i want output c due 1 define (either 45/46) not have matching define b. output g because there's no define g b. appreciate on this! your syntax bit strange me, i'

How to perform map marker click in HERE MAP (android ) -

i using map. found issue. how know marker clicked? @override public boolean onmapobjectsselected(list<viewobject> list) {..) with on gesture listener got method how find particular map marker object , map marker title etc. to obtain marker clicked below in onmapobjectsselected method. for (viewobject viewobject : list) { if (viewobject.getbasetype() == viewobject.type.user_object) { mapobject mapobject = (mapobject) viewobject; if (mapobject.gettype() == mapobject.type.marker) { mapmarker window_marker = ((mapmarker) mapobject); system.out.println("title is................."+window_marker.gettitle()); return false; } } } you have find out object type selected in loop above.

javascript - What is this issue, and how to prevent by jQuery's own way? -

i implementing append operation using $.each - method. result funny(getting double time of elements!). may have workaround fix this. but want understand real issue here, there way fix using jquery 's own way? thanks in advance. var data = ["orange", "apple"]; var temp = function() { var template = '<dl class="dropdown"><dt> <div class ="dropdownclass" ><span class="hida">select</span> <span class="multisel"></span> </div></dt><dd><div class="mutliselect"><ul><li><input type="checkbox" value="control" />control node</li><li><input type="checkbox" value="border" />border node</li</ul></div></dd></dl>'; return $(template).clone(); } $(document).ready(function() { var tr; var ut $.each(data, function(i, value)

Ansible-playbook: how to write content of var to file -

i have var, want write content of var line in file. example: var: text_need_to_add file before added: some_line text text mark text text some_line file after added: some_line text text mark text_need_to_add text text some_line what should do? sorry english. you can magic sed command: - name: insert string in file shell: sed '/mark/a {{ text_need_to_add }}' filename i'm not in sed manipulation, general idea is: if can't ansible, try in bash , if - setup ansible you. or can write ansible module it, bash enough.

osx - One empty dummy-file copied and saved with names from a list -

i'm trying in osx terminal: have list ( test.txt ) containing around 700 unique file names. these unique file names needs saved one-by-one 1 empty image file ( eg. 700 x 1225 px). have created empty file name empty.jpg . have read pbcopy , pbpaste can't figure how work these commands! thinking list (test.txt) , image (empty.jpg) schould in same folder , output saved in location. can newbie @ …? i found solution on issue using perl script running in terminal: #!/usr/bin/perl use strict; use warnings; use file::copy; $filetobecopied = "empty.jpg"; $filename = 'test.txt'; open(my $fh, '<:encoding(utf-8)', $filename) or die "could not open file '$filename' $!"; while (my $row = <$fh>) { chomp $row; print "$row\n"; copy($filetobecopied, $row) or die "file cannot copied."; } works expected!

java - Remove scroll bars in GraphZoomScrollPane -

i working jung. have added visualizationviewer graphzoomscrollpane . graph size less size. dont need scroll bars. i tried adding visualizationviewer normal jpanel wel. however, size of graph changes. is there way remove/hide scroll bars in graphzoomscrollpane ?

ios - Slide menu - move from right to left and back -

Image
i have slide menu when click on screen menu comes out right left. how can write code if click button move left right? my slide menu: my code: private void updatetableviewposition(cgpoint positon) { // set position of button based on provided argument _buttontogglevisibility.frame = new coregraphics.cgrect(positon.x , _buttontogglevisibility.frame.y, _buttontogglevisibility.frame.width, _buttontogglevisibility.frame.height); // todo: // if button outside of screen // move screen // move tableview right aligned of button _tableview.frame = new coregraphics.cgrect(_buttontogglevisibility.frame.right, _tableview.frame.y, _tableview.frame.width, _tableview.frame.height); } public override void touchesended(nsset touches, uievent evt) { base.touchesended(touches, evt); uitouch touch = (uitouch)touches.anyobject; _moving = false; // todo: fix button clickable /

python - Save data from Dataproc to Datastore -

i have implemented recommendation engine using python2.7 in google dataproc/ spark, , need store output records in datastore, subsequent use app engine apis. however, there doesn't seem way directly. there no python datastore connector dataproc far can see. python dataflow sdk doesn't support writing datastore (although java 1 does). mapreduce doesn't have output writer datastore. that doesn't appear leave many options. @ moment think have write records google cloud storage , have separate task running in app engine harvest them , store in datastore. not ideal- aligning 2 processes has own difficulties. is there better way data dataproc datastore? i succeeded in saving datastore records dataproc. involved installing additional components on master vm (ssh console) the appengine sdk installed , initialised using sudo apt-get install google-cloud-sdk-app-engine-python sudo gcloud init this places new google directory under /usr/lib/google-cl

mysql - Delete log-bin files when log_bin is OFF -

i have lot of mysql-bin files on server (mysql-bin.0001, mysql-bin.0002…) occupy many space. on server (mysql 5.5 percona) log_bin option off. is save delete log files log-bin directory? when don't need them anymore, yes, it's safe delete them. having log_bin set off means, binary log disabled , nothing new gets written these files (nor more files created). when don't know, binary log for, might want read it. it's used replication (the master needs have enabled) , backup techniques.

Slugify name field in django form -

i have model has meta: unique_together = ['slug', 'person'], person foreign key field. in form don't want type slug field. want populate child_name field. tried as: class childform(slugcleanmixin, forms.modelform): class meta: model = child fields = ('child_name','slug','child_birth_date','blood_group') def slug(self): return slugify(self.child_name) but slug field not autopopulated child_name. tried using pre_save in models as: def create_slug(instance, new_slug=none): slug = slugify(instance.child_name) if new_slug not none: slug = new_slug qs = child.objects.filter(slug=slug).order_by("-id") exists = qs.exists() if exists: new_slug = "%s-%s" %(slug, qs.first().id) return create_slug(instance, new_slug=new_slug) return slug def pre_save_post_receiver(sender, instance, *args, **kwargs): if not instance.slug:

python - I have installed opencv on ubuntu. I was trying to use function imshow() . it is giving an error -

i have installed opencv on ubuntu. trying use function imshow(). giving error, please find below. opencv error: unspecified error (the function not implemented. rebuild library windows, gtk+ 2.x or carbon support. if on ubuntu or debian, install libgtk2.0-dev , pkg-config, re-run cmake or configure script) in cvshowimage, file /io/opencv/modules/highgui/src/window.cpp, line 545 error traceback (most recent call last) in () ----> 1 cv2.imshow('mask',img) error: /io/opencv/modules/highgui/src/window.cpp:545: error: (-2) function not implemented. rebuild library windows, gtk+ 2.x or carbon support. if on ubuntu or debian, install libgtk2.0-dev , pkg-config, re-run cmake or configure script in function cvshowimage you can try use option in cmake with_gtk=on opencv needs compiled gtk support (with_gtk=on).

Pandas Dataframe group by week -

Image
i have pandas dataframe contains set of fixtures of sports events on years worth of data. i want create new column in dataframe, 'round' increments week week can work on larger set of matrices (of fixtures) round round. import pandas pd dta = pd.read_csv(...) #read data indexeddta = dta.set_index(['date']) #index raw data. indexeddta['round'] = 0 #add in new column , give dummy value. indexeddta['round']= indexeddta.groupby(by=dta.date) #wrong assuming need new column different integer values each week, sorted date, not care values take, can try: import pandas data = list(range(10)) dates = pandas.series(pandas.date_range('2013-11-01', '2013-11-10')) df = pandas.dataframe({'dates': dates, 'data': data}) df = df.set_index('dates') df['round'] = df.index.year * 100 + df.index.week df if incremented 1 1, maybe add: df['round'] = df['round'].diff(1).fillna(1.) df.lo

php - How to retrieve orders details from woocommerce using REST API? -

i want orders details woocommerce using rest api. if, tried anything, returns error following: {"code":"woocommerce_rest_cannot_view","message":"sorry, cannot view resource.","data":{"status":401}} i have tried following, require __dir__ . '/vendor/autoload.php'; use automattic\woocommerce\client; use automattic\woocommerce\httpclient\httpclientexception; $woocommerce = new client( 'https://www.domain.com', 'ck_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 'cs_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', [ 'version' => 'v3', ] ); print_r($woocommerce->get('orders')); so, please provide suggestion or idea acheive solution. in advance.

Submit data from a form wordpress theme to other site -

supposed have website run on wordpress , has form use collect user's information (e.g., checkout function) , data submitted other site need it. is there better way of doing in wordpress? sure. can done using api services.

c# - Populating global variable in razor view using JQuery (MVC) -

please see code below: @{ var propertylist = new list<tuple<string, string>>(); } <input type="text" data-id="@item.item1" class="form-control prop"/> <a class="btn btn-default" id="run-report" href="@url.action("runreport", "reports", new {reportid = model.reportid, proplist = propertylist})"> run report</a> <script> $("#run-report").click(function () { $(".prop").each(function () { var currentprop = $(this).attr("data-id"); var currentpropval = (this).value; @{ propertylist.add(new tuple<string, string>("", "")); } }); }); </script> as can see above, have global variable called propertylist containing list of tuples, <string, string> . i declare here because need use url.action download report d

Detecting char encoding on direct file uploads PHP -

on site allow direct text file uploads. these files stored on server, , displayed on website. use utf-8 on site. now run trouble when people upload non- utf-8 files contain special chars, such é . i've been doing testing. made 2 text files, both containing same word fiancée . 1 encoded utf-8 , 1 encoded iso 8859-2. the utf-8 1 uploads fine, , shows text correct, iso 8859-2 shows fianc�e . now i've tried detect uploaded file content mb_detect_encoding , whatever file throw @ it, detect utf-8. i noticed can use utf8_encode convert iso 8859-2 files valid utf-8, works on non-utf files. , cannot detect non-utf files, cannot use utf8_encode function, messes valid utf-8 files. hope makes sense :) so question is, how can detect files sure not utf-8 encoded start with, can use utf8_encode function on them. you cannot. welcome encodings. seriously though, files binary blobs. bits , bytes in file mean anything @ all; images, cad data or, perhaps, text. de

Spring Sleuth - Tracing Failures -

in microservice environment see 2 main benefits tracing requests through microservice instances on entire business process. finding latency gaps between or in service instances finding roots of failures, whether technical or regarding business case with zipkin there tool, addresses first issue. how can tracing used unveil failures in microservice landscape? want trace error afflicted spans, not each request, nothing went wrong. mentioned here custom sampler used. alternatively, may register own sampler bean definition , programmatically make decision requests should sampled. can make more intelligent choices things trace, example, ignoring successful requests, perhaps checking whether component in error state, or else. so tried implement that, doesn't work or used wrong. so, blog post suggested registered own sampler: @bean sampler customsampler() { return new sampler() { @override public boolean issampled(span span) {

search - Lucene Faceting : what are the limitations of Taxonomy and SortedSetDocValuesFacetField compared to solr and es implementations? -

we know lucene supports faceting providing taxonomy(separate index , hierarchical facets) , sortedsetdocvaluesfacetfield ( flat facets , no sidecar index). then why did solr , elastic search go own implementation ? ( is, solr uses block join & elasticsearch uses aggregations ) there limitations in lucene's implementation ?

angular - Menu and submenu generation issue -

Image
i created small project, menus , it's sub menus generated services. sub menus loading first time when main menu clicked, next time, doesn't load. app.component.html: <li class="treeview" *ngfor="let menu of menus"> <a href="#" *ngif="menu.parentmenuid === 0"> <i class="fa fa-book"></i> <span>{{menu.menu}}</span> <span class="pull-right-container"> <i class="fa fa-angle-left pull-right"></i> </span> </a> <ul class="treeview-menu" *ngfor="let submenu of menus"> <li *ngif="submenu.parentmenuid === menu.id"><a routerlink="{{submenu.htmlid}}"><i class="fa fa-circle-o"></i> {{submenu.menu}}</a></li> </ul> </li> app.component.ts: import { menuservice } './services/menu.s

Excel function to choose a value greater than or less that a particular value in cell -

i have data set this units price 1 15 100 10 150 9 200 8 50000 7 i need output price respect quantity. example- if input value 90 should give price 15 if input 210 should give value 8. however,sadly cannot use if statement. in advance. you can use combination of index , match =index(b1:b5,match(lookup_value,a1:a5,1)) this assumes units in column a , price in column b make sure understand both functions: index match - particularly reason ,1) @ end