I have recently started renting a server from Hetzner..  I get continuous emails telling me that my server is performing scans on other servers:   "Your server with the above-mentioned IP address has performed scans on other servers on the Internet.  This has placed a considerable strain on network resources and, as a result, a segment of our network has been adversely affected"   I have run clamscan and rhkit, nothing is found or detected even with updates.   Do you have any advice on how I can solve this issue? Is there a way of installing a firewall???    Nmap shows:  PORT      STATE SERVICE 22/tcp    open  ssh 80/tcp    open  http 31337/tcp open  Elite

This is a  about Server Security - Responding to Breach Events (Hacking)   See Also:                  Canonical Version I suspect that one or more of my servers is compromised by a hacker, virus, or other mechanism:   What are my first steps? When I arrive on site should I disconnect the server, preserve "evidence", are there other initial considerations? How do I go about getting services back online? How do I prevent the same thing from happening immediately again? Are there best practices or methodologies for learning from this incident? If I wanted to put a Incident Response Plan together, where would I start? Should this be part of my Disaster Recovery or Business Continuity Planning?   Original Version       2011.01.02 - I'm on my way into work at 9.30 p.m. on a Sunday because our server has been compromised somehow and was resulting in a    attack on our provider. The servers access to the Internet   has been shut down which means over 5-600 of our clients sites are now   down. Now this could be an FTP hack, or some weakness in code   somewhere. I'm not sure till I get there.      How can I track this down quickly? We're in for a whole lot of   litigation if I don't get the server back up ASAP. Any help is   appreciated. We are running Open SUSE 11.0.            2011.01.03 - Thanks to everyone for your help. Luckily I WASN'T the only person responsible for this server, just the nearest. We managed   to resolve this problem, although it may not apply to many others in a   different situation. I'll detail what we did.      We unplugged the server from the net. It was performing (attempting to   perform) a Denial Of Service attack on another server in Indonesia,   and the guilty party was also based there.      We firstly tried to identify where on the server this was coming from,   considering we have over 500 sites on the server, we expected to be   moonlighting for some time. However, with SSH access still, we ran a   command to find all files edited or created in the time the attacks   started. Luckily, the offending file was created over the winter   holidays which meant that not many other files were created on the   server at that time.      We were then able to identify the offending file which was inside the   uploaded images folder within a  website.      After a short cigarette break we concluded that, due to the files   location, it must have been uploaded via a file upload facility that   was inadequetly secured. After some googling, we found that there was   a security vulnerability that allowed files to be uploaded, within the   ZenCart admin panel, for a picture for a record company. (The section   that it never really even used), posting this form just uploaded any   file, it did not check the extension of the file, and didn't even   check to see if the user was logged in.      This meant that any files could be uploaded, including a PHP file for   the attack. We secured the vulnerability with ZenCart on the infected   site, and removed the offending files.      The job was done, and I was home for 2 a.m.            The Moral   - Always apply security patches for ZenCart, or any other CMS system for that matter. As when security updates are released, the whole   world is made aware of the vulnerability.   - Always do backups, and backup your backups.   - Employ or arrange for someone that will be there in times like these. To prevent anyone from relying on a panicy post on Server   Fault.


Is there a method of displaying a post that is a draft when not logged in?  For example I have created a mailer template for my news...  <?php if ( isset($_GET["mailer"]) ) get_template_part( 'mailers/template', 'news' ); else { get_header(); ?>      <!-- WEB TEMPLATE -->  <?php get_footer(); } ?>   This is on my single-news.php template.  As you can see my news mailer template is pulled in when I use this variable... ?mailer   http://www.example.com/my-news-reports/?mailer   But I would like to be able to still use the mailer template even when in draft mode.  Is this possible with adding a variable like this.. ?mailer&draft=true  I understand the 404 template is retrieved, and this may cause issues. Just wondering if there was a method I could adopt to get round this draft issue.  Thanks

I have several unpublished posts in my Wordpress website and I am trying to make it accessible for normal users (who are not logged in) using the normal post slugs (site.com/post-here). I understand it may not be the best practice but for my special purpose, this needs to be done.  I have tried adding the following code snippet into my functions.php file:  function enable_view_drafts() { $role = get_role( 'subscriber' );  $role->add_cap( 'read_private_posts' );  $role->add_cap( 'edit_posts' ); } add_action( 'after_setup_theme', 'enable_view_drafts');   I've also tried init hook instead of after_setup_theme. No luck.  My understanding is that changes to roles are saved to the database so only need to be done once. That is why I'm using after_setup_theme hook to call the function.  But when I try to access the page as a normal user, I'm being shown a 404 page instead of showing the post content. I've also tried loading the preview URL (site.com/?p=212&preview=true) but that didn't work either.  These are my guesses:   the normal user doesn't have enough caps to read the drafts post. testing and viewing draft posts on the front-end is not possible for any users (including administrators).   What changes do I have to make in order to accomplish what I'm trying to do? If it's not possible, what alternative solutions do you suggest?  Note: I'm not looking for plugin-based solutions.


Consider a continuous function defined all of $R^n$ i.e., $h:R^n \to R$. Also obtain the infimum of $h$ $$ a: = \inf_{x\in R^n} h(x) $$  Define the set $A := \{ x \in R^n : h(x) > a \}$. Is $A$ open?  I was trying to show that it is open. If $A$ is all of $R^n$ then it is open. We will consider the case when $A \subset R^n$. If $A$ is a strict subset of $R^n$ then its complement exists. Denote it by $A^c$. Also, since $h(x)$ is defined over all $R^n$ and $a$ is the infimum, we can obtain $A^c$ explicitly as $$ A^c = \{ x \in R^n : h(x) = a \}$$  It remains to show that $A^c$ is closed. Suppose that $A^c$ is not closed. Then there is a sequence of points in $A^c$: $x_1, x_2, \dots$ such that $\lim_{n\to \infty} x_n  \notin A^c$. This is a contradiction since $h$ is continuous and  $ h(x_n) = a$ for every $n$, and its limit is $a$.  Did I get this right? Is there a better proof?

Suppose that $S$ is a closed subset of $\mathbb R^d$ and that $f$ is a continuous real-valued function with domain $S$. Show that, for every real number $a$, the set {$x ∈ S | f(x) ≤ a$} is a closed subset of $\mathbb R^d$    I don't know how to start this. Do we use the fact that If $S$ is closed and bounded every sequence in $S$ has a subsequence that converges to a point in $S$?


recently i had to change two files on a fedora raw image mounted via loopback on ubuntu, which usually runs in a kvm on the ubuntu host. That made a lot of troubles with selinux after booting from the image because of wrong selinux labelling, the system could not access these files without proper selinux labels.  while i know that i can set on fedora a .autorelabel, it is a long and tedious boot process (about 1 hour on slow disks) and it seems to be too much as I have changed only 2 files (network & passwd). I also do not want to turn off selinux for Fedora!  Is there possibility to mount a fedora image on a ubuntu system, change files and  relabel on Ubuntu. Note that Ubuntu has no selinux active.  "restorecon", which is always mentioned in the web only seems to work with an active selinux, which does not work in this case, with a fedora image mounted via loopback on unbuntu. Is there any way to relabel the changed files correctly, assuming that this labels are part of the ext2/xfs filesystems fedora uses?

I have a Linux system (Arch Linux) without SELinux support. I would not like to configure such support on my system. Now, I have an ext4 volume image which is known to have some SELinux context set on its files. I need to read and change that context for certain files. When I mount this image and ls -lZ it, I get a ? instead of context.  How do I access & change SELinux context on files if I don't have SELinux enabled systemwide? If this is impossible, then which is minimal SELinux configuration which will not influence overall system but will allow me to change contexts within a mounted image?


I've practically browsed the whole Internet, but didn't find any particular formula for calculating the trophy outcomes in a PvP game such as Clash of Clans. This is what I figured out so far:   At some point I thought that the sum of points was always 48, and that it is separated between the winner and the loser, weighted in favor of the one with fewer points. This turned out to be not true, because I myself have been in battles where winning I got like 13 trophies and losing I got 14 (total 27). I thought it is some kind of an ELO rating system, but couldn't confirm it actually is, not just because there is no negative trophy count in CoC, but also because in small differences in rank you could actually gain a lot of trophies (like 30) when winning. As far as I know you're matched against opponents with a rank that is ranged within ~230 trophies compared to your rank Ps: I'm not talking about clan trophies, but the trophies of a single person in normal multiplayer.   I'd like to ask that if anyone more familiar with the subject brang more light into this, preferably a Supercell employee. ;)

While searching for an opponent, I have noticed that the total possible trophies to be awarded fluctuates.  I have seen enemies with 2 town halls greater than mine (and with xbows & flame towers) and the possible awarded trophies (if you 100%) is around 10 to 15.  What is this reason that this is so low?      The most I have seen is around 35 possible trophies - when performing an attack that isn't revenge.


Can anyone tell me how to get my iPod touch to shuffle my full music library with iTunes 12.1.0.50?

In the old version of the music app you could shuffle all songs when songs were selected:      This feature seems to be absent in iOS 8.4 and the new music app:      What are the options for shuffling all my songs in the new version of the music app under iOS 8.4?


It is my terminal command sudo apt install --install-recommends winehq-staging  and it is my answer Reading package lists... Done Building dependency tree        Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation:  The following packages have unmet dependencies:  winehq-staging : Depends: wine-staging (= 5.21~bionic) E: Unable to correct problems, you have held broken packages.  I'm getting confuse how to install wine on Ubuntu 18.04 because I need that

After upgrading from 10.04 to 12.04 I am trying to install different packages.  For instance ia32-libs and skype (4.0).  When trying to install these, I am getting the 'Unable to correct problems, you have held broken packages' error message.   Output of commands:  sudo apt-get install -f Reading package lists... Done Building dependency tree        Reading state information... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.   After running this:  sudo dpkg --configure -a foo@foo:~$ sudo apt-get install -f Reading package lists... Done Building dependency tree        Reading state information... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.


I'm kind of new to latex and I keep having the error: 'missing $ inserted' in the following piece of code:   \sigma$_1$  and \sigma$_3$ horizontal   anyone knows what I'm doing wrong?

Been trying to this line to parse for a good 20mins, but all attempts have failed:  \beta = $-$0.84, t = $-$2.09, P = 0.04   Could anyone tell me why I'm getting a Missing $ inserted error here?


