How to display error message with some colors using slf4j logger?
Making a log4j console appender use different colors for different threads
Sudo is also user login password - why? how to change? When installing Ubuntu I can create a user with an encrypted folder, what I always do. Now after the installation the login password for this user is also the sudo password. Is that how it should be? I actually would like to have a different user login and sudo password, does is make sense? Should I do that, how? Using the validation data I'm unclear on the exact process of using the validation data.  Let's say that I fit my neural network model and adjust hyperparameters using the training set and validation set. Do I then evaluate the test set on this model? Or do I recombine the validation and training sets and fit a fresh model with the hyperparameters that I found during the validation phase, and then evaluate on the test data? I have seen a number of different notebooks and examples that do both ways.  Surely, once I've found my hyperparameters, it makes sense to fit a fresh model using the full training set (recombined with validation set), since the validation loss has no effect on the weights. SF Short Story about resetting the world every day Trying to identify a short story. I recall it was quite short, shorter than a novella. I read it within the last few years, but my impression is that it's from the second half of the twentieth century, maybe the sixties. I can't recall if I read it online, in an anthology, or collection. Set in America, a middle-aged man stumbles on a team (maybe like dwarves or gnomes) whose job it is to set up the world for the next day by removing all the previous day's &quot;stuff&quot;, like street furniture? (I know that makes no sense). He disrupts this process and somehow prevents progressing to the next day. I also remember the story was quite lighthearted with the team behaving in a very grumpy way like interrupted workmen. I thought the title was something like &quot;What happened to Tuesday&quot; or similar. For some reason, I thought it was by Keith Laumer, but a search doesn't reveal anything. The trope was similar to &quot;The Tunnel Under the World&quot; by Pohl, and &quot;The Adjustment Team&quot; by Dick, in that reality was constantly changed and controlled by an organisation of some kind. Why use the 'ref' keyword when passing an object? I need another LP-E5 type battery for my Canon 450D. Should I buy an original Canon battery or one of the many generic brands available? There are loads of cheapos on , for example.  I should add that the new battery will be added to my existing Canon battery in a battery grip.  Does anyone have any experience (good or bad) of using generic batteries? Probability of first actor winning a "first to roll seven with two dice" contest? Origins of the nose-bleed in anime/manga In a similar spirit to my , I wonder who was the first artist to feature a nose-bleed when thinking, shall we say, "provocative thoughts"?  Did it become popularized in anime/manga because of the popularity of the artist's work or because it is a common belief in japanese folklore? How do I add a notification for process completions How can I add a notification of some sort (like playing a .wav file or creating a pop-up on the status bar) when a process finishes. For example, I am compiling a program that takes a couple of hours to finish. I would like to hear/see some sort of message when it completes compiling. Is there a tool for doing this (like tying an alarm program to the pid of a process) or something like that? How do I address unchecked cast warnings? Eclipse is giving me a warning of the following form:     Type safety: Unchecked cast from Object to HashMap   This is from a call to an API that I have no control over which returns Object:  HashMap&lt;String, String&gt; getItems(javax.servlet.http.HttpSession session) {   HashMap&lt;String, String&gt; theHash = (HashMap&lt;String, String&gt;)session.getAttribute("attributeKey");   return theHash; }   I'd like to avoid Eclipse warnings, if possible, since theoretically they indicate at least a potential code problem.  I haven't found a good way to eliminate this one yet, though.  I can extract the single line involved out to a method by itself and add @SuppressWarnings("unchecked") to that method, thus limiting the impact of having a block of code where I ignore warnings.  Any better options?  I don't want to turn these warnings off in Eclipse.  Before I came to the code, it was simpler, but still provoked warnings:  HashMap getItems(javax.servlet.http.HttpSession session) {   HashMap theHash = (HashMap)session.getAttribute("attributeKey");   return theHash; }   Problem was elsewhere when you tried to use the hash you'd get warnings:  HashMap items = getItems(session); items.put("this", "that");  Type safety: The method put(Object, Object) belongs to the raw type HashMap.  References to generic type HashMap&lt;K,V&gt; should be parameterized. I am executing my ./shell.sh which contains   eval "$(pyenv init -)" pyenv shell 3.8.2   But nothing happens. If i run this code in bash manually it works fine and shell version of python switches from 2.7.10 to 3.8.2.  I am in the right directory and I gave the .sh file execution permissions. "Compared with" vs "Compared to"—which is used when? Is only one of them correct? Are they used in different situations? Or are they interchangeable? What makes a spell being cast considered to be a {class} spell? My understanding is that when a spell is known or prepared via one of your class features, or if you cast it via a class feature, it's considered a "class spell" (sorcerer spell, cleric spell, etc.) for you. If you cast it via some method outside your class (items, etc.), it isn't considered a spell from your class.  For clarity, some class features care about whether or not a spell is a 'class' spell (emphasis mine):    Wild Magic Surge for Wild Magic sorcerers can only trigger "[...] immediately after you cast a sorcerer spell [...]". Overchannel for School of Evocation wizards can only be used "when you cast a wizard spell [...]" Empowered Evocation for School of Evocation wizards can also only be used on "[...] any wizard evocation spell you cast". Rod of the pact keeper gives a bonus "[...] to the saving throw DCs of your warlock spells".   Contrast with a feature like Blessed Healer for Life Domain clerics that just use the language of "When you cast a spell [...]", and you'll see why I believe there's an important distinction as to whether or not a spell instance is a 'class' spell.  However, comments on  made me question where my understanding of what makes a spell instance a 'class' spell comes from, and I'm not sure of a concise spot that explains it. What are the rules that govern what is or is not considered a class spell when cast?   Of particular concern is whether or not a spell is, in all instances, a class spell once you've obtained it from your class. For example, if you were a wizard that had magic missile both prepared and in your spellbook, would any instance of magic missile you cast be considered a wizard spell, even if it was cast by way of, say, a wand of magic missile? Jquery Validation for dynamically added rows that has multiple element with same name Any way to do DISTINCT ON? I'm trying to create a query like this:  SELECT DISTINCT ON (field1, field2) field1, field2, field3 FROM table1   But can't figure out how to get DISTINCT ON narrowed down to a few fields in Drupal like that. Calling $query-&gt;distinct() just seems to structure the query like this:  SELECT DISTINCT field1, field2, field3 FROM table1   I did figure out a hacky way to add what I want by adding an expression before I add any fields like this:  $query-&gt;addExpression('DISTINCT ON (field1, field2) field1', 'field1');   Which creates:  SELECT DISTINCT ON (field1, field2) field1 as field1, field2, field3 FROM table1   I'm looking for a better way to this ? Another combinatorics problem: $\sum\limits_{k = 0}^n (-1)^k \binom{2n-k}k2^{2n-2k}=2n+1$ I am dealing with problem 10F in the textbook A Course in Combinatorics by J. H. van Lint and R. M. Wilson.   Problem 10F: Prove directly the equality  $\sum\limits_{k = 0}^n {{{\left( { - 1} \right)}^k}\left( {\begin{array}{*{20}{c}} {2n - k}\\k\end{array}} \right){2^{2n - 2k}} = } 2n + 1$.  Sketch of the proof: Evaluate  $\sum\limits_{n = 0}^\infty  {\sum\limits_{k = 0}^n {{{\left( { - 1} \right)}^k}\left( {\begin{array}{*{20}{c}}{2n - k}\\k\end{array}} \right){2^{2n - 2k}}{x^{2n}}} } $. To do this, use Hint 1. Then, use Hint 2.  Hint 1: $\sum\limits_{j = 0}^\infty  {\left( {\begin{array}{*{20}{c}}{a + j}\\j \end{array}} \right){x^j} = {{\left( {1 - x} \right)}^{ - a - 1}}} ,\,\,a \in {\mathbb{Z}^ + }$.  Hint 2:  ${\sum\limits_{i = 0}^\infty  {\left( {2i + 1} \right){x^{2i}} = \left( {\frac{x}{{1 - {x^2}}}} \right)} ^\prime }$.   Attempt: It is enough to show that  $\sum\limits_{n = 0}^\infty  {\sum\limits_{k = 0}^n {{{\left( { - 1} \right)}^k}\left( {\begin{array}{*{20}{c}} {2n - k}\\ k \end{array}} \right){2^{2n - 2k}}{x^{2n}}} }  = {\left( {\frac{x}{{1 - {x^2}}}} \right)^\prime }$. But I can not use Hint 1. I have a HP MFP127fw.  It's "supported" by Ubuntu 17.10 - except print jobs will not release from the print que because a special copywrited driver for HP is not installed.  I went through this with 16.10 and had to install a small HP driver that I found with Synaptic.  Then the jobs would release. It isn't part of HPLIPS.  Apparently Ubuntu 17,10 version doesn't run synaptic due to Wayland.  Where can I find this driver? Previous posts                  As of today, the Moderator Flag Dashboard is officially graduated and the old version sent to the smelter's yard.  Based on stats from the past month, virtually all moderators were already on the new UI (thank you) so you hopefully won't notice any change.  That said, I would like to highlight the handful of improvements we made over the last month and a half based on your feedback:   A more responsive navigation bar at the top of moderator pages, improving the mobile experience. Similarly, , increasing room on the screen for the first question. . .  Not only do the headers look better, they now function better.  Now you scroll to and highlight the post/comment each time you click the link, not just the first time. .  Posts by the same user are grouped together and ordered newest first. .  We eliminated the VLQ (auto) side effect so now "Resolve all flags (auto)" doesn't do anything surprising.  If you still want to leave a comment or decline, you can do so with the buttons next to the individual flags.   Bugs and Feature Requests  Since this project is officially launched, all bugs and feature requests should be done in the form of questions tagged  on MSE, not answers on this post.  Feel free to post an answer here if you have specific concerns about the release process. How can be solved the equation $x^3+x-1=y^2$ in positive integers?    I know this equation defines an elliptic curve, but this seems to be a non-elementary way to solve this question. Is there a more elementary solution?   By the way I found three solutions: $(1,1), (2,3)$ and $(13,47)$. Is this related to the law group property of elliptic curves? Thanks for further answers. How to easily and completely disable/enable WLAN (so it cannot be turned on again while travelling)? Without going into specifics of why I might like to do this, or whether this is a good idea or not, I would like to know how I can disable use of wireless networking on my MacBook Air, either via removal of software or drivers or similar, such that the machine is unable to connect to a WIFI network in any way without I undo those changes.  The intention is for the machine to be unable to communicate wirelessly when out of the house, and for those changes to not be easily reverted until I return (for example requiring some piece of external storage that does not travel with me and which contains copies of whatever I have removed). How can I easily remove and then re-allow WIFI access (without losing my stored profiles/passwords or disturbing anything else)? Is it possible to simply copy a certain app or plugin to an external drive, delete it from my laptop, and later copy it back, again having everything as it was before?  One year later I have been happily using Daniel Lawson's solution below for quite some time now. I have created two applications with automator, one that deletes the .kext, one that restores it from an USB stick. First, copy /System/Library/Extensions/IO80211Family.kext to a USB stick and leave that stick at home. Open Automator, select to create an &quot;Application&quot;, then choose &quot;Utilities&quot; from the &quot;Library&quot;, then &quot;Execute Shell Script&quot;. (I'm translating this from my German menus, so the exact names may differ.) For the &quot;Disconnector&quot; app, enter the following into the text area of the &quot;Execute Shell Script&quot; event: echo YOUR_ADMIN_PASSWORD | sudo -S rm -rf /System/Library/Extensions/IO80211Family.kext  Replace &quot;YOUR_ADMIN_PASSWORD&quot; by your admin password. Then save the app and drag its icon to the Dock. Now, when you are sure you want to be free of all online distractions, click the app icon, and the IO80211Family.kext is gone. Just restart your laptop and you can no longer connect to WLAN:  For the &quot;Reconnector&quot; app, enter the following into the text area in Automator: echo YOUR_ADMIN_PASSWORD | sudo -S cp -r /Volumes/NAME_OF_YOUR_USB_STICK/IO80211Family.kext /System/Library/Extensions/  Replace &quot;YOUR_ADMIN_PASSWORD&quot; by your admin password and &quot;NAME_OF_YOUR_USB_STICK&quot; by the name of your USB stick. Save the app etc. Now when you return home, insert the USB stick that carries the IO80211Family.kext into your laptop, click the Reconnector app icon and then restart your laptop. Now you can connect to WLAN again. Note. There are some security issues invovled when you echo your admin password, because by that it is written to the shell history and can be found there. I don't care, but you might, depending on your circumstances. How does iCloud Photo Library's "Optimize iPhone Storage" setting work in relation to other photo apps on iOS? If I have Optimize iPhone Storage enabled on my iPhone and my phone storage is completely full, I understand that iOS will only store a low-res thumbnail of many of my photos on the device. (The full high-res version of the image will only exist in iCloud and on devices with Download and Keep Originals enabled.)  But when only thumbnails exist on the device, how does that work in relation to other photo apps on iOS? For example, do third-party cloud-based photo apps (like Google Photos, Dropbox's Carousel, or Amazon Prime Photos) have access to the full high-res images from the iCloud Photo Library? Or will they only see the low-res thumbnails in some cases?