The groups_per_user function receives a dictionary, which contains group names with the list of users. Like the groups in Linux system. Users can belong to multiple groups. Fill in the blanks to return a dictionary with the users as keys and a list of their groups as values. basically I'm trying to reverse the assignment of groups to users instead of users to groups That's what I have tried so far: def groups_per_user(group_dictionary):     user_groups = {}     groups = []     # Go through group_dictionary     for group,users in group_dictionary.items():         # Now go through the users in the group         for user in users:         # Now add the group to the list of           # groups for this user, creating the entry           # in the dictionary if necessary           groups.append(group)           user_groups[user] = group      return(user_groups)  print(groups_per_user({"local": ["admin", "userA"],         "public":  ["admin", "userB"],         "administrator": ["admin"] }))  How can I traverse throw the list and at the same time add the user to the group name as efficient as possible? Please excuse my grammars, that's my fist question here. Thank you

Given a dictionary like so:  my_map = {'a': 1, 'b': 2}   How can one invert this map to get:  inv_map = {1: 'a', 2: 'b'}


Apologies for the confusing title but I couldn't think of a better way to phrase it. What I'm talking about is this:  $$ \sum_{i=1}^n \;i = \frac{1}{2}n \left(n+1\right)$$ $$ \sum_{i=1}^n \; \frac{1}{2}i\left(i+1\right) = \frac{1}{6}n\left(n+1\right)\left(n+2\right) $$ $$ \sum_{i=1}^n \; \frac{1}{6}i\left(i+1\right)\left(i+2\right) = \frac{1}{24}n\left(n+1\right)\left(n+2\right)\left(n+3\right) $$  We see that this seems to indicate:  $$ \sum_{n_m=1}^{n}\sum_{n_{m-1}=1}^{n_m}\ldots \sum_{n_1=1}^{n_2} \; n_1 = \frac{1}{m!}\prod_{k = 0}^{m}(n+k) $$  Is this a known result? If so how would you go about proving it? I have tried a few inductive arguments but because I couldn't express the intermediate expressions nicely, I didn't really get anywhere.

Can someone tell me how to get a closed form for  $$\sum_{k=1}^n k^p$$  For $p = 1$, it's just the classic $\frac{n(n+1)}2$.   What is it for $p > 1$?


Whenever I boot to Ubuntu and boot into Windows again my time changes to GMT. Why is this and how can I fix this?

Dual boot system Windows XP Pro and Ubuntu 12.04.  I have the bios set for the correct time and Ubuntu set for US Eastern time.  Ubuntu will boot up and the time will be off by -4 hours.  If I correct the time in Ubuntu then when I boot up in Windows XP the time will be off by + 4 hours.  This is a fresh install of 12.04. I did not have this problem before reinstalling Ubuntu.


When Snap updates a program it keeps the before versions installed. For example, I had Skype installed with the 60 version ( 567 MB ),but then it was updated with 63 version (606 MB) and finally the actual 66 version ( 607 MB ). As is the program uses 1.7 GB in the hard disc. If an user has in his system a few programs installed using Snap, probably it doesn't a big problem but if the idea is that in the future the most program is istalling as is, it will use a lot of space in the hard disc, and the process won't be efficient. If I uninstall Skype and re install again, it uses only 607 MB. If this issue is not known, how can I comunicate to Ubuntu programers to review it and try to improve the process ?

So I installed vlc daily built snap package. It's working great, no problems there. However I noticed that after upgrade the system has 2 versions of vlc (7 and 9). That can be seen when browsing /snap/vlc/ directory and using system monitor. This is also the case with other snaps. Is there a way to automatically delete older versions of snaps? Or do I just delete them using plain "rm" command? Is it safe to delete them that way?


How to do unit tests on a multithreaded server?  Assuming I have a server that extends a thread class and every connected client will be a subthread. This server accepts a new client using socket api.  What is a good way to do unit tests on this server?  What should the unit tests cover?  I wonder how to simulate clients.   Update: I decided to share my code on

I have thus far avoided the nightmare that is testing multi-threaded code since it just seems like too much of a minefield.  I'd like to ask how people have gone about testing code that relies on threads for successful execution, or just how people have gone about testing those kinds of issues that only show up when two threads interact in a given manner?  This seems like a really key problem for programmers today, it would be useful to pool our knowledge on this one imho.


How can we say that $$\text{Power} = \mathbf{F}\cdot \mathbf{v}$$  We know that small work done by a force $\mathbf{F}$ to displace an object by '$\mathbf{x}$' is  $$W = \mathbf{F}\cdot \mathbf{x}$$  So derivating wrt time, we get   $$\begin{align} P=\dfrac{dW}{dt}&=\frac{d\mathbf{F}}{dt}\cdot \mathbf{x}+\mathbf{F}\cdot\dfrac{d\mathbf{x}}{dt}\\ &=\frac{d\mathbf{F}}{dt}\cdot \mathbf{x}+\mathbf{F}\cdot\mathbf{v} \end{align}$$  We get this wrong result. How actually can we show $P=\mathbf{F}\cdot\mathbf{v}$ ?  Edit  Actually I know that total work $W$ is $\int \mathbf{F}\cdot d\mathbf{x}$.  Infinitesimal work done by $\mathbf{F}$ to displace body by $d\mathbf{x}$ will be $dW = \mathbf{F}\cdot d\mathbf{x}$, so dividing by $dt$ on both sides gives $$P =\dfrac{dW}{dt} = \mathbf{F}\cdot \frac{d\mathbf{x}}{dt}$$  But I wanted a proper proof not involving differentials!

Let's say that we have a car travelling at a constant velocity (V) on a flat plane , let's assume that it's applied force or the force applied from its engine ( Fapp ) balances the frictional force ( Ffrict ) , hence the power due to Fapp is equal to Fapp×V , now let's assume that the same car now moves up an incline with the same engine power as previously stated and at a constant velocity ...but this time it will travel at a much lower constant velocity since the force which the engine exerts is much higher now in order to balance Fparalell and Ffrict , but what I don't understand is what caused this reduction in velocity , if the engine applies an equal force to that of the counteracting forces shouldn't that mean that there is no net force hence no change in velocity ,also if p=FV and if we now apply a greater force for the same velocity V why does the power increase , I know the answer can be simply explained using mathematics but my intuition says that power is the rate at which kinetic energy is transferred to a particle , so why would a greater force at the same constant velocity mean that you are transferring a greater amount of KE per unit time ?


My friend has shared his Steam library with me so I can play his games when he is not playing. He has Just Cause 3 with some DLC which I can play as i have made some progress in the Sky Fortress DLC.   If I buy Just Cause 3 for myself, what will happen to the DLC he purchased and shared with me? Will I still be able to play it?

Using Steam's Family Sharing feature, can you share DLC as well as games?


I'm creating a .command file (with macOS) that I want to be able to drop into any folder and have it create a .txt file relative to what ever folder it exists in.  Eg.  cd . echo -e "write this to the log" >> log.txt exit   The above doesn't work though. I've also tried cd pwd.   Is this possible to do?

How can I determine the name of the Bash script file inside the script itself?  Like if my script is in file runme.sh, then how would I make it to display "You are running runme.sh" message without hardcoding that?


Can someone please solve the following. I'm not good at proofs by induction. I know the base case but I don't know how to solve it after that for $(N+1)$ Let $a_1, a_2, · · · , a_n ∈ R,,$ where n is a positive integer greater than or equal to 2. Use induction to prove that $|a_1 + a_2 + · · · + a_n| ≤ |a_1| + |a_2| + · · · + |a_n|$.

I am trying to prove: $P(n): |x_1| + \cdots + |x_n| \leq |x_1 + \cdots +x_n|$ for all natural numbers $n$. The $x_i$ are real numbers.  Base: Let $n =1$:    we have $|x_1| \leq |x_1|$ which is clearly true  Step: Let $k$ exist in the integers such that $k \geq 1$ and assume $P(k)$ is true.  This is where I am lost. I do not see how to leverage the induction hypothesis.  Here is my latest approach:  Can you do the following in the induction step: Let $Y$ = |$x_1$ +...+$x_n$| and Let $Z$ = |$x_1$| +...+ |$x_n$| Then we have: |$Y$ + $x_n+1$| $\leq$ $Z$ + |$x_n+1$|. $Y$ $\leq$ $Z$ from the induction step, and then from the base case this is just another triangle inequality. End of proof.


Consider the following use of a hyphen:  There are many bear-like animals.  Now, how does the hyphenation change if "bear" is replaced by "grizzly bear"?  Which of the following would be appropriate:  There are many grizzly bear-like animals. There are many grizzly bear -like animals.  The intended meaning is not "There are many grizzly (gray-haired) animals that resemble bears," but rather "there are many animals that resemble grizzly bears (Ursus arctos)".

For example, "file system" and "related". Is it "file system-related"? It will appear as if it is a compound of "file" and "system-related", won't it?


Is there a symbol for multiply or divide, which acts like the $\pm$ symbol?

Is there mathematical sign that combines multiplication ($\times$) and division ($\div$) operations? Would that ever be used? For example $4({\times}{\div})2$ would give $8$ and $2$, like $4\pm 2$ would give $6$ and $2$.


I am not new to ubuntu, but have encountered this problem several times. I am running with a wired connection on ubuntu 12.04 LTS. When I worked with ubuntu for the first two- three weeks or so, the connection seemed to work fine, and I hadn't even set up the connection- it had been auto-detected by ubuntu, which is natural. But now, the connection seems to have not working (its not detecting at all) . On repeatedly restarting my computer, I found that the internet seeme to connect (or detect), like 1 out of 5-8 restarts. Is there any solution to this unusual problem, as I have tried all the solutions on this site and other sites too, but have not found a working solution. On my other partition on windows vista, this problem never occurs and the internet connection alway connects. PS: If there is any extra info I have to provide like error logs or any other info just tell me and I will do so, as I desperately want a solution.  Output for sudo lshw -c network-  *-network                   description: Ethernet interface    product: NM10/ICH7 Family LAN Controller    vendor: Intel Corporation    physical id: 8    bus info: pci@0000:01:08.0    logical name: eth0    version: 01    serial: 00:1a:92:6b:2e:b1    size: 100Mbit/s    capacity: 100Mbit/s    width: 32 bits    clock: 33MHz    capabilities: pm bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd autonegotiation    configuration: autonegotiation=on broadcast=yes driver=e100 driverversion=3.5.24-k2-NAPI duplex=full firmware=N/A ip=10.0.0.2 latency=32 link=yes maxlatency=56 mingnt=8 multicast=yes port=MII speed=100Mbit/s    resources: irq:20 memory:fdefe000-fdefefff ioport:ee00(size=64)   Output for cat /var/log/dmesg | grep eth0 -  [    1.199914] e100 0000:01:08.0: eth0: addr 0xfdefe000, irq 20, MAC addr    00:1a:92:6b:2e:b1 [   18.108866] ADDRCONF(NETDEV_UP): eth0: link is not ready [   19.317182] ADDRCONF(NETDEV_UP): eth0: link is not ready [   19.317593] ADDRCONF(NETDEV_UP): eth0: link is not ready [   19.320152] e100 0000:01:08.0: eth0: NIC Link is Up 100 Mbps Full Duplex [   19.320401] ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready

My connection was fine until now, but my wired connection is not working in Ubuntu 12.04.  I have installed Ubuntu 12.04 along side Windows 7 partition and the connection works on Windows but not on Ubuntu 12.04. I have no problem with wireless connection as well.  The problem is specific to the wired connection on Ubuntu 12.04. I have included a few details below.  ifconfig  eth0      Link encap:Ethernet  HWaddr 00:1e:ec:8d:f0:03             inet6 addr: fe80::21e:ecff:fe8d:f003/64 Scope:Link           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1           RX packets:1 errors:0 dropped:0 overruns:0 frame:0           TX packets:376 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:1000            RX bytes:316 (316.0 B)  TX bytes:33769 (33.7 KB)           Interrupt:19   eth2      Link encap:Ethernet  HWaddr 00:21:00:4e:ac:58             inet6 addr: fe80::221:ff:fe4e:ac58/64 Scope:Link           UP BROADCAST MULTICAST  MTU:1500  Metric:1           RX packets:1660 errors:0 dropped:0 overruns:0 frame:28           TX packets:1846 errors:61 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:1000            RX bytes:1372676 (1.3 MB)  TX bytes:254576 (254.5 KB)           Interrupt:18   lo        Link encap:Local Loopback             inet addr:127.0.0.1  Mask:255.0.0.0           inet6 addr: ::1/128 Scope:Host           UP LOOPBACK RUNNING  MTU:16436  Metric:1           RX packets:1862 errors:0 dropped:0 overruns:0 frame:0           TX packets:1862 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:0            RX bytes:155767 (155.7 KB)  TX bytes:155767 (155.7 KB)     sudo lshw -C network    *-network                       description: Wireless interface        product: BCM4312 802.11b/g LP-PHY        vendor: Broadcom Corporation        physical id: 0        bus info: pci@0000:03:00.0        logical name: eth2        version: 01        serial: 00:21:00:4e:ac:58        width: 64 bits        clock: 33MHz        capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless        configuration: broadcast=yes driver=wl0 driverversion=5.100.82.38 ip=10.0.0.3 latency=0 multicast=yes wireless=IEEE 802.11bg        resources: irq:18 memory:99700000-99703fff    *-network        description: Ethernet interface        product: RTL8101E/RTL8102E PCI Express Fast Ethernet controller        vendor: Realtek Semiconductor Co., Ltd.        physical id: 0        bus info: pci@0000:04:00.0        logical name: eth0        version: 02        serial: 00:1e:ec:8d:f0:03        size: 100Mbit/s        capacity: 100Mbit/s        width: 64 bits        clock: 33MHz        capabilities: pm msi pciexpress msix vpd bus_master cap_list rom ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd autonegotiation        configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=full firmware=N/A latency=0 link=yes multicast=yes port=MII speed=100Mbit/s        resources: irq:19 ioport:3000(size=256) memory:93410000-93410fff memory:93400000-9340ffff memory:93420000-9343ffff


To simplify the situation I'm having: I'm trying to terminate a thread while it is still running in Python 2.7, and I'm not sure how to do it.   Take this simple code:  import time import threading  def thread1():         print "Starting thread 1"         while True:                 time.sleep(0.5)                 print "Working"  thread1 = threading.Thread(target=thread1, args=()) thread1.start()  time.sleep(2) print "Killing thread 1" thread2.stop() print "Checking if it worked:" print "Thread is: " + str(thread1.isAlive())   Thread 1 keeps on 'working' and I'm trying to kill it in the main thread. Any idea on how to do it? I've tried:  threat1.terminate threat1.stop threat1.quit threat1.end   This all seems to point that there is no way to really stop it with a simple line of code. What could you suggest?

Is it possible to terminate a running thread without setting/checking any flags/semaphores/etc.?


It is something I already did in the past, several years ago, and I can't remember how I proceeded. I have a directory with two tex files which will be never merged. So I have something like paper1.tex, paper1.bib, paper2.tex, paper2.bib, etc... I would like to use paper1's theorems/propositions/definitions in paper2. paper1 is not finished. So the numbering in paper1 may change a lot.   Example: I have Theorem~2.8 in paper1 that I want to use in paper2 in \cite[Theorem~2.8]{paper1}. After modifying paper1, Theorem~2.8 becomes Theorem~3.5 and I would like that \cite[Theorem~2.8]{paper1} in paper2 automatically becomes \cite[Theorem~3.5]{paper1}.

I want to compile sections of the article independently. Clearly, I can make their numbers right just by using something like \setcounter{section}{4}.  How can I get something like \ref{VeryUsefulTheorem} working if the command \label{VeryUsefulTheorem} is in another section (i.e., in another TeX file, which is compiled to its own PDF file)?  I'm using the  package, and, therefore, inter-document links are clickable. Is it possible to make links to a stuff in a different PDF file clickable?


I already asked this question here, but realized that my description was too meager for people to help me. Therefore, I will try to describe the problem here in more detail. Data: layer 1 (tmc_segments), layer 2(regional_roads(earth)). Layer one contains simplified geometry of the road network. Layer two contains some roads from Layer one, but these roads are more detailed. Objective: to get from layer 1 only those roads that are on layer 2. Layer one contains two distinctive attributes:road_numbe and road name. Layer two contains one attribute Name, wich contains both number and name.

I have some difficulties with a task I have.  Data: layer 1 (tmc_segments), layer 2(regional_roads(earth)). Layer one contains simplified geometry of the road network (just simple lines with data about movement). Layer two contains some roads from Layer one, but these roads have more detailed geometry. Objective: to get from layer 1 only those roads that are present on layer 2. Layer one contains two distinctive attributes:road_numbe and road name. Layer two contains one attribute Name, wich contains both number and name.    As you can see, road geometry is very diferent, so Select by location not working that well.


There is a classic example that a spinning skater pulls his arms back. The angular momentum is conserved, the moment of inertia decreases. And therefore, it's angular velocity increases, so the rotational kinetic energy will increase. But what will happen if the skate pushes his arms outward? The rotational kinetic energy will decrease. But where will it go?

This may be a very basic question but I am not seeing how it works. Consider the standard example of an ice skate rotating about his/her center of mass and pulling in his/her arms. The torque is zero so we have conservation of angular momentum. This implies that $\omega$ increases to keep $I\omega$ constant, but then $K_{rot}=\frac{1}{2}I\omega^2$ doesn't stay constant, it increases. This implies that there is work done, but what force is doing this work?


I recently upgraded to 12.10 (fresh install). I am a facing weird problem:  When I boot, I get a message notifying me of low graphics. For now, I have been switching to console using Alt+F1 and then rebooting.  Upon reboot, I select recovery mode, allow system to boot and then again reboot.  Now I select normal mode and my graphics load smoothly.  Could you please tell me what could be the issue? I have a Dell Inspiron 5230 with Intel 4000 onboard graphics.

Note: This is an attempt to create a canonical question that covers all instances of "low-graphics mode" error that occurs to a user, including but not limited to installation of wrong drivers, incorrect or invalid lightdm greeters, low disk space, incorrect installation of graphics card like ATI and Nvidia, incorrect configuration of xorg.conf file while setting up multiple monitors among others. If you are experiencing the "low-graphics mode" error when trying to login but none of the following answers work for you, please do ask a new question and then update the answers of this canonical question as and when your new question gets answered.   When I try to boot into my computer, I am getting this error:  The system is running in low-graphics mode Your screen, graphics cards, and input device settings could not be detected correctly. You will need to configure these yourself.   How do I fix the failsafe X mode and login into my computer?  Answer index:


I'm trying to find away to load a different favicon on page refresh/load. I've had a quick google but noting seems to be showing up in terms of tutorials.

I have a web application that's branded according to the user that's currently logged in. I'd like to change the favicon of the page to be the logo of the private label, but I'm unable to find any code or any examples of how to do this. Has anybody successfully done this before?  I'm picturing having a dozen icons in a folder, and the reference to which favicon.ico file to use is just generated dynamically along with the HTML page. Thoughts?


I was wondering what would be the best way to 'set' different display styles for different posts in the loop on a category page?  That's what I would like to end up with:

First post

Second post

Third post

post 4...

post 5...

post 6...

   How can I achieve this?  Thanks :)

