After reading many books I now understand that the combination of two conductors having equal and opposite charge placed close to each other forms a capacitor and their Capacitance is defined as the ratio of charge on the capacitor(i.e. the charge on the positive plate) to the potential difference between the two conductors constituting the capacitor.  Now my question is that is there any meaning of capacitance for two conductors having unequal charges(i.e. the sum of charges is not equal to zero). If yes then how is the capacitance defined for such a system and will the system still be called a capacitor ? NOTE - I'm a high school student

In Concepts of Physics by Dr.. H.C.Verma, in the chapter on "Capacitors", in page 144, under the topic "Capacitor and Capacitance" the following statement is given:     A combination of two conductors placed close to each other is called a capacitor. One of the conductors is given a positive charge and the other is given an equal negative charge. The conductor with the positive charge is called the positive plate and the other is called the negative plate. The charge on the positive plate is called the charge on the capacitor …   Note that the term charge on a capacitor does not mean the total charge given to the capacitor.   (Emphasis mine)  According to the above statement, "the charge on the capacitor" is the charge on the positive plate when both positive and negative plates of a capacitor are equally charged? How to extend this definition when the two plates are unequally charged?   Suppose we supply charges $+Q_1$ and $-Q_2$ to the positive and the negative plates respectively. After electrostatic conditions are attained, I determined the charge distribution on the four surfaces - outer surfaces and inner surfaces of the two plates. The charge on the outer surfaces of the two plates are equal to $\frac{Q_1-Q_2}{2}$. The magnitude of charge on the inner surface of the two plates is $\frac{Q_1+Q_2}{2}$.   Now coming to my doubt, if the "charge on the capacitor" is the charge on the positive plate, which surface of the positive plate should I want to consider - the outer one or the inner one? And what is the reason for this choice? It seems to me that, a capacitor with unequal charges on its plates is not a capacitor in the first place (inferred from the statement above).


If we have a diagonal covariance matrix does that guarantee independency?

I read from my textbook that $\text{cov}(X,Y)=0$ does not guarantee X and Y are independent. But if they are independent, their covariance must be 0. I could not think of any proper example yet; could someone provide one?


Lizardfolk is a PC race from the book Volo's Guide to Monsters.  The Players Handbook says (Monk):     Beginning at 1st level, while you are wearing no armor and not wielding a shield, your AC equals 10 + your Dexterity modifier + your Wisdom modifier.   Volo's Guide to Monsters says (Lizardfolk):     You have tough, scaly skin. When you aren't wearing armor, your AC is 13 + your Dexterity modifier.   Both explanations saying that this is now your AC. But if I think about the meaning of the Wisdom bonus (feeling/knowing how the enemy is moving) I think a lizard-monk's armor class should be: 13 + your Dexterity modifier + your Wisdom modifier.  So the question is the same as the title: Does the Wisdom modifier apply on a lizard-monk's armor class?

In D&D 5E, does natural armor stack with Unarmored Defense? We have a level 2 player character who wild shaped into an animal. The player said they could stack its natural armor with Unarmored Defense, getting effectively 10 + natural armor + WIS + DEX = a super high AC. Does this work?


I typed the following and get an error. Help would be appreciated it. $x^{2}\lneq x$ It states undefined control sequence.

I know what my symbol or character looks like, but I don't know what the command is or which math alphabet it came from. How do I go about finding this out?


Looks like the answer is no but just to double check... Can I boot Windows 7 SP1 x64 from GPT disk (converted with Windows DISKPART) if my system built on BIOS (non EFI motherboard, ASUS P5WDH Deluxe)?

I'd like to know if there's a method to get Windows 7 or Windows 8 Developer Preview to install to a GPT disk on my traditional IBM PC BIOS setup. Windows 7, of course, rejects my GPT partition, because I don't have UEFI. Well, Debian and Grub 2 seem to work fine... So I want to know if there's a way to force Windows to work as well.  I'd seriously prefer avoiding hybrid MBR/GPT, because it's quite fragile and feels hackish, but it does work. I would assume the main blocker is that Microsoft is simply not adding support in their BIOS bootloader for GPT, which is understandable, I suppose. Is there any recourse?  The way I see it, there are a few potential solutions:   Having an alternate bootloader for the Windows kernel. NOT a chainloader. As far as I know, none exist. That's a shame. Storing as little as possible on an alternate MBR-based disk. Not liking this idea, but it's doable. I'm not sure I'd call this a solution to the problem as much as a workaround. Emulating EFI enough to get the EFI bootloader to work... I remember hearing a bit about a UEFI-on-BIOS emulator, but I can't find anything about it now. I assume this is doable, but there's probably not much demand for it yet, and it's probably no fun at all to setup. GRUB 2 seems to be able to boot a hackintosh with necessary EFI emulation, but I guess there's no interest/UEFI 2 is harder to approach (and I would assume other EFI emulators used for hackintosh are on the same boat.) Coreboot with TainoCore. Coreboot does not work on my motherboard (as far as I know,) and I'm quite sure the last effort to do this during GSoC was a failure. I'd absolutely love this solution, if it did work, though.   Am I missing anything?


I've received an assignment to solve the following determinant for the matrix: A is an nxn matrix defined as follows:  Show that the determinant of A is equal to n+1. I've tried solving it and got stuck, so I checked the solution:  I'm just puzzled, how did the transition from the first determinant to the second happen? I thought maybe they added all the rows to the first one, but it doesn't make sense to me because they received the same result in every variable. Help would be much appreciated!

I have the following $n\times n$ matrix:  $$A=\begin{bmatrix} a & b & \ldots & b\\ b & a & \ldots & b\\ \vdots & \vdots & \ddots & \vdots\\ b & b & \ldots & a\end{bmatrix}$$  where $0 < b < a$.  I am interested in the expression for the determinant $\det[A]$ in terms of $a$, $b$ and $n$.  This seems like a trivial problem, as the matrix $A$ has such a nice structure, but my linear algebra skills are pretty rusty and I can't figure it out.  Any help would be appreciated.


My terminal is not able to download/update/upgrade anything at all. When i type sudo apt-get update, i get this - 0% [Connecting to "IP Address"] and it just stays that way. Doesnt download or update anything. Mind you my laptop is connected to wifi during this process. Why isnt my terminal?

When I do upgrade it gets stuck here:  user@plato:~# sudo apt-get upgrade Reading package lists... Done Building dependency tree        Reading state information... Done Calculating upgrade... Done The following packages will be upgraded:   bind9-host coreutils cpio curl dnsutils libbind9-90 libc-bin libc-dev-bin   libc6 libc6-dev libcgmanager0 libcurl3 libcurl3-gnutls libdns100   libdrm-intel1 libdrm-nouveau2 libdrm-radeon1 libdrm2 libisc95 libisccc90   libisccfg90 libjasper1 liblwres90 libplymouth2 libsepol1 libssl-dev   libssl-doc libssl1.0.0 linux-libc-dev mime-support multiarch-support ntp   ntpdate openssl plymouth plymouth-theme-ubuntu-text python3-distupgrade   ubuntu-release-upgrader-core unzip 39 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. Need to get 16.0 MB of archives. After this operation, 12.3 kB of additional disk space will be used. Do you want to continue? [Y/n] y 0% [Connecting to us.archive.ubuntu.com (2001:67c:1562::15)] ░   When I do update it gets stuck here:  user@plato:~# apt-get update 0% [Connecting to us.archive.ubuntu.com (2001:67c:1562::14)] [Connecting to sec░   I'm able to ping us.archive.ubuntu.com just fine:  user@plato:~# ping us.archive.ubuntu.com PING us.archive.ubuntu.com (91.189.91.23) 56(84) bytes of data. 64 bytes from economy.canonical.com (91.189.91.23): icmp_seq=1 ttl=54 time=81.5 ms 64 bytes from economy.canonical.com (91.189.91.23): icmp_seq=2 ttl=54 time=81.5 ms 64 bytes from economy.canonical.com (91.189.91.23): icmp_seq=3 ttl=54 time=81.5 ms 64 bytes from economy.canonical.com (91.189.91.23): icmp_seq=4 ttl=54 time=81.4 ms ^C --- us.archive.ubuntu.com ping statistics --- 4 packets transmitted, 4 received, 0% packet loss, time 3004ms rtt min/avg/max/mdev = 81.425/81.528/81.582/0.355 ms   What can i do to fix this?    What I have tried so far.  I've tried following directions on this blog:   To force apt-get to use IPv4 exclusively   Create a file in /etc/apt/apt.conf.d/99force-ipv4 Add this line to newly created file Acquire::ForceIPv4 false; Apt-get will now use IPv4 exclusively


I am building a logistic regression model and one of my independent variable sis heavily skewed. Is it better to use the ln or the log10? Why?  And how to correct the skewness of a variable that contains a lot of zero values?

I have few seemingly simple questions.   I am working on time series data and applying vector error correction model. I find different results when I transform the data into LOG and LN. Which one is better? I have variables in % and in levels (numbers). I have for example one which is measured in million USD and others in %. My question: shall I list the whole number in eviews like 47,000,000,000 or just 47 and then bring in the billion when interpreting the results? Does it make any difference when running Johansen's test?


The story I'm thinking of is from the 80s, and it's set in a world where the Great Depression never ended, and so in the "present day" the main character, a wanderer, stumbles upon a society of deaf-mutes. This all came to pass because of a drug that created deformities in children when ingested by pregnant women (like the thalidomide controversy) and so years ago a group of these people set out to create their own society in the middle of nowhere - I think it was in the desert. This man approaches the outskirts of the village and sees a man approaching on a cart. The wanderer only realizes belatedly that the man can't see or hear him. I think the man on the cart might have used a pole so he could feel where the road's boundaries were by whacking it against the fence posts on either side. The wanderer follows the man and encounters a strange sight: braille paths to different buildings. The paths had different patterns that corresponded to particular locations. I believe as a consequence the inhabitants walked barefoot, and I believe they communicated by "writing" in each others' palms. I think the wanderer befriended a little girl, who took him to a cafeteria of sorts in a pitch-black building. That's all I remember.

I was reading  and it made me suddenly remember another story I read in a book somewhere in the 90s to the early 2000s. Rather than being about a sighted man showing up in a community of the blind, this involved a hearing man (for some reason, I want to say he was either a reporter or an encyclopaedia salesman) showing up in a community for the deaf. They were socially isolated, the result of the government or society trying to eliminate hereditary deafness. I don't remember if the theme was of eugenics or simply that deaf people were kept from meaningfully interacting with society. While there, the protagonist notices that the children (all of whom are deaf) spend time standing in fields, holding hands, and swaying to music he can't hear. He comes to realize that, by being completely isolated from sound, the community hears something more fundamental to the universe, and the story ends with the community using this to move to another world, possibly a higher plane of existence.  One of the odd details that I remember was a member of the community communicating that when they started out, they were preyed upon by men who assumed they would be easy targets due to their deafness, and that they had both trained to defend themselves and also kept a number of guard dogs on the premises.


