How to prompt for user input and read command-line arguments

How do I have a Python script that a) can accept user input and how do I make it b) read in arguments if run from the command line?


Stackoverflow is being ripped without attribution in queryby.com

just found my stackoverflow  in this site. with a lot of others. without answers. all the questions are attributed to one Rajesh Kumar .Also find an identical site named . thought you should know.


Bulk croping same portion from multiple file

I want to crop same portion, say rectangular areas from multiple image files which are located at same place in all files. Is there anyway to do it in GIMP? and I also have to do it regularly. Can I save a template for this action.  I've read  .I don't know if it is the same problem or not


How to install ubuntu 14.04 inside window 7 using wubi without internet?

Although i have same release of ubuntu and wubi and are in same directoy. But also while installing it automatically connects to internet and starts downloading ubuntu. i have already downloaded ubuntu-14.04.1-desktop-i386.iso of 987MB. Should i have to download other applications like metalink or something so that while installing internet will not be required? Please help me out..


How to get the name of a variable in a string

I want to run a function that will create a file with the name of a variable and write in it the content of that variable.  list_A = 'one two three'.split()  def write_list(list_to_write):      flux = open('%s.list' %list_to_write, 'w')     flux.write('\n'.join(list_to_write))     flux.close()  write_list (list_A)   This creates a file called ['one', 'two', 'three'].list   I would like it to create a file called liste_A.list instead.  PS: I found many similar posts, but none that seemed to address my issue.


Attempt to invoke virtual method 'java.lang.String Model.User.getPhone()' on a null object reference

the problem is when I click on cart object to make an order the app crashes and throws the NullPointerExcetion.  my Cart.java code is   public class Cart extends AppCompatActivity {      RecyclerView recyclerView;     RecyclerView.LayoutManager layoutManager;      FirebaseDatabase database;     DatabaseReference requests;      TextView txtTotalPrice;     FButton btnPlace;      List<Order> cart = new ArrayList<>();     CartAdapter adapter;      @Override     protected void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         setContentView(R.layout.activity_cart);          //Firebase         database = FirebaseDatabase.getInstance();         requests = database.getReference("Requests");              public void onClick(DialogInterface dialogInterface, int i) {                         Request request = new Request(                         Common.currentUser.getPhone(),                         Common.currentUser.getName(),                         edtAddress.getText().toString(),                         txtTotalPrice.getText().toString(),                         cart                 );                  // send it to firebase                 requests.child(String.valueOf(System.currentTimeMillis()))                         .setValue(request);                 //Delete cart                 new Database(getBaseContext()).cleanCart();                 Toast.makeText(Cart.this, "Thank you, Order is placed!", Toast.LENGTH_SHORT).show();                 finish();             }         });     private void loadListFood() {         cart = new Database(this).getCarts();         adapter = new CartAdapter(cart, this);         recyclerView.setAdapter(adapter);     } }


I've seen people write custom classes to more easily handle command line options in various languages. I wondered if .NET (3.5 or lower) has anything built in so that you don't have to custom-parse things like:     myapp.exe file=text.txt


Error while installing Trelby on Ubuntu 16.10

I'm trying to install Trelby on my Ubuntu 16.10, but I'm getting a dependency error for Python. How do i get past this error?


$C_v$ for polytropic process having equation $PV^{x}=k$

Polytropic process has an equation $PV^{x}=k$.  But from this how can we conclude $C_v=\dfrac{R}{x-1}$ or $C_p=\dfrac{xR}{x-1} $ ?  I could'nt find any proof on the net.


2d Array of objects is not creating new objects, just overwriting

So I have a 2-dimensional array in Java where each cell in the array is a Chunk the Chunks hold information about their location. The problem is that in my for loop what seems to be happening is that every time I create a new Chunk I'm just overwriting the information about all the previous chunks here's my code public static int worldsize = 5;  public static Chunk[][] chunks = new Chunk[worldsize][worldsize];  public CreateWorld(){     for(int i = 0; i < worldsize; i++){         for(int j = 0; j < worldsize; j++)         {             System.out.println("creating chunks at postion " + i + ", " + j);             chunks[i][j] = new Chunk(i, j);             System.out.println("chunk at positon 0, 0 : " + chunks[0][0].chunkXPos + ", " + chunks[0][0].chunkYPos);         }     }  }  and here is the Chunk public static int chunkXPos; public static int chunkYPos;  public Chunk(int chunkX, int chunkY){     chunkXPos = chunkX;     chunkYPos = chunkY;     System.out.println(chunkXPos + ", " + chunkYPos);     cells = createChunkList().clone(); }  The expected output would be this: creating chunks at postion 3, 2 3, 2 chunk at positon 0, 0 : 0, 0 creating chunks at postion 3, 3 3, 3 chunk at positon 0, 0 : 0, 0  what I actually get creating chunks at postion 3, 2 3, 2 chunk at positon 0, 0 : 3, 2 creating chunks at postion 3, 3 3, 3 chunk at positon 0, 0 : 3, 2  from what I was able to figure out every time I call = new Chunk(i, j); it sets all the information about all the other chunks as the new coordinates so that's why the chunk at position [0][0] thinks it's at [3][2] The solution is probably very simple, Although I'm new to java and I can't figure it out


Assign value to variables inside an array

I have variables which I put inside an array. When I loop through the array I assign values to the variables. When I console.log(variable) it returns undefined.  Example:  var test1, test2; var tests[test1, test2]; function change(){ for(var i=0;i<tests.lenght;i++){    tests[i] = i; }} change(); console.log(test1); //returns undefined   Shouldn't the output be 0? What am I missing?  Edit  I think I understand now, but how to apply to specif problem:  var table1 = {}; var table2 = {}; var tables = [table1, table2];  function initiDataTables(urlsToInit){         for(var i = 0; i<tables.length; i++){             var tempUrl = urlsToInit[i];             var name = '#example'+i.toString();             var name2 = name + ' tbody';             console.log(name);             tables[i].val = $(name).DataTable({                 'autoWidth'   : false,                 'ajax': {                     'url' : tempUrl,                     'dataSrc' : '',                 },                 'columns': [                     {'data':'ID'},                     {'data':'Naziv'},                     {'data':'File'},                     {'defaultContent':"<button id='btnView1' class='btn btnview btn-primary'>Prikaži</button>"},                     {'defaultContent':"<button id='btnDelete1' class='btn btndel btn-danger'>Obriši</button>"},                 ],                 'columnDefs' : [                     { 'visible': false, 'targets': [2] }                 ]             });              console.log('Check' + table1);               $(name2).on( 'click', '.btnview', function () {                 var data = tables[i].val.row( $(this).parents('tr') ).data();//here it gives me undefined                 window.open('Images/'+data.File, 'window name', 'window settings');             } );              $('.dataTableServer').on( 'click', '.btndel', function () {                 var data = tables[i].row( $(this).parents('tr') ).data();                 //deleteData('news', data.ID);             } );         }        }   I am trying to initialize multiple datatables.


Struggling to get moderncv files to compile

I'm a real novice on LaTex, having only used it previously a small amount at University but not for a while. I've decided I'd quite like to transfer my CV to the LaTex moderncv style. I downloaded the package here  I use TexWorks, and I was hoping I'd just be able to open the template file from the moderncv download, compile it and edit the text to produce a nice CV. Unfortunately, when I try to do this I get the following error:  Running ttf2pk.exe... miktex-makepk: PK font umvs could not be created. !pdfTeX error: pdflatex.EXE (file umvs): Font umvs at 864 not found ==> Fatal error occurred, no output PDF file produced! texify: pdflatex failed for some reason (see log file).  So it seems to be a problem with not having a font package installed or something?! Do you know which package this is? And how do I actually download a font package so that TexWorks knows it's installed and thus compiles the file? I've heard people talk about Miktex package installer, but I don't think I have that available, but I set up all my LaTex stuff quite a while ago, so I'm not sure... Sorry for my very poor understanding of LaTex, I'd just like to find a way to get this moderncv package working asap. Any help would be much appreciated. Added MWE: \documentclass[11pt,a4paper,sans]{moderncv}          \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc}  \moderncvstyle{casual}                            \moderncvcolor{blue}     \usepackage[scale=0.75]{geometry}  \name{John}{Doe} \title{Resumé title}                                \address{street and number}{postcode city}{country} \phone[mobile]{+1~(234)~567~890}                    \email{john@doe.org}                                 \begin{document} \makecvtitle  \section{Education}  \end{document}  still does not compile and produces the error:  !pdfTeX error: pdflatex.EXE (file umvs): Font umvs at 657 not found ==> Fatal error occurred, no output PDF file produced! texify: pdflatex failed for some reason (see log file).


Physical sense of angular momentum conservation

If two balls of equal mass m are connected by a massless rod and if a force is applied to one of the ball normal to the line joining ball and the rod then what is the final subsequent motion of the system? And can we apply angular momentum conservation here?


What would happen if someone who is suspended created a new account and tries to have it merged it later?

Let's say someone:   has his Stack Exchange account suspended for a year; then created a new account; tries to merge it with his previous account after the suspension is over.   What would happen then since it's theoretically not allowed as it defeats the purpose of the suspension.


Really weird bug on "Unanswered > my tags", when I have no favorite tags

I wanted to look for some questions to answer, so I went to . It came up with some really weird tags, as seen in this image:        , , , , and  are the tags in which I have the most posts. I also have  that has the tags , , and .  When I clicked on |bug|reputation|achievements-dialog|:        After I gave myself a favorite tag it acted as normal filtering the unanswered questions by that tag.


Prove that the product of a non-zero rational and irrational number is irrational.

Could you please confirm if this proof is correct?  Theorem: If $q \neq 0$ is rational and $y$ is irrational, then $qy$ is irrational.  Proof: Proof by contradiction, we assume that $qy$ is rational. Therefore $qy=\frac{a}{b}$ for integers $a$, $b \neq 0$. Since $q$ is rational, we have $\frac{x}{z}y=\frac{a}{b}$ for integers $x \neq 0$, $z \neq 0$. Therefore, $xy = a$, and $y=\frac{a}{x}$. Since both $a$ and $x$ are integers, $y$ is rational, leading to a contradiction.


Is there a set which cannot be proven to be finite or infinite? The set must be not be proven to be infinite of any cardinality.  I am a novice at set theory regarding these topics, so if this is something that I can solve for myself if I study the right topics, pointing out the topics will be very helpful to me.


Dealing with SPAM: 6 (or more?) spam flags should destroy the user instead of the -100 penalty

Before you downvote, I don't propose that any user that gets spam flagged would be instantly destroyed. Read on.  In the recent spam wave, I've noticed how the flagging system works. People very quickly reach the magic 6 spam flag count, and the post gets annihilated. That's good.  However, there are problems with that:   These spam flags get cleared from the queue. So mods won't see them nor be able to destroy the user effectively, without some sort of pointer, or manual lookup at the recent flags. Spam flags induce a -100 reputation penalty, which is 100% useless since the user always have 1 reputation point, and will not get lower.   My suggestion is as follow, if ALL of the following are true:   The user only has one post. The user only has one reputation (meaning that his only post was never upvoted). The user's only post has reached 6 (or more?) spam flags The user registered less than a week ago.   If all of the above are correct, the user should be automatically destroyed. That's what us mods do, why not automate the process?


Doubts regarding the Completeness of an estimator

Let $X_{1},...,X_{n}$ be random variable from the probability density function:  $f(x|\beta)=\frac{\beta^{\alpha}}{\Gamma{\alpha}} x^{\alpha-1}e^{-\beta x}$ where $\alpha$ is known and $\beta>0$.  I know that $\sum_{i=1}^{n}X_{i}$ will be a complete Statistic since the gamma distribution is in exponential family. What I wanted to know is that whether $X_{1}$ is complete or not? Since, $X_{1}$ is from gamma family and gamma family is complete. Hence,  $X_{1}$ is complete. Is my reasoning correct? If not, could you give me some examples which are complete Apart from the usual $\sum_{i=1}^{n}X_{i}$. Thanks in advance.


Understanding static and instance members

I've learned that I should use Object(instance) for using instance field in static method.  For example:  INSTANCE FIELD(==speed)   that is declared in public class Car, should be used through Object in static method (ex. 'public static void main(String[] args) )  like this.   Car myCar = new Car();  myCar.speed = 60;    So, the reason I should use object is because static method is located in CLASS and for being shared to objects, but on the other hand, instance field is just Frame that is not substance?  For using this instance field in static method, do I have to make the instance that is called 'object'?  In other words, is this process right?:  instance field -> OBJECT( substantialization)  -> static method.    I'm wondering what I understood


