I am using Hp laptop with pre-installted Windows 8 operating system. I have upgraded my windows 8 to windows 8.1 recently. My question is can i install ubunutu in my laptop. Please replay and help me to find a soluton.

I'm absolutely new to Linux. I would like to know how to install Ubuntu alongside the pre-installed Windows 8+ OS.  Should I do it with Wubi, or through the Live USB/DVD?  What steps do I need to take to correctly install Ubuntu?


Some time ago on an older computer running Ubuntu I noticed the output on a virtual console (e.g. tty1) is slow. It wasn't an issue there and barely even noticeable.  But now on my new laptop with Manjaro Linux (derived from Arch) it's sometimes ridiculously slow. I think it's different than the situation , therefore my question is not a duplicate. I suspect graphics acceleration issue.  I found out that the issue is heavily affected by the processor clock speed.  shows how it looks like at 800 MHz.  Possibly relevant info from dmesg:  [    0.474770] PCI-DMA: Using software bounce buffering for IO (SWIOTLB) [    0.478826] vesafb: mode is 1920x1080x32, linelength=7680, pages=0 [    0.478827] vesafb: scrolling: redraw [    0.478828] vesafb: Truecolor: size=8:8:8:8, shift=24:16:8:0 [    0.478843] vesafb: framebuffer at 0xa0000000, mapped to 0xffffc90001000000, using 8128k, total 8128k [    0.661095] Console: switching to colour frame buffer device 240x67 [    0.842325] fb0: VESA VGA frame buffer device [    2.301199] fb: switching to inteldrmfb from VESA VGA [    2.363655] fbcon: inteldrmfb (fb0) is primary device [    2.363698] Console: switching to colour frame buffer device 240x67 [    2.363705] i915 0000:00:02.0: fb0: inteldrmfb frame buffer device   The scrolling: redraw part looks interesting, though I'm not sure it means anything, since it says switching to inteldrmfb from VESA VGA.  Output of fbset -i:    mode "1920x1080"      geometry 1920 1080 1920 1080 32      timings 0 0 0 0 0 0 0      accel true      rgba 8/16,8/8,8/0,0/0  endmode   Frame buffer device information:      Name : inteldrmfb      Address : 0xa0000000      Size : 8294400      Type : PACKED PIXELS      Visual : TRUECOLOR      XPanStep : 1      YPanStep : 1      YWrapStep : 0      LineLength : 7680      Accelerator : No   Some additional tests to document the difference:   time python -c "for i in range(100): print(\"hi\")" shows me 0.03s on xfce4-terminal and 0.23s on a virtual console. time echo -e "\033c" 0s on xfce4-terminal and 0.14s-0.16s on a virtual console. time man gpm (and pressing Q while it opens up) instantly on xfce4-terminal, 3s-4s on a virtual console.    This is especially frustrating while scrolling through man pages. Interestingly nano doesn't seem to be affected by this.  How to make my virtual consoles render text with decent speed?

So I have a program written in C++.  It can tell me how long it took to do all the calculations and it does a lot of quite heavy, multi-threaded calculation.   I've just noticed that if I run the program on the exact same machine, it takes around 20-21 seconds to do all the calculations if started from the TTY, and only about 0.2 seconds if I start it from GNOME terminal.  What is causing that? It's literally the exact same file on the same machine.


Background Recently my phone got stolen from my pocket and then I was almost thrown in street and run over by a car. The police won't move a finger because of a new law, which means I'll have to wait for over a year to get it back, but of course I did file a complaint with all the documents regarding the ownership of the phone. Question Is there any possibility of tracking your phone considering the fact that you have no pre-installed or rooted app and even if you do have it they can do factory reset/boot or do a full wipe? Can you track your IMEI or is there a service that could track it for you?

