Posts

Showing posts from April, 2014

javascript - can add ChartRangeFilter to a Bubble Chart? -

i know if can use chartrangefilter type of chart. since data according search continue grow horizontally. , yes, have use bubbles. or else can horizontal scroll vertical axis not move. i not know else put in post: / ask me continue ingrensando more description google.load("visualization", "1", { packages: ["corechart"] }); google.setonloadcallback(drawchart); function drawchart() { var alarmas = new array(); alarmas[1] = 'prop1_bid'; alarmas[2] = 'prop1_ask'; alarmas[3] = 'prop2_bid'; alarmas[4] = 'prop2_ask'; alarmas[5] = 'prov1_ask_05'; alarmas[6] = 'prov1_ask_10'; alarmas[7] = 'prov1_ask_20'; alarmas[8] = 'prov1_ask_60'; alarmas[9] = 'prov1_ask_x'; alarmas[10] = 'prov1_bid_05'; alarmas[11] = 'prov1_bid_10'; alarmas[12] = 'prov1_bid_20'; alarmas[13] = 'prov1_bid_60'; alarmas[14] = '

c# - Resize window without showing window contents -

in windows have setting "show window contents while dragging". when off instead resizing outline of window. my wpf application has many controls on it, extremely slow resize. there way make application resize showing window outline instead of updating contents? i found question regarding winforms unfortunately i'm not able adapt wpf. can hook onto hwndsource , message numbers may have changed in windows 10, if statement in answer never entered... or there may other things @ work. also, inside if calls wndproc base after has changed system parameter, resetting system parameter when has finished calling it. calling method not option in wpf window object not have way forward message. public void onviewloaded() { hwndsource source = hwndsource.fromhwnd( new windowinterophelper(this).handle); source?.addhook(wndproc); } private static intptr wndproc(intptr hwnd, int msg, intptr wparam, intptr lparam, ref bool hand

Gitlab-runner status showing not-compatible" reason="GitLab Runner >= 9.0 -

please let me know gitlab-runner version should use make compatible gitlab gitlab version 8.4.2 gitlab-runner version: 9.3.0 git revision: 3df822b git branch: 9-3-stable go version: go1.7.5 built: thu, 22 jun 2017 10:57:22 +0000 os/arch: linux/amd64 error: jul 27 20:13:02 ip-**-**-**-** gitlab-runner[20539]: time="2017-07-27t20:13:02z" level=error msg="checking gitlab compatibility... not-compatible" reason="gitlab runner >= 9.0 can used gitlab ce/ee >= 9.0" result=404 runner="#%%_67" statustext="404 not found" <nil> as stated in release note of gitlab 9 runners above version 9 use new v4 api , requires @ least gitlab 9.0 . so runner version below 9 should it. tip: keep version of gitlab instance above runners avoid problem. to downgrade runner: uninstall it; download desired package repo ; install package.

r - include an 'outside' matrix when using an apply function on a 'target' matrix -

friends! i'd take each row of matrix , apply function it. part fine - r code looks this: apply(rategroup, 1, function(x) do.call(groupcoord(x), as.list(x))) and each row of 'rategroup' goes function 'groupcoord' ...but if want function 'groupcoord' use matrix outside of function, 1 same each row of 'rategroup')? ...or, bonus question: if wanted matrix outside of function updated 1 progresses through rows of 'rategroup'? sorry don't have examples here, because cannot work...but do* have code below running first row of 'rategroup' through function, involves 'outside' matrix called 'overlap' thank insights! == candidates <- 19 raters <- 12 groupsize <- 4 overlap<-matrix(0,nrow = raters, ncol = raters) ratenum<-1:raters groupcoord <- function(a,lap) { x1 <- a[1] x2 <- a[2] x3 <- a[3] x4 <- a[4] lap[x2,x1] <- lap[x2,x1] + 1 lap[x3,x1] <- lap[x3,x1] +

javascript - Why am I getting a 404? -

i trying link google maps html page. returning 127.0.0.1 - - [27/jul/2017 22:24:05] "get /luca.html http/1.1" 404 - any ideas why? new google.maps.event.addlistener(marker12, "click", function () { window.open('t3xm.html'); }); } my html path http:// 127.0.0.1:5000/ t3xm.html layout of project files my bet referencing wrong path. window.open('t3xm.html') file in document root of server. probably it's set /static . solve might want create route serve file you. ps. need give more information problem. using library? server use etc...

Why "docker stack ps" is throwing an exception? -

i'm barely starting on docker , following docker docs . followed until step docker stack ps throwing me exception(that's think) command needs 1 argument. don't understand should pass in there. tried --help giving me not useful info. it expects name of application argument. docker stack ps <application name> how did start stack?

