Posts

Showing posts from May, 2011

odata controller. Correct why to implement get by key -

this question has answer here: exclude odata metadata , type json 1 answer i have adapted pattern pluralsight course. because of ability return correct http codes. public virtual ihttpactionresult get(int key) { iqueryable<t> result = repository.asqueryable().where(p => p.id == key); if (!result.any()) return notfound(); return ok(singleresult.create(result)); } the problem in return format. { "@odata.context":"https://localhost:44300/odata/$metadata#reports/$entity","id":1,"name":"test report#1","description":"min f\u00f8rste rapport","categorytypeid":1,"organizationid":1,"definition":null,"accessmodifier":"local","objectownerid":1,"lastchanged":"2016-08-18t12:57:48.3735722+02:00...

javascript - Get zip file from non-public folder (php) -

i have zip file in non-public folder of web server. want make file not accessible public, looking use php readfile read zip file , create file object zip file in javascript. not sure if best way appreciate suggestion. how use returned data construct file object? here php code (getzipfile.php): <?php $filename = "abc.zip"; $filepath = "/path/to/zip/"; // http headers zip downloads header("pragma: public"); header("expires: 0"); header("cache-control: must-revalidate, post-check=0, pre-check=0"); header("cache-control: public"); header("content-description: file transfer"); header("content-type: application/octet-stream"); header("content-disposition: attachment; filename=\"".$filename."\""); header("content-transfer-encoding: binary"); header("content-length: ".filesize($filepath.$filename)); ob...

android - RenderScript acting weird and returning nothing -

i'm using renderscript , when write kernel, @ first acting ok. when change kernel , rebuild project returns nothing. knows why? return blank photo , nothing else. i have fixed it. problem me targetsdkversion 24 . found out in android 7, there has been lot of changes (new features) renderscript, have changed targetsdkversion 22 , fixed issue. tried simple filter, , after using filter showed me nothing in imageview. when changed targetsdkversion 22 fixed problem , see filtered image in imageview. here code i've used: uchar4 __attribute__((kernel)) filtered(uchar4 in, uint32_t x, uint32_t y) { uchar4 out = in; out.r = 255 - in.r; out.g = 255 - in.g; out.b = 255 - in.b; return out; } if interested can try targetsdkversion 24 , 22. , here code java part: public void imagefilter(bitmap bmp) { doallocation(); operationbitmap = bitmap.createbitmap(bmp.getwidth(), bmp.getheight(), bmp.getconfig()); int height = operationbitmap.getheigh...

reflection - LIbSVM of Weka in C# with IKVM -

i using weka machine learning library in c# ikvm . far worked well, however, having problem using libsvm package. the problem appears when want instantiate libsvm classifier in c# (the class not found), advised: abstractclassifier classifier = (abstractclassifier)java.lang.class.forname("weka.classifiers.functions.libsvm").newinstance(); what tried: add the libsvm.dll , weka.dll project (converted libsvm.jar , weka.jar) merge libsvm.jar , weka.jar 1 dll , add project (using ikvm or ilmerge) note package installed since appears in result of wekapackagemanager.getinstalledpackages(); has every succeeded using weka libsvm in c# using ikvm? thanks, botond i hava same problem ,but found solution website: here . i use weka.jar(version 3.6) , libsvm package weka 3.8 {home}/wekafiles/packages/libsvm step 1. need: weka.jar, libsvm.jar(libsvm/libsvm.jar), libsvm.jar (libsvm/lib/libsvm.jar). step 2. rename libsvm.jar libsvm1.jar. step 3. r...

json - Exporting MobileFirst Analytics data -

i've captured event logs mobilefirst 7.1 client app (hybrid ios) using analytics api: wl.analytics.log({'module': 'account', 'activity': 'update account'}, 'message title'); and retrieve logs analytics console without problem. next retrieve logs using analytics api . below working url format: http://localhost:10080/analytics-service/data/administration/apps/worklight/export?query={"event":"customdata","format":"json","limit":10,"offset":0,"startdate":"2016-08-24","enddate":"*"} which returns following json data: [ { "mfpappname": "myapp", "deviceos": "ios", "appid": "worklight", "mfpappversion": "1.0", "deviceosversion": "7", "devicemodel": "xxx", "deviceid": "xxx...

python - Custom printing in jupyter notebook -

Image
i'm looking alternative mathcad make simple calculations wanted expressions if using pen , paper , make easy read people don't know programming. tried sweave, knitr unhappy it. found jupyter notebook sympy , it's still not easy mathcad me, i'll give try. jupyter i'm having trouble printing formulas: i want print both sides of equation automatically . what want: what get: what tried ccode doesn't return latex , it's boring typing "assign_to" if need more convenient way, can define wrapper function follows. class equation(object): def __init__(self, left, right, mode='latex'): self.mode = mode self.left = left self.right = right self._eq = sym.eq(left, right) self._latex = sym.latex(self._eq) def __repr__(self): if self.mode == 'latex': return self._latex.__repr__() elif self.mode == 'sympy': return ...

database - How to use SQLite.Net to create, insert and draw data in Xamarin.Android? -

i new xamarin , android development. making timetable app , have no idea of how create database using sqlite.net. there possibly documentation of commands can used , thorough description somewhere? because find stuffs related java, ios, , other stuffs. in app, need create, access, insert, modify , draw links between database, unsure of how any. thanks using sqlite.net easy in xamarin android/ios/forms. add nuget package "sqlite-net" intp project. add 2 files, sqlite.cs , sqliteasync.cs in root folder. uses orm hance crud functions can used easily. here few links xamarin understand concepts better. https://developer.xamarin.com/guides/cross-platform/application_fundamentals/data/part_3_using_sqlite_orm/ https://developer.xamarin.com/recipes/android/data/databases/sqlite/ https://developer.xamarin.com/recipes/ios/data/sqlite/ https://developer.xamarin.com/guides/xamarin-forms/working-with/databases/ https://developer.xamarin.com/recipes/ios/data/sql...

visual studio code - Tell the TypeScript compiler where to look for non-relative modules -

i'm using ts-loader , webpack compile .ts files. in webpack config have following configuration: resolve: { modulesdirectories: ['shared', 'node_modules'] } this allows me import component lives in shared directory without spelling out full relative path. example: import button 'components/button' webpack walk directory tree looking shared directory. way, component can live in ../../shared/components/buttton.tsx , webpack find , bundle it. this works fine, getting errors in editors (both sublime , vs code). also, if run tsc command command line compiler errors because ts compiler not know how resolve modules. is there way tell ts compiler recursively component in shared directories? i using ts 2.1v i noticed new baseurl , paths configuration options not able use them successfully. is there way tell ts compiler recursively component in shared directories not recursively. can go 1 level using paths mapping.

ajax4jsf - the difference between a4j ajax listener and action in ajax call. -

please me understand difference between a4j ajax listener , action in ajax call. <a4j:commandbutton id="abc" value="abc"> <a4j:ajax execute="@this" ***listener="#{mybean.update()}"** or action = "#{#{mybean.update()}"*** oncomplete="#{rich:component('mypopup')}.show(); return false;" /> </a4j:commandbutton> i removed <a4j:ajax > tags below. <a4j:commandbutton id="abc" value="abc"> execute="@this" action = "#{mybean.update()" oncomplete="#{rich:component('mypopup')}.show(); return false;" /> </a4j:commandbutton> then work action , <a4j:ajax > tags, action doesn't trigger method in bean while listener triggered.

NOT_NULL query condition on globalSecondaryIndex in dynamodb query -

is possible add constraint dynamodb query expression states gsi should not null? can provide examples. is possible construct query 1 below? new dynamodbqueryexpression<xxx>() .withhashkeyvalues(yyy).withkeyconditionexpression(gsi != null); note: please let me know if possible in during query , not during filter time? the dynamodb string attribute can't have null or empty string. when try insert null, api should throw below exception:- java.lang.illegalargumentexception: input value must not null when try insert empty string, api should throw below exception:- com.amazonaws.amazonserviceexception: 1 or more parameter values invalid: attributevalue may not contain empty string if want add additional filters on attributes (i.e. attributes other hash or range key), can use below syntax (i.e. withfilterexpression). not equals operator "<>" map<string, attributevalue> eav = new hashmap<string, attributevalue...

javascript - jquery multiplication - behind the scene calculation -

Image
i have calculator: this html : <div class="row"> <div class="twenty columns"> <h2 class="secondary-title text-red2">mortgage utilisation calculator</h2> <form> <div class="row forminput"> <div class="ten columns"> <p class="slider-label">daily flexi account balance (rm)</p> <input type="text" class="daily-flexi-accbalance strictly-numbers" value="200000" /> </div> <div class="ten columns"> <p class="slider-label">number of days in month</p> <div class="field type-dropdown"> <div class="picker picker-dd2"> <select class="dropdown2 numdays-...

css3 - CSS animations, slide in on 'block' and out on 'none' -

i'm building using css slide animation have text slide in when text display set "block", wondering how go doing reverse (sliding out) when set "none"? possible slide in , slide out css animations, or have use javascript? hope makes sense! let me know if have questions! jsfiddle of give better idea https://jsfiddle.net/qjwql236/ thanks! and code below: document.getelementbyid("in-button").onclick = function(){ document.getelementbyid("text-container").style.display = "block"; } document.getelementbyid("out-button").onclick = function(){ document.getelementbyid("text-container").style.display = "none"; } #text-container{ height: 30px; width:300px; color: white; background-color: blue; float:left; display:none; position: relative; left: -300px; animation: slide 0.5sforwards; -webkit-animation: slide 0.5s forwards; } @-webkit-keyframes slide...

amazon web services - How to recover AWS ElasticBeanstalk OptionSettings -

i forgot add optionsettings file git , accidentally reset repo. took me while setup run (and able deployed before). does aws save copy of file somewhere? if do, can download it? took me while figure thjs out don't want have redo. yes, should in file called .ebextensions/options.config in zipped application version. if deployed should able find in s3 bucket/path this: s3://elasticbeanstalk-region-account/resources/environments/e-xxxxxxx/_runtime/_versions/app-name/app-name-version

java - How to mock/fake a new enum value with JMockit -

how can add fake enum value using jmockit ? i could't find in documentation. possible? related: this question mockito only, not jmockit. edit: removed examples gave in first place because examples seem distracting. please have @ upvoted answer on linked question see i'm expecting. want know if it's possible same jmockit. i think trying solve wrong problem. instead, fix foo(myenum) method follows: public int foo(myenum value) { switch (value) { case a: return 1; case b: return 2; } return 0; // satisfy compiler } having throw @ end capture imaginary enum element doesn't exist not useful, never reached. if concerned new element getting added enum , foo method not being updated accordingly, there better solutions. 1 of them rely on code inspection java ide (intellij @ least has 1 case: "switch statement on enumerated type misses case") or rule static analysis tool. the best sol...

javascript - Iterate on req.body.objectName to test whether the key-value pairs are valid or not in node js -

the problem statement : "the node js webservice server application should first validate whether req.body.object contains valid key-value pairs, if present go mongodb specific method , crud operation , send response otherwise send response key-value pairs not correct or similar." so, achieving this, tried putting things below 1 @ route: if ((updatevalues.configid == null) || (updatevalues.configname == null) || (updatevalues.description == null) || (updatevalues.version == null) || (updatevalues.classname == null) || (updatevalues.configgroups_info.allevents == null) || (updatevalues.configgroups_info.billingdatecleard == null) || (updatevalues.configgroups_info.billingscheduleexpiration == null) || (updatevalues.configgroups_info.configurationerrordetected == null) || (updatevalues.configgroups_info.dailyselfreadtime == null) || (updatevalues.configgroups_info.datavinehypersproutchange == null) || (updatevalues.configgroups_info.datavinesyncfatherchange == null) || (...

Xcode 7.3 How to Convert my existing iPhone application to universal app, for work with iPad in iOS -

Image
previously, iphone application. want run in ipad well. chose target universal, when run in ipad simulator. remains color of view without labels , textfields. how can make application run both in ipad , iphone? step 1 : first need change size class wany x hany . when open controller controls visible disabled, because change size class , constraints defined not compatible it. step 2 : select controls in controller goto bottom of attribute inspector. see checkbox c x any . uncheck it. step3 : have add new constraint any x any . have changed size class **any x ** check above check box default activate constrains current size class. step 4 : need add missing constraints ever necessary controls.

java - Difference when starting timer inside service and activity -

i want have periodically task should run every 30 seconds. i'm using scheduledthreadpoolexecutor or timer scheduledthreadpoolexecutor executor = new scheduledthreadpoolexecutor(1); executor.schedulewithfixeddelay(new mytask(), 0, 30000, timeunit.milliseconds); class mytask implements runnable { @override public void run() { } } here timer timer timer = new timer(); timer.schedule(new timertask() { @override public void run() { // here } }, 0, 30000); my question is: there differences if start above code inside service/intentservice or inside 1 activity. actions same or start inside service better. if want run task when app in backgroud should use service or if want run in when app in front may use in activity

solr5 - Solr Boosting specific field values -

i'm trying boost score documents returned search in solr. the boost want achieve along lines of: field1:(value1)^5 or field2:(value2)^2 if document have field1 matching value1, boost 5. if document have field2 matching value2, boost 2. the documents have many fields, let's call them field1, field2... , may missing fields. the documents not need have field1 or field2 matching value1, value2 respectively. i have other filter queries such as: fq: field1:[* *] <- checking presence of fq: field3: ("something" "somethingelse") fq: field4: 1 i grouping results field not being used in of queries. raw query parameters: group=true&group.facet=true&group.field=anindependentfield i using same fq's tried different query parsers. there enough documents in solr field1:value1 and/or field2:value2 other values fields. so far i've tried using query parsers: standard query parser method a) q: field1:(value1)^5 or ...

mod rewrite - Alter GET variable in Wordpress -

i working on wordpress self-hosted website, standard .htaccess settings: in website, have page called "animalpage". using rewrite settings, shown in address bar http://www.example.com/animalpage . i using custom page template , processing things, include use of variables. instance: if (isset($_get=['word'])) { echo $_get['word]; } so, http://www.example.com/animalpage?word=cat display "cat". the problem have rewriting url can like: http://www.example.com/animalpage/dog , still being able access "dog" variable. i not mod_rewrite rules begin with, working within wordpress installation throwing me curveball. does know need add .htaccess achieve this? thank you! old version: rewriterule ^animalpage/([a-z0-9]+)/?$ animalpage?word=$1 [nc,qsa] revisited: rewriterule ^animalpage/([^/])/?$ animalpage?word=$1 [nc,l,qsa]

python - AUC calculation in decision tree in scikit-learn -

using scikit-learn python 2.7 on windows, wrong code calculate auc? thanks. from sklearn.datasets import load_iris sklearn.cross_validation import cross_val_score sklearn.tree import decisiontreeclassifier clf = decisiontreeclassifier(random_state=0) iris = load_iris() #print cross_val_score(clf, iris.data, iris.target, cv=10, scoring="precision") #print cross_val_score(clf, iris.data, iris.target, cv=10, scoring="recall") print cross_val_score(clf, iris.data, iris.target, cv=10, scoring="roc_auc") traceback (most recent call last): file "c:/users/foo/pycharmprojects/codeexercise/decisiontree.py", line 8, in <module> print cross_val_score(clf, iris.data, iris.target, cv=10, scoring="roc_auc") file "c:\python27\lib\site-packages\sklearn\cross_validation.py", line 1433, in cross_val_score train, test in cv) file "c:\python27\lib\site-packages\sklearn\externals\joblib\parallel.py", line 800, i...

HTML button not working after adding css to a h3 -

i wanted h3 aligned buttons made position absolute , couple other things. if want view problem can go here . don't know else use describe problem. oh , show once upon time season 5. appreciated greatly. try these changes in html code <form method="get"> <h3 class="watching_what"> <button class="change" style="float:left;" type="submit" name="episode_num" value="0">previous</button> watching episode 1 <button class="change" style="float:right;" type="submit" name="episode_num" value="2">next</button> </h3> </form> and in css code remove transform property .watching_what { text-align: center; color: 003099; position: absolute; /* position: element(#target); */ /* transform: translatey(-100%); */ left: 0px; right: 0px; padding-top: 18pt; padding-bottom:...

mysql - Change varchar m/d/yy to yyyy-mm-dd -

i have varchar(9) column data in form m/d/yy. want convert yyyy-mm-dd. can select values , view changes using query, select str_to_date(date_new,'%m/%d/%y') date july my problem how update values in column. tried using query, messes dates. update july set date_new = str_to_date(date_new, '%d-%m-%y' ); any gladly accepted! thank in advance. :) you close. can use date_format() convert desired string representation. update july set date_new = date_format(str_to_date(date_new,'%m/%d/%y'), '%y-%m-%d'); note: you'd need change column varchar(9) varchar(10) fit reformatted values. alter table july modify date_new varchar(10); here sqlfiddle .

php - Having trouble with inserting query after program checks username availability using ajax -

Image
i'm having trouble inserting query database after program checks username availability on blur using ajax check if username available register or not. after checks username availability, insert empty queries in database. here sample output more details: but problem when displays username available automatically inserts empty query database. this insert database after checks availability of user: i want insert query inserted when user submits or when he/she clicks register button. availability of username checking only. there problem code? here code: sample.php file <!doctype html> <html> <head> <title>sample</title> <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> </head> <body> <input type=...

java - I am Getting Maven compiler error while i am running Maven Project -

Image
could please give me suggestion how can solve issue? maven version : 4.0.0 maven-compiler-plugin:3.5.1 add selenium dependencies in pom.xml <dependency> <groupid>org.seleniumhq.selenium</groupid> <artifactid>selenium-support</artifactid> <version>2.53.0</version> </dependency>

php - Call to undefined method GuzzleHttp\Psr7\Response::isSuccessful() -

so have installed guzzle library version 6 according teamup calendar documentation . however, when try run code below fatal error: call undefined method guzzlehttp\psr7\response::issuccessful() code: <?php include 'vendor/autoload.php'; define('api_key','****ww9d5ea2b0540ba1e02c08100b0e5**'); $client = new guzzlehttp\client(['headers' => ['teamup-token' => api_key]]); $res = $client->get('https://api.teamup.com/ks************/events?startdate=2016-08-21&enddate=2016-08-25'); if ($res->issuccessful()) { echo $res->getbody(); // {"event":{ ... }} } shouldn't contained in library? anyone? yes, there no method issuccessful . default guzzle throw exception if server return error http://docs.guzzlephp.org/en/latest/quickstart.html a guzzlehttp\exception\serverexception thrown 500 level errors if http_errors request option set true. a guzzlehttp\exception\client...

indexing - Lucene search with dashes does not return consistent results -

hi have problem lucene search not return consistent results. indexing done standardanalyzer , lucene version 3.0 an example entry in database a1bc-1-12345678 - au-01 / 123456 - no.1 abc defg xx-yyy example data if search whole string, not return results. if take out single dashes , slashes, search a1bc-1-12345678 au-01 123456 no.1 abc defg xx-yyy example data it not return results. if replace dash between xx-yyy whitespace, search for a1bc-1-12345678 au-01 123456 no.1 abc defg xx yyy example data --------it returns result!---------------------- now if include dashes , slash, , replace dash between xx-yyy whitespace, search for a1bc-1-12345678 - au-01 / 123456 - no.1 abc defg xx yyy example data it not return results. finally if replace dash between both au-01 , xx-yyy whitespace, search for a1bc-1-12345678 au 01 123456 no.1 abc defg xx yyy example data it not return results. in conclusion, "xx-yyy" not valid "au-01" valid, ...

ruby - cannot create the rspec files on windows 'rails app" -

Image
i'm running on windows 7 , cannot install/create rspec files , capybara needed work on assignment . if finish simple setup steps listed below , give me link empty app repository download finish assignment , gratefull . by way , 'm getting following errors in step 4 if . have asked before no 1 have answered ;( steps needed : create new rails application called todolists add following specification gemfile group :test do gem 'rspec-rails', '~> 3.0' gem 'capybara' end run bundle command resolve new gems from todolists application root directory, initialize rspec tests using rails generate rspec:install command [todolists]$ rails generate rspec:install create .rspec create spec create spec/spec_helper.rb create spec/rails_helper.rb add following line .rspec add verbose output test results. --format documentation download , extract starter set of bootstrap files. 1 |-- gemfile |-- db | ‘-- seed.rb ‘-- s...

javascript - why does it fail saying that d3 is not defined when served as string in webbrowser -

i trying launch wpf webbrowser string. have java script file referenced in head section points file on drive. looks me still fails. ideas? string served webbrowser: <!doctype html> <meta charset="utf - 8"> <head> <script src="file:///c:/users/ksobon/appdata/roaming/dynamo/dynamo%20revit/1.0/packages/extra/d3/d3.v3.min.js"></script> <link rel="stylesheet" href="file:///c:/users/ksobon/appdata/roaming/dynamo/dynamo%20revit/1.0/packages/extra/bootstrap/css/bootstrap.min.css"> <style> body { font: 10px arial; } .axis path { fill: none; stroke: grey; shape-rendering: crispedges; } .axis text { font-family: arial; font-size: 10px; } .axis line { fill: none; stroke: grey; stroke-width: 1; shape-rendering: crispedges; } </style> </head> <div class="row"> <div class="col-md-12" id="linelinechart1" align="center"> <script> function ...

ajax - How to redirect with expressjs for a specific status? -

i'm doing blog-app currently, , i'm struggling find way redirect/send specific status , act accordingly. for example, have function saves data in mongodb using mongoose. if no errors occurred 200 status. newarticle.save(function(err){ if (err) throw err; else { res.sendstatus(200); } }); i want able "fetch" status (i'm using react views , routes , superagent ajax request), , something, example, if article added load component on page have h1 saying : great job on posting article. so first part. the second part is, 404 or 500 errors want express redirect me example : myblog.com -> myblog.com/something , react router render basic 404 pages, not know how that, i'm searching lot , couldn't find something... and, since lack knowledge in http basics how server , client talk each other, if have article/books recommend i'd know about. for first part. depending on if using state or data library flux or redux, if not, can ha...

php - CSS block-quote empty lines -

css block quote don't add empty lines qoute example : <blockquote> number 1 number 2 </blockquote> this appear following "" > "" don't appear , empty line appear > number 1 > > number 2 i want them empty line included on blockquote . a > reserved character in html. it's used building tags. you need escape it, or browser think it's code , not display it. use &lt; < , , &gt; > . <blockquote> number 1<br> &gt;<br><!-- "greater than" symbol --> number 2<br> </blockquote> <hr> <blockquote> number 1<br> <br><!-- empty line --> number 2<br> </blockquote> from spec: 5.3.2 character entity references four character entity references deserve special mention since used escape special characters: &lt; represents < sign. &gt; repres...

python - Save line in file to list -

file = input('name: ') open(file) infile: line in infile: name in infile: name print(name[line]) so if user pass file of vertical list of sentences, how save each sentence own list? sample input: 'hi' 'hello' 'cat' 'dog' output: ['hi'] ['hello'] , on... >>> [line.split() line in open('file.txt')] [['hi'], ['hello'], ['cat'], ['dog']] or, if want more careful making sure file closed: >>> open('file.txt') f: ... [line.split() line in f] ... [['hi'], ['hello'], ['cat'], ['dog']]

c++ - Same STL files with different compilers -

there 2 binary files obtained same source file: 1 compiled clang++-3.6 , other 1 g++-4.8. in call function stl (std::unique, in particular) gdb brings me same file: /usr/include/c++/4.8/bits/stl_algo.h. i expected implementations different each compiler though. clang , gcc share parts of c++ implementations? i expected implementations different each compiler though. clang , gcc share parts of c++ implementations? it's not share same c++ implementations, rather both compilers link same standard c++ library default on system. i presume on linux, programs installed package manager link against libstdc++ (provided g++). by default, when compiling clang++, libstdc++ used, when include iostream example, uses 1 /usr/include/c++/4.8. if want link against llvm c++ library, need install "libc++-dev" package (name may vary depending on distro) , compile using: -stdlib=libc++ (instead of default: -stdlib=libstdc++). example: test.cpp: #include ...

javascript - Angular 2 RC5 and above - How to show an error page when no route matches? -

my current route config looks this { path: '', redirectto: 'register/account', pathmatch: 'full' }, { path: 'register/account', component: accountregistercomponent }, { path: 'register/auto/:id', component:autoregistercomponent }, if user tries navigate '/register/auto'. see blank page , error in console. how can show 404 error or message saying page not available globally? see angular2 cheatsheet can this: {path: '**', redirectto: '/404' } so example have this: {path: '/404', component: notfoundcomponent}, {path: '**', redirectto: '/404' } hope helps

postgresql - Remove a series in Graphite when using postgres for storage? -

just installed graphite using postgres storage , sending data graphite using statsd. works fine! my issue created bunch of series (mostly gauges) testing , want them gone see no way delete them. have no whisper files delete since using postgres. in looking @ tables in postgres graphite database see nothing contains series. see custom graphs , user in graphite database can find testing series blow away. any pointers? series not kept in postgres db? graphite uses postgresql/mysql/sqlite storing user profiles, saved graphs & dashboards, , events (annotation-style data). time-series metrics stored in native whisper files. in cases these files exist under /opt/graphite/storage/whisper/ . say sent metric accident named foo.bar.baz . file exist @ /opt/graphite/storage/whisper/foo/bar/baz.wsp , can deleted command-line sudo rm /opt/graphite/storage/whisper/foo/bar/baz.wsp .

excel vba - Worksheet_Change(ByVal Target As Range), Target always equals Nothing -

Image
thanks in advance! using worksheet_change(byval target range) event not workbook_sheetchange(byval sh object, byval target range) event. after testing realized event fires argument target set nothing . code , picture fallows. private pnet range private pproposedvalue range 'event handlers '-------------- private sub worksheet_change(byval target range) if pproposedvalue nothing elseif pnet nothing elseif target pnet pproposedvalue.value2 = target.value2 me.calculate end if end sub is doesn't work checking if 1 range variable refers same range range variable. target pnet false if refer same range.

r - Interaction term failing lmerTest with In pf(F.stat, qr(Lc)$rank, nu.F) : NaNs produced -

i trying carry out lmertest on 2 separate datasets, , reason getting following error 1 of datasets. in pf(f.stat, qr(lc)$rank, nu.f) : nans produced this dataset gives me p-value of interaction term between habitat , soil without issue. anova(lmer(sqrt(abs) ~ habitat*soil + (1|species), data=frl_light, reml=t)) analysis of variance table of type iii satterthwaite approximation degrees of freedom sum sq mean sq numdf dendf f.value pr(>f) habitat 0.057617 0.028809 2 8.8434 1.0880 0.37805 soil 0.232708 0.232708 1 2.6732 8.7888 0.06848 . habitat:soil 0.308003 0.154001 2 2.7134 5.8163 0.10443 --- signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 this dataset has similar structure throws error, , fails give p-value interaction between habitat , light . density degree of freedom measurement 0, problem. anova(lmer(sqrt(abs) ~ habitat*light + (1|species), data=frl_soil, reml=t)) analysi...

google apps script - simple macro at spreadsheet not running native function -

in script.google.com/macros/d/1rrm3wod.... page have function wd_hyperlink(x) { return hyperlink("https://www.wikidata.org/wiki/"+x,x) } so, when use in originator (a https://docs.google.com/spreadsheets/d/1hwih... spreadsheet page), calling =wd_hyperlink('q131303') in cell, runs not recognize native function hyperlink() . line 2, hyperlink not defined. hyperlink formula. can't use did. have set formula cell. var myfunction = '=hyperlink("https://www.wikidata.org/wiki/&'+x+'", '+x+')'; spreadsheetapp.getactivespreadsheet() .getsheetbyname("sheetname") .getrange("a1")//cell .setformula(myfunction); but from documentation : custom functions (wd_hyperlink(x)) return values, cannot set values outside cells in. it doesn't work this.. function wd_hyperlink(x) { var myfunction= '=hyperlink("https://www.wikidata.org/wiki/&'+x+'", ...

php - Strange behavior Of foreach -

<?php $a = array('a', 'b', 'c', 'd'); foreach ($a &$v) { } foreach ($a $v) { } print_r($a); ?> i think it's normal program output getting: array ( [0] => [1] => b [2] => c [3] => c ) can please explain me? this well-documented php behaviour see warning on foreach page of php.net warning reference of $value , last array element remain after foreach loop. recommended destroy unset(). $a = array('a', 'b', 'c', 'd'); foreach ($a &$v) { } unset($v); foreach ($a $v) { } print_r($a); edit attempt @ step-by-step guide happening here $a = array('a', 'b', 'c', 'd'); foreach ($a &$v) { } // 1st iteration $v reference $a[0] ('a') foreach ($a &$v) { } // 2nd iteration $v reference $a[1] ('b') foreach ($a &$v) { } // 3rd iteration $v reference $a[2] ('c') foreach ($...

sql - How to select a specific line in a row with carriage returns -

Image
using sql server 2012 i'm running following basic query select macroid ,macrotext ,auditeventid ,audittypecode ,audittimestamp apxfirm.dbo.advmacro however it's come attention every result row has numerous carriage returns embeded, , need specific row within rows. below how result set looks in sql. however when pasting in notepad it'll this. [version] 3.5.1.212 [description] taxlot information populating holdings table [portfolios] @master [mode] management [autoprint] no [graph] no [sheet] no [attended] no [apply copies] no [page number by] report [number 1 page reports] no [consolidate composites] both [frames] yes [output file] txlotext [error file] txlotext [report] txlotext.rep report txlotext.rep $prifile 123103 $_outfile txlotext.xml gauge 2 1 prop mb frame g1 2 c y y y "report txlotext.rep" y - y y 0 0 100 100 000000 ffffff 0 1 "" ffffff 000000 360 0 0 6a240a n frame g0 2 r n n y "report txlotext.r...

Android Auto: My App doesn't play audio -

i'm implementing android auto support app, not working properly. i've followed google's documentation , tutorials, audio not working. controls, album art, artist name, etc., appear fine. strange behaviour: after running spotify app through auto emulator , playing song, if go app , try play audio, works! here's service class i've implemented: /** * created feliperrm on 8/13/2016. */ @targetapi(build.version_codes.lollipop) public class automediabrowserservice extends mediabrowserservicecompat { private static final string current_media_position = "media_position_key"; private static final int play = 1; private static final int pause = 2; private static final int buffering = 3; private static final int connecting = 4; private static final int stopped = 5; mediaplayer mediaplayer; private static final string my_media_root_id = "meuiddaraiz"; mediasessioncompat msession; @override public void...