I asked a question about a programming problem and someone wrote a couple of comments, trying to help me find the source of the problem and even pointing out a problem with my code that was easy to fix (but that wasn't the problem I originally asked the question for).  Eventually that other person suggested a different way of doing what I was trying to do but I ended up fixing the problem within my original code myself. Afterwards I asked the other person to post his suggestion as an answer, which I already upvoted (because it works too) and I'm also going to post an answer explaning how to fix my original code with the solution I found.  Now I'm not sure what to do with those two answers: My answer fixes the code and solves the problem but the other guy's answer works too and he suggested the alternative way of doing it before I was able to fix the code myself.  Which answer do you accept in that case? The answer that came first or the answer that stays true to the original code?

What does it mean to accept an answer? How do I accept an answer, and what are the rules? Can I accept my own self-answer? What are the reputation benefits? Which answer should I accept? Should I upvote the accepted answer? What should I do if none of the answers are suitable?      For more information, see "" in the .


How can I prove that a sum of two integer squares, namely $ x^2 + y^2 $ (ranging  from $ x = 0 \to p, \; y = 0 \to p $) is a complete system of residues (CSR) modulo $ p $ (prime)? Or, how can I prove that $ x^2 + y^2 \equiv \left \{ 0, 1, 2, \cdots, p-1 \right \} \pmod p $, for some integers $ x,y $ and all prime values of $ p $?  I've failed to prove $  \left (0, 1, 4, 9, 16, \cdots \right ) $ is a CSR modulo $ p $ , and I feel that this is an important step to solve my question.   I've also tried showing that Lagrange's four-square theorem solves the question, but it obviously gets stuck when $ x^2 + y^2 \equiv z \pmod p $, and $ z $ cannot be expressed as a sum of squares.

I have heard somewhere that for all primes $p$, for all $k$, there exist $x, y$ s.t. $x^2 + y^2\equiv k \pmod{p}$? I recall that the proof is very elementary, but I can't remember such a proof. How would one prove this? One way is to use Cauchy-Davenport, but I don't think that this is the simplest solution.


I recently ran into two problems:   given a rand() function that generates 0 and 1 with 50% probability respectively (binary outcome), how to write some code to generate 1 with 90% of the chance and 0 with 10%? There is a society where people will NOT stop having babies until they have a boy. What's the ratio of boys and girls in that society? Consider it's equal probability to have either a boy or a girl.   If possible, please advise what kind of background prob/stats materials these relate to. Thanks!  UPDATE: Here are some thoughts on the two questions:  1.since rand() only generate 0 or 1, it's useless to write code like the following:   if (rand() < 0.1) {      return 0; } else {      return 1; }   I guess this involves Bernoulli trial and Binomial distribution, but the question asks for EXACT distribution for 90% of 1 and 10% of 0. I'm puzzled how to proceed.   2.I put it the wrong way - my bad.  My initial thoughts on this is as follows:  Suppose $\text{P}(B) = \text{P}(G) = 0.5$ B' = boys in the society    $$\text{P}(B') = \text{P}(B) + \text{P}(B|G) + \text{P}(B|G,G) + \text{P}(B|G,G,G) + ...$$   But I didn't see how to derive this equation into computable format.   UPDATE 2 (from @David Marx):   Problem 1  think of this as a binary number with 4 bits (n) - represents range [0, 15] with each equal probability of 1/16.  Now to get 1 with 90% probability, we can write something like this:  if (n < 9) {     return 1; } else if (n == 9) {     return 0; }   This way, Prob(n in range[0,9)) = 9/16; Prob(n = 9) = 1/16; So the returned value will be 1 at 90% of the time.    Problem 2   The reminding of Geometric Series is appreciated! The equation indeed matches my initial thoughts on the summation of conditional probabilities -- I failed to recognize it as geometric series.   So I guess the ratio should be the result for that summation:    $$\text{P}(B') = (1/2) + (1/2)^2 + (1/2)^3 + ...        = 1/(1-(1/2)) - 1       = 1. $$  So the ratio of boys in the society will be 100%? Anything wrong here?


I was watching a tutorial on texturing. There was shown a way to separate the glass part of the windows so you won't keep on clicking on them while you're texturing which I admit made things a lot easier.  Now I want to work on texturing my windows but I have no idea on how to select them. They aren't on a different layer. If there is a clip board option on here I haven't found it yet.

Let's say you have a single obj with a number of separate closed 3D geometries in it. For example's sake, imagine you have an obj called neighborhoodfirehydrants.obj that includes the model for all of the fire hydrants on a street, which themselves are closed, but as I said above, are all within the same obj file.  Now let's say you wanted to be able to process each of those fire hydrants one at a time, separately. To the user, it's very obvious to see visually that these faces can be subgrouped into separate "objects" but in the Blender world, it sees them all as one.  I'm looking for a way (script would be ideal) to iterate through a blender obj neighborhoodfirehydrants.obj and find each of the "objects" (fire hydrants) that make it up. I've been looking into using the looping tools, but that's not making sense in this context.


I am thinking if this practice would help the really good answers stand out even more and maybe people would be helped by this by having the high vote answers stand out.

I've noticed a psychological effect with my own voting, and am curious to know whether anyone else sees the same thing. Simply put, if I see a correct or good answer, I don't always upvote it, if the answer has some reasonable number of votes already. Similarly, if a post already has several downvotes, I usually don't bother downvoting further (some sort of "they've been punished enough" logic, I suppose).  I think this is because in my head I'm unconsciously thinking of the number of votes as a 'rating' or 'score' indicating the quality of the answer. I then find myself thinking "this answer is correct, and the best one here, but it's not that great, it's worth about 4 points." So I don't upvote. Although it's hard to disentangle from other variables like number of views or age, I suspect the same effect may be a feature on many of my own answers rated by others - the answer reaches some sort of natural level, as judged by the community... and then sits there, with only very minor subsequent increments.  Since becoming aware of this tendency in myself, I've been thinking more carefully about what the vote represents. There are clear problems with using the number of votes as a quality rating, the most obvious of which is that the scale isn't normalised in size, and is also function of time. But, irrational as it is, I still feel this bias against answers with votes (positive or negative)!  To summarise my question:   Has anyone else experienced this? Do you ever find yourself voting in this way, or should a good answer always receive an upvote? Is there a general consensus on what a vote represents?


I am a US citizen living in the US. Though I am a legal adult and financially independent, I sometimes travel internationally with my parents. Once we arrive at our destination, my parents demand that I turn over my passport and withhold it from me until it is time to return home. This is unsafe because they can stop me from leaving the destination country. Moreover, as a matter of principle, I don't want anyone else to have possession of my passport. (If I refuse to turn over my passport, they will steal it while I'm sleeping or showering, etc.)  Is it possible to legally obtain a second, fake passport to satisfy my parents that I have turned over my passport to them, while keeping my real passport in my possession?  If not, is it possible to obtain a second, real passport in a fully legal fashion? (This is my preference if possible.)

My USA Passport expires in April 2017 and I would like to renew but can't send my current passport due to imminent travel. Is it possible to keep you old passport while your new passport is being processed?  Can I apply at a passport facility?


What is the expected value of the longest run of heads or tails observed in $N$ flips of a fair coin?   I'd like to consider this for any $N$, small or large.

Is there a way to calculate on average, the maximum amount of times we can expect a coin to land heads during 1,000 flips?  So the answer (and formula if one exists) I am looking for would be something like: during 1,000 flips we can expect a maximum run of 12 heads in a row.


If I want to compare different cameras or lenses, what properties should the photos that I use have? And what should I do in order to get the most information?  I can think of the following, but probably it's just a subset:   Good lighting (how do I define that?) Proper exposition and manual settings; Same aperture and field of view (the focal length might differ) - is there a "scientific way to do this?"; Scene with good amount of details, colors and contrasts; Use of a tripod (?)   Also, what can I do if I want typical lens flaws (distortion, chromatic aberration) to pop out?

I have a range of cameras from a (frankly awful) kiddie camera to a hybrid (Olympus Pen) and I want to take some pictures to test their (comparative) limitations.  So I want to take the same photos with each camera, load them on to my computer, and be able to say: "This is clearly better than that" or "There's not a lot to choose between them" (so it's a rough comparison).  Also, in the absolute: "Never use the kiddie camera for photographs that ..." (to be honest, I suspect that that one could end after the fifth word).  Thus my question: What sort of photographs should I be taking for this experiment, and what sort of feature will each photograph test?  To add a sniff of motivation, I bought the kiddie camera for (surprisingly enough) one of my kids to get a bit of practice with taking photographs.  But it is absolutely awful and seems to only take reasonable pictures with lots of light and the subject an exact distance from the lens.  I recently picked up a (very) cheap compact with the intention of swapping it for the kiddie camera (with suitable admonitions that this one can't be dropped) but I'd like to test it myself before handing it over as replacing a rubbish camera with a rubbish camera won't get me those highly coveted Daddy Points.  So in this particular test, I want to compare those two with (maybe) the Olympus providing some sort of "gold" standard (I'm aware that by the standards of this site, the standard provided by the Olympus won't be quite gold, but then iron pyrites is underrated in my opinion).  But I'm also interested in the wider question of taking test shots myself to compare cameras to learn more about what each one is capable of (or rather, to learn what each one is capable of when I'm taking the photos - which is why I'm not interested in online comparisons of the cameras).


Meta Stack Exchange  contains  page, but Meta Stack Exchange doesn't have "First Posts" . Also in other site's First Posts review queue page, "Access earned at 500 reputation", but in Meta Stack Exchange it shows "Access earned at 2,000 reputation". I hope the "First Posts" review queue page is not required for Meta Stack Exchange.

On the Stack Overflow help center article about review queues, , it says on the bottom:  Note: These two queues do not exist on Meta sites.  But there are Late Answer and First Posts review queues on Meta Stack Overflow, as far as the  says. So shouldn't that last sentence be removed?


I installed fresh copy of ubunti 14.04 LTS and Ubuntu use my entire disk but i cannot connect to wifi i see enable wifi button is in grey color  rfkill list all   shows  phy0: Wireless LAN       Soft blocked : no       Hard blocked : yes   I tried  rfkill unblock all   but problem remain same  i also did  lspci -nnk | grep -iA2 net   Both Network Controller and Ethernet Controller uses kernel driver so i think it might not be a driver problem ?

