I have been referring my new company's code, where I found the code was not wrapped around IF and ELSE so was little bit confusing in flow. For example:  if(user_is_registered)   {       // You are already registered.       //exit   } //New user's registration code goes here   While my last company was following the other way i.e. :  if(user_is_registered)    {       // You are already registered.    } else    {       //New user's registration code goes here    }   Like every fresher I am confused which is the best practice to follow with legitimate reasons. Please enlighten me. I tried to find out answers for the same, but could not get. Some of answers are there in which some experts are supporting way 1 some are supporting way 2. Please also suggest me other refs if available. Thank you.


model exported into FBX with texture material as "flat" instead of "box" even though its set to box

I'm trying to export a model with textures as an FBX. the export works fine except the texture comes out as flat. this is how model looks when its box:  this is how model looks when its flat:  this is how the model looks when exported as an FBX with "box":  i want the export to be like the first picture. the fire texture at the back is exported as "flat" and comes out in the FBX matching the model of the first picture (which is correct). the body texture in the middle is exported as "box" but comes out in the FBX matching the "flat" model in the second picture (which is wrong). has anyone encountered something similar to this?


Why would the Children of the Forest create the White Walkers, only to fight them later on?

It is my understanding that the Children of the Forest first created the White Walkers in order to protect themselves from the First Men. However, something must have happened that then the Children of the Forest and the First Men teamed up to defeat, or at least repel, the White Walkers. What is that something? Or am I misinterpreting the show?


My brand new ASUS computer does not seem to find a driver to make MEDIATEK MT7630e work? I've tried .  The driver then worked but the computer did not shut down anymore.  It seems to be a well-know problem that has not been fixed. Really? Never had a single unsolved problem with Ubuntu before.    *-network                       description: Ethernet interface        product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller        vendor: Realtek Semiconductor Co., Ltd.        physical id: 0        bus info: pci@0000:02:00.0        logical name: eth1        version: 10        serial: 1c:b7:2c:8e:e3:11        size: 100Mbit/s        capacity: 1Gbit/s        width: 64 bits        clock: 33MHz        capabilities: pm msi pciexpress msix vpd bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation        configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=full firmware=rtl8168g-3_0.0.1 04/23/13 ip=192.168.1.107 latency=0 link=yes multicast=yes port=MII speed=100Mbit/s        resources: irq:47 ioport:e000(size=256) memory:f7104000-f7104fff memory:f7100000-f7103fff   *-network UNCLAIMED        description: Network controller        product: MT7630e 802.11bgn Wireless Network Adapter        vendor: MEDIATEK Corp.        physical id: 0        bus info: pci@0000:03:00.0        version: 00        width: 32 bits        clock: 33MHz        capabilities: pm msi pciexpress bus_master cap_list        configuration: latency=0        resources: memory:f7000000-f70fffff    00:00.0 Host bridge: Intel Corporation Broadwell-U Host Bridge -OPI (rev 09) 00:02.0 VGA compatible controller: Intel Corporation Broadwell-U Integrated Graphics (rev 09) 00:03.0 Audio device: Intel Corporation Broadwell-U Audio Controller (rev 09) 00:04.0 Signal processing controller: Intel Corporation Broadwell-U Camarillo Device (rev 09) 00:14.0 USB controller: Intel Corporation Wildcat Point-LP USB xHCI Controller (rev 03) 00:16.0 Communication controller: Intel Corporation Wildcat Point-LP MEI Controller #1 (rev 03) 00:1b.0 Audio device: Intel Corporation Wildcat Point-LP High Definition Audio Controller (rev 03) 00:1c.0 PCI bridge: Intel Corporation Wildcat Point-LP PCI Express Root Port #1 (rev e3) 00:1c.2 PCI bridge: Intel Corporation Wildcat Point-LP PCI Express Root Port #3 (rev e3) 00:1c.3 PCI bridge: Intel Corporation Wildcat Point-LP PCI Express Root Port #4 (rev e3) 00:1f.0 ISA bridge: Intel Corporation Wildcat Point-LP LPC Controller (rev 03) 00:1f.2 SATA controller: Intel Corporation Wildcat Point-LP SATA Controller [AHCI Mode] (rev 03) 00:1f.3 SMBus: Intel Corporation Wildcat Point-LP SMBus Controller (rev 03) 00:1f.6 Signal processing controller: Intel Corporation Wildcat Point-LP Thermal Management Controller (rev 03) 02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 10) 03:00.0 Network controller: MEDIATEK Corp. MT7630e 802.11bgn Wireless Network Adapter  0: asus-wlan: Wireless LAN     Soft blocked: no     Hard blocked: no 1: asus-bluetooth: Bluetooth     Soft blocked: yes     Hard blocked: no


Java Rounding to specific decimal places

I am trying to write a java program that rounds to one decimal place less. For example if I have a total of 32.45678 it should be 32.4568 or if its 0 it should be 0.0. Here is what I have so far. Thanks  import java.text.DecimalFormat; import java.util.Scanner; public class product{    public static void main(String[] args) {     Scanner scan = new Scanner(System.in);     System.out.println("Enter the first number:");      float f1 = scan.nextFloat();     System.out.println("Enter the second number:");      float f2 = scan.nextFloat();     float p = f1*f2;      DecimalFormat df = new DecimalFormat(".####");     System.out.println("Product: "+df.format(p));    }  }


I am retrieving the list of all the fields and trying to serialize. Using the code snippet below allfieldNames contains around 400 fields but Data >>> contains information related to only 100 random fields. Any idea ?   Map <String, Schema.SObjectType> schemaMap = Schema.getGlobalDescribe(); Map <String, Schema.SObjectField> fieldMap =  schemaMap.get('Case').getDescribe().fields.getMap(); String allfieldNames = ' '; for(Schema.SObjectField fields : fieldMap.Values()) {  if (allfieldNames == ' ') {     allfieldNames = allfieldNames + fields; } else {     allfieldNames= allfieldNames + ', ' + fields ; } } List<Case> lstCase = Database.query('SELECT '+ allfieldNames + ' FROM Case LIMIT 1'); system.debug('Test>>>>>'+lstCase.size()); if(lstCase.size()==1) { system.debug('Data>>>>'+ JSON.serialize( lstCase[0])); }


Prove that $\sin(\pi z)$ can be written as infinite product

Prove that  \begin{align} \sin(\pi z) = \pi z \prod_{n=1}^{\infty} \left( 1-\frac{z^2}{n^2}\right) \, \, \, \, \forall \, z \in \mathbb{C} \end{align}  The hint I had it's to use the Fourier series, but I really don't see how.  Any suggestions? Thanks in advance!


Hard disk drive stopped working after being connected just for 1 second and then disconnects

My hard disk drive stopped working. I have bought an external SATA to USB adapter and I have connected it and the disk makes noise and starts to spin. Nothing seems to be out of the ordinary. The computer detects it and opens the folder with the explorer, but instantly it stops working and does not detect it again until I disconnect and connect it again. What can the problem be? I’ve tried to put it in the fridge. Should I open it?


How to remove the "Could not connect to the iTunes store" error message when your network does not allow access to the iTunes Store

Since the last update, iTunes is unusable for me on my iMac, because with every song change it shows a "Could not connect to the iTunes Store" error message. My network at work does not allow access to the iTunes store, but that is ok. I just want to listen to my local music connection there. I have disabled the iTunes Store in the parental settings completely, but still, the error pops up with each and every song change. Any idea how to prevent iTunes from showing this popup?  There are two major annoyances here in iTunes imho a) iTunes tries to access the store even if it is disabled completely in the settings and you're signed out b) The error messages "staple" on top of each other, so iTunes diplays the same error 1000 times and you have to click them all away. This reminds me of Windows 95 times.


How to derive two keys from one password

What is the best way to generate two independent symmetric keys from one user-entered password or passphrase? Would using both scrypt and pbkdf2 achieve this?


When using tcpdump's `-i any` argument, how to get also interface name inline?

I'm diagnosing some networking issues with an inordinate amount of network interfaces on a Linux server.   I'm needing to dump all interface traffic as per tcpdump -i any, but I'm not finding any definition of the interface identifier (eth0, eth10, br4, etc.)   Is there a way to instruct tcpdump to include interface info with each packet per line?


The choice of pivot point in non-equilibrium scenarios

It is true that under equilibrium condition, no matter what pivot point one choose, the resulting net torque will always be zero. I wonder if this principle apply to non-equilibrium scenarios as well, namely, the net torque of the system being the same regardless of choice of pivot point? For example, if we put a sphere on a inclined smooth ramp, we would expect the sphere to slip down the ramp without rolling. However, if we choose the point of contact between the sphere and the surface of the ramp as the pivot point, we will have a torque due to gravity. Apparently this contradicts our assumption. What's the mistake here?


How do I go about proving this series expansion $$\frac{\sin^{-1}(x)}{\sqrt{1-x^{2}}}=\sum_{r=0}^{\infty}\frac{x^{2r+1}4^{r}}{(2r+1)\binom{2r}{r}}?$$  I have used this expansion while solving other problems but I tried and could not prove this expansion. I know the individual expansions of $\sin^{-1} (x)$ and $\frac{1}{\sqrt{1-x^{2}}}$. ...and they both contain the $\binom{2r}{r}$ in the numerator. I know that this must have something to do with the differentiation of the series expansion of $(\sin^{-1} (x))^{2}$. But in that case I do not know how to derive the series for $(\sin^{-1} (x))^{2}$. So if someone can provide a step by step proof of either one of the series then I would be really grateful. If the proof for one of the series is provided then I can prove the other series by differentiation or integration(obviouslt I have to show the conditions for term by term integration or differentiation are satisfied....but I will worry about that later).


What can I do about uncounterable spells?

