Posts

Showing posts from September, 2014

c# - ASP.Net MVC Login Method -

i have problem asp.net mvc application on hosting . when use login page on local machine worked without problem if upload website on hosting ( plesk windows ) , called login method, show error : an error occurred while trying encrypt provided data. refer inner exception more information. innerexception : access path `c:/windows/system32/configsystemprofile/appdata/local/asp.net/dataprotection-keys` denied. source file : //file header private readonly usermanager<mak_users> _usermanager; private readonly signinmanager<mak_users> _signinmanager; //login method var quser = db.users.where(a => a.username == model.usr_natcode).singleordefault(); await _signinmanager.signinasync(quser, model.rememberme); please me fix problem :((

html - PHP While loop to display information in groups of four -

i want make slider displays 4 boxes @ time information in it. connect database , information output using while loop. possible output in groups of four, seeing have 4 boxes , repeat process many times takes. far can output 4 boxes 1 person... <?php include '../pinflow/configuration.php'; session_start(); $sql = "select * pin pin_profession = 'engineering' order pinid desc"; $result = mysqli_query($database,$sql) or die(mysqli_error($database)); while($rws = mysqli_fetch_array($result)){ ?> <figure> <img src="../pinflow/userfiles/avatars/<?php echo $rws['pin_avatar'];?>" class="active" /> <figcaption><?php echo $rws['name'];?></figcaption> <img src="../pinflow/userfiles/avatars/<?php echo $rws['pin_avatar'];?>" class="active" /> <figcaption><?php echo $rws['name'];

html - MySQL - How can i remove specific part of a string? -

i have html embed codes inside database. want remove height , width values them. values not same can't use "replace" method. embed codes <iframe width="560" height="315" src="***" frameborder="0" allowfullscreen></iframe> . are there methods can replace 'width="{any value}"' "" (emptiness)

bash - Get rid of "warning: command substitution: ignored null byte in input" -

i'm getting -bash: warning: command substitution: ignored null byte in input when run model=$(cat /proc/device-tree/model) bash --version gnu bash, version 4.4.12(1)-release (arm-unknown-linux-gnueabihf) with bash version 4.3.30 it's ok i understand problem terminating \0 character in file, how can suppress stupid message? whole script messed since i'm on bash 4.4 there 2 possible behaviors might want here: read until first nul. more performant approach, requires no external processes shell. checking whether destination variable non-empty after failure ensures successful exit status in case content read no nul exists in input (which otherwise result in nonzero exit status). ifs= read -r -d '' model </proc/device-tree/model || [[ $model ]] read ignoring nuls. gets equivalent behavior newer (4.4) release of bash. model=$(tr -d '\0' </proc/device-tree/model) you implement using builtins follows: model="" while if

bash - Does the the order of command line flags matter? -

this question has answer here: is there established order 'ls' arguments? 1 answer i testing hugo static blog generator comes themes , example sites within them. in order use examplesite, copy content it's content hugo project root. while did this, noticed where, put -flag args seems important. is normal bash behavior or introduced zsh? this command didn't work cp themes/hugo-theme-bootstrap4-blog/examplesite/* . -r this command worked! cp -r themes/hugo-theme-bootstrap4-blog/examplesite/* . cp own command, provided os vendor. neither bash nor zsh controls behavior of cp . the posix standard requires cp accept options before arguments. given in posix utility syntax guidelines , entry #9: all options should precede operands on command line. gnu tools go beyond requirement, accepting options after arguments unless

c# Where does a path with no beginning default to? -

stream stream = new filestream("my file", filemode.create, fileaccess.write, fileshare.none); if have code this, path of stream defaults bin\debug .exe located. if .exe in directory, path default there? default same directory .exe is? the root current working directory application. doesn't have same exe location, , can change during execution. for example if in command line in directory c:\foo , run application c:\boo\my.exe path relative c:\foo you can find or change working directory using enviroment.currentdirectory property

c# - Open WPF Application from Excel VSTO project -

i have vsto excel tool written in c# , use wpf form display data. wpf form in different project, in same solution excel vsto project. if open wpf form in same thread excel, somehow damage excel , starts doing strange things. if run wpf form in different thread, works perfectly. code below should ok: if (app != null) { // when click button again , wpf form opened already, bring on top. bringdatabasetofront(); } else { t = new thread(() => { app = new app(_synchronizationcontext, currentcaller); app.resourceassembly = app.gettype().assembly; app.initializecomponent(); app.shutdownmode = system.windows.shutdownmode.onmainwindowclose; /* makes thread support message pumping * dispecher context of wpf db form */ dispatcher.run(); }); // wpf must on single-threaded apartment t.setapartmentstate(apartmentstate.sta); t.start(); } the problem starts when shut-down tool (excel). freezes , stays