I have been installing different distros on my pc based on their niche that I find valuable. I'd want to know how to install programs to a drive not containing the root for that version so I could use the programs on different versions. Is that possible? **For example, I have windows and I have my programs installed on a different hard-drive so If I'd be able to use most those programs on win7 or 10 if I had those on a different partitions.

I want to choose where on a hard drive the application is stored when installing it via Ubuntu Software Center. I am not looking for a general setting for all applications, but rather I would like to set the exact folder on hard drive where the currently installed applications will be stored. Also is it a problem to store the application to a NTFS partition?


Describe which natural numbers do not belong to the set $$E = \left\{\left[n+\sqrt{n}+\frac{1}{2}\right] \mid n \in \mathbb{N}\right\}.$$   The answer is the set of positive perfect squares. I am not sure how to prove it. We know that $\left[n+\sqrt{n}+\frac{1}{2}\right] = n+\left[\sqrt{n}+\frac{1}{2} \right]$, but what do I do from here?

Let $(a_n)$ be a sequence of positive integers defined by  $a_n=[n+\sqrt{n}+\frac{1}{2}]$  Show that a natural number $m$ doesn't occur in the sequence iff it is a square.


I am working with regular expressions and am struggling to understand a particular output.  Case 1:  >>> m = re.match("(abc)+", "abc") >>> m.groups() ('abc',)   Case 2:  >>> m = re.match("([abc])+", "abc") >>> m.groups() ('c',)   In Case 1 above, I do understand how m.groups() returns ('abc',) (a tuple with the matched string for group 1, the only group in the RE).  However, in Case 2 above, where I put 'abc' in the RE inside a character class as [abc], I do not understand why does m.groups() return ('c',). I would have still expected the same tuple returned as Case 1, i.e. ('abc',)  Could anyone please help me understand why does m.groups() return ('c',) in Case 2.

I have a Python regular expression that contains a group which can occur zero or many times - but when I retrieve the list of groups afterwards, only the last one is present. Example:  re.search("(\w)*", "abcdefg").groups()  this returns the list ('g',)  I need it to return ('a','b','c','d','e','f','g',)  Is that possible? How can I do it?


When reviewing, it is possible to edit the post that is presented. However, when what you are reviewing is actually a review audit and you click edit, the following message appears:     This post is deleted and cannot be edited.   See    Doesn't this kind of give the game away? It's literally telling you that you need to flag the post as it's an audit. When you do so you'll get the Congratulations message, giving you a free review point.  Is this a problem? Should this be Changed?

On a recent review audit on SU, I clicked "Edit" and was greeted with the plain text "This post was deleted and cannot be edited". It wasn't in a popup box or anything; the actual page consisted of just that text, with no formatting (as though it were the only content of the HTML page). This makes it really obvious I'm dealing with an audit.


I made a pair of eyes for a character of mine that consists of two meshes. One that acts as the real eye with the iris and the pupil, and then a copy of that one but slightly different to represent a cornea which has only a simple glass shader on. Why are the eyes of my character dark as soon as I place them inside the eye sockets? Seriously, you can barely see them. Can anyone tell me why Blender does this?  Eye out of socket:    Eye inside socket:    From a distance you can't see it's eyes at all, only if you're this close can you make them out.  Blend file:

My model has a clear plastic (or glass) dome with objects inside.  The objects appear dark.  I've tried the glass shader with color 100% RGB, with very small IOR, and using just a refraction shader.    I know Cycles has problems with caustics, but I just want broad illumination to fall clean through the glass.  The light-to-column path can ignore refraction, but is blocked or tremendously attenuated. The camera-column path needs refraction, and seems to work fine anyway.  This demo image offers all optical paths of interest:   light upon object, seen directly light upon object, seen through glass (looks okay) light through glass onto object, seen directly. This is the shadow on the lit side of the column just below the glass tubing.  I expect full illumination, but there is shadow.  There is some light, but it's diffuse light from the floor. light through glass onto object, seen through glass. This     I did at one point try non-progressive rendering, and find extremely coarse light where there shouldn't be shadow, but this is not a practical way to make nice images. I've even tried cranking up certain sampling settings to many thousands, but still get bad noise though less, at the cost of long render times. I  would like to finish my creations sometime before "Star Trek, the Generation After the Next" becomes real life, if you know what I mean.  The next image is an example. I think Transmission in Sampling was 5000, but not sure.    I'm using Cycles in Blender 2.67 on a quad core Linux machine, 16GB RAM. Machine limits have never been a problem for 3D rendering.  Possibly, I screwed up some setting when I made my startup file, and just need to fix it. OTOH maybe this is just a limitation of path tracing, or of the way Cycles does it. If that's the case, what to real-world Blender artists do when they need to produce images on a budget and schedule?  What is the practical real-world fix?


I have been watching some LinkedList videos to try and understand what it is. But I see a lot of people having code like   for(String x : model)   Can anyone help me understand what ":" does in this code besides attaching x to "model" or is that all it does?

Consider:  List<String> someList = new ArrayList<String>(); // add "monkey", "donkey", "skeleton key" to someList     for (String item : someList) {     System.out.println(item); }   What would the equivalent for loop look like without using the for each syntax?


Is it true that when a spring is extended, potential energy is stored in spring and result in gain of mass of the spring?

(One of examples that potential energy contributes to mass.)  Does hot object weigh more than cold one?  (One of examples that kinetic energy contributes to mass.)  If these are true and justified by mass-energy equivalence principle, could the underlying principle be justified?  I've learned and derived $E=mc^2$ but only for the case that $m$ is interpreted as rest one. Could I generalize this argument to include kinetic and potential energy? :  $$mc^2=E =∑m_0c^2+∑K+V=∑\gamma m_0c^2+V$$


"Not only has he got many friends, but also several enemies."  "Not only he has many friends, but also several enemies."  Which out of the two statements above is correct?

Why is this sentence incorrect:  "Not only this transformation changes the preference of respondents, but it also converts the scale"  and I was asked to write:  "Not only does this transformation change the preference of respondents, but it also converts the scale"  Any suggestion will be helpful.


How do you tell when a noodle is done cooking? I have tried throwing it at the ceiling but I don't know if that works can someone please help me find out.

I've tried a number of different ways to tell when spaghetti, capellini and other pasta types are done, but I'm curious if there are more specific rules of thumb.  With regular spaghetti, I've tried biting-in-half to see if it's still white in the middle, throwing it against the fridge (which seems more amusing than useful), etc., but are there better and more reliable ways?  Also, how much does pasta 'cook' once you take it out of the water?  So if you want an al dente pasta, do you take it off slightly before done?  If so, how much?


Scanner scan = new Scanner(System.in);         AccountList accounts = new AccountList();                  accounts.addAccount(new BankAccount(100000, "Mark", "BA0021"));         accounts.addAccount(new BankAccount(367000, "John", "BA0022"));         accounts.addAccount(new BankAccount(94500, "Michael", "BA0023"));                  accounts.accessAccount("BA0021").checkBalance();         String temp = "BA0022";         accounts.accessAccount(temp).checkBalance();         **temp = scan.nextLine();         accounts.accessAccount(temp).checkBalance()**;  As you can see, I tried :         **temp = scan.nextLine();         accounts.accessAccount(temp).checkBalance();**  like the other two methods I tried and succeeded :         accounts.accessAccount("BA0021").checkBalance();         String temp = "BA0022";         accounts.accessAccount(temp).checkBalance();  And the console shows : Mark's  balance is $100000 John's  balance is $367000 **BA0023 Cannot Find an Account That Matches the ID** Exception in thread "main" java.lang.NullPointerException: Cannot invoke "ainsof26.project.banking.BankAccount.checkBalance()" because the return value of "ainsof26.project.banking.AccountList.accessAccount(String)" is null     at BankingApplication/ainsof26.project.banking.BankingApplication.main(BankingApplication.java:22)  Can you recognize what the problem here is? This is accessAccount method : BankAccount accessAccount(String id) {         for(BankAccount account: accountList) {             if(account.clientId == id) {                 return account;             }         }         System.out.println("Cannot Find an Account That Matches the ID");         return null;      }

I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug.  Is == bad? When should it and should it not be used? What's the difference?


How do we identify if a number can be represented as the sum of squares of $3$ integers?  For eg: $434 = 11^2 + 12^2 + 13^2$ but $432$ is not?

I'm trying to determine if 1317 and 116 can be written as the sum of three squares?  I have the condition that if it is not of the form $4^{\alpha}(8k+7)$ then it can be written as a sum of three squares, but how do I use this condition to work it out?  Thank you


I am doing a Senior Design Project for my Electrical Engineering degree. This project involves making a PCB. I am having trouble finding a specific library for EAGLE 7.7.0 software. The library that I need is for an NJM2360D Boost Converter. Does anyone know where I can get a library for this component? Please and Thank you!