comparing concatinated strings and normal strings

when i am comparing a string that is concatinated and comparing the objects of the concatinated string and normal string its showing false. I thought that the Strig literal "kalyansreekar" is already present in String constant pool. can soomeone explain me why this is happening and also the implementation code of string concatination. Thank you.  String a="kalyan"; String b=a+"sreekar"; String c="kalyansreekar"; System.out.println(b==c);   "I expect the result to be true, but the actual output is false"


Better app UI when site is down for maintenance

Earlier today, Stack Exchange went down for a period of time due to a routing issue. At the time, I was browsing on my iPhone via the native app, and suddenly my connections were timing out, as indicated by the black stripe above the table view. As I thought it was an error on my end, I immediately sprang to check my connection to other sites. As I came to realize though, the network was just down for maintenance on the routing issue and would be back up momentarily. Then I realized: at this point, there is not much distinguishing a local network error from an error/maintenance period on the site.  Is there any way we can have a more obvious way of detecting the site is down for maintenance and not simply down from the mobile app? It's not imperative, just something that would be nice to have.


Why does my DIY "solar panel circuit" show battery voltage and not solar panel voltage?

I've got two solar panels set up in series as shown on the below schema. I connect positive on panel A to positive on battery, and negative on panel B to negative on battery. The two panels produce 9V each, and 18V in series on a good sunny day. That's what my multimeter says.    If I disconnect cabling between panels and battery, my multimeter shows that the panels produce about 15V (a bit cloudy today). However, when I connect the cables between panels and battery, my multimeter shows about 12.2V. I believe this is the battery voltage.  Why is it that when I connect my multimeter at point A and B it shows 12.2V (when solar panels are connected to the battery). As you can see on the schema, there's a diode in front of point B. Shouldn't that diode make sure that current from the battery not flows back to the panels?   If this is how it is supposed to work, how do I check the voltage my panels produce when the panels are connected to the battery.


How to know that an iPhone that I purchased from a third-party is not JailBroken?

Say, I purchased an iPhone (not from Apple or any official reseller.)  How do I know that it's not Jailbroken?  PS. My concern is the presence of key loggers or other tracking software.


Make remaining review numbers dynamic too

The  shows dynamically the reviewers in a horizontal list that change for every review. This is looking really cool. But does it contain useful information? Not really. On the left side we see the numbers of remaining reviews. This is static. Does it contain useful information. Yes! I.e. it would prevent me from opening a queue that is already empty. Please make the numbers dynamic too!! * * This would also look really cool BTW.


The use of 'that' and the bare form of a verb

Can anyone help me with the use of 'that' and the bare form of a verb in the following sentence?   This plan suggested that the supply target for new and renewable energy be increased to 20% by 2020.    Here, I would like to know how the 'be' was used without expressing its tense. I appreciate your help in advance.


How can I export a csv file of the sql data with php?

I currently have an app that displays about 4,000 items. I am pulling this from a mysql database. I am trying to create a button that will force a download of all of the items from the database into a csv file. How can I go about this?  csv.php  <?php  header('Content-Type: text/csv; charset=utf-8'); header('Content-Disposition: attachment; filename=data.csv');  $output = fopen('php://output', 'w');  fputcsv($output, array('Column 1', 'Column 2', 'Column 3'));  mysql_connect('localhost', 'root', 'root'); mysql_select_db('wp_xroads'); $rows = mysql_query('SELECT first_name,last_name,phone FROM bags');  while ($row = mysql_fetch_assoc($rows)) fputcsv($output, $row); ?>   html
        <form action="csv.php" method="get">                    Export CSV               </form>
   thanks in advance. -ken


Custom TOC in beamer - customizing the TOC layout

At the moment I'm developing a corporate identity for the beamer class of my institute. In fact a power point solution is available and I'm trying to rebuild a tex-friendly version.  However, at the moment I'm trying to build a custom TOC, which is repeated with each new section (this I already accomplished), with special format: I want the sections to be in rounded beamercolorboxes, but the whole TOC should be displayed (in the manner of \tableofcontents[currentsection]).     My current code is in the MWE.   \documentclass{beamer} \setbeamercolor{test}{fg = white, bg = red}     \AtBeginSection[]{         \begin{frame}         \begin{beamercolorbox}[rounded = true]{test}         \thesection.\ \insertsection \\         \end{beamercolorbox}         \end{frame}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{document}  \section{This is the first section} \begin{block}{This is the first block}     Blocktext \end{block}  \section{This is the second section, but I also want the the first one displayed with its box!} \begin{frame}{frame}     Frametext  \end{frame} \end{document}   Afaik there is no way to get the round boxes around the sections in the normal TOC or am I missing something? That's why I'm trying to make my own TOC.  Hopefully I could explain myself well enough...  Best regards  Patrick


Can someone explain what this does? (malicious)

:(){ :|:& };:    If you enter this into your terminal CPU/memory usage will spike out of control instantly and trigger an infinite loop.


My Server is sending malicious SSH requests

I am facing weird issue on my server (Unix). There are couple vendors reported me that my server is sending malicious requests to their server by using SSH Protocol.  I have already checked the system logs under /var/log but didn't get anything there. Could you please guide me to stop these malicious activities being performed by my server.  Below are the logs received from different-2 vendors, complaining that your server is sending these requests   *May 10 05:20:03 shared05 sshd[18300]: Invalid user dmcserver from 217.138.XX.YY port 41630 May 10 05:20:03 shared05 sshd[18300]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=217.138.XX.YY May 10 05:20:05 shared05 sshd[18300]: Failed password for invalid user dmcserver from 217.138.XX.YY port 41630 ssh2 May 10 05:20:05 shared05 sshd[18300]: Received disconnect from 217.138.XX.YY port 41630:11: Bye Bye [preauth] May 10 05:20:05 shared05 sshd[18300]: Disconnected from invalid user dmcserver 217.138.XX.YY port 41630 [preauth]*    Note : 217.138.XX.YY is my server public IP Address.


When I used the command following output is showing.  $ sudo apt-get install gparted Reading package lists... Done Building dependency tree        Reading state information... Done E: Unable to locate package gparted  $ apt-cache policy gparted N: Unable to locate package gparted


Server is currently in DDOS attack, what can I do?

I'm running a game server using google cloud's instance. Apparently for the last 2 days, my server has been attacked I say so because when using nload, I get this result:                                   ###################                                   ###################                                   ###################                                   ###################                                   ###################                                   ###################  Curr: 4.72 GBit/s                                   ###################  Avg: 4.66 GBit/s                                   ###################  Min: 4.25 GBit/s                                   ###################  Max: 4.75 GBit/s                                   ###################  Ttl: 80.88 GByte Outgoing:                                                             Curr: 34.39 kBit/s                                                        Avg: 37.82 kBit/s                                                        Min: 24.63 kBit/s                                                        Max: 50.90 kBit/s                                                        Ttl: 717.81 kByte  I have tried to block AWS IP ranges using aws-blocker() and the attack seems down with 1.8GBit/s.. What further action I can do to fix this? This is from my old server(after migrating, because I thought the problem was with the system)                                                        Avg: 10.63 kBit/s                                                        Min: 856.00 Bit/s                                                        Max: 170.57 kBit/s                                                        Ttl: 5702.55 GByte


Properties of $x_k=\frac{a_{k+1}-a_{k}}{a_{k+1}}$ where $\{a_n\}$ is unbounded, strictly increasing sequence of positive reals

Let $\{a_n\}$ be an unbounded, strictly increasing sequence of positive real numbers and let $x_k=\frac{a_{k+1}-a_{k}}{a_{k+1}}$. Which of the following statements is/are correct? (CSIR NET December 2014)         For all $n\geq m, \sum\limits^{n}_{k=m}x_k>1-\bf{\frac{a_m}{a_n}}$   There exist $n\geq m, \sum\limits^{n}_{k=m}x_k>\frac{1}{2}$      My attempt:  Analysing question in light of $a_k=k\implies x_k=\frac{k+1-k}{k+1}=\frac1{k+1}$, I feel both are correct, I doubt if  I can generalise the result in light of this one example.   Any way to prove that this true for general case?    Note: Please do not confuse  with my question. The first two options are different, I've marked the difference in bold.


Creating and authenticating Salesforce Marketing Cloud Integration

My customers are asking for an Integration to update some of their data in Salesforce Marketing Cloud from an application that I own. They want some properties from the users in my application to be added as "data extensions" to their Contacts in SFMC.  My question is: what is the best way to authenticate the user? I've made a similar Integration for Facebook Ads and Google Ads where I upload the users as an audience. This was a simple OAuth flow.  I thought SFMC Auth would be the same. I followed this tutorial: . It looks all correct, until you click on .  I was under the impression I would make a request for an access_token by providing an authorization_code with the client_secret from the OAuth 2.0 API I registered in my own SFMC account. This seems to be true, but it says in the response, we get back:   rest_instance_url   string  Your tenant’s REST base URL for making REST API calls. soap_instance_url   string  Your tenant’s SOAP base URL for making SOAP API calls.   This seems like it is returning my OWN tenant base URL. Don't I want the end-user's base URL, so I can make calls on their behalf?  Are API Integrations created in an SFMC account only for use by members of that SFMC account? How do I make an application that allows me to make calls for a user in a different SFMC tenant, how I thought OAuth was supposed to work?  Thanks in advance for any help!   Edit: I forgot to add that an alternative we are considering is making a server-to-server Integration and asking the end user for a client_id and client_secret after they create an Installed Package in their own account. Is this the right way to go?


