I'm pretty sure this is a duplicate somewhere. I apologize for the repeat. I'm running Xubuntu 14.04. For some odd reason my pc is running slow today, so I thought it might have something to do with the software, so I did an update, and sudo apt-get update returns an error:  E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable) E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?   I tried the answer given in   and this is the following result:  $ sudo lsof /var/lib/dpkg/lock lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs       Output information may be incomplete. COMMAND   PID USER   FD   TYPE DEVICE SIZE/OFF     NODE NAME aptitude 2166 root    3uW  REG  252,0        0 49021509 /var/lib/dpkg/lock  $ sudo lsof /var/lib/apt/lists/lock lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs       Output information may be incomplete.  $ sudo lsof /var/cache/apt/archives/lock lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs       Output information may be incomplete.  $ sudo dpkg --configure -a dpkg: error: dpkg status database is locked by another process    How do I fix this? Could someone walk me thru the steps?  Why would I need a "lock" on an open directory?  How do I find what process is using it? How do I check my hardware if that's the culprit??   I will try a reboot, and see if that fixes anything. Be right back.    OK, NOW after rebooting I get the following results:|  $ sudo lsof /var/lib/dpkg/lock lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs       Output information may be incomplete.  $ sudo lsof /var/lib/apt/lists/lock lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs       Output information may be incomplete.  $ sudo lsof /var/cache/apt/archives/lock lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs       Output information may be incomplete. lsof: status error on /var/cache/apt/archives/lock: No such file or directory lsof 4.86  latest revision: ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/  latest FAQ: ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/FAQ  latest man page: ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/lsof_man  usage: [-?abhKlnNoOPRtUvVX] [+|-c c] [+|-d s] [+D D] [+|-f[gG]] [+|-e s]  [-F [f]] [-g [s]] [-i [i]] [+|-L [l]] [+m [m]] [+|-M] [-o [o]] [-p s] [+|-r [t]] [-s [p:s]] [-S [t]] [-T [t]] [-u s] [+|-w] [-x [fl]] [--] [names] Use the ``-h'' option to get more help information.   I also tried  sudo dpkg --configure -a   which may have worked cause when I did  sudo apt-get update   I got NO ERRORS.


Can I upgrade V-brake to disk brake for Cannondale Quick Cx 5

I have a Cannondale Quick Cx5 with V brake.  I'm wondering whether I can upgrade to disk brake?


Setting a value to one place in a list(b) which is in another list(a) sets that value in the same place in all the lists that are in list(a)

Im trying to make an 9x9 array using nested lists and when I set am trying to set a single value for some reason it is setting that value in every row of that array. It starts with a list like this [[0,0,0,0,0],  [0,0,0,0,0],  [0,0,0,0,0],  [0,0,0,0,0],  [0,0,0,0,0]]  I did something like list[2][3]=1 and the list changed to [[0,0,0,1,0],  [0,0,0,1,0],  [0,0,0,1,0],  [0,0,0,1,0],  [0,0,0,1,0]]  I can't figure out what I did wrong. My code is def resetGrids():     gridHidden=[]     gridShown=[]     gridpart=[]     for i in range(9):         gridpart.append(0)     for i in range(9):         gridHidden.append(gridpart)         gridShown.append(gridpart)     for i in range(10):         searching=True         while searching:             checkX=random.randint(0,8)             checkY=random.randint(0,8)             print(checkX, checkY)             if gridHidden[checkY][checkX]!=10:                 print(gridHidden[checkY][checkX])                 gridHidden[checkY][checkX]=10                 print("a")                 #for a in range(-1,2):                 #    if checkY+a>=0 and checkY+a<=8:                 #        for b in range(-1,2):                 #            if checkX+b>=0 and checkX+b<=8:                 #                if gridHidden[checkY+a][checkX+b]!=10:                 #                    gridHidden[checkY+a][checkX+b]+=1                 searching=False                 print("B")             print(gridHidden)         print("c")     print("d")


Cannot generate bibliography:"I found no \citation command"

There are many related questions but I couldn't solve it from them.  Here is a MWE:  \documentclass[11pt]{article} \usepackage[utf8]{inputenc} \usepackage[british]{babel} \usepackage{filecontents} \begin{filecontents}{test.bib} @article{Moran05, author = {T. Moran}, journal = {Sociological Forum}, number = {2}, pages = {209-244}, publisher = {Wiley, Springer}, title = {Text}, volume = {20}, year = {2005} } \end{filecontents} \usepackage[backend=biber]{biblatex} \bibliography{test}  \begin{document}  \textcite{Moran05}  \printbibliography  \end{document}   I get:  Process started: bibtex.exe "test"  This is BibTeX, Version 0.99d (TeX Live 2016/W32TeX) The top-level auxiliary file: test.aux I found no \citation commands---while reading file test.aux I found no \bibdata command---while reading file test.aux I found no \bibstyle command---while reading file test.aux (There were 3 error messages)  Process exited with error(s)


I have recently installed Ubuntu 14.04 on my dual boot PC with Windows 8.1. On Ubuntu I have seen a 524 MB drive popped up.  As I take a look at it, its not swap or anything. Its contents are as follows:   Can I delete the partition and extend the 104 GB partition? Or I should leave it as it is?


Expectation of a random variable that takes points in the natural numbers

Let $X : \Omega \to \mathbb{N} $ be a r.v. Then $$ \mathbb{E} \{ X \} = \sum_{n=0}^{\infty} P(X > n) $$ Attempt: $$ \mathbb{E} \{ X \} = \sum_j j P(X = j ) = \sum_j j(1 - P(X > j) - P(X<j ) )$$ But here it gets complicated. Am I on the right track?


How does light behave within a black hole's event horizon?

If the event horizon of a black hole is the distance from the center from within which light cannot escape, imagine a person with a flashlight falls into the black hole.  He points his flashlight in a precisely radial direction and turns it on. Now there is a light ray moving outward at the speed of light. If it now cannot move in an arc, but rather is constrained to radial motion, it must, at some point before the horizon, switch directions and fall back into the black hole.  If the speed of light is constant, how does it suddenly change directions, without either decelerating, or requiring an infinite amount of energy?


I do a lot of  development and I like their templating language. , the , looks very much like it.  How can I use Twig in Drupal 7 or even Drupal 6?


I am not sure about the answer I got in me earliar question. I am asking about every day activity.    Please help me with following sentence construciton. I want to use two conditions using if and would.  Senario is our office bus is not passing near from my bosss residence hence he prefer to travel by train every day. I want to ask him if Office Bus route is near from his residence or bus passes near from his residence, then would he travel by bus instade of train every day.  So if i say   1)Would you travel by train if our office bus passes near from your home. or 2)Would you travel by train if our office bus would pass near from your home. or 3)would you travel by train if our office bus is passing near from your home.


Program to balance speaker output for surround sound 2.1?

I don't know how to tune speakers well, so I wanted to know if there is a program that will create a balanced sound output when connected to my 2.1 system for all sounds. Using Macbook Pro 2010 15 inch.


How to interpret poor $R^2$ score but good RMSE value?

I split my data into training set and test set and am running linear regression on it. I am using Python's "scikit" library and I am getting an $R^2$ score of 0.31 and an RMSE value of 0.037. The response variable in my regression consists of values between 0 and 1 so the RMSE value is giving me an error rate of 3.7%. However, the low $R^2$ score indicates that the model is not working well. I'm not sure if I'm misunderstanding these metrics and not sure how to interpret these results. I would appreciate any guidance.


The symbol for a map which is an isomorphism?

Suppose I have a map A → B which is an isomorphism. I'd like to represent this as something that looks like \rightarrow with \simunder it. I could try \underset{}_{}, but is there already a ready made symbol?  I couldn't find the symbol using Detexify, nor in the comprehensive list of LaTeX symbols.


How do I change "Show Applications" button position from right to left?

as you can see the show applications or dash button is on the right. I want to make it come to the left. how can I do that? My dock is at the bottom of the screen


What is the significance of the Period of a Steam Cipher

If we only know the period of a Stream Cipher, let's say 150-200 bit in length, how can we use this information to attack a stream cipher?   Taking a look at this link,  I see that the period of the stream cipher is simply the amount of data we encrypt before starting the encryption over again.   From the attacker's stand point, this let's us know the chunk size of data we are encrypting but how does this help us attack the stream cipher? Won't we still need to know plaintext and cipher text?


Is there any function in javascript like PHP's http_build_query function?

PHP's http_build_query function Generates URL-encoded query string I need the exact same functionality in javascript.   Function example:  $data = array(     'foo' => 'bar',     'baz' => 'boom',     'cow' => 'milk',     'php' => 'hypertext processor' );  echo http_build_query($data) . "n";   Output:  foo=bar&baz=boom&cow=milk&php=hypertext+processor   I want the same output in javascript. I tried encodeURIComponent but it's solving adifferent purpose.


How to install audacity software in Ubuntu?

I am new to Ubuntu and trying to install audacity on Ubuntu. I tried these commands & didn't work.   sudo add-apt-repository -y ppa:audacity-team/daily && sudo apt-get update && sudo apt-get install audacity && sudo apt-get -f install  can anybody please help me in this. Thanks in Advance


What is the retina and non-retina resolution of iPhone5 in pixels?

What is the non-retina/retina resolution of iPhone5 in pixels. (Double or half of 640px x 1136px screen size)?  Is the retina 640px x 1136px or is that the non-retina?


Have anyone experienced this?     String or binary data would be truncated   Raised during ALTER INDEX; even in CREATE TABLE. I'm not having this problem in other databases. I may have reconfigured something as this is only a test database.    All I am seeing in the internet is regarding length of strings inserted by INSERT statement exceeds in the length of defined data type.


Sometimes I can best remember a question by its comments. How can I search for a question that way?  Downloading the data dump is not viable because it may be a question posted today.


What are Thumbs.db files for? How can I prevent them from being created?

What are Thumbs.db files for? I've seen them mostly in picture folders. Wherever pictures like icons and wallpapers are located, a Thumbs.db is automatically generated. I've deleted them many times, but they just appear again after some time.  I initially thought that these files were related to a virus, but they are not because my antivirus gave them a clean chit. I also tried Combofix and malwarebyte.


I am a beginner with LED lights, but would like to use a 5mm UV LED to make a pendant with a small fluorescent crystal. (This is what I purchased ()). I would like to create a very simple, very compact circuit with a coin cell (watch battery), and an on/off switch. What would be the easiest way to do this? Also, would using 2 batteries fix the voltage issue?


How to add a secondary ip address permanently on fedora linux 25?

Lots of examples out there to do this temporary, but can I make this secondary IP address permanent, so that it survives reboots "the fedora way", or does this really need some kind of non-standard script to make this work? While this question (*) answers this partially, there a a lot of settings in the "ifcfg" scripts these days, like UUID, AUTOCONNECT_PRIORITY and a lot of IPV_6 settings, which i do not need at this point.  So the question is really how to add a secondary ip adress properly without screwing up network settings ? I am worried that I will introduce some weird network behaviour of the machine if i just "copy" these values.  e.g. what do do with these values of the default "eth0" (copy them,  change them?)  UUID=5e14c1d3-a58a-4540-8a9d-107210cc45aa AUTOCONNECT_PRIORITY=-999 IPV6_FAILURE_FATAL=no IPV6_ADDR_GEN_MODE=stable-privacy   (*)


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


I was hoping to use ESRI's ArcGIS Editor for OpenStreetMap to view OpenStreetMap data in ArcMap, but my organization hasn't upgraded to version 10 yet.   I also know about ArcBruTile, but I prefer not to use that software because of the potential TOS violations with Google, Bing, etc.   Does anyone know of another way to bring OpenStreetMap tiles into ArcGIS 9.3.1?


Dual booting ubuntu and windows, window won't load even after updating with

Windows won't boot after installing Ubuntu from a usb stick. I tried updating grub:  $ sudo update-grub Generating grub configuration file ... Found linux image: /boot/vmlinuz-4.15.0-20-generic Found initrd image: /boot/initrd.img-4.15.0-20-generic Found Windows Boot Manager on /dev/sda1@/EFI/Microsoft/Boot/bootmgfw.efi Adding boot menu entry for EFI firmware configuration done   It did't help.I checked my partitions and there is a microsoft reserved partition at /dev/sda3 and flags msftres.  I also tried updating grub from startup up window from advanced options under ubuntu header.  While installing i made three separate partitions, and before anything I had my window partition shrunk, as was required.


Enhance Ability on multiple targets: same effect for everyone?

can be "upcasted" (cast using a higher spell slot) to target more creatures.  Does the caster choose which effect to apply for each target, or are the same effects applied to each target?


Should I be using 'is' or 'was' in reported speech?

Which is correct?        She was told that it was against the law to steal.      Or        She was told that it is against the law to steal.        Background information: The original context is that I was relating an incident via email, where my colleague told a customer that some of our actions were part of the organisation's policy. The policy is still valid, but the statement I used to relate the incident in my email went like this:    "Mr Jay was informed that it was our policy to do this."   And I received feedback that it should go like this instead:    "Mr Jay was informed that it is our policy to do this."


Why can't we see light travelling from point A to B?

Let's say we have a cloud of dust which is a lightyear across and someone shoots a beam of light from point A to B , why it is not possible for an observer far far away to see the light while it travels through the cloud at the speed of light?


Journal Editor does not respond about status of paper ~1 year

I submitted a paper with my co-author to a Springer Journal in the area of computational Mathematics.  It has been nearly a year now and we have not heard from the editor. There was no response for inquiries made every 3 months.  I  requested status from managing editor few weeks ago but still with no response. Given the length of the wait and the fact that the journal is the right avenue for our work, I was not sure what are the right steps ( wait more, withdraw and submit elsewhere?...)


How do I CAST a date in a subquery? Currently getting an error: Conversion failed when converting date and/or time from character string

I have a column called Source in my table called TPR. The Source column is of datatype varchar and contains text like January 2020 and Q3 Completed. When I run a query that only extracts the date-like fields to CAST as dates like so: SELECT CAST(Source AS DATE) AS Source FROM TPR WHERE Source NOT LIKE 'Q3 Completed`  I get the appropriate results. When I place the query above in a subquery to act as a filter like so: SELECT CaseNumber FROM TPR WHERE Source =      SELECT CAST(Source AS DATE) AS Source      FROM TPR      WHERE Source NOT LIKE 'Q3 Completed`  I get the following error: Conversion failed when converting date and/or time from character string. Warning: Null value is eliminated by an aggregate or other SET operation.  I've also tried the following but it too failed: SELECT CaseNumber FROM TPR WHERE CAST(Source AS DATE) =      SELECT CAST(Source AS DATE) AS Source      FROM TPR      WHERE Source NOT LIKE 'Q3 Completed`  I don't understand why this is failing.


Animation render: Save plain rendered image AND composite image

I'm looking for a way to save both the plain render layer frame and composite frame in an animation render (PNG sequence output); is this possible?


Original SCI-FI movie where an innkeeper has gills

I remember a movie on the original SCI-FI channel about a male and female protagonist stranded on an island village and while searching for answers the female protagonist notices an inn keeper had gill slits behind his ears. I can't remember the name of the movie.


How to simplify an expression that does not have a common factor

I am trying to simplify this expression :  $$9a^4 + 12a^2b^2 + 4b^4$$  So I ended up having this :  $$(3a^2)^2 + 2(3a^2)(2b^2) + (2b^2)^2$$  However, after that I don't know how to keep on simplifying the equation, it is explained that the answer is $(3a^2 + 2b^2)^2$ because the expression is equivalent to $(x + y)^2$ but I don't understand how they get to that ?


How to put a full-width front cover page on a Tufte-class document?

I would like to put a full width picture on a front cover page using the Tufte-Latex class. How can I do it? This is my MWE:  \documentclass[openany, justified]{tufte-book} \usepackage[utf8]{inputenc} \usepackage{graphicx}  \newsavebox{\titleimage} \savebox{\titleimage}{\includegraphics[height=15\baselineskip]{garden.jpg}}  \title[Hyper Simple]{%   \setlength{\parindent}{0pt}% A title \par \par \vspace{1cm}   \usebox{\titleimage}} \author{My name} \publisher{Exhibition Catalog}  \begin{document} \frontmatter % r.3 full title page \maketitle \chapter{First chapter} \end{document}


How to get BibLaTeX-chicago use title case capitalization?

According to the 16th version of the Chicago Manual of Style, titles in the reference list are now supposed to be capitalized in title case style rather than sentence casing. Yet, as far as I understand, BibLaTeX-chicago (0.9.9b) does not seem to make any automatic changes to the capitalization of .bib-entries.   Is there any way (except for doing it manually for each entry, of course) to get BibLaTeX-chicago use title case capitalization for the entry field title in all entry-types (regardless of how the title is formatted in the .bib-field) ?   Here's a MEW:  \documentclass[12pt, a4paper]{article} \usepackage[authordate,strict,backend=biber, cmsdate=old]{biblatex-chicago} \begin{filecontents}{bibsample2.bib} @BOOK{Smith2003,  title = {This is the book title},  publisher = {Penguin},  year = {2003},  author = {Smith, James},  address = {London},     } @ARTICLE{Doe1970,  author = {Doe, John J.},  title = {this is the article title},  journal = {Great Journal},  year = {1970},  volume = {40},  pages = {207-234}, } \end{filecontents} \addbibresource{bibsample2.bib} \begin{document} \autocite{Smith2003} \autocite{Doe1970} \printbibliography \end{document}   So, what I'm looking for is for these titles to be spelled as   This is the Book Title  This is the Article Title  in the output.  I'm using the latest version of BibLaTeX (2.5), Biber (1.5) and BibLaTeX-chicago (0.9.9b).  Any pointers are greatly appreciated..


How to install class bench using make all and bashrc

Class bench is program for Linux,Classbench duty is create packets and generate some rules which they call them filter set.In class bench there is three folder:   trace_generator db_generator  parameter_files   Note: trace_generator's duty is to generate packets, db_generate's duty is create filter set, paremeter_files is like library.  Ok ,Know how to install db_gerater and trace_generator? simple! just go to their path and write "make all".Know If you want to run db_generater you should just type this command   db_generator -bc acl3_seed 10000 2 0.5 -0.1 MyNewFilters10k but when I write that I saw linux terminal does not support this I search and find I have to add this to my bashrc also I typed !/.bashrc but now I do not know what I should add here.  Before that I installed NS2 which is network simulator I wrote something about NS2 in there but now for classbench I do not know what I should add here? By the way acl3_seed in the parameter_files


Prove that if f '(x) <= 1/2 for all x in the domain of f, then f has at most one fixed point.

I'm pretty sure we need to prove via contradiction, but in the past I've only ever had to prove that there exists at most a set number of roots.


Create a bootable ubuntu backup partition

This question is asked many times but I haven't got the right answer.  What I want is to create a partition where I backup my current Ubuntu partition that appears in the GRUB menu. If one day my Ubuntu won't to start I lunch the backup partition and voila my system is restored.   Currently I use CloneZilla but the problem is I must have always on me a usb key that contains CloneZilla.    EDIT:  df -h /dev/sda5           55G     39G   14G  74% / none               4,0K       0  4,0K   0% /sys/fs/cgroup udev               997M    4,0K  997M   1% /dev tmpfs              202M    1,2M  200M   1% /run none               5,0M       0  5,0M   0% /run/lock none              1006M    8,0K 1006M   1% /run/shm none               100M     36K  100M   1% /run/user parted -l nothing


In my form I have couple of 'select' fields, among others. Now, when I update form, I need to make some fields readonly. Since I can't disable fields because then I'll get no return value, I need to find a way how can I make 'Select' fields readonly. My idea is to somehow change field type to input/text, and then make that field readonly. Is that possible? Or is there a better way? What I use on text fields: document.getElementById('id_rn_number').readOnly = true;  And I can't use (on any field type): document.getElementById('id_report_division').disabled = true;


How could someone like Hashirama die in the First Shinobi World War?

Hasirama is one of the most OP characters in the Naruto series. No one could match his strength, even Madara, and he had crazy regenerative abilities. Basically, he had no weaknesses. Narutopedia sums it up pretty well:     Hashirama was famed as the strongest shinobi of his era, reputed as a God of Shinobi ... His body was brimming with vitality, granting him considerable regenerative powers that could mend most injuries with no residual effects ... Hashirama was proficient in all five basic nature transformations, along with Yin and Yang Release ... [It goes on and on]   So how did someone like him die in the First Shinobi World War? He alone has the same power as an entire village, and so long as he is careful, no one can even scratch him. And if he gets hurt, he can just heal it and shrug it off. So how could he so carelessly die?


Sum of First $n$ Squares Equals $\frac{n(n+1)(2n+1)}{6}$

I am just starting into calculus and I have a question about the following statement I encountered while learning about definite integrals:  $$\sum_{k=1}^n k^2 = \frac{n(n+1)(2n+1)}{6}$$  I really have no idea why this statement is true. Can someone please explain why this is true and if possible show how to arrive at one given the other?


How to load a menu item and its children menu items?

I have the menu item id. I want to display that menu item with its children.   Suppose for example I have menu item test and it has two children menu items. So I want to load them and display it as  test   test1   test2   I tried to load the menu item with the following code.  $menu_content = current(\Drupal::entityManager()->getStorage('menu_link_content')->loadByProperties(array('id' => 1)));   But I am unable to get the children from the variable. Can someone help me here?


Completely prevent installation of Python 2?

I'm on Ubuntu 19.04 and I would like to make sure that if I try to install some software with a hard Python 2 dependency that it would just fail instead of installing 2 on my system.


Why define  $$(\nabla^2F)(X,Y)=\nabla_X(\nabla_YF)-(\nabla_{\nabla_XY}F)?$$  I can't find the motivation of this definition .I don't know the purpose of defining so.  The more details the better, I am just a beginner in geometry.   Thanks.


In plain English, how does casting spells and using creature abilities work with the stack and priority?

I'm a relatively new player to Magic: the Gathering. I was reading  to try to understand exactly when it's okay to cast instants (e.g. ) and use some abilities (e.g.  should be tappable sometime during other peoples' turns), but I don't seem to be making much progress: as I come to understand some things, others make less sense.  My confusion is boundless  For instance: to cast  one needs priority. Spells go on the stack, and priority gets passed at some points (I have no idea when), and effects on the stack are resolved when both players have passed priority. But when is that? I can't find any mention of when the other player gets the priority to cast an instant, except on their own turn. Furthermore,  states that during the Main Phase:     505.4. Second, the active player gets priority. Players may cast spells and activate abilities. The active player may play a land.   So players (plural) may cast spells, but only the active player has priority, so only the active player can cast an instant. The turn rules, and the rules on , never mention any point at which the other player gets priority, so when can they possibly Cancel?  In addition, you can only cast a spell when the stack is empty, so the entire stack must be able to be resolved in your turn at some point.  I need an explanation!  I could go on a bit more. There is also  which can be overloaded to "Counter each spell you don't control", which seems like it could only possibly work with an understanding of the stack.  Could someone explain, in simple English:   When can Instants be cast? When can tap abilities be used? What do Instants and abilities have to do with the Stack and Priority?


Controller does not charge, connect, reset, ps button plus share does not work... help

blinks orange three times then turns off  when pressing ps button,ps button with share, same thing happens.  when pressing reset button, same thing also happens.  dosent charge  does not connect  my controller wont charge, connect, wont reset... everytime i press the ps button with share or ps button itself, it blinks orange three times and turns off. same if i press reset button... pls help me...


Mod migration stats are messed up, most likely from https move

Looking at the /admin/posts/migrated/stats page, I noticed this oddity:    Three of them were migrated while it was still on http - and the link on the icon is still without the s, and one of them was from https (with an https link back to the question from before it was migrated, on the /admin/posts/migrated/here page).


How to host a repository in my own site like a PPA?

As launchpad does not support binary uploads, I want to make .deb packages and host them in My own Github website.    How to do it? When done, how to install packages from it?


Looking for the title of a book about alien invasion, mining asteroids and using lasers to defend earth

What I remember of this novel/series is that the main character creates solar laser satellites and mines asteroids to create more satellites to defend Earth from aliens. Later on, he uses the hollowed out asteroids as a base and eventually as an armored fortress to repulse the alien fleets. I last remember the main character attempting to hollow out more asteroids to defend and attack the aliens eventually.


I downloaded a simple java app and I want to know which file I need to run to start. There are several classes in the project and I do not know which one is the main one. Thank you.


How to install up-to-date virus scanner ClamAv in 12.04?

ClamAV is in the official security software repositories from Canonical, but on running freshclam, it reports:  ClamAV update process started at Tue Jan 21 10:31:59 2014 WARNING: Your ClamAV installation is OUTDATED! WARNING: Local version: 0.97.8 Recommended version: 0.98.1   (I have backports repo enabled, too.)  I would assume that there's little point with a virus scanner that is not up to date. I can think of two answers, I'm hoping the second is correct:   Canonical don't take security seriously in this regard, you'll have to go outside the software centre to download something from elsewhere. I can't accept this from   EDIT: I feel me stating my opinion on Canonical's policy in the question has skewed the tone of answers. All answers say (2) but in fact answer (1): you have to fetch in code from outside Ubuntu LTS, probably because those people can accept this as fine. You clearly haven't done X. Type this or click that, and you'll get proper security updates for Ubuntu LTS from official sources.   Please advise! Thanks.


Can you skip the next iteration of a for loop in python?

For this code:  for i, num in enumerate(range(20)):     if num > 10:         i += 1     print(num)   The idea is to get it to skip every other iteration after num > 10, however it just prints all the items in the range.  Is there a way to skip the next/several iteration(s) of a for loop?


If $X$ is compact and $T:X \to Y$ continuous and bijective, show that $T$ is homeomorphism.

Let $X$ and $Y$ be metric spaces, $X$ compact, and $T:X \to Y$ bijective and continuous. Show that $T$ is a homeomorphism.   My attempt:  We need only show that $T^{-1}$ is continuous.  Let $M \subset Y$ be closed. Then, from the surjectiveness of $T$, there exists a $A \subset X$ such that $T(A)=M$. Since $M$ is closed, by the continuity of $T$, we must have that $A$ is closed.  Now $$T^{-1}(T(A))=T^{-1}(M)$$ i.e, $A=T^{-1}(M)$. Since $A$ and $M$ are closed, we must have that $T^{-1}$ is continuous.  My problem with this, however, is that I am not using the fact that $X$ is compact anywhere in the proof. Is there perhaps another way that I can show this, using the compactness of $X$?   Any hints will be appreciated.


For a subfield $K$ of $\Bbb C$ with $K\nsubseteq \Bbb R$, show $K$ is dense in $\Bbb C$.

Let $K $ be a subfield of $\mathbb C$ not contained in $\mathbb R$. Is $K$ dense in $\mathbb C$?   My problem is I have never used the concept of dense set in algebra and neither have any idea about using sequences here. Please give some hints


Is there a distance penalty for settling cities?

In Civ 4 there was a serious penalty when you settled a city far away from your main capital.   What is the position on this in Civ 5? Should I scatter shot my cities far away? Or place them close to my capital?


I have recently bought a very expensive new MacBook Pro with 8 GB memory and now I am frustrated by its very fast battery drainage. Often I see only 2 hours left on full battery charge! Right now it is only 2:22 hours with no process above 200MB except 1 GB for kernel_task. Also 4 GB memory is free after a "memory clean" (I am also disappointed that Apple does not properly clean memory by itself). What are possible causes of that low battery performance and how to deal with them? Any help is greatly appreciated. EDIT. I do memory clean with , hope it does what it says and not spreads a virus or likes.  Battery Information:    Model Information:   Serial Number:    D863063R190DGDLBH   Manufacturer: SMP   Device Name:  bq20z451   Pack Lot Code:    0   PCB Lot Code: 0   Firmware Version: 406   Hardware Revision:    2   Cell Revision:    158   Charge Information:   Charge Remaining (mAh):   4976   Fully Charged:    No   Charging: Yes   Full Charge Capacity (mAh):   6696   Health Information:   Cycle Count:  133   Condition:    Normal   Battery Installed:    Yes   Amperage (mA):    2870   Voltage (mV): 12272  UPDATE. I restarted Mac today in the morning and closed all applications - still only 3 hours. In the afternoon I have closed all applications - and miraculously I saw whopping 8 hours! Then launched Komodo and Chrome and back to 4 hours. Really puzzling...


Blender rendering only part of the objects

I have a question regarding my rendering using motion tracking. As you can see the rendering only shows a small part of the actual 3d model (tears of steel rig).    Does anyone know why this occurs?  The scene can be found here    // Turning all objects at the right to render won't change anything


Is it ethical to seek a PhD program if you suspect you may want only a Masters?

I'm considering a PhD or Master's in engineering in the US, and I haven't really decided which makes the most sense for me. There are many questions and answers here that mention leaving a PhD program with a Master's and how it's not a "failure" or "dropping out", but it occurs to me: what effect does this have on a person's adviser/professors?   What about references, future relationships, etc? Is it taken negatively or as an insult, or cutting ties, to bow out with the lower degree?  What prompted this question is that a few programs that most interest me state explicitly that there is very little funding available for Masters students (so you are mostly expected to pay your own way), but full funding and additional opportunities are available for those admitted to a PhD program. The way they are worded, they seem extremely interested in good PhD candidates, and not at all interested in Masters students.  I'm not considering seeking a PhD solely to get a Masters/funding, because that's just outright dishonest and I wouldn't stomach such deceit. But, what might the ethics be of not being certain whether you want a PhD or a Masters, but applying for a PhD program?   If one's adviser and/or program and/or professors are explicitly harmed by having someone complete their Masters requirements, then I'd be much more hesitant to even consider a PhD application unless I was certain that's what I wanted. If being unsure is considered normal and the "harm" caused by bowing out of the program with a Masters not so great, then that would certainly ease things the other direction.  To be clear, these departments also specifically suggest you pick Masters OR PhD, and generally discourage you from applying to both. Thus my quandary!


I want 3 post with one loop iteration, so I'm using the_post() to achieve this: (html removed)  <?php while ( have_posts() ) : the_post();      the_title();     the_post();     the_title();     the_post();     the_title();  endwhile; ?>   The problem starts, if number of posts is not divisible by 3. For example, if I have 5 posts, than this loop will still try to display 6 of them, generating empty html. How can I work it out? Or maybe I'm trying to achieve this functionality the wrong way?  @edit: Here is HTML I wanna output to clarify my question:

Title

Content

Title

Content

Title

Content

Title

Content

Title

Content

Title

Content

   So I want to surround every 3 posts with .row.


How to find the number of perfect matchings in complete graphs?

In wikipedia FKT algorithm is given for planar graphs. Not anything for complete graphs. I need to find the number of perfect matchings in complete graph of six vertices.


I see there is a difference in output between ps ef and ps -ef. What is that difference, are both commands correct or which is preferred?


The code   \documentclass{article}  \usepackage{fontspec}  \usepackage{wasysym} \begin{document} \textrecipe \end{document}    works properly generating unicode character (U+211E) But when I add \setmainfont{Sanskrit 2003} downloaded from here  , it fails to generate the unicode character. This may be related to availability of symbol in font or for some other reason, but I need to retain both the symbol and font in the document. Kindly help.   \documentclass{article}  \usepackage{fontspec}  \usepackage{wasysym} \setmainfont{Sanskrit 2003} \begin{document}     \textrecipe \end{document}


How can I remove certain string from file name?

I have few files in the following directory: /var/lib/jenkins/bin/  -rwxr-xr-x. 1 root root 4430846 Apr 27 09:45 01-DSP-04.12_03_crc.bin -rwxr-xr-x. 1 root root 1659036 Apr 27 09:45 01-FL4-04.12_02-crc.bin -rwxr-xr-x. 1 root root 1659036 Apr 27 09:45 01-FL8-04.12_02-crc.bin -rwxr-xr-x. 1 root root 1659036 Apr 27 09:46 01-FPGA-04.12_02-crc.bin -rwxr-xr-x. 1 root root  524328 Apr 27 09:46 01-MMI-04.11_05-crc.bin -rwxr-xr-x. 1 root root   27692 Apr 27 09:46 01-PIC-04.11_06-crc.bin   Also, I have a script that does some work at /var/lib/jenkins/scripts/my_script.sh.  I want to remove the leading "01-" from the file names from this script. Is there any good way of doing this?  I tried the solution from  but do not work for me.  I get output like this:  Command  $ for file in /var/lib/jenkins/bin/*; do echo mv $file `echo $file | cut -c4-`; done   Output  mv /var/lib/jenkins/bin/01-DSP-04.12_03_crc.bin r/lib/jenkins/bin/01-DSP-04.12_03_crc.bin mv /var/lib/jenkins/bin/test.sh r/lib/jenkins/bin/test.sh   As you can see it removes first 3 character which is directory name, not file name. I want to remove 3 character after 21 character from file name.  Any better way to do this?


Why did the original-Earth have continents that resembled the ones on the final-Earth?

So in the end of season three I think, when Thrace comes back and says 'I found Earth', the ending zooms out of the galaxy, zooms back in, and I could have sworn I saw Florida, the continental United States, and the gulf of Mexico, all while hearing 'I found Earth and I will take you there'. So when they finally get to the (nuked out) fake-Earth, that is presumably the planet.   So, why does fake-Earth have a Florida and Mexico? (We know the final-Earth was found because in the end when they arrive, we clearly see Africa and Arabia).


How many rooms are there in Hogwarts school in harry potter

I know how many people were at Hogwarts, but I don't know how many rooms are there totally.


confidence interval and interpretation[further duplicated]

I've come across the post in relevant topics in the confidence interval, I've seen answer said the population mean is not random variable so we can't say 95% probability that CI contains the population mean. Could someone explain more clearly and avoid credibility for me, please? My understanding is, given 5% of the p-value,  each sample could generate a confidence interval and re-sampling numerous time, consider a collection of their confidence interval, and 95% of such CI contains the population mean, and 5% do not Analogy: If this is true, why we can't say the CI that we computed, 95% of chance it is the one that contains the population mean.  Just like a collection of 100 balls and 95 of which are red. Then we pick a ball blindly, we may infer 95% of our ball is red. Appreciated for any comments and help


Landau & Lifshitz's Approach (contour method) on the WKB connection formulas

Background of the question (see pp. 161, section 47 in Landau & Lifshitz's quantum mechanics textbook Vol3, 2nd Ed. Pergamon Press). We have the following potential well $$U(x)\leq E \quad\text{for} \quad x \leq a ,$$ $$U(x)>E \quad\text{for} \quad x>a .\tag{47.0}$$ The WKB solutions right and left to the turning point are $$\begin{align}\psi=&\dfrac{C}{2\sqrt{p}}\exp{\left(-\dfrac{1}{\hbar}\left|\int_a^x pdx\right|\right)} \cr &\quad \text{for} \quad x>a, \end{align}  \tag{47.1}$$ $$\begin{align} \psi= & \dfrac{C_1}{\sqrt{p}}\exp{\left(\dfrac{i}{\hbar}\int_a^x pdx\right)}\cr +&\dfrac{C_2}{\sqrt{p}}\exp{\left(-\dfrac{i}{\hbar}\int_a^x p dx\right)}\cr &\quad \text{for} \quad x<a,\end{align} \tag{47.2}$$ respectively. Most quantum mechanics textbooks determine the relation between $C$ and $C_i$'s by finding the exact solution near the turning point. And then let the exact solution match with the WKB solutions. However, in Landau & Lifshitz's quantum mechanics textbooks (vol3, section 47) they let $x$ vary in the complex plane and pass around the turning point $a$ from right to left through a large semicircle in the upper complex plane. Landau claims starting from +$\infty$, when arriving at $-\infty$ (left to $a$), there is phase gain $\pi$ in the denominator of prefactor in Eq.(2). From this we can determine $$C_2=\frac{C}{2}\exp\left(i\frac{\pi}{4}\right).\tag{47.4a}$$ They also claim the first term will exponentially decay along the semicircle in the upper half plane. Question is why? Can we show $$\Im{\left(\int_a^x pdx\right)},$$ where $\Im$ stands for the imaginary part, is positive?


How to automatically skip leading white spaces in listings

This question led to a new package:      For my programming lecture slides I heavily use the listings package with \lstnewenvironment to typeset source code. It's a great package (no, I do not want to switch to minted), the only thing that bugs me is that I have to pass the gobble=<indent> option to get well formatted source as well as output:  \documentclass{beamer} \usepackage{listings} \lstloadlanguages{C}  \lstnewenvironment{C}[1][] {\lstset{language=C, basicstyle=\scriptsize\ttfamily, #1}}{}   \begin{document}  \begin{frame}[fragile]{A simple truth\ldots}   \begin{C}[gobble=4] % <-- ** This is annoying! **     #include <stdio.h>     int main(){       printf("tex.stackexchange.com: the coolest community ever!\n");     }   \end{C} \end{frame}  \end{document}   Manual handling of gobble is especially painful, if one moves code examples around and changes the nesting level. I constantly forget to update the parameter in this situations. Ideally, the C environment in the above example would automatically determine the gobble by the preceeding indentation (that is, number of spaces) before it in the source. Something like the following (pseudo code):  \lstnewenvironment{C}[1][] {\PreceedingWS{\WScount}%   \lstset{language=C, basicstyle=\scriptsize\ttfamily,    gobble=\the\numexpr\WScount+2\relax, #1}}{}    The idea is that \PreceedingWS magically determines the number of spaces in the current line before the \begin{C} and stores it in some macro (\WScount).  Is this possible?    Summary of Results (2011-06-27)   I got three answers, two of which did actually help me:     is based on ConTeXt, which doesn't help me, but may be a good reference for those guys who actually use ConTeXt.   is a bit hacky, but has the advantage that it can be applied to (probably) any verbatim-style environment. Moreover, I have learned a bit about TeX scanning from his well-documented answer. It came "right in time" for me to safe me a reasonable amount of work.  showed up relatively late. It is much cleaner as it integrates directly into the listings package and is provided as an own package. I am surprised by how little code he needed for this, which for me is an indicator that his solution integrates well and has a good chance to survive further evolution of the listings package. I certainly hope his lstautogobble package will make it to CTAN or eventually be directly integrated into listings.   I have tested the latter two with my lecture slides, which contain ~100 small listings in very different settings and environments (inside tables, minipages, in combination with beamer overlays, ...), so I can say that both approaches do actually work.    To sum up: Bruno's answer became the accepted answer, as it helped me most when I actually needed it. Martin's answer received the bounty, as it is the cleaner and more stable solution which I am going to use in any future project.


How to reduce higher order linear ODE to a system of first order ODE?

Is there any general and systematic way of reducing the higher order linear ODE to a system of first order ODE?  For example, assume we have $a_3x^{(3)}+a_2x^{(2)}+a_1x^{(1)}+a_0x=0$, then how do we convert this into matrix form(a system of first order ODE). And after we solve the system of equation, how to combine them into our final solution $x(t)$?  Thanks for helping me out!


I have a terrible motherboard:  Manufacturer: Foxconn Model: 2AB1 Chipset: AMD 785G Southbridge: AMD SB700 Brand: American MegaTrends INC.  It wont let me overclock my CPU, so I've decided to upgrade it. I am going to get a motherboard with a socket AM3 and DDR3 RAM for my supplies that will let me overclock. Want I want to know is:   When I upgrade my motherboard, do I need to reinstall anything? Will I still have Windows 7 Premium? Will I need new drivers or anything such?


Why does the status "under peer review" change to "Awaiting Reviewer selection" after 2 months?

I submitted my manuscript 3 months back. After a few days, the status changed to "under peer review". It was so for two months. Now the status is changed to "awaiting reviewer selection". It is totally confusing. what does this really mean? what is happening to my manuscript?


How to find from what computer I connected to a current server

I often work on one of available to me Linux/HP-UX servers (let's say it is server1) and then do  ssh server2 ((let's say it is server2)) and start working on another Linux/HP-UX server. Then I can connect another server ((let's say it is server3) and start working on it. While working on server3 how to get in command line information from what server I came from?   So on server3 I want to get information that I came from server2 and on server2 I want to get information that I came from server1? What is a command or utility for it?


What cross-platform command-line tool allows me to get my external IP address?

How do I get my external IP address  from the Windows and Linux command line? On Windows, ipconfig shows an internal network IP address, but it does not show the external one.


Are moments related to moments in physics?

The terms are the same, but I cannot outwardly see, whether moments in statistics have something to do with moments in physics.  So are they related? How?


How to install libboost_version1.59 or newer on Ubuntu16.04

How can I install libboost1.59 ?  I have tried many methods to install it, but fail to update the version 1.58 on my Ubuntu 16.04 to the version 1.59.  I tried  and  on StackOverflow,  and   Who can give me an effective method?


GnuPG Error - GnuPG failed to start because of "unsafe permissions"

Every time I start Kubuntu, I get same error. Here is the KSnapshot:      Any suggestions on how to fix it?


How can I rename items using /replaceitem in MCPE?

I am attempting to rename a cobblestone using the below command, and it is not working: /replaceitem block ~ ~1 ~ slot.container 0 cobblestone 31 0 {display:{name:CobbLELstone  I have double checked - it is the right block. I have looked at other sources and have found nothing helpful. The error I'm getting is:  Syntax error: Unexpected "": at "bbLELstone>><<"  Can you help explain what I have done wrong? Here are some screenshots in case they help:


What is the cause of a hard-drive which suffers the click-of-death?

I feel that my question is probably too wide, I'm willing to focus my question more if needed and possible. Please comment.  I have a hard-drive (2.5" Toshiba) which was installed in a notebook. The notebook fell from a table (on the side) while running. Since then the disk makes the click-of-death-sound and is no longer recognized either by the system or when attached to a SATA-USB-adapter on another PC.  In the past, for another hard-disk with the same symptoms, I did/tried a transfer of the hard-drive-heads from a working disk to the non-working one. I was unable to make the broken disk work again - the click-of-death remained. The data was lost.   At that time I only transplanted the hard-drive heads. I was as careful as possible. I saw that the heads of the broken drive were visibly damaged. The donor-drive was the same model, but not the same creation date.   When done, I let the disk run while being semi-open. I saw what created the click-of-death: it's the heads running over the whole disk and then returning abruptly onto their parking position - this is when it is clicking. The controller instructed the drive to do it again and again. It was surely looking for some "known-data".  Now, for my current broken disk, I have a working model of the same revision and date ready to be a donor. But I'm unsure - this time I really would love to get back the data.  What causes the controller to scan the disks again and again? What is it looking for?  Why does replacing a physically damaged head not help?  Is there some kind of calibration stored on the PCB which is adapted for the heads?  Transferring the heads was relatively easy. Was it too easy? Did I probably break something, even though I was really careful?


Trying to create a rock paper scissor game but after getting the users choice then randomly generating the computers choice and displaying it in the program. The program doesn't go onto the next set of code which determines the winner.      Scanner in = new Scanner(System.in);      int ComputerChoice = (int)(3 * Math.random()) + 1;      System.out.println("Please select one of the following [R/P/S]: ");     String UserChoice = in.nextLine();      if (UserChoice.equalsIgnoreCase("R") ) {         System.out.println("You chose: Rock"); }       else if (UserChoice.equalsIgnoreCase("P") ) {         System.out.println("You chose: Paper"); }       else if (UserChoice.equalsIgnoreCase("S") ) {         System.out.println("You chose: Scissors"); }       else if (UserChoice != "R" || UserChoice != "S" || UserChoice != "P") {             UserChoice = "R";             System.out.println("Invalid choice! Defaulting to Rock.");         }      if (ComputerChoice == 1) {         System.out.println("I chose: Rock");     }     else if (ComputerChoice == 2) {         System.out.println("I chose: Paper");     }     else if (ComputerChoice == 3) {         System.out.println("I chose: Scissors");         }      if (UserChoice == "R" && ComputerChoice == 1) {         System.out.println("A Tie!");     }     else if (UserChoice == "R" && ComputerChoice == 2) {         System.out.println("Paper beats rock - you lose!");     }     else if (UserChoice == "R" && ComputerChoice == 3) {         System.out.println("Rock beats scissors - you win!");     }     else if (UserChoice == "P" && ComputerChoice == 2) {         System.out.println("A Tie!");     }     else if (UserChoice == "P" && ComputerChoice == 1) {         System.out.println("Paper beats rock - you win!");     }     else if (UserChoice == "P" && ComputerChoice == 3) {         System.out.println("Scissors beats paper - you lose!");     }     else if (UserChoice == "S" && ComputerChoice == 1) {         System.out.println("Rock beats scissors - you lose!");     }     else if (UserChoice == "S" && ComputerChoice == 3) {         System.out.println("A Tie!");     }     else if (UserChoice == "s" && ComputerChoice == 2) {         System.out.println("Scissors beats paper - you win!");


"Member state(s) of destination" confusion in Belgium online Schengen visa application

I am an Indian passport holder. I am planning to apply for a Belgium visa for a conference. I am also planning to visit Spain after this conference.  In the online application form, I need to fill up a box called:  "Member State(s) of destination". But in the answer box, they have provided provision to enter only one EU country name. When I enter 'Belgium', then I cannot enter 'Spain' without cancelling 'Belgium' first.  When I click further information it says: "Please indicate which Schengen Member state you are visiting."  Which country should I enter then?  Any help will be greatly appreciated.


Does this sentence have a different meaning with "is" vs. "are"?

The largest number of cows are running for the hills.      The largest number of cows is running for the hills.   According to various free online grammar checkers both forms are correct.  My interpretation is that the "are" version refers to the cows, whereas the "is" version refers to the number or quantity.      "Cows are running for the hills" vs. "The largest number is running for the hills".   Is this too subtle a distinction?


Which one is more appropriate to use: "send you" or "send to you"?

Are both of the following sentences correct?  Let me know if there is still something I need to send to you. Let me know if there is still something I need to send you.  Which one is more appropriate to use?


Unlimited Greyhound or Amtrak trips in US/Canada?

I've heard mention of 'limitless' tickets in North America, either by bus or  train.  Do these exist? What are the conditions and prices?


How can I mount a filesystem, mapping userids?

I can successfully mount an ext4 partition, the problem is that all the files on the partition are owned by the user with userid 1000. On one machine, my userid is 1000, but on another it's 1010. My username is the same on both machines, but I realise that the filesystem stores userids, not usernames.  I could correct the file ownership with something like the following:  find /mnt/example -exec chown -h 1010 {} \;   But then I would have to correct the file ownerships again back to 1000 when I mount this external drive on another machine.  What I would like is to give mount an option saying map userid 1000 to 1010, so that I don't have to actually modify any files. Is there a way to do this?


So I've only just installed ubuntu on my laptop, as I'd like to get more comfortable with it. Doing apt-get update gives me a hell of a lot of 404 errors, followed by failed to fetch errors.  I also can't seem to install chrome, as after downloading the executable it says it's missing a dependency (Which i tried to fix via google help, but none of the results fixed it as they did for others)  I've read a few threads regarding similar things to what I'm experiencing but nothing seems to fix it. Any help at all would be much appreciated!


Permalinks: custom post type -> custom taxonomy -> post

I am having trouble working with WordPress rewrite rules, and could use some help.  I have a custom post type called _shows_.  All shows have a single custom taxonomy category _show-category_. A _show_ will never have more than one _show-category_.  I would like my urls to route in this manner:  www.mysite.com/shows/  =>  archive-shows.php  www.mysite.com/shows/%category%/ => taxonomy-show-category.php  www.mysite.com/shows/%category%/%postname%/ => single-shows.php   So as a real world example, lets say we have a _show-category_ "Foo" and a _show_ post titled "Bar" that has "Foo" as it's _show-category_. I would expect my WordPress app to look like this:  www.mysite.com/shows/foo/ => shows all posts under the foo category www.mysite.com/shows/foo/bar => shows the indivual post   I try to avoid plugins when possible, but am open to any solution.


I am having very slow performance running Blender

I just installed Blender and I am having very slow performance,when I press any menu buttons it takes around 3 sec. to respond or show is this normal? Do I need to set up something additional or install a driver? I have read the system requirements are looking fine,it shouldn't be that slow.   Thank you  P.S.  I am using: Samsung RC530 Intel core i7 , 2.20GHz GeForceGT 540M, 6GB RAM DDR3, 500 GB SSD Samsung, Windows 10 64 bit


Shell Script for logging into a ssh server

I tried writing a shell script which can do automatic login into a ssh server using password which is mentioned in the script. I have written the following code:  set timeout 30 /usr/bin/ssh -p 8484 root@172.31.72.103 expect  {    "root@172.31.72.103's password"     {       send "password\r"     } }   This code is not running properly, still it is asking for the password. Can somebody please help me in solving this


Why is the value of the entire column changing after each iteration instead of just a particular cell?

I am trying to convert a python list into a 2d matrix without numpy library.   However, in doing so, my code is not working as expected.   n=3 arr = [16,13,4,16,13,19,23,8,11]   mat=[[0]*n]*n                    #initialising a 3*3 matrix  for a in range(n):     for b in range(n):         mat[a][b]=arr[b]         print(mat)               #To understand the result of each iteration     if len(arr) >n:         arr=arr[n:]  print(mat)   The obtained output is:     [[16, 0, 0], [16, 0, 0], [16, 0, 0]]   [[16, 13, 0], [16, 13, 0], [16, 13, 0]]   [[16, 13, 4], [16, 13, 4], [16, 13, 4]]   [[16, 13, 4], [16, 13, 4], [16, 13, 4]]   [[16, 13, 4], [16, 13, 4], [16, 13, 4]]   [[16, 13, 19], [16, 13, 19], [16, 13, 19]]   [[23, 13, 19], [23, 13, 19], [23, 13, 19]]   [[23, 8, 19], [23, 8, 19], [23, 8, 19]]   [[23, 8, 11], [23, 8, 11], [23, 8, 11]]        finally:                               [[23, 8, 11], [23, 8, 11], [23, 8, 11]]   instead of:     [[16,13,4], [16,13,19], [23, 8, 11]]   Why is the value of the entire column changing after each iteration instead of just that cell?  What possible change in the code can give the desired result(i.e- converting the list of 9 elements to a 3x3 matrix)?


On OS X El Capitan, what is the difference between /Library/ and /System/Library/?

There are two 'Library' directories in my OS X 10.11 installation, one being /Library/, the other being /System/Library/. What is the difference between different Library folders?


My properties tab on the right is only showing the World tab and nothing else.   I'm new and don't know how to solve this.


This is homework but I would appreciate a hint : If $(a,b)=1$ and $(\frac{a}{b})^m=n$ then show $b=1$ From $(\frac{a}{b})^m=n$ we can conclude that $a^m=n b^m$ so $b^m | a^m$ But what next? It’s obvious that because of $(a,b)=1$ b should be 1 to make that happen but how should I write it down ?


dynamically Created html link does not work

After creating a batch of Html nodes, The link does not work!  How can I fix it?  Javascript Codes:     var nnn = '
' +                     '' +                     '' +                     '' +                     '
' +                     '
User
' +                     '
' +                     '
' +                     '
TEST TEST
' +                     '
' +                     '
' +                     '<input id="deleteC_24_20" type="submit" class="submitLink" value="delete">' +                     '<input id="editC_24_20" type="submit" class="submitLink" value="edit">' +                     '' +                     'reply' +                     '' +                     '

' +                     '
' +                     '
' +                     '
' +                     '
';                 $(collapseId).append(nnn);   Exactly this line of code:  'reply'    I expect this event to fire after clicking the  tag that I have created dynamically. But it doesn't work!  $("a[id^='replyC_']").on("click", function (event) {     var nodeId = event.target.id; });


Calculating the age of the Universe now and 30 billion years from now

I am confused about the age of the Universe.   If you calculate it by $1 / H_0$, won't the answer be roughly the same today as it will be 30 billion years from now?  I know $H_0$ is a parameter, not a constant, but it doesn't change that much, does it?  And if the expansion is accelerating then $H_0$ is going up, implying the age of the universe $1 / H_0 $ was higher in the past than it is today.


Text color changes height of tabular row

Why is it so? My MWE:  \documentclass{article}  \usepackage{tabularx} \usepackage[table]{xcolor}  \begin{document}  \begin{table}[H]     \caption{Title.}\label{title}     \begin{tabularx}{\linewidth}{|p{5.5cm}|X|}     \hline     \color{red}{\textbf{Column 1}} & \color{red}{\textbf{Column 2}} \\     \hline     A & a \\     \hline       B & b \\     \hline       C & c \\         \hline       \end{tabularx} \end{table}  \end{document}   The result is as follows    If color is black, then the height is as I expect:


Using different Web.config in development and production environment

I need to use different database connection string and SMTP server address in my ASP.NET application depending on it is run in development or production environment.   The application reads settings from Web.config file via  property.  I use Build/Publish command to deploy the application to production server via FTP and then manually replace remote Web.config with correct one.  Is it possible somehow simplify the process of deployment? Thanks!


Is it correct?  p → q, ¬p → r, ¬q → ¬r ⊢ q  1) p -> q    premise 2) ¬p → r    premise 3) ¬q → ¬r  premise 4) ¬q         assumption  5) ¬p         MT 1,4  6) r         e2   2,5  7)  ¬q       assumption 8) ¬r         e2 3,7 9) ⊥          ¬e 6,8 10 ¬q        assumption 11) q          ¬e 9, 10   I believe it is true. Could you please help?


Apache2 restart issues after editing virtualhost

hello i try to restart apache2 with command service apache2 restart and it's give me this :  Restarting web server apache2                                                AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1.  Set the 'ServerName' directive globally to suppress this message   "" Please i need help whit thsi !!!!!


In our daily lives, we generally use $10$ digits to define the numbers, i.e., $0$ to $9$. Based on these ten digits, we define all the natural, rational, and irrational numbers, etc. This representation is known as the decimal representation. I know that one could also define the number system in other ways. For example:  Unary: 1 11 111 1111 ... Binary: 0 1 10 11 100 ... Hexadecimal: 0 1 2 3 4 5 6 7 8 9 A B C D E F ...  Similarly, I can define my own number system, for example say: $\alpha \,$ $\beta\,$ $\gamma\,$ $9\,$ $\alpha \alpha \,$ $\beta^{2} \alpha\,$... But I am wondering, why do we use the decimal system to learn mathematics or say in our everyday lives. I know that a computer uses a binary number system since the most basic unit of storage is $0$ or $1$. However, I want to know, why humans use the decimal number system. Is there any logical advantage of using decimal representation over say Unary, Binary, or anything other? Thanks.


Installing Cygwin packages from the command-line

Possible Duplicate:        I'm looking for a "yum"-link method to install additional Cygwin packages from the command-line. Let's say I want to add the package "Math/bc", then ideally I'd like to be able to do it  using one command as in:  yum install bc   Currently the only way I've found to install new packages is to locate and run the installation file SETUP.EXE file and then scroll to the relevant package, add it, etc. This is  quite cumbersome so I'm sure there is a smarter command-line way to add an additional package.


Has anyone had success or tried painting vinyl siding?  Apparently   claims that it is possible but I wanted to know if anyone has done this? Were there any pitfalls or learning?   The reason to want to do this should be pretty obvious as replacing all the siding on a house purely because of color is a lot of money. Basically I have a yellow house, the siding is in good condition, but quite ugly so was hoping there is an effective way to change its color other than buying new.


A question on consistency of fonts in figures and in text

Suppose I output a figure of some function from Matlab, without adding the x-axis label and y-axis label. The figure is then saved as a PDF file.  Now I want to input this figure into LaTeX, and I want to   add the x-axis label and y-axis label; add the name of the function in the figure, just near the line;   because by doing so, the fonts in the x/y-axis labels and in the figure are consistent with the main font used in the text.  Is there any method to do this?


How to use the word difficulty correctly

Is it correct to say:  The city is difficult to turn into an economic center.  OR it must be:  It is difficult to turn the city into an economic center.  Thank you.


What are the differences between a multidimensional array and an array of arrays in C#?

What are the differences between multidimensional arrays double[,] and array-of-arrays double[][] in C#?  If there is a difference, what is the best use for each one?


all. Anyone know what value this capacitor should be? It says 104... but that does not help.


Can a player collect nobles after a day ends in Guillotine?

I was playing the game with two friends and there were just two cards left on the second day, when my friend decided to use the [Escape!] card which allowed him to Randomize and discard 2 cards.  After this the day ended, we drew the next 12 cards. Then, my friend collected the first noble in line, saying that his last play (from day 2) was not over because he didn´t collect a noble, which is obligatory according to the rules.  Is this allowed?


Java Find Closest Pair in Dataset gives NullPointerException

I am trying to find closest pair from a few different datasets. So far it works with the SmallerSet which has 12 points but when I change dataset which has 100 points . It's giving NullPointer Excepiton at the line that I add "--->" before the loop .I dont't figure it out to solve.  public static PointPair closestPair(Point2D.Double Px[], Point2D.Double Py[],int n) {     PointPair closestpairLeft;     PointPair closestpairRight;      if (n <= 3) {         if(n==2)             return new PointPair(Px[0],Px[1]);         else{         PointPair p1=new PointPair(Px[0],Px[1]);         PointPair p2=new PointPair(Px[0],Px[2]);         PointPair p3=new PointPair(Px[1],Px[2]);          if(p1.closerThan(p2)<0){             if(p1.closerThan(p3)<0)                 return p1;             else                 return p3;         }         else{             if(p2.closerThan(p3)<0)                 return p2;             else                 return p3;         }         }     } else {         int mid = n / 2;           Point2D.Double Xl[] = Arrays.copyOfRange(Px, 0, mid);         Point2D.Double Xr[] = Arrays.copyOfRange(Px, mid, n);          Point2D.Double Yl[] = new Point2D.Double[Xl.length];         Point2D.Double Yr[] = new Point2D.Double[Xr.length];          ---> for (int i = 0, k = 0, j = 0; i < n; i++) {             if (Py[i].getX() <= Xl[mid-1].getX()&& j<mid) {                 Yl[j++] = Py[i];             } else if (k<mid){                 Yr[k++] = Py[i];              }          }          closestpairLeft=closestPair(Xl,Yl,mid);         closestpairRight=closestPair(Xr,Yr,n-mid);     }


I am getting null pointer exception while adding data to this custom array

I am trying to create a custom array and want to add data by indexing using k (int). I don't know why it's giving me a null pointer exception.  public class FourElements_Sum_GivenVal {      int sum,first,second;      public static void findFourElements(int arr[],int n,int x) {          int size=((n)*(n-1));         FourElements_Sum_GivenVal aux[] =new FourElements_Sum_GivenVal[size/2];         int k=0;         //System.out.println((n*n-1)/2);          for(int i=0;i<n-1;i++) {             for(int j=i+1;j<n;j++) {                 aux[k].sum=arr[i]+arr[j];                 aux[k].first=i;                 aux[k].second=j;                 k++;              }         }         public static void main(String[] args) {         // TODO Auto-generated method stub            int arr[]= {1,2,3};           int x=23;           findFourElements(arr,arr.length,x);     }    }


Would it be possible to stop escaping angle brackets in email notifications?

Here's an email I just received for a tag I subscribe to, showing a summary of a new question asked:  Creating tree formed XML from flat XML with Xquery  I have some XML in the following format:   &lt;data&gt; &lt;row&gt; &lt;id&gt;1&lt;/id&gt; &lt;parent_id/&gt; &lt;/row&gt; &lt;row&gt; &lt;id&gt;2&lt;/id&gt; &lt;...  tagged: xml, xquery Sep 7 at 13:46   (The link to this question is .)  The escaped angle brackets make the summary harder to read.  Ideally, the summary would show the text as is:  I have some XML in the following format: <data> <row> <id>1</id> <parent_id/> </row>...   As a subscriber to XML-related tags, this would be great!


How can i sort a pair of array of vectors v[ ]by second element

I have a pair of array of vectors {V[x].push_back(make_pair(y,w));} I want to sort it by the second element ie. by w.How could it be done in c++?


Why when I insert list of figure, there are something error like  Bad math environment delimiter. ...ikel hijau dan lingkaran merah\relax }}{14}?


When adding values on jquery i get infinte number

I want to make a simple addition of every span with the class .part-price, but when I do it comes out in infinite numbers.  This is my javascript (jquery) :  var total = 0;   $(".part-price").each(function() {     total += Number($(this).text());   });   $("#cart-total").text(total);   And this is my html :  0.86 1.00 Total: 0   At the moment I only have 2 value, one is 0.86, and the other is 1.00, it should come out as:  0.86 + 1.00 = 1.86  But with my code the result is:  0.86 + 1.00 = 1.8599999999999999


Why is $\sqrt{\sum_{i=1}^n |v_i|^2} \leq \sum_{i=1}^n |v_i|$ true?

Sorry if this is very basic but here's a question.   Let $\mathbf{v}=(v_1,\ldots, v_n)\in k^n$ where $k=\bar{k}$.      Why do we have   $$ \sqrt{\sum_{i=1}^n |v_i|^2} \leq \sum_{i=1}^n |v_i|,  $$   where the left-hand side can be thought of as the $2$-norm $\|\mathbf{v}\|_2$ on $L^2(k^n)$?   $\mathbf{General \; case}$: If this is true for $p=2$-norm, I am guessing that this is true for all $p\geq 1$:  $$ \left( \sum_{i=1}^n |v_i|^p\right)^{1/p}\leq \sum_{i=1}^n |v_i|.  $$     In fact, does this inequality hold when $p$ is a rational number?


Application of Derivatives rigorous proof

Let $f:R\rightarrow R$ be a function such that all its successive derivatives exist in all $R$ and also $f(x)f''(x)\leq 0$ everywhere.  If $\alpha$ and $\beta$ be two successive roots of $f(x)=0$.   Then prove that $f'''(x)=0$ for atleast one $\gamma \in(\alpha,\beta)$.  My Attempt:  I began by taking an example $f(x)=(x-1)(2-x)$ and let $x=1$ and $x=2$ be its two successive roots.The statement is trivially true.  Then I took the function $f(x)=e^{-x}(x-1)(2-x)$.The statement is true here also so on and so forth.  But what would be the exact proof I wonder. It appears to be a question of Rolle's Theorem.


It's the first time after ten years of linux os (debian). I've a script in user home:  /home/user/bin/script1.sh   with correct permissions. Using shell, script runs. Inside crontab:  30 13   * * *   user        /home/user/bin/script1.sh   I see the log of cron.log like below:  Dec 27 13:30:01 server1 /USR/SBIN/CRON[22709]: (user) CMD (       /home/user/bin/script1.sh)   but script1.sh doesn't start


Matrices A+B=AB implies A commutes with B

$A$ and $B$ are $n\times n$ matrices and $A+B=AB$. I have an interesting proof that this implies $A$ commutes with $B$, but the proof only works when $||B|| \lt 1$. I'm looking for a way to salvage the proof so that it works for all $B$.  $$A=AB-B$$ $$A=(A-I)B$$ by repeatedly substituting $A$ with $(A-I)B$ on the RHS, $$A= (A-I)B^N - \sum_{i=1} ^{N-1} B^i$$  Since the space of $n\times n$ matrices is Banach (hence complete) under the standard operator norm, the limit $\sum_{i=1}^{\infty}B^i$ is well defined given $||B|| \lt 1$. Hence, taking the limit as $N \rightarrow \infty$, $$A =  -\sum_{i=1}^{\infty}B^i$$  Now the LHS commutes with B, hence so does the RHS.    Is there some trick to extend the method to work with any $B$ where $||B|| \geq 1$? I know that the result is true due to another simple algebraic proof, but I'd like to see if this method can be salvaged.


I'm making a video, and I have two identical objects that start in the same place and then separate. I want to have a dotted line connecting them which appears only when the two objects start separating and continues to grow as the objects continue to separate. This takes out using the array modifier.


Is it possible to add/change your profile picture?

I use Ubuntu 17.04 and I was just wondering if it was possible. Thanks for viewing!


Texmaker (Windows version) - first use - Error: Log file not found!

This is my first time using a LaTeX editor.   I installed  allowing it to use the default directory on the C drive.  Software Versions   Windows: 7 Ultimate 64-bit  Texmaker 3.4.1 for Windows   I then did A Local guide for using Texmaker (There use to be a link to this but it is now dead)  Basically create a simple Hello World document and save it.  When I went to process the file   Tools -> PDFLaTeX     I received    Error: Log file not found!   What I checked  I checked the configuration (Options -> configure Texmaker) and found no option for log files.  I checked for a log file under the C:\Program Files (x86)\Texmaker and found none.  I checked for a log path in the Windows registry using regedit and found none.  I checked the Texmaker issues and found  but it does not help.  Any ideas?  After reading answer  I installed MiKTeX as an administrator (didn't work as user) and chose the default options. After MiKTeX installed I was able to create a PDF file using Texmaker.   Also, correctly setting the PDF viewer options   Options -> Configure Texmaker -> Commands -> PDF Viewer Built-in Viewer and Embed   I was able to preview the pdf in Texmaker   View -> PDF Viewer   What I learned   is a LaTeX editor which generates a file containing LaTeX markup.     is a program that converts the LaTeX markup into an output format such as PDF.


Are quarks/electrons different sizes (physically/in terms of mass)?

i.e. is an electron bigger/smaller than a strange quark? Is a strange quark bigger/smaller than an up quark? Or are they all the same size?  Leading on, are electrons the same size (as in physical size or mass) as protons and neutrons?  To clarify: Say if an electron was mass x. Is it possible that a certain quark could be mass x+1, 1/2x, etc?


How to build a dmg Mac OS X file (on a non-Mac platform)?

Is it possible to build a .dmg file (for distributing apps) from a non-Mac platform? And if yes, how?


Same citation in multiple paragraphs (undergrad paper)

What I currently have is:  paragraph 1  paragraph 2  paragraph 3 [1].  With that I want to show that I am citing all 3 paragraphs from the same source. But appearently this is not right. Is it enough that I do?  paragraph 1 [1]  paragraph 2 [1]  paragraph 3 [1].


Prevent selection of vertices through other objects

I noticed that you can select vertices through other objects. Here is an example to show what I mean:  I have a cube partially inside a sphere. When I do a circle select when the back vertex is hidden behind the sphere...   Both vertices, including the one that was hidden by the object, are selected.   Is there a way to prevent this behavior?  EDIT: I tried the "limit selection to visible" option but it didn't work... I believe this case is different because it is selecting through a different object, not just itself.


Traveling Amsterdam-Brussels with KLM ticket on Thalys - When / where does my ticket get stamped?

I purchased a ticket to Brussels via Amsterdam on KLM, with the Schiphol to Brussels-Midi portion on the Thalys.  The return portion of my itinerary is on Air France several days later.  This was done in good faith (i.e., not as a fare dodge) since I really do need to go to Brussels.  However, it now turns out that I have a meeting in Amsterdam the day I arrive.  I realise I am required to board the train to Brussels to fulfill the terms of my KLM ticket, and that I will need to get my ticket stamped on the Thalys in order to board my return flight.  What I want to know is where and when this takes place, since I need to return to Amsterdam. Will I need to ride the train all the way to Brussels, or can I get my ticket stamped and then disembark in Rotterdam or Antwerp?  Alternatively, is there any possibility of getting my KLM Thalys ticket issued for a later train, so that I can attend my meeting in Amsterdam before heading to Brussels?  NOTE: Some users have marked this question as duplicate.  Be assured that I read other Thalys/KLM questions others carefully prior to posting, but none of them address my key question: Where/when during the Thalys ride does the ticket get stamped?  This is important to anyone in my situation -- i.e., needing to return to Amsterdam after boarding the Thalys, but needing their ticket stamped to ensure their return itinerary is not cancelled.


Can I delete my own question which has an answer awarded with a bounty?


Left crockpot unplugged for about an hour

I'm making chicken chili. Or trying to... This morning I turned on my crockpot to high for about 40 minutes. I then drove to work and replugged it, about an hour after unplugging it. After cooking it for 5 more hours, should it be safe?


Position of cursor around brace when using auto-completion in TeXStudio

In using TeXStudio to edit my text file under Debian, I have a problem in locating the cursor while using the auto-completer to complete a pair of braces. There is a little box frame holding the place of the right brace, and the edges of the box cover the shining cursor when the cursor moves to one of the edges of the box frame. Therefore, I cannot distinguish whether the cursor is on the left or right side of the box frame. It is especially annoying when I want to delete a brace because I don't know where the cursor is at that moment. How can I solve this?


How to recognize which virtual environment is being used

Suppose I have logged in through sshto a given Linux machine, knowing nothing about it.  How can I quickly check what virtual environment (VMWare, VirtualBox, LXC, etc., if any) is currently running on this machine?


I remember reading this book years ago, but I'm unable to remember the title. I'm hoping someone else has read it and remembers the title. Here is a quick synopsis from what I remember:  Humans, while testing their first FTL drive, travel to the closest star and destroy it. However, there was an unknown, inhabited world around the star. The world was populated by telepaths; when the telepaths realized what was going on, they 'screamed' out into the universe with their last dying breath, asking all the other telepathic aliens to kill these other aliens (humans) in revenge. It tells the story through generational gaps, as humans attempt to survive the ensuing genocide committed against them.  If anyone could give me the title for this book, I would love to re-read it!


How to enable EPEL repository on RHEL so I can upgrade Apache

I want to upgrade Apache to 2.4.46 or later on RHEL 7.  One step in the  is to Enable the EPEL repository, like so... cd /etc/yum.repos.d && wget http://mirror.centos.org/centos/7/os/x86_64/repodata/repomd.xml`rpm -q --qf "%{VERSION}" $(rpm -q --whatprovides redhat-release)`.repo  The mirror is not available, so I get a 404, but I also tried using other mirrors and I still get a 404 error.  How do I enable the EPEL repo on RHEL 7?


I've created a views slideshow which uses a custom content type for each slide. However I want to prevent any user to access these nodes using the url itself like .../node/1. There seems to be a  from another stackoverflow post, but it's not supported by drupal 8.


How do I restore/reinstall all PAM service configuration files?

I made a mistake that resulted in the deletion of /etc/pam.d, how do I restore the PAM configuration to the state that would be generated for my currently installed packages when I don't know the specific files to restore?


I have two different methods which actually do the same but are implemented a bit different. They walk through a directory and read all files in it and check how many files with a certain name are in the directory. Now I want to know which is faster but both are similar and take around 3-4 seconds (the directory has millions of files) but how can I know which is really faster? Is there a method which compares the speed of them?   method)  private void getAllRelatedFilesEig(String corrId) throws InterruptedException, IOException     { log.debug("Get all files with corrId=" + corrId + " from directory=" + processingDir);                    Profiler profiler = Profiler.createStarted();      Files.list(Paths.get(processingDir))     .filter(p ->      p.getFileName().toString()     .indexOf("EPX_" + corrId + "_") >= 0)     .forEach( path ->     {                 try                 {                     EPEXFile file = new EPEXFile(path);                      if (file.isTranMessage())                     {                         if (file.isOrderMessage())                         {                                                    orderFiles.add(file);                         }                                                else                         {                                                    tradeFiles.add(file);                         }                     }                     else                     {                         infoFiles.add(file);                     }                 }                 catch (IFException ex)                 {                     log.error("Error creating EPEXFile object " + ex.getMessage());                 }     }             );  profiler.stop("allFilesWithSameCorrIdRetrieval");  log.info(orderFiles.size() + " order files with corrId=" + corrId); log.info(tradeFiles.size() + " trade files with corrId=" + corrId); log.info(infoFiles.size() + " info files with corrId=" + corrId);  profiler = Profiler.createStarted();         profiler.stop("processFiles");   orderFiles.clear(); tradeFiles.clear(); infoFiles.clear();     }  method)  private void getAllRelatedFilesOrig(String corrId) throws InterruptedException, IOException { log.debug("Get all files with corrId=" + corrId + " from directory=" + processingDir);  Path dirPath = Paths.get(processingDir);  ArrayList<Path> fileList;  Profiler profiler = Profiler.createStarted();  try (Stream<Path> paths = Files.walk(dirPath)) {     fileList = paths.filter(t -> (t.getFileName().toString().indexOf("EPX_" + corrId + "_") >= 0))             .collect(Collectors.toCollection(ArrayList::new));      for (Path path : fileList) {         try {             EPEXFile file = new EPEXFile(path);              if (file.isTranMessage()) {                 if (file.isOrderMessage()) {                     orderFiles.add(file);                 } else {                     tradeFiles.add(file);                 }             } else {                 infoFiles.add(file);             }         } catch (IFException ex) {             log.error("Error creating EPEXFile object " + ex.getMessage());         }     } } profiler.stop("allFilesWithSameCorrIdRetrieval");  log.info(orderFiles.size() + " order files with corrId=" + corrId); log.info(tradeFiles.size() + " trade files with corrId=" + corrId); log.info(infoFiles.size() + " info files with corrId=" + corrId);  profiler = Profiler.createStarted();  profiler.stop("processFiles");  orderFiles.clear(); tradeFiles.clear(); infoFiles.clear(); }    I have tried to figure it out with the Profiler class but I could not figure out which is exactly faster since sometimes the first and sometimes the second is faster. Is there even a way to say which is faster in general? Even when it is just a little bit faster it would help me to know which one it is.


Number of solutions to the congruence $x^q \equiv 1 \mod p$.

Let $p, q$ be distinct odd primes, I would like to compute the number of solution $\mod p$ to the congruence $x^q \equiv 1 \mod p$. (Show that it's $gcd(q, p - 1))$  If $x^q \equiv 1 \mod p$, since $q$ is prime, this must mean that $x$ is either $1$ or has order $q$.   Hence, the problem reduces to finding the number of elements of $U_p$ which is either $1$ or has order $q$.  If $ q \nmid  p - 1$, then there is only one element, namely $1$.  If $q \mid p - 1$, then the number of elements of order $q$ is $\phi(q) = q - 1$, and so the number of solutions to the congruence $\mod p$ is $q - 1 + 1 = q$, and in either case the number of solutions is $\gcd(q, p - 1)$.  Does this look fine?


I have heard(read) SEO experts who claims that you server position will affect your SEO. In the latest example it was about an international site targeting the Russian market so:   Does the server location affect how many visitor you will get from specific country. Does the TLD affects SEO outside that it is easy to type the TLD of your country   If the above have any effect what will be if you by TLD domain for the countries you are targeting and make them redirect to you international one, for example:   example.com - international example.ru - redirects to example.com/ru/ example.de - redirects to example.com/de/


C++ - Template static method with templated parameter inside template class

I have these two classes:  template <typename GeomType> class InputCSV { public:     InputCSV(DataSet<GeomType> * ds) : ds(ds) {}     virtual ~InputLoaderCSV() = default;      DataSet<GeomType> * ds; };   and  template <typename GeomType> struct DataSet {     template <typename LoaderType>     static DataSet<GeomType> Create()     {         DataSet<GeomType> ds;         ds.fileName = "something";         ds.input = std::make_shared<LoaderType<GeomType>>(&ds);         return std::move(ds);     };      DataSet(const DataSet & ds) = delete;      DataSet(DataSet && ds)     {         this->fileName = std::move(ds.fileName);         this->input = std::move(ds.input);         this->input->ds = this;          ds.input = nullptr;          }      std::string fileName;     std::shared_ptr<InputLoader<GeomType>> input;     protected:            DataSet() : input(nullptr) {} }   Now somewhere in code, I want to do  auto ds = DataSet<Line>::Create<InputCSV>();   where Line is some struct I have. However, this is not working and I got this error:  error C2672: 'DataSet<Line>::Create': no matching overloaded function found error C3206: 'DataSet<Line>::Create': invalid template argument for 'LoaderType', missing template argument list on class template 'InputLoaderCSV' note: see declaration of 'DataSet<Line>::Create'  error cannot access protected member declared in class 'DataSet<Line>' note: see declaration of 'DataSet<Line>::DataSet' note: see declaration of 'DataSet<Line>'   Is there any solution to have this kind of "syntax", or I have to write  auto ds = DataSet<Line>::Create<InputCSV<Line>>();   and change  ds.input = std::make_shared<LoaderType<GeomType>>(&ds);   to  ds.input = std::make_shared<LoaderType>(&ds);   In this example, I donw like "duplication" of  in InputCSV, since there cannot be anything else.


If G is not commutative, then is there always a subgroup that is not a normal subgroup?

I was having a discussion with a friend of mine about some normal group properties and then came up with the question "if G is not commutative, then is there always a subgroup that is not a normal subgroup?" It's probably more easy to solve this in the following form:$$\forall H \leq G : H  \lhd G \Rightarrow \forall a,b \in G : ab=ba$$ My question is, can anybody give a proof, or a counter-example (because I don't think it holds) of this theorem? Thanks!


What caused the expansion of the universe to slow down after the inflationary epoch?

As everyone knows, when the big bang happened, the universe expanded at an unbelievable rate and this was called the inflationary epoch (or more popularly cosmological inflation) which lasted for about $10^-$$^3$$^4$ seconds. But after that, the rate of expansion suddenly reduced and is now gradually increasing. Can someone tell me what is the probable reason or the resistive force that caused expansion to slow down greatly after the big bang?  The question is based on the simple fact that expansion could not have slowed down if there was no resistive force acting or more simply inertia of motion.


How to set up a SFTP server with users chrooted in their home directories?

I have been trying to set up a SFTP server with multiple users chrooting into their home directories. I followed the advice on  () and then executed the following commands on the user's directories  chown root:root /home/user/ chmod 755 /home/user/   There is an additional folder in every user's home directory called public, which is owned by its user so as to allow them to create directories and upload and remove files as needed. (This was advised in the guide I mentioned earlier)  Now when I execute sftp -P 435 user@localhost, I get this error:     Write failed: Broken pipe   Couldn't read packet: Connection reset by peer   How do I proceed from here? The ultimate idea is to have each user on some other machine use FileZilla to log into their chrooted home directories and then be able to upload directories and files. All this in SFTP (because it's more secure)


Is there any Ubuntu version for a PC with 248 MB RAM?

I need a compatible version of Ubuntu for my computer that has only 248 MB of RAM. Would it be possible to remove Windows XP?


Can I use a 5v xtal osc with a 3v MCU? Will a simple npn buffer work?

I have several crystal oscillator cans that run on 5v. I have a PIC24HJ128 on a breadboard. The PIC uses 3v. I want to use a simple npn transistor to buffer the osc out into the CLK in. Will this work? Does anyone have any advice?


If light rays obey to the wave equation, why can they be thought as straight lines?

I'm a newbie with physics but I'm wondering how a ray of light can essentially be represented. I have always known that a ray of light proceeds in a straight line until it encounters another object (or material) that refracts/reflects it. But a light ray should be part of an electro-magnetic wave, is this correct? If it is so, it should obey to the  and this doesn't seem to me to describe a straight line ray.  I'm having problems visualizing how light is emitted and how it relates with the wave equation. Can someone with a clear understanding of the problem explain it to me in simple terms?


Can i send email to the subscriber and same email to 3rd person at same time using journey bulider on submit of smart capture form

I have a cloud page in SMFC with the smart capture form. The form is submitting the data to DE working fine.   I have created a journey to send a email, when user fill the smart capture form in my cloud page, Right now the email goes to the person who have filled the form.   I want to sent email to 3rd person as well to the subscriber who just filled the form.  So any one can let me know what changes i need to do for this.  Or  Is there any way i can do this.  I more thing i don't want to use two journeys for this until i don't have other solution.


How can i change the css of my menu link, using javascript?  <li> <a href="here is the link"> Промоции </a> </li>   Because i cant add id on <li> or <a> ! Im using opencart, and im just trying to modify a theme


Can anybody help me identify my road bike frame?

The serial number is located under the bottom bracket and its C0 30 402322. It was repainted and the fork is also been replaced. It has the downtube shifter mounts on it with braze on front mech hanger. The frame is made of aluminum and its has a standard 1" headset on it. The downtube is teardrop-like shaped as well. Still trying to identify this frame for 2 years now and scoured the net for any info but no luck even my LBS who knew the painter and previous owner had no idea also cant find the previous owner to ask and the painter passed away. Hope somebody can help. Thanks. Will add photos if somebody notices.


Is it true that for every $p$ and $q$ prime there exist infinitely many $k$ such that $p^k - 1$ is divisible by $q$?

This question is interesting because it helps to ask for another question: What is multiplicative group of algebraic closure $\bar{\mathbb{F}}_p^*$ of $\mathbb{F}_p$? I know that for algebraic extension $\mathbb{F}_q \supset \mathbb{F}_p$, it's true that $(\mathbb{F}_q)^* =$ ciclic group on $q - 1$ element. If the answer for question in title is yes, then we know a lot of subgroups of $\bar{\mathbb{F}}_p^*$. More presicely we know, that for every n there exists subgroup $\mathbb{Z} /n\mathbb{Z} \subset \bar{\mathbb{F}}_p^*$ . I know that $\widehat{\mathbb{Z}}$ has the same property. If I'm right that  $\widehat{\mathbb{Z}} = \times_r \mathbb{Z}_r$, where $r$ is prime, and  $\mathbb{Z}_r$ is $r$-adic group. Is it true that $\bar{\mathbb{F}} _p^* =\widehat{\mathbb{Z}}$?


Let $(X,d)$ be a compact metric space. Let $f:X\rightarrow X$ be such that $d(f(x),f(y))=d(x,y)$ for all $x,y\in X$. Show that f is onto. Hint: Fix $y\in X $and $ x_1\in X$, define $x_n=f(x_{n-1})$, observe that $d(x_n,x_{n+k})=d(y,x_n)$.  It is easy to show that  \begin{align*}  d(x_n,x_{n+k})&=d(f(x_{n-1}),f(x_{n+k-1})) \\  &=d(x_{n-1},x_{n+k-1})\\  &=d(x_{n-k},x_n) \end{align*} I don't understand how we get  $d(y,x_n)$.Why $y$ must be an element in $x_n$?


How to get selected text from a text area in jquery?

If i select a text from a text area i need to know which text is selected, for example "hello world" if i select hello i would like to see hello is selected how can i do this in jquery. and i want to make it bold.  <textarea id="editor" cols="80" rows="20">    Hello world, This is Me! </textarea>  <button onclick="SelectText()">   Bold </button>


Comma(s) when starting a sentence with both an introductory element and participial clause

If a sentence is starting with both an introductory element and a participial clause, where do I need to set the comma(s) appropriately?  Consider the following versions of an example sentence:     (A): Finally, having explained the consequences, we recommend bringing the car to the dealer's garage.   (B): Finally having explained the consequences, we recommend bringing the car to the dealer's garage.   I do know that for short introductory elements (such as "Finally") the comma is not mandatory, but I am unsure if in the given example sentence it is at all possible. Personally, I prefer version A; however, this preference is driven by my gut feeling rather than by a specific formal rule.  So, maybe someone knows? I appreciate any help!


How can I add numbers to my author-year natbib (elsarticle) reference list to confrorm with guide for authors?

I know this question is a duplicate of , but that question was closed 4 years ago for lacking details and clarity. Since I need to resubmit within 10 days, I post this one with more detail and an MWE instead of trying to reopen the old question  I am trying to format the reference list using elsarticle class to comply with Bioresource Technology's (BITE) Guide for Authors.  It is not as easy as it ought to be using elsevier's LaTeX template since BITE for some inexplicable reason wants to use Harvard (authoryear) style both in the text and reference list, but preceed each reference in the reference list by a number, like a numbered list.  The Guide for Autors specifically states: References in the list should be placed first alphabetically, then numbered chronologically.  This style is not present among elsevier's bibtex style files and I am wondering how this can be achieved?  I am currently using the standard plainnat.bst style file with authoryear option set in the \documentclass, as in the MWE below:  \documentclass[review,authoryear]{elsarticle} \bibliographystyle{plainnat.bst} \begin{document} These citations: \citep{Feynman1963118,Dirac1953888}. \bibliography{mybibfile} \end{document}   mybibfile.bib:  @article{Dirac1953888,   title   = "The lorentz transformation and absolute time",   journal = "Physica ",   year    = "1953",   author  = "P.A.M. Dirac" }  @article{Feynman1963118,   title   = "The theory of a general quantum system interacting with a linear dissipative system",   journal = "Annals of Physics ",   year    = "1963",   author  = "R.P Feynman and F.L {Vernon Jr.}" }   The above MWE generates    The journal wants these two references to be preceeded by [1] and [2] (and so on when adding more references), respectively. How can this be achieved?  elsarticle class uses natbib, but I can not figure out how to tweak it to make the reference list a numbered list as well. It is a really strange request from the journal.


The majority of definitions give the same meaning - "Pandora's box" is a synonym for "a source of extensive but unforeseen troubles or problems."  Are there any other metaphors with the same meaning?


Appropriate Test for Statistical Significant Change in Values Over Time

I have four number of values for number of policies within a given field put forward in a given year. I want to find if there is a statistically significant increase or decline in the number of policies over time.   My initially approach was to try and run a t-test on the values, but I believe that that was wrong as I used percentage values compared to total number of policies.   What would be the best way to find statistical significance? I think I may have been trying to over complicate things that that this only needs simple regression.