How to check if a subfolder exists and if so add it to the path automatically on cd?

On my Ubuntu machine, I have a lot of javascript / typescript projects.  Each of npm's binary might have a global installation, like tsc at  ~/.nvm/versions/node/v7.10.0/bin/tsc $ tsc -v Version 2.4.2   and it each project will define its own binary at:  ~/src/project/node_modules/.bin/tsc  $ cd ~/src/project && ./node_modules/.bin/tsc -v Version 2.3.4      I have a lot of nodejs / typescript projects, and whenever I call a command, e.g. tsc, I always want to run the project's as the first choice, and only then fallback to the global installation.  I know that npm scripts will always call the command from ./node_modules/.bin/ and hence setting up scripts like:  $ jq .scripts package.json  {   "test": "mocha --compilers js:babel-register --recursive tests/unit",   "start": "node start.js",   "start-dev": "nodemon start.js",   "tslint": "tslint 'src/**/*.ts?(x)' --fix",   "tsc": "tsc" }   would suffice. I could then call:  > pink_elephant@1.0.0 tsc /home/philipp/myProject > tsc "-v"  Version 2.3.4      Yet not all my projects have these scripts defined, and I find handling the arguments via -- annoying.   So in order of making my life as a developer easier, I like to define my path in a way, that whenever I:  cd someProjectFolder   it looks for the existence of:  ./node_modules/.bin/   and if it exists, add it to the path of the current shell.  How can I achieve this?


I have a multiple entry Schengen visa issued by the German consulate in Kolkata that is valid until 26.08.2014. Does this mean I have return within 26.08.2014?   If I enter before 26.08.2014, then can I stay up to another 10/15 days?


cat_is_ancestor_of() for custom taxonomies

I'm trying to use cat_is_ancestor_of() for custom taxonomy categories but it's not working. Is there any other way to check if a category is child of another?


