So its been like 12-14 years since I have done any c++ development and this weekend I decided to give it a try again to prototype some gaming stuff but this error was the first one that I ran into that made no sense to me.  I had this switch statement:  void Game::handleEvents() {   SDL_Event event;   SDL_PollEvent(&event);    switch (event.type)   {   case SDL_MOUSEMOTION:     bool mouseInUiNow = isInRect(sideUiBackground, event.motion.x, event.motion.y);      if (mouseInUiNow && !mouseInUi)     {       std::cout << "mouse enter ui" << std::endl;       mouseInUi = true;     }     else if (!mouseInUiNow && mouseInUi)     {       std::cout << "mouse exited ui" << std::endl;       mouseInUi = false;     }      break;    default:     break;   } }   Which resulted in this error:  error: cannot jump from switch statement to this case label default:   After googling a little, I figured out that I needed to add braces around the case statement:  void Game::handleEvents() {   SDL_Event event;   SDL_PollEvent(&event);    switch (event.type)   {   case SDL_MOUSEMOTION:   {     bool mouseInUiNow = isInRect(sideUiBackground, event.motion.x, event.motion.y);      if (mouseInUiNow && !mouseInUi)     {       std::cout << "mouse enter ui" << std::endl;       mouseInUi = true;     }     else if (!mouseInUiNow && mouseInUi)     {       std::cout << "mouse exited ui" << std::endl;       mouseInUi = false;     }      break;   }    default:     break;   } }   However I was not really able to understand why. Knowing how to fix it is one thing but I would really like to understand the why too.  Could someone please explain to me why this is needed in this case but in other cases the braces are not needed (naively is seems like the creation of a variable bool mouseInUiNow = isInRect(sideUiBackground, event.motion.x, event.motion.y); is causing the braces to be needed, but not sure why)?

I've always wondered this - why can't you declare variables after a case label in a switch statement?  In C++ you can declare variables pretty much anywhere (and declaring them close to first use is obviously a good thing) but the following still won't work:  switch (val)   {   case VAL:     // This won't work   int newVal = 42;     break; case ANOTHER_VAL:     ...   break; }     The above gives me the following error (MSC):     initialization of 'newVal' is skipped by 'case' label   This seems to be a limitation in other languages too.  Why is this such a problem?


I already have 4 GB ram but only 2.43 GB usable in my Windows 7 32-bit OS. If I install 2 GB more with 4 GB of old RAM, is it possible to do that to increase the usable RAM size?

I upgraded my PC to 4 GB RAM and I get only 3 GB. Windows 7 32-Bit consider that I've 4 GB RAM but didn't use more than 3 GB.  Someone told me that MS Windows 32-bit doesn't support RAM larger than 3 GB.  So please is there any way to make my OS "Windows 7 32-Bit" support more than 3 GB RAM ?  *`Note: I can't move to 64-bit because I've many program doesn't work with a 64-bit OS.  Edit::  I tried what Mr. Wonsungi advised me but whenever I check this option:      Enable support for 4 GB of RAM   I get the following error:      'Cannot access to the registry key   HKEY_CLASSES_ROOT\CLSID\{E88DCCE0-11d1-A9F0-00AA0060FA31}.'   There is no "CLSID" in my registry, I don't know why!.


Wrapping up my Genji Ult project! I have the materials, the animations, and the particles down! The only thing I need to do now is to add the smoke like substance that comes off of the dragon! It definitely moves like smoke but it also is green and glows. I know how to make the smoke green, but how do I make it glow? I have tried an emission shader on both the surface and volume parts of the smoke domain's material output node! It winds up just showing the surface of the cube.  The smoke looking material coming off the dragon. I'm using blender cycles to render a smoke simulation and can color the smoke with the volume material settings but cannot make it this as an emission shader is used for surface not volume so it will just show the box as well.

I'm creating a simple fireball sprite for my game and I want to render a fire animation.  I would like to get the upper images with transparent background, but when is set the transparency on under Render -> Film one of my frames will look like lower pictures.  You can see the difference of these two images.


While writing down an algorithm, I've come to the following construct:     There are multiple for/if/while's before this one so it is quite indented.  Example code:  \usepackage{algpseudocode,algorithm,algorithmicx} \begin{document} \begin{algorithm} \begin{algorithmic}[1] \If{true} \If{$interval.start - error_{early} \leq timestamp + error_{late}$ {\bf and} $timestamp - error_{early} \leq interval.end + error_{late}$} \State \Return{$false$} \EndIf \EndIf \end{algorithmic} \end{algorithm} \end{document}   The If line is too long an I would like to break the line before or after the and. Linebreaking with \\ does not work.