I'm designing a small module that breaks out a DIP SPI EEPROM to a 2x5 pin header socket(more info here: ). I want to mount the socket on the end of the board, with the pins lying parallel to the board.  I think two 5x1 surface-mount header footprints, on both sides of the board right near the end would do the job. Trouble is, KiCAD doesn't come with such a footprint(if it does, I haven't found it yet). Where might I find one? If one doesn't exist, that's OK; I'll have a shot at making my own.


Given a positive sequence $\{a_n\}$ such that   $$a_{n+1}=a_n+\frac{n}{a_n}$$   Can one find an symptotic expannsion of $a_n-n$?   I want one which has the term $O(1/n)$, or a stronger one.

Let $a_{n+1}=a_n+\frac{n}{a_n}$ and $a_1>0$. Prove $\lim\limits_{n\to \infty} n(a_n-n)$ exists.  In my view, maybe we can use  $${a_{n + 1}} = {a_n} + \frac{n}{{{a_n}}} \Rightarrow {a_{n + 1}} - \left( {n + 1} \right) = \left( {{a_n} - n} \right)\left( {1 - \frac{1}{{{a_n}}}} \right).$$ And then  $${a_n} - n = \left( {{a_1} - 1} \right)\prod\limits_{k = 1}^{n - 1} {\left( {1 - \frac{1}{{{a_k}}}} \right)} .$$ By Stolz formula, we have  \begin{align*} &\mathop {\lim }\limits_{n \to \infty } n\left( {{a_n} - n} \right) = \mathop {\lim }\limits_{n \to \infty } \frac{n}{{\frac{1}{{{a_n} - n}}}} = \mathop {\lim }\limits_{n \to \infty } \frac{1}{{\frac{1}{{{a_{n + 1}} - \left( {n + 1} \right)}} - \frac{1}{{{a_n} - n}}}}\\  = &\mathop {\lim }\limits_{n \to \infty } \frac{{\left[ {{a_{n + 1}} - \left( {n + 1} \right)} \right]\left( {{a_n} - n} \right)}}{{{a_n} - {a_{n + 1}} + 1}} = \mathop {\lim }\limits_{n \to \infty } \frac{{\left[ {{a_{n + 1}} - \left( {n + 1} \right)} \right]\left( {{a_n} - n} \right)}}{{ - \frac{n}{{{a_n}}} + 1}}\\  = &\mathop {\lim }\limits_{n \to \infty } {a_n}\left[ {{a_{n + 1}} - \left( {n + 1} \right)} \right]. \end{align*} And how can we continue?


Let $X = \{f \in C[0,1]; \|f\|_{\infty}\leq1, f(0)=0, f(1)=1\}$ be a subset of $C[0,1]$ and define the operator $T:X \rightarrow X$ by $Tf(t)=f(t^{2})$. Show that $T$ is continuous and has no fixed point.   Could you help me with the later question?

Problem: Given $f:[0,1] \rightarrow \mathbb{R}$ ($f$ continuous ) and $f(x^2) = f(x)$ $\forall x \in [0,1]$. Show that function $f$ is a const.


Regarding this code my table is fit to the page but the size of words are diminished. What should I do? \begin{table}[H]     \centering     \caption{Printing parameters}     \resizebox{\columnwidth}{!}{%     \begin{tabular}{ccccccccc}         & Layer height, mm & First layer speed, mm/s   &Printing speed, mm/s  & Extruder temperature, °C & Bed temperature, °C & Extrusion multiplier & Extrusion width, mm & Fan speed, \% \\ \hline         Carbon fiber tow&  &  &  &  &  &  &  &      \end{tabular} }     \label{table3} \end{table}  Thanks

I have a table that I want to insert on a page, but at least one (perhaps both) of the following conditions are met:   The table is too wide to fit within the text block or page. That is, I'm exceeding some horizontal restriction. The table is too tall to fit within the text block or page. That is, I'm exceeding some vertical restriction.   What are my options to make this table fit? If it doesn't fit, regardless of my attempts, what other options exist?


Is it deliberate that I can't click on the timestamp of a comment on the election page, to grab a link? I could earlier tonight! The feature is useful for sharing comments in chat.  FF26 WinXP SP3

There were   on this already, and  it’s also implemented by now. And when looking at the source, I can indeed see an ID being set for every comment on election pages.  However, unlike comments on questions, there is no actual link for the permalink for comments on election pages:    Could those be added please so we can actually link to comments easily?


I've bought a Windows 8.1 key with the intention of uninstalling Ubuntu 14.04 and installing Windows 8.1. I don't have a recovery disk, but I do have a USB handy that I can run something from... I'm very new to Linux so no suggestion is too simple! I wouldn't mind a dual boot but I'd prefer a full wipe - any information required feel free to ask. Thanks.

I have absolutely no experience with Linux, and I desperately need to get my computer back up and running again with Windows.  How do I remove Ubuntu and reinstall Windows?    Editor's note: many of the answers are about removing Ubuntu from dual-boot but keeping Windows (which is a bit complicated), while other answers are about removing Ubuntu from single-boot (which is easy: basically just format the disk while installing Windows). The question as written is ambiguous between dual-boot or single-boot.


I have code that looks like this:  var a = []; for(var i = 0; i < 10; i++) {     a[i] = function() {         console.log(i);     } }   Unfortunately, it seems that i is being passed by reference, so all the functions in a output 10. How do I make it so that each function outputs the value that i had when it was created? I.e. a[0]() gives 0, a[1]() gives 1, etc.  EDIT: to clarify, I do not want a to store the values 0-9. I want a to store functions that return the values 0-9.

How would you explain JavaScript closures to someone with a knowledge of the concepts they consist of (for example functions, variables and the like), but does not understand closures themselves?  I have seen  given on Wikipedia, but unfortunately it did not help.


Is it possible to use the free Wi-Fi at the Zurich Airport when one cannot receive a text message?

I am traveling through Zurich and have a phone without any roaming there; I'm planning on picking up a SIM once I get to my final destination. Last time I was there, I couldn't access the airport wifi because it required a code sent via SMS.    In the event I need to contact someone or coordinate about flight delays, is there some alternate way to get wifi access?


Our prof gave us the following problem as an exercise:  Suppose $(R,+,\cdot)$ is a finite ring with unity (denoted $1_R$) such that for some $a,b\in R$, we have $ab=1_R$ Show that $ba=1_R$  Here's my attempt at a proof: Proof. Let us assume that $ba\neq 1_R$ Next, we consider $S:=\{(ba)^n\mid n\in\Bbb Z^+\}\subseteq R$ Since $R$ is a finite ring, we must have that $(ba)^m=(ba)^n$ for some distinct $m,n\in\Bbb Z^+$ (wlog say $m\gt n$). Then, we have $(ba)^{m-n}=1_R$ Note that $m\gt n$, so $m-n$ is a positive integer but $m-n\neq 1$ (hence $\gt 1$) since $ba\neq 1_R$ by assumption. Now, $$(ba)^{m-n}=1_R\iff b(ab)^{m-n-1}a=1_R\iff b(1_R)^{m-n-1}a=1_R\iff ba=1_R$$ which gives us a contradiction.  Is the above proof correct? I'd like the community to proofread it. I'd also be interested in a shorter argument to prove the claim (if there is one). Thanks!

Let $R$ be a finite ring with identity $1$, and assume $\exists x,y\in R$ such that $ xy=1$. How can I show it implies $yx=1$?


Was trying to figure this out, and realized I don't know the exact math:  In the card game magic you have a deck of 60 cards. You can have 4 copies of any individual card, and you are dealt a starting hand of 7. Each turn, one additional card is drawn.  What are the odds of drawing more than one of a card (2, 3, or 4 of the same card) on turns 1, 2, 3 etc...  If anyone knows how to break this down, I'd love to see the math behind it.  Cheers

In Magic, at the start of the game, you draw 7 cards. How would you calculate the likelihood of drawing a specific card in your opening hand?  For example, let's say I have a 60 card deck, and I'm running 4 . What is the percent chance that I will have at least one Bird in my opening hand?


I've never used the python console before so I only know  commands from the documentation that I've looked up. But I've read that it can be a lot faster than just pressing ctrl+F12 because it doesn't need the GUI.. or something. I looked in other places as well but my brain started to melt from this programming nightmare thing. I also have multiple scenes that needs rendering, so if I could do them one after another, it would be a plus. So if someone could show a command that let's me render my animation(s) in the compositor from the command line, it would be most appreciated!

I would like to be able to render several files one after the other, when I am not using my computer, e.g. at night. Is there a way of doing this?


I've just read , but I don't understand; where can I find the file ~/.config/spotify/Users/[Spotify user name]-user/prefs to be able to edit it? Do I have to use the Terminal? If possible, can you explain step by step how to find ~/.config/spotify/Users/[Spotify user name]/prefs? Edit I found it using Google Chrome: file:///home/tim/.config/spotify/Users/tim/prefs  But I cant edit it. How do I edit a file in a folder that starts with a .? Do I need to be root user?

How do you show a hidden folder (whose name starts with .) in File Manager a.k.a. Nautilus on Ubuntu?  I am somewhat new to Ubuntu and can't seem to find the "view" menu.


I've QGIS 2.18 installed in Ubuntu 16.04 for a long time. I added the repository .  Why is it not updating to version 3.0 or 3.2? I thought the respository for the LTR version is .

I am relatively new to Linux, so can you indicate the exact commands (step-by-step) that I need to type to get the latest QGIS installed on Ubuntu 14.04.  I have tried to follow the instructions provided here  but I haven't managed to install anything.  Can someone explain to me step by step process of doing it. Right from adding the QGIS repository on the sources list.  I have Ubuntu 14.04.1 LTS installed on a 32-bit Dell Latitude E4310 Machine


Example: a guy who is used to being around the opposing sex and has been for a long time, therefore he will usually be more comfortable with female friends than male ones   (I'm not good at explaining things and I have searched all over for a good word that describes this attitude so I hope you get gist of What I'm saying)

I am looking for a word describing a man who has a lot of female friends, and who prefers female friends.   I was "Wikipedia surfing" (going through Wikipedia pages and clicking on links found within the wiki), and I came upon the page of a man who had a lot of female friends, and there was a word that described that attribute succinctly.   I do not remember any details about the bloke. I looked up the word (I seemingly immediately forgot it), and, to tell the truth, I am unsure whether the word defined "someone who has a lot of friends of the opposite sex" (which, if true, means in my memory I incorrectly paired the word's definition to his gender), or more specifically, "a man who has a lot of female friends (and/or) prefers female companionship", where companionship does not insinuate sexual relationships.  If there were two words for the two definitions I just gave that'd be all the better! I have tried to remember for quite a while to no success.    An update: perhaps an example for some clarification is necessary. Imagine a scenario where you have a gay man (who has never had sexual interests in women) who has all female friends, who know he is gay, and no male friends. Here he prefers the companionship of women, and not of men; thus, he could be a "ladies' man", but only speciously, since I believe the word implies some yearning, from either the women or the "ladies' man", to copulate, which doesn't exist here. The word would also apply for a lesbian who only has male friends (who she has no desire to copulate with), and who thus prefers them as companions. So, generally, we'd get: "someone who prefers the company of members of the opposite sex". I hope this clarifies the request some. Thank you.


I have provided the code for a triangle having vertices A, B, and C. The lengths of the sides are to be labeled a, b, and c.  The altitude of the triangle is to be drawn as a dashed line segment from A to line segment BC, the foot of the altitude is to be labeled P, the height is to be labeled h, and a right angle mark is to be put at the foot.  The length of PC is to be labeled x, and the length of PB is to be labeled b-x, and these labels are to be inside the triangle.  There are now two smaller triangles that are similar to each other.  One pair of angles that have equal measure are to be labeled with an arc having a "peg" through it; the other pair of angles that have equal measure are to be labeled with an arc having two "pegs" through it.  \documentclass[10pt]{amsart} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsthm} \usepackage{mathtools,array} \usepackage{tikz}  \tikzset{ mydot/.style={   fill,   circle,   inner sep=1.5pt   } }  \begin{document}   \begin{tikzpicture}[>=latex]  % the coordinates of the vertices \coordinate (C) at (0,0); \coordinate (A) at (100:4cm); \coordinate (B) at (20:5cm);  % the edges of the triangle \draw (C) -- (A) -- (B) -- cycle;  % labelling the vertices \node[mydot,label={left:$A$}] at (A) {}; \node[mydot,label={right:$B$}] at (B) {}; \node[mydot,label={below left:$C$}] at (C) {};  \end{tikzpicture}  \end{document}

I saw the following code for drawing a triangle separated into two right triangles used in a demonstration of the Pythagorean Theorem.  What does the code \tkzDefPointWith[orthogonal normed,K=7](C,A) instruct TikZ to typeset?  How can I add "P" to the picture at the point that (dotted) line segment from C intersects line segment AB?  I guess that I use the command \tkzLabelPoint. What is the optional argument to position P? After I label this point, I guess that I can have TikZ draw a right angle at this intersection with a command like \tkzMarkRightAngle(C,P,B).  \documentclass{article} \usepackage{tkz-euclide} \usetkzobj{all}  \begin{document}  \begin{tikzpicture} \tkzDefPoint(0,1){A} \tkzDefPoint(2,4){C} \tkzDefPointWith[orthogonal normed,K=7](C,A) \tkzGetPoint{B}  \tkzLabelPoint[left](A){$A$} \tkzLabelPoint[right](B){$B$} \tkzLabelPoint[above](C){$C$}  \tkzMarkRightAngle(A,C,B)  \tkzDrawSegment[green!60!black](A,C) \tkzDrawSegment[green!60!black](C,B) \tkzDrawSegment[green!60!black](B,A)  \tkzLabelSegment[auto](B,A){$c$} \tkzLabelSegment[auto,swap](B,C){$a$} \tkzLabelSegment[auto,swap](C,A){$b$}  \tkzDrawAltitude[dashed,color=magenta](A,B)(C) \tkzGetPoint{P}  \tkzMarkAngle[size=1cm,color=cyan,mark=|](C,B,A) \tkzMarkAngle[size=1cm,color=cyan,mark=|](A,C,P) \tkzMarkAngle[size=0.75cm,color=orange,mark=||](P,C,B) \tkzMarkAngle[size=0.75cm,color=orange,mark=||](B,A,C) \end{tikzpicture}  \end{document}


I'm usually used to scp but this time to access the source server I need to ssh to a first machine then do another ssh from this server to access a local machine. How to transfer files from this machine to my machine? because it's not directly accessible. Can I use the machine in the middle as a "proxy" for my transfers?

I am trying to copy files from a remote server to my local server, however, my remote server first requires me to connect to an intermediate host and then leapfrog onto the actual server from there. I am wondering how would I go about copying files from my remote server to my local machine with the scp command using this leapfrogging technique?  So first I have to connect to intermediate server, then from there I want to connect to my actual server.


I need to delete the first 2 bytes of a 6MB file. However, this is an embedded Linux with only 32 Mbytes RAM and less than 1 MB free flash memory.  I tried using dd, as:  1 - # dd bs=1 skip=2 count=1022 if=input of=ouput_1  2 - # dd bs=1024 skip=1 if=input of=ouput_2  3 - # rm -rf input  4 - # (dd if=ouput_1 ; dd if=ouput_2) > ouput  5 - # rm -rf ouput_1 ouput_2  With all files under the /tmp (mounted as tmpfs on RAM), my problem is that just before lines 3 and 5, the memory needed is 12 Mbyte (2x6MB), and the process sometimes fail and gives an "Not enough memory" error.  Is there a way I can remove the first 2 bytes without allocating twice the size of the file ? Can I use dd (or any other) to cut a binary file 'in place' ?

Today I had to remove the first 1131 bytes from an 800MB mixed text / binary file, a filtered subversion dump I'm hacking for a new repository. What's the best way to do this? To start with I tried dd bs=1 skip=1131 if=filtered.dump of=trimmed.dump  but after the skip this copies the remainder of the file a byte at a time, i.e. very slowly. In the end I worked out I needed 405 bytes to round this up to three blocks of 512 which I could skip dd if=/dev/zero of=405zeros bs=1 count=405 cat 405zeros filtered.dump | dd bs=512 skip=3 of=trimmed.dump  which completed fairly quickly but there must have been a simpler / better way? Is there another tool I've forgotten about?


I'm beginner of java and I study about JFrame now but I have an issue. I made a constructor with parameters of JPanel but when I invoke it with arguments, an error is happened. Could you help me to find any solutions??  import javax.swing.*; import java.awt.Color; import java.awt.Font; import java.awt.*;  public class JFlexiblePanel extends JFrame{      private Color col1;     private Color col2;     private Font font1;     private String str;     private JPanel panel1;     private JLabel label1;      public JFlexiblePanel(Color col1, Color col2, Font font1, String str) {         this.col1 = col1;         this.col2 = col2;         this.font1 = font1;         this.str = str;         panel1.setBackground(this.col1);         panel1.setForeground(this.col2);         label1.setFont(this.font1);         label1.setText(this.str);         panel1.add(label1);     }     }   In different class to invoke this constructor  JFlexiblePanel p1 = new JFlexiblePanel(Color.BLUE, Color.RED, new Font("Arial",Font.BOLD,12), "America");

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


Can we verify if $E(X^2)$ also exist, provided that E(X) exists?   Thanks.

It would be appreciated if the following examples could be given:   A distribution with infinite mean and infinite variance. A distribution with infinite mean and finite variance. A distribution with finite mean and infinite variance.  A distribution with finite mean and finite variance.   It comes from me seeing these unfamiliar terms (infinite mean, infinite variance) used in an article I am reading, googling and reading a thread on the , and not finding it a sufficiently clear explanation. I also haven't found any explanations in any of my own textbooks.


The plugin 'OpenLayers plugins' doesn't work any more in Qgis version 2.8 'Wien'.  Is there another solution to load/ add an open street map file?

Although I have installed the OpenLayers plugin in QGIS 2.4, I cannot see it in the list when I click on Plugins.    Does anyone else have this issue?


I had http://foo.tld/ cancelled because foo was a name too similar to a brand, so the DNS authority cancelled it. So I will register http://bar.tld/ to talk about 'foo'.   'foo' as ALIAS:  http://foo.bar.tld/  'foo' as /Directory/:  http://bar.tld/foo/  I personally prefer the Alias way, it one less /Directory/.  So my question is, how should I develop the website, or both ways are the same? Can anyone point out the differences?

I recently moved from having a main site like www.example.com with a subdomain associated site yyy.example.com, to moving everything off the subdomain to a subdirectory like www.example.com/yyy/, with the same hierarchy underneath the subdirectory, and now yyy.example.com is just a redirect page to the subdirectory, so yyy.example.com/abc/page-x is redirected to www.example.com/yyy/abc/page-x and so on.  The effect has been that the traffic increased by several times (the total page views are more than ten times at the present rate) what it was to the yyy subdomain. Previously almost all of the traffic to the yyy subdomain was from the www site. This is from monitoring the old yyy site for a year or more.  I'm curious to know if there's any research or results which would indicate whether this is universal (subdirectories beat subdomains) or "just me".


I have text file which contains numerous lines. I need to do:   shuf txt.txt From shuf output read first line to a variable $line   How to represent it in one line for bash script?  Now it is like this:  shuf txt.txt -o aaa.txt n=$(head -n 1 aaa.txt) rm -rf aaa.txt   As you may notice, it is not very nice

What's an easy way to read random line from a file in Unix command line?


I tried to find the $4$ digits of $2^{2020}$ with Euler. i find without Euler the last digits (6) , but i dont know how to find it using Euler . its look very simple but im getting trouble on it...

can u suggest me any short trick of solving these kind of problems. How to find last four digits of any number raised to some power ?


I am currently using Ubuntu 14.04 on my very low end computer (it has pentium 4 2.8 GHz, with 1 Gb ram and 40 Gb HDD). The problem is that it gets really slow every now and then, though it is much smoother than Windows! However, am looking for something more buttery to use.  I have spent a lot of time (since I am new to Linux) in installing apps such as Red Eclipse, Google Chrome, uTorrent and many more into my current OS.  I have heard that Lubuntu would be the best choice for me, and have confirmed that with my own research on Google, as I would be using it for low end gaming, listening to music, web surfing, online gaming (Miniclip), movies, torrenting, some programming and some photo and light video editing.  How can I change from Linux Ubuntu to Linux Lubuntu without losing any data? Will my currently installed apps work on Linux Lubuntu as well?  Some additional questions:   How can I make Lubuntu look better and really good to the eye after I have installed it? Are the terminal commands almost the same in Lubuntu as they are in Ubuntu? How would I connect my PPPoE connection in Lubuntu?

I am a new linux user and i installed Lubuntu on my old pc. I found that learning codes of lxterminal is quite rewarding. Codes of Ubuntu are quite easily found. Are the codes for Ubuntu and Lubuntu same? and  What are the best sites to learn those?


How to add a file shortcut on the desktop in 16.04? I tried to drag & drop a file from Nautilus to the desktop and nothing happened.  Thanks.

I wonder, isn't still there  an easy way to create a desktop shortcut in Ubuntu 14.04 (or Unity)? There is no context menu on desktop doing this.   So I tried the following: I looked for an app I want to create a shortcut for in the dash, then I tried to drag it to the desktop. And guess what? I got the error:


The title essentially says it all.  Is there a way of efficiently finding the commutator subgroup of $A_4,$ and groups in general?  I know that the commutator subgroup must be normal in $A_4.$  I know the conjugacy classes are classes of cycle type:  $1$  $2, 2$  $3, 1$  The normal subgroups must be a union of the conjugacy classes. Does this mean that the commutator is:  e+conjugacy class of cycle type $(2, 2)$+ conjugacy class of cycle type $(3, 1),$  where e is the identity element of $A_4$?  Please make the explination as simple as possible, I'm having difficulties with abstract algebra.

Find the derived subgroup of $A_4$.   Since it is $A_4$, for a permutation $\sigma$ to be in $A_4$, $\sigma$ must have a cycle structure of $2$ cycles. Therefore, $\sigma=(ab)(cd)$.  The commutator of such elements, would be obviously another permutation of $2$-cycle (of length $2$).  Does it mean that $A'_4=A_4$?


You can ﬂip the coin $100$ times, but instead of having a ﬁxed stake, you can freely choose the stake for each ﬂip, just before the ﬂip. You start out with $\$$$100$. After each ﬂip, if it comes up heads you win twice your stake (and your stake is returned), and if it comes up tails you lose your stake (if you start with $x$ and select a stake of $s$, then after the ﬂip you will either have $x−s$ or $x+2s$. You can never make your stake larger than your current balance.  My goal is to find an optimal strategy $(s_1, s_2, s_3, ..., s_{100})$ to maximize an expected profit. It turns out that the optimal strategy is $S=x$.  I understand that the expected balance after a single coin flip is:   $$\frac{x-s}{2} + \frac{x+2s}{2} = \frac{2x+s}{2}$$  which is maximized when $s = x$. To me, this makes me think that $S = x$ is a locally optimal choice, but is this sufficient to conclude that I should always take $S = x$ for every flip or was it just coincidence (that locally optimal choice leads to globally optimal solution)? I think the good analogy is a greedy algorithm (e.g the greedy algorithm makes a locally optimal choice to find a global optimum - this doesn't work most of the time).

I was recently asked this question in an interview, but was completely stumped as to how to even begin answering it - it's been bugging me ever since, and I thought it was quite a nice question, so hopefully someone on here can help me out. Any help would be appreciated! Here goes:  You start off with £100 and you toss a coin 100 times. Before each toss you choose a stake $S$ which cannot be more than your current balance $x$ (so your maximum stake for the first toss is £100). If the coin comes up heads, you win $2S$ and your new balance is $x+2S$. If it comes up tails, you lose your stake and have $x-S$. How do you choose your stake so as to maximise your expected winnings from the game, not including the initial balance?  Cheers,  Boris


Hi, I'd like to know what algorithm is used to display recent tags on homepage? How many recent questions tags is taken under consideration when displaying that tag cloud? Any details?

How are these calculated? I see them going up and down all the time, and there are obviously way more than 48 questions about C# so how are these calculated?


I have a pretty long paper that is getting sluggish to compile. Different sections are imported with \input. I'd like to have something like \includeonly but that works on \input rather than \include commands (\input works better for the paper as it does not start sections on new pages, etc.).  A reasonable option would be to use \include for the draft and swap back later, but thought I would ask here first if there is a command like \includeonly for \input. (By the way, I tried \includeonly combined with \input but indeed it doesn't work.)

I am running into a rather weird error that apparently originates from the combination of \include, \let\clearpage\relax and a referenced label after a page break.  In this particular example, the label mylabel defined in the listing cannot be referenced anymore when the reference and the label are close enough to a page break.  The MWE consists of two files, the main-file and an included file. I am using the \let\clearpage\relax command to . The error does not occur if the file is \input instead of \included.  \documentclass[11pt,twoside]{book} %  \usepackage[utf8]{inputenc} % Enoding \usepackage[english]{babel} % Language \usepackage{listings} \usepackage{forloop}  \begin{document} \begingroup \let\clearpage\relax  \include{includedfile} % changing include for input would work  \endgroup \end{document}   Included file:   \newcounter{ct} \forloop{ct}{1}{\value{ct} < 40}% {%     .\\ }  Listing \ref{mylabel}.  \begin{lstlisting}[caption=somecaption, label=mylabel] some code; \end{lstlisting}   Running this example will have an output where the label cannot be referenced (even after multiple runs):    Now, one solution is to use \input as mentioned earlier but I am rather interested in why this happens. Does the \clearpage command fulfil an important function for references to work? And can the error be avoided without removing \let\clearpage\relax while using \include?  EDIT: I just found  with the same issue (though it does not have a definite answer).


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));    }  }