Configuring Postfix relay gmail but why get tatus=deferred (SASL authentication failed; cannot authenticate to server smtp.gmail.com[?

Here is the story, I would like to use POSTFIX relayhost config to send mails to gmail. I use 2-step Authentication and change and double check password and username. everything looks fine in sasl_passwd  >postmap -q smtp.gmail.com:587 /etc/postfix/sasl_passwd Jonh:adfasdfasdfixvl   I am really tired of looking web but find nothing  ANY IDEA HOW TO RESOLVE THE ISSUE ?!  Here is my config main.cf :     postconf -n       alias_database = hash:/etc/aliases alias_maps = hash:/etc/aliases command_directory = /usr/sbin config_directory = /etc/postfix daemon_directory = /usr/libexec/postfix data_directory = /var/lib/postfix debug_peer_level = 2 debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5 html_directory = no inet_protocols = ipv4 mail_owner = postfix mailq_path = /usr/bin/mailq.postfix manpage_directory = /usr/share/man mydestination = $myhostname, localhost.$mydomain, localhost mydomain = local.domain myhostname = host.local.domain myorigin = $myhostname newaliases_path = /usr/bin/newaliases.postfix queue_directory = /var/spool/postfix readme_directory = /usr/share/doc/postfix-2.10.1/README_FILES relayhost = smtp.gmail.com:587 sample_directory = /usr/share/doc/postfix-2.10.1/samples sendmail_path = /usr/sbin/sendmail.postfix setgid_group = postdrop smtp_sasl_auth_enable = yes smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd smtp_sasl_type = cyrus smtp_tls_CAfile = /etc/pki/tls/certs/ca-bundle.crt smtp_use_tls = yes smtpd_sasl_path = smtpd unknown_local_recipient_reject_code = 550   And here is the log why it failed :  Jan 12 00:19:53 gamma postfix/pickup[11859]: A1EFD800DB: uid=0 from=<root> Jan 12 00:19:53 gamma postfix/cleanup[11886]: A1EFD800DB: message-id=<20150112001953.A1EFD800DB@host.local.domain> Jan 12 00:19:53 gamma postfix/qmgr[11860]: A1EFD800DB: from=<root@host.local.domain>, size=456, nrcpt=1 (queue active) Jan 12 00:19:53 gamma postfix/error[11887]: A1EFD800DB: to=<john@gmail.com>, relay=none, delay=0.02, delays=0.01/0.01/0/0, dsn=4.7.0, status=deferred (delivery temporarily suspended: SASL authentication failed; cannot authenticate to server smtp.gmail.com[173.194.78.109]: no mechanism available)


Gmail has an automatic categorisation feature that sorts mail into various categories (social, promotions, updates, etc.). I would like to have an "Updates" tab, but I would like to disable the automatic categorisation so that the only mail that goes into this category is mail that I set up a filter for.  I currently have my mail going into a label, but labels aren't quite as nice as the tabs that categories have.  Is there a way to prevent mail automatically being assigned to a category?


Finding functions satisfying $f(f(x))+f(x)+x=0$

Find the number of continous functions $f:\Bbb R\to\Bbb R$ which satisfy the following functional equation $$f(f(x))+f(x)+x=0$$


Arrange numbers 1 - 15 so that any sum of two adjacent numbers is a squared number

E.g. ...13,3,1,....   I could not think of a systematic way to approach this question.  Have been pondering/making wild guesses on this for days.


I know that technically it's possible to do so using only a birth certificate and US drivers license. However there is a difference between what is technically possible and what happens in practice, so my question is has anyone done this recently? I only ask because my passport won't be here for a few weeks and was hoping to enter Canada and just have a family member FedEx it to my friend's house there. So has anyone tried it recently or know anyone who has?


Is there a guideline to choosing answers?

Here is a situation I am in, and I am unsure of how to address it:  I asked a question (on Startups), and two people both work pretty hard to create good answers.  Neither answer is, in my view, complete, but taken together, they answer the question very well.  My question is, how can I reward the responders and indicate to future page visitors that both answers must be read?  I am sorry to ask such a basic question here, but I cannot find guidelines that outline principles that would apply here.  Thanks in advance.  Edit: Ironically, I ended up in exactly the same situation here.  Thanks to Bart and Andy.  (They got upvotes)


(70s, or 80s Novel) Man with intelligent robotic legs (from the waist down)

In the future a Man was involved in an accident and lost the lower half of his body. He gets a Prosthetic that replaces everything from his waist down. The prosthetic is also cybernetic, (an AI of sorts)  One specific scene I remember is the man was trying to get something from a storage tank/container. (I think it was a rail car) He is half way into the opening trying to reach inside when the hatch closes right on his hips crushing him. (I do not remember if this was the accident that caused him to get the prosthesis or if this accident destroyed his prosthesis. I THINK this destroyed his prosthesis, I vaguely remember his legs AI telling him this was a bad idea to reach in the container)  Possibilities:   I think cryogenic storage is involved in the story. I think he had an accident or illness that caused him to lose his lower body, and was  frozen until they could heal him.  When he awakened, [ran out of  money? Society no longer interested in storing frozen people?] they  could not fix him and gave him the prosthesis instead. He may have re-entered cryo hoping to find a way to replace his prosthesis, and when he awakened again he could still not be fix, I THINK this is when he was reaching into the storage tank and his prosthesis was crushed. I recall at this point, that either he could not afford a replacement or tech had devolved so that no one could make a replacement.  And for a time he was dragging himself around by his hands.   I think he was a bit of a miscreant or minor troublemaker. (would not follow the rules, ie he did not need anything from the storage tank, he was doing it because he wanted to)  This would have been a book in English, Published in Paperback in the USA.


Let $V,W$ be vector spaces. Let's define a category whose objects are linear map $f:V\to W$ and morphisms from $f$ to $g$ are pair of linear maps $(\alpha,\beta)$ where $\alpha:V\to V,\beta :W\to W$ such that $g \circ\alpha = \beta \circ f$.   Does this category have some special name? If $f_i$ are indexed family of objects, is there product of them in this category?


I know that there are cases when RSA will not work like when the number to feed into the system is greater than the modulus. I was wondering if there were any other cases when RSA won't work  I looked all over and tried rephrasing the question in google many times  Edit: I am looking for what cases exist with a valid n, e and d used properly will not encrypt and decrypt correctly eg: message <= n


I am not understanding something very fundamental here , I have read that an RC circuit can be used as a clock source. From this I assume a DC input. Playing around with my oscilloscope the only time I see an RC circuit oscillate is with an already oscillating input, throwing in a DC input there is no oscillating just the obvious blocking of DC by the cap, so how does an RC circuit work as on oscillator with a DC input? And I know you can make fancy ones with more components but I mean a very simple resistive/capacitive circuit? Thanks in advance.


UnixTree (XTree for Unix Systems) does not appear in color

I am trying to use UnixTree (www.unixtree.org) on Ubuntu 16.04 LTS via the Ubuntu Terminal.  If I run the application "xt" I get the following error:  $ xt No term file or database entry found for term "xterm-256color" xt: cannot initialize terminal.   I got around this error by setting:  $ export TERM=xterm $ xt   And the application starts. However, it starts in the same color scheme as the terminal itself, which makes the application unusable since the color highlighting of selection is critical to its use as seen in image .  Screenshot of my view:   I tried launching the application using the following option according to the UnixTree manual:  $ xt +w   Which should launch UnixTree in a new window, with full color and mouse functionality but it does not work, the application still opens in the same window without color.  I also tried launching the application from xterm itself, but it appears black/white as well, same as xterm itself.  However, I prefer to use Ubuntu Terminal at this time.  Anyone have any suggestions? Thanks!


What is the proof, without leaving the Earth, and involving only basic physics, that the earth rotates around its axis?  By basic physics I mean the physics that the early physicists must've used to deduce that it rotates, not relativity.


Can we have the ability to retract a flag on a deleted post?

Can we introduce a way to retract a flag on a deleted post or comment, or on any post, from the "Flags Raised" page?  Right now, you have to go to the post to retract your flag, but it might be deleted.  A few times I've raised valid flags on an abusive comment or a troll's post, only to receive the message:  Declined - A moderator reviewed your flag, but found no evidence to support it.  or to see that my flag is still pending, but the offensive post is gone.  Ten thousand reputation is a lot just to have this simple feature, and being able to do this would also save the moderator time to review the flag.  Does anybody else see this as a good feature?


How should I present a slideshow consisting of PDFs?

I need to present a slideshow on a projector. I know that if I use  it can send a seperate image to the laptop screen and the projector.  If I have some other application (like a PDF viewer) being used to view the slideshow, how can I make the presentation display on both the screen and the projector?


I see entries describing BTRFS on Ubuntu 12.04 has some concerns due mostly to the maturity of the BTRFS product.  Now that we have 13.10 available, is the BTRFS file system reliable?


How to remove known hosts from Windows 10 SSH?

I am using Windows 10's built-in ssh client and would like to remove an entry added to the list of known hosts.  Where is this stored?


Problems with package managers (aptitude and apt)

My problems in Aptitude: I keep getting this error  E: The method driver /usr/lib/apt/methods/http could not be found. W: Is the package apt-transport-http installed? And I can't update anything, if I'm installing I get this:  E: The method driver /usr/lib/apt/methods/http could not be found. E: The method driver /usr/lib/apt/methods/http could not be found.   or sometimes this with the log above:   E: Internal error: couldn't generate list of packages to download   And when I installed Aptitude just earlier, it uninstalled apt.  My problems with apt:  Sometimes, I can't use sudo apt-get update and sudo apt-get upgrade.  I forgot the rest because I can't do it again because Aptitude uninstalled it. PLEASE HELP ME!


I'm trying to add CSS to wp_head, from within the method called to render a shortcode. I know that wp_head does not take any parameters, so I'm trying to figure out the following:  The method called by WP to render the shortcode has two params, $atts and $content. What I'm trying to do is generate instance specific CSS from the $atts provided, and add it to the header, rather than rendering a  tag in my method, I'd like all of my CSS in  one spot (I'm adding a numerical ID to each rule, which allows custom CSS even if its the same shortcode).   The troubles I'm having:   I can't just pass a string to wp_head using add_actionm it requires a function Because I need the $atts provided by wordpress, the function has to accept a parameter, which php 5.2 doesn't support (minimum supported php version for WP). WP doesnt have a way to called something like.. content_for in rails, so I cant just append it and put it where I want.   I've tried filters, actions, *wp_add_inline_styles*, and even globals with no success. Any help would be greatly appreciated.


Fix Broken File Permissions On Ubuntu Server

I have a VPS running Ubuntu 16.04  I changed the owner of the root directory (/) recursively to root.   I was young and stupid (this happened about an hour ago but never mind). Various things don't work correctly now including a website in the /var/www/html folder. I searched far and wide for a solution but only found either OS-specific instructions which didn't work for me or the instruction to reinstall which, as you might guess, is not what I want to do. I'm looking for a way to restore all file and folder permissions to what they were before without individually finding and changing them. If someone provides a link with instructions which might not be understood by a noob who goes around changing permissions recursively in the root of a linux server then please explain or simplify what the link says.   Thank you all in advance and I hope this issue gets solved as soon as possible.  -user9123


Why am i a getting little green dashes and a green box in my code in MVS 2010?

I am new to c++ and I am having a problem with Microsoft visual studio (2010). I know there are supposed to be better c++ ide's but this is the one my school has us use. So, my problem is:  There is a little green box appearing in the text of my code file. It is pretty small, but I cannot erase it. It is always there in the top corner and moves to the right of my code as I type. Additionally, when I try to make a space I get a little green dash instead. Why is it doing this and how can I fix it?  Before this started my laptop windows key in between the ctrl and alt button got stuck and I had to turn off the computer and brute force it back into place. I am assuming it is possible that before I did that I may have inadvertently turned on something that I don't want or understand!  Thank you in advance for help.  edit - Here is a link to a picture:


Should I apply for a MA or a PHD(in mathematics) after undergraduate study?

I am entering my 4th year undergraduate BS math program next month. I am certain I will want to do a PhD program eventually but I am not sure if I should do a MA before it.  I have decent undergraduate non-math grades(8.8~) and pretty good math grades (9.8~). I also have done quite a few graduate courses(most of them self study) in various topics: Algebraic number theory, Algebraic topology(homotopy, homology, cohomology under a professor), Lie groups, Galois theory(introductory), Model theory(under a professor), Universal Algebra(under a prof), Set theory(under a professor) and Functional Analysis.  I also expect close to full on my gre subject test(from mock tests).  I am not sure how much value this adds and/or how to present it properly but this is all I have to show for my undergraduate years. Under these circumstances, what would the chances of acceptance into a very good PhD program be? I would like apply to an algebraic number theory/logic oriented program(like Berkley and UCLA). Also, what is the best way to make them aware of my self study? Do I mention it in my statement or should I ask my professors to mention it for me?  What are the benefits of doing a MA before PhD or vice versa?   Edit: In response to one of the comments, my career goals are to eventually get a research position in math(maybe academia, maybe elsewhere but definitely pure math oriented research).


How to deal with this NullPointerException?

I was making a program where it would count how many times every word was used in a random paragraph. It compiles, but when i try to run it its giving me a NullPointerException.  Here's the code:  import java.util.StringTokenizer;   class Count {     int count;     String name;      void SetCount(int c, String n)     {         count = c;         name = n;     }      void Show()     {         System.out.print("Name=" + name);         System.out.print("Count=" + count);     } }  class Contains2 extends Count {     public static void main(String args[])     {         String s = "Once you have made it to the box office and gotten your tickets, you are confronted with the problems of the theater itself. If you are in one of the run-down older theaters, you must adjust to the musty smell of seldom-cleaned carpets. Escaped springs lurk in the faded plush or cracked leather seats, and half the seats you sit in seem loose or tilted so that you sit at a strange angle. The newer twin and quad theaters offer their own problems. Sitting in an area only one-quarter the size of a regular theater, moviegoers often have to put up with the sound of the movie next door. This is especially jarring when the other movie involves racing cars or a karate war and you are trying to enjoy a quiet love story. And whether the theater is old or new, it will have floors that seem to be coated with rubber cement. By the end of a movie, shoes almost have to be pried off the floor because they have become sealed to a deadly compound of spilled soda, hardening bubble gum, and crushed Ju-Jubes";         int size, i, count = 0, j;          size = s.length();         String[] test = new String[size];          Count[] c = new Count[size];          StringTokenizer st = new StringTokenizer(s, " ");             while (st.hasMoreTokens())         {             for (i=0; i < size; i++)             {                 test[i] = st.nextToken();                 c[i].SetCount(1, test[i]);             }         }          for (i=0; i<size; i++)         {             for (j=0; j<size; j++)             {                 if (c[i].name.equals(test[j]))                     c[i].count+=1;             }         }          for (i=0; i<size; i++)         {             c[i].Show();         }     }    }


Apex callout to a SSL endpoint: unable to find valid certification path to requested target

since some days I get the following error message when I call an webservice from SF:  PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target   I have read different other comments etc. here but I still do not have a clue why this happens. When I check the remote site with:     and enter my subdomain: subdomain.example.com everything besides the following is green:  The server is not sending the required intermediate certificate.   But I do not think that this is the point or?  What I know:    Simple GET request with Basic Auth Postman call works   When I go to global settings and turn off 'SSL Verification'  Curl call works SF do not work round about from the 28th of January. Was working all the time before. There is/was a Self-signed certificate in SF that expires on the 28th   This certificate is/was def. not used in Apex code  I'm not sure if this self signed certificate was even used for this service or was just there (because SF creates one) The webservice is running on a Tomcat The certificate chain from the endpoint is valid (see pic) Admin of the tomcat server told me that he couln't find the 'old/expired' certificate anywhere.   So what would be the next steps here?   Create a new self-signed certificate and add it to the webservice in tomcat? How this can be checked besides SF callouts?   I'm happy about any ideas/recommendations.


Do I need an airport transit visa for Dublin, Ireland en route to the UK?

I am Haitian, and traveling with a Haitian passport. I have to go to London with a work permit (tier 2 visa) on the 29th of July but I have 2 hour transit in Dublin.  Do I need a transit visa? Can I get it at the airport?  I also have a valid US visa.


How to prove $~a+aq+\cdots+aq^r = \dfrac{a(q^{r+1}-1)}{q-1}~$ via induction?

Prove by mathematical induction that, for $q\ne1$, and integer $r\ge 0$,   $$a+aq+\cdots+aq^r = \dfrac{a(q^{r+1}-1)}{q-1} $$    Unsure where is my $~n~$ to sub my $~k+1~$ in this case, as there are $~3~$ variables.    Will require a really simplified answer if possible, beginner discrete mathematics.    Edit: Selected Rick's answer as his was more complete, but I personally understood through Marty's method. Thank you all for taking a look at my question.


If steam and water, both at 100 °C, were exposed to a person's skin for a small time interval, which would result in a more severe burn?

Imagine that you had two boxes with of steam and water of equal mass, both at $100~^\circ\rm C$, and you decide to expose your left land to the steam and your right to the water for a short period of time. Which hand would 'feel hotter' (i.e if you were to take your hand out and measure its temperature, which would be higher?  The common answer is that the steam but that answer assumes the steam condenses, which would result in a large heat transfer during the phase change. If your hand and the steam or the water are allowed to reach thermal equilibrium then it would make sense for the steam to transfer more heat since it would transfer extra heat equal to its heat of vaporization. But in a scenario where you are not in contact with the water or the steam for very long, the steam would not condense(thermal equilibrium is not reached).  The heat of vaporization of water is quite large, so it should take a decent amount time for all that heat transfer to take place (time that is not available in this scenario). Taking the rate of heat transfer between the steam and your hand and the water and your hand into account, will the heat transferred by the steam and the water be any different?


Running two independent instances of Chrome

I use Chrome as my main browser.  I also spend a lot of time on a particular webapp that my company uses.  I'd like to keep those two things separate.  I can run the webapp in a separate window - but I'd like to go further than that.  I'd like to have it be identified by a different task in the Win 7 taskbar; ideally a different icon; and ideally a different title in Process Monitor.  How can I run a second, independent instance of Chrome, with a different title and icon, that won't merge with my main Chrome browser.


Centos iptables: No chain/target/match by that name

I had a CentOS6.7 with OpenVZ. Now, I just uninstalled OpenVZ and start using Plain CentOS6.7. Due to some difficulties for using cPanel in OpenVZ.  I noticed one problem when install csf in my plain server.  Error:  iptables: No chain/target/match by that name.  this error comes only when using -m state option with iptables.  Message Log : FATAL: Error inserting xt_state (/lib/modules/2.6.32-358.el6.x86_64/kernel/net/netfilter/xt_state.ko): Unknown symbol in module, or unknown parameter  Dmesg Log : nf_conntrack: Unknown parameter `ip_conntrack_disable_ve0'  Can someone give any idea and please share some troubleshooting link if you have ?.  Thanks


In Order of the Phoenix, Sirius confesses he is related to the Weasleys, and that all Pureblood families are related to one another. I was thinking about this, and realized that James Potter was from a Pureblood family.  Who is Harry related to, and does he end up married to his 4th cousin twice removed?


Clip specific layer by bounding box with ogr2ogr

I am looking to use ogr2ogr to clip a specific layer (Towns) from an sqlite/gpkg data source to a bounding box. R is not necessary for running the code below it just makes it reproducible by providing an example dataset. Here is what I've tried:  library(sf) input_gpkg <- system.file("sqlite/test3.sqlite", package = "sf") st_layers(input_gpkg)      Driver: SQLite       Available layers:      layer_name geometry_type features fields      1      Towns         Point     8101      5      2   HighWays   Line String       10      2      3    Regions Multi Polygon       10      2   system(paste("ogr2ogr -f 'GPKG' -clipsrc 1077228.72991008 4218298.82092178 1211486.08907174 4469736.19302021 output.gpkg", input_gpkg)) st_layers("output.gpkg")      Driver: GPKG       Available layers:      layer_name geometry_type features fields      1      Towns         Point      433      5      2    Regions Multi Polygon        1      2      3   HighWays   Line String        0      2   I tried setting the clipsrclayer flag but I get the same result.  system(paste("ogr2ogr -f 'GPKG' -clipsrc 1077228.72991008 4218298.82092178 1211486.08907174 4469736.19302021 -clipsrclayer 'Towns' output.gpkg", input_gpkg)) st_layers("output.gpkg")      Driver: GPKG       Available layers:      layer_name geometry_type features fields      1      Towns         Point      433      5      2    Regions Multi Polygon        1      2      3   HighWays   Line String        0      2   How can I have the output contain only the Towns layer? I do not want a solution that involves loading the entire Towns layer into memory because of the possibility that it will involve a huge number of points and kill performance.  See also:


Getting hard disk drive serial number at the terminal - not the WWN

WWN = world wide name Seagate Constellation ES, model ST3500514NS, a 500 GB 3.5" SATA drive It has "serial number", 9WJxxxxx which is eight characters. It has WWN 5000C5002E47xxxx which is a 16 characters. Both are printed on the label on the hard disk drive. WD model WD4001FFSX, a 4 TB SATA drive It has "serial number" WMC5D0Dxxxxx which is 12 characters. It has WWN 50014EE003Fxxxxx which is 16 characters. HGST, model HUC109060CSS600, a 300 GB 2.5" SAS drive It has "serial number" KWJTxxx, also eight characters. It has WWN... I don't know; it is not printed on the label and not plugged into the system to find out.  For inventory, we generally write down and track the following, which can always be gathered from the label on the drive:  Manufacturer Model number Serial number Size in GB or TB, and connection type which is either SATA or SAS Location where in use, or in storage when not in use  The problem arises obviously 1, 2, 3 years later when an inventory sheet shows whatever hard drive. You are pretty sure it's in a running server, but you don't want to shut down the server to pull the hard drive to read the label. How do you get the serial number of the drive that corresponds to what is on the label? udevadm info --query=all --name=/dev/sda has ID_SERIAL, but that is the WWN. We don't want another field to track the 16 characters of the WWN as an identifier... And I already hate writing down the long serial numbers of WD drives. Is there a way in Linux to extract the serial number of the drive? I believe it is possible because years ago the RAID storage manager GUI we had been using nicely reported the eight-character serial numbers of Seagate drives that were in use. And that RAID hardware has listed a bunch of Seagate-specific hard disk drives that were "officially supported", and if memory serves, really no other make/model of drives. Is it possible this is hard disk drive firmware related, meaning it can be done on certain make drives and not others?


Centering Two Matrices and Putting Them Side By Side

Here is the portion of my code that is rather bothersome:  \begin{center}      \begin{matrix}       E_1  \\       E_2      \end{matrix}      \begin{bmatrix}        1 & h & 2 \\      -5 & 15 & -12      \end{bmatrix}  \end{center}   And the result is    How do I go about getting the E_1 E_2 column to the left of the bmatrix?


How to create magnified subfigures and corresponding boxes for portions of a large image

Updated Below  I hope the title gets at what I'm trying to do. I have a large image for a thesis on an image processing topic, and I want show the large image, with zoomed in boxes (typically with the same aspect ratio). I also want colored frames overlaid on the large image to show what portions I'm magnifying. Here's an example:    I am currently accomplishing this by taking the large image and copying the desired zoomed areas into seperate images, and creating the overlaid frames, all in MATLAB. I then use the technique discussed in this  of mine to align all the images nicely.   My new question is, can a similar end product be created entirely within LaTeX so that the only external file I need is the original large image, and some LaTeX component (I'm thinking Tikz, but open to suggestions) creates the overlaid frames and cropped/ zoomed copies of it, then either arranges them as shown in my example, or uses the technique  to align them nicely.   Also, the example I showed is just a sample layout; ideally any solution would be flexible enough to allow rearrangement to some other reasonable arrangement, such as large image on top (full linewidth) with two or three zoom boxes in a horizontal line under it.   Thanks.  The image I'm working with is here:    Update  Please see Jake's response below for current best/ complete version of code. The only outstanding item is that, while subcaptions work and can be referenced with \subref{}, the spy library processes the labels multiple times, resulting in a warning about multiply defined labels.   As such, I have elected to not use subcaptions/ labels for now since the color-coding makes pretty clear the relationship between the zoomed images and the large one. The subcaptions can be removed by replacing the line   \newcommand\phantomimage{\subcaptionbox{\label{\pgfkeysvalueof{/tikz/subfigurename}}}{\phantom{\rule{\imagewidth}{\imageheight}}}}   with  \newcommand\phantomimage{\phantom{\rule{\imagewidth}{\imageheight}}}   I've started a separate question  about the multiply-defined labels with spy problem. I'll update this post again if any solution comes out of the new question.  Final Update   The subcaption issue has been resolved. Please see Jake's response below for final code and usage.


If I am writing a tour description, what is the correct way to write up days and nights? For example in this short description:  'Summit Java's highest peak for sunrise, trek through lava fields and camp in stunning spots. 4 days, 3 nights.  Your adventure includes:   4-day guided hiking 3 nights camping Return transfer from....'   etc  Would it be different if it was 1 day, or 2 days? (or 1-day or 2-days?)  We are trying to stick to AP style, but it is not clear on this subject. If someone can clear this up we'd be very grateful!


Over the definition of Joule in relation to a vector quantity

I was thinking about the unit of measure of the Energy (as well as Heat and Work) which is Joule  $$\text{J} = \frac{\text{kg}\cdot \text{m}^2}{\text{s}^2} = \text{N}\cdot \text{m}$$  But again, watching the very last expression I realized that that is the same unit of measure of a vector quantity, namely the Torque or the Moment of Force.  How is that possibile, since the Joule represents a scalar quantity?  Isn't it a bit ambiguous?


Post-retirement plans for Ruby package in Precise 12.04LTS?

Now that Ruby 1.8.7 is , is it at all possible that the default ruby package in precise might be updated all the way up to 2.0?  I understand that backporting is generally not done with Ubuntu releases for concerns of breaking people, but in this case we're dealing with a deprecated package that might either already have security issues, or have more of them discovered in the future without any chance of them being fixed.  What's the plan? Will 12.04 march on with 1.8.7?


How to mark the inverse of a line length using Geometry?

Using some Geometry construction, how can we show the length 1/c on this figure (so that we end up depicting the inverse length)? Bottom line, You can make any construction, but given length c of this right angle triangle, show/create/mark something which equals 1/c.  Assume length b = 1 unit.


Reporting Cox & Snell and Nagelkerke in logistical regression

As part of an assignment, I've been asked to report Cox & Snell and Nagelkerke values for my (logistical) regression analyses. I have been asked to interpret them as well as discuss what they suggest for the data.  I am a bit confused to what they show, and how I should report them. Also, how do I know if they're important? I am really stuck on how to answer this question.   Many Thanks


How to solve "Unable to locate package update" when doing sudo apt-get install update

When I want to update packages it shows this error:  gopi@Gopi-PC:~$ sudo apt-get install update [sudo] password for gopi:  Reading package lists... Done Building dependency tree        Reading state information... Done E: Unable to locate package update


Add external project to subversion repository

I would like to have the following structure in my SVN Repository  External    - MVC    - MVCConttrib    - NLog   I want every team member to be able to check out the External repository so nobody has to look up the SVN urls for the underlying projects, but I want the projects in the repository to be updated from their respective (external) URLs.  How can I accomplish this?  I hope my explanation is not too confusing but I don't know how else to explain it.


Shell, howto extract letters from $line1="Test this... test this!", and print one by one

I am writing a script, which I would like to spice up a bit.  What I need, is a loop, which takes one letter at a time, including space, and then write it on the screen, like an old typewriter would do.  I would write some kind of pause/sleep between the typing, so it would look retro like.


I'm new to LATEX and having a tough time doing my homework and properly formatting code. As you see, the spacing is out of whack and the beginning of each line for each instruction does not line up. Could anyone recommend a better way to make sure they line up? Thanks.   P.S. - I tried using \quad, but it doesn't seem to work when it is the first instruction on a line in a LATEX document.  \indent \indent $IF\ Z_1 \neq 0\ GOTO \ C$\\ $[B]$ \indent $X \leftarrow X - 1$\\ \indent \indent $Y \leftarrow Y + 1$\   Rendering:


How to set CanDestroy to only destroy one type of wool?

I'm making a map and I'm trying to give the player an item that can only destroy one type of wool. So far this is the command I have:  /give @p minecraft:brick 1 0 {CanDestroy:"minecraft:wool"}


Suppose $F(k,x)$ be a secure PRF over $(\mathcal{K},\mathcal{X},\mathcal{Y})$ where $\mathcal{K} = \mathcal{X} = \mathcal{Y} = \{0,1\}^n$ $$F'(k, x) = F(F(k, 0^n), x) \; $$ Trying to get the intuition to prove it is secure PRG else given will be not by contrapositive... but cannot from the reduction of it. How to formulate it to prove it is secure?


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


I've discovered that the sum of each row in Pascal's triangle is $2^n$, where $n$ number of rows. I'm interested why this is so. Rewriting the triangle in terms of C would give us                $0C0$ in first row. $1C0$ and $1C1$ in the second, and so on and so forth. However, I still cannot grasp why summing, say, 4C0+4C1+4C2+4c3+4C4=2^4.


I have a PCB with documentation. In the documentation, there is referred to specific pins of several jumpers and connectors. On the PCB however, there isn't a label or so for which pin has what number. I need to figure out which pin has which number, so that I know the function of each physical pin.  I noticed all connectors have all pins with a rounded tin pad, whilst one pin (either the first or the last when counting from right to left) has a square tin pad:     Is it some kind of convention which number this pin has? After that, how to count the other pins?


is Photron Stedy Pro 560 compatible with canon 600d

I want to know that is  compatible with canon 600D. It's head will be set with 600D?


Using Static Variables in a Custom Module

I'm trying to define a static variable for use in my custom module. I want it to let me pass a number from function to function. I'm using drupal_static() but I can't get it to work. How do I do this?  This is the code I'm using to define my static variable.  $var = &drupal_static(__FUNCTION__); if (!isset($var)) {   // generate contents of static variable   $var = '8'; } return $var;   I've tried putting it in a custom module.    function viewusercontact_locateuser($value, $key, &$counter) {    global $user;     /**********In here***********/     if ($value['uid'] == $user->uid) {       ........    } }   I can't seem to get it to work. What am I doing wrong?  (I got my code from the following guides)


I am trying to install GIMP through the terminal.. But The following error is showing..  The following packages have unmet dependencies:  gimp : Depends: libgegl-0.3-0 (>= 0.3.0) but it is not going to be installed E: Unable to correct problems, you have held broken packages.   Help is appreciated.


I have the following class and I want to call the Get method on this class. The problem is that I dont't have the type T. I have the string name of type T, that's all.   What I want is some thing like: This class is also registered with structure map but I dont how I can use it in structuremap  string name ="FooClass"; //Get IBaseCodeService<FooClass> then call Get method public class BaseCodeService<T> : IBaseCodeService<T> where T : BaseCode     {         readonly IAttributeUow uow;         public BaseCodeService(IAttributeUow uow)         {             this.uow = uow;         }          public async Task<IEnumerable<T>> Get()         {             using (uow)             {                  var repo = uow.GetCoreRepository<T>();                 return await repo.GetAll().ToListAsync();             }         }     }


Add close as belongs on programmers.stackexchange.com to stackoverflow

Now that  is , can we get the "close as belongs on" added for it to StackOverflow? See also: . I'm re-asking since that was apparently asked before the site got out of beta and was marked as a bug report (status-by-design).


Does auto increment on Primary Key prevent concurent inserts?

I have a Sql Server logging table, that continuously is being inserted into, I want to revise the design of this table.  Currently, we are using a GUID as the PK,  because the software can generate this and we just insert it, and hopefully, multiple inserts won't block each other. However, UniqueId is not a very efficient PK for a table and our indexes are very large and fragmented.  If I change this column to a long with auto-increment enabled.  Will this become a concurrent insert bottleneck?  I do not need my primary key to be in any sort of order, Just a unique id for that row?


How to 'warm up' LED output color without changing the bulbs

I tried to ask this question before, but I don't think I was clear. I replaced my recessed lighting with recessed dimmable LED fixtures.  The bulbs are contained in the fixture, and I don't believe they can be changed. Perhaps I'm wrong about that. They are from Commercial Electric, Model T61.  They are 6" recessed LED swivel fixtures and I really don't think there's any way to change the bulbs inside. If I'm wrong and you know a way to change them, I'd so appreciate it.  They are labeled "soft white", but they are bright and harsh.  They are dimmable, but even at the lowest setting they are pretty bright. So are there photo gels or some other way to "warm up" the lighting to more closely match my old halogens which were just beautiful.


Supply SU password in a bash script, within the script?

The purpose is to restart the machine if it doesn't get an abort command from the user. The problem is that the way the terminals are set up, user must supply SU password for shutdown, init, reboot, etc. commands. We are wondering if it's possible to supply password in bash script itself, maybe using stdin. i.e.:  #!/bin/bash # (script) echo "Terminal will restart in 60s, Ctrl+C to cancel." sleep 60 su - root -c "init 6" < "password"   We are going to try putting the password in a file and stdin that.  Edit: sudo and expect are out as solutions as getting them installed will be impossible due to a massive amount of paperwork for permission and a limited timeframe. Also we would like to use init 6 or shutdown -r rather than reboot.


Runt time error during string manipulation on a character pointer but not on character array

In the following C program,'s' is declared as character pointer and assigned with a string "Fine", now I am trying to replace the first character to 'N' that should result in "Nine". But this program results in runtime error.   #include<stdio.h>  main() {    char *s = "Fine";    *s = 'N';     printf("%s", s); }   whereas, if the above program is changed as following, declaring 's' as a character array, the program runs without any error and output will be "Nine"  #include<stdio.h>  main() {    char s[] = "Fine";    *s = 'N';     printf("%s", s); }   I do not know the reason behind this issue. It would be great if someone explains me. Thanks in advance.


Cannot Add, Remove, Move, or Drag icons from Dock

I'm using OS X Yosemite (10.10.2) and recently I have been unable to drag or move any items on the dock. Right clicking them gives no option for "remove from dock", and the icons cannot be rearranged. New icons cannot be added, old icons cannot be deleted.  I have tried restarting, and resetting dock preferences to default, and killall Dock, as suggested by earlier askers. None of it works.  I heard about problems with PushBullet - but I do not have PushBullet. Just in case, I deleted a lot of random applications. Still nothing works.  I've tried various commands from lots of answerers on other questions. I've consulted the Mac Help pages. Nothing.  Does anyone know how I can resolve this? After resetting my Dock in an attempt to fix it, it is now filled with the default icons too. This is really limiting my productivity.


Why aren't there any fighter carriers in the Star Trek universe?

All of the ships of every species seem to be medium to large vessels with multiple crew members. Why aren't there single fighter craft and carrier ships to transport them in mass?  I've just noticed the difference between Battlestar Galactica and Star Trek, where the former has primarily aircraft carriers, and the latter has battleships.   Wouldn't a huge fleet of small fighters be extremely maneuverable and possibly stealthy?  Update:  For clarity, my question is not about the Federation and their choice of ships, but the universe at large. I would think there would be some diversity in space warfare strategy, such as huge armadas of fighters with base stations / carriers.


Why is the gradient the vector of strongest slope?

I'm struggling with the interpretation of the gradient. The gradient of a function is orthogonal to the tangent on a particular point, which makes perfect sense from its definition (its scalar product with the derivative = 0)  But I have also read many time that the gradient can be seen as the vector with the strongest slope. I have drawn a sketch, to try to understand this, with an univariate function (of variable x). MM'=dx.    Here, you can see that it has nothing to do with the slope of the function, since it's not following it, it's orthogonal. What did I misunderstood in this concept?


Related:    Today, we had . This sort of sparked me into coming up with a new feature-request (Can't find a dupe, surprised).  Basically, we should have more control over what does and does not appear in the multicollider. This includes:   Muting comments and/or answers on a specific post. Muting comments from a specific user Ignoring all comments not addressed to you in a post of yours (I don't think this is that good, though--many times comments address both the OP and the other guy). Ignoring certain chat rooms The ability to make answers/comments on posts written by others to ping your multicollider.   Note that "Mute" could mean that it shows up in the inbox, but doesn't trigger the colorful glowing circle on the multicollider.    With the new "notifications" thing, there may be some scope in making certain notifications opt-in or opt-out (not all of these exist, but many would be useful in the notifications tab):   Notification of rejected edit Notification of  posts Notification of change to favorites Notification of certain badges Notification of edits Notification of edits to posts you have upvoted Notification of edits to posts you have downvoted (yes, should be separate)  - Notification of edits to posts you have closevoted


java code for testing command line args in range of 1-5

I am tring to do if() for String[] args to check if the string is between 1 to 5  here is my code:  public static void main(String[] args) {     System.out.println(args[0] == "1" || args[0] == "2" || args[0] == "3" || args[0] == "4" || args[0] == "5"); }   the code is returning false when I type anything.  thx for help


$I=\sum_{k=1}^{98}\int_{k}^{k+1}\dfrac{k+1}{x(x+1)}dx$, then which of the following are correct?

$$I=\sum_{k=1}^{98}\int_{k}^{k+1}\dfrac{k+1}{x(x+1)}dx$$, then which of the following are correct?  A) $I<\dfrac{49}{50}$  B) $I>\dfrac{49}{50}$  C) $I<\log_{e}99$  D) $I>\log_{e}99$  My attempt is as follows:-  $$I=\sum_{k=1}^{98}(k+1)\int_{k}^{k+1}\dfrac{1}{x}-\dfrac{1}{x+1}dx$$ $$I=\sum_{k=1}^{98}(k+1)\left(\ln\left|\dfrac{k+1}{k+2}\right|-\ln\left|\dfrac{k}{k+1}\right|\right)$$  $$I=\left(2\ln\left|\dfrac{2}{3}\right|-2\ln\left|\dfrac{1}{2}\right|\right)+\left(3\ln\left|\dfrac{3}{4}\right|-3\ln\left|\dfrac{2}{3}\right|\right)\cdots\cdots+\left(99\ln\left|\dfrac{99}{100}\right|-99\ln\left|\dfrac{98}{99}\right|\right)$$  This is looking like a telescopic terms but middle terms are not cutting entirely.  $$I=\left(-2\ln\left|\dfrac{1}{2}\right|+99\ln\left|\dfrac{99}{100}\right|\right)-\left(\ln\left|\dfrac{2}{3}\right|+\ln\left|\dfrac{3}{4}\right|+\ln\left|\dfrac{4}{5}\right|\cdots\cdots+\ln\left|\dfrac{98}{99}\right|\right)$$  $$I=\left(2\ln2+99\ln\left|\dfrac{99}{100}\right|\right)+\ln\left|\dfrac{99}{2}\right|$$  $$I=\ln2+99\ln99-99\ln100+\ln99$$ $$I=\ln2+100\ln99-99\ln100$$ $$I=\ln\left(\dfrac{2\cdot 99^{100}}{100^{99}}\right)$$ $$I=\ln\left(198\cdot\left(\dfrac{99}{100}\right)^{99}\right)$$  So is $198\cdot\left(\dfrac{99}{100}\right)^{99}>99$?  Is $\left(\dfrac{99}{100}\right)^{99}>\dfrac{1}{2}$, any way to find this if its true without finding the actual value.  Actual answers are $B,D$. Am I missing some trick here?


Windows user here trying to install Ubuntu onto a laptop that has no operating system to speak of. I got an external hard drive setup and it boots to Live okay. However, when I run the installer, it gives me a popup with a row of 6 question marks and will not let me continue the installation (or exit the popup). It occurs right around where you pick what timezone you're in, just after you hit the "Install Now" button on the options menu where you select whether you want to erase all partitions or do your own thing.


how to start a new line after inserting a figure without indentation at the beginning of this new line?

\section{last paragraph} Here are some words in the last paragraph. Now a figure is inserted below. \begin{figure}[H] \centering \includegraphics[width=5cm]{...jpg} \caption[Example .]{.,,} \label{...} \end{figure} Now I want to start a new line after this figure. But there is always indentation at the begining. How to delete this indentation?   Here is the complied result:   I add the usage exmaple:  \documentclass[a4paper,12pt]{article}  \usepackage[english]{babel} \usepackage{graphicx} \usepackage{float}  \begin{document} \section{Paragraph} Here are some words in the last paragraph. Now a figure is inserted below. \begin{figure}[H] \caption{A picture of a gull.} \centering \includegraphics[width=0.5\textwidth]{Penguins.jpg} \end{figure} Now I want to start a new line after this figure. But there is always indentation at the begining. How to delete this indentation? \end{document}   Here is the compiled result:


After Ubuntu install PC still boots straight to Windows XP

I have just installed Ubuntu on a machine running Windows XP. I selected the option to install alongside Windows. Everything seemed to go well. When it finished I removed the boot/install DVD and re-booted. The machine booted into Windows with no sign of Ubuntu.  I checked in the disk management tools and, sure enough, there is the partion created for Ubuntu but I can't find a way to get Ubuntu started.  I expected to get an option at boot up enabling me to select Windows or Ubuntu but that doesn't happen.  Sould I be looking for something else or is it likely that something has gone wrong?  Thanks in advance for any help/advice offered,  Simon.  Edit: I downloaded 14.04, I didn't do anything explicit to dual boot, I expected that to occur as part of the installation. I will check tose links.  Sorry if this is a duplicate ... if I knew what GRUB is and how it is related then I would have searched for it first honestly! I wouldn't expect others to do the hard work for me if I can find an answer:)  Another edit: Progress! There are two discs in this machine and it does appear that Ubuntu created some boot files on the secondary drive as opposed to the boot drive. I am now checking for a solution and will report it here as soon as I find one.  Thanks for the pointers,  Simon.  Last Edit: Fixed it! Thanks for all your help, I would not have found this on my own. The answer for me was to use this:   Thanks everybody,  Simon.


Why exactly is a sample of size 142 too small for 11 variables?

In a (logistic?) regression paper related to credit scoring and involving psychometric data and credit scoring, there are 11 predictor variables used to estimate credit score. The sample size is 142. Intuitively, it doesn't seem enough, but what exactly is the rule of thumb involved for regressions? That involve psychometric data? That are logistic?  the paper:   ZUI slideshow summary:


$\lim_{n \rightarrow \infty} (x^n/n!)=0$. prove. x is finite whereas n is infinite. But increasing n means also increasing $x^n$. It is understandable that if n is too large n! will exceed $x^n$. How it can be proved in a mathematically precise way?


Proper parametrization of a closed curve

Let $\gamma:I\to\mathbb{R}^2$ be a closed plane curve, for simplicity, a unit circle. Therefore, we have $$\gamma(\varphi) = (\cos \varphi, \sin \varphi).$$ What is the proper domain of $\varphi$?  says it's $\varphi \in [0,2\pi]$ with $\gamma(0) = \gamma(2\pi)$. What is the advantage of this domain rather than a domain $\varphi\in[0,2\pi\rangle$ with the additional condition that $$\lim_{\varphi \to 2\pi}\gamma(\varphi)=\gamma(0)?$$ It seems to me that the second definition is much more natural since no point on the curve is repeating, and the usual angle variable in the polar cordinates uses this domain.


How do you manage Labeled and All-Mail unread mails in Thunderbird with a GMail IMAP accounnt?

I use Thunderbird with gmail via imap and do so with multiple accounts.  On the gmail side I have filters that will automatically assign labels to incoming mail and archive it moving it out of the inbox.    On the Thunderbird side it will see the new mail appear in the corresponding folder and the all mail folder -- that's fine but my problem is that they're both marked as unread.  Since I have many accounts I use the unread mail view in Thunderbird's folder panel and what I see is both folders highlighted as unread.  When I read the message in one folder the other only get marked as read I click on it and Thunderbird does another imap transaction.    Is there a configuration that will recognize the same mail in two different folders automatically?


I read a prove that the projective space $\mathbb P_{R}^{n}$ is not affine (n>0): (Remark 3.14 p72 Algebraic Geometry I by Wedhorn,Gortz).  It said that the canonical ring homomorphism $R$ to $\Gamma(\mathbb P_{R}^{n}, \mathcal{O}_{\mathbb P_{R}^{n}})$ is an isomorphism. This implies that for n>0 the scheme $\mathbb P_{R}^{n}$ is not affine, since otherwise $\mathbb P_{R}^{n}=Spec R$.  I am not clear about why is it impossible to have $\mathbb P_{R}^{n}=Spec R$? And is what sense does the $=$ mean here?


How to make my Nvidia Graphic Card is the Default in PES 2015

I had PES 2015 game and it's always use Intel(R) HD Graphics as a default  How to change that to Nvidia ?


What happens when my aasimar Celestial warlock has overlapping class and racial features?

If you are an Aasimar warlock whose otherworldly patron is The Celestial, you will know the light cantrip from both race and class. Additionally, once you reach 6th level in warlock you will have resistance to radiant damage from both race and class.  Is there any ruling on what happens when you have overlapping class and race features?


devel module use anonymous user as author in generate content?

i have been created 'job' content type, i used 'Devel module' to generate content of 'job' type, but in some 'jobs' its taking anonymous user as a author, but i don't want anonymous user as author, so what should i do to avoid anonymous user as a author?


Is a table without a primary key normalized?

In a lecture, my lecturer showed us a table without a primary key. Upon questioning, he said that in 3NF when you remove transitive dependencies it's ok to then have a table without a primary key.  However, no primary key implies there's no functional dependencies - but 3NF is the removal of transitive dependencies, and I was taught that each table needs to have a primary key for normalization as it's all about functional dependencies.  I know it's fully possible to create a table without a primary key, but is that database considered normalized if that table exists?  I should add, the table doesn't have any “unique key”, no primary, no composite, no foreign.  The table shown has three attributes with none of them labeled as primary or unique. I asked if it was a mistake and he said it's fine to not have one. I questioned the remark as none of the information in the table can be uniquely identified and he claimed it's ok to be like this. This goes against what I was taught about normalisation.


What happens when a town is under quarantine and my visa expires

A friend of mine is currently in Wuhan, China, as   He is a European citizen and had thus made a tourist visa to visit the family of his wife for the Lunar new year, but got caught in the middle of the quarantine and lockdown of the city as he is bound to leave soon. He has an extended visa and all is fine for him, but this situation got me thinking:  Say somebody is travelling to a city like Wuhan, and they should leave tomorrow to go back home and their visa is about to expire and the city unexpectedly is locked down under quarantine.   What would this somebody situation be ? Would they be illegally in the country ? Is there some special law that covers these situations or is it an international agreement ?   Just to clarify, I am asking this question just out of pure curiosity, I am not currently in this situation.


What is the American version of the word ''tearaway''? (a young person who behaves in an uncontrolled way and is often causing trouble)

I was looking for a word (a noun) that describes a young person/a teenager who is stubborn, acts recklessly, and likes to show off to draw people's attention (as they think it's cool). I've found the word tearaway, which somehow fits the definition, and would like to know if there is a similar word which is commonly used in American English (besides the word hellion, as I think that doesn't wholly fit what I was looking for like the word tearaway)?


Who was the first person to use the phrase "fun fact"

I want to know when the first known use of the phrase *fun fact" was.  When, where, or who first used the phrase fun fact to mean a small tit-bit of information?


I rendered a scene and all of the textures worked perfectly. I saved, left, and move some textures to different files. now, when I came back and I rendered, part of the texture was missing. Help!


What is the speed of electricity in a vacuum?

I was looking up the difference of the speed of electricity versus the speed of light online and I found that the speed of electricity can approach (up to 90% of) the speed of light at 186,000 miles per second or approximately 300,000 kilometers per second. But, the comparison that I saw was with light traveling in a vacuum versus electricity traveling via a medium such as a cable. So, my question is what would be the speed of electricity in an absolute vacuum? Please help me understand.


Opening current directory from a terminal onto a file browser?

My current directory is buried deep in multiple subfolder layers from my home directory.  If I want to open this directory in a gui-based file browser, I have to double click folder after folder to reach it.  This is very time consuming.  On the other hand, with very few key strokes and several times hitting the tab button, it is very easily reachable via a terminal.  I want to know if there is a way to open the current directory in a terminal onto a a file browser.  What is the command to do this?  For reference, I have an ubuntu system, but I'd like to know what the commands are across the various distributions of linux.


Comments rendered meaningless by the deletion of one of them

I put a lot of effort in writing comments in a conversation, arguing against one initial comment made by another user. That user finally deleted her original comment, as well as an ulterior one, rendering the whole conversation meaningless to any other potential reader.  I can understand that one would not like traces of its past errors to remain forever visible on the Internet, but it is obvious that everybody is exposing himself to that when posting on Stack Exchange, and should accept the risk. The conversation was polite and, to my mind, interesting – deleting it does not do any good.  I find it rude and disserving to the community to thus break a whole conversation. My comments now seem to spring out of the blue – you can guess what that makes me sound like.  If the deleted comment doesn’t come back, I’ll have to delete my comments and consider my time lost. Maybe I’m wrong in caring about that, and I got too invested in commenting what went a bit off-topic (but not that much).  Still, I find this pretty rude on the part of the deleter – although she did post a comment saying that she deleted her comment (actually, she deleted two).  The conversation is here, right below the original question:   I did read  and . So deleting or flagging my own comments as obsolete seems to be the right thing to do now.  But I’m unhappy with the time wasted, and, most importantly, I disapprove of that user’s behaviour. What can I do? Would I be right to comment that such a deletion is rude?


Is homemade jam permitted across US-Canada border?

Next week I will be flying to the US from Canada, and I was planning to bring a couple jars of homemade strawberry jam as a gift for my host.  Unfortunately, both countries' respective border services websites make no mention of whether jam is allowed across the border. It seems that canned fruit is generally permitted, but I don't know whether jam could be included as a "canned fruit" (or furthermore, whether homemade preserves are even permitted under this guideline).  Thus my question is: can a traveller bring a small quantity (2-3 jars) of homemade fruit jam from Canada into the US? (Answers that reference an official/government source would be preferred)


\documentclass{minimal} \usepackage{tikz} \begin{document} \pgfmathparse{random(-5,5)} \pgfmathresult \end{document}   Works, but I have a .0.0 that not supposed to be here.


How do I make post-install scripts so when I reinstall ubuntu everything is as I want it?  Things I want to achive:   Installing PPA  installing my programs themes needs to be installed Settings needs to be changed (power management, short commands, startup applications, etc.) system reboots


What is the difference: "would" vs "will"

Would you please to explain the differences?     For example, this would be the exception to throw if the caller   attempted to use some object before it had been properly initialized.      For example, this will be the exception to throw if the caller   attempted to use some object before it had been properly initialized.


Prove the existence of a graph of 15 vertices with some vertices degree given

this is the exercise:  If possible draw a graph with 15 vertices having 3 vertices with degree 4; 4 vertices with degree 3; 6 vertices with degree 2; 0 vertices with degree greater than the ones of the above.    This is the graph I have done by myself:   my questions are,   the graph I have done is right?  and also, since in the given exercise we have the number of vertices and the degree of some of them, is there exists any theorem or algorithm that says to us if a graph with a certain configuration is possibie to draw? It is labourious sometimes to try to draw a graph going by attempts, and without any certainty of its existance.  Can you help me? Thanks!


Why is it that when proving trig identities, one must work both sides independently?

Suppose that you have to prove the trig identity:  $$\frac{\sin\theta - \sin^3\theta}{\cos^2\theta}=\sin\theta$$  I have always been told that I should manipulate the left and right sides of the equation separately, until I have transformed them each into something identical. So I would do:  $$\frac{\sin\theta - \sin^3\theta}{\cos^2\theta}$$ $$=\frac{\sin\theta(1 - \sin^2\theta)}{\cos^2\theta}$$ $$=\frac{\sin\theta(\cos^2\theta)}{\cos^2\theta}$$ $$=\sin\theta$$  And then, since the left side equals the right side, I have proved the identity. My problem is: why can't I manipulate the entire equation? In this situation it probably won't make things any easier, but for certain identities, I can see ways to "prove" the identity by manipulating the entire equation, but cannot prove it by keeping both sides isolated.  I understand, of course, that I can't simply assume the identity is true. If I assume a false statement, and then derive from it a true statement, I still haven't proved the original statement. However, why can't I do this:  $$\frac{\sin\theta - \sin^3\theta}{\cos^2\theta}\not=\sin\theta$$ $$\sin\theta - \sin^3\theta\not=(\sin\theta)(\cos^2\theta)$$ $$\sin\theta(1 - \sin^2\theta)\not=(\sin\theta)(\cos^2\theta)$$ $$(\sin\theta)(\cos^2\theta)\not=(\sin\theta)(\cos^2\theta)$$  Since the last statement is obviously false, is this not a proof by contradiction that the first statement is false, and thus the identity is true?  Or, why can't I take the identity equation, manipulate it, arrive at $(\sin\theta)(\cos^2\theta)=(\sin\theta)(\cos^2\theta)$, and then work backwards to arrive at the trig identity. Now, I start with a statement which is obviously true, and derive another statement (the identity) which must also be true - isn't that correct?  Another argument that I have heard for keeping the two sides isolated is that manipulating an equation allows you to do things that are not always valid in every case. But the same is true when manipulating just one side of the equation. In my first proof, the step  $$\frac{\sin\theta(\cos^2\theta)}{\cos^2\theta}$$ $$=\sin\theta$$  is not valid when theta is $\pi/2$, for example, because then it constitutes division by zero.


While reading Think Bayes, one of the books by Allen B. Downey, in chapter one, he mentioned an example known by the name The Monty Hall problem :     The Monty Hall problem is based on one of the regular games on the show. If you are on the show, here’s what happens:       Monty shows you three closed doors and tells you that there is a prize behind each door: one prize is a car, the other two are less valuable prizes like peanut butter and fake finger nails. The prizes are arranged at random.     The object of the game is to guess which door has the car. If you guess right, you get to keep the car.     You pick a door, which we will call Door A. We’ll call the other doors B and C.     Then Monty offers you the option to stick with your original choice or switch to the one remaining unopened door.     Before opening the door you chose, Monty increases the suspense by opening either Door B or C, whichever does not have the car. (If the car is actually behind Door A, Monty can safely open B or C, so he chooses one at random.    He then explains the problem, that we are supposed to understand :     To start, we should make a careful statement of the data. In this case, D consists of two parts: Monty chooses Door B and there is no car there.   Next we define three hypotheses: A, B, and C represent the hypothesis that the car is behind Door A, Door B, or Door C. Again, let’s apply the table method :     Figuring out the likelihoods takes some thought, but with reasonable care we can be confident that we have it right:   If the car is actually behind A, Monty could safely open Doors B or C. So the probability that he chooses B is 1/2. And since the car is actually behind A, the probability that the car is not behind B is 1. If the car is actually behind B, Monty has to open door C, so the probability that he opens door B is 0. Finally, if the car is behind Door C, Monty opens B with probability 1 and finds no car there with probability 1   What I don't understand is How is p(D|H) = 1 in C? Because Monty could also open door A. So the  p(D|H) should be equal to 1/2 in C. Also, I don't think I fully understand the reasoning behind case A and B either. Can someone explain this in more details ?


Why is General Theory of Relativity not applicable in the singularity of Black Hole?


Can a prone, entangled character stand up?

This is a pretty straightforward question, but to stand up from being prone takes half your movement speed. When entangled, your speed is 0, so are you able to stand up without becoming un-entangled?


What does X is the new Y mean, and why do we say this?

In English, I sometimes hear a phrase like green is the new black.  Literally, this makes absolutely no sense whatsoever.  What does it mean when someone says X is the new Y, when this makes no sense when taken literally?   gives plenty of examples:          I've found definitions online for specific examples, such as , but overall I don't understand what X is the new Y means, and I can't find it explained anywhere.  What does X is the new Y mean?  As far as I'm aware, this phrase exists only in English.


Order of a product of subgroups. Prove that $o(HK) = \frac{o(H)o(K)}{o(H \cap K)}$.

Let $H$, $K$ be subgroups of $G$. Prove that $o(HK) = \frac{o(H)o(K)}{o(H \cap K)}$.  I need this theorem to prove something.


I run a large and high trafficked WordPress powered platform. One of my editors informed me that our site is blocked at his workspace as a "games site". They use WebCat to filter the traffic.  The issue here is that our platform is not a gaming site, although it does have a games category that covers news. And that is a very minor part of the site.  My question is, what can I do to unblock the site? How does WebCat work? Do they use a universal database to filter the traffic (meaning that the site is blocked on all workspace with WebCat) etc. Obviously they need to improve their filtering algorithm.


Did anyone see this error? I'm not able to understand what code statement did it, as it isn't available in the stacktrace.     System.InvalidOperationException: Collection was modified; enumeration operation may not execute.      at System.Reactive.PlatformServices.DefaultExceptionServices.Rethrow(Exception exception)      at System.Reactive.AnonymousSafeObserver1.OnError(Exception error)      at System.Reactive.Concurrency.ObserveOn1.?.OnErrorPosted(Object error)      at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)      at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)   Application is wpf C#.net using Reactive. There are multiple locations where Reactive is being used, and the collections are locked for read/write operations using lock as a synchronization mechanism.  Note: In the entire code, I'm not iterating through the subscriber list or modifying it as well.


Select jQuery created input element on propertychange

My HTML input is created in jQuery so no handlers by default comes with it. I am trying to get onproperty change  $('#input').delegate('input propertychange', function() { console.log('Hello World'); });   or   $('#input').on('input propertychange', function() { console.log('Hello World'); });   The expected behavior is that when I type into the input that is generated in jQuery, console.log returns the message. Both examples above don't work, any suggestions?  Thanks!  EDIT:  I generate the input this way:  $('#container').append('<input type="text" id="inputidhere" value=""></input>');


SO Blog icon has partial white background when tab is inactive

When you open a tab on the , and switch to another tab, the icon has a partial white background: Firefox (Most obvious) - note the difference between that and the normal Stack Overflow logo  IE  Edge  Tested on Windows 10 with Firefox 41.0.2, Internet Explorer 11 and Microsoft Edge v20.10240.16384.0. (If someone could test this on chrome that would be great)


How many ternary strings of length 4 have exactly one 1?

Answer: Ternary strings have symbols 0, 1, and 2. If there is exactly one 1, then there are 3 positions the one can be in and 2*2*2 ways to fill the other 3 blanks with a 0 or a 2. So the answer is 3*2*2*2 = 24.  I don't understand why there can only be 3 positions the one can be in?


Recently we received new question about question ban:   Member can't ask new questions, the system shows the message:     We are no longer accepting questions from this account. See the Help   Center to learn more.   On MSE I've found this discussion:   Our CM answered that algorithm depends on:   Number of closed questions. Number of deleted questions. Number of flags. Summary ratings. etc   But, still, the formula is not clear. Could you clarify the exact formula? Without understanding how it works exactly, members don't know what they should do to release the ban. All this "contributing positively to the site in other ways" are kinda abstract phrases, that don't help to those people, actually.  It would be great if you add this information to the help center. On  page, for example.


In CGEL page no.126 "I already knew how to do it."[Tr included within Tsit]..., if Tr is internal part within Tsit so this shows imperfective aspect.., is this right or wrong? And also 1) I knew how to do it and 2) I already knew how to do it. Is any difference in these aspect sentences with or without adverb "already"?


What is the exact difference between the game and game engine?

I thought game engine are something like Unity or Unreal. They have a editor with scene editor, some Physics library, some scripting editor and tools to improve the workflow of developer. Furthermore, I thought game engine should independent of the actually game.(i.e.) The game engine should not have any game logic in it.  However, I watched this game engine video and I am totally confused.  . In the game engine video, I don't see the game engine anywhere because it seemed as though the professor developed the game straightaway.  I hope someone can explain the exact difference between a game engine and the actual game.


How to return a bool and a string in a return statement?

I have the following statement: if Game.item_can_move(item_target) == True:     return True + ""  else:     return False + ", error"  but this doesn't seem to work. I would like to return a bool, str in both of the return.


I am trying to write a merge sort function, and this section of code takes the list of ordered pairs of the previous step and creates ordered groups of 4, to be passed on to the next step.     groups = [[]] * ceil(len(pairs)/2)     print(groups)     for n in range(len(groups)):         print(n)         while pairs[2*n] and pairs[2*n+1] != []:             if pairs[2*n][0] <= pairs[2*n+1][0]:                 groups[n].append(pairs[2*n].pop(0))                 print(groups)             else:                 groups[n].append(pairs[2*n+1].pop(0))                 print(groups)         groups[n] = groups[n] + pairs[2*n] + pairs[2*n+1]         print(groups)  So for example, it should take the input pairs = [[27, 38], [3, 43], [9, 82], [10]] and produce groups = [[3, 27, 38, 43], [9, 10, 82]] Instead it produces groups = [[3, 27, 38, 43], [3, 27, 38, 9, 10, 82]] For some reason it seems to be appending the first 3 elements into both sublists when n = 0, and then only appending the elements to the second sublist when n = 1 I don't understand why with the exact same command, the append function appears to be populating both sublists at the same time and behaving differently within the same loop. Any help would be appreciated


The Safari app has disappeared from my iPhone?

I can't find the safari icon on my iphone 4?  I have tried resetting home screen layout and that doesn't work.  My restrictions button is 'on' and it asks for a password for this button.  I don't have a password.  Can you help? Thanks,


Inequality $\frac1a + \frac1b + \frac1c \leq \frac{a^8+b^8+c^8}{a^3b^3c^3}$

Let $a,b,c$ be positive reals . Prove that $\displaystyle \frac1a + \frac1b + \frac1c \leq \frac{a^8+b^8+c^8}{a^3b^3c^3}$  I found this one in a book, no hints mentioned, but marked as very hard. I can't make any progress...


Simple mobile multiplayer game. TCP/UDP?

I'm tying to dive into multiplayer game programming.  The game is quite simple, it's a 2D scroller mobile game, the player need to touch the screen in order to move 1 step and it could contain up to 4 players at max. 1 of the player could create a room for other players to join.  I was thinking that I would use TCP for this and will only send packets when 1 of the player trigger an event like moving or exiting the game. Is my approach is correct? Since from what I've read, many games are created in UDP instead of TCP.  In case of UDP, what is sent between the clients and the server? The position of each entity in the game at a fix time interval?  I'm really new multiplayer programming. I'd appreciate if someone would share their story.  Thank you.


Unzip and 7z with password, without temporary files

Every now and then, I receive a download link for a 6 GB .zip data archive that I'd like to:  download  unzip  recompress with 7z, with a password   I'd like to avoid using temporary files for each step, because it would use ~ 18 GB of write operations on my SSD, whereas only 6 GB are necessary at the end. On Linux, it would probably be wget ... | unzip ... | 7z ... with pipes. How to do this on Windows?  Note: this question is linked to  but not a duplicate, because the linked question only covers the "7z temp" part of the question, whereas I'm speaking about a download+unzip+7z chain. Also I'm looking for a command-line solution, and not a drag'n'drop GUI solution like .


So I just finished a jar of home-made pickles. They were excellent! Not too salty, a bit spicy, very good. They were so good that I'd like to get some more pickles out of that jar. I was thinking of pickling some eggs in that same brine. Is reusing brine ever done? Are there any reasons I shouldn't do it? I've never heard of this being done, but I don't see why not.


If I want to say something like:   The audience,...,who is deeply affected by her loss.  Should I use "which is deeply affected by her loss." or "who is deeply affected by her loss."


I want to run the command HTOP, nethogs, and a bunch of other commands each in its own terminal tab as Ubuntu starts. I always have to manually start a terminal and type the same commands over and over. To be clear I want to:   Open One terminal with multiple tabs on startup In each of these terminal tabs run a different command automatically     $ vim ~/.config/autostart/Apps.desktop  #!bin/bash gnome-terminal --tab Htop -e htop --tab Nethogs -e nethogs --maximize     is that the correct format ? !wine will open a wine command with others, atleast thats how it does now in the terminal. It does not seem to work. Well it will work if you run the program as the root in the terminal. But it will not run after the boot takes place.


Create Third level navigation in SharePoint 2013 on premise publishing site

i have created global Navigation (structural navigation)  on SharePoint online site .  now i am trying to create third level navigation on SharePoint On Premise Site. i have SharePoint on premise publishing site . but i am not able to find Edit Links button .  is that possible to create third level navigation in SharePoint on premise . if Possible/not possible please  share some articles.


How do I install drivers for graphics and sound?

I recently shifted to Ubuntu 12.04 from windows 7. I completely removed Windows and then installed Ubuntu.  However, I can't find a way to download and install drivers for my video and audio hardware like I used to be able to do in Windows. Could someone please explain to me how software and drivers, in general, are installed on Ubuntu. Is installing through 'Ubuntu Software Center' the only way to install them?  My laptop model is: Dell Inspiron 14 N4010 (i5/4gb/500gb). Kindly help. Thanks in advance.


I am looking for the shortest comprehensive way to explain to people that are trying to use DRM as a technology to prevent users from using their data in some fashion deemed undesirable, why their solution cannot work by definition.  Ideally I'd like something that:   Covers why technically it is impossible to have people access local data, but only in such-and-such a way Imparts an understanding of why this is, to avoid follow-on "But what if" rebuttals Is intuitive enough and short enough that even a politician (j/k) could grasp it   When faced with this situation I try to be clear and concise, but I usually end up failing at least on one of these points. I'd really like to have a 'stock' answer that I can use in the future.


When I put the code:  \documentclass{article} \begin{document} \begin{table}[h] \begin{center} \begin{tabular}{|c|c|c|} \hline Air & \multicolumn{2}{|c|}{\textit{Oscilations/180s}} \\ \hline 521&521&522\\ \hline \end{tabular} \end{center} \end{table} \end{document}   I obtain this:    But I would like that the second row, second and third columns, have the same size.  Can anyone help me?  Just another doubt, how can I add a piece of Latex Code in a more estilista way?  Thanks.


I have a Lenovo T430 (with an Optimus graphical system), connected to a Dock Station with an output DVI (a 23" screen is on this output). I have Ubuntu 14.04 Beta 1.  Optimus works great with the last nVidia drivers (nvidia-331) and nvidia-prime.  With the command:  prime-select nvidia   I'm able to use the nvidia card rather than the Intel one. Note that the DVI port on the DockStation can be used only with the nVidia card !   The dual screen is nearly functional, I have my workspace on the two screens, and when I go in the parameters, I see correctly my two screens.  But, if I want to configure a little bit deeper, via nvidia-settings, it sees only the screen on the DVI port. So I cannot manage anything, and the problem is: the system thing I have only one screen. When a new window appears, it's between my two screens. When I "maximize" a window, it's done as if I had only one screen (so my window uses the two screens).  I'm not confident enough to edit xorg.conf or other things by myself, that's why I need your help.  Here a screenshot of the screen parameters settings from Ubuntu versus nvidia-settings:


Is it possible to travel by air in India domestically with only a scanned pan card?

I am from North India. I am thinking of going to Bengaluru via flight but I only have scanned copy of my pan card in my phone. Is it possible for me to travel without Aadar?


Why are complex numbers used in electrical engineering?

When I was in high school, I asked a physics teacher "Why do we use complex to calculate stuff with electricity?" (something along that line) and he said "Because it just happens to work" without further details on WHY it works.  I'm in CS/IT and am not very well-versed in EE or abstract maths (though I know enough of the basics to make some robots simple.) As I learned about EE basics, I've learnt that complex numbers are VERY useful in EE and complex analysis is a must for students of EE.  I know complex numbers work well for calculating stuff in EE, but WHY does it work? In CS, I've learnt about how logic algebra works and why its maths works and have a pretty good fundamental understanding of it. Complex numbers, however, still seem quite abstract to me. "It just works" doesn't sit quite right with me.  So, how and WHY do imaginary numbers work to calculate stuff in EE?  Edit:  I'm well aware that complex numbers are used in EE like . However, what I'm asking is, I think, even more mathematically fundamental. Why do complex numbers work here at all?  They only possible answer to this I've seen so far is because of Euler's Formula:  \begin{equation} \label{Eq:I:22:9} e^{i\theta}=\cos\theta+i\sin\theta. \end{equation}  Is that it? Is that the sole reason complex numbers are used?


Coordinates vs. Geometries: How can we know two coordinate systems describe the same geometry?

Specifically, I'm asking this because I'm taking a class on General Relativity, and in Hartle's book , in Ch. 12, after having spent some time using Schwarzschild coordinates, we are introduced to two new coordinate systems, the  coordinates and the  coordinates.  The book claims that the three of these coordinates are just different coordinate representations of the same spacetime geometry.  How does one prove this claim, particularly since the coordinates do not even remotely behave identically (e.g.: when $r=2M$ in Schwarzschild coordinates, the system appears to blow up, but really the issue is with its representation in Schwarzschild coordinates)?  Obviously, there would be no point having 3 different coordinate systems if they all behave identically everywhere, but I'm having difficulty reconciling these different behaviours as all being different descriptions of the same spacetime geometry.


This is related to .  Bill the Lizard informed us that mods know who flagged a post, but does this include them?  If a mod gets flagged, do they get to see who flagged them?  Not that any of these wonderful mods would ever think of doing anything untoward, but you never know.  Bill might suddenly lose his mind one day and, if I have to flag him, madness plus "modness" could equal mayhem.


For some reason on the mobile web, the selected tab that determines the questions that pop up (active, newest, featured, unanswered...) doesn't show on the mobile site:  It is kinda weird and it is not helpful at all. Can the name of the selected tab come back please? This is not a dupe because whether there is the message or not, the selected tab name does not show up.


How to boot Ubuntu, Manjaro and Win 10 in separate drives? UEFI

I have installed win10 in a 2tb hdd and Manjaro in 250GB drive in a gpt UEFI system I have other drive (250gb too) and I want to install Ubuntu in it. But how can I partitionate and install correctly? I don't want to have problems booting the systems 2tb → Win 10 250GB → Manjaro 250GB → Ubuntu (!)


How important is the domain name for SEO

Most people advice to buy a domain name that exactly matches your main business field. For example if you sell computers the best one will probably be computers.com but with millions(maybe billions) of website all over the web the chance the perfect domain for you to be free is (lets be hones) less than zero. So you have to satisfy yourself with something else like company-name-computers.com or just company-name.com. So the question is how much does this counts when the search engines calculate your website position in SERPs cause I have always thought that having high quality and related content, pretty URLs and back-links from valuable sources is more important then the domain name itself.


I know Animate Dead can give you skeletons or zombies (your choice), and Create Undead can give you Ghouls, Ghasts, Wights, or Mummies.  Is there any other WotC material expanding upon the types of undead you can have? either through spells or magic items or "other"?


Is $|P(\mathbb{N})| = |\mathbb{R}|$?  If so, what is the argument?  I know that the cardinality of the power set greater than the cardinality of the natural numbers, and I assume that the cardinality of the power set of the natural numbers is smaller than that of the power set of the real numbers, though I have not been able to prove this to myself definitively (it simply seems intuitive that the power set of a countable set is smaller than the power set of an uncountable set).  The two approaches that I have considered have been:  (1) Create a bijection between $P(\mathbb{N})$ and $\mathbb{R}.$  (2) Show that there exists no uncountable set smaller than the power set of the real numbers.


I'm learning java and I have a problem:  import java.io.File; import java.io.FileNotFoundException; import java.util.Scanner; import java.io.PrintWriter; import java.util.*;   public class edytor{   public static void main(String[] args) throws FileNotFoundException     {     Scanner czynowy = new Scanner(System.in);      System.out.println("Do you wanna editing existing file?");     String tn = czynowy.nextLine() ;     if(tn=="t") {System.out.println("bleble"); }     Scanner odpowiedz = new Scanner(System.in);      System.out.println("Type file name");     String polozenie = odpowiedz.nextLine() ;         System.out.println("################################");       PrintWriter zapis = new PrintWriter(polozenie);     Scanner tekst = new Scanner(System.in);     String tekst1 = tekst.nextLine() ;       zapis.println(tekst1);       zapis.close();    } }   It's compiling, but when in string tn I type t char this doesn't print "bleble". What should I do to make it work? Greetings!


How do I create a script file for terminal commands?

In Windows I can write a file containing commands for cmd (usually .cmd or .bat files).  When I click on those files it will open cmd.exe and run them commands the file contains.  How would I do this in Ubuntu?         I'm sure this is a duplicate, but I can't find my answer. Its similar to these questions, but they don't answer the question:


Kernel CPU usage shows more than 100%, temperature low, fan speed high

The activity monitor is showing strange things, like kernel CPU % usage being way above 100%, between 200% - 1.000%.    At the same time the cooling fan is running at max speed and the CPU temperature seems to be 47°. At the same time, everything started to react very slowly.  I am only running chrome with 3 tabs open.  What could be the problem? Am I reading the % correctly and why would it show >100%?


What is the true install procedure for youtube-dl in 20.04?

I am having no luck getting youtube-dl installed on my 20.04 system. Here's what I have tried:  sudo apt-get install youtube-dl RESULT: The command executes OK, but when I try to download anything I get errors. I checked the version: $ youtube-dl --version 2020.03.24 $ which youtube-dl /usr/local/bin/youtube-dl  I assume I got an old version of youtube-dl because Ubuntu's repo is out-of-date?   So, searching for solutions led me to try this:  pip3 install --upgrade youtube-dl This attempt being a . But first - removed the apt-installation using sudo apt-get remove youtube-dl But when I check to verify the version, I remain stuck at the old version! $ youtube-dl --version 2020.03.24  So let's move that out before trying something else: $ pip3 uninstall youtube-dl Found existing installation: youtube-dl 2020.11.26 Uninstalling youtube-dl-2020.11.26:   Would remove:     /home/walker/.local/etc/bash_completion.d/youtube-dl.bash-completion     /home/walker/.local/etc/fish/completions/youtube-dl.fish     /home/walker/.local/lib/python3.8/site-packages/youtube_dl-2020.11.26.dist-info/*     /home/walker/.local/lib/python3.8/site-packages/youtube_dl/*     /home/walker/.local/share/doc/youtube_dl/README.txt     /home/walker/.local/share/man/man1/youtube-dl.1 Proceed (y/n)? y   Successfully uninstalled youtube-dl-2020.11.26  Whoa!? I just un-installed the current version!  sudo snap install youtube-dl Aka , which went as follows: $ sudo snap install youtube-dl youtube-dl 2020.11.17+gitd65d891 from Joe Borg (joeborg) installed $ youtube-dl --version bash: /usr/bin/youtube-dl: No such file or directory $ which youtube-dl /usr/local/bin/youtube-dl    Which leaves me confused and bewildered beyond repair. I have used youtube-dl for over a year now & installed on macOS & Debian systems - with no problems. I know Ubuntu is different, but... this is confusing. How do I fix this?


What are the differences between linux-generic, linux-server and linux-virtual kernel packages?

I'm getting new VMs built for development and staging environments, and was wondering whether there are compelling reasons for or against using the linux-virtual package on all of these images.  Do the -virtual kernels have different tuning? Do they have tools that make the suspend/wake-up better/safer?


Is there software that allows the webcam to be used as a camera?  I'm using Ubuntu 12.04 desktop.  Thanks!


I am trying to add an active class to li based on the active URL, This what I got, unfortunately, it is not working when the
Home
   and it will work when :
Home
   The jQuery is:  jQuery(function($) {      var path = window.location.href;      if ( path == '' ) {        path = 'index.php';      }      $('ul li a').each(function() {       if (this.href === path) {        $(this).parent().addClass('is-current');       }      });     });   Thank you!


I'm stuck on this screen. I've edited the Ubuntu boot partition while running Windows now Ubuntu does not boot anymore. In depth I have seen a lot of question like this one on here, but what I have not gotten is the replies from the people who have asked about whether the answer has worked or not. Basically tried to boot Ubuntu and it went well. It worked and I installed it something somewhere went wrong and now when I try to boot it. I looked at the other answers that said troubleshoot. So I did it ctrl-alt-1-7 but 1-6 just tells me to log in and runs a whole script than stops unexpectedly and 7 is where it says /dev/mmcblk0p2: clean Booting Ubuntu worked earlier (yesterday) but I trashed a file and then  renamed the file trash 1000 but kept the files so I renamed it ubuntu. Then I tried to restart it up on my Chromebook. It still has old entries from it but I don't know how to delete those to start ALL over. This on Ubuntu 20.04.


Algorithm to get the maximum size of n squares that fit into a rectangle with a given width and height

I am looking for an algorithm that can return the number of size of n squares that fit into a a rectangle of a given width and height, maximizing the use of space (thus, leaving the least amount of leftover space for squares that do not fit). Neither the rectangle nor the squares can be rotated.  For example, let's say I have a rectangle that is 5 inches by 7 inches, and I need it to fit 35 squares. The algorithm needs to tell me that the 35 squares fit if they are 1 inch wide/tall (as they could be laid out inside the rectangle in a 5 x 7 grid). Another example is if I need to divide a rectangle 35 inches by 1 inch into 35 squares. It should still tell me that the squares will fit if they are 1-inch wide/tall (as they could be laid out in the rectangle in a 35 x 1 grid).  The tricky part is that sometimes there may be leftover space, as the squares cannot be divided into partial squares. Let's say for either of the two examples above I need to lay out 34 squares and not 35 (in which case the answers would still be 1 inch), or maybe 33, or 7 squares. Or, perhaps the rectangle width and height aren't whole numbers. With the number of squares being a variable I need an algorithm that can tell me the size of the squares for a given rectangle width and height.  Thanks for your help!


An example of a bivariate distribution with normal marginals and a nonlinear conditional mean curve?

That is, an example of a bivariate distribution with normal marginals for which a linear regression is inappropriate.  Does an asymmetric copula always produce this?


I have seen several definitions of connected space, but I would like to discuss those from . I am concerned about these:  $X$ is disconnected, if it is the union of two disjoint nonempty open sets.  What about $[0,1] \cup [2,3] $ ? It is not the union of two disjoint nonempty open sets, so it is connected?  $X$ is connected, when it cannot be divided into two disjoint nonempty closed sets.  What about $(0,1) \cup (2,3) $ ? It cannot be divided into two disjoint nonempty closed sets, so it is connected?   Maybe I don't understand what "divided" means.


Create a dictionary based on the typename in C#

I have a Type variable -  Type t = typeof(myClass);  How can I create a Dictionary - Dictionary<String, myClass> using the type variable t?


Setting path environment variable for desktop launchers

I set a custom $PATH in ~/.bashrc with PATH=$HOME/.bin:$PATH. When I launch the  from the terminal it is able to find my custom build tools that are located in $HOME/.bin. When I launch Geany with an XFCE launcher, it doesn't pick up the custom path and my custom build tools do not work. Is it possible to set a custom path such that the launcher will pick it up? I would prefer not to have to create a custom .desktop file.  While  would provide an answer if I knew what shell, and how that shell is started, is used when I use a shortcut to start a program. Presumably, it is not an interactive bash shell or else .bashrc would be sourced.


Why doesn't a star's core cool down when it expands as a red giant?

When a star starts to run out of hydrogen to fuse, it begins to collapse due to gravity until the central core temperature rises to $10^8~\text{K}$  Then due the force generated by the fusion of helium, the star expands again and becomes a red giant.  So, why doesn't the expansion cool the core?


Every finite group is isomorphic to some Galois group for some finite normal extension of some field.   I'm trying to write a proof, but I know this is incorrect. Can anyone point me in the write direction?  Proposition: Every finite group is isomorphic to some Galois Group $\text{Aut}_F(K)$ for some finite normal extension K of some field F.   My hack at a proof: For every $n \in \mathbb{Z}^+$ where $n = |\text{Aut}_E K|$ there exists a normal extension $K$ of $E$ such that $\text{Aut}_E K \cong S_n$. Then consider a subgroup $H \leq \text{Aut}_E K$ where $H \cong \text{Aut}_E K$. It follows that $H$ is the Galois group of $K$ over $K_H$.


I have a table with hyphens in the name, and I can't change the table name so I thought backticks would help.  Unfortunally for me it failed, some googling did'nt give me any answers. How can I solve this?  ex:      $stmt = $this->_dbh->prepare(         'UPDATE `:table`         SET status = NOT status         WHERE id=:id;');       $stmt->bindParam(':table',$this->_settings['table'], PDO::PARAM_STR);     $stmt->bindParam(':id',$data['id'], PDO::PARAM_INT);     if( $stmt->execute() ){         return 'Success';     }     else{         $this->_log( $stmt->errorInfo() );         return 'Action failed.';     }   In the log, with backticks:  13:25:18    42S02 1146 Table 'db_name.'table-name'' doesn't exist   Without backticks:  13:38:14    42000 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''table-name'             SET status = NOT status             WHERE id='1'' at line 1


My client wants a map of bus routes rendered as white lines with blue casing.  I'm using QGIS 2.8.2 on Mac OSX 10.10.5.  I found a .kml dataset here: .  I also tried using the .shp.  When I add the layer to the map and apply a cased line styling, some of the routes render as nice unified lines and others render as segmented, like earthworms:    I could easily cheat and render a duplicate layer (featuring only the thin white lines) on top of this one.   Why do the lines render in different ways?    Is there a way to render them all as unified?