I ran into a problem. If I render on a transparent background, then the output volume is almost invisible.  As you can see, the fire after the render almost disappears. :(  That is, I try to get the result like on the left preview  In addition: If I remove the transparency, everything becomes normal, but the point is to get a tank with a shot on a transparent background    Thank you in advance! If something is wrong, feel free to edit

Bit of an issue here, trying to render this glass scene    Looks fine in the viewport, but when I hit render    Does anyone know the cause of different view port and final render, and how to fix it?  Here's my


I have a game I'm making in Unity and now I'm stuck on saving. Is it possible to program a game to resume where it left off when you quit? Every time I search for this on Google I get nothing. Can anyone tell me if this is possible or not? And if it is how would I do it?

I am making a game using the Unity game engine. I want to save the player's progress including level, experience points, chosen character, etc. Presently I am using playerprefs but I want to know whether this will work for gamers who will run this game on their mobile devices (Android/iOS) as well as desktops (OSX/PCs)? If not, then how should I save this information? I want to auto-save player progress after clearing each stage.


I have a Rest Web Service class that exposing Get Function. I am trying to get the entire URL of the request to save it in logs. According to the  I could get it, without beginning of the URL, with : req.requestURI  But when I use it, I only get 'Account/' if I take as example the Get function in the documentation, without base URL and without parameters. So the question is how I can get the entire URL of the Request including base URL and Parameters? for example:  https://myDev.my.salesforce.com/services/apexrest/GetAccountInfo?IdNumber=1561&AddressId=53812245&Apartment=8

I have set up an apex class as a REST endpoint for an HTTP GET request that an external system is sending. We're having some trouble with it and they want me to send them the request detail. How do I get the full URL with the querystring appended so I can System.debug it and send it to them?  Also are there any other useful methods that return information I/they can use?  The REST class has one HTTPGet method:  @RestResource(urlMapping='/smscallback') global class SMSCallbackController {     @HttpGet     global static String doGet() {      System.debug(RestContext.request.requestBody);      String g_transactionId = RestContext.request.params.get('tranid');     String g_messageGuid = RestContext.request.params.get('messageguid');     String g_recipient = RestContext.request.params.get('recipient');     String g_statusId = RestContext.request.params.get('statusid');     String g_datetime = RestContext.request.params.get('datetime');     String g_clientRef = RestContext.request.params.get('clientref');      System.debug('Transaction ID: ' + g_transactionId);     System.debug('Message GUID: ' + g_messageGuid);     System.debug('Recipient: ' + g_recipient);     System.debug('Status: ' + g_statusId);     System.debug('Date/Time: ' + g_datetime);     System.debug('Security Ref: ' + g_clientRef);      SMS_Message__c relatedRecord;      //check record exists     try {         relatedRecord = [SELECT Transaction_ID__c, Recipient_Phone__c, Salt__c FROM SMS_Message__c WHERE Transaction_ID__c = :g_transactionId AND Recipient_Phone__c = :g_recipient LIMIT 1];     } catch (Exception e) {         System.debug(e);          RestResponse res = RestContext.response;         res.addHeader('Content-Type', 'application/json');          String jsonResponse = '';         res.statusCode = 500;         jsonResponse = '{"response": {"status": "Failed", "message":"Server Error."}}';         res.responseBody = blob.valueOf(jsonResponse);          return 'No matching transaction found!';     }      //check hash     g_clientref = EncodingUtil.urlDecode(g_clientref, 'UTF-8');      String valueToHash = relatedRecord.Recipient_Phone__c + String.valueOf(relatedRecord.Salt__c);     Blob b = Crypto.generateDigest('SHA-256', Blob.valueOf(valueToHash));      if (g_clientref == EncodingUtil.base64Encode(b)) {         //if hash matches, set delivery code and received time         relatedRecord.Delivery_Status_Code__c = g_statusId;          String dtStr = g_datetime + '+01:00';         System.debug('Date/Time string to save:' + dtStr);         Datetime dt = (Datetime)json.deserialize('"' + dtStr + '"', datetime.class);         System.debug('Date/Time to save:' + String.valueOf(dt));         System.debug('hour(): ' + dt.hour());         System.debug('hourGmt(): ' + dt.hourGmt());         relatedRecord.Receipt_Received_At__c = dt;          relatedRecord.Message_GUID__c = g_messageGuid;         update relatedRecord;          RestResponse res = RestContext.response;         res.addHeader('Content-Type', 'application/json');          String jsonResponse = '';         res.statusCode = 200;         jsonResponse = '{"response": {"status": "Success", "message":"Received."}}';         res.responseBody = blob.valueOf(jsonResponse);          return 'Message details successfully updated!';     } else {         //hash does not match         return 'Security does not match!';     }               }   }


I made a recursive method to find the least number of rallies that could be played before one or another team wins with given points team should score to win - k,  current points of two teams - x and y.  So it looked like  public static int scores(int k, int x, int y, int rally) {     if (x==k || y==k)         return rally;     else {         rally++;         return Math.min(scores(k, x + 1, y, rally), scores(k, x,y+1,rally));     } }   When I called this method with custom values in main method  scores(5,0,0,0)   It worked fine. But when I changed IF statement to check that the winner has at least two-point margin   if ((x==k || y==k) && Math.abs(x-y)>=2)   The program showed java.lang.StackOverflowError  I am extremely bad at this, please help me

What is a StackOverflowError, what causes it, and how should I deal with them?


I want to install perl module CAM::PDF for Linux. Can somebody please suggest that how can this be done? I was unable to find any place where I could download this module from.

I get this error:  Can't locate Foo.pm in @INC  Is there an easier way to install it than downloading, untarring, making, etc?


On the normal website, once you have submitted a suggested edit, you can just click [edit] again to improve it. This does not seem to be possible on the mobile version of the website. Especially given that there's no 'preview' option on mobile, it sometimes happens that the formatting can be improved, like here (expletive has been grayed out):    It shouldn't be hard to show an [edit] link between the [share] and [flag] links, like the normal site.

When you have less than 2K rep and your edit goes in a queue, you are usually allowed to revise your edit while it is being reviewed, by clicking the edit button again on the question page. However, when on mobile SE sites, the edit button disappears when you have submitted an edit for review.    Editing  by  into the question: It seems that the cause of this is when the mobile site hides the edit link (when there is a pending edit), it doesn't check who is making the edit, which means that it hides it for your own as well as other's edits.


The current version of supported GCC on Ubuntu 16.04.3 LTS is 5.4 version and the latest GCC version is already at 7.0. So can we expect a newer version of GCC in Ubuntu 18.04 LTS?

Why are packages in the official Ubuntu repositories older than the latest (upstream) versions from Debian Sid, PPAs, the authors, etc.?


I don’t know how old this tire is. There are small cracks along the sides. In the inside the rubber coating is stripping and peeling. Is this tire still usable? Air has been going out of my tube rapidly lately, in about a day, but I’m not sure it’s from a puncture, maybe a bad valve.

The treads on my road bike's 28C tires are almost completely gone—they only persist along the shoulders of the tire.  Do the treads matter?  What is a good indicator of when the tire as a whole needs to be replaced?


I have a big table with a problem, when I want to rotate the text in a \multirow cell, the text is placed outside and is bigger than the dimensions of the cell, I took some advice from here, using\parbox, and then \rotatebox. But I don't get good results.           \documentclass{article}  \usepackage{array,multirow,graphicx}  \begin{document}  \begin{table}[H]  \centering  \begin{tabular}{|c|l|r|r|r|r|}  \hline  & \multicolumn{1}{|c|}{Text} & \multicolumn{1}{|c|}{Text} & \multicolumn{1}{|c|}{Text} & \multicolumn{1}{|c|}{Text} & \multicolumn{1}{|c|}{text}\\  \hline  \rotatebox{90}{\parbox{2mm}{\multirow{3}{*}{rota}}} & text &&&&\\  & text &&&&\\  & text &&&&\\  \hline  \end{tabular}  \end{table}  \end{document}   Which results in:


The question is a Multiple choice question   Let $X$ be a random variable with the M.G.F. $$M_{X}(t) = \frac{6}{\pi^{2}}\sum_{n\ge1}\frac{e^{\frac{t^2}{2n}}}{n^2}\,,\;t\in R$$ Then $P(X \in Q)$, where $\,Q$ is the set of rational nos., equals  The options are  0 1/4 1/2 3/4  The correct option is option 1.) i.e. 0 I'm looking for an explanation as to how did they deduce the answer to zero.

I was thinking whether I can replace this sum by an integral , because I can't think of a distribution whose mgf looks like this. Please Help!


I am considering a stochastic variable X that is standard normal distributed i.e. $$ F_X(x) = \int_{-\infty}^x\frac{1}{\sqrt{2\pi}}e^{-\frac{t^2}{2}}dt $$ How do I find out the distribution of $X^2$?  /Gus

Suppose that $Z\sim N(0,1)$ and let $V=Z^2$.  Prove that $V\sim \chi^2(1)$.  I want to use the method of moment generating functions, because I already understand the proof using the method of distribution functions.  I will show my work, and then where I got stuck.  Since $Z\sim N(0,1)$, then $\mu=0$ and $\sigma^2=1$, and we have  $$M_V(t) =E[e^{tV}]=E[e^{tZ^2}]=\int_{-\infty}^\infty e^{tz^2}\frac{1}{\sqrt{2\pi}}e^{-\frac{1}{2}z^2}dz=\int_{-\infty}^\infty \frac{1}{\sqrt{2\pi}}e^{z^2(t-\frac{1}{2})}dz.$$  At this point, I'm out of ideas.  I want to eventually get something that looks like $\frac{1}{(1-2t)^{\frac{1}{2}}}$.  Could I get a hint please?


I need to compare some strings in Javascript, and check if a string is at the end or in the middle.  Example : If by searching for people named "Depp" I get  ["Bob Deppo", "Johnny Depp"]   then the ordered output should be  ["Johnny Depp", "Bob Deppo"]   Basically I am looking for am way to verify the existence of a substring at the end of another string. Something like :  people.sort(function(a,b){   if(a.indexOf(" Depp"+[ AND NOTHING MORE ])!== -1) return 1;  });   A few example would be :  "Johnny Depp".indexOf(" Depp"+[ AND NOTHING MORE ] !== -1 ) = TRUE "Bob Deppsomething".indexOf(" Depp"+[ AND NOTHING MORE ] !== -1 ) = FALSE   If this [AND NOTHING MORE] symbol which would signal the end of a string exists, does one for the beginning of a string also exist ?  Possible Solution (but very nasty) :  One way of doing it would be to get the index of that substring " Depp" with indexOf (6) and see if added together with the length of the substring "Depp" (5) we get the total length of the string "Johnny Depp" (11)  function atEnd(substring, string){     return (string.indexOf(substring) + substring.length == string.length); }   Not very elegant though.  So does such a [AND NOTHING MORE] symbol exist ?  Thanks !

