$X,Y,Z$ are sets, $X+Y:=(X \cup Y) \setminus (X \cap Y)$.  I need to show that $(X+Y)+Z=X+(Y+Z)$.  Intuitively it is clear that $$(X+Y)+Z=(X \cup Y \cup Z) \setminus ( [X \cap Y] \cup [Y \cap Z] \cup [Z \cap X] \setminus [X \cap Y \cap Z ])$$  Then the claim would follow. Any idea how to prove the intuition in a smart way without considering 8 cases ($x \in X, x \notin Y, x \in Z$, etc.)?

By $A\oplus B$ we denote the symmectric difference of two sets. The definition is $A\oplus B =(A\setminus B) \cup (B\setminus A)$. Now I hope to show that $A\oplus (B\oplus C) = (A\oplus B)\oplus C$. I remember that there's an elegant proof, but I forget its detail. (The first step is to show $A\oplus (A\oplus B) = B$, and maybe applying this formula, we can obtain associativity.)


I'm currently developing a home automation framework for my apartment. This involves getting JSON over Serial from an Arduino. When the JSON can't be parsed (usually only on startup) I log it as an error.  Today something strange happened though, the broken JSON caused one of my terminals to become weird.  [nodemon] restarting due to changes... [nodemon] starting `node build/server` sensor living-room-humidity on serial:arduino-master:42 sensor living-room-temperature on serial:arduino-master:42 sensor living-room-motion on serial:arduino-master:42 sensor living-room-brightness on serial:arduino-master:42 sensor kitchen-humidity on serial:arduino-master:43 sensor kitchen-temperature on serial:arduino-master:43 sensor kitchen-motion on serial:arduino-master:43 sensor kitchen-brightness on serial:arduino-master:43 listening on http://127.0.0.1:50000 serial opened: arduino-master serial error can't parse JSON:  S≤┼├▒│E⎼⎼⎺⎼: U┼e│⎻ec├ed ├⎺┐e┼ ⎽e⎼☃▒┌ d☃⎽c⎺┴e⎼ed: /de┴/├├≤USB▮ /#Y⎼dB▒±dPSX2≤TB☃8AAAA c⎺┼┼ec├ed /#Y⎼dB▒±dPSX2≤TB☃8AAAA ▒┤├▒e┼├☃c▒├ed [┼⎺de└⎺┼] ⎼e⎽├▒⎼├☃┼± d┤e ├⎺ c▒▒┼±e⎽↓↓↓ [┼⎺de└⎺┼] ⎽├▒⎼├☃┼± ◆┼⎺de b┤☃┌d/⎽e⎼┴e⎼◆ ⎽e┼⎽⎺⎼ ┌☃┴☃┼±↑⎼⎺⎺└↑▒┤└☃d☃├≤ ⎺┼ ⎽e⎼☃▒┌:▒⎼d┤☃┼⎺↑└▒⎽├e⎼:42 ⎽e┼⎽⎺⎼ ┌☃┴☃┼±↑⎼⎺⎺└↑├e└⎻e⎼▒├┤⎼e ⎺┼ ⎽e⎼☃▒┌:▒⎼d┤☃┼⎺↑└▒⎽├e⎼:42 ⎽e┼⎽⎺⎼ ┌☃┴☃┼±↑⎼⎺⎺└↑└⎺├☃⎺┼ ⎺┼ ⎽e⎼☃▒┌:▒⎼d┤☃┼⎺↑└▒⎽├e⎼:42 ⎽e┼⎽⎺⎼ ┌☃┴☃┼±↑⎼⎺⎺└↑b⎼☃±▒├┼e⎽⎽ ⎺┼ ⎽e⎼☃▒┌:▒⎼d┤☃┼⎺↑└▒⎽├e⎼:42 ⎽e┼⎽⎺⎼ ┐☃├c▒e┼↑▒┤└☃d☃├≤ ⎺┼ ⎽e⎼☃▒┌:▒⎼d┤☃┼⎺↑└▒⎽├e⎼:43 ⎽e┼⎽⎺⎼ ┐☃├c▒e┼↑├e└⎻e⎼▒├┤⎼e ⎺┼ ⎽e⎼☃▒┌:▒⎼d┤☃┼⎺↑└▒⎽├e⎼:43 ⎽e┼⎽⎺⎼ ┐☃├c▒e┼↑└⎺├☃⎺┼ ⎺┼ ⎽e⎼☃▒┌:▒⎼d┤☃┼⎺↑└▒⎽├e⎼:43 ⎽e┼⎽⎺⎼ ┐☃├c▒e┼↑b⎼☃±▒├┼e⎽⎽ ⎺┼ ⎽e⎼☃▒┌:▒⎼d┤☃┼⎺↑└▒⎽├e⎼:43 ┌☃⎽├e┼☃┼± ⎺┼ ▒├├⎻://127↓▮↓▮↓1:5▮▮▮▮ ⎽e⎼☃▒┌ ⎺⎻e┼ed: ▒⎼d┤☃┼⎺↑└▒⎽├e⎼ ⎽e⎼☃▒┌ d☃⎽c⎺┴e⎼ed: /de┴/├├≤USB▮ ⎽e⎼☃▒┌ e⎼⎼⎺⎼ c▒┼'├ ⎻▒⎼⎽e JSON: π"☃d":42←"b⎼☃±▒├┼e⎽⎽":126←"└⎺├☃⎺π"☃d":42←"b⎼☃±▒├┼e⎽⎽":125←"└⎺├☃⎺┼":▮←"├e└⎻e⎼▒├┤⎼e":23↓8▮←"▒┤└☃d☃├≤":29 S≤┼├▒│E⎼⎼⎺⎼: U┼e│⎻ec├ed ├⎺┐e┼ ☃ /#5┌9⎻PA°2P└_└┐c_WAAAA c⎺┼┼ec├ed /#5┌9⎻PA°2P└_└┐c_WAAAA ▒┤├▒e┼├☃c▒├ed /#5┌9⎻PA°2P└_└┐c_WAAAA d☃⎽c⎺┼┼ec├ed /#▒▒73J1G⎺CK↑▒XdVbAAAB c⎺┼┼ec├ed /#▒▒73J1G⎺CK↑▒XdVbAAAB ▒┤├▒e┼├☃c▒├ed /#▒▒73J1G⎺CK↑▒XdVbAAAB d☃⎽c⎺┼┼ec├ed /#├┌7⎺°_▒R6FDON─┐HAAAC c⎺┼┼ec├ed /#├┌7⎺°_▒R6FDON─┐HAAAC ▒┤├▒e┼├☃c▒├ed /#├┌7⎺°_▒R6FDON─┐HAAAC d☃⎽c⎺┼┼ec├ed /#┤_Q┬├XdLW1└C▒Z⎻8AAAD c⎺┼┼ec├ed /#┤_Q┬├XdLW1└C▒Z⎻8AAAD ▒┤├▒e┼├☃c▒├ed /#┤_Q┬├XdLW1└C▒Z⎻8AAAD d☃⎽c⎺┼┼ec├ed /#3☃┐R±°_⎼E⎻☃Q┼K┘▒AAAE c⎺┼┼ec├ed /#3☃┐R±°_⎼E⎻☃Q┼K┘▒AAAE ▒┤├▒e┼├☃c▒├ed     I know that this most likely can be fixed by just restarting that shell, but I still want to understand why this happens and (if possible) prevent it from happening again.

If I understand the cat manual correctly:       concatenate files and print on the standard output   cat will take files as argument and print them on standard output. What I don't get is if I use the command:    cat img.png > copy.png   I will obtain 2 png files identical while if I just    cat img.png     I have all chance that my terminal get messed up and misinterpret what I type.     How's that possible?   Binary values are still binary data. Why it does not simply shows a series of 0 and 1 or the interpretation of those binary data in ASCII or whatever the encoding in terminal is?   Is this behavior also possible by cating a text file containing strange characters?   Should a mechanism to prevent this behavior  like try{}catch{} statement should be implemented?


I was banned from asking questions on Stack Overflow because many of my questions have a score of 0. I really think that is too much. What should the beginners do? Where should they ask their questions? Will it harm you to help the beginners?

I have asked the three questions below, one of which I deleted myself. How can Stack Overflow  block me from asking further questions? It seems Stack Overflow is not for beginners, but just for people with years of experience.   Could anyone tell me what the problem is with my questions and how I can improve them?      (deleted by myself)


I am NOT able to login into production instance () using password+security token.   However, I am able to login into dataloader for sandbox instance () using password+security token.  If I use another laptop, I am able to login to data loader for production instance which is good, but as that laptop has Windows 10 so data loader doesn't work properly.  Any help is highly appreciated.

I am able to login to data loader for production instance however I am able to login to sandbox. I am adding the security token at the end too. I am using version 37 of data loader and windows 7.  When I try to login into data loader, I get a login error "Error:Check your username and password. If you still can't login, contact your Salesforce admin". I am sure that I am using the correct username and password. I am also adding security token at the end of password.


I have this map where keys are strings and values are vectors of Product type (structs containing and int "code" variable and some other variables). Given a code, I want to remove all occurrences of vector elements where that code is present, and I need to do this for all map elements. This is what I'm trying and my program crashes:  void removeByCode(map<string, vector<Product>> &products, int code){     for (auto productlist: products){         for (auto i=productlist.second.begin(); i != productlist.second.end(); i++){             if ((*i).code==code)                 i = productlist.second.erase(i);         }     } }   This is one use case where it crashes (assume this is what the map pairs look like):  a: [code:1; code:2]  b: [code:1]  c: [code:1; code:2]  Code to be erased: 2  PS: I need to use erase (not remove or other methods)

I want to clear a element from a vector using the erase method. But the problem here is that the element is not guaranteed to occur only once in the vector. It may be present multiple times and I need to clear all of them. My code is something like this:  void erase(std::vector<int>& myNumbers_in, int number_in) {     std::vector<int>::iterator iter = myNumbers_in.begin();     std::vector<int>::iterator endIter = myNumbers_in.end();     for(; iter != endIter; ++iter)     {         if(*iter == number_in)         {             myNumbers_in.erase(iter);         }     } }  int main(int argc, char* argv[]) {     std::vector<int> myNmbers;     for(int i = 0; i < 2; ++i)     {         myNmbers.push_back(i);         myNmbers.push_back(i);     }      erase(myNmbers, 1);      return 0; }   This code obviously crashes because I am changing the end of the vector while iterating through it. What is the best way to achieve this? I.e. is there any way to do this without iterating through the vector multiple times or creating one more copy of the vector?


I was looking through some documentations for my university task and noticed that all of the syscalls there are followed by (2), like execv(2), fork(2) or fcntl(2). What do they represent?

For example: man(1), find(3), updatedb(2)?   What do the numbers in parentheses (Brit. "brackets") mean?


Let $f:\mathbb Q\to\mathbb R$ be a uniformly continuous function and assume that $f'(x)=0$ for all $x\in\mathbb Q$. That $f$ is constant is obvious...and, as far as I can tell, unprovable. Please tell me that I'm wrong!

I'm trying to make a problem for my advanced calculus students.  I was thinking, if we have a differentiable function $f:\mathbb{R}\to\mathbb{R}$ such that $f'(q)=0$ for all $q\in\mathbb{Q}$, can we say that $f$ is constant?