Ubuntu 16.04 wifi not connecting  Wifi not connecting on Ubuntu 16.04. When I go to network settings to turn the wifi toggle on it immediately toggles back to off.   I've tried   $ sudo service network-manager restart   as well as multiple other suggestions but nothing seems to work ...  This is what I got when I typed   $ sudo lshw -C network   into the terminal...  description: Ethernet interface        product: RTL8101/2/6E PCI Express Fast/Gigabit Ethernet controller        vendor: Realtek Semiconductor Co., Ltd.        physical id: 0        bus info: pci@0000:07:00.0        logical name: enp7s0        version: 0a        serial: ec:b1:d7:df:8d:40        size: 100Mbit/s        capacity: 100Mbit/s        width: 64 bits        clock: 33MHz        capabilities: pm msi pciexpress msix bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd autonegotiation        configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=full firmware=rtl8107e-2_0.0.2 02/26/15 ip=10.50.18.72 latency=0 link=yes multicast=yes port=MII speed=100Mbit/s        resources: irq:48 ioport:3000(size=256) memory:c3104000-c3104fff memory:c3100000-c3103fff   *-network DISABLED        description: Wireless interface        product: Wireless 3160        vendor: Intel Corporation        physical id: 0        bus info: pci@0000:08:00.0        logical name: wlp8s0        version: 83        serial: 34:e6:ad:9b:9c:63        width: 64 bits        clock: 33MHz        capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless        configuration: broadcast=yes driver=iwlwifi driverversion=4.4.0-47-generic firmware=16.242414.0 latency=0 link=no multicast=yes wireless=IEEE 802.11abgn        resources: irq:52 memory:c3000000-c3001fff  I don't think the card is recognised with ifconfig   enp7s0    Link encap:Ethernet  HWaddr ec:b1:d7:df:8d:40             inet addr:10.50.18.72  Bcast:10.50.31.255  Mask:255.255.240.0           inet6 addr: fe80::18b2:f378:6027:7c2b/64 Scope:Link           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1           RX packets:15630 errors:0 dropped:0 overruns:0 frame:0           TX packets:7899 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:1000            RX bytes:6370690 (6.3 MB)  TX bytes:1605183 (1.6 MB)  lo        Link encap:Local Loopback             inet addr:127.0.0.1  Mask:255.0.0.0           inet6 addr: ::1/128 Scope:Host           UP LOOPBACK RUNNING  MTU:65536  Metric:1           RX packets:2709 errors:0 dropped:0 overruns:0 frame:0           TX packets:2709 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:1            RX bytes:217671 (217.6 KB)  TX bytes:217671 (217.6 KB)   but I think it's recognised in $ sudo lspci -vnn    08:00.0 Network controller [0280]: Intel Corporation Wireless 3160 [8086:08b3] (rev 83)     Subsystem: Intel Corporation Dual Band Wireless AC 3160 [8086:8070]     Flags: bus master, fast devsel, latency 0, IRQ 52     Memory at c3000000 (64-bit, non-prefetchable) [size=8K]     Capabilities: [c8] Power Management version 3     Capabilities: [d0] MSI: Enable+ Count=1/1 Maskable- 64bit+     Capabilities: [40] Express Endpoint, MSI 00     Capabilities: [100] Advanced Error Reporting     Capabilities: [140] Device Serial Number 34-e6-ad-ff-ff-9b-9c-63     Capabilities: [14c] Latency Tolerance Reporting     Capabilities: [154] Vendor Specific Information: ID=cafe Rev=1 Len=014      Kernel driver in use: iwlwifi     Kernel modules: iwlwifi  Edit: $ rfkill list prints   0: acer-wireless: Wireless LAN     Soft blocked: yes     Hard blocked: no 1: phy0: Wireless LAN     Soft blocked: no     Hard blocked: no 2: hci0: Bluetooth     Soft blocked: no     Hard blocked: no   I'd greatly appreciate any help, Thanks in advance.


The mirror modification is not mirroring along the x axis like i wanted, it is doing this:  Can sb please help me?

When I add a mirror modifier it sometimes doesn't mirror correctly, giving me an overlapping mesh. How can I fix this?


Is it okay to copy a game's formula? Formulas like damage formulas, taking the stats STR, DEX, INT, critical rate, etc. into account. Specifically I want to copy Ragnarok Online's damage . But I will probably remove some stuff from the formula to reduce the scope of my game.       Your question has been identified as a possible duplicate of another question.   I think game formulas and the like are different from game mechanics. Game mechanics is how the game is played.

Most games build on other games' successes and many are downright clones. Where is the limit of imitation before legal issues come into play? Is it down to literary or graphic work like characters and storyline that cause legal problems, or can someone actually claim to own gameplay mechanics?  There are so many similar clone games out there that the rules are probably very slack or nonexistent, but I'd like to hear the views of more experienced developers / designers.


For example if you got an x-ray mod if your friends don't have that mod will they be able to join in general to play lan in that world?

I'm wondering if I could play Minecraft with my friend. A modded Minecraft, only myself with mods and him without mods.  Is it possible?


I was wondering if there's any sort of package or something I could install in Ubuntu 13.10 to allow a graphical screensaver. I really do not like the blank black screen when the display turns off. I prefer abstract/colorful/exciting things over complete blackness. It reminds me of night which I think is bleak and boring. So any advice would be nice. Thanks

I want to change the default screen saver in Ubuntu 11.10/12.04. On 11.04 I just did a  sudo apt-get install xscreensaver-data-extra xscreensaver-screensaver-bsod    And then I could change it in the control center -> screen saver options.  Now there seems to be no other option to change the default screen saver.


$(X,\le)$ is totally ordered. How do you prove that if every non empty countable subset of $X$ is well ordered then $(X,\le)$ is well ordered?

Let $(X,⪯$) be totally ordered set, prove that if every non empty countable subset of $X$ is well ordered then X is well ordered.   It does seem obvious that any subset should have a minimum but I am not sure of how to prove it. Any help would be appreciated, and sorry I put up the same problem earlier but forgot to include the 'countable' subset.


I want to pass JavaScript variables to PHP using a hidden input in a form.  But I can't get the value of $_POST['hidden1'] into $salarieid. Is there something wrong?  Here is the code:  <script type="text/javascript">     // View what the user has chosen     function func_load3(name) {         var oForm = document.forms["myform"];         var oSelectBox = oForm.select3;         var iChoice = oSelectBox.selectedIndex;         //alert("You have chosen: " + oSelectBox.options[iChoice].text);         //document.write(oSelectBox.options[iChoice].text);         var sa = oSelectBox.options[iChoice].text;         document.getElementById("hidden1").value = sa;     } </script>  <form name="myform" action="<?php echo $_SERVER['$PHP_SELF']; ?>" method="POST">     <input type="hidden" name="hidden1" id="hidden1" /> </form>  <?php    $salarieid = $_POST['hidden1'];    $query = "select * from salarie where salarieid = ".$salarieid;    echo $query;    $result = mysql_query($query); ?>  <table>    Code for displaying the query result. </table>

What is the scope of variables in javascript? Do they have the same scope inside as opposed to outside a function? Or does it even matter? Also, where are the variables stored if they are defined globally?


I have a fairly recent iMac, but Blender says I have no supported GPU. Are there any libraries to hoo

Hello I just got the AMD Radeon RX Vega 56 (blackmagic eGPU Pro) yesterday  plugged it in to my brand new Mac mini (Mojave), it shows up in the menubar and as an alternative as a render engine,. My question is, can I use this eGPU for cycles renders? (Blender 2.80)  Very grateful for your responses.


I have searched the whole internet including reading everything on google/askubuntu/all ubuntu communities), tried all the possible solution and still didn't figure it out (but I am not google so my indexing and searching algorithm skills might not be that good)   anyways to the point. I am trying to run apt-get update and then apt-get upgrade.   I get the following error:  Reading package lists... Done Building dependency tree        Reading state information... Done You might want to run 'apt --fix-broken install' to correct these. The following packages have unmet dependencies:  libnvidia-ifr1-390 : Depends: libnvidia-gl-390 but it is not installed  libnvidia-ifr1-390:i386 : Depends: libnvidia-gl-390:i386 but it is not installed  nvidia-driver-390 : Depends: libnvidia-gl-390 (= 390.87-0ubuntu0~gpu18.04.1) but it is not installed                      Recommends: libnvidia-gl-390:i386 (= 390.87-0ubuntu0~gpu18.04.1) E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).   then i ran apt --fix-broken install .. and got these results  Reading package lists... Done Building dependency tree        Reading state information... Done Correcting dependencies... Done The following additional packages will be installed:   libnvidia-gl-390 libnvidia-gl-390:i386 The following NEW packages will be installed:   libnvidia-gl-390 libnvidia-gl-390:i386 0 upgraded, 2 newly installed, 0 to remove and 9 not upgraded. 4 not fully installed or removed. Need to get 0 B/29.1 MB of archives. After this operation, 147 MB of additional disk space will be used. Do you want to continue? [Y/n] y (Reading database ... 298882 files and directories currently installed.) Preparing to unpack .../libnvidia-gl-390_390.87-0ubuntu0~gpu18.04.1_i386.deb ... diversion of /usr/lib/i386-linux-gnu/libGL.so.1 to /usr/lib/i386-linux-gnu/libGL.so.1.distrib by nvidia-340 dpkg-divert: error: mismatch on package   when removing 'diversion of /usr/lib/i386-linux-gnu/libGL.so.1 by libnvidia-gl-390'   found 'diversion of /usr/lib/i386-linux-gnu/libGL.so.1 to /usr/lib/i386-linux-gnu/libGL.so.1.distrib by nvidia-340' dpkg: error processing archive /var/cache/apt/archives/libnvidia-gl-390_390.87-0ubuntu0~gpu18.04.1_i386.deb (--unpack):  new libnvidia-gl-390:i386 package pre-installation script subprocess returned error exit status 2 Preparing to unpack .../libnvidia-gl-390_390.87-0ubuntu0~gpu18.04.1_amd64.deb ... diversion of /usr/lib/x86_64-linux-gnu/libGL.so.1 to /usr/lib/x86_64-linux-gnu/libGL.so.1.distrib by nvidia-340 dpkg-divert: error: mismatch on package   when removing 'diversion of /usr/lib/x86_64-linux-gnu/libGL.so.1 by libnvidia-gl-390'   found 'diversion of /usr/lib/x86_64-linux-gnu/libGL.so.1 to /usr/lib/x86_64-linux-gnu/libGL.so.1.distrib by nvidia-340' dpkg: error processing archive /var/cache/apt/archives/libnvidia-gl-390_390.87-0ubuntu0~gpu18.04.1_amd64.deb (--unpack):  new libnvidia-gl-390:amd64 package pre-installation script subprocess returned error exit status 2 Errors were encountered while processing:  /var/cache/apt/archives/libnvidia-gl-390_390.87-0ubuntu0~gpu18.04.1_i386.deb  /var/cache/apt/archives/libnvidia-gl-390_390.87-0ubuntu0~gpu18.04.1_amd64.deb E: Sub-process /usr/bin/dpkg returned an error code (1)   i tried all the tricks like apt clean/remove/dist upgrade/whatever apt i found on the net without luck.  any help is really appricated.