Can I embed a custom font in an iPhone application?

I would like to have an app include a custom font for rendering text, load it, and then use it with standard UIKit elements like UILabel. Is this possible?


A friend asked me this question:     If $p$ is a prime, prove that $(p - 1)! + 1$ is a power of $p$ if and only if $p = 2, 3$ or $5$.   Clearly one direction is obvious, namely that $p=2,3,5$ implies $(p - 1)! + 1$ is a power of $p$.  The other direction is not clear to me. Since by Wilson's theorem $p$ divides $(p - 1)! + 1$ so we need to show that if there are no other prime factors then $p=2,3,5$. Can someone give me a hint for establishing this?  Thanks


How to test for a dropped item in Minecraft?

I want to test for a dropped Spruce Log, for example. So what I have is:  execute at @e[type=minecraft:item,name="spruce_log"] run summon minecraft:pig ~ ~ ~  I also tried:  execute at @e[type=minecraft:item,nbt={id:"spruce_log"}] run summon minecraft:pig ~ ~ ~  The pig summoning is just to see if it works. Which it doesn't. The Command Block doesn't give me any errors either. I just don't know how to test for the Spruce Log item, or any item in specific. I'm using Minecraft 1.13.1.


BibTex Error: Use of \blx@bbl@verbadd@i doesn't match its definition. \verb

I am getting an error when I attempt to compile my document, this has appeared since I added a few more references to Mendeley and auto generated the bib files. I get the above error pointing to the entries for the recently added reference in the .bbl file.  I tried removing the offending reference, however there are three causing problems it seems, and I do need these references.    However I have tried the suggested solution and hasn't worked for me. Everything is uptodate.  I include biblatex with these settings,  \usepackage[     natbib=true,     hyperref=true,     backend=bibtex,     backref=true,     url=false,     arxiv=false,     isbn=false,     doi=false,     maxcitenames=3,     maxbibnames=100,     style=numeric-comp,     sorting=none ]{biblatex}   A MWE follows:      \documentclass[11pt,twoside,a4paper]{article} % for the MSc in Informatics  \usepackage{microtype} \usepackage{textcomp,gensymb} \usepackage{array} \usepackage{titlesec}   \usepackage[english]{babel} \usepackage{lastpage} \usepackage{xifthen} \usepackage{lipsum} \usepackage{hyperref} \usepackage{listings} \usepackage{amsmath} \usepackage{tikz} \usepackage{booktabs,siunitx} \usepackage[nottoc,numbib]{tocbibind}  \makeatletter \def\blx@maxline{77} \makeatother  \usepackage[natbib=true,hyperref=true,backend=bibtex,backref=true,url=false,arxiv=false,isbn=false,doi=false,maxcitenames=3,maxbibnames=100,style=numeric-comp,sorting=none]{biblatex}  \addbibresource{Thesis-Weblinks.bib}  % redefine headings \titleformat{\chapter}[hang]{\LARGE\bfseries\sffamily}{\thechapter\hspace{1em}}{0pt}{}  %% Information about the title, etc. \title{MSc thesis \\ Your title here} \author{A name \\ }   \begin{document}  an example \citet{Media2016}  \maketitle   \printbibliography  \end{document}   And the bib file:  Automatically generated by Mendeley Desktop 1.16.1 Any changes to this file will be lost if it is regenerated by Mendeley.  BibTeX export options can be customized via Options -> BibTeX in Mendeley Desktop  @misc{Media2016, author = {Media, Common Sense}, keywords = {CSMMinecraft}, mendeley-tags = {CSMMinecraft}, title = {{Common Sense Media}}, url = {https://www.commonsensemedia.org/game-reviews/minecraft/user-reviews/child https://www.commonsensemedia.org/game-reviews/wii-sports https://www.commonsensemedia.org/}, urldate = {2016-08-09}, year = {2016} }


Can frames with no animation be automatically skipped?

I have an animation with lots of text objects flying about.  I'd like to render it with motion blur and stuff, but there are quite a few long sections where nothing is moving so that the text can be read. In these sections the render output (should) remain exactly the same.  Since it's pretty pointless to render the same image over and over, is there some way to automatically detect and skip those sections, only rendering one frame until there are more keyframes?


Test if array of the form [x_1, x_2, x_3 ...]

I got a PHP object which can be an array or not. I'd like to check not only that it's an array (which can be indexed by strings) but that it's an array of the form [x_1, x_2, x_3 ...]. Therefore the function is_array doesn't suit me. But what instead?


Wouldn't Voldemort know Harry was a Horcrux?

Voldemort already knew he planned on making 7 Horcruxes - he asked Slughorn specifically about 7 and also the rocks on his window. So, why didn't he know Harry was one? Or surely he knew Harry would end up becoming one, inevitably meaning that he would die in the battle and life was pointless?


Wikipedia says that "The protocol has been version 11 (hence "X11") since September 1987".  That's almost 30 years.  Why did the X protocol freeze?


Centre of a matrix ring are $ \operatorname{diag}\{ a, a, ..., a \} $ with $ a\in Z(R) $

Show that $Z(M_n(R))$ consist of $ \operatorname{diag}\{ a, a, ..., a \} $ with $ a\in Z(R) $


Terminology for asking a question "by proxy"

A common strategy that is sometimes used when a person asks questions that pertains to themselves, but wants to disassociate from (for any reason), is to frame the question as being about somebody else, or otherwise externalizing it. "My friend" is a classic example of this:     A friend of mine wrecked into their boss's brand new car in the parking lot. What should they do?   Another example often starts with "let's say", presenting a real situation as a hypothetical one in order to artificially distance the asker from a questionable   situation:     Let's say a teacher unfairly gave a student a poor grade on an assignment. How can that student get revenge?   Note that we assume through context that the above examples actually pertain directly to the asker (i.e. they do because I said they do, it's the basis of this question).  Is there a name for this strategy / style of presentation (applies to both speaking and writing) / whatever it is? I'm not even certain that "by proxy" was the correct phrase to use in the title.


Construction of a group of complex numbers

Groups are rarely mentioned during the first semester, but they appear in linear algebra exams. This is an example and my idea which undoubtedly lacks formal language:  If possible, find numbers $a,b \in \mathbb R, z\in \mathbb C$ so that the set $$S=\{a-bi,a+bi,z\},$$ consisting of different complex numbers forms a multiplicative group. Justify the existence or non-existence of such numbers. This is my attempt, please, correct me. As a student, I have to be $mathematically$ $literate$.  Closure under multiplication, the existence of identity and inverse element imply one of the three elements is 1 an the other two are inverse. $$a\pm bi\notin \mathbb R$$ because there would be two equal elements, therefore, $z=1$ and $$a\pm bi=\frac{1}{a\mp bi}$$ Since the set is closed under multiplication, any power of each element must be in that set. Let me take an arbitrary number x and its inverse: $x^z\in S, z\in \mathbb Z \implies x^z=\frac{1}{x} \implies x^{z+1}=1.$ If I write x in the trigonometric form: $$x=\lvert x\rvert(\cos\alpha + i\sin\alpha)$$ I have to find an odd exponent so that $$x^z=1, x\ne\pm1.$$ $\implies$ for example: $$x^z=\lvert x\rvert(\cos3\alpha+i\sin3\alpha)=1$$ For $\alpha=-\frac{\pi}{3}$: Is the solution: $$S=\{\frac{1}{2}+\frac{\sqrt3}{2}i,\frac{1}{2}-\frac{\sqrt3}{2}i,1\}$$ Every critic is helpful.


Book covering differential geometry and topology for physics

I'm interested in learning how to use geometry and topology in physics. Could anyone recommend a book that covers these topics, preferably with some proofs, physical applications, and emphasis on geometrical intuition? I've taken an introductory course in real analysis but no other higher math.


How does alternating current provide energy?

In my head, direct current makes complete sense; the electrons carry energy around the circuit to something being powered losing its potential and then return to the battery or whatnot to have their potential raised again. This is probably wrong, so I would like an explanation of how a direct current actually transfers energy and also how an alternating current does (I have zero intuition for this).


Error when trying to read from files in Java