I get the use of JavaScript's new operator, anonymous functions, and use of functions as first class citizens (i.e. passing functions as parameters, using functions as return values, etc..) And I thought of doing a weird combination of these.  function foo(s) {     return function () {         alert(s);     } }  var bar = foo('bar'); var baz = new foo('baz');  bar(); baz();   Both calls bar() and baz() behave similarly (i.e. alert's 'bar' and 'baz' respectively).  Is there really a difference between variable = func() vs variable = new func() when func() returns an anonymous function?

I've recently started maintaining someone else's JavaScript code. I'm fixing bugs, adding features and also trying to tidy up the code and make it more consistent.  The previous developer used two ways of declaring functions and I can't work out if there is a reason behind it or not.  The two ways are:  var functionOne = function() {     // Some code };     function functionTwo() {     // Some code }   What are the reasons for using these two different methods and what are the pros and cons of each? Is there anything that can be done with one method that can't be done with the other?


I just install Ubuntu 14.10 and wanna connect to school WiFi(wpa2 enterprise/peap/mschapv2), but failed. According to forum solution, I need to delete a line called system-ca-certs=true. But I even cannot find it in that file. Anyone has idea?  The solution for the low version   I put my file below, clearly, no line related to "system-ca-certs"  [connection] id=*** uuid=672b112a-ed80-4d76-9cb9-9f1435919b78 type=802-11-wireless  [802-11-wireless] ssid=*** mode=infrastructure security=802-11-wireless-security  [802-11-wireless-security] key-mgmt=wpa-eap  [ipv4] method=auto  [ipv6] method=auto  [802-1x] eap=peap; identity=jz1958 phase2-auth=mschapv2 password-flags=1

My university uses WPA2 Enterprise encryption for students to login their wireless. In NetworkManager I have keyed in everything that they needed   Security : WPA & WPA2 Enterprise  Authentication : Protected EAP (PEAP) CA certificate is not needed PEAP version : Automatic Inner authentication : MSCHAPv2 Username and Password are correct.   Everytime I try to connect, I get a window asking me to input my password over and over again


I want to set or clear the bit number 3 in a register named TCCR0B depending on the value of the bit number 2 in a variable named ‘mode’. If bit 2 is high in mode, bit 3 in TCCR0B has to be set without disturbing other bits. In case bit 2 in mode is low, I want to clear bit 3 in TCCR0B. Basically I want to copy one bit  to other bit. I thought it is going to be simple, but now I feel we need conditional statement to do this. I am not sure if I am making this code complex. Is there any easy method to achieve this? I wrote below code to test this.   #define WGM02 3 #define WGM02_IN_MODE 2  int main (void) {     unsigned int TCCR0B;     unsigned int mode;     while(1)     {         printf("enter the TCCRB\n");         fflush(stdin);         scanf("%X",&TCCR0B);         printf("TCCRB = %x\n",TCCR0B);         fflush(stdin);         printf("enter the mode\n");         scanf("%X",&mode);          mode=((mode>>WGM02_IN_MODE)&0x01);         if(mode)         {             TCCR0B = (TCCR0B & ~(1<<WGM02))  | (mode<<WGM02);         }         else         {             TCCR0B = (TCCR0B & ~(1<<WGM02))  & ~(mode<<WGM02);         }         printf("TCCRB = %x\n",TCCR0B);     }  }   Edit: I looked at the post in . But it is related to setting clearing etc of individual bits and not copy from one to another.

How do you set, clear, and toggle a bit?


I am active on Stack Overflow. I saw that one of my question has more than 10,000 views but the  badge wasn't awarded to me.  Why not?

I was browsing my reputation/questions, and I noticed that one of my questions has 10k views. However, it doesn't show the 10k view "Famous Question" badge on my account.  Is "10k views" a rounded figure that will show 10k between 9500-10499? Also, does that mean that the "Famous Question" badge is only earned after receiving 10000+ views?


I have an asus laptop, windows 8 is the current OS. I am trying to install ubuntu as a dual boot, so far I have tried downloading it from the ubuntu website however a message error showed when I tried to reboot and now can't replicate this message, it said the file contained some sort of error. Next I tried to boot from USB, I don't have a cd drive so CD isn't an option. No luck with the USB it didn't recognize the files. Is there a possibility that my laptop isn't compatible with Ubuntu?  Thanks.

I'm absolutely new to Linux. I would like to know how to install Ubuntu alongside the pre-installed Windows 8+ OS.  Should I do it with Wubi, or through the Live USB/DVD?  What steps do I need to take to correctly install Ubuntu?


I'd like to disable drag-and-drop in Windows Explorer but only on when the source is the left column (directory tree), however.  Better still, I'd like to enable drag-&-drop ONLY when I'm dragging from left-to-right (never left-to-left, right-to-right, or right-to-left, except across multiple instances of Windows Explorer).  OS:  Windows 7

How can I disable copying files via drag-and-drop in Windows Explorer in Windows 7?  Note that I don't want to disable drag-and-drop completely nor in the start menu, just disable copying (duplicating) files when users drag-and-drop.


Okay so, I've got Ubuntu 16 running in a virtual machine (on a Windows 10 host but I don't think that is relevant). Right now my partition looks like that :    What I want to do is shrink my /dev/sda1 partition because my virtual image takes up 50GB of my host's space and that's much more than what I need. Problem is, when I try to, GParted won't let me shrink it below around 46GB, although it looks perfectly aware that only 25GB are used atm. I even tried deleting /dev/sda2 to have unallocated space on the right but it doesn't work.    I tried to use google but all I can find are problems where GParted thinks that a partition is full while it's not, which is obviously not the case here.  Thanks for your help !  PS : I start GParted using "sudo gparted" in my terminal if that is of any help.

My dynamically growing virtual disks (VDI) from various Ubuntu installations in Virtual Box are actually steadily "growing" indeed.  Deleting of files in the virtual machine does not free the space my VDI file took from the host hard disk space.  How do I shrink these files to give the unused hard disk space back to the host?


My current code looks like the following:   var cacheWork = new UnitOfWork();  Log.Info("Caching Cable Entity");  cacheWork.GetRepository<CableEntity>().All();  Log.Info("Caching CablePart Entity");  cacheWork.GetRepository<CablePartEntity>().All();  Log.Info("Caching CableType Entity");  cacheWork.GetRepository<CableTypeEntity>().All();  Log.Info("Caching Country Entity");  cacheWork.GetRepository<CountryEntity>().All();  Log.Info("Caching Filesystem Entity");  cacheWork.GetRepository<FilesystemEntity>().All();  Log.Info("Caching Host Entity");  cacheWork.GetRepository<HostEntity>().All();  Log.Info("Caching Location Entity");  cacheWork.GetRepository<LocationEntity>().All();  Log.Info("Caching NodeCable Entity");  cacheWork.GetRepository<NodeCableEntity>().All();  Log.Info("Caching Node Entity");  cacheWork.GetRepository<NodeEntity>().All();  Log.Info("Caching Person Entity");  cacheWork.GetRepository<PersonEntity>().All();  Log.Info("Caching Tier Entity");  cacheWork.GetRepository<TierEntity>().All();  Log.Info("Caching User Entity");  cacheWork.GetRepository<UserEntity>().All();  cacheWork.Dispose();   What i want is to get rid of the explicit declaring of type for each of these classes. I am able to retrieve all of the types and return it as a list.  What i now want is to do something like this:  var ns = typeof(T).Namespace; var types = typeof(T).Assembly.GetExportedTypes() .Where(t => t.Namespace == ns);  var cacheWork = new UnitOfWork(); foreach (Type t in types)     cacheWork.GetRepository<t>().All(); cacheWork.Dispose();   So i already know that that this syntax does not work, But i'm figuring it has to be a way of doing this via for example reflection. Anyone That can help me with this?  EDIT:  From the already answered SO question i came up with the following solution:              var ns = typeof(BaseEntity).Namespace;         var types = typeof(BaseEntity).Assembly.GetExportedTypes()         .Where(t => t.Namespace == ns);          var cacheWork = new UnitOfWork();         types.ForEach(x =>         {             Log.Info("Caching " + x.Name + "...");             MethodInfo repoMethod = typeof (UnitOfWork).GetMethod("GetRepository");             MethodInfo generic = repoMethod.MakeGenericMethod(x);             var repository = generic.Invoke(cacheWork, null);              MethodInfo getAllMethod = repository.GetType().GetMethod("All");             getAllMethod.Invoke(repository, null);          });         cacheWork.Dispose();

What's the best way to call a generic method when the type parameter isn't known at compile time, but instead is obtained dynamically at runtime?  Consider the following sample code - inside the Example() method, what's the most concise way to invoke GenericMethod<T>() using the Type stored in the myType variable?  public class Sample {     public void Example(string typeName)     {         Type myType = FindType(typeName);          // What goes here to call GenericMethod<T>()?         GenericMethod<myType>(); // This doesn't work          // What changes to call StaticMethod<T>()?         Sample.StaticMethod<myType>(); // This also doesn't work     }      public void GenericMethod<T>()     {         // ...     }      public static void StaticMethod<T>()     {         //...     } }


I know that there are a many similar questions out there on stackoverflow.com but I couldn't figure out a solution for myself. After quite some time on research, my brain is broken now even though I think the task I want to do is relatively simple.   So I have two structs:  struct files_t {     file_t *file; };  struct file_t {     unsigned char *bytes;     unsigned int len; };    The first struct files_t contains a unknown amount of structs of the second struct file_t. The second struct file_t contains an array of unsigned char which represents the bytes of the file_t and the length of this bytes-array.   Then I create myself a pointer to a files_t struct:  files_t* files;   My question now is: How can I iterate through this files struct pointer (Pseudocode: for each file in files) when the amount of file_t's in it is unknown at compile time and also the size of each file_t is unknown at compile time?

First off, here is some code:  int main()  {     int days[] = {1,2,3,4,5};     int *ptr = days;     printf("%u\n", sizeof(days));     printf("%u\n", sizeof(ptr));      return 0; }   Is there a way to find out the size of the array that ptr is pointing to (instead of just giving its size, which is four bytes on a 32-bit system)?


I'm having trouble dual-booting 12.04 alongside Windows 8. It's a self-assembled PC, so there's no OEM UEFI or anything like that (just to be safe, I checked the BIOS settings and it was set to legacy). So the problem is I boot from the live DVD, allow Ubuntu to carve out its own partitions (by selecting "install alongside Windows 8"), it proceeds to a screen where it tells me installation was successful, then a message pops up saying    "Executing 'grub-install /dev/sda' failed. This is a fatal error."   So I chose to finish the installation without a bootloader. Before I go further, here is the return for fdisk -l:  Disk /dev/sda: 1000.2 GB, 1000204886016 bytes 255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk identifier: 0x00000000     Device Boot      Start         End      Blocks   Id  System /dev/sda1               1  1953525167   976762583+  ee  GPT Partition 1 does not start on physical sector boundary.  Disk /dev/sdb: 60.0 GB, 60022480896 bytes 255 heads, 63 sectors/track, 7297 cylinders, total 117231408 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x89e1bf3c     Device Boot      Start         End      Blocks   Id  System /dev/sdb1   *        2048    86843397    43420675    7  HPFS/NTFS/exFAT /dev/sdb2        86845438   117229567    15192065    5  Extended /dev/sdb5        86845440   100560895     6857728   83  Linux /dev/sdb6       100562944   117229567     8333312   82  Linux swap / Solaris   I have it set up so that /dev/sda is my storage HDD with files accessible by both Ubuntu and W8. /dev/sdb is my SSD that I want to run both OSs on. /sdb1 is my existing Windows installation, sdb5 is the currently unbootable 12.04 installation, and sdb6 is swap.   What I have tried so far is deleting the partitions and redoing the whole thing, except initiating it by running   ubiquity --desktop %k gtk_ui   in sudo. No change in behavior. I have tried running grub-install in sudo and it completes successfully. However, when rebooting it boots what I would assume to be the GRUB terminal. Obviously the GUI form is preferable. Anyway, I'm a Linux noob, so I'm open to suggestions.