How can I check if a string ends with a particular character in JavaScript?  Example: I have a string   var str = "mystring#";   I want to know if that string is ending with #. How can I check it?   Is there a endsWith() method in JavaScript? One solution I have is take the length of the string and get the last character and check it.   Is this the best way or there is any other way?


While watching Doctor Who, I found something that troubled me. The Daleks attempted to blow up the TARDIS; but the last time we saw the TARDIS explode it took the entire universe with it. There was another moment in which the Daleks attempted to destroy the TARDIS at the Crucible. Why did the Daleks attempt to destroy the TARDIS knowing it would blow up the universe and them along with it.

From the Cracks in time and space story arc it's known that if a TARDIS is blown up (possibly while in the Time Vortex) it rips creation itself apart. Also, from the Stolen Earth / Journey's End we learn the Daleks' masterplan which is subjugating creation itself via destroying it with the Reality Bomb (unfading Z-neutrino energy radiation).  In the Last Great Time War all sorts of temporal weapons were used and it's known that Daleks have the ability of time travel as well. Why didn't they use the Time Vortex back then to win the war once and for all via detonating a TARDIS while inside?


I see that vi -p option has a limitation that it can open only 10 files at a time. Is there any other option along with -p to address this issue ? --Harish

To open several files in separate tabs in vim I need to execute command   vim -p file1 file2   I fave directory that contains many files and I would like to open all files with extension c in vim editor.  How to make this in short and elegant way?


I've begun noticing questions that look unanswered to the standard "answered" interface, but in the question area an answer was provided fully in the form a comment or several comments.  Protocol for handling this issue was discussed here in 2010:   A potential solution to the problem was offered (and declined) here in 2009:    Looking at instances where this happens it usually involves a very short answer, a simple solution, a link out, or a conversation where the answer is acheived during member interactions in the comments (there's an example here: )  The interface is designed intentionally so that comments cannot be marked as correct answers, and marking an individual comment as a correct answer would sometimes be inappropriate or impossible (because the answer is distributed). However, there is a real need for questions answered like this to be marked as answered: the interface improperly shows the question as unanswered (leading users who may know the answer to open it needlessly, and users who may need the answer to skip the question when it could solve their issue).  So I have a feature request:  Allows the member who asked the question (or moderators and super-users) to mark a question as answered even if there are no answers provided outside of the comments field. I don't know exactly how this would be best implemented, but it would ideally allow comments that contribute to the answer to be (optionally) highlighted so that later viewers can quickly find the key bits in a long string of comments. I think such a feature would be a real improvement for the StackOverflow interface and the value of the site.

I have a question and have seen others to which the best and most relevant answer (at least the one that solved my particular problem) is placed in the comments to the question as opposed to the answers:   I would like to recognize the commenter as the person who correctly answered the question, but there doesn't seem to be any way to do that. The only thing I could think of was to ask the commenter to repost his comment as an answer, but I cannot figure out a way to contact him. In the meantime the question is sitting unanswered and I am getting other "answers" (leading me to believe that people are not reading the comments and answers already posted before trying to answer it themselves).  How are we supposed to do this?  Note: I don't want to accept the comment as an answer (I agree completely with the answers to this question that comments are comments and answers are answers and they should stay that way). I do wonder if there should be some way to contact people in a reasonable manner (comments on their profile that they must opt in to receiving in email?).


How to dual boot windows10 & ubuntu15.04? I have legacy bias mode. Every time I try to make the dual boot, it shows I have to format my full computer. I'm not sure if it'll work either. So, please help me.

I'm absolutely new to Linux. I would like to know how to install Ubuntu alongside the pre-installed Windows 8+ OS.  Should I do it with Wubi, or through the Live USB/DVD?  What steps do I need to take to correctly install Ubuntu?


In first, the one with "process id", I thought this can be done with table but don't know how.  and in the second one, I thought of equation in this but could not figure out how can I place the data outside the Matrix and also there is no representation of equation on the left side of it

How do I get an entire table to get a background color. I dont mean the indivual cells but the entire table to get a gray shade. Something like this:


If I use a 50mm prime FX lens on a FX camera, I will get 50mm. If I use a 50mm prime FX lens on a DX camera, I'll get 75mm (assuming 1.5x crop factor).   Now, if I use a 50mm prime DX lens on a DX camera, do I get 50mm or 75mm? In other words, does a 50mm prime DX lens already account for the crop factor? Does the multiple only exist for a FX lens on a DX camera?  Note that I'm asking about putting FX and DX lenses on a DX body - not putting them on a FX body. I read  but it discusses putting DX lenses on an FX body. I just want to know if 50mm is 50mm whether it's DX or FX lens; and if I put that on a FX body it'll be 50mm and DX body it'll be 75mm.  To further clarify....   I take a picture with a 50mm FX prime on a FX body I take a picture with a 50mm FX prime on a DX body I take a picture with a 50mm DX prime on a DX body   Photos 1 and 2 will be different - 2 will be zoomed by 1.5x. Will 1 and 3 be the same or will 2 and 3 be the same?

My friend has a Nikon 35mm DX lens that I want to use on my FX camera. If I use his lens on my camera in DX mode, does the effective focal length of the lens become 35mm * 1.5 = 52.5mm, or does it just take a crop of the center with an effective focal length of 35mm?


I'm new to java. I have started about 3 days ago. I want to make a line of random characters and to put them into a string. Thank you.       import java.util.Random;       public class test{       public static void main (String[]args){  final String alphabet = "abcdefghigklmnopqrstuvwxyz"; final int N = alphabet.length(); Random r = new Random();  for (int i = 0; i < 50; i++) {     String s = alphabet.charAt(r.nextInt(N));     // System.out.println(alphabet.charAt(r.nextInt(N))); }}}

I've been looking for a simple Java algorithm to generate a pseudo-random alpha-numeric string.  In my situation it would be used as a unique session/key identifier that would "likely" be unique over 500K+ generation (my needs don't really require anything much more sophisticated).    Ideally, I would be able to specify a length depending on my uniqueness needs. For example, a generated string of length 12 might look something like "AEYGF7K0DM1X".