all. I'm trying to fix my system so I can install the nvidia drivers but it seems to get stuck for some reason. I have tried manually removing the downloaded files from   /var/cache/apt/archives/libnvidia-gl-390_390.48-0ubuntu3_i386.deb /var/cache/apt/archives/libnvidia-gl-390_390.48-0ubuntu3_amd64.deb   ... in order to let them download again but to no avail. Have anyone tried installing those drivers on 18.04 lately?  ~$ sudo apt --fix-broken install [sudo] password for jarl:  Reading package lists... Done Building dependency tree        Reading state information... Done Correcting dependencies... Done The following packages were automatically installed and are no longer required:   lib32gcc1 libc6-i386 Use 'sudo apt autoremove' to remove them. The following additional packages will be installed:   libnvidia-gl-390 libnvidia-gl-390:i386 The following NEW packages will be installed   libnvidia-gl-390 libnvidia-gl-390:i386 0 to upgrade, 2 to newly install, 0 to remove and 4 not to upgrade. 3 not fully installed or removed. Need to get 0 B/29,1 MB of archives. After this operation, 147 MB of additional disk space will be used. Do you want to continue? [Y/n] y (Reading database ... 214344 files and directories currently installed.) Preparing to unpack .../libnvidia-gl-390_390.48-0ubuntu3_i386.deb ... diversion of /usr/lib/i386-linux-gnu/libGL.so.1 to /usr/lib/i386-linux-gnu/libGL.so.1.distrib by nvidia-340 dpkg-divert: error: mismatch on package   when removing 'diversion of /usr/lib/i386-linux-gnu/libGL.so.1 by libnvidia-gl-390'   found 'diversion of /usr/lib/i386-linux-gnu/libGL.so.1 to /usr/lib/i386-linux-gnu/libGL.so.1.distrib by nvidia-340' dpkg: error processing archive /var/cache/apt/archives/libnvidia-gl-390_390.48-0ubuntu3_i386.deb (--unpack):  new libnvidia-gl-390:i386 package pre-installation script subprocess returned error exit status 2 Preparing to unpack .../libnvidia-gl-390_390.48-0ubuntu3_amd64.deb ... diversion of /usr/lib/x86_64-linux-gnu/libGL.so.1 to /usr/lib/x86_64-linux-gnu/libGL.so.1.distrib by nvidia-340 dpkg-divert: error: mismatch on package   when removing 'diversion of /usr/lib/x86_64-linux-gnu/libGL.so.1 by libnvidia-gl-390'   found 'diversion of /usr/lib/x86_64-linux-gnu/libGL.so.1 to /usr/lib/x86_64-linux-gnu/libGL.so.1.distrib by nvidia-340' dpkg: error processing archive /var/cache/apt/archives/libnvidia-gl-390_390.48-0ubuntu3_amd64.deb (--unpack):  new libnvidia-gl-390:amd64 package pre-installation script subprocess returned error exit status 2 Errors were encountered while processing:  /var/cache/apt/archives/libnvidia-gl-390_390.48-0ubuntu3_i386.deb  /var/cache/apt/archives/libnvidia-gl-390_390.48-0ubuntu3_amd64.deb E: Sub-process /usr/bin/dpkg returned an error code (1)


I've generated an ssh key pair with ssh-keygen. The id_rsa.pub file looks like this:  ssh-rsa someLettersAndNumbersABC123 username@host   The host part is what bothers me. Currently it comes from the router. But I want to use that key no matter where I am, whatever the hostname some router gives me. Is it save to simply remove everything after my username? Would that even work?  Once I disabled plain password authentication I wouldn't be able to add another key (or connect at all), if the key depends on the hostname of the client.

In a public key file "id_rsa.pub" generated by ssh-keygen, does the part after the == matter?  I ask because when I changed "root@somedomain.com" to "root", it seems to still work.  More generally, I am curious about what the purpose of that half is.


Hello I have been playing CS:GO all week and only gotten 1 case and 1 camo drop. I am on reduced earned xp for whatever reason if that matters. Have I reached my limit for this week or is there even a weekly limit?

Just curious as to how to obtain item drops from the last update.  To clarify, item drops as in weapon skins, crates, anything else Valve added without letting us know, etc.  It seems that after playing a bit, I've gotten no drops, but I've seen players who've gotten drops after a few short minutes of gameplay, but I've been playing for hours.  Is the item drop system like TF2, where you can just idle, get an item drop, come back? Is it like Dota2, where you have to be in the matchmaking system and complete matches for the chance to get drops? Or do you have to be MvP to get item drops? Is it a certain time you play the game?   Also, are weapon and crate drops independent or dependent on each other? Meaning, is the drop counter shared between Weapons and Crates, or are they both separate drop counters?


Hello I have a question about possible equivalence relations.  I know that a relation can be Reflexive, Symmetric , Transitive.  But my question is, is there any strict limitations one has on the other.  For example if we had a relation then there are eight possible combinations of the above, for example we could have R S T and not R , S, T, or Not R, Not S, T, for example.  To me they all seem possible except for a relation that is not reflexive but symmetric and transitive.  Any insight?

An equivalence relation is defined by three properties: reflexivity, symmetry and transitivity.  Doesn't symmetry and transitivity implies reflexivity? Consider the following argument.  For any $a$ and $b$, $a R b$ implies $b R a$ by symmetry. Using transitivity, we have $a R a$.  Source: Exercise 8.46, P195 of Mathematical Proofs, 2nd (not 3rd) ed. by Chartrand et al


I came across such limit $$\lim_{n \to \infty} \frac{1}{n} \sum_{k=1}^n \frac{k}{k^2 + 1}$$ and don't know how to find it. A factor $\frac{1}{n}$ before the sum hints that the limit should be considered as the limit of integral sums but unfortunately I can't select smth like $f(x_k)(x_{k+1} - x_k)$.  Could you please help me to solve it? I would be grateful for any hints. Thanks a lot in advance.

Could please give me a hint.  $$\lim_{n\rightarrow\infty}\frac{1}{n}\sum_{k=1}^{n}\frac{k}{k^{2}+1}$$  It looks like an integral, but I failed to figure out the function.


How can I prove this by using contradiction?  Given the premises, assume that there does exists an integer $b$ such that $ab \equiv 1 \pmod m.$  Then, let $k = \frac{ab - 1}{m},$ where $k \in \mathbb Z$.  So, $$ab = km + 1, b = \frac{km+1}{a} = \frac{km}a + \frac 1a.$$   Then I try to prove $km/a$ is an integer since I know $1/a$ is not.

Isn't finding the inverse of $a$, that is, $a'$ in $aa'\equiv1\pmod{m}$ equivalent to solving the diophantine equation $aa'-mb=1$, where the unknowns are $a'$ and $b$? I have seem some answers on this site (where the extended Euclidean Algorithm is mentioned mainly) as well as looked up some books but there is no mention of this. Am I going wrong somewhere or is this a correct method of finding modular inverses? Also can't we find the Bézout's coefficients by solving the corresponding diophantine equation instead of using the extended Euclidean Algorithm?