I have this code:  \DeclareCaptionFormat{algor}{%   \hrulefill\par\offinterlineskip\vskip1pt%     \textbf{#1#2}#3\offinterlineskip\hrulefill} \DeclareCaptionStyle{algori}{singlelinecheck=off,format=algor,labelsep=space} \captionsetup[algorithm]{style=algori}  \begin{document}     \section{Struttura dati}     \begin{floatleft}         \captionof{algorithm}{Leggi file .gpx}\label{getgpx}         \begin{algorithmic}[1]                   \State $speed \gets computeSpeed(\linebreak gpx.track(i).segment(j).delta\_s(q), \linebreak gpx.track(i).segment(j).delta\_t(q));$             \end{algorithmic}     \end{floatleft} \end{document}   This is how code is shown:    I want the lines gpx.track....delta_s(q),,  gpx.track....delta_t(q), and ); to be indented exactly as the beginning of line 27 is. I've tried using the \indent command but the indentation space is not the same as in the rest of the document and the final result is chaotic.


I have an Efergy Elite unit that measures the watts used for any circuit its connected to. Right now I'm using it to monitor the circuit with our fluorescent light over the kitchen sink and something puzzling is happening. With just this light on, and the clock on the microwave on, it reads 73 watts. If the light is turned off, it measures 3 watts. So, logically the light is using 70 watts. But here's the thing: the bulb is a 24 inch, 20 watt fluorescent. So how could it be using 70 watts? Could it be the ballast? Or, could it be the bulb. I know this is kind of esoteric, but I'm wondering if anyone has encountered this before, and can explain it. I'm considering opening the wall switch up for the light and putting my ammeter on the hot wire to verify the Efergy reading.

Over the years we have replaced just about every bulb in the house with a CFL. But here is the problem. Our electric bill is going up and not down. When I moved here 3 years ago we spent about $140-160. As of this summer we topped $210. Electric rates have raised of course but that doesn't explain why our physical electric usage is has gone from 800 to 1100+ kwh  I purchased a Reliance Controls THP103 AmWatt Generator Appliance Wattage/Amps Load Tester to see if it was something that was busted like the compressor on the fridge that always makes noise. Sears says no and my meter suggests no.  After testing ever in the house I decided to test the CFL's. Different brands, some generic some branded. Meter said that a incandescent bulb of 40w was using 39 and a 60w was using 59. But it also said that an 11w CFL was using 45w and all of the other CFL's had similar readings.  Is this normal?


How to prove the following:  For any complex numbers $z_1,...,z_n$, there exists a subset $E$ of $\{1,...,n\}$ s.t. $$\left| {\sum\limits_{j \in E} {{z_j}} } \right| \geqslant \frac{1}{6}\sum\limits_{j = 1}^n {\left| {{z_j}} \right|} $$

I have one question about a proof in Rudin's book:  If $z_1 ..., z_N$ are complex numbers then there is a subset $S$ of  $ \{1,..., N \}$ for which $|\sum_{k \in S} z_k| \ge \frac{1}{\pi} \sum_{1}^N |z_k|$  Proof:  Write $z_k = |z_k| e^{i \alpha_k}$.   For $\phi \in [- \pi, \pi] $ let  $\ \ S(\phi):= \{ k | \cos (\alpha_k - \phi)>0 \}$.   Then $|\sum _{S(\phi)} z_k| = |\sum_{S(\phi) } e^{-i \phi} z_k| \ge Re(\sum_{S(\phi) } e^{-i \phi} z_k) = \sum_1^N |z_k| \cos ^+ (\alpha_k - \phi) $.  Could you tell me why the two equations hold (the inequality is quite obvious) and what $\cos ^+$ stands for?


I have an InfoPath form that has signature and status fields and I want to make a condition that when the signatures field is not blank, the status field will show a message.  Basically, when signer 1 done then I need status to show Ready for signer 2. And when signer 2 is done I need the status to show Ready for signer 3.  Is it possible in InfoPath designer I have difficulty to applied the action is that b/c the control is signature?  Note: My Signature is Digital signature (Not input category)

I have info path form that has signature and status field and I want to make a condition when signatures field not blank the status field will show a message.  Basically, when signer 1 done then I need status to show Ready for signer 2 And when signer 2 done I need the status to show Ready for signer 3.   Is it possible on info path designer I have difficulty to applied the action is that b/c the control is signature?


Multiple apps fail to launch from Ubuntu 17.10. When I click on some of the apps  they do not launch.  i tried doing  sudo apt install unity unity --reset-icons   when i open a application for example steam), this comes up  tar: This does not look like a tar archive xz: (stdin): File format not recognized tar: Child returned status 1 tar: Error is not recoverable: exiting now find: ‘/home/jitu/.steam/ubuntu12_32/steam-runtime’: No such file or directory

I am new to Linux and I have Ubuntu 17.04 64-bit (Budgie).  I cannot open steam. It is updated to latest version. When I open it it pops up but after some time it disappears. When I try to run it from a terminal I get this output:  tar: This does not look like a tar archive xz: (stdin): File format not recognized tar: Child returned status 1 tar: Error is not recoverable: exiting now find: ‘/home/ghazi/.steam/ubuntu12_32/steam-runtime’: No such file or directory


KDE uses suspend-to-ram by default.  How can I change it so it runs s2both instead?  I have tried  but that simply blocks my machine, whereas s2both works.  This is why I would like KDE to simply call s2both instead of doing something else.

I would like to use the hybrid suspend method instead of suspend when closing the lid or selecting "Suspend" from the menu.  I can imagine to change the pm-suspend script to do so automatically, but there might be a more maintainable / easier way.


I have basic knowledge of Java and fair amount of experience working with other OOP languages, but this code still looks very strange to me. Can you help?  public abstract class Hello {     protected static Name name;     static { /** what does this mean? **/         name = null;     } }

My question is about one particular usage of static keyword. It is possible to use static keyword to cover a code block within a class which does not belong to any function. For example following code compiles:  public class Test {     private static final int a;         static {         a = 5;         doSomething(a);     }     private static int doSomething(int x) {         return (x+5);     } }   If you remove the static keyword it complains because the variable a is final. However it is possible to remove both final and static keywords and make it compile.   It is confusing for me in both ways. How am I supposed to have a code section that does not belong to any method? How is it possible to invoke it? In general, what is the purpose of this usage? Or better, where can I find documentation about this?


If a sequence of increasing, absolutly continuous functions converges pointwise to a function f, does it follow that f is absolutly continuous? What if it converges uniformly?

Here's a question I came up randomly just now:  If a sequence of absolutely continuous functions $\{\phi_{n}\}$ converges uniformly to a function $f$, does it imply that $f$ is also absolutely continuous?  I am having trouble judging if this is true. If the statement is not true, can anybody help me find a counter-example?  Thank you!


I am typing a command, I remember I have to check something, if I press Ctrl+U the command disappears and I can type something else, but then the command I was typing is not in the history.  Is there a way to recover that command, or a different shortcut that I can press to save somewhere the command?

I often find myself in the following position: I've started typing a long command at the bash prompt, but half-way through I find out I need to check something with another command. This is a problem when I'm at the console (no X), which is often the case, because then I only have the following unsatisfactory ways to do it, that I know of:    Hit ctrl+alt+F2 and log in on another virtual console, and find out what I wanted, then go back and continue  ctrl+a, type echo + space + enter, find out what I wanted, press ↑ until I find my command, ctrl+a, del x 5, ctrl+e, and continue  Highlight what I've typed so far with my mouse (if gpm is running, which it usually is), press ctrl+c to interrupt, find out what I wanted while being careful not to use my mouse to highlight stuff, then press middle mouse button on a new prompt and continue  Pray to the command line gods that the half-written command will have no adverse effects but simply fail, and gingerly press enter, then find out what I wanted, press uparrow until I get my command back, and continue  Jump into my time machine, travel back in time and remind myself to start screen before starting to type command, travel back to the present, press ctrl+a c, find out what I wanted, press ctrl+a ctrl+a, and continue   So what I want to know is, is there some more elegant way of doing this? A sort of subshell-command or similar?  I'm most interested in methods that do not require any preparations or setup to work.


I've recently answered a question which got deleted in a few minutes after I posted my answer (and as result, my answer and all comments made by others were removed as well).  Although I enjoyed thinking about the question which was nice (it was open for a day before my answer), I somehow feel exploited by such behavior from the question owner and do not think it is in the spirit of this community by any means (it was mentioned that the question was asked by a professor for a test).  Are there any policies at Stack Exchange for such occasions?

Today I was looking at the question of this . The question was pretty simple, he was looking for the eval function in  not knowing of it's existence. He received a comment and while I was finishing reading the question, I saw him commenting      Thanks, eval() is what I was looking for.   and then he deleted his question. In my opinion, such behavior isn't appropriate. So, should I just ignore this or can I do something about it?


I've been trying to understand the following counterexample posted here:   "You only need two objects 0, 1 and a single non-identity arrow 0->1. Consider the functor from this to Set which takes 0 and 1 to the natural numbers and the arrow to the successor function. "  I don't get why the image of $0\to 1$ in $Set$, which is $0\to 1$ in $\mathbb N$ is not a category...what am I missing? All the axioms seem to check out.

On Hilton and Stammbach's homological algebra book, end of chap. 2, they wrote in general $F(\mathfrak{C})$ is not a category at all in general. But I don't quite get it. I checked the axioms of a category for the image, and I think they are all satisfied. Am I missing something? Thanks.


I am an admin trying to query all the private messages for my organization through SOAP API. I query the ChatterMessage object:  SELECT Id, ConversationId, SenderId, SendingNetworkId, Body, SentDate, CreatedById FROM ChatterMessage   where this returns the messages that is sent under the Chatter object. However, there is a chat box that does not log the messages under the object ChatterMessage. The documentation states that this object is used for private chat messages but the chat box conversations are not stored in this object. How can private chat messages be retrieved and which object contains this info? The only chatter hierarchy is related to feeds is found .

I want to monitor private message and want to check and store at admin side. so admin can see who doing message to whom and make the policy for to sending the message.


We have a mobile app project which at this moment gets very low traffic (few server hits per day) but due to potential cooperation with a big company we might soon start serving as much as 500.000 customers per month.  Our backend services are hosted at DigitalOcean (and we'd like to keep it that way as much as possible) and we have CloudFlare (free version) in front which also handles DNS and other related stuff.  The backend service is divided into 5 Node.js apps: api (serving data from the database), cdn (serving images), cms (admin content management), shared_modules (codebase shared between 4 other apps) and www (landing page for the mobile app). Currently all 5 apps are being "dockerized" within one DO droplet (Dokku-based image, the cheapest $5/mo droplet).  The most important apps are api and cdn which must always be available because they're the backbone of our mobile app.   I do understand that at least each app should get its own droplet but it's obvious that won't be enough to serve so many customers. Ideal solution would let us spin additional droplets per-request basis without much additional configuration to do so.   While I'm also aware that app optimization plays a major role when it comes to high-performance setup, at this moment I'm more interested in the server architecture aspect.  My question is what would be the most reliable (and also the cheapest) server architecture setup which would be able to serve so many customers per month?  EDIT: I disagree this question is related to the linked question simply because I'm providing specific information (numbers, technologies/services used) and I'm looking for specific solutions (the exact server-side architecture to handle high availability, high performance requirements in my case). The linked question is related to high availability, high performance in general or theory (which might be sufficient for writing a thesis) but it is NOT what I'm looking for. The linked question DOES NOT answer my question at all. If I were to look for "dry" information on high availability, high performance then I would go through Wikipedia and not ServerFault. In light of everything said I'd kindly ask you unlock this question because I'm not getting my answer from the linked question. Thanks.

This is a  about  Related:      I have a question regarding capacity planning. Can the Server Fault community please help with the following:   What kind of server do I need to handle some number of users? How many users can a server with some specifications handle? Will some server configuration be fast enough for my use case? I'm building a social networking site: what kind of hardware do I need? How much bandwidth do I need for some project? How much bandwidth will some number of users use in some application?


Read this years ago (From 50's or 60's?) in Analog about a fortified compound/outpost on an alien world where the humans were in an escalating (and failing) arms race agains the local animal/insect population.  The natives became more deadly as the humans tried to develop better defenses.  One member of the outpost crashes in another area of the planet, expecting instant death, but finds the locals there non-threatening as they were only reacting to the violence of the outpost.  Looking for title and author.

I read a book in the early 80's (sometime between 81 and 83) that I have been trying to remember the title of for a long time. I got the book from my high school librarian as a reading suggestion, so it may have been a young adult book, but I don't know.   The only think I remember about the story is one of the weapons that the "good guys" wore.   The weapon was a hand gun type of weapon that they wore in a holster that was on the forearm of their gun hand.  The weapon was somehow connected to the nerves in their wrist so that when they tensed their hand or arm in a certain way the gun jumped into their hand.


Suppose I'm helped from a question and would like to gift some points +100 to that question. There is the option to award a bounty to the answer in anyone's question. But I want to award some bounty to the question itself : it's different. So it should say gift rather than bounty. Would you consider adding this feature?

Amongst the reasons for starting a bounty, one can select:     Reward existing answer      One or more of the answers is exemplary and worthy of an additional bounty.   Why not enable one to reward excellent questions in a similar manner?


I've got a script like the following:  flag=false # Do a bunch of stuff that might set flag to true. if [[ "$flag" == "true" ]]; then    command \        | pipe_command_a \        | pipe_command_b \        | pipe_command_c \        | pipe_command_d \        > "${output_path}" else    command \        | pipe_command_a \        | pipe_command_c \        | pipe_command_d \        > "${output_path}" fi   The only difference between flag being true or false makes is that pipe_command_b may not be run. Is there a way to collapse this so that I don't have to repeat all of the common stuff?

Say I've got the following pipeline:  cmd1 < input.txt |\ cmd2 |\ cmd4 |\ cmd5 |\ cmd6 |\ (...) |\ cmdN > result.txt   Under certain conditions I would like to add a cmd3 between cmd2 and cmd4. Is there a way to create a kind of conditional pipeline without saving the result of cmd2 into a temporary file? I would think of something like:  cmd1 < input.txt |\ cmd2 |\ (${DEFINED}? cmd3 : cat ) |\ cmd4 |\ cmd5 |\ cmd6 |\ (...) |\ cmdN > result.txt


I've done some searching on this already and I think I know the answer. But I'd like to ask just to double check.  If i am not sure if the outlets are properly grounded, my best bet would be to replace the 2 prong outlets with GFCI outlets, correct? Actually, i suppose someone is going to say my best bet would be to first find out for sure if they are properly grounded or not :) Could someone suggest a relatively inexpensive tool for doing that?  If the boxes are correctly grounded, then I should be able to just replace the 2 prong outlets with regular 3 prong outlets, correct?  For right now, I mainly want to swap out a 2 prong outlet in the living room that the TV and the rest of the media/gaming stuff will be plugged in to. But there are 2 prong outlets scattered around the house that I'll probably also want to eventually replace.  I would be somewhat surprised if everything is correctly grounded since the wiring in the house is pretty old, it's all knob and tube wiring. Although the home inspector said it all looks like it's in pretty good shape. Eventually we'll have an electrician come in and replace all the wiring, but for now it's staying as is.

I have some 2-prong non-grounding type receptacles, and I'd like to replace them with 3-prong grounding type receptacles.  According to National Electrical Code, what are my options?


I am struggling with the following equation, which I need to proof by induction:  $$\sum_{k=1}^{2n}\frac{(-1)^{k+1}}{k}= \sum_{k=n+1}^{2n}\frac{1}{k}$$  $n\in \mathbb{N}$. I tried a few times and always got stuck.  Help would be appreciated.

$$\sum_{i=1}^n \frac1{n+i} = \sum_{i=1}^{2n}\frac{(-1)^{i+1}}i,\quad \text{ for }n\ge 1.$$  I really have no clue how on to solve this one. It's the last one on my assignment. Would really enjoy some help with this one.


In the switch statement, when i have a case with "||" it doesn't work properly.  $get = 'item'; switch ($get):  case 'items' || 'several-items':     echo 'items';     break;  case 'item':     echo 'item';     break;  endswitch;   This code outputs items. Is this a php bug ?  $get = 'several'; outputs items too.  So the problem is definitely with the '||' operator, because the following code works just fine:  $get = 'item'; switch ($get):  case 'items': case 'several-items':     echo 'items';     break;  case 'item':     echo 'item';     break;  endswitch;

Is there a way of using an 'OR' operator or equivalent in a PHP switch?  For example, something like this:  switch ($value) {      case 1 || 2:         echo 'the value is either 1 or 2';         break; }


I'm wondering about the concept of image hashing specifically SHA256. Like how do we do it? Can we hash the image based on the binary file? or do we need to convert the data into strings first then do normal hashing? Are there any other ways on how to hash images in C++? without using any libraries?

This might seem an impractical and unnecessary conversation, but I feel it's something I need to clarify. Especially, as I just got my first developer job in a blockchain startup.  So hashes are said to generate the same thing for any information it sees, and it's only a one-way interaction.   As far as I understand, hashes are just long alphanumeric strings. If one computes hashes across all documents, keys, information, files, etc, over and over again- it's simply a matter of time until the same combination comes up again for different information (applying it across all possible contexts)? This might be an impractical test given size and possibility, yes, but is it this that makes hashes powerful, that it's practically impossible to recreate a hash that for any foreseeable endeavor it's fine, or is there some element that I'm missing that reduces even that extremely low probability to zero? Is there any design constraint that prevents a very powerful computer to back-calculate the original data from a hash? Or is it simply that the design is so complex that it's simply a futile exercise to dream of such a large computer required for this task? What's stopping a hacker or malicious middle man to hack open the software program or library that creates this "hash" and then use that library to create hashes of his/her own or mislabel some target company's hash with his/her own pointing to their version of the file? Especially since many applications, languages, and developers use hashing independently. Whichever is most weakly secured, we can use that to take on the rest?   Any resources are also appreciated.


Here is the proof they gave: Start with the statement $a = b$. Multiply both sides by $b$ to get $ab = b²$. Subtract $a²$ from both sides to get $ab − a² = b² − a²$. Factor the left and right sides of the equation to get $a(b − a)=(b − a)(b + a)$. Now divide both sides by $b − a$ to get $a = b + a$. Finally, let $a = b = 1$ in this final result to get the statement that $1 = 2$ but that is not true. What went wrong with the proof?  I'm not sure but is the error that you are not allowed to divide by $b-a$?

I have a "proof" that has an error in it and my goal is to figure out what this error is. The proof:  If $x = y$, then  $$ \begin{eqnarray} x^2 &=& xy \nonumber \\ x^2 - y^2 &=& xy - y^2 \nonumber \\ (x + y)(x - y) &=& y(x-y) \nonumber \\ x + y &=& y \nonumber \\ 2y &=& y \nonumber \\ 2 &=& 1 \end{eqnarray} $$    My best guess is that the error starts with the line $2y = y$. If we accept that $x + y = y$ is true, then   $$ \begin{eqnarray} x + y &=& y \\ x &=& y - y \\ x &=& y = 0 \end{eqnarray} $$  Did I find the error? If not, am I close?


My apologies if the question is vague and too naive. I am totally new with the Linux commands.  We have a dedicated server with  and have several sites hosted there. Our server is running out of space.  This is what I got by running df -h in the command prompt after connecting with the server via ssh    I have little to no experience with Linux shell command. How do I figure out what is filling up the space and where the folder is located. How do I go to Home directory?   My assumption is the server is running cache . But I an't figure out where these cache is getting stored. I am not an expert with server and system administration. Please treat me as total novice in this sector.  appreciate your help

Which sequence of commands will tell me which files are the largest starting from a particular directory, including all sub directories? I want to know where all the space went.  Preferably just with regular unix'y commands.  If possible, try to keep it compatible with Sun OS 5.10 (perhaps in addition to regular Linux answers, not as a replacement, to keep it as general as possible.)


I try to show that there are infinitely many prime numbers in the set $ \{ 4n-1 \ : \ n \in \mathbb{N} \}$. I've been told that I needed to adjust Euclid's proof a bit so that it would work for numbers of this kind, so I did, but without finding something useful.    My attempts  First, I supposed that there are there are only finitely many prime numbers of the shape $4n-1$, lets say $S \ = \ \{n_1,n_2, \cdots n_t \}$. Then I took a look at this, hoping that it would be prime. $$ \prod_{1 \leq j \leq t}(4n_j -1)+1 $$ But, if $n$ is odd, the ones cancel out and $2$ would divide everything if I'm not mistaking. If $n$ is even, I guess everything would be even as well.    It seems that I misunderstood the hint. Could you give me a sketch about how this really works? You can make use of rings and groups if you need to, and you can use easy analytic stuff, but please don't use very advanced knowledge.

This is the proof from the book:     Theorem. There are infinitely many primes of the form $4n+3$.    Lemma. If $a$ and $b$ are integers, both of the form $4n + 1$, then the product $ab$ is also in this form.  Proof of Theorem: Let assume that there are only a finite number of primes of the form $4n + 3$, say  $$p_0, p_1, p_2, \ldots, p_r.$$ Let $$Q = 4p_1p_2p_3\cdots p_r + 3.$$ Then there is at least one prime in the factorization of $Q$ of the form $4n + 3$. Otherwise, all of these primes would be of the form $4n + 1$, and by the Lemma above, this would imply that $Q$ would also be of this form, which is a contradiction. However, none of the prime $p_0, p_1,\ldots, p_n$ divides $Q$. The prime $3$ does not divide $Q$, for if $3|Q$  then $$3|(Q-3) = 4p_1p_2p_3\cdots p_r,$$ which is a contradiction. Likewise, none of the primes $p_j$ can divides $Q$, because $p_j | Q$ implies $p_j | ( Q - 4p_1p_2\cdots p_r ) = 3$, which is absurd. Hence, there are infinitely many primes of the form $4n +3$.   END  From "however, none of the prime ...." to the end, I totally lost!    My questions:   Is the author assuming $Q$ is prime or is not? Why none of the primes $p_0, p_1,\ldots, p_r$ divide $Q$? Based on what argument?     Can anyone share me a better proof?     Thanks.


Beginner; novice-level problem. Here is the code that generates 30 random numbers, sorts them in ascending order, and then sorts them in descending order.  The last objective is to find duplicates in the list and remove one of them (e.g., if there are two 27's, I want to remove one and leave the other).       static void Main(string[] args)     {          Random randomNum = new Random();         List<int> numbers = new List<int>();          for (int i = 0; i < 30; i += 1)             numbers.Add(randomNum.Next(1, 100));          Console.Write("List of random numbers:");         foreach (var number in numbers)             Console.Write(" {0} ", number);          var sorted =             from number in numbers             orderby number             select number;          Console.WriteLine();         Console.Write("List in ascending order:");         foreach (var element in sorted)             Console.Write(" {0} ", element);          var sortdescending =             from number in numbers             orderby number descending             select number;          Console.WriteLine();         Console.Write("List in descending order:");         foreach (var element in sortdescending)             Console.Write(" {0} ", element);

Anyone have a quick method for de-duplicating a generic List in C#?


A PC of my family members has a super slow log in process. Once things log in, things are fine, but the login takes around a minute to two minutes which seems abnormal.  Looking at the event log, it looks like there are a bunch of events of "Event ID" 101, 103, and 108 with high "degradation times".    The trick is that a lot of the paths responsible for these events don't seem to have paths that resolve, i.e.:  - <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event"> - <System>   <Provider Name="Microsoft-Windows-Diagnostics-Performance" Guid="{CFC18EC0-96B1-4EBA-961B-622CAEE05B0A}" />    <EventID>101</EventID>    <Version>1</Version>    <Level>2</Level>    <Task>4002</Task>    <Opcode>33</Opcode>    <Keywords>0x8000000000010000</Keywords>    <TimeCreated SystemTime="2017-12-18T23:09:12.400559000Z" />    <EventRecordID>13</EventRecordID>    <Correlation ActivityID="{44BAF9B0-7854-0001-AE04-BB445478D301}" />    <Execution ProcessID="3916" ThreadID="4776" />    <Channel>Microsoft-Windows-Diagnostics-Performance/Operational</Channel>    <Computer>laptop</Computer>    <Security UserID="S-1-5-19" />    </System> - <EventData>   <Data Name="StartTime">2017-12-18T23:02:24.956664000Z</Data>    <Data Name="NameLength">6</Data>    <Data Name="Name">Devic</Data>    <Data Name="FriendlyNameLength">0</Data>    <Data Name="FriendlyName" />    <Data Name="VersionLength">0</Data>    <Data Name="Version" />    <Data Name="TotalTime">56436</Data>    <Data Name="DegradationTime">50436</Data>    <Data Name="PathLength">9</Data>    <Data Name="Path">C:\Devic</Data>    <Data Name="ProductNameLength">0</Data>    <Data Name="ProductName" />    <Data Name="CompanyNameLength">0</Data>    <Data Name="CompanyName" />    </EventData>   </Event>   How do I backsolve these to the actual entities that are failing to load in time, and speed up things?

In august 2015, I have upgrade my laptop from windows 8.1 to windows 10. But it spends always 10 minutes to boot it. It is not normal that it spends so long. What can I do for boot him faster? Below some information about my laptop.   age: +/- 2 year (on august 2015) edition: Windows 10 Home   File trace are removed.  Update:    I must also say that always there comes a windows update, I have the same problem again form slow booting. Is it good that I turn off the updates? If yes, how can I do that? Also it is in periods that my pc booting to slow. Some time it is like normal (a few seconds) and other times a few minutes. I don't know how it comes that it is fast or slow.


There are times where I just want to watch some videos on my PS4.  The system requires you to use a controller to press the PS button and pick a user account.  After that point I am able to use a wireless keyboard to navigate the menus to get to Netflix, Youtube, and other services.  Is there a way to watch videos without leaving the PS4 controller on the whole time, to help preserve battery life?

I'm trying to figure out if its possible to turn off the PS4 controller without turning off the system because it pretty much stays on the whole time I'm not gaming and obviously drains the battery pretty quickly.  On the PS3 there was always an option to turn off the controller itself so I'm wondering if I'm missing something. Anyone know if this is possible?


CREATE TABLE `contacts` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(60) DEFAULT NULL, `email` varchar(60) DEFAULT NULL, `password` varchar(60) DEFAULT NULL, `hash` varchar(60) DEFAULT NULL, `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`), UNIQUE KEY `email` (`email`), KEY `id` (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8   I created the previous table. When I try to insert with the following code duplicated data, the instruction is ignored and not inserted as expected. However, the ID is auto incremented, producing gaps among the correct insertions of data. For example, inserting through PHP:  $sql = "INSERT IGNORE INTO `contacts`(`ID`, `name`, `email`, `password`, `date`) VALUES (NULL, '$nombre', '$email', '$password', NOW())";   I would like to prevent the ID from being auto incremented when a duplicated data is tried to be inserted, so I can keep the ordered enumeration in my DB. I am asking this only because I didn´t find this specific question been asked with the aforementioned target and using INSERT IGNORE INTO...

I'm using MySQL's AUTO_INCREMENT field and InnoDB to support transactions. I noticed when I rollback the transaction, the AUTO_INCREMENT field is not rollbacked? I found out that it was designed this way but are there any workarounds to this?


How to handle a native OS (Ubuntu) file upload window in selenium in java. Can Auto-It tool be used for this? If not please let me know the tool name Please anyone help me on this... thanks in advance

This is my first time here but I have already posted this question on SO. I keep getting solutions for Windows + Java and not for Linux or python for that matter.  I am using Selenium and Python to automate a file upload application for the past many hours but nothing helpful!   The HTML DOM structure for this file upload is an input tag with its type attribute value = 'file'. I know I can make use of the send_keys.   The problem is I am not supposed to use send_keys() (as per the question I am trying to solve). The assumption is there are other ways of doing it.  Can anyone suggest me alternative ways to upload the file? I do get solutions for windows but not for Linux(Ubuntu). I know there are applications/tools to automate GUI components like AutoIt but there is nothing for Linux close to AutoIt.  I can say I have done my homework to find a solution. Only after not finding anything useful, I am asking this question, please help!


I said, “I will go to school today, not if it is snowing, if my cat is awake.” The meaning is odd, but my question is regarding the grammar of the statement. Does the “if my cat is awake” place a conditional on the main clause “I will go to school today” or does it place a conditional on the conditional “not if it is snowing” or both?

If I said, "I will run, not if it is snowing, if I my shoes are comfortable." Does the "if my shoes are comfortable" modify the "I will run" clause? I agree the sentence would be clearer with the addition of "and" in place of the comma. However, without the "and" is it still clear that the "if my shoes are comfortable" clause modifies the "I will run" clause?


I have $10$ identical coins that are to be placed at $10$ sites arranged in a ring. Assuming that the coins are placed at random, and by some chance only three coins turned out to be "up-faced". What are the number of possible ways such that none of these three "up-faced" coins are in adjacent sites?   What I tried is that there should be at least one "down-faced" coin in between two up-faced coins. Since, we have $7$ down-faced coins, all I have to find is number of ways to arrange these 7 coins such that there is at least one in between two "down-faced" coins. Note that the answer is $50$, but with my idea I get $38$. Any ideas?

If $n$ distinct objects are arranged in a circle, I need to prove that the number of ways of selecting three of these $n$ things so that no two of them are next to each other is $\frac{1}{6}n(n-4)(n-5)$.  Initially I can select $1$ object in $n$ ways. Then its neighbours cannot be selected. So I will have $n-3$ objects to choose $2$ objects from. Again, I can select the second object in $n-3$ ways. The neighbours of this object cannot be selected. However from here onwards, I am unable to extend this argument as the selection of the third object is dependent on the position of the first and the second object. Is there any simpler method to prove the result?


When I'm running a game with Play on Linux and I accidentally hit the Super key, it always opens the unity launcher and crashes my game. How can I prevent this, by disabling the super key for this program specifically? I would like to still use the key outside of Play on Linux (although I tried disabling it system-wide and that didn't work either).

Duplicate question to , which was never answered. (Which option is worse, that I repost the same question, or that I thread necro the old post?)  Anyway, is there a way to disable specific keys when specific programs are running? Or alternatively, disable Dash when a specific program is running?


Is there any way to decrypt the data which is affected and encrypted by locky ransomeware hackers. one of our companies system (windows 7) is affected. i have Ubuntu installed on my PC. please help anyone , if there is any war for the recovery.  Thanks.

I would like to help to my friend.  She opened a email, and after that, all files is transform to some encrypt format on she computer.  Every image, document extension replaced by .locky.  Now, after hours and hours searching on google I dosen't find any trusted way for she get back they files.  I hope we can find out something.  What I already tried:   Remove virus with programs: Malwerebytes, Hitmanpro, they dosen't find any result. I tried restore the system from the control panel.-Gess what, no restore points.. I tried shadowfile explorer, which capable search shadow files-No results. I tried rename files from .locky to original format like:png,jpg, etc.- Dosen't work either.   At this point I gived up, I need some help from a experted person.  We would like to target one specifick file types, images, like jpg, jpeg, png and others.  Is there anyway for we can recover this files, without for we need to pay to the hacker?  My friend does not have any backups of the files in question.


Hypothetical situation: A moderator of a site posts a terrible answer in the main (not meta) site they are a moderator of. Can they see the identities of people who downvote it?

I have always wondered, do SO/SE employees/admins have an ability to see who downvoted them? For example, I can see my own downvoted questions on .  Does this interface look like it does to me, or to everyone else, when logged in as an admin? And if it's not built-in to the interface, do those who are developers ever look it up in the DB?  If not, why are you lying? (that's a joke.)  I ask this because I think anonymous downvotes save us from taking the downvote personally.  Even at our best, sometimes it's human nature if we know the source of criticism, and I don't want anyone to take a downvote that I make personally.  And no, I'm not making any assumptions or guesses as to why one might do this, beyond that desire  to know why they were downvoted.  Simply wondering if it exists.