As the title says, I didn't realize pulling the brake will get it stuck in a closed position when wheel and pads are removed. Now the reason I'm asking this  is none of the answers worked for me.  So what happened? Step by step description of the (rather long) process:   pads were worn off and started making funny noises, so I thought I'd remove them (first mistake) pulled the brake lever without any pads (second mistake) used the bike like this for a while I bought new pads, then removed the (back) wheel observed brakes stuck in a closed position, then I stupidly pulled the lever again (!)   I tried separating them with a wide range of tools, just they keep coming back in after a few seconds. Right after I stick something in between, push them apart from each other, if I wait a few seconds they are right back in the previous (wrong) position.  I'd like to know if there's anything I can do now, without bleeding the brake or anything I don't think I'm prepared for with my rather primitive tools.  Thank you all in advance for the answers, happy holidays & ride safe and fun!  EDIT: I just noticed  and its answers. I will try to leave it overnight, then attempt a bleeding if it doesn't work (I'm aware of the trapped air possibility).  EDIT #2: I attempted to spread apart the pistons again, and succeeded, then I stuck a solid piece of wood that barely fit between them. Left it like this overnight + a few hours later, then removed the wooden piece and left it free for a while. It seems the pistons got back to their normal position and all I needed was a bit of patience.  Thanks to all the people who replied on the linked questions, they really saved me some experiments and possibly more. Cheers!

I recently replaced the brake pads on my hydraulic disc brake. The brakes are a Tektro Draco 2. Now the new pads are constantly touching the rotor.     This is how it looks like with caliper unmounted. Notice the left piston is constantly sticking out:    I tried spreading the pistons with a spacer. I left it in there for 3 hours    But still, the left piston comes out again. I'm thinking about buying a service kit to bleed the system. Will that help?


Is it possible that electric or electronic devices be damaged by exposure to water if the current is turned off during their exposure to water and the electricity is switched back on only after the water is completely dried off ?

For example, say I submerged a computer mouse entirely. Assuming that I ensured that all traces of the water were gone, would the device suffer any issues?  It is my understanding currently that provided that there is no power being supplied to a device, and assuming that non-electronic damage like rust etc. hasn't taken place, then once the device is completely dry, it can be used without issue. Is this correct?


So I can clearly do this:  RewriteCond %{REQUEST_FILENAME}\.php -f   But I cannot do this:  RewriteCond some_directory/%{REQUEST_FILENAME}\.php -f   Furthermore, this also fails:  RewriteCond prefix%{REQUEST_FILENAME} -f   Presuming of course those files exist in the directory (duh!).  Apparently, I can't prepend literal strings to TestStrings in RewriteCond stanzas in Apache 2.4  Anyone know how to do this? Thanks.  Note: Prepending string literals is done in the same way as appending.  I had misattributed the problem as a limitation of the syntax.  The truth was that "REQUEST_FILENAME" expanded to the full unix path, not the HTTP requested path, as I had originally thought.  tl;dr There is no special syntax provision for prefixing string literals; they work the same way they do in shell scripting, prefix%{variable}postfix is valid syntax.  Thanks for your time.

This is a  about Apache's mod_rewrite.   Changing a request URL or redirecting users to a different URL than the one they originally requested is done using mod_rewrite. This includes such things as:   Changing HTTP to HTTPS (or the other way around) Changing a request to a page which no longer exist to a new replacement. Modifying a URL format (such as ?id=3433 to /id/3433 ) Presenting a different page based on the browser, based on the referrer, based on anything possible under the moon and sun. Anything you want to mess around with URL   Everything You Ever Wanted to Know about Mod_Rewrite Rules but Were Afraid to Ask!  How can I become an expert at writing mod_rewrite rules?   What is the fundamental format and structure of mod_rewrite rules? What form/flavor of regular expressions do I need to have a solid grasp of? What are the most common mistakes/pitfalls when writing rewrite rules? What is a good method for testing and verifying mod_rewrite rules? Are there SEO or performance implications of mod_rewrite rules I should be aware of? Are there common situations where mod_rewrite might seem like the right tool for the job but isn't? What are some common examples?   A place to test your rules  The  web site is a great place to play around with your rules and test them. It even shows the debug output so you can see what matched and what did not.


This indefinite integral has no closed form $$I(x)=\int_0^xe^{\cos(t)}dt$$ The usual expansions of $ I (x) $ are generally obtained by expanding $ e ^ x $ and integrating $ \int \cos ^ \alpha (x) dx $, thus obtaining a series in terms of the hypergeometric function. Since I am not very familiar with the hypergeometric function, and its properties are not very well known, I was wondering if there was an expansion for $ I (x) $ in terms of "more known" functions. This is my attempt: Applying the  for the composite function $f(x)=\exp(\cos(x))$ we can show that $f^{(2n+1)}(0)=0$ and $f^{(2n)}(0)$ are the number of partitions of a $2n$-set into even blocks  therefore we can express $f (x)$ with the following taylor series: $$\frac{e^{\cos(x)}}{e}=1+\sum_{n=1}^{\infty} (-1)^n\Bigg(\sum_{k=1}^{2n}\sum_{h=0}^{k-1}\frac{(-1)^h(h-k)^{2n}}{2^{k-1}k!}\binom{2k}{h} \Bigg)\frac{x^{2n}}{(2n)!}$$  $$\frac{1}{e}\int_0^xe^{\cos(t)}dt=x+\sum_{n=1}^{\infty} (-1)^n\Bigg(\sum_{k=1}^{2n}\sum_{h=0}^{k-1}\frac{(-1)^h(h-k)^{2n}}{2^{k-1}k!(2n+1)!}\binom{2k}{h} \Bigg)\frac{x^{2n+1}}{(2n)!}$$

Question:     Find out $\displaystyle{\int e^{\cos x}~dx}$.   My Attempt:  Let $\cos x = y$. Hence $-\sin x\ dx = dy$ or $$dx = \displaystyle{\frac{-dy}{\sin x}=\frac{-dy}{\sqrt{1-\cos^2x}}=\frac{-dy}{\sqrt{1-y^2}}}$$ So  $$\begin{align}\int e^{\cos x}~dx &= \int e^y\left(\frac{-dy}{\sqrt{1-y^2}}\right)\\ &=-\int\frac{e^y}{\sqrt{1-y^2}}~dy \end{align}$$  This integral is one I can't solve. I have been trying to do it for the last two days, but can't get success. I can't do it by parts because the new integral thus formed will be even more difficult to solve. I can't find out any substitution that I can make in this integral to make it simpler. Please help me solve it. Is the problem with my first substitution $y=\cos x$ or is there any other way to solve the integral $\displaystyle{\int\frac{e^y}{\sqrt{1-y^2}}~dy}$?


I use the following .Xmodmap file to map a few symbols and German Umlaute öäü:  keycode 108 = Mode_switch keycode  13 = 4 dollar EuroSign                                                 keycode  19 = 0 parenright degree keycode  20 = minus underscore ssharp keycode  21 = equal plus plusminus keycode  47 = semicolon colon odiaeresis Odiaeresis keycode  48 = apostrophe quotedbl adiaeresis Adiaeresis keycode  49 = grave asciitilde grave asciitilde   To use it I just have to add this line to my .xsessionrc file:  xmodmap ~/.Xmodmap &   Unfortunately XFCE takes too long (many seconds) to load it and so I wanted to transfer these settings to the xkb system, which XFCE uses.  But xkb seems too sophisticated to provide a similar simple solution for this simple task. How could the same be achieved with xkb?  There is already an example of how to . However this is not a duplicate since my changes have to go to the xkb_symbols section and the solution needs some essential modifications. Furthermore my xkb file has to be in a folder named symbols/ e.g. ${HOME}/symbols/gergr:  setxkbmap -print |sed -e '/xkb_symbols/s/"[[:space:]]/+gergr&/' |xkbcomp -I${HOME} - $DISPLAY   I am wondering what exactly does a working xkb file look like.

I have a custom xmodmap file I use, including useful multi-language diacriticals, english quotes, dashes &c. I want to use this map with kmscon, so I need to create a xkb configuration from it. Is there an automated method to do it? Or even a straightforward manual process, since I won't need to do this frequently?


If i remove this 'static' then nothing will print what is the reason behind this?   #include<stdio.h> int *fun(); int main() {  int *p;  p=fun();  printf("Address=%u\n",p);  printf("Value at that address=%d\n",*p);  return 0; } int *fun() {  static int i=1;  return (&i); }

I've seen the word static used in different places in C code; is this like a static function/class in C# (where the implementation is shared across objects)?


I want to input 5 names and then sort them manually.   Is there any shorter solution than this??  def swap(x,y):   L[x],L[y]=L[y],L[x]   L = input("Enter names separated by space: ")   L = L.split(" ")     for x in range(len(L)):        for y in range(len(L)-1):           if L[y] > L[y+1]:             swap(y,y+1) print(L)

What is the best way of creating an alphabetically sorted list in Python?


How do I create a picking session in python? Say I have a script that does some operations, but its want the user to pick first a source object and then a target? How do I invoke the picking? My guess is bpy.ops.view3d.select(), but I get a context error all the time... What is the secret?

In my addon panel, how can I have an object selection box?  And what data type would I use to store the the selected object?  It should look like this:


I've compiled the code below on different compilers without any problem, but when upgrading to GCC 8 I got the error:  error: invalid operands of types ‘<unresolved overloaded function type>’ and ‘int’ to binary ‘operator<’ left->takeBlock<0, 0, 0, 0, M, N0>(*this);  Why is this happening? typedef int index_t;  template<int M, int N = M, typename T = double> struct mat {  public:     template<index_t I, index_t J, index_t Isrc, index_t Jsrc, index_t Mblock, index_t Nblock, index_t Msrc, index_t Nsrc> // I, J, Isrc, Jsrc, Mblock, Nblock must be explicitly specified.     void takeBlock(const mat<Msrc, Nsrc, T>& src) {     }     template<index_t N0>     void split(mat<M, N0, T>* left, mat<M, N - N0, T>* right) const {         static_assert(N0 < N, "N0 >= N");         left->takeBlock<0, 0, 0, 0, M, N0>(*this);  // <------------- *** ERROR ON THIS LINE ***         right->takeBlock<0, 0, 0, N0, M, N - N0>(*this);     }   };  int main(int argc, char **argv) {     mat<3,1> translation;     mat<3, 4> transformation;     mat<3> R;     transformation.split(&R, &translation);      return 0; }  Edit: It seems I can fix it by replacing ->takeBlock< with ->template takeBlock<

In templates, where and why do I have to put typename and template on dependent names? What exactly are dependent names anyway?    I have the following code:  template <typename T, typename Tail> // Tail will be a UnionNode too. struct UnionNode : public Tail {     // ...     template<typename U> struct inUnion {         // Q: where to add typename/template here?         typedef Tail::inUnion<U> dummy;      };     template< > struct inUnion<T> {     }; }; template <typename T> // For the last node Tn. struct UnionNode<T, void> {     // ...     template<typename U> struct inUnion {         char fail[ -2 + (sizeof(U)%2) ]; // Cannot be instantiated for any U     };     template< > struct inUnion<T> {     }; };   The problem I have is in the typedef Tail::inUnion<U> dummy line. I'm fairly certain that inUnion is a dependent name, and VC++ is quite right in choking on it. I also know that I should be able to add template somewhere to tell the compiler that inUnion is a template-id. But where exactly? And should it then assume that inUnion is a class template, i.e. inUnion<U> names a type and not a function?


I have the following class.  class MyClass<T> {     private static List<T> _Values;     public static List<T> Values     {         get { return (_Values = _Values ?? new List<T>()); }     } }   I have used it several times like this.  MyClass<Int32>.Values.Add(1); MyClass<String>.Values.Add("1");   Is there any possibility to retrieve all Lists of all types that have ever been used and are in the memory now using reflection?  Something like   var lists = typeof(MyClass<>)     .MemoryOccurrences()     .Select(x => x.GetStaticVariable("Values")); // two lists expected in this case

We need to get all the instances of objects that implement a given interface - can we do that, and if so how?


Let $X$ be a Hausdorff space, $\mathcal{B}(X)$ the Borel $\sigma$-algebra and $\mu : \mathcal{B}(X) \to [0, \infty]$ a measure.  Consider the following properties:  (1) $\forall A \in \mathcal{B}(X): \mu(A) = \sup \left\{ \mu(K) \mid K \subseteq A, K \text{ compact} \right\}$  (2) $\forall \varepsilon > 0 \, \exists K \subseteq X$ compact: $\mu\left(X \setminus K\right) < \varepsilon$  If $\mu$ satisfies (1) then some authors say that $\mu$ is "tight" or "inner regular" or "inner regular w.r.t. the compact sets". Often those authors that reserve the notion "inner regular" for "inner regular w.r.t. the closed sets" call $\mu$ "tight" if it satisfies (1). Other authors, mostly probabilists, refer to a finite measure (probability measure) $\mu$ as "tight" if it satisfies (2). (2) seems not to be an interesting property for measures $\mu$ that are not totally finite (but at least finite on compact sets). As an example, the Lebesgue measure on $\mathbb{R}$ is "tight" in the sense of (1) but not "tight" in the sense of (2).  If $\mu$ is finite then (1) $\Rightarrow$ (2). It is also folklore that if $X$ is metrizable and $\mu$ finite then (1) $\Leftrightarrow$ (2) (see also ).  Questions:   Can the assumption on $X$ being metrizable be weakened, e.g. perfectly normal or even weaker? Are there interesting applications in which tightness in the sense of property (1) is of interest when $\mu$ is finite, but (2) is not applicable?

Let $P$ be a probability measure on a Borel $\sigma$-algebra (on some metric space, $\Omega$).  It is called tight if for every $\epsilon >0$, there exists a compact $K$ such that $P(X \in K) \geq 1 - \epsilon$.   It is called inner regular if $P(A) = \sup \{P(K) | K \subset A, K \text{ compact}\}$ for every $A$ in the Borel $\sigma$-algebra.   It is clear that inner regularity implies tightness if we choose $A=\Omega$. For an arbitrary set $A$, using tightness we can obtain a compact $K(\epsilon)$ such that $P(A\cap K(\epsilon)) \geq P(A) - \epsilon$. If $A$ is closed then $K \cap A$ is compact and hence we get inner regularity for closed sets $A$. How can I prove this for general $A$?  Thanks.


I've seen it over and over again: A poor guy asks a question, makes a mistake in the formulation, another small typo and the result is less-than-perfect (not to say: stupid). What usually happens next is that within minutes such a question is down-voted, closed or even deleted.  I'm not against down-voting, closing or deleting of unconstructive/stupid content. Housekeeping is necessary.   But Gentlemen - Please! - Leave that poor guy the time it takes to reformulate, extend or rewrite his question. Most of the time I see plain down-votes without a comment within 20 minutes of the original post. And - that's the sad part - the down voters are usually members with >15k reputation.  Please consider the following:   Not all persons have English as their mother-tongue. Asking technical questions in a foreign language is quite challenging. Is it really so simple to estimate the effort that went into a badly formulated question? Often the right question is the key to the correct answer. To find that "golden question" is time consuming, but usually a steep learning curve. You cut that off if you close the question. Rewriting a question needs time. Especially if the proper research was not done in the first place. Posts on SO are not real-time communication. (There's the chat for this) People tend to follow that fact and expect answers by the next day (or even by the next week).   If your answer is: "If I see the question being improved, I'll take the down-vote back." then I'd have to reply: Nay! This is not going to happen, I know you're too lazy to come back to a bad question.  My question is: How long do you allow someone to react on "improvement requests"?  What is the consensus on SO about this?  Is there a consensus? One hour? One day? One week?

