Posts

Showing posts from July, 2013

sql - Handle divide by zero exception in this SSRS rdlc expression -

the following code showing result nan% if values zero: =format(((sum(iif(fields!flag.value=1,cint(fields!area1.value),0))) / (sum(iif(fields!flag.value=1,cint(fields!unitarea.value),0))) *100),"n") + "%" the simplest way avoid divide 0 error here not create in first place! if replace 0 second return value in divisor iif expression 1, problem goes away. that said think whole expression simplifying somewhat. if read correctly want determine proportion of area1 within unitarea when value of flag 1. expression written: =format( iif( fields!flag.value = 1, cint(fields!area1.value) / cint(fields!unitarea.value), nothing ), "percent" ) note i've dropped multiplier , instead used format function return result of division percentage (you further removing format function entirely , handling formatting in designer). you don't have layout expression indentation have, expression builder ignores whitesp

unity3d - Using Accelometer in unity,to move a gameobject with in the scene -

i placing 2 gameobjects @ left down corner , right upper of screen. using 2 gameobjects form border. , using boundaries class create bound such stop pivot point of gameobject , move inside bound using accelometer (it means have 2 borders, outer border , inner border, drawing inner border using bounds width , height calculating formula derived). this code void start () { valueofheight = (screen.height * 110 )/ 320; valueofwidth = (screen.width * 110 )/ 480; boundaries = new bounds (new vector3(screen.width/2,screen.height/2,0f),new vector3(screen.width - valueofwidth,screen.height - valueofheight,0f)); } void update () { if(gameobject.transform.position.x > cornerpoints [1].transform.position.x && gameobject.transform.position.x < cornerpoints [3].transform.position.x&& gameobject.transform.position.y > cornerpoints [1].transform.position.y&& gameobject.transform.position.y < cornerpoints [3].transform.position.y) {

xpath - Returning empty string when attribute does not match return text when attribute matches -

i need able keep track of in document particular value is. use xsl ecosystem i'm working in prevents that. i'm using java saxon-he 9.7.0-2 processor. xml <test> <value cat="fiction">at edge of orchard</value> <value cat="mythology">hero thousand faces</value> <value cat="fiction">spill simmer falter wither</value> </test> xpath for $a in /test return (if ($a/value[@cat="mythology"]) $a/value[@cat="mythology"] else "") what see come is: "" "hero thousand faces" "" what i'm seeing is: "hero thousand faces" link videlibri xpath tester link saxon code i think want iterate on every value , check. below xpath should work you: string-join((for $a in /test/value return (if ($a[@cat=&

amazon web services - Issues while testing on AWS Auto Scaling, ELB, Cloud Watch -

i created web app in jsp. 1 of web app url return unique id. here url. www.biomobilestrokelab.com/gatekeeper/newuserid.jsp it works fine in web browser. want test scalablity on web app. use apache jmeter purpose. when hit 1000 requests per second sometimes requests return response successfully sometimes receive http 504 gateway timeout code somtimes receive http 503 service unavailable back-end server @ capacity. i using aws autoscalig minimum instances = 2 maximum instance = 12 health check grace period = 300 sec default cool down = 60 sec for elb follwing options configured. time out = 60 sec interval = 200 sec unhealthy threshold = 2 healthy threshold = 10 and apply following cloud watch matrices auto scaling. cpu utilization: add 1 instance when greater 10% , remove 1 instance when less 3% , applied average statistics period of 1 minute. request count: adds 1 instance when sum greater 1000 , decrease 1 instance when sum less equal 1000. ki

c++ - Why do I have to implement a virtual function in a derived class if I want to use the base class implementation -

i have pure virtual base class , derived class. know allowed implement virtual (not pure) method in base class. not understand why have implement same method in derived class if want use base implementation: #include <iostream> using namespace std; class abstract { public: int x; abstract(){ cout << "abstract constructor" << endl; x = 1; } virtual void foo() = 0; virtual void bar(){ cout << "abstract::bar" << endl; } }; class derived : abstract { public: int y; derived(int _y):abstract(){ cout << "derived constructor" << endl; } virtual void foo(){ cout << "derived::foo" << endl; } virtual void bar(){ abstract::bar(); } }; int main() { cout << "hello world" << endl; derived derived(2); derived.foo(); derived.bar(); //here have define derived::bar use

Butterknife 8.4.0 - Plugin with id 'android-apt' not found -

i keep getting error plugin id 'android-apt' not found . what's going wrong here? plugins { id "me.tatarka.retrolambda" version "3.2.5" } apply plugin: 'com.android.application' apply plugin: 'android-apt' android { compilesdkversion 24 buildtoolsversion '23.0.3' dexoptions { javamaxheapsize "6g" } defaultconfig { applicationid "com.yitter.android" minsdkversion 15 targetsdkversion 24 multidexenabled true // enabling multidex support. renderscripttargetapi 23 renderscriptsupportmodeenabled true } buildtypes { release { minifyenabled false //runproguard false //proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.txt' } } compileoptions { sourcecompatibility javaversion.version_1_8 targetcompatibil

cron - How do I create a scheduled task with Heroku's free site? -

i’m using rails 4.2.7. want host app heroku first decided create free hobby account see how works. create task runs every day , reading heroku’s scheduler app. however, when try , add add-on error $ heroku addons:create scheduler:standard creating scheduler:standard on ⬢ myproject... ! ▸ please verify account install add-on plan (please enter credit card) more information, see https://devcenter.heroku.com/categories/billing verify @ ▸ https://heroku.com/verify i’m not ready shell out money yet. how create scheduled task or heroku not hosting service this, , if not, else should go? you must verify account use add-ons (some exceptions there, heroku postgres , heroku connect add-ons). you don't need spend money verify account. need have valid credit card. heroku try verify credit card , on successful verification, account verified. can read more information accepted credit cards , detailed verification procedure here . quoting link mentioned above,

ocaml - An executable compiled in Mac OS cannot run in Ubuntu server? -

i have written one-line ocaml program: print_string "hello world!\n" in mac os. compiled ocamlopt -o test test.ml , generated test works fine. then scp test ubuntu & nginx server, ocaml not installed. launched ./test , , got error: -bash: ./code: cannot execute binary file: exec format error . so have install ocaml on server, , compile program on there? isn't possible compile program in mac os in way such executable alone run in ubuntu server? executable (binary) formats not portable across systems, no. ocamlopt produces format native system on compilation, , shouldn't expect run on other system unless of identical type. you can portability compiling bytecodes instead (using ocamlc rather ocamlopt). bytecode executables run more slowly, however.

asp.net mvc - How to disable jquery.unobstrusive and enable jquery.validate in MVC forms -

i have mvc form , using jquery.validate.js plugin validate controls. had requirement of making form submit value asynchronously, took advantage of ajax.beginform() , had include jquery.validate.unobtrusive.js plugin pass value asynchronously. problem when started use jquery.validate.unobtrusive.js plugin validation used validate using jquery.validate gone toss , validation not getting fired, instead data annotation validation getting fired dont want. link using <script src="~/scripts/jquery/jquery.validate.min.js"></script> <script src="~/scripts/jquery/additional-methods.min.js"></script> <script src="~/scripts/jquery.validate.unobtrusive.js"></script> @using (ajax.beginform(new ajaxoptions { httpmethod = "post", onbegin = "onbegin", onsuccess = "success", onfailure = "fail", url = "~/usermanagement/editingpopup_create" })) { @html.labelfor(model => model.fi

hibernate - Could not determine type for: java.util.Set -

this classes user , catalog... 1 user have many catalog. package com.egs.account.model; import org.apache.commons.lang.builder.equalsbuilder; import javax.persistence.*; import java.util.date; import java.util.set; @entity @table(name = "user") public class user { private long id; private string username; private string password; private string passwordconfirm; private string firstname; private string lastname; private date dateregistered; private long skypeid; private set<role> roles; @onetomany(mappedby = "user", cascade = cascadetype.all) private set<catalog> catalogs; @id @generatedvalue(strategy = generationtype.auto) public long getid() { return id; } public void setid(long id) { this.id = id; } public string getusername() { return username; } public void setusername(string username) { this.username = username; } public stri

python - pync interacting with tweepy -

am python newbie here. trying filter tweets using tweepy , streaming function, , push alert me via pync. using notifier function, i've noticed when notification pure text. moment there url in there, no longer see notification. i've tried decoding/encoding utf-8/ascii suspecting issue has got format, , i've tried using regex extract part without url, nothing seems work. an example of tweet trying push myself be: [bukit timah] snorlax until 8:14:00am @ pie http://maps.google.com/maps?q=1.336806,103.809445 … http://sgpokemap.com would appreciate help! if need more information let me know! i've solved myself! seems notifier cannot take in character brackers [ , ]. did filter out , ok.

python - How to select text from DataTable object in Bokeh -

i have bokeh datatable object. dynamically updating using incoming stream of data. @ point of time select (using mouse) particular cell , copy value (to text-box). however, unable copy text. there attribute in datatable can used that, or there other workaround. data = dict(x=[], y=[]) source = columndatasource(data) columns = [ tablecolumn(field="x", title="id"), tablecolumn(field="y", title="count"), ] data_table = datatable(source=source, columns=columns, width=400, height=280) demo_data = {} demo_data['x'] = ["9985", "5106", "1218", "3427", "2642", "2769", "3410", "9220", "1298", "6562"] demo_data['y'] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] you should add editable attribute datatable like: data_table = datatable(source=source, columns=columns, wi

c# - Reload routes on runtime in dotnetcore -

i have custom route reads urls no-sql database (mongodb) , add them route pipeline @ moment application starts, "pretty standard" something (in startup.cs file): app.usemvc(routes => { routes.maproute( "default", "{controller=home}/{action=index}/{id?}"); routes.routes.add( new landingpagerouter(routes, webrequest, memorycache, configuration)); // custom routes adds urls database } the issue if add route database after application has started 404 since routing system isn't aware of new route, think need add missing routes @ runtime or (less convenient) restart application pool web application (which has been developed on framework 4.5 , runs on different pool) any other thoughts on this? thanks. the first question database mean when say: i add route database , wether can keep routes in json, xml or ini file. if can, example, keep routes in json file, there possible routes dynamically avai

python - Enabling or disabling checkbox with conditionals -

in code i'm trying disable hi box when no checked , enable when yes checked. attempt in changed function. when running code , checking yes box hi still fine , when checking yes yes box get: exception in tkinter callback traceback (most recent call last): file "c:\users\ahmed\appdata\local\programs\python\python35-32\lib\idlelib\run.py", line 119, in main seq, request = rpc.request_queue.get(block=true, timeout=0.05) file "c:\users\ahmed\appdata\local\programs\python\python35-32\lib\queue.py", line 172, in raise empty queue.empty during handling of above exception, exception occurred: traceback (most recent call last): file "c:\users\ahmed\appdata\local\programs\python\python35-32\lib\tkinter__init__.py", line 1550, in call return self.func(*args) file "c:\users\ahmed\desktop\no_yes.py", line 13, in changed c3.config(state=enable) nameerror: name 'enable' not defined it might me using idle , not imp

ios - Setting height for UITableViewCell with UIWebView inside -

i have uiwebview inside custom uitableviewcells . problem don't quite know how dynamically size uitableviewcell cells since webview inside cell needs render before can know webview's height. my proposed solution follows: customcell.m conforms uiwebviewdelegate , returns own height delegate method after webview inside has finished loading. - (void)webviewdidfinishload:(uiwebview *)webview { cgfloat height = [[webview stringbyevaluatingjavascriptfromstring:@"document.body.scrollheight"] floatvalue]; [self.contentwebview setframeheight:height]; [self.delegate celldidfinishloadingwithcell:self withheight:height]; } then tableviewcontroller.m conforms cell's delegate, , redraws doing like: - (cgfloat)tableview:(uitableview *)tableview heightforrowatindexpath:(nonnull nsindexpath *)indexpath { return [self.heights[[nsstring stringwithformat:@"%i%i",indexpath.section,indexpath.row]] floatvalue]; } - (uitableviewcell *)tablevi

maven - How to find which dependency is pulling in a particular class file? -

my project consists of dependencies pulling same common dependency. the common dependency storm-kafka has new version 1.0.2 , old version 0.10.0 on building shaded jar, see classes both versions in fat jar , somehow during execution, older 1 getting picked gives classnotfounderror because other dependencies related older version not there. jar -xvf my_shaded_fat_jar.jar find . -name keyvalueschemeasmultischeme.class ./org/apache/storm/kafka/keyvalueschemeasmultischeme.class ./storm/kafka/keyvalueschemeasmultischeme.class storm/kafka older 1 , org/apache/storm/kafka new 1 want. surprising part not see 0.10.0 in ~/.m2 repo: ls ~/.m2/repository/org/apache/storm/storm-kafka/ 1.0.2 # no 0.10.0 here ! how debug maven find out older dependency creeping into? edit: on running mvn dependency:tree -dverbose -dincludes=storm.kafka , get: [warning] pom org.apache.storm:flux-core:jar:1.0.2 invalid, transitive dependencies (if any) not available, enable debug logging mo

python - Gunicorn, no module named 'myproject -

i'm installing built website on new server. i'm not original developer. i've used gunicorn + nginx in past keep app alive (basically following this tutorial ), having problems here. i source venv/bin/activate , ./manage.py runserver 0.0.0.0:8000 works , running expected. shut down , run gunicorn --bind 0.0.0.0:8000 myproject.wsgi:application , , following: [2016-09-13 01:11:47 +0000] [15259] [info] starting gunicorn 19.6.0 [2016-09-13 01:11:47 +0000] [15259] [info] listening at: http://0.0.0.0:8000 (15259) [2016-09-13 01:11:47 +0000] [15259] [info] using worker: sync [2016-09-13 01:11:47 +0000] [15262] [info] booting worker pid: 15262 [2016-09-13 01:11:47 +0000] [15262] [error] exception in worker process traceback (most recent call last): file "/var/www/myproject/venv/lib/python3.5/site-packages/gunicorn/arbiter.py", line 557, in spawn_worker worker.init_process() file "/var/www/myproject/venv/lib/python3.5/site-packages/gunicorn/workers/b

Server rendering in python/ruby/php then attach react.js in client -

i'd try react.js. most examples seem suggest server api + reactjs rendering or server rendering via node/reactjs + reactjs rendering on client i'd have 2 templates, 1 server , 1 client because think maintaining node+reactjs on server hassle , cause performance degrade. if render html on server jinja2 (or whatever server template language other reactjs), possible attach reactjs component rendered html? doesn't react add special id , key attributes divs hard create jinja2 (or template language) ?

emscripten read javascript arrayBuffer in C -

this code incorrect tells trying do char* p = em_asm( var = new arraybuffer(8); return a; ); what correct way of getting c pointer of javascript arraybuffer? want read arraybuffer not write as far i'm aware, there's no direct way of returning array inline javascript (although there way of returning read-only arrays javascript wrapped c functions, see this answer ). can instead malloc space array in c function, pass address inline emscripten, , use emscripten javascript function writearraytomemory copy javascript array malloc ed memory. this... char *a = malloc(4); em_asm_int({ var v1 = new uint8array([2,4,6,8]); writearraytomemory(v1, $0) }, a); printf("the array [%d, %d, %d, %d]\n", a[0], a[1], a[2], a[3]);

php - Find sum of column with certain string(s) in another column in a table -

Image
i trying work on project needs find total sum , total sum criteria. currently, have managed calculate total sum of column "price". here code: $sumquery = "select sum(price) value_sum tickets"; //$dbc database connection $sumresponse = @mysqli_query($dbc, $sumquery); $sumrow = mysqli_fetch_array($sumresponse); $sum = $sumrow['value_sum']; i want work upon code , make more specific. instead, want calculate sum of column "price" if in row has string "check" or "cash" in column "paytype". have no idea start this. have done research prior asking question, came out no results. here snippet of table may understand more: here simple version of want achieve if description made no sense. find sum of column "price" each row string "check" or "cash" in column "paytype". use conditional aggregation: select sum(price) value_sum, sum(case when paytype in ('c

Rails 4.2.7 & Devise 4.1.1 - Change password with current password required in user preferences page with AJAX -

my application has 3 different user types (i.e. devise models): superadminuser , adminuser , standarduser . every user, regardless of type, has preferences page able update number of attributes (e.g. :email , :password , :username , etc.), 2 of attributes requiring user enter current password update ( :email , :password ), while remaining attributes not require current password update. now, in ideal world, preference updates utilize ajax attribute changed refresh in page rather entire page reload. have working of attributes don't require user enter current password, i've been unable work :email , :password . oddly enough, have working in previous prototype, had 1 devise user model, not three, , single model didn't have it's own registration controller overriding devise registration controller, 3 user models in current app do, although don't see in these overriding registration controllers impacting issue here. the error message i'm getting own, on pre

java - Replace intents for notification within app -

intents taking long process in app. there better way can tell different elements of app has happened? example use: intent = new intent("com.ftx.player_died"); i listen intent on 2 different places in app. not make same call twice. inventory.playerdied(true); notificationbar.playerdied(true); doesn't scale nicely. is there can use faster intents don't make same call twice or 3 times? using localbroadcastmanager or eventbus not faster normal broadcastmanager , private app (that means other application cant listen intent action)

CMake additional Debug Options -

when compiling code debug symbols, want enable compile-time , run-time checks, so: gfortran -c -o hello.o -g -o0 -wall -fcheck-all -fbacktrace hello.f90 (yes, it's fortran, assume it'd work other languages same.) if wanted compile same intel fortran compiler, command this: ifort -c -o hello.o -g -o0 -warn -check -traceback hello.f90 the way compile in cmake have found far this: if(${cmake_fortran_compiler_id} matches "gnu") set(cmake_fortran_flags_debug "${cmake_fortran_flags_debug} -wall -fcheck=all -fbacktrace") elseif(${cmake_fortran_compiler_id} matches "intel") set(cmake_fortran_flags_debug "${cmake_fortran_flags_debug} -warn -check -traceback") else() message(warning "unable determine compiler id: ${cmake_fortran_compiler_id}") endif(${cmake_fortran_compiler_id} matches "gnu") but introduces hardcoded flags wanted avoid when starting use cmake. there way add compiler switches based o

Java client with Apache HttpClient to connect to Druid -

i working on ingesting , query data on druid server. but, when query using command line below: curl -x 'post' -h 'content-type:application/json' -d @quickstart/ingest_statistic_hourly_generate.json localhost:8090/druid/indexer/v1/task can tell me way of utilizing java client apache httpclient send query druid server response. much. i have not tested , should give fair idea of doing this import java.io.bufferedreader; import java.io.inputstreamreader; import java.nio.file.files; import java.nio.file.paths; import org.apache.http.httpresponse; import org.apache.http.client.httpclient; import org.apache.http.client.methods.httppost; import org.apache.http.entity.stringentity; import org.apache.http.impl.client.httpclientbuilder; public class httptestclient { public static void main(string[] args) throws exception { string url = "http://localhost:8090/druid/indexer/v1/task"; string content = new string(files.readallbytes(p

html - Laravel <title> in <body> -

i mixed 2 examples laravel tutorial ,and receive result, hope me understand. route file : route::get('/', function () { return view('child', ['name' => 'samantha']); child.blade.php @extends('layouts.master') @section('title', 'page title') @section('sidebar') @parent <p>this appended master sidebar.</p> @endsection hello, {{ $name }}. @section('content') <p>this body content.</p> @endsection and master.blade.php <html> <head> <title>app name - @yield('title')</title> </head> <body> @section('sidebar') master sidebar. @show <div class="container"> @yield('content') </div> </body> </html> output hello, samantha. master sidebar. appended master sidebar. body content. page source code

android - How to code a sort of layout in XML where a circular ImageView is aligned on top of a CardView as shown in the picture below? -

Image
i want develop below shown sort of layout app. i want know how align circular imageview on cardview shown above. well can done through both image view , cardview put in relative layout. use com.joooonho.selectableroundedimageview rounded image view. use this: <relativelayout android:layout_width="match_parent" android:layout_height="match_parent" android:paddingleft="2dp" android:paddingright="2dp" > <android.support.v7.widget.cardview android:id="@+id/card_view" android:layout_gravity="center" android:layout_width="match_parent" android:layout_height="define it" android:margintop="70dp" card_view:cardcornerradius="4dp"/> <com.joooonho.selectableroundedimageview android:id="@+id/image" android:src="@drawable/photo

Login to created Windows instance using Ansible -

i creating windows instance using ansible. once instance got created need install iis on created instance automatically. how login newly created instance automatically? what parameters need mention in host (inventory) file login? everything in docs. prerequisites (powershell on target machine): set-netconnectionprofile -interfacealias ethernet0 -networkcategory private enable-psremoting iwr https://raw.githubusercontent.com/ansible/ansible/devel/examples/scripts/configureremotingforansible.ps1 -usebasicparsing | iex group_vars file group_vars/server : ansible_user: administrator ansible_password: secret ansible_port: 5986 ansible_connection: winrm inventory file: [server] 192.168.1.2 playbook: --- - name: install iis hosts: server gather_facts: false tasks: - name: install iis win_feature: name: "web-server" state: present restart: yes include_sub_features: yes include_management_tools: y

python - Pandas aggregate list in resample/groupby -

Image
i have dataframe in each instance has timestamp, id , list of numbers follows: timestamp | id | lists ---------------------------------- 2016-01-01 00:00:00 | 1 | [2, 10] 2016-01-01 05:00:00 | 1 | [9, 10, 3, 5] 2016-01-01 10:00:00 | 1 | [1, 10, 5] 2016-01-02 01:00:00 | 1 | [2, 6, 7] 2016-01-02 04:00:00 | 1 | [2, 6] 2016-01-01 02:00:00 | 2 | [0] 2016-01-01 08:00:00 | 2 | [10, 3, 2] 2016-01-01 14:00:00 | 2 | [0, 9, 3] 2016-01-02 03:00:00 | 2 | [0, 9, 2] for each id want resample day(and easy) , concatenate lists of instances happened in same day. resample + concat/sum not work because resample removes non-numeric columns ( see here ) i want write similar this: daily_data = data.groupby('id').resample('1d').concatenate() # .concatenate() not exist result desired: timestamp | id | lists ---------------------------------- 2016-01-01 | 1 | [2, 10, 9, 10, 3, 5, 1, 10, 5] 2016-01-02 | 1 | [2, 6, 7, 2, 6] 2016-01-01 | 2 | [0, 10, 3, 2] 2

iphone - CLLocationManager: didEnterRegion & didExitRegionAlert method did not called -

i using clregion geofencing . monitored clcircularregion set notifyonexit , notifyonentry . here code: cllocationcoordinate2d coordinategym = cllocationcoordinate2dmake(lat,lng); clcircularregion *regionset = [[clcircularregion alloc]initwithcenter:coordinategym radius:radius identifier:strtitle]; if(isexit) { regionset.notifyonexit = yes; regionset.notifyonentry = no; } else { regionset.notifyonexit = no; regionset.notifyonentry = yes; } [self.locationmanager startmonitoringforregion:regionset]; [self.locationmanager startupdatingheading]; before monitor region try removed region motinored before it. monitored region. directly invote monitoringdidfailforregion delegate method error: operation couldn’t completed. (kclerrordomain error 4.) error. , not called delegate method. -(void)locationmanager:(cllocationmanager *)manager didenterregion:(clregion *)region { -(void)locationmanager:(cllocationmanage

javascript - Jquery not functioning properly in Google Apps Script -

i have code: index.html <!doctype html> <html> <div> <form id="email_subscribe"> <input type="email" name="email" id="email" placeholder="enter email"> <input type="submit" value="subscribe"> </form> <span id="thank_you" hidden="true">thank you!</span> </div> <?!= htmlservice.createhtmloutputfromfile('css').getcontent(); ?> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script> $( document ).ready(function() { $( "#email_subscribe" ).submit(function() { google.script.run.withsuccesshandler(function(ret){ $("#email_subscribe").slideup(); $( "#thank_you" ).show("slow"); console.log(ret); }).a

rewardedvideoad - Can Rewards Video Ads Can be integrated in non gaming android app -

what want ask user view 5 video ads , based on point , when required point accumalated able view next activity in , android app,. my abs non gaming app. is allow integrated in non gaming platform. reward videos made give user coin, tokens, points, unlock stage. regarding game. kudos. this not limited game actually. can use in regular app also. developer use deliver digital doc, pdf, ppts. quiz app use unlocking next level/exam/paper. conclusion : can surely use in non game apps. link of documentation .

angular - Angular2 Observable error handling in template -

i approach of new angular observables. prevents writing long chain of .done().fail().always() . in jquery. happening under hood in ng2 using | async pipe . how case when there might exceptional case while loading data myobservable . there way how figure out observable failed in template? // sample.component.ts class simplecomponent{ myobservable:observable<string>; constructor(private _someservice:someservice){ myobservable = _someservice.getsomedatabyhttp(); } } // simple.component.html <div> <div> {{myobservable | async}} </div> <div (anyerrorinobservable)="myobservable"> // kind of construction figure out observable failed load oops, kind of error appeared while fetching myobservable. </div> </div> i know can done using .catch() . hope there kind of better approach. thanks advance there no way handle errors in template. can use operators catch() ensure errors don

sql - What is a pager in mysql more clause? -

i have been studying mysql http://dev.mysql.com/doc/refman/5.7/en/batch-mode.html in page there point: if have query produces lot of output, can run output through pager rather watching scroll off top of screen: shell> mysql < batch-file | more i have batch file bat.sql . if run or without more clause output same: c:\users\redefine webs>mysql -u root < d:\softwear\mysql\install\data\bat.sql name date type remark tommy 2000-01-02 litter 4 kittens, 3 females, 1 male bowser 2001-04-26 vet needed break straightened puffball 2002-05-13 birthday gave him new chew toy c:\users\redefine webs>mysql -u root < d:\softwear\mysql\install\data\bat.sql | more name date type remark tommy 2000-01-02 litter 4 kittens, 3 females, 1 male bowser 2001-04-26 vet needed break straightened puffball 2002-05-13 birthday gave him new chew toy c:\users\redefine webs> what

linux - make command not tabbing to complete file names -

trying use 'make' command in linux compile c programs class. if make works, if type 'make' , start typing file name , tab doesn't autocomplete file me. it's kind of annoying , i'd able use instead of typing gcc -o everytime test program. how can fix this? edit have galliumos - 2.0 (ubuntu 16.04) installed on c720 chromebook (chromeos has been removed , replaced this) shell bash. edit2 adding line complete -f -x '!*' make in ~/.bashrc file works, need making ignore directories or make .c , compiled c programs added autocomplete. it not complete, because parameter following make name of target (for recipe) , not filename. it perhaps completes options expect filename, e.g. make -f mymakefile .

php - Please create web server writable folder config in phpMyAdmin -

Image
i trying phpmyadmin installed on mac el capitan. every time go to: http://localhost:8080/phpmyadmin/setup/ i setup page every time click "save", following error: please create web server writable folder config in phpmyadmin top level directory described in documentation. otherwise able download or display it. i read other threads on stackoverflow, , did following: created manually file in mamp/htdocs/phpmyadmin/config.inc.php opened file , added: $i=0; $i++; $cfg['servers'][$i]['user'] = 'root'; $cfg['servers'][$i]['password'] = 'cbb74bc'; // use here password $cfg['servers'][$i]['auth_type'] = 'config'; ?> (that came guide found on path: http://localhost:8080/phpmyadmin/doc/html/setup.html#setup_script ) this did not solve problem. can see around stackoverflow, solved problem everybody. have clue wrong here? best regards update after answers

java - JavaFx draw Image inside in Pane -

hi want drawing image inside in pane , when bounds heigh want cut image. image consists of tile. 1 tile size 256. full image bigger tham pane. don't know how can cut image. hi want draw 1 large image, consists of tiles. 1 tile has dimensions of 256x256. image in pane. @ time, image dimensions larger dimension pane. not know how draw in pane. help public class testurlimage8 { public static arraylist<busstop2> list = new arraylist<>(); public static arraylist<positiontilesandurlpaths> positiontilesandurlpathslist = new arraylist<>(); public static hashmap<string, image> imgcache = new hashmap<>(); public static double lat; public static double lon; public static double deltay; public static double deltax; public static double positionx; public static double positiony; public static int[] imagecount = getcountimage(); public static int [] countimage = countimage(); public static int []x = new in

javascript - Cannot find elements that are dynamically created by Ajax -

in jsp page, use ajax call insert table body existing table. have jquery function find max value in rows in table , change background color. however, seems jquery cannot find elements dynamically created ajax. ajax call: function getreltable(type) { $.ajax({ type : "post", datatype : "html", cache : false, url : _ctx + "/monitor/get_table.do", data : { "type" : type, }, success : function(content) { //var t_body = $(content); $("#table_body").html(content); findmax(); }, error : function() { ui.msg('信息加载错误', 0); } }); } and content in ajax jsp page: <c:foreach var="noderel" items="${noderelinfo}" varstatus="stc"> <c:choose> <c:when test="${stc.first}"> <tr>

cudnn - Cmake not using user configured lib for linking -

i using cmake (3.5.0) compile c++ probject on ubuntu 14.04, depends on nvidia cudnn. seems cmake not provide correct paths of cudnn linker although have configured paths. file findcudnn.cmake: find_path(cudnn_include_dir name "cudnn.h" paths "$env{cmake_include_path}") find_library(cudnn_libraries name "libcudnn.so" paths "$env{cmake_library_path}") include(findpackagehandlestandardargs) find_package_handle_standard_args(cudnn default_msg cudnn_include_dir cudnn_libraries) mark_as_advanced(cudnn_include_dir cudnn_libraries) cmakelists.txt: find_package(cudnn required) list(append linker_libs ${cudnn_libraries}) ... add_library(myobjects object ${mysources}) add_library(mylib shared $<target_objects:myobjects> ${cuda_objs}) target_link_libraries(mylib ${linker_libs}) cmake_include_path, cmake_library_path exported paths of cudnn5 in home folder. after cmake .. , paths in cmakecache.txt set cudnn5. however, linker (and link.