Bards can use a musical instrument as a spellcasting focus for bard spells.  If I have levels in both the Bard and Sorcerer classes, a musical instrument to use as a spellcasting focus, no access to an arcane focus, and a known Sorcerer spell that also appears on the Bard spell list but needs a material component (such as Invisibility), can I cast the Sorcerer spell as if it was a Bard spell? Since it is a Bard spell, I know it, and I have a spellcasting focus for it.

If I start with a Celestial Warlock with Cure Wounds and then multiclass into Bard, can I cast Cure Wounds as a Bard now, or do I have to learn the spell a second time to be able to cast it as a Bard?


I want to create bootable live Windows PE on USB stick.  I want to create it from Windows 10 installation i have.  I wonder, how can i achive that? Any instructions? Is there any special software for this?

We've got a Windows 10 installation running in an environment where it can occasionally lose power and restart. However, this sometimes leads to corruption of files.  I've had a look at Windows "To-Go" but this seems to be persistent. And I've also checked out virtualisation, but that would require us to run a non-persistent Windows 10, in another Windows 10 environment.  Is it possible to install Windows 10 as a "non-persistent live CD"? So that a user will have a seemingly fresh Windows 10, but doesn't require to re-install it at each startup?


I am using an application on Linux, Ubuntu that originally was on Windows. I am missing opengl header files that I had access to with the Windows 10 SDK.  I want to install opengl on my Ubuntu machine. I did a search for it under Ubuntu packages .  How do I know which package to install