What I would like is a method to convert a double to a string which rounds using the half-up method - i.e. if the decimal to be rounded is 5, it always rounds up to the next number. This is the standard method of rounding most people expect in most situations.  I also would like only significant digits to be displayed - i.e. there should not be any trailing zeroes.  I know one method of doing this is to use the String.format method:  String.format("%.5g%n", 0.912385);   returns:  0.91239   which is great, however it always displays numbers with 5 decimal places even if they are not significant:   String.format("%.5g%n", 0.912300);   returns:  0.91230   Another method is to use the DecimalFormatter:  DecimalFormat df = new DecimalFormat("#.#####"); df.format(0.912385);   returns:  0.91238   However as you can see this uses half-even rounding. That is it will round down if the previous digit is even. What I'd like is this:  0.912385 -> 0.91239 0.912300 -> 0.9123   What is the best way to achieve this in Java?


I'm trying to change the cleanup interval for Apache PrivateTmp files from the default 30 days to 6 hours. I read that to edit the time intervals, I should set up an override file in /etc/tmpfiles.d/tmp.conf rather than editing /usr/lib/tmpfiles.d/tmp.conf, so I created that file with the following lines:  # override the default cleanup intervals v /tmp 1777 root root 6h v /var/tmp 1777 root root 6h   Now if I run systemd-tmpfiles --clean, the expected files are removed, so this part is working.  However, /usr/lib/systemd/system/systemd-tmpfiles-clean.timer has OnUnitActiveSec set to 1d. I assume this means my 6 hour cleanup interval will effectively be limited to once per day.  I can change that timer interval to 6h or less, but should I edit this file directly, or create an override file similar to /etc/tmpfiles.d?  Update: this question was marked as a duplicate, but I don't see anything in the linked question about whether I should be using an override file like with the tmp.conf file.  Solution: apparently I can't post this as an answer since the question has been marked as a duplicate. But this is how I created an override file to change the timer interval:  Copy the existing timer file to the corresponding override directory:  sudo cp /usr/lib/systemd/system/systemd-tmpfiles-clean.timer /etc/systemd/system  Edit the new copy (change the 1d value to 1h):  sudo nano /etc/systemd/system/systemd-tmpfiles-clean.timer  Load the new timer file:  sudo systemctl daemon-reload  Confirm that the new timer interval is loaded:  sudo systemctl list-timers

I'm trying to make a systemd timer that runs every 15 minutes. Right now I have:     timer-fifteen.timer:  [Unit] Description=15min timer  [Timer] OnBootSec=0min OnCalendar=*:*:0,15,30,45 Unit=timer-fifteen.target  [Install] WantedBy=basic.target    timer-fifteen.target:  [Unit] Description=15min Timer Target StopWhenUnneeded=yes    This runs over and over again without stopping. Does it need to be *:0,15,30,45:* instead? How can I make this work?


In the following sentence, "other half" and "were" do not seem to match up:     In one study conducted by the University of Michigan, half of the participants were asked to solve a puzzle while mentally referring to themselves as "I," while the other half were asked to use "you".   Shouldn't it be the other half "was" asked to use "you"?

What’s the right version of these two?   Half of the students doesn’t bother to show up.  Half of the students don’t bother to show up.    Or are both right?  The related question  discusses some relevant concepts, but the answer is very general, and it's not clear how to apply it here since "half" is a singular noun, while "two" is a plural noun.   Barrie England's answer there says that in "2/3 of the pizza was eaten," singular agreement is appropriate because "the emphasis is likely to be on the amount of pizza eaten, and not on the number of individual thirds. In contrast, in [2/3 of the visitors were men] the emphasis is on the number of visitors who were men, so plural concord ... is required."  What does it mean to put "emphasis" on "the amount" vs. "the number"?  If "half of the students" is just an approximate or uncertain percentage (like "between 51% and 55%"), rather than an exact count, how do I know whether it's appropriate to emphasize the amount or the number of students?


I want to give input as   %>Python_script_name listed_files   How to check if  exist as file or it is  some input argument.  <listed file can also be in path /govr/rest/listed_files >   Please share the small script, by which I can check if command line argument is valid file or it is a simple variable to be processed.  Just to summarize, I need to process my script so as to take  or a single argument at command line.  Please help.  Thanks in advance.

How do I check whether a file exists or not, without using the  statement?


A more apt title to this is question may be "Jumping through hoops". My question is similar to .  I have the following requirements for the table of contents in my thesis:   The title "Table of Contents" must be centered Every chapter, section, subsection, and appendix must have dots between the chapter/section/etc name and the page number The chapters must start out "Chapter #" for each entry in the ToC.   Following the second answer in the link above, I can get all three of these requirements using Tocloft, however it also puts "Chapter Appendix" which is not correct (see MWE below). Following the first answer, I no longer have this problem, but I can't get #2: there are no dots between the chapter name and the page number. Looking at the documentation for titletoc, it doesn't seem possible to include them (but maybe I'm missing something).  I would like to satisfy all three requirements but not have "Chapter Appendix". I am willing to use any package(s) to meet these.  MWE:  \documentclass{report} \usepackage{titlesec,tocloft,calc}  \renewcommand{\cftchappresnum}{Chapter } \AtBeginDocument{\addtolength\cftchapnumwidth{\widthof{\bfseries Chapter }}} \renewcommand\cftchapdotsep{\cftdotsep} \renewcommand{\contentsname}{\vspace*{-1.75in}\hfill\bfseries\Large Table of Contents\hfill}    \renewcommand{\cftaftertoctitle}{\hfill}  \begin{document} \tableofcontents  \chapter{Asdf} \section{Foo} \chapter{Jkl;} \section{Bar}  \addtocontents{toc}{\protect\setcounter{tocdepth}{0}} \titleformat{\chapter}[display]{\centering\Huge\bfseries}{\thechapter}{0pt}{} \appendix \renewcommand{\thechapter}{} \begin{chapter}{APPENDIX} \renewcommand{\thechapter}{A} \end{chapter} \addtocontents{toc}{\protect\setcounter{tocdepth}{2}} \end{document}

I have searched for something to resolve a problem that has shown up here:   I have tried the code from that thread. But I got an issue, that is, it adds the \chaptername even for appendix chapters:     Chapter 1. aaaaa   ....   Chapter Appendix A   How can I resolve it?


I was updating from Ubuntu 18.04 to 20.04, when the update GUI showed a certain package from python3 could not be installed and the update failed. The message then showed restart required. After restarting it is just showing blank screen and blinking underscore. I went into ubuntu recovery mode and run fsck and dpkg and then resumed, but the problem is still not solved

I upgraded my Ubuntu OS from 12.10 to 13.04 and after the process of upgrading it via Software Updater, it requested me to restart the computer. I rebooted and on boot I proceeded to a purple screen with Ubuntu text and 5 dots below it and continued to a blank black screen with a blinking underscore character (_).  I have all my files in there and I can't access them. I tried the grub boot menu edit that other questions pointed out, but it didn't seem to do anything.


[{LanguageMedium: "Sinhala Medium"}, {Subject: "English"}, {Type: "Past"}]   From this array object how to remove the object where object key is "LanguageMedium"

Say I create an object as follows: let myObject = {   "ircEvent": "PRIVMSG",   "method": "newURI",   "regex": "^http://.*" };  How should I remove the property regex to end up with new myObject as follows? let myObject = {   "ircEvent": "PRIVMSG",   "method": "newURI" };


I was wondering, I haven't been able to find the symbol for doing a "hollow" square bracket, its basically how you would expect a square bracket to look if you used \mathbb on it. Does anybody know how to do this?

I know what my symbol or character looks like, but I don't know what the command is or which math alphabet it came from. How do I go about finding this out?


The following example compiles with an error:  \documentclass{article}  \usepackage[english]{babel}\usepackage{csquotes}  \usepackage{listings}%\usepackage{listingsutf8}  \usepackage[style=ieee]{biblatex}  \usepackage{filecontents} \begin{filecontents}{bib.bib}     @Article{A1, title = {A b}}     @Article{A2, title = {A~b}} \end{filecontents}  \addbibresource{bib.bib}  \begin{document}      A: \cite{A1}.\\     B: \cite{A2}.\\      \printbibliography  \end{document}      l.23 Undefined control sequence.   Something probably causes the ~ character in bibliography entry to be confusing for LaTeX, as document with \cite{A2} commented out compiles with no errors.    Either changing \usepackage[english]{babel} to \usepackage{babel} or changing \usepackage[style=ieee]{biblatex} to \usepackage{biblatex}, or removing \usepackage{listings} (which is necessary, but its application was removed from the MWE), also causes the document to compile without errors, so there are four factors involved: all three of these packages together with the usage of tilde character in bibliography.  I cannot figure out the reason because this incompatibility, but resolving it would be quite useful for me.

Consider the following MWE:  \documentclass{scrreprt}  \usepackage{textcase}  \RequirePackage{listings} \usepackage[american]{babel}  \begin{document}     \MakeTextLowercase{A~B} \end{document}   LaTeX fails with the error  ! Undefined control sequence. <to be read again> az                      b l.9     \MakeTextLowercase{A~B}  ?    The error seems to lie in the combination of MakeTextLowercase, the listings package and the tilde. Whenever I remove any of these three components, everything works fine. Does anyone have a clue where the problem is?


Looking at a  chart confirms that the prefix "in-" is supposed to mean 'not' or 'without', just wondering why the exception only occurs for certain words. I don't know if it's an origin thing, as infamous originated in Latin, but so did insufficient, and I can't find a concrete orgin of invaluable.

Why are not infamous and inflammable the opposite of famous and flammable, like incomplete, inactivity, inappropriate and so on?


How can get the enum values from an int input? Let's say I have this enum below.  [Flags] public enum Weeks {     Sunday = 1,     Monday = 2,     Tuesday = 4,     Wednesday = 8,     Thursday = 16,     Friday = 32,     Saturday = 64 }  public List<Weeks> GetEnumValues(int input) {     // Don't know what is the logic here     // Help is much appreciated }   Then the output is as follows  Examples: 1.) input = 3; This means Sunday and Monday hence 1 + 2 = 3; This should return List<Weeks> { Sunday, Monday } 2.) input = 20; This means Tuesday and Thursday hence 4 + 16 = 20; This should return List<Weeks> { Tuesday, Thursday } 3.) input = 40; This means Wednesday and Friday hence 8 + 32 = 40; This should return List<Weeks> { Wednesday, Friday }   Thank you in advance.

How can an int be cast to an enum in C#?


I have a button that will close my app.  I am using exit(0); but I dont like the way it closes my app, its like when an app crashes and the app closes kinda close. I am looking for away to terminate when the user pushes this button. Any suggestions?  Thanks  I have tried the following:  [[NSThread mainThread] exit];   but got this error:  No visible @interface for 'NSThread' declares the selector 'exit'

I am programming an iPhone app, and I need to force it to exit due to certain user actions.  After cleaning up memory the app allocated, what's the appropriate method to call to terminate the application?


I was working normally on my desktop computer with Windows 8.1, then my power supply stopped working, the PC shut down and it won't turn on again until I replace the power supply (which I can because it's December 31)  I used my converter to connect my FILES (D:) Hard disk via USB to my Ubuntu laptop (It has nothing to do with windows, windows is in another physical hard disk) and I get this error:    I've read this , but it requires you to start Windows (I can't do it) I need some solution I directly on Linux.  Thank you beforehand!

