Posts

Showing posts from January, 2015

javascript - variable is set to undefined in function -

this question has answer here: how use “settimeout” invoke object itself 3 answers i trying create slide show load next slide before current 1 done. have 2 prototypes this. 1 showing current slide , 1 loading next slide. it worked fine until put settimeout() delay between slides. nextslide() function calling after settimeout() this.nextslide undefined if it's loaded , added this.nextslide in loadnextslide() . $(document).ready(function(){ //set width , height of canvas var width = $(document).width(); var height = $(document).height(); $("#mkslide").css({"width":width+"px","height":height+"px"}); slideshow = new slideshow(width, height, "2d"); slideshow.loadnextslide(null); slideshow.nextslide(); }); function slideshow(canvaswidth, canvasheight, dimension){ //c

javascript - How to handle an error on ajax login form? -

i have several login forms use ajax, when information wrong page refreshes. want catch keyword/variable php, right echoing 'error', , want alert on page no refresh. here's current js. when submit, login object created , login method performed, if successful redirects dashboard if not echos 'error' , how can accomplish need javascript? <script> $('#doctor_login').on("submit", function(e){ frmreg = document.getelementbyid("doctor_login"); if(frmreg.user_name.value == "") { alert("<?php echo _username_empty_alert; ?>"); frmreg.user_name.focus(); return false; }else if(frmreg.password.value == ""){ alert("<?php echo _password_is_empty; ?>"); frmreg.password.focus(); return false; }else{ $.ajax({ type:'post', url: '../page/handler/handler_ajax_login.php', data: $(this).serialize() } }); } })

Recurly PHP 2.5.* in Laravel 5.1 getting 'Call to private method' error -

