Let $\mathcal{P}(S)$ denote the power set of $S$. Why is $\mathcal{P}(S) = 2^S$?  I know that the power set of $S = \{x,y,z\}$ is  $$\mathcal{P}(S) = \{\{\}, \{x\}, \{y\}, \{z\}, \{x, y\}, \{x, z\}, \{y, z\}, \{x, y, z\}\},$$  so how does this relate to $\mathcal{P}(S) = 2^S$? I cannot understand why  $$\mathcal{P}(S) = \mathcal{P}(\{x,y,z\}) = 2^{\{x,y,z\}} = \{\{\}, \{x\}, \{y\}, \{z\}, \{x, y\}, \{x, z\}, \{y, z\}, \{x, y, z\}\},$$  I assume it is somehow related tot he fact that the set $\{x,y,z\}$ has 3 elements, and $\mathcal{P}(\{x,y,z\})$ is a set of $2^3 = 8$ sets.

The following is from the Wikipedia page on the :     By identifying a function in $2^S$ with the corresponding preimage of $1$, we see that there is a bijection between $2^S$ and $\mathcal P(S)$, where each function is the characteristic function of the subset in $\mathcal P(S)$ with which it is identified.   I don't understand the start of the sentence,"By identifying a function in $2^S$ with the corresponding preimage of $1$".  I can make out some sense out of the rest.  Please help.


I am trying to make a shader like the blue shader below but can’t get it right. I have tried using a mix shader with two diffuse and a fresnel but it ends up way off from the what I’m trying to achieve.

Is there a way to replicate this pseudo-shiny effect that appears on Sonic from Sonic Generations in cycles?


The process C:\Windows\system32\svchost.exe Computer Name has initiated the restart of computer Computer Name  on behalf of user NT AUTHORITY\SYSTEM for the following reason: Operating System: Recovery (Planned) Reason Code: 0x80020002 Shutdown Type: restart Event ID : 1074   I use this computer to run simulations overnight and automatically restarting ruins all my progress. I am not allowed to disable windows updates, how can I make it so that windows will never reboot on its own?

I have had this happen to me twice now.  I'll be in the middle of working on something that has resulted in me not rebooting my machine for several days.  If Windows 7 is waiting to install updates it'll eventually get to a point where it forces a restart to install the updates.  The problem is that it doesn't notify me or tell me that its going to do this and I've lost work as a result and most recently had a VM become corrupt and unusable.  Is there a way to at least get it to prompt me before doing this?  It used to...


I have a list of shapefiles stored in a group: pump  I want to save all shapefiles as a new shapefile with a new CRS.  For that, I wrote the following script:  import os as os from qgis.core import * import processing   root = QgsProject.instance().layerTreeRoot() prjpath =QgsProject.instance().readPath('')  groups = ['pump'] groupPump = root.findGroup(groups[0]) pathPump = prjpath + '/layers/hydrology/' + groups[0]   crs = QgsCoordinateReferenceSystem(3857, QgsCoordinateReferenceSystem.EpsgCrsId)  def saveGroup(group, crs, savePath):      group = group      for layerId in group.findLayerIds():         layer = QgsMapLayerRegistry.instance().mapLayer(layerId)         layerName = QgsMapLayerRegistry.instance().mapLayer(layerId).name()         path = savePath + '/'+layer.name() + '_' + crs.authid()[-4:] +'_' +'.shp'         print path          QgsVectorFileWriter.writeAsVectorFormat(layer, path, "utf-8",crs, "ESRI Shapefile")         path)  saveGroup(groupPump, crs, pathPump)   No error, nothing happens...What did I do wrong?

I have a lot of shapefiles that I need to save in a different CRS... is it possible to automate this process with a script in QGIS?


I have two single-phase motors. This motors working in a fan. When I disconnect it from the mains and rotate it manually it produces 160V-190V. The problem is when this generator runs manually and totally disconnected from the mains, I connect the two wires to Christmas lights and it lights up.  When I connect it to a 110V-220V appliance, the appliance did not work, the voltage (using a multitester) from the fan drops down and the fan seems to run from the electricity it produces. I learned this from google and it says it's backfeeding. Please help me to stop this backfeeding problem from an AC generator. Electricity is always going back from its source, so I think the backfeeding is because the electrons is going back to the generator is why it is running from the electricity it produce, am I right? (I use this picture to describe the image of the problem in my head.)  This is the motor. I don't know what type it is.

I have two pieces of single-phase fans and they are literally the same, it is ac motor and whenever I rotate it manually it produce voltage about 160-190vac. I just get the idea that it can be an ac generator, but the problem is when I connect it to 110v-220v cellphone charger, the charger is not working, the voltage drops and the generator seems to run from the voltage itself, I search it and the answer is the backfeeding. I also connect the generator to christmas lights and there is no problem maybe because it has resistors, I also conect Led bulb using an adaptor 110v-220v and the led is blinking(it should not be) and everytime it blinks the generator get a shock, it seems to get backfeed. The other problem is I connect these 2 ac fans and I rotate it to be a generator(160v-190v each) but they seem to be run from the voltage themselves. I had this idea to use a full rectifier, inverter or somewhat to make them a working generator with a stable of 220vac even if using. My ideas/plans (in order):  To stop the backfeed of the generator when using. If there is no possible way to do that then using an inverter is the last option. If ac-dc is the best way then i'll connect dc's from positive to negative, making dc volts step up then convert it to 220v ac. AC-DC-AC in short If no. 2 didn't work, then i'll suppose to make an inverter for each generator making them ac-dc-ac and avr for each to stabilize their voltage.  Please help me guys, I need to make it possible. Another thing I recently know, is it possible to put a ground wire to a single-phase generator to stop getting backfeed instead of transfer switch ? The picture is the single phase motor.


I am trying to access a node programmatically and getting errors though using (AFAIK) the recommended way. My code (so far) is really simple. use Drupal\node\Entity\Node;  $nid=1805; $node = Node::load($nid); print_r($node, true);  It keeps failing with this error message.  [09-Nov-2020 08:32:31 UTC] PHP Fatal error:  Uncaught Error: Class 'Drupal\node\Entity\Node' not found in test-node-access.php  The program resides (at least currently) in Drupal root directory. I am acting on user action via AJAX call from a paragraph (as a lame explanation to a little un-orthodox implementation).

How can I bootstrap Drupal 8 from an external script?  This an example script from the .  require_once __DIR__ . '/vendor/autoload.php'; use PhpAmqpLib\Connection\AMQPStreamConnection;  $connection = new AMQPStreamConnection('localhost', 5672, 'guest', 'guest'); $channel = $connection->channel(); $channel->queue_declare('task_queue', false, true, false, false); echo " [*] Waiting for messages. To exit press CTRL+C\n"; $callback = function ($msg) {   echo ' [x] Received ', $msg->body, "\n";   sleep(substr_count($msg->body, '.'));   echo " [x] Done\n";   $msg->delivery_info['channel']->basic_ack($msg->delivery_info['delivery_tag']); };  $channel->basic_qos(null, 1, null); $channel->basic_consume('task_queue', '', false, false, false, false, $callback);  while (count($channel->callbacks)) {   $channel->wait(); }  $channel->close(); $connection->close();   Within a worker script like this, I need to be able to create nodes.  How can I bootstrap Drupal 8 in this script?  ? and  bootstraps passing a fake request to the kernel, which to me looks like a work-around.  In Drupal 7 you could do something like this, apparently.  // Bootstrap Drupal. include_once './includes/bootstrap.inc'; drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);


I was wondering if anyone knew a way I would be able to find and replace all prefixes for the src of certain image files, e.g. on button click -> find all img src="Images/g/....." and replace with img src="Images/r/....."

   As you can see from the above extract, my files are saved within a folder named 'g', I need a function that will scan my entire HTML files and change all those src's to point to the same file but within "Images/jpg/r/....."  P.S. Simplicity is the key.

How can you change the href for a hyperlink using jQuery?


Position is relative, as it depends on the reference frame.  We usually visualize the sun at the center of the solar system.  BUT, we can also visualize the Earth at the center of the solar system, with the sun orbiting around it and the planets orbiting around the sun.  Therefore, shouldn't we be theoretically be able to see a star orbiting around a planet? (given that the planet happens to be stationary relative to the Earth)?

I wonder if there ever could be a star (really small) which may orbit around a planet (really big)?


I formatted the partition containing Ubuntu 13.04 running parallel with Windows 8, I then merged the partition disk into another disk and that is where the problem starts.  When I restart the computer and I get grub rescue.  I searched for solution on net they advised me to repair by booting with Windows CD, this resulted in another problem and now it's saying "operating system wasn't found " and I can not boot with Windows CD.  My OS is windows 8.  Please help me with a solution.

I installed Ubuntu alongside Windows 8, however have decided to unisntall Ubuntu.  First I booted into Parted Magic and, using GParted deleted all the ext4 and swap partitions.  This leaves me with the same partitions I had before I installed Ubuntu:  /dev/sda1 ntfs WINRE_DRV /dev/sda2 fat32 SYSTEM_DRV (my UEFI partition) /dev/sda3 fat32 LRS_ESP /dev/sda4 unknown Microsoft Reserved Partition /dev/sda5 ntfs Windows8_OS /dev/sda6 ntfs LENOVO /dev/sda7 ntfs PBR_DRV   I expected deleting the partitions would be enough to remove Ubuntu and allow me to boot back into Windows 8, however whenever I boot I get the following error:  error: no such partition.   which is followed by GRUB rescue:  grub rescue>   In my UEFI partition, there are two directories BOOT and EFI. In BOOT is a single file - boot.sdi. In the EFI directory are another two directories, BOOT and Microsoft. Inside BOOT are two files, bkpbootx64.efi and bootx64.efi. The Microsoft directory has a directory in it named Boot. Inside it are the normal Microsoft EFI files (as far as I can tell).  Thinking there were still GRUB files left, I ran find . -iname "*grb*" and find . -iname "*grub*" in the UEFI partition, however only found one empty file, bootx64.efi.grb (which I deleted).  How is GRUB still installed, and how can I uninstall it?  I'm pretty new to UEFI and so things may need explained in detail. The computer is a Lenovo IdeaPad Z580.  edit: I forgot to mention, I deleted the ubuntu folder in the UEFI partition.  edit 2: I managed to get back into Windows through a "System Recovery" option in the laptop's BIOS settings. This may or may not have solved the issue.  edit 3: okay, I can boot almost normally now. When I boot, I see No partition active for a couple of seconds then Windows boots. How can I remove that?


is on how to use an OSX program and would seem ideal for apple.se.  However, the only migration options are meta, superuser, tex, dba and sharepoint, none of which are at all suitable.