Simple enough question: is there some shell command (or GUI method) I can use that, given the path to a file on my system, tells me what package put it there? Assuming the file did in fact come from a package, that is.  Bonus question: what if it's a file that isn't installed on my system? Is there, say, a website that will let me look up a file and see what packages, if any, provide it?


I have deleted text file using rm. Now I have to recover it.  How to recover it?

Is it possible to restore files/directories which are deleted from terminal using rm and rm -r?. If a file is deleted from graphical interface, it could be restored from trash, but how do you restore a file if it is removed using the rm utility?.


Just to clarify, I know how to use tellraw proplerly.  How do you address a player's name using tellraw? I want to make it like this:     [YOU] My name is CatsAreMeow   I want it so the CatsAreMeow part can change into anyone's name. How do you do it?

I'm trying to make a minigame where you have different kits. You step on a pressure plate and get all your armor and effects added. That's all working fine. I'm trying to make it so it places a sign above the pressure plate saying "TAKEN" "BY" "[PLAYERWHOHASTHATKIT]" In bold dark red Is this possible? I've tried /blockdata ~ ~-1 ~ {"Text3":"@p"}with all the other text I want. Is this possible?


I recently hit 3k on SO and now I can vote to close. I have an extensive flagging history with some of them are marked as waiting for review.  I had to discover that the flag from my pre-3k prevents me to vote to close. Since I have quite a few votes left, I would like to convert my flag to a close-vote at the expense of one vote.   Don't get me wrong, I don't want that all my previous flags waiting for review are automatically converted to close-votes (for example at the end of the day if there are still votes left). The questions might already have received a good correcting edit or I made a mistake when I first flagged it. Though, this should be possible on a case by case basis.

Back in April, I flagged a post as "not a real question".  The post was subsequently closed and reopened, then closed again and finally just reopened a 2nd time a short time ago.  I still firmly believe the post is not acceptable for SO, so I went to use my recently acquired close vote privilege and was greeted with the following messsage:    I specifically clicked close and not flag (and figuring I just clicked in error, I tried again and got the same message).  I do understand that, in the new closing system, flagging for closure is treated very much like a close vote (since it throws it to the close vote queue) except no vote is actually recorded.  My issue is why should by flag be counted as a close vote when I never actually voted to close.


I just came across a CSS issue. When I scroll down on the Ask Question page on Programmers, Meta Programmers, Workplace, Meta Workplace, and Meta Stack Exchange site, I see text overlapping the footer,.  The help text goes behind the footer, linked question says help text comes over footer.  Improper css :       Improper css      Improper css :      Proper CSS :     This can be reproduced in Firefox and Chrome.  This is not duplicate of  as my question says the help text goes behind the footer not over it.

When I can scroll down far enough to have the hot network questions overlap the footer (because my question is short) there is no background under the text:    Could they either be given a white background: (just disable the transparency option)    Or stop at the footer:      This also happens with the help text on some sites, as per this bug report:     Ubuntu 14.04.1 (Latest LTS Version), . Same problem with  and .  Windows 10 Pro,  and .  (Images linked to screenshot of browser)  My question is different from  because my issue is the lack of background on the footer.   I think there was a site redesign?


I'm trying to style the native "interim login" modal form for the admin area of a theme - but I don't want to wait around for it to appear. Is there a way I can trigger it with a $_GET parameter?

I'm developing a login plugin and need to test the login form that pops up after a session has expired.   I would like to see the popup appear on my request. Any hack is fine. Ideally some little javascript to run from the console.


I wanted to multiply a float number by 100 and then convert the resulting number to an integer number. My code is as follows and there is nothing complicated in it: <?php  $num = 2.3;   echo (int)($num * 100);   But the result is very strange. This code displays the number 229 while the number 230 is expected. And this is while there is no such problem for other numbers and the result is what is expected and this strange output is created only for the number 2.3 !!!

Consider the following code:   0.1 + 0.2 == 0.3  ->  false   0.1 + 0.2         ->  0.30000000000000004   Why do these inaccuracies happen?


What's the easiest way to prevent dangerous commands matching a pattern (like rm) from going into the Bash command history? I'd like to keep them away from the history of the current session, not just from the .bash_history file.

Is there any way to exclude commands like rm -rf, svn revert from being getting stored in bash history? Actually I, by mistake, have issued them a number of times even though I have no intent to do, just because I am doing things quickly and it happened. Hence results in lost of lots of work I have did so far.


I feel like I should note that I've watched the Star Wars movies as a kid, but it has been a while, and I may have missed/forgotten a lot of details along the way. Also, the movies are all I've seen. I've never read any of the books or anything like that.  I was wondering why Obi-Wan Kenobi and Yoda didn't train Luke from the time he was very young. Obi-Wan knew where Yoda was, so the two of them could have trained Luke from a very young age. They could have helped him become very strong by the time the first movie began. Why didn't they do that? Why was giving Luke to his aunt and uncle more preferable?

