if input equals string, do something... python 2.7
input() error - NameError: name '...' is not defined
I typically have two needs:  Scenario A. Change a single PDF page.  In this case I have a PDF but not the original source file used to create the PDF. I don't want to try to recreate the document from scratch. I'd like to open the PDF and change a few things. A good example of this scenario: I was responsible for planning a big event at a campground site, I had a PDF of the site. I wanted to start with that document, highlight some parts, add some labels, remove some parts that weren't relevant.   or   Scenario B. Combine PDFs or extract page(s) from a PDF  This scenario usually arises because I want a single PDF deliverable that is made up of parts that are best created in different programs. In this case I have the source files for all the documents but they don't play well enough together to easily create a single PDF deliverable. For part of it, I may want to use Libre Office Writer. For another page I may want to use Gimp. Still another page I may use Libre Office Calc. I could use Writer as the master document and embed images or the Calc object into that, but for ultimate control, you can't beat separate PDF documents that are then combined.  What are the best tools / processes for editing PDFs in Ubuntu? How to set a proxy for terminal? I am looking to set a proxy for terminal. What I need is I want to send all terminal communications to the internet through a proxy, say tor.   I tried to set a system wide proxy set up. But Terminal doesn't obey the system wide proxy configuration.  Is there any other way to do this? How to save an alias of an eval $(other_comand) command I've been using docker for a while and there's a command I write each time I boot up my docker:  eval $(docker-machine env)   I know eval shouldn't be used unless necessary, but it's mentioned by the following:  docker-machine env outputs environment variables like this:  docker-machine env export DOCKER_TLS_VERIFY="1" export DOCKER_HOST="tcp://&lt;some_ip&gt;:&lt;some_port&gt;" export DOCKER_CERT_PATH="/home/gableroux/.docker/machine/machines/default" export DOCKER_MACHINE_NAME="default" # Run this command to configure your shell:  # eval $(docker-machine env)   eval grabs these and load them in my current session.  Now what if I'd like to have an alias like this:  alias dockereval="eval $(docker-machine env)"   Syntax is good, but the problem is when a dotfile (let's say .zshrc as an example), well the content of the $() is evaluated when registering the alias when you source that file.  which dockereval   Results in  dockerenv: aliased to eval   I tried a few things like:  alias dockereval="docker-machine env | eval" alias dockereval="docker-machine env | /bin/bash" alias dockereval="eval `docker-machine env`"   but none did work. 2nd one is probably because it's running in a different session, 3rd does the same as $() I guess  Is there an other way to load these environment variables with an alias? Infinite partition of $\mathbb N$ by infinite subsets Whitespace Problems With Script and Variables I keep seeing custom flags in the queue from question askers who are incredibly irritated because there is a big, prominent box at the top of their question. It's just a list of other questions which may have the answer they desire, and is only even displayed to them because the question is not closed yet.  This question may already have an answer here: [list]  But to an ordinary user, it is not at all clear that the box is only shown to them, or that it will go away on its own if their question never actually gets closed. Could the text for this notice be altered to make it more clear that:  They are just suggestions for the person to view. Potentially if they agree with one, they should vote to close their own question as a duplicate of it.  Their question is not closed yet. If they disagree with the duplicates suggested, they should clarify their question and explain why it's not a duplicate.   I was thinking of an altered wording such as:  You might be able to find an answer to your question here: [list] If those answers do not fully address your question, please [edit your question] to clarify your exact problem.  I went with a more direct wording for the bolded title. Since the notice is only displayed to the asker, it makes more sense to talk directly to them in the message rather than making it feel like it's supposed to be addressing the entire audience of the site. Emphasize that only that person is seeing it by talking to them. It would also be helpful to append a &quot;More info&quot; link at the end of the message that links them to some further documentation about duplicates, and explains how the notice works - particularly that it will go away eventually or change to a proper duplicate notice if the question does get closed. Pass by Reference / Value in C++ I would like to clarify the differences between by value and by reference.  I drew a picture     So, for passing by value,  a copy of an identical object is created with a different reference, and the local variable is assigned the new reference, so to point to the new copy  How to understand the words: " If the function modifies that value, the modifications appear also within the scope of the calling function for both passing by value and by reference "  Thanks! Getting absolute path of a file I have installed Ubuntu 15.04 on my laptop with RTL8723BE Wi-fi card. But it is always disconnecting from network. I have tried echo "options rtl8723be fwlps=N ips=N" | sudo tee /etc/modprobe.d/rtl8723be.conf but that didn't helped. What can I do to prevent the wifi from disconnecting? If I upgrade to kernel 4.X, will it help?  ~$ lspci -knn | grep Net -A2  09:00.0 Network controller [0280]: Realtek Semiconductor Co., Ltd. RTL8723BE PCIe Wireless Network Adapter [10ec:b723]     Subsystem: Hewlett-Packard Company Device [103c:2231]     Kernel driver in use: rtl8723be   ~$ rfkill list 0: hci0: Bluetooth     Soft blocked: yes     Hard blocked: no 1: phy0: Wireless LAN     Soft blocked: no     Hard blocked: no   ~$ ifconfig &amp;&amp; iwconfig &amp;&amp; route -n &amp;&amp; ping -c 1 google.com eth0      Link encap:Ethernet  HWaddr 38:63:bb:cd:4a:7e             UP BROADCAST MULTICAST  MTU:1500  Metric:1           RX packets:3 errors:0 dropped:0 overruns:0 frame:0           TX packets:53 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:1000            RX bytes:752 (752.0 B)  TX bytes:8445 (8.4 KB)  lo        Link encap:Local Loopback             inet addr:127.0.0.1  Mask:255.0.0.0           inet6 addr: ::1/128 Scope:Host           UP LOOPBACK RUNNING  MTU:65536  Metric:1           RX packets:3870 errors:0 dropped:0 overruns:0 frame:0           TX packets:3870 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:0            RX bytes:314613 (314.6 KB)  TX bytes:314613 (314.6 KB)  wlan0     Link encap:Ethernet  HWaddr c0:38:96:6d:c4:83             inet addr:192.168.1.205  Bcast:192.168.1.255  Mask:255.255.255.0           inet6 addr: fe80::c238:96ff:fe6d:c483/64 Scope:Link           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1           RX packets:15240 errors:0 dropped:0 overruns:0 frame:0           TX packets:14627 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:1000            RX bytes:14410285 (14.4 MB)  TX bytes:2192744 (2.1 MB)  eth0      no wireless extensions.  wlan0     IEEE 802.11bgn  ESSID:"DIR-615"             Mode:Managed  Frequency:2.437 GHz  Access Point: 00:90:4C:08:00:0D              Bit Rate=150 Mb/s   Tx-Power=20 dBm              Retry short limit:7   RTS thr=2347 B   Fragment thr:off           Power Management:off           Link Quality=70/70  Signal level=-22 dBm             Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0           Tx excessive retries:0  Invalid misc:186   Missed beacon:0  lo        no wireless extensions.  Kernel IP routing table Destination     Gateway         Genmask         Flags Metric Ref    Use Iface 0.0.0.0         192.168.1.1     0.0.0.0         UG    400    0        0 wlan0 169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 wlan0 192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 wlan0 PING google.com.Dlink (172.26.136.19) 56(84) bytes of data. 64 bytes from 19.136.26.172.in-addr.arpa (172.26.136.19): icmp_seq=1 ttl=249 time=102 ms  --- google.com.Dlink ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 102.547/102.547/102.547/0.000 ms Why is it that   $$\lim_{n \rightarrow +\infty} \left( 1 + \frac{\lambda}{n}+ o \left( \frac{1}{n} \right) \right)^n = e^{\lambda}$$  I once remembered the justification for "ignoring" the $o(1/n)$ but can't recall it again. Show that $a^{61} \equiv a\pmod{1001}$ for every $a \in \mathbb{N}$ How can I repair grub? (How to get Ubuntu back after installing Windows?) Running a caching DNS server on my LAN How to show full date and time in Nautilus/Files 3.6+ list view? Prove $S_4$ has only 1 subgroup of order 12 The subgroup in $S_4$ that I know has order 12 is the subgroup of all even permutations, otherwise known as the alternating group $A_4$. However, I know this from a fact and not because I am able to show a subgroup of order 12 exists in $S_4$ in the first place. If I had not been told there existed a subgroup of order 12 in $S_4$, I would not have known there was one. So I guess this is actually a two-parter for me: 1) How do I go about showing that a subgroup of order 12 does indeed exist in $S_4$? I know by Lagrange that if there exists a subgroup, then the order of that subgroup must divide the order of the group. However, this doesn't say anything about the existence of the subgroup. And Sylow only verifies subgroups of a prime to some power order, which 12 is not. I also know that there might be a cyclic subgroup of order 12, but without manually multiplying every possible permutation in $S_4$, I don't know any other way to check the existence of this or if this subgroup is isomorphic to $A_4$ because I don't know how to write these permutations as functions in order to check if there is a homomorphism (I know that a permutation is bijective by definition). And 2) How do I show that this group of order 12 is the only group of order 12 in $S_4$? How to switch from Resident visa to Tourist visa status in the Schengen area? I have a 1-year residence permit from one Schengen country that is now expiring. Upon its expiration, I would like to get my 90/180 days validity as a tourist to stay, or return here as soon as possible.  I understand that the tourist short-stay scheme is based on the 90/180 days "counter". But what happens if my previous stay was not tourism but residence (as searching year). Wouldn't that mean that I can quickly exit and re-enter the Schengen area to activate my tourist stay?   Also, is there a way to change this purpose of stay without exiting the Schengen area? drush/drush dev-master requires codegyre/robo ~1.0.0-beta1 I'm transitioning a Drupal 6 site to Drupal 8.1 so following the official instructions, I set up a new install in its own directory. Since this is only one site, I followed the instructions to put my database credentials in sites/default/default.settings.php after the declaration of the $databases array.  Running drush --status returns the following.  Drush version          :  8.1-dev                                           Drush temp directory   :  /tmp                                              Drush configuration    :                                                    Drush alias files      :                                                    Drupal root            :  /media/psf/Home/apps/newp                         Drupal Settings File   :  MISSING   Since this Drupal is 8.1-dev that must mean I need to upgrade it. Since this is a global install using Composer, I run composer global update.     Your requirements could not be resolved to an installable set of   packages drush/drush dev-master requires codegyre/robo ~1.0.0-beta1   Checking the drush-ops page on github doesn't show any anomalies like this nor my Google search.   What am I overlooking? In many situations, JavaScript parsers will insert semicolons for you if you leave them out. My question is, do you leave them out?  If you're unfamiliar with the rules, there's a description of semicolon insertion on the . Here's the key point:     If the first through the nth tokens of a JavaScript program form are grammatically valid but the first through the n+1st tokens are not and there is a line break between the nth tokens and the n+1st tokens, then the parser tries to parse the program again after inserting a virtual semicolon token between the nth and the n+1st tokens.   That description may be incomplete, because it doesn't explain @Dreas's example. Anybody have a link to the complete rules, or see why the example gets a semicolon? (I tried it in JScript.NET.)   is related, but only talks about a specific scenario. "Pending" vs "Impending". Are they synonyms? They appear to me to mean almost if not exactly the same thing, but I am not sure. Are there differences in meaning between them? Drop In Reputation - But No Record Of Why?