i'm in process of developing heavily recurly integrated platform users have option of adding/editing/removing features reflected in subscription pricing. the environment project laravel 5.1 , attempting use recurly's php client simplify api integration. in order lot of recurly stuff work, had add namespacing recurly php files in order have them referenced , reference 1 inside laravels framework. i.e. <?php namespace app\libraries\recurly; use datetime; use domdocument; abstract class recurly_base { to 44 or class files involved in 2.5.* version of recurly php library. i can use library generate subscriptions, time try update subscriptions, fatalerrorexception thrown php, , thrown same class exampled above. call private method recurly_base::addlink() context 'app\libraries\recurly\recurly_base' this error thrown during block of code $user = $request->user(); $subscription = recurly_subscription::get($user->recurly_subscripti

javascript - JSONP request error Angular 2 -

i making jsonp request in angular 2. response when click on link of error message, unable output response browser, error: uncaught response status: 200 ok url: https://www.statbureau.org/calculate-inflation-price-jsonp?jsoncallback&country=united-states&amount=102&start=1968%2f1%2f1&end=2016%2f1%2f1 import {component} '@angular/core'; import {navcontroller} 'ionic-angular'; import {jsonp, urlsearchparams } '@angular/http'; import {jsonp_providers} '@angular/http'; @component({ templateurl: 'build/pages/home/home.html', providers: [jsonp_providers] }) export class homepage { value: any; constructor(private jsonp: jsonp) { this.jsonp=jsonp; let cpiurl = "https://www.statbureau.org/calculate-inflation-price-jsonp?jsoncallback" let params = new urlsearchparams(); params.set('country', 'united-states'); params.set('amount', '102'); param

compilation - Viewing code inserted by the Java compiler -

can java class file decompiled such way show code added compiler? example, java compiler inserts no argument constructor whenever no explicit constructor found. when decompile class file no explicit constructor, however, 1 inserted compiler doesn't show up. example compiler's insertion of "extends java.lang.object" in class doesn't explicitly extend other class. again, when decompile such class, i'm not seeing "extends" component of class declaration in decompiled text. perhaps i'm taking fact java compiler "inserts" code literally? maybe need more sophisticated decompiler? better use byte code viewer asmifier asm . instructions added compiler skipped @ decompiling, in order keep source code , decompiled code close. you find default constructor signature public <init>()v . added byte code if no constructor defined.

solr - query document which has particular word at last index of that field -

i have field textfield data type i want search if has particular word @ last index of field, for example. my field title value elligator red lace men's running sports shoes now want search documents has shoes last word in title. have tried search solr regex ? (supported solr 4.0+.) q=title:/.*shoes/ for this, title field must of type stringfield , not tokenized.

excel - Copying template worksheet under two if conditions and naming sheet according to cell value -

i have list of companies in range d16:d40 under 2 reporting categories: quarterly or semi annually. range j16:j40 states whether quarterly or semi annually reported. i want copy template qtr or semi depending on stated value in range j16:j40 . how can improve below formula work? the macro below shows application defined / object defined error. sub copyqtrsheetandinsert() ' ' copyqtrsheetandinsert macro ' dim rcell range dim rcell2 range dim background worksheet set background = activesheet each rcell in range("d16:d49") each rcell2 in range("j16:j49") if rcell2.value = "qtr" sheets("qtr").copy after:=sheets("semi") sheets("qtr (2)").name = rcell.value end if next rcell2 next rcell end sub

c# - Compiler Ambiguous invocation error - anonymous method and method group with Func<> or Action -

i have scenario want use method group syntax rather anonymous methods (or lambda syntax) calling function. the function has 2 overloads, 1 takes action , other takes func<string> . i can happily call 2 overloads using anonymous methods (or lambda syntax), compiler error of ambiguous invocation if use method group syntax. can workaround explicit casting action or func<string> , don't think should necessary. can explain why explicit casts should required. code sample below. class program { static void main(string[] args) { classwithsimplemethods classwithsimplemethods = new classwithsimplemethods(); classwithdelegatemethods classwithdelegatemethods = new classwithdelegatemethods(); // these both compile (lambda syntax) classwithdelegatemethods.method(() => classwithsimplemethods.getstring()); classwithdelegatemethods.method(() => classwithsimplemethods.donothing()); // these compile (method gr

shell - Get current directory through alias in git-bash (windows) -

this command prints directory name fine: echo ${pwd##*/} this alias in .bashrc not: alias echodir="echo ${pwd##*/}" they both work fine in home directory, after changing directories typing in manually works. alias still prints home folder. understand because git bash works nested shells or - base shell doesn't change directories @ all, surface 1 does. is there way create alias works expected? i'm posting answer twalberg put in comments(he gets credit): as one-off command: echo "-----updating "${pwd##*/}"-----" as alias: alias updating='echo "-----updating "${pwd##*/}"-----"'

How to pass empty value to a query param in swagger? -

i trying access url similar http://example.com/service1?q1=a&q2=b . q1 not have values associated required access service ( http://example.com/service1?q1=&q2=b ). how achieve through swagger ui json. i've tried using allowemptyvalue option doesn't seem work. please find below sample json tried using allowemptyvalue option, { "path": "/service1.do", "operations": [{ "method": "get", "type": "void", "parameters": [{ "name": "q1", "in" : "query", "required": false, "type": "string", "paramtype": "query", "allowemptyvalue": true },{ "name": "q2", "in" : "query", &q

caching - What is the cache's role when writing to memory? -

i have function little reading, lot of writing ram. when run multiple times on same core (the main thread), runs 5x fast if launch function on new thread every run (which doesn't guarantee same core used between runs), launch , join between runs. this suggests cache being used heavily write process, don't understand how. thought cache useful reads. modern processors have write-buffers. reason writes are, first approximation, pure sinks. processor doesn't have wait store reach coherent memory hierarchy before executes next instruction. (aside: stores not pure sinks. later read written-to memory location should return written value, processor must snoop write-buffer, , either stall read or forward written value it) obviously such buffer(s) of finite size, when buffers full next store in program can't executed , stalls until slot in buffer made available older store becoming architecturally visible. ordinarily, way write leaves buffer when value writt

ios - Swift: How to make a label in the borders of the screen? -

i'm trying create game generates labels randomly on screen, entire word must inside screen. have textfield in screen i'm intending put words beneath. i have function adding label, , making sure it's inside borders. func addword(word: string) { let screensize: cgrect = uiscreen.mainscreen().bounds let screenwidth = uint32(screensize.width) let screenheight = uint32(screensize.height) let label = uilabel() label.text = word label.font = uifont.systemfontofsize(32) label.sizetofit() label.backgroundcolor = uicolor.whitecolor() let x = cgfloat(arc4random_uniform(screenwidth)) let y = cgfloat(arc4random_uniform(screenheight)) label.center = cgpointmake(x, y) label.center = checkbounds(label, minx: 0, maxx: cgfloat(screenwidth), miny: (newwordstextfield.bounds.origin.y+newwordstextfield.bounds.maxy), maxy: cgfloat(screenheight)) view.addsubview(label) let pangesture = uipangesturerecognizer(target: self, action:

audio - Is it possible to get access to the speaker signal on Android? -

sending audio speaker playback on android easy, possible copy of actual final digital signal? let's have 2 apps running "myapp" , "someotherapp". app sends audio speaker, "someotherapp". "someotherapp" not app - it's 3rd party app. possible copy of mixed audio signal played speaker os? is, audio signal mixture of speaker signal app , speaker signal "someotherapp". to summarize: looking way hook low-level audio path (hal audio stream out - after mixing!) can copy of "final" speaker signal (in real-time). optimally, hook low-level microphone path, that's less of concern right now. looks short answer no . longer 1 kinda . , sorta . not really, far know. option 1: might problem respects privacy. (not option) option 2: nobody thought needed, did not build system. option 3: amount of trouble shooting when programmers use wrong source not worth it. edit - can, of course, record input .

c++ - How to calculate mersenne numbers in compile time -

note: q&a not mersenne twister , mersenne numbers . i want compute, @ compile time, array of size n containing mersenne primes (2 n − 1) n in [0, n - 1]. template <std::uint8_t n> static constexpr std::array<std::uint16_t, n> mersenne_numbers() { // compute mersenne numbers n, n-1 ... 1 , return array return { 1, 2, 3 }; }; int main() { constexpr std::array<std::uint16_t, 5> arr = mersenne_numbers<5>(); } how can implement ? so compute array of (2^n - 1) @ compile time, may do template <std::size_t ... is> constexpr std::array<std::uint16_t, sizeof...(is)> mersenne_numbers(std::index_sequence<is...>) { return {{ ((1u << is) - 1u)... }}; } template <std::uint8_t n> constexpr std::array<std::uint16_t, n> mersenne_numbers() { return mersenne_numbers(std::make_index_sequence<n>{}); } demo implementation of index_sequence stuff can done in c++11, , found on so. or in

Android App Crashes Unexpectedly When Trying To Run New Activity -

when try , switch activity in app, crashes. logcat when run on phone. here activity i'm starting from: package com.epicodus.parkr; import android.app.progressdialog; import android.content.intent; import android.graphics.typeface; import android.support.annotation.nonnull; import android.support.v7.app.appcompatactivity; import android.os.bundle; import android.util.log; import android.view.view; import android.widget.button; import android.widget.edittext; import android.widget.textview; import android.widget.toast; import com.google.android.gms.tasks.oncompletelistener; import com.google.android.gms.tasks.task; import com.google.firebase.auth.authresult; import com.google.firebase.auth.firebaseauth; import com.google.firebase.auth.firebaseuser; import butterknife.bind; import butterknife.butterknife; public class mainactivity extends appcompatactivity implements v view.onclicklistener { private firebaseauth mauth; private progressdialog msigninprogressdialog; @b

Python newbie problems -

Image
i finished watching video https://www.youtube.com/watch?v=qo4zn5uzsvg , , though teaches 2.0 edition python, notes pop 3.0 uses of python. nevertheless, in end, challenges provided, 1 of them this: def returntwo(): return 20,30 x,y = returntwo() print(x,y) whenever try see conclusion be, comes def returntwo(): return 20,30 (red x in 3.5 shell) x,y = returntwo() syntaxerror: invalid syntax. what can do? the python shell allows interactively run commands. useful when doing quick calculations of check small pieces of code. in case, want define function. defining function that: a definition . later on, call function , make run. issue here function (often) defined in more 1 line. means, hit enter before finish define function . reason, tell shell finished enter : this applies if define function in single line: and that's reason why syntaxerror : line x, y = returntwo() supposed in function, that, need indented (to level of return 20, 30 ):

javascript - Cannot initialize a pie chart with Chart.js -

i copying example chart.js , stuck error making is. here code (taken examples): <canvas id="mychart" width="400" height="400"></canvas> <script src="https://code.jquery.com/jquery-2.1.4.min.js"></script> <script src=" https://cdnjs.cloudflare.com/ajax/libs/chart.js/1.0.2/chart.min.js" charset="utf-8"></script> <script type="text/javascript"> // context of canvas element want select var ctx = document.getelementbyid("mychart").getcontext("2d"); var mynewchart = new chart(ctx[0]).pie(data); var data = [{ value: 300, color: "#f7464a", highlight: "#ff5a5e", label: "red" }, { value: 50, color: "#46bfbd", highlight: "#5ad3d1", label: "green" }, { value: 100, color: "#fdb45c",

ios - Error creating a temp file using NSTemporaryDirectory -

in ios 9.1 there's apparently problem following code. doing wrong? nsstring *filepath = [nstemporarydirectory() stringbyappendingpathcomponent:@"foobar.dat"]; nsstring *s = @"testing"; nsdata *data = [s datausingencoding:nsutf8stringencoding]; nserror *error = nil; bool ok = [data writetofile:filepath options:nsdatawritingatomic error:&error]; if(!ok) { nslog(@"=== error writing path %@, %@", filepath, error.debugdescription); } the log says === error writing path /var/folders/gf/4429772177s9rr234wzlwpz00000gp/t/foobar.dat, error domain=nscocoaerrordomain code=4 "the folder “foobar.dat” doesn’t exist." userinfo={nsurl=file:///var/folders/gf/4429772177s9rr234wzlwpz00000gp/t/foobar.dat, nsunderlyingerror=0x15e0bc20 {error domain=nsposixerrordomain code=2 "no such file or directory"}, nsuserstringvariant=folder} this happens on iphone, not in simulator. there's gb of free space in phone. help. edit added c

javascript - how to make post request in node js + express -

Image
i trying make post request using express + node.js .i install these plugins package.json { "name": "expressjs", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "test": "echo \"error: no test specified\" && exit 1" }, "author": "", "license": "isc", "dependencies": { "body-parser": "^1.14.1", "express": "^4.13.3", "mongodb": "^2.0.47" } } i make post request var express = require('express'); var mongodb = require('mongodb'); var app = express(); var bodyparser = require('body-parser'); app.use(bodyparser.json()); // support json encoded bodies app.use(bodyparser.urlencoded({ extended: true })); // support encoded bodies var mongoclient = require('mongo

graphql - Relay requests via setVariables -

when request made via setvariables there way take account of local state in-between async requests i.e. implement loading indicator ? an illustration making requests https://www.graphqlhub.com/graphql _onchange = (ev) => { this.setstate({ loading:true }) let giftype = ev.target.value; this.props.relay.setvariables({ giftype }); this.setstate({ loading:false }) } this won't track loading state , loading pass on false while async change view have lag. if move loading setvariables there way track response ? in root container there ability track response via renderloading={function() { return <div>loading...</div>; }} is there similar method relay.createcontainer is bad practice use setvariables navigate through data sets ? full code class giphitems extends react.component { constructor(){ super(); this.state = { loading: false } } render() { const random = this.pr

java - HtmlUnit - "Browser Not Supported" Error on website using JQuery -

i use htmlunit login website , click link file downloaded, however, website, uses jquery, returns "browser not supported" error. there way htmlunit can set normal browser website? any appreciated. i'm trying following settings, error still occurring: public void surf(job job) { system.out.println("[enter] surf"); try { string applicationname = "netscape"; string applicationversion = "5.0 (macintosh; intel mac os x 10_11_3) applewebkit/537.36 (khtml, gecko) chrome/51.0.2704.106 safari/537.36 opr/38.0.2220.41"; string useragent = "mozilla/5.0 (macintosh; intel mac os x 10_11_3) applewebkit/537.36 (khtml, gecko) chrome/51.0.2704.106 safari/537.36 opr/38.0.2220.41"; int browserversionnumeric = 51; browserversion browser = new browserversion(applicationname, applicationversion, useragent, browserversionnumeric); webclient webclient = new webclient(browser);

android - ViewPager inside ViewPager.How to scroll parent pager horizontally instead of scrolling child, but keep child pager vertical scroll? -

i have parent viewpager , each page of contains child viewpager . child viewpager may contain listview or vertical scrollview . want pass horizontal scroll child viewpager parent viewpager , want keep child viewpager scrollable vertical. overriding dispatchtouchevent(motionevent event) in child viewpager , returning false helps pass motion events parent viewpager, how keep listview , scrollview in child viewpager scrollable? the solution easier expected. just override canscrollhorizontally in child viewpager , return false.

Can't see variable values in Locals or Autos in Visual Studio -

i'm using microsoft visual studio community 2015 version 14.0.25422.01 update 3. can't see variable values in locals or in autos. empty. googled , came couple of suggestions: i've started visual studio in administrator mode, debug -> options -> use legacy c# , vb expression evaluators use managed compability mode what should able see variables? screenshot

Android Studio Error while importing eclipse project -

Image
i started android development android studio not know eclipse. client has sent me source code android app needs editing , while trying import getting following error. some 1 please guide me solution, need right now. using android studio 2.1.2 jdk 8 installed. this project.properties file thanks! ok turns out app using "pulltorefresh" library missing deliverable me. did not have experience of working external libraries yet took me time identify that. i downloaded library , gave correct path in "project.properties" file. imported project android studio , working absolutely fine

jquery - bootstrap-datepicker input needs focus-out focus-in to re-initialize -

when have (bootstrap eternicode) datepicker open , click , drag browser's scrollbar, datepicker naturally losing focus , hiding. but not able view datepicker directly again. need first click on element, before going date-pickers input in order make visible again. how can prevent happening?

jsoup: manipulation on text -

i have html file, example: <!doctype html> <html> <body> <h1>my first heading</h1> <p>my first paragraph.</p> </body> </html> i have written method in java, converts text symbols latin cyrillic, like: public static char changeletterlatcyr(char charsent) { char l_a = 'a', l_a = 'a', l_b = 'b', l_b = 'b', r_a = 'А', r_a = 'а', r_b = 'Б', r_b = 'б', result = ' '; if (charsent == l_a) { result = r_a; } else if (charsent == l_a) { result = r_a; } else if (charsent == l_b) { result = r_b; } else if (charsent == l_b) { result = r_b; } else { result = charsent; } return result; } how implement function on text in document saving tag structures? function changes every char specific. i need result: <!doctyp

java - Don't know how to display only one syso if i have more "if" who are satisfied -

how make simple program show me 1 answer, if multiple conditions satisfied like: if age<16 syso("you can't rent cars") , if age <18 syso("you can't vote"). for example, if introduce 17 want display ("you can't vote") not ("you can't vote" , "you can't rent cars"). i tried use 2 conditions sticked "&&", didn't work. code comments import java.util.scanner; public class assign1 { public static void main(string[] args) { scanner x = new scanner(system.in); int age; system.out.println("insert age "); age = x.nextint(); if (age<16) { system.out.println("you can't drive"); } if (age<18 && age<16) { system.out.println("you can't vote"); } if (age<25) { system.out.println("you can't rent cars"); } if (age>25) {

Laravel 5.2 - Form do not submit -

sorry, i'm new laravel, have form: <form action="/register" method="post"> {!! csrf_field() !!} .... <div class="form-group"> <button type="button" class="btn btn-default">register</button> </div> </form> and route is: route::get('/register', 'auth\authcontroller@getregister'); route::post('/register', 'auth\authcontroller@postregister'); when click on register button nothing happen... form not submit, no errors etc. can me ? change <button type="button" class="btn btn-default">register</button> to <button type="submit" class="btn btn-default">register</button> and use dynamic url when deploy app server,then no error(s) action="{{ url('/register') }}

Meteor - connect collections of multiple databases -

in meteor (server side), possible create collections of multiple databases? let's want connect 2 different databases , mount collections in meteor. concern collections same name in both databases (for example "users"). is there way have 2 collections named "users" 2 different databases (connections)? thanks! edit: the other question not address main issue: if want mount (connect) 2 collections named "users" (for example) 2 different databases. meteor says: error: method named '/users/insert' defined i reopened question, there no easy answer. mongo driver assumes 1 connection per collection. aside, reasonable assumption - if did write, db updated? here ways work around limitation without implementing own driver: declare more 1 collection ( users1 , users2 ), each collection has access 1 of database instances. technically work fine, may not easy in code. use external process regularly copy contents of 1 collectio

javascript - change position of all selected svn-elements via translate() -

with pointermove -event make svg-element dragable. after draging new position saved doing `save()' canvas.on({ 'element:pointermove': function(elementview, event, x, y) { save(); } }); but want move multiple elements: elements want move have class highlighted . so pointermove-event can move 1 element, other highlighted elements (if there other highlighted elements) should same movement. think can translate() . but how can 'connect' $('.highlighted')-elements translate() make them same movement?

java - Make cell editable with JButton -

Image
i'm stuck 2 days on piece of code, cells of table non-editable default , want editable when click on edit button, can not run code. thank in advance help. table = new jtable(model) { public boolean iscelleditable(int row, int column) { return false; } }; table.setselectionmode(listselectionmodel.single_selection); sorter = new tablerowsorter < tablemodel > (model); table.setpreferredscrollableviewportsize(new dimension(560, 200)); jscrollpane scrollpane = new jscrollpane((table)); table.setrowsorter(sorter); add(scrollpane); scrollpane.setbounds(10, 180, 560, 200); table.setrowheight(28); table.setbackground(color.dark_gray); table.setforeground(color.white); modifier.addactionlistener(new actionlistener() { public void actionperformed(actionevent e) { if ((jbutton) e.getsource() == change) { boolean iscelleditable(int row, int column) { return true; } } } }); put enabled cell (row,

MongoDB C# Driver 2.1.0 - resolve reference -

i have following relationships between classes: public class person : entity { public string firstname { get; set; } public string lastname { get; set; } } public class project : entity { public string projectname { get; set; } public mongodbref leader { get; set; } } i following this tutorial resolve project leader mongodbref using following snippet. unfortunately cannot find resembles fetchdbrefas<>() method in c# 2.1.0 driver mongodb var projectcollection = this.database.getcollection<project>("projects"); var query = p in projectcollection.asqueryable<project>() select p; foreach (var project in query) { console.writeline(project.projectname); if(project.leader != null) { // can't figure out since // database.fetchdbrefas<t>(...) not available anymore } } can explain me how works 2.1.0 driver? i solved writing own extension method imongodatabase. in case else s

R: ifelse statement to create new variable equal to value of second variable conditional on value of third variable -

i'm trying create new variable (nphours) value of value of second variable (hours) conditioned on value of third variable (prod) being equal "n", otherwise want value of (nphours) "0". sample data: samp<-structure(list(hours = c(4.05, 4.05, 3.95, 3.95, 1), prod = structure(c(2l, 1l, 2l, 1l, 1l), .label = c("n ", "y "), class = "factor"), nphours = c("0", "0", "0", "0", "0")), .names = c("hours", "prod", "nphours"), row.names = c(na, 5l), class = "data.frame") the following ifelse statement produces "0". samp$nphours <- ifelse(samp$prod == "n", samp$hours, 0) can assist? str(samp$prod) so...report blank after "n" .... samp$nphours <- ifelse(samp$prod == "n ", samp$hours, 0)

javascript - Is there an un-obfuscated/un-minified (debug) version of the Firebase v3 JS libraries available? -

prior version 3.0, "debug" version of library available appending -debug filename. for example, v2.4.2 has an obfuscated version , a debug version , v3.1.0 seems have the obfuscated version ; appending -debug filename gives 404 note: an earlier question pre-3.0 answered; question v3+ from firebase-talk group: we unfortunately not ship debug version of 3.x.x client. reasons bit hard into, deals how build sdk itself. hoping bring debug version of sdk in future release, although don't have time estimate on that. sorry don't have better use. i'd love hear use cases (other using debug) if have them

hive - Modify partition column value -

can modify value of partitioned table, changing name of partition directory? the table have has year , month partitions. values stored decimal partitions "2016.0" instead of "2016" , "3.0" instead of "3". can rename directories , have values in partitions updated? first rename directories: hadoop fs -mv /dev/year=2016.0 /dev/year=2016 hadoop fs -mv /dev/year=2016/month=4.0 /dev/year=2016/month=4 let hive metastore know new location/partition: alter table logs partition(year = 2014, month = 4) set location 'hdfs://dev/year=2016/month=4';

java - Spring Security: sudden classpath and Thymeleaf related issues after modifying the filter chain -

i'm trying integrate waffle-spring-security4 existing spring boot project, of configuration happens automatically. i've noticed when negotiatesecurityfilter in chain, weird things occur: classnotfoundexception on initializing trivial class 1 string property; thymeleaf template loaded fine can't resolved , on. when happened, had following filters in chain: webasyncmanagerintegrationfilter securitycontextpersistencefilter headerwriterfilter csrffilter logoutfilter negotiatesecurityfilter (by waffle) basicauthenticationfilter requestcacheawarefilter securitycontextholderawarerequestfilter sessionmanagementfilter exceptiontranslationfilter filtersecurityinterceptor with switching http basic authentication issue disappears, think issue might filters above. have idea on how troubleshoot this? (if have strategy debugging similar issues, excellent.) yes, caused waffle, has turned out. the problem once you've done successful authentication waf

javascript - Leaflet: How to style 2000+ points in a GeoJSON object with no style properties? -

i have single geojson featurecollection object contains on 2000 features. in geojson object, each feature part of 1 category so: { "type": "feature", "properties": { "category": "electrical", "name": "plane no 2" }, "geometry": { "type": "point", "coordinates": [ 94.5703125, 58.722598828043374 ] } }, { "type": "feature", "properties": { "category": "military", "name": "base 1" }, "geometry": { "type": "point", "coordinates": [ 104.4140625, 62.91523303947614 ] } }, in actual data, there total of 38 categories (each feature assigned 1 category). is using javascript switch statement in situation practical solution in order give each point own styling? or, there better way? i doi

asp.net identity - How to access Azure Active Directory? -

i'd working on creating asp.net 5 web application , use asp.net identity manage users. i'd use azure active directory in multi-tenant configuration. understand more claims, expect create our own custom claims well. i see asp.net identity can configure providers (facebook, google) possible set azure active directory authenticate facebook / google , have flow through asp.net identity? guess flowing through azure active directory make our subsequent migration claims authentication easier. if so, pointers setting , road bumps may expected appreciated. regards, rajesh classic azure ad not integrate directly facebook or google, new b2c offer does. see http://aka.ms/aadb2c

sql - How to Jump back to the loop increment stage inside a stored procedure if a condition is satisfied inside the loop? -

i have stored procedure shown below has loop running inside it. if condition mentioned below satisfied need go loop , start loop stage. how can achieve this? ..... steps......... while (@iv<= @rcnt) begin create table #mathlogictable ( idnum integer identity(1,1), attributename varchar(256), inputvalues decimal(15,3) ) insert #mathlogictable select statements.................. if (not exists (select 1 #mathlogictable)) begin set @iv=@iv+1 (i need step go start of loop...if condition satisfies) end ------------------------------------------------------------ select............ update........ n steps......... ------------------------------------------------------------- end you should use continue keyword: if (not exists (select 1 #mathlogictable)) begin set @iv=@iv+1 continue end

C code crashes (no idea why) -

basically i'm beginner coder , wrote: #include <stdio.h> #include <stdlib.h> int main() { system("color 0a"); char playername[13]; char playergender; int playerage; printf("please input name , age!\nname: "); scanf("%s", playername); printf("age (from 18 50): "); scanf("%d", &playerage); label: if(playerage > 18 && playerage < 50) { printf("what gender you, m(male) or f(female): "); scanf("%c", playergender); gender: if(playergender == 'm' || playergender == 'f'){ printf("okay, name %s, you're %d years old , you're %s.", playername, playerage, playergender); }else{ printf("try again.\n\n" "what gender you, m(male) or f(female): "); scanf("%c", playergender); goto gender; } }else{ printf("wrong, try again.\n"

r - Separate year from month in date format -

this question has answer here: converting numeric values yyyymm dates in r 1 answer format date (year-month) in r [duplicate] 3 answers suppose have list containing year , month: l <- c(200101, 200102 ,200103, 200104) i want separate them can have 2 separate lists. here did no luck: as.date(l,"%y%m",format = "%y") this work : year_list<-as.numeric(substr(as.numeric(l),1,4)) month_list<-as.numeric(substr(as.numeric(l),5,6)) example 1: > l <- c(200101, 200102 ,200103, 200104) > l [1] 200101 200102 200103 200104 > year_list<-as.numeric(substr(as.numeric(l),1,4)) > year_list [1] 2001 2001 2001 2001 > month_list<-as.numeric(substr(as.numeric(l),5,6)) > month_list [1] 1 2 3 4 example 2: > l <- c

mysql - Selecting only some relations -

i have 3 tables: a, b, c. tables , c have fields: id , name , related many-to-many through b table fields a_id , c_id . how can select entries have relations only entries c called 'mike' ? select a.* inner join b on b.a_id = a.id inner join c on c.id = b.c_id c.name = 'mike'

java - Selenium error "Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms" when running on jenkins master node -

so after compile selenium code , run file.class im getting following error org.openqa.selenium.firefox.notconnectedexception: unable connect host 127.0.0.1 on port 7055 after 45000 ms. firefox console output: error: no display specified @ org.openqa.selenium.firefox.internal.newprofileextensionconnection.start(newprofileextensionconnection.java:112) @ org.openqa.selenium.firefox.firefoxdriver.startclient(firefoxdriver.java:271) @ org.openqa.selenium.remote.remotewebdriver.<init>(remotewebdriver.java:119) @ org.openqa.selenium.firefox.firefoxdriver.<init>(firefoxdriver.java:218) @ org.openqa.selenium.firefox.firefoxdriver.<init>(firefoxdriver.java:211) @ org.openqa.selenium.firefox.firefoxdriver.<init>(firefoxdriver.java:207) @ org.openqa.selenium.firefox.firefoxdriver.<init>(firefoxdriver.java:120) @ clusterreloadaut.<clinit>(clusterreloadaut.java:11) exception in thread "main" java.lang.exceptioninini