How can I type a backtick (`) or tilde (~) using my Italian keyboard on Windows 8?  Right now, I'm using ALT+96.  Are there any other key combinations?

Here is what the layout of an Italian keyboard looks like:  As you can see, the curly braces, which are absolutely necessary to write code in any of C, C++, JavaScript, Java, Objective-C, and others, appear in purple in this picture. This is because while the other characters can be seen visually as printed characters on most Italian keyboards, these purple characters are actually usually not printed on the keyboard's keys. These characters, found in the upper right corners of the given keys, can usually be generated with the following key combinations: (RIGHT SHIFT or LEFT SHIFT) + (RIGHT CTRL or LEFT CTRL) + (Alt or AltGR) + ([ or ]) (Actually as the MSKLC application shows, SHIFT + AltGr + [ and SHIFT + AltGr + ] are enough to generate the curly braces.) Characters such as the at (@) sign (called 'chiocciola' in Italian) and the hash (#) key (called 'cancelletto' in Italian) found in the lower right hand corner of the keyboard can be generated easily as follows (AltGr + @) or (AltGr + #). Such characters are also fundamental to programming as they can, for instance, be found in CSS, namely with media queries and with selectors referring to the id html attribute. Upon further inspection, we can see that all of the US ASCII keyboard / programmer's keyboard are covered by the keys of the Italian keyboard, except for the following, which are the tilde, which is especially useful on the Linux command line and is used to refer to a user's home directory on such system, as well as the back-tick (`), also known as the back-quote, which is also very useful on the Linux shell when we want to turn the output of a command into a command-line input. So, here comes the question: With all those empty upper-right hand corners of keys, why isn't there a better way of generating these characters, perhaps through a CTRL-ALT-SHIFT modifier key combination? All I've been able to find regarding generation of these characters are the following ALT-codes:  ALT code 96  corresponds to ` ALT code 123 corresponds to { ALT code 125 corresponds to } ALT code 126 corresponds to ~  and to generate a character via an ALT code, you make sure that the NumLock key on your keypad is toggled on, hold down the ALT key, enter the keycode, and release the ALT key. ALT code are documented at:  If someone knows of a better way of inserting these characters from an Italian keyboard without switching the keyboard layout in the Control Panel, then please let me know. Thanks.


The default behaviour for the \begin{enumerate}tag is to sequentially list the items given by \item over the numbers {1, 2, 3, 4, ...}.    Is it possible to change this to the alphabet {a, b, c, d, ...} How about Roman Numerals {i, ii, iii, iv, v, vi, ... } How is this done?   Note that I use emacs 24.3. Thanks for all the help.

I've seen documentation whereby an \alph command is put around the \begin{enumerate} somewhere, but I'm not entirely sure how that operates...


In my site I have two different roles for users named recruiter and candidate. when they register their account they can choose their role (recruiter or candidate). And when they login my site I will check user is recruiter or candidate. after this check I will show them a different page (recruiter page and candidate page).  How to proceed with this?

By default after a new user signs up, a redirect to the home page happens.  But in such case I want to redirect such user to another page like node/35.  In this node/35 I then want to display some content.


So I tried to install Ubuntu on my Dell laptop and I wanted to create a separate partition. I took away some free space from another partition already created. The space was listed as unusable, so I reallocated all of it in the previous partition which I took from. Then I tried to boot into Windows to transfer my data from a partition so I can format it to install Ubuntu. The funny thing is, it won't boot. It keeps on loading, nothing happens. After a force shut down, it entered the repairing tool and I got an error, which said that I can shut down or I can go into advanced settings and the following text:  logfile\\?\GLOBALROOT\Device\HarddiskVolume2\Windows\System32\Logfiles\Srt\SrtTrail.txt   So I searched a bit through the common problems and I found some solved through cmd. I typed these:  bootrec.exe /rebuildbcd bootrec.exe /fixmbr bootrec.exe /fixboot   Still can't boot. Then I typed these in diskpart:  select disk 0 select partition 1 active extend filesystem   Then again the 3 other bootrec commands listed above. Didn't work either. So I found another solution and typed:   bootrec rebuildbcd  rem didn't find any windows installations, not here, not above bcdedit /export c:\bcdbackup attrib c:\boot\bcd -h -r -s ren c:\boot\bcd bcd.old bootrec /rebuildbcd rem found 2 windows installations, pressed Y for both   Now it tells me that the operating system has failed to start multiple times and I need to reinstall the it with an installation media, which I currently don't have, alongside this error: 0xc0000001. Tried to boot into Safe Mode. Same thing, it keeps on loading and nothing happens. I have Windows 10 and Windows 7 installed, so I can easily boot into Windows 7, if needed. There are also 3 partitions, only 2 of them visible in 7.   The main problem would be that I can't boot into Windows 10. What can I do?

I installed Windows on my computer, followed by an installation of Ubuntu. However, now I'm unable to boot into my Windows install.  What can I do to fix this?


I have a few java classes that do a simple data base test. I have all of the java files in a folder called "MorphiaTest". I also have all of the jars they depend on in that exact same folder. I want to compile this little application so I can move it around and run it. I'm running ubuntu and trying to do this all from the command line so I can SCP my compiled app onto a server. In this one folder is QueryTest.java and Record.java as well as the requisite Mongo-java-driver.jar and morphia-1.3.2.jar. All I want to do is compile these and run "java QueryTest" from the command line and have my program run. This is how I'm compiling javac -cp ":mongo-java-driver-3.8.2.jar:morphia-1.3.2.jar" QueryTest.java Record.java   All fine and dandy this compiles fine. But when I go to run "java QueryTest" I get this: Error: Unable to initialize main class QueryTest Caused by: java.lang.NoClassDefFoundError: org/mongodb/morphia/Datastore  What am I doing wrong?

I am getting a NoClassDefFoundError when I run my Java application.  What is typically the cause of this?


How can I delete a folder with whitespace in its name, but without quoting the folder name? I also need to be prompted to confirm the deletion.  I know how to do it like this: rm -ri /home/user/'my folder'  But how can I do this without quotes? Is there another way?

So I finally got my Ubuntu box up and running, ran the LAMP install, and successfully loaded up the apache2 webserver, and php5.  The one thing I didn't want is for Ubuntu during the installation to take one whole 1TB drive that contained a ton of stuff, but it was a backup drive so no biggie.  But now I was transferring pics to the /var/www location and it copied a directory that contains spaces. Terminal seems to hang when I use the rm command, any ideas would be appreciated, thanks guys.


I currently have Kali Linux OS installed on my machine normally (not as a virtual machine). I'll soon also install Windows 7.  I'd like to know if there is a way to convert my Kali Linux OS (with all it's memory) to be a virtual machine on VMWare on the soon-to-be-installed Windows 7?  The important thing is to keep all of the Linux OS memory (so that the VMWare machine will also have it).

A while ago I turned my PC into dual boot with Windows and Ubuntu. But my experience is, that I rarely boot into Ubuntu, so I wanted to make it available as virtual machine in Windows rather than as a second OS. Can you provide me some information which is the tool of my choice and how I can achieve this migration? I already have VMWare Player installed.


Working in Sublime Text in a Latex Document, i wondered. Is there any way to compile my document look on the right side of my screen? Like Texstudio.

I recently (2 days back) started using LaTeX, I use Sublime Text 2 (ST2) for most of the programming. I found that ST2 has LaTeX package. So what I am doing is write the document with ST2 and run it with TeXWorks to see any errors/debugging. Is there a way I can run/debug the tex file directly from ST2? Is there any better practice than what I am doing currently?


The following image shows Guillotine that is a device designed for carrying out executions by decapitation.     Intuitively, slicing with pushing is less effective than slicing with pushing and sliding. When slicing, the contact area varies, which in turns make the pressure varies even though the force is kept unchanged.  Shortly speaking, what is the effect of slanted blade? Does it cut faster?  Bonus question: Is slicing with pushing is less effective than slicing with pushing and sliding? What makes the difference?

What is the point of having 45 degreed blade in Guillotine? After all, the pressure-Force over Area-blade imposes to the neck is the same either way.


how to get access to all Arabic / Hebrew language features in the last updated Adobe products 2014.1 specially Illustrator.

Arabic text doesn't show properly in Adobe Illustrator. Even with a font that supports Arabic text (e.g. Arial), the text is back to front (left to right, not right to left) and the letters don't join up properly. To an Arabic speaker, it's gibberish.  I know that there is an Illustrator version for the Middle East but... really, no chance am I buying that just to get a few words into a vector graphic.  I've also seen refs for  (Winsoft) however it's 100 Euros and I work on CS6 now which isn't supported anyway.  I can't believe that after 16 major versions of Adobe Illustrator there is no way to copy & paste a bit of Arabic into it somehow?  Can anyone think of an alternative? Free one if poss, it's a tiny job with 9 words in total.  Thanks very much


I updated my Latex files (I am using MacTex2015 distribution) and since than I am getting a strange undefined control sequence error. Bibliographical entries that have "de" in the author name don't work unless I change it to "De" which is wrong.  Here is my MWE:  \documentclass[a4paper,11pt]{scrartcl} \usepackage[latin1]{inputenc} \usepackage{blindtext} \usepackage{hyperref} \usepackage{csquotes} \usepackage{filecontents} \begin{filecontents}{\jobname.bib}  @book{devogel1967,     Address = {Leiden},     Author = {Cornelia Johanna de Vogel},     Call-Number = {TH: Ps 2.276},     Date-Added = {2014-07-20 14:47:36 +0000},     Date-Modified = {2014-08-17 10:23:51 +0000},     Keywords = {secondary},     Number = {3. The Helenistic-Roman Period},     Publisher = {Brill Archive},     Title = {Greek Philosophy},     Year = {1967}} \end{filecontents} \usepackage[ngerman]{babel} \usepackage[style=historische-zeitschrift, maxnames=2, hyperref=true, backref=true, backrefstyle=none, backend=bibtex,idemtracker=true]{biblatex} \bibliography{\jobname} % \begin{document} \blindtext\footcite{devogel1967} \pagebreak \printbibliography \end{document}   Can someone help with this? Thank you!

Firstly, hello everyone. I am new here : )  I am writing my phd thesis using MikTeX + TeXnicCenter and everything goes well, until I have updated MikTeX today.  My Problem:  The program gives an error message to the "same old" command:  \printbibliography[prefixnumbers={},notkeyword={Eigene}, notkeyword={Datenblatt}, title={Fremdliteratur}, heading=subbibliography]   The error message looks like this:  Undefined control sequence. <argument> ...nameprefix {van~der}\isdot }\ifprefchar    Investigation  I have found out that this error comes from the name prefix "van der". If I write them together without space in *.bib file and compile it, it works again.  What's the best way to fix this or work around it? Is it a bug?


Let $A$ be a subset of $\mathbb{R}^n$, and let $B$ be a subset of $\mathbb{R}^m$. Note that the Cartesian product $\{(a, b) : a \in A, b\in B\}$ is then a subset of $\mathbb{R}^{n+m}$. Show that $m^{*}_{n+m} (A \times B) \le m^{*}_n(A)m^{*}_m(B)$.   $m^*_n$ denotes an n-dimensional outer measure.   The definition of an outer measure is that $m^*_{n+m}(A \times B) = \inf \{\sum_{j \in J} \text{vol}(C_j) : A \times B \subseteq \bigcup_{j \in J} C_j\}$ and similarly $m^{*}_n =  \inf \{\sum_{i \in I} \text{vol}(A_i) : A  \subseteq \bigcup_{i \in I} A_i\}$ and $m^{*}_m(B) = \inf \{\sum_{k \in K} \text{vol}(B_k) : B  \subseteq \bigcup_{k \in K} B_k\}$.   I can also observe that the Cartesian product of a cover of $A$ and a cover of $B$ covers $A \times B$, but I am not sure how to proceed from here. I appreciate if you give some help.

If  $A\subseteq R^n$ and $B\subseteq R^m$, such that $A \times B\subseteq R^{n+m}$ Prove that  $μ^{*}_{n+m}(A\times B)\leq μ^*_n(A)μ^*_m(B)$, where $μ^*_q$ is the outer measure of  $ \mathbb{R}^q $.  My attempt $A⊆⋃_iA_i,B⊆⋃_jB_j $, and since  $A \times B \subseteq ⋃_{i,j}A_iB_j$ I have the inequality (because of the outer measure monotocity) that states   $m^*_{n+m}(A \times B) \leq m^*_{n+m}(⋃_{i,j}A_iB_j)  $ But I don't think that is going to take me somewhere.  Thanks!


Actually am testing the functionality of Scanner.  I have a very simple program which has a String variable which contains "abc".Then am  reading other String(value "abc") from Scanner using next() method(even i tried with nextLine()). Then am comparing using the ==, to check whether they are equal according to ==(i know i can compare with equals method which is  working as excepted), the strange thing is that it is returning false when i compare using == , even though their hashcode() s are equal and equals() method returning true..  import java.util.Scanner;  public class Tester1234 {      public static void main(String[] args) {          Scanner scanner=new Scanner(System.in);         String str1="abc";         System.out.println("Eneter abc");             String str2=scanner.next();          System.out.println("str1.hascode()"+str1.hashCode()+"\tstr2.hascode()"+str2.hashCode()+"\tstr2.equals(str1)"+str1.equals(str2));         if(str1==str2)         {             System.out.println("equal");         }         else         {             System.out.println("not equal");         }      } }   I want to know why it is behaving like this ??  Thanks...!

I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug.  Is == bad? When should it and should it not be used? What's the difference?


Back before I knew what I was doing, I installed my Arch system with a 10 GB root and an 85 GB /home partition. Now my 10 GB root (where my pacman installs to) is full and I'm unable to get gparted running on my computer (it's a mac) to resize because my CD-ROM drive isn't working.  Is there an easy way to set my system up so that pacman installs and runs from my home partition where there is plenty of room?

My /root is full to the brim and I can't install new packages. My /home has 8 times the space of my /root, but pacman is set to install new packages on /root. Is there a safe way that I can change where pacman permanently installs new packages?


I want to send an async HTTP request from the HTML, parse a response, and update an HTML page respectively. Is there a way to do it without using AJAX or any other third-party library?  I'd like to find the most basic way to do this. Since libraries can do it, it should be possible without them too.  Worth saying, that I'm a mobile developer who checks web development for a couple of days.  UPDATE 1  I didn't have to call AJAX a "third-party library". My bad.  UPDATE 2  Thanks everybody who responded. What I've learned: the only way to do what I wanted is AJAX, in particular, XMLHttpRequest.

I need to do an  request in JavaScript. What's the best way to do that?  I need to do this in a Mac OS X dashcode widget.


Basically the title. If a Warlock fights by wielding their Book of Shadow or Genie Vessel in one hand as a spell focus and keeps the other one empty to meet the requirement of somatic component, they will eventually end up in situations where they are forced to use the book or vessel as an improvised weapon (like when an enemy closed the distance or when the Warlock needs to perform an Opportunity Attack). So the question is, would hitting someone with the spine of the book of shadow or their oil lamp of a Genie Vessel be considered using an improvised weapon with magical properties? For the Vessel, It is a tiny object, but not specifically written as "a magical tiny object" even if the previous sentence mention that the patron has imbued magical powers with it. The Warlock can do lots of wacky stuff with it like sleeping in it or dragging others into it to rest, but it almost seems like its the power of the Class Feature using the item in question as the medium in which the feature's power (and thus your Patron's power) is expressed, and not the power of the Item proper.  Genie's Vessel ; 1st-level Genie feature ; Your patron gifts you a magical vessel that grants you a measure of the genie's power. The vessel is a Tiny object, and you can use it as a spellcasting focus for your warlock spells. You decide what the object is, or you can determine what it is randomly by rolling on the Genie's Vessel table.  The book of shadow is even more vague; it is only stated to be a grimoire, and nothing else about it's materalistic properties are mentioned or explained further other than that if its lost or destroyed you can resummon it. How durable is it, anyway? This also opens some icky boxes like "Would anti-magic fields suppress their magical properties or destroy them outright?" and something like "If the Genie's Vessel is indeed a magic item and using it as an improvised weapon can pierce resistance, the Genie Warlock has access to a magical weapon that is basically the equivalent of a +0 but magical dagger at LV1" etc. I am aware that some similar questions have been asked, like "Does attacking with an improvised weapon using a magic item count as a magical attack?" and "Are punches with Gauntlets of Ogre Strength magical, improvised weapon attacks?"; but the main issue here is that both the book of shadow and the vessel's status as a separate magical item seems to be a bit unclear. They look very much like tag-alongs to complete a feature's ... uh... feautre. PS: Before someone says that using it as an improvised weapon is a poor choice of tactics, keep in mind that Genie Warlocks gain extra damage from the "Genie's Wrath" Feature equal to their proficiency bonus. Compared to wielding a regular dagger with the damage of 1d4 + dex + pb, using the Genie's Vessel as an improvised weapon of 1d4 + str + pb isn't that bad; and depending on how the DM would rule it could be counted as magical and be able to pierce resistances.

This question was triggered by .  Basically, it goes like this: If you have a weapon with a certain magical effect, let's say the minor property unbreakable (can not be broken, requires special means) or temperate (no harm in temperatures between -20 to 120 F), it can bypass the immunity of something like a Werewolf because it is magical instead of mundane. This goes for any minor property because those properties are under the Magic Items portion of the DMG on pg.143.  How does this differ from a pair of gauntlets with the exact same effect being used as an improvised weapon (emphasis added for clarity) from dealing damage in the same manner to the same Werewolf? Or something that's clearly not a weapon like a Shield of Missile Snaring being used to bash an opponent?


After installing node.js I execute this command:  sudo apt-get install npm   And getting error:  The following packages have unmet dependencies:   npm : Depends: node-gyp (>= 0.10.9) but it is not going to be installed E: Unable to correct problems, you have held broken packages.     $ sudo apt-get upgrade -f npm node-gyp Reading package lists... Done Building dependency tree Reading state information... Done Calculating upgrade... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies:   nodejs-dev : Depends: libssl-dev (>= 1.0.0g) but it is not going to be installed E: Broken packages

I'm trying to install nodejs and npm, however, it fails. This is my terminal:  sudo apt-get install nodejs npm Reading package lists... Done Building dependency tree Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation:  The following packages have unmet dependencies: nodejs : Conflicts: npm E: Unable to correct problems, you have held broken packages.   What to do? I'm kinda lost :(


Title, pretty much. I currently have LibreOffice 4.2.8.2 on Ubuntu 14.04. I'm just wondering what the easiest way to upgrade to the new LibreOffice 5 is, without creating duplicate applications or screwing everything up. Can anyone give me a quick method? Thanks in advance!

LibreOffice is seeing some dramatic improvements each version and subversion that goes out.   I would like to have always the latest version of LibreOffice on my machine(s). I know of the PPA that exists but is it recommended to use it with 12.04 for daily use? What are the pro and cons of using the PPA? Will it break my system/Libreoffice installation?  Does libreoffice get eventually also upgraded in the Ubuntu repositories or does this upgrade happen only with new releases? Who manages the upgrades of libreoffice in Ubuntu and in the PPA?


I want to show that: for $a,b \in \mathbb R$ with $a<b, \exists x \in (a , b)$ such that $x \notin \mathbb Q$ . I start with $0< \frac 1{\sqrt 2} < 1 \Rightarrow 0< \frac{ b-a}{\sqrt 2} < b-a \Rightarrow a < \frac{b-a}{\sqrt 2} +a < b$ . I know I am close to completing the proof but I do not know how to prove that the number $\frac{b-a}{\sqrt 2} +a \notin \mathbb Q$ Any help would be great!

I'm trying to prove that there is an irrational number between any two unequal rational numbers $a, b$. Here's a "proof" I have right now, but I'm not sure if it works.  Let $a, b$ be two unequal rational numbers and, WLOG, let $a < b$. Suppose to the contrary that there was an interval $[a, b]$, with $a, b$ rational, which contained no irrational numbers. That would imply that the interval contained only rational numbers since the reals are composed of rationals and irrational numbers. Furthermore, this interval has measure $b-a$, a contradiction since this is a subset of $\mathbb{Q}$ which has measure zero.  Does this work? Is there an easier way to go about it, perhaps through a construction?  Construction: Let $a = \frac{m}{n}$, $b = \frac{p}{q}$. WLOG $a>b$. Then $a-b = \frac{m}{n}-\frac{p}{q} = \frac{mq-np}{nq}$. Since $mq - np > 1$, we can construct an irrational number $a + \frac{1}{nq\sqrt2}$ which is between $a$ and $b$.


The bellow example show that the compact Hausdorff $\beta X$ does not have  non-trivial subsequence:  Assume $R=(\mathcal{U}_n)_n$ is a sequence of distinct ultrafilters on some set $X$. Since every Hausdorff space has an infinite discrete subspace, there is a subsequence $R=(\mathcal{V}_n)_n$ of $R=(\mathcal{U}_n)_n$ such that $\{\mathcal{V}_n|n \in \mathbb{N} \}$ is a discrete subspace of $\beta X$. In particular, there is a sequence $(A_n)_n$ of sets with $A_n \in \mathcal{V}_m$ if and only if $m =n$. If we let $B_n=A_n - (A_0 \cup...\cup A_{n−1})$, then the sequence $(B_n)_n$ is pairwise disjoint and $B_n \in \mathcal{V}_m$  iff $m=n$. If we let $B =\cup_n B_{2n}$, then $B \in \mathcal{V}_m$ if and only if $m$ is even. In other words, if $B =\{ \mathcal{V} \in βX|B \in \mathcal{V}\}$, then $B$ is a clopen set with $\mathcal{V}_m \in B$ iff $m$ is even. Therefore, we conclude that the sequence $(\mathcal{V}_m)_m$ cannot converge to any point, so the sequence $(\mathcal{U}_n)_n$ cannot converge to any point either.     I would like to know that:      (1) :What does it mean "sequence of distinct ultrafilters on some set $X$"?I mean, is it possible to define different ultrafilters on some set $X$?      (2) Why "$B_n \in \mathcal{V}_m$  iff $m=n$"? And " $B =\cup_n B_{2n}$, then $B \in \mathcal{V}_m$ if and only if $m$ is even "?      (3)$B$ is a clopen set with $\mathcal{V}_m \in B$ iff $m$ is even

Assume $R=(\mathcal{U}_n)_n$ is a sequence of distinct ultrafilters on some set $X$. Since every Hausdorff space has an infinite discrete subspace, there is a subsequence $R=(\mathcal{V}_n)_n$ of $R=(\mathcal{U}_n)_n$ such that $\{\mathcal{V}_n|n \in \mathbb{N} \}$ is a discrete subspace of $\beta X$. In particular, there is a sequence $(A_n)_n$ of sets with $A_n \in \mathcal{V}_m$ if and only if $m =n$. If we let $B_n=A_n - (A_0 \cup...\cup A_{n−1})$, then the sequence $(B_n)_n$ is pairwise disjoint and $B_n \in \mathcal{V}_m$  iff $m=n$. If we let $B =\cup_n B_{2n}$, then $B \in \mathcal{V}_m$ if and only if $m$ is even. In other words, if $B =\{ \mathcal{V} \in βX|B \in \mathcal{V}\}$, then $B$ is a clopen set with $\mathcal{V}_m \in B$ iff $m$ is even. Therefore, we conclude that the sequence $(\mathcal{V}_m)_m$ cannot converge to any point, so the sequence $(\mathcal{U}_n)_n$ cannot converge to any point either.     I would like to know that:      (1) Why "$B_n \in \mathcal{V}_m$  iff $m=n$"? And " $B =\cup_n B_{2n}$, then $B \in \mathcal{V}_m$ if and only if $m$ is even "?      (2)$B$ is a clopen set with $\mathcal{V}_m \in B$ iff $m$ is even


I need to find the number of divisors of $N = 3^55^77^9$ that are of the form $4n+1$, $n\geq 0$.  My try:  I noticed that $5$ itself is a number of the form $4n+1$ so all of its power satisfy the required condition, so number for the exponent of $5$ will be $7+1 = 8$.  Also, even powers of $3$ and $7$ satisfy the required condition.   But, I also noticed that odd powers of $3$ and $7$ multiplied together also satisfy the given condition as $(4m+3)(4k+3) = 4q+1$. How would I take that into account?

How to find the number of factors of $884466000$ without using a calculator?


I have heard of the Cut in Sequent Calculus before, but it seems that it exists for Natural Deduction as well. Could you please provide a proof in Natural Deduction (propositional logic) that illustrates the use of a Cut?  Additionally, there is a theorem in Sequent Calculus that transforms proofs that use Cut into proofs that don't use it. Is there an equivalent theorem for Cuts in Natural Deduction? Could you provide the corresponding proof (of the one you have given for the above) which now does not make use of the Cut?  I have tried to find information on the Cut for Natural Deduction but it seems that most literature talks about it with regards to Sequent Calculus. Could this be because the Cut for Natural Deduction have a different name? Links to resources greatly appreciated but not necessary! Thank you very much for your responses in advance!  Edit: this question is more about simple examples that illustrate concepts involved, rather than the formal proofs of those concepts (and establishing the correct terminology regarding these concepts)

Just reading:  "Gentzen was motivated by a desire to establish the consistency of number theory. He was unable to prove the main result required for the consistency result, the cut elimination theorem - the Hauptsatz - directly for Natural Deduction. For this reason he introduced his alternative system, the sequent calculus for which he proves the Hauptsatz both for classical and intuitionistic logic."   Any direct proofs of cut-elimination for natural deduction around? Whats their underlying substantial idea exactly?  Best Regards


It's pretty basic and I'm sure I'm missing something dumb here, but I'd like to know why $||A+B||_F \leq ||A||_F+||B||_F$  The way I understand it,  $||A+B||^2_F=tr((A+B)^T(A+B))=tr((A^T+B^T)(A+B))=tr(A^TA+A^TB+B^TA+B^TB)$  Now using the property the trace is linear:  $tr(A^TA+A^TB+B^TA+B^TB) = tr(A^TA)+tr(B^TB)+tr(A^TB+B^TA)=||A||^2_F+||B||^2_F+tr(A^TB+B^TA)$  Now if we were to prove that $2||A||_F||B||_F \geq tr(A^TB+B^TA)$ that would solve the question. But I don't see how that's trivial, and generally multiplying $\sum$s together is something I avoid like the plague. Is this indeed the way? would someone help me with this last step?

How can I go about proving the triangle inequality holds for the Frobenius norm?  I worked through $\|A+B\|_F \le \|A\|_F + \|B\|_F$ and was not able to make it work =/.


I have a list containing the activation function names to apply to each of the hidden layers of a NN.  I want to modify the following command so that instead of relu, the command calls activation[i]:  #activation = ['relu','softplus','softsign'] for i in range (1,hidden_layers+1):     W_dmd[i] = tf.Variable(tf.initializers.GlorotUniform()(shape=[input_shape,code_length]))     b_encoder_dmd[i] = tf.Variable(tf.initializers.Zeros()(shape=[code_length]))     x_dmd[i] = tf.compat.v1.nn.relu(tf.compat.v1.nn.xw_plus_b(x_dmd[i-1], W_dmd[i], b_encoder_dmd[i])) #Instead of relu, same command but with the name in activation[i]   The commands should then be:  x_dmd[1] = tf.compat.v1.nn.relu(tf.compat.v1.nn.xw_plus_b(x_dmd[0], W_dmd[1], b_encoder_dmd[1]))  x_dmd[1] = tf.compat.v1.nn.softplus(tf.compat.v1.nn.xw_plus_b(x_dmd[1], W_dmd[2], b_encoder_dmd[2])) x_dmd[3] = tf.compat.v1.nn.softsign(tf.compat.v1.nn.xw_plus_b(x_dmd[2], W_dmd[3], b_encoder_dmd[3]))   From this , I can come up with:  x_dmd[i] = getattr(tf.compat.v1.nn, activation[i])(tf.compat.v1.nn.xw_plus_b(x_dmd[i-1], W_dmd[i], b_encoder_dmd[i]))   Is this correct? Thanks!

What is the best way to go about calling a function given a string with the function's name in a Python program.  For example, let's say that I have a module foo, and I have a string whose content is "bar". What is the best way to call foo.bar()?  I need to get the return value of the function, which is why I don't just use eval. I figured out how to do it by using eval to define a temp function that returns the result of that function call, but I'm hoping that there is a more elegant way to do this.


Python script seems to do incorrect arithmetics.  import _thread import time  def mult(pixel : int, multiplier : tuple) -> float:     "multiplies either r,g,b pixel by row vector (0.257, 0.504, 0.098),(-0.148,-0.291,0.439),(0.439,-0.368,-0.071))"      sum=0     for mul in multiplier:         sum += (pixel * mul)         print(sum)     return sum  redMul = [0.257, 0.504,0.098] greenMul = [-0.148, -0.291, 0.439] blueMul = [0.439, -0.368,-0.071]  redAdd = 16 greenAdd = 128 blueAdd = 128  try:    _thread.start_new_thread(mult,(1,blueMul)) except:     print("Error: unable to start thread")   code outputs:  0.439 0.07100000000000001 1.3877787807814457e-17   when expecting:  0.439  0.071 0   What is the cause of this error and how can i resolve it?

Consider the following code:   0.1 + 0.2 == 0.3  ->  false   0.1 + 0.2         ->  0.30000000000000004   Why do these inaccuracies happen?


What are some good words that have the meaning of doing something only to make another’s life difficult?   My ex is suing me for my car. He bought it for me and now wants it back.  I am in a different relationship happily married and he wants to hurt me any way he can. He’s a narcissistic jerk and we have court tomorrow for the car, so I’m looking for a word or word to describe the way he is being.

I am looking for an adjective that describes a person who is not willing to forgive or excuse someone's faults or wrong-doings from the past (other than "unforgiving"). For the ones who speak German, that word would be "nachtragend".


I downloaded an .obj-file, and imported it into Blender 2.81, and I get some smooth surfaces - all is good, but I would like to see the flat version, so I go to Object Mode, Object, Shade Flatten - all is still fine.  I then find out I have a lot of duplicates, which I remove from Edit Mode, Mesh, Clean Up, By Distance.  If I then try to smooth it again, I get these weird blobs:   I tried editing the Object Data Property for Normals, Auto Smooth, but that makes no difference from 0 to 180 degrees.  When I click on the individual vertices it looks fine by showing the nearby vertices they are connected to.  What have I done wrong?

I have imported a mesh (AutoCad DXF) and I'm experiencing strange shading behavior. I've done the following to try and address the problem with no luck:  Recalculate Normals Remove Doubles Delete Loose Geometry Cleared Seam, Sharp, and Bevel Weights  There are no modifiers on the mesh.  The original imported mesh looks fine in smooth shading but I need the mesh to be in quads which causes the shading to mess up as shown in photo. I can add my .blend file but I'm not sure how to do that.


I'd like to integrate the following, similar, question:   The proposed solution consists in using the sed command which, when the test is found, exits. Tail will then fail at the next line as the sed is no longer in the pipe and the process will stop:  tail -f /path/to/file.log | sed '/^Finished: SUCCESS$/ q'   My problem is that I have a spring boot log stopping with the line:  org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive   [/opt/tomcat/webapps/my-app.war] has finished in [63,859] ms   This is also the last line of the catalina.out (until a new deploy takes place, that is). For this reason the tail -f command will just hang even though the sed exits and my watcher will stay stuck.  Is there a way to make the entire pipeline immediately fail when sed finds the line?  Thanks

I want to watch a file until a bit of text appears  I found this answer:   but when I tried it on ubuntu, it doesn't exit:  $ echo one > test.txt $ echo two >> test.txt $ echo three >> test.txt $ echo four >> test.txt $ cat test.txt | sed '/w/ q' one two $   works as expected.  however when I try to tail the file  $ tail -f test.txt | sed '/w/ q' one two   it never exits.  tail does not stop even though the pipe is broken.  Does anybody know how to make tail exit when sed exits?


I uninstalled Candy Crush Saga and Candy Crush Soda Saga from control panel.  Then I went to regedit and deleted both under HKEY_CLASSES_ROOT.  I went to Windows PowerShell and the program is not there.  The Candy Crush Soda Saga App is still showing up on my desktop list. I right click and choose Don't show on list, but nothing happens.  The program does not open if I click on the app.  What else can I do?  The reason I want to remove all of it is because this past update was causing critical issues.

Windows 10 comes with "Candy Crush Saga" preinstalled, but I do not want it on my system. How do I remove it?


I know that a tag wiki "is an editable page that briefly summarizes the topic of the tag and that may provide links to existing questions that are often useful to many people."   How can we find the tag wiki content? Is there a data dump available for downloading the tag wiki content?

Is it possible to include the tag-wiki associations in the Data Explorer? To do this would require two additional columns in the postTags table that associate a tag wiki excerpt and a tag wiki to their tag.  The tag wiki data is already available in the posts table. But there is no way to associate this data with its tags. The SEDE schema lacks the required columns to link the tag excerpt and the tag wiki to the tags table.  Additionally, the postTypes table only lists three posts types. It makes no mention of tag-wiki and tag excerpt posts. Perhaps the postypes table can be updated to reflect the additional post types?


On my Mac Mini Mid 2011, the Bootcamp window looks like this:  However on my Mid 2011 iMac - the computer where I want to make the install - the window looks like this:  Upon installing, the Mac Mini's window looks like this - and lets me select a disk image present on the hard drive or an external drive:  However on the iMac it doesn't allow me to select a .iso image:  And when I try to make the install on the iMac, I get a message saying:  Why are the steps in both High Sierra OS different? How do I proceed to install the .ISO of Windows 8.1 that I have on the iMac?

There is no option in the Bootcamp wizard to choose the Windows ISO.. Any ideas?


Can you complete badges with Steam trading cards for a game you don't own?

While you have to own a game to get card drops, drops are not the only ways to get cards from a game. You can trade them, you can buy them from the market or you can use a booster.  Do boosters work for games you don't own? Can you craft badges for games that you don't own?


I created a database with the name of old. Now I need to change database name to new. But,I did not know how to change a name?

The MySQL manual at  covers this.  Usually I just dump the database and reimport it with a new name. This is not an option for very big databases. Apparently RENAME {DATABASE | SCHEMA} db_name TO new_db_name; .  This needs to work with , which stores things very differently than .


I must be missing something, or under-thinking what goes on with a basic T Test, but I was under the impression that if I do a T-test, and one of my samples was made up of only one observation, the test would fail.  To see if this is indeed the case, I ran some code in Python code.  I made up some numbers, where my first sample has 15 values and the second sample has only 1:    import statsmodels.api as sm print "This is the result of the T-test:" ttest = sm.stats.ttest_ind(np.array([821,823,814,815,816,817,881,891,234,354,678,765,989,435,657]), np.array([21]), alternative='larger') print "pvalue:", ttest[1], ", at alpha = 0.05, thus the result is:", ttest[1] <= 0.05   Here's the result:    This is the result of the T-test: pvalue: 2.72522964545e-08 , at alpha = 0.05, thus the result is: True   I am getting an answer saying that there is a significant difference between the two sample means.  Is this simply a bogus answer?    I was under the impression that one observation can't be assumed to belong to a normal distribution, so this assumption for a T-test itself can not be verified.  Thus the test should not be appropriate.

For an ecology project, my lab group added vinegar to 4 tanks containing equal volumes of pond water, 1 control with no elodea (an aquatic plant) and 3 treatments with the same amount of elodea in each. The purpose of adding the vinegar was to reduce the pH. The hypothesis was that the tanks with elodea would go back to their normal pH quicker. This was indeed the case. We measured the pH of each tank daily for about two weeks. All the tanks eventually returned to their natural pH, but the length of time that this took was much shorter for the tanks with elodea.  When we told our professor about our experimental design, he said that there exists no statistical test that can be performed on the data to compare the control to the treatment. That because there was no replicate for the control (we only used one control tank) we cannot calculate variance and so we can't compare the sample means of the control and the treatment. So my question is, is this true? I definitely understand what he means. For example, if you took the height of one man and one woman, you can't draw conclusions about their respective populations. But we did 3 treatments, and the variance was small. It seems reasonable to assume that the variance would be similar in the control?  Update:  Thank you for the excellent answer. We got more water and elodea from the wetland and decided we would run the experiment again with smaller tanks but this time with 5 controls and 5 treatments. We were going to combine this with our original data but the starting pH of the tanks was different enough that it doesn't seem valid to consider the new experiment to be sampled from the same population as the original experiment.  We considered adding different amounts of elodea and trying to correlate speed of pH remediation (measured as time elapsed until pH returned to its original value) with amount of elodea, but we decided that wasn't necessary. Our objective is only to show that the elodea makes a positive difference, not to construct some kind of predictive model for exactly how the pH responds to differing amounts of elodea. It would be interesting to determine the optimal amount of elodea, but that's probably just the maximum amount that can survive. Trying to fit a regression curve to the data wouldn't be especially illuminating because of the various complicated changes that occur to the community when adding a large amount. The elodea dies, decomposes, new organisms start to dominate, and so on.


I installed emacs 24.5 and auctex 11.88 on os 10.9. The compilation (C-c C-c) of a tex file does not work in the GUI (Emacs.app), but it does work in the terminal. I get the following error   I believe that I set up the necessary paths because the preview functionality is working. Not sure what else to try. Thank you for any suggestions.

LaTeX rookie here.   I'm running OS X 10.7 with Emacs 24, Auctex 11.86 and TexLive 2011 via MacTex.   When i run LaTeX through Emacs in the terminal it outputs my test.tex as test.pdf just fine.   However, when i run the same file through Auctex in Emacs.app it fails and i'm given:  LaTex: problems after [0] pages'   and the output reads  Running `LaTeX' on `test2' with ``pdflatex -synctex=1  -interaction=nonstopmode "\input" test2.tex'' /bin/sh: pdflatex: command not found   I've been googling this and know this is a fairly common problem, but for the life of me I haven't been able to implement a fix. From what i've read it seems Emacs has a different PATH than terminal, no? Can someone please explain to me how to fix the PATH or environment variable (i'm not sure which) so that Emacs can find pdflatex. Is there something I need to change in my ~/.emacs ?  thanks, any help is appreciated.