I realize this is a long shot, but my phone was lost or stolen a few hours ago.  At the time it was stolen, I didn't have any specific applications installed to track it or wipe the data. So... my bad. I'm hoping the fact that I have a pattern lock will at least prevent anyone from accessing my data.  My question is, do I have any options for tracking or data wipe after the fact? (I'm more interested in tracking.)  Note: I have read similar questions, but unless I'm mistaken, they all address the question in terms of preparation before losing the phone. I'm asking about fallback options after losing the phone.


I want to open corresponding folder in file explorer. I tried to get the command for that. For example, let's say my current terminal address is   dkp@DKP:~/Documents$   Now, i want to open Documents in file explorer, if there is any way or command to do so.  Reverse(and other) question :- I was also wondering if there is any short-cut key for right-key -> open in terminal.  Thanks, peace.

I was wondering if anybody knew a command that would allow me to open a Nautilus (if that's the right name for the Ubuntu graphic/window explorer) window from the command line at the current directory that the user is at.  So, if I open a command line, and type:  cd /home/myUser/some/long/path/to/a/directory   Then, I'd like to be able to issue some command:  nautilus open-sesame   And have a graphic window opened to /home/myUser/some/long/path/to/a/directory. Is this even possible?


Let $n$ be the number of vertices of $G$. Recall that $G'$ denotes the complement of $G$. Show that   a) $n \leq \chi(G)\chi(G')$ and therefore,   b) $\chi(G') + \chi(G) \geq 2\sqrt n$.   This question was on my graph theory exam and I didn't know how to approach solving it.  Any tips on how to approach this would be greatly appreciated!

Is there any relation between the chromatic number of a graph $G$ and its complement $G'$ that are always true?  I saw these ones: $\chi(G)\chi(G')\geq n$ and $\chi(G)+\chi(G')\geq 2n$,  but I'm not pretty sure about them.


Is it possible to have one mouse pointer for two computer systems?  It's like dual screening, but each screen is assigned to a different computer.  The OP of the indicated "answered before" asks for a hardware switch solution, this is totaly different.

I have two computers set up next to each other - one Mac and one PC. Is there a mouse out there (Bluetooth, perhaps?) that I can use on both - one computer at a time - without linking the desktops? I'm thinking maybe a mouse that has a side toggle that switches which machine it's hooked up to at any given time. Doable?


I was about to spend the next 3 hours playing CSGO, but the Steam client wouldn’t launch. I tried launching it from the command line interface, but there was an error saying that ~/.steam/error.log was read-only. I then performed chmod 666 on the file to yet again encounter the same error. Frustrated, I tried to open up Discord and I got a similar read-only file error bug. Then, I realized almost all my files were read-only, so I decided to restart my computer. Upon restarting, I found this 1st error.     I therefore decided to go into my BIOS and turn TMP state to disabled. I then booted my computer up once again and found this 2nd error, which is where we are at now.     I am totally stumped as it looks like it seems to be a bad drive superblock and I don't know how to fix it.

I dual boot Ubuntu and Windows 7. I was browsing on FireFox in Ubuntu and all of a sudden I get some error message, so I rebooted.  Now when I try to boot into Ubuntu I get this message:  fsck from util-linux 2.26.2 /dev/sda6 contains a file system with errors, check forced. /dev/sda6: Inodes that were part of a corrupted orphan linked list found.  /dev/sda6: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.         (i.e., without -a or -p options) fsck exited with status code 4 The root filesystem on /dev/sda6 requires a manual fsck  Busybox v1.22.1 (Ubuntu 1:1.22.0-15ubuntu1) built in shell (ash) Enter 'help' for a list of built-in commands.  (initramfs) _   How can I fix this?


I am playing about with 'John the ripper' to see how easily my password can be cracked. The only issue i I cannot seem to fin the hashed password.  Things I've tried.   Reading hash from /etc/passwd - Result: No user found sudo dscl . -read /Users/<user>/ | grep GeneratedUID | cut -c15- cat /var/db/shadow/hash/<Result From First Command> | cut -c169-216 - Result: directory 'shadow' does not exist Some others (forgotten what they were. Had similar issues.    also didn't work for me.  Would like to know where the password hash is for my user so I can test out JTR. Thanks in advanced.  Edit: When I do sudo defaults read /var/db/dslocal/nodes/Default/users/Test.plist ShadowHashData|tr -dc 0-9a-f|xxd -r -p|plutil -convert xml1 - -o - I get 2 hashes'zcvUSru/AH3YNusqitC14z8dm8iX9dZTRzKKkv+oMODQQ9CG79yGmsjo8s13UCSIZ6TmE/U2krMC7KzxgafDwVkOq0eJ1F6aYFUBex649rUnj/58jhCp7Lgt5vWYN95SrDQwMKEYkFXkHM/Ieg0GsnCJnZwem4ugfSnU2fKCquE= and weXOBzKgCTzoeamwRXZ8vLNQNrHyCyFk/ZD2Bc/Vb6c= However when I put 'Test:' in a text file and do ./john <file> It gives me 'No password hashes loaded'.  Is this an issue with how I'm using John The Ripper or am I getting the wrong hashes?  Note: This was a test user and this is not my real password hashed. The encrypted password is 'password'

I think on previous versions of OS X, password were stored in the /etc/shadow file.  Nevertheless, this file doesn't appear to exist in the later versions of the operating system - specifically OS X 10.9 which is the first of the non-cat named OS releases.  Does anyone know where the password hashes are stored on OS X Mavericks?


I've seen this short movie when I was a kid, but I don't remember the title. The story is that humans live underground, and have a lifespan of seven days.    They train a newborn on his first day and send him on a quest to open some door that will lift the curse. On his way he battles with some monsters, plays some kind of chess with some other monster, and on the seventh day opens the door.  I remember that the short movie had animatronics, and even some CGI (this was around the late '80-ties, I think), but I can't find it anywhere.

People are born and grow up and die of old age in a matter of 5 days. The elders (5 days old) train children and send the most promising one on a trek across the dessert to a monolith that is the cause of the rapid aging to hopefully disable it.   I saw it on a reel to reel in the mid 90's. It looks like it was made in the late 70's or 80's. The cast was small. A few men played the elders seated in a row of chairs and the young boy who had to set out to save them who matures into a man and finally an elderly man.  I've been trying to figure out the title for years.


I am running a glm logistical regression in R thus: glm(outcome ~ sex + other_factors, data = data, family = 'binomial') Sex is entered as "Male" or "Female". and I get an Odds ratio of 0.366 for "sexMale". Does that mean that the male, or the female, is more likely to experience the outcome?

I've been having a hard time trying to understand the use of logistic regression in a paper. The paper available  uses logistic regression to predict probability of complications during cataract surgery.   What is confusing me is that the paper presents a model that assigns odds ratio of 1 to baseline described as follows:     A patient whose risk profile was in the reference group for all risk indicators (ie adjusted OR=1.00 for all in Table 1) may be regarded as having a ‘baseline risk profile’, and the logistic regression model indicates a ‘baseline predicted probability’ for PCR or VL or both=0.736%.   So the probability of 0.00736 is presented with odds ratio of 1. Based on the transformation from probabilities to odds ratios: $o=\frac{p}{1-p}$, this can't be equal to 1:  $0.00741=\frac{0.00736}{1-0.00736}$.  It gets even more confusing. The composite odds ratios that represents multiple covariates having values different than the baseline is used to calculate predicted risk.      ...the composite OR from Table 1 would be 1.28 X 1.58 X 2.99 X 2.46 X   1.45 X 1.60 = 34.5, and from the graph in Figure 1, we see that this OR corresponds with a predicted probability of PCR or VL or both of around 20%   The only way to arrive at the values the paper is giving as examples is to multiply the baseline probability with composite odds like this: $0.2025=\frac{(34.50\ \times\ 0.00736)}{1\ +\ (34.50\ \times\ 0.00736)}$.  So what is going on here? What is the logic for assigning odds ratio 1 to a baseline probability that is not 0.5? The update formula I've came up with above comes up with the right probabilities for examples in the paper but this is not the direct multiplication of odds ratio I'd expect. What is it then?


IS HR an acronym?  Should "a" or "an" be used in front of it in a sentence, such as: Do you have an HR question?

99% of the time, I'm clear on when I should use "a" versus "an." There's one case, though, where people & references I respect disagree.  Which of the following would you precede with "a" or "an," and why?   FAQ FUBAR SCUBA   [Note: I've read the questions  and , but the rules given there don't necessarily apply here.]    [Edited to add]  Here's a shorter (and hopefully clearer) version of the question…  In written English, which is correct (and why): "a FAQ" or "an FAQ"?  Some references with differing opinions:   an: the  and  a: the Microsoft Manual of Style for Tech Publications, 3e either: the  and


Would you please help me to prove the following proposition:  If $(P(X), c_R)$ is a choice structure that satisfies WARP, then $R_c$ is a rational binary relation?  Clarification:   For any nonempty set $X$, let $P(X)$ denote the set of all nonempty subsets of X.  For any nonempty subset $B$ of $P(X)$, a function $c: B \rightarrow P(X)$ is called a choice function iff $c(A) \subset A$ for all $A \in B$. The pair $(B, c)$ is called a choice structure. For any binary relation $R$ on $X$, define the function $C_R : P(X) \rightarrow P(X) \cup \{\emptyset\}$ as follows: $$C_R (A) = \{x \in A : ( \forall y \in A ) ( xRy ) \}.$$ Weak Axiom of Revealed Preference (WARP): $c(A) \cap B \neq \emptyset \Rightarrow c(B) \cap A \subset c(A)$.

Would you please give me an example to show that $(P(X), C_R)$ may be a choice structure even if $R$ is not rational (i.e., complete and transitive).  Clarification:   For any nonempty set $X$, let $P(X)$ denote the set of all nonempty subsets of X.  For any nonempty subset $B$ of $P(X)$, a function $c: B \rightarrow P(X)$ is called a choice function iff $c(A) \subset A$ for all $A \in B$. The pair $(B, c)$ is called a choice structure. For any binary relation $R$ on $X$, define the function $C_R : P(X) \rightarrow P(X) \cup \{\emptyset\}$ as follows: $$C_R (A) = \{x \in A : ( \forall y \in A ) ( xRy ) \}.$$


Just to clarify: I've look up to each existing question with accepted answers, but these questions were asked before Ubuntu 16.04 LTS came out and these answers are no longer working. Tried everything from said commands, but I still can't run 32bit applications.  I'm using Ubuntu 16.04 LTS 64bit. All said libraries are installed, but I still can't get the 32bit applicaton work. This is terminal dump:  error while loading shared libraries: libX11.so.6: cannot open shared object file: No such file or directory   Google doesn't help much and as I said, each question that already have an accepted answer just has outdated informations that are no longer supported or I don't know why it doesn't work, it just doesn't. I've got a little bit upset and will accept ANY working answer.

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?


At the top of the screen : public GameObject uiSceneText; private TextMeshPro textMeshPro;  Then in the script at some point : uiSceneText.SetActive(true);  if (textMeshPro.text != "")     textMeshPro.text = "";  The exception error null is on the textMeshPro on the line : if (textMeshPro.text != "")  textMeshPro is null. This screenshot shows the TextMeshPro in the Hierarchy :  and I see that the Scene Image object and its child Scene Text both are enabled true. I want to get the text and add replace a new text with the text already in the Text but the textMeshPro is null. The complete script : using System.Collections; using System.Collections.Generic; using TMPro; using UnityEngine;  public class PlayerSpaceshipAreaColliding : MonoBehaviour {     public float rotationSpeed;     public float movingSpeed;     public float secondsToRotate;     public GameObject uiSceneText;      private float timeElapsed = 0;     private float lerpDuration = 3;     private float startValue = 1;     private float endValue = 0;     private float valueToLerp = 0;     private Animator playerAnimator;     private bool exitSpaceShipSurroundingArea = false;     private bool slowd = true;     private TextMeshPro textMeshPro;      // Start is called before the first frame update     void Start()     {         textMeshPro = uiSceneText.GetComponent<TextMeshPro>();          playerAnimator = GetComponent<Animator>();     }      // Update is called once per frame     void Update()     {         if (exitSpaceShipSurroundingArea)         {             if (slowd)                 SlowDown();              if (playerAnimator.GetFloat("Forward") == 0)             {                 slowd = false;                  LockController.PlayerLockState(false);                  uiSceneText.SetActive(true);                  if (textMeshPro.text != "")                     textMeshPro.text = "";                  textMeshPro.text = "Here I will add the new text.";                              }              if (slowd == false)             {                              }         }     }      private void OnTriggerEnter(Collider other)     {         if (other.name == "CrashLandedShipUpDown")         {             exitSpaceShipSurroundingArea = false;             Debug.Log("Entered Spaceship Area !");         }     }      private void OnTriggerExit(Collider other)     {         if (other.name == "CrashLandedShipUpDown")         {             exitSpaceShipSurroundingArea = true;             Debug.Log("Exited Spaceship Area !");         }     }      private void SlowDown()     {         if (timeElapsed < lerpDuration)         {             valueToLerp = Mathf.Lerp(startValue, endValue, timeElapsed / lerpDuration);             playerAnimator.SetFloat("Forward", valueToLerp);             timeElapsed += Time.deltaTime;         }          playerAnimator.SetFloat("Forward", valueToLerp);         valueToLerp = 0;     } }

Since many users are facing the NullReferenceException: Object reference not set to an instance of an object error in Unity, I thought that it would be a good idea to gather from multiple source some explanation and ways to fix this error.  Symptoms I am getting the error below appearing in my console, what does it mean and how do I fix it?  NullReferenceException: Object reference not set to an instance of an object


Consider $f$ is a twice differentiable function such that $f(x)+f''(x)=-xg(x)f'(x)$, $\forall x \geq 0$ where $g(x) \geq 0, \forall x \geq 0$. Prove that for $\forall x \geq0$, (i)$(f(x))^2+(f'(x))^2$ is a non increasing function. (ii)$(f(x))^2<3(f(0))^2+4(f'(0))^2$ (iii) $f$ is bounded, that is $|f(x)| \leq a$, for some fixed positive real constant $a$. (iv) $\lim_{x \to \infty} f(x)\sin(\frac{1}{x})$ exists.  I could prove part (i). Let $$h(x)=(f(x))^2 + (f'(x))^2$$ $$h'(x)=2f'(x)(f(x)+f''(x))$$ $$=-2xg(x)(f'(x))^2 \leq 0$$ from conditions $x \geq 0$, $g(x) \geq 0, x \geq0$. Hence $h(x)$ is non increasing and part(I) is proved. Part(ii) attempt $$3h(0)=3{(f(0))^2+(f'(0))^2}$$ We must prove that this is larger than $$(f(x))^2-(f(0))^2, \forall x\geq0$$ I thought of trying to prove that this is negative. Let $$p(x)=(f(x))^2$$ $$p'(x)=2f(x)f'(x)$$ $$=2f(x)[\frac{f(x)+f''(x)}{-xg(x)}]$$ I couldn't make further progress. Part(iii) is a direct consequence of part(ii) and part(iv) is a direct consequence of part(iii).

Consider $f\in C^2$ so that $$f''(x)+f(x)=-x\,g(x)f'(x), \ \forall x\ge0 $$ where $g(x)\ge 0$. Then ($\forall x\ge 0$)         (A) $f(x)^2+f'(x)^2$ is non-increasing,   (B) $f(x)^2<3f(0)^2+(2f'(0))^2$,   (C) $|f(x)|\le\alpha$, where $\alpha$ is a fixed real constant.   (D) $\lim_{x\to\infty} f(x)\sin\left(\dfrac{1}{x}\right)$ exists.        Answer Given: (A),(B),(C),(D)  What I have tried : I differentiated option (A) and then with the help of the given equation in the question I was able to show that  it is less than zero . Hence I was able to infer that option (A) is correct .   Now coming to option (B).  I assumed the function in option (A) to be $h(x)$.   $$ h(x) = f(x)^2 + f'(x)^2 $$  Since $h'(x)<0$ ,therefore $h(x)$ is a decreasing function   hence for all $x\ge 0$  $h(x)< h(0)$  which implies $(f(x))^2 + (f'(x))^2<(f(0))^2 + (f'(0))^2$  From the above expression we can get the second option .   Is my method correct ?. If not , please show the right method .  I am unable to get the the 3rd and 4th option .


Is it possible to determine which, if any, Windows versions were previously installed on a machine?  Use case example: I'd like to find out if Windows 2012/2016 images we use were in-place upgrades or to be able to show that a machine has not been a fresh install since whatever version.  I've done some poking around within the registry, wmic, etc. but can't find any remnants that point to previously installed Windows versions.

Is there a reliable way to determine the OS upgrade history leading to Windows 10 or if it was a fresh install?


their internal Windows/AD domain name is blahblahblah.com and their public website is blahblahblah.com and they can't see their website while on the office network (the web site loads just fine from anywhere else). How do I fix this so they can see their public web site internally?

I am using my domain example.orgin my firm. I can use www.example.orgto view my website. If I try http://example.org from outsite my firm there is no problem, but if I try it from inside, my windows DNS servers deliverthe IPs of domain controllers.  How can I solve this? Can I prevent my DCs from registering as example.org in my DNS and will this be a problem for my enviroment?


Is there a way to make the Photos app perform more computations when it is running in the background?  Basically, I read that People Tagging happens when the computer is plugged and when Photos is not open. Which means that I could easily leave my computer switched on for the night to allow Photos to do its Machine Learning stuff. But when I look at the Terminal, the PhotoAgent, photoanalysisd etc. are only using very small amount of my computer's resources.  Isn't there a way to speed things up? For example, by allocating more memory to Photos, etc.

Photos on my phone and my laptop both say this at the bottom of the People section of the app. There has been no noticeable progress made in the past few weeks. It looks like all the people it has "identified" were carried over from when I manually tagged them in iPhoto years ago.   Is there a way to jumpstart this process or restart it?


For example, $\mathbb N$ is equipotent to $\mathbb Q$ which is a field.  $\mathbb R$ is equipotent to itself, which is a field.  But what about $\mathbb R^{\mathbb R}$, $P(\mathbb R^{\mathbb R})$ etc.?

So I took an introductory abstract algebra course a few semesters ago, and we were shown that groups and rings can both be made into products, i.e. if I have some group $G$ (resp. ring $R$) and some indexing set $I$, then I can make a group $G^{I}$ (resp. ring $R^{I}$) with the appropriate cardinality. However, it was also demonstrated that for fields, you cannot keep the multiplicative inverse under a product structure, i.e. if I have fields $F_{1}, F_{2}$, then $F_{1} \times F_{2}$ will still be a ring, but you will not (not just "not in general", but won't) have multiplicative inverses for all non-zero (i.e. not $(0, 0)$) elements, as you could pick $(0, x)$, where $x \neq 0$. According to Wikipedia, an ultraproduct will preserve field structure, but I'm not sure what the cardinality of $\prod_{i \in I} F_{i} / \mathscr{U}$ would be in general.  I saw  that said you could make a field of arbitrarily large cardinality by extending a given field through throwing in a whole bunch of "transcendental" elements. The example given was that if I had $\mathbb{Q}$, I could start by dumping in the complexes, but then I suppose after that I'd just start throwing in dogs and cats or something; I'm really not sure what that responder meant, and ceteris paribus, my dogs tend to stay inside, so I'd rather keep them out of my fields, particularly the large ones the thread was interested in.  Moreover, the thread mentioned earlier seemed more concerned with just making the fields big. My question is a bit more nuanced: Given any cardinality $\kappa > 1$, can I generally construct a field $F$ of a cardinality $\kappa$? Moreover, how vague do I have to be about it (i.e. do I have to use some really choicy methods, or can I make it a bit more straightforward)?  Thanks.  EDIT: Sorry. I am aware that for finite fields, you are limited to powers of primes. I meant for infinite cardinals.


I'm working on a bigger project and have to work with dependency properties... Now i need to change the value of my dp but do not want to get the event fired.  is it possible to break this event - chain?  Or can i change the dp without firing the event?  Cause it's not possible to say -> e.Handled= true  Thanks.

I need to set a dependency property on a control (Slider.Value) in my code without it triggering a ValueChanged event (since I set the value, not the user). What is the best way to handle this situation in WPF?   For clarification, what I am trying to do is hook up WPF sliders to a WinForms User Control. Currently in my app I have a ValueChanged event handler that passes the slider value to the WinForms control via a method call. The WinForms control (which is actually a wrapper around a native OpenGL window) needs to be able to dynamically change the slider based on it's internal calculations. To do this I use an abstraction of a slider (ISlider) , I instantiate a WPF-flavor of that slider in my app, and pass a handle to it's base to the WinForms control via a .NET property on the WinForms User Control. All of this is currently working, it's just that when the internal logic decides the slider needs to change, it calls ISlider::SetPos(), which then changes the WPF slider, which then triggers a ValueChanged event on the slider, and the handler for that event extracts the slider's position and passes it in to the WinForms control which originated the event in the first place. The suggestions by ligaz and Alan Le both seem like they should work, but I'm just not sure I'm going about this in the best way.


There are 1000 doors in a palace which also contains 1000 servants. Every servant has a distinct tag numbered from 1 to 1000. Everyone has a perfect work set; i.e. to operate the doors taking their tag no.'s multiple. In simple words, man1 will open all doors.. Man2 will close even numbered doors.. Man3 will open closed doors and will close opened doors that are numbered as multiple of 3. And so on till 1000th servant operates 1000th door. Now, how many doors are closed at last.

I have a problem called "The Prison Problem" that I need to explain to my 9-year-old cousin. I would think that he has just started learning about divisors and perfect squares, and as such, I have a proposed solution. Any input from you guys would be welcome, as to what is the best way to go about this.  Problem:  There was a jail with 100 cells in it, all in a long row. The warden was feeling very jolly one night and told his assistant that he wanted to give all the prisoners a wonderful surprise. While they were sleeping, he wanted the assistant to unlock all the cells. This should be done, he told the assistant, by putting the key in each lock, turning it once. The assistant did this, then came back to report that the job was done. Meanwhile, however, the warden has second thoughts. "Maybe I shouldn't let all the prisoners free," he said. "Go back and leave the first cell open, but lock the second one (by putting the key in and turning it once). Then leave the third open, but lock the fourth, and continue in this way for the entire row." The assistant wasn't very surprised at this request as the warden often changed his mind. After finishing this task, the assistant returned, and again the warden had other thoughts. "Here's what I really want you to do," he said. "Go back down the row. Leave the first two cells as they are, and put your key in the third cell and turn it once. Then leave the fourth and fifth cells and turn the key in the sixth. Continue down the row this way." The assistant again did as instructed. Fortunately, the prisoners were still asleep. As a matter of fact, the assistant was getting pretty sleepy, but there was no chance for rest yet. The warden changed his mind again, and the assistant had to go back again and turn the lock in the fourth cell and in every fourth cell down the row. This continued all through the night, next turning the lock in every fifth cell, and then in every sixth, and on and on, until on the last trip, the assistant just had to turn the key in the hundredth cell. When the prisoners finally woke up, which ones could walk out of their cells?  Proposed solution:  Ten cells are left open after this process. Every cell that is a perfect square will remain open (1, 4, 9, 16, 25, 36, 49, 64, 81, and 100). If a number is not a perfect square, then it has an even number of divisors, therefore it will be "toggled" an even number of times and end up where it started (closed). Perfect squares have an odd number of divisors, so they will end up the opposite of where they started (open).


I am generating some bootstrap cards using for loop on my flask template. On each card, there is a button which runs an ajax query. What  I want to do is show the content retrieved on the card body. The ids of the card body are dynamic since I am generating them via a for loop.

Results - Men

           {% for gen in ev_list %}             {% for evt in gen.boys %}

                     {{ evt }}                     <button class="btn btn-outline-secondary evt float-right" data-event="{{ evt }}" data-id="{{ meet.meetid }}" data-gender="-men">                                            </button>

Special title treatment

With supporting text below as a natural lead-in to additional content.

             {% endfor %}           {% endfor %}

   jquery:  $('.evt').on('click', function() {         var event = $(this).attr('data-event');         var id = $(this).attr('data-id');         var gender = $(this).attr('data-gender');           var p_text = $('#result_'+$(this).attr('data-event')).text();         console.log('#result_'+$(this).attr('data-event'));         console.log(p_text);          $.ajax({             type: 'POST',             url: '/process',             data: JSON.stringify({ "event" : event, "meetid":id, "gender":gender} ),             contentType: "application/json; charset=utf-8",             dataType: "json",         })         .done(function(data){             $('#result_'+$(this).attr('data-event')).text(data);         });     });   The html on the browser looks as follows:    The console output on the browser from the js script is as follows:    Although the id of the P tag and the id that I am targeting looks similar it seems that the correct element is not picked up by jquery. How can I fix this?

Does anyone know how to select an item in the DOM by ID with jQuery, when that ID has a space?   For example, the ID of my item would be
Stuff
   How would I select this with jQuery?   If I just do   $("#content Module").whatever()    jQuery will try to find an item with both the ID of content and the ID of Module, which is not what I am looking for.  I should add that I am working with an old code base where these two word ids are used extensively, so going through and changing all the IDs would be bad.


I'm trying to build a command that displays a sort of checklist. Ideally, I only want to pass a set of boolean values to that command.  A naive MWE looks like this:  \documentclass{article} \usepackage{tabularx}  \newcommand{\mychecklist}[5]{     \begin{table}         \begin{tabularx}{\textwidth}{|l|l|}             param 1 & #1 \\             param 2 & #2 \\             param 3 & #3 \\             param 4 & #4 \\             param 5 & #5         \end{tabularx}     \end{table} }  \begin{document} \mychecklist{x}{}{x}{}{x} \end{document}   However, I need to pass more than 9 parameters. How can I do this efficiently? Is there a solution that lets me pass a set of indices (eg. [1,3,5]) to the command and produce the desired result, a table with checkmarks in the respective positions?

I am kind of new to LaTeX. I am doing project which contain resources (formula, solutions to problems, e.g.) i can bring to the Exams day on 16th March. I have been looking for a solution to my problem couple of hours now. What i am trying to achieve is to create a \newcommand with indefinite variable (arguments?) that can do a repetitive task such as 5 \times 10 \times 15 \times 20 \times 25. The numbers are supposed to be the arguments and \times, the repeating task between each argument. I have tried to make a tabular many column inside a \newcommand but have not succeed. To give a better vision, i will post a piece of my code.  \documentclass{article}  \usepackage{lmodern} \usepackage[T1]{fontenc}  \usepackage[utf8]{inputenc} \usepackage{amsmath} \usepackage{enumitem} \usepackage{titlesec} \usepackage[norsk]{babel}  \titleformat{\section}{\LARGE\filcenter}{}{1em}{} \setlength{\jot}{14pt}  \title{Hjelpermidler i Digital Radio} \author{Sami Rashiti}  \newcommand{\degree}[2]{#1\,^{\circ}\ \mathrm{#2}}   \begin{document}  \maketitle  \newpage  \section*{Innlevering 1} \input{innleveringer/innlevering1.tex} ~\newline  \begin{align}     e_n &= \sqrt{4KTBR}                                                                     \\     e_n^2 &= 4KTBR                                                                          \\     R &= \frac{e_n^2}{4KTB}                                                                 \\       &= \frac{(\frac{V_o}{A})^2}{4KTB} \qquad ,der \quad e_n = \frac{V_o}{A} = 3,2\mu V    \\       &= \frac{(3.2\mu V)^2}{4\cdot1.38\cdot 10^{-23}\cdot 310\cdot   100\cdot 10^3}        \\       &= 6\ k\Omega     \end{align}  \end{document}


I've got a very long list of items, 30K+. I would like to loop through the entire list, but in groups/blocks of 10 or 100s.  So:  for 100items in 30Klist:     print 100items # list of 100 items from the long list   Is that somehow possible?

I have a Python script which takes as input a list of integers, which I need to work with four integers at a time.  Unfortunately, I don't have control of the input, or I'd have it passed in as a list of four-element tuples.  Currently, I'm iterating over it this way: for i in range(0, len(ints), 4):     # dummy op for example code     foo += ints[i] * ints[i + 1] + ints[i + 2] * ints[i + 3]  It looks a lot like "C-think", though, which makes me suspect there's a more pythonic way of dealing with this situation.  The list is discarded after iterating, so it needn't be preserved.  Perhaps something like this would be better? while ints:     foo += ints[0] * ints[1] + ints[2] * ints[3]     ints[0:4] = []  Still doesn't quite "feel" right, though.  :-/ Related question:


I am trying to prepare plant-based burger patties like beyond-meat. What is a good binder to be used as a  replacement for methyl-cellulose. I want to grill the patties on a griller.

I am looking to understand the nature of how binders work.   I made patties the other day. A potato, two carrots, a can of black beans, a bit of bread crumbs. It blended to a decent grainy slush and fried up nicely.   Then I tried a sweet potato, broccoli, and chick peas. The mixture felt right, but it did not hold together when I tried to cook it up, either in a pan or baking it. (Although, my vegan daughter said the taste was great, so I was on to something)  Is there a process vegan cooks use to (a) choose the right mix of ingredients that need no special binder or (b) is there a decent universal binder that works within reason when the other ingredients are chosen right?


I try to update the image after reading it from the database and throws                        java.lang.NullPointerException SQL Error     at java.io.FileInputStream.<init>(FileInputStream.java:130)     at tprison.Tprison.lambda$startgu$21(Tprison.java:947)   It will work if i choose an image using file chooser but what is this can't I change a person name or age something like that without changing the person image.  i understand the file is null but how, while it is having an image.  here is the code that will hold the image in the layout   browse = new JFXButton("browse");      browse.setOnAction(e -> {      fileg = filechooser.showOpenDialog(stageg);      if(fileg != null){         imageg = new Image(fileg.toURI().toString(),130,140,true,true);           rectangleg = new Rectangle(130,140);          rectangleg.setFill(new ImagePattern(imageg));           rectangleg.setArcWidth(10);          rectangleg.setArcHeight(10);           bpgu.setTop(rectangleg);          BorderPane.setAlignment(rectangleg, Pos.TOP_LEFT);          bpgu.setMaxSize(130, 140);          bpgu.setPrefSize(130, 140);          bpgu.setVisible(true);   here is the code that retrieve the image from the database and display.  InputStream is = rsgf.getBinaryStream("Pic");          OutputStream os = new FileOutputStream( new File("photo.jpg"));                byte[] content = new byte[1024];             int size = 0;             while((size = is.read(content)) != -1){                 os.write(content,0,size);             }             os.close();             is.close();              imageg = new Image("file:photo.jpg", 130, 140, true, true);             rectangleg = new Rectangle(130,140);             rectangleg.setFill(new ImagePattern(imageg));              rectangleg.setArcWidth(10);             rectangleg.setArcHeight(10);              bpgu.setTop(rectangleg);             BorderPane.setAlignment(rectangleg, Pos.TOP_LEFT);             bpgu.setMaxSize(130, 140);             bpgu.setPrefSize(130, 140);             bpgu.setVisible(true);   and finally here is the the code that update the image to the database and where the error points(fileg is null).   pica = new FileInputStream(fileg);  pstgu.setBinaryStream(10,(InputStream)pica, (int)fileg.length());

What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?  What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?


I am a new linux user. I am trying to set up my ralink drivers.  I am following the steps from another forum which are:   download driver:  tar -xvf /home/ukbeast/USERNAME/Downloads /2011_1007_RT5390_RT5392_Linux_STA_V2.5.0.3_DPO_v2.bz2.bz2 cd 2011_1007_RT5390_RT5392_Linux_STA_V2.5.0.3_DPO download patch:  patch -p1 < rt5592sta_fix_64bit_3.8.patch (if asks for directory point it to pci_main_dev.c) make sure /os/linux/config.mk reads HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=y make sudo make install modprobe rt5390sta   I am getting stuck on step 5. When I enter patch -p1 < rt5592sta_fix_64bit_3.8.patch into the terminal I am getting "no such file or directory" as a response.  I do not know how to point it to pci_main>dev.c?  Any help on how to point it there would be much appreciated.

I would like to know if my  is in anyway compatible with Ubuntu.  Dual booting Ubuntu 15.04 with windows 8.1 on an HP Pavilion G6 1d98dx.  I've tried so many different distros but the problem is the same on all of them "wireless disabled by hardware switch" I've tried rfkill unblock all but that did not fix the problem.  Bus 002 Device 002: ID 04f2:b293 Chicony Electronics Co., Ltd  Bus 002 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 001 Device 002: ID 05dc:a20b Lexar Media, Inc.  Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub 00:00.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 12h Processor Root Complex 00:01.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] BeaverCreek [Radeon HD 6520G] 00:01.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] BeaverCreek HDMI Audio [Radeon HD 6500D and 6400G-6600G series] 00:04.0 PCI bridge: Advanced Micro Devices, Inc. [AMD] Family 12h Processor Root Port 00:11.0 SATA controller: Advanced Micro Devices, Inc. [AMD] FCH SATA Controller [IDE mode] 00:12.0 USB controller: Advanced Micro Devices, Inc. [AMD] FCH USB OHCI Controller (rev 11) 00:12.2 USB controller: Advanced Micro Devices, Inc. [AMD] FCH USB EHCI Controller (rev 11) 00:13.0 USB controller: Advanced Micro Devices, Inc. [AMD] FCH USB OHCI Controller (rev 11) 00:13.2 USB controller: Advanced Micro Devices, Inc. [AMD] FCH USB EHCI Controller (rev 11) 00:14.0 SMBus: Advanced Micro Devices, Inc. [AMD] FCH SMBus Controller (rev 13) 00:14.2 Audio device: Advanced Micro Devices, Inc. [AMD] FCH Azalia Controller (rev 01) 00:14.3 ISA bridge: Advanced Micro Devices, Inc. [AMD] FCH LPC Bridge (rev 11) 00:14.4 PCI bridge: Advanced Micro Devices, Inc. [AMD] FCH PCI Bridge (rev 40) 00:15.0 PCI bridge: Advanced Micro Devices, Inc. [AMD] Hudson PCI to PCI bridge (PCIE port 0) 00:15.1 PCI bridge: Advanced Micro Devices, Inc. [AMD] Hudson PCI to PCI bridge (PCIE port 1) 00:15.2 PCI bridge: Advanced Micro Devices, Inc. [AMD] Hudson PCI to PCI bridge (PCIE port 2) 00:18.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 12h/14h Processor Function 0 (rev 43) 00:18.1 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 12h/14h Processor Function 1 00:18.2 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 12h/14h Processor Function 2 00:18.3 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 12h/14h Processor Function 3 00:18.4 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 12h/14h Processor Function 4 00:18.5 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 12h/14h Processor Function 6 00:18.6 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 12h/14h Processor Function 5 00:18.7 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 12h/14h Processor Function 7 01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8101E/RTL8102E PCI Express Fast Ethernet controller (rev 05) 07:00.0 Network controller: Ralink corp. RT5390 Wireless 802.11n 1T/1R PCIe 08:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS5209 PCI Express Card Reader (rev 01)


I am using a Partner WSDL and describe calls to get the fields from one salesforce org into other org. The objects and Fields are fetched, however I also want to get the translation for some of the fields.   Any help is appreciated

I'm trying to implement a preview screen with a picklist of available languages and a textbox with translated text. The problem is System.Label.My_Preview_Text or $Label.My_Preview_Text are already translated to current User's locale. Is there a way to retrieve a translation for the specified locale, something like System.Label.getValue('My_Preview_Text','en_US'). Like we can do this in  or . Is there a way to do that in Apex/VisualForce?


How can I prove the following statement?  $$\binom{n}{0} ^2 + \binom{n}{1} ^2 + \binom{n}{2} ^2 + ... + \binom{n}{n} ^2 = \binom{2n}{n}$$  I know that:  $$\sum_{k = 0}^{n} \binom{n}{k} = 2^n$$  But I don't see how I could use it to prove the given problem.

I was hoping to find a more "mathematical" proof, instead of proving logically $\displaystyle \sum_{k = 0}^n {n \choose k}^2= {2n \choose n}$.  I already know the logical Proof:  $${n \choose k}^2 = {n \choose k}{ n \choose n-k}$$  Hence summation can be expressed as:  $$\binom{n}{0}\binom{n}{n} + \binom{n}{1}\binom{n}{n-1} + \cdots + \binom{n}{n}\binom{n}{0}$$  One can think of it as choosing $n$ people from a group of $2n$  (imagine dividing a group of $2n$ into $2$ groups of $n$ people each. I can get $k$ people from group $1$ and another $n-k$ people from group $2$. We do this from $k = 0$ to $n$.


I'm using Windows 10 and Firefox 66.  If I use Firefox's "Save Page As..." (ctrl + s) to downlaod a webpage that has more than simple text (i.e., js, css, images etc.), I get a webpage.htm file as well as a folder called webpage_data containing the extra resources. In Windows explorer, these look like normal files and folders -- no icon overlays or anything indicating that they behave differently from any other file or folder.  However, If I delete the folder, the file gets deleted as well!  I've never seen files "linked" like this in a Windows filesystem before. What's going on here? Is this something I can replicate with arbitrary files and folders via the file properties dialog?

I saved an HTML web page using Google Chrome. An HTML file along with a folder containing the images was saved on my computer. Now when I move the HTML file to a different location or delete it, the folder moves along with it.  How is this association enforced?  I am seeing this behavior on Windows. Is it something specific to NTFS? Can it also be achieved on Linux?


I noticed that when I throw salt into a cooking pot and then mix, the salt collects in the center. As salt is denser than water, I would have expected it to go towards the border of the pot, and not in the middle. What is going on exactly there?

At xmas, I had a cup of tea with some debris at the bottom from the leaves.  With less than an inch of tea left, I'd shake the cup to get a little vortex going, then stop shaking and watch it spin.  At first, the particles were dispersed fairly evenly throughout the liquid, but as time went on (and the vortex slowed, although I don't know if it's relevant) the particles would collect in the middle, until, by the time the liquid appeared to almost no longer be turning, all the little bits were collected in this nice neat pile in the center.  What's the physical explanation of the accumulation of particles in the middle?  My guess is that it's something to do with a larger radius costing the particles more work through friction...


I am confused about whether I should write "I work at registrar's office" or "I work in registrar's office"

When do you use at the office? And when do you use in the office? What's the difference between the phrases?


Do var Impact performance   As currently, I am working on optimisation to speed up the execution process.  As My code has lot of declaration like following  var lstProducts = dbSet.ToList();   Now if I change it to strongly type as following,  List<Product> lstProducts = dbSet.ToList();   do it impact the execution time. or CPU cost/compilation time or such  or it do not make any sense?

Earlier I asked a question about  and got the answer that while it is only necessary for anonymous types, that it is used nonetheless to make writing code 'quicker'/easier and 'just because'.  Following  I saw that var gets compiled down to the correct type in the IL (you will see it about midway down article).  My question is how much more, if any, IL code does using the var keyword take, and would it be even close to having a measurable level on the performance of the code if it was used everywhere?


Let me explain. There is a user with just 20 rep voting on every answer/comment I post on Stack Overflow. In my reputation overview I can see I'm not earning any rep anymore after just a few votes by this user, but my concern of getting banned/losing my rep because of this user made me post this question.  Is there any way to block a user or something? Hope someone has some good advice in this matter.

I'm relatively new in StackOverflow, even though my account is 2 years old, I started actively contributing to site a few months ago.  I'm trying to do my best and while doing it, hoping to learn more than I currently know.  Today, for the first time, most of my answers were serially upvoted by someone/something I don't know.   And felt worried about it, I thought that this will negatively affect my account standing by creating an indication that I used a sockpuppet (I think that's what it's called)  Those reputation bonuses were reversed by the automatic mechanism a few moments ago, however, the upvotes and the "Serial upvoting reversed" event is still visible.   I'm acting incredibly picky while building my reputation anywhere just like any serious minded person would do. Now that "Serial upvoting reversed" message stands there, giving false signals to my profile visitors that I'm cheating rather than working my hands. This is a terrible feeling.  Even though I can't prove it, I never tried to gain reputation by chicanery.  What I would like to know is, if there's a serial upvote incident like that happening, how should we react to it?   Can we file an abuse report to somewhere?


I am attempting to set a rule, or a policy, to move items with my Inbox, to a specific folder, labelled 'Cache'. So items come into my Inbox, and after 2 weeks, I would like them to be moved to 'Cache'. After 90 days of age, they will then be moved to an archive. Is this possible? I tried messing with rules, can couldn't figure out a way to do so.

In my Outlook 2013, I am trying to manage my emails by creating sub-folders in my inbox.  What I want to do is to divide my emails in four sub folders named as follow :  (First Quarter, Second Quarter, Third Quarter, Fourth Quarter)  Currently, I want to apply this for the First and Second Quarter of the year.  Is it possible to do this by creating a specific rule?  I don't mind to create a rule for each quarter if needed.


I started an application from the terminal which prints the status and various logs in the console so that I can read them from the terminal. I accidentally closed the terminal but the application is still running, however, I can't see the logs anymore. Is there a way to get back access to that process console which is still running. ?   I am on Red Hat Enterprise Linux Server 7.1 (Maipo).  I was running an application in tornado, a python framework using the following command.   python2.7 /proj/website/app.py 8080   8080 is the port number.

I have a running program on a SSH shell. I want to pause it and be able to unpause its execution when I come back.  One way I thought of doing that was to transfer its ownership to a screen shell, thus keeping it running in there.  Is there a different way to proceed?


Which one is right and why? Does the answer change if instead of 0.5 we have let say 5.

I have seen people say both 0.25 mile and 0.25 miles. Should we use plural or singular for a fraction of a mile?


In an effort to learn a little, I am trying to figure out the difference between defining a value when creating a class and using get; set;  I have no idea of the terminology to look up the answer myself. Any help would be greatly appreciated. Are there certain situations you'd use one over the other.  I've been using get; set; for a while, but more a matter of habit, not because i understood why.   Example:  public class Post {      public Guid guid = new Guid();      public Guid userguid { get; set; }  }

In C#, what makes a field different from a property, and when should a field be used instead of a property?


cannot delete my own question, overwrite instead

Looking to find all files (recursively) which have an underscore in their file name and then delete them via command line.


I'm using Debian10/KDE and since a few months ago one package was kept back. However, when using sudo apt update instead of sudo apt-get update it displays something else and allows to see the "additional version". Why is that? Shouldn't this also be displayed with apt-get? Shouldn't it simply install version 2.8.5? (Why isn't it? How can it be installed?) sudo apt-get upgrade Reading package lists... Done Building dependency tree        Reading state information... Done Calculating upgrade... Done The following packages have been kept back:   python3-psycopg2 0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.  sudo apt upgrade Reading package lists... Done Building dependency tree        Reading state information... Done Calculating upgrade... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.  sudo apt update Reading package lists... Done Building dependency tree        Reading state information... Done 1 package can be upgraded. Run 'apt list --upgradable' to see it.  apt list --upgradable Listing... Done python3-psycopg2/stretch-pgdg 2.8.5-1~pgdg90+1 amd64 [upgradable from: 2.7.7-1] N: There is 1 additional version. Please use the '-a' switch to see it  apt list --upgradable -a Listing... Done python3-psycopg2/stretch-pgdg 2.8.5-1~pgdg90+1 amd64 [upgradable from: 2.7.7-1] python3-psycopg2/stable,now 2.7.7-1 amd64 [installed,upgradable to: 2.8.5-1~pgdg90+1]   Trying to debug further: apt policy python3-psycopg2 python3-psycopg2:   Installed: 2.7.7-1   Candidate: 2.8.5-1~pgdg90+1   Version table:      2.8.5-1~pgdg90+1 500         500 http://apt.postgresql.org/pub/repos/apt stretch-pgdg/main amd64 Packages  *** 2.7.7-1 500         500 http://ftp.XX.debian.org/debian buster/main amd64 Packages         100 /var/lib/dpkg/status  sudo apt install python3-psycopg2 Reading package lists... Done Building dependency tree        Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation:  The following packages have unmet dependencies:  python3-psycopg2 : Depends: python3 (< 3.6) but 3.7.3-1 is to be installed E: Unable to correct problems, you have held broken packages.  Unlike in the linked question the usual sudo apt-get --with-new-pkgs upgrade doesn't work here: sudo apt-get --with-new-pkgs upgrade Reading package lists... Done Building dependency tree        Reading state information... Done Calculating upgrade... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.   Whatever the solution is: there should at least be a prompt/s when running sudo apt-get upgrade to install or not install that new version.

When doing an apt-get upgrade I sometimes get a message saying "The following packages have been kept back". For example:  $ sudo apt-get upgrade                                                                                Reading package lists... Done                                                                                Building dependency tree                                                                                Reading state information... Done                                                                                The following packages have been kept back:                                                                                linux-headers-server linux-image-server linux-server                                                                                0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.   What does this mean exactly? Obviously the packages have been held back and not installed, but why?  The follow-on question would be: how does one upgrade these kept back packages?


For the most simple of 2D games, I have implemented a posteriori collision detection (overlapping rectangles) on the xy Cartesian plane, but am now interested in understanding the basics of a priori collision detection...  On , I noticed the reference to Newton’s Method.  So, I want to better understand the link between finding zeros of an equation and detecting a posteriori collision.  Let's start with the most obvious case of finding roots of an equation:  If you have a projectile's trajectory modeled as a quadratic function, you can find the roots to predict at what time the height will equal zero (or any other constant height, actually, by just rearranging f(x)=C to be f(x)-C=0 and then finding roots of that expression).    So, as I understand, finding the root can tell me the time at which the object will be at any chosen height.  More broadly, we basically know the (x,y) location of the object for any given time.    But how does root finding, in particular, translate to detecting collisions with another object?  The other object may be stationary, or be moving.  If the latter, do you also determine roots/location of this moving object as well? Calculate the (x,y) trajectory of both objects and determine where they will intersect?

For the most simple of 2D games, I have implemented a posteriori collision detection (overlapping rectangles) on the x/y Cartesian plane, but am now interested in understanding the basics of a priori collision detection...  In the link , I noticed the reference to Newton’s Method.  So, I want to better understand the link b/w finding zeros of an equation and detecting a posteriori collision.    Let's start with the most obvious case of finding roots of an equation:  If you have a projectile's trajectory modeled as a quadratic function, you can find the roots to predict at what time the height will equal zero (or any other constant height, actually, by just solving f(x)=C to be f(x)-C=0 and then finding roots of that expression).    So, as I understand, finding the root can tell me the time at which the object will be at any chosen height.  More broadly, we basically know the (x,y) location of the object for any given time.  But how does root finding, in particular, translate to detecting collisions with another object?  (The other object may be stationary, or be moving.  If the latter, do you also determine roots/location of this moving object as well? Calculate the (x,y) trajectory of both objects and determine where they will intersect?)  Again, the basic question is where does root finding come into play?  Any links to a basic primer on this topic, with a simple example would also be greatly appreciated.


Last year I bought some Kreitler rollers and used them somewhat. The biggest problem I have is starting.   I have 4.5-Inch Kreitler Alloy Rollers with Killer Headwind Fan Drums.  Does anyone have a suggest on an easy way to start?

After seeing a few questions about rollers pop-up, such as , it has spiked my interest in these things again.  So how do you learn how to ride on rollers? How long does it take you to get the hang of it? Is it like learning to use clipless pedals where you are almost guaranteed to fall off a couple of times before you get it nailed?


I have a synchronous process that is trigger by a user action and the process can take more than 10 minutes.  While it's being processed, the previous UI that user triggered from and the previous data displayed is blocked and the user cannot approach it.    Do you know of any references for a system that has this kind of behavior?

I'm writing a web app using Twitter Bootstrap with PHP on server side. My app makes regular ajax requests via jQuery and i want to disable certain parts of the UI until the server completes processing and hands back the control to Client-Side.  I wonder what would be best practices for the same?


As seen in the badge earned section, amp; instead of which & should be shown on the Stack Overflow  profile page.   Android:  (Lollipop). Stack Overflow app, latest version.

I'm using the official Stack Exchange mobile app for iOS or Android, and  My app crashed! It doesn't look good on my new smartphone. It won't run after I updated my device. I noticed another bug. I have an idea for a new feature which is currently not in the app.  How do I report bugs with or request features for the iOS and Android apps? Also:  I've used the built-in functionality of the app to report a bug or submit a feature request. Did I do the right thing? The app prompted me to post on Meta after an error occurred. Should I post about it here? I'm wondering why the latest version is from 2017. I've heard rumors that the apps are no longer supported; is that true? I can't find the app on my device's app store anymore! Where did it go?     We get a lot of bug reports from users about the mobile apps, which are unsupported, and at the moment, there is no centralized Q&A pair for those to be closed as duplicates of (the relevant answers are spread across multiple unrelated questions). This question is an FAQ proposal, to serve as a directly-related duplicate target for those questions.


Suppose $X$ and $Y$ follow Cauchy distribution independent of each other. What will be the pdf of $X+Y$?  What I got by using convolution theorem is that the density $g$ of $X+Y$ is $:$  $$g(x) = \int_{-\infty}^{\infty} f(y) f(x-y)\ \mathrm {dy}$$ where $f$ is the density of the Cauchy distribution given by $f(x)=\frac {1} {\pi ({1+ x^2})},x \in \Bbb R$. Then the whole integration becomes $$\frac  {1} {\pi^2} \int_{-\infty}^{\infty} \frac {\mathrm {dy}} {(1+y^2)(1+(x-y)^2)}.$$ Now how do I solve this integral? Please help me in this regard.  Thank you very much.

Is there any method to show that the sum of two independent Cauchy random variables is Cauchy? I know that it can be derived using Characteristic Functions, but the point is, I have not yet learnt Characteristic Functions. I do not know anything about Complex Analysis, Residue Theorem, etc.   I would want to prove the statement only using Real Calculus. Feel free to use Double Integrals if you please.   On searching, I found . However, I was wondering if I could get some help directly on the convolution formula:  $$f_Z(z)=\int_{-\infty}^\infty f_X(x)f_Y(z-x)\,dx=\int_{-\infty}^\infty\frac{1}{\pi^2}.\frac{1}{1+x^2}.\frac{1}{1+(z-x)^2}dx\tag{1}$$  Here I have supposed that $X,Y$ are Independent Standard Cauchy. But I think the general formula can be derived easily after some substitutions. I need some help on how to proceed from $(1)$.  EDIT: Just as what the hint in the hyperlink said, I got the answer using that hint. However, I am not quite sure that the hint is algebraically correct. Maybe there has been some typing mistake in the book.


I need to sort Rectangle objects in my ArrayList list1 by their corresponding properties: height,width, and topCorner(Point). I am able to sort the list when evaluating one property.   How can I set up my compareTo method so that it first attempts to sort the objects in the list by height, then by width(if all object heights are equal), and finally bytopCorner(if all object heights and widths are equal)?  public class Point implements Comparable<Point> {  private int x; private int y;  public Point(){     this(0,0); } public Point(int x,int y){     this.x=x;     this.y=y; } public int getX(){     return x; } public int getY(){     return y; } public int compareTo(Point pt){     if(x==pt.x){         return y-pt.y;     }     else{         return x-pt.x;     } } public String toString(){     return "("+x+", "+y+")"; } } class Rectangle implements Comparable<Rectangle> {  private int height; private int width; private Point topCorner;  public Rectangle(int x,int y,int height,int width){     this.height=height;     this.width=width;     this.topCorner=new Point(x,y); } public int getHeight(){     return height; } public int getWidth(){     return width; } public Point getPoint(){     return topCorner; } public int compareTo(Rectangle rect){     if(height!=rect.height){         int compareHeight=((Rectangle)rect).getHeight();         return this.height-compareHeight;     }     else if(width!=rect.width){         int compareWidth=((Rectangle)rect).getWidth();         return this.width-compareWidth;     }     else if(topCorner!=rect.topCorner){         Point comparePoint=((Rectangle)rect).getPoint();         return this.topCorner-topCorner;     }     else{         System.out.println("// ERROR BRO // ERROR BRO //");     }     return 0; } public String toString(){     return "(H:"+height+", W:"+width+", P:"+topCorner+")"; } }   ===========================================================================  public class RectangleComparable { public static void main(String[]args){     Random rn=new Random(21);     ArrayList<Rectangle> list1=new ArrayList<>();     for(int index=0;index<10;index++){         int ran1=rn.nextInt(21), ran2=rn.nextInt(21),                 ran3=rn.nextInt(21), ran4=rn.nextInt(21);         list1.add((new Rectangle(5,ran2,ran3,ran4)));     }     System.out.println("KEY : H=height, W=width, P=point\n");     System.out.println("Unsorted List : \n"+list1+"\n");     Collections.sort(list1);     System.out.println("Sorted List : \n"+list1); } }   I'll go ahead and apologize if this is somehow a duplicate question. I looked around, but I didn't find anything that gave me a really direct answer (because I'm still a programming noob).

Assume you have some objects which have several fields they can be compared by:  public class Person {      private String firstName;     private String lastName;     private String age;      /* Constructors */      /* Methods */  }   So in this example, when you ask if:  a.compareTo(b) > 0   you might be asking if a's last name comes before b's, or if a is older than b, etc...  What is the cleanest way to enable multiple comparison between these kinds of objects without adding unnecessary clutter or overhead?   java.lang.Comparable interface allows comparison by one field only Adding numerous compare methods (i.e. compareByFirstName(), compareByAge(), etc...) is cluttered in my opinion.   So what is the best way to go about this?


This pre-existing question on askubuntu.com purports to solve the problem of installing the reboot of HTML Tidy: . However, when I followed the accepted answer's instructions on Xenial 16.04.2, I encountered a problem that was not covered there, so am creating a new question.  I do the following:  wget https://github.com/htacg/tidy-html5/releases/download/5.4.0/tidy-5.4.0-64bit.deb sudo dpkg -i tidy-5.4.0-64bit.deb   and get this error:  dpkg: error processing archive tidy-5.4.0-64bit.deb (--install): trying to overwrite '/usr/lib/libtidy.so', which is also in package libtidy-0.99.0 2009 1223cvs-1.5   I do not already have the older tidy package installed, but I went through the motions of uninstalling it anyway:  sudo apt-get -y autoremove tidy Package 'tidy' is not installed, so not removed   No change in ability to install tidy 5.4.0 afterwards, or the error message that ensues.   Here is the result of apt-cache policy:  apt-cache policy libtidy-0.99-0 libtidy-0.99-0:   Installed: 20091223cvs-1.5   Candidate: 20091223cvs-1.5   Version table:   *** 20091223cvs-1.5 500   500 http://archive.ubuntu.com/ubuntu xenial/main amd64 Packages   100 /var/lib/dpkg/status

For example:  $ sudo apt-get install curl Reading package lists... Done Building dependency tree Reading state information... Done You might want to run 'apt-get -f install' to correct these: The following packages have unmet dependencies: bsh : Depends: libjline-java but it is not going to be installed groovy : Depends: libjline-java but it is not going to be installed rhino : Depends: libjline-java but it is not going to be installed E: Unmet dependencies.   Try 'apt-get -f install' with no packages (or specify a solution).   I get the same or similar errors when I attempt to install clojure1.3, leiningen, and several other packages.   When I try the suggestion made in the error message, this is what happens:  $ sudo apt-get -f install  Reading package lists... Done Building dependency tree        Reading state information... Done Correcting dependencies... Done The following packages were automatically installed and are no longer required:   diffstat linux-headers-3.2.0-26-generic linux-headers-3.2.0-26 dh-apparmor dkms html2text libmail-sendmail-perl libsys-hostname-long-perl Use 'apt-get autoremove' to remove them. The following extra packages will be installed:   libjline-java Suggested packages:   libjline-java-doc The following NEW packages will be installed:   libjline-java 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. 23 not fully installed or removed. Need to get 0 B/72.0 kB of archives. After this operation, 129 kB of additional disk space will be used. Do you want to continue [Y/n]? Y (Reading database ... 226243 files and directories currently installed.) Unpacking libjline-java (from .../libjline-java_1.0-1_all.deb) ... dpkg: error processing /var/cache/apt/archives/libjline-java_1.0-1_all.deb (--unpack):  trying to overwrite '/usr/share/java/jline.jar', which is also in package scala 2.9.2-400 Errors were encountered while processing:  /var/cache/apt/archives/libjline-java_1.0-1_all.deb E: Sub-process /usr/bin/dpkg returned an error code (1)  $ sudo apt-get upgrade Reading package lists... Done Building dependency tree        Reading state information... Done You might want to run 'apt-get -f install' to correct these. The following packages have unmet dependencies:  bsh : Depends: libjline-java but it is not installed  groovy : Depends: libjline-java but it is not installed  rhino : Depends: libjline-java but it is not installed E: Unmet dependencies. Try using -f.


I'm a girl, younger than 16 years of age, and live in a country where getting divorced is considered VERY BAD in the society for both the parents and the children. My father can't cope up with my mother and we hear an argument daily where he almost every time says to give a divorce to my mother. My mum is very egoistic,and doesn't understand that we could perfectly live happily and there is nothing wrong with dad (she thinks he has an affair although he doesn't and has explained to her like a gazillion times...). If they get divorced it would have a greater effect on me and my brother's life than theirs as they are both about the age of 40.  WHAT DO I DO???!!! I'm so confused and tensed and scared.... Help me, PLEASE!

I am a young teenager, younger than 16. (I do not want to give my age online)    My dad told me he wants a divorce, but I don't want my parents divorced. My dad says he can't stand my mom anymore.  My dad is older than 45 and my mom is older than 40.    If it happens, I would choose to stay with my mom. My dad can cook and drive, but my mom can't. There's a school bus in high school though.    What can I do to prevent this divorce?


A term used in a contract stated this "Specialist oils or spark plugs may be required for your vehicle's service.  Specialist oil is at a set cost of £24 whilst if recommended Spark Plugs will be quoted to you on the day of your service.", In the first sentence, does "Specialist" describe only "oils" or both "oils" and "spark plugs"? Does the second sentence clarify anything in the first?

Can you grab the blue shirts and socks?   Is the above sentence stating that both the shirts and the socks are blue? Or only the shirts?  At this stage, I am leaning towards the earlier (only the shirts) — though writing "Can you grab the blue shirts and blue socks?" seems redundant.


I use shared profile for firefox between Windows 7 and Ubuntu 12.04. The shared profile is in a common disk partition/file-system. Due to this reason firefox doesn't start till I load the shared hard disk in Ubuntu.  I have Ubuntu 12.04 installed inside Windows-7 using wubi. The shared drive I am talking about is actually the other disk partitions in Windows.  I wanted to know how to configure Ubuntu so that it automatically loads the shared disk partition/file-system at startup?   I read . My result for  sudo blkid   is  /dev/loop0: UUID="4b7302d4-3802-433e-8208-2cbd0a0c2ea1" TYPE="ext4"  /dev/sda1: SEC_TYPE="msdos" LABEL="DellUtility" UUID="5450-4444" TYPE="vfat"  /dev/sda2: LABEL="RECOVERY" UUID="3E3A243D3A23F097" TYPE="ntfs"  /dev/sda3: LABEL="OS" UUID="F25608385607FFD9" TYPE="ntfs"  /dev/sda5: UUID="5AB27043B2702623" TYPE="ntfs"    How do I find which of these to use in the startup command?   I have absolutely no idea which of the above 5 have the firefox profile. I know it is in E: drive in Windows 7. In Ubuntu it is shown as 141 GB file system and at the top a number 5AB2704 something is present. How to find out which of the above 5 is the file-system that I want.

I use Ubuntu 11.10 and Windows7 dual boot with Ubuntu as my primary OS.  Every time I need to access a document I need to mount the respective drive, though this is not at all tiresome, still, is there any way that drives becomes automatically mounted when I login?


I am the author of an add-on for Blender 2.8.  I have one user that is experiencing an error. I understand what is causing it, but I don't understand why.  My add-on is selecting the "Standard" option from this list:    The user, however, does not have that option. Hist list looks like this (note also the different Display Device):    We are both using clean installs of the latest Blender 2.8 beta (11 July 2019 build).  What exactly is "sRGB / BT.709"? Why does he have this option, whereas I do not?

I've just read that Filmic is not completely implemented: .      Notes:         The results appear to be identical to the original Filmic config, but I left out some parts like the renaming of color spaces, BT.1886, grayscale and new roles. Some of those things might be worth adding as well if they are backwards compatible.         ...   Q: Are there significant differences between Filmic shipped with Blender and its ? Before going down the rabbit hole: What does that mean to us and what version is preferred?


Consider a scenario where an elevator is moving up with constant acceleration 'a'. If a stone is thrown from it will the stone also possess an acceleration 'a'?  Because i know that if we throw a stone from an elevator moving with uniform velocity the stone also acquires that velocity,so what will be the case with uniform acceleration.

A stone is released from an elevator going up with acceleration of $g/2$. What is the acceleration of the stone just after the release?  The answer is $g$. Shouldn't the stone carry the acceleration of the elevator and be $-g/2$?


I am developing iOS application on Swift and I want to add a done button to the Decimal Pad Keyboard Type. Do I need to create an Application Extension for Custom Keyboard  to recreate Decimal Pad with a done button or is there another way. I only need this keyboard to be accessible within my app. Thanks.

In several cases I want to add a toolbar to the top of the iPhone keyboard (as in iPhone Safari when you're navigating form elements, for example).    Currently I am specifying the toolbar's rectangle with constants but because other elements of the interface are in flux - toolbars and nav bars at the top of the screen - every time we make a minor interface change, the toolbar goes out of alignment.  Is there a way to programmatically determine the position of the keyboard in relation to the current view?


Others have asked about ; the solutions there (using \strip@pt to remove the units, or using \number to convert to an integer number of sp units) work fine for a regular length but not for one with skip/glue (as described in ).  For example, the following  \documentclass{article} \begin{document} \newlength\testlength \setlength\testlength{10pt plus 2pt minus 1pt} length: \the\testlength\par \textbackslash strip@pt: \csname strip@pt\endcsname\testlength\par \textbackslash number: \number\testlength\par \end{document}   prints:  length: 10.0pt plus 2.0pt minus 1.0pt \strip@pt: 10 plus 2.0pt minus 1.0pt \number: 655360

This might be a silly question, but I can't seem to be able to find the answer anywhere: suppose I have this simple plain TeX code:  \newskip\myskip \myskip = 10pt plus 4pt minus 2pt   Now, how can I access (read) those stretch and shrink parts, those 4pt and 2pt values?  After David's answer: this is what I wanted:  %%%! tex \newskip\spaceskipFixed  % nonsensical values just for testing \spaceskipFixed = 10pt plus 4pt minus 2pt \spaceskip = \spaceskipFixed  % wrong, glue becomes dimen, stretchability and shrinkability gone \def\modifyspaces #1 {%     \spaceskip = #1\spaceskipFixed }  \def\text{Aha oho haha hoho!} \newbox\gauge \setbox\gauge = \hbox{\modifyspaces .5 \text} \def\showline #1#2{     \line{\hbox to\wd\gauge{#1\hfill}\hskip 2em {\spaceskip = 0pt\tt\% #2}\hfill} }  \line{\text\hskip 2em{\spaceskip = 0pt\tt \% unmodified, wild spaces}\hfill} \vbox to 0pt{\noindent\kern \wd\gauge\hbox{\vrule width .1pt height 0pt depth 15mm}\par\vskip -15mm} \showline{\modifyspaces .5 \text}{simple text with modified spaces, width \the\wd\gauge} \showline{\hbox to 92pt {\modifyspaces .5 \text}}{hbox to 92pt, no shrinkability => overfull}  % fixed \def\modifyspaces #1 {%     \spaceskip = #1\spaceskipFixed plus #1\gluestretch\spaceskipFixed minus #1\glueshrink\spaceskipFixed } \showline{\hbox to 92pt {\modifyspaces .5 \text}}{hbox to 92pt, shrinkability preserved, all shiny} \bye


How can I prove the Boolean algebraic rule $$A+A'B=A+B$$ without using a truth table?  With the truth table, it is easy to see that the two are equal, but how can I prove it using lesser Boolean identities?

For me, it is pretty clear that $a + \overline{a}*b = a + b$, because the first $a$ in the or will make sure that if the second term must be 'evaluated', $a$ will always be false, and therefore won't matter in the and - probably because I'm a programmer and it is very common to see this unnecessary cluttering in long if-else structures.  I can easily prove it with the truth table as well, just make both expressions', and turns out they are identical.  But I was looking for a 'algebraic' way to prove it. That is, something using the basic operations properties like the fact that they are transitive, commutative, associative, etc. For example, if I was to prove this other simple identity $a + a*b = a$ I would simply do something like:  $a + a*b = a*(1 + b) = a*1 = a$.  Is there a way to also prove the former using this algebraic operations, without resorting to the truth table?


The only thing I remember is that the main character and travels with a woman in a kind of tank in a post-apocalyptic world. At some point, the robot woman is hurt and broken… (you can see some led light in her face). The man fires up the tank.  It was a movie. I show it on TV. Should be from the eighties. Also is a real action movie.  About the characters. The girl was not blonde for sure. They use rifles and shotguns..  The van/tank had a upper round trap door and a side door. It was armored.   Then man and the robot had some kind of relationship... even sex.  While not damaged, the girl had nothing visually identifying she as a robot.

I am trying to identify a sci-fi movie from the 80's or 90's, with the following parameters:  Setting:    Scenes of a red desert planet   Culture:    Either people roam fairly solo and try to acquire resources to survive, or you live in a weird society where if a stranger is captured he needs to play in a game of fight to the death.  Mobility:      One foil character has a giant battle-bot-looking tank as his form of transportation through the desert. Protagonist has a car that has a plastic half bubble on top to look out from.   Robot:      The protagonist runs around in the beginning of the film with a female robot/android whose face is melted off after it has acid touch its face.(This scene happens next to the protagonist's rover)  Love interest:      Somehow protagonist comes across female protagonist in desert. She smells really bad and is hungry. They sleep outside, and he tells her to sleep away from him. He uses a thermal blanket(the first I ever saw in my life). She wakes up next to him, smelling horrible. He bathes her in some water hole they find(as if water were not scarce and they could just waste water.)   Pupa monsters:      Scene where they are in a building and they are trying to get out. They come across a room that is white, in which multiple giant, white, snot, pupa are hanging securely from the ceiling. Through curiosity, they disturb them, and now they have to get out of that room fast.  Boss Antagonist:      Pervert bionic man, that is actually attached to a giant robotic arm, as only form of movement. He is in black and has a pale bald head as his most human looking part.


I am trying to find out how many Amperes I will need to reach a certain temperature in a certain time (Milliseconds)  I need a thick wire to slow the melting of the wire. "Nichrome is the wire I'll be using" now in the American Gauge. I want to use 12 as its thick but not too thick and on Wikipedia, when I was checking how many amps I will need to reach a specific temperature using that gauge type it said I will need around 39.03A to reach around 1400F but in what time period will I reach that? Thicker wires are much slower to heat up but smaller wires are very weak.   P S I am very new to the American Wire Gauge so forgive me if I'm wrong.    I need a thicker, more sturdy wire that can put in a high PSI environment and still reach temperatures of 2-4 millisecond. The problems i see is thicker wire don't have as much resistance and a smaller mutil-twisted smaller wire. Is there away i can change that and still reach my desired temp of 1400F?


I tried to insert some data into my database table using JDBC, but it throws some exception like--> java.lang.NullPointerException There is no error in my connection I guess!  Here is the code--> package batch2;  public class Database {     Connection con;     Statement stm;          Database(){         try {             Class.forName("com.mysql.cj.jdbc.Driver");                          con=DriverManager.getConnection("jdbc:mysql://localhost:3306/javabatch2", "root", "");         }          catch (Exception ex) {             Logger.getLogger(Database.class.getName()).log(Level.SEVERE, null, ex);         }      }          public void addStudent(String name, String phone, String email){         String sql= "insert into student(name, phone,email) values ('"+name+"',  '"+phone+"',    '"+email+"')";                  try{             stm.execute(sql);         }catch(Exception ex){              System.out.println(ex);   ***//exception trows here***         }              }  }  Here is my main class--> package batch2;  public class Main1 {       public static void main(String[] args){         Database obj = new Database();                  obj.addStudent("hola", "875423", "hola@gmail.com");         System.out.println("Added into student table DONE");     }      }

What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?  What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?


I would like to do something like this $("#A").on("click", function(){     $.event.trigger({type:"custom"}); }); $("#B").on("custom", function(e){     $("#B").removeClass("hidden"); }); $("#C").on("custom", function(e){     alert("something"); }  Where I trigger a custom event using JavaScript. I would then like to be able to use the .on function on different elements throughout the page. Clicking the "#A" would then trigger the event for all registered elements. I noticed that the trigger function is called on an element instead of globally, which is not what I want.

I'm looking for some input on how to implement custom eventhandling in jquery the best way. I know how to hook up events from the dom elements like 'click' etc, but I'm building a tiny javascript library/plugin to handle some preview functionality.  I've got a script running to update some text in a dom element from a set of rules and data/user input I got, but now I need that same text shown in other elements that this script can't possibly know of. What I need is a good pattern to somehow observe this script producing the needed text.  So how do I do this? Did I overlook some builtin functionality in jquery to raise/handle user events or do I need some jquery plugin to do it? What do you think is the best way/plugin to handle this?


In my homework, I have some problems with scanf function:  /* Can Doğu */ #include <stdio.h> #include <stdlib.h> #include <math.h>  /* My Function prototypes */ double calculate_profile_area(int edgecount,double edgelength); // Has two parameters: edgecount & edgelength. Returns double type value. double calculate_volume(double a,double h); // Has two parameters: profilearea & boxheight. Returns double type value. double calculate_price(double p); // Has one parameter: volume. Returns double type value.  /* My main function */ int main(void) {  /* Variables & input-output part */ int count; double length,height,area,volume,price; area=0.0,volume=0.0,price=0.0; printf("Enter edge count for box profile: "); scanf("%d",&count); printf("Enter the profile-edge length and box-height: "); scanf("%lf%lf",&length,&height);  /* Calling my functions */ area=calculate_profile_area(count,length); volume=calculate_volume(area,height); price=calculate_price(volume);  /* Printing the results */ printf("Box profile area is %.2lf cm square.\n",area); printf("Box volume is %.2lf cm cube.\n",volume); printf("Total sugar price is %.2lf TL.\n",price); system("pause"); return(0); }  /* calculate_profile_area function */ double calculate_profile_area(int edgecount,double edgelength) { double profilearea=0.0; profilearea=edgecount*((edgelength*edgelength)/(4*tan(M_PI/edgecount))); return(profilearea); }  /* calculate_volume function */ double calculate_volume(double a,double h) { double v=0.0; v=a*h; return(v); }  /* calculate_price function */ double calculate_price(double p) { double cost=0.0; if(p>=0 && p<=500)     cost=p*120; else if(p>=501 && p<=1000)     cost=p*100; else if(p>=1001 && p<=2500)     cost=p*80; else if(p>=2501 && p<=5000)     cost=p*65; else if(p>=5001)     cost=p*50; return(cost); }   When I enter a double value (2.15), my compiler reads it as 2.14999999. Thus my 'area' result is calculated as 54.59 (which should be 54.60). Any idea why my result is not correct?

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


Let $S$ be the subspace of vector space of all real $n\times\ n$ matrices generated by all matrices of the form $AB-BA$ with $A$ and $B$ in vector space all $n\times\ n$. What is the dimension of $S$?

Let $S$ be the subspace , of  $M_{n \times n}(\mathbb R)$ (the vector space of all $n \times n$ real matrices ) , generated by matrices of the form $AB-BA$ , where $A,B \in M_{n \times n}(\mathbb R)$ , then how do we prove that $\dim S=n^2-1$ ? The only thing that I can determine is that the trace of all matrices of $S$ is $0$ . Please help


I'm working for an e-commerce client who has requested a design for a newsletter signup modal to appear on page load the second time a user visits the site. I've tried to explain to them that blocking a users progress with a popup wall which forces them to click is bad UX, that modals should be triggered by a user action and not just by arriving somewhere and that there are ways to display this sign up that won't annoy users.   Are there more concrete figures/studies I can point to that help make avoiding this a bit more straight forward? They heard it "isn't so bad" from an "ECRM industry expert" and I'm pretty sure ECRM will beat poor old UX unless I get some support.

I had a client request that they wanted a mailing list popup like the example given below where the popup is presented to the user as soon as they land on the site    I am a little concerned about the effectiveness of this popup in terms of conversion and the potential for it being an annoyance. I did some research on what the general view is on mailing list popups and there seems to be consensus that they can help in increasing conversions but they can be really annoying as well. However most of this information was garnered by discussions in forums about such methods to sign up people. I am wondering if there is any research on whether such a popup is bad usability or there are pros which outweigh the cons?


When I take a photo on my Nikon D5000, it comes up with an error "press shutter release button again". When I do that, it gives me the same error, and my pictures turn black. Also, when I take my lens off, the mirror is stuck up.

The LCD on my Nikon D3000 is displaying the following error message:     Error. Press shutter release button again.   I have pressed the shutter release button but the camera still does not work.


As some context I am looking to research into the area of prime numbers out of interest and to apply computer science and mathematical concepts I have studied. I am primarily wondering what are some common applications for the study of prime numbers? I am currently looking in depth to the creation of public keys in RSA cryptography, and attempting to discern if it is possible to compute the prime roots of such a public key. What I wonder though is if this has useful application (other than for those that would want to crack RSA encryption)? I also gather from my searching that prime numbers are integral to concepts such as checksums, has functions and other similar methods, but I am not quite as confident how so. So the concise version of my question is "what are some applications to the study of prime numbers specifically in a field at least partially related to cryptography?".

My understanding of hashing and encryption is rather limited. I certainly do not understand the mathematical formulas at play in these algorithms. With that said, what part do prime numbers play in cryptography?  When I was in college, one of my professors told me that the fact that there is no formula to predict a prime number (other than just trying them) is what makes many encryption schemes (like PGP) so secure, since it's not possible to guess the number used for the public/private key in any reasonable amount of time. Is that correct?


I would like to prevent one site in particular from showing up in my hot network question list.  Is there any way to do that?

I was going to make a filter for the "" by excluding some sites from it.  I noticed  which talks about "negative filtering" but does not explain how one can do it or if it is possible.  There does not seem to be a way to do this, though.  On the filter page, my only options are:  So how can I do "All sites except [list]"? It would also be nice if this could include similar functionality with the meta checkbox.  Something like "All main & meta sites except..."


I need help proving "For each $x,y,z$ in $\mathbb{N}$, if $x<y$, then $xz<yz$."  This must be done using Peano's axioms and the definitions of addition, multiplication, and ordering.   I have tried induction on z, and the base case works out but I run into an issue when it comes to the inductive part seeing as I am no longer dealing with equality.   Maybe induction is not the correct approach to this proof, and maybe a direct $P\implies Q$ proof would be more logical, however once I assume $x<y$, I don't have much to work with to deduce $xz<yz$, besides the definition of order.

Let $a,b,c\in \mathbb{Z}$. If $ac>bc$ and $c>0$, then $a>b$   I think I would use contrapositive to prove this. But I am not sure proper contrapositive statement.   Is it If $a<b$, then $ac<bc$, and $c<0$.? If so, contrapositive is not a good choice, isn't it?


While practicing math for the SAT, I came across the question-   What is the sum of the solutions to $\sqrt{3x+13} = x+3$?  The first step I did was to make it a quadratic from the given equation.  Working with the quadratic, $x^2 + 3x -4$, I factored it down to $(x+4)(x-1)$.  I then checked each solution with the original equation. For $x=1$, I found the equation to hold true as $\sqrt{(3*1)+13} = 1+3$  My question then comes from when I tried to check $x=-4$.  $\sqrt{(3*-4)+13} = -4+3$  $\sqrt{(-12)+13} = -1$  $\sqrt{1} = -1$ (Or so I thought)  The answer to the problem was 1 as it did not include $x=-4$ to be a proper solution. Upon seeing this, I decided to do some research.  According to the book, , by I.M. Gelfand, Alexander Shen:     "To be exact, a square root of a nonnegative number $a$ is a nonnegative number whose square is equal to $a$"   For example: $\sqrt{25} = 5$ and $5^2 = 25$  What confuses me is why we cannot also include $-5$ as a solution to the square root, because $-5^2 = 25$

Last year in Pre-Algebra we learned about square roots. I was taught then that $\sqrt{64}=8$ and $\sqrt{100}=10$, which I understood and accepted. I was also taught that $\pm\sqrt{64} = 8,-8$ because both of those numbers squared is 64, which I also get. But this year, with a new school and teacher in a different state, our teacher is telling us that: $\sqrt{64}=8,-8$ and $\pm\sqrt{64}$ also is $8,-8$. The way to get the positive root of something is: $+\sqrt{64}=8$ And these seem to contradict each other. I was always taught that a regular square root returned a positive number and only a positive number, but now my teacher is saying a regular square root gives two numbers, and considering the square root of a number $n$ is defined as $y^2=n$ I see where he is coming from. Upon researching this Wikipedia says:  For example, $4$ and $−4$ are square roots of $16$ because $4^{2} = (−4)^{2} = 16$  And Wolfram MathWorld says:  Note that any positive real number has two square roots, one positive and one negative. For example, the square roots of $9$ are $-3$ and $+3$  But on the other side, Wolfram Alpha, when given "The square root of 9" gives only 3.  So, which is right? Is $\sqrt{64}$ considered $8$? or is it $8,-8$?


The RSA trapdoor permutation as I understand goes like this,  choose $N$ such that $N= p*q$ where $p$ and $q$ are large random primes.  Therefore $N$ is NOT prime  choose integers $e, d$ such that $e \cdot d =1 \bmod \phi(N)$  $F(pk, x) = y = x^e \in \mathbb{Z}_N$  $F^{-1}(sk, y) = y^d$   The proof that $y^d = x$ involves Euler's theorem whih states that $x^{\phi(N)} =  1$ only for $x \in \mathbb{Z}_N^*$. But this means that there are $x \not\in \mathbb{Z}_N$ for which the proof does not hold. The user of RSA, however, decides $x$, what if user chooses an $X$ not in $\mathbb{Z}_N^*$?  Would RSA break down in such cases?

I decided to read the original RSA paper A Method for Obtaining Digital Signatures and Public-Key Cryptosystem because of a question I had about RSA (which is not the question I'm about to ask, but may be a question on here at some time) and came across something I had never seen before in any textbook description of RSA (Note: this comes from the beginning of ).  for any integer (message) $M$ which is relatively prime to $n$, $M^{\phi(n)} \equiv 1\pmod{n}$  The part I don't recall ever hearing in class, or coming across in a text book, or seeing in any description of RSA I've ever read is that $M$ and $n$ must be relatively prime. So, I decided to play around with a toy example of RSA to see what would happen. I use $p=13$, $q=31$, $e=7$ and $M=2p=26$ (for completeness: $d=103$, $\phi(n)=360$, $n=403$). I observed the following using my toy instance of RSA: $M^e\equiv M\pmod{n}$, $M^e\equiv 0\pmod{p}$ and $M^e\equiv M\pmod{q}$. Do these equivalences hold for all $M,p,q$ when $M$ and $n$ are not relatively prime? How would I prove this? What is the real-world effect of this?


I am trying to get a substring from square brackets in a string, I tried multiple regexes but nothing works.  I tried multiple regexes and code from multiple stackoverflow posts but nothing works.  String mydata = "some string with [the data i want] inside"; Pattern pattern = Pattern.compile("[(.*?)]"); Matcher matcher = pattern.matcher(mydata); if (matcher.find()) {     System.out.println(matcher.group(1));     output = output.replace("%item%", matcher.group(1)); }   It should return "the data i want" but instead it says that no pattern was found.

I am tired of always trying to guess, if I should escape special characters like '()[]{}|' etc. when using many implementations of regexps.  It is different with, for example, Python, sed, grep, awk, Perl, rename, Apache, find and so on. Is there any rule set which tells when I should, and when I should not, escape special characters? Does it depend on the regexp type, like PCRE, POSIX or extended regexps?


Is there a way to check if we already have the patch for the Cryptsetup vulnerability that's in the news recently?    I keep on getting software updates from the software center and I am not sure if one of those is for this specific vulnerability.  Thanks,

Today a couple of buffer overflows in NTP were announced , . It looks like updating my system to fix these issues is in order.   How can I find out if they have been fixed in the Ubuntu repositories, such that if I were to run:   sudo apt-get update sudo apt-get upgrade   then the fix would get installed and the vulnerability closed?   Edit: The selected answer specifically addresses the question of how to identify if a given CVE has been fixed or not, "Does Ubuntu generally post timely security updates?"  is certainly related but not identical


I am a cross-platform developer working on both android and ios platforms. For my ios development i used Xcode with ios simulator to make my work easy, and i got a new pc to work with. Whenever i tried to run Xcode with my build running on a simulator, the data is just flowing in and out like a river. I tried many things, and even removed the apple id and related accounts from my PC, but of no use.   nsurlsessiond takes on GB's and i dont know what it takes from me. Is there any way to get rid of this data eating monster so that i can work peacefully??

I'm a software developer and as such I build and run programs hundreds of times per day. I've noticed that since I started using Catalina, after compiling and linking there is a delay (which can be seconds) when the internet is slow or having problems (I have bad internet often). If I disable wifi and rebuild, the delay goes away. How can I disable this so my builds run faster?