In the whole series we never know who were Harry's grandparents. He sees them in that magical mirror in the first book but it does not ever occur to him to ask about them from anyone. He never wonders how they died or where they lived nor he ever asks about any relatives from his father's side.  Why JKR never mentioned the Potters? Has she had any interview about this?

You'd think that as soon as Harry met someone who was friends with his dad, he'd have asked about his family.  Certainly Lupin or Sirius could have told him something of his family, given that they were James' closest friends, and Sirius was "always welcome at the Potters".  Obviously there's nothing in the books, but did J.K. Rowling ever explain why there was no mention of any living relative other than Aunt Petunia, or even what happened to Harry's grandparents?


I am very new to Ubuntu and I am trying to download Adobe Flash Player. I need someone to take me through every single step. What version do I need to download?  Thank you so much!!!!

I have had significant problems with watching flash video in 64-bit Ubuntu.  Does anyone know of a good way to get flash running on the platform?


I want to run a script by doubleclicking the executable file. I tried this: filename: myscript.sh script to run: run this script I making the myscript.sh executable by rightclick  and checking: "allow executing file as program" but I cannot get it to work. Everything that happens when I doubleclicking the file its content displays in the default application, in my case in GNU emacs. How can I execute the script? This seemed easy but I cannot find a working solution. Im running Ubuntu 18.04.5 LTS

When I double-click on a script in Nautilus to run it, the script just opens in my text editor with no option to run it. Using Nautilus, how do I run executable text files and/or scripts?