I am attempting to install Ubuntu on a box which was previously running Windows 7.  I have also experienced the dreaded "Unable to install GRUB" error.  I am not attempting to dual boot. I have previously run a Windows boot disk and removed all existing partitions.  If I run the Ubuntu 12.04 install CD and click install after the config screens, I get the error   Executing 'grub-install /dev/sda' failed. This is a fatal error. (It is the same error as this question: )  All the questions I've read while looking for a solution are related to dual boot.  I'm not interested in dual boot, I'm after a clean out the box Ubuntu install. How can I achieve this?  (For my sanity, please use very simple instructions when responding. I don't claim to have any talent either for linux or as a sysadmin)    Additional details copied from comments dated: 2012-05-29 ~15:19Z  After booting from the CD, clicking Try Ubuntu, and then sudo fdisk /dev/sda I get fdisk: unable to seek on /dev/sda: Invalid argument  sudo fdisk /dev/sdb gives   Device contains neither a valid DOS partiion table, nor Sun, SGI or OSF disklabel.  Building a new DOS disklabel with disk identifier 0x15228d1d.  Changes will remain in memory only until you decide to write them.  After that of course, the previous content won't be recoverable.  Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite).  Command (m for help):   I should add the Live CD desktop is graphically bad. I've got missing parts of programs and the terminal occasionally reflects to the bottom of the screen. But I can't imagine this is related.


//Spielfeld Größe int sizeX = 800; int sizeY = 600;  //Robo Startposition float roboX = sizeX/2; float roboY = sizeY/2;  //Robo Speed float speed = 0.03;  //Robo Acceleration float accel = 0.05;  float x1; float y1;   void setup() {   size(800, 600);   frameRate(60);   background(200); }   void draw() {   background(200);   println("x " +x1);   println("y " +y1);   robo();   x1=screenX(roboX,roboX);   y1=screenY(roboY,roboY);   stopRobot();   object(); }  //Beschleunigung zurücksetzen void mouseReleased() { accel = 0.05; }  void robo() {   rectMode(CENTER);    //RoboMovement if(mousePressed){   float zielX = mouseX;   float moveX = zielX - roboX;   roboX += moveX * speed*accel;    float zielY = mouseY;   float moveY = zielY - roboY;   roboY += moveY * speed*accel;      //Beschleunigung am Anfang   if(accel< 1) {   accel += 0.05;   } } pushMatrix();    translate(roboX, roboY);     rotate(atan2(mouseY-roboY, mouseX-roboX));   rotate(radians(90));     //Hitbox   fill(0, 0);   stroke(160);   ellipse(0, 0, 78, 78);    noStroke();    //Track Connectors   fill(129, 29, 29);   rect(18, 12, 10, 8);   rect(18, -12, 10, 8);   rect(-18, 12, 10, 8);   rect(-18, -12, 10, 8);    //Robo Body   fill(63, 82, 21);   rect(0, 0, 13, 30);   ellipse(7, 15, 20, 20);   ellipse(-7, 15, 20, 20);   ellipse(7, -15, 20, 20);   ellipse(-7, -15, 20, 20);   rect(9, 0, 16, 23);   rect(0, 17, 20, 15);   rect(-9, 0, 16, 23);   rect(0, -17, 20, 15);    //Robo Body Details   fill(120);   ellipse(0, 0, 25, 25);    fill(60);   rect(0, -18, 6, 36);   rect(0, -36, 10, 5);   ellipse(0, 0, 20, 20);    fill(255, 0, 20);   ellipse(10, 18, 5, 5);     //Robo Tracks    //Right   fill(80);   rect(25, 0, 12, 34);   ellipse(24, 20, 10, 10);   ellipse(26, 20, 10, 10);   ellipse(24, -20, 10, 10);   ellipse(26, -20, 10, 10);    //Left   rect(-25, 0, 12, 34);   ellipse(-24, 20, 10, 10);   ellipse(-26, 20, 10, 10);   ellipse(-24, -20, 10, 10);   ellipse(-26, -20, 10, 10);    //Track Details   fill(140);   for (int i = -21; i< 22; i += 6) {     rect(25, i, 12, 2);     rect(-25, i, 12, 2);   }   popMatrix(); }       float [] [] bobject= new float [][] {{250, 250}, {500, 500}, {100, 100}}; void object() {   fill(255);   stroke(0);   circle(bobject[0][0], bobject[0][1], 20);   circle(bobject[1][0], bobject[1][1], 20);   circle(bobject[2][0], bobject[2][1], 20); }   void stopRobot() {            if(dist(x1,y1,bobject[0][0],bobject[0][1])<=45){     speed=0;     if(mouseX<bobject[0][0]){       speed=0.03;}     if(mouseY>bobject[0][1]){       speed=0.03;}     }                     if ( x1<=0+45) {     speed=0;     if (mouseX>=0) {       speed=0.03;     }   }   if ( x1>=width-45) {     speed=0;     if (mouseX<=width-45) {       speed=0.03;     }   }   if ( y1<=0+47) {     speed=0;     if (mouseY>=0+47) {       speed=0.03;     }   }   if ( y1>=height-45) {     speed=0;     if (mouseY<=height-45) {       speed=0.03;     }   } }    This is the code, basically the idea is, that if the robot collides with the wall/objects it stops, independently from the position of the small circles. Somehow i cant paste in the code so heres a link to the file  If anybody could help me, that would be nice