Wouldn't it be a good idea to be able to vote for questions to be moved to any Stack Exchange site? For example, I just voted  as off topic, but that was all I could do. I wish I could've voted it be moved to .  It's OK to have the predefined list of sites that is now when voting to move, but it would be nice to have a more link, where we could pick any Stack Exchange site.  Here's a quick mockup of how I see this implemented:    When the more link is clicked, a list of all the Stack Exchange sites should appear.


Good day.  We have an 8 core server for mariadb 10.1 on Centos 7. IT's a production database as well as a replication master. I am not sure if it's using more than one of the cores.    We also have a one-core virtual server acting as a slave.   Searching on this tells me that most queries are about using more than one core per query, which are repeatedly answered with NO, that's not possible.  I get that.   I just want to know if multiple queries can be apportioned out to multiple cores, whether configuration settings are required to do this, and how to tell if it's working.   I also need to know whether slave throughput could be improved by adding cores.    Thanks,  Ed Greenberg

I've been presented with some dedicated MySQL servers that never use more than a single core. I'm more developer than DBA for MySQL so need some help  Setup  The servers are quite hefty with an OLAP/DataWarehouse (DW) type load:   Primary: 96GB RAM, 8 cores + single RAID 10 array Test: 32GB RAM with 4 cores The biggest DB is 540 GB, the total is around 1.1TB and mostly InnoDB tables Solaris 10 Intel-64 MySQL 5.5.x   Note: The biggest DB is the replicated one from the OLTP DR server and the DW is loaded from this. It isn't a full DW: just last 6 months to 6 weeks so it is smaller than the OLTP DB.  Observations on a test server   3 separate connections each has a concurrent (and different) ALTER TABLE...DROP KEY...ADD INDEX the 3 tables have a 2.5, 3.8 and 4.5 million rows CPU usage goes up to 25% (one core is maxed out) and no higher the 3 ALTERs take 12-25 minutes (a single on the smallest takes 4.5)   Questions   What setting or patch is required to allow more than one core to be used? That is, why doesn't MySQL use all cores available? (like other RDBMS) Is it a consequence of replication?   Other notes   I understand the difference between an RDBMS "thread" and an OS "thread" I'm not asking about any form of parallelism Some of the system variables for InnoDB and threads are sub-optimal(looking for a quick win) Short term, I'm unable to change the disk layout OS can be tweaked if needed A single ALTER TABLE on the smallest table takes 4.5 minutes (shocking IMO)   Edit 1   innodb_thread_concurrency is set to 8 on both. Yes, it's wrong but won't make MySQL use multiple cores innodb_buffer_pool_size is 80GB on primary, 10GB on a test (another instance is shut down). This is OK for now. innodb_file_per_table = ON   Edit 2   innodb_flush_log_at_trx_commit = 2 innodb_use_sys_malloc = ON innodb_flush_method should be O_DIRECT (but SHOW VARIABLES doesn't show this) innodb_doublewrite = OFF File system = ZFS (And my sysadmin found this: )   To test   innodb_flush_method isn't showing as O_DIRECT when it should be will follow RolandoMySQLDBA's settings   Let me know if I've missed anything important  Cheers  Update  Changed innodb_flush_method + 3 x thread settings in RolandoMySQLDBA's answer Result: > 1 core used for the tests = positive result


In our setup we have a network of 6 to 8 computer with no one of them having password and it logs straight on with operator user id. I want control these systems remotely but due to no password it does not allow me to do so.  I can get into one computer by team viewer but try to do RDP but it is not working.  Any alternate solution as we cannot assign password to our system.   Thanks in advance.

I have an HTPC with a user that has no password and autologin.  I want to be able to connect to it via Remote Desktop without a password, so I can login with the original user. (I don't want to add another user just for the mstsc)  Is there a way of doing that?  The OS is Windows 7, 32bit.


I have a HP 530 laptop with Ubuntu 12.04 installed. With Windows Vista, I could use its wireless hardware, but now it doesn't work. I have tried using the command: sudo rfkill unblock all  Does anyone know what I should do?  Edit: I have a Broadcom wireless network card.

I'm having serious problems installing the Broadcom drivers for Ubuntu. It worked perfectly on my previous version, but now, it is impossible.   What are the steps to install Broadcom wireless drivers for a BCM43xx card?  I'm a user with no advance knowledge in Linux, so I would need clear explanations on how to make, compile, etc.    lspci -vnn | grep Network showed:   Broadcom Corporation BCM4322 802.11a/b/g/n Wireless LAN Controller [14e4:432b]      iwconfig showed:  lo        no wireless extensions. eth0      no wireless extensions.   NOTE: Answer below is updated every time new information is added and confirmed working.


I have a C# application required to calculate token same as JavaScript below:  key = CryptoJS.enc.Hex.parse("436574536f667445454d537973576562"); iv = CryptoJS.enc.Hex.parse("1934577290ABCDEF1264147890ACAE45"); text ={userID: 0,tokenTime:'2017-05-06 19:20:22'}; text=JSON.stringify(text); token=CryptoJS.AES.encrypt(text,key,{iv:iv}).toString();   token=9L9qY0fmi3Riysac3YbIciIIJFisPZZC3uBxjriVH1OyARL2ZQ/HVO941/Tod2PT  (JavaScript can not be change)  But,I am confuse by what is include in string "token"?  only ciphertext or whole result of encryption in string?  And,how to convert format of key and iv for CryptoJS to a format which accepted by C#(RijndaelManaged or AesCryptoServiceProvider)?  Most of the question and answer using "CryptoJS.enc.utf8.parse",so I try to convert key and iv from hex to utf-8 ,but only key can be converted.

How can you convert a byte array to a hexadecimal string, and vice versa?


I had asked this problem earlier but I was too vague in how I asked it so I'm making a new post to be more specific.      Problem: Say we have a series circuit with an ammeter, a cell with internal resistance and known emf, and a 10 ohm resistor. It is noticed that the resistor gets warmer. How would this affect the calculated value of the internal resistance?   Here is the official answer:   Here is my thinking: Since the resistor increases in temperature, it increases in resistance. Let's look at the equation ℰ = IR + Ir, where "ℰ" is emf, "I" is current, "R" is external resistance, and "r" is the internal resistance of the cell. if R increases and current is constant, in order to maintain constant emf, r must decrease. Where's the flaw in my thinking?

Say we had a circuit with a cell (with internal resistance)and an external resistor of $10 \Omega$ as shown:  The $10\Omega$ resistor then increases in temperature, leading to an increase in resistance in this resistor. My thinking was that since $10 \Omega$ resistor now has a value higher than $10\Omega$, more voltage drops across this resistor. Since your emf is constant, less voltage must drop across the internal resistor. Less voltage drop means less resistance. Where is the flaw in my logic?


I want to retain the leading "00" when a value is incremented by one,below val has "00349",when i increment and print it becomes 350,how to print as 00350 retaining the leading "00"  val = 00349 val = val + 1 print val -->prints as 350,i want to print as 00350

What is a Pythonic way to pad a numeric string with zeroes to the left, i.e. so the numeric string has a specific length?


Let $\{a_n\}$ be a bounded sequence of real numbers and $a_{n+1}\geq a_n - 2^{-n}$. Prove that $a_n $ is convergent.  My attempt: Suppose $a_n $ is not convergent then $\limsup a_n \neq \liminf a_n$. Let $\{x_n\}$ and $\{y_n\}$ converges to limsup and liminf. Then for some $x_p=a_{n_p}$ and $y_q=a_{n_q}$ we have $x_p-y_q>\epsilon$. where $n_q>n_p$. Also from given condition $x_p-y_q < \frac{1}{2^{n_p}}$. This is a contradiction for bigger $n_p$. Is this correct? Please help!

Here's the original question:     Let $(a_n)$ be bounded. Assume that $a_{n+1} \ge a_{n} - 2^{-n}$. Show   that $(a_n)$ is convergent.   Okay, I know that if I can show that if the sequence is monotone, I can conclude that it is convergent. But I am not sure how to show that it is monotone.  I know that  $$a_n \le a_{n+1} + \frac{1}{2^n} < a_{n+1} + \frac{1}{n}$$  It looks to me as if it is monotonically increasing but I'm quite not sure how to prove my claim. Any hints would be appreciated.


How to get rid of the suggestion box that appears if you double click on the input field. autocomplete="off" does not work.

How do you disable autocomplete in the major browsers for a specific input (or form field)?


For what values of $x_1, x_2, x_3, x_4$ is the matrix $A=\begin{pmatrix}1 & 1 & 1 &1 \\ x_1 & x_2 & x_3 &x_4 \\  x_1^2& x_2^2 & x_3^2 & x_4^2\\  x_1^3& x_2^3 & x_3^3 &x_4^3 \end{pmatrix}$  invertible?   Okay, I know what those are Vandermonde matrix, but how do I find for what values is matrix invertible?  Do I need to find $\det A^{-1}$ and than definition area or what? Help!

I'd like to show the case $n=4$ for the Vandermonde-determinant. It should look like this:  $V_4 := \det \begin{pmatrix} 1 & 1 & 1 & 1 \\ x_1 & x_2 & x_3 & x_4 \\ x_1^2 & x_2^2 & x_3^2 & x_4^2 \\ x_1^3 & x_2^3 & x_3^3 & x_4^3 \end{pmatrix} = (x_4 - x_3)(x_4 - x_2)(x_4 - x_1)(x_3 - x_2)(x_3 - x_2)(x_2 - x_1)$.  I tried calculating the $\det(\dots)$ via the first row. However, it ends up in a very large calculation.. I'm sure there's a better way to show especially this case with $n=4$.  Thank you for any help ;)


The process with pid=0 exits after system init?  According to this    It is called the idle process, but why is not it listed in ps aux?

The idle task (a.k.a. swapper task) is chosen to run when no more runnable tasks in the run queue at the point of task scheduling. But what is the usage for this so special task? Another question is why i can't find this thread/process in the "ps aux" output (PID=0) from the userland?


I have an andriod device.Can I access files of another android device ? I am connected to his wi-fi network. if yes how??

I'd like to be able to easily transfer large files wirelessly, fast, between Android devices - preferably without requiring root.  As a secondary objetive, it wouldn't hurt if the same solution could be used, to transfer files between the Android devices and a Windows PC.   Specifically, I'm trying to exchange files between my Nexus 7 (Android 4.2.2) and Samsung Galaxy S2 (Android 4.0.4).   Bluetooth is simply too slow, so that's out of the question Transfer via the Internet is also not an option, hence so is cloud-based solutions Only Nexus 7 supports NFC, so that's out too  looked promising and very simple, but does not work on "Devices that don't have WiFi Tethering setting, such as the Nexus 7"   Wi-Fi direct ( and up) seems to be a decent lowest common denominator between my two devices, however...  Galaxys S2's native Send via Wi-Fi Direct sees the Nexus, but seems to get stuck in the "Connecting..." most times. When there finally seems to be breakthrough, I get "Waiting..." and a spinning circle. Even if it worked, it would only allow me to send from the Galaxy S2 to the Nexus 7, as a similar option os not present on the Nexus 7.  J4velin's  is no longer available in the Play Store, with the following explanation:     WiFi Direct drivers are broken on many devices, which led to users leaving negative reviews for this app. As I don't see any sense in keeping a free app published when only getting 1-star-ratings (for an issue which only your device manufacturer can fix), the app is no longer available at the Play Store.   Nick Adams'  seems flaky at best. Invations from Nexus 7 to Galaxy S2 are never received. Invitations from Galaxy S2 are mostly received, but even when accepting promptly, the peers doesn't always show as connected. When they finally do, usually after quite a long wait, I can select a file to send but it's never transferred -  "Transfer failed" it says almost immediately in the notification bar.  budius inc's  is working slightly better, but still very unreliable. I actually managed to (occasionally) send files both ways, but never when attempting connection from the Nexus 7. To send from the Nexus 7 to the Galaxy S2, I had to go through this akward manoeuvre:   Share the file on the Nexus 7 via the WiFi Shoot intent Start the Receive WiFi Shoot app on the Galaxy S2 Invite the Nexus 7 from the Galaxy S2 (never the other way around!) Accept the invitation on the Nexus 7 Press the Shoot button on the Galaxy S2   Take the whole switching back and forth between devices, and garnish with random delays or failures in any step of the process...  Is there really no easy, reliable, fast way to transfer files directly between different Android devices?  Generally, my experience with Wi-Fi Direct is all but positive...   A device often won't even see a device lying next to it Sometimes, it will see the other device, only to have it disappear from the list, before I have the chance to connect When I do have a chance, invations are not realiably received (from Galaxy S2 to Nexus 7 mostly reliable, but never worked the other way around) When invitations are received (and accepted), a partnership rarely manages to be setup ("invited" or "connecting") And even when that happens, some apps can't seem to transfer files through it...   *Sigh*  Maybe J4velin's explanation pretty much sums up the sad state of Wi-Fi Direct on Android, which otherwise seemed as the best solution to my quest?


When mentioning the title of a video game, would it have to have quotation marks before and after it? Around published works, yes, but would video games also count as published works?  Would it be written like this:     I stayed home and played "Halo."   Or would it be written like this:     I stayed home and played Halo.

The titles of freestanding works (books, movies, plays, albums, etc.) are italicized; smaller parts within these works (chapters in a book, articles in a magazine, songs within an album) are not (they are put in quotes, instead).  How are software titles treated?  My understanding is that if a particular program resembles a book or a dramatic work (like a video game), its title is italicized -- otherwise, it is treated as a proper noun, just like any other product.     I played Grand Theft Auto, instead of reading "Democracy in Ancient Greece" in Microsoft Encarta and preparing my presentation in PowerPoint.   Is this approach correct?


What is the largest proportion of elements of a nonabelian group that have order at most $2$?   In other words, given $G$ a nonabelian group with order $n$, and $k$ elements of order at most $2$, how large can $k/n$ be?  A colleague and I have been thinking about the following for a couple of days. Unfortunately neither of us knows much about a group theory beyond a first course (and in particular, no representation theory to speak of), so it may be simple, but beyond our expertise. We have made some progress:   An abelian group of order $n$ can have $n$ elements of order at most $2$, at least when $n=2^m$ for some integer $m$: $(\mathbb{Z}/2\mathbb{Z})^m$ works. Also, there is a priori no restriction on elements of prime order $p>3$ in nonabelian groups: a nonabelian group can have as many elements of order $p$ as we like: one of the two nonabelian groups of order $p^3$ has $p^3-1$ elements of order $p$, and this generalises to $p^m$ for $m>3$ by taking a direct product of this group with $(\mathbb{Z}/p\mathbb{Z})^{m-3}$. Now, as for the case we're actually interested in: elements of order $2$ in nonabelian groups.    A lower bound for the maximum of the ratio $k/n$ is $3/4$: examples with this ratio are $ D_8 \times (\mathbb{Z}/2\mathbb{Z})^m $. An upper bound for the maximum has been suggested by my colleague: suppose that $a,b$ are elements of order at most $2$. Then $$ ab = ba \iff aba = b \iff (ab)^2 = e, \tag{1} $$ i.e. $a$ commutes with $b$ if and only if $ab$ also has order at most $2$ (this immediately implies there must be an element of order larger than $2$, of course, or the group would be abelian). Now, the largest proportion of pairs that commute with one another is $5/8$ (i.e. there are at most $5n^2/8$ pairs that commute), by the $5/8$ theorem (, ). If the set of elements of order at most $2$ is $H$ (not necessarily a subgroup), then $\lvert H \rvert = k$. Let $h \in H$, then  $ hG = G $ by the group property. The most elements of $h' \in H$ for which the product $hh'$ can lie outside $H$ is $n-k$, so the number of $h'$s with $hh' \in H$ is at least $2k-n$, provided that $2k>n$ (the interesting case). There are $k$ $h$s, which is a total of at least $k(2k-n)$ pairs $hh'$s that lie in $H$. These pairs then all commute by $(1)$, so by the $5/8$ theorem, $$ k(2k-n) \leq \frac{5}{8} n^2 , $$ or $$ \left( \frac{k}{n}- \frac{1}{4} \right)^2 \leq \frac{3}{8} , $$ so $$ \frac{k}{n} \leq \frac{1}{4}(1+\sqrt{6}) < 0.863 . $$ One could do slightly better than this by treating the identity separately, worrying about elements with higher order that commute with their own powers, and so on, but none of this gives more than an $O(1/n)$ correction, as far as I can see.

Is there an non-abelian finite group, in which more than half of the elements have order $2$   I only know that if there is one, then all elements (except identity) cannot have order $2$, otherwise it would be abelian, so there is at least one element of order $>2$, say $x$. If I conjugate $x$ with another element, then conjugation preserves order but any $2$ conjugation might not give distinct elements, for the conjugacy class of an arbitrary element would be always the whole group.  Or is there such a group


I have this code:  def get_endpoint(type):     return "%s/%s.json" % (v2_endpoint,type)  def get_entities(type,endpoint=None,entities=None):     if not endpoint:         endpoint=get_endpoint(type)         entities=[]     r=requests.get(endpoint,headers=header)     entities.extend(r.json()[type])     if not 'next' in r.links:         return entities     else:         return get_entities(type,r.links['next']['url'],entities)  print "Fetching info from New Relic....", servers = get_entities('servers') applications = get_entities('applications') print "Done."   I noticed that it doesn't print the first and last print statements until it has processed those functions. Expected behaviour, I presume.  So, how do I make it print the first line before it starts processing the function?

How do I force Python's print function to output to the screen?


Which one is correct:   A child born today inherits a world vastly different from that of its parent’s generation. A child born today inherits a world vastly different from that of his parent’s generation.   I found the first version of the sentence in a book. But my humble knowledge of English language says it must be written his instead of its.  What do you think and why?  EDIT:  The posts given on  do not answer my question because all the answers refer to rudeness and anger such as in the accepted one: this is something that would be said only in the heat of anger. But the author of the book is not trying to offend anybody.

In Japanese, referring to people as "it" considered rude. Instead of "it", We say "that person" or information of the person (ex. a person who wares a blue shirt).  In English, Is referring to people as "it" considered rude?


I ran the following command in chroot environment without X:  gsettings set org.gnome.desktop.a11y.applications screen-reader-enabled true  I get the following error message:  (process:8290): WARNING **: Command line `dbus-launch --autolaunch=09be9504960407430fb3a253000052a5 --binary-syntax --close-stderr' exited with non-zero exit status 1: No protocol specified\nNo protocol specified\nAutolaunch error: X11 initialization failed.   Is X a must for changing gsettings? Is there another way to change the setting? (My purpose is to make a LiveCD iso with screen reader enabled by default)  Thanks!

I am trying to change some gconf settings in Ubuntu 12.10. I would like to change the lightdm greeter background.  I have discovered that while logged in to unity as a user while running X server, I am able to do this with:  sudo xhost +SI:localuser:lightdm gsettings set com.canonical.unity-greeter background "'/usr/share/backgrounds/micros-background.png'"   The problem is that this requires me to login as a user under X. So that entire window manager needs to be running. But I want to use chroot to change these settings without any X server running. I just want to mount the partitions and change gsettings without having the full window manager running.  Is there a way to directly change gsettings without being logged into X and Unity?  Or alternatively... is there a way to bring up the X server and Unity in the background so that I can make the changes without having a full windowed display come up on my monitor?


If $f: \mathbb R \to \mathbb R$ is bounded, increasing and continuous. Does $f$ have to uniform continuous?     I know the answer is yes if $f$ has domain to be any open interval, say $(0,1)$. But I don't know how to prove this case. Any help is appreciated.

Supose $f$ is increasing, bounded and continuous on $[a,+\infty)$.   Is  $f$ uniformly continuous ?  I think yes. how to prove that?  My idea is to show there exists $X$ , $f$ is uniformly continuous on $[X,+\infty)$.  How to fix such $X$?


when I was catching up with Evans PDE and I realise I do not have a good understanding about limsup and liminf.  I found the following exercise in a real analysis book that motivates the definition of limsup.But I have no idea how to answer.   Let $(x_n)$ be a bounded sequence. For each $k\in\mathbb{N}$, let   $$y_k=\sup_{n\ge k} x_n=\sup\{x_k,x_{k+1},x_{k+2},\cdots\}.$$   Show that the sequence $(y_k)$ is decreasing and bounded below.  Conclude that $(y_k)$ converges.   [Part 1) was solved in previous posts, but I have not found an answer for part 2)]

I have been trying to understand the following definition and just needed some clarification.  For each bounded sequence $(a_n)_{n=1}^{\infty}$ we define the sequences ($\overline{a}_n)_{n=1}^{\infty}$   and ($\underline{a}_n)_{n=1}^{\infty}$  in the following way:  \begin{eqnarray*} \overline{a}_n&=& \sup\left\{a_n,a_{n+1},\dots \right\},\\ \underline{a}_n&=&\inf\left\{a_n,a_{n+1},\dots\right\}. \end{eqnarray*}  How does this definition imply that $\overline{a}_n$ is decreasing and $\underline{a}_n$ is increasing?


What is the antonym of the word destination. Here is some context:  Every train has a destination and a ____?  I was thinking it might be origin but I've never encountered that word used in this context so I'm not sure - there might be a better word.

This question arises when I try to describe my itinerary to ticket service in the UK. Take for example, I plan to buy a ticket from A to B. B is the terminal. How to say its counter part A? I cannot find a proper term. I have to say "I will depart from A" or "I plan to go to B from A". Or I even use "departure place" to refer to B.


Anyone remember the name of this book? The Nations of the world send people to investigate a hollow asteroid.  What they find is a civilization- with libraries that "teach" you.  There's a tunnel- and as you go down the tunnel- you also go through time.  No one knows who built it or what it was for. I remember enjoying the detailed descriptions of the future and would like to read it again.

I read this book many years ago and it had a nice plot. For the life of me I can't remember the name or author so I need help.  Story: one asteroid shaped object appears close to Earth orbit or in the Sol system.  People get on board and start exploring. They find machines/computers that can teach them anything in a very short time (languages, crafts etc).  Towards the end, something happens and one of the characters goes into a long tunnel where he/she opens a portal in time with the help of a device he/she has.  In the epilogue it states that he has been transported back in time to Egypt.  I think there were no pyramids.  Sorry for being brief but this is all I remember. Any help would be appreciated. Thanks.


I uninstalled quite a few programs today and in every removal there are the following messages on terminal. What are they supposed to mean? Is something to be fixed?    I have seen that there are similar questions but they are outdated. My question's point is to see if there is currently a way to fix it, so if someone wants to vote to close this one I would advice them against it.

Each time apt-get tries to process triggers for shared-mime-info, it reports warnings like:  ... Processing triggers for shared-mime-info... Unknown media type in type 'all/all' Unknown media type in type 'all/allfiles' Unknown media type in type 'uri/mms' Unknown media type in type 'uri/mmst' Unknown media type in type 'uri/mmsu' Unknown media type in type 'uri/pnm' Unknown media type in type 'uri/rtspt' Unknown media type in type 'uri/rtspu' Unknown media type in type 'interface/x-winamp-skin'   I've checked /usr/share/mime-info but doesn't see any of them:  /usr/share/mime-info$ grep 'url/rtspu' * (Got nothing)   So, how to clean up my system so it won't report these unknown media types?


I have a dynamic soql in where I pass a string of ids in the WHERE IN clause this thtrows me a error:      expecting a colon, found '{'   My where clause is as follows:   WHERE Id IN {x0x0o000000000xXXX}   I also tried  WHERE Id IN :{x0x0o000000000xXXX}   I also tried adding {x0x0o000000000xXXX} to a string and do  WHERE IN :String    this gives the error:     IN operator must be used with an iterable expression   So is it not possible to use a string in the SOQL itself and does it has to be :Set or :List?  I get the use of :Set my question is: is it in any way possible to use a string directly in de dynamic soql so use   testString = String.valueOf(Set<id>);  WHERE IN testString

Can some one correct my soql? I need to export records in data loader like:  WHERE Id IN ('123123123','123123fsdf')   But this following query does not work for me:  SELECT Id, Syndication_Documents__c FROM ContentVersion  WHERE Syndication_Documents__c in : 'a4fa0000000KzbV','a4fa0000000KzbW'


If $|G|=p^{n}$  Then  Why is it that every subgroup of order $p^{n-1}$ is normal?

Generalizing the case $p=2$ we would like to know if the statement below is true.  Let $p$ the smallest prime dividing the order of $G$. If $H$ is a subgroup of $G$ with index $p$ then $H$ is normal.


In the TNG episode "" the Enterprise-D enters another galaxy.  Does she ever go to another galaxy a second time?  Why am I aksing such a absurd question? The spoken opening text of TNG is quite different in the German translation. Translated back to English it goes something like:  Space - infinite vastnesses. We are in a distant future. These are the adventures of the new starship Enterprise, which is many light-years away from earth on its way, to discover new worlds, unknown lifeforms and new civilisations. The Enterprise thereby advances to galaxies, that no man has seen before.  Obviously the guy who did the German translation didn't know much about Star Trek, since travelling to other galaxies is, if at all, only a very minor part of what the series is about. But I grew up with this sentence and it made me wonder: Does the Enterprise D advance into galaxies where no-one (that is: no human) has been before? I already know of one example, where the Enterprise D entered another galaxy. But that's singular, while the opening text talks about galaxies (plural). Is there another example of the Enterprise D going to another galaxy, or is the German translation of the opening text not only misleading but plainly wrong about that?  For completeness, here is the original opening text:  Space: the final frontier. These are the voyages of the starship Enterprise. Its continuing mission: to explore strange new worlds, to seek out new life and new civilizations, to boldly go where no one has gone before.  And here is the untranslated German opening text:  Der Weltraum, unendliche Weiten. Wir befinden uns in einer fernen Zukunft. Dies sind die Abenteuer des neuen Raumschiffs Enterprise, das viele Lichtjahre von der Erde entfernt unterwegs ist, um fremde Welten zu entdecken, unbekannte Lebensformen und neue Zivilisationen. Die Enterprise dringt dabei in Galaxien vor, die nie ein Mensch zuvor gesehen hat.  (emphasis added)

I recall in at least two episodes of Star Trek ( from the original series and  from The Next Generation) that there is reference to and contact with species from external galaxies.  By the 29th century, we see that timeships exist.  My question is, is there any reference to intergalactic relations in Star Trek in the future (say, by the 29th Century), or does the Star Trek Universe stay in the Milky Way Galaxy?


I want to create JUnit 5 test for Rest API which uses JWT token validation:      @Test     public void resetTokenTest_OK() throws Exception {         when(userService.findByResetPasswordToken(anyString())).thenReturn(trueOptional);          mockMvc.perform(post("/users/reset_token")                 .contentType(MediaType.APPLICATION_JSON)                 .content(ResetPasswordTokenDTO))                 .andExpect(status().isOk())                 .andExpect(jsonPath("$.resetPasswordToken").value(randomString_254))                 .andExpect(jsonPath("$.login").value("login"))                 .andExpect(jsonPath("$.status").value("200"))                 .andExpect(jsonPath("$.error").value(""))                 .andExpect(jsonPath("$.errorDescription").value(""));     }     I make a Mockup request using this payload:  {   "resetPasswordToken": "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWUsImlhdCI6MTUxNjIzOTAyMn0.VFb0qJ1LRg_4ujbZoRMXnVkUgiuKq5KxWqNdbKq_G9Vvz-S1zZa9LPxtHWKa64zDl2ofkT8F6jBt_K4riU-fPg",   "login": "login",   "status": "1",   "error": "",   "errorDescription": "" }   I get NPE for this :   Caused by: java.lang.NullPointerException     at org.engine.utils.GenericUtils.getLoggedInUser(GenericUtils.java:15)     at org.engine.rest.UsersController.lambda$resetToken$0(UsersController.java:159)     at java.base/java.util.Optional.map(Optional.java:258)     at org.engine.rest.UsersController.resetToken(UsersController.java:153)     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)     at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     at java.base/java.lang.reflect.Method.invoke(Method.java:564)     at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190)     at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138)     at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:105)     at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:879)     at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:793)     at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)     at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040)     at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943)     at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)   Full :   For some reason I get NPE for this code:  return (Users) SecurityContextHolder.getContext().getAuthentication().getPrincipal();     Do you know how I can fix this issue?

What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?  What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?


In Stargate Atlantis, Season 5, Episode 19 - Vegas, we are presented an alternate reality of the universe. At one point, we find out that:  McKay tells Sheppard that a little while ago, he and his team accidentally opened a rift in space/time and visited another reality, in which that Sheppard is somewhat of a hero having saved the world several times over   Is Rodney referring to the reality we are familiar with in the show, or do we simply not know? Also could It possibly have something to do with episode 5, "Daedalus variations"?

I'm going to assume enough time has passed that the following is not considered a spoiler:  In the second-to-last episode of Stargate Atlantis, we see an alternate universe where Sheppard is a detective.  In the middle of the episode, McKay questions Sheppard as part of an investigation. McKay then says, "You know, I once met another version of you. He was very different."  What exactly is he referring to? As far as I remember, Rodney McKay said he knew his Sheppard when he traveled between universes, so it can't be this one. Which is it?


Let $R$ be a commutative ring $(\neq 0)$ with 1, I have proven that $R$ has at least one maximal ideal, but I can't proved that $R$ has at least one prime ideal. I read that it's trivial but I can't see it. Some help? Is clear that $0$ es prime ideal iff $A$ is an integral domain, but this isn't the case.

A maximal ideal  is always a prime ideal, and the quotient ring  is always a field. In general, not all prime ideals are maximal.      In $2\mathbb{Z}$, $4 \mathbb{Z} $ is a maximal ideal. Nevertheless it is not prime because $2 \cdot 2 \in 4\mathbb{Z}$ but $2 \notin 4\mathbb{Z}$. What is that is misunderstand?


Right now I am practicing for AP Computer Science, right? (btw I am self-studying, so gaps in my learning may be large, be warned)  Here is the code that the question will talk about:      public void changer(String x, int y) {          x = x + "peace";          y = y * 2 ;     }     public void test() {          String s = "world";          int n = 6;          changer(s,n);          /*End of method*/     }   Now, at the point "End of method" String s SHOULD equal to "worldpeace" and int n SHOULD equal to 12. But in the answers, it says that s is still "world" and n is still 6.   Now, obviously this means that the variables have not changed, at least up until that point. Can someone explain past this? When would the variable have changed? I honestly am so confused why s is not "worldpeace" and n is not 12.

I always thought Java uses pass-by-reference. However, I've seen a couple of blog posts (for example, ) that claim that it isn't (the blog post says that Java uses pass-by-value). I don't think I understand the distinction they're making. What is the explanation?


I created a user in terminal by  useradd xyz   I'm able to log in from the terminal but not in the GUI.  What is wrong?

I am trying to understand system administration on Ubuntu. So, as an example, I create a dummy user using   sudo useradd -d /home/linda linda   and passwd to create the password. I check that an entry has been made using cat /etc/passwd  linda:x:1004:1004::/home/linda:/bin/sh   However, when I su - linda, I get    No directory, logging in with HOME=/    and indeed, no home directory has been created. What am I missing?  Thanks.


I want to change the title showing in a page based on information I pick up from within the page (eg to show the number of inbox messages)  document.getElementsByTagName('title')[0].innerHTML="foo"; does change the title tag, but firefox does not update the displayed title (in window and tags) when this happens.   Is this possible?

I have a webpage that implements a set of tabs each showing different content. The tab clicks do not refresh the page but hide/unhide contents at the client side.  Now there is a requirement to change the page title according to the tab selected on the page ( for SEO reasons ). Is this possible? Can someone suggest a solution to dynamically alter the page title via javascript without reloading the page?


I couldn't log in to facebook, so I ping the domain and got this:     ping www.facebook.com      Pinging www.facebook.com [69.171.228.14] with 32 bytes of data:      Request timed out.      Reply from 204.15.23.57: Destination net unreachable.   But when I ping this IP, it is reachable.      Pinging 204.15.23.57 with 32 bytes of data:      Reply from 204.15.23.57: bytes=32 time=190ms TTL=51   I realize it is something wrong with my computer, as I have tried using different networks (on the same network other devices can connect to facebook), resetting router's routing table, clear my computer arp cache...but none of it works.   Does anyone have any idea?


I'm trying to create a node setup that allows me to use a Principled BSDF for the yellow lego plastic, but also use a .png with alpha for the face. I can't figure out how to make that work, so my work around is to use an image texture with the face and a yellow background, as seen below.  But I'd rather use the Principled shader to control color.  Below is something I've tried unsuccessfully.  Can anyone suggest a node setup that'll allow me to use the .png WITH a Principled BSDF?

I'm designing this animal-type creature, and want to add a transparent .png image to its face with the face features (object has a subsurf). On the left is the image with the features, on the right is the part of the object where I want it to be.    I tried to import the image as a plane, but matching the shape of the plane with the face didn't work, and the lines of the face left shadows on the head, and could be seen as a different object from some angles (although it's the closest I've gotten yet). It looked like this:    So , I tried selecting the faces of the head that the features should go over, and create a new material for it. Unfortunately, since the .png is transparent, the result produced was this:    (where it's impossible to tell the transparency from a black background default color, and where I wouldn't know where to start to adjust size and position).  I also tried UV mapping, but then the whole object became black with the features repeated all over.   Is it something I have to go into Nodes for? I'm kind of stuck here. Creating a new material and applying it is simple, but applying a material that is an image is a bit more complex it seems... Ideally, I would reproduce the same technique for the adhesive bandage on its arm (seen on the right of image 1).


Prove that   $\dfrac {\left( 5^{125}-1\right)}{\left( 5^{25}-1\right)}$ is composite number using number theory. Do not use calculator or Wolfram alpha or anything like that.


Can anyone explain how I can get the client IP of the Java RMI programming, including a sample of how to use it?  I have looked up the , but it is hard to understand.  I would like to print the client IP on server

When I implement an RMI server (implement an interface that extends java.rmi.Remote) is there a way to get information about the current RMI request context, specifically the remote client's IP address?  public void myMethod() throws RemoteException {      log.info("remote IP is "+ RMISomething.getSomething());  }


So i am a bit confused when it comes to focal length in DSLR cameras. According to multiple sources online i found and as per NIKON "It is a calculation of an optical distance from the point where light rays converge to form a sharp image of an object to the digital sensor or 35mm film at the focal plane in the camera".  However according to other explanations it is the distance from the lens to the point where light converges  Therefore my first question is this. If the focal length is the distance from the convergence point to your camera sensor and since the image is the sharpest where the refracted beams of light meet how is the image not blurry since the location of the "intersection" is different from the location of the sensor.  Therefore to put it plainly, since through the pentaprism we are viewing a perfectly clear/focused image is the converging point at the prism, the sensor  or somewhere else. Lets keep it simple by talking about a 50 mm lens.  Secondly how is technically and inside the camera the refraction amount by the lens translated to a wide angle or telephoto lens.  I apologise for the confusion.  Thank you

I understand the idea of a focal length for a single lens, i e the distance from the lens to the point at which parallel rays of light converge. However, in the case of a photographic lens with multiple lens elements, where exactly is the focal length of the lens as a whole measured from?


For all positive integers n,m,k where $n\ge m\ge k$ , $\binom {n}{m}\binom {m}{k}=\binom {n}{k}\binom {n-k}{n-m}$   Prove the following statements using combinatorial proofs.  I can't come up combinatorial proofs.   Also,     $\sum_{i=0}^n {n \choose i} = 2^n$   how would you proof $2^n$?

I want to prove this equation, $$ \binom{n}{a}\binom{n-a}{b-a} = \binom{n}{b}\binom{b}{a} $$ I thought of proving this equation by prove that you are using different ways to count the same set of balls and get the same result. But I'm stuck. Help me please.   (Presumptive) Source: Theoretical Exercise 1.14(a), P19, A First Course in Pr, 8th Ed, by S Ross.


I am trying to create a dictionary from two lists, the dictionary should do a one-one mapping of each element of the listA to the corresponding element in the listB at the same index ,I have the current output and expected output below, can anyone suggest how to fix this?  destination_milestones_gerrit_branches ={} destination_milestones =['m1','m2','m3'] gerrit_branches = ['b1','b2','b3'] for milestone in destination_milestones:     print milestone     for branch in gerrit_branches:         print branch         destination_milestones_gerrit_branches[milestone]= branch print destination_milestones_gerrit_branches   Current output:-  {'m1': 'b3', 'm3': 'b3', 'm2': 'b3'}   Expected output:-  {'m1': 'b1', 'm2': 'b2','m3':'b3'}

Imagine that you have the following list. keys = ['name', 'age', 'food'] values = ['Monty', 42, 'spam']  What is the simplest way to produce the following dictionary? a_dict = {'name': 'Monty', 'age': 42, 'food': 'spam'}


While compiling my code, I keep getting the following linker error (the code compiles fine) foo.cc:15: undefined reference to `void foo<int, int (*)(int)>(int*, unsigned long, int (*)(int))' I'm fairly new to C++, and I'm pretty certain that my issue is coming from using template arguments, but I'm not sure where I am going wrong. The header for function foo and how it is being called is shown below template<typename T, typename F> void foo(T* a, size_t b, F c); ... // neither of these work foo(ptr,val,func); foo<int, int (*)(int)>(ptr,val,func);  and my implementation of foo is compiling fine. I'm not sure where the issue is coming from.

Quote from :     The only portable way of using templates at the moment is to implement them in header files by using inline functions.   Why is this?  (Clarification: header files are not the only portable solution. But they are the most convenient portable solution.)


I Wonder if this sql query is secured from sql-injection, and if it is ok, or i should modify something.  I tried to bind the id from the GET and than if everything is ok, i use that actual query with that id.  if(isset($_GET['id']) && $_GET['id'] != null) {   $id = $_GET['id'];    $stmt = $mysqli->prepare('SELECT id FROM maps WHERE id = ?');   $stmt->bind_param('i', $id);    $stmt->execute();    $result = $stmt->get_result();    if (mysqli_num_rows($result) == 1)    {     $row = $result->fetch_assoc();       $secid = $row["id"];   } else {       header("LOCATION: index.php");   }    $sql = "SELECT    maps.id,   maps.name,   maps.description,   maps.date,   maps.mcversion,   maps.mapid,   maps.category,   maps.format,   maps.userid,   users.username,   users.rank,   users.verified,   users.mc_username,   (SELECT COUNT(*) FROM likes WHERE likes.mapid = maps.id) AS likes,   (SELECT COUNT(*) FROM downloads WHERE downloads.mapid = maps.id) AS downloads,   (SELECT COUNT(*) FROM subscribe WHERE subscribe.channelid = maps.userid) AS subscribes,   (SELECT COUNT(*) FROM views WHERE views.mapid = maps.id) AS views   FROM maps   INNER JOIN users        ON maps.userid = users.id   WHERE maps.id = '$secid'";    $result = mysqli_query($con,$sql);    if (mysqli_num_rows($result) > 0) {       $row = mysqli_fetch_assoc($result);   } else {       header("LOCATION: index.php");   }  } else {     header("LOCATION: index.php"); }

If user input is inserted without modification into an SQL query, then the application becomes vulnerable to , like in the following example:  $unsafe_variable = $_POST['user_input'];   mysql_query("INSERT INTO `table` (`column`) VALUES ('$unsafe_variable')");   That's because the user can input something like value'); DROP TABLE table;--, and the query becomes:  INSERT INTO `table` (`column`) VALUES('value'); DROP TABLE table;--')   What can be done to prevent this from happening?


Are there any examples where the inductive step works but the base case does not? I know there are some where the latter is more difficult.

I am looking for an example where you have $P(n)$ implying $P(n+1)$. However there is no base case. For which there is therefore no solution at all for the induction problem even though the inductive step itself works.


How can I create a reliable alias or function that let me create and cd into one directory?  I tried the following, but, as an example can't create directories with spaces.  mcd () {         mkdir $1 && cd $1 }

Quite often I need to perform this two commands:  mkdir abc cd abc   I am curious whether there is a simple command (or an alias that I can create and use) to do it in one go, like  user@GROUP:~$ mdcd abc user@GROUP:~/abc$   Is this possible?


I'll add some quotes from the , as it wouldn't get clearer if I quoted everything from the book. The quotes which I'll take from the book won't have any page number, as it varies from edition to edition. In The Restaurant at the End of the Universe, Zaphod, Trillian, Arthur, Ford and Marvin travel in the black ship  belonging to the rock band Disaster Area (Wikipedia)  back in time:  "We're plummeting back-ward through time." (Ford in Chapter 20)  However, they travel too far back in time:  "[...] If it is what I think it is, and if it's saying what I think it's saying, then we've already gone too far back into the past. Maybe as much as two million years before our own time." (Ford in Chapter 20)  Shortly after that, they end their time travel (so they're now two million years before their own time). They then realize that they should get off the ship and use the teleporter to do that, leaving Marvin behind:  There is a teleporter on the ship for which the guidance system was never built, as it was never intended to be used, and it also requires somebody to stay on the ship to operate it. Marvin is chosen to stay behind and teleport the others, who have no choice but to go wherever it takes them. (Wikipedia)  With Arthur and Ford the following happens:  The teleporter has meanwhile sent Arthur and Ford to the Golgafrinchan Ark Fleet Ship B, a ship of fools, which crash-lands on prehistoric Earth. (Wikipedia)  which makes sense, as they're two million years before their time, so the earth is two million years before it's time as well. What doesn't make sense however is what happens to Zaphod and Trillian:  Zaphod and Trillian are returned to the Heart of Gold, which is commandeered by Zarniwoop to complete his mission, to discover who really rules the Universe.  Because this means, that Zaphod and Trillian were teleported into their own time, as Zarniwoop and the Heart of Gold didn't exist two million years before their own time. It's the same with Marvin, who somehow made it off the ship as well (I forgot how and it's not quite relevant), who then was on a different planet, where the Krikkit robots found him and took his leg - once again in the normal time, not two million years ago. Am I not seeing something which explains this or did Adams simply make a mistake here?

In , Arthur, Ford, Zaphod, Trillian, and Marvin have just stolen Hotblack Desiato's stunt ship after leaving Milliways and traveled into the past 2 million years before their own time.      ”Trouble is,” said Ford, ”that the one instrument in this whole ship that   is giving any reading is worrying me. If it is what I think it is, and if it’s   saying what I think it’s saying, then we’ve already gone too far back into   the past. Maybe as much as two million years before our own time.”   As they realize that this ship is about to crash into the sun, they discover a teleportion device (their only means of escape) and leave Marvin behind to control it so they can escape despite the fact they have no idea where they might end up. Arthur and Ford end up on the Golgafrincham ship which shortly thereafter crash landed on pre-historic Earth (i.e. roughly 2 million B.C.), and Zaphod and Trillian end up back on The Heart of Gold.      ”I trust you had a pleasant meal?” said Zarniwoop to Zaphod and Trillian   as they rematerialized on the bridge of the starship Heart of Gold and lay   panting on the floor.   As I understand from the beginning of the book, at this point the Heart of Gold had been left with Zarniwoop alone on the ship in Arthur's "own time" (in the 1980's). There doesn't really seem to be any explanation as to why the teleportion device sent Zaphod and Trillian 2 millions years into the future as far as I can tell.   So, am I misinterpreting something to the story and the gang really left The Heart of Gold 2 million years before their own time, or did the teleportion device also act as a time machine when Zaphod and Trillian stepped into it? Or perhaps did Zarniwoop have The Heart of Gold travel back in time?


What are the differences between:  An algorithm to solve optimization problems  and  An algorithm for solving optimization problems  I think only the second one is correct but I can’t explain why the first one is wrong.

Are the following sentences grammatical or not? If not, does substituting a to-infinite make them grammatical? (Optional: designate if the sentence expresses purpose, reason, aim, or function)  1 I have decided to purchase a jet for getting to NYC and back more quickly. 2 I have decided to buy a jet for having a quicker way to get to NYC and back.  This is my only reason and aim; this will be the jet's only purpose and function.  3 I hate hairdryers, so I am buying a space heater for drying my hair more naturally, and that is my only aim & purpose & reason and that will be its only function 4 For having a lasting shine in your hair, buy ShineOn Shampoo. 5 My neighbor and I have decided to cooperate more for having a better life together.   Research done: ELL  (Note the  here is a restatement of Cambridge Dictionary's ) ELL  ELL  BBC English  (Currently the best site I've found.) ELU  All of which have answers that I find  (i) incomplete (ii) contradictory (iii) terribly confusing, if not (iv) wrong. To sort through the haze, I am focusing on one issue. Background Some sources say that you need to use a to-infinitive for expressing purpose, aim, function, reason, etc. I find these to be rather hazy distinctions, given that the ODO defines  as The reason for which something is done or created or for which something exists and the same work lists as : aim, reason, function, etc. It is my assertion that at least some of the following sentences demonstrate that one can use the -ing form (be it a gerund, verbal noun, participle) to express individual purpose (aim, reason, function, intention, whatever you want to call it). Do you agree, or not? Why (not)?  In shorter terms, are the sentences grammatical? or do we have to substitute a to-infinitive (including in order to + infinitive) to make them grammatical? (Optional: designate if the sentence expresses purpose, reason, aim, function, etc.)


I would like to know why I am getting a NullPointerException when I am trying to return JTable cell value from class A to class B.   Any valuable feedback or suggestions to overcome the issue are highly appreciated!

What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?  What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?


I want to install Ubuntu on a removable hard driver, so that when I remove the hard drive and turn on my computer, there exist no signs of Ubuntu (I mean no grub or something else). But when I connect my hard drive and turn on my computer, Can boot from external hard drive and start an Ubuntu session. I want Ubuntu to be installed on my external hard drive,creating a live Linux is not my answer. any suggestions?

OS: Windows 7. I want install Linux Ubuntu on portable external Hard Drive USB 2.0. I read a variety of methods, but I'm confused by contradictory advices and methods. Actually, installing Ubuntu on anything other than clean PC looks much more complicated than installing Windows. I need to have Ubuntu package + Python 2.7 + C compiler installed. My external hard drive is partially filled, I need to keep all files.   Will Ubuntu run entirely on external hardrive, without writing anythinhg to Windows system folders and to registry?  Can anyone post detailed guide how install Ubuntu on external hard drive?


For a polynomial P(z) of degree $n\geq2$, show that there exists some $R_{1}>0$ such that for $R>R_{1}$ it holds that: $$\int_{C_{R}}\frac{1}{P(z)}dz=0$$ where $C_{R}$ is a circle of radius R with the centre $0$.  I am already aware of the fact that $$\lim_{R\to \infty}\int_{C_{R}}\frac{1}{P(z)}dz=0$$ and how to go about proving it but I'm not sure how to evaluate the first integral written above without using any limit. Would I maybe use a similar approach as was used to show the latter integral?

Prove that $$\frac {1} {2\pi i} \oint \frac {{\rm d}z} {P(z)} $$ over a closed  smooth simple curve that contains all of the roots of the polynomial $P(z)$ is either zero if $n \geq 2$ or equals $\frac{1} {a_0} $ if it's degree is $1$.   Proof: $n\geq 2$ $$\frac {1} {P(z)=(z-z_0)(z-z_1)\dots(z-z_n)}$$ So after partial decomposition of the fraction I'll have something like $$\frac {A} {z-z_0} +\frac{B} {z-z_1}+\cdots$$ where $A,B \in \mathbb{C}$ (Is this fact true that $A,B$ wont be polynomials and just coefficients I can see it why in an intuitive way but cannot write a full proof of it for the decomposition trying to get a linear system or something) then use Cauchy's theorem and integrate all of these on  different circles with their center at each root  and argue that  the integral is the same as the sum of those circle integrals. Now since $\frac {1}{z-z_n}$ will be analytic inside the circle when I'm integrating on circles that do not contain $z_n$  some  of those integrals  will be zero. and now since my curves are of the form $\gamma(t)=z_n+e^{it}$ , $t \in [0,2\pi]$ the rest of the integrals  will look like $$\int_0^{2\pi}  \frac{Aie^{ti}} {e^{it}}\,{\rm d}t $$  and all of them will be $A_i$.   Is my proof correct? Only part I cannot show is that I won't have any problem with decomposing the fraction. And I'm also using the assumption that after the decomposition I'll have as numerators simple complex numbers not not functions of any kind.


I really love the Vampire Knight anime and have rewatched it few times. Now I would to read the manga but I don't want to read the part where the anime have covered up.

I've watched the Vampire Knight anime. I really like the story so far but find it frustrating that the anime doesn't finish off the story. I'm trying to figure out if it is worth reading the manga.  Does the manga contain more story than the anime? Does it finish the story off?


I'm compiling the following file hello.tex, which contains a picture:  \documentclass[12pt]{article} \usepackage{graphicx} \begin{document} \includegraphics[width=5cm, natwidth=1079, natheight=377]{x.png}  \end{document}   This produces the correct output with xelatex hello.tex. However, for various reasons I need to use latex+dvips+ps2pdf:  latex hello.tex dvips hello.dvi ps2pdf hello.ps   However, the last step produces an error:  C:\Users\Bai\Desktop>ps2pdf hello.ps Error: /syntaxerror in (binary token, type=137) Operand stack:  Execution stack:    %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1967   1   3   %oparray_pop   1966   1   3   %oparray_pop   1950   1   3   %oparray_pop   1836   1   3   %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval-- Dictionary stack:    --dict:1197/1684(ro)(G)--   --dict:0/20(G)--   --dict:79/200(L)--   --dict:102/300(L)--   --dict:43/200(L)-- Current allocation mode is local Last OS error: No such file or directory Current file position is 22237 MiKTeX GPL Ghostscript 9.19: Unrecoverable error, exit code 1   Any idea what could be causing this?

There several types of graphics files. In no particular order .jpeg .eps .pdf .png .tif .jif (and no doubt others). Some work with latex, dvips and some work with pdflatex. How am I supposed to know which?  Just to confuse matters, metapost produces .eps but I can use these with pdflatex as long as I put in a four line incantation.  Can anyone explain this?


I am writing a program that generates excel reports, currently using the Microsoft.Interop.Excel reference.  My dev computer has Excel on it, but the end user may or may not have Office installed.  Will this tool fail if Office isn't installed on the end users computer, or is this interop service separate from the actual application?

How can I create an Excel spreadsheet with C# without requiring Excel to be installed on the machine that's running the code?


$(G,*)$ is an abelian group and $a,b$ are elements of G. Let $n=ord(a)$ and $m=ord(b)$ in $G$. Show that the order of $a*b$ is equal to $nm$ if $gcd(n,m)=1$.  I have already proved that $ord(a*b)|nm$. But the other part is a problem.  Thanks

We want to show that if $a,b\in G$ where $G$ is a finite Abelian group, we have  $\operatorname{LCM}(|a|,|b|) = |ab|$ given that $ab \neq e$.   How I approached this question was by saying let $\operatorname{LCM}(|a|,|b|) = L$. Then if we show that $L$ divides $|ab|$ and $|ab|$ divides $L$ then $|ab| = L$. Showing that $|ab|$ divides $L$ was fine. But then I am having trouble with the second part that is showing $L$ divides $|ab|$. For this, so far I have:  Consider $(ab)^{|ab|} = e = a^{|ab|}b^{|ab|} $  since we know $a \neq b^{-1}$ by assumption then we can conclude that $|a|$ divides $|ab|$ and $|b|$ divides $|ab|$. We know that $L = \frac{|a||b|}{\operatorname{gcd}(|a|,|b|)}$ from here can we conclude that $L$ divides $|ab|$?


I was denied entry last year for insufficient funds (I was trying to stay for 6 months to be with my boyfriend...I know, what a great plan) So anyways, I was told I am welcomed back but should wait at least 6 months. They also said a visa would help. I’m not sure what to do...since I waited more than long enough to return, if I have proof of funds for the two weeks I’m staying and a return flight back will I run into any issues? I have most definitely learned my lesson, it just sucks it was the hard way. Btw: I’m planning a visit in December for 2 weeks for the holidays!  I am a US Citizen.

On November 11, my American girlfriend flew over to the UK to visit me. She was detained and questioned, and refused entry under the belief she would not leave within those six months. This was due to her having no return flight booked, as we were going to wait until we were together in the UK to book a return flight for either herself, or both of us back to the USA once we decided what exact dates I would be able to travel. Lesson learned. A hard lesson, but we learned!  Anyway, they said although she'll flag up in the future, it won't be a straight ban from entering and she could even try to come back the next day if she so pleased, although it would be unwise if her circumstances had not changed.  Fast forward to December 18. She got herself a job in the States to prove she intends to leave at the end of her stay, and has since applied for a UK Standard Visitor Visa. She posted her documents off to New York earlier today.  Will they send her a letter back refusing to issue her a visa since, as an American citizen, she does not even need one? She wanted to get one to be safe as I told her not to fly to the UK even with return flights booked if she doesn't have a visa, as she risks being denied once again after a long flight. It's hard to get this information on the Internet, and some stories I read said that they were sent a letter back from the UK Embassy denying their visa simply because they don't need one in the first place - even after that person was denied entry.  We're in a bit of a pickle granted, so any help would be greatly appreciated.   Cheers.


I am writing an IOS application in Swift (XCode 6) for iPhones and I need to get the telephone number assigned to the telephone running the app.  Searches have not found an answer. Any thoughts?

Is there any way to get own phone number by standard APIs from iPhone SDK?


I have an index of categories with three levels. The first level is compiled directly by PHP and the second and third level are loaded through ajax.  Adding onClick listeners to the first level works fine and I can load the second level. But I'm unable to add listeners to the second level to load the third level.   I have been able fetch the list of the second level after loading it and loop through the list items. At that point console.log(this) displays items like:
Antiek | Eetgerei
   console.log($(this).children('a')) does find a link:  [a#bucket1.cat-active, prevObject: r.fn.init[1]]   But then the following code doesn't display anything:  $(this).children('a').click(function () {     console.log('Link found!'); });   Any ideas why? (I imagine it's a tiny typo, but I simply don't see it. No errors are logged either.)

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


Is there a known mechanism to count the number of ways in which I can fill $k$ boxes of various sizes, $r_1,...,r_k$, with $n$ objects without counting permutations of objects within a box as a separate allocation.  e.g. Suppose $n=3$, $k=2$, $r_1=1$, and $r_2=2$. Then, there are 3 objects and 2 boxes. Box 1 can fit 1 object and box 2 can fit 2 objects. Also, if object 1 in box 1 and objects 2 and 3 in box 2 is an allocation that is counted, I would not like to additionally count object 1 in box 1 and objects 3 and 2 in box 2.  Any guidance would be greatly appreciated!

I have n objects and k boxes, each box has its own size.  The arrangement of objects in a box doesn't matter. How many combinations are there, respectively the formula?  Say we have 7 objects and 3 boxes with sizes of 2, 3 and 4. The solution is 6, the same result appears (it has to appear) when we place the gaps [(2+3+4)-7=2]  The multinomial coefficient only considers (I think so) the case when a box has to contain a specific number of objects, so the result is wrong:  $$ \frac{7!}{2!\cdot 3!\cdot 4!} = 17.5 \not= \frac{2!}{2!\cdot 3!\cdot 4!} = \frac{1}{144} $$ But what's the correct formula?


It where this guy is in a bar and there is a white monster next to him and they become friends or something like that and the song is a pop song

I am trying to identify a song, which I used to play all the time but forgot. It features the artist in a happy mood. I remember the following scenes from the music video:   Artist and the band playing in a street or on a bridge. Artist sitting in a pub/bar and having a drink with a hairy monster/bear. Mood of the song similar to  by .   I listened to this song couple of years ago (between 2013 - 2017). Forgot exact year. I also believe I heard this on a TV commercial first. Any clues?   I also remember the lyrics of this particular song had the word "epiphany".


I just can’t find anyway to do it I’ve already tired so many commands but they are all just old or outdated. If anyone could help me that would be great

In Java Edition, I can test for a dropped item on the floor by using NBT: /execute if entity @e[type=item,nbt={Item:{id:"minecraft:green_wool"}}]  But in Bedrock Edition, NBT is inaccessible from commands. Is there still a way to test for a dropped item on the ground? What about testing for a named item drop? This would allow you to run certain commands when a specific item is dropped, for example, if the player drops a compass they could be teleported to the spawn of your world, or have a message shown to them. See also:


I have a HTTP long polling endpoint that anyone can connect to for updates. The nature of the application requires the solution to be open, it cannot sit behind any form of authentication. The server accepts a maximum of 1000 connections, but currently there is nothing stoping one person from spamming all 1000 connections.   Is there any nginx configuration options that can be used to attempt to limit one connection per user?

I am investigating the vulnerability to  and I think I understand how and why this sort of attack works.  What I don't understand is why Lighttpd and NginX are not affected (according to the same article as linked above). What do they make so different?


I understand that using new String(..) will create a new object, where as literals will be stored in string pool and reused.  Is there any real time use case for this? When would I need to use new String(..)?  Why is the String.valueOf(char[]) or String.valueOf(byte[]) is designed to create new String object? Is there no way you can programmatically add the char[] to the string pool?

While looking at online code samples, I have sometimes come across an assignment of a String constant to a String object via the use of the new operator.  For example:  String s; ... s = new String("Hello World");   This, of course, compared to  s = "Hello World";   I'm not familiar with this syntax and have no idea what the purpose or effect would be.  Since String constants typically get stored in the constant pool and then in whatever representation the JVM has for dealing with String constants, would anything even be allocated on the heap?


Why are  and  called arithmetic and geometric respectively?

Where does the name of these two famous types of sequences come from?  The article  of Wikipedia says that the geometric sequence is called like this because every term is the geometric mean of its two adjacent terms. Though it is true, it only reduces the question to: why is the geometric mean geometric (in opposition to the arithmetic mean).   Continuing my investigation on , I was told that a square with the same area than a rectangle with sides $a$ and $b$ has their geometric mean $\sqrt{ab}$ for side. That's again totally true, but a square with same perimeter than this rectangle of sides $a$ and $b$ has their arithmetic mean $\frac{a+b}{2}$ for side!  Thus, my question: Who coined these names? And why? Why is the geometric mean more geometric than the arithmetic mean?


Find all continuous functions $f:\mathbb R\to\mathbb R$ such that $f(f(x))=e^{x}$  I didn't solve this problem, but I proved that f is increasing and $ x<f(x)<e^{x} $  please help

I was thinking, inspired by mathlinks, precisely from , if there exists a continuous real function $f:\mathbb R\to\mathbb R$ such that $$f(f(x))=e^x.$$ However I have not still been able to come up with an answer. I would like to share this problem with you.   I'm not aware of its level, though i wouldn't classify it as homework, so I'm not giving it the homework tag. If anybody feels that this problem is in reality easy or looks like an homework, please feel free to add that tag.    EDIT for those interested in the complex case, I've found this on MathOverflow. It's the first answer. Wow!


I dim a empty array of string, but how can I get whether the array is empty? I have tried below but get no idea.   Sub arrtest()   Dim myVar() As String   Debug.Print VarType(myVar)   '8200   Debug.Print TypeName(myVar)  'String()   Debug.Print IsEmpty(myVar)   'False   Debug.Print IsNull(myVar)    'False   Debug.Print LBound(myVar)    'Error   Debug.Print UBound(myVar)    'Error   Debug.Print myVar Is Nothing 'Error End Sub

Passing an undimensioned array to the VB6's Ubound function will cause an error, so I want to check if it has been dimensioned yet before attempting to check its upper bound.  How do I do this?


I am unable to understand the above cost function. The two possible outputs ($y$) are $-1$ and $+1$. As far as i know, $x_i$ values are individual training example values, $y_i$ are actual true values for that example and w is the weights that we are adjusting so as to minimise the cost. if the actual output is $1$ and and my SVM predicts it as $-1$ my classifier is penalised, how will my SVM penalise? how much will be the penalty? I know this function gives cost 0 for that training example when prediction is correct and some penalty if predicted wrong. I am also confused how $\max(0,1-y(wx+b))$ outputs the cost for one training example. please enlighten me how this cost function works.

I'm reading a book on data science and get confused about how the book describes the hinge loss of SVM. Here is a figure from the book on Page 94:    This figure shows the loss function of a NEGATIVE instance. It seems there is no penalty if the instance lies within the margin even on the positive side. Also on Page 95, the author explains:    However, from what I read about SVM, there should be penalty as long as the negative instance lies within the negative margin or on the wrong side. I updated the loss function as below with orange color:    Can someone tell me if I'm correct or not? Thanks!  Updates:  In , it says:     Correctly classified points lying outside the margin boundaries of the support vectors are not penalized, whereas points within the margin boundaries or on the wrong side of the hyperplane are penalized in a linear fashion compared to their distance from the correct boundary


I was creating a loop to send HTTP requests taking data from a txt file but in the variable I get a line break that I don't know how to remove:  import requests  file = open("uuids.txt", "r")  for uuid in file:     url = 'http://ip:port/api/assets/changeAssetTemplates/{}'.format(uuid)     headers = {         ...     }     print(url)     response = requests.request("GET", url, headers=headers)     print(response.text)   The first print paints this:  http://ip:port/api/assets/changeAssetTemplates/f4c71dd5-13af-428a-a3a5-4cbaf10d9bd3   A good URL. But the second print paints the error from the request:  {"timestamp":1563971402621,"status":404,"error":"Not Found","message":"No message available","path":"/api/assets/changeAssetTemplates/f4c71dd5-13af-428a-a3a5-4cbaf10d9bd3%0A"}   Where we can see that the data you get from the uuid variable is making a line break (%0A) and I would like to know how to avoid this problem.  By the way, an example of uuids.txt:  f4c71dd5-13af-428a-a3a5-4cbaf10d9bd3 1a71d6dc-a9b3-43fa-b675-747af9d7c202 2465ea64-3334-44b1-8f23-16e4df3aeea1 2fb98bba-d03d-495a-b5a2-9656bf623854 7a2aca40-dc5c-4aec-b700-7d0a91d39dd8 983ce44b-ab24-49bb-b128-8a30712dc2ca 2487e2ed-bff5-4195-ab5e-875210e634b0 965c62da-7c7a-4bf3-a0b8-de60d9b392dd 8b9bcf8c-0163-48cc-8603-3447ab7f29f6 0a7a5db9-67be-4a2a-af58-0189565caa2d

What is the Python equivalent of Perl's chomp function, which removes the last character of a string if it is a newline?


I have a hard disk formatted to NTFS partition type. I accidentaly wrote a ufs image (1 GB onto it). It has lots of important data . Can I recover the partition table and the data ? If yes, then how should I go about it ?     I have seen several questions regarding the same kind of problems which recommend test disk , but will test disk or some other application work in this case ?

I have a Toshiba satellite A-200 laptop with a Vista OS on it with 4 NTFS partitions  (C:) Vista  (D:) Entertainment  (E:) Work  (F:) Sources   and I wanted to start using Ubuntu instead. So I tried it first from the live CD and everything was OK and all the partitions were shown and working and so I decided to install Ubuntu to replace Vista on the (C:) drive. After I did that I can no longer find my folders and files on the (D:), (E:), (F:) partitions and the only file system that is shown is one 198 GB although my HDD is 320 GB.  I can't access the lost data on the remaining 120 GB which I hope is still there and not totally lost  I am now working from the live CD but I am unable to install testdisk. Can I recover the Vista partitions by the product recovery CD to get my laptop back to the factory settings? Can I recover the NTFS partitions using a recovery program for Windows or will that make the problem worse?   I need these data badly as I don't have a backup for them.


I created a CMS in PHP using PDO/MySQL. On each page in the CMS I have the HTML charset entered as UTF-8:  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">  I have a couple of <textfield> elements that the user can enter some descriptive text of the item into. This works well for strings that are typed out into the <textarea>, however the client has a tendency to copy and paste from another document, by the looks of it. Every so often I see a � on the page, however, in the database, it's actually a hyphen, or an apostrophe, etc.  I know that it's an encoding issue, but what I'm not sure of is where the problem is. If I'm setting the page charset as UTF-8, should the content not save as UTF-8?  If I change the charset to Latin-1 (ISO 8859-1) the symbol appears correctly. I was under the impression that UTF-8 had a broader character range than Latin-1, which kind of adds to the confusion.  Is there a work around for this in PHP? Can I force a field in MySQL to be a specific charset?  I have checked a few Questions and Answers on SSO without much luck. Most of the answers are "Make sure you're declaring your charset", which I am.

I'm setting up a new server and want to support UTF-8 fully in my web application. I have tried this in the past on existing servers and always seem to end up having to fall back to ISO-8859-1.  Where exactly do I need to set the encoding/charsets? I'm aware that I need to configure Apache, MySQL, and PHP to do this — is there some standard checklist I can follow, or perhaps troubleshoot where the mismatches occur?  This is for a new Linux server, running MySQL 5, PHP, 5 and Apache 2.


Does anyone know how to make reflective planes? I'm following the  and I can't figure out how to make a glossy plane. Can someone please help?

I'm creating a scene with large amounts of water that will be readily visible, containing refraction and at various angles. The scene is an indoor long-course swimming pool, about 50 meters, all of which would be seen by a camera above 5 meters above the water's surface. This is being fluid-sim'd, but there are no quickly-moving objects or people, so any water movement is slower and in bulk. The "remove bubbles" option is enabled.  I've tried using a Mix Shader of Refraction BSDF and Reflection BSDF with the factor coming from a Fresnel node, but the results appear either too glossy or too transparent and overly colored. How can I make the water appear realistic? Changes to shaders (refraction to glass)? Or is tweaking colors sufficient?


In Wikipedia Fermat's Principle is stated as:     A ray of light prefers the path such that there are other paths, arbitrarily nearby on either side, along which the ray would take almost exactly the same time to traverse.    So how does the principle for shortest time come from this statement? Is there any mathematical derivation or any assumption to make?

How is  proven? Or it is what usually is observed and is basis for the theories?


When ac current is passed through a wire, the electrons in the wire oscillate to and fro in the wire (due to change in polarity of current in the wire). If the ac current is of frequency, say 50Hz, then will the wire emit electromagnetic waves of the same frequency?

Does AC current in simple wires produce electromagnetic waves? AC current entails very rapid changes in polarity and therefore the electrons in the metal will feel rapidly changing forces which should make them accelerate before attaining a constant drift velocity. Will this rapidly changing accelerations produce any electromagnetic wave, since the acceleration should be sinusoidal if the voltage source is, and hence the emitted electromagnetic wave should also be sinusoidal? Am I correct? If yes, why do we not account for energy lossd through EM waves in simple AC circuit analysis?


Is there any easier (less no. of steps or calculations) proof for this using congruences: $89|2^{44}-1$. My proof: $$2^6\equiv-25\mod89$$ $$2^5\equiv32\mod89$$ Now square both equations: $$2^{12}\equiv625\equiv2\mod89$$ $$2^{10}\equiv-44\mod89$$ Now multiplying: $$2^{22}\equiv-88\equiv1\mod89$$ Since $2^{44}-1=(2^{22}+1)(2^{22}-1)$, it is proved.

As the title, I was asked to show that $2^{44}-1$ is divisible by $89$.  My first attempt is to change the expression into $(2^{22}-1)(2^{22}+1)$.  Then further simplified it into $(2^{11}-1)(2^{11}+1)(2^{22}+1)$, I used my calculator and was able to show that $2^{11}-1$ is divisible by $89$ but then I don't know how to show it with modular arithmetic. I do think that it is quite similar to the form where we can use the Fermat's little theorem. $(\sqrt{2})^{88}-1$. (Though I do understand Flt can only be applied to integer.)  Can someone tell me whether I can take square root in modular arithmetic as well? I am still pretty new to the modular arithmetic. Thank you very much.


In my paper I have many images and many floats and thus having issues to get everything well formated. One issue is that floats tend to end up at the end of the paper. How can I encourage LaTeX to split my text and to get my float at the top or bottom of the page, instead of moving the float to the document end?  The main reason I ask is not so much that I don't like the graphic to be at the end, but that I don't like the graphic to have a whole page for itself. Having its own page for itself is wasting precious space that I don't have. I need to get text on the same page, even if it is a little (and looks ugly). Every centimetre counts.  I wish I could give a MWE, but I don't know how to do it for a so document-specific case and without releasing my document. I hope someone is able to help me anyway.

How to influence the position of float environments like figure and table in LaTeX?   This is a general question and should collect useful answers for all users. I hope we can use this as a reference


I have used a spectrum analyzer with an antenna to see packets at 2.4 GHz being transmitted from my transceiver successfully. There was a mode in the spectrum analyzer which helps you to take a look at the power vs time plot too.  I would like to know if it is possible to do the same thing as above using a Tektronix TDS2024B Digital Storage Oscilloscope. As far as what I have understood about oscilloscope is that we need to use probes to connect it to the boards but how do I use it to detect these wireless packets?  Please excuse this naïve question.

I would like to know what will show up if I put bluetooth or wifi carrier signal (2.4GHz family) in a say 50MHz oscilloscope? Am I going to see something like a rectangular block? And the only information I will get is the amplitude?


Say I joined multiple objects together （instead of boolean）， the meshes are now overlaping each other. Instead of selecting the faces/verticies one by one， split them into objects and combine them back into one mesh with boolean modifier， is there a smarter way of achieving the same thing（delete concave/intersecring/overlaping faces inside）？

So in the image below there are two circles, how can I remove the internal vertices between them without messing up the outside shape. I'm working on a gun and this is just a simple way to illustrate the issue I'm dealing with. If I where to go in and delete the internal faces it would leave holes on the outside of the object, is there a fast way to get around this?


In C language I am trying to assign a value to pointer string. I cannot use char array, I have to use pointer string. So please tell how can I do that?  I am doing something like this (code given), but when I run my code an error is prompted program stopped working.  #include <stdio.h>   int main (void) {      char *myString = " ";     int value = 1;      myString[0] = value+'0';      printf("%s\n",myString);      return 0; }

The following code receives seg fault on line 2:  char *str = "string"; str[0] = 'z';  // could be also written as *str = 'z' printf("%s\n", str);   While this works perfectly well:  char str[] = "string"; str[0] = 'z'; printf("%s\n", str);   Tested with MSVC and GCC.


Is there a somewhat intuitive explanation as to why the exchange of a photon between two particles causes a force between those particles? Is there a difference in the way massless and massive particles act in this regard?

I hope this is the right word to use.  To me, these forces seem kind of fanciful (except for General Relativity and Gravity, which have a geometric interpretation).  For example, how do two charged particles know that they are to move apart from each other?  Do they communicate with each other somehow through some means?  I've heard some people tell me that they bounce together messenger photons.  So does one electron receive a messenger photon, go, "Oh hey, I should move in the direction opposite of where this came from, due to the data in it", and then move?  Aren't photons also associated with energy, as well?  Does this type of mediation imply that electrons give off energy in order to exert force on other electrons?  Every electron is repelled by every other electron in the universe, right?  How does it know where to send its force mediators?  Does it just know what direction to point it in?  Does it simply send it in all directions in a continuum?  Does that mean it's always giving off photons/energy?  I'm just not sure how to view "how" it is that electrons know they are to move away from each other.  These questions have always bugged me when studying forces.  I'm sure the Standard Model has something to shed some light on it.


My girlfriend is Swiss and has the ESTAVisa. We landed in the US over 3 months ago and were in NYC for just 4 days. Then, we have been in Canada for the past 3 months+. I just read that a visit to Canada doesn't count as "leaving the US".  She is not a resident of Canada, but we've been here for over 3 months so it's obviously not a border jump. Any ideas?

I'm on a New Zealand passport.  From most US Embassy webpages:     The Visa Waiver Program (VWP) enables nationals of certain countries,   including Australia, New Zealand, and the U.K., to travel to the   United States for tourism or business for stays of 90 days or less   without obtaining a visa, if certain requirements are met. Under the   VWP, time spent in Canada, Mexico, and adjacent islands counts towards   the maximum of 90 days stay allowed under the program.   I'll be there on a 1-year working holiday visa starting when I arrive in Vancouver. I'm spending 3 days in Hawaii en route to Vancouver. This seems to imply that 90 days after landing in Hawaii, my time will be up and I won't be able to get back into the US, as my living in Canada will not reset the clock. What if after this time I want to say, pop across the border to Seattle? How can I restart the 90 days, without having to resort to say, flying to Japan and back just to reset it?


I have a tfwx file and when I open it in arcmap it is displayed as 4 bands.  I would like to use the georeferenced file in qgis since I know nothing about arcmap.

I have georeferenced some images (ArcGIS -> Update Georeferencing) which creates a *.tfwx file with the new parameters for georeferencing.   I renamed it to *.tfw but QGIS is not able to read the georeferencing information.   Does anybody has any useful tips how to fix this?


Let $m$ and $n$ be infinite ordinal numbers  Which of the following is true  a) $m<n \Rightarrow |m|^{|m|}<n^{|n|}$  b) $m+n$= Max{$m,n$}  c) $m=n \Rightarrow |m|=|n|$  d)$|m|=|n| \Rightarrow m=n $  e)  Max{$m,n$} <$|m|+|n|$  I could only understand that d) is false due to the cardinality of the two different ordinals can be the same and c is true! Please help on the rest of the statements