When Anakin was only 9 years old, everyone in the Jedi Council was arguing that he was already too old for Jedi training.  When it comes to Luke, it was a pre-planned agenda to make him a powerful Jedi. So, why did Kenobi wait for Luke to be much older? He could have started Luke's training by himself.


I was uninstalling a VIA RAID/SATA utility and accidentally removed the SATA driver in the process.  Once I restarted the computer and the uninstall took effect, XP no longer had the SATA driver in order for it to load.  I get a BSOD.  I know I can reinstall XP with the SATA drivers slipstreamed.  Is there a way to reinstall the SATA driver without reinstalling XP altogether?  Thanks.  EDIT: I decided to just restore a disk image of the partition.  Problem solved.

I have tried using nLite and downloading the "AMD SATA RAID/SATA AHCI Driver (Preinstall driver, press F6 during Windows* setup to read from floppy)" from the motherboard website and it still wont "find any hard disk drives installed in your computer".  I have tried hitting F6 and going through that but it wont load the drivers that way either  Motherboard: Gigabyte ga-ma785gm-us2h (rev 3.3) Hard drive: Western Digital Caviar black


What is the problem with this code.   \begin{frame} \frametitle{\textbf{\emph{m-way} Search Tree}} \begin{figure}  \centering  \scalebox{0.4}{ \begin{tikzpicture}   \tikzset{every matrix/.style={inner sep=-\pgflinewidth,matrix of math nodes,column sep=-\pgflinewidth,nodes={draw=red,font=\color{blue},minimum size=.75cm,anchor=center}}}   \matrix[above] (t1)  at (0,0) {18 & 44 & 76 & 198\\};   \matrix[below] (b1)  at (0,0) {\bullet & \times & \times & \bullet & \bullet\\};   \matrix[above] (t21) at (-5,-4) {7 & 12\\};   \matrix[below] (b21) at (-5,-4) {\times & \bullet & \times\\};   \matrix[above] (t22) at (0,-4) {80 & 92 & 141\\};   \matrix[below] (b22) at (0,-4) {\bullet & \times & \times & \bullet\\};   \matrix[above] (t23) at (5,-4) {262\\};   \matrix[below] (b23) at (5,-4) {\times & \bullet\\};   \matrix[above] (t31) at (-7.5,-8) {8 & 10\\};   \matrix[below] (b31) at (-7.5,-8) {\times & \times & \times\\};   \matrix[above] (t32) at (-2.5,-8) {77\\};   \matrix[below] (b32) at (-2.5,-8) {\times & \times\\};   \matrix[above] (t33) at (2.5,-8) {148 & 151 & 172 & 186\\};   \matrix[below] (b33) at (2.5,-8) {\times & \times & \times & \times & \times\\};   \matrix[above] (t34) at (7.5,-8) {272 & 286 & 350\\};   \matrix[below] (b34) at (7.5,-8) {\times & \times & \times & \times\\};   \draw[blue] (b1-1-1.center) -- (t21-1-1.north east)               (b1-1-4.center) -- (t22-1-3.north)               (b1-1-5.center) -- (t23-1-1.north west)               (b21-1-2.center) -- (t31-1-1.north east)               (b22-1-1.center) -- (t32-1-1.north)               (b22-1-4.center) -- (t33-1-2.north east)               (b23-1-2.center) -- (t34-1-3.north); \end{tikzpicture} } \vspace{-0.3cm} \caption{\emph{m-way} search tree} \end{figure}

I am having trouble getting a basic example of a matrix of notes to show up in my beamer presentation. I am using the code copied from the pgf manual. Here is a complete working example. The error I get upon compilation is:  "Package pgfbasematrix Error: Single ampersand used with wrong catcode."  \documentclass{beamer} \usepackage{tikz} \usetikzlibrary{arrows,decorations.pathmorphing,backgrounds,fit,petri,positioning,matrix}  \begin{document}  \begin{frame}  \begin{tikzpicture} \matrix (magic) [matrix of nodes] { 8 & 1 & 6 \\ 3 & 5 & 7 \\ 4 & 9 & 2 \\ }; \draw[thick,red,->] (magic-1-1) |- (magic-2-3); \end{tikzpicture}  \end{frame} \end{document}


What is the origin of the phrase "long odds"? What does the "long" refer to?

In English we say an event has "long odds" if it is unlikely to happen, and "short odds" for the opposite.  The question is why?  Best I have been able to get from people:   Long over even (if you are betting then the odds you get from the house are larger then for an even bet) Long as in something being a long way away and harder to hit/achieve/get to.


I am holding an Indian passport. Currently working in Japan. During my vacation to India, I wanted to visit Kuala Lumpur. So I booked Tokyo to Kuala Lumpur with AirAsiaX airlines and 3 days later, I have a next flight with Indigo airlines from Kuala Lumpur to India. I booked both the tickets differently. Am I eligible to get Transit Visa for those 3 days?

Quoting from   Please check whether you are eligible for Transit Visa / Pass or not. The following are conditions for the said visa / pass: (i)         Indian visitor(s) who enter / depart to / from the country from Kuala Lumpur International Airport (KLIA) and Low Cost Carrier Terminal (LCCT)  only; (ii)         Visitor must possess a valid visa (Single Entry / Multiple Entry) from the destination country (only Australia, U.S.A., China, Japan, South Korea, New Zealand and Taiwan); (iii)        Visitor must possess a valid passport / travel document with an expiry date of not less than 6 months on the date of visit; (iv)        Visitor is not listed among those barred from entering Malaysia; (v)         Visitor must be in possession of a confirmed ticket to a third country; (vi)        Visitor must be able to finance his/her stay in Malaysia; (vii)       Visitor MUST visit the country in group (package tour) and the trip is either a packaged tour in Malaysia or in the destination country; and  We are a group of 3. 2 of us will hold a tourist visa from the destination country(Japan) and one with a residence card. Are we eligible for the Transit Pass? However What does the point (vii) mean group (package tour)? should this also contain accommodation (Hotel). My plan was to book an accommodation myself and visit places on my own? Also point (vi) how are we suppose to prove our finances? As it simply states must be able to finance. Edit: I am planning to book a ticket in such a way that I can spend 24 hrs in KUL and fly to Tokyo. A night in the hotel and day to visit places. I will be booking my tickets in Malaysia Airlines


In an UNIX environment running AIX where I'm a not privileged user (without sudo) if I need to download a file from HTTPS server and there is no wget or curl... How I do it?  Is there any replacement for wget/curl?

I'm on IBM AIX 7.1 where cURL and wget are not available. Also, I'm not in a position to install either.  Are there alternatives that would be available that would enable remote API calls using GET/POST?


Sometimes, when installing things its says "dependencies" are missing.    What are dependencies?

What is the role of dependencies while installing any software?I was installing vlc player and it were closed by giving me error something like check dependency .  What is to solution of this and how i'll get these dependencies??  Thanks in Advance.


I'm doing a PhD in astrophysics and astrodynamics. Ive coursed a math degree but I'm not familiarized with statistics and analysis data. In the thesis I'm doing a lot of bayesian analysis data is required to modeling some observations and so on. Can you please recommend to me some bibliography that could help an amateur like me? Something like an introduction or whatever.   This is an article im trying to understand, for example. The part of the Bayesian model escapes me.

I'm looking for resources (books, articles, sites, etc.) to learn about Bayesian inference, but specifically applied to astronomy and astrophysics.


Let $\mathbb{F}[x]$ be a polynomial ring over a field $\mathbb{F}$. Let $I \subset \mathbb{F}[x]$ be an ideal, that is,  $\forall s,t \in I: s-t \in I$ and $\forall r \in \mathbb{F}[x]: rs,sr \in I$.  Prove that $\exists c(x) \in \mathbb{F}[x] : I = \{c(x)g(x): g(x) \in \mathbb{F}[x]\}$.  Any hints as to which $c(x) \in \mathbb{F}[x]$ I should pick and how I should proceed? Also my notes highlighted this result as particularly important... why is this? Thanks!

Let's start with a definition:     Definition: Let $F$ be a field, $I$ a nonzero ideal in $F[x]$, and $g(x)$ an element of $F[x]$. Then, $I= \langle g(x)\rangle$ if and only if $g(x)$ is a nonzero polynomial of minimum degree in $I$.   Now it gets completely foggy what is meant with "minimum degree".I constantly come across the "minimal polynomial". This seems to be linked, but it seems strange that there is a division here.   Could someone give a pointer to what the second line actually means. Maybe some example or diagram (if possible) would help a lot here.


I'm searching for a Regex to avoid letting user to enter a string with only a single ? character. Here are examples of what I want to achieve: ?        Not Ok (I want to avoid letting this) ?a      Ok a?      Ok ??      Ok ???     Ok

I don't really understand regular expressions.  Can you explain them to me in an easy-to-follow manner?  If there are any online tools or books, could you also link to them?


When I try to bevel this edge one side is much longer than the other. I realize this is because the rectangle is much longer than how tall it is but I want to be able to evenly bevel it? Can someone help me

I'm taking a course and the instructor has beveled an edge and I cannot get the same result. My bevel only bevels on segment on one side then the rest, about 4 or 5 segments bevel on the other side. Other words the bevel is not beveling evenly on the top of a cylinder. Pictures below


"And, Dick, all kinds of queer folk live in the trunk of the Faraway Tree," said Jo."   The is not capital here, which means it is not the part of the name? Why is the used here?

I was reading a paragraph about lions and I came up with a question about the definite article (the).  Let me tell you first what I know about it.     1->We use the before a singular noun (when we are sure about the noun.    And the listener and the speaker both know about it).      2->We use the before a plural noun (again when we are sure about the noun,   and we are not talking generally).   So, my question is why does the writer use the here as we are not talking about any specific lion or lions. We are talking generally.  The Paragraph:     Living in the grasslands, scrub, and open woodlands of sub-Saharan   Africa, the lion is the second largest cat in the world. It is dwarfed   slightly by the tiger, which is closely related and has a very similar   body type.    Can we re-write the paragraph something like this:     Living in grasslands, scrub, and open woodlands of sub-Saharan Africa,   lions are the second largest cat in the world. They are dwarfed   slightly by tigers, they are closely related and has a very similar   body type.


I am looking to learn Lindbladian dynamics and apply it to a system with multiple baths. Are there any texts available that only assume undergraduate Quantum Mechanics knowledge (My school offers three quantum mechanics courses, and I have done two of them)? The more concise and application oriented the text is, the better.