I am building a custom (child) theme and I want to style the first post of my loop in a different way than the others (bigger image, different position of some stuff).   Which is the best way of doing it? My "problem" is that my theme has support for different post types and the style would vary depending on the type of content, so I want to avoid repeating code as much as possible (i.e. using a function).   As I am a bit more used to OOP, my ideal scenario would be passing a variable to the view and check it in the loop of each content-type (that way I can re-use most of the code from the TwentyEleven templates). From what I know, that is not possible (please correct me if I am wrong).   For now, what I do is this:  function electric_index_loop($readMore = 0) {  $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $args = array(     //Excluimos los "miniposts" (citas, estados, enlaces...) del listado     'tax_query' => array(         array(             'taxonomy' => 'post_format',             'field' => 'slug',             'terms' => array('post-format-aside', 'post-format-link',                 'post-format-status', 'post-format-quote'),             'operator' => 'NOT IN'         )     ),     'posts_per_page' => 5,     'paged' => $paged );  // The Query query_posts($args);  // The Loop if (have_posts()) {     $post_count = 0;     global $more;     $more = $readMore; // 0 fuerza que se muestre sólo el "excerpt", 1 fuerza que se muestre todo el contenido     twentyeleven_content_nav('nav-above');     while (have_posts()) {         the_post();         if ($post_count == 0) {             get_template_part('highlight', get_post_format());         } else {             get_template_part('content', get_post_format());         }         $post_count++;     } } else {     ?>

<?php _e('Nothing Found', 'twentyeleven'); ?>

<?php _e('Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'twentyeleven'); ?>
             <?php get_search_form(); ?>

     <?php } wp_reset_query();}   As you see, I check the counter in the loop that I create in the function and ,if the current post is the first, I load a different template ("highlight").  I'd have to create different templates for the different types of content (which, in some cases sucks, because I can get all I need in some cases with just a CSS class).   Well, is there a better way of doing these? Perhaps a hook or something?   Thanks in advance!


If every Sylow subgroup of G is a normal subgroup, show that G is isomorphic to the product of its Sylow subgroups.  I can't figure this out without G being abelian.

I want to prove the following:     If every Sylow subgroup of $G$ is a normal subgroup, then $G$ is isomorphic to the product of its Sylow subgroups.   So far, I have gotten to realize that for every prime factor $p_i$ of $|G|$, there is exactly one Sylow subgroup and that these form a partition of $G$. However, I am having trouble finding the isomorphism between $G$ and the product which I will call $G_1 \times \ldots \times G_r$. My idea was just to use the mapping $(g_1, \ldots, g_r) \mapsto g_1\ldots g_r$, which is a bijection, but I don't see whether it is a homomorphism. In general, not all elements of $G_i$ commute with elements of $G_j$, so one cannot simply change the order of the elements in the product.


I need to write a trigger in which if an account that has related Opportunity and the user tries to delete that account it throws you an error.Here i am not understanding how to query Opportunity in account Trigger?

trigger preventAccountDeletionifopp on Account (before delete) {     for(account accdel:trigger.old){        Opportunity oppprevent =[select Name,(select Name,Owner from Opportunitys)from ACCOUNT =: accdel.id ];         if(oppprevent.size() > 0){           accdel.adderror('Opportunity record is refering this record.So, you cannot delete it...!');         }    } }


It's been awhile since I've played Pokemon X but just to make sure, I battled my rival again in Kiloude city and then went to Anistar city to see if the professor was at the sundial -- which he was not. I guess I must have upgraded my Mega Ring before I took a break, but I can't find any of the stones. at around 8:20 I went searching for the Mawileite on the second floor of the Shabboneau castle but it was not there. I'm thinking of deleting my data and starting over because this is really bothering me.

I upgraded my Mega Ring and have been looking for Mega Stones, and I found . However, the Mega Stone isn't in the place it's supposed to be, and I'm sure the location is right. Why isn't my Mega Stone here?


For example, I have started a visual studio instance, then I want to start a new visual studio instance in the windows 8's start screen with clicking the visual studio icon. But rather than starting a new instance, the system just bring me to the existing visual studio instance.  How could I set the default action for clicking to start a new process rather than switch to the existing process?  Thanks.

When selecting an application from the Windows 8 Start screen, if I already have that application running the default behavior is to set the focus to the most recently opened window.  Is it possible to change this behavior so it will always open a new instance of the application without having to right-click and select "Open new window"?


I wanted to test my controllers, and I have hard time with mocking objects. I have very simple method like this.   @RequestMapping(value = "/places", method = RequestMethod.GET) public String showPlacesByQuery(Model model, @RequestParam(value = "q", required = false) String query) {      Location location = geolocationParser.getCoords(query); //this line cause NPE     List placesList = placeService.findPublicPlaces(location, 0);      model.addAttribute("query", query);     model.addAttribute("placesList", placesList);     return "places/list"; }   I wrote test and I'm getting NullPointerException. I think the cause is that geolocationParser.getCoordS(query) returns null? or something is wrong with whole assignment Location location = geolocationParser.getCoords(query);   @Mock GeolocationParser geolocationParser;  @Mock PlaceService placeService;  @Before public void setUp() throws Exception {     MockitoAnnotations.initMocks(this); }  @Test public void testShowPlacesByQuery() throws Exception {      String query = "SomeQuery";     PlaceController placeController = new PlaceController();      Location location = mock(Location.class);     location.setCity("someString");     location.setLatitude("54.2323");     location.setLongitude("18.2323");      when(geolocationParser.getCoords(Mockito.anyString())).thenReturn(location);      List<Place> expectedPlaces = asList(new Place(), new Place());     when(placeService.findPublicPlaces(location, 0)).thenReturn(expectedPlaces);      MockMvc mockMvc = MockMvcBuilders.standaloneSetup(placeController).build();     mockMvc.perform(get("/places").param("q", query))             .andDo(print())             .andExpect(status().isOk())             .andExpect(view().name("places/list")); }   I spend hours to make it work, on different ways, with no results.

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?


the active button border is so thin I can barely see it (see attached image). Is there a way to change this to a thicker border or to a fully colored active button?

Is there any way to increase the visibility (e.g. thickness, contrast or colour) of bezel that surrounds the highlighted (aka selected) button in gnome window? TBH sometimes it is barely visible in default version. PS: I am using GNOME 3.28.2.  Here is a screenshot illustrating the issue (from a link posted in a comment):


it displays a window  that says Requires installation of untrusted packages it says:  This requires installing packages from unauthenticated sources.  details--codeblocks codeblocks-common codeblocks-contrib gamin libcodeblocks0 libgamin0 libwxbase2.8-0 libwxgtk2.8-0 libwxsmithlib0 valgrind   the pop up window also has two options: ok and repair.  when i am trying to click Ok it doesn't do anything and when i am trying to click repair the window appears another 3-4 times and in progress one program called update cache is running but the cache didnt get updated and apart from that i updated cache from the update centre.  Please Help

Any install that I'm trying through the Software Center is telling me:  Requires installation of untrusted packages: The action would require the installation of packages from not authenticated sources.  I did an apt-get update from the command line, then removed the software sources that the keys were bad from (PPAs I added myself), and unchecked them in the software sources for software center, but to no avail.  I can't install anything from software center anymore - only> from the command line with apt-get. Is uninstalling/installing the only option?  I don't want to break other PPAs that I have. Additional information: Here's a paste from apt-get update: Reading package lists... Done W: GPG error: http://ppa.launchpad.net oneiric Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B725097B3ACC3965 W: GPG error: http://us.archive.ubuntu.com oneiric Release: The following signatures were invalid: BADSIG 40976EAF437D05B5 Ubuntu Archive Automatic Signing Key <ftpmaster@ubuntu.com>  I've tried apt-key update, and there was no effect (two keys unchanged). The output of apt-get update and apt-get upgrade, and the contents of /etc/apt/sources.list, can be found in .


$G$ is a group, and $H$ is a nonempty subset of $G$. We know that, for any two values $a$ and $b$ in $H$, $ab^{-1}$ is also in $H$. Given this, how do we know that $H$ is also a subgroup of $G$? More specifically, I need help proving that, for every $a$ in $H$, $a^{-1}$ is also in $H$. Thank you.

I've been reading some stuff about algebra in my free time, and I think I understand most of the stuff but I'm having trouble with the exercises. Specifically, the following:     Prove that a nonempty subset $H$ of a group $G$ is a subgroup if for   all $x, y \in H$, the element $xy^{-1}$ is also in H.   Proving that the identity is in $H$ is easy: just take $x=y$, so $x x^{-1} = 1 \in H$. However, I'm having trouble showing that multiplication is closed and that each element in $H$ has an inverse. Can anyone give some hints?


In Englishes which allow the usage of ain't, why do we put "no" afterwards?       I ain't got no money.      Your dad ain't got no nose.   Is it compulsory to use no  in order to make a proper structure with ain't?

Is "not unpleasant" a double negative, and hence bad grammar?  See the first answer (by Ham and Bacon) to , for the basis of this question:     "Did you enjoy the movie?"      "Well, I didn't not enjoy it, but..."   Are all "not un..." forms incorrect?  They are very widely used, much more so than the blatant "not not" or "didn't not", etc.


I’m using Stack Exchange iOS app 1.7.0.1 beta and it expires shortly:        Latest stable version in the AppStore is 1.6.6 was released about 4 months ago.   What are the future plans of Stack Exchange team about the iOS app?  Will we see new beta in the next week?

The Stack Exchange beta iOS app distributed over TestFlight will expire in 2 days has expired. After the 100 day test period, the app won't start any more so all beta testers can't use the app then.  Can we please get an updated release so we don't have to remove the app and install the current release from the App Store instead?


I am trying to have my footer (just a div with a line of text in it) be at the bottom of the screen if the content doesn't go all the way to the bottom, or be at the bottom of the content if the content requires scroll bars.  If the content doesn't require scroll bars, it works perfectly, but when the content is too long, the footer is still in the same spot, sitting right on top of the content.  My basic div structure is:

   My corresponding CSS (stripped down somewhat):  body {     margin: 0;     padding: 0;     height: 100%; }  html {     margin: 0;     padding: 0;     height: 100%; }  #container {     width: 674px;     min-height: 100%;     height: 100%;     position: relative;     margin: 0 auto; }  #body {     width: 616px;     padding: 5px 14px 5px 14px;     margin: 0 auto;     padding-bottom: 20px; }  #footer {     position: absolute;     bottom: 0;     width: 644px;     height: 20px;     margin: 0 auto; }

I have a simple 2-column layout with a footer that clears both the right and left div in my markup.  My problem is that I can't get the footer to stay at the bottom of the page in all browsers.  It works if the content pushes the footer down, but that's not always the case.


I have an old (how could it be otherwise) HP elitebook 745 with an AMD processor and a broadcom wifi. The driver was not present until running  apt-get install firmware-b43-installer   but apparently loads now. this step was also listed in the referenced "installing broadcom drivers article".   A new problem appears, visible from dmesg  [    1.591898] bcma: bus0: Found chip with id 43228, rev 0x00 and package 0x08 [    1.591923] bcma: bus0: Core 0 found: ChipCommon (manuf 0x4BF, id 0x800, rev 0x25, class 0x0) [    1.591942] bcma: bus0: Core 1 found: IEEE 802.11 (manuf 0x4BF, id 0x812, rev 0x1E, class 0x0) [    1.592049] bcma: bus0: Core 2 found: PCIe (manuf 0x4BF, id 0x820, rev 0x12, class 0x0) [    1.592068] bcma: bus0: Core 3 found: SDIO Device (manuf 0x4BF, id 0x829, rev 0x07, class 0x0) [    1.604210] bcma: bus0: Bus registered  [    5.164775] b43 bcma0:1 wlp2s0b1: renamed from wlan0 [    5.188343] IPv6: ADDRCONF(NETDEV_UP): wlp2s0b1: link is not ready [    5.348195] b43-phy0: Loading firmware version 666.2 (2011-02-23 01:15:07) [    5.468139] [drm] ib test on ring 1 succeeded in 0 usecs [    5.512831] IPv6: ADDRCONF(NETDEV_UP): wlp2s0b1: link is not ready [    5.563673] IPv6: ADDRCONF(NETDEV_UP): wlp2s0b1: link is not ready [    5.620189] AMD-Vi: Event logged [ [    5.620196] INVALID_DEVICE_REQUEST device=00:00.1 address=0x000000fdf80c0020 flags=0x0a00]   The symptom is that now "WiFi networks" is shown as an option in the "Network" menu, but is grayed out (no actual WLAN networks are shown). If I try to connect to a wlan as hidden network it fails, and dmesg shows the last lines of the above script again.  ifconfig yields  wlp2s0b1: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500         ether ac:e0:10:my:ma:ca  txqueuelen 1000  (Ethernet)         RX packets 0  bytes 0 (0.0 B)         RX errors 0  dropped 0  overruns 0  frame 0         TX packets 0  bytes 0 (0.0 B)         TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0   following a comment I also issued below command:  lspci -knn | grep Net -A3; rfkill list 02:00.0 Network controller [0280]: Broadcom Inc. and subsidiaries BCM43228 802.11a/b/g/n [14e4:4359]     Subsystem: Broadcom Inc. and subsidiaries BCM43228 802.11a/b/g/n [14e4:05e2]     Kernel driver in use: bcma-pci-bridge     Kernel modules: bcma 0: phy0: Wireless LAN     Soft blocked: no     Hard blocked: no 1: hci0: Bluetooth     Soft blocked: no     Hard blocked: no   I then removed firmware-b43-installer and used apt install bcmwl-kernel-source. Further I uncommented in /etc/modprobe.d/blacklist.conf  # replaced by b43 and ssb. # blacklist bcm43xx   Then we still have the bcma as a kernel module ...  lspci -knn | grep Net -A3 02:00.0 Network controller [0280]: Broadcom Inc. and subsidiaries BCM43228 802.11a/b/g/n [14e4:4359]     Subsystem: Broadcom Inc. and subsidiaries BCM43228 802.11a/b/g/n [14e4:05e2]     Kernel driver in use: wl     Kernel modules: bcma, wl   After removing the comment in blacklist.conf and checking rfkill the situation is as before, the wifi seems to be known to the system, but is not operational, is grayed out and does not see networks.  I am checking:  iw wlo1 info Interface wlo1     ifindex 3     wdev 0x1     addr ac:e0:10:3d:f2:f4     type managed     wiphy 0     txpower 200.00 dBm   so in principle it should be fine. However in dmesg I see sometimes: IPv6: ADDRCONF(NETDEV_UP): wlo1: link is not ready. (Bluetooth firmware load fails now, but I suppose that does not matter).  Could this be a networking issue? What could be missing?

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


descargue dos imagen iso de matlab, pero cuando lanzo ./install en la terminal me aparece este error: [./install: 1: exec: /home/sergio/Descargas/Matlab r2016b/Mathworks Matlab R2016b Linux/R2016b_glnxa64_dvd1/bin/glnxa64/install_unix: Exec format error]

When I tried to install Matlab using the Software Center, it prompted me for the Location of MATLAB installation(s). Since I am trying to install it, I don't know what to do.


Are there any ways to transfer reputation between users without using bounties?

Is it possible to transfer my account reputation to anybody? If it is legal, how? Because if I want close or deleted my account.  Note:  If I deleted my account, what would happen to my account points, privileges and badges, etc.?


I have Ubuntu 13.04 DESKTOP version and for some odd reason I'm told that the Unity launcher cannot be moved to the bottom of the screen because of several reasons:  1. Canonical wants it there so it fits with their overall design goals, namely when it comes to touchscreen devices and netbooks. This in my mind totally ignores the fact that most Ubuntu users are DESKTOP users. No matter what Canonicals long term goal is, it surely mustn't be at the expense of needs of their core user base.  2. Most monitors are widescreen, the launcher is more compact where it is. This is not only taking away the users choice, but is also a wrong assessment. Widescreen monitors can sometimes be rotated on a pivot, giving it a portrait aspect. By displaying the Unity launcher on the left side it takes up a lot of space. Many desktop users have multiple monitors, and having the launcher on the left side of each monitor is very awkward. Also, many websites are catered to fit on a half 1920 display, so you can have two browser windows open side-by-side with all content visible. The placement of the Unity launcher takes away the horizontal space meaning there's less room for each browser window, and you'll see the right side of the web pages being occluded.  Any suggestion to simply hide the Unity launcher, or "Canonical knows best" or "get used to it" are unwelcome and totally ignores the above points.  Linux is about choice. Canonical's stubbornness with the Unity launcher placement is inconsistent with what Linux is about.

I can’t get used to the new Unity system. I’d like to move the left Unity panel to the bottom of screen (like Windows 7 – more similar is better).  But I can't find a way. Is it possible?


I am encountering this error:  Err:27 http://ppa.launchpad.net/midori/ppa/ubuntu bionic Release                  404  Not Found [IP: 91.189.95.83 80]

When updating, I get the following error message:   W: The repository 'http://ppa.launchpad.net/mc3man/trusty-media/ubuntu xenial Release' does not have a Release file.   Here, I find another statement on this error:   This recommends removing certain PPAs; and, I'm not sure if I should do that since it might mean not getting the updates that I need.    Is this what I should do?


Because of a particular user's constant blathering, retaliatory comments, harping on everything, and generally destroying all enjoyment I've had in the Struts 2 tag, I'm asking for the ability to filter a user's comments, and preferably answers.

Stack Overflow has successfully borrowed at least one XBox feature (Achievements).  I'd like to see another feature borrowed as well. Let's say I'm playing Halo online and another player is being a bigot.  I have the option to add him to a list of ignored users.  After doing that, all the racist things he says will never be heard through my headphones anymore. Now, on Stack Overflow, I'd like the ability to add a user to a list of ignored users.  This would hide all of that user's comments, and maybe his questions and answers as well (not sure if hiding questions/answers is necessary). This serves multiple purposes:  It would make it easy for users to avoid other users' flamebait. It would give users a more appropriate response to flamebait. The ability to start flame wars would be reduced, since fewer users would see those comments. Users would now have an incentive to be more diplomatic, as there is now a negative consequence to the behavior (the silent treatment). Administrators could review which users are the most often ignored, which would be a strong indication that someone should be  or even locked out of their account. Administrators wouldn't have to spend as much time dealing with complaints about abusive users, since users would have a better way to respond.    makes a good point in a comment to an answer, that I thought should get more visibility:  I had a problem, reported it and got the response "not bad enough to do anything about, sorry". Which is kind of true, because the only options available to the mods are the nuclear one (penalty box) and the zero-effect one (do nothing). We need a middle ground option where abuse can be handled for you without also being handled for everyone.


In my map as you see below, I have my population by district.  I want to create 50 clusters with similiar sums of the population and by proximity. How I can achieve this?  For each cluster, I want the districts are next to each other (As you can see in yellow in the picture).

I have a shapefile with 3800 polygons representing the smallest administrative areas in Ireland. Many of these, in rural areas, have tiny populations, under 100 people. In urban areas, all would have adequate populations.  For each area I have a population figure, and various other attributes, all of which can be intelligently summed to give valid results for areas produced by combining the smaller areas.  I need to merge the areas to get say, 500 or 600 areas of reasonable population. I need to leave the larger (in population) areas alone, where possible. I would greatly prefer to do this automatically. This is necessary for model fitting purposes, primarily.  I've looked at a number of the dissolve questions here:   'Batch Dissolve Polygons based on Attributes in QGIS or FWTools' I think would require me to know which areas to merge, when this is what I need to calculate. 'Practical way of managing polygons and unions of them' and 'How do dissolve polygons from shapefile using open source tools?' have the same issue.   Any suggestions?


I do need to refresh a specicif div content, i've tried with .load       $("#myDiv").load(location.href + " #myDiv");  And it works, but after that seems that I cannot manipulate the returned loaded 'div'. I checked and seems that the .load does not allow you to manipulate the returned code. Is there any other way to refresh a div content without the .load? Thanks a lot!

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've added "reject_sender_login_mismatch" to "smtpd_sender_restrictions" as was suggested to me. Now I get this when sending an email:      <my_email@my_domain.com>: Sender address rejected: not owned by user my_email@my_domain.com   The logs of postfix:    localhost postfix/submission/smtpd[26211]: connect from unknown[11.22.33.44]   localhost postfix/submission/smtpd[26211]: NOQUEUE: reject: RCPT from unknown[11.22.33.44]: 553 5.7.1 <my_email@my_domain.com>: Sender address rejected: not owned by user my_email@my_domain.com; from=<my_email@my_domain.com> to=<some_external_email@gmail.com> proto=ESMTP helo=<[66.77.88.99]>   localhost postfix/submission/smtpd[26211]: disconnect from unknown[11.22.33.44] ehlo=2 starttls=1 auth=1 mail=1 rcpt=0/1 quit=1 commands=6/7   Note that all does work when I comment out "reject_sender_login_mismatch"  Why doesn't it work with it? How to fix this?  Here's a part of my postfix config:    virtual_mailbox_maps = pgsql:/etc/postfix/virtual_mailbox_maps.cf   smtpd_sender_login_maps = pgsql:/etc/postfix/virtual_mailbox_maps.cf   In the logs I also have this:    localhost postfix[26246]: /usr/bin/postconf: warning: /etc/postfix/main.cf: unused parameter: smtp_sender_login_maps=pgsql:/etc/postfix/virtual_mailbox_maps.cf   Also note that my IP is'nt static because I carry my laptop with me everywhere.

Until recently my server with Postfix has worked well. Then I enforced some restrictions to a) combat spam b) disable sending emails to me on behalf on my own name -- I have begun receiving emails from my own email address demanding to send bitcoin to someone.   I want to fix both a and b.  And now I can't send email via my own postfix server.    Client host rejected: cannot find your reverse hostname, [<my ip here>]   Note that I carry my laptot to different places and countries, and connect to WiFi from those. And I want to be able to send email always.  Here's a part of my config of Postfix. For database of the accounts and domains I use Postgresql.  smtpd_helo_required = yes  smtpd_client_restrictions =   permit_mynetworks,   permit_sasl_authenticated,   reject_unknown_reverse_client_hostname,    reject_unknown_client_hostname,   reject_unauth_pipelining  smtpd_helo_restrictions =   permit_mynetworks,   permit_sasl_authenticated,   reject_invalid_helo_hostname,  ###  reject_non_fqdn_helo_hostname,   reject_unauth_pipelining  smtpd_sender_restrictions =   permit_mynetworks,   reject_sender_login_mismatch,   permit_sasl_authenticated,   reject_non_fqdn_sender,   reject_unknown_sender_domain,   reject_unauth_pipelining  smtpd_relay_restrictions =   permit_mynetworks,   permit_sasl_authenticated,   reject_non_fqdn_recipient,   reject_unknown_recipient_domain,    reject_unauth_destination   smtpd_recipient_restrictions =   permit_mynetworks,   permit_sasl_authenticated,   reject_non_fqdn_recipient,   reject_unknown_recipient_domain,   reject_unauth_pipelining  smtpd_data_restrictions =   permit_mynetworks,   permit_sasl_authenticated,   reject_multi_recipient_bounce,   reject_unauth_pipelining  # deliver mail for virtual users to Dovecot's LMTP socket virtual_transport = lmtp:unix:private/dovecot-lmtp  #  query to find which domains we accept mail for virtual_mailbox_domains = pgsql:/etc/postfix/virtual_mailbox_domains.cf  # query to find which email addresses we accept mail for virtual_mailbox_maps = pgsql:/etc/postfix/virtual_mailbox_maps.cf  # query to find a user's email aliases virtual_alias_maps = pgsql:/etc/postfix/virtual_alias_maps.cf  virtual_alias_domains =  alias_database =  alias_maps =   mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 inet_interfaces = all