So, basically I have a library system that has      private int numberOfBooks = 0;      public int getNumberOfBooks() {     return numberOfBooks; }   Of course when you add a new book in the library the numberOfBooks is increased by 1. My other class Student has the following code:      private LibrarySystem libraryBooks;      public void searchByISBN() {     int i = 0;     boolean found = false;     while(i<libraryBooks.getNumberOfBooks()) //THE PROBLEM IS HERE     {         if(books[i].getISBN().equals(in.next()))         {             found = true;             break;         }         i++;     }     if(found)     {         System.out.println("\n Book info: \n ISBN: " + books[i].getISBN() +                              "\n Title: " + books[i].getTitle() +                             "\n Author: " + books[i].getAuthor() +                             "\n Subject: " + books[i].getSubject());                         }        else System.out.println("There is no book with such ISBN"); }   I get a Java.lang.NullPointerException and I don't know why. How can I fix this?

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  if I could ask a certain type of DIY question. It received a score of -3 and was eventually closed.  My question: isn't the purpose of Meta to make sure that I ask correct questions in SE?

If I have a specific question I want to ask about, but I don't know which Stack Exchange site would be on topic for asking that question, where can I ask where to ask that question?  Is there any generic place where we can ask for advice? Is it here?  This is not about a specific question but in general.  For example: "Where should I ask for advice about fishing?", or if I need to know where I should ask "What would be the best fishing rod to fish for salmon?" (regardless of how good/bad these examples are)


I am trying to predict for count which ranges from 0 onwards as a regression problem using NN. Can I add sigmoid, tanh or relu activation function to the hidden layers and no activation function to the final layer?

What is the purpose of a neural network having a non-linear activation function?   Is it correct to say that the non-linear activation function's main purpose is to allow the neural network's decision boundary to be non-linear?  I've read in other StackOverflow answers that the activation function "", but that is rather vague.  Another posting states that an answer in the context of , but again that is not exactly what I'm asking.


Let $f_n, f \in L^1(\mathbb{R}), f_n \to f$ pointwise. Then $\int \left|f_n-f\right| \to 0$ iff $\int \left|f_n\right| \to \int \left|f\right|$.    My attempt was to use the Triangle Inequality for one side. Certainly taking convergence in mean as true we have convergence in mean of the absolute values, because of the triangle inequality.   Now, take convergence in mean of the absolute values. How to show convergence in mean of the original functions? I'm not even sure where pointwise convergence comes into play at this point. The only thing I tried was Egoroff's Theorem, and that led to nothing.   I would appreciate a hint, or a link if this is a repeated problem (I have a feeling it's standard, but I couldn't find it in the drop-down menu when I typed out the title).

Let $1\leq p < \infty$. Suppose that    $\{f_k\} \subset L^p$ (the domain here does not necessarily have to be finite),  $f_k \to f$ almost everywhere, and  $\|f_k\|_{L^p} \to \|f\|_{L^p}$.    Why is it the case that $$\|f_k - f\|_{L^p} \to 0?$$   A statement in the other direction (i.e. $\|f_k - f\|_{L^p} \to 0 \Rightarrow \|f_k\|_{L^p} \to \|f\|_{L^p}$ ) follows pretty easily and is the one that I've seen most of the time. I'm not how to show the result above though.


I have a program where I generate a folder, its subfolders and files, and when I click the file, it has to show its content. My problem is that when I click, the function isn't called.  This is my function:       function printFile(params) {             //alert("Hello");             $.ajax({                     method: "GET",                     url: "getFile.php",                     data: {                         q: params                     }                 })                 .done(function(msg) {                     $("#continut").html(msg);                 });      }      window.onload = function(){         //alert("Hello");         $("li").click(function() {              printFile(this.id);         });      };   This is the body:  <?php     function listAll($path, $test) {          $fileList = glob($path);          //Loop through the array that glob returned.         foreach($fileList as $filename){         $pieces = explode("/", $filename);         if($test == 0){         if (strpos(end($pieces), '.') !== false) {         echo '
'.end($pieces)."
", '
';          }         else         echo '
'.end($pieces).'
', '
';          }         else         {         $spaceValue = 40*$test;         echo '
';         if (strpos(end($pieces), '.') !== false) {         echo '
'.end($pieces)."
", '
';          //echo $path;         }         else         echo '
'.end($pieces).'
', '
';          echo '
';         }         listAll($path.end($pieces)."/*", $test+1);         }     }      listAll("D:/xampp/htdocs/*", 0);    ?>   And this is getFile.php:  <?php       $val = $_GET['q'];      $fh = fopen($val,'r');     while ($line = fgets($fh)) {         echo($line."
");     }     fclose($fh);   ?>   What can I do to call the function printFile on generated li?

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 really want to use Firefox as my main browser but can't find a way to make it the default browser on iOS: this make it's adoption much more complicated. Is it totally impossible?   Edit - Example of use case: while clicking a link in the Twitter app, I would like it to open directly in Firefox.  I won't jailbreak.

With Google Chrome available for iOS now I'd like to know if it's possible to make Chrome the default browser? I find "open in browser" type options from other iOS apps still take me to Safari.  Not interested in jailbreaking. Looking for a solution that works without having to do that.


I have an example of an array of objects a that I copy with slice() to b.  I alter one of the objects in a but it changes also b. Isn't slice supposed to copy the array, including its contents? I need a and b to have different pointers.  Javascript  var a = [{x1:1, x2:2}, {x1:3, x2:4}];  var b = a.slice();   a[1].x1 = 5;   console.log(b[1]);   this prints:  x1: 5  x2: 4

...where each object also has references to other objects within the same array?  When I first came up with this problem I just though of something like   var clonedNodesArray = nodesArray.clone()   would exist and searched for info on how to clone objects in javascript. I did find a  on StackOverflow (answered by the very same @JohnResig) and he pointed out that with jQuery you could do  var clonedNodesArray = jQuery.extend({}, nodesArray);   to clone an object. I tried this though, this only copies the references of the objects in the array. So if I   nodesArray[0].value = "red" clonedNodesArray[0].value = "green"   the value of both nodesArray[0] and clonedNodesArray[0] will turn out to be "green". Then I tried  var clonedNodesArray = jQuery.extend(true, {}, nodesArray);   which deep copies an Object, but I got "too much recursion" and "control stack overflow" messages from both Firebug and Opera Dragonfly respectively.  How would you do it? Is this something that shouldn't even be done? Is there a reusable way of doing this in Javascript?


First of all argument bounded and monotone will not work because there is no restriction on sequences to be positive or negative, they can alternate irregularly.  I tried to make a use of comparison test but there was too many cases to consider and it was just too messy.  So I think the only way to approach the problem is directly from the definition. All I need to do is to prove that the sequence of partial sums $B_n=\sum^n_{i=0} b_i$ is convergent sequence.  So I tried to prove that $B_n$  is Cauchy because this seemed easier. $$a_n<b_n<c_n \\ \therefore \ a_n+a_{n+1}+...+a_{n+m}<b_n+b_{n+1}+...+b_{n+m}<c_n+c_{n+1}+...+c_{n+m}\\ \therefore  \ A_{n+m}-A_n<B_{n+m}-B_n<C_{n+m}-C_n$$ and by sandwich this goes to zero $B_{n+m}-B_n$ goes to zero as $n$ tend to infinity. The problem is that I need no this expressions but modulus of them and in this case it does not need to be true for example if  $A_{n+m}-A_n<0<B_{n+m}-B_n$. And here I am stuck

I am interested in proving a theorem, which I suppose one may call a sandwich or squeeze theorem for series.  Suppose we have three series: $\sum^{\infty}_{n=1}a_{n}$, $\sum^{\infty}_{n=1}b_{n}$ and $\sum^{\infty}_{n=1}c_{n}$. We know that $\sum^{\infty}_{n=1}a_{n}$ and $\sum^{\infty}_{n=1}c_{n}$ converge; furthermore, let us assume that for all $n\in\mathbb{N}$, the following inequality holds: $a_{n}<b_{n}<c_{n}$. Then, the series $\sum^{\infty}_{n=1}b_{n}$ will also converge.  The only way that I can think of to approach the proof of the above would be via the Cauchy criterion, i.e. showing that  $$\forall_{\varepsilon>0}\,\exists_{n_{\varepsilon}}\,\forall_{m>k>n_{\varepsilon}}\quad|b_{k+1}+...+b_{m}|<\varepsilon.$$  As I understand, in order to show that, we would have to somehow bound $\left|\sum^{m}_{n=k+1}b_{n}\right|$ by $\left|\sum^{m}_{n=k+1}c_{n}\right|$ and/or $\left|\sum^{m}_{n=k+1}a_{n}\right|$. If we assume nonnegativity of the terms of $\sum{}b_{n}$ and $\sum{}c_{n}$, the task becomes trivial. However, without this assumption, I am having problems with finding the right bound.   I would be thankful for some hints on how this could be done, or possibly advice on a different approach to the proof. Thank you in advance.


So I had an old panel and subpanel replaced with a single new panel. The guys reused the old breakers, and the breakers wobble in the panel like loose teeth. With the old panel, they didn't wobble at all.   Is this because the breakers don't fit the new panel, or were they just not tightened down enough?  The breakers are GE type THQL, 1 pole units. The panel is a GE PowerMark Gold Load Center, type 1 indoor enclosure, model 6.

I went on a breaker flipping binge the other day because the panel at my house wasn't labeled and I had a doorbell transformer to replace. After I got the doorbell finished I realized the fridge wasn't running. Investigated and found that the issue is the breakers have some wiggle to them, not flopping around but if you apply slight pressure to top or bottom they move a fair bit. Can reliably get fridge to turn off by wiggling that breaker.  The Wiggle (animated gif but seems to only go if clicked on):   I'm not super comfortable with fussing in the main panel, I'm just wondering if I should expect an electrician to want to replace the whole panel? Does replacing the whole panel seem reasonable for something like this? Should I just swap out this one breaker for now and see if that helps?


I wanted to make an anvil with a tutorial. But as I added the subsurf Modifier it started looking weird. I wanted to make a"Hole" but it fills it up. How can i get it right?

I'm following . After using Boolean I cleaned up the extra vertices. Edge flow looks fine on my mesh.   However, when I apply a Subdivision Surface modifier my mesh becomes really messy as if something is wrong with the edge flow.   Can you guys help spot the problem?  Mesh topology:    Subdivision issue:


Using adb shell or a terminal emulator on the device, entering this will clear all notifications (requires su)  service call notification 1   This will send an sms (doesn't require su)  service call isms 5 s16 "PhoneNumber" i32 0 i32 0 s16 "BodyText"   Where can I learn more about service call? I've found  on StackOverflow and appreciate the answer's breakdown as to what everything means. But where can I find info on what method notification 2 might be trying to call?  Running service call was incomplete and printed this usage:  Usage: service [-h|-?]        service list        service check SERVICE        service call SERVICE CODE [i32 INT | s16 STR] ... Options:    i32: Write the integer INT into the send parcel.    s16: Write the UTF-16 string STR into the send parcel.   I ran service list and it came back with 78 services for my device including isms and notification and for most services will print what seems to be a namespace (com.android.internal.telephony.ISms for isms and android.app.INotificationManager for notification). How can I use this information to find out what I can do with each of these services?

In  I was adviced to use service call phone 2 s16 "$number". It works, but in service list I see other useful things I don't know how to use and can't easily find the information on the Internet.  I don't see any introspection in service apart from service list to findout myself...  Where to find more complete description of "service" calls and their parameters?


I found this option in the file /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf : wifi.powersave = 3  But couldn't find detailed explanations about that in the :  wifi.powersave  If left unspecified, the default value "ignore" will be used.  I noticed that my Wi-Fi signal sometimes goes down even if the modem is near my laptop.Can that option cause this behavior ? And also does that have an impact on speed? (because of the packet drops due to low signal intensity) And what does 3 mean in that option? Thanks.

In Linux Mint 17.3 / 18 iwconfig says the power management of my wireless card is turned on. I want to turn it off permanently or some workaround on this issue.  sudo iwconfig wlan0 power off works, until I reboot the laptop.  Also, if I randomly check iwconfig, sometimes it's on, despite I did run this command.  I read some articles about making the fix permanent. All of them contained the first step "Go to directory /etc/pm/power.d", which in my case did not exist.  I followed these steps:  sudo mkdir -p /etc/pm/power.d sudo nano /etc/pm/power.d/wireless_power_management_off   I entered these two lines into the file:  #!/bin/bash  /sbin/iwconfig wlan0 power off   And I finished with setting proper user rights:  sudo chmod 700 /etc/pm/power.d/wireless_power_management_off   But after reboot the power management is back on.  iwconfig after manually turning power management off  eth0      no wireless extensions.  wlan0     IEEE 802.11abgn  ESSID:"SSID"             Mode:Managed  Frequency:2.462 GHz  Access Point: 00:00:00:00:00:00              Bit Rate=24 Mb/s   Tx-Power=22 dBm              Retry short limit:7   RTS thr:off   Fragment thr:off           Power Management:off           Link Quality=42/70  Signal level=-68 dBm             Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0           Tx excessive retries:2  Invalid misc:18   Missed beacon:0  lo        no wireless extensions.   I don't think this question applies only to Linux Mint, it is a general issue of particular wireless adapters.


I have a canon DSLR and even in Manual mode or with proper settings, I have to bump aperture, shutter speeed AND ISO to get photos to be even CLOSE to the right exposure. Currently have my ISO set to 1600 just to get a decent photo in natural light with Aperture at 4.5 and SS at 1/60. I shouldn't have to shoot like this and can't even THINK about shooting the low-light portraits that I love. Someone please help. There is no one in town that will repair on site and I don't want to send it out for something that could be simple, just never thought of!

I am shooting in natural light, with my subject facing a full floor-to-ceiling south facing window. You would think my meter would allow ISO between 200-400 in bright light, but I was lucky to get it to 640, with f/3.2 and 1/60 (manual mode).  I've read other places that people say put your ISO down to 100 for indoor shots for greatest clarity (especially sharp eyes) — but don't know how I can with subjects potentially moving. Is there a setting in my camera (Canon 5D Mark III) I am missing, or something that might be making my meter need more light?


I saw the definition of electric charge in David Tong's QFT lecture in the Dirac theory to be given as, $$Q=\int d^{3} x \bar{\psi} \gamma^{0} \psi=\int d^{3} x \psi^{\dagger} \psi.$$ However, the combination $\psi^{\dagger} \psi$ is not Lorentz invariant. Then how the charge is a Lorentz invariant quantity as it is supposed to be? Am I missing something? Can someone clarify these to me. Also in QFT what is the most rigorous definition of electric charge if the electrons are modeled as excitations of the Dirac field?

We have gravitational force between two massive particles and we have electromagnetic force between two charged particles. When special relativity suggests that mass is not an invariant quantity why we have electric charge as an invariant quantity ?


Once the tag has been selected for a particular site in the ios app, looks the questions are sorted by popularity. How can the questions be sorted by date to see all the unanswered questions at the top?

When I start the (alpha 0.1.50) iOS app on iOS 7, the Questions tab shows Active Questions (see below).  I would far prefer to see the Newest Questions but have not been able to find a way to configure this.  Is it possible, in the current alpha of the iOS app, to switch the Questions viewed to be sorted by Newest?


If I have a file words_of_interest.txt with one word per line, is there a way to use awk (or some other *nix tools) to obtain the number of times each of these words occurs in another text file my_text.txt, using only one pass?  Currently I am grep -c'ing  the text for each word, but this is quite slow because the text is large, and there are several hundred words to search for.  EDIT: providing sample input and output:  [words_of_interest.txt] joe hi  [my_text.txt] hi joe hi jack nice day today  [output] joe 1 hi 2   EDIT2: To those who marked this question as duplicate: the  is about counting all the words, whereas this one is about counting only the instances of a specific pre-defined set of words.

I had a command which would work through a text file, count all the occurrences of the words and print it out like this:  user@box $˜ magic-command-i-forgot | with grep | and awk | sort ./textfile.txt 66: the 54: and 32: I 16: unix 12: bash 5:  internet 3:  sh 1: GNU/Linux   So it does not search line-by-line, but word by word, and it does it for all the words, not just for 1 word. I'd found it somewhere on the internets a long time ago, but I cannot find or remember it..


I have a class which I'm trying to stream directly into (I'm not streaming the class into an ostream, but actually streaming text into the class) by overriding the << operator. The class is essentially used so we can toggle debug output on and off for different parts of the project. However, when I try to use the operator, I get an undefined reference.  This is what's in my .h as a public member of the class  template <typename T> DebugOutputStreamer& operator<<(T const& value);   And this is in my .cpp  template <typename T> DebugOutputStreamer& DebugOutputStreamer::operator <<(T const& value) {     if(m_Enabled)     {         if(m_UseColors)         {             std::cout << m_OuputColour << value << ConsoleColour::FG_DEFAULT;         }         else         {             std::cout << value;         }     }     return this; }   However when I try to stream "Hello" in, I'm getting   main.cpp:(.text+0x564): undefined reference to `DebugOutputStreamer& DebugOutputStreamer::operator<< <char [6]>(char const (&) [6])'   Could anybody tell me what I'm missing?

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


I was recently reading articles/posts about the Special Theory of Relativity and I was fascinated by the theory's insights about space and time. My goal is to have an in-depth understanding for STR and so I want to know what books, websites or youtube channels are good for learning the STR. Also, do you have to be an expert at STR to be good in GTR?  **My Mathematical knowledge is not very high(in Pre-Calculus) and I am in AP Physics 1. Just some helpful information.

This question recently appeared :     Slashdot posts a fair number of physics stories. Many of us, myself included, don't have the background to understand them. So I'd like to ask the Slashdot math/physics community to construct a curriculum that gets me, an average college grad with two semesters of chemistry, one of calculus, and maybe 2-3 applied statistics courses, all the way to understanding the mathematics of general relativity. What would I need to learn, in what order, and what texts should I use? Before I get killed here, I know this isn't a weekend project, but it seems like it could be fun to do in my spare time for the next ... decade.   It seems like something that would be a good addition to this site: I think it's specific enough to be answerable but still generally useful. The textbook aspect is covered pretty well by , but beyond that: What college-level subjects in physics and math are prerequisites to studying general relativity in mathematical detail?


What does this 4 graphs mean and how are they related to my 2 cores? I have a MacBook Pro (13 inch medio 2012?

I checked the specs, and the i5-3427U CPU has 2 cores.  But the Activity Monitor shows 4 little charts for the CPU, so it looks like 4 cores.   Which is correct? Why does the Activity Monitor have 4 charts?


Before starting to ask, just know that I am a total noob to CSS and started learning it yesterday along with HTML.  I'd like to know how i can center a div with some text in it. I've tried this:  #div1 {position:absolute;top:50%;left:50%;}   but it doesn't move exactly to the center.

How can I horizontally center a
 within another
 using CSS?

Foo foo


, is there a way to delete the Stack Exchange OpenID?

I have two OpenID accounts. So what I want to do is delete or remove my private email from the StackExchange OpenId, but the problem is I can't find the remove, delete or deactivate button?  I want to remove my private email from OpenID because I only use that email for my family, friends and love ones.


It is possible to 'fill' an array in Python like so:  > [0] * 10 [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]   I wanted to use this sample principle to quickly create a list of similar objects:  > a = [{'key': 'value'}] * 3 > a [{'key': 'value'}, {'key': 'value'}, {'key': 'value'}]   But it appears these objects are linked with one another:  > a[0]['key'] = 'another value' > a [{'key': 'another value'}, {'key': 'another value'}, {'key': 'another value'}]   Given that Python does not have a clone() method (it was the first thing I looked for), how would I create unique objects without the need of declaring a for loop and calling append() to add them?  Thanks!

I needed to create a list of lists in Python, so I typed the following: my_list = [[1] * 4] * 3  The list looked like this: [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]]    Then I changed one of the innermost values: my_list[0][0] = 5  Now my list looks like this: [[5, 1, 1, 1], [5, 1, 1, 1], [5, 1, 1, 1]]    which is not what I wanted or expected. Can someone please explain what's going on, and how to get around it?


What off-topic flag should I use on SO for a question that has nothing to do with programming, software, and is not suitable for any other SE site?  The reworked flag system confuses me; I don't see any off-topic flag that fits a completely off-topic question.

Currently, when flagging an off-topic question, the following choices are offered.   Questions about general computing hardware and software are off-topic for Stack Overflow. Questions concerning problems with code you've written must describe the specific problem and include valid code to reproduce it. Questions must demonstrate a minimal understanding of the problem being solved. Questions on professional server, networking, or related infrastructure administration are off-topic for Stack Overflow unless they directly involve programming or programming tools. Questions asking us to recommend a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. This question belongs on another site in the Stack Exchange network   However, there are some questions that fit in none of these categories.  For example, career advice questions are off-topic here (and on programmers.SE), questions like  are off-topic on pretty much any SE site.    Some questions might also be relevant on another SE site not listed when the "belongs on another site" option is selected.  How should those questions be flagged?  Why isn't there a "it's off-topic because it is" option?  EDIT: just to be clear, I don't have the "Other" option under Off-Topic.


How to prove that the number of divisors of any positive number $n$ is $\le 2\sqrt{n}$?   I have started something like below:  $$ n^{\tau(n)/2} =   \prod_{d|n} d$$  But not getting ideas on how to take this further and conclude. Any help is appreciated. Thanks!

In Waclaw Sierpinski's book Elementary Theory of Numbers on page 168 there is the following exercise:  "Exercises. 1. Prove that for natural numbers $n$ we have $d(n) \leq 2\sqrt{n}$," where $d(n)$ is the number of divisors of n.  As a hint right below is given: "The proof follows from the fact that of two complementary divisors of a natural number $n$ one is always not greater than $\sqrt{n}$.  I understand the hint but I don't know how it can be used to prove $d(n)\leq 2\sqrt{n}$.  Complementary divisors are pairs of divisors that when multiplied gives the number that is to be divided. For example the number $120$ has the complementary divisors: \begin{align*} & 1, 120 \\ & 2, 60 \\ & 3, 40 \\ & 4, 30 \\ & 5, 24 \\ & 6, 20 \\ & 8, 15 \\ & 10, 12 \\ \end{align*} How do you prove that $d(n) \leq 2\sqrt{n}$?


Just bought a brand new HP pavillion all in one desk top. I saved the current Ubuntu to a USB stick and Im not sure once im in setup what to do to have it boot up using the USB stick ?

This is the third time I've tried to install Ubuntu Server 14.04.03 64-bit on the same laptop, and each time it caused different problems.  Each time I wrote the same iso image to a USB flash drive by using a different application and OS.   Universal USB Installer (pendrivelinux.com) from Windows WinImage writer from Windows built-in image writer from Linux Mint 17.2    The iso image is the same in all three cases, the USB flash drive is the same, and the laptop is the same. However each time the installation of Ubuntu gave me different installation options. For example, the last time I installed Ubuntu, it didn't show all the packages to choose while installing (Basic Ubuntu server, etc.).


I would like to build a memoryless (possibly cyclic) logic circuit. Perhaps this is not the best name, so let me illustrate what I would like to have with an example.  Consider a state machine with inputs a and b, and outputs i and o. The values of the outputs are defined by the equation:   i = a * b o = b   or with the truth tables:  a b | i o  0 0 | 0 0  0 1 | 0 1  1 0 | 0 0   1 1 | 1 1  The output values are completely defined by the inputs, independently of the history of the circuit or of the current value of i and o.   This can be easily implemented by a circuit where i is the output of an AND between a and b, and o is simply b (in this circuit, the values of the outputs are independent of the previous history, so it is  said to be combinatorial).  Now consider the following circuit.    If the initial state of i and o is 0, then the circuit computes exactly the function above. However, if then we change the input, that is no longer the behavior, because the circuit has "memory" (the circuit is not combinatorial, but rather sequential). For example:  i) First we set a and b to 1, so that i and o become 1 too.  ii) Afterwards a remains 1 and we set b to 0, then i and o remain with value 1 (the circuit remembers the previous value).  Then my question is: is there any implementation of logic gates such that in (ii) i and o become 0? More in general, I would like the machine to implement the function above no matter which is the previous history.  I would like to keep the wires between the gates, and simply change the implementation of the gates. My intuition is that if the circuit contains only OR gates, this can be achieved implementing the OR gates with diodes (). But I am not sure about this, and I have no clue about how to do that for AND gates (I only care about monotone circuits, so implementing NOT is not an issue).  I will try to give one more example of a simple circuit with one feedback loop and one OR gate. Consider the function o = i and the circuit on the left:    This is a sequential circuit. Assume initally o = i = 0. Then we set i to 1, and o becomes 1. Then, after setting i to 0, o remains 1.   However, if we implement the OR gate with diodes (as in the right image, see ), then the circuit is not sequential any more. The output o is always equal to i, no matter the previous history. Please, correct me if this is wrong. Then for this simple case, the answer is: yes, you can implement the OR gate with diodes to achieve that behavior.  Thank you!

Consider the following circuit with two OR gates:         – Schematic created using   and the Time Simulation:   The OR gates with both inputs 0 generate 0, and after one input is set to 1,  they remain with 1 as long as there is current. The circuit has memory.  Now consider the implementation of OR with diodes (let's call them diode-ORs):          and the Time Simulation:   In this case, the diode-ORs always generate a 0 whenever both inputs are 0. The circuit has no memory. And there is a loss of voltage, that would accumulate if more diode-OR gates were cascaded.  My question is the following: is there another implementation that behaves like diode-ORs (i.e., without memory even in the presence of feedback loops) but does not have a cumulative voltage loss (or has only a very small voltage loss)?  Or put another way: can we replace each of the two diode-ORs by a circuit so that the whole system behaves the same way, except that there is no cumulative voltage loss (or the voltage loss is very small)?  Maybe using pass transistor logic? ()  Dave Tweed suggested to use a "better diode" and that is a correct answer to the question. Is there any other alternative? A problem with that solution is that it cannot be used for the AND case, which I would also like to handle in that way (with low voltage drop, and without memory even in the presence of fededback loops) because diode-ANDs have memory when there is positive feedback ().  I am a computer scientist and I am interested in the answer mainly for theoretical reasons and for teaching purposes.  I know that the feedback loop is not needed to generate the outputs of the circuit.   Thank you!


banks = {     "National Bank of Canada" : "327",     "Toronto-Dominion Bank" : "302",      "Royal Bank of Canada" : "173",      "Wells Fargo" : "273",      "Goldman Sachs" : "87",      "Morgan Stanley" : "72",      "Canadian Imperial Bank of Commerce" : "83",     "TD Bank" : "108",      "Bank of Montreal" : "67",      "Capital One" : "47",      "FNB Corporation" : "4",      "Laurentian Bank of Canada" : "3",      "Ally Financial" : "12",     "Montreal Trust Company" : "145",     "Canadian Western Bank" : ".97" }    for value in banks.values():     count += 1     total_mkt_cap += float(value)     total =+ count     if float(value) > float(largest):         largest = value  The variable largest is now the value 327, but I would like largest to be the key which is "National Bank of Canada", not the value, any help appreciated, thank you

I have a dictionary: keys are strings, values are integers.  Example:   stats = {'a':1000, 'b':3000, 'c': 100}   I'd like to get 'b' as an answer, since it's the key with a higher value.  I did the following, using an intermediate list with reversed key-value tuples:  inverse = [(value, key) for key, value in stats.items()] print max(inverse)[1]   Is that one the better (or even more elegant) approach?


I wrote a sentence, and I am confused about the word 'therefore', if 'therefore' in a right place. If this sentence has another error, please point out. Thank you. Here is the sentence:  Some people have talent skills, these people therefore learn some things far faster than others.

I know we can begin a sentence with Therefore. We can also use it after commas in a sentence.  For example, which is correct?   She had previous experience, therefore she seemed the best candidate. She had previous experience. Therefore, she seemed the best candidate.   I myself feel when the first or second clause is long or when the subject is switched, using "therefore" at the beginning of sentence is better. Therefore, I think sentence #1 is better here because it uses the same subject and both sentences are short.


So I'm new to coding and working my way through the Titanic data set from Kaggle. In the data frame there are columns labeled "Age" and "Sex." I want to make a new column that has 4 values that indicate for different things: 0: Male aged 16 or over 1: Female aged 16 or over 2: Male aged 15 or younger 3: Female aged 15 or younger  So far I've gotten this, but this just splits it up into 3 values, not the 4 I'm looking for.  def person_detail(Person):     Age, Sex = Person     return 2 if Age < 16 else Sex   I then apply the function to the "Age" and "Sex" columns to get a new column. I know that you can't have two returns, but if it gets across what I am trying to accomplish, it would look something like the below.  def person_detail(Person):     Age, Sex = Person     return 2 if Age < 16 and Sex == 0     return 3 if Age < 16 and Sex == 1 else Sex   Thanks in advance. For reference in the "Sex" column 0 is for male, and 1 is for female.

I want to write a function in Python that returns different fixed values based on the value of an input index.    In other languages I would use a switch or case statement, but Python does not appear to have a switch statement.  What are the recommended Python solutions in this scenario?


I have several layers and want to delete some of their table attributes columns, like FLAG. Using Refactor fields is fine:    However, when I do it in batch, I get an error in the Fields mapping column which doesn't recognize FLAG:  Missing parameter value: Fields mapping (row 1)     I was hoping to use the tool in batch as I have several columns I want to have deleted in many of my layers.

In QGIS, there is this nice tool "Refactor Fields" in the Processing Toolbox :    Using it on a single layer is fairly straightforward.  However, when you plan on using it in a batch mode, one can see the "Fields mapping" textbox. I'm looking for an example of the syntax to be used there.  I haven't found any specific documentation yet.


I have installed Ubuntu 12.04 and want to increase my swap size from 1Gb to 4Gb. how can I do this?  /dev/sda5                               partition       1046524 568284  -1

I have, by default, 250MB of swap space in Ubuntu, and I want to expand it to a larger size. I need 800MB, which I think will be enough to open several applications without having to hit the current limit of swap. I hope someone can help me.


More and more lately I've been noticing--what I think of as--mistakes with plurals. I've seen this a lot in spoken English, but it's also popped up a few times in the articles and books I read. The majority of the time, this seems to be with sentences that start with "There's [...]." ie:  There's three of them on the table over there. If there's more of them in your pocket, why are you asking me? There's other ways this can go, just talk to me!  All these cases look improper to me. It should be "There are" or I guess "There're" if the speaker/writer wanted to keep the contraction. And yet, I've started seeing this multiple times on a daily basis. I've begun to question whether I'm in the wrong. Did I miss some change to the word "There's?" Can it be used for plurals despite being the contraction for "There is?" I've added the  tag in case this is a solely American quirk.

It seems I put a   Bounty assigned by outside party, two lengthy, reference-citing answers, one "-1" (awarded the bounty), one "-2", two others scored "0" and "-2" respectively, the answers suggesting one or the other is correct, 73 comments and no consensus so far - and me, as the asker, lost without a clue what to think of the answers anymore -  this is no longer "Learners' Level" question, so I thought I'd bring it here and hear what the experts have to say.    Original question:  Plurality of verb depending on plurality of list elements  An edit was suggested to my sentence.     There was were an orange, some grapes, two apples and a small pile of cherries on the plate.   In my native language plurality of the verb always follows plurality of the first element on the list. There were an orange,... sounds awkward to me, no matter what follows up. My simple solution was reordering:     There were some grapes, an orange, two apples and a small pile of cherries on the plate.   But that's not the first time I faced this situation and I'd like to know what the rules of grammar say about that - was my editor overzealous or am I trying to copy rules of my language that don't apply in English?    Someone linked a  for negatives, where the situation is more clear-cut ("There is no..."). Same applies to connection with "or" apparently, per accepted answer there. Still, nothing for "and".  It seems there is a consensus that in that if the verb goes after the list, it will be plural.     an orange, some grapes, two apples and a small pile of cherries were on the plate.   There doesn't seem to be clear consensus for:     On the plate { was | were } an orange, some grapes, two apples and a small pile of cherries   Adding more to the confusion is the abbreviated form: "There's"     One last note. In North America, at least, there is a widespread use of using a singular form like "there is" and "there was", without regard for the subject item or items, and this "there is" is often shortened to "there's":           There's three apples on the table!      Could you please clarify this mess?


I want to draw the following inequalities in LaTeX.    This set of inequalities define a region. I want to plot this set of inequalities. How can I do this?   I want to achieve something like this.

i'm here to ask if there's a TikZ/pgf support to draw areas resulting from a system of linear inequalities, into a xyz cartesian space. i found examples of my needs for xy plan at , but i also need to draw some 3d polytopes.  the problem is coordinate system as i found in pgfmanual.pdf seems not suited for R3: only (,) support but i need something like (,,).  As an example, i need to do drawings like this:    but i also need to get a colored surface with a 50% transparent color.  The system which generated that polytope is quite simple and is a linear programming problem:  x_1 + x_2 + x_3 <= 4 x_1             <= 2             x_3 <= 3     3*x_2 + x_3 <= 6 x_1             >= 0       x_2       >= 0             x_3 >= 0    Can you advise me some url/article/doc which can help me, or make me some example to lead me to learn how to reach my target?  Thank you for your attention


I got Yosemite via the Apple Beta Program. I installed Yosemite on a separate partition which I had created for the purpose specifically. Now I want to reclaim my 50 GB by deleting the partition. I have already set my startup disk to my original Mavericks partition.   So, if I launch Disk utility in Mavericks and delete the Yosemite partition, will my Mac still boot?   PS: I am not looking to uninstall just yet, but I'm running low on space and might need to get some space back soon enough (before Yosemite gets stable and I get the upgrade).

I have installed the developer preview for Yosemite.  Huge mistake. Everything in my workspace is broken.  I don't have any sort of backup image. I was wondering if I could re-download Mavericks and run the installer - would that effectively downgrade me back to Mavericks?


First I had this issue described here  but nobody was able to provide a valid answer.  Recently this wifi connection issue gets even worse. I would lose wifi connection randomly about every 5 minutes on my computer(Dell XPS 8900 with skylake i7-6700 CPU and Samsung 950PRO SSD). The wifi icon would remain connected state while connection is lost. It looks like it would be  reconnected automatically after a while or I will have to reconnect manually.  Can somebody plz tell me what is going on here? Is it something wrong with my computer or just another bug with this version?

I have installed Ubuntu 15.04 on my laptop with RTL8723BE Wi-fi card. But it is always disconnecting from network. I have tried echo "options rtl8723be fwlps=N ips=N" | sudo tee /etc/modprobe.d/rtl8723be.conf but that didn't helped. What can I do to prevent the wifi from disconnecting? If I upgrade to kernel 4.X, will it help?  ~$ lspci -knn | grep Net -A2  09:00.0 Network controller [0280]: Realtek Semiconductor Co., Ltd. RTL8723BE PCIe Wireless Network Adapter [10ec:b723]     Subsystem: Hewlett-Packard Company Device [103c:2231]     Kernel driver in use: rtl8723be   ~$ rfkill list 0: hci0: Bluetooth     Soft blocked: yes     Hard blocked: no 1: phy0: Wireless LAN     Soft blocked: no     Hard blocked: no   ~$ ifconfig && iwconfig && route -n && ping -c 1 google.com eth0      Link encap:Ethernet  HWaddr 38:63:bb:cd:4a:7e             UP BROADCAST MULTICAST  MTU:1500  Metric:1           RX packets:3 errors:0 dropped:0 overruns:0 frame:0           TX packets:53 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:1000            RX bytes:752 (752.0 B)  TX bytes:8445 (8.4 KB)  lo        Link encap:Local Loopback             inet addr:127.0.0.1  Mask:255.0.0.0           inet6 addr: ::1/128 Scope:Host           UP LOOPBACK RUNNING  MTU:65536  Metric:1           RX packets:3870 errors:0 dropped:0 overruns:0 frame:0           TX packets:3870 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:0            RX bytes:314613 (314.6 KB)  TX bytes:314613 (314.6 KB)  wlan0     Link encap:Ethernet  HWaddr c0:38:96:6d:c4:83             inet addr:192.168.1.205  Bcast:192.168.1.255  Mask:255.255.255.0           inet6 addr: fe80::c238:96ff:fe6d:c483/64 Scope:Link           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1           RX packets:15240 errors:0 dropped:0 overruns:0 frame:0           TX packets:14627 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:1000            RX bytes:14410285 (14.4 MB)  TX bytes:2192744 (2.1 MB)  eth0      no wireless extensions.  wlan0     IEEE 802.11bgn  ESSID:"DIR-615"             Mode:Managed  Frequency:2.437 GHz  Access Point: 00:90:4C:08:00:0D              Bit Rate=150 Mb/s   Tx-Power=20 dBm              Retry short limit:7   RTS thr=2347 B   Fragment thr:off           Power Management:off           Link Quality=70/70  Signal level=-22 dBm             Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0           Tx excessive retries:0  Invalid misc:186   Missed beacon:0  lo        no wireless extensions.  Kernel IP routing table Destination     Gateway         Genmask         Flags Metric Ref    Use Iface 0.0.0.0         192.168.1.1     0.0.0.0         UG    400    0        0 wlan0 169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 wlan0 192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 wlan0 PING google.com.Dlink (172.26.136.19) 56(84) bytes of data. 64 bytes from 19.136.26.172.in-addr.arpa (172.26.136.19): icmp_seq=1 ttl=249 time=102 ms  --- google.com.Dlink ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 102.547/102.547/102.547/0.000 ms


I have a directory with over 400 images. Most of them are corrupt. I identified the good ones. They are listed in a text file (there're 100+ of them).  How can I move them all at once to another directory on BASH?

I have a file that contains file names. For example:  /tmp/list.txt (it is with the spaces at the start of each line):     /tmp/file.log   /app/nir/home.txt   /etc/config.cust   I want, using one line, to move all the files listed in /tmp/list.txt to /app/dest  So it should be something like this:  cat /tmp/list.txt | xargs mv /app/dest/


I'm planning on building an online presence of a game I'm working on once it reaches a stage that would allow for creating marketing material (screenshots, trailers, etc).  Should I trademark/copyright my game before I start building online presence? How long does the trademarking/copyrighting process take? How much money can it cost?

I got a couple of questions about game trademarks.   When should I submit a trademark for my game if I see that this is a serious project? Where do I submit a trademark request? Does it have to be local (In my country)? What do I need to be ready to submit a trademark request?   Thanks!


I was trying to make an application that would hold data of what their customer is buying. Code for the method that is creating trouble for me is here:   private void MyData(long Invoice, String Name, int num, String[] products, int[] quantity, double tax, double cost) throws FileNotFoundException, IOException {     FileInputStream inputStream = new FileInputStream(new File("SalesDetails.xlsx"));     XSSFWorkbook workbook = new XSSFWorkbook(inputStream);     XSSFSheet worksheet = workbook.getSheetAt(0);     Invoice =Invoice+3;     for(int i=2; i<=27; i++)     {         XSSFCell cell=null;          cell = worksheet.getRow((int)Invoice).getCell(i);         switch (i) { //some cases. }     }   In this method, I am using Apache POI to write to an excel file.  The line where I put cell = worksheet.getRow((int)Invoice).getCell(i);  is creating an exception which I am not getting why. Please help me find solution to this.  I know there is already a similar question, but the solution to it is not helping me remove the exception.

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


I have a web service that returns an xml string as results. The return string is in this format:  <ReturnValue>    <ErrorNumber>0 </ErrorNumber> <Message>my message</Message> </ReturnValue>   The data that I want to insert into the "message" tag is a serialized version of a custom object. The serialized format of that object contains xml and namespace declarations post serialization. When that gets thrown into the "message" tag of my return xml string, XmlSpy says that it's not well-formed. How should I get rid of the namespace declarations, or is there a different way to imbed a serialized object into an xml string?

I was looking for a generic method in .Net to encode a string for use in an Xml element or attribute, and was surprised when I didn't immediately find one.  So, before I go too much further, could I just be missing the built-in function?    Assuming for a moment that it really doesn't exist, I'm putting together my own generic EncodeForXml(string data) method, and I'm thinking about the best way to do this.    The data I'm using that prompted this whole thing could contain bad characters like &, <, ", etc.  It could also contains on occasion the properly escaped entities: &amp;, &lt;, and &quot;, which means just using a CDATA section may not be the best idea.  That seems kinda klunky anyay; I'd much rather end up with a nice string value that can be used directly in the xml.  I've used a regular expression in the past to just catch bad ampersands, and I'm thinking of using it to catch them in this case as well as the first step, and then doing a simple replace for other characters.    So, could this be optimized further without making it too complex, and is there anything I'm missing? :  Function EncodeForXml(ByVal data As String) As String     Static badAmpersand As new Regex("&(?![a-zA-Z]{2,6};|#[0-9]{2,4};)")      data = badAmpersand.Replace(data, "&amp;")      return data.Replace("<", "&lt;").Replace("""", "&quot;").Replace(">", "gt;") End Function   Sorry for all you C# -only folks-- I don't really care which language I use, but I wanted to make the Regex static and you can't do that in C# without declaring it outside the method, so this will be VB.Net  Finally, we're still on .Net 2.0 where I work, but if someone could take the final product and turn it into an extension method for the string class, that'd be pretty cool too.  Update The first few responses indicate that .Net does indeed have built-in ways of doing this.  But now that I've started, I kind of want to finish my EncodeForXml() method just for the fun of it, so I'm still looking for ideas for improvement.  Notably: a more complete list of characters that should be encoded as entities (perhaps stored in a list/map), and something that gets better performance than doing a .Replace() on immutable strings in serial.


We need to remove the all special character from the string in apex.  String s1 = 'a"b*c:5>x<y?z/de|f\''; String regExp = '"*:<>?\/|\/‘; String replacement = '1'; String s2 = s1.replaceAll(regExp, replacement); System.debug(s2);   Above code shows,      Illegal string literal: Invalid string literal '"*:<>\/?|'. Illegal character sequence \/' in string literal error.   How to remove the special character from the string in apex.

I'm especially terrible with Regex, but reworked one I found online to suit my needs, but it keeps throwing the "no viable alternative at character '\'" error. This pattern works when tested in regex101.com, regexplanet.com, and rubular.com. I thought I had escaped everything that needed escaping. Right, now  I'm out of my depth with this. Hopefully someone here can give me some insight.  In case anyone needs to know, the regex needs to find the first email address in an the email body (which is from a submitted form) that immediately follows the word "From:" (at this point I'm unsure if there will be a space after "From:" or not), since there could be multiple email addresses in the text.  Thanks in advance to anyone who can help!  Here's my code:  if (email.Subject.Contains('xxxx') || email.fromAddress == 'xxxx'){         Pattern myPattern = Pattern.compile('From:(\\s(?:[a-z0-9!#$%&'*+\\/=?^_'{|}~-]+(?:\\.[a-z0-9!#$%&'*+\\/=?^_'{|}~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\]))');         Matcher myMatcher = myPattern.matcher(email.plainTextBody);         Set<String> emails = new Set<String>();         while(myMatcher.find()) {             emails.add(matcher.group(1));         }     }


Evaluate $$P.V. \int^{\infty}_{0} \frac{x^\alpha }{x(x+1)} dx   $$ where $0 < \alpha <1$    Thm   Let $P$ and $Q$ be polynomials of degree $m$ and $n$,respectively, where $n \geq m+2$. If $Q(x)\neq 0$. for $Q$ has a zero of order at most 1 at the origin and $f(z)= \frac{z^\alpha P(z)}{Q(z)}$, where $0 < \alpha <1$ then  $$P.V, \int^{\infty}_0 \frac{x^ \alpha  P(x)}{Q(x)} dx= \frac{2 \pi i}{1- e^{i \alpha 2 \pi }}  \sum^{k}_{j=1} Res [f,z_j] $$ where $z_1,z_2 ,\dots , z_k$ are the nonzero poles of $\frac{P}{Q}$    Attempt  Got that $P(x)=1$ where its degree $m=1$ and $q(x)=x(x+1)$ its degree is $n=1$ so it is not the case that $n \geq  m+2$ because $2 \geq 1+2$

I've been looking at  $$\int\limits_0^\infty  {\frac{{{x^n}}}{{1 + {x^m}}}dx }$$  It seems that it always evaluates in terms of $\sin X$ and $\pi$, where $X$ is to be determined. For example:  $$\displaystyle \int\limits_0^\infty  {\frac{{{x^1}}}{{1 + {x^3}}}dx = } \frac{\pi }{3}\frac{1}{{\sin \frac{\pi }{3}}} = \frac{{2\pi }}{{3\sqrt 3 }}$$  $$\int\limits_0^\infty  {\frac{{{x^1}}}{{1 + {x^4}}}dx = } \frac{\pi }{4}$$  $$\int\limits_0^\infty  {\frac{{{x^2}}}{{1 + {x^5}}}dx = } \frac{\pi }{5}\frac{1}{{\sin \frac{{2\pi }}{5}}}$$  So I guess there must be a closed form - the use of $\Gamma(x)\Gamma(1-x)$ first comess to my mind because of the $\dfrac{{\pi x}}{{\sin \pi x}}$ appearing. Note that the arguments are always the ratio of the exponents, like $\dfrac{1}{4}$, $\dfrac{1}{3}$ and $\dfrac{2}{5}$. Is there any way of finding it? I'll work on it and update with any ideas.    UPDATE:  The integral reduces to finding   $$\int\limits_{ - \infty }^\infty  {\frac{{{e^{a t}}}}{{{e^t} + 1}}dt} $$  With $a =\dfrac{n+1}{m}$ which converges only if   $$0 < a < 1$$  Using series I find the solution is     $$\sum\limits_{k =  - \infty }^\infty  {\frac{{{{\left( { - 1} \right)}^k}}}{{a + k}}} $$


Lenovo laptop running Windows 7 Home Premium.  My windows explorer runs VERY slowly.  e.g. a RMB on anything in the right hand pane or on the desktop takes 10 seconds, even selecting objects (files or folders) takes 10 seconds.  However, selecting folders in the left pane of the explorer (the tree) or in the top (where the "url" would be) has instantaneous response.  This is with respect to files local to my hard drive, the CPU utilization is low to zero (though the explorer process jumps up to 25% utilization during the selection - on a 4 CPU system).  Interacting with icons in the taskbar is also slow (10 seconds per operation).  When I rebooted this morning, I caught the taskbar while the log in process was still happening, and it responded immediately, I opened an explorer - no delay in interacting.  Then all of a sudden the 10 second lag happened again.  So it appears that something I've installed and have running is causing this.  What is a good way to track this down?  Other than re-imaging my computer, or just blindly uninstalling everything one-by-one?  My startup folder has only one item in it (Dropbox), so there must be some other place where other programs are launched.  Edited to add: The problem in this case happened to be MS Office's Grooveex.dll, which was disabled by configuring MS Office 2010 and disabling the sharepoint (I think, I disabled a few things).   from the duplicated question really helped, specifically the autoruns - which let me look at what specific things were autorun that specifically affected Explorer.  That was perfect.

A machine is described as being "really slow" or "freezing". How can I troubleshoot/resolve this issue? What should be the first steps to take?


For convenience, I tend to brew tea in a French press. Just drop a bunch of tea leaves, add hot water, let the leaves dance in the water for a little while, and then push the press down and serve (I know there are probably a million better ways to do it, but take it as a given that I don't want to change my brewing method). I tend to get two to three medium-sized cups from a single press. Unavoidably, because I drink these cups over the course of an hour or so, the last one comes from water that has lingered with the leaves longer and can be quite bitter, sometimes unpleasantly so. If it was for the taste only, I would often pour that last cup down the drain. But I figure it might also be the cup with the highest caffeine content and because I also dring tea to stay alert through the day, I sometimes force that cup onto myself, for caffeine-intake purposes only. Since this can be the only reason I go through that last cup, I am now wondering whether --- and to what extent --- it's even true that this last cup contains more caffeine than the previous ones? Am I at least getting the caffeine-intake benefits I am looking for when I chug that last disgustingly bitter cup?

The ISO standard for brewing tea says "6 minutes".  Of course different teas have vastly different properties, but...  For "average commodity black tea" and "average commodity green tea", will leaving the tea bag in longer (say 1 hour or 1 day) result in higher caffeine content in the cup?  How much?


I have a employee dataset with the following 5 details.  projects completed customer ratings number of bugs reported customer complaints profit   I want to rank these employess based on their efficiency. We have observed the following facts of each detail as follows.  projects completed -> highly efficient employees tend to complete many projects customer ratings -> highly efficient employees has a good customer ratings number of bugs reported -> highly efficient employees has less number of bugs reported customer complaints -> highly efficient employees has less customer complaints profit -> highly efficient employees make a higher profit to the company   I am wondering if I can convert the above observations to derive a ranking function to rank the employees. Please recommend me a suitable approach to perform my task of ranking.  I am happy to provide more details if needed.

I am analysing some employee details to find the efficiency of the employees. Ideally I want some rankings to rank them based on these features.  My features include;   current salary projects completed customer ratings number of bugs reported customer complaints employee satisfaction profit age etc.   My target is the ranking of the employee in the job hierarchy.  I did some correlation analysis and found some features that have positive correlation (e.g., salary, projects completed, profit, customer ratings, employee satisfaction etc.).  I also found some features that are negatively correlated with ranking (e.g., customer complaints, number of bugs reported etc.)  Now, I want to use these features to make a function that reflects the employees actual rankings, so that we can use the same function to rank employees in the future.   NOTE: I am not only limited to correlations. I am happy to receive answers using other methods as well.  Is there a any good method to solve my problem.  I am happy to provide more details if needed.


I want get the pathInof in my template twig :  How i can reach pathInfo please in my template ?

I have a Link field named field_my_link (machine name).  Within a Twig template I can get the link's URL value with this:  {{ node.field_my_link.uri }}   If inside the Link's URL there is an external URL, e.g. http://example.com it works good.  But, if inside the Link's URL there is stored an internal URL, e.g. "/node/11", I get a value like this:  "internal:/node/11"   with the "internal:" prefix.  How can I get the valid URL?  For example, if the link's URL is "http://example.com" I want "http://example.com" (this already works), if the link's URL is "/node/11" I want the relative URL "/node/11", if the link's URL is "<front>" I want the URL "/", etc.    EDIT  I can get the value I want within a PHP preprocess function, using this:  $url = $variables['node']->get('field_my_link')->first()->getUrl();   How can I access the same value within the Twig template?  I know I can do this within the preprocess function:  $variables['my_url'] = $url;   Then access the url within Twig using {{ my_url }}, but I would avoid to write a preprocess function each time I have a link field.


We arrived in the US by air, bought a car in California, and spent just under the 90 days allowed in the USA under the Visa Waiver Program before exiting overland to Mexico.  Our plans have now changed and we wish to sell the car in a few months time and return home to Australia.  To sell the car and transfer registration requires a smog check, and our preferred flight goes from Los Angeles, so it appears we have to return to the US to sell the car and fly home.  We plan to give ourselves a month in the US to sell the car before flying home.  We're unsure what our best move is in gaining re-entry to the USA.  Our options as we see them:  1) Return to the border after 90 days+ in Mexico, explain that our purpose of entry is to sell the car and fly out, and show proof of travel.  2) As above but take the long drive down to Guatemala or Belize in order to leave North America, before driving back up.  3) Apply for a proper visa at the embassy in Mexico City.  However they appear to require original copies of marriage/birth certificates, which we don't have with us.  Additional Information:  We entered by air, and therefore weren't given a paper I-94W form.  Our proof of exiting the USA within the 90 days is in the form of our entry stamps to Mexico.  We have more than sufficient funds to support ourselves in the USA, and can provide evidence of it.  We will have one way tickets booked back home to Australia and can show the booking as evidence.  We're travelling on our Australian passports.  I realise that there aren't any guarantees or hard and fast rules.  However we'd appreciate opinions on the best course of action based on our situation.  Many thanks!

Sorry about my wrong terminology, thank you for the corrections, I am revising my question a little so hope it is a little clearer. Thank once again.  We plan to travel to the US (Colorado) from the UK in early February 2018 under the VWP. Our return flight to the UK is scheduled for mid-June 2018. We plan to purchase an RV and then spend 60 days in the Western US then travel overland into Canada for approximately 40 days (asking US immigration to log us out when we leave). We understand our 90-day allowance will continue to 'run down' whilst we are in Canada. Our questions are:   Will our initial 90-day allowance expire when we are 'logged out' by US immigration. If not, does it matter? If our entry into the US expires whilst we are in Canada, is there any process for a UK citizen to apply for some sort of visa that would guarantee entry into the US for another 25 days or so? After spending approximately 40 days in Canada (therefore 100 days after we originally entered the US), will we be able to simply apply for re-entry into the US at an overland crossing from Canada (and will the initial VWP entry in February have any bearing)? We will then spend approximately 25 more days in the US, heading back to Colorado to sell the RV and fly back to UK around mid June 2018.   While I understand that the B2 visa option would solve this issue, getting that process completed (timescale, interview in London, etc) makes it impractical for us in this case.


I read this sci-fi book quite some time ago, it was an old paperback, and I can only remember parts of it.  Most of the story takes place on some sort of intergalactic cruise ship and for some reason relevant to the plot, people rent/change bodies for the travel.  The main character is an “average Joe” who accidentally ends up with some super soldier/assassin body instead of the one he was supposed to get, leading to high jinks and mayhem.

I'm trying to find the title of a book I read sometime between 85 and 95 in German. It could have been written much earlier, and it was most likely translated from English. I think it had a "book to the movie" sticker on the cover, but all googling for the movie or book failed so far.  What I remember:   brain transplants are safe and affordable enough to rent a body for a holiday. This is achieved with a robotic surgeon removing the brain and spinal cord from the old body and reattaching all nerves in the new body. an overweight guy leaves his dominating mother to take a holiday on a space cruise, renting a new body for the trip. I think through a bribe he manages to rent the body belonging to an assassin that was held in storage while the assassin was on an assignment. At some point a small alien is revealed to be living in one of the legs. the assassin returns from the assignment and gets the body of the overweight guy to follow him onto the cruise to get his body back. He later discovers that the body contained an implant producing a permanent feeling of guilt. overall villain is a human-alien hybrid that has a robotic container attached to his spine that contains four additional brains. He owns the cruise ship and I think he tries to crash / blow it up somewhere. Though details are getting fuzzy, there.


I’ve developed an application using Python Language, but now I need to convert it to run in a cellphone which have Android Os.   Any recommendations?

We are working on an  version and this platform has a nice Python API..  However, there is nothing official about Python on Android, but since  exists, is there a way to let the snake and the robot work together??


I'm looking for a hotel search site that does the following things:   List the price as "what you pay" including all fees, taxes, surcharges, etc. Has a map view Ideally allows to search for "free cancellation"   Background: All my favorite search sites seems to have degraded a lot over the last few years, e.g. hipmunk.com, booking.com, hotels.com. They used to list the actual out of pocket price but now it's getting much more expensive when you get to the payment page, which makes it really hard to compare prices and plan to a budget. That's partially driven by the idiotic "resort fee" that many hotels have started charging. I had extreme case on hotwire.com today: advertised rate $74/night, actual price to pay was $139. Almost double.   Also, since maybe 2015/2016 the difference between "free cancellation" and "prepaid" has gone way up from almost nothing to a substantial percentage of the rate.  That, again, makes it hard to search for a "free cancellation" rate, since only the pre-paid ones will show up in the comparison.  Any tip for a website or some other search mechanism that allows comparing "true cost" for "free cancellation" rates would be appreciated.  EDIT Clarifying the question, since there seems to be some confusion. Let's say I have $200, I can spend on a room tonight in Boston. I'd like to see of a list of hotels that I can afford. Currently it's easy enough to see a list of hotels and prices, but the list prices are substantially lower than the actual price and the difference or ratio isn't constant either. For example, for tonight on hipmunk.com   "Taj Boston": lists at $170 but costs $225   "Westin Copley" lists at $180 but costs only $205.   So I have to always click through to the payment page to get the actual price and it's cumbersome to find hotels that match my price target.

Every time I book a hotel online, the price increases by 25% in "taxes and fees" at checkout, compared to the price featured in search results.  This does not occur when booking flights (I actually think there's a regulation against it for flights).  Is there a website that lets you compare the ACTUAL price of hotels with taxes and fees included, and also lets you book?


(Apologies in advance for any community-hated mistakes, this is my first post.)    I noticed something odd when writing a program for a class; the program would measure the time difference between a merge sort algorithm that I wrote and the merge sort performed by the Sort function in the Java Collections.    While testing the timer for Collections.sort() with multiple trials, I had some very strange output. The first "run" takes a notably longer time than any of the runs following it.    This is true whether I run multiple instances of the Sort class, or call the same instance multiple times.  It is true whether I repeatedly call a shuffled list, ordered list, reverse ordered list, or mix them up.  I've tried it on different computers/OSs, same results.  Trying smaller Linked Lists sometimes makes the results seem to steadily halve for a few runs until they plateau.  I've been searching for a possible reason for why this might be happening but can't find anything.  Any thoughts?  I don't think it's an actual glitch so much as something I'm not taking into consideration, but even my professor had no idea what the reason might be.  I've put some sample results and my relevant code below.  JDK MergeSort of shuffled list:  609 milliseconds 386 milliseconds 432 milliseconds 436 milliseconds 435 milliseconds 443 milliseconds 437 milliseconds 436 milliseconds 437 milliseconds 435 milliseconds 440 milliseconds   JDK MergeSort of ordered list:   42 milliseconds 34 milliseconds 34 milliseconds 35 milliseconds 33 milliseconds 37 milliseconds 34 milliseconds 38 milliseconds 34 milliseconds 35 milliseconds 34 milliseconds   JDK MergeSort of reversed list:   2312 milliseconds 42 milliseconds 43 milliseconds 76 milliseconds 40 milliseconds 40 milliseconds 46 milliseconds 67 milliseconds 40 milliseconds 40 milliseconds 44 milliseconds   Here's the relevant code:  import java.util.LinkedList; import java.util.Random;  public class Sort {  LinkedList test1 = new LinkedList();  public void jdkMergeSort(LinkedList test1){     Collections.sort(test1); }//end jdkMergeSort  public void fillLists(){     for(int i=0; i<1000000; i++){         Random j = new Random();         int k = j.nextInt(100000000);         test1.add(k );     }//end for loop         }//end fillLists  public void shuffleLists(){     Collections.shuffle(test1); }//end makeUnsortedLists  public void sortLists(){     Collections.sort(test1); }//end makeSortedLists  public void reverseSortLists(){     Collections.sort(test1);     Collections.reverse(test1); }//end makeReverseSortedLists  public void jdkSortTimer(){     long start,end;      shuffleLists();     start = System.currentTimeMillis();     jdkMergeSort(test1);     end = System.currentTimeMillis();     System.out.println("JDK MergeSort of random list: " + (end-start) + " milliseconds");       sortLists();     start = System.currentTimeMillis();     jdkMergeSort(test1);     end = System.currentTimeMillis();     System.out.println("JDK MergeSort of sorted list: " + (end-start) + " milliseconds");               reverseSortLists();     start = System.currentTimeMillis();     jdkMergeSort(test1);     end = System.currentTimeMillis();      System.out.println("JDK MergeSort of reversed list: " + (end-start) + " milliseconds");           }//end jdkSortTimer }//end class

How do you write (and run) a correct micro-benchmark in Java?  I'm looking for some code samples and comments illustrating various things to think about.  Example: Should the benchmark measure time/iteration or iterations/time, and why?  Related:


Ok, I'm taking a Comp. Prog. class at my high school and the teacher that "teaches" the class knows practically nothing about programming. I joined the Java UIL team and am teaching the class with curriculum from some college website. Anyways, I started writing a Body Mass Index Calculator yesterday, and have had success but my problem is that I want to have a println prompt to run the program again after the calculations have been completed. Now, I have learned the Do While loop for this occasion, but my problem is with the scanner. I want to receive input as a string but when I do   String a = sc.nextLine();    outside of the do, it says that y or yes, cannot be resolved to a variable. A friend suggested switch cases, what do you think? I use Eclipse BTW.  String a = sc.nextLine(); do{     wow(); //My method name }while(a == y); //Error is here

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


I am a new developer. I have created a plugin for data insert WP dashboard. I am trying to insert images in my database. I am trying to form submit with Ajax in WordPress. There is my code. When I use input type=text data submitted successfully, but when I use input type=file then data not submitted. I want all data inserted in my database and file saved in the upload folder.   <form  id="ajax_form" method="" action="<?php echo $_SERVER['REQUEST_URI']; ?> " enctype="multipart/form-data">

                     Code	                     <input type="text" name="code" value="<?php echo $code; ?>" class="ss-field-width" />

                     School	                     <input type="text" name="name" value="<?php echo $name; ?>" class="ss-field-width" />

                     Image	                     <?php wp_nonce_field('ajax_file_nonce', 'security'); ?>                         <input type="hidden" name="action" value="my_file_upload">                         It's a file upload...                         <input type="file" name="file_upload">

             <input type='submit' name="insert" value='Save' class='button'>          </form>   Ajax code is here:  jQuery('#ajax_form').submit(ajaxformdata);         function ajaxformdata()     {             var alldata = jQuery(this).serialize();              jQuery.ajax({               type:"POST",               //url: "/wp-admin/admin-ajax.php?action=signup",              url: "/mywp/wp-admin/admin-ajax.php?action=cruddata",                                data: alldata,               success:function(data)             {                 alert('Data submited');             },              error: function(errorThrown)             {                 alert(errorThrown);             }           });              return false;       }     PHP code is here  <?php function cruddata()     {         global $wpdb;         $code = $_POST["code"];         $name = $_POST["name"];         $imagesss = basename($_FILES["photo"]["name"]);         $table_name = $wpdb->prefix . "school";          $wpdb->insert(              $table_name, //table             array                 (                     'code' => $code,                      'name' => $name                     //'image_name' => $imagesss                 );         $message.="Data inserted";         }      add_action( 'wp_ajax_cruddata', 'cruddata' );

I would like to upload a file asynchronously with jQuery.     $(document).ready(function () {     $("#uploadbutton").click(function () {         var filename = $("#file").val();          $.ajax({             type: "POST",             url: "addFile.do",             enctype: 'multipart/form-data',             data: {                 file: filename             },             success: function () {                 alert("Data Uploaded: ");             }         });     }); });  File <input type="file" id="file" name="file" size="10"/> <input id="uploadbutton" type="button" value="Upload"/>     Instead of the file being uploaded, I am only getting the filename. What can I do to fix this problem?


Let $R=\mathbb{Z}[i]/(3+i)$. Why is this a ring and show that $|R|=10$. I'm not allowed to use isomorphisms for the second bit.  For the first bit I said $(3+i)$ is an ideal, $\mathbb{Z}[i]$ is a ring, and $\mathbb{Z}[i]/(3+i)$ is a quotient group so it is a ring.  Second bit no idea.

A very basic ring theory question, which I am not able to solve. How does one show that    $\mathbb{Z}[i]/(3-i) \cong \mathbb{Z}/10\mathbb{Z}$. Extending the result: $\mathbb{Z}[i]/(a-ib) \cong \mathbb{Z}/(a^{2}+b^{2})\mathbb{Z}$, if $a,b$ are relatively prime.   My attempt was to define a map, $\varphi:\mathbb{Z}[i] \to \mathbb{Z}/10\mathbb{Z}$ and show that the kernel is the ideal generated by $\langle{3-i\rangle}$. But I couldn't think of such a map. Anyhow, any ideas would be helpful.


If $f$ is a continuous even function from $[-a,a]$ to $\Bbb R$ then calculate $\int_{-a}^a \frac{f(x)}{1+e^x}dx$  The answer that is given is $\int _{-a}^af(x)dx$  My attempt  $I=\int_{-a}^a \frac{f(x)}{1+e^x}dx=-\int_{-a}^a \frac{f(x)e^x}{1+e^x}dx+\int_{-a}^a {f(x)}dx$  Now for the first integral, we can use integration by parts but the equation is getting complicated and for the second integral would be $2\int_{0}^a {f(x)}dx$ as $f$ is even. Please help...

I have a question:     Suppose $f$ is continuous and even on $[-a,a]$, $a>0$ then prove that   $$\int\limits_{-a}^a \frac{f(x)}{1+e^{x}} \mathrm dx = \int\limits_0^a f(x) \mathrm dx$$   How can I do this? Don't know how to start.


I have two images that should be under a section but it glitches back for some reason. Here is the code \section{Resultat} Huvudet från hammaren placerades i den mindre skålet medan stenen och keramiken placerades i bunkarna efter att de hade värmts upp tillräckligt vid 100 grader. Temperaturen mättes någon minut efter när föremålen hade placerats i det svalna vattnet.  \subsection{Stenen} Bunken med 600 ml vatten som stenen placerades i har massan  \begin{equation}     m_w1=\rho\cdot V_s=997\cdot 600\cdot 10^{-6}=\unit[0,5982]{kg}. \end{equation} Temperaturen för vattnet innan de stenen placerades i bunken ocg efter visas i figur 1.  \begin{figure}%     \centering     \subfloat[\centering Termometern visar cirka 17,5 grader Celcius.]{{\includegraphics[width=5cm]{sten efter.jpeg} }}%     \qquad     \subfloat[\centering Termometern visar cirka 17,5 grader Celcius.]{{\includegraphics[width=5cm]{sten innan.jpeg} }}%     \caption{Bilderna visar vattnets temperaturskillnad efter att stenen hade placerats i bunken.}%     \label{fig:example}% \end{figure}  It shows up like this  As you can see, it should appear under the subsection ''Stenen'' but instead it appears under ''Materiel''.

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


Suppose we have a real vector space $X$ and $\varphi_1,\varphi_2,...,\varphi_n$ and $\psi$ linear functionals from $X$ to $\mathbb R$. I'm struggling with the following implication:  $$ "ker(\psi) \supset \cap_{1\le k \le n}ker(\varphi_k)" \implies " \exists \lambda_1,\lambda_2,...,\lambda_n \in \mathbb R: \psi=\sum_{1 \le k \le n}\lambda_k \varphi_k" $$  What I've tried so far was passing to the quotient $X/\cap_{1 \le k \le n}ker(\varphi_k)$ and then defining the unique linear functional $$\varphi: X/\cap_{1\le k \le n}ker(\varphi_k) \to \mathbb R, \space [x] \mapsto \psi (x)$$  I don't know how to proceed and to be honest I don't even know if this is the right approach but the kernel intersection immidiately triggered the idea to pass to the quotient.  Any help?

I am trying to prove the following. I have seen it alluded to in other places of the internet (this site included) but without proof.  Let $L,L_1\ldots L_n$ be linear functionals on a vector space $X$. If $\bigcap_{i=1}^n ker(L_i) \subset ker(L)$ then there exists $t_i$ for  $i=1\ldots n \in \mathbb{R}$ such that $L = \sum_{i=1}^n t_i L_i$.   In other words, if the intersection of kernels of linear functionals is contained by the kernel of another linear functional then they are linearly dependent.  Related:


I was puzzling over this question that a friend suggested to me. I have come up with no definite answer. What I thought was that:   $x/x$ is $1$ and  $x/0$ is UNDEFINED (or some people say it's $\infty$)   To explain this you need some weird quantum mathematics. When I scoured the internet for answers, all I could find was exactly what I found myself. Does anyone have a definitive answer (even if it's just definitely impossible).

I came up some definitions I have sort of difficulty to distinguish. In parentheses are my questions.   $\dfrac {x}{0}$ is Impossible (  If it's impossible it can't have neither infinite solutions or even one. Nevertheless, both $1.$ and $2.$ are divided by zero, but only $2. $ has infinite solutions so as $1.$ has none solution, how and why ?) $\dfrac {0}{0}$ is Undefined and has infinite solutions. (How come one be Undefined and yet has infinite solutions ?) $\dfrac {0}{x}$ and $x \ne 0$, it's okay for me, no problem, but if someone else wants to add something about it, feel free to do it.


I have a strange problem on getting data from DB  I use C# and Oracle.DataAccess with stored procedure.  In the DB I have a NUMBER(10,2) type field named TotalPayout and when dumping it on the DB I get this data  select a.totalpayout, DUMP(a.totalpayout)    from   tbla a    where a.totalpayout > 17 and a.totalpayout < 18;   returns:  TOTALPAYOUT , DUMP(A.TOTALPAYOUT)   17.40            , Typ=2 Len=3: 193,18,41 17.50            , Typ=2 Len=3: 193,18,51 17.60            , Typ=2 Len=3: 193,18,61 17.70            , Typ=2 Len=3: 193,18,71   But when running the progrem on the DataSet into column type Double I get this values   Total Payout           17.400000000000002 17.5 17.7 17.6   The first value get extra 00000000000002 Can’t find any clue why this happening.  this is the code i use to get the data     public static DataSet ExecuteDataset(OracleConnection connection, CommandType commandType, string commandText, params OracleParameter[] commandParameters)     {         if (connection == null) throw new ArgumentNullException("connection");          // Create a command and prepare it for execution         OracleCommand cmd = new OracleCommand();         bool mustCloseConnection = false;         PrepareCommand(cmd, connection, (OracleTransaction)null, commandType, commandText, commandParameters, out mustCloseConnection);          // Create the DataAdapter & DataSet         using (OracleDataAdapter da = new OracleDataAdapter(cmd))         {             DataSet ds = new DataSet();             ds.Locale = CultureInfo.InvariantCulture;              // Fill the DataSet using default values for DataTable names, etc             da.Fill(ds);              // Detach the OracleParameters from the command object, so they can be used again             cmd.Parameters.Clear();              if (mustCloseConnection)                 connection.Close();              // Return the dataset             return ds;         }     }   If anyone has any advice or suggestion I would appreciate it. Would really like to fix this issue.

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


My problem: I do not have my user name link on top of page- I have only my profile picture- how can I log out? any idea? I log in via gmail.  Thank you!

These answer are no longer valid!  and  and   Can someone post a picture of where the logout button is, I've searched everywhere for it! I really can't find it.  In this post () they mention that it is in the site switch, but I can't find it there either