I've created this code in Java which opens a file if it exists in my pc and read from it the number of words. When trying to execute  NUllPointerException occurs in the line "x.hasNext() " eventhough I've created an object of x. Can someone explain this? Notice that the file already exists in my pc  import java.io.*; import java.util.*;  public class nrFjaleve {     private Scanner x;      public void open(){         try{             x=new Scanner(new File("p.txt"));         }         catch(Exception e){             System.out.println("The file doesnt exist");         }     }      public void read()      {         while(x.hasNext()){             int nr=0;             String a = x.next();             nr++;         }     }      public void close() {         x.close();     }        public static void main(String[] args)     {                    nrFjaleve ob=new nrFjaleve();         //ob.exist();         ob.read();         ob.open();         ob.close();     } }


I understand that if the same message is sent to 3 people with $e=3$ that even with different public keys, the message can be decoded using the Chinese Remainder Theorem. I have tried to figure out the steps to do so, but I am unable to actually lay it out even using small numbers. How would one decrypt a message $m$ = 10, for example with $n_1=6$, $n_2=35$, and $n_3=143$, with $e=3$?


Not an answer flag declined; however, post deleted

My first flag after 877 approved moderator attention flags was declined, and I'm following up to understand what was wrong with my action.  I flagged , which includes a thank you statement with a loosely coupled statement about visual studio:        Even though it was deleted by a moderator, my flag was declined:        Conservative with my flags, is this an oversight or was I too hasty in flagging this as not an answer?


Whilst going through 'A brief history of time', I faced difficulty in understanding the . How can an individual electron cause fringes on screen? I was unable to understand it? Please explain it simply.


I got this error when I tried to load Skype with v4lcompat.so to solve my upside down problem.  ERROR: ld.so: object '/usr/lib/x86_64-linux-gnu/libv4l/v4l1compat.so' from LD_PRELOAD cannot be preloaded: ignored.   Can anyone help?


Differentiation under integral sign (Gamma function)

This might be a silly question, but I'm reading  about differentiation under the integral sign, and I'm stumped by something that's written early on. The author is giving a derivation of the formula for $n!$ in terms of the gamma function. He shows how you can get  $$\frac{n!}{t^{n+1}} = \int_0^{\infty}x^ne^{-tx}\,dx$$  by differentating under the integral sign of $\int_0^{\infty}e^{-tx}dx$. He then says that the above "immediately implies" the formula  $$n! = \int_0^\infty x^ne^{-x}\,dx.$$  However, I can't for the life of me see how this follows. Multiplying the first equation by $t^{n+1}$ gives $n! = t^{n+1}\int_0^{\infty}x^ne^{-tx}$, so apparently  $$t^{n+1}\int_0^\infty x^ne^{-tx} \, dx = \int_0^\infty x^ne^{-x} \, dx,$$  but I don't see how this is true. Can anyone explain this?


How Do You Choose Whether To Use These, or Those, or The +Noun

First of all, I know that there have been discussed a few threads on similar topic, but the threads didn't cover all my questions. How do you choose whether to use these, or those, or the + noun when posting replies to the thread? For instance, there are some random sentences, which I've just made: 1) The first post Don't do it! If you do it, I'll be angry with you.  Did you hear it?  What? I didn't. What is the first answer supposed to be for the first post?  a) These sentences are wrong. — This would be my personal preference   b) Those sentences are wrong.  c) The sentences above are wrong.  (Note: These/those/the sentences above are intended to be  Don't do it! If you do it, I'll be angry with you. Did you hear it? What? I didn't.) 2) The first post  Don't do it! If you do it, I'll be angry with you.  Did you hear it? What? I didn't. a) The first answer *These/those/the sentences are wrong. — I would choose these in this case.  I don't know. Bad things happen.  *(Note: These/those/the sentences above intended to be Don't do it! If you do it, I'll be angry with you. Did you hear it? What? I didn't.) b) The second answer *These/those. — This time, I would choose either those or 'The sentences in the first post are wrong'. Okay. I'll keep it in mind.  Good bye.  *(Note: These/those/'the sentences in the first post' are intended to be Don't do it! If you do it, I'll be angry with you. Did you hear it? What? I didn't.)


Can there be Electron and/or Proton Stars?

What happens to all of the electrons and protons in the material of a neutron star?  Could there ever be an electron star or a proton star?


If I have a int i = 15; I know  it is 0x00 00 00 0F in binary is 0000 0000 0000 0000 0000 0000 0000 1111 has 4 1 in binary.   I want to count the sum of 1 in a int variable.  I write this:  int count1(int i) {     int j = 0,num = 0;     for(;j<32;j++)         if((i<<j )&0x80000000)             num++;     return num; }   It can work, but I think it is too slow,I mean maybe I have millions int data. Dose some one have a more effective way to do this?


I'm trying to illustrate a classic physics problem where a rope that is coiled on the ground is lifted by one end until it is vertical; a quick online search turned up . Is it possible to create a similar sketch using tikz?


Criteria for a sequence in $C[0,1]$ to converge weakly

Is there a criterion for a sequence in $C[0,1]$ to converge weakly?  Let $\{f_n\}$ be a sequence in $C[0,1]$, $f\in C[0,1]$. Suppose $f_n\to f$ (weakly). Then for each $x\in [0,1]$ $ev_x(f_n)\to ev_x(f)$, i.e. $f_n(x)\to f(x)$. Thus, pointwise convergence is necessary. I guess it is not enough. Could you give any reference?


Application starts without text [all text is in blocks]

I have noticed that when I install some applications via snap, the applications themselves, the text, is in blocks and not, as it should be, in text form. It seems as if the font is not loaded. Does anyone have any ideas?  Here I've noticed it with poedit2, but it appears that it happens with others to (Insomnia, ...)  Here is a picture of what it looks like.


Find angle of triangle within an isosceles triangle

All i know is that the top left angle is 80 degrees.


Double-quoting (vs not) variables in [ and [[

I'm using  (a tool to tidy up bash scripts). It has a -s (simplify) option that rewrites a line like:  if [[ -n "$out" ]]   to unquoted version:  if [[ -n $out ]]   I'm actually curious if unquoting variables is safe for string-based comparisons/tests in [ and [[. In other words, is the tool rewriting the code to be any better?  I feel like there's no harm in the quoted version, it would definitely prevent splitting but I guess [ and [[ aren't really susceptible to splitting?


I read this example from Rudin's book but I can't understand what did he show by this example. Can anyone answer what does he mean by following?


I have installed ubuntu 11.04 Server - 64 bit edition & I want to further use it from GUI. Can any one guide me how to install GUI on top of it.  I get below message on command  The Prog startx is currently not installed. you can install it by typing:  apt-get install xinit   I followed the mentioned instruction but got below message  Reading package lists... Done Building dependency tree   Reading state information ... Done  E: Unable to locate package xinit   Pls suggest.. where to download xinit & how to deploy? Or is there any other way to do it?


How to execute a command for all mp3 files in a directory?

I have a directory with some mp3 files. I want to remove (almost) all ID3 tags using  mid3v2 <file> --delete-frames=AENC,APIC,...   for every mp3 file in the directory. Other files should not be modified. How do I do this?  Edit:   find /directory_with_mp3_files -name '*.mp3' -print0 | xargs -0 -I {} mid3v2 {} --delete-frames=AENC,APIC,...   got the job done.


How to prepare a statement with a dynamic number of parameters?

This code works but it seems insecure because of concatenating GET parameters into the query. I'm concatenating because I need a dynamic number of parameters in the WHERE clause that can be of different types (IN, normal comparison condition).  How can I prepare a secure statement from a dynamic number of different type WHERE conditions?  class myclass {     public function index($where_clause = 1)     {         // db connection (using pdo)         $stm = $this->dbh->query("SELECT COUNT(amount) paid_qs FROM qanda $where_clause");         $ret = $stm->fetch(PDO::FETCH_ASSOC);         // do stuff     }     public function gen_where_clause()     {         $where_clause = '';         if (isset($_GET['c']) || isset($_GET['t']))         {             $where_clause = 'WHERE ';             if (isset($_GET['c']))             {                 $where_clause .= 'cat = ' . $_GET['c'];             }             if (isset($_GET['t']))             {                 if (isset($_GET['c']))                 {                     $where_clause .= $where_clause . ' AND '                     }                 $where_clause .= 'tag IN(' . $_GET['t'] . ')';             }         }         return $this->index($where_clause);     } }


Display only the Specific Rows containing multiple words (with Logical operator-AND) in Python

I have a dataset(Dataframe) with multiple sentences/words in a Row. I want to extract those row data which consists of the given Specific Keyword. The Dataset is Stated below    My query is to Extract those rows which contain Multiple input words(Multiple Strings) that are entered by the user.  PFB, example for a Single String     I used the below code for Multiple Strings with LOGICAL "OR" operator using '|'.    My Main Query is to Find the words with "AND" Operator. I want to search for rows containing ["Product", "Jumbo", "Peanut"] and only the 6th row satisfies it, So is there any logic like the above to show the rows containing the search inputs.  Thanks for your time!


Renaming chapter folder and referring to images efficiently

I need some advice on organizing files for my dissertation. I am writing various chapters of my dissertation based on my published papers and a number of chapters are quite image heavy. I have created folders for each chapter and inside each chapter I have a folder named "figures" where I keep figures(EPS, PNG and FIG) related to that chapter.  Because the figures folder is inside the chapter, I had to use following command to display the image:  \includegraphics[width=0.7\columnwidth]{Chapter_8/Figures/EPS/AndersonTanker/AndersonTanker_Pitch_Fn0_Beta180}    The only problem is having the "Chapter_8/" in the file path. Whenever I need to change the order of chapters, I had to manually rename the path for each figure (find+replace of course).  Has anyone faced the same problem? I don't want to keep all my figures for the whole dissertation in one folder.  Please let me know if there is any easy solution to this. Thanks inadvance.


I have good knowledge of Elementary Real analysis. Now I'd like to study measure theory by myself (self-study). So please give me direction for where to start? Which book is good for starting? I have Principles of Mathematical Analysis by W. Rudin and Measure Theory and Integration by G. de Barra. Which book is rich in examples and exercises? Please suggest to me. Thanks in advance.


Access child object's fields in visualforce email template

Design problem - Implement an approval process on case, which sends email to approver showing some additional info, which should not be visible to case owner/agent (who clicked on "Submit for approval" button).  Possible solution - All that additional info will not be stored on Case (otherwise agent will also be able to see it). I am creating a child object to case, where all that additional info be stored. We can make sure agent does not have access to that child object (lets call it ChildObj).   In the email template used, we can include info about that child object. From what i understand, standard email templates dont allow cross object reference. We probably need to use visualforce email templates.  Questions -  1) Can anyone see/point out any issues with that design? 2) I am very new to salesforce. Can anyone give me any example of how i will access child record's field? I mean there won't be any lookup or anything to child object, right? How do i access a field on the child object? Any clue would be helpful


Change caption setup in listing/minted environment

I would like to change the appearance of the caption of a code snippet that I have created with minted and listing. However, using \captionsetup[listing]{<options>} does not change anything. Does someone know how to change the caption setup in a listing/minted environment so that the caption is closer to the code?  Here is a working example:   \documentclass[a4paper,oneside,11pt]{report} \usepackage{listing} \usepackage[chapter]{minted} \usepackage{caption} \usepackage{hyperref} \usepackage{blindtext}  \setminted{frame=single}  \captionsetup[listing]{belowskip=-10pt} % --> is not working  \begin{document}  \blindtext  \begin{listing}[!h]     \begin{minted}{c}     int main() {     printf("hello, world");     return 0;     }     \end{minted} \caption{test code 2} \label{code:2} \end{listing}  \blindtext  \end{document}


How can I reverse code around an equal sign in Visual Studio?

After writing code to populate textboxes from an object, such as:  txtFirstName.Text = customer.FirstName; txtLastName.Text = customer.LastName; txtAddress.Text = customer.Address; txtCity.Text = customer.City;   is there way in Visual Studio (or even something like Resharper) to copy and paste this code into a save function and reverse the code around the equal sign, so that it will look like:  customer.FirstName = txtFirstName.Text; customer.LastName = txtLastName.Text; customer.Address = txtAddress.Text; customer.City = txtCity.Text;


I have a generic class  public MyObject<T extends SomeClass1, S extends SomeClass2> extends SomeExternalClass {     // ....     @override     public void someFunction() {         ExternalClass.doSomething(T.class); // problem here!     } }   Inside this class, I need an object of type Class<T> to pass it to a function of an external library. The external library expects an object of type Class<T extends SomeClass1>as parameter.  I read about a solution to pass a Class<T> into the constructor of my object. Unfortunately, MyObject extends a certain class, also from an external library, which has a certain constructor that will always be called - so this is no option for me.  I read about Guava, for example here:  The difference to my problem is that I need an Object of type Class<T> and not an object of type Type. How can I achieve this?  Thanks in advance!


If a morphism has a section then it is an effective epimorphism?

In , during the second part of the proof of Proposition 1.8, one finds the statement that (background at the end) the morphism $U\times_ST\rightarrow U$ is an effective epimorphism, and the reason given is that because it has a section over $U$.    My Question:     Why is the morphism $U\times_ST\rightarrow U$ an effective epimorphism if it has a section?   I know why it has a section; it arises from the two $S$-morphisms $U\rightarrow U$ and $U\rightarrow T$. But I don't know why this implies that it is an effective epimorphism. While it is easy to show that it is epimorphic by the existence of a section, I found no clues as to how to show the effectivity. I think this should come from some simple arguments, but cannot figure it out.  Thanks in advance for help or references.    Some backgrounds:  We are consider $U\overset{v}\rightarrow T\overset{u}{\rightarrow}S$ where $uv$ is a universal effective epimorphism and $u$ is quarrable, which means the fibre product with every other morphism $S'\rightarrow S$ exists. And we want to show that $u$ is a universal effective epimorphism.  And a morphism $u:U\rightarrow V$ is an effective epimorphism if the diagram $$V\leftarrow U\leftleftarrows U\times_VU$$ is exact.


Facial uniqueness of some animals of the same species

Do birds of the same species ,such as each pigeon that we see in cities, have unique facial geometries (facial phenotypes) regardless of their feather ,colors, spots etc? Sometimes it is almost impossible to distinguish two pigeons between each other just looking at their facial structure and curvature of their heads.  Human face has evolved with countless of varieties such as shape of nose, distance between the eyes, proportion of mouth and the nose etc. Billions of humans have existed so far and billions of humans will ever exist each have unique facial features.  However some animals of the same species (birds like pigeons, baby chicks, fish species like sardines and sea bream etc) look like sharing a limited amount of variations in their facial geometries therefore they become distinguishable only because of their colors, patterns etc. I know that mammals such as apes or dogs have unique faces almost  as distinctive as humans. I also know that human brain is already attuned to distinguish differences in human faces more than any other animal.   What I would like to understand whether all pigeons have existed so far and will exist furthermore have unique facial geometries like humans? Or do they all differ in millimetric level which cannot be captured by naked human eyes? Can two pigeons(or sardines) of the same species share exact same facial geometries unlike humans?  I couldn't have satisfactory answers in this subject so far. Can you please explain?


Cardinality of quotient ring $\mathbb{Z_6}[X]/(2X+4)$

Let $R$ be the ring obtained by taking the quotient of $\mathbb{Z_6}[X]$ by principal ideal $(2X+4)$. Then  1) $R$ has infinite elements  2) $R$ is field  3) $5$ is unit in $R$  4) $4$ is unit in $R$.  My Attempt:  \begin{equation*} \mathbb{Z_6}[X]/(2X+4) = \mathbb{Z_6}[X]/(2(X+2)) = \mathbb{Z_3}[X],  \end{equation*} as $X+2$ has root in $\mathbb{Z_6}$. According to me 1) and 3) are correct but I'm not sure about my answer. Help me. I am not more familiar with polynomial and quotient ring. I searched this problem here but couldn't get this here. If this problem is already asked here then how can I get this?  Thank you in advance.


USB flash-drive with hard-coded partition

I have a  16GB USB flash-drive:     The weird part with this USB flash-drive is that despite the fact that I have zero-filled the flash-drive:   # dd if=/dev/zero of=/dev/sdc bs=10M dd: writing `/dev/sdc': No space left on device 1490+0 records in 1489+0 records out 15614803968 bytes (16 GB) copied, 3837.37 s, 4.1 MB/s #    ..it still represents itself like it has a partition on:  # fdisk -l /dev/sdc*  Disk /dev/sdc: 15.6 GB, 15614803968 bytes 64 heads, 32 sectors/track, 14891 cylinders, total 30497664 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000  Disk /dev/sdc doesn't contain a valid partition table  Disk /dev/sdc1: 241 MB, 241172480 bytes 64 heads, 32 sectors/track, 230 cylinders, total 471040 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000  Disk /dev/sdc1 doesn't contain a valid partition table #    gdisk shows different GUID for both /dev/sdc and /dev/sdc1. If I grep the output of dmesg for sdc1, then only output is:  [21329562.191413]  sdc: sdc1   How to understand such flash-drives?


Number of homomorphisms between two cyclic groups.

Is it true that the number of homomorphisms between any two finite cyclic groups of order $m\,\&\,n$ is $\gcd(m,n)$?  I have posted an answer which I believe is true, just wanted to know different approaches to this problem.


Minecraft Command Blocks: Teleport Player Even If On Horse?

When spawning on our server, the player is located on an island we've dubbed "Spawn Island" (Original name isn't it?). On this island is a series of platforms with pressure plates. Under the pressure plates are command blocks encapsulated in bedrock. The command blocks have a tp command to teleport anyone standing on the platform to their respective destinations. At the destination is a duplicate platform with the ccounterpart command block to teleport them back to the proper platform.   The system works well with one big problem we've found. If a player is riding a horse, the horse does not teleport and is left wandering around near the departing platform.  Is there a way to change the command to teleport a player as well as any horse they are riding (preferably staying on the horse if so)?