Yes, I have seen that this question has been asked and answered before in this same website, but answers given there were mostly in regards to geometry, or non-mathematical examples (e.g. "the 'e's in the word 'between' are congruent, but not equal", "two triangles with the same dimensions and points are equal").  I can understand this just fine, but I can't use this advice when it comes to pure numbers, like mods. For example: $17 \equiv 5 (mod(6))$. How is this statement correct? If we solve $5 (mod(6))$ we get $5$, so that would mean $17 \equiv 5$.  Also, $17 \equiv 4(mod(13))$, which means $17 \equiv 4$, and $17 \equiv 3(mod(7))$, which is $17 \equiv 3$  So then, $17 \equiv 5 \equiv 4  \equiv 3$ is true? That doesn't seem right. Are all positive integers congruent to one another?  I know this may seem like a simple matter to some, but I'm seriously stuck.

In an Introduction to Abstract Algebra by Thomas Whitelaw, he gives examples of the congruence mod operation, such as $13 \equiv5 \pmod4$,  and $9 \equiv -1 \pmod 5$. But when I first learned about the modulo operation my junior year, I would have told you that $13 \equiv 1 \pmod 4$, and that $9 \equiv 4 \pmod 5$.     Is this just a difference in the definition of modulo? Or is this pretty typical (to not take it to the largest factor, or one over)?