java - JOIN with JPA: what queries should I write to get the same result I get in JDBC? -

i'm new jpa , trying convert method using in jdbc jpa exercise. supposed calculate masses of stars in database , update relative mass column . calculate mass need temperature of star , value of flux @ 350um band. problem have data saved in different tables of database, therefore have use join. jdbc approach public void updateallmasses() { string selectquery = "select s.starid, s.temperature, f.value" + " star s join flux f " + "on s.starid = f.source " + "where f.band = 350.00 , f.value != 0"; try { resultset resultset = databaseutiljdbc.dbexecutequery(selectquery); while (resultset.next()) { string starid = resultset.getstring("starid"); double flux350 = resultset.getdouble("value"); double temp = resultset.getdouble("temperature"); if (temp != 0) { string updatequery = "update

python - How to construct clusters based on pairwise linkage (the same or not) -

i have set of images , asked on mturk whether given 2 images, belong same category or not (there more application-specific nuance here asking whether belong same category or not). my question how construct cluster assignment such answers, assume possible pairs within set answered. ideally robust noise (we duplicated questions , plan use majority vote). one example, assuming there 3 images b c d. assuming answer following: similar b c similar d different c b different c different d b different d the output should 2 clusters (a, b) , (c, d). note not know number of clusters in advance , infer answers. i found related questions on not same. instance, might based on distance instead of boolean answer (yes or no). might able reduce question form of distance suppose question easier distance setting. related questions here: clustering given pairwise distances unknown cluster number? https://stats.stackexchange.com/questions/2717/clustering-with-a-distance-matrix would more i

python - Passing URL params from the database -

i trying build full stack web application. in database, have table lots of data looks like: shows id show_name show_number 1 first show 2 2 second show 1 3 third show 1 4 fourth show 2 5 fifth show 3 6 sixth show 1 if can see, have show number column on side. show number number 1-32. trying have url have show_number type of parameter setting url pattern. in urls.py urlpatterns = [ url(r'^show/(?p<show_number>\d+)$', views.slideshow), ] and when go …/show/1/, rows show_number 1 on page. if go …../show/2/ rows show_number 2 go there , on. in models.py: def show_screen(self): connection.cursor() cursor: cursor.execute("select show_number, show_name shows order show_number asc;") data = cursor.fetchall() return data i

python - Accepting integers as keys of **kwargs -

keywords have to strings >>> def foo(**kwargs): ... pass ... >>> foo(**{0:0}) typeerror: foo() keywords must strings but black magic, namespaces able bypass that >>> types import simplenamespace >>> simplenamespace(**{0:0}) namespace() why? , how ? could implement python function can receive integers in kwargs mapping? could implement python function can receive integers in kwargs mapping? no, can't. python evaluation loop handles calling functions defined in python code differently calling callable object defined in c code. python evaluation loop code handles keyword argument expansion has firmly closed door on non-string keyword arguments. but simplenamespace not python-defined callable, defined entirely in c code . accepts keyword arguments directly, without validation, why can pass in dictionary non-string keyword arguments. that's perhaps bug; supposed use c-api argument parsing functions , guard

java 8 - Collect a List from another List in Java8 using streams -

i have list of objects. want move through list , collect few objects need , create list of objects. how can achieve in java8. i start transactions.gettransactions() returns arraylist. now, want create list of transactions using t.getid() , t.getname() , t.getdate() . how can make null checks objects t.getotheraccount().getholder().getcountrerpartyname() efficiently.. transrolist.addall(trans.stream().filter(t -> t.getdetails().gettransactiontype() != null) .filter(t -> t.getdetails().gettransactiontype().equals(type)) .map(t -> { transactionsro ro = new transactionsro(); ro.setid(t.getid()); ro.setaccountid(t.getthisaccount().getaccountid()); ro.setcounterpartyaccount(t.getotheraccount().getcounterpartyaccount()); ro.setcounterpartylogopath(t.getmetadata() != null ? t.getmetadata().getcounterpartylogopath() : null); ro.setcounterpartyname(t.getotheraccount().getholder().getcounterpartyname())

Powershell using string and file content in email message body without breaking formatting -

i have powershell script has part needs email information. have requirement include 2 pieces of information inside message body, having issues formatting. first part line of text store inside powershell script variable, , second part information text file. below simplified version of want do: $info1="the following fruits ready eat: " $info2=get-content "info2.txt" $body=$info1 + $info2 $body=$body | out-string send-mailmessage -to myname@mydomain.com -subject "fruit status" -from fruit@mydomain.com -body $body -smtpserver smtp.mydomain.org -usessl the file info2.txt contains following info. 3 columns list of fruits tab separators: col1 col2 col3 apple orange pear banana grape strawbery kiwi peach apricot the above code works email looks this: the following fruits ready eat: col1 col2 col3 apple orange pear banana grape strawbery kiwi peach apri

Optimising *ngFor loops and *ngIf for large datasets (Angular 2) -

i'm displaying data json data (from api) using *ngfor , i'm bit concerned possible performance issues in approach. i'm looking suggestions on how improve it. this json structure (without data) displaying in page: https://gist.github.com/fogofogo/f4b5ac9a765fc684e7e08b30221c6419 and json structure full data: https://gist.github.com/fogofogo/f7b5c3db347246689ea5007344eff53b the json showing data 2 matches , @ 2k lines! potentially have 100 matches. this using display data on page: <div class="..." *ngfor="let sport of competition.sports"> <p>{{ sport.sport }}</p> <ng-container *ngfor="let country of sport.countries"> <div class="..." *ngfor="let tournament of country.tournaments"> <p>{{ country.country }} - {{ tournament.tournament }}</p> <div class="..." *ngfor="let fixture of tournament.fixtures" class="tournament_it

Java main method -

in overloaded main method why main method signature string[] args considered entry point. e.g. public class test { public static void main(string[] args) { system.out.println("why being printed"); } public static void main(string arg1) { system.out.println("why not being printed"); } public static void main(string arg1, string arg2) { system.out.println("why not being printed"); } } the main method should have 1 argument, of type string[] single string , 2 string forms not valid main methods, , such not options, accepted forms are: public static void main (string[]) public static void main (string...) the second option syntactic sugar first option. this set in java language specifications: 12.1. java virtual machine startup the java virtual machine starts execution invoking method main of specified class, passing single argument, array of strings... link

wordpress - Woocommerce Social Login Google verifying -

i got google id , google secret form google api console . , set in social login woocommerce plugin (yith plugin) . when try login google account , google this app isn't verified . don't have social login problem linkedin or facebook. google error screenshot follow these steps verify app https://support.google.com/cloud/answer/7454865

javascript - PHP call to header() function is not working -

this question has answer here: how fix “headers sent” error in php 11 answers i trying change page using php after set session variable. calling function code echo "<a href='index.php?id="; echo $row['id']; echo "'><img src='images/pic_1.jpg' the function called , variable set page never redirects <?php function getid() { echo $_get['id']; session_start(); header("location: home.php"); $_session['id'] = $_get['id']; } if (isset($_get['id'])) { getid(); } ?> i have tried both using exact url , file name none work. how have both page redirect , $_session['id'] variable work? response headers have sent before response body in http. code contains echo statement (which star

vbscript - can VBS control an application -

i running system based on reflection hp , have created many vb codes automate , make processes smoother. problem seeing vb editor linked actual application means make changes have roll out entire new version. want see if there way can call vbscript file , run code there changes needed, can make them without releasing whole new host program. can done?

r - Why is my Github page responding with 404? -

i'm trying launch github website.however, when go publish, receive 404 error message: "file not found. site configured @ address not contain requested file.if site, make sure filename case matches url.for root urls (like http://example.com/ ) must provide index.html file." i have index file, , address matches repository name.

ios - Cordova project with sub project build fails -

i'm developing cordova based ios app. want add vk social network sdk project. doc requires add project subproject main project. the problem subproject of vk has own bundle identifier com.vk.vksdkframework of course different project bundle id. when run cordova build ios --device , following error: === build target vksdkframework of project vk-ios-sdk configuration debug === check dependencies code sign error: provisioning profile not match bundle identifier: provisioning profile specified in build settings (“iphone 4s”) has appid of “com.myappid” not match bundle identifier “com.vk.vksdkframework”. it builds expected in xcode not cordova. there way ignore check bundle id?

regression - R survival survreg not producing a good fit -

Image
i new using r, , trying use survival analysis in order find correlation in censored data. x data envelope mass of protostars. y data intensity of observed molecular line, , values upper limits. data is: x <- c(17.299, 4.309, 7.368, 29.382, 1.407, 3.404, 0.450, 0.815, 1.027, 0.549, 0.018) y <- c(2.37, 0.91, 1.70, 1.97, 0.60, 1.45, 0.25, 0.16, 0.36, 0.88, 0.42) censor <- c(0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1) i using function survreg r survival library modeldata<-survreg(formula=surv(y,censor)~x, dist="exponential", control = list(maxiter=90)) which gives following result: summary(modeldata) call: survreg(formula = surv(y, censor) ~ x, dist = "exponential", control = list(maxiter = 90)) value std. error z p (intercept) -0.114 0.568 -0.20 0.841 x 0.153 0.110 1.39 0.163 scale fixed @ 1 exponential distribution loglik(model)= -6.9 loglik(intercept only)= -9 chisq= 4.21 on 1 degrees of freedom, p= 0.04 number of

How to scale a sprite proportionally by one axis - swift/spritekit -

i creating game requires sprite resized either x value or y value depending on sprite size. how can resize sprite either x value or y value yet have scale proportionally? appreciated! proportional means percentage, example if want scale 10% on x, node.xscale += node.xscale * 0.1 if want scale proportionally based on original size only, need preserve original scale somehow let dscalex = node.xscale * 0.1 ... node.xscale += dscale

css3 - Why does grid-gap change a column's width in CSS Grid? -

Image
using css-grid have setup 24 column grid inside of container 1002px wide. inside container div, there child div spans 21 columns. width of expecting of child div is: 21/24 * 1002 = 876.75 when grid-gap property added, width of column decreases 873px, not desired. how can write css width of div 876.75px? see example: https://codepen.io/edtalmadge/pen/mvlrqw?editors=1100 html <div class="container1"> <div class="column"> <p>no grid-gap ...width 876px expected</p> </div> </div> <div class="container2"> <div class="column"> <p>grid-gap: 30px; ...width becomes 873px (3px narrow)</p> </div> </div> css /* no grid gap */ .container1 { display: grid; grid-template-columns: repeat(24, 1fr); width: 1002px; background-color: #ededed; } /* has grid gap */ .container2 { grid-gap: 30px; // causes width o

coq tactic - Coq contradiction in hypotheses -

in coq have 2 hypotheses h , h0 , contradict each other. problem is, contradict each other specializations , @ moment of proof context not specialized. at moment proof context looks this: color : vertex -> bool v : v_set : a_set x0, x1 : vertex h : v x0 -> v x1 -> (a_ends x0 x1) \/ (a_ends x1 x0) -> color x0 <> color x1 h0 : v x0 -> v x1 -> (a_ends x0 x1) \/ (a_ends x1 x0) -> color x0 = color x1 ______________________________________ false as proof graphs ( v = set of vertices, a = set of arcs, color = color of vertex), show contradiction in natural language: suppose graph contains vertices x0 , x1 (and neighbouring), x0 , x1 cannot have same , different color @ same time. therefore h , h0 cannot both true , therefore goal implied current context. how should go in coq, without generating v x0 , v x1 , a (a_ends x0 x1) \/ (a_ends x1 x0) new subgoals time? tricky part the: "suppose graph exists v , a of such , such forms&quo

c# split string in 2. letter by letter -

i need split string in 2, 1 letter each variable. example: string = "abcdefghij" name1: acegi name2: bdfhj i done far: var builderm = new stringbuilder(); var builderk = new stringbuilder(); (int = 0; < s.length; i++) { builderm.append(s[i]); builderk.append(s[i++]); } txtm.text = builderm.tostring(); txtk.text = builderk.tostring(); but showing same text in 2. you should use ++i instead of i++ (int = 0; < s.length; i++) { builderm.append(s[i]); if(i + 1 < s.length) // prevent ior exception when count odd. builderk.append(s[++i]); // pre increment. } the reason i++ post incremented. means i gets incremented after expression therefor s[i++] give same item s[i] .

python - Adding timedelta object to datetime -

my timedelta object looks this: txdelta = 00:30:00 . want add datetime object consistently isn't working: from datetime import datetime, date, time, timedelta localdt = datetime.combine(datetime.strptime('2015-06-18', '%y-%m-%d').date(), (23:35:02+timedelta(txdelta)).time()) note 23:35:02 datetime object. error message: typeerror: unsupported type timedelta days component: datetime.timedelta what doing wrong? the way create time object strange. advice declare way if you're not used it: txdelta = timedelta(minutes=30) tdelta = time(hour=1, minute=35, second=2) if got tried combine date , time , timedelta . full code below should trick: from datetime import datetime, date, time, timedelta txdelta = timedelta(minutes=30) tdelta = time(hour=1, minute=35, second=2) localdt = datetime.combine(datetime.strptime('2015-06-18', '%y-%m-%d').date(), tdelta) + txdelta print(localdt) basically, combine datetime object time one

javascript - Scrolltop animation locking scroll -

i have form multiple fields. in each field, page scroll bottom $('.my_input').on('change', function(e){ $("html, body").animate({ scrolltop: $("html, body").height()}, "slow"); } this works fine, if try scroll top, page "freeze" scroll in bottom, releasing after several attemps. how fix it? tks maybe event firing again , again. can try using one fire event once. see code below. please share sufficient code replicate problem, if doesn't maybe reason problem. $(document).ready(function(){ $('.my_input').one('change', function(e){ $("html, body").animate({ scrolltop: $("html, body").height()}, "slow"); }); }); .my_input{ display:block; margin-bottom:300px; } <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <input type="text" class="my_input"/> &

ssh - Correct user group and permissions for WordPress on Google Compute Engine -

i'm running user group , permission issues restoring site google compute engine vaultpress backup solution; i'm being told it's related permissions , ssh user not being able write new files. can suggest permission/ownership change should make local user can write , edit file changes within wordpress instance, default directories , files within site belong www-data user , group. thank time :)

java - Retain Dynamic Json Property names using map -

i have read json api response pojo, massage data bit, , return in same json format. json has dynamic property names, , causing me problems mapping pojo. i read can use @jsonanysetter , read dynamic properties in map, not preserve names of dynamic properties. need names, have send same json on service. here sample json service needs read, { "recommendationmethods":{ "personalized":{ "teams":{ "teamtrek":[ { "name":"alex", "rank":0 }, { "name":"brian", "rank":1 } ], "teamfuji":[ { "name":"emma", "rank":0 }, { "name":"stephanie

wordpress - Apache with Firewall Port Redirection - Page cannot be displayed -

i @ loss trying understand why port redirection wordpress site fails. setup following: lab host [192.168.0.3/24] - check point firewall [192.168.0.253/24] - dmz wordpress site [static 1-1 nat (internal 172.16.1.80|external 192.168.0.80] the firewall setup forward https traffic going 4333 webserver in dmz on 443. goal put webserver online facing internet behind single static ip provided residential isp. when attempt access server remotely lab host, see traffic being redirected , making webserver. issue page cannot displayed. if browse ip , append .php page url, works. missing pictures , page formatting out of wack @ least portion of page gets displayed. how fix redirection can port forward 4333 443 , have wordpress site displayed without having provide page in url? not sure missing. don't think firewall @ point , hoping point me in right direction. assume apache configuration or wordpress setting issue. thanks in advance. e

better icons with css or html? -

is better doing icons html <!doctype html> <html> <head> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> </head> <body> <i class="fa fa-cloud"></i> <i class="fa fa-heart"></i> <i class="fa fa-car"></i> <i class="fa fa-file"></i> <i class="fa fa-bars"></i> </body> </html> or css way ? , performance same ? ty

java - Mapbox Android SDK Null Pointer exception on screen orintation change and crash on API 25 -

i getting null pointer exception when screen orientation changes vertical horizontal (all other api's) , upon launch on api25 . here stack trace , code in question. 09-11 20:24:57.386 2794-2794/com.example.andrew.satwatch e/androidruntime: fatal exception: main process: com.example.andrew.satwatch, pid: 2794 java.lang.nullpointerexception: attempt invoke virtual method 'void com.mapbox.mapboxsdk.maps.mapboxmap.addsource(com.mapbox.mapboxsdk.style.sources.source)' on null object reference @ com.example.andrew.satwatch.mainactivity.addvectorlayersource(mainactivity.java:1018) @ com.example.andrew.satwatch.mainactivity.addcountries(mainactivity.java:988) @ com.example.andrew.satwatch.mainactivity.onitemselected(mainactivity.java:423) code in q

c# - ProtoBuf ParseDelimitedFrom is misaligning to the NetworkStream? -

what trying do i author of this project grabs playing song spotify's local instance via local api , sets discord's 'now playing' message reflect it. pretty simple stuff, various reasons want switch c#, , doesn't have same level of support spotify. to cut long story shorter, cross-platform + working useful api + spotify playlist = clementine. decided create similar discord integration clementine. but there's problem i can create socket connects 127.0.0.1:5500. can send connectrequest message through socket. can receive these message types no problems whatsoever: keep_alive, play, pause, stop, repeat, shuffle, volume_update, track_position_update but if try play song stopped state, 20 exceptions thrown , "play" message parsed. believe should current_metainfo message. similar exceptions thrown if try add new song playlist. the mechanism using retrieve messages message.parser.parsedelimitedfrom(client.getstream()); wh

Azure Vnet Peering in ARM Template -

i have common arm template common infrastructure , arm template applicationxyz infrastructure. in arm template applicationxyz infrastructure want peer vnet in vnet in common infrastructure arm template. possible without editing both arm templates, or having vnets peered in same arm template? i'm not sure understand question properly, if vnets in different resource groups need nested deployment or change both templates create peering, peering require configured on both end (with exclusing of classic arm peering, can enabled on 1 end). also, cannot create peering if vnet not existant, in order idea work vnets must in place.

c++ - Architecture/Platform independent installer for deploying Qt application -

i have developed qt application , want deploy application. know qt (being platform independent), needs compile every platform , architecture. so, planning cross-compile every architecture , platform , executables , dll files (or shared object in linux). i looking installer can decide on run-time architecture , platform of system in running , copy right binary desired location in system. know need provide every possible dll file , executable file don't want provide different installer every architecture , platform going support. don't want distribute different installer different architecture (e.g. windows/i3, windows/i5 etc) under different directories. so, looking free open-source installer doesn't require compiled every possible architecture , platform (may 1 written in java?). can me in deciding architecture should cross-compile for? binary compiled i3 intel core able run on i5 , i7 (because of backward compatibility?)? any suggestion on deployment of qt app

php - Checking if selected rows are favourite by user in cakephp -

i have venue table 20+ columns. have favorite_venues table columns id | userid | venueid here code venues $this->venue->virtualfields = array( 'bookedcount' => "select count(*) bookings venueid = venue.id" ); $result = $this->venue->find('all', array('conditions'=>$conditions, 'order' => array('venue.bookedcount desc'), 'limit' => 20, 'offset' => $offset * 20 )); i want add condition if send userid, should check every venue if added favourite list or not , set $venue['isfavorite'] = yes/no i dont want loop , check every venue get. there way can incorporate in same mysql query in cakephp. not sure how put yes/no virtual field you can left join in favorite_venues table, , example use case statemen

c# - UpdateProgress not working on secound click -

updateprogress works on first button click . when click second time updateprogress didn't appeared.instead of updateprogress things works on second click. please me.. <asp:updatepanel id="updatepanel2" runat="server"> <triggers> <asp:asyncpostbacktrigger controlid="btnsubmit" /> </triggers> <contenttemplate> <div class="form-group row"> <div class="col-sm-6"> <p style="margin: 0 0 5px 0;"><b>class</b></p> <asp:dropdownlist id="drpclass" cssclass="form-control" onselectedindexchanged="drpclass_selectedindexchanged" autopostback="true" runat="server"></asp:dropdownlist> </div> <div class="col-sm-6"> <p style="margin: 0 0 5px 0;"><b>divisio

elasticsearch - elastic search error: "can't select channel size is 0 for types: [RECOVERY, BULK, STATE]" -

i'm getting following error fluentd-elasticsearch after running every couple of hours: can't select channel size 0 types: [recovery, bulk, state] it looks error coming here: elasticsearch/core/src/main/java/org/elasticsearch/transport/connectionprofile.java <t> t getchannel(t[] channels) { if (length == 0) { throw new illegalstateexception("can't select channel size 0 types: " + types); } assert channels.length >= offset + length : "illegal size: " + channels.length + " expected >= " + (offset + length); return channels[offset + math.floormod(counter.incrementandget(), length)]; } what cause of error? how resolve? this fluentd setup: <match *.**> buffer_chunk_limit 64m buffer_queue_limit 500 type elasticsearch hosts index1:9200,index2:9200 logstash_format true flush_interval 30s request_timeout 100s flush_at_shutdown true

T4 default template parameters -

i want pass in default template parameters of context controller t4 template codegenerator function new extension such: <#@ parameter type="system.string" name="controllername" #> <#@ parameter type="system.string" name="controllerrootname" #> <#@ parameter type="system.string" name="namespace" #> <#@ parameter type="system.string" name="areaname" #> <#@ parameter type="system.string" name="contexttypename" #> <#@ parameter type="system.string" name="modeltypename" #> <#@ parameter type="system.string" name="modelvariable" #> <#@ parameter type="microsoft.aspnet.scaffolding.core.metadata.modelmetadata" name="modelmetadata" #> <#@ parameter type="system.string" name="entitysetvariable" #> <#@ parameter type="system.boolean" name="use

make options page full screen in chrome plugin -

i need increase size of options page of chrome plugin full screen . tried tired increase width , height not have effect. the body tag of options.html looks this: <body style="width:1300px;height:500px;"> in manifest json have "options_ui": { "page": "options.html", "chrome_style": true }, "background": { "scripts": ["background.js"] }, i open options page chrome > more tools > extensions > options hyperlink. can please suggest how can achieve it.

java - My understanding of when to use Abstract class or Interface -

i wish validate understanding of when/why use abstract or interface. my example related humans. human can man or woman. human can have different profession in life. how use them: i declare professions interface, because establish contract of human can in profession. example: interface softwareengineer{ code(); } interface truckdriver{ drivetruck(); } interface pilot{ flyplane(); } and declare man , woman abstract class- because man , woman person is. abstract man{ } abstract woman{ } the class use define person can implement profession interface define person can , person extend abstract class define he/she is. class mark extends man, implements softwareengineer{ code(){ } } this how explain 1 interface , abstract difference understanding. wondering how answer below 2 questions: you can not instantiate abstract class , if make man , woman abstract how can instantiate these class. how can of use then? why did make man , woman abstract, why can'

Switch between camera in android for Camera2Api -

i using snipped of code switch between cameras old camera api imagebutton useothercamera = (imagebutton) findviewbyid(r.id.useothercamera); //if phone has 1 camera, hide "switch camera" button if(camera.getnumberofcameras() == 1){ useothercamera.setvisibility(view.invisible); } else { useothercamera.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { if (inpreview) { camera.stoppreview(); } //nb: if don't release current camera before switching, app crash camera.release(); //swap id of camera used if(currentcameraid == camera.camerainfo.camera_facing_back){ currentcameraid = camera.camerainfo.camera_facing_front; } else { currentcameraid = camera.camerainfo.camera_facing_back; } camera = camera.open(currentcameraid); //code snippet method somewhere on android developers, forget setcameradisplayorientation(cameraactivity.this, currentcameraid,

python - db.create_all() doesn't throw any errors and doesn't create the tables -

here's file structure: / /apitestproject /models __init__.py users.py items.py /resources __init__.py users.py items.py __init__.py index.py .deployment deploy.cmd requirements.txt run_waitress_server.py runserver.py web.config inside main __init__.py file have: from flask import flask flask_sqlalchemy import sqlalchemy postgres = { 'user': 'admin_user@pracap', 'pw': 'the_password', 'db': 'apitest', 'host': 'pracap.postgres.database.azure.com', 'port': '5432', } url = 'postgresql://{}:{}@{}:{}/{}'.format(postgres['user'], postgres['pw'], postgres['host'], postgres['port'], postgres['db']) app = flask(__name__) app.config['sqlalchemy_database_uri'] = url app.config['sqlalchemy_track_modifications'] = false db = sqlalchemy(app) import apitestproj

javascript - Angular Submit Syntax and message if no results found using MovieDB API -

i'm super new @ web development , trying learn how use angular mini project. i'm using moviedb's restful api's , want simple search movie title, return results found, , return message if nothing found. unfortunately i'm hitting few comprehension hurdles , have looked solution haven't found 1 matches i'm doing, think pretty simple (most of ones i've seen more complex approaches , think it's beyond understanding moment) all want right have searchbar, user types in movie name, clicks submit, , angular app return results. can't quite figure out how pass submit through app. here html code: <!doctype html> <html> <head> <link href="http://s3.amazonaws.com/codecademy-content/projects/bootstrap.min.css" rel="stylesheet" /> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.3/angular.min.js"> </script> <!-- modules --> <script src="js/app.js">

css - How to Stick the arrow icon to line -

am trying make border css below has small triangle icon css needs centered border line of div. if use float:right or left arrow icon goes either end of border line, can make center , if possible stick border line responsive design. .center { text-align: center; border: 3px solid green; } .arrow-down { width: 0; height: 0; border-left: 10px solid rgba(30, 7, 7, 0); border-right: 10px solid transparent; border-top: 10px solid #f00; } <!doctype html> <html> <head> </head> <body> <div class="center"> <p>this text centered.</p> </div> <div class="arrow-down"></div> <div class="center"> <p>this second text centered.</p> </div> <div class="arrow-down"></div> <div class="center"> <p>this third text centered.</p> </div> <div class=&

language agnostic - Is floating point math broken? -

0.1 + 0.2 == 0.3 -> false 0.1 + 0.2 -> 0.30000000000000004 why happen? binary floating point math this. in programming languages, based on ieee 754 standard . javascript uses 64-bit floating point representation, same java's double . crux of problem numbers represented in format whole number times power of two; rational numbers (such 0.1 , 1/10 ) denominator not power of 2 cannot represented. for 0.1 in standard binary64 format, representation can written as 0.1000000000000000055511151231257827021181583404541015625 in decimal, or 0x1.999999999999ap-4 in c99 hexfloat notation . in contrast, rational number 0.1 , 1/10 , can written as 0.1 in decimal, or 0x1.99999999999999...p-4 in analogue of c99 hexfloat notation, ... represents unending sequence of 9's. the constants 0.2 , 0.3 in program approximations true values. happens closest double 0.2 larger rational number 0.2 closest double 0.3 smaller rational number 0.3 . sum

accessibility - Blinking cursor visible on texts after voiceover off on safari -

i using safari on mac. cursor , focus on field looks fine. when starts voiceover , after terminating it, blinking cursor starts appearing on texts input fields. replicate this, use html page, start voiceover on , close voiceover. seeing blinking cursor on texts. there way fix this?

Auto Logout from app after 15 min due to inactivity in android -

i want session management in android application.i want logout user application if inactive or not interacting application. not sure when start service. starting in onresume(). have used countdowntimer automatic logout after 15min. not working. there efficient or working solution session management. logoutservice : public class logoutservice extends service { public static countdowntimer timer; @override public void oncreate(){ // todo auto-generated method stub super.oncreate(); timer = new countdowntimer(5 * 60 * 1000, 1000) { public void ontick(long millisuntilfinished) { //some code log.v("logoutservice", "service started"); } public void onfinish() { log.v("logoutservice", "call logout service"); // code logout stopself(); } }; } @override public ibind

javascript - Google Map is not showing up -

Image
i working on website http://dev5.99medialabtest2.com/carwash/ in bottom, there section "our location". there code map, can check inspect feature, map not showing on front end. can please? your parent container not have height, thats why don´t see map. try set height of div id of 'map' value , see map #map { height: 200px; }