I'm implementing security in my RESTful webservice, and I'm thinking of creating a filter that checks if the Authorization header is valid or not, and this check is done by sending the token to a third party endpoint. If the token is valid, the third party endpoint has to send me a response that contains information regarding the token's expiration, client id, scope, and other stuff. The logic, then, is this:  @Override public void doFilter(         final ServletRequest request,          final ServletResponse response,         final FilterChain chain) throws IOException, ServletException {     HttpServletRequest req = (HttpServletRequest) request;     header = req.getHeader("Authorization");     EndpointResponse eResponse = Endpoint.validate(header);     if(eResponse.valid())){       chain.doFilter(...);       return eResponse; //or equivalent     }else{       HttpServletResponse res = HttpServletResponse(response);       res.setStatus(HttpServletResponse.SC_UNAUTHORIZED);       ...     } }   Then, in a DAO class, I will use the eResponse like this  public final class DAO{         public void checks(){         if(eResponse.scope() == "ADMIN"){             ...         }else{             ...         }     } }   Is there a way to inject or return an object after the filter does the validation? Hopefully, without using spring or hibernate, since I can't use these at my job.  -EDIT-  The way I'm accessing the DAO would be like this  @Path("") public class CertificationService {      @GET     @Produces(CertificationApplication.SUPPORTED_REPRESENTATIONS)     @Path(CertificationConstants.URL_PATH)     public Response getCertificationByUpId(String upId) throws CertificationException {                 ResponseBuilder response;             try{             response = Response.ok(DAO.findCertificationByUPID(upId));         } catch (CertificationException e) {             response = handleException(e);         }         return response.build();     }    }   The findCertificationByUPID method would have to call the checks() method I declared above.
I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug.  Is == bad? When should it and should it not be used? What's the difference?
Installing grounded light fixture on box with no ground conductor I'm installing a brand new motion activated security light to an existing box on my garage. After removing the old light, I notice it only has white/black wiring while the new light fixture has of course white/black/green (ground) wires to attach. What do I do if no ground wire is available with the old box? I bought a rtl8811au chipest based usb wifi for my work stationd that supports dual band. But when I plugged in the usb my ubuntu doesn't recognized it. So I had to find the driver and compiled it 'cause the one inside the usb package was not compatible with the last kernel version.  My experience with some drivers get from github platform was unsatisfied.  All the drivers I tested are an issue in my user experience. It seems that, with these drivers, my wifi usb stops working randomly, specially when the browser is open and it loads some javascript.   In that context the ping command works normally and all the other connections such as p2p like torrent, or app like telegram.  When that issue shows up, I have some options:   Waiting to work again with do nothing Unplug and replug the usb dongle Restart network service or turn off and turn on wifi   With all these options I have to wait and it is so heartbreaking !  So I think that the problem is relative to the driver 'cause I get it from github and it can contain some error.  I tried drivers like:         and the problem still persists on all these drivers.  Do you know some driver that works properly ? How do I perform a biographical interview? I have a couple of elderly relatives who have not kept a journal and refuse to write down their "life story." I really would like to know their stories and who they were and who they are. They have their favorite stories that they rehash every time I see them, but I'd like to get more. I have no experience with "interviewing" and am looking for information on how to get their stories. Any websites, books, and or tips\techniques would be greatly appreciated. What are C++ functors and their uses? I keep hearing a lot about functors in C++. Can someone give me an overview as to what they are and in what cases they would be useful? CPU Speed stuck at 0.78 GHz, How do I increase it to its base speed of 2.30 GHz? My 1yr old laptop, HP Pavilion 15 has it's CPU, Intel i5-8300H stuck at 0.78 GHz whenever it's plugged and charging, and the moment I remove the charger plug or switch it off, it increases suddenly and keep fluctuating freely, with good utilisation percentage more than 1-2GHz or more as I experience Thermal Throttling. I tried sneaking into the BIOS to see if I can do anything, but found nothing. I also downloaded Intel Extreme Tuning Utility (XTU) but couldn't control it. My question is how do I increase the speed to say atleast 2 GHz (fixed, not fluctuating) when it's charging, irrespective of getting thermal throttle, and also maybe even control the fan speed if it does get hot? Why Cooper or Dr. Brand can't send message? jQuery autocomplete tagging plug-in like StackOverflow's input tags? I would like to filter the markers on my (geojson) layer according to two features: year and type of event, ideally using both filters (year and eventType) as check-boxes without using layerGroup at all. I would like to be able to click on a checkbox and update dynamically the markers by filtering them according to feature.properties.eventType too, in addition to the year displayed, something like    &lt;input type="checkbox" id="all" name="all" value="all"&gt;   &lt;label for="all"&gt;All&lt;/label&gt;   &lt;input type="checkbox" id="funfair" name="funfair" value="newsletter"&gt;   &lt;label for="funfair"&gt;Funfair&lt;/label&gt;   &lt;input type="checkbox" id="trade" name="trade" value="trade"&gt;   &lt;label for="trade"&gt;Trade&lt;/label&gt;   &lt;input type="checkbox" id="exhibition" name="exhibition" value="exhibition"&gt;   &lt;label for="exhibition"&gt;Paid exhibition&lt;/label&gt;   etc... which would trigger a  filter: function(feature, layer) {   return feature.properties.eventType == value-of-checkbox; }   I have five types of eventType. So, for instance, if 1890 is checked, the map is showing all 1890 events, no matter what kind of event it is (because by default it would show all events). If the user checks the 'funfair' and the 'trade' checkbox, though, I want the map to show only the 1890 events of the funfair and trade kind, and not other kind of events.  This is my complete script, which so far is working fine with filtering by year.  var oldmap = L.tileLayer('address', {   maxZoom: 12 }),  var modernmap = L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}', {   maxZoom: 12,   id: 'mapbox.streets',   accessToken: 'mytoken' });  var map = L.map('map', {   center: [40.1857864,-4.5536861],   zoom: 7,   layers: [oldmap, modernmap] });  var baseMaps = {   "Old map": oldmap,   "Modern map": modernmap };  var jsontest = {"type": "FeatureCollection",   "features": [     {       "type": "Feature",       "geometry": {         "type": "Point",         "coordinates":  [ -16.5471268,28.4136726 ]       },       "properties": {         "Name":"Point1",         "year":'1892',         "eventType":"funfair",         "notes":""       }     },     {       "type": "Feature",       "geometry": {         "type": "Point",         "coordinates":  [ 2.1753895,41.3767925 ]       },       "properties": {         "Name":"Point2",         "year":'1890',         "eventType":"trade demonstration",         "notes":""       }     }   ]};  var mapLayerGroupsYear = [];  function onEachFeature(feature, layer) {   var year = mapLayerGroupsYear[feature.properties.year];   if (year === undefined) {     year = new L.layerGroup();      //add the layer to the map     year.addTo(map);      //store layer     mapLayerGroupsYear[feature.properties.year] = year;   }    //add the feature to the layer   year.addLayer(layer);    }   var myLayer = L.geoJSON(jsontest, {   onEachFeature: onEachFeature })  L.control.layers(baseMaps, mapLayerGroupsYear).addTo(map);   I am a beginner with leaflet so please forgive the dumb question, in case it is. What's a concise way to check that environment variables are set in a Unix shell script? I've got a few Unix shell scripts where I need to check that certain environment variables are set before I start doing stuff, so I do this sort of thing:  if [ -z "$STATE" ]; then     echo "Need to set STATE"     exit 1 fi    if [ -z "$DEST" ]; then     echo "Need to set DEST"     exit 1 fi   which is a lot of typing. Is there a more elegant idiom for checking that a set of environment variables is set?  EDIT: I should mention that these variables have no meaningful default value - the script should error out if any are unset. Is it safe to have laptop turned on 24/7? request: bragging & boasting but all made up of lies This is a single word, idiom, phrase, expression request - so basically I'll take anything that fits the bill.  Basically I'm trying to translate the Chinese word 吹牛 - which dictionaries will tell you mean to brag &amp; to boast - but it actually also refers to things that are usually all untruths and lies.  I thought, originally, that one of these would work: he's just bragging (i.e.: it's not, actually, true) - but Google only says:     brag      braɡ/      verb      ?verb: brag; 3rd person present: brags; past tense: bragged; past participle: bragged; gerund or present participle: bragging         say something in a boastful manner.   "he bragged that he was sure of victory"         noun      noun: brag; plural noun: brags         a boastful statement.      and     boast1      bəʊst/      verb      verb: boast; 3rd person present: boasts; past tense: boasted; past participle: boasted; gerund or present participle: boasting         talk with excessive pride and self-satisfaction about one's achievements, possessions, or abilities.      "she boasted about her many conquests"      synonyms:  brag, crow, swagger, swank, gloat, show off, blow one's own trumpet, sing one's own praises, congratulate oneself, pat oneself on the back; More      exaggerate, overstate;   preen oneself, give oneself airs;   informaltalk big, blow hard, lay it on thick, shoot one's mouth off;   informalskite, big-note oneself   "his mother had been boasting about how wonderful he was to all her friends"   antonyms:   deprecate, belittle   (of a person, place, or thing) possess (a feature that is a source of pride).   "the hotel boasts high standards of comfort"         noun      noun: boast; plural noun: boasts         an act of talking with excessive pride and self-satisfaction.      "I said I would win and it wasn't an idle boast"      Not really seeing anything talking about lies.   Anything about bragging or boasting that involves lies? How do I capture the milky way? Can the milky way actually be photographed ? I know the image is manipulated, and is probably a composite, but how do you capture such contrast in the milky way? Is an equitorially mounted scope required? Any advice or pointers are welcome, thanks.  I'm heading out towards much less light polluted areas middle of next week and I want to try some nighttime sky captures with my 7D.  Additional info: I just found  on wikipedia that says: 54s, tripod mounted 5D, 16mm lens, f/2.8, ISO800. What else do I need to be aware of? My 7D is only an APS-C and the widest lens I have is 19mm. I'm thinking that might not be wide enough to capture an interesting shot? I have seen quoted several places on the internet a rule that one can apply bonuses and penalties in the most beneficial order.  An example I come across frequently (as a druid) is the combination of Natural Bond and . Natural Bond increases your effective druid level for determining the stats of animal companions but cannot increase it beyond your character level. Choosing an alternative animal companion lowers your effective druid level for determining the same stats. The "most beneficial order" rule is used to justify applying the level penalty before the natural bond bonus in order to get around the character level cap on natural bond.  Does this rule actually exist? If so, where does this rule originate? I would like to be able to cite a reliable source for my GM. How do I download with youtube-dl to get video title as filename? I use a Full HD 24" external display besides my 15" MacBook Pro Retina, on which I use the option for most screen estate regarding the Retina display. In the display arrangement screen, the MacBook Pro is therefore a bigger rectangle than the external display. Is there a way to size these rectangles regarding their "real world size" instead of resolution? I'm annoyed by my cursor teleporting vertically whenever I move from one display to another. Conditionally run a view if another view has no results Evaluate $\mathop {\lim }\limits_{x \to 0} \left( {{1 \over {{{\sin }^2}x}} - {1 \over {{x^2}}}} \right)$ I tried l'Hospital but that will require a lot (and I mean A LOT!!!) of differentiating  Is there a shortcut? $$\mathop {\lim }\limits_{x \to 0} \left( {{1 \over {{{\sin }^2}x}} - {1 \over {{x^2}}}} \right)$$  Thanks in advance We are having issues with our exchange 2013 server. The server is running Windows Server 2008 R2 Standard.  The issue we're having is that our Exchange server isn't receiving internet emails. It can currently send mail out to internet addresses, and send and receive internal emails from the current email server. I have checked the settings of the receive connectors and everything seems correct. We have tried everything that we can think of.   We can send and receive email locally, and send out to a gmail account. However, we don't get the reply email from the gmail account to the inbox.    Thanks in advance!! Image is of the DNS settings on the exchange server. Is there anyway to get tuple operations in Python to work like this:  &gt;&gt;&gt; a = (1,2,3) &gt;&gt;&gt; b = (3,2,1) &gt;&gt;&gt; a + b (4,4,4)   instead of:  &gt;&gt;&gt; a = (1,2,3) &gt;&gt;&gt; b = (3,2,1) &gt;&gt;&gt; a + b (1,2,3,3,2,1)   I know it works like that because the __add__ and __mul__ methods are defined to work like that. So the only way would be to redefine them? Pretty tricky cmd