material design - How to set min and max number of tags on Materialize CSS tag input -

are there options (for instance) can added material_chip make possible? (the official docs doesn't specify whether or how accomplish this). if not, work around can use achieve this? you can use chip.add , chip.delete events disable possibility of adding new tag , enable again when user removes tag. example: $('.chips').on('chip.add', function(e, chip){ // check current number of tags/chips - disable if need }); $('.chips').on('chip.delete', function(e, chip){ // enable again });

r - Multiple tidying operations in one pipeline -

this more of code-cleaning exercise i'm doing right now. initial data looks this: year county town ... funding received ... (90+ variables total) 2016 x yes 2015 y no 2014 x yes 2016 b z yes i couldn't see how count of submitted , approved applications transformed indicator variables counted following code: counties <- original_data %>% select(county, funded, year) %>% mutate( a=ifelse(county == "a", 1,0), b=ifelse(county == "b", 1,0), c=ifelse(county == "c", 1,0), ... etc ... ) and output looks like county funding received year binary.a binary.b yes 2016 1 0 no 2015 1 0 b no 2016 0 1 this data transformed 2 dataframes (submitted , funded) count of each county

ios - When I try to build Xcode project from Jenkins, I am getting the error "String index out of range 15" -

Image
i installed jenkins , added required keychains , provisioning profile using "keychains , provisioning profiles" plugin following document https://wiki.jenkins.io/display/jenkins/keychains+and+provisioning+profiles+plugin error when try build job. also when build project xcode works fine. fatal: string index out of range: 15 java.lang.stringindexoutofboundsexception: string index out of range: 15 @ java.lang.string.substring(string.java:1963) @ com.sic.plugins.kpp.provider.kppbaseprovisioningprofilesprovider.removeuuidfromfilename(kppbaseprovisioningprofilesprovider.java:171) @ com.sic.plugins.kpp.model.kppprovisioningprofile.getprovisioningprofilefilepath(kppprovisioningprofile.java:76) @ com.sic.plugins.kpp.kppprovisioningprofilesbuildwrapper.copyprovisioningprofiles(kppprovisioningprofilesbuildwrapper.java:157) @ com.sic.plugins.kpp.kppprovisioningprofilesbuildwrapper.setup(kppprovisioningprofilesbuildwrapper.java:99) @ hudson.model.build$buildexecution.dorun(build

python - djstripe customers not deleted -

Image
i have test website using stripe , djstripe 0.8.0 subscription payments. i had test data set test payments system working. i deleted stripe test data. however, when open django admin console , navigate djstripe > customers, have following records displayed, no users/customers attached them: there no records in corresponding database table. have deleted customers stripe , database itself. still cannot rid of these records. if try access records or delete records admin console, receive following error message: attributeerror: 'nonetype' object has no attribute 'email' file "c:\users\me\desktop\myappname\env3\lib\site-packages\djstripe\settings.py", line 94, in get_subscriber_model_check_subscriber_for_email_address(subscriber_model, "the customer user model must have email attribute.") file "c:\users\me\desktop\myappname\env3\lib\site-packages\djstripe\settings.py", line 70, in _check_subscriber_for_email_address

ios - Could not cast value of type 'SwiftyJSON.JSON' to 'Swift.String' -

i have been trying display data parsed json uitableview . used swiftyjson parse data , pass array controller. i used nsarray force json array. when print passed data, shows following: ( "string one", "string two" ) then inside the func collectionview(_ collectionview: uicollectionview, cellforitemat indexpath: indexpath) -> uicollectionviewcell function, used let urls: string = sshostring[indexpath.item] as! string when print array inside function cellforitemat without forcing type string, prints following: string 1 string 2 but when force type string crashes , shows following: could not cast value of type 'swiftyjson.json' 'swift.string'. how make work? how force string? as requested: var featuredscreenshots:nsarray = nsarray() var featuredssho = nsmutablearray() items in json["featured"].arrayvalue { featuredssho.add(items["screenshots"].arrayvalue) } self.featuredscreenshots =

javascript - Laravel 5.4 Served in subdirectory Nginx. 404 when including js files -

my problem serving css , js files using laravel 5.4 on nginx server (ubuntu). have configured server serve application nested sub-directory (not in root of web server). routing working. see: https://zwestwind.com/sandboxes/zypth/blog/tasks https://zwestwind.com/sandboxes/zypth/blog/posts and ..blog/ well. the problem cannot include js files (and css). js file in "blog/public/js/posts.js". attached below site configuration, , code include js file in blade template. can view error in console when hit site. server configuration: server { return 404; } server { listen 80; listen [::]:80 ipv6only=on; listen 443 ssl; root /var/www/zwestwind.com/html; index index.php index.html index.htm; # make site accessible http://localhost/ #server_name example.com www.example.com; server_name zwestwind.com www.zwestwind.com; ssl on; ssl_certificate /etc/nginx/ssl/pub_clf_origin.pem; ssl_certificate_key /etc/nginx/ssl/priv_c

spring boot - what is the difference between netflix zuul server and netflix eureka server? -

i have created 2 java spring-boot micro services 1) producer 2) consumer , have used spring eureka server service registration , discovery . worked fine . use of netflix zuul. typically backend services perform server side business operations (i.e. core) not exposed publicly due many reasons. shielded gateway layer serves reverse-proxy. netflix zuul serves gateway layer gives capabilities mentioned @apollo , here

git - python- dulwich only working in interpreter, but not as a script -

i trying use dulwich access git repositories. have followed documentation , installed required, , tried running simple script: >>> dulwich.repo import repo >>> r = repo(<path/to/my/repo>) >>> r.head() >>> c = r[r.head()] >>> c >>> c.message when type line line in python interpreter, works fine, , intended results. however, when create script same commands, , try running terminal using python script-name.py , no results @ all. and finally, when run same script in pycharm, error says modulenotfounderror: no module named 'dulwich.repo'; 'dulwich' not package . any idea happening here, because can't find helpful?

python - How would I code a hangman game with multiple outcomes possible? -

i trying code hangman game prints different words when player gets word amount of lives left, can't figure out how that. have else put in place expect concept. have tried elif statements, don't know else try except this: lives_remaining = 14 guessed_letters = '' def play(): word = pick_a_word() while true: guess = get_guess(word) if first_try(guess, word): print('excellent!') break elif second_try(guess, word): print('great!') break elif third_try(guess, word): print('ok!') break elif fourth_try(guess, word): print('close one!') break elif lives_remaining == 0: print('nope!') print('the word was: ' + (word)) break def first_try(guess, word): if lives_remaining > 12: def second_try(guess, word): if lives_remaining >

angularjs - Equivalent Single Html file with export options like Datatables -

i created single html - table - export options, search, pagination using static data using datatables. plnkr.co/edit/n3cbx8grgojtopgbxe32?p=preview is similar kind of example or working html available in angular-ui-grid datatable doesn't works huge records. please kindly equivalent html file using angular ui grid..thanks in advance anything thanks. from looks like, able export csv , pdf. don't see evidence of excel export working. not sure offhand on print function, however, exporting pdf , printing option. can later if it's deal breaker. the js code pretty straight forward. i've added options pdf configuration well. the code exporting function comes verbatim ui-grid.info: 312 exporting data custom ui . converted buttons if wanted, provides external export functionality. little menu in upper right corner has these export options, i've left experimentation. setting $scope.gridoptions.enablegridmenu false turn off. js $scope.gridoptions

postgresql - rails error: relation already exists -

i'm trying move rails app docker container production , i'm last step of loading production dump container. i've done backup of current production database pg_dump pdfcat_production > ~/pdfcat-20170728.dump i've loaded once before , worked, it's second time failing; docker-compose run -e 'rails_env=production' app rake db:drop docker-compose run -e 'rails_env=production' app rake db:create cat ~/pdfcat-20170727.dump | docker exec -i 79766cf70617 psql -upostgres i error; error: relation "categories" exists error: role "pdfcat" not exist error: relation "categories_id_seq" exists error: role "pdfcat" not exist alter sequence error: relation "clients" exists error: role "pdfcat" not exist error: relation "clients_id_seq" exists error: role "pdfcat" not exist after finishes these errors cannot load web app. the loading of second time giv

d3.js - How to get D3 Multiple Y-Axes Ticks to Line Up? -

Image
i'm trying show multiple y-axes on time series multiple lines. you'll see in screenshot on right there y-axis tick labels shown each of 4 color-coded lines. i want show 6 ticks/labels. depression, sleep disturbance, daily health perfect! showing 6 labels. want "steps" show on exact same marks. in case, need 0, 12000, 26000, 39000, 52000, , 65000. roughly. idea. cannot figure out how of y-axes show in count of 6 ticks line nice. note: there many time series display, , depending on user's data, y-domains may different (one person may have 60,000 steps, user 5,000). information determined programmatically , dynamically, can't hard code things. any on do? you should use .tickvalues() , set axis' values explicitly. based on person's data, create array of 6 values [0, (max * 1/5), (max * 2/5), ..., (max * 5/5)], , use argument tickvalues

c# - Getting primary key from the database -