With the help of the Stack Overflow community I've written a pretty basic-but fun physics simulator.    You click and drag the mouse to launch a ball.  It will bounce around and eventually stop on the "floor".  My next big feature I want to add in is ball to ball collision.  The ball's movement is broken up into a x and y speed vector.  I have gravity (small reduction of the y vector each step), I have friction (small reduction of both vectors each collision with a wall). The balls honestly move around in a surprisingly realistic way.  I guess my question has two parts:   What is the best method to detect ball to ball collision? Do I just have an O(n^2) loop that iterates over each ball and checks every other ball to see if it's radius overlaps? What equations do I use to handle the ball to ball collisions? Physics 101 How does it effect the two balls speed x/y vectors?  What is the resulting direction the two balls head off in?  How do I apply this to each ball?     Handling the collision detection of the "walls" and the resulting vector changes were easy but I see more complications with ball-ball collisions.  With walls I simply had to take the negative of the appropriate x or y vector and off it would go in the correct direction.  With balls I don't think it is that way.  Some quick clarifications: for simplicity I'm ok with a perfectly elastic collision for now, also all my balls have the same mass right now, but I might change that in the future.    Edit: Resources I have found useful  2d Ball physics with vectors:  2d Ball collision detection example:     Success!  I have the ball collision detection and response working great!  Relevant code:  Collision Detection:  for (int i = 0; i < ballCount; i++)   {       for (int j = i + 1; j < ballCount; j++)       {           if (balls[i].colliding(balls[j]))           {             balls[i].resolveCollision(balls[j]);         }     } }   This will check for collisions between every ball but skip redundant checks (if you have to check if ball 1 collides with ball 2 then you don't need to check if ball 2 collides with ball 1.  Also, it skips checking for collisions with itself).  Then, in my ball class I have my colliding() and resolveCollision() methods:  public boolean colliding(Ball ball) {     float xd = position.getX() - ball.position.getX();     float yd = position.getY() - ball.position.getY();      float sumRadius = getRadius() + ball.getRadius();     float sqrRadius = sumRadius * sumRadius;      float distSqr = (xd * xd) + (yd * yd);      if (distSqr <= sqrRadius)     {         return true;     }      return false; }  public void resolveCollision(Ball ball) {     // get the mtd     Vector2d delta = (position.subtract(ball.position));     float d = delta.getLength();     // minimum translation distance to push balls apart after intersecting     Vector2d mtd = delta.multiply(((getRadius() + ball.getRadius())-d)/d);        // resolve intersection --     // inverse mass quantities     float im1 = 1 / getMass();      float im2 = 1 / ball.getMass();      // push-pull them apart based off their mass     position = position.add(mtd.multiply(im1 / (im1 + im2)));     ball.position = ball.position.subtract(mtd.multiply(im2 / (im1 + im2)));      // impact speed     Vector2d v = (this.velocity.subtract(ball.velocity));     float vn = v.dot(mtd.normalize());      // sphere intersecting but moving away from each other already     if (vn > 0.0f) return;      // collision impulse     float i = (-(1.0f + Constants.restitution) * vn) / (im1 + im2);     Vector2d impulse = mtd.normalize().multiply(i);      // change in momentum     this.velocity = this.velocity.add(impulse.multiply(im1));     ball.velocity = ball.velocity.subtract(impulse.multiply(im2));  }   Source Code:     If anyone has some suggestions for how to improve this basic physics simulator let me know!  One thing I have yet to add is angular momentum so the balls will roll more realistically.  Any other suggestions?  Leave a comment!


While on a call, if I receive a text message, the notification sound for text message plays during the call. How do I mute the notification sounds for text messages while I'm on a phone call? My device is Samsung Galaxy 6 Edge.

I call somebody, or somebody calls me, we are talking. Now, during the call I got SMS and I cannot hear anything because the SMS notification is playing.  So how to disable this notification when call is active? Thank you in advance.  Samsung Galaxy Ace 2, Android 2.3.  Note: I am interested in setting this once and for good. Not something I have to remember to switch off each time I make/get a call.


I want to prevent duplicate records of an object in Salesforce. I know how to do it by writing a trigger,but some one told me it can be possible by validation rule also.  Can anyone help me how to avoid duplicate records using validation rule ?

I have a custom object with name and a lookup to contact among other fields.  The need that i have is that i need to make sure that only record name should not be duplicated for a contact.  There can be duplicate names as long as its not the same contact. We should not allow duplicate names for the same contact.  Can we achieve this using validation rules? I am trying to avoid using triggers if this can be achieved using validation rules.


Let consider an $SU(2)$ doublet of bosons $\Phi =(\phi_A, \phi_B)$ which is described by the Lagrangian $$L = (\partial_{\mu}\Phi)^{\dagger}(\partial_{\mu}\Phi) +a^2 V(\Phi^{\dagger} \Phi) -\frac{\lambda}{4} (\Phi^{\dagger} \Phi)^2$$ where $a^2, \lambda >0$. this Lagrangian is invariant under a global $SU(2) \times U(1)$. In order to require the Lagrangian to be invariant under a local $SU(2) \times U(1)$ transformation we have to replace derivatives by covariant derivatives induced by an $U(1)$ gauge field $B_{\mu}$ and vector bosonic $SU(2)$ gauge field $W=(W^1,W^2,W^3)$. The continuation is well known: one observes that the field $\Phi^{\dagger} \Phi$ with respect the potential $V:= a^2 V\Phi^{\dagger} \Phi -\lambda/4 (\Phi^{\dagger} \Phi)^2 $ has non-vanishing VEV (vacuum expectation value), one chooses an arbitrary non zero vacuum value and breaks the symmetry in usual way. One of the main motivations for this SSB (spontaneous symmetry breaking) mechanism is to explain how the obtained gauge bosons $Z_{\mu}$ and $W^{1/2}_{\mu}$ become massive bosons and one recognizes this property by observation that after symmetry braking the new Lagrangian contains terms $$\frac{g_W^{1/2} v^2}{8}W_{\mu}^{1/2} W^{1/2 \mu}\\ \frac{(g_W^2+g_B^2) v^2}{8}Z_{\mu}Z^{\mu}$$ which conventionally regarded as mass terms. My question is simply is there any reason why one needs to introduce to principle of spontaneous symmetry breaking in order to obtain massive bosons (the mass is necessary to explain the short rangeness of the weak force)? From naive point of view one might also try to extend the initial Lagrangian 'by hand' with 'mass terms' in gauge bosons. Why is this approach nowhere studied or compared with the conventional SSB mechanism which explains the massiveness of the gauge bosons? What are the advantages? Is it simply easier to develop the theory in consistent way? Are the concrete calculations in most cases easier to perform?

Question: Why can't we add a mass term for the gauge bosons of a non-abelian gauge theory?   In an abelian gauge theory one can freely add a mass and, while this breaks gauge invariance, as long as the coupling current is conserved everything works fine (i.e., the scalar modes decouple and the theory is renormalisable).  In non-abelian gauge theories, it is often stated that the only way to introduce a mass term is through the Higgs mechanism. If we added a mass term without introducing the Higgs field, but the coupling current is still conserved, at what point would the theory break down? It seems to me that the scalar modes decouple as well, at least to tree level. I failed to push the calculation to one loop order, so maybe the theory breaks down here. Is this the most immediate source of problems, or is there any simpler observable which fails to be gauge invariant?  One would often hear that if we break gauge invariance the theory is no longer renormalisable. I may be too naïve but it seems to me that a (gauge-fixed) massive gauge boson has a $\mathcal O(p^{-2})$ propagator and therefore (as long as the current in the vertices is conserved) the theory is (power counting) renormalisable. Or is it?  To keep things focused, let us imagine that we wanted to give gluons mass, while keeping self-interactions and the coupling to matter (and ghosts) unchanged. Could this work without a Higgs?    There are many posts about that are asking similar things. For example,    asks about the mass of fermions, not of the gauge bosons.  same as above.  same as above.  is a list of modifications/generalisations to the Higgs mechanics, but doesn't discuss if it is avoidable at all.


This is a sorting algorithm test file. I am getting NullPointer error:  "Exception in thread "main" java.lang.NullPointerException     at Test.loadFiles(Test.java:28)     at Test.main(Test.java:39)"   The problem seems to be with "filecache[x].setName(nameOffiles[x]);" Please guide. Thanks.  import java.io.File; public class Test {    static File folder = new File("D:\\");    static File[] listOfFiles = folder.listFiles();    static String[] nameOffiles = new String[30];    static long[] sizeOffiles = new long[30];    static int i = 0;    static MyFile filecache[] = new MyFile[30];    public static void readFiles(){       for (File file : listOfFiles) {          if (file.isFile()) {             nameOffiles[i] = file.getName();             sizeOffiles[i] = file.length();             i++;          }        }        i = 0;    }    public static void loadFiles(){       for(int x = 0; x <nameOffiles.length; x++){          filecache[x].setName(nameOffiles[x]);          filecache[x].setSize(sizeOffiles[x]);       }    }    public static void testFiles(){       Sorting sort1 = new Sorting();       sort1.quickSort(filecache);    }    public static void main(String[] args) {       readFiles();         loadFiles();       testFiles();       for(int x = 0; x < filecache.length; x++){          System.out.println(filecache[x]);       }    } }

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 have this 4 tags, each is repeated once. Of course, I have 800 html files. And I don't know which of them has recurring tags. <link rel="stylesheet" type="text/css" href="BEBE/style.css" media="screen"> <link href="css/style.css" rel="stylesheet" type="text/css" media="all"> <link rel="stylesheet" type="text/css" href="BEBE/style.css" media="screen"> <link href="css/style.css" rel="stylesheet" type="text/css" media="all">  Output <link rel="stylesheet" type="text/css" href="BEBE/style.css" media="screen"> <link href="css/style.css" rel="stylesheet" type="text/css" media="all">  The regex I use, it finds all duplicate lines but also the blank ones. Or, I need just those meta tags, and after a replace to become only one of each. Search: (?-s)^(.*)\R(?s)(?=.*^\1(?:\R|\z))

Can I replace identical lines with just one line at the end in Notepad++? E.g. from:  1st January 2013 //some text1 1st January 2013 //some text2 1st January 2013 //some text3 1st January 2013   to:  //some text1 //some text2 //some text3 1st January 2013   Also is it possible, if I have all dates from 1 to 30 or 31, to replace them individually at their last appearance?


i have a Map like  Map <String, List<Object>> timeSerisData   which contains two lists one is headerList and another is dataList but internally dataList contains another Objects, means my dataList is list of Objects. So now i am getting that headerList and dataList like this:  @PostMapping("/doExportData") @Timed public void doExportData(@Valid @RequestBody Map <String, List<Object>>  timeSerisData){     List<Object> headerList = new ArrayList<>();     List<Object> dataList = new ArrayList<>();             for(Map.Entry<String, List<Object>> entry :              timeSerisData.entrySet()) {          if(entry.getKey() == "headerData") {              headerList = entry.getValue();             System.out.println("headerlist"+headerList);          }else {              if(entry.getKey() == "dataList") {                  dataList = entry.getValue();                 System.out.println("data list"+dataList);             }          }      } }      In above code in dataList i am getting list which contains two objects   like this:[{Ticker=GSU,Name=Revenu,Year=2015, dataList=[1,2,3,4,5,6]},   {Ticker=GSU, Name=Gross,Year=2018, dataList=[7,8,9,10,11,12]}]   Now i want to get the values of this dataList and want to set that in pojo class. So how to get those values.

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?


Can some explain how Regex engine works when it tries match    ^4$ to 749\n486\n4    I am mean how Regex engine parse string While performing match

In the Stack Overflow podcast #36 (), this opinion was expressed: Once you understand how easy it is to set up a state machine, you’ll never try to use a regular expression inappropriately ever again. I've done a bunch of searching.  I've found some academic papers and other complicated examples, but I'd like to find a simple example that would help me understand this process.  I use a lot of regular expressions, and I'd like to make sure I never use one "inappropriately" ever again.


I just read a wikipedia page on the . Apparently people have made pretty accurate estimates for almost 200 years. How did they do this? How did they measure any fundamental constant accurately before they had modern technology?

I am interested in the practical method and I like to discover if it is cheap enough to be done as an experiment in a high school.


I'm using 12.04, I accidentally used Ctl-Alt-F9 and got a black full screen with command line cursor (Terminal).  How can I go back to the normal Unity screen?

I tried to install an nvidia driver and there was an error saying I must not be in an X terminal when doing so. So I did a Ctrl+Alt+F1.  The resulting terminal did not allow the nvidia driver to be installed and showed the same error message. How do I revert back to the Unity GUI?


I am trying this simple task to add a feature class to an mxd (ArcGIS 10.3) but getting few errors. Here are two options I tried.  1) Preferred option - adding feature class itself into a active dataframe of the current mxd. I used the script below:  import arcpy  mxd=arcpy.mapping.MapDocument("CURRENT")  DF=mxd.activeDataFrame  arcpy.mapping.AddLayer(DF,"C:\Work\GP1500\Tests\Input.gdb\Poly1","TOP")   The addLayer line generates the error below ......  assert isinstance(add_layer, Layer) AssertionError  2) Create a layer from the Feature class and add the layer using the script *****  import arcpy  mxd=arcpy.mapping.MapDocument("CURRENT")  DF=mxd.activeDataFrame  FC="C:\Test.gdb\Test_Poly1"  arcpy.MakeFeatureLayer_management(FC,"TestPolyLayer")  inputlayer =arcpy.mapping.layer(TestPolyLayer)  arcpy.mapping.AddLayer(DF,inputlayer,"TOP")   ******It generates the error while executing the second last line i.e. to define input layer with following message AttributeError: 'module' object has no attribute 'layer'  Note: the second option i used is after I saw Nick's reply in

I am trying to automate various tasks in ArcGIS Desktop (using ArcMap generally) with Python, and I keep needing a way to add a shapefile to the current map. (And then do stuff to it, but that's another story).  The best I can do so far is to add a layer file to the current map, using the following ("addLayer" is a layer file object):  def AddLayerFromLayerFile(addLayer):  import arcpy  mxd = arcpy.mapping.MapDocument("CURRENT")  df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0]  arcpy.mapping.AddLayer(df, addLayer, "AUTO_ARRANGE")  arcpy.RefreshActiveView()  arcpy.RefreshTOC()  del mxd, df, addLayer   However, my raw data is always going be shapefiles, so I need to be able to open them. (Equivalently: convert a shapefile to a layer file without opening it, but I'd prefer not to do that).


I am new to android and i am trying to make a stopwatch but dont know whats wrong with my code. I am getting this error-                                                                                java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.Button.setOnClickListener(android.view.View$OnClickListener)' on a null object reference   Please help.  StudyTimeFragment.java  package com.studypal.khadija.studypal;  import android.app.Fragment; import android.os.Bundle; import android.os.SystemClock; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.Chronometer;  public class StudyTimeFragment extends Fragment {  public Button startbutton; public Chronometer studywatch;  @Override public View onCreateView(LayoutInflater inflater, ViewGroup container,                          Bundle savedInstanceState) {      View rootView = inflater.inflate(R.layout.fragment_studytime, container, false);      startbutton=(Button)rootView.findViewById(R.id.button);     studywatch = (Chronometer)rootView.findViewById(R.id.chronometer);     startbutton.setOnClickListener(new View.OnClickListener() {         public void onClick(View v) {             // Perform action on click             studywatch.setBase(SystemClock.elapsedRealtime());             studywatch.start();             return;         }     });     return rootView;  } }   fragment_studytime.xml   <?xml version="1.0" encoding="utf-8"?>  <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"  android:layout_width="match_parent" android:layout_height="match_parent">  <Chronometer     android:layout_width="88dp"     android:layout_height="91dp"     android:id="@+id/chronometer"     android:layout_gravity="top|center"     android:layout_marginTop="175dp"     android:width="150dp"     android:height="150dp"     android:textSize="70dp" />  <Button     android:layout_width="wrap_content"     android:layout_height="wrap_content"     android:layout_marginTop="300dp"     android:layout_gravity="top|center"     android:text="Start"     android:clickable="true"     android:onClick=""     />   </FrameLayout>