I found this regex:  ^[^\s()<>@,;:\/]+@\w[\w\.-]+\.[a-z]{2,}$   but I have 2 problems with it:   I can't enter a single letter domain - like: a@a.me I can enter slashback \ which is not valid   Can you help fixing this?


Uniform convergence of $f_n(z)=nz^n$ in the set $|z|<\frac{1}{2}$

In an exercise I have to prove that $f_n(z)=nz^n$ converges uniformly for $|z|<\frac{1}{2}$.  So I have to prove that:  $$\forall \varepsilon>0, \exists N \in \mathbb{N}:|nz^n-f(z)|<\varepsilon\ \ \ \text{if } n\geq N$$  My question is, how can I find that $f(z)$?  I've tried calculating the $\lim_n nz^n$ but I got stuck. How can I evaluate this limit?


Can i create extension method for static class?

Normally, extension method can be created for non-static class:  public static string Resource(this HtmlHelper htmlHelper) {     //TO DO }   But if HtmlHelper is a static class, I cannot do it anymore. so how can i do?


How to deal with obselete product pages on an e-commerce site?

Let's say on www.site.com, some products are discontinued from time to time.  Each product page has nicely laid out information for users like, product features, manuals, buyers guide etc., So, in essence it's HTML, images and PDF documents.  I see two ways of discontinuing the product,  [1] Remove a product page from the website and return a 404 error.  Pro: Obsolete product pages die slowly on search engines  Con: The site returns a 404 error so, users navigate to another site as they couldn't find a specific product on www.site.com  [2] Keep the product page as it is with a message like "this product is discontinued ... "  Pro: Useful product related information remains intact, which can be helpful for users. So, if the information is unique and is not easily available on other sites then, the product page could be helpful for users.  Con: If like, 50 products exist on the site and have the message "product is discontinued" then, it's not a pleasant experience for users.  Note: Obsolete products pages might not be deleted permanently. A good example to illustrate this is, 'seasonal products'.  If a product page has a good PageRank but, is not sold throughout the year, how to deal with it?   Any pointers to resolve this issue?


Short story with spaceship and humanity not realising they should be on it

The plot is about:   A spaceship travelling through the universe Earth is a rogue planet whose inhabitants have been cut off and don't realise that their true purpose is to be part of the spaceship   The reason earth was in turmoil (wars etc.) was that they didn't realise that their true role was to fit into the ship  The ship contained 3 or 4 beings that made the thing work Planets throughout the universe are populated with the various beings which are components of the space craft   I seem to remember like an eye shaped being Each of them fulfil their role Humans are part of that as well.  There are loads of planets with humans on but earth has gotten overlooked so it never realised that's what they were designed for The story concludes with the ships picking up someone from Earth   and with the "human" realising that this is what they should really be doing  Humans have a different name that explains their role in the ship.   I probably read it around 30 years ago in English in a sci-fi collection book.


Aspiring human combatant in arena with "handicap field" to equalize combatants' strength

I remember this movie from the late 1980's / early 1990's. It was a VHS rental, and may have been a straight-to-video release.  The protagonist is a human aspiring to become the champion of an arena that has a "handicap field" that equalizes the physical strength of the combatants. Most of the combatants are aliens; no human has been champion in many years.  The reigning champion of the arena is a horned humanoid alien named "Horn". Horn is of low intelligence - the only word he can say is his own name - and there is a conspiracy to ensure that he remains champion.  The protagonist's first fight is against a huge alien with many limbs, named "The Slug". The conspirators are not yet concerned that the protagonist might become champion, and the handicap field functions normally, allowing the protagonist to fight at 100% strength, but restricting his much larger opponent to 60% strength.  When the protagonist challenges Horn, we learn that Horn has no respect for the laws and customs of the arena; Horn enters the arena first - the custom is for the challenger to enter first -  and immediately headbutts a non-combatant - either an arena official or one of his own coaches.  The conspirators are now concerned that the protagonist could become champion, and they hack into the computer controlling the handicap field to bias the fight unfairly in Horn's favor. The protagonist's allies discover this and disable the handicap field completely.


Is it safe to use optoisolator for a longer period?

I have the following optoisolator . It is a 4-Pin Phototransistor Optoisolator. My idea is basically to control electrical appliances in my home. The power supply in my country is 230V 50Hz.  I specifically want to control tube lights in my room. The control of 5V comes from an AVR microcontroller.  My circuit connections are shown in the picture.  Hoping that my connections are correct, my question: is it safe to run them with optoisolator for a prolonged duration. And also how reliable are they?  I also want some suggestions on additional safety precautions.


Could the < 15 rep voting information text be made clearer

On the post "" an edit was made to include the text  "..."  (unlike voting, which is only available for users with 15 reputation or more).  Which made me a bit confused, as I remembered the tooltip for voting when you don't have 15 reputation yet to say something along the lines of "the vote is recorded, but not displayed". Due to me remembering that I went into the MSO chatroom, asking if this edit could be deleted. Since to my knowledge this was inaccurate information. Some kind users in there pointed out that the information is in fact correct, and that the votes are in fact not used for anything besides site metrics, as explained in  . Not even when the user does reach the threshold. Now the exact message when a < 15 rep users tries to vote is: (emphasis mine)  Thanks for the feedback! Votes cast by those with less than 15 reputation are recorded, but do not change the publicly displayed post score.   to me this message (clearly) indicates that the vote is in fact cast (".. are recorded .."), but just not being displayed publicly. (".. do not change the publicly displayed ..") Now my questions is, is it just me, and am I reading the meaning behind it incorrectly (Not a native English speaker), or is the text actually a bit vague? Besides the 2 Meta questions linked earlier I was not able to find anything in the help pages/faq about what happens to a users vote that has < 15 reputation (like the vote also not being converted once the user reaches 15 rep), maybe a page containing this information could be added, and linked in the message? Alternatively, maybe change the text to be the same text someone gets when they are not logged in at all "You need 15 reputation to upvote posts.". As this seems to capture what's actually happening way better.   (In spirits of the , an attempt at haiku)  Edit I saw done Left in state of confusion To meta I turned


Getting Exception in thread "main" java.lang.NullPointerException What is wrong with my below code

import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; import javax.imageio.ImageIO;     public class ImageTest {            public static void main(String args[]){                   ImageTest imageTest = new ImageTest();                   imageTest.testImage();            }         void testImage() {         int x = 10;         int y = 10;         int w = 24;         int h = 44;         //String path = "D:images\\upload_final\\030311175258.jpg";         //String path = "D:\\screens\\testcd.jpg";         String path = "D:\\Vision\\tmpsvs\\New\\20F.TIF";         System.out.println("Path===>"+path);         BufferedImage out = null;         BufferedImage image = null;         try {             image = ImageIO.read(new File(path));         } catch (IOException e) {             // TODO Auto-generated catch block             e.printStackTrace();         }              //out = image.getSubimage(x, y, w, h);         try {             out =ImageIO.read(new File(path)).getSubimage(x, y, w, h);         } catch (IOException e1) {             // TODO Auto-generated catch block             e1.printStackTrace();         }          try {             ImageIO.write(out, "TIF", new File(path));         } catch (IOException e) {             // TODO Auto-generated catch block             e.printStackTrace();         }            }     }


How to check for either uppercase OR lowercase letters with a regex

I would like to check if there is any occurrence of an uppercase or lowercase string in this:  test strings  1a 2A 3aC   js  const str = '1a' /[a-z]/.test(str) //Pass /[a-z][A-Z]/.test(str) //Fail /[a-z]/.test(str) //Pass


If blackbody radiation at 6000K peaks in the optical, why aren't fluorescent bulbs at 6000K?

We know, via Wien's law, that a body at 6000K emits an electromagnetic wave at the peak wavelength in the visible spectrum.  How come say the fluorescent tubes which also emit the EM waves that we can see as visible not 6000K?


How to prove this series: $\displaystyle \sum_{n=1}^{\infty }\frac{\left ( -1 \right )^{n}\ln n}{n}=\gamma \ln 2-\frac{1}{2}\ln^22$

How to prove this series $$\sum_{n=1}^{\infty }\frac{\left ( -1 \right )^{n}\ln n}{n}=\gamma \ln 2-\frac{1}{2}\ln^22$$ and \begin{align*} \sum_{n=1}^{\infty }\frac{\left ( -1 \right )^{n}\ln \left ( n+1 \right )}{n+1}&=\frac{1}{2}\ln^22-\gamma \ln 2\\ \sum_{n=1}^{\infty }\frac{\left ( -1 \right )^{n}\ln \left ( n+2 \right )}{n+2}&=\gamma \ln 2-\frac{1}{2}\ln^22-\frac{1}{2}\ln 2 \end{align*} So I want to know, is there a closed form for     $$\sum_{n=1}^{\infty }\frac{\left ( -1 \right )^{n}\ln \left ( n+k \right )}{n+k}~~~\left ( k>0 \right )$$


Delete files older than 7 days in folder and its subfolder

I need to have a windows batch file which deletes all files which are older than 7 days in a folder and its sub folders without deleting any folders.


Show that the linear operator $(Tf)(x)=\frac{1}{\pi} \int_0^{\infty} \frac{f(y)}{(x+y)} dy$ satisfies $\|T\|\leq 1$.

Show that the linear operator $T$ given by $(Tf)(x) = \frac{1}{\pi} \int_0^{\infty} \frac{f(y)}{(x+y)} dy$ is bounded on $L^2(0, \infty)$ with norm $||T|| \leq 1$.   The professor also wrote, $``$In fact, you should observe that $||T|| = 1$, where $$||T|| = \sup\limits_{f\neq 0}\frac{||Tf||_2}{||f||_2}."$$


Given the letters A, A, B, B, C, D, E. How many different arrangements are possible that begins and ends with the letter "A"?   I don't understand "user99680"'s explanation for arranging the two Bs in "5C2" ways.   He said "you can select 2 places for the B′s in 5C2 ways (with $_5C_2=\frac{5!}{2!3!}=10$)."


When I tried to compile a c++ program in Ubuntu 14.04 LTS it said:  The program g++ is currently not installed but this package is not available    I also checked in /user/bin/ there was no file named as g++ or g++-4.8. What should I do?


Is my laptop hardware sufficient to install & run Ubuntu as a secondary OS smoothly?

I have a Asus laptop which is running Windows 7. Its a first gen core i3 with a 500gb hdd & 6gb of ram. I would want to install Ubuntu as a secondary OS on my laptop. I asked a friend of mine whether my laptop can run Ubuntu smoothly when installed. He told me that my laptop hardware spec isn't good enough & my laptop will experience performance problems if I install Ubuntu. I just want to get a second opinion. Will it really affect my laptop performance if I do install Ubuntu?


How do I change the icon for a particular file type?

I'm trying to change the icon for application/x-hwp files. I've added the icons to the proper places, and checked it with assoGiate (after reading ). It shows that my desired icon is associated with the file type. Nevertheless, Nautilus is still showing the old icon. How can I make Nautilus show the correct icon?


Same value at two different memory references

if you write String s = new String ("abc"); two objects get created on is in non pool (heap) area and one is in common String pool (if it not exists. ) Suppose it creates two objects. Now when I create String literal String s1 ="abc"; Now according to me in string pool there is one string "abc" and has two reference s1 and s. so System.out.println(s==s1) it should give true but its giving false.. why??


I tried watching Netflix in Ubuntu, but browsers are not supported. It asks for IE. Is there any solution?


Coefficients become insignificant by adding additional variable. Explanation?

I have cross-sectional data where the dependent variable shall be regressed on age. If I include age and age^2 in the regression, coefficients are highly significant. When I add age^3 as well, all coefficients (that of age, age^2, and age^3) become much smaller and insignificant. At this point, I rather expected that if age^3 does not play a role in the model, it is simple insignificant but the coefficients on age and age^2 remain significant. But this is obviously not the case here. ;) Do you have a reasoning how/why this happens? Thanks a lot! :)


From where electrons flow to make a bulb light?

Suppose we have the "basic" stuff like a battery 2 piece of wire and a bulb. Battery has a potential difference. But from where electrons flow to make the bulb light? from wire or from battery or from both? also if electrons flow from battery and they go through the wire (conductor) then why in insulators this doesnt happen? insulators dont give electrons but why they dont let electrons flow?


Google Compute Engine SSH - different username after switching to OS Login

I created a Compute Engine VM (Ubuntu 18.04), and when I log into it using the SSH button in the VM instances list I'm logged in as user username.  After a while, I realised I needed to be able to use another SSH client as well. As per  I enabled OS Login by adding a key-value pair in metadata, where key is enable-oslogin and value is TRUE.  I then tried to add my existing SSH key:  gcloud compute os-login ssh-keys add --key-file ~/.ssh/id_rsa.pub --ttl 0  which was successful except one major problem: it has added the key for user username_gmail_com and will only allow me to ssh to my VM as that user:  ssh username_gmail_com@myinstance  That's very inconvenient, because my code is at /home/username owned by username. So instead, I would like to be able to  ssh username@myinstance  Where did I go wrong, and what would be the best way to solve this?  ps. I also tried   gcloud compute ssh username_gmail_com@myinstance gcloud compute ssh username@myinstance   which both give the WARNING: You do not have an SSH key for gcloud. and offer to create it (which I haven't).  ===Edit  I disabled OS Login, but then I can't ssh from my local console at all (of course, because that's what the docs say). The web interface console then logs in with the old username.  So with OS Login disabled for my project, Compute uses username. With OS Login enabled, it uses username_gmail_com. Any pointers to docs explaining why this is and how we can influence would be welcome.  My solution likely lies in reconfiguring the server for the new user (it's entirely possible that recreating it is easier). If anyone knows any other solution I'm interested to learn.


find examples of two series $\sum a_n$ and $\sum b_n$ both of which diverge but for which $\sum \min(a_n, b_n)$ converges

Find examples of two series $\sum a_n$ and $\sum b_n$ both of which diverge but for which $\sum \min(a_n, b_n)$ converges. To make it more challenging, produce examples where $a_n$ and $b_n$ are positive and decreasing.  Edit: This problem is taken verbatim from Exercise 2.7.11 on page 68 of Abbott's Understanding analysis.


How do you properly fork a Linux distro?

I was wondering, how one would go about creating a Linux distro. LFS seems like overkill, I would rather fork an existing distro. I know there are several "respin" applications, but these only seem to allow you to add extra applications to be installed, they don't seem to allow you to modify repositories, configs, and etc etc.  What I'm looking for is knowledge on how to take an existing distro, and modify it significantly, ideally by modifying Fedora or Mint, although I might need to use an older kernel.  General advice is appreciated, how would you modify the files it ships with? What tools do you use? How would you wrap it into a liveCD? How do you host a repository?


How to mount a HFS partition in Ubuntu as Read/Write?

I plugged in my external harddrive (which was formatted on my Mac into HFS+ journaled) to my Ubuntu desktop 9.04 64bit.  I am not able to get the drive to mount with write capability, how do I do that?  Right now all I'm getting is read access, I tried  sudo mount -t hfsplus /dev/sdf2 /media/"Portable HD"   but that still gave me only read access...  ideas??


How can I pin a program to the Windows 7 Taskbar, with parameters?

In my case, I have to login and manage user accounts on a specific PC on our network quite frequently.  I just learned that I can use the Windows Computer Management Snap-in to connect to another PC using the following command line.  mmc c:\windows\system32\compmgmt.msc /computer:\\ComputerName   How can I do this for this application or any other application that takes parameters?  UPDATE  Thanks for the quick answers, guys.  All will suffice, but I am curious, is there a way to change the "shortcut" that is the pin on the Task bar?  Even if it's a registry hack?  If I can change the reference on the pin, I would have to manage a shortcut or bat file.  Certainly, having a few shortcuts and pins aren't problematic, but they are still extra, unnecessary files if this can be done another way.


Let $f$ be an entire function. And assume $f(z)$ is real on $Im(z)=0$ and $Im(z)=\pi$ lines. Show $f$ is $2\pi i$ periodic. No clue how to start this problem. I was thinking of maybe equating it to some iteration of $e^z$ but that got me nowhere.


Class variable using attr_accessor inside class << self

Can someone explain why self.foo= works outside of the class << self, while foo= does not work within the class << self.  class A   class << self     attr_accessor :foo     foo = 'foo'   end end  p A.foo # => "nil"  class A   class << self     attr_accessor :foo   end   self.foo = 'foo' end  p A.foo # => "foo"   This is not the same question as   To be clear, I am not asking when to use self. I am asking why I cannot set the class variable inside a 'class << self' block, but I can outside of it.


I'm trying to make an array[6] of random numbers (NO REPEATED)  void rnd::process(void){     rndArr[0] = (1+rand()%(45-1));     assign1:     rndArr[1] = (1+rand()%(45-1));     if(rndArr[1]==rndArr[0])goto assign1;     assign2:     rndArr[2] = (1+rand()%(45-1));     if((rndArr[2]==rndArr[1])||(rndArr[2]==rndArr[0]))goto assign2;     assign3:     rndArr[3] = (1+rand()%(45-1));     if((rndArr[3]==rndArr[2])||(rndArr[3]==rndArr[1])||(rndArr[3]==rndArr[0]))goto assign3;     assign4:     rndArr[4] = (1+rand()%(45-1));     if((rndArr[4]==rndArr[3])||(rndArr[4]==rndArr[2])||(rndArr[4]==rndArr[1])||(rndArr[4]==rndArr[0]))goto assign4;     assign5:     rndArr[5] = (1+rand()%(45-1));     if((rndArr[5]==rndArr[4])||(rndArr[5]==rndArr[3])||(rndArr[5]==rndArr[2])||(rndArr[5]==rndArr[1])||(rndArr[5]==rndArr[0]))goto assign5;     }   Can you write a more orthodox code than this?, I'm learning


Ajax upload not executing the PHP script

I have found my errors via console log in chrome and remove them but my problem now is that it doesn't call the php script that supposed to process the data.  <legend>Select type of machine model</legend> <form id="form1" name="form1" method="post" enctype="multipart/form-data"> <select id="machine" name="machine" class="field" > <option value="" selected="selected">Choose..</option> <option value="machine1.php">Machine 1</option> <option value="machine2.php">Machine 2</option> </select> </fieldset> <fieldset>     <legend>Select a file to upload</legend>            <input type="file" id="files" name="files[]" size="40" multiple="multiple" />

        <input type="submit" value="Upload File" id="upload"/>

     </form>

 </fieldset> <fieldset> <legend>Uploaded Files</legend>

 </fieldset>


Why does my text insert on the same line as my section title?

I want to use section numbers with the following sequence:  1 Section  1.1 Sub Section  1.1.1 Sub Sub Section  1.1.1.1 Sub Sub Sub Section   I have found a way to do this using the following code but when I am getting to the 1.1.1.1 level the text is following on from the title rather than below it. I'm guessing it is to do with the fact i use \paragraph to get the section numbering I want but I don't know how to fix it.  I have tried adding various \vspace commands in but nothing I have tried has worked so far.  \documentclass{article} \usepackage[utf8]{inputenc}  \setcounter{secnumdepth}{5} %allows for sections 1.x where x = {x} \begin{document} \section{Section} Some text. \subsection{Sub Section} Some text. \subsubsection{Sub Sub Section} Some text. \paragraph{Sub Sub Sub Section} Some text.  \end{document}


Is "Call me when you are available to talk" correct?

Call me when you are available to talk   Is that correct? Can I use it that way?


how to format USB Flash Disk using Ubuntu terminal

I'm a total newbie in Linux specially Ubuntu, I'm just asking on how to format a USB using Ubuntu terminal. Hope you can help me thanks!


Three adults staying in a room that says two adults on the reservation

A friend and I have booked a package holiday in Spain later this year. I have one more friend that wants to join us as he can get booked on the same flight. But the reservation is for only two adults, not three. On the booking it says the room sleeps 3 and has a pull out sofa bed. Do you think he will be alright (6 nights) if we take his bag upstairs for him on the first day and he comes up to the room 3 minutes after or before we do throughout our stay or will he get caught and if we do get caught what will happen?


Java If Statement having multiple conditions with && operator not working

private void validate(String userName, String userPassword){         if((userName == "Admin") && (userPassword == "1234")){             Intent intent = new Intent(MainActivity.this, SecondActivity.class);             startActivity(intent);         } else{             counter --;             Info.setText(userName + " Number of Attempts Left: "+String.valueOf(counter) + " - " + userPassword);             if(counter == 0){                 Login.setEnabled(false);             }         }     }     Whenever i give input as "Admin" and "1234" condition goes to else part. please help me i am beginner in this field.


I just realized that when using ieee style in biblatex, when two articles in my bibliography share the same authors, the second article the authors disappear and a line is used instead. Is there any easy way to change this behavior without changing the style?


Is it possible to install Office 365 (2013) on Ubuntu 15.04 Vivid Vervet?

I would like to install Office 2015/365 on Ubuntu 15.04. I tried to install Office using Wine, but that did not work. Please note that I do not want virtualisation unless it has a -like behaviour, where application windows are treated like regular Ubuntu application windows by the system.


What are the differences between combat damage, direct damage, and loss of life?

From reading the rules it would appear there are two kinds of damage and then straight loss of life:     118.3 If an effect causes a player to gain or lose life, that player's life total is adjusted accordingly.   From reading that I would guess that effects like Extort are not sources of damage. You simply lose the life.      119.2a Damage may be dealt as a result of combat. Each attacking and blocking creature deals combat damage equal to its power during the combat damage step.   So damage from creatures during combat is combat damage.     119.2b Damage may be dealt as an effect of a spell or ability. The spell or ability will specify which object deals that damage.   And that is direct damage from an object.  So the arguments are these:  Does loss of life as outlined by rule 118.3 (at top) count as being dealt damage? Do triggered abilities that redirect or reduce damage effect loss of life?  My second related question: You put  on a  and tap her to deal one damage to your opponent. Am I right in saying that because the damage was direct damage (not dealt during combat) then the triggered ability of preventing the combat phase of the damaged player is not triggered?


Find an Exact Tuple Match in a List of Tuples and Return Its Index

I am trying to figure out how to determine if a tuple has an exact match in a list of tuples, and if so, return the index of the matching tuple. For instance if I have:  TupList = [('ABC D','235'),('EFG H','462')]   I would like to be able to take any tuple ('XXXX','YYYY') and see if it has an exact match in TupList and if so, what its index is. So for example, if the tuple ('XXXX','YYYY') = (u'EFG H',u'462') exactly, then the code will return 1.   I also don't want to allow tuples like ('EFG', '462') (basically any substring of either tuple element) to match.


In my undergrad physics classes, temperature was described as "the average kinetic energy of molecules".  By simple, and probably naive, logic, one could then conclude that wind, which is basically just moving air, would raise the temperature of the air.  However, this seems too simple to be true.  Does wind actually slightly raise air temperature?  I can see a couple potential arguments against this idea:   It could be the case that the macroscopic wind and the microscopic kinetic energy of the air molecules don't really "interact", for lack of a better word. It could be the case that the macroscopic and the microscopic motions do "interact", but since the macroscopic wind is on such a large scale compared to the average kinetic energy of individual molecules, any system in which we use the average kinetic energy of the molecules is so small that the wind is effectively constant, and so it could be ignored. Regardless, I'm guessing that the temperature only depends on the relative motion of the air molecules, so the wind just isn't even relevant   Can anybody provide some more educated input?


Insert dynamically first nam and last name in google document

Is there a way to insert user elements (like name) dynamically in a Google Document For example, I have some GDocs templates and I want to use variables in the footer. This variables insert the name of the user how use the GDocs template.


I got a new Dell xps15 with Windows 10 and I am trying to install Ubuntu 16 on dual boot. I am following this guide:  This is what I did:  Download Ubuntu iso and create the usb pen boot drive Shrink the main C: drive, now I have 229 Gb not allocated Restart and boot from usb.  The problem is that when I arrive to the "Installation type" window, there is not the option "Install along side window" but only this: /dev/sda (see picture below).  If I click "install" an error occurs: what can I do?


Is there any way to overlay some lines and dimensions on the document so that one can see where the margins end and more easily examine the overall layout and ratios of elements on the page?  See for example, some of the illustrations of frameworks in this article on the  and this one on  (which displays dimensions).


I am new to Game Development, All I have developed is some 2d Games, using Game Maker by . There game development is much more easy, just as simple as Drag and Drop. But, Now I wish to evolve in Game Development, and wanna try some hands with the common programming languages like, Java, C++ or C. In order to achieve this, I came around the first topic, Game Engine. So, What is Game Engine.? That is a broad question, with various answers. I came out with some conclusion after reading various links,  Wikipedia: A game engine is a system designed for the creation and development of video games. The core functionality typically provided by a game engine includes a rendering engine for 2D or 3D graphics, a physics engine or collision detection (and collision response), sound, scripting, animation, artificial intelligence, networking, streaming, memory management, threading, localization support, and a scene graph.  It exists to abstract the (sometime platform-dependent) details of doing common game-related tasks, like rendering, physics, and input, so that developers (artists, designers, scripters and, yes, even other programmers) can focus on the details that make their games unique. Engines offer reusable components that can be manipulated to bring a game to life. Loading, displaying, and animating models, collision detection between objects, physics, input, graphical user interfaces, and even portions of a game's artificial intelligence can all be components that make up the engine.  Now what I understand is, Game Engine takes care of all the common work, like physics, loading etc... As far my question is concerned, what is a Game Engine (Programmatically)? Is it a Library? With pre-defined functions and classes, which can be inherited? Or what so ever, what is it?


sometimes I don't want to be forced to interact with the topmost window. How can I get around it, without closing it?

We've all seen this when we opened a setting or preference window from a context menu in a program we're using-- the window flashes/flickers and forces you to close it if you want to get at information 'below' it in the z-order window stack.  What is this 'feature' called?  Is there a way to prevent Windows from forcing interaction?


Why some scripts use export for system variables?

I see many online tutorials for ubuntu, and some of them are using export= in the beginning of the script for system variables.  for example:  export JAVA_HOME=/usr/local/java/jdk1.8.0_05 export CATALINA_HOME=/ubuntuland/utils/apache-tomcat-8.0.8   See   I am trying to understand the logic - as it makes sense to me that they will use system variables and not define their owns.  EDIT  when I write:  echo $JAVA_HOME in the shell I see the correct content, in any shell, at any time of the server (even after reboot)


What is the probability that I will get the same permutation when shuffling a deck of 52 cards?

I am doing a research paper about this topic. It has really puzzled me and although I seem to have found a way to calculate it, my answers are rather weird.  I assumed that since 1300 AD a total of approximately 1.546×10^20 times a set of cards have been shuffled (700 years x every second since then).  The probability that such permutation has never been seen before is then  (1-  1/52!)^(1.546×10^20 ) and that it did happen is the answer - 1.  However, I always got the answer being equal to 1.   What am I missing? Any more tips and tricks concerning this topic, PLEASE do. I need to cover 12 pages.  Also: how long would it take until the chances increase of us seeing a permutation ever again?


Create an alias to a desidred directory to use within terminal

I constantly need to type   cd /home/geo/Geant4/geant4.10.00.p02-install/lib/Geant4-10.0.2   How do i create an alias to that directory so I could just type   cd $geant (or any other word i decide to create as the alias name)   it would also help me whenever i need to use cmake because i could use $geant aswell in the middle of an cmake option  Thanks


The simple modules of upper triangular matrix algebras.

Let k be a field. $A= \begin{pmatrix} k& k& k\\ 0&k&k\\ 0&0&k \end{pmatrix}$ is the upper triangular matrix algebra. Then the projective module $P(2)=Ae_2=\begin{pmatrix} k\\k\\0\end{pmatrix}$ has a submodule $P(1)= \begin{pmatrix} k\\0\\0\end{pmatrix}$. Also we know that the cokernel of the inclusion map $i: P(1) \rightarrow P(2)$ is $S(2)$(the simple module correspond to $e_2$), I thought $S(2)$ is of the form $\begin{pmatrix} 0\\k\\0\end{pmatrix}$, but find this is not an $A$-module, so what is $S(2)$, in other words, what are the simple modules of $A$ written as $3 \times 1$ matrix?


Why does "know" rhyme with "go", but "now" rhymes with "cow"?

I am curious about why we pronounce "know" as though it rhymes with "go", but "now" is pronounced as though it rhymes with "cow".  My first thought was that somehow a "k" before an "n" modified the vowel, but "knight" and "night" rhyme.  Are the origins of these two words completely different causing the difference in pronunciation?


Am trying to traceroute to google.com but unfortunately this is the output I am getting -    I know that these * * *s mean that the packets are not reaching back, perhaps due to firewalls, but no matter which website I am trying to traceroute, I am getting the same output, even our internal website. Any suggestions?


Removing text between two specific strings

I have a file as below:  mime PI Name: ISHO SUCCESS RATE RT, Value: 95.663826 scr  PI Name: RRC Access Failures due to UU, Value: 0.13394141 prog PI Name: RRC Access Failures due to UU, Value: 0.16077702 sch PI Name: RRC Access Failures due to UU, Value: 0.11781933   I want to remove text PI till Value:. I tried   sed '/<PI>/,/<\/Value:>/d'    Any help?


Ubuntu 18.04 screen saver / lock - how to turn it off?

In Ubuntu 18.04 anytime I walk away from the computer this screen appears after 5 minutes, no matter what settings I put in Privacy > Screen Lock:    First of all I want to ask you guys: what is this screen technically called? I tried to search for "screen lock" or "screen saver" in Ubuntu 18.04 but I got results about something else. I think technically speaking this is NOT screen lock since you are not required to use your password.   However, in Ubuntu 16 the screen would just go black and moving the mouse would be enough to use the computer again.   What's super annoying in Ubuntu 18.04 is that here you have to drag that arrow (as you can see on the screenshot) up in order to be able to use the computer again... Where do I disable that?


How to download Bootcamp drivers without Bootcamp assistant?

I'm setting up my MacBook Air for a Windows-only boot setup. This was easy enough. It already had rEFIt on it, I just connected a Windows 7 boot thumb drive, and away I went.  However, it seems Apple does not let you download Bootcamp drivers outside of their assistant tool. Reinstalling OS X just for the drivers is ridiculous.  This laptop no longer has OS X on it at all. How do I get the required drivers? I cannot find them anywhere on Apple's support pages.  Every other manufacturer has their drivers available for download.   How do I download the Windows drivers for my 2010 MacBook Air without the BootCamp Assistant?


Bash: multiple actions on error response

I have the following command:  /path/to/script.sh && echo "done."; exit 0 || echo "error."; exit 1   What I want is to echo "done" and exit with 0 if script succeeds and echo "error" and exit with 1 if it doesn't, but it is not working this way, it misses priorities.   How to handle this?  === edit. ===  using {} also not works as needed. commands like ./true.sh && { echo done.; ./error.sh; } || { echo err.; echo err1; } works wrong, as it outpust done and all errors after it. ps: true returns 0, error returns 1.


Server monitoring for medium scale UNIX network

I'm looking for suggestions for a good monitoring tools, or tools, to handle a mixed Linux (RedHat 4-5) and HPUX environment.  Currently we are using  which is working reasonably well but it is becoming harder to keep track of what alerts are sent out for what servers.   Features I'd like to see:   Easy configuration of servers.  The ability to monitor CPU, network, memory, and specific processes   I've looked into Nagios but from what I have seen it won't be easy to set up the configuration for all of our servers ~200 and that without installing a plugin into each agent I won't be able to monitor processes.


I recently implemented a class like:  class TestClass : IDisposable {     RegistryKey m_key;     public TestClass()     {         m_key = Registry.CurrentUser.OpenSubKey("Software", false);     }      public void Dispose()     {         // m_key.Dispose();         IDisposable disp = m_key;         disp.Dispose();     } }   If I uncomment the direct call to Dispose, I get error CS0117 ("'Microsoft.Win32.RegistryKey' does not contain a definition for 'Dispose'").  Some Googling led me to , where I learned what was going on, so I now understand the mechanics of it.  The  documentation suggests that the author would prefer that I call Close() instead of Dispose(), but doesn't explain why.  What is the purpose of this pattern (which I think I've seen it in the IO classes as well)?  In light of the fact that this was an intentional decision by the class author, how bad is the code above (the call to Dispose through the IDisposable interface)?  It can't be too bad - after all, it's what would happen in a using statement, right?  [edits: 1) changed title from "non-public" to "explicit" 2) removed the explicit implementation from my code, accidentally left in from experimentation]


Maybe this is too general for here, but I am having a lot of difficulty studying math. Just got out of the military and I guess I am not use to this yet but when I run into a problem I have trouble with and I just can't get it I get extremely frustrated, I will try and look at the solution but it usually doesn't help and just makes me even angrier than I was before.  Obviously I just can't stop working on the math otherwise it would never get done, and I also can't get stop getting mad, otherwise I would have already. What do I do? I just can't seem to ever remember anything from math even though I study all the time.


Let $p$ be prime and let $\zeta_p$ be a primitive $p$th root of unity. Consider the quadratic subfield of $\mathbb{Q}(\zeta_p)$. For instance, for $p=5$ we get the quadratic subfield to be $\mathbb{Q}(\sqrt5)$ obtained by the relation between the golden ratio and $\cos(2\pi/5)$ (the minimal polynomial of the golden ratio $\phi$ is $x^2-x-1$ and so the extension is quadratic).   Also $\cos(\pi/5)=\phi/2\implies \cos(2\pi/5)=\phi^2/2-1$ by double angle identity.      Is it true that in general the quadratic extension is $\mathbb{Q}(\sqrt{\pm p})$ where $\pm$ depends on whether $p$ is $1$ or $-1$ $\pmod 4$?    Please prove or disprove.


I have a subgroup $G$ of $\mathbf{GL}_n (\mathbb{R})$, the set of $n \times n$ invertible matrices. I want to prove that $f: G \to G$ sending $A \to A^{-1}$ is continuous. The metric I want to use the one which regards an $n \times n$ matrix as an element of $\mathbb{R}^{n^2}$ and then uses the standard, Euclidean metric. I tried to do this directly from $\epsilon$-$\delta$, but I don't know of a way to manipulate the inequality $|B^{-1} - A^{-1}|$ using the assumption $|B-A| < \delta$. I probably need to add and subtract something, but I can't think of anything clever. Does anyone have any tips?


Sentence that needs correction:     "Angela was curious about the unopened letter on the table and wondered for whom  it was meant."   I think the whom should be replaced with who because the sentence can be rewritten as      Angela was curious about the unopened letter on the table and wondered "who was it meant for?"   Correct answer: the sentence contains no error.   why am I wrong?


How can I make sense of the way (screen) colors are generated?

OK here is some common knowledge I have from the net: a computer screen has 3 constituent colors of red, green, blue. To make all spectra of stuffs it just combines them.  We also know that red is about 650nm, blue 470 and violet 425. In real life, mixing yellow and blue creates green, a color in-between.  So how the hell can computers combine red & blue to give violet? In my understanding, (650+470)/2=425?? Using that absurd principle, then surely it's possible to create IR & UV light by mixing RGB on a computer screen?  Bonus question: to make things more perplexing, let's add biology in for a bit. Our eyes have 3 types of cones with maximum responsivity near computer's RGB values. When a natural light strikes our eyes - say from a pure 425nm violet flower - according to a  I can say that the S-cones are highly activated while M & L are barely on. See, that's very different from the combination of red & blue excitation that screens give us. So... should we conclude that computer colors are "fake"?


In C++/CLI, how do I declare and call a function with an 'out' parameter?

I have a function which parses one string into two strings.  In C# I would declare it like this:  void ParseQuery(string toParse, out string search, out string sort) {     ... }   and I'd call it like this:  string searchOutput, sortOutput; ParseQuery(userInput, out searchOutput, out sortOutput);   The current project has to be done in C++/CLI.  I've tried  using System::Runtime::InteropServices;  ...  void ParseQuery(String ^ toParse, [Out] String^ search, [Out] String^ sort) {     ... }   but if I call it like this:  String ^ searchOutput, ^ sortOutput; ParseQuery(userInput, [Out] searchOutput, [Out] sortOutput);   I get a compiler error, and if I call it like this:  String ^ searchOutput, ^ sortOutput; ParseQuery(userInput, searchOutput, sortOutput);   then I get an error at runtime.  How should I declare and call my function?


How do I prove that $6 \mid n^3- n$ for all $n ≥ 1$?

How do I prove that $6 \mid n^3 - n$ for all $n \ge 1$?  I'm having difficulty understanding this problem. All help is greatly appreciated.


How can I prevent accidentally making bash quit, due to holding ctrl-d too long?

I know how to disable ctrl-D by set -o ignoreeof, which applies when logged in over ssh as well.. But I only want to disable it when it is about to quit a local shell. How can I then?  In interactive bash shell, ctrl-d is used to delete characters in front, and to indicate the end of stdin input, and also makes bash quit.  Sometimes when I delete characters in front by ctrl-d, I hold the keys too long, and accidentally make bash quit. How can I prevent accidentally making bash quit?


Move off-screen window back to screen on Windows 10

I just opened Wunderlist (the one from the Windows store) and the top half is off-screen. Right-clicking the icon in the task bar and selecting move no longer works, since it's not there. Accessing the move command in the menu bar through the keyboard  doesn't work.   How do I get it back on screen? (and why is this still an issue, so many years later?)