Possible Duplicate:          Given a question that is not clear at first, which satisfies the criterion for being "not a real question":      "It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot   be reasonably answered in its current form."   should that question be closed immediately, or should the OP get a chance to improve the quality of his question.  My modus operandi is this: When I encounter a question which is "not a real question", I respond via a comment - I might ask one or more counter-questions (about the issue), I might comment that I don't understand the question. So, I let the OP know that his question should be improved. I then give the OP say 15 minutes to respond (and in most cases the OP does respond). However, if the OP doesn't respond, then I consider voting for "not a real question".  Is this how SO should work?   I have witnessed in the past several questions for which I saw potential, being closed immediately, and I wonder if that is appropriate.   Edit: Of course, questions that are duplicates should be closed immediately, and off-topic questions should also be moved / closed immediately. In this question I am specifically referring to those questions which "have potential" (which could be corrected / improved)..


I'm working on employees database. Each one of them needs to have it's unique employee number in 5 digit format. It doesn't have to, but can be corelated with id number in database. I was trying to create custom seter that will add auto generated id to number 00000, but it didn't worked. Now I'm trying to set @SequenceGenerator, but it doesn't work to.  the entity looks like this:  @Entity @Table(name = "employees") @NoArgsConstructor @SequenceGenerator(name="empIdGen", initialValue=10, allocationSize=100) @Data public class EmployeeEntity {      @Id     @GeneratedValue(strategy = GenerationType.AUTO)     private Long id;     @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="empIdGen")     private int employeeId;     private String firstName;     private String lastName;  }   returnet JSON has 0 on that field for each employee:  [     {         "id": 1,         "employeeId": 0,         "firstName": "Jon1",         "lastName": "Doe1"     },     {         "id": 2,         "employeeId": 0,         "firstName": "Jon2",         "lastName": "Doe2"     },     {         "id": 3,         "employeeId": 0,         "firstName": "Jon3",         "lastName": "Doe3"     } ]   I expect values for field "employeeId" like 00001, 00002, 00003 or completly random, but unique. I would appreciate suggestions how to do that.

Is it possible to use a DB sequence for some column that is not the identifier/is not part of a composite identifier?   I'm using hibernate as jpa provider, and I have a table that has some columns that are generated values (using a sequence), although they are not part of the identifier.  What I want is to use a sequence to create a new value for an entity, where the column for the sequence is NOT (part of) the primary key:  @Entity @Table(name = "MyTable") public class MyEntity {      //...     @Id //... etc     public Long getId() {         return id;     }     //note NO @Id here! but this doesn't work...     @GeneratedValue(strategy = GenerationType.AUTO, generator = "myGen")     @SequenceGenerator(name = "myGen", sequenceName = "MY_SEQUENCE")     @Column(name = "SEQ_VAL", unique = false, nullable = false, insertable = true, updatable = true)     public Long getMySequencedValue(){       return myVal;     }  }   Then when I do this:  em.persist(new MyEntity());   the id will be generated, but the mySequenceVal property will be also generated by my JPA provider.  Just to make things clear: I want Hibernate to generate the value for the mySequencedValue property. I know Hibernate can handle database-generated values, but I don't want to use a trigger or any other thing other than Hibernate itself to generate the value for my property. If Hibernate can generate values for primary keys, why can't it generate for a simple property?


I am a Indian Citizen and will be travelling to Lyon (France). Right now, I am just checking various flights. I haven't decided, as  most of the flights transit through a Schengen country, Middle Eastern country, or Russia.   I want to be sure about the transit visa requirements in each country before making flight reservations. While I've checked transit visa requirements of many countries, most of these answers are from forums. I keep seeing posts that say "as long as you are not leaving the airport you do not require a transit visa," which is not necessarily the case.   I do understand that it depends on your nationality and duration of layover, but I want to find the genuine source to get the answer regarding transit visa of a country.

When thinking about travelling, I often have to think about a place to visit, and then look up visa rules for that particular country. This can be a fairly painful process because official government sites can often be hard to find, and advice on (say) guidebooks or Wikitravel tends to be generic.  Is there any resource where I can enter my nationality/residency, and then look up a list of visa rules for various countries?


I am trying to make an axe and stomped upon this problem...having no idea how to resolve it. 1st photo is with subdivision.  second is without.

So I'm making a basic car model here for fun, but when I try to add the subdivision surface modifier for smoother body, the side of the car become what it looks like in the screenshot. Is there any solution to make the side look less bulky? Any help is appreciated. :D


I'm running Windows 7 and I need to test a web application in IE8. I can't seem to find a version of IE8 anywhere for windows 7.  Can IE8 even be installed in windows 7?