Suppose $m, n$ are infinite ordinal numbers. $$a) m=n → |m|=|n|$$ $$b)|m|=|n| →m=n$$ $$c)m<n→ |m|<|n|$$ $$d)|\max{(m,n)}|< |m|+|n|$$ $$e)|m|<|n| →|m|^{|n|}<|n|^m$$  Which of the above statements are true? (a) looks true but I do not know the way to work it out. Please help


I want to compare the means of two independent variables, but my problem is the large difference in their sample sizes. One of my variables consists of 560 people and the other only has 29.  So can I use the t-test for independent samples in this case? If not, which test should I use?

There is a very confusing question in my mind. I have data, and would like to compare numeric scores between men and women.  There is a big difference in those two groups: the number of men is 34, while the number of women is 310, and variances are not equal.  As far as I know, when the variances are not equal, I can use the Welch–Satterthwaite equation (independent t-test assuming unequal variances). My question is: can I still use this equation although there is a really big difference in sample size between my two samples? Or is there a certain limit for the difference in sample size between two samples?


After upgrading my 13.04 vm to 13.10 when I run my 13.10 vm all I get is a black screen with flashing _. I can alt f1-f6 to get into tty1-6 and I ran apt-get update & upgrade but still no luck.. When I try to run gui apps from the tty1 it states that GtkWarning: could not open display.  And when I type unity the error says no DISPLAY variable set, setting it to :0 unity-panel-service: no process found  Can someone help me to get unity working again?  The link you gave me did not fix the problem and since this is virtual machine i dunno which video card it is using

I am trying to boot Ubuntu on my computer.  When I boot Ubuntu, it boots to a black screen.  How can I fix this? Table of Contents: