Is there a simple way to convert C++ enum to string?

Suppose we have some named enums:  enum MyEnum {       FOO,       BAR = 0x50 };   What I googled for is a script (any language) that scans all the headers in my project and generates a header with one function per enum.  char* enum_to_string(MyEnum t);   And a implementation with something like this:  char* enum_to_string(MyEnum t){       switch(t){          case FOO:             return "FOO";          case BAR:             return "BAR";          default:             return "INVALID ENUM";       }  }   The gotcha is really with typedefed enums, and unnamed C style enums. Does anybody know something for this?  EDIT: The solution should not modify my source, except for the generated functions. The enums are in an API, so using the solutions proposed until now is just not an option.


Show that $\sum_{i=1}^n (x_i - \bar{x})(y_i - \bar{y}) = \sum_{i=1}^{n} (x_i - \bar{x})(y_i)$. I fell into this hole where I keep finding that $$\sum_{i=1}^n (x_i - \bar{x}) = \sum_{i=1}^n x_i - \sum_{i=1}^n \bar{x} = n\bar{x} - n\bar{x} = 0$$ This seems true, but I know that I am missing something, since this implies that covariance is always zero, which is obviously not true.


A standard fact in Commutative Algebra is that a Projective $A$-module is flat.  The converse is false.      Can someone show me an example of a Flat Non Projective $A$-Module?   Thank you!


Is it possible that we have a physical state which is a mixture of discrete eigenstates and continuous ones?

For a system has both continuous and discrete spectrum, is it possible that a physical states is something like:  $$\psi(x)=\sum_{n=n_1}^{n=n2}c_n\psi_n(x)+\int_{E_0-\Delta_E}^{E_0+\Delta_E}\psi_E(x)\mathrm{d}E$$  I am asking this because of some comments under my  to this Phys.SE question:


How to define a permission to save a file on Ubuntu

I am trying to install postgreSQL   I open terminal and type the   gedit  /etc/apt/sources.list.d/pgdg.list   then in Gedit I enter this line   deb http://apt.postgresql.org/pub/repos/apt/ zesty-pgdg main   The when I try to save the file red colored text appears saying:     Could not save the file “/etc/apt/sources.list.d/pgdg.list”.   you do not have the permission necessary to save the file. Please check that you typed the location correctly and try again   How do I solve this problem?


How do I calculate $\lim_{x\rightarrow 0} x\ln x$

I was thinking about the reasons behind $0^0=1$ and I remember one of my friends studying math arguing about the continuity of the function $x^x$ in $0$. But when I write as $$x^x=e^{x\ln x}$$ I am now looking at $$\lim_{x\rightarrow 0} x\ln x$$ Graphically I can see in Mathematica that it goes to $0.$ But I can't calculate by using a Taylor expansion, because I can't expand log around $0$. How do you prove that?


Unable to write an apostrophe in Javascript

