Basically, I have created a webapp - which should restrict access to users who are not logged in to the system.  The system is utilising a "user" object to persist session state between the client and the server, this effectively serves as the cookie.  The urls /index, /login, /register  can be accessed by all users visiting the webapp, regardless if they are registered, or logged in.  However, anything outside of this url boundary should redirect the user to the registration page.  In order to achieve this, I've been using springs HandlerInterceptorAdapter - and implementing some basic checking in the preHandle(). However - everything I've come up with is getting caught up in a redirect loop.  Any and all suggestions on how to resolve this are most welcome and appreciated. Any advice, articles or examples on where I can expand my knowledge of this use case are most appreciated. Comments on if and why my approach is flawed, and what best practices are I am keen to hear.  Keep in mind id rather not go down the spring security route just yet - trying to keep this as simple as possible.  @Override public boolean preHandle(HttpServletRequest request,                          HttpServletResponse response,                          Object handler) throws Exception {      HttpSession session = request.getSession();     User user;      try {         user = (User) request.getAttribute("user");     } catch (Exception e) {         e.toString();         return true;     }       if (user == null &amp;&amp; request.getPathInfo() != "/login"       || user == null &amp;&amp; request.getPathInfo() != "/register"      || user == null &amp;&amp; request.getPathInfo() == "/index") {          response.sendRedirect("register");         return true;     } else {         return true;     } }
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?
I just picked up a copy of Windows 7 Pro OEM for install on my computer.  Guy at the store said the only real difference between OEM and standard retail box was tech support.  However, the outside of the box has this big warning that says "The software must be installed with an OPK"?  What is the OPK?  Is it really necessary?  The MS site about it seemed to say it was optional.  EDIT:  BTW - I'm just an individual tinkerer, and not a System Builder Company Employee.  I should have made that clear.  I've used sysprep in a professional setting in the past, so I'm somewhat familiar with its concepts. For example how come $\zeta(2)=\sum_{n=1}^{\infty}n^{-2}=\frac{\pi^2}{6}$. It seems counter intuitive that you can add numbers in $\mathbb{Q}$ and get an irrational number. "Who wants ice-cream?" — Should I say "(not) I" or "(not) me"? Item cannot be installed or removed until the package catalogue is repaired Does light pollution affect sleep quality while already asleep? Many articles on the internet write about melatonin and its effects, making you tired. A lot of articles also point out how the use of devices before going to bed in modern days likely decrease melatonin production. Therefore, making it harder to fall asleep. But this information is only about the process of getting to sleep, before we are actually sleeping.  A recent Harvard Medical article 1 states:     High exposure to bright, artificial outdoor lights during the night may result in sleepless nights for older adults.   Referring to a publication on Nov. 15, 2018, in the Journal of Clinical Sleep Medicine.  Considering that:    many people nowadays, use their mobile devices in bed prior to going to sleep; modern cities or houses have (street) lights that are always enabled at night; ignoring the phase of falling sleep; focusing only on the time we are asleep already, so during the actual sleep cycles.   Does a darker room with less or no (artificial) light pollution improve sleep quality, with all associated health benefits as a result? In other words: Does light pollution, while asleep decrease the sleep quality or does light pollution only negatively affect the phase of “falling asleep”?  I wasn't able to find any studies or information regarding sleep quality in relation to light pollution during sleep. Were such studies performed? Are there specific moments when light pollution affects sleep quality the most, for example during REM-sleep or in a specific sleeping phase?    1 I am looking for shapefiles or a list of suburb names for Melbourne and Canberra. I have ABS shapefiles, but I need to filter that to end up with only metropolitan suburbs.  My shapefile has codes in it for  - I just need to know which suburbs belong to the metros. Inverse metric in linearised gravity Quaternions, Rotations and Real numbers I haven't really formally studied Algebra at anywhere near this level, but I was told about the existence of Quaternions a few years ago and I find them really cool. I also like how pure quaternions are analogous to cross products in $R^3$, and that it gives me a way of doing it algebraically rather than relying on hand rules.  Over the course of using them it's my understanding that multiplying an element by another, both imaginary numbers, rotates it in some manner so as to be orthogonal to both, similar to rotations of $\frac{\pi}{2}$ in the space with one real and one imaginary axis when multiplied by $i$, which is why it's useful for cross products as it will rotate it to be orthogonal to a plane spanned by linear combinations of those two vectors [afaik].   What I can't intuit though is why for any pure quaternion multiplication, there's a negative real part [the scalar product] if it's meant to correspond to a rotation within $R^3$ and the space of pure Quaternions is Isomorphic to $R^3$. Similarly I don't understand why $i^2 = j^2 = k^2 = $ A negative real. Aliases not available when using sudo What are the C++ coding and file organization guidelines you suggest for people who have to deal with lots of interdependent classes spread over several source and header files?  I have this situation in my project and solving class definition related errors crossing over several header files has become quite a headache. Over 20GB of disk space is gone? System drive, OS is Windows 7 x64 SP1 Ultimate.    Windows Explorer shows 100GB of used space.  TreeSizeFree shows 75GB of used space.  Total Commander and FAR confirm TreeSizeFree's measurements (counting hidden files).  Shadow copy is using up to 5GB with the current usage of 1.36GB.  Running FAR from Win7 PE shows the same.  Checkdisk shows no bad sectors. Disk is an OCZ SSD.  SMART monitor suggests SSD condition is perfect.    Where is the rest of space gone? What is batch size in neural network? I'm using Python Keras package for neural network. This is the . Is batch_size equals to number of test samples? From Wikipedia we have  information:     However, in other cases, evaluating the sum-gradient may require   expensive evaluations of the gradients from all summand functions.   When the training set is enormous and no simple formulas exist,   evaluating the sums of gradients becomes very expensive, because   evaluating the gradient requires evaluating all the summand functions'   gradients. To economize on the computational cost at every iteration,   stochastic gradient descent samples a subset of summand functions at   every step. This is very effective in the case of large-scale machine   learning problems.   Above information is describing test data? Is this same as batch_size in keras (Number of samples per gradient update)? PHP: running scheduled jobs (cron jobs) Is a music band a singular or a collective entity, grammatically speaking? Duplicate:    What is correct to say?  Korn* is a great band  OR  Korn* are a great band.  (* You can replace your favourite band's name here) Of course everybody there is no doubt about the following sentences:  The Beatles are a great band Led Zeppelin is a great band  But with certain kinds of names, the situation becomes difficult.  Metallica are a great band  OR  Metallica is a great band  Is there any consensus on this matter? Recovering files from harddrive My laptop got broken (by what it seems the graphics card burned) and it is so old that it is not worth fixing it.   I took the harddrive from it and tried to use it as external hard drive with other computer, however I cannot access all the data, ie anything that is inside my user folder (it shows it to be empty). Couldn't find anything to solve it. write some AMPscript to skip a record if its empty I have a data extension with a CustomerId(PK) that has multiple Productid's as Productid1, ProductId2, ProductId3...ProductId10.   Some of the Productid's are empty for some Customers and I'm trying to write some AMPscript if the productIdx is empty to show the next one.  I'm trying to display 6 products in an email and at the moment when I preview the email, if from the first six Products one doesn't have a value(is empty) I get the error "The subscriber preview failed to generate. Review the details, correct all issues, and try again. Product1 not found"  I want to skip the product that is NULL and go to the next one available.  %%[ SET @customerId = [customerId]  SET @customer_rows = LookupRows("PRL","customerId",@customerId) IF Rowcount(@customer_rows) &gt; 0 THEN SET @customer_row = ROW(@customer_rows, 1)  SET @product_count = 0  SET @productId1 = FIELD(@customer_row, "productId1")  IF NOT EMPTY(@productId1) THEN SET @product_rows = LookupOrderedRows("PI_UK", 1,"Normal_SalePrice Desc", "ProductCode", @productId1)  IF RowCount(@product_rows) &gt; 0 THEN  SET @product_count = ADD(@product_count,1) ELSE  SET @product_count = ADD(@product_count,0) ENDIF ELSE SET @product_count = ADD(@product_count,0) ENDIF    SET @productId2 = FIELD(@customer_row, "productId2") IF NOT EMPTY(@productId2) THEN SET @product_rows = LookupOrderedRows("PI_UK", 1,"Normal_SalePrice Desc", "ProductCode", @productId2) IF RowCount(@product_rows) &gt; 0 THEN SET @product_count = ADD(@product_count,1) ELSE SET @product_count = ADD(@product_count,0) ENDIF ELSE SET @product_count = ADD(@product_count,0) ENDIF  SET @productId3 = FIELD(@customer_row, "productId3") IF NOT EMPTY(@productId3) THEN SET @product_rows = LookupOrderedRows("PI_UK", 1,"Normal_SalePrice Desc", "ProductCode", @productId3) IF RowCount(@product_rows) &gt; 0 THEN SET @product_count = ADD(@product_count,1) ELSE SET @product_count = ADD(@product_count,0) ENDIF ELSE SET @product_count = ADD(@product_count,0) ENDIF  and so on till ProducId10...   I have uploaded a photo with the PRL Data extension Intersections of all subgroups is a nontrivial subgroup, so every element has finite order. I need help to prove this result:  "Let $G$ be a group such that the intersection of all its subgroups other than $\{1\}$ is a subgroup different from $\{1\}$. Then all its elements have a finite order".  I know I must think of an element $g$ of infinite order. That will imply that every subgroup has infinite order (because it will contain an element like $g^k$). After this, I don't know which step I can take. Can someone help? Author information column wise I am using authblk package and I want to achieve following output using this package. I have FlexiPage Home_Page_Default.flexipage assigned as Default Home Lightning Page for all profiles in one sandbox. I need to migrate it to another sandbox and assign as Default Home Lightning Page for all profiles in the destination sandbox.   I am able to retrieve and deploy that flexipage but looks like I am not able to assign it automatically as Default Home Lightning Page for all profiles in the destination sandbox using Force.com ANT Migration Tool or changeset.  Is that possible to migrate default home flexi page assignment from one organization to another using ANT Migration Tool or changeset?  If this is possible then how? Stack Exchange releases "data dumps" of all its publicly available content roughly every three months , and also makes that information queryable over the Internet at the  (SEDE) (updated weekly, on Sunday). Over time, as new features and other bits of data are introduced to Stack Exchange sites, the "anatomy" of the data dump is likely to change.