Recently I'm curious about the topic of  which is not talked about in common quantum mechanics textbooks, i.e. Master equation, Lindblad equation, reduced density matrix, entanglement entropy, correlation, decoherence, , ,   and so on.   Are there some good references (easy and readable or rigorous and thorough) including papers, literatures or textbooks which can elucidate these topics related to open quantum systems?


If in a group $G$ , $a^2b^2=b^2a^2 , a^3b^3=b^3a^3 , \forall a.b\in G$ , then how to prove that $G$ is abelian ? It is supposed to be some elementary manipulation but I can't figure it out , please help .

Let $G$ be a group. Assume that $a^2b^2=b^2a^2$ and $a^3b^3=b^3a^3$ for all $a, b \in G$. Prove that the group $G$ is abelian.   Also please tell me whether there is any standard approach in proving commutativity of groups like this problem.


Can somebody briefly explain the different types of grounding with examples?   Chassis ground Earth ground  Signal ground

This question stems from notations on schematics and seemingly conflicting information I'm seeing. I suspect that I'm seeing different vernacular for the same concepts--but I'm in a place where no one's ever told me that an "elevator" is a "lift". Then again, I may have the concept completely off, and need to be schooled so I don't blow up my workshop. :)  With DC: Batteries have +/- terminals. Most schematics I see show the circuit with voltage in and ground. I've heard that most schematics don't trace the return path to the negative terminal because that's understood and it doesn't need to clutter everything up. I've also heard that on a DC circuit, ground is SYNONYMOUS with the negative terminal. On schematics, I've seen V-in and ground, I've also seen V-in, ground, and a separate trace connecting to the negative terminal.   Then, we move to AC. There's a hot wire (positive), a neutral wire, and ground. I ~assume~ that in an AC circuit, positive correlates to positive, neutral to negative, and ground to ground. Transformers will correlate the +/- when changing DC.  What are the facts and what are the myths? How can I tell if I need to ground something to earth vs. "ground" to the negative terminal? When do I ground to the chassis of my device? Are there standard conventions in a schematic that would indicate GROUNDED ground vs. return-to-the-source ground? Or is that something you know from experience and doing an analysis of the circuit? Is it generally safe to assume I can connect ground to negative? Or are there cases in which that would be a Very Bad Thing, and how do I identify those cases?  Just trying to wrap my head around +/-/ground in AC vs. DC, and how that voltage is used...


My home page could be potentially linked as:  http://example.com http://example.com/ http://example.com/?ref=1 http://example.com/index.html http://example.com/index.html?ref=2  (the same page is served for all those URLs)   I am thinking about defining a canonical URL to make sure Google doesn't consider those urls to be different pages:  <link rel="canonical" href="/" /> (relative) <link rel="canonical" href="http://example.com/" /> (trailing slash) <link rel="canonical" href="http://example.com" /> (no trailing slash)   Which one should be used? I would just slap / but messing with canonical seems like a scary business so I wanted double check first.  Is it a good idea at all for defining a canonical URL for a home page?

What is the difference between these two URLs:   http://example.com/ http://example.com   Should we always add the final / or avoid it? Does it make a difference?


let $f$ be a function of bounded variation on a closed and bounded interval $[a,b]$.then $f$ is measurable.  the proof is as follows: let $f$ be a function of bounded variation on a closed and bounded interval $[a,b],$ then by Jordan's theorem , $f$ is the difference of 2 increasing functions on $[a,b].$  EDIT: I found the proof here:

Suppose that $f\colon[a, b] \to \mathbb{R}$ is a function of bounded variation. Show that $f$ is Borel measurable.  I was wondering if I could get a hint.


My URLs are currently looking like  example.com/products/123/product-name   where 123 is the product ID.  I can make them like  example.com/products/product-name   by saving the URL as unique field in the database, but does it make a real difference for SEO, and is it worth the effort?  I see Webmasters SE (this question URL) uses ID in its URL, but I guess that's because there are a lot of questions with the same title. I don't have a lot of products with the same title, but some have.

Say I have a web shop with a product (optimus-prime), in a category (superheros) such that it has the URL:  www.example.com/superheroes/optimus-prime   Now I want to prepend the product ID (99) to the product name in the URL, so that the URL becomes:  www.example.com/superheroes/99-optimus-prime   In regards to SEO, specifically Google search rankings, does it make any notable difference when using one product URL over the other?  As a programmer, I prefer using the URL with the ID in it because it makes system alias generation 100% fail safe for CMS routing purposes.


We have deleted a large part of the data from a two-digit terabyte sized database, and would now like to release some of the space back to the operating system. The database is currently about 80 % unused space. It will never reach its former size again (the load has been transferred elsewhere).  We have tried running SHRINKDATABASE on a copy of the database on a separate server (non-production). Running for 2 days (on our hardware) it was able to release the space.  I'm assuming it will take much longer on the database in production, as this is heavily used (mostly for querying now though, less so inserts).  Only hours of downtime (at a time) is acceptable on the production system. Some performance degrade over extended periods would be acceptable too.  Any ideas on how to release this amount of unused space, without having excessive downtime, or introduce severe performance degrade during the process?

This question is asked in various forms here but the question boils down to:  I know shrinking a database is risky. In this case, I've removed so much data and I'll never use it again.   How can I shrink my database? What files do I shrink?  What should my considerations be while doing this?  Should I do anything after? What if it is a large database? Can I shrink it in smaller increments?


Assuming that the  works to allow the  thumb drive to boot from an  laptop which boots with UEFI and GPT:  Open the notebook and press quickly F2 to enter the BIOS. Under the MAIN menu, enable the F12 Boot Menu option. Under the BOOT menu, select Legacy boot and press F10 Save & Exit. While the notebook is rebooting, press F2 again to enter the BIOS. Under the BOOT menu, select as your first boot option the USB HDD stick (your USB stick). Press F10 Save & Exit.   why the two step process?

To run the live AVG rescue "disk" on USB for Windows 10, how is it made to work with a GPT and UEFI system?  (Possible solution listed below.)  I enabled the boot menu so that pressing F12 will display a list to select from.  Also, I put everything USB at the top of the boot sequence and Windows and the HDD at the bottom.  However, I hadn't realized GPT and UEFI are so different from a BIOS.  Because the USB flash drive isn't compatible with GPT it's not being picked up?  This  was suggested:   Open the notebook and press quickly F2 to enter the BIOS. Under the MAIN menu, enable the F12 Boot Menu option. Under the BOOT menu, select Legacy boot and press F10 Save & Exit. While the notebook is rebooting, press F2 again to enter the BIOS. Under the BOOT menu, select as your first boot option the USB HDD stick (your USB stick). Press F10 Save & Exit.    Perhaps this will work, but what is the problem that prevents UEFI boot from registering the thumb drive?  Because it's using GPT and not an MBR?  I don't want to switch to legacy, but stay with UEFI.  The laptop:


I'm new to Kali Linux.  I'm running Kali Linux inside VMware Workstation.  I have a Ralink USB wireless NIC connected to my PC.  I want to enable Monitor mode which is simply done with the airmon-ng start wlan0 command. But there's no wlan0 adapter to be found. When I enter the ifconfig command I only see eth0 and lo:

I have Kali linux installed on Virtualbox (4.2.12) and the host OS is windows 7. I have bridged the VM with the host OS.The problem is Kali is not able to detect the WiFi interface. I searched the internet and most of the  say that the virtual machine can only identify wireless devices connected via USB and the host machine's WiFi can not be detected by VM. Assuming that it is true I am wondering how am I able to connect to the internet from the VM when the host machine is only having an active WiFi connection and no wired connection? Any insights? P.S. I do not have the privilege to create a tag that is why I am tagging this with backtrack.


I solved this series $$\sum_{n=2}^\infty \frac 1 {n^2\ln n}$$ wit Condensation Test and I got now $$\sum_{n=2}^\infty \frac{1}{2^nnln(ln(2))}$$  Can I use now a geometric series like $\sum_{n=0}^\infty \frac 1 {2^n}$ with comparasion test for say that  $\frac{1}{2^nln(ln(2))}<\frac 1 {2^n}$ and get the conclusion that the series is Convergent?  Thanks

How tipe are this series?  $$\sum_{n=2}^\infty \frac 1 {n^2\ln n}$$ But $$\sum_{n=2}^\infty \frac 1 {n\ln n\ln(\ln n)}$$ I used Condensation Test, but I stack after that. Thanks!


$ df -i /mnt/large_linux/ Filesystem       Inodes   IUsed    IFree IUse% Mounted on /dev/sda1      29376512 1035086 28341426    4% /mnt/large_linux $ df /mnt/large_linux/ Filesystem     1K-blocks      Used Available Use% Mounted on /dev/sda1      462509952 451315844         0 100% /mnt/large_linux $ sudo dumpe2fs /dev/sda1 | grep -i reserved dumpe2fs 1.42.12 (29-Aug-2014) Reserved block count:     5875200 Reserved GDT blocks:      995 Reserved blocks uid:      0 (user root) Reserved blocks gid:      0 (group root)   Reserved GDT blocks at 30-1024   Reserved GDT blocks at 32798-33792   Reserved GDT blocks at 98334-99328   Reserved GDT blocks at 163870-164864   Reserved GDT blocks at 229406-230400   Reserved GDT blocks at 294942-295936   Reserved GDT blocks at 819230-820224   Reserved GDT blocks at 884766-885760   Reserved GDT blocks at 1605662-1606656   Reserved GDT blocks at 2654238-2655232   Reserved GDT blocks at 4096030-4097024   Reserved GDT blocks at 7962654-7963648   Reserved GDT blocks at 11239454-11240448   Reserved GDT blocks at 20480030-20481024   Reserved GDT blocks at 23887902-23888896   Reserved GDT blocks at 71663646-71664640   Reserved GDT blocks at 78675998-78676992   Reserved GDT blocks at 102400030-102401024   However I have plenty of free space:  $ pydf -k Filesystem      Size      Used    Avail Use%         Mounted on                 [omitted] /dev/sda1  462509952 451315844 11177724 97.6 [#####] /mnt/large_linux      I've also tried running sudo tune2fs -m 0 /dev/sda1, to no avail.

I have file servers which are used to store files. Files might reside there for a week, or for a year. Unfortunately, when I remove files from the server, df command doesn't reflect the freed up space. So eventually, the server gets filled up (df shows 99%), and my script doesn't send any more files there, except there might be a few dozen GB of free space on there.   I got noatime flag on the mounted partitions if that makes any difference.


An object of mass 1 kg at rest experiences a force of 1 N in space with no resistance force. What will be the speed of the object after 20 years?  If I go with the high school physics. F=ma ; gives the acceleration of 1 m/s^2. And v = u + at; gives me v = 0 + 1 * 20 * 365 * 24 * 60 * 60 = 6.3 x 10^8 m/s (which is ~2 times speed of light) I am sure something is wrong here, but I am not able to find the theory behind it.

I'm in a freshmen level physics class now, so I don't know much, but something I heard today intrigued me. My TA was talking about how at the research facility he worked at, they were able to accelerate some certain particle to "99.99% the speed of light". I said why not 100%, and I didn't quite understand his explanation, but he said it wasn't possible. This confused me. Since the speed of light is a finite number, why can we go so close to its speed but not quite?  Edit: I read all the answers, and I think I'm sort of understanding it. Another silly question though: If we are getting this particle to 99.99% the speed of light by giving it some sort of finite acceleration, and increasing it more and more, why cant we increase it just a little more? Sorry I know this is a silly question. I totally accept the fact we cant reach 100%, but I'm just trying to break it down. If we've gotten so close by giving it larger and larger acceleration every time, why cant we just supply it with more acceleration? And how much of a difference is there between 99.99% the speed of light, and the speed of light? (I'm not really sure if "difference" is a good word to use, but hopefully you get what I'm asking).


The start of this question is copied from . And stems from the first comment underneath.     Just now while installing Windows 7 from a bootable USB which wasn't   successfully because of some bizarre Select driver to be installed.   issue, before the setup had even started, after which I thought of   connecting my passport drive which has Ubuntu on it to check what was   wrong, which too didn't boot because of (no the Ubuntu wasn't   corrupted I checked it elsewhere, worked fine).   The main question:  I have tried all the driver that were at my disposal, no use. Any solutions?  Bonus question:  What is the technical reason behind it? Detailed would be much appreciated

I just bought a new config ( ASUS p8z68-v lx, i5-2500k + ram and new graphic card ). Coming back and installing it in my old computer, I just saw that my DVD player was on IDE (yup…).  So, I needed to install windows 7 64bits from my usb key. Fine, I made my usb key bootable and copy the official DVD on it (the same version that was on my old computer), set BIOS to boot on it first and started the computer up.  It worked fine until it asks me for cd/dvd drivers (which is funny since, I do it via USB because I can't plug in my DVD player :D) I have 3 SATA HDD plugged in and that's it.  I made a small google search and found that it could be SATA or RAID drivers. Fine, I took another USB KEY and put all my motherboard drivers on it (from the CD sold with the MB) and none of those drivers seemed to work. I tried downloading new drivers from ASUS website and same effect.  Any idea but no "buy a new DVD player", I'm now broke for the month :) ?


I have mistakenly deleted my movies using root rm -rf /home/username/Videos/movies. How can i recover it, I have already installed extundelete and am using ext4 and its mounted at /dev/sda

Are there any tools, methods, incantations to recover recently deleted files on Ubuntu?  If it makes any difference, I want to recover a  2.x database file. But would be better to have a method/tool that works on any kind of file.


I'm using bash shell.  I want to parse a CSV file, in which the CSV file observes true CSV formats.  From this thread --  , I got this  #!/bin/bash  file_path=$1 echo $1  while IFS=, read -r ID name address zipcode do     echo "I got:$ID|$name|$address|$zipcode" done < $file_path   However, in a CSV file, since some cells might themselves contain a comma, there are quotes around those items.  So the below file doesn't parse properly  1,1871,"222 W. Merchandise Mart Plaza, Suite 1212",60605   Is there a way to modify the above script (or produce a new one) in which a CSV file can be accurately parsed?

I work with CSV files and sometimes need to quickly check the contents of a row or column from the command line.  In many cases cut, head, tail, and friends will do the job; however, cut cannot easily deal with situations such as  "this, is the first entry", this is the second, 34.5   Here, the first comma is part of the first field, but cut -d, -f1 disagrees. Before I write a solution myself, I was wondering if anyone knew of a good tool that already exists for this job.  It would have to, at the very least, be able to handle the example above and return a column from a CSV formatted file.  Other desirable features include the ability to select columns based on the column names given in the first row, support for other quoting styles and support for tab-separated files.  If you don't know of such a tool but have suggestions regarding implementing such a program in Bash, Perl, or Python, or other common scripting languages, I wouldn't mind such suggestions.


In a quest for understanding RAM requirements of system processes, I arrived to analysis of /proc/pid/maps.  I have noticed a pattern: many shared libraries have exactly 60KB space allocated in their virtual memory right after the code, with permissions ---p, meaning non-executable, non-writable, non-readable and private.  My guess is that it is not the .text .data or .bss sections of the shared library because it is not r/w/x.  What is it? can it be reduced?  When using /proc/pid/smaps to further dive in,  I haven't seen it in RSS (Resident Memory), so one can claim that it is of no importance to RAM use.  I tried to relate it to the executable or shared library sections by using objdump or readlef, but I could not find a section that's 60KB.  For example:  76d2d000-76d94000 r-xp 00000000 1f:00 439        /lib/libc.so.0 76d94000-76da3000 ---p 00000000 00:00 0     (What's that?) 76da3000-76da4000 r--p 00066000 1f:00 439        /lib/libc.so.0 76da4000-76da5000 rw-p 00067000 1f:00 439        /lib/libc.so.0 76da5000-76dab000 rw-p 00000000 00:00 0

Why does /proc/pid/maps contain a few records for the same library ? Here is an example:  7fae7db9f000-7fae7dc8f000 r-xp 00000000 08:05 536861                     /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.20 7fae7dc8f000-7fae7de8f000 ---p 000f0000 08:05 536861                     /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.20 7fae7de8f000-7fae7de97000 r--p 000f0000 08:05 536861                     /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.20 7fae7de97000-7fae7de99000 rw-p 000f8000 08:05 536861                     /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.20   What does this mean ?


If a filter's group delay is N, the filtered signal using this filter is sig_filtered, what does sig_filtered[N::] mean in python? I saw other usages of this python operator "::", e.g. A[::3] in another post (), where A is a list. Can somebody give out a summary on how to use this python operator "::"?

I need a good explanation (references are a plus) on Python's slice notation.   To me, this notation needs a bit of picking up.   It looks extremely powerful, but I haven't quite got my head around it.


just wondering if anybody knows what's the problem. I use the brightness bar control with my keyboard or in options, the computer shows me the brightness bar increasing or decreasing but the screen is still at max brightness.  My computer is: Gateway NV51M  CPU: Intel Pentium processor T4500  Graphic Card: Intel GM45 Express Chipset  OS: Ubuntu 15.10 64 bit    Please if anybody can help me, I'm frustrated :(

This morning I found that I cannot change the brightness of my Dell XPs 13 laptop's display anymore. I tried the following to change the brightness   Use keyboard brightness keys Run the commands shown below Boot with kernel option acpi_backlight=vendor. This resulted in a dell_something folder being present in the /sys/class/backlight folder. Changing the brightness file in that folder does not help. Add 'intel_backlight' to xorg.conf Set "load legacy option ROM" BIOS option to enabled and "secure boot" to disabled Boot with kernel option i915.disable-pch_pwm=0 Boot from a fresh Ubuntu 12.04 USB stick installation. I can still not control the brightness. This is strange as the laptop came preinstalled with 12.04. Maybe this a hardware problem? Install latest intel video driver   Any ideas why this broke suddendly? I've upgraded from 12.04 to 14.04 in April and till yesterday the brightness keys were working fine.  Thanks!  echo 100 > /sys/class/backlight/intel_backlight/brightness echo 100 > /sys/class/backlight/acpi_video0/brightness


This showed up as the background on my Windows 10 desktop:    Does anyone know where the photo was taken?

Windows 10 has an extensive collection of lock screen photos, many of which have  here on Travel.SE.  Is there a website which lists the location of all of these photos? I imagine Microsoft has purchased an official license, so they should have a record about the photographer and the place where the photo was taken.


I plan to use the terminal to modify the file permissions in the folder in batches. command like it chmod +x /users/abc/123/*.py  But I had some problems, there are a few special files I cannot move it, at the same time, I don’t want to modify its permissions, so I want to skip some specified files when executing this command. So can I add anything to this command to skip the modification of the specified file? Maybe this is a very simple question, forgive me for being so stupid. If it is not feasible in the end, I plan to make a sh file, and avoid it by temporarily renaming it. sh command line like mv /users/abc/123/456.py /users/abc/123/456.pybak chmod +x /users/abc/123/*.py mv /users/abc/123/456.pybak /users/abc/123/456.py  But I still hope to solve it more simply.

I want to exclude some large content directory  I'm Using it to chown Directory  chown -R admin /home/admin/web/public_html   is there anyway to exclude a subdirectory under html  Like:  chown -R admin exclude=/home/admin/web/public_html/content /home/admin/web/public_html   Something like that  Thanks


I managed to get ubuntu installed on the extra hard drive. But I can't log in. it shows my username, then login If I type the username it then takes me to the password. It will not allow me to enter a password.  I guess I need to know what information to type in after login, so it will allow me to type in the password I set up. Or I need to know how to change my user name, and password.   Otherwise, I need to know how to remove ubuntu from the hard drive, and format that hard drive. Still waiting to have somebody explain to me how to download the Live CDs and have them boot so that I can try the programs before installing it or them to the extra hard drive.

When I'm about to install a program in the terminal it wants the password:  [sudo] password for xxx:   But when I start to type my password nothing happens. What should I do?


I have a new ASUS ZenBook UX533F with Ubuntu 19.04. Initially, battery life was excellent, heat was low and suspend worked properly.  I was trying to find a way to limit the battery charge to 80% to extend the life of the battery, so:   I installed tlp and tlp-rdw.   However, sudo tlp-stat --battery reported that I could not set thresholds for charging:  natacpi    = inactive (no kernel support) tpacpi-bat = inactive (laptop not supported) tp-smapi   = inactive (laptop not supported)   Foolishly, I thought that if I could get kernel support for natacpi, I would be able to use this feature, so I did:   sudo apt install acpi-call-dkms - had read somewhere that this would make the feature work.   When I did that, it told me that it needed to "register" something on the BIOS or UEFI (I did not understand what it meant - I saw the word "MOK" somewhere).   It was too late!  Now, my battery life is much lower, my laptop is constantly overheating and it even produces a high level of heat when it is suspended.  I have already verified that the laptop enters suspend:  Oct 03 11:21:15 myuser kernel: PM: suspend entry (s2idle)  Did I ruin my new laptop? Somebody help!!!

This was working perfectly on 17.10 but after upgrading to 18.04 yesterday, when the lid is closed the screen turns off but doesn't suspend properly.  I travel around a lot and immediately noticed the heat (and battery draining) when taking it out of the travel case.  I've tried uncommenting these lines in /etc/systemd/logind.conf  HandleLidSwitch=suspend HandleLidSwitchDocked=suspend   and restarted but didn't make any difference.


I'm recovering a server from getting hacked and there is one thing I can't fix:  When I ssh (or scp) to the server, no matter what password I give, it lets me log in. I don't know much about the ssh protocol but I'm pretty sure it's not supposed to do that.   I've checked in the sshd_config file and the only changes are the ones that I've made (as far as I can remember).   Another thought that I had was that there might be something screwed up in the /etc/passwd file that I'm missing. Has anyone seen this?

This is a  about Server Security - Responding to Breach Events (Hacking)   See Also:                  Canonical Version I suspect that one or more of my servers is compromised by a hacker, virus, or other mechanism:   What are my first steps? When I arrive on site should I disconnect the server, preserve "evidence", are there other initial considerations? How do I go about getting services back online? How do I prevent the same thing from happening immediately again? Are there best practices or methodologies for learning from this incident? If I wanted to put a Incident Response Plan together, where would I start? Should this be part of my Disaster Recovery or Business Continuity Planning?   Original Version       2011.01.02 - I'm on my way into work at 9.30 p.m. on a Sunday because our server has been compromised somehow and was resulting in a    attack on our provider. The servers access to the Internet   has been shut down which means over 5-600 of our clients sites are now   down. Now this could be an FTP hack, or some weakness in code   somewhere. I'm not sure till I get there.      How can I track this down quickly? We're in for a whole lot of   litigation if I don't get the server back up ASAP. Any help is   appreciated. We are running Open SUSE 11.0.            2011.01.03 - Thanks to everyone for your help. Luckily I WASN'T the only person responsible for this server, just the nearest. We managed   to resolve this problem, although it may not apply to many others in a   different situation. I'll detail what we did.      We unplugged the server from the net. It was performing (attempting to   perform) a Denial Of Service attack on another server in Indonesia,   and the guilty party was also based there.      We firstly tried to identify where on the server this was coming from,   considering we have over 500 sites on the server, we expected to be   moonlighting for some time. However, with SSH access still, we ran a   command to find all files edited or created in the time the attacks   started. Luckily, the offending file was created over the winter   holidays which meant that not many other files were created on the   server at that time.      We were then able to identify the offending file which was inside the   uploaded images folder within a  website.      After a short cigarette break we concluded that, due to the files   location, it must have been uploaded via a file upload facility that   was inadequetly secured. After some googling, we found that there was   a security vulnerability that allowed files to be uploaded, within the   ZenCart admin panel, for a picture for a record company. (The section   that it never really even used), posting this form just uploaded any   file, it did not check the extension of the file, and didn't even   check to see if the user was logged in.      This meant that any files could be uploaded, including a PHP file for   the attack. We secured the vulnerability with ZenCart on the infected   site, and removed the offending files.      The job was done, and I was home for 2 a.m.            The Moral   - Always apply security patches for ZenCart, or any other CMS system for that matter. As when security updates are released, the whole   world is made aware of the vulnerability.   - Always do backups, and backup your backups.   - Employ or arrange for someone that will be there in times like these. To prevent anyone from relying on a panicy post on Server   Fault.


I would like to find out on the console if my processor is 64 bit capable.  I can find out that I have installed the 32 bit version of Ubuntu with  uname -a   If it doesn't contain 64 at all, then I know I have a 32 bit kernel.  But how can I find out if I could install the 64 bit version as well?

I am on Ubuntu and I did this command:  $ uname -a Linux slabrams-desktop 2.6.32-29-generic #58-Ubuntu SMP Fri Feb 11 19:00:09 UTC 2011 i686 GNU/Linux   Does it mean I am on 32bit or 64 bit processor?  The reason I am trying to figure this out is that I was getting errors which looked like this:  cannot execute binary file   and from Googling, I thought it was a processor issue.  Any ideas?


Fermat's little theorem states that if $p$ is a prime number, then for any integer $a$, the number $a^{p}-a$ is an integer multiple of $p$. In the notation of modular arithmetic, this is expressed as $$ a^{p} \equiv a \quad(\bmod p) $$ Using Little Fermat Theorem: find all solutions: $x^{14} \equiv 9(\bmod 13)$ I'm having first experience with non linear congruences so i would be glad if somebody explained my how to make progress with that.

Let $p$ be a prime. Show that for all integers $x$, $x^2\equiv 1 (\text{mod} \ p) $ if and only if $x \equiv 1 (\text{mod} \ p)$ or $ x \equiv p-1 \ (\text{mod} \ p ). $    I know that I have to prove this both forward and backward. I'm not really sure where to begin


Is there a way to save all bash commands from all terminals to a single file? By default, different terminals have different history and that gets confusing. I'd like to save all history to a single file and optionally look up those commands instead? Perhaps shift+uparrow could look up in the history in the central file?

I consistently have more than one terminal open. Anywhere from two to ten, doing various bits and bobs. Now let's say I restart and open up another set of terminals. Some remember certain things, some forget.  I want a history that:   Remembers everything from every terminal Is instantly accessible from every terminal (eg if I ls in one, switch to another already-running terminal and then press up, ls shows up) Doesn't forget command if there are spaces at the front of the command.   Anything I can do to make bash work more like that?


I would like to modify a char by shifting it (and thus changing its value) and the return the result instead of that previous char: #include <stdio.h> #include <stdlib.h>  int main(){     char * str = calloc(4, sizeof(char));     printf("what bit to set [0-31]\n");     int a;       scanf(" %i", &a);     int byte = a/8;     int offset = a%8;          str[byte] = (str[byte] >> offset) & (char)255; //how to return the modified char?           for(int i =0; i<4 ; i++)     {         for (int j =0; j<8 ; j++)             printf("%i", (str[i] >> (7-j)) & 1); //print the results         printf("\n");     } }  output: what bit to set [0-31] 20 00000000 00000000 00000000 // I want 00001000 00000000

How do you set, clear, and toggle a bit?


I recently got a microSD card for a music player, I've tried to mount this on my computer to transfer music but have got the following error:  Unable to mount 127 GB Volume     Error mounting /dev/sdb1 at /media/blank/9C33-6BBD: Command-line `mount -t "exfat" -o "uhelper=udisks2,nodev,nosuid,uid=1000,gid=1000,iocharset=utf8,namecase=0,errors=remount-ro,umask=0077" "/dev/sdb1" "/media/blank/9C33-6BBD"' exited with non-zero exit status 32: mount: unknown filesystem type 'exfat'   I'm trying to mount the microSD via a usb adapter - I've tried 2 different adapters with no difference. My system is Ubuntu 14.04.  I've run   lsusb sudo fdisk -l    and the results are:      blank@blank:~$ lsusb Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 002 Device 006: ID 0420:1307 Chips and Technologies Celly SIM Card Reader Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 011 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 010 Device 002: ID 04d9:0499 Holtek Semiconductor, Inc. Optical Mouse Bus 010 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 009 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 008 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub blank@blank:~$ sudo fdisk -l [sudo] password for blank:     Disk /dev/sda: 1000.2 GB, 1000204886016 bytes 255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x4eb6e04c     Device Boot      Start         End      Blocks   Id  System /dev/sda1   *          63   212700599   106350268+   7  HPFS/NTFS/exFAT /dev/sda2       212701184   391024639    89161728   82  Linux swap / Solaris /dev/sda3       391026686  1953523711   781248513    5  Extended /dev/sda5      1919977472  1953523711    16773120   82  Linux swap / Solaris /dev/sda6       391026688  1919977471   764475392   83  Linux  Partition table entries are not in disk order  Disk /dev/sdb: 127.0 GB, 126968922112 bytes 255 heads, 63 sectors/track, 15436 cylinders, total 247986176 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000     Device Boot      Start         End      Blocks   Id  System /dev/sdb1           32768   247986175   123976704    7  HPFS/NTFS/exFAT   Any pointers as to what the issue is and how I can resolve it?

When trying to mount an exfat filesystem, I get the following error:  Error mounting /dev/sda6 at /media/gkp/Backup: Command-line  `mount -t "exfat" -o "uhelper=udisks2,nodev,nosuid" "/dev/sda6" "/media/gkp/Backup"'  exited with non-zero exit status 32: mount: unknown filesystem type 'exfat'   Exfat is used on some USB sticks and camera sd cards. What can I do to mount this type of filesystem?


I need to evaluate $$\int_0^\infty \frac{\cos(x)}{\cosh(x)} dx $$  through Residue Theory, but it has an infinite number of poles in x=(2n+1)pi/2, I couldn't find the way to the solution that is $$\frac{\pi\ }{2 \cosh \ (\pi\ /2)}.$$  I tried also the Method of the Fourier Integral, but couldn't find the answer too. I'm in this question for over 1.5h and  have a test tomorrow, can someone help me?

How can I evaluate$$\int_{-\infty}^\infty \frac{\cos x}{\cosh x}\,\mathrm dx\text{ and }\int_0^\infty\frac{\sin x}{e^x-1}\,\mathrm dx.$$ Thanks in advance.


I have created a custom .desktop file to launch Chrome in dark mode.   Here is what the file looks like:  [Desktop Entry] Name=Dark Chrome Exec=google-chrome-stable --enable-features=WebUIDarkMode --force-dark-mode Terminal=false Icon=/opt/google/chrome/product_logo_64.png Type=Application   I have added it to the dock. When I launch the application from the dock it creates another separate chrome icon rather than just attaching the process to the existing icon (as a regular application behaves)  How can I get it to behave like a regular application icon?

I'm using Ubuntu 17.10 with GNOME shell and Numix-Circle icon theme.   When I hover over the Numix icon for Nightly Web Browser, which is pinned to the dock I get the title "Nightly Web Browser".      But when I launch the program, another icon pops up at the bottom, with the name "Nightly".


I am receiving a query via a configuration file in unix, for ex. Config file content will be in the format:  Table_name|query  ABC|select ABC.A,ABC.B from PQR left join (select * from ABC) on ABC.pk=PQR.pk   I am trying to process query part as below :      while read line in config_file     do         query=`echo $line|awk -F "|" '{print $1}'`         result=hive -e "$query"         ...   However the '*' in query variable is getting expanded to the listing of files in the current directory  Could you please help how to escape the * character, i searched for the solution but could not find one.

Or, an introductory guide to robust filename handling and other string passing in shell scripts.  I wrote a shell script which works well most of the time. But it chokes on some inputs (e.g. on some file names).  I encountered a problem such as the following:   I have a file name containing a space hello world, and it was treated as two separate files hello and world. I have an input line with two consecutive spaces and they shrank to one in the input. Leading and trailing whitespace disappears from input lines. Sometimes, when the input contains one of the characters \[*?, they are replaced by some text which is is actually the name of files. There is an apostrophe ' (or a double quote ") in the input and things got weird after that point. There is a backslash in the input (or: I am using Cygwin and some of my file names have Windows-style \ separators).   What is going on and how do I fix it?