Are the lore associated with Knights of the Old Republic (and soon to be released Old Republic) video game considered as Star Wars canon?

For all types of derivative works, namely:   Movies Novels Comic books Other written works (including RPG materials) Cartoons Video games Derivative movies (such as the infamous Ewok movies and even more infamous )   According to what rules does something become "canon" and who is responsible for the evaluation of a published work?


I have heard part of the explanation and that is that air on the top part of the aircrafts wing wants to move in a straight line, but the air is pulled down the slope or camber, but that's as far as I got. So why would pulling air downwards cause this pressure difference?

What aerodynamic effects actually contribute to producing the lift on an airplane?  I know there's a common belief that lift comes from the Bernoulli effect, where air moving over the wings is at reduced pressure because it's forced to travel further than air flowing under the wings. But I also know that this is wrong, or at best a minor contribution to the actual lift. The thing is, none of the many sources I've seen that discredit the Bernoulli effect explain what's actually going on, so I'm left wondering. Why do airplanes actually fly? Is this something that can be explained or summarized at a level appropriate for someone who isn't trained in fluid dynamics?  (Links to further reading for more detail would also be much appreciated)


For some reason this is my folder structure:  I have a Desktop folder nested inside the This PC folder which is in another Desktop folder. I cannot figure out how to fix this. As far as I know, this is how it is supposed to be:  What should I do??? I am running Windows 10.

My file explorer isn't showing the relationship of the Desktop shortcut with other shortcuts correctly.  As you can see here, "This PC," "Libraries," etc., are showing under "Desktop," which is not what I wanted. I'd like all the shortcuts above to be displayed at the outmost level. The only change that I've committed and relate is that I changed the directory of the desktop into this:  But I've done nothing other than I can relate to this problem. Can anyone please help? Thanks in advance.


Please find the code snippet below :  public static void main(String[] args)  {     System.out.println(args[0]=="abc"); }   I am getting the output as false (believe me I am passing abc as command line args i.e. java Main abc from command line)         Can somebody explain me the reason behind "false" in the output? what I could conclude is command line args are created on heap,but couldn't find the concrete reason/explanation for the same.I understand String comparison and difference between equals and ==.Are command line args not stored in String pool?


After upgrading to ubuntu 16.04, whenever I run sudo apt update, I receive Reading Package List Error and for most of the archives, Failed to fetch  http://. . .  Empty files can't be valid archives. Following the suggestion on Ubuntu forum when I issue the following:    sudo rm /var/lib/apt/lists/* -vf sudo apt-get clean sudo apt-get update sudo apt-get upgrade    things get back on track.  However after a few days I encounter the same problem again. How can I resolve this issue?

After upgrading from 15.10 to 16.04, I am receiving the following error on apt-get update:  Reading package lists... Done E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/restricted/source/Sources  Empty files can't be valid archives E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/universe/source/Sources  Empty files can't be valid archives E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/multiverse/source/Sources  Empty files can't be valid archives E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/restricted/binary-amd64/Packages  Empty files can't be valid archives E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/restricted/binary-i386/Packages  Empty files can't be valid archives E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/restricted/i18n/Translation-en  Empty files can't be valid archives E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/universe/binary-amd64/Packages  Empty files can't be valid archives E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/universe/binary-i386/Packages  Empty files can't be valid archives E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/universe/i18n/Translation-en  Empty files can't be valid archives E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/multiverse/binary-amd64/Packages  Empty files can't be valid archives E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/multiverse/binary-i386/Packages  Empty files can't be valid archives E: Some index files failed to download. They have been ignored, or old ones used instead.   Does anyone know how to solve this error?


Let S be an arbitrary set. Let $F=\{f:\{0,1\}\to S\}$ be the set of functions from $\{0,1\}$ to S. Construct a bijection $F→S \times S$.   I think I would define the function $a(f)=(f(0),f(1))$ because we know that both $f(0)$ and $f(1)$ are in $S$, but I don't know where to go from there.

My knowledge of constructing bijections is very poor and I would really appreciate any clarification or assistance.  The question I am having trouble with is the following:   Let $S$ be an arbitrary set.  Let $F=\{\{0,1\} \xrightarrow{f} S \}$ be the set of functions from $\{0,1\}$ to $S$.  Construct a bijection $F \xrightarrow{\alpha} S \times S$.


The $2 \times 2$ matrix $A$ satisfies    $$A^2 - 4A -7I = 0,$$   where $I$ is the identity matrix. Prove that $A$ is invertible.  I'm not sure how to do this. Help would be appreciated.

The $2 \times 2$ matrix ${A}$ satisfies ${A}^2 - 4 {A} - 7 {I} = {0}$ where ${I}$ is the $2 \times 2$ identity matrix. Prove that ${A}$ is invertible.  I have tried to solve it like a quadratic, but that doesn't work.  Any help is appreciated!


How can I determine the CCD (imaging area width) given image details such as focal length? I have images taken by cameras, but very little information about the cameras themselves (I have focal length and resolution). Given this, is there any way to determing the CCD width

How to calculate sensor size (width/height) when knowing focus length, vertical & horizontal angle view (FOV)?


