I am using a Linux system. The X-Window will be closed if keyboard idles for 5 minutes. One way to avoid the closure of X-Window is to press the ENTER key within 5 minutes. My question: Is there an automatic way to "press" ENTER key from keyboard?  I tried the following command from a script but failed:  echo -ne "\r" &gt; /dev/myTTY   or  echo -ne "\n" &gt; /dev/myTTY   The newline or CR appears in the command line, but system did not seems to have received the command.
I just installed a fresh Ubuntu 12.04 (Precise Pangolin).   I noticed that, there is no screensaver settings, which is fine. I like to control the period of time after which the blank screen is shown,which automatically locks the screen.  I do not want to enable screensaver. I only wish to be able to change the idle time period required to lock the screen automatically. It seems to me, it is by default around 10-15 minutes.
Anyone know a simple method to swap the background color of a webpage using JavaScript? proving topological equivalence How would I show that $$d_E = \sqrt{\sum_{i=1}^n(x_i-y_i)^2}$$ and $$d_\infty= \sum_{i=1}^n|x_i-y_i|$$ and $$\sup\{|x_1-y_1|,|x_2-y_2|,...,|x_n-y_n|\}$$ are topologically equivalent on $\mathbb{R}^n$? I can do it for $\mathbb{R}^2$, but I'm not sure how a generalization looks like. How can I find the cheapest prepaid SIM card for a given country? Next month I am traveling to country X, where I would need Y minutes of calls, Z text messages and most importantly Q megabytes of data. How can I find the cheapest/most reliable SIM card for my needs? Managing constructors with many parameters in Java In some of our projects, there's an class hierarchy that adds more parameters as it goes down the chain. At the bottom, some of the classes can have up to 30 parameters, 28 of which are just being passed into the super constructor.  I'll acknowledge that using automated DI through something like Guice would be nice, but because of some technical reasons, these specific projects are constrained to Java.   A convention of organizing the arguments alphabetically by type doesn't work because if a type is refactored (the Circle you were passing in for argument 2 is now a Shape) it can suddenly be out of order.  This question might be to specific and fraught with "If that's your problem, you're doing it wrong at a design level" criticisms, but I'm just looking for any viewpoints. PythonTEX not working on current Overleaf compiler Is there a way to make PythonTEX compile as of today in Overleaf V2 ?  \documentclass[]{article} \usepackage[utf8]{inputenc} \usepackage{pythontex}  \begin{document} \begin{pyverbatim} def calc_ellipticity(theta, delta):     theta = np.deg2rad(theta)     psi = np.arcsin(np.sin(2*theta) * np.sin(delta))/2     return np.tan(psi) \end{pyverbatim} \end{document}   Compiling gives : ? PythonTEX ? Number of moves necessary to solve Rubik's cube by pure chance Suppose, random moves are made to solve Rubik's cube. A move consists of a $90$-degree-rotation of some side. The starting position is also random.   What is $E(X)$, where $X$ is the number of moves until the cube is solved ? How many moves must be made, that the probability that the cube is solved, exceeds $99$% ? Proving that kernels of evaluation maps are generated by the $x_i - a_i$ I want to prove that the kernel of the evaluation map $s_a : \mathbb{C}[x_1,\dots,x_n] \rightarrow \mathbb{C}, x_i \mapsto a_i$ where $a = (a_1,\dots, a_n) \in \mathbb{C}^n$ is the ideal generated by $\{x_1 - a_1, \dots, x_n - a_n\}$.    The proof in the book first shows it easily for the case $a = 0$, and says that by substitutions of variables $x_i' = x_i - a_i$, you can show it for the rest of the cases.  I know that $f \in \ker s_a$ iff $f(a) = 0$.  And $\phi : \mathbb{C}[x_1,\dots, x_n] \rightarrow \mathbb{C}[x_1 - a_1, \dots, x_n-a_n], x_i \mapsto x_i - a_i$ is a surjective ring homomorphism.  Please give a hint and not the full answer.  Thanks. I have a database with millions of phone numbers with free-for-all formatting. Ie, the UI does not enforce any constraints and the users are typing in whatever they want.  What I'm looking for is a Java API that can make a best-effort to convert these into a consistent format. Ideally, the API would take the free text value and a country code and produce a valid international phone number or throw an exception.  For example, a phone number in the system might look like any of the following:  (555) 478-1123 555-478-1123     555.478.1123 5554781123   Given the country of US, the API would produce the value "+1 (555) 478-1123" for all these. The exact format does not matter, as long as it's consistent.  There are also numbers in the system without area codes, such as "478-1123". In that case, I would expect a NoAreaCodeException, or something similar.  There could also be data such as "abc", which should also throw exceptions.  Of course, there are countless variations of the examples I have posted, as well as the enormous complication of international phone numbers, which have quite complicated validation rules. This is why I would not consider rolling my own.  Has anyone seen such an API? Formal Languages - Regular Expression I've been battling the following two questions for more than a day today.  Write a regular expression (comprised of {a, b}) that contain at least two b and do not contain abb. Write a regular expression (comprised of {a, b}) that contain abba and do not contain baa.  For the first part I wrote a basic one to start off with that doesn't handle the must two-b: b* OR a* OR (a+ AND b)* OR a*  I ran a few &quot;truth tables&quot; inputs over it and it seems ok. But the moment I add the requirement, things go haywire. Mostly because when pushing in those &quot;b&quot;s, you can suddenly use the OR to break things up. Same thing on the second one.... Any help would be greatly appreciated! Norah Should I be able to 'manually' rotate the headset? Why was Sirius ever convicted? tmux: enable mouse only when shift pressed overbrace/underbrace but with an arrow instead Is there a similar command to \overbrace{foo}^{bar} but instead of braces, an arrow pointing up/down?  EDIT: Here's a little demonstration of how I'd expect something like this to work:    And possible syntax would be \overarrow{a=b}^{\text{theorem X}} I have an UTF-8, polish text in .tex file. When I open it with my LEd (LaTeX editor), it shows ok (all characters can be seen). But when I try to compile it, I get error:  Package inputenc Error: Keyboard character used is undefined (inputenc) in inputencoding `utf8'.   I have to copy the text, cut it and paste to Notepad++, change (not convert!) encoding from UTF8 to ANSI (the polish characters will be missed and replaces with some random characters). Than copy it again and paste to LEd (in that editor, characters display bad also). But now I can compile my pdf and in it, the encoding is right again.  Is there a way to set encoding in the way I will see characters in LEd propertly and I will be able to compile it and I will get good characters in pdf?  The begging of my code:  \documentclass[12pt]{report} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{graphicx} \usepackage{amsmath,amssymb,amsfonts} \usepackage{txfonts} Fix Accessibility of the sites on the leagues (and other pull downs that share the same code path) please The  site picker seems to be ordered on-site statistics instead of alphabetically:  This makes it very hard to find Photography, Physics, and Philosophy (for example) since they are nowhere near each other in the list. I’m open to a better solution, but as it stands, this feels a little too user-hostile to assume everyone is only interested in the first 3 to 5 top visible hits in the ordered list.  Scanning pages of unorganized contents is not optimal Keyboard input should filter and not just jump around  It also breaks accessibility when someone wishes to access the list from a keyboard (or a slower input control) as opposed to a mouse and visually. "I think him to be about 50" or "I think he is about 50"? I have two options. Which one is correct?      a) I think him to be about 50.   b) I think he is about 50.   If both are correct, should I avoid one or the other? In the Breusch-Godfrey test we use a model  $$ e_t = \varepsilon_t + \beta_1 \varepsilon_{t-1} + \dots+ \beta_p \varepsilon_{t-p}. $$  If we reject the null hypotesis of no serial auotocorrelation of the error, it means that the residuals follow an auto-regressive model of order ($p$).  If I want to avoid this problem, I must add a certain number of lags of the response variable $y$ as regressors in the original model. However, in some cases this method is not useful.   Are there other options to consider? My organization is looking at developing mobile applications, we have a wealth of web development resources. There are many factors to consider in making the decision of how to develop this application such as Cost(s), platform support, performance, and maintainability.   But, I have not found any research that actually backs up the assumptions that users prefer the experience of a native app over a hybrid mobile web app (A hybrid app is a HTML5 app distributed in an embedded web view using PhoneGap, etc.).   Some  that native apps are more performant and have a better user experience, but why? Have there been any user surveys or analytics that indicate this user preference towards native? Wiki-tag edit error is non-descriptive I've been editing some wiki entries on the new Expatriates site, and started to get the following error:    When I go to a normal post, I see what is presumably the proper explanation:    Can the Wiki Tag edit error be updated to show a more meaningful error message? What is the best way of defining white noise process so it is intuitive and easy to understand?