i created method traverses data returned primary key in repeat structure following error occurs, can not implicitly convert type "system.attribute" "bool" using system; using system.collections.generic; using system.componentmodel; using system.data.sqlclient; using system.linq; using system.reflection; using system.web; update private void setself(cliente entity) { foreach (propertyinfo pro in entity.gettype().getproperties()) { if (this.gettype().getproperty(pro.name).getcustomattribute(typeof(dataobjectfieldattribute != null)) this.gettype().getproperty(pro.name).setvalue(this, pro.getvalue(entity)); } } because line: this.gettype().getproperty(pro.name).getcustomattribute(typeof(dataobjectfieldattribute) return system.attribute , if looking bool . don't want add check ? if (this.gettype().getproperty(pro.name).getcustomattribute(typeof(dataobjectfieldattr

react native ios - How do I call the launchOptions for iOS in reactnative -

i have push notification, , want content of push notification when click push notification run application. should do? the didfinishlaunchingwithoptions method called automatically while pressing notification banner opens application (if not opened). see this more. what think need bridge between rn code , ios native code (objc or swift) on notification press action. article might

asp.net mvc - Get dynamic table name in MVC with Entity Framework -

i know there lot of solutions such query i'm not able implement of them. i'm passing table name function , want ef table result respective table value passed. so function (a jsonresult ) in controller:- public jsonresult fetchtbldata() { string mytablename= request.form["tblname"].tostring(); using (ebcontext db = new ebcontext()) { try { var edutbllist = db.(**mytablename**).tolist(); // want implement here. } catch (exception ex) { string innermessage = (ex.innerexception != null) ? ex.innerexception.message : ""; } return new jsonresult { data = edutbllist, jsonrequestbehavior = jsonrequestbehavior.allowget }; } } how can without code modification , simplest approach using ef or linq? please help try below code: public jsonresult fetchtbldata() { string mytablename= request.form["tblname"].tostring();

java - how can I get coordinate from graphics2d.rotate -

i have trouble. want see drawed rectangle'coordinates when use g.drawimage(...) g.rotate(math.toradians(angle), org_centerx, org_centery); g.drawimage(marskingimg, left, top, width, height, null); imageio.write(org_bi, "jpg", org.getabsolutefile()); do have idea?

my wordpress site redirect me to database installation -

i hope find here me i have big problem , after moved site 1 host , uploaded database and changed configration file did not work , redirect me database installation this site https://www.eldwa.com define('db_name', 'eldwa_wp3'); /** mysql database username */ define('db_user', 'eldwa_wp3'); /** mysql database password */ define('db_password', 'j.xvjcyxlu]hhb6(hr.49@^0'); /** mysql hostname */ define('db_host', 'localhost'); /** database charset use in creating database tables. */ define('db_charset', 'utf8'); /** database collate type. don't change if in doubt. */ define('db_collate', ''); thank be sure host name right : /** mysql hostname */ define('db_host', 'localhost'); and check location of wp-config.php file located in document root directory.

asp.net mvc - An MVC 6 route does not perform as expected -

i have route: routes.maproute(name: "trads", url: "test_3000/{action}/{traditional}", defaults: new { controller = "test_3000", action = "subset", traditional = urlparameter.optional }); and test_3000controller method: // get: test_3000/subset?traditional=(chinese character) public actionresult subset(string traditional) { if (traditional == null) { return new httpstatuscoderesult(httpstatuscode.badrequest); } test_3000 test_3000 = db.test_3000.find(traditional); if (test_3000 == null) { return httpnotfound(); } return view(test_3000); } this url works: server/test_3000/subset?traditional=的 this url not work: server/test_3000/subset/的 in latter case, 'traditional' null. "traditional" column in sql table. have tried this routes.maproute(name: "trads", url: "test_3000/{action}/{traditional?}", defaults:

mysql - Get data Mochiweb -

i see tutorial mochiweb here but use json , mnesia , show data want know there way data , make variable index.html data render .dtl file using mysql "hello" -> {selected,_col,results} = odbc:sql_query(conn, "select * test_table"), querystringdata = req:parse_qs(), key =proplists:get_value("username", querystringdata,"anonymous"), fname=proplists:get_value("value1", querystringdata,"anonymous"), lname=proplists:get_value("value2", querystringdata,"anonymous"), test=re:run([key], "^[0-9]*$"), if key == "anonymous"-> io:format("wrong"); true-> % io:format("true"), sendlist=[{x,y,z} || {x,y,z}<-results, x=:=list_to_integer(key)],

bash - Go back on line with left arrow when using read? -

i'm reading stdin read var . when type something, can't go in line pressing left arrow on keyboard. test[[d^[[d^[[d (three presses left arrow). how can solved? seems question asked before, didn't results on suggestions , google-fu failed me. the ability use arrow keys move cursor around within text you've entered provided the readline library . bash's read command doesn't use readline default, can tell providing -e option. add option read command.

python - Cannot chain find and find_all in BeautifulSoup -

i have book , docs on beautifulsoup. both should able chain find/find_all methods , use subscripts want single page scrape. not appear case. consider following table. <tr> <td><span style="display:none;" class="sortkey">dresser !</span><span class="sorttext">**<a href="/wiki/louise_dresser" title="louise dresser">louise dresser</a>**</span></td> <td><span style="display:none;" class="sortkey">ship !</span><span class="sorttext"><i><a href="/wiki/a_ship_comes_in" title="a ship comes in">a ship comes in</a></i></span></td> <td><span style="display:none;" class="sortkey">pleznik !</span><span class="sorttext">mrs. pleznik</span></td> </tr> <tr> <td><span style="display:none;" c

amazon web services - compare aws EC2 g3 instances with gtx 1070 or 1080 Ti -

i new gpu computing , cloud computing. wondering if can directly compare aws g3 instances gtx 1070 or gtx 1080 ti graphic card in terms of performance. (price aside) my current project blender 2500-frame 3d animation. (1 2 minutes render each frame in g3.4xlarge instance) thank you! the g3 instances use nvidia tesla m60 gpus, has 2 gpu's vs 1080's 1 (i using since faster one) 1080 has 2560 cores whereas tesla has 4096 cores (2048 per core) 1080 has 8gb ram vs 16gb tesla (8 per core) based on specs, id tesla's come out on top. can compare them below links: tesla: http://www.nvidia.com/object/tesla-m60.html gtx 1080: https://www.nvidia.com/en-us/geforce/products/10series/geforce-gtx-1080/

php - How to determine if Latitude is North or South, or Longitude West or East from decimal coordinate? -

lets have position : 32.709237, 51.627789 need know if latitude w or e , longitude n or s . latitude positive in north , negative in south. similarly, longitude positive in east , negative in west. if(value<0) //value negative

oauth 2.0 - How to configure users access to an API protected with Azure AD oAuth2 -

we have existing "private/internal" api (non ms/azure) protect oauth2 provided azure ad, so, user's access api maintained azure ad administrators. it seems way configure api web application in azure ad. then, users can authorization token azure oauth2 server , send api (e.g. single page web app). the api expected validate scope, per understanding, received in token , make decision regarding access. but can't figure out how configure api access scope in azure ad against user. i.e. how link particular user , api scope in azure ad? can pls advise? thank you. when configure app, can enable "user assignment required" (in enterprise application properties in azure portal), , configure users or groups should have access. alternatively, if need more granularity, can use role based access, define roles in application manifest ( https://docs.microsoft.com/en-us/azure/architecture/multitenant-identity/app-roles ), , assign users different roles

javascript - 2 Select with same options, alerting when it is already selected at the first Select -

Image
i'm having hard time this, have 2 select same options. 2 select inputs named registrationdiscounttype1 , registrationdiscounttype2 so first choose discount registrationdiscounttype1 if add discount registrationdiscounttype2 if option selected in discount number 1 show error discount selected. i've made javascript based on i've search far, can't make work, can me wrong code, or should use? this sample photo // change in discount 2 $("#registrationdiscounttype2").unbind('change').bind('change', function() if ($('#registrationdiscounttype2').closest('table').find('option[value=' + $('#registrationdiscounttype1').val() + ']:selected').length > 1) { alert('discount selected, please choose one'); } }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.1/jquery.min.js"></script> <div class="form-group"> <lab

magento - Building an Extension that Display Chosen Products in a New Frontend Page From the My Acc -

right having problems trying develop websites using extension , and put codes , files in git , github. i want make website display chosen products in new frontend page accessed account section. first have create attribute name display_product. when products set yes using attribute display_product, displayed product added new frontend page accessed account menu page. i have add customize configuration system configuration modify limit number of products displayed on account page.

scrollview which contains horizontal vertical linearlayout with weightsum not working properly -

[<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/activityroot" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="com.weenggs.flora.choosepresentactivity"> <linearlayout android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/bkgflowerselect" android:orientation="vertical" android:weightsum="1"> <linearlayout android:id="@+id/top" android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="0.15" android:background="@drawabl

python - Django - Exclude current post from side bar -

i playing django i'm having trouble templates. in post detail in including recent posts side bar template tag want exclude current post if is, in fact, 1 of recent. original hope use .exclude(id__post_detail=post) in blog_tag think might missing important concept, need request post_detail return response , can that? or perhaps define query in view , call blog_tag? many in advance. 1.blog_tags.py from django import template register = template.library() django.db import models django.utils import timezone ..models import post @register.inclusion_tag('blog/sidebar.html') def sidebar_latest(request, count=5): latest_posts= post.objects.filter(published_date__lte=timezone.now()).order_by('-published_date')[:count] return {'latest_posts': latest_posts} views def post_detail(request, pk): post = get_object_or_404(post, pk=pk) return render(request, 'blog/post_detail.html', {'post': post}) post_detail {% ext

android - Anrdoid Checkstyle 8.1 error: Unable to create Root Module -

i want write custom check checkstyle . checkstyle work standart modules, when trying run custom module getting error: failure: build failed exception. * went wrong: execution failed task ':app:checkstyle'. > unable create root module: config {d:\users\...\config\checkstyle\checkstyle.xml}, classpath {null}. * try: run --stacktrace option stack trace. run --info or --debug option more log output. i use checkstyle gradle plugin here gradle (module: app): apply plugin: 'com.android.application' apply plugin: "checkstyle" android { compilesdkversion 25 buildtoolsversion "25.0.0" defaultconfig { applicationid "com.webtrust.tennosushi" minsdkversion 19 targetsdkversion 25 versioncode 1 versionname "1.0" testinstrumentationrunner "android.support.test.runner.androidjunitrunner" multidexenabled true // line solve problem (Без него вроде как ид