I have researched stacks and have success using them in main with String or Integers. I can't seem to figure out what I am missing in my homework assignment. I continue to get a NullPointerException on my list.add(top, item). Am I forgetting something? I feel like I just need to understand what I am missing to finish the program. Once I can start pushing to the stack I think I am good to go.  The program does push: Enter a sentence, I will tell you if it is a palindrome:  test "t" is a here  Error:  Exception in thread "main" java.lang.NullPointerException at MyStack.push(MyStack.java:48) at CSCI254ProjectTwo.isPalindrome(CSCI254ProjectTwo.java:50) at CSCI254ProjectTwo.main(CSCI254ProjectTwo.java:22)    The below links makes sense and work fine for me:        public static boolean isPalindrome(String sentence) {     MyStack<Object> s = new MyStack<>(sentence.length());// declare a MyStack s     MyQueue<Object> q = new MyQueue<>(sentence.length());// declare a MyQueue q      String str;      for(int i = 0; i < sentence.length(); i++)     {         char temp = sentence.charAt(i);               if(Character.isLetter(temp)) // if ith character in sentence is a letter         {             Character.toUpperCase(temp);//convert to upper case and push it into s and q             str = Character.toString(temp); //i did this because I thought my issue was related to char which now I do not think is the issue             s.push(str);//*******************THIS IS WHERE I WANT TO PUSH TO THE STACK**             q.push(str);         }     }     while(!s.isEmpty())     {            if(s.peek() != q.peek()) // if the front of the queue not match the top of stack            {                return false;                 // return false            }            else            {                s.pop(); // pop out top of the stack and front of the queue                                 q.pop();            }     }     return true; }  import java.util.ArrayList; import java.util.List;  public class MyStack<E> {     //private ArrayList[] list;     private ArrayList<E> list; // used to store elements in stack // private ArrayList<E> testing; //private ArrayList[] test; private int top; // the index of top element private String[] stackArray; /**  * constructor construct an empty stack  */ public MyStack(int size)// {     //ArrayList<E> list = new ArrayList<E>(size);     List strLst = new ArrayList();     //List<String> testing = new ArrayList<>();     //new ArrayList<Object>();     top = -1; //empty stack     //test = (ArrayList[]) new Object[size];     //stackArray = new String[size]; }  /**  * push push a given element on the top of the stack  */ public void push(E item) {     top++;     System.out.println("\"" + item + "\" is a here");      //list.add(top, "E");     //stackArray[top] = item;     //System.out.println("\"" + stackArray[top] + "\" is a palindrome!");     //testing.add(top, item);     //list[top] = item;     //test[top] = (ArrayList) item;     list.add(top, item); **//****************HERE IS MY 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?