What is the exact value of$$\sum_{n=1}^\infty \frac{1}{2^n-1}$$ if it exists?

Calculate $$\sum_{k=1}^{\infty}\frac{1}{2^{k+1}-1}.$$    I used Wolfram|Alpha to compute it and got it to be approximately equal to $0.6$. How to compute it? Can someone give me a hint or a suggestion to do it?


Using yield return turns a method into an iterator.   I have found that an iterator can only be used in a foreach loop if it returns one of the IEnumerable types. Given this limitation, when would it make sense to choose an IEnumerator return type instead of an IEnumerable?

Can anyone explain IEnumerable and IEnumerator to me? For example, when to use it over foreach? what's the difference between IEnumerable and IEnumerator? Why do we need to use it?


After watching Divergent and talking with some friends, I've linked it with another film, which I'm trying to recall. I clearly remember white rooms, lots of lights, some sort of tests (and there was a entry test, or meeting with doctors(?) maybe). The tests might be only for women and the main character might have blonde hair. I remember she was told by one of the testers or competitors that she isn't "compatible" for this programme and she would fail the real tests or that she wouldn't make something (the longer I think about it, it might be for some sort of space programme). I am certain that this film was made before 2014, maybe even 2010, but after 2000. This lab had futuristic glass screens.  I vaguely remember blue suits and that the tests were more mental than physical (if any).  Any clues? I would love to watch that again.

I have had a friend give me a rough description of a film and I'm curious to find out what it actually is. I don't know very much. I understand this will be difficult, especially since every time my friend explains the tale it's different so this description is likely to contain some inaccuracies.  The film's plot begins with a recounting given by the main character, who had both male and female reproductive organs but had one set removed (not sure which, think male ones were removed). The main character is narrating this tale to the barman in a bar. The barman then takes the main character back in time, where they make love to themselves and produce a child.  The child, once born, is abandoned by the mother in the past - but the barman takes the child to the orphanage and leaves them there, ensuring their survival. Eventually it is revealed that the child was the main character themselves, and so was the barman.  In other words every major character introduced up to that point was the same person who had severely messed with their own timeline.


I'm sorry, I'm still a noob at C. I wonder why post and prefix have different effect in "printf" but have the same effect in "for"or maybe in other loop ?   example :  #include <stdio.h> main() {     int number = 0;     printf("%d.\n", ++number); //It prints 1     return 0; }   ...............     printf("%d.\n", number++); //it prints 0 ...............   but in "for"  #include<stdio.h> main() {     int number;     for (number = 0; number < 5; ++number);     {         printf("%d\n", number); //it prints 0,1,2,3,4     }     return 0; } .............     for (number = 0; number < 5, number++);     {        printf("%d\n", number); //it prints 0,1,2,3,4     } .........................

In C, what is the difference between using ++i and i++, and which should be used in the incrementation block of a for loop?


I have the following code from the book Data Structures & and Algorithms - Goodrich:   public class GameEntry { protected String name;  // name of the person earning this score protected int score;    // the score value  public GameEntry(String n, int s) {     name = n;     score = s; }  /**  * Retrieves the name field  */ public String getName() {     return name; }  /**  * Retrieves the score field  */ public int getScore() {     return score; }  /**  * Returns a string representation of this entry  */ public String toString() {     return "(" + name + ", " + score + ")"; } }   Scores Class:  public class Scores {  public static final int maxEntries = 10; // number of high scores we keep protected int numEntries;          // number of actual entries protected GameEntry[] entries;     // array of game entries (names & scores)  /**  * Default constructor  */ public Scores() {     entries = new GameEntry[maxEntries];     numEntries = 0; }  /**  * Returns a string representation of the high scores list  */ public String toString() {     String s = "[";     for (int i = 0; i < numEntries; i++) {         if (i > 0) {             s += ", "; // separate entries by commas         }         s += entries[i];     }     return s + "]"; }  /**  * Attempt to add a new score to the collection (if it is high enough)  */ public void add(GameEntry entry) {     int newScore = entry.getScore();     // is the new entry e really a high score?     if (numEntries == maxEntries) { // the array is full         if (newScore <= entries[numEntries - 1].getScore()) {             return;  // the new entry, e, is not a high score in this case         }     } else // the array is not full     {         this.numEntries++;     }     // Locate the place that the new (high score) entry e belongs     int i = numEntries - 1; //first part outside the forloop because of the scope     for (; (i >= 1) && (newScore > entries[i - 1].getScore()); i--) {          entries[i] = entries[i - 1];      // move entry i one to the right     }     entries[i] = entry;               // add the new score to entries } }   Test Class:   public class TestGameEntry {  /**  * @param args the command line arguments  */ public static void main(String[] args) {     Scores scores = new Scores();     scores.add(new GameEntry("Phillip", 400));     System.out.println(scores.toString());     scores.add(new GameEntry("John", 200));     System.out.println(scores.toString());     scores.add(new GameEntry("Alice", 300));     System.out.println(scores.toString());     scores.add(new GameEntry("Paula", 500));     System.out.println(scores.toString());     scores.add(new GameEntry("Bob", 700));     System.out.println(scores.toString());     scores.add(new GameEntry("Charlie", 400));     System.out.println(scores.toString());     scores.add(new GameEntry("Addison", 1100));     System.out.println(scores.toString());     scores.add(new GameEntry("Sabina", 1200));     System.out.println(scores.toString());     scores.add(new GameEntry("Xenia", 300));     System.out.println(scores.toString());     scores.add(new GameEntry("Pablo", 300));     System.out.println(scores.toString());     scores.add(new GameEntry("Kadir", 300));     System.out.println(scores.toString());     scores.add(new GameEntry("Brigit", 1300));     System.out.println(scores.toString());     scores.add(new GameEntry("Brigit", 1500));     System.out.println(scores.toString());   }  }   In the method add(GameEntry entry) I changed the forloop as follows:  for (; (i >= 1); i--) {     if (newScore > entries[i - 1].getScore()) {             entries[i] = entries[i - 1];      // move entry i one to the right     } }   I am getting a NullPointerException in the if statement. Why is not coming in the forloop?

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?


Why do transformations for the $x$ variable in graphs work opposite as you would expect?   Example: $f(x) =(x)-1$ moves the graph down as you would expect but $g(x) = (x+1)-1$ moves the graph down (as it looks like) but instead of to the right one it's to the left one.   Note: I understand fully how to do graph transformations but don't understand why we just deem the x-value transformations as "doing the opposite". Thanks!

Why does the graph of $\sin(x+{45}^\circ$) shifts to left instead of right comparing with $\sin x$. With respect to point at which line passed from origin.  Mathematically i know , I can fill in values and plot to verify , but is there any other easy to understand explanation for this ?  Sorry if this sounds foolish question.  Thanks  See graph


I m not concerned with rotation of a body with two simultaneous axis but concerned with how we choose the axis,while going through pure rolling I have observed that there are two axis of rotation one is passing through the center of mass and the other is through the point in contact with the ground,my concern is how can there be any axis of rotation through the point of contact where as m very well finding the body does not rotate in that axis of rotation that is it very well rotates only through the center of mass.

I understand that angular momentum is a vector, etc..  But, what really happens when some object, say a ball for example, is set to rotate along two axes? What would the resulting motion look like?


I want to keep monitoring a specific job on a slurm worload like cluster. I tried to use the watch command and grep the specific id. If the job id is4138, I tried   $> watch squeue -u mnyber004 | grep 4138 $> squeue -u mnyber004 | watch grep 4138   but they doesn't work. The second command works for the first few seconds, but stop working when watch refreshes.  A better idea please?

I usually use watch Linux utility to watch the output of a command repeatedly every n seconds, like in watch df -h /some_volume/. But I seem not to be able to use watch with a piped series of command like: $ watch ls -ltr|tail -n 1  If I do that, watch is really watching ls -ltr and the output is being passed to tail -n 1 which doesn't output anything. If I try this: $ watch (ls -ltr|tail -n 1)  I get $ watch: syntax error near unexpected token `ls'  And any of the following fails some reason or another: $ watch <(ls -ltr|tail -n 1)  $ watch < <(ls -ltr|tail -n 1)  $ watch $(ls -ltr|tail -n 1)  $ watch `ls -ltr|tail -n 1)`  And finally if do this: $ watch echo $(ls -ltr|tail -n 1)  I see no change in the output at the given interval because the command inside $() is run just once and the resulting output string is always printed ("watched") as a literal. So, how do I make the watch command work with a piped chain of commands [other that putting them inside a script]?


I will preface this question by stating that the hypothetical situation proposed below will obviously only work as long you have a die with a number of faces equal to the number of enemies. Scenario Suppose we have a party of PCs and they encounter 8 identical hostile enemies. Once of the PCs is a wizard, and decides to cast  in such a way that it will hit all 8 enemies at once. Since , all the enemies just make a Dexterity saving throw. These rolls would normally be rolled for each discrete enemy for a total of 8 individual rolls. Question Would it be entirely unfair to roll a single d20 and a single d8, and if the d20 roll succeeds on the Dex save, rule that the 1d8 roll is the number of enemies take half (or full) damage, and the rest take full (or half) damage? Conversely, if the Dex save fails, all enemies take full damage. Thoughts I'm considering an approach to speeding up dice rolls for large packs of enemies, but I can't really tell outright if the above scenario is unfair. My first impression is that it might skew based on saves or AC (if we're rolling to-hit instead of for saves) and number of enemies. For the example let us consider two sets of outcomes: one for a pack of , and one for a group of . I know this all essentially boils down to dice math, but I'm not the greatest at it and would appreciate the help evaluating whether this is fair, and what the reasonable thresholds are.

As the title question, my DM rolls a single d20 save for groups affected by my area of effect spells that require a save, in order to save time.  I can't help but feel like I'm being ripped off by this as a wizard with primarily AoE save-or-suck spells.  I don't know if this is just a feeling or if the probabilities actually back this up.  I know this can also work in my favor but it still feels off.  How are the probabilities affected when a (homogenous) group gets a single save vs. each individual in the group having their own save?  I want to know specifically if this works more in my favor or more in the favor of my enemies, or if it is statistically speaking a 50/50 split.  I am looking for evidence that this is a bad idea (whether it benefits me or harms me) and that the DM should roll separately for each affected target in the area of effect.    I realize this probably puts the odds in my favor when targeting weak saves in the group (i.e., WIS save on a group of ogres or orcs), but this will not always be the case and especially when there are mixed enemies in the AoE.  So far we have only faced groups that contained single enemy types so I don't know what happens when there are two different enemies with two different saves.  Ideally answers will address a sliding group size (2..N group members, 5 is probably a good stopping point) and a range of save DCs -- DC 14-19 should address most levels of play.


I was just thinking that with all the things replicated by a replicator, I never recall seeing them dispose of the non-consumable items replicated. E.g. whenever Picard asks for his tea, it always replicates the tea and the mug. He drinks the tea obviously, but what about the mug?  Does a replicator have the ability to 'de-replicate' the items it replicates (presumably then storing the constituents elsewhere), or is this 'waste' managed by a different system?  (Note I'm talking about things replicated, not foods or drinks which I know what happens to following .)

Whenever someone in Star Trek creates food or drink in the replicator it is generated in the bowl, plate, or cup. It seems like after a few months they would have piles of used dishes from replicator food while making more for every meal. What do they do with all the dishes?


I'm not able to run the following example in Texmaker:  \documentclass{article} \usepackage{nomencl} \makenomenclature \begin{document} \section*{Main equations} \begin{equation} a=\frac{N}{A} \end{equation}%  \nomenclature{$a$}{The number of angels per unit area}% \nomenclature{$N$}{The number of angels per needle point}% \nomenclature{$A$}{The area of the needle point}% The equation $\sigma = m a$% \nomenclature{$\sigma$}{The total mass of angels per unit area}% \nomenclature{$m$}{The mass of one angel} follows easily.  \printnomenclature  \end{document}   I use MiKTeX under Windows with the following Texmaker configuration:    and run the sequence:    I followed  to configure my editor without success. Thanks for your help

I have used the package nomencl. In my code I have incorporated the \nomenclature as well. But when I compile, it is not showing me any results. My code is :  \documentclass[pdftex,12pt,a4paper]{report} \usepackage{nomencl} \makenomenclature \begin{document} ---page numbering and other things included----- \include{symbols} -----others--- \end{document}   symbols.tex  \chapter*{NOTATIONS} \addcontentsline{toc}{chapter}{Notations} \nomenclature{$G_e$}{Equivalent Shear Modulus} \printnomenclature   Shall I use \nomenclature while explaining the chapter. Will It give me the same results? like  \documentclass[pdftex,12pt,a4paper]{report} \usepackage{nomencl} \makenomenclature \begin{document} ---page numbering and other things included----- \include{symbols} \include{chap3-calculate_w} -----others--- \end{document}   symbols.tex  \chapter*{NOTATIONS} \addcontentsline{toc}{chapter}{Notations} \printnomenclature   chap3-calculate_w.tex  \chapter{SETTLEMENT RESPONSE OF GEOSYNTHETIC REINFORCED GRANULAR FILL SOFT SOIL} \label{chap:W} \section{INTRODUCTION} In this thesis, the methodology to determine an  Equivalent single layer shear modulus \nomenclature{$G_e$}{Equivalent Shear Modulus},$G_e$ value for a...etc   I am not getting the output in both these. Can someone help me with this?


public class Clan {     private String clanName;     static ArrayList<Citizen> list;     private int clanSize;    public Clan(String clanName, int clanSize) {      this.clanName = clanName;      this.clanSize = clanSize;      Clan.list = new ArrayList<Citizen>(clanSize);     //list.add(new Archer());    for (int i = 0; i < clanSize; i++) {        Clan.list.add(Citizen.randomCitizen());    }  }     public static Citizen randomCitizen() {     Random randomReturn = new Random();      Citizen [] list = new Citizen[3];      list[0]=new Archer();     list[1]= new Barbarian();     list[2]= new Civilian();      return list[randomReturn.nextInt(list.length)];   }  This is meant to randomly fill the clan with random citizens whenever its called. The error I am having is if I create a new clan(toronto, 5) and another new clan(montreal, 6). They both have the same pattern of citizens. Its meant to be random for each call

To be specific, I was trying this code:  package hello;  public class Hello {      Clock clock = new Clock();      public static void main(String args[]) {         clock.sayTime();     } }   But it gave the error      Cannot access non-static field in static method main   So I changed the declaration of clock to this:  static Clock clock = new Clock();   And it worked. What does it mean to put that keyword before the declaration? What exactly will it do and/or restrict in terms of what can be done to that object?


Suppose one has an n × 2 matrix X (the independent variables) and a n × 1 vector y (the dependent variable). In a standard multiple linear regression setting, we solve for the 2 × 1 beta vector that minimizes the least squares objective function.   An alternative approach is to instead consider only one variable (say the first, x_1) and solve this linear regression model first. We obtain some scalar coefficient value and a set of residuals derived from the dependent variable. Then, we run a second linear regression model and regress on the residuals of the first model.  My questions are:   What are the conceptual and technical differences in each approach?  Are the outputs going to be equal, similar, or vastly different?  Are there differences in the assumptions of each method? My inclination that the second method is ignorant of correlations or something to this effect, but I am not certain.  Is there one formulation that is objectively superior to the other?   If anyone has any sources as well for further research, please feel free to share.

Not sure if normalize is the correct word to use here, but I will try my best to illustrate what I am trying to ask. The estimator used here is least squares.  Suppose you have $y=\beta_0+\beta_1x_1$, you can center it around the mean by $y=\beta_0'+\beta_1x_1'$ where $\beta_0'=\beta_0+\beta_1\bar x_1$ and $x_1'=x-\bar x$, so that $\beta_0'$ no longer has any influence on estimating $\beta_1$.  By this I mean $\hat\beta_1$ in $y=\beta_1x_1'$ is equivalent to $\hat\beta_1$ in $y=\beta_0+\beta_1x_1$. We have reduced equation for easier least square calculation.  How do you apply this method in general? Now I have the model $y=\beta_1e^{x_1t}+\beta_2e^{x_2t}$, I am trying to reduce it to $y=\beta_1x'$.


I have seen this small equality used in a proof that I was reading and I wanted to show that it is true. It seems like an easy problem but I didn't know how to start. Can you show me how is it true?

I've been messing around with modular arithmetic recently, and stumbled across this, but couldn't find a proof for it anywhere. I hate taking things as truth without knowing why, so could anyone provide a (fairly simple) proof?


I have a page where I have a form at the top of the page that a user can select certain cities to filter on. So far it looks like this:    <?php    $start=_GET['start'];  $end=_GET['end'];   if(empty($start)){    $start=date("Ym"); } if(empty($end)){ $end=date("Ym");  }   $places=array(); if(!empty($_GET['cities'])){   foreach($_GET['cities'] as $loc){ array_push($places,$loc);  } }else{  $places=('CHI','DET','LA','NYC','DAL','SPR','PHI','PITTS','HST','KMZ','SCR','BUF','ALB','UTI','DEC','QNC','SNF');  }  ?>  //html <form method='GET'> START:<input type='text' name='start' value= '<?$start?>'> END: <input type='text' name='end' value='<?$end?>'> <input type='checkbox' name='cities[]' value='CHI' <?= (in_array('CHI', $places)) ? 'checked' : ''; ?> >CHICAGO <input type='checkbox' name='cities[]' value='DET' <?= (in_array('DET', $places)) ? 'checked' : ''; ?> >DETROIT <input type='checkbox' name='cities[]' value='LA' <?= (in_array('LA', $places)) ? 'checked' : ''; ?> >LOS ANGELES <input type='checkbox' name='cities[]' value='NYC' <?= (in_array('NY', $places)) ? 'checked' : ''; ?> >NEW YORK <input type='checkbox' name='cities[]' value='DALLAS' <?= (in_array('DAL', $places)) ? 'checked' : ''; ?> >DALLAS <input type='checkbox' name='cities[]' value='SPR' <?= (in_array('SPR', $places)) ? 'checked' : ''; ?> >SPRINGFIELD <input type='checkbox' name='cities[]' value='PHI' <?= (in_array('PHI', $places)) ? 'checked' : ''; ?> >PHILADELPHIA ......rest of the cities....  <input type='submit' value='Filter'>   </form>   <?  $SQL="SELECT NAME,     ID,     PHONE,     EMAIL,     EVENT,     LOCATION   FROM SHOPPERS  WHERE LOCATION IN ('".implode("', '", $places)."')  AND EVENT BETWEEN '{$start}' and '{$end}'  AND ID BETWEEN '25687' AND '28050'  ";   //and then fetch array to print out results... ..... ?>   This works just fine now. As soon as the page loads, all the cities are checked and the user can check/uncheck whatever they want. However, now, I want to add some boxes/buttons right above the cities with the state names in them, so that if I just want to filter on cities in Illinois, I can click/unclick that and it would check/uncheck Chicago, Decatur and Quincy. I also want to put two new buttons, one to select all and one to clear all.  So the two new buttons would look something like this:    <input type="button" class="check" value="Select All" />   <input type="button" class="check" value="Clear" />   Any help? Thank you

I have an HTML page with multiple checkboxes.  I need one more checkbox by the name "select all". When I select this checkbox all checkboxes in the HTML page must be selected. How can I do this?


Most articles of my site contain huge revisions. It is very tedious and annoying to delete huge revisions one by one following the url ,say, www.example.com/node/9022/revisions. I want to implement an interface in Admin panel to delete multiple revisions at one time. But dont know how to implement this concept. Plz help

I have a drupal 7 sites, where it keeps node and field revisions. I keep revisions for the case where by mistake a new faulty version is saved and I want to revert back.  But, now I want to clean and optimize the database so to take less space in hard disk.  What are some methods of deleting all the revisions except the current one, for all nodes/fields of the site?


I have the following servers:  PROD:   2 x web servers (content delivery)  1 x cms server  2 x database servers (SQL)   UAT:   1 x web server (content delivery + cms) 1 x database server (SQL)   I'm a bit confused with the SQL server 2012's User CAL licensing concept. Now that I have CMS and websites that serve contents to public users, does that mean I have to get a User CAL for each of my website / CMS users?? Is this true? I understand that SQL doesn't require User CAL if I get the per-processor/per-core license, but that costs a lot more...In fact I only need 1 sys admin account and 2-3 database users for the websites and CMS.  For win server 2012 I believe we don't need to worry much about User CAL because web edition allows us to use the web server to serve public users. So, basically we just need to purchase Win Server 2012 with 5-User CAL (for management purposes). Please correct me if im wrong..  I need expert's advice on this, tips to save cost, etc.  Thanks!

When I first setup a Windows 2000 and then 2003 Server in our office using per-server licensing, we got the default 5-user CAL pack.  I noticed that after 3 users logged in, the Server would kick out a notice that I had too many people has logged in.  That's when I noticed that the Server was counting users twice - once for their login, and once for their computer...  For example, if User X logs in from Computer Y, then both X and Y would show up as having used a license.  The only workaround I found was to disable the License Logging Service.    What was I doing wrong?


I broke my phone and I never backed it up so I lost everything. Including Pokemon Go. It would've saved my account though, right? I tried to sign in using my username and password but my password won't work! I USE THE EXACT SAME PASSWORD FOR LITERALLY EVERYTHING I HAVE!!! Why would I use something different this one time??? I asked my friends if my username was right or wrong and they all sent me a screenshot of my profile that I sent them and the username was right. I have so many emails that I cant remember which one I used. Any advice on what I should do?

My daughter has logged me out of my game and now I can't get back in. She signed me up, but has forgotten how she did it What can I do? I have tried google already and can't find it, it actually loaded my other daughters game. The only thing I remember is my nickname in the actual game.


I am trying to install Midori to Ubuntu, starting with:  $ sudo add-apt-repository ppa:midori   The response is:   Midori Browser     http://twotoasts.de/index.php/midori/  This PPA is signed. To add the GPG key to your apt keyring:    sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com A69241F1 Starting with Karmic, adding the PPA and its key is as simple as:    sudo add-apt-repository ppa:midori  You may also want to use the WebKit-team PPA:      https://launchpad.net/~webkit-team/+archive/ppa You can find unstable Midori versions at     https://launchpad.net/~midori/+archive/midori-dev  More info: https://launchpad.net/~midori/+archive/ubuntu/ppa Press [ENTER] to continue or Ctrl-c to cancel adding it.  Hit:1 http://security.ubuntu.com/ubuntu bionic-security InRelease Ign:2 http://ppa.launchpad.net/midori/ppa/ubuntu xenial InRelease                                                                Hit:3 http://ch.archive.ubuntu.com/ubuntu bionic InRelease                                                                       Ign:4 http://ppa.launchpad.net/midori/ppa/ubuntu bionic InRelease                                                          Hit:5 http://ch.archive.ubuntu.com/ubuntu bionic-updates InRelease                              Hit:6 http://ch.archive.ubuntu.com/ubuntu bionic-backports InRelease                                                      Err:7 http://ppa.launchpad.net/midori/ppa/ubuntu xenial Release                                                             404  Not Found [IP: 91.189.95.83 80] Err:8 http://ppa.launchpad.net/midori/ppa/ubuntu bionic Release                                        404  Not Found [IP: 91.189.95.83 80] Hit:9 http://archive.canonical.com/ubuntu bionic InRelease                Reading package lists... Done E: The repository 'http://ppa.launchpad.net/midori/ppa/ubuntu xenial Release' does not have a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. E: The repository 'http://ppa.launchpad.net/midori/ppa/ubuntu bionic Release' does not have a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details.   Is there an easy way how to deal with that?

I tried to install  using :     Open terminal by pressing Ctrl+Alt+T and run the following   commands,  sudo apt-add-repository ppa:midori/ppa sudo apt-get update sudo apt-get install midori    but I got following error:  E: Package 'midori' has no installation candidate


Is there something like an undergraduate research programme (given by a good institution) in mathematics/theoretical physics which provides a research opportunity in which I can collaborate online and leads to a publication?

I've not seen this question before, so I'll ask it after feedback I received on .  I've finished my MBA in the UK and was awarded distinction but would like to find a research group to work with. I'm no longer in the UK (or even Europe) and would like to find a research group with which I could work on a telecommuting / remote basis.  My goal here is not for income (though it's OK if it led to some). My goal is to build my research experience with the thought of pursuing a PhD (business / intercultural management / something in that general area). My MBA didn't result in a lot of research guidance  for me so I feel like there are so many things that I don't know and I want to 'fix' that.  Any ideas how someone can find a research group who would be interested in working with someone remotely for free (obviously there is a time and attention commitment from both sides, which is not exactly free)?


Why does the following code produce an error and how can I avoid it? (tested in Overleaf)  \documentclass{article}  \usepackage{tikz-cd} \usepackage{environ}  \newif\ifDraft  \NewEnviron{Details}{\ifDraft\begingroup\color{blue}\BODY\endgroup\fi}  \Drafttrue  \begin{document}  \begin{Details} $$\begin{tikzcd} A & B \end{tikzcd}$$ \end{Details}  \end{document}   Thanks!

I have a document class test.cls, in which I have defined a custom environment myenvironment using the environ package as follows:  \NeedsTeXFormat{LaTeX2e} \ProvidesClass{test} \LoadClass{article} \RequirePackage{changepage} \RequirePackage{environ} \NewEnviron{myenvironment}{     \begin{adjustwidth}{10pt}{10pt}         \BODY     \end{adjustwidth} }   Now if I try to use tikz-cd inside myenvironment, it fails, e.g. this gives an error:  \begin{myenvironment}     \[\begin{tikzcd}         1 \ar[r] \ar[d] & 2 \ar[d] \\         3 \ar[r] & 4 \\     \end{tikzcd}\] \end{myenvironment}   On the other hand, if I simply write it like this—that is, I substitute what the environment would do—, everything is fine:  \begin{adjustwidth}{10pt}{10pt}     \[\begin{tikzcd}         1 \ar[r] \ar[d] & 2 \ar[d] \\         3 \ar[r] & 4 \\     \end{tikzcd}\] \end{adjustwidth}   What could be the problem?


Reading about measure theory has led me to consider extended real numbers. I have read that in this context $0\times\infty$ is defined as $0$. The wiki article  supports this claim.   Of course, I am familiar with the usual thing said in calculus courses that $0\times\infty$ is not a well defined thing (or better said, products of functions with zero and infinity as limits can have as a limit zero, infinity or any other real number).  In any case, I am interested in knowing why in the context of measure theory it is a good idea to define $0\times\infty=0$. What is the motivation?

In the preface of Terry Tao's notes on measure theory he states that in the extended real number setting we adopt the convention that $\infty \cdot 0 = 0 \cdot \infty = 0.$   He explains that it's a useful convention which makes it natural to define integration from below (e.g. integrals as supremums of nonnegative simple functions). He seems to be saying, "Let's define it this way, because it makes our lives simpler." Is more justification not needed?  This 'fact' helped me during my midterm today in showing that $\mu(E \times \mathbb{R})=0$ for any measure-zero set $E$, but I felt sleazy using it.  Any thoughts (philosophical or otherwise) on why or how we can do this and still have self respect as mathematicians?


$\frac{1}{n + 1} + \frac{1}{n + 2} + \frac{1}{n + 3} + ..... +\frac{1}{3(n) + 1} >  1 $;   Here in this sequence after checking the basis for n = 1 , i.e $\frac{1}{4} > 1$, Which cannot be true;     I think I am wrong at some point , If yes then how can we prove this sequence by mathematical induction?

Prove by induction: $$\frac1{n+1} + \frac1{n+2} + \cdots +\frac1{3n+1} > 1$$  adding $1/(3m+4)$ as the next $m+1$ value proves pretty fruitless. Can I make some simplifications in the inequality that because the $m$ step is true by the inductive hypothesis, the 1 is already less than all those values?


If we place two smooth surface one over the other why friction increases or becomes high ?

I am wondering what will be the physics to explain how two neutral, chemically nonreactive objects stick. I know that using van der Waals formalism, we can treat neutral body electrodynamic forces and arrive with attractive forces that pull the objects together.   Now, once the objects touch (say a mechanical cantiliver in a MEMS sensor like the one used in an iPhone), what happens to the forces? A quantitative answer or some estimate on how strong the attractive force is for simple cases will be very appreciated.  in response to anna's comment : Let us consider what happens in vacuum for ultra smooth surfaces, with no residual electrical charge and fully chemically stablized surfaces (example, silicon crystals with stabilised surface bonds).


I have a string with hex values, for example:  01 02 03 AA BB CC FF 09 65 AA BB DE F2   And my need is take part of this string before first AA BB. I try do it with regular expressions. My ideas are around something like this:  (([0-9A-F]{2} )+(AA BB )){1}   And after match take first group. But it's not works. Could somebody help me with this task, please?

I have this gigantic ugly string: J0000000: Transaction A0001401 started on 8/22/2008 9:49:29 AM J0000010: Project name: E:\foo.pf J0000011: Job name: MBiek Direct Mail Test J0000020: Document 1 - Completed successfully  I'm trying to extract pieces from it using regex. In this case, I want to grab everything after Project Name up to the part where it says J0000011: (the 11 is going to be a different number every time). Here's the regex I've been playing with: Project name:\s+(.*)\s+J[0-9]{7}:  The problem is that it doesn't stop until it hits the J0000020: at the end. How do I make the regex stop at the first occurrence of J[0-9]{7}?


Does "portmanteau" only refer to single words like spork or turducken? If so what would be the term for multiple phrases combined together on a common word or words?  For example:   If I wanted to call someone from this site we'd have to "Stack Exchange numbers"  or  The velocity of ones vehicle when trying to make it through a yellow light might be "stoplight speed" (this just uses a compound word)

What is the difference between compounds and phrases? How do I know that "watch-maker" is a compound but "steel bridge" is a phrase? Does the "head" have anything to do with it (complement-head or attributive-head)?


I am looking to identify a story I read in the 1960s or 70s. It was about a scoutship that landed on Earth, prelude to an invasion force. Previous scouts had disappeared without a trace.  The crew members' names were descriptive of their function. I think the protagonist was called Pilot. They are shape-changers. One by one, the crew members defect, taking on forms of Earth creatures that fit their function and personality. Pilot tries desperately to complete the mission. One scene I remember is he assumes human form and walks into a building -- but is unable to blend in, I think because he forgets to form facial features.  He struggles to complete his crew's mission, barricading himself in a room? (perhaps to destroy the planet?) when he sees birds out the window. The people breaking in to stop him see only a large (white?) bird flying out the window, a bit awkward, but quickly gaining control of its wings and soaring away.  Help, please?

I'm trying to find a short story. Here is what I remember about the plot:   Shapeshifting aliens try to invade planet Earth. They have tried multiple times in the past, but every single time they lost contact with the attack team immediately after it landed on Earth The story is told from the point of view of one such alien, part of a later invasion force He lands on Earth, and notices the extreme biodiversity of the planet (compared to his own) He soon figures out that the previous teams were not dead. They just found a niche in the ecosystem in which they could be an animal (or a plant, or anything really) that had the kind of life they always wished to have However, this particular alien is a pilot. He loves flying. There is nothing in our ecosystem (or so he thinks) that could help him with this The story ends with the Earth army storming the hiding place of the alien. They find nothing, other than a large bird (a goose?) slowly flying away. It looks like there was a niche for our particular alien, after all...   I read this story a long time ago (more than 10 years), but it is probably older than that. I have no idea about the original publication date.  Most likely, I read it in one of Asimov's anthologies, but I don't know if he was the author or just the publisher.


I real feel confused about ('s) followed by a noun it may be /is / or may be /has / such in this example : she's a baby .

Is it alright to use the same contraction, "He's", to mean both "He is" and "He has"?    Examples:   "He's angry."   "He's been angry."   "He's a beautiful house."


Mostly, if an airport, however minor, has scheduled service, it will be to another airport with more services and so one can connect through to any airport in the world. E.g. one can fly from  to  to LHR to anywhere else.  But is there a pair or set of airports where this doesn't hold, creating an "island" of unconnected air transport?  (Fixed wing or I guess helicopter).

A commercial airport being any airport that has regular scheduled passenger flights.  The mathematics of  got me thinking: is the network of scheduled flights a connected graph?  That is, is there a pair (or triplet or even larger set) of airports such that they only have scheduled flights with each other?  Or can you get from any airport to any other?  Ignore vagaries like cargo and general aviation. I'm looking for two airports that I can shuttle between, but would have to drive (or sail) to get to one or the other of them.


When I click on a pictures to view them they seem to look perfectly fine on my laptop, like this:    But when I open them in the picture viewer or any other editor the colors are getting distorted:    Is there a way I can recover the images I am pretty sure the problem was the card reader, but I have already deleted the images from CF card and I need to fix the already copied raw images. The image uploaded is JPEG. I have the same images in RAW format which are getting completely distorted because of the colors  My camera is a Canon 7D.

I have had my Nikon D40 for a while, and some of the pictures are coming out distorted. Two examples are below:   So my questions are:    How do I fix them after the fact? - i.e. after they have been imported from the camera - if possible How do I prevent future pictures from being distorted like this?   Thanks   and


In my project I want to share my referral code with app link.I already save referral code in SharedPreferences but I am unable to set that message in a separate class.  public static SharedPreferences sharedPreferences;  public static void shareMyApp(Context context) {      String link = "https://play.google.com/store/apps/details?id="+context.getPackageName()+"Signup with my referral code.My Code is "+sharedPreferences.getString("member_id",null);      Intent sharingIntent = new Intent(Intent.ACTION_SEND);     sharingIntent.setType("text/*");     sharingIntent.putExtra(Intent.EXTRA_TEXT, link);     context.startActivity(Intent.createChooser(sharingIntent, "Share Via")); }   This method is present inside a java class.When this method called an error appear.     java.lang.NullPointerException: Attempt to invoke interface method 'java.lang.String android.content.SharedPreferences.getString(java.lang.String, java.lang.String)' on a null object reference   How Can I print that code with app link?

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 need to print using my regular office printer a design I have already made to wrap around to the shown here under mug.   As you may notice that the circumference of the top part is wider than the lower part. which mean That I need a sort of deformation or cone projection to do the job.  So please how can I do that doing Illustrator or Photoshop.  ps. There is a post discussing the process designing and printing for mugs  and it is not my case, it discuss the mug printing production itself, but my case is just a regular printing to warp a the printed paper around the mug.  using the wrap command is the solution but actually I don't know the exact amount that I have to adjust the distortion to get my design wrapped exactly over the mug. also I need to know how to determine the dimensions I marked "?" below.

I'm starting a project and want to have customized coffee mugs for people who support the project. I've never designed anything for a coffee mug before and am unsure of the typical standards. I know that print design is typically 300dpi, etc (I haven't done print design in forever, so it could have changed.)  But are there any standard dimensions, dpi, and colors for coffee mug printing? I don't really know how they print onto a coffee mug, so I'm very unsure of how to create it.  I need large portions of transparent parts for my ideal design. I'd like to just set up a wide graphic in photoshop, much like I would create a texture for a cup in 3DS Max.  So, summary of the question:  What dimensions, color mode(CMYK?), and other graphical considerations do I need to design for? Is there any kind of PSD template for a cup wrap? And for a bonus, do "cup printers(?)" print inside of cups as well? How would I create a template for that?


The question, problem 38 from Knights of Pi Math Tournament: Dec. 12, 2009:  Lord Voldemort is buying snakes. There are an infinite number of four varieties of snakes: garter snakes, king cobras, boa constrictors, and coral snakes. Lord Voldemort wants to buy six snakes. How many ways can he choose the snakes (assume all snakes of the same species are indistinct)?  The answer is 84, but what ways would be the quickest and most efficient? Thanks in advance!

I have a problem that I am unable to solve. I spent too much time on this one and I think I miss something.  An ice-cream-shop has 11 flavors of ice-cream. In how many ways can one person choose 6 cornets with flavors not necessarily different?


In Drupal 7, there exists the function hook_node_load. Does anyone know how I can hook into a node being loaded from the database in Drupal 6? If not, can you suggest an alternative hook? I am simply trying to get my custom module to load my javascript file upon the user visiting a particular node page. Thanks.

Is there still a hook_nodeapi in drupal 7 or do i have to try hook_node_load hook for appending some content to node?


OK I have looked up a plethora of these questions on how to install them, and honestly I can't get it to work for the life of me.   I don't know what I'm doing wrong, nor am I super experienced with linux.   When I read some of these instructions and they are even the slightest vauge, such as with not explaining from start to finish how to "cd" something, I tend to get rather lost.   So my question is, can someone just lay out for me in the most simple way on how to install my intuos wacom pen and touch cth-480 / cth-480/s? And I mean every single step, I have tried and tried and simply cannot get it done. I was hoping to ditch my shite of a track pad that comes with this throwaway laptop but no such luck.

My Wacom tablet (CTH-480) is not detected by the Wacom Tablet option under settings. The Tablet shows up when I run lsusb but does not show up under settings. Again Thanks.


I'm new to both subjects and also this forum, so any help would be greatly appreciated.  Proof by induction if that $G$ is a complete graph with n vertices, then the number of edges of $G$ is $n (n - 1) / 2$.  Thanks in advance.

Prove by induction that if $G$ is a complete graph, which has n vertices, then the network $G$ has $n(n − 1)/2$ edges.  How do we go about induction with networks?


I am relatively new to shell scripts. I am trying to create a script that can initiate grunt.js by launching the script in Finder (Mac). I want to be able to place this script anywhere and for it to just work by running the version of grunt in the folder the script is located.  How can I achieve this? I have looked for a few hours trying to find a solution but due to my lack of knowledge I am struggling.  Does anyone have a snippet that can CD to the directory the script is stored and run a command?

How do I get the path of the directory in which a  script is located, inside that script? I want to use a Bash script as a launcher for another application. I want to change the working directory to the one where the Bash script is located, so I can operate on the files in that directory, like so: $ ./application


Usually the decay is said to be randomly but the average period of decay of certain atoms are stable. So if you randomly take a bunch of the same atoms the average time before the decay will fe be 5 days.   But imagine that you could create a bunch of atoms at the same time by decaying uranium atoms. Imagine that you succeeded in creating at the same time a buch of polonium atoms. So they all have the same age. Is the time that those polonium atoms decays in lead also has the same variety of decay with a certain average time or are all polonium atoms decaying more or less at the same time?  Perhaps uranium is not a good example, but it is about the principle question.  To make a distinction of other questions: when atoms are created is there a difference is spreading decay time among those atoms or is the spread of decay time the same, although of course the average time would stay the same?

Say you have a vial of tritium and monitor their atomic decay with a geiger counter. How does an atom "know" when it's time to decay? It seems odd that all the tritium atoms are identical except with respect to their time of decay.


EDIT (before publication): I found the answer in this question: , but it's a little hidden, so I still choose to publish this question and answer it myself, as I think the question title describes my problem better than the question I extracted the answer from and I estimate it might save somebody else the trouble of looking for the answer in a less specific question. Here comes:  In my document, I have numbered and unnumbered sections. I want both in my ToC. I am almost certain someone else has been looking for a way to achieve this, but I can't even find out how to get to the question I am looking for, so, I'm sorry if this is a duplicate of another question, but I couldn't find it. I'm out of ideas as to what to type in the search field.  \documentclass{article} \begin{document} \tableofcontents \section*{Abbreviations or what have you} \section{The First Section} \end{document}   I would like this example to produce:  "  Table of Contents  Abbreviations or what have you ..................1  1  The First Section ......................................2  "  (Trailing dots to "align" the numbers. No dots for sections in normal ToC.)  Could something similar to [heading=bibintoc] be used? This one makes the bibliography appear in the ToC without a number.   and other similar questions do not hold the answer to my query, as they seek to take away the numbers to the sections and still make a ToC, but it seems all their sections are unnumbered. I really don't know what to look for. If you don't want to post an answer, but a link to another question with an answer that solves my problem, that's ok with me, of course.  Comments and better answers always welcome. I am a beginner in TeX/LaTeX.

I'm using LaTeX and the book class and have one problem:  I want that my starred sections (only starred sections) appear in the center of the pages instead of the left side of the pages and also these sections to be added to the table of contents automatically.


I still have problems computing (without a calculator) for example: $R_{21}(3^{234})$  I know i have to use the chinese reminder theorem, bu before that, how do i get there? I know that i haw to split 21 into primes, e.g. $3*7$, and therefor $R_{3*7}((3^{39})^6)=..$.   I hope someone can briefly explain this to me with the given example, would be happy!   Thank you.

I need some help with this problem:  $$439^{233} \mod 713$$  I can't calculate $439^{223}$ since it's a very big number, there must be a way to do this.  Thanks.