I need to do some IE 9 testing. The last time I did serious IE testing was back when I was running XP and IE6 standalones.  I now have Windows 7 and IE11. Do older IE standalones still exist that will run on Windows 7? Google is failing me on this one (or rather, I'm probably failing Google).


I'm working on my mesh which looks like this :    As you can see the surface is not smoothed. Then I apply the smooth option and it gives me this result :    It is the third times I start again this mesh... I cannot understand how to apply the boolean modifier without getting in troubles.  Thank you for your help.

I have a certain geometry. See image. I need to create 3 creases/cavities on the surface. I tried 2 methods, see images. One is Knife Projecting mesh edges onto the surface, and then fiddling around with it. The other is using Difference Boolean operation (including cleaning up triangles afterwards). Both methods give terrible results, plenty of artefacts. What is a clean way to achieve the result? Or do I have to unwrap the mesh and create a bump map with these creases?


I wonder if there are some professors only focusing on teaching or management but no research. I think this may be feasible.

I know the Lecturer position is a purely teaching role (and can even be obtained with just a Master's degree). However, is the Assistant Professor role necessarily tied with research (or can it also be exclusively teaching as well)?  The reason I ask is because I have just finished a Master's degree and want to teach at the university or community college level. I believe obtaining a PhD will open up more doors at various universities and community colleges, and was wondering if that would enable me to land higher up academic positions that are exclusively teaching roles.  Any insight is highly appreciated!


I got stuck on this problem. I tried to separate the real and the imaginary part in both sides of the condition and the inequality but got no clue. Can anyone give me some hint? I really appreciate:          Suppose that $z^2 = \sum_{k=1}^{n}{z_k^2}$, here $z, z_k \in \mathbb{C}$. Prove that $|\text{Re} z| \le \sum_{k=1}^{n}{|\text{Re} z_k|}$

Suppose $z,z_1,z_2,z_3 \in \mathbb{C}$ such that $z^2 = z_1^2+z_2^2+z_3^2$.  Prove that $$|\Re(z)| \le|\Re(z_1)|+|\Re(z_2)|+|\Re(z_3)|$$ where $\Re(z)$ is the real part of $z$.  I think we can use the triangle inequality but I can't complete it.


I have access to ArcGIS Pro at my workplace and will be transferring a project over to someone who will be using QGIS. I have saved my layers as a layer file but the problem is that the other person is unable to import .lyrx files to QGIS.  Does anyone know how I can transfer the project to them and include all the symbology settings I have created?

At college we use ArcGIS Desktop 10, but that does not function on my Mac so I have QGIS there instead.  I want to do my exercises with QGIS, but in ArcGIS Desktop we use .lyr files with ArcMap and .lyrx files with ArcGIS Pro, and they are not supported by QGIS.  Does anyone know, how I can connect the *.lyr files to my *.shp files to use them on my Mac with QGIS?


If you want to ask someone how long he has been working here can we say "he is working since how long? I heard this sentence somewhere.

Context : Let say, I have just joined to a company and I want to ask my new friend how long he has been working here.  Using Present perfect:     How long have you worked here ?   Or   using Present perfect continuous tense ?     How long have you been working here ?   According to the image below:    Image credit:   So my answer is using present perfect continuous because I think he started in the past and he's still working at that office now. Am I right ?  Please include the reason on your answer as well.


page about suspensions uses some vague language and I am curious as to what it means by:  The user never gives anything back to the community, but only takes.

In Jeff's  he listed reasons for getting suspended:  No effort to learn and improve over time  This user does not put reasonable effort into the questions they ask of the community. There is little or no evidence of this user learning over time, either in the topic itself or in the community norms on the site. This user intentionally spams the site with the same question or very similar questions, over and over. The user never gives anything back to the community, but only takes.   What is the criteria for "The user never gives anything back to the community, but only takes."? Does a user with 1785 questions and 7 answers(non of them have positive rating, and two negative) fit to that definition? I remember I saw a user with 0 answer being suspened, but does really answering one answer with negative rating save him?  I didn't linked to that user profile because it's not personally against him, but a hint: this is the user with the most questions in SO.


Hello Friends as i was thinking is it possible for two users to login at the same time in the same machine with multiple monitors can we do it or not and if we can please supply the handy information

I'm still kinda new to linux and my understanding was I could let multiple people (at the most me + two more) use my pc at the same time. If this is indeed the case, how do I?


Ηow to install Java on Linux so that Ι can connect to JOSM?

How do I install Java, including in my browser, so websites with Java work?


held Anakin's lightsabers with his hands. Ok he's really powerful.   But the point is, as maybe using the same Force protection from Force lightnings, one could hold the light of a lightsaber or defend using their own arms, or even protect their own body from it.  We see Vader using his own hands to defend from blasters on Lando's planet.  At this episode on the Clone Wars, when the Father holds it you can see the same glow around his hands.  What are your thoughts? Is it possible and common?

(force energy absorption) allows a Jedi to catch blaster bolts and even stop lightsabers with their body using the Force:    Why don't the Jedi just use tutaminis to defend themselves instead of worrying about lightsaber combat?


The cleric ability Preserve life says the following:     Starting at 2nd level, you can use your Channel Divinity to heal the badly injured.      As an action, you present your holy Symbol and evoke Healing energy that can >restore a number of hit points equal to five times your cleric level.      Choose any creatures within 30 feet of you, and divide those hit   points among them. This feature can restore a creature to no more than   half of its hit point maximum. You can’t use this feature on an Undead   or a construct.   I can't seem to find a straight definition of "creature." Can the cleric heal Player Characters, humanoid NPCs, etc? A layman definition of 'creature' to me would mean any non-humanoid / monstrous enemy to the characters. But it doesn't make much sense to be able to heal only your enemies.  So are the players considered creatures?

In the Starter set and Basic Rules, it mentions "character", "non-player character", "player character", "monster", "creature", and maybe other terms I've missed.  Which of these terms are interchangeable?   Some examples from the Basic Rules PDF:   Page 105: Conditions Appendix refers only to creatures. Chapter 11: all spell descriptions refer to creatures, but occasionally other terms such as humanoids.


In the last decade or so, I've seen more and more lens hoods for long lenses that aren't simply round in front.  I was reminded of that by , which shows the inside of a neatly packed camera bag.  In particularly, here is the telephoto lens from that picture:    In this case, it looks like the lens hood can be detached and flipped backwards on the lens for easier storage.    I thought the point of a lens hood, particular for a long focal length lens, is to shade the lens from angles it's not going to make a picture of anyway.  This is useful, for example, for keeping the sun off the front of the lens when you're not trying to include it in the picture.  This prevents internal reflections from bouncing around and getting into the picture, even though the sun or other bright light is not actually in the picture.  A round lens hood, like on my old 300 mm lens makes sense for that.  So what's the advantage of this tulip-shaped lens hood?  Either you want the hood to shade the lens or you don't.  As long as it doesn't get in the way of the picture, more is better, right?  Presumably the peaks of the tulip don't get in the way of the picture, so how can the cuts in between the peaks be helping?  What am I missing?

I have one lens hood for a 28-105mm lens that is petal shaped.  I have another lens hood for a 50mm lens that is fully round.   If the purpose of the lens hood is to block stray light, then wouldn't fully round always block more?


I'd like to be able to configure /etc/pam.d/sshd so that:  for all users except those in group "admin", module pam_radius is required.   for those users in group admin, module pam_radius is sufficient.  How to do this?

PAM allows to use sufficent and required for some logic, like  auth sufficient pam_a.so auth required pam_b.so auth required pam_c.so   which would mean "either a is true, or b must be true and then c must be true".  Is it possible to do more complex operations? like "(a or b) and (c or d)" or "(a and b) or (c and d)"? Possibly with even more layers of parenthesis.


Anybody knows what this component is? (The white cylinder.)   It has to be some kind of switch since it is marked as "S2", but I never saw anything like it before.    Thanks!

I have recently opened up 3 dead, battery-operated RF transceivers lying around, both wearable and key-chains. I've noticed that all three had components that looked like fuses (cartridge case), soldered down, that are quite large compared to the size of the circuit. See the pictures below. I'm not posting full circuit pictures because I don't know if I should, I can update if they are necessary.  Device 1:    Device 2:    Device 3:    I can't see why such a device will require a fuse, and I couldn't find any other common components manufactured in cartridge cases, maybe I'm not using the correct name. I don't see them on any applications notes or reference designs for the ICs used either.  I've tried to figure out how they are connected to the circuit, I don't have schematics and PCBs are more than 2 layers so they may not be complete, but see the schematics I've figured below.  Device 1:    Device 2:    Device 3:    Also, when I do a continuity test between the terminals of the components with a multimeter, resistance starts in ~50 Ohms range and goes down to short as I keep the probes on its terminals so my best guess is something for ESD protection, maybe Varistors or Thermistors?   Does anyone know what these components are and why they are there?


We know that when a ray of light goes from denser to rarer medium, it bends away from the normal due to increase in its speed. But that means it bas been accelarated and a force acts on it. Am I right? Please explain.

I know that if we solve the Maxwell equation, we will end up with the phase velocity of light being related to the permeability and the permittivity of the material. But this is not what I'm interested in - I want to go deeper than that. We know that the real speed of light is actually not changing, the decrease in speed is just apparent. Material is mostly empty, the light will still travel with $c$ in the spacing. The rare atoms will disturb the light in some way. So I am interested in how the atoms affect the light. Photon absorption-emission theory Some textbooks that I read explain it in a way kind of like this: In a material the photons are absorbed by atom and then re-emitted a short time later, then they travel a short distance to the next atom and get absorbed&emitted again and so on. How quickly the atoms in a material can absorb and re-emit the photon and how dense the atoms decides the apparent speed of light in that material. So the light appears slower because it has a smaller “drift speed”. Interference theory But recently I realize an alternative explanation: Atoms respond to the light by radiating electromagnetic wave. This “new light” interferes with the “old light” in some way that results in delayed light (advanced in phase), this can easily be shown by using simple phasor diagram. Consequently effectively the light covers a smaller phase each second, which gives the impression of a lower phase velocity. However the group velocity is changing in a complicated way. I think that the first explanation does not explain the change in phase velocity of light. if we consider light travelling into a slab of negative refractive index non-dispersive material, let’s say the light is directed perpendicular to the slab. The phase velocity’s direction will be flipped, but group velocity’s direction in the material will not change. Only the second explanation can explain the flipped phase velocity direction. I guess that the velocity that we get in the first explanation is actually belongs to the group velocity. It makes sense to me that the front most of the photon stream determines the first information that the light delivers. So the question is What really cause the phase velocity of light to be decreased?  "drift velocity" of photons (they aren't the same photons, they are re-emitted all the time) phase difference between absorbed and emitted light something else  And also, I still don't really understand detailed explanation of the absorption-emission process for small light's wavelength (for large lambda compare to the atoms spacing, the photons will be absorbed by the phonons). The dispersion relation that we know is continuous and also some material is non-dispersive, therefore the absorption process must occur in all frequency for a certain range. So definitely it doesn't involve the atomic transition, otherwise it will be quantized. My guess is that the relevant absorption process gets smooth out by the dipole moment. What makes the spectrum continuous? EDIT: link for dispersion relation:


I have a new hp laptop 4cell battery I am confused about using battery and charging it I have read it is not suitable to keep it pluged in all the time but where I live it has power fluctuation sometimes and it is not convenient to take in and out the battery every time so please suggest a good way to use laptop battery and to prolong its life is it better to be plugged in even after reaching 100% charge or is it better to charge it to say 85% then discharge it till 30% then again charge it??

Possible Duplicate:          I use my laptop as a replacement for desktop. I generally use it for 6 to 7 hours a day. However I use it for light use like word processing , programming , movies (once two to three days). I have been using my laptop for an year and a half now and the battery wear percentage is 21.7%. I do back to back charge-and-discharge of my battery as I have read that keeping it plugged into AC while having battery in might harm the battery in long run. I do use a cooler pad and recalibrate my battery once two-three months.  What other things should I do to increase my battery service life considering my regular heavy use? (Increasing the years the battery will provide service)   Other information: CPU (first gen i3) temp: 49C.  Motherboard Temp: 49C. Hard Drive Temp: 42C Laptop Model: HP DV4-2126TX.


We know that in the set of nth roots of unity there are exactly $n$ distinct complex numbers: $C_n = \{z \in \mathbb{C} : z^{n} = 1 \}   = \{e^{i2k\pi/n}, \;  k = 0, 1, ...,n-1 \} $ and they lie on the unit circle. Now collect all roots of unity for every $n \in \mathbb{N}$ and consider the set $C =  \{C_n, \;  n \in \mathbb{N}\}$.   Is the set $C$ the unit circle, that is $\{C_n, \;  n \in \mathbb{N}\} = \{z \in \mathbb{C} : |z| = 1 \}$ ?   Obviously $\{C_n, \;  n \in \mathbb{N}\} \subseteq \{z \in \mathbb{C} : |z| = 1 \}$, but I didn't manage to prove the other inclusion (if it is true).

I'm having difficulty understanding how to prove that the primitive roots of unity are in fact dense on the unit circle. I have the following so far:  The unit circle can be written $D=\{x\in\mathbb{C}:|x|=1\}$. The set of primitive $m$-th roots of unity is $A_m=\{\zeta_k:\zeta_k^m=1,\zeta_k\text{ is primitive}\}$.  Hence, the set of all primitive roots $A$ is given by the union of $A_m$ over $m=1,2,3,\ldots$. But I can't seem to get started on how to prove that $A$ is dense in $D$.


I'm using the book class and I want to renew its existing command \@makechapterhead. The original command is shown on p.32 of . In particular, I want to change the spacing in line 811 from 50 to 30, so I did the following  \renewcommand{\@makechapterhead}{      \def\@makechapterhead#1{%         \vspace*{30\p@}%         {\parindent \z@ \raggedright \normalfont      \ifnum \c@secnumdepth >\m@ne  ⟨book⟩     \if@mainmatter          \huge\bfseries \@chapapp\space \thechapter          \par\nobreak          \vskip 20\p@       \fi ⟨book⟩    \fi     \interlinepenalty\@M       \Huge \bfseries #1\par\nobreak       \vskip 40\p@     }} }   But I got an error saying illegal parameter number in definition of \@makechapterhead. How do I fix this?  Thanks.

I am using LaTeX to write my dissertation, and I have realised that on the table of contents and on every chapter page, LaTeX leaves a lot of empty space.  What I mean is that lets say in the page where chapter 1 begins, from the top of the page until the chapter title there is much more vertical space than on any other page. The same goes with chapter 2 etc... and for contents page as well.   Can anybody help me to remove that space? Is there any mistake in my code or something like that? Is this a default of LaTeX?  the preamble is  \documentclass[12pt,twoside]{report} \pagestyle{plain} \usepackage{a4paper} \usepackage{setspace} \doublespacing  \usepackage{amssymb} \usepackage{amsmath}    I've tried the methods below, but none of them work properly.


I'm using the definition where $ \lim \sup s_n = \lim ( \sup \{s_k : k \geq n \} )$.   I know  $\lim \sup (s_n + t_n) \leq \lim \sup (s_n) + \lim \sup (t_n)$ makes intuitive sense because I'm guessing the sequence $s_n + t_n$ is much larger than than the individual sequences $s_n$ and $t_n$. And so the least upper bound would be larger.   However I'm stuck on proving this. I would know how to do this question if I could make the assumption that $s_n, t_n$ were bounded sequences, but I cannot make this assumption.

I am stuck with the following problem.     Prove that $$\limsup_{n \to \infty} (a_n+b_n) \le \limsup_{n \to \infty} a_n + \limsup_{n \to \infty} b_n$$   I was thinking of using the triangle inequality saying $$|a_n + b_n| \le |a_n| + |b_n|$$ but the problem is not about absolute values of the sequence.  Intuitively it's clear that this is true because $a_n$ and $b_n$ can "reduce each others magnitude" if they have opposite signs, but I cannot express that algebraically...  Can someone help me out ?


If I already have a primary key on the column Id and I have a column Name on which I want to add a Unique constraint, how can I do that in SQL Server?  I tried the following:  ALTER TABLE dbo.Hotels ADD CONSTRAINT         UNQ_NAME UNIQUE NONCLUSTERED (             Name )   Error:  Msg 1919, Level 16, State 1, Line 1 Column 'Name' in table 'Hotels' is of a type that is invalid for use as a key column in an index.   Name is represented as:  Name nvarchar(MAX) Allow Nulls

How do I create a unique constraint on an existing table in SQL Server 2005?  I am looking for both the TSQL and how to do it in the Database Diagram.


If we have 2 ways to iterate :  First :  Object ob; ArrayList<Obect> list; for(int i=0;i<list.size();i++) { //Todo}   Second :  Object ob; ArrayList<Obect> list; for(Object o:list) { //Todo}   So what are the differences ? I found that in second case , if try to remove object in this cycle , I get a concurrent modification exception.

What, if any, is the performance difference between the following two loops?  for (Object o: objectArrayList) {     o.DoSomething(); }   and   for (int i=0; i<objectArrayList.size(); i++) {     objectArrayList.get(i).DoSomething(); }


I would like to use the spellchecking dictionaries bundled with OS X from the command line (hunspell), but can't seem to find them. In /System/Library/Spelling there are only 2 files pl_PL.{aff,dic}, and find / -name '*.dic' revealed nothing.  I know I can dowload dictionaries from OpenOffice etc., but I'd like to find the ones bundled with OS X.  EDIT To clarify, there are at least two kinds of dictionaries in OS X:   Definitions used in Dictionary.app. I'm not interested in those. Word lists used by the system spellchecker (red dotted lines). I know OS X uses hunspell because  says so, and there are numerous posts on how to add new ones (, ). Just, I don't want to add new ones but use the English one that obviously comes with the system.

I'm trying to build a command line tool to look up definitions of words, it's only a dummy app for me to practise my C++ skills.  I know there is a list of words stored at /usr/share/dict - but what I'm really looking for is the path to the New Oxford American Dictionary data, it comes bundled with the system, but I couldn't find it yet.


I recently returned to the USA from an extended trip in Canada with around CAD$25 in loonies and toonies (CAD$1 and CAD$2 coins).  As I won't be returning to Canada for a while, and don't live near Canada, I was hoping to exchange the coins, even at a worse rate (since they're worth nothing to me at the moment).   However, I went to a local Travelex and was told that they did not exchange Canadian coins and indeed, that no currency bureaus would take the coins.   Is there anywhere I could go to exchange these coins?

Tonight I just cleaned my room and while doing this I found some money. I counted it and I found out that there are a lot of coins from 25 different countries.  I know that normally banks don't exchange foreign currencies in coins, but is there a way so that I can still get some money for my foreign coins?


To express $2010$ in base $2$, we use exactly $8$ ones and $3$ zeros. Find the next two integers in base $2$ that use the same number of ones and zeros.

I can not figure this out.   I started off by making a table and putting the base(2) on one side, the number in the middle and the remainder in the third row and for 2010 I got 11111011010 but I cant find the next two numbers please help and please explain in detail.  Thank you =)   to express 2010 in base 2, we use exactly 8 ones and 3 zeros. find the next two integers in base 2 that use the same number of ones and zeros


I am plotting a sinus function using a pgfplot and would like that the tick of the x axis was labeled using multiplers of pi (pi/4, pi/2, 2*pi...), for they are the "important" x values to visualize when studying the sinus function.  \documentclass{standalone} \usepackage{tikz} \usepackage{pgfplots} \pgfplotsset{compat=1.14} \begin{document}  \begin{tikzpicture}  \begin{axis}[domain=0:2*pi, ymax=1.2, samples=100, grid=major,   xlabel=$\alpha$, ylabel=$sin(\alpha)$,    xtick = {0,1,...,6}, ytick = {-1,-0.5,...,1}] %I assume this the part that I need to change?     \addplot [blue](\x, {sin(\x r)}); \end{axis}  \end{tikzpicture} \end{document}   I've tried giving regular values of pi in the braces near the % in the code above, but neither using "pi" nor "\pi" has proven useful. Am I missing something? The plot looks like this using the code above:

How do I make the axis labels use multiples of \pi in PGFPlots?


I'm trying to compile a tex file using TexMaker but I got the following error     LaTeX Font Info: Try loading font information for OT1+pcr on input line 220.   (/usr/share/texlive/texmf-dist/tex/latex/psnfss/ot1pcr.fd   File: OT1pcr.fd 1995/12/14 Fontinst v1.500 font definitions for OT1/pcr.   )      ! Font OT1/pcr/m/n/12=pcrr7t at 12.0pt not loadable: Metric (TFM) file not found.   I understand that some packages are missing, I've tried to install the latest version of TexMaker from the website but it didn't solve the problem. I've also tried to edit the OT1pcr.fd file according to this  with no success.  How can I fix this problem? Thanks

My .tex file failed the LaTeX compile with one of this problem, my OS is Ubuntu 12.04, and it seems to have the same problem in Fedora 16. Can someone help me with this?


I recently bought a Toshiba Satellite P50, I tried installing Ubuntu 12.04.3 and 13.10 alongside Windows 8.1.  If I disable Secure Boot, but leave the UEFI mode on, I can get to the screen that asks If I want to try Ubuntu. When I select that option the screen just goes black and nothing happens.   I'm only able to load Ubuntu from a usb when the Secure Boot and the UEFI mode are both enabled. But, after I install it, the computer loads only into Windows. I ran the boot-repair after from the usb, after disabling Secure Boot, and it told me that I should disable Secure Boot, but when I did I was again unable to load it from the usb.  Thanks for taking the time to read this. Any help or suggestions with would be greatly appreciated!!

I'm absolutely new to Linux. I would like to know how to install Ubuntu alongside the pre-installed Windows 8+ OS.  Should I do it with Wubi, or through the Live USB/DVD?  What steps do I need to take to correctly install Ubuntu?


I have following method to UnitTest:  public MessageMediaSoapClient client { get; set; }  public uint[] CheckSMSDeliveryReports() {     try     {         client = GetSMSSoapClient();          var deliveryReports = client.CheckReports();          var delieveredMessageIds =              deliveryReports                 .reports                 .Where(delivery => delivery.status == DeliveryStatusType.delivered)                 .Select(message => message.uid)                 .ToArray()                 ;          if (deliveryReports != default(CheckReportsResultType) && deliveryReports.reports.Count() != 0)         {             client.ConfirmReports(                 deliveryReports                     .reports                     .Where(delivery=> delivery.status == DeliveryStatusType.delivered)                     .Select(messages => messages.receiptId).                     ToList()             );         }         return delieveredMessageIds;     }     catch (Exception)     {         throw;     }  }   I have tried setting up mu Unit Test for initial usage like below:  [TestMethod] public void CheckDeliverReports_ReportCountGreaterThanZeo_ConfirmReportsGetCalled() {     //Arrange     Mock<SmsSoapClient> mockSoapClient = new Mock<SmsSoapClient>();     mockSoapClient.Setup(x => x.Authenticate()).Returns(true);     mockSoapClient.SetupAllProperties();       //Act       //Assert  }   How do I setup a fake for public MessageMediaSoapClient client { get; set; } and then verify if its methods are called.

It is my understanding that I can test that a method call will occur if I call a higher level method, i.e.:  public abstract class SomeClass() {         public void SomeMehod()     {         SomeOtherMethod();     }      internal abstract void SomeOtherMethod(); }   I want to test that if I call SomeMethod() then I expect that SomeOtherMethod() will be called.   Am I right in thinking this sort of test is available in a mocking framework?


Similar to  but focused on the Legends version only.  Plagueis discovered Palpatine only at the age of seventeen. It took some time before Plagueis discovered Palpatine's strength in the Force because of the barriers the latter had built up over the years to hide his teen angst.  However, the Jedi are supposed to be able to know every single Force sensitive in existence within the Republic through midichlorian tests that are instituted within all routine medical tests at birth. Naboo is a Republic member world from the Mid Rim. Palpatine's father was not a Force user, and had no contact with the Sith Lords at the point of Palpatine's birth.  How did Palpatine's undeniably high midichlorian count evade Jedi attention when he should have been subjected to a Republic medical checkup at birth, and there were no Sith present to mask the results?

As per      To hinder transgression, those who showed an aptitude for the Force were taken directly from birth (or soon afterward) to train in the Jedi Temple headquarters on Coruscant or at smaller Jedi Enclaves as Padawans.   Why was Palpatine, who was strong in the Force, not identified as a potential Jedi at birth?


I am preparing slides/presentations of my research work in LaTeX beamer Warsaw theme. As my thesis presentation contains too many sections (which I don't want to reduce it), the final pdf output is such that in order to display all the sections in navigation section, nearly 40 percent of the presentation is getting used. This gives very less space for the content area.   I tried "Only 3 items in navigation bar" .   But that resulted like this.   But my intention of reducing the navigation space to display the sections is not achieved. In this case also, the space/area for the presentation remain the same.   How can I achieve say, 3 items in navigation bar but reduced space in navigation bar?  I have lots of figures/diagrams/tables in my presentation.  Thanks in advance for your guidance/help

I give a lecture with 10 sections and maybe 5-10 subsections. Using the Warsaw theme would make the available space too small.   Is there a way to make the navigation bar show:   only the last section, current section and the next two sections? only the last subsection, current subsection and the next two subsections?   If there is not an option, one may have to change the \insertsubsectionnavigation-function.  Maybe something like   \insertsubsectionnavigation["\thissectionnumber-1" to "\thissectionnumber+2"]    The problem is: I don't understand the way this function works.  Does anyone have an idea or a link to a similar topic?  Here is an example of how it should NOT look:  \documentclass{beamer} \usetheme{Warsaw} \begin{document}     \section{Section 1}     \section{Section 2}     \section{Section 3}     \section{Section 4}         \subsection{SubSection a}\begin{frame}Test\end{frame}         \subsection{SubSection b}\begin{frame}Test\end{frame}         \subsection{SubSection c}\begin{frame}Test\end{frame}         \subsection{SubSection d}\begin{frame}Test\end{frame}         \subsection{SubSection e}\begin{frame}Test\end{frame}         \subsection{SubSection f}\begin{frame}Test\end{frame}         \subsection{SubSection g}\begin{frame}Test\end{frame}         \subsection{SubSection h}\begin{frame}Test\end{frame}         \subsection{SubSection i}\begin{frame}Test\end{frame}     \section{Section 5}     \section{Section 6}     \section{Section 7}\begin{frame}Test\end{frame} \end{document}   A slide would look like:   I want it to look like:


There are some automatic method (package, class, macro) in LaTeX to do a text collage similar to that showed in the image?     If not, is would be possible without too much manual work?. The background, the font and the shape of the collage does not matter (is enough a rentangular shape).

creates word clouds based on the frequency on words in a text, similar to tag clouds. What makes it unique is that it can lay out words in arbitrary directions without too much white space. See the  for many examples.  Given a list of words together with their frequency, is there some package that provides at least some of the functionality in (La)TeX? If not, is there some way to abuse the TeX layout engine to produce word clouds?  (This is not meant as advertisment for wordle, I just do not know of anything that is similar.)


I want to sell (or donate) my HP Mini 1000 netbook, but I am concerned about identity theft and securing personal information with the transition to a new user.   I am running Ubuntu 12.04 LTS. The netbook has a 16 GB solid state drive. I am under the impression that different methods are required to securely erase an SSD, compared to a traditional hard drive.  How do I do this and prepare this computer for sale (or donation)? It is not important whether the computer can still boot the operating system after this erase - only that an operating system can again be installed.  I have tried to read about this in many places on the web, including in askubuntu, but the process is never explained in sufficiently clear, jargon-free language. Or perhaps it is, but I still don't understand how to do this! Can I do this without procuring software? If I need to get software, what should I get?   Essentially, can anyone explain how I do this to someone who, you can assume, knows very little about computers, but can competently follow directions?  Thanks in advance!

I've just received my new SSD since the old one died. This Intel 320 SSD supports TRIM. For testing purposes, my dealer put Windows on it, but I want to get rid of this and install Kubuntu on it.  It does not have to be a "secure wipe", I just need the empty the disk in the most healthy way. I believe that dd if=/dev/zero of=/dev/sda just fills the blocks with zeroes and thereby taking another write (correct me if I'm wrong).  I've seen the answer , but it looks like it's suited for clearing empty blocks, not wiping the disk.  hdparm seems to be the program to do it, but I'm not sure if it clears the disk OR cleans empty blocks. From its manual page:     --trim-sector-ranges           For  Solid State Drives (SSDs).  EXCEPTIONALLY DANGEROUS. DO NOT           USE THIS OPTION!!  Tells the drive firmware to discard  unneeded           data  sectors,  destroying  any  data that may have been present           within them.  This makes those sectors available  for  immediate           use  by  the firmware's garbage collection mechanism, to improve           scheduling for wear-leveling of the flash  media.   This  option           expects  one  or  more  sector range pairs immediately after the           option: an LBA starting address, a colon, and  a  sector  count,           with no intervening spaces.  EXCEPTIONALLY DANGEROUS. DO NOT USE           THIS OPTION!!              E.g.  hdparm --trim-sector-ranges 1000:4 7894:16 /dev/sdz   How can I make all blocks appear as empty using TRIM?


I have two custom Drupal modules moduleA and moduleB. moduleA has all the functions for Ajax calls i.e. ajax_example_dependent_dropdown_callback and _ajax_example_get_second_dropdown_options.  I create a content type in moduleB called content_type_b. I am using Ajax calls in moduleB to populate drop down in content_type_b.  While creating content for content_type_b, I try to choose a value from the drop down. The first time, it works fine. The second time I get an error saying "An Illegal choice has been selected. Please contact the administrator". All these events happen before a node insert.  When I looked into the logs, the hook_node_validate of moduleA is getting called. The node insert must happen in moduleB. So node_validate of moduleB must be called. I think since the Ajax functions were present in moduleA, the node_validate of moduleA is being called.   Please advice how to proceed in this situation.

I have written code like below and all works fine, but while submitting the form I get the error below. I am trying to filter the second dropdown based on the first drop down selection.     An illegal choice has been detected. Please contact the site administrator.   How do I overcome that error?       function dynamic_location_dropdown_form_alter(&$form, $form_state, $form_id) {   if($form_id == 'product_node_form') {    $location_options = array();    if(isset($form['field_destination']['und']['#default_value'][0])) {     $destination = $form['field_destination']['und']['#default_value'][0];   }   else {     $destination = 0;   }    $location_options = dynamic_location_dropdown_locations($destination);    $form['field_destination']['und']['#ajax'] = array(     'event' => 'change',     'wrapper' => 'squadron-wrapper',     'callback' => 'dynamic_location_dropdown_ajax_callback',     'method' => 'replace',   );   $form['field_product_location']['#validated'] = true;   $form['field_product_location']['und']['#prefix'] = '
';   $form['field_product_location']['und']['#suffix'] = '
';   $form['field_product_location']['und']['#options'] = $location_options;   } }  function dynamic_location_dropdown_ajax_callback($form, $form_state) {   $country_id = $form['field_destination']['und']['#value'];   $form['field_product_location']['#validated'] = true;   $form['field_product_location']['und']['#options'] =  dynamic_location_dropdown_locations($country_id);    return $form['field_product_location']; }  function dynamic_location_dropdown_locations($destination_id) {   $nodes = array();   $nodes[''] = '- None -';   if($destination_id != '') {     $select = db_query("       SELECT node.title AS node_title, node.nid AS nid, node.created AS node_created       FROM {node} node       LEFT JOIN {field_data_field_location_country} field_data_field_location_country        ON node.nid = field_data_field_location_country.entity_id        AND (field_data_field_location_country.entity_type = 'node'        AND field_data_field_location_country.deleted = '0')       WHERE (( (node.status = '1')        AND (node.type IN  ('location'))        AND (field_data_field_location_country.field_location_country_nid = $destination_id)))       ORDER BY node_title ASC     ");     $nodes[''] = '- None -';     foreach ($select as $node) {       $nodes[$node->nid] = $node->node_title;     }   }    return $nodes; }


I noticed that many proofs for Herons formula use the properties of angles, which is why I wanted to show a proof that doesn't involve any,  and seems to be simpler than the usual methods that are applied. A triangle with side lengths $a, b, c,$ where $c$ is the greatest side length and an altitude($h$) that intercepts $c$ such that $c$ is the  sum of two side lengths , $c = m + n$, using Pythagorean theorem and the area formula of a triangle,  we can prove Herons formula. First we find $a$ and $b$ in terms of $m$ and $n$ using Pythagorean theorem: $a^2 - m^2 = h^2$ $b^2 - n^2 = h^2$ $a^2 - m^2 = b^2 - n^2$ $a^2 - b^2 = m^2 - n^2$ Then using $c = m + n$, eliminate $m$: $a^2 - b^2 = (c-n)^2 - n^2$ $a^2 - b^2 = c^2 - 2cn$ $n = \frac{1}{2c}(c^2 + b^2 - a^2)$ We can Eliminate $n$ from $b^2 - n^2 = h^2$ to find $h$: $h = \sqrt{b^2 - (\frac{1}{2c}(c^2 + b^2 - a^2))^2}$ Plugging this into the area formula ($A = \frac{1}{2}ch$) gives: $A = \frac{1}{2}c\sqrt{ b^2 - (\frac{1}{2c}(c^2 + b^2 - a^2))^2} $ $A = \frac{1}{2}c\sqrt{ \frac{1}{4c^2}(2a^2b^2+2a^2c^2-a^4-b^4+2b^2c^2-c^4)} $ $A = \sqrt{\frac{1}{16}(c^2 - (a - b)^2)(( a + b)^2 - c^2)} $ $A = \sqrt{\frac{1}{16}(a + b - c)( a + b + c)( b + c - a)(a + c - b)} $ $A = \sqrt{s(s - a)(s- b)(s- c)}$ Q.E.D. Thoughts?

Let $a,b,c$ be the lengths of the sides of a triangle. The area is given by Heron's formula: $$A = \sqrt{p(p-a)(p-b)(p-c)},$$ where $p$ is half the perimeter, or $p=\frac{a+b+c}{2}$.  Could you please provide the proof of this formula? Thank you in advance.


Although they are all over the Internet, but the answers are not fixed and were not asked all 4s at a time causing me to be confused.  Is it accurate if I say:   both login and sign in are the same as authenticate verb, to validate the user. Otherwise password are not required. both logout and sign out are the same log in is to authenticate into a website that has different interface as guest You cannot use the logged in interface if you are a guest, e.g. Facebook sign in is to authenticate into a website that has same interface as guest You can still use the website without signing in, e.g. Google register is entering your information into the system for your account for serious thing You need to enter your information like name, address, contact number, etc for domain registration. Another example is company registration. sign up is to create an account to use You only need to enter essential information like email, username, password, etc for a Facebook account.

I didn't find the difference between them by  googling  Edit: Thx litterally, authenticate, means prove its identity, which is a just a subprocess of global access authorization btw I forgot to mention "Sign In", that's another confusing term for me ;)  Edit 2 other useful answers:


How do I stretch my heightmap over the whole plane?  My plane has the dimensions of 6000 x 6000 and I subdivided it so that each pixel should be the value of one rectangle. My heightmap comes with 200 x 200px resolution.  I imported the image as texture, set the 'color space' to 'linear' and the clipped it.    Now I added the modifier  but it only interprets the values on a little area in the middle of the plane.   How do I stretch my heightmap over the whole plane?     The result should be like that

Trying to do some golf course layouts in 2.73a. Would like to use topo elevation info. Currently have grayscale .jpg of site - top view. How do I get this into Blender as a "lumpy" plane?


A room has N (1 to N inclusive) bulbs and N switches. N people go in one by one. 1st person goes in and toggles none of the switches. 2nd person goes in and toggles all switches other than the multiples of 2(2, 4, 6...). 3rd person goes in and toggles all switches other than multiples of 3(3, 6, 9...), and so on (Till Nth person toggles all the switches except Nth switch). Once the process is finished, how many bulbs are in 'on' state. (Assume that all bulbs to be in 'off' state initially).  Example : If N=3 then answer is 2 and when N=7 then answer is 5.   How to find it for given N ?

I have a problem called "The Prison Problem" that I need to explain to my 9-year-old cousin. I would think that he has just started learning about divisors and perfect squares, and as such, I have a proposed solution. Any input from you guys would be welcome, as to what is the best way to go about this.  Problem:  There was a jail with 100 cells in it, all in a long row. The warden was feeling very jolly one night and told his assistant that he wanted to give all the prisoners a wonderful surprise. While they were sleeping, he wanted the assistant to unlock all the cells. This should be done, he told the assistant, by putting the key in each lock, turning it once. The assistant did this, then came back to report that the job was done. Meanwhile, however, the warden has second thoughts. "Maybe I shouldn't let all the prisoners free," he said. "Go back and leave the first cell open, but lock the second one (by putting the key in and turning it once). Then leave the third open, but lock the fourth, and continue in this way for the entire row." The assistant wasn't very surprised at this request as the warden often changed his mind. After finishing this task, the assistant returned, and again the warden had other thoughts. "Here's what I really want you to do," he said. "Go back down the row. Leave the first two cells as they are, and put your key in the third cell and turn it once. Then leave the fourth and fifth cells and turn the key in the sixth. Continue down the row this way." The assistant again did as instructed. Fortunately, the prisoners were still asleep. As a matter of fact, the assistant was getting pretty sleepy, but there was no chance for rest yet. The warden changed his mind again, and the assistant had to go back again and turn the lock in the fourth cell and in every fourth cell down the row. This continued all through the night, next turning the lock in every fifth cell, and then in every sixth, and on and on, until on the last trip, the assistant just had to turn the key in the hundredth cell. When the prisoners finally woke up, which ones could walk out of their cells?  Proposed solution:  Ten cells are left open after this process. Every cell that is a perfect square will remain open (1, 4, 9, 16, 25, 36, 49, 64, 81, and 100). If a number is not a perfect square, then it has an even number of divisors, therefore it will be "toggled" an even number of times and end up where it started (closed). Perfect squares have an odd number of divisors, so they will end up the opposite of where they started (open).


As per question title. We all know hobbits don't wear shoes (and their feet are more adapted than ours to walking without protection), but was this true even in a chilly climate?  I find just a bit unbelievable that they had to fully cover themselves in winter clothes to withstand a full-blown snow blizzard (which they barely survived), and yet they were simply walking on ice and snow on their nude feet...

This is a question that's been bothering me for the last couple of days:  How is it that the hobbits of the Fellowship were able to survive such cold temperatures throughout their travels without having any foot protection?   I know it's said that they have thick "leather like" soles, with ample amounts of hair for warmth but still, I don't understand how that could provide much more warmth than for instance a regular leather shoe. On top of this I know that multiple days (or even weeks) of their journey was spent crossing mountain ranges, which, near a summit would have a temperature far below freezing. This combined with the assumption that they only have the warmth of shoes on there feet would have presumably resulted in some level of frostbite. But to my knowledge there is no such mention of these problems in the novels or movies aside from the odd "It's cold".  Anyways, I'm just wondering if anyone has some form of explanation to this phenomenon or do hobbits just have really durable feet?


How to derive the chromatic polynomial from a Cycle? I derived the chromatic polynomial for a triangle $ K_3$ it's: $t(t-1)(t-2)$ But I don't understand how to get it for Cycles $C_n$.

This is a homework question. But I am completely stuck.  My only intuition was to go about it inductively from a "greedy algorithm" maybe know as the deletion-contraction algorithm. And to somehow use the information about the jth cycle to solve the j+1th. But I'm not sure how I'd do it. Thank you very much for looking this over.


Why is the infrared heat from the sun not prevented from entering the earth's atmosphere by $\rm CO_2$ to the same extent that it is prevented from leaving the Earth's atmosphere?

We are all told at school water vapour and carbon dioxide are the top two greenhouse gases, and that they absorb thermal infra red radiation, trap heat and warm up the Earth. My question is how do they do that? Why can't Oxygen or Nitrogen or any other gas not absorb infra red radiation as well as water vapour or CO2?


I don't understand why my simple loop in vba not working as I want. I would like to make a diagram and loop through the x axis values with a step = 0,01. I cut out part of the code, probably not necessary for this question. My problem is that the generated values are not exact. It should be something like: 0; 0,01; 0,02; ... and so on but around 0,82 the cell value is: 0,820000000000001 and after that the error goes on. This little bit of difference between 0,82 and 0,820000000000001 is not much but makes a lot of problem for me. For example: in the loop I can not use this: If x = 0.82 ...  because it is not going to be equal. I can cure this problem but there are others and maybe there  is a simpler solution. Here is the code: Sub Generate_Punch()   Dim NoL As Integer NoL = Worksheets("Punch").Range("D5").Value 'Number of loops  Dim d As Double d = Worksheets("Punch").Range("D4").Value 'value of increment/step   'which line start Dim i As Integer i = 15  'Coordinate values: Dim x, y As Double x = 0 y = 0   Worksheets("Punch").Range("A" & i & ":F32767").Clear  For j = 1 To NoL          'Counter     Worksheets("Punch").Cells(i, 1).Value = j          'X coordinate values:     Worksheets("Punch").Cells(i, 2).Value = x      '.... .... ....          i = i + 1     x = x + d Next j  End Sub  Thank you for your answers. Best regards, Robert

Consider the following code:   0.1 + 0.2 == 0.3  ->  false   0.1 + 0.2         ->  0.30000000000000004   Why do these inaccuracies happen?


This is regarding normal sentence case. Here are some examples:  Bob got arrested by the FBI. Maybe The Crystal Method is the best band ever. Attitudes in the West are fairly consistent against polygamy. Yesterday, after seeing two skinny girls make fun of her, she went to The Bad Place. (i.e. she did something self-harming)  Are there any other types of "the" usage possible? And which of these have a set capitalize, and which require a style guide to settle?

When I was a youngster some mumble-mumble-mumble decades ago, I was taught that, in the instances of names of persons, places, and things which carried the definite article the, the article wasn’t capitalised.  Hence, the Batman, the Empire State Building, the Medal of Honor.  In the last twenty years or so, I have seen the capitalisation of the in names proliferate.  Now, it’s The Batman, The Empire State Building, The Medal of Honor.  When I point this out as an error, I’m generally met with the argument, “No, those are names, and all words in a name are capitalised.”  Did I get it wrong, way back when?  Or is it one of those things in which style has trumped rule, and now the standard is to capitalise the definite article in names?


Given a triangle in a plane with vertices A, B, C, find the point T that minimizes the sum of distances between A-T, B-T, and C-T.  I can experimentally determine this point by sampling the space and finding the minimum via an attractive, interactive web page:   Drag any vertex to see the gradient of value sums change and the point T be updated. I find it interesting to note that moving any vertex towards or away from T does not affect T, until the point where the vertex touches T and causes it to move along with it.  However, an experimental determination is neither efficient nor accurate, and prevents me from graphing other interesting properties such as the arcs of the vertices when a fixed sum is required.  Please help me find the equation for T (preferably in terms of vectors, as the answer should be the same in 2D or 3D).  Edit: Based on the answer, I've created an updated interactive using the calculated point and showing the construction:

From Wolfram , I know there is a Lemoine point of triangle, also called symmedian point, the sum of squared distances of this point to all the three sides is algebraically minimum.    How to prove such a property?


I'm relatively new to blender, working on a tutorial that's supposed to train me on how to use it on youtube.  One part doesn't seem to match up as you'll see. Here's what you see on the tutorial when he clicks "Composition"    it has this modal that's supposed to help with denoising the image.  Here's how it looks on my end, from the layout    with my donut so far, and when I click composition I'm missing that modal    I'm guessing you can add it, I just don't know how to.  My current version is 2.8.2

I am trying to follow Blender Guru's beginner tutorial. He went to the Compositor tab and was using it to Denoise an image but when I got there, no nodes show up. Can you guys help?


I'm finding this question particularly difficult to answer. Could someone help me, please?   Edit: I have seen the use of the notation ker which I know translates to kernel, in some solutions, but this notation is not used in my course on Group Theory. What is the alternative solution to this?  Armstrong question 11.11

I have the following question:      Let $G$ be a group and let $H$ be a subgroup of finite index of $G$. Let $|G:H|=n$   Then it holds: $g^{n!}\in H$ for all $g\in G$.   Why is this true?  I think, that's not very difficult, but I have no idea at the moment.   Thanks!


I'm making a simple calendar using javascript for my task. I tried to add a class on the day that the column will be selected. But i got problem with that if i did on this day that code successfully, but if i did on next/prev month it's not working. How do I resolve this?  here's my code :    <button class="btn btn-default prev"></button> <button class="btn btn-default next"></button>

      *Sorry my english is not very good :)

I have a bit of code where I am looping through all the select boxes on a page and binding a .hover event to them to do a bit of twiddling with their width on mouse on/off.  This happens on page ready and works just fine.  The problem I have is that any select boxes I add via Ajax or DOM after the initial loop won't have the event bound.  I have found this plugin (), but before I add another 5k to my pages with a plugin, I want to see if anyone knows a way to do this, either with jQuery directly or by another option.


I have a method that calculates age; calculateAge(User user):  public int calculateAge(User user) {     String date = null, month = null, year = null;     String[] fields;     String DOB = user.getDOB();     System.out.println(DOB);     fields = DOB.split("-");     System.out.println(fields);     fields[0] = date;     fields[1] = month;     fields[2] = year;     System.out.println(date);     System.out.println(month);     System.out.println(year);     LocalDate birthDate = LocalDate.of(Integer.parseInt(year), Integer.parseInt(month), Integer.parseInt(date));     LocalDate now = LocalDate.now();     Period age = Period.between(birthDate, now);     return age.getYears(); }   The prints are debugging lines, and as of now, this is what they print:  The DOB is 1-1-1988, but fields is [Ljava.lang.String;@6d41a4a instead of displaying the array of fields. As such, date, month, and year are printed as null and it can't Integer.parseInt(null), so it gives me a NumberFormatException: null.

In Java, arrays don't override toString(), so if you try to print one directly, you get the className + '@' + the hex of the  of the array, as defined by Object.toString():  int[] intArray = new int[] {1, 2, 3, 4, 5}; System.out.println(intArray);     // prints something like '[I@3343c8b3'   But usually, we'd actually want something more like [1, 2, 3, 4, 5]. What's the simplest way of doing that? Here are some example inputs and outputs:  // Array of primitives: int[] intArray = new int[] {1, 2, 3, 4, 5}; //output: [1, 2, 3, 4, 5]  // Array of object references: String[] strArray = new String[] {"John", "Mary", "Bob"}; //output: [John, Mary, Bob]


I want to select a number randomly, but based on probability from a group of numbers; for example (2-6).  I'd like the following distribution:   6's probability should be 10% 5's probability should be 40% 4's probability should be 35% 3's probability should be 5% 2's probability should be 5%

I know how to generate a random number in PHP but lets say I want a random number between 1-10 but I want more 3,4,5's then 8,9,10's. How is this possible? I would post what I have tried but honestly, I don't even know where to start.


Hi I am doing a weekly meal prep cooking myself, and was wondering if it's ok to grill steaks medium rare and then put them in the fridge to eat in the next 2-3 days, or bacteria can still develop for that time.

I'm thinking of cooking some steak and storing it for later use in a cold salad. If I cook it to medium rare and cut it into strips and store it in the firdge, will it be safe to eat later? I know any bacteria mostly grows on the surface of the meat so that should be killed when cooked, but is there a higher danger of contamination on the now exposed, less cooked surface area?   If I put it in a clean container I'm guessing the pink parts are just as prone to further contamination as the outer surface.   If kept in this condition, how long should I expect this meat to stay good for in the fridge?  What would be different if we were talking about a partially eaten steak stored for later consumption?


Using Cycles as a render engine, I assigned an empty as a camera Track To target, and as the focus target in Depth of Field, yet rendering the scene, the depth pass is rendering all white, as if there's no depth of field, while the combined pass is rendering just fine, am I doing something wrong?

How can one make a render pass with black and white data to display depth of field based on the Settings > Camera dof settings? I want to blur or defocus in the compositor, similar to the way it is done with the Z pass but with a more accurate dof information that is based on a target, as opposed to distance away from the camera.  I tried to fiddle with the settings in a new Render layer, overwriting the material, but I have been unable to achieve a render pass effect that outputs something useful.


I know the fact that $\lim_{n \to \infty} (1+1/n)^n$ tends to $e$, but how do I use this fact to find the limit of $(1-\frac{1}{2n}-\frac{1}{2n^2})^n$ as $n$ tends to infinity?

I need to show the following: $$\lim_{k\rightarrow \infty} \left(1 + \frac{z}{k}\right)^k=e^z$$  For all complex numbers z. I don't know how to start this. Should I use l'Hopitals rule somehow?