I am really new to Javascript and this might be a really dumb question but how do you type an apostrophe in between an object?  const data = {  greeting: 'Welcome to John's restaurant' }   Do I need to write something in front of it? Thank you in advance


Milne Algebraic Geometry - Remark 3.14 confusion

In Milne's , he mentions     Remark 3.14   The local ring $\mathcal{O}_{V,P}$ is an integral domain if $P$ lies on a single irreducible component of $V$...       ... if $P$ lies on more than one irreducible component of $V$, then $\mathcal{O}_P$ contains more than one minimal prime ideal, and so the ideal $(0)$ can't be prime.   Why does having more than one minimal prime ideal mean $(0)$ cannot be prime? I'm probably missing something obvious...    Thanks in advance ^_^


Is there an option to "force" the dash to open a file after I click on it instead of going to options?

When I launch an application from the dash I just need to type a few letters and when I see the application I want, I just click on it and it opens.   The problem in the Files & Folder lens. When I see a file in the list, I need to click on it and then it will go down one level and give a few options (Open, Show in Folder and Email) and then I can open it.   Is there an option where I could skip this one level so this file would act as an application?


Consecutive suggested edits on the same post by the same user

A user  which gets rejected as being too minor. 7 minutes later the same edit gets  by the same user on the same post and gets approved.  So actually this means that someone can repeatedly re-suggest the same edit until it bumps into a set 5 reviewers, from which the 3 of them will approve it. Wouldn't it make more sense if, after having a suggested edit being rejected on post, lose the right to edit this post again (at least for a time period)?  I know that this isn't really important and adding too much complexity in the system just for these rare occasions is not a good idea, but nevertheless it's worth to give it a quick thought :)


Parentheses with automatically increasing heights

To reflect the way I draw math by hand, and because I find this more readable, I would like to have \left and \right (or a custom pair of commands) render parentheses‐like symbols with an increasing size, even if their actual content does not get taller.  As is, the code:  \left(\left(\left(\left(a\right)\right)\right)\right)   renders as:    I am seeking something roughly looking like:    Of course, just as \left and \right, it would have to work automatically, that is, I wouldn’t have to specify any size information manually. My guess is that \left and \right measure the height of what is between them and compute an appropriate size for the parentheses. So, it might do the trick to alter their behaviour so that they pretend their parentheses to be slightly taller than how they are actually rendered — say, by a 1.2 factor, or whatever.  How can I achieve that?


Let V,W be vector spaces over Q, and let T:V→W be a function. Prove that if T(v1+v2)=T(v1)+T(v2) for all v1,v2∈V, then T is linear.

Let V,W be vector spaces over Q, and let T:V→W be a function. Prove that if  T(v1+v2)=T(v1)+T(v2)  for all v1,v2 ∈ V, then T is linear.  All I study is that T(v1+v2)=T(v1)+T(v2) is a property of linear maps. But this question reverses it, giving the equation first, and then tell us to prove it linear. So far, I have no idea towards this question. Anybody can give a hint or advice?


WeakHashMap is an implementation of Map interface where the memory of the value object can be reclaimed by Grabage Collector  if the corresponding key is no longer referred by any section of program. So if key is no longer used in program. its Entry object will be garbage collected irrespective of its usage. Its clear till here  This is different from HashMap where the value object remain in HashMap even if key is no longer referred. We need to explicitly call  remove() method on HashMap object to remove the value. calling remove will just remove the entry from map. Its readyness for GC will  depend whether  it is still used somewhere in program or not.    Usage of WeakHashMap over HashMap as per mine understanding  My understanding is we should go for WeakHashMap only when we want to ensure that value object is reclaimed by Grabage Collector when   key is no longer referred by any section of program. This makes program memory efficient Is my understanding correct here?  Usage of WeakHashMap as per  , i could spot this statement     This class is intended primarily for use with key objects whose equals   methods test for object identity using the == operator.   I did not get what above statement meant and how it contrast with mine understanding of WeakHashMap usage. Actually i did not get how this statement is related to usage of WeakHashMap?  UPDATE:-  on further carefully reading below statement the javadocs     An entry in a WeakHashMap will automatically be removed when its key   is no longer in ordinary use. More precisely, the presence of a   mapping for a given key will not prevent the key from being discarded   by the garbage collector, that is, made finalizable, finalized, and   then reclaimed. When a key has been discarded its entry is effectively   removed from the map, so this class behaves somewhat differently from   other Map implementations.   i am revising my understanding for the benefit of me and others  Usage of WeakHashMap over HashMap as per mine revised understanding  We should go for WeakHashMap only when we want to ensure that key-value pair is removed from map on GC run  when key is no longer in ordinary use other than map itself.  Examples are :-      WeakHashMap<Integer, String> numbers = new WeakHashMap<Integer, String>();     numbers.put(new Integer(1), "one");// key only used within map not anywhere else     numbers.put(new Integer(2), "two");     System.out.println(numbers.get(new Integer(1))); // prints "one"     System.gc();     // let's say a garbage collection happens here     System.out.println(numbers.get(new Integer(1))); // prints "null"     System.out.println(numbers.get(new Integer(2))); // prints "null"       Object key = new Object();     m1.put(key, c1);     System.out.println(m1.size());     key = null or new Object() ; // privious key only used within map not anywhere else     System.gc();     Thread.sleep(100);     System.out.println(m1.size());


Manual pages uses the quotation : `' (quoting string inside grave accent and apostrophe)

I've found that many manpages uses the quotation :  `c/s' i.e quoting character or sting inside grave accent(`) & apostophe(').  Example visit manpage of ,  etc. and you'll find the quotation under `':  Example:     OPTIONS       The -H, -L and -P options control the treatment of symbolic links.  Command-line arguments following these are taken  to  be  names of files or directories to be examined, up to the first argument that begins with `-', or the argument `(' or `!'.  That argument and any following arguments are taken to be the expression  describing what is to be searched for.  If no paths are given, the current directory is used.  If no expression is given, the expression -print is used (but you should probably consider using -print0 instead, anyway).          This manual page talks about `options' within the expression list.  These options  control  the  behaviour  of find  but  are  specified immediately after the last path name.  The five `real' options -H, -L, -P, -D and -O must appear before the first path name, if at all.  A double dash -- can also  be  used  to  signal  that  any remaining  arguments  are  not options (though ensuring that all start points begin with either `./' or `/' is generally safer if you use wildcards in the list of start points).   See the quotation used for emphasized characters. I've to use escape character () to avoid undesired formatting in above quoted text (visualize it by hitting edit button!)   So, I am curious to know about the usage of this quotation used. What is the usage of such quotation or when & why such quotation is used?


How to prove $ \left(\sum\limits_{cyc}{xy}\right)^2 \ge3xyz(x+y+z)$ with $x,y,z$ being positive real numbers

I have tried to improve the inequality by AM-GM. Here is what I have done: Since $$\sum_{cyc}{xy}\ge3\sqrt[3]{x^2y^2z^2}$$ $$\Rightarrow \left(\sum_{cyc}{xy}\right)^2 \ge3xyz\sqrt[3]{xyz}$$  That means we got to prove$\sqrt[3]{xyz} \ge x+y+z$. However that is false in the case $x=1$,$y=2$,$z=3$. Any help?


Brushing teeth before or after breakfast

Usually in the morning I brush my teeth after breakfast. But my dentist told me that it's better not brush them right after eating food, because eating makes them soft.  So now I brush my teeth before breakfast. Is this the correct procedure?  PS. Just found , the author has the same opinion.  Just want to get a additional confirmation.


I've done this before, but I have forgotten how to do it. I tried every command but nothing is working, and I was trying to be quick. Is there a way to do this in Minecraft 1.16?


“I don't know half of you half as well as I should like; and I like   less than half of you half as well as you deserve.”      ― J.R.R. Tolkien, The Fellowship of the Ring   In the sentence above, if I change "I should like" to "I would like", will there be a noticeable difference in the meaning or nuance?


Proof of $A=(A\cap B)\cup (A-B)$ using the laws of set algebra.

Q.Prove: $A=(A\cap B)\cup (A-B)$   I want to prove it using set laws.  But I am lacking of any hint to break L.H.S into any usable result. Any hints will be appreciated.


How to run php script in background on form submit?

I have a form on index.php which takes two fields, i want to display a message as 'You will get an email' when user submits the form. And i want to process the form in the background as it will take more than 15-30 mins. The script shall run even if the users close their browser. I have tried doing it using ajax but the ajax returns message only when the AJAX function succeeds. Is there any way to display the message before the AJAX function succeeds and the script keeps running even after the user close their browser.


Problem with understanding the analytic continuation of zeta function.

I know two things:   $\sum_{n=1}^{\infty}\frac{1}{n^{s}}$ converges if and only if $Re s > 1$ analytic continuation is expanding the domain of entire function.   I would like to find analytic continuation of Riemann zeta function.  But there is a problem, as we approach $Re s=1$ from right side the value of series goes to infinity. Then how it is possible to find a smooth crossing to the $Re s \le 1$ part, so that we would have formula calculating zeta function for all complex numbers?(expect case when $s=1$)


Removing all markup automatically changes package

I have looked around and found no answer to this question.  I am using the changes package, and I need to remove all markup from the source file. There's  about using the , but sadly it goes unanswered.   My questions are these: why is the script not working, and is there a way to make it work ? Is there another script ? (hopefully one that can be used on a windows machine as well)   Some background - I am using a lubuntu 16.04 machine.   I am trying to remove the markup from the following file to no avail:  \documentclass{article}  \usepackage{changes} %I could use [final] to hide the markup from the PDF, but I need the ``evidence'' removed from the source  \begin{document}  Some text \added{some added text}, and some \replaced{replaced}{replactd} text. \deleted{also, some deleted.} \end{document}   I placed the script in the same folder as input.tex, made the script executable and used  sh ./delcmdchanges.bash -i input.tex output.tex   I get no error, no query as to found markup, and the output file contents is identical to the input.


Do eliptical chainrings give you an advantage

Has anyone tried oval chainrings? Are they worth the time and money? Any brands worth considering? I'm trying to gain any advantage I can get


I have a huge file (more than 2 GB) where data is like below.  12,324,32342,E:fsdsf,23432,34534,45345,324  13,3224,342,E:werwefsdsf,23432,34534,45345,324  121,3244,33442,E:,23432,34534,45345,324   Here I need to replace all the occurrences of 4th column wherever it is encountering E: with a blank space "", but wherever it finds a string after E:, that should remain as it is.  The expected output would be:  12,324,32342,E:fsdsf,23432,34534,45345,324  13,3224,342,E:werwefsdsf,23432,34534,45345,324  121,3244,33442,,23432,34534,45345,324


Deploying Connected App - Copado Deployment error "consumer key is already taken" Unable to upload correct yaml file

I am trying to deploy a connected app to higher orgs through Copado but am getting the error as "Consumer key is already taken" and so for that am trying to create a yaml and upload it in the pipeline record (as of my knowledge this approach will help to resolve error) but am unable to create a correct yaml structure... Please check below yaml structure which i am trying with. Any help is appreciated!! Thanks!! regex_lib:   remove-simple-tag: '((?ms)<consumerKey>(.+?)<\/consumerKey>)'    rules:   remove-consumer-Key:       extensions:        - ConnectedApp       regex_name: remove-simple-tag       branches:       replace_values:        - '(?ms)<consumerKey>(.+?)<\/consumerKey>'       replace_with:


How can define variable like \var{arg1: Name}{arg2: Family} and in text use that like      My name is \var$arg1 and my family is \var$arg2   arg1 and arg2 are lables of arguments.


How can I make my jQuery code work for dynamically loaded HTML?

I have the following code:  <script type="text/javascript">     $(function () {         $(".wrapper1").scroll(function () {             $(".wrapper2").scrollLeft($(".wrapper1").scrollLeft());         });         $(".wrapper2").scroll(function () {             $(".wrapper1").scrollLeft($(".wrapper2").scrollLeft());         });     }); </script>   But my HTML is dynamic and added later. Is there a way that I can use this code outside of the dynamically added HTML so that it works after the HTML is loaded ?


how to get the current chapter name, section name, subsection name, etc?

How can one get the current name of the following: Chapter, Section, Subsection(s), frame, label, mdframed?


How to resolve the "GPT detected. Please create a BIOS-Boot partition" error when using boot-repair?

After installing Ubuntu, Windows didn't boot so I installed boot repair to fix this problem. But I am getting the message displayed below.  I tried to make a new partition with unformatted file system but still receiving the same message.  How do I fix it?


Word for a response that is enthusiastic, passionate and long-winded

For example, when asked "What did you put in your tea?"  A normal response might be "Honey."  A ______ response might be "The sweetest honey, from the greatest of flower orchards.  I could literally taste every sweet petal of the flowers that became the honey comb.  The flavor began as a light sweetness and then crescendo-ed into a grand orchestration of savory, blissfully sweet, yet earthy delights! I became enraptured and clenched my fists, looking towards the sky and exclaiming, 'WWWOOOOOOOWWWWW!!  That's some great honey!'"


Difference between Decimal and decimal in c#

can any one explain me what a difference between Decimal as Struct declaration and decimal as variable type in C#?  If they are the same things, so why both of them exists in C#.   The similar hapen with Bool and bool, String and string... etc...


Out of the following queries, which method would you consider the better one? What are your reasons (code efficiency, better maintainability, less WTFery)...  SELECT MIN(`field`) FROM `tbl`;  SELECT `field` FROM `tbl` ORDER BY `field` LIMIT 1;


How to make the ListBox scrollbar appear when it's in a ScrollViewer?

I have a ScrollViewer, which contains a DockPanel, which contains a ListBox as its filled element.  The problem I'm facing is that, when the ListBox contains many items, and the height of the window is reduced to the point where a scrollbar is necessary, the ScrollViewer's scrollbar appears, pushing my controls with DockPanel.Dock="Bottom" off the screen.  The ListBox's scrollbar never appears.  Instead, when the window height is reduced, I would like the ListBox's scrollbar to appear first.  Then, after the ListBox shrinks to some minimum height that I specify, the ScrollViewer's scrollbar should appear to take care of the rest.  How do?


Writing Grover's Iterator in different computational phase

This question is from Nielson and Chuang's Quantum Computation and Quantum Information:    Here $|\alpha\rangle$ is given by: $$\frac{1}{\sqrt{N-M}}\sum_{x} "|x\rangle $$ where $\sum_{x}" |x\rangle$ is the sum of states which are not the solution.  and $|\beta\rangle $ is given by: $$ \frac{1}{\sqrt{M}}\sum_{x} ' |x\rangle $$ where it represents all $M$ solutions.  $\theta$ is defined by: $$\cos\Big(\frac{\theta}{2}\Big) = \sqrt{\frac {N-M}{N}}$$  I understand everything mentioned above as well as the further geometric visualization. However, I am having trouble trying to come up with a justified way to solve this exercise. The only thing that I understand is that $G$ must be a unitary Matrix made up of trigonometric functions. How can I approach this problem?


Is there a way to know which badges can be obtained more than once?


I am trying to get the difference between the content of two different cells. For example:           A           B             C (Result of formula) 1   ABCDE        ABCDEFGH         FGH 2   ABCDEFGH     ABCFGH           DE 3   AB 123 CDE   CDE 345 AB       345   Can anyone recommend how I can achieve this?


I just came across this old laptop and I wanted to try something new, so I decided to install Ubuntu 12.04 on it. I am a rookie at Ubuntu. So I noticed that the OS ain't that great in terms of smoothness, since it's laggy. Don't think that the OS is the problem, just the laptops hardware.   1.4 GHz Intel processor 512 MB of RAM 128 MB video card.    I was hoping that someone could tell me if my laptop is fit to use 12.04 or is it to old? Maybe I have to install some drivers or whatnot. I want to use this laptop for college. No need for gaming. Just for projects, maybe watch a movie or a YouTube video, which by the way lags like hell when in full screen (unwatchable).   I was thinking of updating my RAM to 1 GB, hope that will help Ubuntu run more smoother. What do you thing? Thanks in advance!!! :)


proving a relation with induction , simpifying $(\sqrt x+\sqrt {x+1})^n$= $\sqrt y + \sqrt{y+1}$

prove $(\sqrt x+\sqrt {x+1})^n$ where n is an odd natural number can always be written as $\sqrt y + \sqrt{y+1}$ while y is also a natural number . I have tried using induction by proving the question when n is an even integer  which is easy,then  I tried reducing $(\sqrt x+\sqrt {x+1})^n$ to  $(\sqrt z+\sqrt {z+1})$.$(\sqrt x+\sqrt {x+1})$ in my induction process  but I hit a hard wall here and don't seem to figure out a  way to write these two parentheses in form of a unified $\sqrt y + \sqrt{y+1}$ . Should I change my approach? Is there any other way to prove this ?


Can multiple people use the same account?

On Workplace.SE, we have come across an interesting user, who seemed to have had a roller coaster ride in his first week at work. Quoting JackArbiter's comment on this user from the  :     This guy asks a question 7 days ago where he "just got" the job. 4 days ago where he works with over 100 devs. Then 2 days ago he works with just over 50 devs, and he's been working there for a while and he wants to defend a junior dev. He gets called out for BS and he states that this account (which is 8 days old) is used by multiple people.    This is the  he is referring to:     This account is used by more than one person hence the different scenarios    In other words, this case seems to be the inverse of a sock puppet (puppet sock?). Let us, for a moment, assume that he is stating the truth. Is there any SE policy against use of the same account by multiple people?  Personally I feel that this should not be allowed as:   Creating a user account is free and easy, no reason why people cannot use their own accounts. It is not at all necessary to share your real name, so there is very little fear of your online post biting you in real life (unless you make it really obvious). You can even ask questions without registration. Most importantly, reputation is tied to privileges. People "pooling" reputation undermines this principle. Since the reputation has been gained by multiple people, we cannot really be sure if the person currently using the account knows the site well enough to use those privileges.   However, I could not find any policy explicitly barring such practice, so we cannot "punish" the user in any way if they have not really violated anything.


how to find all extended classes from package/single java file using reflection in java?

Suppose I use a single Java file which contains 2 classes like A & B (B extends A).   Then how can I find class A using reflection in Java?  Are there any methods present in Java reflection to get all super classes?


I have a computer that dual boots Windows 7 and Ubuntu through GRUB. Recently Windows failed to boot, and after trying various things to fix it, now when I choose Windows 7 in the GRUB menu, I get the message  error: no such device: 9A7AC1417AC11B41 error: hd2 cannot get C/H/S values Press any key to continue...   and when I press a key it brings me back to the GRUB menu. The message appears in the same style (colors and font) as the GRUB loader.  I have noticed that windows uses two partitions, one called RECOVERY (16 GB) and one called OS (517 GB) and that the GRUB loader points to RECOVERY but Windows is on the OS partition. I can mount both partitions in Linux and the OS disk seems to have the right files. I used the Windows 7 recovery disk and the automated repair thing no longer finds any errors.  How can I fix this an make Windows boot up again?  fdisk -l outputs  Disk /dev/mapper/isw_bdhfaghdfb_dell: 640.1 GB, 640141230080 bytes 255 heads, 63 sectors/track, 77826 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 131072 bytes / 262144 bytes Disk identifier: 0x2dbec2f5                            Device Boot      Start         End      Blocks   Id  System /dev/mapper/isw_bdhfaghdfb_dell1               1           5       40131   de  Dell Utility Partition 1 does not start on physical sector boundary. /dev/mapper/isw_bdhfaghdfb_dell2   *           6        1918    15360000    7  HPFS/NTFS Partition 2 does not start on physical sector boundary. /dev/mapper/isw_bdhfaghdfb_dell3            1918       64772   504878877+   7  HPFS/NTFS Partition 3 does not start on physical sector boundary. /dev/mapper/isw_bdhfaghdfb_dell4           64772       77827   104858625    5  Extended Partition 4 does not start on physical sector boundary. /dev/mapper/isw_bdhfaghdfb_dell5           77578       77827     2000128   82  Linux swap / Solaris /dev/mapper/isw_bdhfaghdfb_dell6           64772       67204    19531008   83  Linux /dev/mapper/isw_bdhfaghdfb_dell7           67204       74498    58593536   83  Linux /dev/mapper/isw_bdhfaghdfb_dell8           74498       77577    24731648   83  Linux


1970s space cadet training novel for young adults

I would love to identify a sci-fi novel I read in the late 60s or 70s.  It followed a group of young space cadets through their training in the Space Academy.  The training culminated in small groups of cadets being sent through a gateway in the space station, into different worlds where they had to survive whatever conditions they met beyond the gateway, as part of their training.  One such trip went wrong and the group ended up stranded in a hostile world for days, hoping to be rescued by their trainers.  I can't remember much about the story or protagonists so this may be too vague, but I remember descriptions of a vast space station hall and these young cadets bringing whatever kit they hoped they might need - some brought breathing apparatus and full survival gear, but others came with very little as they believed they would not be sent into conditions where they could die without the right equipment.  They hadn't bargained for the power surge or whatever it was that misdirected them as they passed through the gateway!  I also remember rivalry between the cadets - I think the hero was male and quietly heading for top cadet of the year award... and I think at least one of the group died in the unknown planet before they were rescued.  Does this ring a bell with anyone?  I remember the mood and tension more than the details but it was a long time ago!  I have a 10-year old son who I think would love this kind of story.  If anyone can help you have my thanks!


Issue with QGIS 2.10.1 Clip and Intersect Tools

Having an issue in QGIS 2.10 -- clip and intersect don't seem to be working correctly. I am trying to show zipcode by a legislative district in Florida. When I clip the zipcode shapefile by the district one, some of the zip codes aren't being clipped (or intersected -- I'm getting the same result with both tools).   In the below screenshot, the bronze color is what both tools are giving me as an output. It should be giving me the bronze vectors + the areas that are blue-violet (created by the overlay of the semi-transparent blue district shapefile and the purple zip code shapefile). I don't understand why this isn't working, it seems pretty simple to me, but am I missing something?     The data for this project is here if needed:   Both shapefiles are from the US Census and are projected in NAD83.   I tried selecting only the zip codes that would be in the district, checking the "use only selected features" box in the clip tool, and got the same results.


Is sub 15 rep feedback used for internal calculations?

:     It means you're not voting. You're leaving "feedback" - we track the nature of your vote, but don't alter the post score in response to it.   If the post score isn't modified, is anything else being modified? Is this used for people reached or similar? Or is it just a tally?


Automatic bounty award rules - please fix the help to leave no open questions

I read the :     If you do not award your bounty within 7 days (plus the grace period),   the highest voted answer created after the bounty started with at   least 2 upvotes will be awarded half the bounty amount. If there's no   answer meeting that criteria, the bounty is not awarded to anyone.      If the bounty was started by the question owner, and the question   owner accepts an answer during the bounty period, and the bounty   expires without an explicit award – we assume the bounty owner liked   the answer they accepted and award it the full bounty amount at the   time of bounty expiration.   However they leave questions open:   What if the owner of highest voted answer is the person who offered the bounty, and there are no other answers with >= 2 votes? What if the accepted answer has less votes than some other answer? What if the accepted answer belongs to the person who offered the bounty?   I think the help should be updated to cover the answers, i.e. to explicitly state the priorities and relationships between the rules.


for j in * .* ; do      cp $j ../$name-S$i.gid/${j%%. * }$i.${j#*.} done   Could someone tell me what this for loop does?  What do *, % and # mean?  ($name is a path of a directory in which there are -S1.gid ... -Sn.gid directory)


Insert New Picklist value with record type in MetaData Service

Using MetaData API, am able to insert the value in Picklist field in apex code but it is not available for any record type. I am finding hard to expose the value to record type. Here is my code,  public static void updatePicklistFieldTA(string ta, string sessionId) {     MetadataService.MetadataPort service = createService(sessionId);     MetadataService.CustomField customField = new MetadataService.CustomField();     customField.fullName = 'Case.Technology_Area__c';     customField.label = 'Technical Area';     customField.type_x = 'Picklist';     metadataservice.Picklist pt = new metadataservice.Picklist();     pt.sorted= false;     metadataservice.PicklistValue three = new metadataservice.PicklistValue();     three.fullName= ta;     three.default_x=false ;     pt.picklistValues =  new list<metadataservice.PicklistValue>{three};     customField.picklist = pt ;     List<MetadataService.SaveResult> results =         service.updateMetadata(             new MetadataService.Metadata[] { customField });     handleSaveResults(results[0]);     // Get the values for the picklist  }   I found many articles regarding this but there is no solution.  Any help would be appreciated!.


Why hyperreal numbers are built so complicatedly?

I have seen approaches at building hyperreal systems by using complicated notions like ultrafilters and the like.  Why not just postulate the existence of infinitesimal element $\varepsilon$ and infinite $\omega=1/\varepsilon$ like we do with complex numbers and build a field system around them?


A special notification when questions get edited

Often times it happens, that someone answers a question in its original and specific kind. Also often times it happens, that the questioner edits the question when he realizes the given answer(s) is/are correct, but don't answer what the really wanted to know.  The such called Ninja Edit.  I propose that there should be a special notification for anyone who posted an answer to a question, which gets edited afterwards.


I would like to find out if there is any way of making code to create and open folders in python, I've looked around the web but I can't seem to find anything that's simple and can be implemented into current code. Is there  a way of doing it like making a text file or a different way? If there is, let me know. Thanks!


Is it possible to trim a clipping mask in Illustrator? I have an image that I created a mask for, but the entire image is so much larger than the space I need, I would like to crop the rest of the image to the mask.  Basically, I need the same result as in Photoshop when you Right-click > Apply Mask.


I want to do something like this:  user@myserver$echo -en "\rSome text to overwrite same line command is on"   The problem is I end up with this:  Some text to overwrite same line command is onuser@myserver$   If I do echo -e only then I get this:  Some text to overwrite same line command is on  user@myserver$   Which is okay except it causes the console to scroll.  I don't want it to scroll because my console window with tmux is only one line high.  I've tried padding the right hand side of the string with spaces but that doesn't work correctly.


The cardinality of a language over a set of variables $V$ with $\#V= κ$

In predicate logic, to define a language, we consider the following $3$ sets:  (1) $V$, the set of variables;  (2) $F$, the sets of function symbols;  (3) $P$, the set of predicate symbols with their arities.   Now I am concidering about determine the cardinality of a language over a set with arbitary cardinality, $κ$(Note that $κ$ can be either finite, countablely infinite or uncountablely infinite ).  May I please ask:  If the cardinality of $V$, $\#V = κ$, what conditions on $V$ , $F$ and $P$ will give us a language over $V$, $F$ and $P$ with cardinality $κ$?  And may I please ask if it is the fact that if $\kappa$ is finite, then to get a language with cardinality $\kappa$ we need $(V+F+P)^{<\omega}=(\kappa+F+P)^{<\omega}=\kappa$, so we can never have a language of cardinality $\kappa$. I think it is something weird here. Am I wrong with something?  I had googled it but I have get nothing from websites, now I am confused. Could someone please help? Thanks so much!  EDIT: Latter I am told that in my course, the cardinality of a language refers to the set of expression instead of this of the set of strings. So now I need to consider further about when a string makes sense.  EDIT':Now I am considering that if we can find out a general way to determine the cardinality of expression, which may related to combinatorics. See this question:  Any help would be appreciate.


I am using Drupal 7. When I test my page speed in , it says to compress the images. After that I compress the image and uploaded it. The uploaded image placed in files folder like (test_0.png) and the old name is test.png. I have lot of images like that. How to remove images which are not in use.


name of my macbook air changed automatically

i noticed that the name of my macbook air in terminal changed automatically to "homepc"  This is the log of the console with the exact timeline it happened:  NetworkServiceProxy.framework/Versions/A/NetworkServiceProxy (0x7fffb250bdc0) and /usr/libexec/networkserviceproxy (0x10201e390). One of the two will be used. Which one is undefined. Aug 15 00:57:00 Alexs-Air syslogd[47]: ASL Sender Statistics Aug 15 00:57:06 Alexs-MacBook-Air findmydeviced[91598]: objc[91598]: Class LocalizedUnregisterErrorKey is implemented in both /System/Library/PrivateFrameworks/FindMyDevice.framework/Versions/A/FindMyDevice (0x7fffb11a13a8) and /usr/libexec/findmydeviced (0x105338d10). One of the two will be used. Which one is undefined. Aug 15 00:57:08 Alexs-MacBook-Air com.apple.xpc.launchd[1] (com.apple.imfoundation.IMRemoteURLConnectionAgent): Unknown key for integer: _DirtyJetsamMemoryLimit Aug 15 00:57:14 homepc xpcproxy[91608]: libcoreservices: _dirhelper_userdir: 529: bootstrap_look_up returned (ipc/send) invalid destination port Aug 15 01:04:08 homepc prl_naptd[90721]: Reloading configuration... Aug 15 01:04:08 homepc prl_naptd[90721]: vnic0: DHCP/NAT for 10.211.55.1-10.211.55.254 netmask 255.255.255.0 Aug 15 01:04:08 homepc prl_naptd[90721]: vnic1: DHCP for 10.37.129.1-10.37.129.254 netmask 255.255.255.0 Aug 15 01:04:09 homepc timed[88]: settimeofday({0x5d546231,0x3a658}) == 0 Aug 15 01:04:10 homepc systemstats[59]: assertion failed: 18F132: systemstats + 214542 [0A10FDEF-5C7C-3D70-97F1-3A1D67836242]: 0x6d8f Aug 15 01:04:10 --- last message repeated 1 time --- Aug 15 01:04:10 homepc com.apple.xpc.launchd[1] (com.apple.preferen   What just happened?   EDIT:  The question which this is supposedly a duplicate of says this  It's perfectly normal for this to occur; when you login Terminal remotely bash does a reverse DNS lookup   I have never logged in remotely. I checked in system preference>sharing and all sharing is turned off including "remote login"


Check not NULL in entityfieldquery propertyCondition

I want to only return results in entityfieldquery that have a propertyCondition of 'field_entry_path' that is not empty.     $query = new EntityFieldQuery();   $query->entityCondition('entity_type', 'example')         ->propertyCondition('field_entry_path', '', 'NOT IN');   $result = $query->execute();   Thanks.


How to set a distance that rescales with the font

I'm trying to set a distance which is relative to the font size.  The problem is that the distance is reused several times in the document, potentially in environments with a different font size.  In each case the distance should automatically rescale to retain it's proportion to the font size.  Unfortunately, simply specifying the distance in em or ex doesn't work because the distance is stored at the size of em or ex in the current font.  When the font changes, the distance is not updated accordingly.  Is there a way around this?  Ideally the solution should work under both LaTeX and PlainTeX.  Below is a M(n)WE which shows the current, undesired, behavior.  \documentclass[12pt]{article}  \newskip\test \test = 1em  \begin{document}  In each row, the lines should be the same length.  \rule{0.4pt}{1em} \rule{0.4pt}{\test}  {\tiny\rule{0.4pt}{1em} \rule{0.4pt}{\test}}  {\Huge\rule{0.4pt}{1em} \rule{0.4pt}{\test}}  \end{document}


Is there anyway to enable autosleep in batch in windows 10?

I have a requirement that enable autosleep in batch file. The reason is i want to autosleep my computer after getting off work, but disable autosleep when i'm on duty   I know how to auto wake up my computer by using RTC in BIOS I know how to run a batch at certain time by using scheduler   The only thing I don't know is how to enable or disable autosleep by batch.


Installing and accessing Clam AV Antivirus in 12.04

I have installed Clam AV antivirus for Ubuntu. I read   As per the instructions there I ran sudo apt-get install clamav, but the apapplication is not visible in my dashboard.   I am very new to Linux  How can I see the GUI of ClamAV and access it or uninstall it?  Or, can anybody suggest an effective open source antivirus application for Ubuntu?


Is there a preferable exit row in an airplane?

I think the exit row near the wings are not good because the wings carry fuel and they are close to the engines.  For example:    As it is clear, in the above situation the exit row near the wings are not usable.  or this one:


How to improve OSM layer resolution in OpenLayers plugin while exporting?

I'm having trouble with the OpenLayers Plugin exporting a map to a png or pdf file:  The output resolution of the exported osm-layer is very, very poor. Zooming to 100% in the png file shows big pixels. The rest of the map - so the output from shapes and fonts - is in the usual high resolution e.g. 300 or 600 dpi.  Is there any way to improve the osm-background-resolution?


How do I convert my PhD dissertation so that it can be published as a book?

I have just completed a PhD by research, which I think has some merits in being available as a book (This is, of course, my personal opinion). The research cuts across several fields (e.g. sociology, public policy).  I am wondering what I need to do to take the next step.  In particular:   How do you turn an academic piece like the dissertation (which is written for the examiners) into a book (which is for the general public)? How do I find publishers who specialise in my field?


I am reconnecting nodes to create a glass effect. I'm following a tutorial and he has connected nodes and not explained what he has clicked on to bring it up. I can't find the Add box in blue.


Tikz picture bounding box when using to[in=xxx, out=yyy]

I have this two simple images:   \documentclass{report} \usepackage{tikz} \begin{document}     \fbox{\tikz{%          \fill[red!20] (0,0) to[in=210,out=30] (10,0) -- (10,1) -- (0,1) -- cycle;         }}      \bigskip      \fbox{\tikz{%          \fill[red!20] (0,0) -- (10,0) -- (10,1) -- (0,1) -- cycle;         }} \end{document}   And I am quite surprised about the bounding box of the first one:    Is it possible to achieve (automatically) tighter bounding box when using to[in=..., out=...] construct?


Show that 2|n(n+1) using induction   I tried but im stuck , it still (n+1)(n+2)   Two successive numbers   It's simple using the the methode that n=2k or n=2k+1   Can someone help or give a hint ?


MS Word: Automatically update text in file based on text above

I am trying to set up a Word file such that when a certain value is updated at the beginning of the document, all corresponding values in the rest of the document are changed. Therefore, how can I link certain text in my document to reference one specific piece of text. I have tried playing around with Objects, however, I have not been able to find what I am looking for. For example: "Thomas is a cat." ..further down in the document "Since Thomas is a cat, he..." If I change the first sentence to "Thomas is a dog." then the second sentence should automatically change to "Since Thomas is a dog, he.."


how to use force:navigateToURL in lightning components to navigate from one lightning component to another in communities?

In communities, navigateToComponent or Lightning:navigation are not supported. So i found over the web force:navigateToURL is the way to go with. I am not able to make this work. I think the URL that i am trying to build is wrong. Can anyone suggest me the right way of using force:navigateToURL to navigate from one lightning component to another in communities?  I tried something like this. It did not work.  gotoAnotherComponent : function (component, event, helper) {       var urlEvent = $A.get("e.force:navigateToURL");       urlEvent.setParams({         "url": "/cmp/c__componentName"       });       urlEvent.fire();   }


I'm not really sure where to begin with this but for a simplified example I have a set of integers:    {11, 22, 3, 12, 1, 23, 21, 13, 2}     I need to partition these into K=3 clusters with initial means of the clusters of 1,2,3 using Euclidean distances.  I'm assuming I need to find the distance of each value and compute new means but no idea how to go about it and everything I've read online doesn't seem to help    If someone can give me the basic ideas on how to tackle this much appreciated.


L-functions are discussed here: ...  So why are they called L-functions...?  Is there a reason for the L?


Find  $$\frac{1}{3}+\frac{1}{10}+\frac{1}{21}+\frac{1}{45}+....\infty$$ I tried to rewrite it as $$S=\frac{1}{1\times3}+\frac{1}{2\times5}+\frac{1}{3\times7}+\frac{1}{5\times9}+.....$$  To identify the pattern but i could not go on


Planck's law: $B_\nu (\nu, T)$ to $B_\lambda (\lambda, T)$

Wikipedia says that Planck's law is:  $$B_\nu (\nu, T) = \frac{2h\nu^3}{c^2}\times \frac{1}{e^{h\nu /(k_BT)} - 1}$$  So, to convert this to wavelength, I substituted $\nu = \frac{c}{\lambda}$ which gave me:  $$B_\lambda(\lambda, T) = \frac{2hc}{\lambda^3}\times \frac{1}{e^{hc/(\lambda k_BT)} - 1}$$  However, Wikipedia says that:  $$B_\lambda(\lambda, T) = \frac{2hc^2}{\lambda^5}\times \frac{1}{e^{hc/(\lambda k_BT)} - 1}$$  What did I do wrong?


What did Nietzsche mean by monsters and the abyss?

What do you think Nietzsche meant by "Whoever fights monsters should see to it that in the process he does not become a monster.  And when you look long into an abyss, the abyss also looks into you." (Beyond Good and Evil, 146)?  What kind of monster? What does it mean to look into an abyss?


How to get out of root mode in Windows bash?

I'm playing around with the bash shell for Windows 10 and I noticed that I was in the root mode (whoami returns root). I'm still fairly fresh at bash but I know enough to know that using root mode is dangerous if you don't absolutely know what you're doing (like me).   exit and Ctrl+D don't work.  Any tips to log out of sudo?  EDIT: I created a new user account with adduser and it took me out of root mode.


after setting up apache and everything working correctly i tried to go to localhost/phpmyadmin and now instead of showing me the login page it's showing me this weird stuff: here is one line of it. it's a huge pile of code.  addJSON( 'list', PMA_RecentFavoriteTable::getInstance('recent')->getHtmlList() ); exit; } if ($GLOBALS['PMA_Config']->isGitRevision()) { if (isset($_REQUEST['git_revision']) && $GLOBALS['is_ajax_request'] == true) { PMA_printGitRevision(); exit; } echo '   and then below that php myadmin demo server with more pile of code..


I have the following bash script to increment the assigned date: DATE.   #!/usr/local/bin/bash  DATE=20130625  for i in {1..10} do      NEXT_DATE=$(date +%Y%m%d -d "$DATE + $i day")      echo $i $NEXT_DATE done   However, it is just repeatedly printing today's date as follows.  1 20140122 2 20140122 3 20140122 4 20140122 5 20140122 6 20140122 7 20140122 8 20140122   Any help is appreciated. btw, the OS is Solaris 11. Thanks.


Generalize converting a Linq-to-SQL object representing a table to a DataTable

I have the following class:      [Table(Name = "test")]     public class Test     {         private string _Name;         [Column(Storage = "_Name")]         public string Name         {             get { return this._Name; }             set { this._Name = value; }         }          private int _Age;         [Column(Storage = "_Age")]         public int Age         {             get { return this._Age; }             set { this._Age = value; }         }          public static DataTable ConvertListToDataTable(List<Test> table) // Used for SqlBulkCopy         {             DataTable dt = new DataTable();             dt.Columns.Add("Name", typeof(string));             dt.Columns.Add("Age", typeof(int));              foreach (Test row in table)             {                 DataRow dr = dt.NewRow();                 dr["Name"] = row.Name;                 dr["Age"] = row.Age;                  dt.Rows.Add(dr);             }              return dt;         }     }   But I'd like to abstract that ConvertListToDataTable method out into a parent base class. Is that possible using reflection? I wouldn't even know where to start.  Note the DataTable will have columns that exactly match (in name without the _ and type) all the properties of the class with a [Column] attribute    This is the reason I want the DataTable:  public void testBulkInsert(string connection, string table, DataTable dt)     {         using (SqlConnection con = new SqlConnection(connection))         {             con.Open();              using (SqlBulkCopy bulkCopy = new SqlBulkCopy(con))             {                 bulkCopy.DestinationTableName = table;                  bulkCopy.WriteToServer(dt);             }         }     }


Preface  I'll preface this by saying two things:   I'm new(er) to python/pandas, and trying not to reinvent the wheel I've read the documentation for  I've read  and . I understand the concepts we're working with here, and am trying to figure out a "good" solution to getting a modicum of precision I know it would be easier to ensure users only enter numbers, but I don't have control over the source data; the program is a large-scale data validation tool which has to accept everything from the user no matter what was provided   Background  I'm working on porting a project from R to python, and am struggling to find a good way to translate a text-to-float conversion process. Specifically, I'm:   Reading a pandas dataframe in from a SQL database (pandas.read_sql) Casting a column which is stored as text back into a number using pd_to_numeric   Using the error='coerce' option to force the coercion from text to floats  Checking the before/after to see if/where input was coerced to NaN    Question  How to I get pandas to neatly coerce a text representation of a float value to the corresponding float cleanly?  The issue I'm running into is with the numerical precision. For example:  In[1]: pd.to_numeric('3.785', errors='coerce') Out[2]: 3.7850000000000001   I understand why that's happening (i.e. 3.785 is represented in a way that's not easily presentable in the underlying binary representation). What I'm trying to figure out is if there's a way to work around why it's happening efficiently.  For example, in R, there's a lot that goes on under the hood, but in the as.numeric API, you get the number that's ostensibly represented by the text value:  > as.numeric('3.785') [1] 3.785   which is my desired behavior. Is that possible using pandas/python?  I'm open to incorporating other packages, or being told "that's impossible."


Continuing from my , is there a comprehensive document that lists all available differences between debug and release modes in a C# application, and particularly in a web application?  What differences are there?


I’m taking this for granted and using it to show that the wave function in momentum space is the Fourier transform of $x$ space. But suddenly I don’t why this stands.  $$\langle p |x \rangle =e^{-ipx}/\sqrt{2\pi}.$$


I have a circle centred at $(0,0)$ with radius $r$ and I have $2$ random points $P$ and $Q$ on the circumference of the circle. If $d$ is the distance between $P$ and $Q$, what is the variance of $d$?  My solution: I have taken $P$ with coordinates $(x_1,y_2)$ and $Q$ with coordinates $(x_2,y_2)$  $d=2r \sin(\frac{\theta}{2})$ as it is the equation of chord length.  I have the joint pdf of $x$ and $y$ as :  $f(x,y)=\frac{1}{\pi r^2}$ if $(x,y)$ is on the circle.  $f(x,y)=0$ otherwise.  Will the intergal of $xf(x,y)$ with respect to $x$ and $y$ , give me the expected value of $d$?


Beamer itemize not aligned when in blocks

While making a poster, I've got two columns with blocks with itemize inside them. MWE:  \documentclass[final]{beamer} \mode<presentation>{}  \usepackage{times} \usepackage{amsmath,amssymb} \usepackage[english]{babel} \usepackage[latin1]{inputenc}  \begin{document} \begin{frame}[t]{}   %\leavevmode \begin{columns}[t, onlytextwidth] \begin{column}{.5\linewidth} \begin{block}{Contributions} \begin{itemize} \item First Item \item Second Item \end{itemize} \end{block} \end{column} \begin{column}{.5\linewidth} \begin{block}{Approach} \begin{itemize} \item First Item \item Second Item \end{itemize} \end{block} \end{column} \end{columns}  \end{frame} \end{document}   My local installation and ShareLaTeX would misalign the bullets(baselines added by me):   This problem seems similar to:        But this time it happens when itemize is inside the block. If one removes the blocks it works fine.  Am I missing something or does it look like a Beamer bug?  Thanks! I'm a LaTeX noob, sorry if I missed something stupid.


Show that $\left(\int_0^1 f(x)\,dx\right)^2\leq2\int_0^1x\, f(x)^2\,dx $

Let $f$ be a nondecreasing, integrable, function defined on $[0, 1]$. Show that $$\left(\int_0^1 f(x)\,dx\right)^2\leq2\int_0^1x \,f(x)^2\,dx $$


BPY import/append .blend asset from another file? ( ideally by clicking a button)

How to automate the process in Python of importing any one out of 10 assets from another .blend file? (ideally by clicking a button) I am trying to use append, but I am not so sure about the correct syntax.


Test if two binomial distribution are significantly different from each other

I obtained two groups of data from my experiment and calculated the binomial distribution for each group, trying to see if they are significantly different from each other. However, the z sore I got was way smaller than -4, which was a little bit odd to me. Here is how I did my calculation:  The control group: # of trails n1=34; # of successes k1=2, success rate p1=2/34=5.9% The experimental group: # of trails n2=25; # of successes k2=2, success rate p2=2/25=8.0%  average p=6.8% standard error=0.0044 test statistic z=(5.9%-8%)/standard error=-4.77 It's a two-tailed test. I couldn't find a p-value corresponding to the z score I got (-4.77) on the table. Does that mean my p-value was just really small or I made mistakes here?


I am currently trying to understand the Fermi's golden rule.   We consider a system with Hamiltonian: $$\hat H = \hat H_0 + \hat Ue^{i \omega t},$$ where the expectation value of $\hat U$ i much smaller than that of $\hat H_0$.  At $t=0$ the systems is in the ground state $\lvert 0 \rangle$ of $\hat H_0$ (we assume that $\hat H_0$ has discrete spectrum). Using first-order, time dependent perturbation theory, we obtain probability of the system being in the state $\lvert n \rangle$ after time $t$: $$\lvert c_n(t) \rvert^2 = \frac{1}{\hbar^2} \lvert \langle n \rvert \hat U \lvert 0 \rangle \rvert^2 \frac{\sin^2 \left(\frac{(\omega_n - \omega_0 - \omega) t}{2} \right)}{(\frac{\omega_n - \omega_0 - \omega}{2})^2}.$$ As far as I understand, this is the probability (not probability density) that we find the system in a state $\lvert n \rangle$ after time $t$ (if we for example turn off the time dependent potential and measure energy of the system). Now, according to my notes, if we take the limit as $t \to \infty$, this probability tends to: $$\lvert c_n(t) \rvert^2 = \frac{2\pi t}{\hbar^2} \lvert \langle n \rvert \hat U \lvert 0 \rangle \rvert^2 \delta(\omega_n - \omega_0 - \omega).$$ This expression is infinite (undefined?) when $\omega_n - \omega_0 - \omega = 0$. However, even after a very long time the transition probability should be finite (and while we're at it, than one).  I would normally expect to see dirac delta when dealing with probability densities , however as I mentioned before we are considering transitions between discrete states, so Kronecker delta is what I would expect to see here.  My question is, what am I missing here?


Advice on management of large MySQL database

I've inherited responsibility for a 400GB MySQL database that is hosted in Amazon RDS.  The DB serves an application that relies intensively on DB operations, so version releases frequently involve running ALTER statements on very large tables. These updates take over 24 hours to run.  Typically, we make a snapshot of the production RDS instance, restore it to a temporary instance, run the migration on that and then rename it so that the apps start connecting to it as the Production DB.   The obvious difficulty in this is that during the 24+ hour upgrade, we have to keep both DBs in sync, which means data has to be loaded to the application twice, which is a major headache.  I'm convinced there is a better way to do this (albeit I'm aware of the limitations of RDS), but I can't see find a solution.  The DB can't be live while it is being altered, but the alteration takes forever.  Anyone have similarly experience, or should I just learn to live with it?


I am trying to pull logs and doing few others things directly. written a small line BASH but not working. I am sure thats with IF Condition.    sed -rne '/21:25:07/,/21:50:07/ p'  server.log.2015-04-21 > /tmp/filename.log ; du -sh  /tmp/filename.log ;  if [`du -sh  /tmp/filename.log` -gt 0] then gzip /tmp/filename.log ;


Long code snippets that are relevant to the question

. (See comments to the question: the OP tried to include a couple of long XML files, but that wasn't possible.)  What's the recommended approach to including code/data, when there's just too much of it to embed in the question?  I could think of a few approaches myself:   Paste the data to a pastebin and link (and wait for the links to die) Encode the (compressed) data in an image and include that (kludgy!) Implement an attachment feature in Stack Overflow (which will probably be abused)


Is using the phrase "... is left as an exercise for the reader" considered good style in academic papers/theses?

Possible arguments:  Pro   For brevity for trivial deductions   Contra   Looks like the writer could not be bothered to write an extensive explanation Definition of what is trivial to which reader and what not


Seeking World War 1 military record Antonio Alphonso Ferrari of Italy

I am seeking any records of my grandfather who fought on the italian side in World War 1.  His name was Antonio Alphonso Ferrari.  His fathers name was Felice ferrari and his mothers name was Dorothea Caruso.  His birthdate is October 1892.


I have a couple of NTP Stratum 2 servers, and these are in sync with a Stratum 1 GPS appliance, and also peered between them selves. I would be interested in creating a job, which will create an alert if the time difference between Stratum 1 and Stratum 2 goes off by X seconds etc. I appreciate any help on this..  Thanks


How to check if an embedded SVG document is loaded in an html page?

I need to edit (using javascript) an SVG document embedded in an html page.  When the SVG is loaded, I can access the dom of the SVG and its elements. But I am not able to know if the SVG dom is ready or not, so I cant' perform default actions on the SVG when the html page is loaded.  To access the SVG dom, I use this code:  var svg = document.getElementById("chart").getSVGDocument();   where "chart" is the id of the embed element.  If I try to access the SVG when the html document is ready, in this way:  jQuery(document).ready( function() { var svg = document.getElementById("chart").getSVGDocument(); ...   svg is always null. I just need to know when it is not null, so I can start manipulate it. Do you know if there is a way to do it?


I've just taken delivery of a Dell XPS 13 notebook with Ubuntu 14.04 installed. I set out to install SSH and found and installed openssh-client from the repositories with no problem. But when I try to install openssh-server, I'm notified that it can't be found in the repositories.  I've checked main, universe, and multiverse in the software center to no ail. Tried to get help from Dell tech support, got bounced around to Canonical support, only to be told that I needed to a member of some support program I've never heard of and am not particularly interested in.  Can any kinds soul please point the way to a successful openssh-server install?


One thread class, different implementations of its run method?

I have a thread Class that implements Thread. I want to have 3 instances of this class and each of these instances has different implementation of the run method of the thread class. Can i do that? I tried passing parameters to the run method, but no luck. This is what ive tried so far.   class thread extends Thread{     int reelValue;     JButton name;     boolean stop;     Reel r;     int k;      thread(int reelValue, JButton name, boolean stop, Reel r, int k){         this.name = name;         this.reelValue = reelValue;         this.stop = stop;         this.r = r;         this.k = k;     }     public void run(){         r = new Reel();         while (!stop){              k = ThreadLocalRandom.current().nextInt(0, 5 + 1);             name.setIcon(r.symbols.get(k).getImage());             reelValue = r.symbols.get(k).getValue();             try {                 sleep(100);             } catch (InterruptedException e) {                 e.printStackTrace();             }         }      }  }  public static void main(String[]args) {     thread t1 = new thread(reelOneValue, reel1,stopT1, r1, a);     thread t2 = new thread(reelTwoValue, reel2, stopT2, r2, b);     thread t3 = new thread(reelThreeValue, reel3, stopT3, r3, c);      t1.start();     t2.start();     t3.start(); }


Insect identification - Is this a bedbug?

This bug was found on a couch in . The couch, and the two beds in the room show no signs of other bugs. Is this a bed bug that I should worry about or something harmless? It was slightly larger than a common tick.


Alarm is working even when the phone is powered off

I just discovered that if I set the alarm clock and then power off the phone (by holding the power button and then selecting "Power Off") the alarm will still go off when the time comes.  Is this expected behavior? It makes me feel like "power off" doesn't actually power off the phone.  I have a Huawei Y530-U051 running android 4.3.


New to HTML. I have this code in css  h1 {text-align: center; background: white; }   I wanted to make a white background only on my text, but the color is from the one end of the page to the other. I want the background to be same width as my text. Any advices ?


Why do you need 2 resistors when hooking up a transistor as a switch

What is the point of R2 in the following diagram:   I get that R1 controls the current to the Base, but what does R2 do?


find all continous functions$$f(f(x+y))=f(x)+f(y)$$  My try:setting $y=0$ $$f(f(x))=f(x)+k$$ where $k=f(0)$ hence:let $f(x)=t$,$$f(t)=t+k$$ alternatively:$$f(x)=x+C$$ My question:1)Have i got all solutions?I think i am missing a generalised one. 2)does the word continous mean any thing important. I mean if they had not mentioned will there be more functions?


So this doesn't work:      List<Object> j;       List<String> k =new  List<String>();     j =  k;   Nor does this:      j = (List<Object>)k;   or this:     k = j as List<Object>;    It seems like these ought to be assignable, but not sure how is the right way to achieve the result


Why use definition lists (DL,DD,DT) tags for HTML forms instead of tables?

I've come across a few examples recently that do things like:

Full Name:

<input type="text" name="fullname">

Email Address:

<input type="text" name="email">

   for doing HTML forms.  Why is that?  What is the advantage over using tables?


If the universe is closed, does the twin paradox really matter?

By closed universe, I mean just something like 3-D analog of a closed ring or a sphere.  I think it can be one of arguments that the universe must not be closed. Is that right? The paradox is just the fruit of man's imagination that does not actually exist.


That's it. If you want to document a function or a class, you put a string just after the definition. For instance:  def foo():     """This function does nothing."""     pass   But what about a module? How can I document what a file.py does?


Prove that $\tan x \geq x + \frac{x^3}{3}$ for $x \in [0, \frac{\pi}{2})$

I am teaching someone basic real analysis. Working through the past exams, they've found the following problem:  Prove that $\tan x \geq x + \dfrac{x^3}{3}$ for $x \in \left[0, \dfrac{\pi}{2}\right)$.  What's the simplest way to prove it? I've found two possible solutions, but both seem too complex for the course level:   Use Taylor expansion of the $\tan$ function. While Taylor series were covered in the course, this specific one was not. Plug $x = \arctan y$, and prove that $f(y) = y - \arctan y - \dfrac{\arctan^3 y}{3}$ is monotonically increasing through derivation. This works, but it's also fairly tricky.   Is there a simpler solution that I am missing?


Generating function for the partition function

Could someone explain what is the reasoning behind the following equality? Or maybe direct me to a proof of the following equality?  $$\sum_{n=0}^{\infty}p(n)x^n = \prod_{k=1}^{\infty}(1-x^k)^{-1}$$ where $\sum_{n=0}^{\infty}p(n)x^n$ is the generating function for the partition function.


Linear Transformations: Proving 1 dimensional subspace goes to 1 dimensional

I am having trouble understanding this whole question, and how to prove it.  Let $F:\mathbb{R}^n\to\mathbb{R}^m$ be a linear transformation. Prove that if $L$ is a $1$-dimensional subspace of $\mathbb{R}^n$, then  $F(L)=\{y\in\mathbb{R}^m: y=F(x)\text{ for some }x\in L\}$  the image of $L$ under $F$ is a subspace of $\mathbb{R}^m$ with dimension $1$ or $0$. Hence prove that if the kernel of $F$ is $\{0\}$, then the image of $L$ is a $1$-dimensional subspace of $\mathbb{R}^m$ (and so, in this case, $F$ takes lines in $\mathbb{R}^n$ to lines in $\mathbb{R}^m$).


Bug in editing questions when reviewing a queue

When I view the  in the review queue and click "Edit", it takes me to the top of the page, and does nothing.  However, when I open it up as a regular page, then clicking "Edit" gives the following error:     Another edit is awaiting approval for this post. Further edits cannot be submitted until the pending edit is reviewed.   Even if this edit goes through by the time you view this, this should be a replicatable bug.


Cannot flag duplicate question if it has the identical title

are identical posts. I tried to flag the second as a duplicate of the first, but couldn't because it claimed: "Your search returned no matches; please try a different search":


I'm new to circuit analysis and I'm stuck on this question. My question is: What could I do, or what steps should I take to solve this kind of circuit?    What the question asks is basically the current going through resistor $R_2$, using nodal current analysis just gives me a bunch of equations and I can't use voltage analysis, finally I tried to do the equivalent resistance using the Wye-Delta transformation of the circuit and find that overall node is subject to a voltage of $45 \;\text{V}$ but what do I do with that?


Nginx rules for subdomain multisite install (Bedrock)

I'm trying to move an existing Bedrock based multisite instance to nginx and am having difficulty getting a set of nginx rules to mimic the original .htaccess. Bedrock places the crux of the files in a wp/ subdirectory, but the urls still need to be accessible from the root domain.  The .htaccess is here as follows:  RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L]  # add a trailing slash to /wp-admin RewriteRule ^wp-admin$ wp-admin/ [R=301,L]  RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^ - [L] RewriteRule ^(wp-(content|admin|includes).*) wp/$1 [L] RewriteRule ^(.*\.php)$ wp/$1 [L] RewriteRule . index.php [L]   I need these at least as nginx conf rules or preferably nginx vhost rules.


Michelson interferometer interference pattern

My friend and I recently did an experiment on Lasers where we shot a laser beam through a Michelson interferometer and observed the interference pattern on the wall. Here is the basic setup:    One basic thing we don't understand is why when the two arms of the Michelson interferometer are at the same distance, there is a spherical interference pattern. When we block one of the paths, we see a single dot of red light on the wall. It seems like when you unblock both paths, the two beams should constructively interfere, and a dot of red light of higher intensity would appear. But our observations show the circular interference pattern we mentioned earlier. So what is actually the correct model for the laser light?  I read the following link:  and I don't completely understand it.  The main thing I don't understand about the link is even if the two wave fronts have different curvatures, if you look at a particular point on the wall, shouldn't the waves have traveled the same distance on the two paths? Or perhaps I'm misunderstanding where the wave front on each path first gains some curvature.


Mapping array of numeric strings to integers returns NaN

I'm trying to convert an array of numeric strings to integers, and am seeing something odd.     const ints = ['1','2','3'].map(parseInt); console.log(ints);     The above code returns: [1, NaN, NaN]?  The 1 gets parsed correctly, but why are the 2 and 3 getting converted to NaN?


Distance from the surface as an input node for use with volumetric materials

I would like to create a material that has a volumetric component whose local Density depends on the depth of each volume point below the surface.   Can the information "how deep below the surface is a given point" (i.e. the intensity of red color in the figure below) be obtained directly from the material nodes, without adding extra geometry or modifiers?    I've tried using the Z component of the UV Texture Coordinate (after having assigned an UV map), and other kinds of node setups, but I couldn't find a way to obtain that quantity.    Another way of looking at it: consider that SSS can be seen as a Volume Scatter with a Density decreasing smoothly from the surface to one skin-thickness below, while an abrupt fall-off (density goes suddenly from one to zero) corresponds to a Volume Scatter applied on a mesh with a Solidify modifier.   I would like to be able to create any generic falloff profile, including these two.


Let M be some $n \times n$-Matrix.  If we have $M^{k}=I_n$ for some positiv k, is $M$ then similar to $I_n$?


Print Vector made up for structures in C++

I'm trying to print out elements of a vector that is made up of structures. Here is the definition of the vector and its contents:  struct H_Data{     double count[2];     double min, max;     list <double> Ref_Data; };  struct Histogram  {     std::vector<H_Data> H; }Hist[MAX_DIM];   Now I created a vector H and I want to print out all of its contents. I tried doing this with a for loop:  for (int i=0; i<H.size();i++){     cout << H[i] << endl; }   But I get a type error here.  ./CD.h:155:14: error: invalid operands to binary expression ('ostream' (aka   'basic_ostream<char>') and 'value_type' (aka 'H_Data'))     cout << H[i] << endl;   Any help on how to print the contents?


How do "we" get a custom warning when asking a question on a Stack Exchange site?

When I ask a question on Stack Overflow with the tag of regex, Stack Overflow greets me with this custom warning:    I'd love to create one of these for the pandas tag.  I'm assuming this is a feature that generalizes across all exchange sites.  Is there an API, or protocol to get this same behavior for another tag?  If not, can we get one?


How to find image coordinates of the rendered vertex?

I have a simple mesh of a cube.  I would like to know what are the coordinates of each vertex in the rendered image (i.e. for each 3d vertex I'd like to know it's pixel coordinates).  Is there a way to do this?  Clarification:  I'm experimenting with a pose estimation algorithm (i.e. finding out the 3d pose of the object) from a (set of) 2d image(s).  Instead of taking an image of a real object with a real camera I synthetically render the image of a cube using blender.  In this way I know the pose of the object and the intrinsics of the camera, so I can easily validate the results of the pose estimation algorithm. Pose estimation algorithms usually require to provide them with world points on the object and the corresponding image points.  So what I'm looking for is a way to produce a dump of correspondences of the 3d point <--> image point as a byproduct of the rendering procedure. Thanks, Alex


Run the file in folder called `python` not the python interpreter

I have a folder. Inside of this folder is an executable called python. When I try to run python from the terminal it instead runs the python interpreter. How can I run the file called python?


Identifying primitive types in templates

I am looking for a way to identify primitives types in a template class definition.  I mean, having this class :  template<class T> class A{ void doWork(){    if(T isPrimitiveType())      doSomething();    else      doSomethingElse();  } private: T *t;  };   Is there is any way to "implement" isPrimitiveType().


Generating uniform points inside an $m$-dimensional ball

The present question follows on from some other questions on this site asking how to generate uniform points inside a disc (see e.g., ,  and ).  The natural extension of that problem is to generate points inside an $m$-dimensional   with centre $\mathbf{c} \in \mathbb{R}^m$ and radius $r \geqslant 0$.  That is, we want to generate IID random variables from the following distribution: $$\mathbf{X} \sim \text{U}(\mathcal{B}(\mathbf{c},r)) \quad \quad \quad  \mathcal{B}(\mathbf{c},r) \equiv \Big\{ \mathbf{x} \in \mathbb{R}^m \Big| ||\mathbf{x} - \mathbf{c}|| \leqslant r \Big\}.$$ How do we generate IID uniform points on this space?  Is there a simple way to program this?


I'm trying to use MODIS to download some spatial data, but I'm not able to do it. When I try to download and process MODIS data with MODIS R package, I get this strange strsplit error.  b1 <- runGdal(product = "M.D13A2", begin = Sys.Date() - 30, tileH = 18:19, tileV = 4)  Returned: ######################## outProj          =  asIn  pixelSize        =  asIn  resamplingType   =  near  Output directory =  C:/*****************************/MOD13A2.061_20210525100758  (no 'job' name specified, generated (date/time based)) ######################## Local structure is up-to-date. Using offline information! Hm, I have to search for the file. Next time provide the full path and I'll be very fast! Error in strsplit(x, ":") : non-character argument   I don't know what is happening here.


I want to change name on train ticket to another friend

I want to change the name of the passenger on my booked train ticket from Sulekha to Gayatree for the journey to Pune. Is this possible, if so, how?


I tried to make a crouch system. In my script I changed .height and .center properties of collider in CharacterController component. But there are some problems. First, once I press "crouch button" collider is changing its height and center position but when I release the key the collider isn't returning to its previous state. Secondly, if I change its height and position by hand when collider is under a block, it's just stuck. How can I fix this problem?   Here's my script:  using System.Collections; using System.Collections.Generic; using UnityEngine;  [RequireComponent(typeof(CharacterController))] public class PlayerController : MonoBehaviour {      public float moveSpeed;     public float jumpForce;     public CharacterController controller;     public GameObject myCamera;      private Vector3 moveDirection = Vector3.zero;     public float gravityScale;      public Animator anim;      // Use this for initialization     void Start () {         transform.tag = "Player";         controller = GetComponent<CharacterController>();            }      // Update is called once per frame     void Update () {         Vector3 forwardDirection = new Vector3 (myCamera.transform.forward.x, 0, myCamera.transform.forward.z);         Vector3 sideDirection = new Vector3(myCamera.transform.right.x, 0, myCamera.transform.right.z);         forwardDirection.Normalize ();         sideDirection.Normalize ();         forwardDirection = forwardDirection * Input.GetAxis("Vertical");         sideDirection = sideDirection * Input.GetAxis("Horizontal");         Vector3 directFinal = forwardDirection + sideDirection;          if (directFinal.sqrMagnitude > 1)         {             directFinal.Normalize ();         }          if (controller.isGrounded)         {             moveDirection = new Vector3(directFinal.x, 0, directFinal.z);             moveDirection *= moveSpeed;             if (Input.GetButtonDown("Jump"))             {                 moveDirection.y = jumpForce;             }              if(Input.GetButtonDown("Crouch"))             {                 controller.height = 1f;                 controller.center = new Vector3(0f, -0.5f, 0f);                 moveSpeed = 3f;             }         }         moveDirection.y = moveDirection.y + (Physics.gravity.y * gravityScale * Time.deltaTime);         controller.Move(moveDirection * Time.deltaTime);          anim.SetBool("isGrounded", controller.isGrounded);         anim.SetFloat("Speed", (Mathf.Abs(Input.GetAxis("Vertical")) + Mathf.Abs(Input.GetAxis("Horizontal"))));     } }   Thanks for any help!


I tried to use any of the available bib entries for adding open-source projects to my CV, but none of them are of my liking. Is there a way to add this functionality to bibtex? I would be interested in somehow a nice formatting of a project (instead of everything showing up on a single line), where I could add the project title, type of license, url, etc.  I use the . A bibtex record looks like the following:  @electronic{CPCPL:AESA_v1_0,     Author = {Alejandro M. Arag{\'o}n},     Date-Added = {2014-08-13 09:40:31 +0000},     Date-Modified = {2014-08-13 09:50:19 +0000},     Howpublished = {Programming language: {\C++}; Code license: GNU Lesser GPL; Catalogue identifier: AESA\_v1\_0; Distribution format: tar.gz},     Note = {Revisions:},     Title = {cpp-array, from \textit{\uppercase{C}omput. \uppercase{P}hys. \uppercase{C}ommun.} \href{http://dx.doi.org/10.1016/j.cpc.2014.01.005}{185(2014)1681}},     Url = {http://cpc.cs.qub.ac.uk/summaries/AESA_v1_0.html},     Bdsk-Url-1 = {http://cpc.cs.qub.ac.uk/summaries/AESA_v1_0.html}}   This is what I have so far, but I'm not happy with it:


I am trying to cite all the articles in the citations.bib such like that:  \documentclass[margin,line,11pt]{res} \begin{document} \begin{resume} ... \section{\sc Selected Publications} \nocite{*} \bibliography{citations} \bibliographystyle{plain}  \end{resume}  \end{document}   But I got three errors by running BibTex uisng TexShop:  This is BibTeX, Version 0.99d (TeX Live 2013) The top-level auxiliary file: Resume_PlantGenetics.aux I found no \citation commands---while reading file Resume_PlantGenetics.aux I found no \bibdata command---while reading file Resume_PlantGenetics.aux I found no \bibstyle command---while reading file Resume_PlantGenetics.aux (There were 3 error messages)   What's wrong of my tex file? Thanks in advance.  Here is the citations.bib (just directly exported from google scholar):  @article{cai2008quantitative,   title={Quantitative trait loci for aluminum resistance in Chinese wheat landrace FSW},   author={Cai, Shibin and Bai, Gui-Hua and Zhang, Dadong},   journal={Theoretical and Applied Genetics},   volume={117},   number={1},   pages={49--56},   year={2008},   publisher={Springer} } ... @article{song2006potato,   title={Potato Virus Determined by the Improved DAS-ELISA Technique},   author={SONG, Ji-xuan and FAN, Shi-jie and DONG, Ying-ping and YAN, Qian and ZHANG, Min and ZHANG, De-yu},   journal={Guizhou Agricultural Sciences},   volume={5},   pages={028},   year={2006} }


i wish to set higher priority for my dns nameservers, or override the ones that are being set by the dhcp server. no matter which approach i took, nslookup never displays the right dns nameserver.  please see the snippet below.  $ cat /etc/*release* | grep -i dist DISTRIB_ID=Ubuntu DISTRIB_RELEASE=14.04 DISTRIB_CODENAME=trusty DISTRIB_DESCRIPTION="Ubuntu 14.04 LTS"   resolvconf:  $ cat /etc/resolvconf/resolv.conf.d/base  nameserver 208.67.222.222 nameserver 208.67.220.220 $ sudo resolvconf --enable-updates $ sudo resolvconf -u $ nslookup > server Default server: 127.0.1.1 Address: 127.0.1.1#53   dhcp:  $ tail -n 1 /etc/dhcp/dhclient.conf  supersede domain-name-servers 208.67.222.222, 208.67.220.220; $ sudo service networking restart $ nslookup > server Default server: 127.0.1.1 Address: 127.0.1.1#53   how it can be done??


How do you evaluate this integral?   $$\int_0^{\sqrt{R^2-1}}g(x)-f(x)\,\mathrm dx$$   where $f(x)=1$ and $g(x)=\sqrt{R^2-x^2}$.   Wolfram tells me I exceeded my computational limit. Mathematica gives me a long answer which is very difficult to read (for me).  EDIT: I was  to  consider instead $x=f(y)$, so: $$\int_0^{1}\sqrt{R^2-y^2}\,\mathrm dy$$


I am trying to make my document such that when you click on section or subsection titles in the main body, it will take you back to the TOC. I have implemented this as such: \makeatletter \let\oldcontentsline\contentsline% \renewcommand\contentsline[4]{%     \oldcontentsline{#1}{\smash{\raisebox{1em}{\hypertarget{toc#4}{}}}#2}{#3}{#4}}% \let\oldsection\section% \renewcommand\section[1]{%     \oldsection[#1]{\protect\hyperlink{tocsection.\thesection}{#1}}}% \let\oldsubsection\subsection% \renewcommand\subsection[1]{%     \oldsubsection[#1]{\protect\hyperlink{tocsubsection.\thesubsection}{#1}}}% \let\oldsubsubsection\subsubsection% \renewcommand\subsubsection[1]{%     \oldsubsubsection[#1]{\protect\hyperlink{tocsubsection.\thesubsection}{#1}}}% \makeatother  Although it works, at the top of my TOC I get this:  I know it has something specific to do with the \renewcommand\section, because if I change that then it works fine. How can I go about fixing this?


I need to insert a footnote for the third author, and I am using \footnotetext for it.  \author{Bleh \and Bleh Bleh \and Bleh Bleh Bleh\footnotemark} \footnotetext{Right. Works.}   This gives me the following error.  ! Incomplete \iffalse; all text was ignored after line 84. <inserted text>                  \fi    I have checked that it is introduced by footnotemark because if I remove it, it compiles.   Is there any other way to do this?


The recent SHA1 collision got me thinking.. why do we always throw out the baby with the bathwater when moving to more modern hashing algorithms?  When GIT was written, they went with SHA1 hashes because MD5 was too old and had verified collisions. It is inevitable that given enough time and effort, any current and future algorithms will have problems and eventually demonstrable collisions.  So why not just choose to combine hashing algorithms, preferably the most modern, with the second most modern? Naturally, the hash length in bits would be longer, but seems to be a better way of future-proofing a system than just "use the best at the time of writing"  Is SHA1 hash concatenated with MD5 hash more or less likely to introduce a collision?


How to implement L2 regularization towards an arbitrary point in space?

Here is something I read in Ian Goodfellow's book Deep Learning.  In the context of neural networks, "the L2 parameter norm penalty is commonly known as weight decay. This regularization strategy drives the weights closer to the origin [...]. More generally, we could regularize the parameters to be near any specific point in space" but it is far more common to regularize the model parameters toward zero. (Deep Learning, Goodfellow et al.)  I'm just curious. I understand that by simply adding a regularizing term to our cost function, and that by minimizing this total cost $J$ we can influence the model's parameters to remain small :  $$J(\boldsymbol{\Theta}, \boldsymbol{X}, \boldsymbol{y}) = L(\boldsymbol{\Theta}, \boldsymbol{X}, \boldsymbol{y}) + \lambda||\boldsymbol{w}||_{2}^{2}$$  But how would one implement a version of this regularization strategy that would lead the parameters towards any arbitrary point? (say we want the norm to tend towards 5)


How to wire Interdependent beans in Spring?

I want to declare two beans and instantiate them using Spring dependency injection?  <bean id="sessionFactory" class="SessionFactoryImpl">  <property name="entityInterceptor" ref="entityInterceptor"/> </bean>  <bean id="entityInterceptor" class="EntityInterceptorImpl">  <property name="sessionFactory" ref="sessionFactory"/> </bean>   But Spring throws an exception saying "FactoryBean which is currently in creation returned null from getObject"  Why is inter-dependent bean wiring not working here? Should i specify defferred property binding anywhere?


Consider the following sentence:     The main culprit together with his associates was/were arrested.   Which should be used, was or were?


Three reference letters, two academic and one professional

I am applying to a highly prestigious university in the UK for a PhD position. The usual norm here is that PhD's usually (unlike the US) require 2 rec letters, however this specific program asks for 3, and these 3 are for the course itself, it's not like one is for a scholarship and the other 2 are for the application, all three are for the application. The PhD is in bioelectronics/neuroscience, and I have 2 solid rec letters from my uni supervisors, so that's fine but I don't have a third one! so I'm thinking of asking my manager at an oil company I have worked at before, ofc the letter won't have as much impact as the first two, but would something like this be really bad? or really wrong? Thanks in advance for your time.


possible to access custom labels dynamically?

In apex you can reference a custom label with system.Label.labelName, but is there a more dynamic way to get a custom label for example system.Label.get(labelName)? I can't find anything like this in the documentation but was hoping it was possible.   I'm trying to have custom labels for fields to support multiple languages. The list of fields I'm showing is built in the controller and displayed inside an apex:repeat tag so I can't hardcode the labels. Is there a way to accomplish this?  Thanks!


I am making a python program which would act as windows cmd, but I need a code which will display Windows's version. [Highlighted one]    How to make it?


What filesystem to use when using both Windows and Linux?

I will be buying a 2TB hard drive soon, and would like to use it as media storage. I would like to be able to read/write from both Windows (version 7, 64bit) and Ubuntu Linux, and I need support for files greater than 4GB in size (so I think this rules out FAT32).  I'm using IFS drives at the moment to access my linux ext4 partitions, and I find it unstable. Does this mean NTFS? Is there something else I'm missing?


Sum of Consecutive Integers is equal to a given number

consecutive sum  Given an integer N, you have to find the number of ways you can express N as sum of consecutive integers. You have to use at least two integers.  For example, N = 15 has three solutions, (1+2+3+4+5), (4+5+6), (7+8).


The usage of "could" and "can" in questions

Which of the following is more appropriate?   Can you go?  Could you go?    Is there anything wrong in asking like this "Could you go?"


Is the following scheme for generating $p_n=(1/3)^n$ stable or not. $p_n=(5/6)p_{n-1}-(1/6)p_{n-2}$.

Is the scheme for generating $p_n=(1/3)^n$ stable or not?  $$p_n= \frac{5}{6} p_{n-1} - \frac{1}{6}p_{n-2}.$$


How to get the upper triangular form for any linear map?

Let $T:V \to V$ be linear. $V$ is a complex vector space of dimension $k$. Then there exists a basis so that the matrix generated by $T$ under that basis is upper triangular. The proof is by induction on $k$.   But how to generate such a basis. The first step is that because $v$ is a complex vector space, so there exists a non-zero vector $v$ such that $Tv=\lambda v$ for some $\lambda \in \Bbb F$. So, take $e_1=v$ because then $T(e_1)=\lambda e_1$. So, in the first column of the matrix the rows 2 to n will be zero. Now if I extend $e_1$ to any basis of $v$ that basis may not be a basis for which the matrix is upper triangular. Then how to construct it ?


Rotating an object continously with OnMouseDown

I have a script that works but it does not do what I want it to do. My script makes an object rotate on when another is clicked. However, I want the object to continuously rotate until I click on the other object again. Right now when I click it rotates just a bit and stops.  Here is my script:   public class Rotate : MonoBehaviour {     public float speed =50f;     public GameObject target;      public void OnMouseDown(){        target.transform.Rotate (new Vector3(0, Time.deltaTime, 0) * speed);     }  }   How can I make the object rotate continuously until I click it again?


i believe that double have x2 precision of float . in my calculator 10/3 is 3.3333333333333333333333333333333 when i do the following code : #include <stdlib.h> #include <stdio.h>   void main() {       double var = (double )10 / (double )3;     float var2 = (float )10 / (float )3;       printf("%f %f \n" , var , var2 );  }  i get the same number of digits after 3, : 3.3333333333333335 3.3333332538604736 why do i get the same number of digits? and why the value is different ? and how to do a division for double and float and get all the numbers and digits in c (like in my calculator) ?


Java - Invoke selective super class method possible?

I am using inherited codes which cannot be modified. It is being overrided many times. I want to invoke a specific overrided method of a super class (not a direct super class).   public class SuperSuperClass {   ...   public doSomething()   {      //Does something that I want   } }  public class SuperClass extends SuperSuperClass {   ...   public doSomething()   {      //Does something I do not want      super.doSomething();   } }  public class SubClass extends SuperClass {   ...   public doSomething()   {     SuperSuperClass.doSomething();  // is this possible?   } }   The SuperClass.doSomething() does something I do not want before itself calling SuperSuperClass.doSomething(). Is there a way I can invoke SuperSuperClass.doSomething() from SubClass?


How to calculate area percentage from polygons from one shapefile within another?

I'm working on a project where I have to create python code that takes land-use data and adds a percentage field for each land-use category in a Census Tract shapefile. I've been trying to work with the steps manually in ArcGIS before developing the code, but I've had problems getting there.  Basically, I have a land-use shapefile with over 100,000 parcels categorized by land-use category (i.e., Residential, Commercial, etc.) as well as a Census tract shapefile. Within the Census Tract shapefile, I need to add a field with the percentage of area of each land-use category to be applied to each individual Census tract.  I've been working on this for hours and haven't gotten far at all. Could anyone offer any insight as to some steps I should try? I've tried intersecting, dissolving, joining tables (does not work) and more to no avail.


Conservation of energy in quantum teleportation

Consider the  of Bennett et. al. How does one prove that this protocol would never violate the conservation of energy? At the face of it, it doesn't seem to be something obvious, as the various measurements, communications, rotations etc. don't seem to be able to account for the differences in the Hamiltonians of Alice's and Bob's labs. The state $\psi$ might have an expected energy $E_1$ in Alice's lab and a completely different expected energy $E_2$ in Bob's. Where does the difference come from?


What part of an RSA key is referred to by the number of bits?

When we speak about 4096- or 2048-bit RSA keys, what part of the key is this number of bits? The public key comprises both the modulus and the public exponent, and the strength of the key can also be seen as depending on the length of the prime factors. Which of these is the "4096-bit" part?


how to bend straight faces to make a curve

I would like to bend this part, so it looks like a nice curve. But instead it is grabbing this whole part. I added a curve on picture, so that it is easier to understand what I want to achieve as a result. Bend this part alongside with curve  Here is a file to better understand my issue   Thank you very much for your help


Finite subgroups of the multiplicative group of a field are cyclic

In Grove's book Algebra, Proposition 3.7 at page 94 is the following     If $G$ is a finite subgroup of the multiplicative group $F^*$ of a field $F$,   then $G$ is cyclic.   He starts the proof by saying "Since $G$ is the direct product of its Sylow subgroups ...". But this is only true if the Sylow subgroups of $G$ are all normal. How do we know this?


What is Easiest Way to Change URL Structure of Dynamic PHP Website?

I am a SEO guy and always facing this problem, that PHP sites make dynamic URL with IDs. This is not SEO friendly structure—like this /article.php?id=2987—and need to be changed like this /why-to-hire-a-seo-specialist. Is their any easiest way to change this type of URL structure?


Is it okay to use the word "Negro" in a paper if it is in a quote?

I am writing a paper for a 7th grade writing assignment. We have to quote our books and one of my quotes uses the word "Negro" and I do not know if I should put that in my paper or if I should put asterisks instead. (If it helps the book is "To Kill a Mockingbird" by Harper Lee)


Remove comma behind author for textcite only

I have recently moved from the authoryear style to authoryear-comp (). However now commas appear behind the the authorlist regardless of  whether \citet or \citep are used:      (Doe etal., 2002) for \citep and Doe etal., (2002)  for \citet   For the latter this is wanted, for the former it just look ugly. How do I get rid of that comma?  I know that I can redefine nameyeardelim but that removes the comma for both cases.  MWE:   \documentclass[a4paper,11pt]{scrartcl}  \usepackage{hyperref} \usepackage[natbib = true,     style = authoryear-comp,     backend = biber,           hyperref = true,        giveninits = true,     maxbibnames = 8, maxcitenames = 2,     uniquename=false,     uniquelist = minyear,     doi = false, url = false, isbn = false, eprint = false]     {biblatex} % \addbibresource{example.bib}  \begin{document}     some text about \citet{Doe1999, Doe2002, Doe2004}, where \citet{Doe1999} are referenced and others \citep{Doe2002}      \printbibliography \end{document}   bibliography:  @Article{Doe2002,   author  = {John Doe and Albert Miller and Jack Frost and Gregor Smith},   title   = {Paper 2},   journal = {Journal of Best Research},   year    = {2002}, }  @Article{Doe2004,   author  = {John Doe and Jack Frost and Albert Miller},   title   = {Paper 3},   journal = {Journal of Cool Research},   year    = {2004}, }  @Article{Doe1999,   author  = {John Doe and Albert Miller and Jack Frost},   title   = {Paper 1},   journal = {Journal of New Research},   year    = {1999}, }   Desired output would look like the following   \citep: (Doe etal., 2002) \citet: Doe etal. (2002)


Using while loop, issue with referencing from static context

Currently I am working on an assignment within BlueJ. The question I have is simple (I hope). The method I wish to use within the while loop is "getRearWheelDrive()" which checks how many Lamborghinis within the ArrayList< Lamborghini > inventory have rear wheel drive. rearWheelDrive is a boolean variable.   Also I can not use a for-loop for this question, otherwise I would as it would be much easier. I am limited to the while loop.  The error message I receive is: "non-static method getIsRearWheelDrive() cannot be referenced from a static context"  -I tried to create a  static method but it didn't work either.  //  How do I check all the Lamborghini objects within the ArrayList library and then return an int value of how many total have rearWheelDrive? Also with the current code I have, would it cause the loop to finish once it got to the end of the index, or would it infinitely loop?  public int howManyAreRearWheelDrive() {     int indexPlace = 0;     int number = 0;     int i = 0;      while(indexPlace <= inventory.size())      {         indexPlace++;         inventory.get(i);         i++;          if(Lamborghini.getIsRearWheelDrive() == true) {             number++;         }     }     return number;  }


How do I add attributes to CSS in theme.info?

I'm try to add a stylesheet switcher.  This requires the following CSS files to be included on the site. <link rel="stylesheet" type="text/css" href="styles1.css" title="styles1" media="screen" /> <link rel="alternate stylesheet" type="text/css" href="styles2.css" title="styles2" media="screen" /> <link rel="alternate stylesheet" type="text/css" href="styles3.css" title="styles3" media="screen" />  theme.info reference some CSS files. How can I a rel and title attributes? stylesheets[all][] = common/css/small.css stylesheets[all][] = common/css/medium.css stylesheets[all][] = common/css/large.css


numbers x such that the sum of the divisors is a perfect square

Hello I am reading "The Theory of Numbers, by Robert D. Carmichael" and stuck in an exercise problem,  Find numbers x such that the sum of the divisors of x is a perfect square.  I know sum of divisors of a x=$p_1^{\alpha_1}.p_2^{\alpha_2}....p_i^{\alpha_i}$ is  Sum of divisors = $\prod{\frac{p_i^{\alpha_i+1}-1}{p_i-1}}$  But couldn't proceed further on how resolve the product in to X2  It will be helpful if someone supply some hints


How can one verify the equivalence between the geometric and algebraic definitions of an ellipse/hyperbola?

I was recently introduced to the world of conic sections, and I came across two different "definitions" for an ellipse and a hyperbola. I was wondering if there was an easy way to prove that they happen to be "equivalent". First, it was established that: Given a line $r$, a point $F$ not in $r$, and $e \in \mathbb R^+_*$, an ellipse/hyperbola is the locus of the points $P \in \mathbb R^2$ such that $\overline{PF} = e\overline{Pr}$ (where $e<1$ for the ellipse and $e>1$ for the hyperbola) What I would like to verify is that the set of points $\bigg\{(x,y) \in \mathbb R^2: \dfrac{x^2}{a^2} \pm \dfrac{y^2}{b^2} =1\bigg\}$ satisfy the definition given. Any thoughts? Thanks in advance.


Single polygon shapefile to multiple polygon shapefiles

I created a single shapefile that contains multiple polygons by selection by location of the route I had and the ESRI USA counties polygon layer to give me the counties that were in the area I was interested in.  I want to know if there is a tool to use that can take that new shapefile I created of only the new polygons in my area of interest into an individual shapefile for each county.  So say there were 25 counties that crossed my route, I'd like to have a quick way to get shapefiles individually for each 25 counties.  I'm sure there is a quick script for this, but I'm not too familiar with scripts didn't know if there was quick easy way for this than exporting each individually into shapefiles.     I'm also using ArcMap 10.2


Prove the following equation(much needed help):

Let there be a given function $f \in C([0,1])$, $f(x)>0$; $x\in [0,1]$. Prove   $$\lim_{n\to\infty} \sqrt[n]{f\left({1\over n}\right)f\left({2\over n}\right)\cdots f\left({n\over n}\right)}=e^{\int_0^1 \log f(x) \, dx} $$  All the questions before this required solving an definite integral without Newton Leibnitz formula, then this came up, can anyone provide help?