I can't change between Nvidia GPU and Intel using sudo nvidia settings. I get the following error:  Traceback (most recent call last):  File "/usr/share/screen-resolution-extra/nvidia-prime.py", line 22, in <module>     import sys, dbus, logging ModuleNotFoundError: No module named 'dbus'   I already tried reinstalling dbus but it did not work.

When I try to switch to my NVIDIA this happens:  ERROR: Traceback (most recent call last):        File "/usr/share/screen-resolution-extra/nvidia-prime.py", line 22, in        <module>        import sys, dbus, logging        ImportError: No module named 'dbus'   If it helps there is another error:  ** Message: PRIME: Requires offloading ** Message: PRIME: is it supported? yes  ERROR: nvidia-settings could not find the registry key file. This file should        have been installed along with this driver at        /usr/share/nvidia/nvidia-application-profiles-key-documentation. The        application profiles will continue to work, but values cannot be        prepopulated or validated, and will not be listed in the help text.        Please see the README for possible values and descriptions.   along with lots of gtk theme parsing errors.  I have GT 635M GPU and I'm running ubuntu 16.04 LTS with gnome desktop installed.  Please help :/  EDIT 1: I tried running   sudo apt-get install python-dbus   and got  python-dbus is already the newest version (1.2.0-3).   Switching GPU still produces the same error.  EDIT 2: I edited the nvidia-prime.py as Sneetsher suggested. Running nvidia-settings won't print the sys.version and sys.path, but this is the output if I run the script directly.  bp@ubuntu:~$ python /usr/share/screen-resolution-extra/nvidia-prime.py  2.7.11+ (default, Apr 17 2016, 14:00:29)  [GCC 5.3.1 20160413] ['/usr/share/screen-resolution-extra', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/PILcompat', '/usr/lib/python2.7/dist-packages/gtk-2.0', '/usr/lib/python2.7/dist-packages/ubuntu-sso-client'] Usage: /usr/share/screen-resolution-extra/nvidia-prime.py nvidia|intel


I am in the middle of installing Ubuntu server, but, I will not lie, I have no clue how to use it.  Can I use it as a desktop or any help or how to start using?  what are my expectations?  Will I end up seeing a terminal only?  Any advice?

After installing Ubuntu server how do I install the desktop environment?


I want to init some property once and than to use it to find elements in the page using C# with webdriver page object (in java the following code is working), But the following error is shown for using the property containerID :      An object reference is required for the non-static field.    This is my code:  class DescriptionPopUp {         public string containerID { get; private set; }          [FindsBy(How = How.XPath, Using = String.Format("//div[@id='{0}']//div[@class='close-Button']", containerID))]         public IWebElement CloseButton { get; set; }           public DescriptionPopUp(string containerID)         {             this.containerID = containerID;         } }   Is there an smart way to handle the problem?

Consider:  namespace WindowsApplication1 {     public partial class Form1 : Form     {         public Form1()         {             InitializeComponent();         }          private void button1_Click(object sender, EventArgs e)         {             //int[] val = { 0, 0};             int val;             if (textBox1.Text == "")             {                 MessageBox.Show("Input any no");             }             else             {                 val = Convert.ToInt32(textBox1.Text);                 Thread ot1 = new Thread(new ParameterizedThreadStart(SumData));                 ot1.Start(val);             }         }          private static void ReadData(object state)         {             System.Windows.Forms.Application.Run();         }          void setTextboxText(int result)         {             if (this.InvokeRequired)             {                 this.Invoke(new IntDelegate(SetTextboxTextSafe), new object[] { result });             }             else             {                 SetTextboxTextSafe(result);             }         }          void SetTextboxTextSafe(int result)         {             label1.Text = result.ToString();         }          private static void SumData(object state)         {             int result;             //int[] icount = (int[])state;             int icount = (int)state;              for (int i = icount; i > 0; i--)             {                 result += i;                 System.Threading.Thread.Sleep(1000);             }             setTextboxText(result);         }          delegate void IntDelegate(int result);          private void button2_Click(object sender, EventArgs e)         {             Application.Exit();         }     } }   Why is this error occurring?     An object reference is required for the nonstatic field, method, or property 'WindowsApplication1.Form1.setTextboxText(int)


I am creating a random object spawning script in Unity with c#, and am wondering what the ideal way to do this task would be. So I have a list of 31 objects or so, of my special class type. Each one has an arbitrary number assigned as it's weight. This number is divided by the sum of all their weights and multiplied by 100 to make their percent chance for appearing. It's at this stage where I'm stumped. How should I go about selecting them with a random number between 0 and 100? My first idea was to give each one a range and if the random number falls within it, I select that one, but that method does not sound like it would be the most elegant and would involve like 31 IF statements. What is the standard way to do this sort of random selection?

I have a loot box that I want to fill with a random item.  But I want each item to have a different chance of being picked.  For example:   5% chance of 10 gold 20% chance of sword 45% chance of shield 20% chance of armor 10% chance of potion   How can I make it so that I select exactly one of the items above, where those percentages are the respective chances of getting the loot?


Why did he      kill Qyburn?   Was that just for stepping beside him and commanding him to listen to Cersei? It felt out of character for such an obedient beast.

Why did Gregor The Mountain Clegane      kill Qyburn and disobey the queen?   Ok, he wants to fight his brother, but that is not a reason for such an action. He is easily stronger than both of his allies, so he could have just ignored them.  Also, I am not quite sure, why he wants that much to fight his brother really.


When email with header as below comes to hotmail, it is put into spam folder. May be this is because of X-AUTH-Result: FAIL or X-SID-Result: FAIL? Or maybe the reason is different?How can I fix this?  x-store-info:4r51+eLowCe79NzwdU2kR3P+ctWZsO+J Authentication-Results: hotmail.com; spf=softfail (sender IP is 114.112.255.122)     smtp.mailfrom=www-data@uniquemobiles.com.au; dkim=none header.d=uniquemobiles.com.au; x-    hmca=fail header.id=sales@uniquemobiles.com.au X-SID-PRA: sales@uniquemobiles.com.au X-AUTH-Result: FAIL X-SID-Result: FAIL X-Message-Status: n:n X-Message-Delivery: Vj0xLjE7dXM9MDtsPTA7YT0xO0Q9MjtHRD0yO1NDTD0w X-Message-Info: 2etWe3f/w1cLzNMFGWUkxI4X8GWjUgRPldCSLaHlMPz8KnnMw4wBLDZs45EYPr3D2LbW9QLPCct0MQQSuVuU4zU05+QEV84llG4Dg802VOeHLX90x3RbeXG0tmVB1as7GPr5ogCj2Y5rfmkYkroQia15I9SlWXAaM4gmU/Jw3y3yzUlB8kZ3Ihqkx5o9o96DUIgQU8BZOI3s1cj++xdMrorb6Gh1fAHR Received: from uniquemobiles.com.au ([114.112.255.122]) by BAY0-MC2-F21.Bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.4900);  Mon, 2 Sep 2013 21:08:45 -0700 Received: from uniquemobiles.com.au (localhost [127.0.0.1]) by uniquemobiles.com.au (8.14.4/8.14.4/Debian-2ubuntu2) with ESMTP id r8341iG1014318 for <rissa_mol@hotmail.com>; Tue, 3 Sep 2013 12:01:44 +0800 Received: (from www-data@localhost) by uniquemobiles.com.au (8.14.4/8.14.4/Submit) id r8341iuD014317; Tue, 3 Sep 2013 12:01:44 +0800 Message-Id: <201309030401.r8341iuD014317@uniquemobiles.com.au> To: =?utf-8?B?QW50aG9ueSBSaXNpdGFubw==?= <rissa_mol@hotmail.com> Subject: =?utf-8?B?VW5pcXVlIE1vYmlsZXM6IE9yZGVyICMgMTU3NDc1Njc3IHVwZGF0ZQ==?= X-PHP-Originating-Script: 505:Sendmail.php From: Unique Mobiles Sales <sales@uniquemobiles.com.au> Date: Tue, 03 Sep 2013 04:01:44 +0000 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline MIME-Version: 1.0 Return-Path: www-data@uniquemobiles.com.au X-OriginalArrivalTime: 03 Sep 2013 04:08:45.0462 (UTC) FILETIME=[48A58360:01CEA85B]

This is a  about how to handle email sent from your server being misclassified as spam.  For additional information you may find these similar questions helpful:                    Sometimes I want to send newsletters to my customers. The problem is, that some of the emails get caught as spam messages. Mostly by Outlook at the client (even in my own Outlook 2007).  Now I want to know what should be done to create "good" emails. I know about reverse lookup etc., but (for example), what about a unsubscribe link with an unique ID?  Does that increase a spam rating?


From      The main places where it's safe not to use the double quotes are:         in an assignment: foo=$bar (but note that you do need the double quotes in export "foo=$bar" or in array assignments like   array=("$a" "$b"));       Does it mean that it is not required to double quote $bar in assignment foo=$bar? Why? Why do we need the double quotes in export "foo=$bar" and in array assignments like array=("$a" "$b")?   Thanks.

Can I safely omit quotes on the right side of a local assignment?  function foo {     local myvar=${bar}     stuff() }   I'm mainly interested in bash, but any info on corner cases in other shells are welcome.


In java i used TimeUtil package.  package org.core.java;  import java.util.concurrent.TimeUnit;  public class TimeUtil {      public static void main(String[] args) {         long millis = 20000000L;          String tt = String.format("%d days,%d hrs,%d min, %d sec",                 TimeUnit.MILLISECONDS.toDays(millis),                 TimeUnit.MILLISECONDS.toHours(millis),                 TimeUnit.MILLISECONDS.toMinutes(millis),                 TimeUnit.MILLISECONDS.toSeconds(millis) -                  TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS.toMinutes(millis))             );         System.out.println(tt);         String metrics[] = tt.split(",");         String finalString = "";         for(String  metric : metrics) {             metric = metric.trim();             Integer indexChar = Integer.valueOf(metric.substring(0,1));             if(indexChar > 0) {                 finalString += metric+" ";             }         }         System.out.println(String.valueOf(finalString));     }  }   This returns 5 hrs 333 min 20 sec.  In this 333 should not come up.If min exceeded 60 then it will add +1 hrs.But in this its showing 5 hrs 333 min 20 sec.  Expected result approx 10 hrs : ... Please correct me .Am i wrong with the above code.  Thanks

I want to record the time using System.currentTimeMillis() when a user begins something in my program. When he finishes, I will subtract the current System.currentTimeMillis() from the start variable, and I want to show them the time elapsed using a human readable format such as "XX hours, XX mins, XX seconds" or even "XX mins, XX seconds" because its not likely to take someone an hour.  What's the best way to do this?


With initialisms, should one choose "a" or "an" based on the sound of the first letter of the initialism or based on what the first letter denotes?   For example, if "MOU" denotes Memorandum of Understanding, should one choose "a" or "an" based on "em" or based on "memorandum" -- a MOU or an MOU?   The choice presents an issue when the first letter of an initialism is a consonant with a vowel sound or a vowel with a consonant sound, e.g.:   FAQ – Frequently Asked Question; a FAQ or an FAQ?  LOC – Level of Concern; a LOC or an LOC?  MOU – Memorandum of Understanding; a MOU or an MOU? NPV – Net Present Value; a NPV or an NPV?  R&D project – Research and Development project; a R&D project or an R&D project? SOP – Standard Operating Procedure; a SOP or an SOP?  XRD – X-Ray Device; a XRD or an XRD? URL – Uniform Resource Locator; a URL or an URL?    Also, does the choice depend on whether the writing is formal (e.g., technical, legal, policy) or informal?

99% of the time, I'm clear on when I should use "a" versus "an." There's one case, though, where people & references I respect disagree.  Which of the following would you precede with "a" or "an," and why?   FAQ FUBAR SCUBA   [Note: I've read the questions  and , but the rules given there don't necessarily apply here.]    [Edited to add]  Here's a shorter (and hopefully clearer) version of the question…  In written English, which is correct (and why): "a FAQ" or "an FAQ"?  Some references with differing opinions:   an: the  and  a: the Microsoft Manual of Style for Tech Publications, 3e either: the  and


If $N(z)=a^2+b^2 =\text{ prime }\in \Bbb{Z}$  show $$\frac{\Bbb{Z}[i]}{(a+bi)}$$ is a field of prime order.    from   $a+bi$ is irreducible. $\Bbb{Z}[i]$ is an integral domain and $a+bi$ is irreducible in $\Bbb{Z}[i]$ so somehow its a field by a theorem (which theorem I am not  sure, need to fix this)  $$ \begin{aligned} a+bi &\equiv0 \mod(a+bi) \\ a & \equiv b *i \mod(a+bi) \\ [a] &= [bi] \end{aligned}$$   so $z\in \Bbb{Z}[i]$ $z=\alpha+\beta i$  $$\begin{aligned} z+(a+bi)\equiv [z] =[\alpha + \beta i]=\text{ stuff I need to think more} \end{aligned} $$  somehow that is $\Bbb{Z}_p$ so $\frac{\Bbb{Z}[i]}{a+bi} \cong \Bbb{Z}_p$ being a field.

I'm trying to get through a proof of Gauss' that certain primes can be written as the sum of two squares. An assumption is that      the order of $\mathbb{Z}[i]/(a+bi)$ is $a^2+b^2$.   I get that $(a+bi)(a-bi)=a^2+b^2$, so this places a bound on the order of integers with no imaginary part. But since $b$ isn't a unit, it doesn't seem like this finishes the proof.  Any hints?


Claim: there is no entire non-constant function $f$ such that $f(z+1)=f(z)$ and $f(z+i)=f(z), \forall z\in \mathbb{C}.$  May I verify if my proof is valid? Or is there a better way to approach this problem? Thank you.   Suppose there exists such $f.$ Since $f$ is continuous, $f$ is bounded on some compact set $S:=\{a+bi  \in \mathbb{C} : a,b \in [0,1]\}.$   Given $z=x+iy \in \mathbb{C},\ f(x+iy)=f(a+bi+ \lfloor {x}\rfloor + i\lfloor {y}\rfloor)=...=f(a+ib),$ where $a,b \in [0,1].$  Hence, $f$ is bounded in $\mathbb{C}$ and Liouville's theorem follows.

So the problem states that if $f(z)$ is entire, and satisfies the relation $f(z+i) = f(z)$ and $f(z+1) = f(z)$, show that $f(z)$ is constant. So I was thinking that since any point in $\mathbb{C}$ can be written as $\alpha * 1 + \beta * i $ we can say that $f(z + z_0) = f(z) $ in which case it is constant, but I'm having trouble breaking down the steps and using the fact that $f$ is entire, which makes me feel like I'm missing something. What should I review to figure this out?


I am not able to connect to any Bluetooth device.   The below "Connection" switch is greyed out for any kind of Bluetooth device. All of them work in connection with my Android device (i.e. the devices are not broken).    Output of lspci -knn | grep Net -A2; lsusb:  00:19.0 Ethernet controller [0200]: Intel Corporation 82579LM Gigabit Network Connection [8086:1502] (rev 04)     Subsystem: Lenovo Device [17aa:21f3]     Kernel driver in use: e1000e -- 03:00.0 Network controller [0280]: Intel Corporation Centrino Advanced-N 6205 [Taylor Peak] [8086:0085] (rev 34)     Subsystem: Intel Corporation Centrino Advanced-N 6205 AGN [8086:1311]     Kernel driver in use: iwlwifi Bus 004 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 003 Device 005: ID 04f2:b2ea Chicony Electronics Co., Ltd Integrated Camera [ThinkPad] Bus 003 Device 007: ID 0a5c:21e6 Broadcom Corp. BCM20702 Bluetooth 4.0 [ThinkPad] Bus 003 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub   I can search for new bluetooth devices. Therefore, I don't think that it's a firmware-related issue.

Bluetooth is on but can't find or be found by any other devices.  Output of sudo service bluetooth status:  ● bluetooth.service - Bluetooth service    Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)    Active: active (running) since ხუთ 2015-06-04 22:33:18 GET; 13min ago  Main PID: 26678 (bluetoothd)    CGroup: /system.slice/bluetooth.service            └─26678 /usr/sbin/bluetoothd -n  ივნ 04 22:39:14 Rangoo bluetoothd[26678]: Endpoint registered: sender=:1.63 path=/MediaEndpoint/BlueZ4/HFPAG ივნ 04 22:39:14 Rangoo bluetoothd[26678]: Endpoint registered: sender=:1.63 path=/MediaEndpoint/BlueZ4/HFPHS ივნ 04 22:39:14 Rangoo bluetoothd[26678]: Endpoint registered: sender=:1.63 path=/MediaEndpoint/BlueZ4/A2DPSource ივნ 04 22:39:14 Rangoo bluetoothd[26678]: Endpoint registered: sender=:1.63 path=/MediaEndpoint/BlueZ4/A2DPSink ივნ 04 22:39:14 Rangoo bluetoothd[26678]: bluetoothd[26678]: Endpoint registered: sender=:1.63 path=/MediaEndpoint/BlueZ4/HFPAG ივნ 04 22:39:14 Rangoo bluetoothd[26678]: bluetoothd[26678]: Endpoint registered: sender=:1.63 path=/MediaEndpoint/BlueZ4/HFPHS ივნ 04 22:39:14 Rangoo bluetoothd[26678]: bluetoothd[26678]: Endpoint registered: sender=:1.63 path=/MediaEndpoint/BlueZ4/A2DPSource ივნ 04 22:39:14 Rangoo bluetoothd[26678]: bluetoothd[26678]: Endpoint registered: sender=:1.63 path=/MediaEndpoint/BlueZ4/A2DPSink ივნ 04 22:39:14 Rangoo bluetoothd[26678]: Adapter /org/bluez/26678/hci0 has been enabled ივნ 04 22:39:14 Rangoo bluetoothd[26678]: bluetoothd[26678]: Adapter /org/bluez/26678/hci0 has been enabled   Output of lsusb:  Bus 003 Device 005: ID 0a5c:21d7 Broadcom Corp. BCM43142 Bluetooth 4.0   How can I fix it?


When I type in the cmd chcp 65001" and then close it, when reopening it resets to the default "850".   I need to be able to run my C++ program with utf8 but I can't if it keeps reseting itself...

Currently I'm running Windows 7 x64 and usually I want all console tools to work with UTF-8 rather than with default code page 850.  Running chcp 65001 in the command prompt prior to use of any tools helps but is there any way to set is as default code page?  Update:  Changing HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\CodePage\OEMCP value to 65001 appear to make the system unable to boot in my case.  Proposed change of HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\Autorun to @chcp 65001>nul served just well for my purpose. (thanks to )


I am trying to retopo a face and I would like to animate it, making smooth facial expression if possible.  I'm not a very experienced user but I do my best and try to learn as much as i can. Having a project helps me to get motivated and learn stuff.  I've seen a few tutorials for Retopology on YouTube, I know the basics (the process and avoiding Tri and Ngons) and making loops around the important features. I'd like it in a depth real course to follow along to be sure of what I'm doing, even if it's not a free course I'm fine.  thank you for your help !

Since asking for tutorials, videos, resources, links to other content or downloads is considered off topic here, this is a specifically created Community Wiki which gathers resources for Blender and it has been approved by the .  Just write in the appropriate answer/section. If you have concerns, questions, post a  question, so we don't clutter the comments, but you can link your meta question from the comments.  Questions regarding such resources are not allowed anymore, except for very specific and on topic requests (ask on  if you're unsure about your question). Follow the instructions made in the question about how to post, what can be posted, etc.  Learning             Assets    (also see: )   Reference Images/Blueprints (also see: )    Tools    (also see: )      Other   Special Interest ()     Also see the .


I get this message:    And it never actually runs on right click + clicking the menu item.

I tried loading Adobe Flash player in Chromium on Ubuntu 19.04 (Lubuntu in this case) using various answers on AskUbuntu.com. I get to the point where the Allow Flash popup happens. But when I click to allow it, it says "Right-click to run Adobe Flash Player". When I rightclick and choose Run this Plugin, nothing happens. I've tried to apply fixes using the Pepperflash technique, as well as the Adobe Flashplugin technique.


I'm trying to modify the table environment to apply small and centering, along with \figuversion{tabular} (this is some font-specific stuff), to all tables in the document.  What would be the best way to achieve this?  Here is how I tried to do this:  \renewenvironment{table}     {%         \@float{table}%         \small%         \centering%         \figureversion{tabular}%     }%     {%         \end@float%     }   However, optional placement identifier is lost here, i.e., if I write \begin{table}[h!], I get the table, and [h!] is printed above the table.  Here is the minimum working example:  \documentclass[a4paper]{book}  \makeatletter \renewenvironment{table}%     {%         \@float{table}%         \small%         \centering%         %\figuversion{tabular}%     }%     {%         \end@float%     } \makeatother  \begin{document}  \hbox{}  \begin{table}[b!]     \begin{tabular}{cc}         Entry 1 & Entry 2 \\         Entry 3 & Entry 4     \end{tabular} \end{table}  \end{document}   P.S. I cannot use the floatrow package as it clashes with the float package that is not used directly, but some package in my document requires it.    EDIT: This question has already been answered. I repeat the solution here:  \renewenvironment{table}[#1][ht]     {%         \@float{table}[#1]%         \small%         \centering%         \figureversion{tabular}%     }%     {%         \end@float%     }

Background  Would like to center all tables within floats, without having to add \centering to each table.  Ideas  Tried the following:  \let\originaltabular\tabular \renewcommand\tabular{\centering\originaltabular}   It compiles, but the tables remain left-justified.  Question  How would you edit the Preamble of a LyX document to make all the floating tables be centred?