package Josh_the_bot;  /**  *  * @author Jarvis-Main  */ import java.util.*; import javax.swing.JOptionPane; public class Josh_the_bot {      /**      * @param args the command line arguments      * @throws java.lang.InterruptedException      */     public static void main(String[] args) throws InterruptedException {         // TODO code application logic here          Scanner namea = new Scanner (System.in);         int temperature = 0 ;         String theName;         theName = "Josh";         String name = JOptionPane.showInputDialog("Hello What Is Your Name?");         int namez = Integer.getInteger(name);         String namereply = JOptionPane.showInputDialog( "O hello" + namez );         int lel = Integer.parseInt(namereply);   I get this error  Exception in thread "main" java.lang.NullPointerException at Josh_the_bot.Josh_the_bot.main(Josh_the_bot.java:27)   Java Result: 1

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?


Two grocers agree that the daily demand for a particular item has Poisson distribution. However, grocer $A$ claims that the mean demand is $3$ items per day, while grocer $B$ claims that the mean demand is $6$ items per day.   They agree to resolve the disagreement by observing the demand on one particular day: $B$ agrees to accept $A$’s claim if the observed demand is $4$ or less, and $A$ agrees to accept $B$’s claim if the observed demand is $5$ or more.  (a) Calculate the probability that $A$’s claim is accepted when, in fact, $B$’s claim is correct

I want to find the probability that mean is less than 5 given that poisson distribution states it is 6 ie find p(x<5|x~po(6))  Here is the actual question: Two grocers agree that the daily demand for a particular item has Poisson distribution. However, grocer A claims that the mean demand is 3 items per day, while grocer B claims that the mean demand is 6 items per day. They agree to resolve the disagreement by observing the demand on one particular day: B agrees to accept A’s claim if the observed demand is 4 or less, and A agrees to accept B’s claim if the observed demand is 5 or more. (a) Calculate the probability that A’s claim is accepted when, in fact, B’s claim is correct


I'm looking through some c++ wrapper code that provides a c api, and I'm finding lots of reinterpret_cast where a static_cast would suffice, e.g.:  struct cpp_object{ void foo(){ /* do something */ } };  /* begin: c api */ typedef void c_object;  void foo(c_object *o) {     // why this:     reinterpret_cast<cpp_object *>(o)->foo();     // instead of just:     static_cast<cpp_object *>(o)->foo(); } /* end: c api */   Generally I use reinterpret_cast in rare situations, mostly related to forced bit coersion of buffer contents to a type of know layout and size, known to lie inside buffer contents.  So I ask whether that practice makes sense or sticking to static_cast would be a better one.

Both static_cast and reinterpret_cast seem to work fine for casting void* to another pointer type. Is there a good reason to favor one over the other?


I have a textfile where the text inside looks like this:      first line : some content     second line: some content     third line : some content     fourth line: some content   I want to add "some content" between the 2cnd and third line, but with       out.println(somecontent)   it writes in front of the file. Another point is that I sometimes need to change the firstline-content with the thirdline-content. Is it the best solution to create a second file or to save it temporary in strings? And how do i get my program to write the string between the other files?

What is the best way to write bytes in the middle of a file using Java?


I am working on a jsp page where i want to redirect to pages according to following condition. only the else part is working even when i type Google in text field. P.S. I am hosting it on localhost Glassfish Server   <%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE html> <html> <head>     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">     <title>JSP Page</title> </head> <body> <%     String x = request.getParameter("browse");     if (x == "Google" || x == "google") {         response.sendRedirect("http://www.google.com");     } else if (x == "youtube" || x == "Youtube" || x == "you tube" || x == "Music") {         response.sendRedirect("http://www.youtube.com");     }else {         response.sendRedirect("http://localhost:11146/Project_Julie/" + x + ".jsp");     } %> </body> </html>

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?


Whenever I close a file with unsaved changes, Sublime Text displays this dialog:    (Note that Save is selected by default)  In Windows, I would press "N" for "no" to close without saving changes, but in macOS it doesn't look like there's such a shortcut. I've also tried with the arrow keys and tab but the active button doesn't change.  How is this normally done in macOS?

One thing I do a lot is Command ⌘-Tab over to TextEdit, jot down some notes, and then decide to throw them away.  I can close the window with ⌘-W, but is there a way to not-save it from just the keyboard?  Escape simply cancels the close. ⌘-D takes the file-picker to the Desktop (and I thought this used to work, pre-Lion, but maybe I'm just imagining it).  Is there a keyboard shortcut for Don't Save, short of turning on Full Keyboard Access?


The logs found in: C:\Program Files\Microsoft\Exchange Server\V15\Mailbox\Mailbox Database   Are these used to support the indexing or something important? I only ask because they take up a chunk of space and if they're just used for error/warning logging I was wondering if it was possible cut down on them through a setting I'm unaware of?

I'm a bit of an Exchange admin noob so I don't know if this is normal, but on our Exchange 2007 server under C:\Program Files\Microsoft\Exchange Server\Mailbox\First Storage Group\ there are 30,000 1MB .log files.  I don't know if those should be there or not, but they keep multiplying like little jackrabbits.  I've so far resisted deleting them as I'm sure something would break, but it's come to the point now where our 80GB disk is completely full up and Exchange has stopped receiving messages.  My best guess is that these are transaction logs and would be useful in rebuilding the database should something go awry, but 30GB of transaction logging seems a bit excessive.  Is there a way to limit it or is that even a good idea?  And of course did I completely miss the point?


I've been working recently on 3D printing TSP maps. I've included a pretty simple sample right here:  The issue is that when I try to manipulate this figure, it recognizes it as 25 separate sections. I thought that there may have been some node limit per object, but as it turns out, some of the sections were not properly joined (I only discovered this around 25000% zoom)  The end node shown is in the EXACT same position as the end node of the adjacent object not highlighted, but they are definitely different. (I can move each independently) I don't know how to join them, and the research I've done hasn't yielded much...I don't mind fixing it, but I don't know how.

You can see there two bezier curves that I want to connect together. How can I do that? My current area with the peak consists of many small bezier curves which is totally intolerable because it makes the processing of the picture much harder later.


I found many journals require the department information for all authors during submitting manuscript. However, some authors indeed don't have department information. How can I fill this form in this condition?

Recently my paper is reviewed (by a professor from independent third party) and accepted by a journal. But, my employer allows me to publish this paper only without its name there.  Publishing house is expecting affiliation for each author, i.e. I can not leave affiliation as blank.   What should I write as the affiliation?


I have access to both Dungeon and Dragon Magazines through my D&D Insider subscription, but WOTC only lists their articles in the database by title. What would really help is if it a list exists categorizing the adventures by level, setting, and story path (if they have one). Does this exist?

used to go to a spreadsheet with all the 4E adventures published in Dungeon Magazine (and possibly some others, IIRC) during that edition's duration. I remember it listed out each adventure by name, start/end level, adventure path, and maybe even a little summary blurb.  However, the spreadsheet behind that link seems to have disappeared into the digital ether, and I can't find a copy of it in my own google drive (implying I never made a copy of it).  Does anyone happen to have a copy of that spreadsheet that they could share, and/or other resources that would let me sort through the many adventures from 4E Dungeon Magazine?


I have a USB flash drive that's become unreadable in any computer. It has a lot of confidential information on it which I need to wipe before sending it back to the manufacturer for a warranty replacement.  What would be the best way to do this given that I can't get any computer to read the drive and format it?

I've had two 32GB SanDisk MicroSD cards go bad recently.  One I was able to temporarily revive using the kind advice offered in this thread:   When I insert the other into a reader, it registers as 30.6MB (that's MB, not GB).  I've tried all sorts of software and other techniques to revive this card and retrieve the important data off of it (including FindAndMount and TestDisk).  Nothing has worked.  So I'm thinking of returning the card for a refund.  But first, I would like to make it unreadable by someone more skilled than myself.  Is there any way to do this, given that I cannot even format the card or get it to be recognized as more than 30.6MB?  I am looking for a method that does not entail the kind of obvious physical destruction that would jeopardize obtaining a refund from the retailer.  If Costco (where the card was purchased) accepts physically destroyed cards for return, then physical destruction is acceptable (but please have knowledge that they do).  Given two failures, I don't really want to send the card to SanDisk for replacement, because I no longer trust the reliability of their products.


I am storing latitude and longitude at the server side (JAVA Platform).   To store those values, I am using float and double datatype at the server side. I came to know that float and double are not a recommended primitive datatypes (which is not recommended to use currencies in professional way), because float and double having rounding precision problem.  In my case, I am just comparing the stored coordinates (latitude and longitude) at the server side.  Question 1:  Comparing the coordinates with the datatypes (float or double) will make any problem in future?  Question 2:  Using big decimal is good? or Going with float or double is safer?

Bearing in mind that I'll be performing calculations on lat / long pairs, what datatype is best suited for use with a MySQL database?


I have the following function:   int func(int carg, const char **varg) {    //code ...  }   My understanding is the following:  varg is a pointer to a second pointer. This second pointer points to a char. This char is ...   either: a single char (1st case) or: a char that constitutes the first char of a char array. (2nd case)   Is this understanding correct?   The thing I don't understand is why you would want to pass a pointer to a pointer as an argument.  If you wanted to pass (by reference) a single char to the function, you could simply write:   int func(int carg, const char *v) {        //code ... }   In the 2nd case, where you want to pass (by reference) a char array to the function, one could use the same function (where this time, v points to the first element of the array passed to the function):   int func(int carg, const char *v) {    //code ...  }   In summary, I don't understand why you would want to use a pointer to a pointer as argument to a function.  The concrete case I have is the following declaration of a main function:   int main(int carg, const char **varg);   **varg handles the arguments on the command line. One can access the command line arguments using varg[1], varg[2], etc. So, obviously, what **varg does is simply to save the command line arguments in an array. But this could be achieved in a more simple way with the following code:   int main(int carg, const char *varg);    What am I missing?

What is the correct (most efficient) way to define the main() function in C and C++ — int main() or void main() — and why? And how about the arguments? If int main() then return 1 or return 0?  There are numerous duplicates of this question, including:       — For C++, with a very good answer indeed.     Related:


I have put a downloaded iso image of Texlive 2019 on Linux (Mint 19.3, 32 bit) desktop. I open the terminal in the desktop and perform the following commands  $ mkdir mountpoint $ sudo mount -o loop texlive2019-20190410.iso mountpoint $ Password: $ cd mountpoint/ $ ./install-tl   Everything works and the following prompt appears   Actions:  <I> start installation to hard disk  <P> save installation profile to 'texlive.profile' and exit  <H> help  <Q> quit   I press I, but I get the following error:  Installing to: /usr/local/texlive/2019  install-tl: No binary platform specified/available, quitting.   How can one solve this problem?  P.S. I can install Texlive without problem on Windows with the same iso image.

I have just received the TeX Collection 2019 DVD and tried to use it to install texlive on a 32bit linux PC. The installer said something along the lines that no binary was available for my system and gave a list of 5 choices. I selected 64bit linux in the hope that it might work. It installed but the binaries couldn't run. The documentation showed a list of some 16 binaries, so the DVD and the documentation do not match.  How can I do a texlive 2019 install for a 32 bit linux OS?


I really want to make the SW coke gammon in the slow cooker, but I'm going to be out of the house for around 6 hours is it safe to leave it unattended?

Is it safe to leave a slow cooker (Crock-Pot) on unattended (for example, while you're at work and no one is home)? Or is that a fire hazard?


Is it possible to highlight the OP's name in the comments in Android app?

On the websites, whenever the OP comments on an answer, or on his question, his name is highlighted. This is a handy feature because you can easily tell whether the comment is from the OP or not.   But on the Android mobile app (don't know about iOS),  this feature is not there. Can we have it please!?


What exactly does putting extern "C" into C++ code do?  For example:  extern "C" {    void foo(); }

Why do we need to use:  extern "C" { #include <foo.h> }   Specifically:     When should we use it? What is happening at the compiler/linker level that requires us to use it?   How in terms of compilation/linking does this solve the problems which require us to use it?


I have installed Ubuntu 16.10 server and installed all applications I need.  Now my question is how to convert that all into iso?

I am new to linux, but had a question. I am getting in the business of buying old computers, putting Linux on them, then donating them to students who don't have their own computer at home. I have gone through and installed Xubuntu on my system, installed/uninstalled all the software that I want/need, and now want to know if there is a way that I could make an ISO of my system, and put it onto ANOTHER computer, and still have all of my tweaks, and programs ready to go after the ISO has installed. That way I don't need to go through and spend an hour or two on every computer.   What programs would you recommend for creating an ISO like this?   Thanks, Tobin


I'm struggling to convert ISO 8601 datetime coming from angular datetime component on the client side in the python backend. The date is coming from the angular-material-datetimepicker library in this format: '2016-10-24T10:00:00.000Z'. How do I convert to a datetime object to send to the datastore? I'm using Google App Engine. Here's what I've tried fiddling with in pycharm among other things I've found on other forums;  works  >>> datetime.datetime.strptime('2016-10-24T10:00:00Z', '%Y-%m-%dT%H:%M:%SZ') datetime.datetime(2016, 10, 24, 10, 0)   does not work  datetime.datetime.strptime('2016-10-24T10:00:00.000Z', '%Y-%m-%dT%H:%M:%SZ')      As seen above, the first command with the 'nanoseconds i think?' does not work. That is the actual format angular sends through. When I remove .000 it works as seen in the second command. What method call should I execute on the first date for it to work? Also I tried;  >>> datetime.datetime.strptime('2016-10-24T10:00:00.000Z', '%Y-%m-%dT%H:%M:%S%fZ')

I need to parse  strings like "2008-09-03T20:56:35.450686Z" into Python's datetime type.  I have found  in the Python standard library, but it is not very convenient.  What is the best way to do this?


I am testing many things in my investigation and I could also have a side hypothesis about certain relationship. However previous research shows that there is no relationship. Does it make sense to hypothesise no effect? My sample is quite small so it is very likely that I would find support for the "no effect".

As the question states - Is it possible to prove the null hypothesis? From my (limited) understanding of hypothesis, the answer is no but I can't come up with a rigorous explanation for it. Does the question have a definitive answer?


If DES decryption is the same as encryption done in reverse order, then how can the reversed S-Box convert 4 bits into 6 bits?

So, as an exercise to greater understand some things about cryptography, I decided to try and implement GOST 28147-89, which uses eight 4x4 S-Boxes. I can grasp the concept of putting 4 bits through the S-Box and getting four out, but how would one reverse this?  Furthermore, how would one reverse uneven S-Boxes, such as DES's 6x4 S-Box, when multiple inputs give the same output (e.g., for DES's S-Box S5, where inputs of 100011, 101110, 011101, and 010000 all give an output of 1000).


I was approached through direct message by a female account on Instagram (which seemed to be catfished) saying that she is a “sugar mummy” willing to pay $300 weekly for a sugar baby. “She” basically said that since covid is so bad right now, all she needs for now is someone to give her a lot of attention (essentially an online relationship). I was pretty high to be quite honest and I felt like playing along cause it all seemed funny at the time. She asked me a few questions which I answered, and then she said “we can start your payment today”. I asked if she could do etransfer or PayPal but she said she could only send me money by emailing me photos of a cheque. I’m able to deposit cheques on my mobile bank app so I said okay sure. However, then she said she needed to send money to her friend who isn’t so tech savvy and can only receive online transactions through etransfer, but the sugar momma already mentioned she can’t do etransfer so she needs me to do it... She said her friend is someone who can buy her some video card thing for her computer which she mentioned earlier today, but the weird thing is, the cheque she sent me was for $600, which means that she was giving me and her friend the exact same amount, which is really weird. At the time I was like wait this wasn’t a scam this was real, and I impulsively deposited the cheque. My first guess is that she lied and the person I need to etransfer the $300 to for her is someone like me, “the sugar baby”. But just now, at 2am, she finally sent me the email to the person she wants me to send the $300 to, and i asked if I could send it the morning because it’s late and I’m gonna sleep now, but then she said: “ Yes i know it’s pretty late dear. But it’s just you could do within a minute. Once you do I’ll be heading to bed also dear😴.“ It’s pretty late right now and I’m half asleep so if my writing is weird, that’s why. I don’t know what to do about the situation I am in right now. If anyone has any suggestions about what to do (or what NOT to do) moving forward with my situation. Screenshot of account:

I met a guy on a sugar daddy dating site and we talked, I told him my situation and he said he would help.   He asked for my bank account information and I told him you can use cash app or PayPal to go through. He said his account manager deals with his finances. So I set up an account with a bank that I don’t use so that my primary account isn’t used.  Eventually he was in the process of sending me money and we had agreed on a amount that wasn't crazy. But then he asked for my address and I asked why and he said just wondering. Then said he wanted to send me a surprise for being his baby. Which I didn’t give.  Then later on he sent the money and said he sent me a bonus and that I was supposed to use that to pay his mothers caregiver, which he didn’t mention until after.  I kept questioning him and he was saying that he works in construction and he’s trusting me to carry out the errand. Then he said don’t let him down and I asked him if he was threatening me and he kept saying I need this done but didn’t really answer my question.  Am I being scammed? I’m about to change my password but is this a scam?


Is it possible to have the icons in the dock be moved to the center of the screen instead of the left side? I have a 21:9 screen so its rather annoying to tilt your head all the time.  Please note that I'm talking about the position of the icons no the docks position. Assume that the dock is located at the bottom but it doesn't really matter.  E: This solves that:

Just upgraded from Ubuntu 17.04 to Ubuntu 17.10.  Please help me to shift the side bar (aka Ubuntu Dock) to bottom.   I tried running the following command which used to work with older Ubuntu releases   gsettings set com.canonical.Unity.Launcher launcher-position Bottom   but it's not working.


I am trying to evaluate the effect of a certain policy on the achievement gains of students between two points in time. However, not all the students are exposed to this policy. I am supposed to use  the gain score as a dependent variable. After having read many critical articles about the use of gain scores as outcome variables, I would like to ask if somebody could tell me the advantages of this approach (compared to using the post-test score as an outcome variable while controlling for the pre-test score). Is it wrong to say that only when using the difference score as an outcome I can really answer the question of whether competences of students grow faster when they are exposed to this policy? I feel like using the post-test score as an outcome variable does not precisely give me an answer to this question. I would really appreciate if somebody could give me some advice on that

Imagine the following common design:   100 participants are randomly allocated to either a treatment or a control group the dependent variable is numeric and measured pre- and post- treatment   Three obvious options for analysing such data are:   Test the group by time interaction effect in mixed ANOVA Do an ANCOVA with condition as the IV and the pre- measure as the covariate and post measure as the DV Do a t-test with condition as the IV and pre-post change scores as the DV   Question:    What is the best way to analyse such data?  Are there reasons to prefer one approach over another?


I use the KOMA-script to write the thesis and when i call the \listoftables I would like to modify some entries. For example, for the following table:  \begin{table} \centering \begin{tabular}{c|cc|cc|cc|cc}      &\multicolumn{2}{c}{Model 1} & \multicolumn{2}{c}{Model 2} & \multicolumn{2}{c}{Model 3} & \multicolumn{2}{c}{Model 4}       \tabularnewline    \hline  \hline   $ A $ & & & &  &  & & &  \tabularnewline              $ B $ & & & &  &  & & &\ \tabularnewline \hline \end{tabular} \caption{{\sc Size}: Rejection frequencies of asymptotic and bootstrap test.  The sample $T$ is 1000.  Note that we use the principal component analysis for A.} \label{tab:size} \end{table}     I would like only this sentence in the list of table: {\sc Size}: Rejection frequencies of asymptotic and bootstrap test. If you need more information about my .tex, let me know.

I would like to change the caption in the List of Tables in a way it is different from the caption in the corresponding table. How can I do that? Does there exist a command to do that?


This question is different from  I'm asking "Why". And, putting a tag of 'feature request' to improve this site.   It has happened with me a couple of times. I answer the question and then after some hours or even days, the question is 'entirely' changed invalidating my answer. This might have happened with new users here as they are advised to improve their question (for better clarity) by seniors on this site, which is absolutely fine. But then, there should be some system that notifies all the answerers so that they can improve their answers as well (depending on the change).  One such example is here. This question first asked 'object' and its verb. Now which object was not so clear as the picture first showed a girl, a bag, infusion set, peripheral venous catheter etc. Since asked by a layperson, I answered it 'bag' and 'intravenous' or 'infusion'.  But then, after a day, the OP comes with a new image now clarifying what exactly he wants. I'd have answered 'IV bag' at first, if this image could have been in the original question.  This is okay in normal cases, but then, in some unfortunate cases, changing the question invalidates the answer completely. And then, it starts attracting downvoting.  There should be a system (and it does not take much pain) wherein the 'answerers' are notified whenever the question is being changed. 'Edit' in questions are not that frequent but whenever there are, they are the crucial ones.

Consider this situation. I post a legitimate and correct answer to a question and receive a few upvotes. Then the OP realizes that's not what they wanted to ask, and significantly rewrites the question, rendering my answer irrelevant and useless. Ideally the OP would comment on every answer saying "check my edit" but some people don't know to do that.  This leaves two possibly bad situations:   I never know, the answer stays, and the votes don't reflect the usefulness of the answer anymore. All of a sudden I get an influx of downvotes because my answer isn't helpful anymore. If I'm checking and notice my rep has dropped, I come back after the fact, edit the answer, and bring it back to the original quality. This is great, but 9 times out of 10, the downvoters never come back and notice the answer has been edited. It might get more upvotes, but it still doesn't reflect the true value of the answer.   If we can get notified when the OP gets edited, we can nip it in the bud and go back to edit our answers to match - thus maintaining the quality of the answers on SO.


In the movie Baahubali, why did Kattappa kill Baahubali?

In , why did Kattappa kill Baahubali?   I saw the movie 2 times, but I'm still confused. Is there any indication in the film why Kattappa did this?


This should be pretty easy, but every time I come up with something it loops over too many times and makes the list extremely long.  What I want is an output that looks like this:  output = ['http://data.neonscience.org/api/v0/data/DP1.00095.001/KONZ/2018-01', 'http://data.neonscience.org/api/v0/data/DP1.00095.001/KONZ/2018-02]    I have the below information. Ideally I'd like to be able to add to any of these lists and create more urls from there.   SERVER = "http://data.neonscience.org/api/v0/data/" SITECODE = ["KONZ","KONA","DCFS","WOOD"]  PRODUCTCODE = ["DP1.00095.001","DP1.00040.001","DP1.00041.001","DP1.00094.001"] DATES = ['2018-01','2018-02','2018-03','2018-04','2018-05','2018-06']  SERVER = "http://data.neonscience.org/api/v0/data/DP1.00040.001/KONZ/" SERVER2 = "http://data.neonscience.org/api/v0/data/DP1.00040.001/KONA/" SERVER3 = "http://data.neonscience.org/api/v0/data/DP1.00040.001/DCFS/" SERVER4 = "http://data.neonscience.org/api/v0/data/DP1.00040.001/WOOD/"  x = (SERVER  + PRODUCTCODE[i] + '/' + SITECODE[i] + '/' + DATES[i])  gets = []

How can I get the Cartesian product (every possible combination of values) from a group of lists?  Input:   somelists = [    [1, 2, 3],    ['a', 'b'],    [4, 5] ]   Desired output:  [(1, 'a', 4), (1, 'a', 5), (1, 'b', 4), (1, 'b', 5), (2, 'a', 4), (2, 'a', 5) ...]


I am appending a small block of code that has inside of it an image that when clicked triggers a click event on the input for file uploading. When the page is loaded and/or refreshed, there is only one block that once changed, fires the event to append  a new one.

             <input type="file" name="imagem[]" class="none file-chooser" required/>

   The JQuery code for appending:  $('#novo_anuncio .file-chooser').change(function() {     readURL(this);     $('#novo_anuncio .add_new_image').append(         '
\n\
\n\                 <input type="file" name="imagem[]" class="none file-chooser" required/>\n\                 \n\
\n\
'); });   The problem is that the appended code does not trigger the click event on the input. The code is identical and it is appended correctly inside of the .add_new_image main tag. What could be wrong?

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


I have installed Ubuntu Gnome 16.04.  But I saw something is wrong in gnome-tweak-tool 3.18  As you can see in below, the older version of gnome-tweak-tool had a Window Theme option :   But in gnome-tweak-tool 3.18 there in no option for Window Theme :   And the question is how can I change Window Theme in gnome-tweak-tool 3.18 ?  Any helps would be appreciated.

One ubuntu setup looks the following way in gnome-tweak-tool:      I'm customizing a new machine,  but the "Window" option is no longer available:      The first image is from Ubuntu 14.04, and second is from 16.04.1.    How can I bring the window option back?  Am I missing some kind of package?


I dual booted my laptop by installing Ubuntu 14.04 along with Windows 8.1. Now when I power on my laptop by default it boots with Windows. How can I set Ubuntu to boot by default?

I have Windows 7 and 8 installed on my laptop, I just installed Ubuntu.  It normally boots up in Windows 8, how do I change that?


Apparently sometimes a Windows Update includes reinstalling Bloatware such as Candy Crush Saga. Is there any way to prevent this from happening instead of having to manually remove everything again and again and again...?

After installing the Windows Anniversary Update for Windows 10, I realized that there seems to be a feature that lets Microsoft install third-party applications from the Microsoft Store on my system, without my consent or knowledge (for example,  or ).  Anticipating that this might happen again in the future, is there a way to disable these kind of third-party application installations for future updates? Or will I always have to search and uninstall all these applications after each update?


Is it possible to install NFS carbon on Ubuntu? If so can you tell me how ? I have the setup.exe for the bonus edition of the game

Can .exe and .msi files (Windows software) be installed in Ubuntu?


Why multiplication of matrix is not done in the same way as matrix addition (i.e. adding corresponding entries)? I know it is related to linear transformation, but by reading book I'm unable to visualize it.

Most of the time I see matrix multiplication presented and defined, as a seemingly arbitrary sequence of operations. For example, the  I'm currently reading for a linear algebra course defines the product $AB$ as the $(i, j)$ entry in the $1 \times 1$ matrix that is the product of the ith row of $A$ and the jth column of $B$. Properties of matrix multiplication are subsequently proven based upon this definition. The definition is clear, but why the matrix product is useful is not clear to me as a student. A  I'm referencing defines the product $AB$ in terms of linear combinations.   The problem I have is doing matrix multiplication quickly by hand, particularly when the $A$ is $p \times 1$ and $B$ is $1 \times q$. I would like to know of how to look at or define matrix multiplication, in a manner which makes it easy (for the average student) to compute by hand, while being intuitive and consistent for use for later proofs.   wikipedia has a great .


I know that is because maybe the plug I'm plugin it is not grounded, I have the 3 pin power adapter, I live in Argentina where voltage is 220v from the power plug, is there any way to ground my MacBook in order to not feel that static sensation, because I feel like its gonna broke something on the MacBook.  Is there any wrong on using my MacBook with this static sensation when rubbing it ?

The aluminum Macbook Pro gives a mild shock when connected to a wall socket and charging. It only happens when I'm, for example, not wearing shoes or slippers and my feet are resting on the ground (i.e. by body is acting as a conductor). I contacted apple and I was told to perform the following steps:  Shutdown  hold ⇧+ctrl+⌥+power for 10 seconds  wait 30 seconds then hold ⇧+ctrl+⌥+R+power (Let the Mac reboot three times with that apple tone, then let go. The Mac reboots again.)   This did not fix the problem and I was not told what these steps were supposed to do. They have asked me to purchase a three pin version of the adapter and see if that fixes my problem. My last MacBook Pro was giving pretty severe jolts towards end of life. Hence a bit concerned. Question  Has anyone here experienced such a problem?  Is anyone aware of what the above sequence of steps supposed to do?  Also, will this damage the Macbook in some way?


I am currently studying in Canada since a year. I am planning to travel to Karachi, Pakistan in the mid of Dec 2015. Since connecting flights were quite expensive in that peak time, so I booked two non-connecting flight that first takes me from Calgary to Dubai, the other from Dubai to Karachi.  The confusion is I don't have visa for Dubai, so am I still able to use Dubai as transit route to take my another flight to Karachi and return back via same route?  Your response will be highly appreciated.  Thanks

My uncle is traveling from Dubai to Amsterdam and then to Quito. He is citizen of Ecuador and Pakistan, currently in Pakistan. He will arrive at 5 AM in Dubai from Lahore and leave Dubai at 11:55 PM on the same day.  I want to know how long he can stay in Dubai airport without visa. He will travel by KLM airlines from Dubai to Amsterdam and then from Amsterdam to Quito. Does he need a visa in Dubai?


Can I import a my bib file IEEE Trans by simply typing between the \begin{thebibliography} and \end{thebibliography} tags \input{./Master.bib} or am I forced to use this style as suggested in ?  \begin{thebibliography}{1}  \bibitem{IEEEhowto:kopka} H.~Kopka and P.~W. Daly, \emph{A Guide to \LaTeX}, 3rd~ed.\hskip 1em plus   0.5em minus 0.4em\relax Harlow, England: Addison-Wesley, 1999.  \end{thebibliography}

I've browsed the forums and found a number of posts that have addressed this issue, but none of the solutions seem to work for me. I have the following script that I just copied from the bibtex home page to get familiar with it. Instead of the citation number I get a question mark. I compile using Latex+Bibtex+Latex+Latex+PDFLatex+ViewPDF just as has been previously suggested and the problem persists.   \documentclass[11pt]{article} \usepackage{cite}  \begin{document}  \title{My Article} \author{Nobody Jr.} \date{Today} \maketitle  Blablabla said Nobody ~\cite{Nobody06}.  \bibliography{mybib} \bibliographystyle{plain} \end{document}   My bibliography (Bib.bbl)  @misc{ Nobody06, author = "Nobody Jr", title = "My Article", year = "2006" }    Looking at previous posts one thing that is concerning is that my .bbl looks empty as shown below. Further, I don't have a .blg  \begin{thebibliography}{}  \end{thebibliography}


So basically what i have been struggling with is to evaluate sentence in EF Core.  For example if i have:   string condition = "65 < 100 AND 65 > 50"   How can evaluate that?

I would like to do the equivalent of:  object result = Eval("1 + 3"); string now    = Eval("System.DateTime.Now().ToString()") as string   Following Biri s , I got this snippet (modified to remove obsolete method ICodeCompiler.CreateCompiler():  private object Eval(string sExpression) {     CSharpCodeProvider c = new CSharpCodeProvider();     CompilerParameters cp = new CompilerParameters();      cp.ReferencedAssemblies.Add("system.dll");      cp.CompilerOptions = "/t:library";     cp.GenerateInMemory = true;      StringBuilder sb = new StringBuilder("");     sb.Append("using System;\n");      sb.Append("namespace CSCodeEvaler{ \n");     sb.Append("public class CSCodeEvaler{ \n");     sb.Append("public object EvalCode(){\n");     sb.Append("return " + sExpression + "; \n");     sb.Append("} \n");     sb.Append("} \n");     sb.Append("}\n");      CompilerResults cr = c.CompileAssemblyFromSource(cp, sb.ToString());     if (cr.Errors.Count > 0)     {         throw new InvalidExpressionException(             string.Format("Error ({0}) evaluating: {1}",              cr.Errors[0].ErrorText, sExpression));     }      System.Reflection.Assembly a = cr.CompiledAssembly;     object o = a.CreateInstance("CSCodeEvaler.CSCodeEvaler");      Type t = o.GetType();     MethodInfo mi = t.GetMethod("EvalCode");      object s = mi.Invoke(o, null);     return s;  }


If a creature is engulfed by a Gelatinous Cube and a character casts Banishment (or similar teleportation/planar magic) on the Cube, would the engulfed creature be affected even though the spell specifies one creature?

If a creature with the ability to swallow other creatures is banished what happens to a still living swallowed creature (i.e. PC)?    The  spell has the following key points:     "You attempt to send one creature that you can see" "While there, the target is Incapacitated" "The target remains there until the spell ends"   The thing is, you only targeted one creature.  So what creature(s) are affected in this situation and how?  You can't see the swallowed creature, so how is it affected?  I can see several possible scenarios:   The swallowed creature is left behind.  Could be a useful way to save someone swallowed. The swallowed creature is also banished.  It is treated the same as the banished creature and is also incapacitated.  It may or may not take ongoing damage during this time (for instance the acid damage from the stomach). The swallowed creature is also banished.  It isn't affected by the incapacitation and could fight its way out of the creature that did the swallowing.  If it gets out, it is just in the demiplane alongside the banished creature.  It may or may not stay behind in the demiplane since it wasn't the target and the spell fails to pull it back.   Background: Our party is about to face a Kraken (party member stole from the temple of the God of Sea and Treachery despite the cleric vehemently warning against taking anything).  This thing seriously outclasses us (level 10 party members) if it is the full version of the Kraken.    We've faced a baby version of this before.  If this is the full CR23 version, the only thing I can see that can get us out is the cleric's Divine Intervention, running away while it is banished, or an exploit like being able to banish the creature with someone(s) inside who can then escape and attack it without being attacked in response.


I would like to use ssh with port forwarding by default. So I added the following ssh command to a script (with made-up server names): ssh -f -N user@server -L 8080:server:8080  where server is a remote server. Everything works except that if the script is run a second time, ssh complains that bind [127.0.0.1]:8080: Address already in use  Is there a way to tell ssh to test and do the port-forwarding only when the port/address is available?

I have a script which connects to a remote host to replicate some files via SSH.  I must connect to an rsync daemon listening on port 873.  To accomplish this I have a ssh configuration like this.  Host blah     LocalForward 10873 127.0.0.1:873     Hostname 10.2.4.1   Unfortunately because of the timing of this script, there is a small chance that on occasion when it attempts to establish the SSH session another similar script will have the port open to a different host.  If I connect while another ssh session is open I get the obvious message Address already in use.  me@local:~$ ssh blah bind: Address already in use channel_setup_fwd_listener: cannot listen to port: 10873 Could not request local forwarding. Linux remote 2.6.26-2-amd64 #1 SMP Tue Jan 25 05:59:43 UTC 2011 x86_64 motd... remote:~$    What I want to have happen is to have the SSH client immediately exit with a exit code so I can put some logic into my script to report a failure instead of trying to run any commands against the port forwarded to the incorrect host.


For me, intuitively, integral $2\pi y~dx$ make more sense. I know intuition can not be proof, but by far, most part of math I've learned does match with my intuition. So, I think this one should 'make sense' as well. Probably I didn't understand the way surface area is measured. It will be great if any one could tell me how 'integral $2\pi y~dx$' is wrong. (By the way, how to use mathematical symbols in texts?)

Suppose we rotate the graph of $y = f(x)$ about the $x$-axis from $a$ to $b$.  Then (using the disk method) the volume is $$\int_a^b \pi f(x)^2 dx$$ since we approximate a little piece as a cylinder.  However, if we want to find the surface area, then we approximate it as part of a cone and the formula is $$\int_a^b 2\pi f(x)\sqrt{1+f'(x)^2} dx.$$  But if approximated it by a circle with thickness $dx$ we would get $$\int_a^b 2\pi f(x) dx.$$  So my question is how come for volume we can make the cruder approximation of a disk but for surface area we can't.


I'f you're familiar with Python, I'm sure you're aware that you can multiply a String by an Integer to get that desired amount of Strings back.     Example:  'J' * 3 --> 'JJJ'     What's the most efficient way to do this in JavaScript?  I was looking for an inline method; similar to that of Pythons behaviour    A few of my ideas:  var str = 'J',     strOld = str,     timesToExtend = 3;  for(var i = 0; i < timesToExtend; i++){     str += strOld; }  = 'JJJ'     var str = 'J',     timesToExtend = 5,     strOld = str;  while(!timesToExtend){   str += strOld;   timesToExtend--; }     These are just rough ideas, so don't expect them to be 100% accurate and working. I assume this MUST contain a loop; however any method without a loop will be praised!  Thanks for reading; thank you for your response in advance!

What is the best or most concise method for returning a string repeated an arbitrary amount of times?  The following is my best shot so far:  function repeat(s, n){     var a = [];     while(a.length < n){         a.push(s);     }     return a.join(''); }


In Cambridge dictionary， the pronunciation of responsibility is /rɪˌspɑːn.səˈbɪl.ə.t̬i/， but I am pretty sure p is not pronounced /p/, at least not the same way as /p/ in peach. So what is happening here?

I've pronounced "p" in "hospital" as "p" for many years and just noticed that some people pronounced it as "b". Please refer to  for its pronunciation and . Which one is correct, "p" or "b"? Or maybe both of them are correct?


I have dual monitor.  In windows 7, I usually like put two or three windows in left monitor, the quick way is :   move window 1 to left edge, Windows auto resize it to haft window size move window 2 to left edge, Windows auto resize it to haft window size, move window 2 to right part of left monitor. (if need three, need adjust their width)   But in windows 10:   move window 2 to left edge would happen:     Here, window 2 replace window 1, and window 1 be shinked. Need one more click to restore window 1 and two more movements to make window 1 in left part of left monitor, window 2 in right part of left monitor.  You should know, because of dual monitor, move window 2 to right edge of left monitor would not auto resize itself to half window size.  How can I disable this shrink in windows 10 ??? I'd like the windows 7 style, no shrink, don't swap window 1 and window 2 position

When you snap a Window to the left half or right half or your screen by pressing Win+[Left|Right], Win10 suggests some open apps that you can pin in the other half.  This steals my keyboard focus away from the app I was trying to work in. How do I disable this "feature"?


For example, LXS = Alexis, or RTQL8N = articulatin'. I seem to recall there being a word for this.

For example:   Icy → IC Excel → XL Easy →  EZ*     * This spelling is based upon the U.S.A's. more recent pronunciation of the letter , which is /ziː/, rather than the British style /zed/. Compare with the pronunciation of , which is /iːzi/ in both regions. See: O.A.L.D.


Let $f$ and $g$ be $n$ times differentiable functions then prove that $$\frac {d^n}{dx^n}(fg)=\sum _{i=0}^n \binom{n}{ i} f^{(i)}g^{(n-i)} $$ where $f^{(k)} $ is $k$-th  derivative with respect to $x $.    Now I started with Mathematical Induction. I know its true for $n=1$ so skipped it. Let it be true for $m<n $ thus $$\frac {d^m}{dx^m}(fg)=\sum_{i=0}^{m} \binom {m}{i}f^{(m)}g^{(m-i)} =s .$$ We need to prove this for $m+1$ . Note that $m+1 <n $ is also true. So we see that  $$\frac {d^{m+1}}{dx^{m+1}}(fg)=\frac {d}{dx}(s).$$ But now problem here is that I don't know how to differentiate this whole $s$ as we cant use Leibniz rule to prove Leibniz rule.

Assume $f$ and $g$ are differentiable at $x$. Prove that $(fg)^{(n)} = \sum_{k=0}^n \binom{n}{k}f^{(k)}(x)g^{(n-k)}(x)$   I am assuming here $fg = f(x) g(x)$. Then we can prove this via induction. If $n = 0$ we have $1 = 1$ which is true. Now assume it is true for some $m$ we need to show it is possible for $m+1$. We have $(fg)^m = \sum_{k=0}^m f^{(k)}(x)g^{m-k}(x)$. How do we show that?