how to overwrite control+shift+power to start screensaver instead of lockscreen
How can I launch screensaver with a keyboard shortcut?
How to insert text before the first line of a file? I've been looking around sed command to add text into a file in a specific line. This works adding text after line 1:  sed '1 a\   But I want to add it before line 1. It would be:  sed '0 a\   but I get this error: invalid usage of line address 0.  Any suggestion? Clipping a figure to content Is it possible to clip a figure inserted with \includegraphics to contents? That is, remove all surrounding whitespace. What is hard reset and what is factory reset? It is mentioned at  that one should do Factory reset or hard reset. I'm a bit confused about what is hard reset?  Factory reset I suppose is using the option in settings to reset phone to the factory state i.e. when it was unboxed. Unable to lock the administration directory (/var/lib/dpkg/) is another process using it? I get this error when trying to use apt-get:  E: Could not get lock /var/lib/dpkg/lock - open (11 Resource temporarily unavailable) E: Unable to lock the administration directory (/var/lib/dpkg/) is another process using it?     How can I fix this? Seeking GeoServer tutorials? What are sources where I can learn how to use GeoServer?  I know of these two sites:    - which in fact is not working (at least at the moment)  - not only (tutorials) for GeoServer   But I am interested in more complex information, and not to read only documentation. If every pair of congruence equations admits solutions, then the entire system admits solutions Let a system of three linear congruence equations in integers be given;      \begin{cases}x\equiv b_1\mod c_1\\ x\equiv b_2\mod c_2\\ x\equiv b_3\mod c_3\\ \end{cases}   with $c_1,c_2,c_3\in\mathbb Z_{+}$. Show that, if every pair of congruence equations admits solutions, then the entire system admits solutions.    Now, if every pairs admits solutions, then for example $b_1\equiv b_2\equiv a\mod \gcd(c_1,c_2)$ for some $a$ then;   $x-a\equiv b_1-a\mod c_1$  $x-a\equiv b_2-a\mod c_2$  replacing $x$ by $x':=\frac{x-y}{\gcd(c_1,c_2)}$, we obtain:  $x'\equiv b_1'\mod c_1'$  $x'\equiv b_2'\mod c_2'$  and since $\gcd(c_1,c_2)=1$ by Chinese Remainder Theorem we have a unique solution $\mod{c_1'c_2'}$, so $x\equiv (\gcd(c_1,c_2)x'+a)\mod{\operatorname{lcm(c_1',c_2')}}\quad(1)$  We can do it with another pair (take $2$nd and $3$rd, since we know that such a pair admits solutions;  $x\equiv(\gcd(c_2,c_3)x''+a')\mod{\operatorname{lcm(c_2',c_3')}}\quad(2)$  Now how can I show that for the pair $(1)$ and $(2)$ also solutions exist ? Let $X$ be a metric space. Prove that if every continuous function $f: X \rightarrow \mathbb{R}$ is bounded, then $X$ is compact.  This has been asked before, but all the answers I have seen prove the contrapositive. Realistically, this may be the way to go, but is there way to exhibit an unbounded continuous function (under the assumption $X$ is not compact) without appealing to results beyond introductory real analysis (e.g., the solution I've seen involves the Tietze Extension theorem)?  Because we're working with metric spaces, it's clear that the assumption that $X$ is noncompact (towards proving contrapositive) will lead us to extract a sequence of points in the space with no convergent subsequences. But how can we infer the existence of an unbounded continuous on the space knowing only about some sequence of points in this space (without using anything too advanced)? How do I add SSL to a .net application that uses httplistener - it will *not* be running on IIS Most recent edits in bold I am using the .net HttpListener class, but I won't be running this application on IIS and am not using ASP.net.  This  describes what code to actually use to implement SSL with asp.net and  describes how to set up the certificates (although I'm not sure if it works only for IIS or not).    The class documentation describes various types of authentication (basic, digest, Windows, etc.) --- none of them refer to SSL.  It does say that if .  Is this going to be a one line property setting and HttpListener figures out the rest?    In short, I need to know how to set up the certificates and how to modify the code to implement SSL.  Although it doesn't occur when I'm trying to access HTTPS, I did notice an error in my System Event log - the source is "Schannel" and the content of the message is:     A fatal error occurred when attempting   to access the SSL server credential   private key. The error code returned   from the cryptographic module is   0x80090016.   Edit: Steps taken so far   Created a working HTTPListener in C# that works for HTTP connections (e.g. "" Created a certificate using makecert.exe Added the certificate to be trusted using certmgr.exe Used Httpcfg.exe to listen for SSL connections on a test port (e.g. 8090) Added port 8080 to the HTTPListener via listener.Prefixes.Add("); tested an HTTP client connection, e.g. (") in a browser and receive correct return tested an HTTPS client connection, e.g. (") in a browser and receive "Data Transfer Interrupted" (in Firefox) debugging in visual studio shows that the listener callback that receives the requests never gets hit when the HTTPS connection starts - I don't see any place that I could set a breakpoint to catch anything else earlier. netstat shows that listening ports are open for both HTTPS and HTTP.  the HTTPS port does go to TIME_WAIT after a connection is attempted.  and  don't catch any of the traffic, I guess it doesn't get far enough in the process to show up in those HTTP analysis tools   Questions   What could the problem be?  Is there a piece of .Net code I am missing (meaning I have to do more in C# other than simply add a prefix to the listener that points to HTTPS, which is what i have done) Have a missed a configuration step somewhere?  What else might I do to analyze the problem? Is the error message in the System Event log a sign of the problem?  If so how would it be fixed? How do I uninstall Ubuntu? How do I format drive and unistall Ubuntu 11.10?  I wanted a dual boot and was given an option to overwrite Windows XP partition and said yes.  Format options don't work.  I tried a few dos prompts and probably not using correct fdisk.  Format options state drive is busy closed all windows.  Tried to boot windows XP and disk says its corrupt. In ubuntu 11.04 there was a workaround using gconf-editor and setting key /apps/gnome_settings_daemon/plugins/xrandr/active to false.  However there is no such key in gconf-manager using ubuntu 11.10 (gnome 3). How do I create RAW TCP/IP packets in C++? I'm a beginning C++ programmer / network admin, but I figure I can learn how to do this if someone points me in the right direction. Most of the tutorials are demonstrated using old code that no longer works for some reason.   Since I'm on Linux, all I need is an explanation on how to write raw Berkeley sockets. Can someone give me a quick run down? Textbook approach to modeling non-proportional hazards in the Cox model In Cox models with time varying coefficients, the effect of covariates on the hazard is allowed to change through time. In cases where a coefficient has a linear relationship with time, I am aware of at least two text books ( and an Appendix to ) that advocate for the following model, first in R code:  coxph(Surv(time, death) ~ disease + disease:time)   And now in mathematical notation:  $$ h(t|X) = h_0(t) \exp(\beta_1X + \beta_2X_T) $$ Where $h(t|X)$ is the instantaneous hazard rate at time $t$ given covariates $X$; $h_0(t)$ is the baseline hazard rate; and $T$ is the censoring or event times. $\beta_1$ represents the log hazard ratio for individuals with $T=0$ (which is sort of nonsensical since you can't have $T=0$ in the data), while $\beta_2$ is harder to interpret... $\beta_2$ shows how the log hazard ratio depends on censoring/event times, but that is circular because event times are also the response variable (this point is made in Terry Therneau’s vignette “”).  According to Therneau's vignette, to correctly specify a time varying coefficient, you need to use the following model, first in R code:  coxph(Surv(time, death) ~ disease + tt(disease), tt=function(x,t,...){x*t})   And now in mathematical notation: $$ h(t|X) = h_0(t) \exp(\beta_1X + \beta_2X_T) $$  The difference is that the time interaction is with $t$ in the model rather than with the event times $T$ in the data. The resulting parameters are easy to interpret: they are the intercept and slope of the linear relationship between the log hazard ratio of $X$ and time. This approach seems like the proper way to model a time varying effect.  Can anyone justify or advocate for the first approach to modeling non-proportional hazards in the Cox model? If it is really incorrect (as I suspect it is), what are the practical consequences of using this approach? Beamer - Color of header foreground with AnnArbor theme I use beamer with the theme AnnArbor and colortheme whale.  I tried to use:  \setbeamercolor{section in head/foot}{fg=white, bg=blue}   or  \setbeamercolor{palette tertiary}{fg=white, bg=blue}   But for an unknown reason, the bg works but not the fg... The sections names stay black in the header.    EDIT : the problem comes from the hyperref package.  This code works well :  \documentclass{beamer} \usetheme{AnnArbor} \usecolortheme{whale} \setbeamercolor{frametitle}{fg=white,bg=blue}  \begin{document}     \section{Test 1}     \subsection{Test 1.1}     \begin{frame}         \frametitle{Test}     \end{frame} \end{document}   Whereas this one doesn't works :  \documentclass{beamer} \usetheme{AnnArbor} \usecolortheme{whale} \setbeamercolor{frametitle}{fg=white,bg=blue} \usepackage{hyperref} \hypersetup{     colorlinks=true,     linkcolor=black,     urlcolor=blue,     citecolor=gray,     frenchlinks=false,     pdfborder={0 0 0} }  \begin{document}     \section{Test 1}     \subsection{Test 1.1}     \begin{frame}         \frametitle{Test}     \end{frame} \end{document}   And that's pretty normal because of this line :  linkcolor=black, drupal 7 + services 3 - inserting nodes with select fields I'm using Drupal 7 + Services 3 to create nodes with POST and JSON. Everything works fine, except field types of select - entity reference select or plain text.  The entity reference uses the autocomplete widget, while the text select is a plain radio button.  This is the format I'm using:  "field_urgency": {     "und": [  {  "value": 1    }   ] } Is the complement of a prime ideal closed under both addition and multiplication? Fantasy book with shape shifting dragon warriors Set in a fantasy world with shape shifting Dragon kings and their warriors. They terrorize the humans, and kill those with magic.   The protagonist is the great-grandson of a powerful warlock. He finds out that he has magic, and fights with it to save his new friends, the Griffin, Blackhorse (I think that's his name), some creepy necromancer who is immortal, and Gwen (fellow sorceress), along with the kingdom that the Griffin rules in.   They fight the protagonist's father, the leader of the Dragon kings, the king's Duke, and the creepy sorcerer, who has a curse (when he dies, he changes side from good to bad, or bad to good). I have no clue what this is called, but I want to find out, since I'm out of things to read. MAXDOP not working? I wanted to test out MAXDOP on my computer. So I set MAXDOP to 2 for a specific query. However, when I looked at my logical processors in Task Manager as I ran the query, it looked like they were all being used. I thought that it would only be using 2 logical processors if MAXDOP was set to 2? Does anyone know what is happening? Please see image below.  Another issue is, the DOP returned by the execution plan said 1. Now I know that setting MAXDOP does not mean SQL Server will actually use the number set. However, given that it seemed all my 4 logical processors were being used to process the query, it made it even more strange to see DOP 1.  This is the query I ran:   This was what happened as I ran it (i.e. it looks like all 4 logical processors are being used to run the query): How to reduce the thickness of letters Non superscript citations for figures Is it possible to reference figures like so   taken from \emph{ref. \cite{reference}}   with non superscript numbers, while leaving the rest of the references in the bulk of the document untouched? This is using BibTeX and the . How to disable gedit side panel? How do i disable this stupid side panel of gedit, that somehow appeared? There is nothing in the settings or plugins. Tried rm -r -f ~/.config/gedit as well, with no success. I don't have big screen and i find it totally useless and eating up what little free space for editing documents i have. See Screenshot