I cast , sacrificing my only creature to kill my opponent.  My opponent responds with , which will win the game the other way.  Last Word says "This spell can't be countered."  What else can I do about it besides countering it to prevent my plans from being foiled?  (I'd really like to have the last word here.)    Historic Note: before of the April 2018 rules change, uncounterable spells with targets used to actually have different wording (still visible on the printed cards) implying that they still could be countered.  For example, Last Word said:     Last Word can't be countered by spells or abilities.   Meanwhile Akroma, Angel of Fury said:     Akroma, Angel of Fury can't be countered.


Garbage Collection setting object to null

Given  public class A {  public B First { get; set; } }        public class B {  public C Second { get; set;} } public class C  {   public D Third { get; set; }   }   And somewhere in the class you have this  var testClass = new A(); //All the properties have values in it and the class D has a property value that it is holding in to the memory //testClass.B = new B(); //etc..   What happens if you did testClass = null? What does testClass's reference now to the heap? And what about D that is holding to a value that it can't collect?  EDIT: Just to clarify, given D has an event that hasn't been unsubscribed and has 10,000 handlers. What happens to testClass = null?


I have a used note 4 and want to make sure there is no spyware or malware on it. I know some can survive a factory reset. Somebody told me to flash a rom and recovery image but not how to do this. I searched and came across a video of a person using a program called odin to do this, however after he was finished all his apps were still there. If this completely cleans the phone why are his apps still there?   What would be the best way for me to actually wipe everything on the phone?


The antonym of “greedy” is “generous”. Is there a word for “not greedy” (one who is content with what he has)?


What is the reason for having rep on Meta?  Why bother having up- or down-votes on meta? Isn't this a place to express your opinions? Why penalize people for expressing their opinions on this site?  Rep has nothing to do with expressing what peoples' ideas are, so why have it? For example, I, as a single-rep user can't comment, so this is penalizing me for my opinions.  The system also warns me that "you are about to be banned". So, because meta is about peoples' opinions and the community does not like that opinion, you should be banned?   This is a fault in the system IMO. Isn't a good site able to encourage opinions to make the site better? A good site is where there's the ability to discuss and have a back-and-forth discussion between users so as the site can become better. Obviously Jeff Atwood isn't working here anymore. If he did then maybe things could've gotten better.    EDIT: So from the comments, rep shows what your stance is in the community. If you have none then you have no say. Is that the site you want, especially on meta?  And anyone who thinks that this is perfect is wrong. Anything can get better, no matter how good it is.


Prove that $-1$ is an eigenvalue of an orthogonal matrix $A \in M_{4 \times 4} (\Bbb R)$ with $\det(A)=-1$

Let $A \in M_{4 \times 4} (\Bbb R)$ be an orthogonal matrix with $\det(A)=-1$. Prove that $-1$ is an eigenvalue of $A$.   I'm a bit lost. I know about all the basic orthogonal matrices' properties (including the ones about scalar product). I also know that orthogonal matrices' eigenvalues are $\pm 1$. Any tips, please?


"they had renovated" vs "had been renovating"

How can I understand the sentence 1b?   1 a When I last went to Moscow, they had renovated St Basil's Cathedral.    b When I last went to Moscow, they had been renovating St Basil's Cathedral  The explanation to 1b is: “they are still renovating the cathedral when I went to Moscow”, but as far as l know “had been doing” can also mean “had just finished something”, why does the answer give only one possibility? If it does mean “still doing”, is there any difference with “was doing”?


QUESTION CONTEXT: The universe is roughly 14B years while its diameter 93B light years, making radius 46.5B ly. If I understand correctly if we froze everything, go on the one side, then go to the other by the speed of light while everything else would be frozen, it would take us 93B ly. From the spectator POV however, the Big Bang happened 'only' 14B years ago. Is this caused by time dilation/relativity of time of observer to moving objects  or spacetime expansion and  if the former is true, then no two particles in universe ever moved relative to each other FTL, right? if the latter is true, how is that exactly different to two objects moving FTL to each other (with omitted relative time compensation)?


Access is denied when I create a file in programfiles folder

I created a wpf application. It will create a text file and store some data. In the time of implementation it's working fine(visual studio 2015). After I create a setup and install it in the same system I get the error:     Access denied to create file C:\programFiles\test\hello.txt   This is my code :  using (StreamWriter file = File.CreateText("hello.txt"))   When debugging the file is created in the debug/bin folder.


What would be the correct 's if the name ends with an X?

Assume someone's name ends with x. If we want to refer to one of his belongings, should we say ---x's or ---x'es?  The problem here is that if the pronunciation follows spelling.


Why am I still in jeopardy of have question creation access blocked on Android.SE?

Essentially, for several months now I seem to have the infamous quote atop the questions writing page that says if I don't pull my act together, I won't be able to ask questions, possibly permanently (depending on how I influence the community). I have read the help page and still cannot work out why, after all this time, I still have this warning.  I have   Gone over my old questions, and accepted answers where they work Provided my own answers where I can Voted where necessary   I have no questions with negative scores, and I fail to see why I still have the warning. Any help or detailed explanation please.   EDIT screenshot, just to provide evidence.


How to reset all settings to original state using Kubuntu 16.04?

I'm using kubuntu 16.04  The settings are a little messed up and I'm not able to get them back to how it looks like when you create a new account.  I would like to reset all system settings so that it looks like a newly installed kubuntu.  How can I do that?


Ramdisk(block device) performance is extrememly slow

I made a ram block device using 'rd' module. Afterward, I formatted it with ext4 filesystem. I ran fio benchmark towards the ramdisk. But the performance is extremely low in that it shows only around 100 mb/s. My kernel version is 5.4.0 and the OS is Ubuntu 18.04. Any ideas?


Problem:  click event is working for button Click Me but click event is not working for label Click Me.  Below is the code  HTML  <button type="button" id="clickMe" class="btn">Click Me</button> <div class="preview">  </div>   JQuery  $('#clickMe').click(function() {     var lab = "<label class=\"click\">Click Me </label>";     $('.preview').append(lab); });  $('.click').click(function() {     alert("You clicked on text"); });


How can I strip out some text from filenames in a folder?  I'm currently attempting:  rename s/"NEWER_(.*?)"//g *   But nothing it getting renamed  I have a parent folder, with a bunch of sub-folders, within are files, that OneDrive thought would be a great idea to append a " (NEWER_timestamp)" to, and I'd like to remove that.  Example File Names:  getyou.ico (NEWER_1417529079.87) o7pm.ico (NEWER_1417529184.89) o7th.ico (NEWER_1417529135.81)


Finding maxima using Lagrange multipliers

Finding maxima of $x^2+y^2+z^2$ subject to conditions $\frac{x^2}{4}+\frac{y^2}{5}+\frac{z^2}{25} = 1 $ and $z=x+y$  Now I form $F(x,y,z, \lambda_1 , \lambda_2 )= x^2+y^2+z^2 + \lambda_1(\frac{x^2}{4}+\frac{y^2}{5}+\frac{z^2}{25} - 1 ) + \lambda_2(z-(x+y)) = 0  $  Partially differentiating w.r.t x,y,z we get  $f_x = 2x + \lambda_1\frac{x}{2} + \lambda_2 = 0$  $f_y = 2y + \lambda_1\frac{2y}{5} + \lambda_2 = 0$  $f_z = 2z + \lambda_1\frac{2z}{25} - \lambda_2 = 0$  how do I solve ?


How does windows "limit" the CPU (Power Options / Battery saving)

Can anyone explain how Windows effectively limits the CPU?  Last time I tried some tricks to let my laptop not overheat, so I tried limiting the CPU to 70%.   As for my suprise it stopped my laptop from overheating - even when launching CPU intensive applications which caused my laptop to overheat and shut down, didn't overheat my laptop anymore!  I looked at task manager but the "CPU intensive" application still uses ~95% of CPU and the windows task manager shows a total of 100% CPU usage.  I have limited the CPU usage here ("plugged in" option was on 70% [both min and max] when testing the CPU intensive application):    How does Windows do this magic?   I see 100% CPU usage yet my CPU does not overheat. And I do not see any performance differences.  Does Windows limit the CPU speed? Like, if I have a 2.4 GHz processor, on 70% it will only have 1.68 GHz when limited? How is this possible (changing the CPU speed)? I thought you can only underclock when in BIOS?  If not, how does Windows accomplish this if not by changing the speed?    Side question: If it's about the speed, is there a way to set the CPU max state to 200% ?


Circutikz how to scale down a single 'bipole' in a diagram

I am not entirely satisfied with the relative size of Operational Amplifier and (american) resistor in this simple circuit:  \begin{tikzpicture}[scale=2] \draw (0,0) node[op amp] (opamp) {} (opamp.+) node[ground] {} (opamp.-) to [short, *-o] ++(-0.3,0) node[left] (a) {$i_i$} (opamp.out) node[right] {$v_o$} (opamp.out) --++(0,0.6) to[R] ++(-1,0) -| (opamp.-) ; \end{tikzpicture}     I thought the easiest way is to scale the resistor down, by changing the line to:  (opamp.out) --++(0,0.6) to[R,scale=0.8] ++(-1,0) -| (opamp.-)   However, what I get is this:    No matter how I tried (curly braces around the to operation, using a node instead), I could not get the desired effect for the bipole (term which, btw, is not really used in English to define one-ports, at least so tells me Google).  I resorted to scaling the rest of the elements up, because for nodes the procedure is no issue.  \begin{tikzpicture}[scale=2] \draw (0,0) node[op amp,scale=1.4] (opamp) {} (opamp.+) node[ground] {} (opamp.-) to [short, *-o] ++(-0.3,0) node[left] (a) {$i_i$} (opamp.out) node[right] {$v_o$} (opamp.out) --++(0,1) --++(-0.35,0) to[R] ++(-1,0) -| (opamp.-) ; \end{tikzpicture}     However, I would like to know whether there is a proper way to scale the 'non-nodes' in circutikz and what the correct syntax would then be.


Biblatex cite with footnote only once, with use of brackets

I've started putting into practice the answer to . Yet I would like to change this so that there are brackets around the citations:   in the superscript in text,     in the superscript in footnote,  in the bibliography.   I've managed to get the first one and the last one working. The second one however, I don't know how to do this.   Note that I mainly write in english and in dutch, so I don't think there is much babel interference.  Also, would there be a way to order the footnotes so that first all ''normal'' \footnote{} are printed and below that all \sfcite{} citational footnotes (per page that is)?  Here's what I've managed to concoct:  \documentclass{article} \usepackage[english]{babel} \usepackage[pdfborder={0 0 0}]{hyperref} \usepackage[citestyle=numeric-comp,sorting=none,hyperref]{biblatex} \usepackage{filecontents}  % No brackets around the number of each bibliography entry \DeclareFieldFormat{labelnumberwidth}{\textbf{[#1]}}  %--------------------------------------------------------------- % Essentially verbatim from Joseph Wright % http://www.texdev.net/2010/03/08/biblatex-numbered-citations-as-footnotes/ \makeatletter \ExecuteBibliographyOptions{citetracker,sorting=none}  \DeclareCiteCommand{\notefullcite}[\mkbibbrackets]     {\usebibmacro{cite:init}%         \usebibmacro{prenote}}     {\usebibmacro{citeindex}%         \usebibmacro{notefullcite}%         \usebibmacro{cite:comp}}     {}     {\usebibmacro{cite:dump}%         \usebibmacro{postnote}}  \newbibmacro*{notefullcite}{%     \ifciteseen         {}         {\footnotetext[\thefield{labelnumber}]{%             \usedriver{}{\thefield{entrytype}}\addperiod}}}  \DeclareCiteCommand{\sfcite}[\cbx@superscript]%     {\usebibmacro{cite:init}%         \let\multicitedelim=\supercitedelim         \iffieldundef{prenote}         {}         {\BibliographyWarning{Ignoring prenote argument}}%     \iffieldundef{postnote}         {}         {\BibliographyWarning{Ignoring postnote argument}}}     {\usebibmacro{citeindex}%         \usebibmacro{sfcite}%         \usebibmacro{cite:comp}}     {}     {\usebibmacro{cite:dump}}  \newbibmacro*{sfcite}{%     \ifciteseen         {}         {\xappto\cbx@citehook{%             \noexpand\footnotetext[\thefield{labelnumber}]{%             \fullcite{\thefield{entrykey}}\addperiod}}}}  \newrobustcmd{\cbx@superscript}[1]{%     \mkbibsuperscript{[#1]}%     \cbx@citehook     \global\let\cbx@citehook=\empty} \let\cbx@citehook=\empty \makeatother %---------------------------------------------------------------  \begin{filecontents}{\jobname.bib} @article{ref1,     hyphenation = {american},     title = {Natural Products as Sources of New Drugs over the Last 25 Years},     author = {Newman, D.J. and Cragg, G.M.},     journal = {J. of Nat. Prod.},     volume = {70},     number = {3},     pages = {461--477},     year = {2007}} @article{ref2,     hyphenation = {american},     title = {Natural products as leads to potential drugs: an old process or the new hope for drug discovery?},     author = {Newman, D.J.},     journal = {J. of Med. Chem.},     volume = {51},     number = {9},     pages = {2589--2599},     year = {2008}} @online{ref3,     author = {Quintin, C.},     title = {Les eponges},     url = {http://christophe.quintin.pagesperso-orange.fr/Liste_Doc.html},     urldate = {2009-05-03} } \end{filecontents}  \addbibresource{\jobname.bib}  \begin{document} First citation.\sfcite{ref1,ref2} Some text\footnote{A footnote}.   \pagebreak Second citation\sfcite{ref1}, second citation\sfcite{ref2}, first citation.\sfcite{ref3} \printbibliography \end{document}


I'm not able to edit the question. Can anyone tell me what's the reason behind that? On hove that it will be show "Account is not allowed to suggest edits"


Is the reason that I cannot see that functionality that I have too low reputation?


My pixel art looks weird in the game view in Unity

I am making my first 2D game in Unity and something has been bothering me. If I'm in the scene view, my game looks fine but when I go to the game view the pixels in the sprites aren't rendered correctly and everything looks distorted.   Does anyone know an answer to this?


Could you kindly list here all the criteria you know which guarantee that a continuous local martingale is in fact a true martingale? Which of these are valid for a general local martingale (non necessarily continuous)? Possible references to the listed results would be appreciated.


Novel: little girl holding a green stone that gave her the ability to talk to animals

I've read this book along with the series of I'm sure went up to about 3 or more other books. I read them around the year 2008 or 09, I can't remember most of the story because I was young but I loved it.  The book cover showed a little girl maybe the age of 11 to maybe early teens holding/cupping a green stone that I think could give her the ability to talk to animals or do some sort of ability.  I vaguely remember bits and pieces of the story but someone else was after the stone which sent her on an adventure to get the stone to right place out of the reach of the wrong hands. I think she had a younger brother with her or a town friend that joined her on her quest. I think her father or guardian was a teacher or a scientist that faked his death before the quest because he knew she needed that comfort of him being out of danger while she went out. He knew she had something that was special that effected the stone. (From book 1)  I could be incorrect about some of the details, it has been nearly 10 years since I've read them.


I am attempting to clone multiple partitions with either  or dd without cloning the whole drive which consists of:  A boot partition A home partition  Seen below is the original installation on a 128GB SSD, which I successfully cloned to a larger 250GB. This as a backup that I would later try to resize and shrink down.  Below is a photo of a working clone of the operating system, which is now about 41 gigs in size total after being resized with Gparted.  I have tried to clone these partitions to my 64GB USB disk as a working portable backup, but have ran into some issues. I have tried using: sudo -s dd if=/dev/sdb of=/dev/sdc & pid=$! while kill -USR1 $pid; do sleep 1; done  This bit for bit cloning method tried to copy the unallocated space on the input drive, which obviously won't work because the output disk is much smaller. In a second attempt I was able create a partition table on the destination disk that matched the source's sizes. I then tried to use boot repair and got  Moving onto to  options; normally a disk to disk would be my choice, but since the destination drive is smaller than the source,  will not allow this. I do see an option to copy ONE partition at a time using the disk to disk option, but do not see how I might clone all three at once. I know there is an option to do this with saving as image but I want the USB to be bootable. One way I can think of making this work would be to make an image of the partitions I want to clone using disk to image, then restoring the image to the 64GB USB disk later, but after trying this I ran into more errors. After making an image of /dev/sdb/ I attempted to restore the file but got this error about /dev/sdb2/ missing:  (/dev/sdb is the target for this session) So perhaps my image was OK, but it didn't properly read /dev/sdb2/ so I checked it with Gparted again and saw this following here:  I checked with Synaptic Package Manager to see, and I already have e2fsprogs v1.42.9-3 installed. So I did some reading and tried the following solutions that have worked for other people: sudo fsck.ext4 -f /dev/sda6 sudo touch /forcefsck Sudo reboot  this seemed to work temporarily, as after another reboot or two, the problem still persists. I am assuming now that during the device to image process in Clonezilla that my /dev/sd2/ was not read properly, as I can not even access this partition in Nautilus or Gparted. I am thinking that is may have been caused by the re-sizing of the drive, but can not be sure, as it will still allow me to boot to this installation. I think I can actually clone these two partitions to image, and then restore them but I need to address this problem of:  The following list of software packages is required for ext4 file system support: e2fsprogs v1.41+.  Could this have come from re-sizing the partition? If so, how come I am able to boot to this installation if it can't be read?


How to test and actually perform a transfer of an internet domain to a new server regarding mail?

My setup is a productive server (e.g. 1.1.1.1) hosting a domain, lets say example.com. Currently, postfix and courier (only IMAP) are doing the job of hosting mail. I am planning to transfer the domain to a new server (e.g. 1.1.1.2), also using postfix but with dovecot as a new IMAP server. I already setup postfix on 1.1.1.2 to accept all mails for example.com, which are delivered to the mailboxes and are accessable via IMAP. All accounts, including mail, are shell accounts. I use Debian for both servers.  In the webinterface of my virtual host provider I am able to set the IP of the server (A-record) and the mailserver (MX-record) for example.com. Currently, they are pointing to 1.1.1.1 respectively server.example.com (the latter automatically resolves to 1.1.1.1, too). I cannot influence any TTL-settings. And, I am not going to change my provider, just changing the virtual machine the domain is hosted on.  Two questions:   I would like to have my old server 1.1.1.1 deliver all received mails to the new server 1.1.1.2 for testing purposes (e.g. to test mailfilters, SPAM recognition, etc. as not everything will be setup identically). Is this a good idea (e.g. regarding bounces, etc.)? What's the correct way in postfix for achieving this (something like reverse-proxy in Apache HTTP Server)? What's the best way to perform the domain transfer from the old server to the new server such that downtime is minimal (at least during IMAP account transfer I am sure I need to stop all mail servers) and no mails are getting lost/are deferred? I had the idea of letting the old server forward mails to the new server for a certain time such that mails can be received from systems with outdated DNS cache, too.   Generally speaking, I am searching for a convenient and best-practice way to perform this. And, I do not know, if my ideas regarding both questions are pointing in the correct direction.


How to find specific strings in JS document using RegEx

I have a JS file exporting an array of objects. Each object contains a property with a URL strings. Here's an example: export const data = [   {     name: 'aaa',     content: 'Click here or here'   },     {     name: 'bbb',     content: 'Click here or here'   } ]  Notice the title property on each link, which may be empty or include some text. In my IDE (Webstorm) I want to search for every occurence of title, including the double quotes and the text between them or with empty double quotes. Essentially I want to be able to find each occurence of title="some text" and title="". Webstorm support searching with RegEx, but I have to idea how to construct such expression. I tried title=["]\D["], title=["]\w\s["], ["][a-zA-Z]["] and a few more... None of them worked. Any ideas how to construct such RegEx?


Travelling to Vietnam: how to find a local friend or travel companion?

I'm planning to travel to Vietnam (Hanoi).  I would like to make a local friend or travel companion there and vice versa.I'm willing to be a true travel accompany back in our country.  Is there any website for this?


Find the dimension of a subspace and the orthogonality complement of another

I would like to the fastest way to find $\dim(V \cap W^\bot)$ where $V$ and $W$ are two subspaces of $\Re^4$. $V$ is defined as the span of three vectors and $W$ the span of one vector.For example as in here - $$ V = \left\langle\begin{pmatrix}2\\2\\2\\1\end{pmatrix}, \begin{pmatrix}5\\4\\1\\1\end{pmatrix}, \begin{pmatrix}2\\1\\1\\0\end{pmatrix}\right\rangle,\quad W = \left\langle\begin{pmatrix}1\\-3\\2\\1\end{pmatrix}\right\rangle $$


How to connect Paramiko stdin to console?

Use the Paramiko package to run commands over SSH. Need to run a app that takes in user input, how can I connect sys.stdin directly to the app that is running via Paramiko so whatever the user types in, it will go into the app running.   stdin, stdout, stderr = ssh_client.exec_command('/tmp/input_required')  while not stdout.channel.exit_status_ready():     print(stdout.read(1), end ='')


Faster way to delete large number of files

I have a directory where lots of cached files are getting generated very quickly. Since these are very small files, it is consuming all my inodes very quickly.   Currently I am running the following command to find all the files older than 12 hours and delete them.  $ find ./cache -mtime +0.5 -exec rm {} \;   But the rate at which this command is deleting is slower than the rate at which files are being generated. Can someone tell me some alternative way to remove large number of files quickly.


When Input Values To My Program, It Crashes :( C#

This is the program. Can someone tell me what I did wrong? Every time I input a value for the string SolvingFor, the program crashes. I'm new to coding so if I made a stupid mistake please tell me.  using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks;  namespace PercentageCalculator { class Program {     static void Main(string[] args)     {         string SolvingFor;         int part;         int whole;         int percent;         Console.WriteLine("please only use numbers and lowercase letters.");         Console.WriteLine("Are you trying to solve for percent, part, or           whole?");          SolvingFor = Convert.ToString(Console.Read());          if (SolvingFor == "part") {             Console.WriteLine("Please Enter Value of the Whole");             whole = Convert.ToInt32(Console.ReadLine());             Console.WriteLine("Please Enter Value of the Percent");             percent = Convert.ToInt32(Console.ReadLine()); ;             Console.WriteLine("Your answer is" + (whole * percent) / 100); }         else if (SolvingFor == "whole")         {             Console.WriteLine("Please Enter Value of the part");             part = Convert.ToInt32(Console.ReadLine());             Console.WriteLine("Please Enter Value of the Percent");             percent = Convert.ToInt32(Console.ReadLine()); ;             Console.WriteLine("Your answer is" + (part * 100) / percent);         }           else if (SolvingFor == "percent")         {             Console.WriteLine("Please Enter Value of the part");             part = Convert.ToInt32(Console.ReadLine());             Console.WriteLine("Please Enter Value of the whole");             whole = Convert.ToInt32(Console.ReadLine()); ;             Console.WriteLine("Your answer is" + (part * 100) / whole);         }          else         {             Console.WriteLine("Please only input valid lowercase letters and numbers. ");         };         Console.Read();     }     } }


Comment links fail when next to non-whitespace

Parens, outside  Input: ([text](http://example.com) Result: ([text]() Expected: (  Brackets, inside  Input: [[text]](http://example.com) Result:  [[text]]() Expected:   These issues affect chat's markdown rendering too.


/boot is almost full preventing Software Updates

I can't do a software update because /boot is almost full. I, as root deleted unneeded files, but it didn't change the space problem. Trash shows that it's empty, and I can't get run gksudo nautilus to access roots trash to empty it. So basically, I can't do any more upgrades if they involve /boot.   How do I empty root's trash?


What is causing my hard drive's click of death?

Upon bootup I have a drive that will spin up click and few times then spin down.  I have a spare drive (same model number) I attempted to transfer the heads from with no luck, HOWEVER, the heads from the bad drive work fine in the spare drive.  Swapping the PCB has no effect either.  So although it seems to spin up fine, could the problem be with the platter motor?


How can i align an image next to a div horizontally

I am trying to align an image with a div that contains two rows of text like this:    Here is my current

hello world

hello world

   my current css:  .second-div {   display: inline-block;   margin-left: 15px;   height: 50px;   vertical-align: center;  }  .first-div{   display: inline-block; }  .img {   vertical-align: middle;   display: inline-block;   margin-top: auto;   margin-top: bottom;   height: 50px;   width: 50px; }  .m-0 {   margin: 0;   text-align: center; }   But i cant seem to align them without having to add a bottom margin to the picture which i assume is the wrong way of going about this.  i created a js fiddle so you guys can take a look


Is there a way to recover files from a storage device partially overwritten with dd?

I'm an idiot, I was writing an image to a USB drive using dd when instead of typing /dev/sdb I typed /dev/sdd and wrote the 135mb image to my 750gb External Hardrive full of files. Is there ANY possibility of recovering the files or did dd completely zero out the drive? Please help, as this is one of the lowest points of my life EVER.  dd finished writing the 135mb image in 5 seconds, so I didn't have a chance to stop it. By the time I knew what happened to was too late. The command was as follows:   sudo dd if=generic.img of=/dev/sdd bs=1M   EDIT2: The External Harddrive's filesystem was FAT32(I've had the drive for awhile and FAT32 was the most Universal FS at the time). I also have a 2TB drive I just got which I was planning on moving most of the files to from the 750gb, If needed I can use it to transfer the Recovered files to.


How to Change HDD Spin-Down Time in Xubuntu

I'm a new Ubuntu user. I use an old Toshiba notebook(which got a HDD manufactured by Toshiba) for work and recently installed Xubuntu in it. This old Toshiba HDD has overheating problem so after decreasing Swappiness I went to change the HDD spin-down time (the amount of inactivity time after which the HDD will spin-down).   I've downloaded the "Disks" app (gnome-disks-utility) from Store. I've opened it, selected my HDD and gone to Drive Settings. Under Standby tab, I've turned Apply Standby Timeout Settings on and set the standby time to 15 minutes.  I left the APM option disabled under the APM tab. Did it get the job done? When I type sudo hdparm -S /dev/sda, still I get this answer:   -S: bad/missing standby-interval value (0..255)   Plus, what should be the ideal spin-down and APM settings that would mimic Windows? I don't wanna wear it down faster than it should.  Update: I found out that the "Apply Advanced Power Management Settings(APM)" option also has to be turned on and its value has to be equal or less than 127 to make spindown work. Unbelievable work for a simple thing which the OS should've done for you in the first place.


How can I prove if the following series converges? $$\sum_{n\geqslant1} \frac{|\sin n|}{n}$$  I can't use differential or integral calculus. I've tried using Dirichlet and Cauchy tests, but they didn't get me anywhere.


When playing Cribbage, if I played a 7, and my opponent played an 8, (making a 15 for 2 points), can I then play a 6 for a run of three, or do they have to be in consecutive order?


What are tag synonyms and merged tags? How do they work?

What are tag synonyms? How can tag synonyms be distinguished from "real" tags? How are new tag synonyms created? Who can create tag synonyms? How can I delete/reverse/undo bad tag synonyms? What are merged tags?


Linux: clnt_create: RPC: Program not registered

NFS mounts recently automatically got un-mounted. When I checked, the NFS service status it was shown to be running.  [root@hsluasrepo]# service nfs status rpc.svcgssd is stopped rpc.mountd (pid 4083) is running... nfsd (pid 4148 4147 4146 4145 4144 4143 4142 4141) is running... rpc.rquotad (pid 4079) is running...  [root@hsluasrepo]# service rpcbind status rpcbind (pid  4203) is running...  [root@hsluasrepo common]# rpcinfo -p 10.80.3.154    program vers proto   port  service     100000    4   tcp    111  portmapper     100000    3   tcp    111  portmapper     100000    2   tcp    111  portmapper     100000    4   udp    111  portmapper     100000    3   udp    111  portmapper     100000    2   udp    111  portmapper   But showmount output was showing an error.  [root@hsluasrepo ]# showmount -e 10.80.3.154 clnt_create: RPC: Program not registered   After restarting the NFS service, showmount output displayed the NFS server's export list.  Can anyone tell me the root cause of this issue and How to avoid this problem in future?  /var/log/messages:  Jul 7 03:22:01 hsluasrepo rsyslogd: [origin software="rsyslogd" swVersion="5.8.10" x-pid="1188" x-info="rsyslog.com"] rsyslogd was HUPed Jul 7 03:22:02 hsluasrepo rhsmd: In order for Subscription Manager to provide your system with updates, your system must be registered with RHN. Please enter your Red Hat login to ensure your system is up-to-date. Jul 8 03:22:01 hsluasrepo rhsmd: In order for Subscription Manager to provide your system with updates, your system must be registered with RHN. Please enter your Red Hat login to ensure your system is up-to-date. Jul 8 16:36:55 hsluasrepo kernel: nfsd: last server has exited, flushing export cache Jul 8 16:36:55 hsluasrepo rpc.mountd[4083]: Caught signal 15, un-registering and exiting. Jul 8 16:36:55 hsluasrepo rpc.mountd[24463]: Version 1.2.3 starting Jul 8 16:36:55 hsluasrepo kernel: NFSD: Using /var/lib/nfs/v4recovery as the NFSv4 state recovery directory Jul 8 16:36:55 hsluasrepo kernel: NFSD: starting 90-second grace period Jul 8 16:37:32 hsluasrepo rpc.mountd[24463]: authenticated mount request from 10.60.5.208:1004 for /common/PROD (/common/PROD) Jul 8 16:38:09 hsluasrepo rpc.mountd[24463]: authenticated mount request from 10.60.5.181:869 for /common/PROD (/common/PROD)  Jul 8 16:38:43 hsluasrepo rpc.mountd[24463]: authenticated mount request from 10.60.5.180:825 for /common/PROD (/common/PROD) Jul 8 16:39:12 hsluasrepo rpc.mountd[24463]: authenticated mount request from 10.60.5.176:688 for /common/PROD (/common/PROD)


I want to send a string variable to a mysql database so that database uses a query with my variable and finds something in the database.Also the database/query needs to send me back another variable which i can use it in my c++.  I probably need to find how to connect the c++ with the mysql also and how exactly i can send this variable to the query.  How do you advice me to do this?  LE: I've found this and covers preety much exactly what i need to do:  #include <mysql.h> #include <cstdio>  int main() {     MYSQL *conn;     MYSQL_RES *res;     MYSQL_ROW row;     char *server = "server";     char *user = "user";     char *password = "password";  // got tot keep my data secret     char *database = "cpp_test";     conn = mysql_init(NULL);  // connect to database if(!mysql_real_connect(conn, server, user, password, database, 0, NULL, 0)) {     fprintf(stderr, "%s\n", mysql_error(conn));     return -1; }  // send SQL query if(mysql_query(conn, "select * from cpp_testTAB")) {     fprintf(stderr, "%s\n", mysql_error(conn));     return -1; }  res = mysql_use_result(conn);  // output table name printf("MySQL Tables in mysql database:\n"); while ((row = mysql_fetch_row(res)) != NULL) {     printf("%s %s %s %s\n", row[0], row[1], row[2], row[3]); }  // close connection mysql_free_result(res); mysql_close(conn);  return 0; }


Showing that $\gamma = -\int_0^{\infty} e^{-t} \log t \,dt$, where $\gamma$ is the Euler-Mascheroni constant.

I'm trying to show that  $$\lim_{n \to \infty} \left[\sum_{k=1}^{n} \frac{1}{k} - \log n\right] = -\int_0^{\infty} e^{-t} \log t \,dt.$$  In other words, I'm trying to show that the above definitions of the Euler-Mascheroni constant $\gamma$ are equivalent.  In another post here (which I can't seem to find now) someone noted that  $$\int_0^{\infty} e^{-t} \log t \,dt = \left.\frac{d}{dx} \int_0^{\infty} t^x e^{-t} \,dt \right|_{x=0} = \Gamma'(1) = \psi(1),$$  where $\psi$ is the digamma function.  This may be a good place to start on the right-hand side.  For the left-hand side I was tempted to represent the terms with integrals.  It is not hard to show that  $$\sum_{k=1}^{n} \frac{1}{k} = \int_0^1 \frac{1-x^n}{1-x} \,dx,$$  but I'm not sure this gets us anywhere.  Any help would be greatly appreciated.


Changing my site from HTTP to HTTPS - will google search results sort themselves out?

I've made all of my http pages 301 redirect to their https equivalents.  I've also made sure that all of the URLs in my sitemap files are https.  Lastly I created a new profile in GWTs under the https version of the site, and submitted the sitemaps in there (and removed them from the http version of the site).  I suspect this was unnecessary, but I don't think it'll have done any harm.  Is there anything else I need to do, or is it just a matter of time for google to re-crawl and update their index?  Thanks


Nilpotent matrices with same minimal polynomial and nullity

From Hoffman and Kunze.     Let $N_1$ and $N_2$ be 6 X 6 nilpotent matrices over the field F. Suppose that   $N_1$ and $N_2$ have the same minimal polynomial and the same nullity. Prove that   $N_1$ and $N_2$ are similar. Show that this is not true for 7 X 7 nilpotent matrices.   Right so nilpotent matrices have $N^k= 0$ for some k. Since these have the same nullity and minimal polynomial $N_1^k = N_2^k = 0$ from some k right? The same minimal polynomial implies the same characteristic values but thats not enough to say they have the same jordan form and are thus similar right?  and how would I get started in proving this breaks for 7x7 nilpotent matrices?  Thanks in advance for any assistance.


What is a word/idiom for 'unable to decide'?

Let's say I have an important decision to make and I can't decide between two competing things (like break up with a girl or not break up with her). What would be a word/idiom to express that?


I found this result in so many books and I tried to demonstrate it but I'm not convinced with my proof,  if A is a countable dense subset of $\mathbb{R}$ then there exists $B\subset A$  dense and countable in $\mathbb{R}$.


Adverbs . But the word friendly is not an adverb, is it? A friendly advice is , but a friendly person is correct. Is the word friendly very unusual or are there many non-adverbs ending in -ly?


Beamer presentation with notes: navigation does not work properly and "destination with the same identifier" warnings show up

I am refloating a long-standing Beamer problem and will put a good bounty to it, to see if we can all solve this problem once and for all...  I am following on a previous question I posted , and an  that never got a proper answer, and adding some more information and problems detected just recently.  The problems are related to the navigation links in Beamer presentations WITH NOTES.   If you try to show your notes on the left, navigation links on the top of slides just plain do not work. If you do like I did and switch notes to the right, the links on top work.   BUT STILL WE RUN INTO THE FOLLOWING PROBLEMS:   Links in the table of contents do not work at all. You get infinite amounts of the following warnings (one per slide):      destination with the same identifier * has been already used, duplicate ignored   I think this is a really big problem with Beamer, I do not know if it is a bug or it can be solved somehow...  Turning off the links is not an option; though we will remove the warnings, the main reason why some of us use Beamer is for the awesome navigation that takes us quickly to a slide in a big presentation during the questions round.  It would be of great advantage if the navigation feature could be used together with the ability to add notes next to the slides... In fact, I do not understand why this is not possible.  I gave up trying to add the notes on the left, so let's try to make everything work at least with the notes on the right...  With notes on the right, navigation links on top of slides work, but we still need to make navigation in table of contents work too, and get rid of those terribly annoying warnings.  This is a MWE to start playing with:  \documentclass{beamer} \usepackage{pgfpages} \setbeameroption{show notes on second screen=right}%better notes on right  \mode<presentation> {     \usetheme{Singapore} } \begin{document}   \begin{frame}[plain]     \titlepage   \note{     Notes for the title page } \end{frame}   \section*{Outline} \begin{frame}[plain] \frametitle{Outline}     \tableofcontents  \note{     Notes for the table of contents } \end{frame}   \section{Frame 1} \begin{frame} \frametitle{Frame with notes 1}     FIRST FRAME CONTENTS  \note{     Notes for the first frame } \end{frame}   \section{Frame 2} \begin{frame} \frametitle{Frame with notes 2}     SECOND FRAME CONTENTS \note{     Notes for the second frame } \end{frame}   \section{Frame 3} \begin{frame}     \frametitle{Frame with notes 3}     SECOND FRAME CONTENTS     \note{         Notes for the third frame     } \end{frame}   \end{document}   EXTRA BONUS POINTS IF YOU ARE ABLE TO MAKE NAVIGATION WORK IN HANDOUT FORMAT TOO, WHERE NAVIGATION DOES NOT WORK AT ALL! Just use:   \documentclass[handout]{beamer}  \usepackage{pgfpages}  \pgfpagesuselayout{2 on 1}[a4paper,border shrink=5mm]  \setbeameroption{show notes}


Add @reply autocomplete when commenting on the Android app

When commenting, having an autocomplete when you want to @reply to a user would be wonderful (similar to the one available on the desktop site). Normally when I'm on mobile site, I can copy/paste the username, remove the spaces, and I move on with life. But without copy/paste available within the app, the complex or unicode names are nearly impossible to use @reply.


can anyone explain output for the below javascript question?

const doSomething = (foo) => {   foo.push('rsa')   foo = ["World"]   return foo; }  let blah = ["Hello"]; console.log(blah); doSomething(blah); console.log(blah);    Please Explain me the output  output will be like below I am really confused with javascript so please can anyone explain this.  output will be like below I am really confused with javascript so please can anyone explain this. output will be like below I am really confused with javascript so please can anyone explain this. [   "Hello" ] [   "Hello",   "rsa" ]


Ubuntu equivalent of system restore? Does it exist?

Ubuntu n00b here.  I have created several disasters of the first order already.  I am getting ready to try to install opera - it is a very long and arduous process.  I am afraid - no - I am absolutely certain that I will damage something important.  How do I create a system restore point?  Does such a thing exist?


How can I write a bash script that sets a variable that's available to the user in the terminal?

I want the user to be able to run a script which looks like this now:  # script.sh export PASSPHRASE=123   and then be able to do this in the same terminal as that in which the script was evoked:  $ echo $PASSPHRASE 123   In other words, I want the variable in the script to be available to the user after the script has been run. How do I do that?


He knows a thing or two about being a doctor: study, study, study!   Is this "being" the same as "becoming?"  And why?


Searching an unknown type of color in space

I don't know a lot about the plot of this book as it has been quite a while since I last read it. But I do now that it was set in the space age, where everybody could travel between planets. It also had something to do with searching an mysterious, indescribable color (the 8th?).    There were aliens that were not able to perceive color who maintained the spaceships. A characteristic I can quite clearly remember is that these aliens (called lhari/laari?) would often get burned when they picked up a glowing tool, as the couldn't see it glowing.    At some point the protagonist undergoes a surgery to look like these aliens to do something they wouldn't allow humans to do. Maybe travel somewhere or spy on them?    I read it maybe 4 years ago, but it was an old book I picked up at a garage sale. I cannot name a specific time when it was written, but my best guess would be 1970-1980.   If I happen to remember more things, I will make sure to edit this question.


Contractions between big bang and gravitational law

If big bang happened then the centre of the universe must be place of big bang.   Let the mass of whole universe be $M$ and mass of small planet or any Astro object be $m$. Then the Gravitational force between $M$ and $m$ be given by:- $$lim_{M\to\infty \, m\to0\, r\to\infty} \frac{G_\infty M m}{r^2}\left(1+\left(1+\frac{r}{\delta}\right)\alpha e^\frac{-r}{\delta}\right)$$  Where $\alpha$ and $\delta$ are constant.  Then according to the gravitational law ,, attraction force on $M$ and $m$ must be equal. Then the acceleration of $m$ will be infinitely high towards $M$ as compare to acceleration of $M$.  Then by this theory universe instead of expanding must be compressing and the shape of the universe must be sphere "if big bang theory is correct."  I want to know whether I'm Right or not.


RadioButton not working caused java.lang.NullPointerException

I have created a activity according to RadioButton that user choose. i didn't know why my code was not working. this is my non working code.(i want to change background color when user checked radiobutton)  public class RegisterActivity  extends Activity {     /** Called when the activity is first created. */ RadioButton rbRed; RadioButton rbBlue; TexView header; @Override public void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     requestWindowFeature(Window.FEATURE_NO_TITLE);      setContentView(R.layout.cafechoice);      rbRed = (RadioButton) findViewById(R.id.radioRed);     rbBlue = (RadioButton) findViewById(R.id.radioBlue);     header = (TextView) findViewById(R.id.textview);      rbRed.setOnCheckChangeListener(radio_listener);     rbBlue.setOnCheckChangeListener(radio_listener);  } final CompoundButton.OnCheckedChangeListener radio_listener = new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {     if (!isChecked)         return;     if (buttonView.getId() == R.id.radioRed)     {     header.setBackgroundColor(Color.parseColor("#E23DA4"));     }     else if (buttonView.getId() == R.id.radioBlue)     {     header.setBackgroundColor(Color.parseColor("#548BF7"));     } } };   logcat showed up error on  rbRed.setOnCheckChangeListener(radio_listener);   caused by java.lang.nullpointerexception


I installed kubuntu-desktop via software centre but now everything is messed up in unity. As if the theme was changed but it's still "Ambiance" (the default). It even affects LXDE. For example...   Icon theme was changed to some other icon theme.  Some fonts are different like In Google chrome, fonts like "Hardware Insights Juju..." aren't supposed to be that thin. Also in the indicators' menus; you see it's not even readable and the icon for the language (that looks like this --> [EN] ) is missing.  Notifications look like kubuntu's. Double click to maximize doesn't work any more. It glitches in a weird way. Also there's a bug when switching workspaces but it's hard for me to explain.  Grub has a black background now. after grub, there should appear "Ubuntu" with 5 dots below it. Instead appears "Kubuntu" flashing. Who knows what else would I discover :/   What I want: A clean Unity desktop. A brand new one. And I want grub back to its old look. I tried to reinstall unity but it doesn't work. It only uninstalls a few megabytes leaving behind loads of dependencies which really matter and nothing gets fixed. I like kde as long as it doesn't mess things up. Can someone please tell me how to reinstall it or at least any workaround to all those problems though I really really don't prefer this.  I've tried this Q&A but no joy:      I've tried to reset my Unity configuration using this Q&A but this also didnt work:


This is probably not possible, but I have this class:  public class Metadata<DataType> where DataType : struct {     private DataType mDataType; }   There's more to it, but let's keep it simple.  The generic type (DataType) is limited to value types by the where statement.  What I want to do is have a list of these Metadata objects of varying types (DataType).  Such as:  List<Metadata> metadataObjects; metadataObjects.Add(new Metadata<int>()); metadataObjects.Add(new Metadata<bool>()); metadataObjects.Add(new Metadata<double>());   Is this even possible?


Can someone convert this circuit from 12VDC to 6VDC

It is a small sensor which activates relay when there's dark.  I just want that circuit to work with 5Vdc or 6Vdc.


What are the formal rules of manipulating calculus symbols?

I'm not sure if this is the right place for this question, but here goes.  I am often inclined to treat, without knowing if this is correct, the operators of calculus, namely $d, \frac{d}{dx},\int,\int_a^b$, as if they were "constants" that you can apply the rules of multiplication to.   So for example, I would be inclined to "multiply both sides by $dx\cdot dy$" as follows: $$\frac{y^2}{dx}=\frac{x}{dy}\implies x^2dx=ydy $$  or to "apply $\int$" to both sides as follows:  $$x^2dx=ydy \implies \int x^2dx=\int ydy$$  even though I am not sure whether $\int$ is an operator by itself, or whether $\int ...dx$ together form a single operator.   So my question is, not about whether the above particular derivations are correct, but what is the topic that one should study to learn the rules of manipulation of these operators? I'd like to really understand them, not just memorize them.   (note that I've taken an introduction to real analysis, but this focused very much on general concepts such as continuity, differentiability, integrability, without touching on the implications for the rules of manipulation of these operators)


S1300I scanner issues under Ubuntu 16.04 using Sane

In theory this scanner does work under Linux and Ubuntu.  I've found this document that I tried to follow.    I install sane, copy firmware, confirm the location in the config etc.  Everything looks good.  Potential problem areas  sudo sane-find-scanner   output:  # sane-find-scanner will now attempt to detect your scanner. If the # result is different from what you expected, first make sure your # scanner is powered up and properly connected to your computer.  found SCSI processor "Marvell 91xx Config 1.01" at /dev/sg5 # Your SCSI scanner was detected. It may or may not be supported by SANE. Try # scanimage -L and read the backend's manpage.  could not fetch string descriptor: Pipe error could not fetch string descriptor: Pipe error found USB scanner (vendor=0x04c5 [FUJITSU], product=0x128d [ScanSnap S1300i]) at    libusb:005:007 could not fetch string descriptor: Pipe error # Your USB scanner was (probably) detected. It may or may not be supported by # SANE. Try scanimage -L and read the backend's manpage.  # Not checking for parallel port scanners.  # Most Scanners connected to the parallel port or other proprietary ports # can't be detected by this program.   Okay.  So the scanner is detected and listed, it prints a bunch of extra noise that   # scanimage -L  No scanners were identified. If you were expecting something different, check that the scanner is plugged in, turned on and detected by the sane-find-scanner tool (if appropriate). Please read the documentation which came with this software (README, FAQ, manpages).   Okay, let's verify the firmware files:  ls -lh  /usr/share/sane/epjitsu  total 136K -rw-r----- 1 root root 65K Jan  1 17:49 1300_0C26.nal -rw-r----- 1 root root 65K Jan  1 17:49 300_0C00.nal   Looking at the configuration file: (snippets)  # Fujitsu S300 firmware /usr/share/sane/epjitsu/300_0C00.nal usb 0x04c5 0x1156  # Fujitsu S1300 firmware /usr/share/sane/epjitsu/1300_0C26.nal usb 0x04c5 0x11ed   Last thing I tried was to pull the line from sane-find-scanner and update the config  sane-find-scanner returns a different product ID.   I updated the config file above, restarted the sane service, I ran scanimage -L still, scanner not detected.  For reference I had this working on this same computer under a virtualbox VM.  If I can get it to work under windows that would be ideal.  Any suggestion would be much appreciated.    Update: I revisited the behavior after adding the 1300i firmware and it's still not working but.  Once in a while when I do run this is the output.  If I run it again it'll fail.  scanimage -L device `epjitsu:libusb:005:008' is a FUJITSU ScanSnap S1300i scanner   also sudo gscan2pdf and sudo simple-scan both fail to detect a scanner.  It fails with and without sudo permissions.


quantum random number generator implementation in quantum lab

How can I generate and print a 32 bit sequence of 0s and 1s in Qiskit or IBM Q experience quantum lab using quantum random number generator implementation?


I am a new Ubuntu user. I'm having a problem when trying to install GParted with these commands:  su root apt-get install gparted   Soon after running the commands, this error appears below, and I do not know what it is or how I can fix it. Thanks in advance.  E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem."


The meaning of "for" after the colon mark

What does "for" meaning in this sentence? I mean the word "for" after the colon mark.     A second difference from Quine is also important: for the crux of the Legal Realist   position (at least for the majority of Realists) is that non-legal reasons (e.g., judgments of fairness, or consideration of commercial norms) explain the decisions.   Full text .


Using \cref with consecutively numbered definitions and theorems

I'd like to number definitions and theorems consecutively, and I'd like to reference them with package cleveref's \cref command. Here's my attempt.  \documentclass{article} \usepackage{amsthm}  \newtheorem{definition}{Definition} \newtheorem{theorem}[definition]{Theorem}  \usepackage[nameinlink]{cleveref} \crefname{definition}{def.}{defs.} \crefname{theorem}{thm.}{thms.} \begin{document}  \begin{definition} Let $0$ denote the number zero. \end{definition}  \begin{theorem}\label{t:mytheorem} Let $x$ be $0$. Then $x = 0$. \end{theorem} \begin{proof} Left for the reader. \end{proof}  As can be seen in~\cref{t:mytheorem}, $x = 0$ whenever $x$ equals $0$. \end{document}     The screenshot shows that the citation uses the wrong term 'def.'.  If I change the line  \newtheorem{theorem}[definition]{Theorem}   to   \newtheorem{theorem}{Theorem}   the citation is worded correctly, but the definition and the theorem are no longer numbered consecutively.


Find the CDF and density for the ratio $Z=X/Y$ given that $X$ and $Y$ are iid?

$X$ and $Y$ are iid r.v.s where $f(x)=\lambda e^{-\lambda x}$, $x>0$. We are given $Z=X/Y$ and asked to find the CDF and density for $Z$.  I tried doing this using the multivariate transformation formula, where   $f_{W_1,W_2}(w_1,w_2)=f_{X_1,X_2}(x_1,x_2)|J|$, but I ended up getting that $f_Z(z)=\frac{1}{(1+z)^2}$, which results in a negative CDF. I was hoping to see a different method of doing this. Any help appreciated.  Edit: Here is my work for obtaining my answer:  $Z=X/Y$; we then let $W=Y$ and $X=ZW$. The Jacobian is then calculated to be $w$. That means we have:  \begin{align} f_Z(z) & =\int_0^\infty f_X(x)f_Y(y)w\,dw \\[10pt] & =\int_0^\infty \lambda e^{-\lambda x}\lambda e^{-\lambda y}w \, dw \\[10pt] & =\lambda^2 \int_0^\infty e^{-(z+1)\lambda w}w\,dw \\[10pt] & =\frac 1 {(z+1)^2} \end{align}


Can the sum of reciprocals of a set without density converge?

It is known that if a set of natural numbers has positive asymptotic density then the sum of the reciprocals of those elements diverge. Let $\{a_n\}$ be an increasing sequence of natural numbers where the density of the set $\{a_n | n\in \mathbb N\}$ does not exist. Can the series $\sum_{i=0}^n \frac{1}{a_i}$ converge? All the examples that I have of sets where the density does not exist do not converge.


When rendering a custom form, how do I use  instead of  for the button #type?

I have a render array for my custom form, which acts as a "Like" button for articles (but with custom functionality for our client). The button is defined like so:  ...     $form['like_btn'] = [       '#type'   => 'button',       '#markup' => '<img src="/path/to/like-icon.svg" width="32">',       '#attributes' => [         'class' => ['like'],         'id'    => ['like-btn'],       ],       '#ajax'   => [         'callback' => '::updateLikesCounter',         'disable-refocus' => FALSE,         'event'    => 'click',         'wrapper'  => 'like_counter',         'progress' => [           'type' => 'none',         ],       ],     ]; ...   However, this renders the button as <input type="submit"> rather than a <button> element.  How can I make the "button" render element type utilize the <button> HTML element instead? Or, which render element #type should I use instead?


Is copper piping required within a certain distance from a water heater?

I have read that National Code requires you to use copper for 18 inches from your water heater.  How can I do this when everything existing is PEX?   I need to replace my existing low boy water heater next to my kitchen sink.  It was installed by the builder ten years ago. All the pipe in the house is PEX.  The existing water heater is connected using PEX as well.    The supply line comes directly thru the wall to the HW Heater. There is no space to run 18 inches of copper! The heater is under the kitchen counter, and the countertop is directly over it. Only about an inch clearance.


Probability of drawing Ace of Spades at particular place with and without replacement with two specific examples

Drawing cards both with and without replacement and finding probability of drawing Ace of Spades.  What would that be for the two specific cases below?  1) Randomly draw cards from a standard deck of cards WITHOUT replacement. What is the probability that the last card drawn is the Ace of Spade?  2) Randomly draw cards from a standard deck of cards WITH replacement. What is the probability that the 40th card drawn is Ace of Spade?


How do I use one shape to delete a portion of another shape?

I have created an arrow shape (rightmost in image), from which I wish to cut out the majority so that only two thin sides remain. The most accurate way to do this would be to duplicate the shape and to somehow use the duplicate (leftmost in image) to remove the chunk that I no longer desire from the original. I am not sure what to do after the duplication, however, or if this method is even possible? Is there a better one?


Is there a difference between "Alpha Helix" and "Alpha subunit"?

In my biochemistry textbook the terms alpha helix and alpha subunit are both used. Are these two terms synonymous? For instance, hemoglobin has an alpha and beta subunit, are these the same thing as alpha helix and beta pleated sheet?


Getting a France Schengen visa but not going there

I have applied for a France shengen visa but am not able to go in France. Instead am going to Italy and Austria and then London. so will there be any problem at immigration due to France Schengen visa or while departing outside of the Schengen area?


What is ArcGIS for Desktop (and Geodatabase) equivalent to Regions of ArcInfo Workstation Coverages?

Here's one for those who've been around the block a few times.  ArcInfo Workstation from days of yore had an intelligent data model called Regions or Region sub coverages. With this model one could select one or more polygons and create new virtual polygons from the selected set. Furthermore one could dissolve within the set, creating a result akin to merged polygons, or have disparate polygons, possibly overlapping, that identify themselves as one unit (multipart polygons in shapefile parlance). These virtual polygons are called regions. When the regions are loaded into Arcmap (or ArcEdit/View back then) they behave like an independent shapefile or feature class in terms of querying, symbolizing, etc.   The beauty of this model and what is missing from feature classes and feature datasets in the ArcGIS world, so far as I've been able to determine, is that in regions the geometry is stored only once. Imagine, for example, the continent of North America split into polygons depicting countries, islands, states & territories, counties, municipalities, etc. down to whatever level you feel like stopping at, all stored in a single feature class. (ugh, what a mess) Yet, each level has convenient handles (country, province, whatever) that can be grabbed and used as if they were independent feature classes.   Coverages and Regions have their problems, they weren't left behind lightly, but they weren't all bad. Sooo, what is the ArcGIS answer to ArcInfo Regions?


Why is beamer+pstricks+preview no longer compatible now?

The following code is taken from Gonzalo Medina' . At the time he posted the answer the code was compilable.   \documentclass{beamer} \usepackage{pstricks-add} \usepackage[active,tightpage]{preview} \PreviewBorder=0pt \PreviewEnvironment{pspicture}  \begin{document}  \begin{frame}     \begin{pspicture}(6,6)         \pnode(0,0){A}         \pnode(6,0){B}         \pnode(6,6){C}         \pnode(0,6){D}         \pnode(1,1){P}         \pnode(5,1){Q}         \pnode(3,5){R}         \only<5>{\psclip{\pscircle[linestyle=none,dimen=middle](3,3){3}}}         \only<1->{\pspolygon*[linecolor=red](A)(B)(Q)(P)}         \only<2->{\pspolygon*[linecolor=green](B)(C)(R)(Q)}         \only<3->{\pspolygon*[linecolor=blue](C)(D)(R)}         \only<4->{\pspolygon*[linecolor=yellow](D)(A)(P)(R)}        \only<5>{\endpsclip}      \end{pspicture} \end{frame}  \end{document}     But now, the same code is no longer compilable with error /typecheck in --div--.  Actually, I want to compile the following code but the same error also occurs. What is wrong?  \documentclass{beamer} \usepackage{pstricks} \usepackage[active,tightpage]{preview} \PreviewEnvironment{pspicture} \PreviewBorder=12pt\relax   \begin{document}  \begin{frame}{Test} \psset{unit=.5cm,runit=.5cm} \begin{pspicture}[showgrid=top](-7.5,-7.5)(7.5,7.5) \pstVerb {        %true setglobal     %globaldict begin     /c40 {40 cos} bind def     /s40 {40 sin} bind def     /s65 {6 5 s40 mul add} bind def     %end     %false setglobal } \pscircle[linecolor=blue]{8} \pscustom[fillstyle=solid,fillcolor=black!20]{%   \only<1->{\psarc(0,0){5}{40}{! 180 0.3 ATAN1 sub }}   \only<2->{\psline(! 37.5 c40 mul s65 div 1.5)(! 32.5 c40 mul s65 div 0.5)}   \only<3->{\psarc(0,0){5}{!180 0.1 ATAN1 sub}{!180 0.1 ATAN1 add}}   \only<4->{\psline(! 27.5 c40 mul s65 div -0.5)(! 22.5 c40 mul s65 div -1.5)}   \only<5->{\psarc(0,0){5}{!180 0.3 ATAN1 add}{320}}   \only<6->{\psarcn(0,0){6}{! 270 5 c40 mul 36 25 c40 dup mul mul sub sqrt div ATAN1 add }{! 270 0.25 Acos sub }}   \only<7->{\psline(-7.5,-1.5)(!5 c40 mul s65 div 7.5 sub -0.5)}   \only<8->{\psarcn(0,0){6}{!180 1 12 atan add}{!180 1 12 atan sub}}   \only<9->{\psline(-7.5,0.5)(! 5 c40 mul s65 div 7.5 sub 1.5)}   \only<10->{\psarcn(0,0){6}{!180 1.5 6 atan sub}{! 1 c40 div 10 div 36 25 10 sin mul sub 60 s40 mul add mul s65 div ATAN1}}   \only<11->{\closepath} } \end{pspicture} \end{frame} \end{document}   Forensic trace record  The last success of compiling the code was on July 29, 2012 and the last update of preview is in 2010. So preview can be removed from the list of candidates causing this problem.  pstricks and beamer are left, but which one is the source of problem?


How do I get the function definition from a Python environment?

I am studying image processing on a learning website. On one of the exercises, function_name is used but it was never defined or discussed on the previous lessons. It was explicitly stated that the function is preloaded in the built-in Python shell used in the website. I really want to know how function_name was written, how do I do this?


What are the complete requirements of the Bollywood Achievement?

I'm very curious is there some kind of requirement(s) I'm unaware of for the Bollywood Achievement:  Bollywood As Gandhi, win a cultural victory with 3 or fewer cities in your empire.  I'm only asking this question because I have actually accomplished this achievement several times but Steam has never awarded me for the achievement.I went ahead and started a new game as Gandhi and accomplished the listed requirements (3 or fewer cities in my empire and win by culture victory) again just as is stated in the achievement and again no achievement received. Also, never had more than 3 cities the entire game. So I'm just wondering what gives? Is there some kind of unlisted requirements for the achievement? The achievement states as follows: Does it require a specific difficulty? Does it require that no game modifications are used? Does it require that you never go to war with any other civilization or city-state? I'm just at a loss because I just barely completed this achievement exactly as it is stated for like the 19th time and I still have not received the achievement.


Problem: Find all distributions $f$ in $\mathcal D'(\mathbb R^2)$ so that $xyf=0$ and $(x^2-y^2)f=0.$ My Thoughts: Note that $c\delta_{(0,0)}$ where $c\in\mathbb C$ satisfies the distributional equations above. It appears that $\operatorname{supp}(u)=\{x=0\}\cap\{y=0\}=(0,0)$ which would imply that $u$ is a finite linear combination of $\delta_0$ and its derivatives. Is my reasoning on the right track? Apologies if I am not showing enough details, I am trying to make sure that my intuition is on point. Thank you for your time.


I have a problem. I overstayed my uk tourist visa for about 10 months and decided to return voluntarily. However during my exit in February 2016, I did not meet any immigration officer at the Heathrow Terminal 3 before boarding the plane. I just went through the normal boarding process everyone went through without getting my passport stamped as an overstayer. Now I have gained admission to study a master's program in September in the uk and would like to make an application for a visa at the uk embassy In my home country. Is there any likelihood that the visa officer might know I overstayed my first visa even though nothing shows in my passport? Any help please? Thank you. Note my passport was never expired so it's the same passport I came back with.


I need to analyze complexity for some algorithms in Java. For that I am planning to give large number of input and measure the time taken by Java implementation. What is the most precise and accurate way to check time between some lines of code? I need precision in milliseconds...


What is the difference between the "...", '...', $'...', and $"..." quotes in the shell?

Sometimes I see shell scripts use all of these different ways of quoting some text: "...", '...', $'...', and $"...". Why are there so many different kinds of quote being used? Do they behave differently or affect what I can do inside them?


Actually, my Powershell can't resolve many commands while cmd/bash can: node, git, npm, etc... PS C:\Users\vssen> notepad notepad : The term 'notepad' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1 + notepad + ~~~~~~~     + CategoryInfo          : ObjectNotFound: (notepad:String) [], CommandNotFoundException     + FullyQualifiedErrorId : CommandNotFoundException  But PowerShell MUST at least open notepad with "notepad" command! Note: it is opening notepad by "notepad.exe" command, but it must do it without ".exe". I think this error also make issues to me while I am working with git and node too, and I see a lot of opened issues similar to that, and there is still no answer. Example error behavior with other commands: npm: open new console; npm.exe --version: no output; git: not found; node: not found; git.exe: open and close console; node.exe: open nodejs console window; THINGS I TRIED:  clear all user and system paths, adding only for nodejs for example, or only system32 DISM sfc /scannow Installation of separated PowerShell 7 (cross platform) - SAME ISSUE! Get-Command can't find path without ".exe", can with ".exe"  PS C:\Users\vssen> $PSVersionTable  Name                           Value ----                           ----- PSVersion                      5.1.19041.906 PSEdition                      Desktop PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...} BuildVersion                   10.0.19041.906 CLRVersion                     4.0.30319.42000 WSManStackVersion              3.0 PSRemotingProtocolVersion      2.3 SerializationVersion           1.1.0.1  env variables vssen: Path: C:\Program Files\nodejs;C:\Users\vssen\AppData\Local\Programs\Python\Python39\Scripts\;C:\Users\vssen\AppData\Local\Programs\Python\Python39\;C:\Users\vssen\AppData\Local\Microsoft\WindowsApps;C:\Users\vssen\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\vssen\AppData\Roaming\nvm;C:\Program Files\PostgreSQL\13\bin; system: Path: C:\Program Files\nodejs;C:\Program Files\Git\cmd;C:\Program Files\Conan\conan;C:\Program Files\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;%SYSTEMROOT%\System32\OpenSSH\;%NVM_HOME%;%NVM_SYMLINK%;C:\Program Files\PostgreSQL\13\bin;C:\Program Files\dotnet\;C:\MinGW\bin;C:\Program Files\CMake\bin;C:\Program Files\Docker\Docker\resources\bin;C:\ProgramData\DockerDesktop\version-bin;C:\Program Files\PowerShell\7\;C:\Program Files\Amazon\AWSCLIV2\ I've validated every path in env Path, all links are valid (and PowerShell & cmd must work with invalid links as well!) C:\Users\vssen>where where C:\Windows\System32\where.exe   C:\Users\vssen>where notepad C:\Windows\System32\notepad.exe C:\Windows\notepad.exe  Maybe someone know Microsoft developers) Help is much appreciated! i don't want to reinstall Windows please... PS: all possible related and non-related things to mention  OS Build: 19043.985 Windows Feature Experience Pack 120.2212.2020.0 (don't know what is it) I have WSL use nodejs via nvm have bash (from git installer)


How to create an Automator service to run a script on all files in a folder

I want to create a service using Automator to run a shell script on all files in a folder, say delete all log files. What I have done is    Created a new service in automator. Added a "Run Shell Script" action. I have change this to 'pwd' for now.  Selected "Service receives selected folders". Tried to run it, but get a message. "To test this service within Automator, add the "Get Specified Finder Items" action to the beginning of your workflow. Remove or disable the action before running the workflow outside of Automator. OK. So I add "Get Specified Finder Items". Added a 'test' directory to the list of items.   Now, when I run the script, the results window prints out my home directory.  Elsewhere, I have read that I maybe need to add   cd "$1"   to the beginning of my script. I did that but it still prints my home directory. How do I get this thing to print the directory I have selected in "Get Specified Finder Items?"  Edited to Add  Here is a screen shot of a script that works.    Here is a screen shot os a script that doesn't work.     The usual way I would deal with the "no match found : *.log" error would be to redirect error output to null. Replacing the "rm" line by  find . -name "*.log" -print0 | xargs -0 rm -rf   Does work though. This seems more difficult than it should be.


ABC. How can it avoid the likelihood function?

According to the , we have the scenario shown below, but how can ABC generate simulation datasets from samples of $\theta$ without knowing or evaluating the likelihood function?  For example, how would this method work for a normal $N(\mu, \sigma)$ distribution? Assuming that the parameter to estimate is $\mu$ and that $\sigma$ is known, how would it generate the simulations without evaluating $N(\mu, \sigma)$?


How to get another user's (including current user) followed sites

How to get another user's followed sites, programmatically.   It seems that SPSocialFollowingManager followingManager = new SPSocialFollowingManager(userProfile, context); only works for the current user; for another user it always returns null.  I have tried to run with elevated privileges and it can't get the result for even the current user.


VPC public subnet internet access with ELB hooked up

I am attempting to set up a web server (nginx) that needs access to the internet while also being hooked up to an ELB but I am having trouble getting this solution working.  Details:   3 public subnets   a b c  3 private subnets   a b c  1 ELB   This has the three public subnets included in its default pool  1 NAT instance in public subnet   The various guides I have found useful for getting the public subnets hooked up to the ELB by pointing the subnets to the IGW.  These set ups do not take in to consideration the need for internet access.  When I change the route table for the single NIC from the IGW to the nat instance I get internet access but I lose the ability to connect to the ELB and visa versa, when I update the route table to use the IGW I lose the ability to connect to the internet.  I can allocate an EIP and give it access that way but was hoping to avoid exposing this server the internet via a public address if possible.  What I am thinking is that I can either 1) add a second NIC to the web servers that need internet access so they have a leg out via a NAT instance and also have a leg in the public subnet to connect to the load balancer or 2) I can use the nat instance as the gateway for my network.  Has anybody set something similar to this up?


Difference between 'if [ "x$foo" = "x1" ]' vs 'if [ "$foo" = "1" ]' in bash?

I'm reading Gitlab's source code to learn more about how it works.  In the run  located inside the project root directory, I see the following:  if [ "x$GDK_RUNIT" = "x1" ]; then   ... fi   I know this conditional's purpose is to check if the value of the GDK_RUNIT envar is set equal to 1, and to exit with a non-zero return code if that's the case.  My question is, what is the difference between the above code and the following:  if ["$GDK_RUNIT" = "1" ]; then   ... fi   In other words, what is the purpose of placing "x" before both the envar name and "1"?  I checked man test for anything related to x (since I know if and test are functionally equivalent), but all I saw was the -x flag.    x$GDK_RUNIT doesn't look like a flag to me, so I assumed the contents of the man page wasn't relevant.


How much free memory should I have on my webserver?

I have a webserver that's currently hosting two Wordpress sites and some java-based collaboration software.  The server has 2G of memory and is currently using about 1.8G of the available memory.  Right now what's on here is pretty much a pilot project that's getting negligible traffic so I think it's pretty clear that I'll be needing more memory.    I was wondering, if I was to release it, how I might anticipate my memory needs based on the traffic it gets.  I've poked around on Google and what I've found has been a bit tenuous.  Is there a good heuristic that one should use when calculating memory demands as a function of the base (no traffic) load on the server?    For reference, the output of free -m can be seen below:               total       used       free     shared    buffers     cached Mem:          2048       1832        215          0          0          0 -/+ buffers/cache:       1832        215 Swap:            0          0          0   To me this looks like actual memory used and isn't an illusion due to caching or anything else.  I figure the demands of my collaboration software will have to be experimentally tested so here's free -m without that software running:               total       used       free     shared    buffers     cached                                      Mem:          2048       1109        938          0          0          0                                      -/+ buffers/cache:       1109        938                                                                       Swap:            0          0          0      My plan B to figure this out is to add a bunch of swap space to the server, give it some traffic and adjust according the the amount that swap gets used.  I was just wondering if anyone had a good rule of thumb to estimate how much memory I should plan on in advance...or if what I'm thinking is nuts.  Many thanks in advance (I'm really quite new to this).


How do I save terminal output to a file?

How do I save the output of a command to a file?  Is there a way without using any software? I would like to know how.


Align the footer at the bottom with variable content height

So, I am trying to achieve this:   I know this looks like an already asked question but I have tried all the available solutions of stackoverflow.  My current structure is: HTML:

Content

Footer

   CSS:   .app{     text-align: center;     background-color: #1a1f25;     min-height: 100%;     width: 100%;     position: relative;     overflow-y: auto;     top: 0; } .footer{     color: lightgray;     padding: 10px 30px;     position: absolute;     width: 100%;     font-size: 10px;     background: black;     bottom: 0; }   Update: I tried checking the answer given , but my website is responsive and that answer is for those footers which have fixed height. Which makes it difficult to convert that solution for my usecase.


On a deep level, how does copying something to the clipboard work? Is there a file that stores the text or image I copy somewhere?  I found  where the question was never answered. I also found a lot of references to xclip. I don't currently have xclip installed, but my clipboard works fine--eg I could copy something from Firefox and paste it into terminal with no issues. So, clearly something must be happening on a different level than xclip. What is that and how does it work?


I'm new in LaTex. I need to draw a graphic like the image and each rectangles of image must have the size shown in Figure. I drwan it by MS power point but I need to do by LaTex. Can you help me? Thank you in advance for your help and collaboration!  Thank you in advance for your help and collaboration!


After a 18 month J1 visa, can I come back to the US with ESTA and stay 3 months?

I'm from Italy and I had a J1 visa for the US for 18 months. Now it's expired (I'm in the grace period) so I'll soon go back to Italy. Since my boyfriend is American and lives in the US I would like to come back in January with the ESTA to visit him and probably stay 3 months and then return to Italy again.  According to my visa and DS-2019 form I'm not subject to the two years rule. Will I have any problem when entering the US with my ESTA? Should I wait longer before coming back? Do you think the immigration officer will make any problem since I have been in the US for so long (18 months) with the J1 visa?


I completed my master's three months back. Currently, I am writing scientific articles with collobrations in which I use the previous educational affiliation. Is this correct or should I use my current address as affiliation? Please do help me in this regard.


Why get Armor after Attack but before Shields?

Whenever I watch a professional Protoss (usually WhiteRa) in replays of HotS, they usually get Armor (ground/air armor) after getting Attack but before getting Shields.   Why is that?


Could anyone explain why the number of legal or reachable combinations of a $3\times 3\times 3$ Rubik's Cube is $1/12\mbox{th}$ of the total. I understood the logic behind the total number of combinations: $8! \cdot 2^{12} + 3^{12} \cdot 12!$. What I am not able to understand is why do we divide this quantity by $2 \cdot 3\cdot 2$. I don't have any idea about parity or group/set theory. Is there another possible explanation for it?


I need help with the following question regarding modular arithmetic.  "A seating plan consists of 7 chairs in a circle. If I am currently sat in chair 3, what chair will I be in $3^{453}$ steps later?  Assume that for each step, you move one chair forward in the anticlockwise direction and the chairs are numbered from 1 to 7."    Obviously, the number of steps is too large to be computed, so I assume there must be a trick to do this?  Thanks!


how to automatically include the contents as I write the document

I write a document without writing myself the Contents. I just put the command:  \tableofcontents   and what I write after the command:  \begin document   is automatically added in the Contents. However , when I have a subsubsection the Latex doesn't include it in the Contents. It is like it doesn't recognize it.  For example I have this file:  \documentclass[12pt, fleqn]{report}  \usepackage[utf8]{inputenc}  \usepackage[english,greek]{babel}   \usepackage{graphicx}   \graphicspath{{images/}}   \usepackage{amsmath}   \usepackage{caption}   \usepackage{ragged2e}  \usepackage{graphicx}  \usepackage{afterpage}  \usepackage{fancyhdr}  \usepackage{lipsum}  \usepackage{mathptmx}  \usepackage{anyfontsize}  \usepackage{t1enc}   \usepackage{titlesec}   \setcounter{secnumdepth}{3}  \chapter{A} \section{B} \subsection{C} \subsubsection{D}   Everything until \subsection{C} is included. After I write in the document the\subsubsection{D} , then it doesn't appear in the Table of Contents. Any idea why this is happening?  Thank you.


What vegetation would thrive in the Martian atmosphere?

Most plants require carbon dioxide for their photosynthesis, which Mars has in overabundance.   Would atmosphere composition (let's ignore temperatures for the purpose of this question) of Mars allow vegetation to grow?


I would like to install Ubuntu on my 128 GB with persistent data.  If possible I would like to boot it within virtual box so I can access it from any windows computer.  Is it possible?


Where to ask questions about Catia (CAD software)?

Where can I ask questions about  ?  (for those who do not know,  Catia is a very powerful 3D CAD/CAM/CAE drawing software)


How to Solve $\lim_{x\to \infty}\sqrt{x^2 + ax} - \sqrt{x^2 + bx}$

I can't quite figure out how to manipulate this into a determinate form — should I try rationalizing it by multiplying by the conjugate, completing the square, or something like that?  Note: I'm in precalc, so haven't learned any fancy calculus theorems, etc.


Can sub folder point to different hosting provider www.domain.com/subfolder

I have a situation where we need to point a sub domain to a different hosting provider.  The main website www.mainwebsite.example is being hosted with HostingProvider1 and now we have another application www.example.com which is hosted with HostingProvider2.  We want this application to be accessible only via  www.mainwebsite.example/application   I am not sure how this can be done at DNS level. Our main domain which is www.mainwebsite.example is hosted with Network Solutions, I am not sure if I can make www.mainwebsite.example/application  on DNS level to point to a different hosting provider.  If it was application.mainwebsite.example then it would be simple as I can change the CNAME record. But in this case the client wants www.mainwebsite.example/application to point to different hosting.  Not sure if this is possible only at DNS level.


He was born on Earth but moves at incredible speeds, has incredible powers and looks very different in comparison to a human. What is he and how did he become like that?


How to move gameobject with touch on Android

I'm trying to make a game where you control a character via touch on Android devices.  The player will have two degrees of movement.   When you touch the touch screen and move your finger, the game object should move to your finger's location and follow your finger as you move it.  Here is an example of what I'm trying to do:  (@ 1:02).  I already know I need to use Input.touches.  I've tried using Transform.translate and Vector3.Lerp, neither gave me the results I wanted.   Here is some of the code I've tried using:  #pragma strict  var speed : float = 1;  function Start () {  }  function Update () {     if (Input.touchCount > 0 &&          Input.GetTouch(0).phase == TouchPhase.Moved) {           // Get movement of the finger since last frame         var touchDeltaPosition:Vector2 = Input.GetTouch(0).deltaPosition;          var touchPosition:Vector3;          touchPosition.Set(touchDeltaPosition.x,                             transform.position.y,                             touchDeltaPosition.y);           // Move object across XY plane         transform.position = Vector3.Lerp(transform.position,                                                 touchPosition,                                                  Time.deltaTime*speed);     }  }


I want to upgrade RAM in my HP LAPTOP model number - AU111TX. Current Specification of RAM installed on my laptop is  Can I add RAM in empty slot of different speed i.e. 2666MHz? How do I know that this RAM speed is compatible with my laptop? This is the RAM that I am planning to buy.


C# Reflection - Get PropertyInfo without a string

I have a property in Myclass:  public class MyClass{         public string FirstName {get;set;} }   How can I get the PropertyInfo (using GetProperty("FirstName")) without a string?  Today I use this:  PropertyInfo propertyTitleNews = typeof(MyClass).GetProperty("FirstName");   Is there a way for use like this:  PropertyInfo propertyTitleNews = typeof(MyClass).GetProperty(MyClass.FirstName);   ?


We have two Android phones (Vibrants) and a regular land-line at home.  We bought a cordless system that has Bluetooth built-in (Panasonic KX-TGA651) so that we can use the cordless phones to answer our cell phones.  Everything works well. However, we want to place the cordless base in the kitchen, but don't want to have to park our cell phones there. Do Bluetooth repeaters exist that we could use for this purpose?


How to remedy Imgur "403 Forbidden" errors?

Every other image I see hotlinked from Imgur returns a "403 - Forbidden" error.  If I copy and paste the link into my browser the image will load. Or if I delete the initial i. in the URL, the image loads.   The image will not load if it's used in a BBCode style tag, or if I right click on it and choose open in a new tab.  Do you know the cause or a fix?  These are a couple of examples that you'll probably be able to see, but I can't unless I do one of those above mentioned actions:


Calculating population within a polygon from a raster layer

I am trying to calculate the population within a set of polygons (representing districts). I have a raster file of population data. Can I assign the population data to the polygons and then sum the population?


How to find $\lim _{ n\to \infty } \frac { ({ n!) }^{ 1\over n } }{ n } $?

How to find $\lim _{ n\to \infty  } \frac { ({ n!) }^{ 1\over n } }{ n } $ ? I tried taking using logarithm to bring the expression to sum form and then tried L Hospital's Rule.But its not working.Please help!   is what wolfram alpha is showing,but its not providing the steps!  BTW if someone can tell me a method without using integration, I'd love to know!


Why not 'heading' in "Where are you headed?"

Why do people say:     Where are you headed?   To me, it should be:     Where are you heading?   because you usually say "We are heading out" or "I was heading north". The initial sentence looks to me like passive voice.


compilation errors in powerdot. Can some one help?

\documentclass[mode=present,style=elcolors]{powerdot} \pdsetup{ lf=my first presentation, rf=for some conference, trans=wipe, theslide=\english{slide}, randomdots,dmaxdots=80 } \begin{document} \begin{slide}{basic itemize} Contents of the slide. \end{slide} \section{first section} \begin{slide}[<slide options>]{another slide} Contents of the slide. \end{slide} \begin{note}{personal note} The note. \end{note} \end{document}   error messages:  ! Undefined control sequence. <recently read> \c@lor@to@ps l.12 \end{slide} The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., `\hobx'), type `I' and the correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined. ! Undefined control sequence. \XC@usec@lor ...\expandafter \c@lor@to@ps #1#2\@@ \else \expandafter \expand... l.12 \end{slide} The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., `\hobx'), type `I' and the correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined. ! Undefined control sequence. <recently read> \c@lor@to@ps l.12 \end{slide}


I need to get all the dates present in the date range using SQL Server 2005