Whenever I boot Ubuntu, I get a message that it cannot mount my windows partition, and I can choose to either wait, skip or manually mount.  When I try to enter my Windows partition through Nautilus I get a message saying that this partition is hibernated and that I need to enter the file system and properly close it, something I have done with no problem so I don't know why this happens.    Here's my partition table, if any more data is needed please let me know.     Device Boot      Start         End      Blocks   Id  System /dev/sda1            2048    20000767     9999360   83  Linux /dev/sda2        20002814   478001151   228999169    5  Extended /dev/sda3   *   478001152   622532607    72265728    7  HPFS/NTFS/exFAT /dev/sda4       622532608   625141759     1304576   82  Linux swap / Solaris /dev/sda5        20002816   478001151   228999168   83  Linux


This is from Stewart and Tall from the chapter on Kummer's Theorem. Show that there are no non trivial  (non-zero) solutions to $x^3 + y^3=3z^3$

I haven't found any useful method to solve the following problem: Prove that if $x,y,z\in\mathbb{Z}$ and $x^3+y^3=3z^3$ then $xyz=0$.  Source:


I am looking for a subset of $\mathbb{R}²$ such that $A\neq A'\neq A''\neq A'''$ (where $A'$ is the set of limit points of $A$).  I read it's possible but I don't even see how it could be ... I've tried a subset that has an isolated point (or several) and is open otherwise.  The furthest I could go was picking $\lbrace(\frac{1}{n},0):n\in\mathbb{Z}\rbrace \cup B((2,0),1)$ because then $A'$ has an isolated point.  I'm sure I'm missing a point here, could you help me?  Thank you very much

Let $A'$ denote the set of accumulation points of $A$. Find a subset $A$ of $\Bbb R^2$ such that $A, A', A'', A'''$ are all distinct.  I can find a set $A$ such that $A$ and $A'$ are distinct, but not one where $A,A',A'',A'''$ are all distinct.


I gather that the phrase "your mileage may vary" basically means your experience may vary. But, in general use, the term "mileage" has two different senses, and both seem to be capable of being the one the phrase means :  Mileage as a measure of fuel efficiency -- i.e.  how much fuel a vehicle uses for specific number of miles it travels. Mileage as a measure of total miles a vehicle has traveled over its lifetime.  Both can possibly be the intended meaning of the term "mileage" in the phrase "your mileage may vary". So which one is it ?

In the United States we have a saying, "your mileage may vary", which means "your experience may be different".  In English-speaking countries that don't use Imperial miles, is there an equivalent expression?


Does the $0.\overline{9} = 1$ proof show that the gap between numbers adjacent numbers is $0$, and so are infinitesimal values equal to $0$ ? Would $10^{-\infty}=0$ ?  Edit: I feel like the smallest non-zero number would be $0.0...1$, which when subtracted from $1$ would 'appear' to be $0.999...$ , but it can't since $1 = 0.999...$

I'm told by smart people that $$0.999999999\ldots=1$$ and I believe them, but is there a proof that explains why this is?


Suppose the primes p and q used in the RSA algorithm are consecutive primes (meaning they differ by 2). How would you factor n = pq? The ciphertext 10787770728 was encrypted using n = 10993522499 and e = 113. The factors p and q of n were chosen so that p - q = 2. Use your method in part (a) to decrypt the message

So in RSA, there is a modulus n which is the product of two primes. My question is regarding when p and q are consecutive primes, what would the time complexity be? So, n=pq and p and q are consecutive primes is the only information to work off of. Also would Fermat's factorization be an efficient way to factor such an n?  edit: I'n not actually trying to factor n or find p and q. I just want to know if Fermat's factorization method would be efficient given this information.


Self Describing Example: sesquipedalian is a sesquipedalian word Opposite Example: quotidian is not a quotidian word (obviously just my opinion)

For example, "word" is a word, "adjectival" is adjectival, etc. Is there a term for this? Something like a set that includes itself, but not quite. I want to call it "autoinclusive"; would that work linguistically?


I'm just trying to understand how Inheritance works in C#. (even though I think I got it, I want to try to do something practical in order to understand)  So I've been trying to create a class with a property and a constructor and another one which inherits this one. But I get an error and I don't really seem to get why.  using System; using System.Collections.Generic; using System.Text;  namespace ConsoleApp2 {     public class Test     {         public int testing { get; }         public Test(int p)         {             this.testing = p;         }     }     public class Test2 : Test {      } }   There is no argument given that corresponds to the required formal parameter 'p' of 'Test.Test(int)' for line 15   Can someone help me understand what's happening and why do I get that error? Thanks.

If I inherit from a base class and want to pass something from the constructor of the inherited class to the constructor of the base class, how do I do that?  For example, if I inherit from the Exception class I want to do something like this:  class MyExceptionClass : Exception {      public MyExceptionClass(string message, string extraInfo)      {          //This is where it's all falling apart          base(message);      } }   Basically what I want is to be able to pass the string message to the base Exception class.


I will have booked s flight from Los Angeles to Düsseldorf via Newark. What happens with the baggage? Do I have to pick it up in Newark? And do I have to leave the security area in Newark?

Travveling with SAS 907 from Oslo, Norway to Newark Terminal B. Transfer to Terminal C and further with United 239 to Nashville. Do I have to pick up the luggage at terminal B and bring it to terminal C?


Help figure out why my method Deserialize from the class XML return null, why? Document format attached........................................................ ................................................................................ ................................................................................                                                          public class XMl {     //список данных из xml      public XMl() { }      public dataroot Deserialize(String pathToFile)     {         //dataroot dataRoot = null;          //var serializer = new XmlSerializer(typeof(dataroot));          //var reader = new StreamReader(pathToFile);         //dataRoot = (dataroot)serializer.Deserialize(reader);         //reader.Close();          //return dataRoot;          XmlSerializer ser = new XmlSerializer(typeof(dataroot));         dataroot dataRoot = null;         using (XmlReader reader = XmlReader.Create(pathToFile))         {             dataRoot = (dataroot)ser.Deserialize(reader);         }          return dataRoot;     } }   [Serializable()] public class XML_Vozdykhoobmen {     [XmlElement("ID_Zdan")]     public String ID_Zdan { get; set; }      [XmlElement("ID_Pom")]     public String ID_Pom { get; set; }      [XmlElement("NaimZdaniya")]     public String NaimZdaniya { get; set; }      [XmlElement("NaimPomeshcheniya")]     public String NaimPomeshcheniya { get; set; }      [XmlElement("KlimatPoyas")]     public String KlimatPoyas { get; set; }      [XmlElement("Temperatyra")]     public String Temperatyra { get; set; }      [XmlElement("PritokKratnost")]     public String PritokKratnost { get; set; }      [XmlElement("PritokEdinitsaIzm")]     public String PritokEdinitsaIzm { get; set; }      [XmlElement("VytyazhkaKratnost")]     public String VytyazhkaKratnost { get; set; }      [XmlElement("VytyazhkaEdinitsaIzm")]     public String VytyazhkaEdinitsaIzm { get; set; }      [XmlElement("EdinitsaIzm")]     public String EdinitsaIzm { get; set; }      [XmlElement("PoRaschety")]     public String PoRaschety { get; set; }      [XmlElement("Kolichestvo")]     public String Kolichestvo { get; set; }      [XmlElement("Prim")]     public String Prim { get; set; } }  [Serializable()] [XmlRoot("dataroot")] public class dataroot {     //[XmlArray("Vozdykhoobmens")]     [XmlArrayItem("XML_Vozdykhoobmen", typeof(XML_Vozdykhoobmen))]     public XML_Vozdykhoobmen[] Vozdykhoobmen { get; set; } }

How do I Deserialize this XML document:  <?xml version="1.0" encoding="utf-8"?> <Cars>   <Car>     <StockNumber>1020</StockNumber>     <Make>Nissan</Make>     <Model>Sentra</Model>   </Car>   <Car>     <StockNumber>1010</StockNumber>     <Make>Toyota</Make>     <Model>Corolla</Model>   </Car>   <Car>     <StockNumber>1111</StockNumber>     <Make>Honda</Make>     <Model>Accord</Model>   </Car> </Cars>   I have this:  [Serializable()] public class Car {     [System.Xml.Serialization.XmlElementAttribute("StockNumber")]     public string StockNumber{ get; set; }      [System.Xml.Serialization.XmlElementAttribute("Make")]     public string Make{ get; set; }      [System.Xml.Serialization.XmlElementAttribute("Model")]     public string Model{ get; set; } }   .  [System.Xml.Serialization.XmlRootAttribute("Cars", Namespace = "", IsNullable = false)] public class Cars {     [XmlArrayItem(typeof(Car))]     public Car[] Car { get; set; }  }   .  public class CarSerializer {     public Cars Deserialize()     {         Cars[] cars = null;         string path = HttpContext.Current.ApplicationInstance.Server.MapPath("~/App_Data/") + "cars.xml";          XmlSerializer serializer = new XmlSerializer(typeof(Cars[]));          StreamReader reader = new StreamReader(path);         reader.ReadToEnd();         cars = (Cars[])serializer.Deserialize(reader);         reader.Close();          return cars;     } }   that don't seem to work :-(


I'm a German citizen and currently waiting for my H1B application to come through. Now my employer, a US company, has asked me to come to the US for 2-3 weeks in August already, in order to get to know the team and hear more about the system I will be working on.   Their lawyers say I can do so under the Visa Waiver Program/B1 visa, but all information I can find say that I should not be employed by a US company/receive salary directly from them if I want to enter on the VWP/B1.  Other online sources however say that it's totally fine to go to the US on VWP/B1 for just a couple of meetings, so the more I read, the more I get confused. Can someone help me shed some light on this?

I am having trouble finding out which visa I need for visiting the US headquarter of my new company.  Background: I'm starting as a software engineer in my European company. The employment is through a local  since the US company has no presence there yet. To get acquainted with the business, it'd make sense to go to the US and talk to the new colleagues as early as possible. On the other hand, I also don't want to be denied entry for obvious reasons.   is the best discussion of this topic that I could find so far.  However, it is from 2012 and @Doc was working for the local subsidiaries of much larger organizations.  Would this still apply to my situation (PEO not subsidiary, new at the company, 2017)?  The documents I could find mostly mention that business meetings fall under the scope of ESTA. Training is also mentioned in many places but it is never clear what is allowed and what is not.  mentions that "Alien trainees who seek merely to observe the conduct of business or other professional or vocational activity may qualify for B-1 or B-2 classification if the US business does not pay or reimburse expenses. The foreign employer must continue to be the principal employer and pay wages, salary, and/or other compensation from a source abroad." The document goes on to say "Hands-on training, deigned to provide on-the-job experience, is not deemed to fall within the B-1 (or B-2) classification. Even if the foreign employers pays salary and expenses, B-1 classification is inappropriate if the hands-on services performed by the trainee will benefit the US-based company and/or the US-based company would have had to hire an employee but for the services of the alien 'trainee.'" (emphasis mine)  The  does not mention training and mainly refers to the  While I cannot find details at the BVC website either, this looks like the best authority to ask for clarification.  The  says that I may "attend short-term training (you may not be paid by any source in the United States with the exception of expenses incidental to your stay)" and "consult with business associates".  Questions:   VWP is essentially the B1/B2 program for people from pre-approved countries, right? That means that there is no use in applying for B1 because I wouldn't be allowed to do more than on ESTA either, correct? Does it make a substantial difference whether I come for 2 or 6 weeks? I'd argue that a shorter period may look more like discussions and meetings while a longer period would look more like employment. Where does a PEO come in with regards to "not being paid by any source in the United States"? I feel like I could argue either way. Is there any way to get our plans pre-approved without a denial being treated as a "visa rejection" or even a "refusal to enter"?   Thank you for your help.


In my MacBook Air "El Capitan", the Windows 10 was installed using Boot Camp, but the Windows 10 installation was corrupted (crashing).  Then I removed (adding space to MAC installation) the Windows 10 partition using Disk Utility.  Now when I turn On my MAC still message windows is appearing (showing MAC and Windows start options), and the default OS was Windows (appearing blue screen...).  I want to remove Windows 10 option, but I don't know how to do it.       sh-3.2# diskutil list  /dev/disk0 (internal, physical):     #:                       TYPE NAME                    SIZE       IDENTIFIER     0:      GUID_partition_scheme                        *121.3 GB   disk0     1:                        EFI EFI                     209.7 MB   disk0s1     2:          Apple_CoreStorage Macintosh HD            120.5 GB   disk0s2     3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3  /dev/disk1 (internal, virtual):     #:                       TYPE NAME                    SIZE       IDENTIFIER     0:                  Apple_HFS Macintosh HD           +120.1 GB   disk1                                   Logical Volume on disk0s2                                   22ACF9AD-58C6-401F-87D6-41696160E1FD                                   Unencrypted  sh-3.2#  gpt -r show /dev/disk0        start       size  index  contents            0          1         PMBR            1          1         Pri GPT header            2         32         Pri GPT table           34          6                    40     409600      1  GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B       409640  235298960      2  GPT part - 53746F72-6167-11AA-AA11-00306543ECAC    235708600    1269536      3  GPT part - 426F6F74-0000-11AA-AA11-00306543ECAC    236978136          7             236978143         32         Sec GPT table    236978175          1         Sec GPT header  sh-3.2#

Today I was trying to set up Windows on my MacBook Pro (15", Late 2011) over BootCamp.   I used the modified Info.plist-trick to create a bootable Windows 8 USB-drive and create a Bootcamp partition. After this was done, I tried to install Windows, but I ran into the problem of Windows not accepting the pre-made partition, so I deleted it and rebooted once again into the Windows installer to install it.   Everything went fine, but in the last bit of the installation process, it aborted - telling me that it couldn't change my boot configuration.  After this, it froze, so I held the power button down until it restarted. I couldn't boot from the newly created (hard drive) "EFI boot" section, so I booted the Recovery and tried to delete the two new partitions (the windows and the "Microsoft reserved" one). But it wouldn't let me delete the ~130MB partition named disk0s4. Even from Internet recovery, I couldn't get rid of it.   Next thing I did was try to run the Windows installer again, but from this point on, the installer would crash in a BSOD, almost instantly restarting my PC shortly after. I thought it had to be the disk0s4-partition that is causing all of this, so I made another effort deleting it - and I made it using the disk utility on my OS X. Having only one partition left, I tried rebooting, only to see that the "EFI boot" was still there. (note: this is not by USB-Drive, it has a hard-drive icon whereas the USB drive has a USB one)  I don't really know what to do from here to fix all this. I have no idea where this "EFI boot" is coming from (there is only one partition and a lot of unallocated space on my HD) and why my Windows installer is crashing.  I hope somebody can help me despite my long (but detailed) question.  Edit: fdisk output:  Disk: /dev/disk0    geometry: 60801/255/63 [976773168 sectors] Signature: 0xAA55          Starting       Ending  #: id  cyl  hd sec -  cyl  hd sec [     start -       size] ------------------------------------------------------------------------  1: EE 1023 254  63 - 1023 254  63 [         1 -  976773167] <Unknown ID>  2: 00    0   0   0 -    0   0   0 [         0 -          0] unused        3: 00    0   0   0 -    0   0   0 [         0 -          0] unused        4: 00    0   0   0 -    0   0   0 [         0 -          0] unused         gpt output:        start       size  index  contents           0          1         PMBR           1          1         Pri GPT header           2         32         Pri GPT table          34          6                   40     409600      1  GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B      409640  486812704      2  GPT part - 48465300-0000-11AA-AA11-00306543ECAC   487222344    1269536      3  GPT part - 426F6F74-0000-11AA-AA11-00306543ECAC   488491880  488281255            976773135         32         Sec GPT table   976773167          1         Sec GPT header   diskutil output:  /dev/disk0    #:                       TYPE NAME                    SIZE       IDENTIFIER    0:      GUID_partition_scheme                        *500.1 GB   disk0    1:                        EFI EFI                     209.7 MB   disk0s1    2:                  Apple_HFS Macintosh HD            249.2 GB   disk0s2    3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3   Seems like there is a hidden partition...


This code  \tikz \graph [layered layout] { "I want newline after comma:" -> "Hello,\\ World."; };   just gets rid of the whitespace between the "," and the "W" of "World" below:    Why doesn't it make a newline?

The MWE:  \documentclass{standalone}  %====================================== \usepackage{tikz} \usetikzlibrary{graphdrawing} \usetikzlibrary{arrows} \usetikzlibrary{graphs} \usegdlibrary{force, layered, trees} %======================================  \begin{document}  \tikz  \graph [spring layout, nodes = draw] {     a/"dispersive\newline collision";     b/"non-dispersive\newline  collision";      a -> b };  \end{document}   The output:    The question:  As you can see above, the \newline command does nothing. Trying to use \\ instead of \newline, like how the pgfmanual does in some examples (see pg. 386) has the same effect. Why? What can I do in order to have the words appear on separate "lines"?


I know in ruby language there is a method called   can print all member's in object without override toString(Java) <<(in cpp),it's very usefull for debug print. I want to know How to implment these function in c++ or is there has any library to do this? I'm newer to learn c++, hate to write too much templates for many diffent complex classes! Thanks for any advise!

I'd like to be able to introspect a C++ class for its name, contents (i.e. members and their types) etc. I'm talking native C++ here, not managed C++, which has reflection. I realise C++ supplies some limited information using RTTI. Which additional libraries (or other techniques) could supply this information?


With the use of a time turner, that opens a whole "Pandora's Box" of possibilities.  While the use of one can be problematical, when the Ministry of Magic found out how dangerous Voldemort was, why didn't they simply use a time turner to go back and stop him before he became dangerous?  (I know this does open a lot of plot holes, but witches and wizards don't seem to worry about laws of science, so it would seem strange that magic that seems to easily supersede laws of physics (like brooms that fly without propulsion) would worry about the problematical issues of time travel.)

It seems like it would be a very helpful device.  Why was it never used again, regardless of the purpose?


We're inheriting a Windows Server 2008 R2 server on a network full of Windows 7 machines.  There are already Group Polices in place, and they work.    How can we back them up and restore them in case we make changes and something goes wrong?  Can they be stored in git or some version control system that can store different versions and so we can record what we changed?

This is a  about Active Directory Group Policy Basics   What is Group Policy?  How does it work and why should I use it?  Note: This is a Question & Answer to new administrator that might not be familiar with how it functions and how powerful it is.


After updating to iOS 7 on my iPhone 5, I lost all the events on my calendar in the months previous to the update.  How can I recover those?

Calendar on iPhone 4s does not work with iOS 7. It stopped working 2 days ago. It won't open on the phone. iCloud is working fine and so is iCal on my MacPro.  How do I get it to work again?


This is a post by NiceTryDad on instagram.     Son: "What does the word "gay" mean?"   Me: "It means happy."   Son: "Oh, are you gay?"   Me: "No, son, I have a wife."   Later then, I googled up the meaning of the word "gay". And I found that it has some meanings in its older use, like having or showing a merry, lively mood, and also bright or showy. And also,  explains:     Gay meaning ‘homosexual’ became established in the 1960s as the term preferred by homosexual men to describe themselves. It is now the standard accepted term throughout the English-speaking world. As a result, the centuries-old other senses of gay meaning either ‘carefree’ or ‘bright and showy’ have more or less dropped out of natural use. The word gay cannot be readily used today in these older senses without arousing a sense of double entendre, despite concerted attempts by some to keep them alive. Gay in its modern sense typically refers to men (lesbian being the standard term for homosexual women) but in some contexts it can be used of both men and women   I know that that post was just a joke, but I'm wondering if I can use the word gay to indicate that someone's happy in business or academical writings. Since people would always refer it to its modern sense (homosexuality).

When did the main meaning of the word 'gay' shift from happy to homosexual? How did the meaning evolve, if there is a relation between the two?


I want to colour the markers of a scatter3 plot in specified colours with rgb values. I tried it before in the following way:  \documentclass[]{article} \usepackage{pgfplots}  \begin{document} \begin{figure}[H] \centering \begin{tikzpicture} \centering     \begin{axis}[ view={100}{35}, width=255pt, height=255pt, z buffer=sort, xlabel={$R$}, ylabel={$G$}, zlabel={$B$}, point meta=explicit,colormap/bluered, scatter/use mapped color={ball color=mapped color}, ] \addplot3[only marks,scatter,mark size=2.5, scatter/classes= {0={mark=ball, }}] table[x=R,y=G,z=B,meta=C] {Scatterplot.txt}; \end{axis} \end{tikzpicture} \caption{Caption} \label{label}  \end{figure}  \end{document}   In this try the data in Scatterplot.txt was divide in the following way:  R G B C 0.68235 0.67843 0.44314 1 0.68235 0.67451 0.45098 1 0.68235 0.67059 0.4549 2 0.67843 0.66667 0.4549 5 0.68235 0.67451 0.45882 4 0.68235 0.68235 0.46275 3 0.6902 0.69412 0.47451 2   It plotted the scatter plot like I wanted. The dots were in the colour cube and had 5 different colours. Those colours were just the ones defined by a predefined colourmap.  The problem is now, that i want to have the marker in a colour specified by three columns in Scatterplot.txt.  The file Scatterplot.txt now looks like:  R G B RED GREEN BLUE 0.68235 0.67843 0.44314 0.7653 0.74446 0.33547 0.68235 0.67451 0.45098 0.7653 0.74446 0.33547 0.68235 0.67059 0.4549 0.7653 0.74446 0.33547 0.67843 0.66667 0.4549 0.7653 0.74446 0.33547 0.68235 0.67451 0.45882 0.7653 0.74446 0.33547 0.68235 0.68235 0.46275 0.7653 0.74446 0.33547 0.6902 0.69412 0.47451 0.7653 0.74446 0.33547   So instead of 4 columns with 3 coordinates and a single "colourvalue" I want to have the markers still at the coordinates of the first 3 columns, but coloured in the rgb value defined in the last 3 columns.  This is the first question I asked here and i hope that it is in the format how you normally do this here. If not please let me know so I can do it better next time.  Note, that i found the question    which is similar to mine, but I was not able to make it work with a   addplot3   command.

I am trying to plot a set of data points (scatter points not linked to each other), where each point has a different color. The color definition is given by predefined rgb values written in the same file that contains the data.  The following file serves as example:  \usepackage{filecontents} \begin{filecontents}{test.dat}     x   y   RED   GREEN   BLUE     1   11  0.2    0.3    0.5     2   14  0.3    0.3    0.4     4   26  0.1    0.8    0.1     3   39  0.0    0.1    0.9 \end{filecontents}   The x and y columns represent the position of the points I want to plot. The next three columns RED, GREEN and BLUE correspond to the associated color values in rgb format.  What I was trying so far, was to do:  \begin{document}  \pgfplotstableread{test.dat}\test %number of points to be plotted \pgfplotstablegetrowsof{\test} \pgfmathsetmacro{\N}{\pgfplotsretval-1}    \begin{tikzpicture} \begin{axis}[%     xmin=0, xmax=5,     ymin=0, ymax=45,     width=8cm,     height=6cm,     grid=both,     xlabel=Xtest,      ylabel=Ytest,        ]     \foreach \i in {0,...,\N}     {     \definecolor{testcolor}{rgb}{\thisrow{3}, \thisrow{4}, \thisrow{5}}        \addplot[scatter,          only marks,              scatter/use mapped color={draw=none,fill=testcolor},     ]      table [x index = 0,y index = 1]{\test};     } \end{axis} \end{tikzpicture}  \end{document}   But I am unable to fetch a single row value for the color definition. How can I do this ? I also looked at meta options, but the color is defined with a single value (linearly) and I need the three components in the color definition.


I'm trying to insert the "Registration Form" in a page using this shortcode [wp-form-registration]but it doesn't work.  I just need to show the Registration form in a page in the frontend.  This is the code to create the shortcode:  function print_form_registration($atts, $content = null) {       return wp_register();  }  add_shortcode('wp-form-registration', 'print_form_registration');

I am having a form page called Test Form with this form :  <div id="container"> <form action="wp-content/themes/max-magazine/TestForm.php" method="post" name="myForm"> User <input type="text"  name="uname" /> Email  <input id="email" type="text" name="uemail" /> Password  <input type="password"  name="upass" /> <input type="submit" value="Submit" /></form> </div>   And in backend am having a php file named TestForm.php  <?php  function create_account(){ $user = 'AccountID'; $pass = 'AccountPassword'; $email = 'email@domain.com'; if ( !username_exists( $user )  && !email_exists( $email ) ) {     $user_id = wp_create_user( $user, $pass, $email );     $user = new WP_User( $user_id );     $user->set_role( 'contributor' ); }  } add_action('init','create_account'); ?>   Now if this function is defined in function.php then it works fine and create the user but same function in TestForm.php does not work. Please help  Also I will be fetching data from form like this :  <?php $user = $_POST['uname']; $pass = $_POST['upass']; $email = $_POST['uemail']; ?>


What is the best method for determining when a roast chicken is done cooking? Many of the methods I have seen online provide approximate time ranges for cooking dependent on the weight of the chicken. I don’t usually have a scale handy when I cook, especially if I’m only cooking part of the chicken. Are there any precise approaches I can use that are easily accessible?

How can you tell when a roast is done?  How long should they roast for?


TL;DR for admins: Not a duplicate. I'm trying to force redirect the user from the Flask backend after completing survey using Flask, but it doesn't work (though from my understanding it should - it even behaves on console level as though as it did, but the browser doesn't reload). I do not want yet to do it on the ajax, I try to keep it as minimal as possible for now, the survey makes correctly a vanilla ajax POST to "/survey" and I want to keep it that way for now. Also, I want to understand the Flask problem instead of replacing it with another solution that I don't fully comprehend yet  I'm trying to learn some basics of Web development, wanting to make a somewhat interesting web app service using Flask as my backend.  My survey subsite of the project looks a little like this:  @app.route("/survey", methods=["GET", "POST"]) @login_required def survey():     if request.method == "GET":         return render_template("survey.html")      if request.method == "POST":         x = request.get_json(silent=True)         print(x)          //todo: manipulate on x and classify a user into a group            return redirect(url_for("index")) // just for now redirect everybody   I'm a complete AJAX/JS newbie, but I know that my SurveyJS survey website ("/survey") after a bit of tinkering is sending the correct JSON to the backend (by printing the vast x variable after completion of the survey).  Sadly, the redirects don't work, even though the server actually tries to do it - I have the standard 200 OK code in the console that I always got for the redirects on other subsides, but the website is not changed (no loading circle or anything). After the completion, I make a POST ajax request and the survey site gives the standard SurveyJS blank website with "Thank you for completing the survey!" (it doesn't load the website or anything)  Console Flask prompts:  INFO:werkzeug:127.0.0.1 - - [03/Jul/2017 20:06:44] "POST /survey HTTP/1.1" 302 - INFO:werkzeug:127.0.0.1 - - [03/Jul/2017 20:06:45] "GET / HTTP/1.1" 200 -   What can I do to make the redirect work from the Flask level?

I'm using $.post() to call a servlet using Ajax and then using the resulting HTML fragment to replace a div element in the user's current page. However, if the session times out, the server sends a redirect directive to send the user to the login page. In this case, jQuery is replacing the div element with the contents of the login page, forcing the user's eyes to witness a rare scene indeed.   How can I manage a redirect directive from an Ajax call with jQuery 1.2.6?


Lately I've been watching a course in differential topology and the instructor gave the set $\{(x, y)| x^3 = y^2\}$ as a subset of $\mathbb{R}^2$ which is not a smooth manifold with no explanation, and I'm wondering how to explicitly show that this set is not a one-dimensional smooth manifold?

Cuspidal cubic $y^2=x^3$ in $\Bbb R^2$ "seems to be not smooth" intuitively because its pictured graph has a cusp at the origin. But I read from book that it is a smooth manifold. I feel so confused. How do we understand "smooth"?  Furthermore, it is not a regular submanifold of $\Bbb R^2$. I don't know how to prove this.  Any help will be appreciated.


I needed to create a list of lists in Python, so I typed the following: my_list = [[1] * 4] * 3  The list looked like this: [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]]    Then I changed one of the innermost values: my_list[0][0] = 5  Now my list looks like this: [[5, 1, 1, 1], [5, 1, 1, 1], [5, 1, 1, 1]]    which is not what I wanted or expected. Can someone please explain what's going on, and how to get around it?


I'm aware of several situations where it's unnecessary to use double quotes when expanding a variable in Bash, such as inside [[...]], or when used on the right hand side of a variable assignment.  When reading about quoting variables I often hear that it's often better to just use double quotes everywhere, as there are only a very few cases where you wouldn't want them.  What are the cases where behaviour from quoting is undesirable? I'm not talking about situations where you don't need to quote, but where quoting a variable will actively stop something from working.

The old advice used to be to double-quote any expression involving a $VARIABLE, at least if one wanted it to be interpreted by the shell as one single item, otherwise, any spaces in the content of $VARIABLE would throw off the shell.  I understand, however, that in more recent versions of shells, double-quoting is no longer always needed (at least for the purpose described above).  For instance, in bash:  % FOO='bar baz' % [ $FOO = 'bar baz' ] && echo OK bash: [: too many arguments % [[ $FOO = 'bar baz' ]] && echo OK OK % touch 'bar baz' % ls $FOO ls: cannot access bar: No such file or directory ls: cannot access baz: No such file or directory   In zsh, on the other hand, the same three commands succeed.  Therefore, based on this experiment, it seems that, in bash, one can omit the double quotes inside [[ ... ]], but not inside [ ... ] nor in command-line arguments, whereas, in zsh, the double quotes may be omitted in all these cases.  But inferring general rules from anecdotal examples like the above is a chancy proposition.  It would be nice to see a summary of when double-quoting is necessary.  I'm primarily interested in zsh, bash, and /bin/sh.


I'm new to the PC-building world and I built my first PC. I didn't want to pay for Windows so I found Linux was free and Ubuntu was the best one. Well now I have Windows 8 on a USB drive and I can't uninstall Ubuntu.

I have absolutely no experience with Linux, and I desperately need to get my computer back up and running again with Windows.  How do I remove Ubuntu and reinstall Windows?    Editor's note: many of the answers are about removing Ubuntu from dual-boot but keeping Windows (which is a bit complicated), while other answers are about removing Ubuntu from single-boot (which is easy: basically just format the disk while installing Windows). The question as written is ambiguous between dual-boot or single-boot.