I tried to do what I thought the comments in /etc/sudoers was telling me:  # This file MUST be edited with the 'visudo' command as root. # # Please consider adding local content in /etc/sudoers.d/ instead of # directly modifying this file.   Then:  : ~ ; visudo --help visudo - safely edit the sudoers file  usage: visudo [-chqsV] [-f sudoers] [-x file]   But I didn't read the bit after that more carefully, so I typed:  sudo visudo -x /etc/sudoers.d/dci   Instead of  sudo visudo -f /etc/sudoers.d/dci   Now, I'm stuck. Any command I try to do with sudo gives me:  >>> /etc/sudoers.d/dci: syntax error near line 1 <<< >>> /etc/sudoers.d/dci: syntax error near line 1 <<< >>> /etc/sudoers.d/dci: syntax error near line 2 <<< … >>> /etc/sudoers.d/dci: syntax error near line 58 <<< sudo: parse error in /etc/sudoers.d/dci near line 1 sudo: no valid sudoers sources found, quitting sudo: unable to initialize policy plugin   And without sudo, unsurprisingly:  : ~ ; rm /etc/sudoers.d/dci rm: remove write-protected regular file ‘/etc/sudoers.d/dci’? y rm: cannot remove ‘/etc/sudoers.d/dci’: Permission denied   How do I fix this?  Update:  After trying the solution from , I got the following result:  : ~ ; pkexec visudo ==== AUTHENTICATING FOR org.freedesktop.policykit.exec === Authentication is needed to run `/usr/sbin/visudo' as the super user Authenticating as: DCi Admin,,, (dci) Password:  polkit-agent-helper-1: error response to PolicyKit daemon: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: No session for cookie ==== AUTHENTICATION FAILED === Error executing command as another user: Not authorized  This incident has been reported.   I was guessing this was because I was supposed to be using root password, but that's possibly a wrong guess.   then fixed that problem.

Following the instruction  I get:  pkexec visudo  ==== AUTHENTICATING FOR org.freedesktop.policykit.exec === Authentication is needed to run `/usr/sbin/visudo' as the super user Authenticating as: Thomas,,, (tuc) Password:  polkit-agent-helper-1: error response to PolicyKit daemon: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: No session for cookie ==== AUTHENTICATION FAILED ===  Error executing command as another user: Not authorized  This incident has been reported.   I am doing this via ssh since the box I am doing this on is used as a music server with no screen and is rather inaccessible. This happened when I upgraded from Ubuntu 14.04 to 16.04. I tried to copy a sudoers file from another recent 16.04 installation, but I can't do that because of the sudoers file:  sudo mv ~/gyrf sudoers  >> /etc/sudoers: syntax error near line 36 <<< >> /etc/sudoers: syntax error near line 37 <<< >> /etc/sudoers: syntax error near line 38 <<< >> /etc/sudoers: syntax error near line 39 <<< >> /etc/sudoers: syntax error near line 40 <<< >> /etc/sudoers: syntax error near line 41 <<< >> /etc/sudoers: syntax error near line 42 <<< >> /etc/sudoers: syntax error near line 43 <<< >> /etc/sudoers: syntax error near line 44 <<< >> /etc/sudoers: syntax error near line 45 <<< >> /etc/sudoers: syntax error near line 46 <<< >> /etc/sudoers: syntax error near line 47 <<< >> /etc/sudoers: syntax error near line 48 <<< >> /etc/sudoers: syntax error near line 49 <<<  sudo: parse error in /etc/sudoers near line 36     sudo: no valid sudoers sources found, quitting sudo: unable to initialize policy plugin   Should I go get the box from the attic and try pkexec visudo or is something else wrong here?


Stan Lee said     Whosoever holds this hammer, if he be worthy, shall possess the power of Thor.                                    Why this truck can't lift Mjolnir ? But                                  The Helicarrier is in flight and it is lifting Mjolnir.                                  (Thor hangs his hammer on coat rack)  I don't understand. Why is this different? Isn't this truck worthy enough?

Can an inanimate thing can lift Mjolnir without the help of a living being (unworthy)  Scenario 1  Mjolnir in a very light car with a sail attached to it, then a very strong wind blew and moved the car uphill.  It is possible or not?  Scenario 2  Can upward wind alone lift the Mjolnir?


If I say "The shop will be closed tomorrow", is the word 'closed' here an adjective or a verb?

He is loved.   This is something that I've always kind of wondered.  In a sentence like this, is loved a verb or an adjective? Can it be considered either?


I have a strange problem, when I'm inserting data into the database.  When I'm passing the value from form field in English, everything works as expected (the value is inserted). However, when I pass the value in another language (e.g. Russian), the value inserts, but it is empty in database table. Not null, just an empty value.  I am using the . I have tried to set the proper charset with mysql_query("SET NAMES utf8");, but it doesn't work, and the table data in the database is set as utf8 and utf8_general_ci.  Anybody knows how to solve this issue?  Hey guys, I just found out that the problem in my Controller, the incoming parameters are in wrong charset. Here is the output result: ��� ������� Does anybody know how to set charset in Kohana controller?

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


I have a private git repo for a project.   In there, a few file exist which I'd like to make available as a separate library, as they're not application specific and can be reused.   Is there a way to fork a git repo so that it contains just these few files, retaining the version history but ignoring all other files?   The other files need to be kept private, so I can't simply fork the whole repo and remove them for future commits.

I have a  repository which contains a number of subdirectories. Now I have found that one of the subdirectories is unrelated to the other and should be detached to a separate repository.  How can I do this while keeping the history of the files within the subdirectory?  I guess I could make a clone and remove the unwanted parts of each clone, but I suppose this would give me the complete tree when checking out an older revision etc. This might be acceptable, but I would prefer to be able to pretend that the two repositories doesn't have a shared history.  Just to make it clear, I have the following structure:  XYZ/     .git/     XY1/     ABC/     XY2/   But I would like this instead:  XYZ/     .git/     XY1/     XY2/ ABC/     .git/     ABC/


I computed the 10 first powers of 256 and I noticed that they all end by 6.  256^1 = 256 256^2 = 65536 256^3 = 16777216 256^4 = 4294967296 256^5 = 1099511627776 256^6 = 281474976710656 256^7 = 72057594037927936 256^8 = 18446744073709551616 256^9 = 4722366482869645213696 256^10 = 1208925819614629174706176   My intuition is that it is the same for all powers of 256 but I can't figure out how to prove it, any suggestion?  My attempt was to show that $\forall n$ there is a $k$ such that $2^{8n} = k*10 + 6$, $k$ and $n$ being non null integers. I tried to decompose the right member in powers of $2$ but that leaves me stuck.

We have to prove that  "the product of two numbers ending in 6 also ends with 6" mathematically.  I have no clue how to start. I don't want you to prove it for me! but some hints would be very helpful as I'm totally stuck on how to start this prove.


My laptop is stuck on the login page.  I made sure that the password is correct I tried the default Wayland, xorg and Kodi options  but nothing works and I don't get any error or warning, just throws me back to the login page  is a video of the screen Can you suggest me how to troubleshoot or direct fix this problem Thank you Update 1) for  comment from Lol4t0 Logging in with tty shows The following  I probably messed up some env variable in ./profile, but even rm ~/.profile fails with the same error following the steps shown  fix the problem

To get an maven environment variable to run, I tried several options. Basically, I followed some options from , such as ~/.pam_environment, /etc/bash.bashrc and I don't really know anymore. Within them I exported sth like export PATH=/opt/apache-maven-3.6.0/bin:$PATH (I'm being so unconcrete because I cannot look it up).   Afterwards, I did run gnome-session-quit and my machine got stuck.   So after hard restart I try to login again, but I'm not able to do that: I see my username, enter the password, hit enter, screen turns black and after 2 seconds I'm back at the login screen.   So, that very strange and worrying. Next step: Login via tty (Strg + ALT + F3). Within there I can login, but can not do much. I thought about sth like . But whatever I do: The command could not be located because '\bin' is not included in the PATH environment variable. I think, altogether thats alarming and I'm getting really nervous.  Executing export PATH="/usr/bin:$PATH seems to work and echo $PATHgives an output starting with /usr/bin:/usr/bin:/usr/bin:/home/user/Documents/.../esper/examples/transaction/etc:/home/user/anaconda3/bin:/usr/lib/jvm/java-1.8.0-openjdk-amd64/bin:/opt/apache-maven-3.6.0/bin:/opt/apache-maven-3.6.0/bin:/opt/apache-maven-3.6.0/bin but does not really help.  I'm running an Ubuntu 18.04 on an Lenovo G50-70.   Can you help me accessing my desktop again and/or fixing my PATH issue?


In Apache webserver I have user www-data, and all files in /var/www are owned by www-data. Isn't that for security? Sometimes I need to upload files via FTP to /var/www/*, but with my own user I don't have write permission to it.   Let's say I use WordPress which recommends the permission to be 644 for files and 755 for folders. What is the best way to do this securely? I need still be able to upload file via FTP.

Has anyone got a nice solution for handling files in /var/www? We're running Name Based Virtual Hosts and the Apache 2 user is www-data.  We've got two regular users & root. So when messing with files in /var/www, rather than having to...  chown -R www-data:www-data   ...all the time, what's a good way of handling this?  Supplementary question: How hardcore do you then go on permissions?  This one has always been a problem in collaborative development environments.


How do you pronounce the word "married"? Why do most people pronounce it like "mɛrid" or "mɛərid" even though IPA for it is "mærid"?

The way I pronounce these words is the same. Similarly for other words like these: I pronounce ferry and fairy the same, carrot and caret. Yet, dictionaries show different pronunciations for these words:  For example, Merriam-Webster gives:  \ˈma-rē\ for , \ˈmer-ē\ for  and \ˈmā-rē\ for   The American Heritage Dictionary gives:  (măr′ē) for , (mĕr′ē) for  and (mâr′ē) for   When I listen to the recordings, they all sound the same to me. How do you pronounce them differently? Who pronounces them this way?


test = '<tag>part1</tag><tag can have random stuff here>part2</tag>' print(re.findall("<tag.*>(.*)</tag>", test))   It outputs:  ['part2']   The text can have any amount of "parts". I want to return all of them, not only the last one. What's the best way to do it?

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


Currently I am learning Quantum field theory, however I notice the lack of group theory knowledge especially Lie Algebra is quite fatal to my understanding. I hope to find some materials that can self study this field. My field of interest is mainly on quantum field theory and related theoretical particle physics. My mathematical skill is on the level of standard beginning postgraduate students on physics, I learn mathematical methods from physics side instead of mathematics side, so I am not familiar with the style of Definition proves lemma corollary. I hope the material focus more on the application on physics theory. Please recommend some lecture/course materials/books that may meet these requirement.

I am looking for a good source on group theory aimed at physicists. I'd prefer one with a good general introduction to group theory, not just focusing on Lie groups or crystal groups but one that covers "all" the basics, and then, in addition, talks about the specific subjects of group theory relevant to physicists, i.e. also some stuff on representations etc.  Is Wigner's text a good way to start? I guess it's a "classic", but I fear that its notation might be a bit outdated?


I've seen this assertion in a few comments around the site, and I found the answer to the $\rightarrow$ implication   Does anyone know a (hopefully simple) proof of the $\leftarrow$ implication?

So, as the title says I'd like to give a proof of the fact that if $C$ is an infinite set then it is equipotent or equivalent to its cartesian product $C\times C$ using Zorn's Lemma (and of course some of its implications like the fact that $C$ has an infinite countable subset which I think might be very useful).   The main problem that I have is that I'm not supposed to use any theorem or result involving cardinal numbers since I'm still taking an elementary set theory course which hasn't covered that topic yet and all the proofs that I've read so far use cardinals arithmetic at some point.   Another thing that I think might be useful is a lemma which was proved via Zorn's Lemma in an answer to the question   which states that given the infinite set $C$ there exists a non-empty set $B$ such that $B\times \mathbb{N}$ is equipotent to $C$. Then it suffices to give a bijection from $(B\times \mathbb{N})$ $\times$ $(B\times \mathbb{N})$ to $B\times \mathbb{N}$  So, any suggestion on the direct proof (without cardinals, unfortuntely) via Zorn's Lemma or an actual bijection from $(B\times \mathbb{N})$ $\times$ $(B\times \mathbb{N})$ to $B\times \mathbb{N}$ would be highly appreciated. Thanks in advance.


Gnome Terminal captures F10 instead of passing it to the shell. I want to disable it. Searching for the problem returned answers that it can be disabled in "Preferences/Shortcuts". However, it doesn't appear to be there for me.  I have Ubuntu 16.04 and Gnome Terminal 3.18.3.

I have noticed that if I press  F10 when on a terminal, Ubuntu or the terminal opens the File Menu.  Is there any way to unbind this?   I don't see any entries with F10 on System settings -> Keyboard shortcuts  I want to use function keys in Emacs to debug my code (e.g. F10 triggering gud-step, etc.) when running Emacs within a terminal ( emacs -nw) but at the moment the terminal seems to be capturing my keys.  Update 1:  If I go to Edit -> Keyboard Shortcuts I can disable the option "Enable the menu short key (F10 by default)".  So I disabled it. However , the key F10 is still bound to the menu!!  Is there a way to unbind this key other than through the Edit-> Keyboard shortcuts menu? Perhaps there is a configuration text file under etc where I can activate/deactivate keyboard shortcuts?  Update 2:  I also followed all the tricks  and they didn't work. F10 still behaves as an accelerator in the terminal.   This is all on Ubuntu 11.10  Update 3:  Following the suggestions in  I also tried:  3.1 Adding the following code to  ~/.gtkrc-2.0  binding "NoKeyboardNavigation" {         unbind "<shift>F10" }  class * binding "NoKeyboardNavigation"   3.2 Adding the following code to ~/.config/gtk-3.0/gtk.css  @binding-set NoKeyboardNavigation {     unbind "<shift>F10" }  * {     gtk-key-bindings: NoKeyboardNavigation }   and the problem still persists.


I wanted to make a bootable Windows 10 USB on my Ubuntu 16.04 Gnome and in the process of following  I got myself into a few problems with my 8 GB pen drive disk.   GParted does not recognize the whole 8GB as unallocated. I think another 4GB partition was created but I don't seem to able to manage it via GParted.    I get errors when trying to format disk or erase it in Disks:   When I run sudo mkfs.vfat /dev/sdb1 || sudo dd if=/dev/zero of=/dev/sdb1 bs=1M count=1 to format via command line I get the following output:  mkfs.fat 3.0.28 (2015-05-16)  I tried opening the USB disk in GParted on another laptop (running Lubuntu) and there I could see the disk formatted correctly and showing up the whole 8GB. Could it the problem be my computer's system?   How am I to repair this USB stick so I can get a working windows bootable USB?

I can't format my pendrive (where ubuntu was loaded as live-usb) . Whenever I do , they say .  This partition cannot be modified because it contains a partition table; please reinitialize layout of the whole device. (udisks-error-quark, 11)  What to do ? I use Disks in Ubuntu 16.04


I put my shell script inside /etc/cron.daily  I was hoping everything that in that folder would be run daily but my script is not being ran.

I created 3 daily cron jobs to run.  Below are the three that are placed in etc/cron.daily  rkhunter.sh  #!/bin/sh ( rkhunter --versioncheck rkhunter --update rkhunter --cronjob --report-warnings-only ) | mail -s 'rkhunter Daily Run (my server)' me@email.com   chkrootkit.sh  #!/bin/bash chkrootkit | mail -s "chkrootkit Daily Run (my server)" me@email.com   logwatch.sh  #!/bin/sh ( logwatch ) | mail -s 'logwatch Daily Log (my server)' me@email.com   I replaced me@email.com ofcourse with my email.  If I run this cronjob manually it works fine ./nameoffile.sh  But it doesn't run daily, what can be the cause or how can I check into this?


Given $X_1,X_2,...X_n$ IID  from a Bernoulli distribution while $n>2$.  If I want to find an unbiased estimator for $$(1-p)p$$ as a function of $X_1, X_2$ and the use    I realize this is the $\mathbb{E}[Var(P)]$  not sure if this implies anything instantly.  My question is what is the pmf  for bernouli here to get the unbiased estimator?  What I thought of so far:  $\theta  = p(1-p)$  $\mathbb{E}[\hat{\theta}] = \sum_{i=0}^{\infty}T(i)(1-p)^ip^i = p(1-p)$  Any hints are appreciated!

Let $X_1,X_2,X_3 ...X_n$ be a random sample from Bernoulli   distribution with parameter $\theta$.Find UMVUE of $\theta(1-\theta)$.   I know that $T=\sum_{i=1}^{n}X_i$ is complete sufficient statistic for our paramenter $\theta$. I am trying to find out function of T which is a unique unbiased estimator of $\theta(1-\theta)$. Now $T\sim Bin(n,\theta)$  $E(T^2)-E(T)^2=V(T)$  $n\theta(1-\theta)+n^2\theta^2-n^2\theta^2=n\theta(1-\theta)$  $\implies\dfrac{1}{n}(T^2-\bar{T}^2)$ is umvue of $\theta(1-\theta)$     If I have sample size $n=10$ with observations $1,1,1,1,1,0,0,0,0,0$   obtain the value of this estimator.   Now I am stuck at this point that is $T^2$ is $T^2=\sum_{i=1}^{n}X_i^2$ or $T^2=(\sum_{i=1}^{n}X_i)^2$. Can someone help me and tell at what point I am doing things wrongly?


I have the following code:  public class Test2 {     public static void main(String[] args) {          long ta, after, before;         Runtime rt;         rt=Runtime.getRuntime();         rt.gc();         NodoPrueba q=new NodoPrueba(1);          before=rt.freeMemory();         q=null;         rt.gc();         after=rt.freeMemory();         ta=after-before;         System.out.println("Before: "+before+"\nAfter: "+after);         System.out.println("\nDifference: "+ta);     }  }   Well, the class NodoPrueba only has an int attribute. But i have the following output:  Before: 127991976  After: 128673800  Difference: 681824  If the theory says that NodoPrueba class only takes 16 bytes on memory: 8 bytes from the object, 4 bytes for int and 4 bytes for padding (object's size is always a multiple of 8), where does the difference come from?

I have an application that reads a CSV file with piles of data rows.  I give the user a summary of the number of rows based on types of data, but I want to make sure that I don't read in too many rows of data and cause OutOfMemoryErrors.  Each row translates into an object.  Is there an easy way to find out the size of that object programmatically?  Is there a reference that defines how large primitive types and object references are for a VM?  Right now, I have code that says read up to 32,000 rows, but I'd also like to have code that says read as many rows as possible until I've used 32MB of memory.  Maybe that is a different question, but I'd still like to know.


I would like to know how I can measure the bandwidth consumption of a command in Ubuntu. For example: I am running this command on Ubuntu terminal:  curl -I trafficinviter.com   I get the following result:  HTTP/1.1 200 OK Date: Mon, 02 Jan 2017 14:13:14 GMT Server: Apache X-Pingback: http://trafficinviter.com/xmlrpc.php Link: <http://trafficinviter.com/>; rel=shortlink Set-Cookie: wpfront-notification-bar-landingpage=1 Content-Type: text/html; charset=UTF-8   But I do not understand how much the bandwidth is consume by the curl command. Even whether the curl has downloaded the complete page and shown me only header? I only want to know whether there is any command that show the bandwidth consumption when I use the curl command as:  (some command that show bandwidth consumption) curl -I trafficinviter.com   and I get some result like :  Bandwidth used: 100kbps   Hope this help to define my problem.Kindly let me know your response.

I think I'm being the victim of a bug here. Sometimes while I'm working (I still don't know why), my network traffic goes up to 200 KB/s and stays that way, even tough I'm not doing anything internet-related.   This sometimes happens to me with the CPU usage. When it does, I just run a top command to find out which process is responsible and then kill it. Problem is: I have no way of knowing which process is responsible for my high network usage. Both the resource monitor and the top command only tell me my total network usage, neither of them tells me process specific network info.  I've found questions here about monitoring total bandwidth usage, but, as I mentioned, that's not what I need. Is there another command I can use to find out which process is getting out of hand?  The command iftop gives results that disagree entirely with the information reported by System Monitor. While the latter claims there's high network traffic, the former claims there's barely 1 KB/s.  I've already tried killing all the obvious ones (Firefox, update-manager, Pidgin, etc) with no luck. So far, restarting the machine is the only way I found of getting rid of the issue.


The first edit I rejected had changed the FAQ links in my answer () to refer to ISO CPP site instead of the original C++ FAQ.  I mistakenly thought that was a too enthusiastic but uninformed user inadvertently vandalizing my answer, and so I reject not just that but also the next edit that popped up (about apparently the same), and so on.  However as it turns out the ISO CPP FAQ is based on the original, with the help of Marshall Cline and e.g. Andrei Alexandrescu, and even contains a broken link to my old correct C++ tutorial, just as in the original FAQ. Apparently Marshall has okayed moving the FAQ from his website to ISO CPP. With Usenet more or less dead there is no more question of real updates to the FAQ resulting from community discussions, so referring to ISO CPP is in my opinion now correct and I should not have rejected the updates. Can I undo the rejections? I am not sure what all answers I rejected updates for.

A nice user suggested  to . The edit, though very good and desirable, was rejected. I do not understand the reasons, and I did not find a way to contact those people who rejected it. What can I do to re-approve the edit?


We've been working to clean up some space in our /opt mount. A large culprit of space consumption was log files for some processes we run (to the tune of 2 to 12 GB each).  We've cleaned these up by truncating them. However, this seems to be skewing our output from df -H.  /dev/mapper/Sys-opt     76G    72G      0 100% /opt   When running du -sh * on this directory, the sizes don't add up. When running lsof | grep log, I see that many of the files we've deleted still show up with (deleted) appended to the end.  My question is, (a) should I be concerned with this?, and (b) is there a way to get my df -H back to normal, without restarting the box / these processes? Will restarting the processes even fix it (I see several entries for the same logs, which are from processes I know have been restarted recently)?

How does one find large files that have been deleted but are still open in an application? How can one remove such a file, even though a process has it open?  The situation is that we are running a process that is filling up a log file at a terrific rate. I know the reason, and I can fix it. Until then, I would like to rm or empty the log file without shutting down the process.   Simply doing rm output.log removes only references to the file, but it continues to occupy space on disk until the process is terminated. Worse: after rming I now have no way to find where the file is or how big it is! Is there any way to find the file, and possibly empty it, even though it is still open in another process?  I specifically refer to Linux-based operating systems such as Debian or RHEL.


I was talking with some of my friends and we all had very different opinions on how long Rey was on the island with Luke. Is there a definitive answer anywhere, or context in the film that I may have missed that hints to how long this training is? Even though it runs parallel to some scenes with the resistance, it seems likely that Rey was on the island before those scenes started, since we see them sleep multiple times while the resistance scenes appear to be much faster.

Watching the movie, it seems like      Rey is on the island with Luke for weeks.   But the      assault on the resistance fleet seems to take like 2 days. Even the mention of going to get the hacker and back was like 18 hrs each way. And then there was talk of like 16 hours of fuel reserves.   So, it's all a little confusing. Can we determine the time span of the movie? And if so, what is it?


I am trying to retrieve time of my post from Firebase timestamp to the Feed activity through an Adapter and Viewholder. But, when I launch my app, it crashes. what could be the possible reason for that. Except that everything is working fine, I mean, Image Url and EditText data are retrieving safely. How to retrieve Time and display it in my feed. In the below code, the error is thrown at first line.  long millisecond = feed_list.get(position).getTimestamp().getTime(); String dateString = DateFormat.format("MM/dd/yyyy", new Date(millisecond)).toString();                        holder.setTime(dateString);

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?


greetings all i want to validate an email with javaScript and i need to use the best pattern for the matching please suggest me a good pattern

Is there a regular expression to validate an email address in JavaScript?


CASE 1: function Test(name){    var privateName = name;    this.getName = function(){       return privateName;    } }  var name = new Test("unknown"); console.log(name.getName())  CASE 2: function getName(pName){     var name = pName;     return name; }  var name = getName("unknown") console.log(name)  It seems both are doing the same thing returning the name passed to the function. Then what is the difference between the two implementations? What are we trying to achieve in CASE 1?

How would you explain JavaScript closures to someone with a knowledge of the concepts they consist of (for example functions, variables and the like), but does not understand closures themselves?  I have seen  given on Wikipedia, but unfortunately it did not help.


I just got my enchanting table, and now I want to know how to get XP quick. My usual strategy is to go out and night and kill every mob I find, however I believe that there are faster ways that I don't know of. What is the fastest way, or just any way much faster than my way?

Now that experience does something besides render regions of a server uninhabitable due to  orb lag, what's the most efficient and safe way to get those excellent enchants?  A mob farmer may rank highly, but what about without tons of setup?


Is there a way to retrieve the desktop environment name (e.g. Gnome, Unity, XFCE, LXDE, KDE...) from the command line or using Python?

I am writing a bash script that needs to know which desktop environment (XFCE, Unity, KDE, LXDE, Mate, Cinnamon, GNOME2, GNOME3,... ) is running.  How can I obtain that information?


EDIT: A  has been asked, but does not address the unique function of drag and drop as distinct from other methods of deleting.  I'm running Windows 7. When I drag a program shortcut to the recycle bin, it pops up "Are you sure you want to move this shortcut to the recycle bin?" and gives me the sage advice that deleting the shortcut doesn't delete the program... well I'm not stupid and I already knew that, so I'd like it to stop telling me.  Btw, moving actual files (click and drag style) to the recycle bin produces no messages at all. I know I can disable all delete notifications from the recycle bin, but I really only want to disable this superpower that program shortcuts seem to have.  I searched Google and came up with only 15 results - none answered the question. I expect it's probably impossible without having a custom script running in the background, but I thought I'd ask.

How do I remove the warning before deleting a shortcut in Windows?  Every time I want to delete a shortcut it warns me that I'm not actually deleting the program, just a shortcut.


i'm looking for such a proof. There is a proof of Luroth for n=1,2,3 without any topological concepts,but only analysis.(which is simple for n=1,and gets much more complicated for n=2,3)  a heard Brouwer himself prooved it even before the fixed point theorem,so the best will be if someone knows where to find it.

It is very elementary to show that $\mathbb{R}$ isn't homeomorphic to $\mathbb{R}^m$ for $m>1$: subtract a point and use the fact that connectedness is a homeomorphism invariant.  Along similar lines, you can show that $\mathbb{R^2}$ isn't homeomorphic to $\mathbb{R}^m$ for $m>2$ by subtracting a point and checking if the resulting space is simply connected. Still straightforward, but a good deal less elementary.  However, the general result that $\mathbb{R^n}$ isn't homeomorphic to $\mathbb{R^m}$ for $n\neq m$, though intuitively obvious, is usually proved using sophisticated results from algebraic topology, such as invariance of domain or extensions of the Jordan curve theorem.  Is there a more elementary proof of this fact? If not, is there intuition for why a proof is so difficult?


We are 2 South Africans going on a cruise in Croatia and have an 14 hour layover at Zurich.  I have been advised that we can apply for a transit visa at the airport in Zurich.  Is this easy to obtain?

Do I need an airport transit visa through Switzerland if I have no Schengen visa? Am traveling from Cairo to Moscow via Swiss Air


Let $M$ be a manifold. Prove that $M$ is path connected if and only if $M$ is connected.  My attempt:  ($\Rightarrow$) Let $M \subset \mathbb{R}^n$ be path connected. Every path connected subset of $\mathbb{R}^n$ is connected.  ($ \Leftarrow$) Let $M \subset \mathbb{R}^n$ be connected. I think that the goal here is to show that for any $x,y \in M$, there exists $a,b \in \mathbb{R}$ and a path $\Phi:[a,b] \rightarrow M$ such that $\Phi(a)=x$ and $\Phi(b)=y$.   I know that since $M$ is a manifold, there exists an open neighborhood $U$ around $x,y \in M$. I also know that $M$ contains a diffeomorphism.  Not sure how to put this all together in my proof..

prove every connected manifold is path connected manifold .       my thought:      connected space : Let $ X$  be a topological space. A separation of $ X $ is a pair $U, V$ of disjoint    nonempty open subsets of $ X $ whose union is $X$. The space $ X $ is said to be connected    if there does not exist a separation of  $X$ .      Components: Given  $X$ , define an equivalence relation on $X$ by setting x~y if there    is a connected subspace of $X$  containing both $ x$  and $ y$ . The equivalence classes are    called the components (or the "connected components") of $ X$.       Path Component: I define another equivalence relation on the space $ X$  by defining x ~ у    if there is a path in $ X$  from $ x$  to $ y$ . The equivalence classes are called the path components of $ X$ .       Theorem  : The path components of $ X$  are path connected disjoint subspaces    of $X$  whose union is $X$ , such that each nonempty path connected subspace of $X$  intersects only one of them.       thank you so much


Ok, this is a newbie-question i'm afraid to ask for some time .. how to use Drupal Hooks?  Yes, i know where to look for the code, but then? Put it in the template-folder, a block, a custom module?   When i google for a tutorial, the most results are for Drupal 6 / before 2010.

I am intermediate in PHP. To polish my skills I start learning Drupal 7. While learning Drupal architecture concepts, the terms hooks and bootstrapping puzzled me a lot. I read the "Pro Drupal development" book, and some documentation on drupal.org, but it is so advanced for me to learn how hooks work in Drupal to display the web page.  Can anyone tell me what hooks are in simple words?


I have a query string I'm trying to remove a query string parameter. What I currently have is  date=(.*)&  But this will remove anything to the last &. I only want to remove to the first occurance of the &.  So this is how it should work:  date=5%2F13%2F16&tab=1&a=b = tab=1&a=b  But mine is doing this:  date=5%2F13%2F16&tab=1&a=b = a=b  I think I probably need something around the & but I read the regex stuff and I just get more confused.

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


So far I am able to make the character fall at a constant rate but I am unsure how to make the character accelerate while falling.  When the character is falling I have a line of code as such:  position.y -= 7f;   How can I change my implementation such that the character falls faster over time?

I want to move my object with an acceleration in the proper direction.  For example if I have these values:  friction = 0.3; direction = 180; speed = 5;   For making it clear, I need a formula to create a linear acceleration.


I've been running Ubuntu (Unity) on a chromebook for a couple of years. I had to reformat the device and now I'm trying to reinstall from a backup. I've downloaded  and copied my backup called trusty_backup.tar.gz to the downloads directory. Whenever I run the reinstall script to install the chroot from the backup I get the error trusty_backup.tar.gz not found.  This is the command I am using: sudo sh ~/Downloads/crouton -f trusty_backup.tar.gz  What have I got wrong? Thanks.

I have installed Ubuntu 13.04 on my desktop (runs like a charm). Then I used Crouton to install Ubuntu 12. 04 on my chromebook samsung (ARM). It also works quite well.  Here comes my question. Can we have a true Ubuntu (preferably 13.04) on my ARM chromebook?  It seems that the Crouton/Ubuntu is not 100% the real thing.  The best option would be to have the full Ubuntu 13.04 and remove the Chrome OS.


I want to count items in radius of 10 chunks but I have never made a plugin and I didn't saw a event to count a specific item. What I want to do is for example: count the amount of cobblestone items on the ground, in chest and in inventories and I want to put that number in a variable. If two players would use the same plugin at the same time. Will it putt the amount of cobblestone of both players in that variable or does the game makes them separate. I really Want it to be separate. I don't want to spoil what I am going to make because I saw that what I am going to make has never been made before(I think) I hope someone can help.

I want to run a command when there are only 10 entities left. I know you can use /execute unless entity to detect when all matching mobs have died, but it doesn't work if you want to run a command when there are for example 10 entities left.  A command like /execute if entity @e[limit=10] does not work, it also triggers if there is only one entity.  Such a counting system could also be used to determine once there is only one player left in an arena, meaning they have won a battle or similar.


How can I prove that $f(x)=x^s$ for $0< s ≤1$ is Hölder-continuous with constant s?

I want to show that $$f: \mathbb{R}_{\geq0} \to \mathbb{R}_{\geq0}$$ $$x \mapsto x^s$$ is Holder continuous with Holder exponent $s \in \mathbb{R}$, where $0<s \leq 1$. So what I want to show is that $\exists \hspace{2 mm} C \in \mathbb{R}_{\geq0}$ sucht that for all $ x,y \in \mathbb{R}_{\geq0},  $ $$|x^s -y^s| \leq C|x-y|^s$$ and therefore, assuming, wlog $\hspace{1mm} x>y$ $$(x^s -y^s) \leq C(x-y)^s.$$  I thought about Bernoulli's inequality but couldn't make that work.I thought about the binomial theorem, but didn't know how to handle the fact that $s \in \mathbb{R}$.


I was given an Asus Nexus 7. How can I tell if it is the 1st or the 2nd gen?

I am having trouble with Bluetooth Low Energy (BT 4.0) on a Nexus 7.  I think I may have a 2012 model.  How to tell if I have a 2012 or 2013 version of the Nexus 7?


There is an , but almost all serious Android answers are answered on  (Even multiple times because people are too lazy to search first).  Why not combine the two?

I don't understand why Stack Exchange has created a separate network for Android when they already have  tags in all of their programming networks? Is this a beginning of language specific network? Can we expect more specific networks in future like:   php.stackexchange.com java.stackexchange.com csharp.stackexchange.com etc.


So im having problems with the Scanner class in java. The console output is always the same no matter what my input is. I wanted the program to display the sum (8) when the user types "yes" and end the program when the user types "end". Instead, the program ignores my input and continues to ask for it.  public static void main(String[] args) {      Scanner sc = new Scanner(System.in);     String choose = "sdjajkk";     System.out.print("type anything:");      for (int i=0; choose!="end"; i++)     {         System.out.println(i);         choose = sc.nextLine();         System.out.println("if u typed yes then u will get sum");         if (choose=="yes")         {         int c = 3+5;         System.out.println(c);         }     } sc.close();      }   ThaT was my code^  and here is my console:   Is there a problem with including the scanner in the for loop? Or does the sc.nextLine() scanner read the wrong line? Any help would be appreciated.

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 trying to create a horizontal bar chart like the one in the picture below. For that I want to use data stored in a table like this: \pgfplotstableread[col sep=comma]{ system,   Tmin, Tmax, limitmin, limitmax {a},      20,     50,     10,      30 {b},     10,     60,     15,      60 {c},      15,     78,     0,       0  }\datatable  The closest I came to a result was by manually typing in the coordinates. But the stacked bar chart keeps adding/ subtracting the values and I cant figure out how to let a bar start from a value different to zero. \begin{tikzpicture} \begin{axis}[ xbar stacked, stack negative=on previous , xlabel={Temperature $^{\circ}C$}, symbolic y coords={%     {A},     {B},     {C}}, ytick=data, %nodes near coords,  %nodes near coords align={horizontal}, ytick=data, xmajorgrids, legend ]      \addplot+[blue, fill=blue, bar shift =-5pt] coordinates {     (14,{A})      (5,{B})      (14,{C})  }; \addplot+[blue, fill=blue, bar shift =-5pt] coordinates {     (-20,{A})      (-10,{B})      (14,{C})  }; \addplot+[red, fill=red, bar shift =5pt] coordinates {     (20,{A})      (5,{B})      (14,{C})  };  \addplot+[red, fill=red, bar shift =5pt] coordinates {     (-20,{A})      (-10,{B})      (14,{C})  };  \end{axis} \end{tikzpicture}   There is probably a proper way to do this but I am still new to tikz and pgfplots and could not find a good example. Thanks for your help!

I have this script of plotting bar graph with min(-ve) and max(+ve)    \documentclass[border=5mm]{standalone}  \usepackage{pgfplots}  \pgfplotstableread{ Year    FarMin  FarMax  NearMin NearMax HereMin HereMax 1930    -20     50      -10     30      -15     40 1940    -10     60      -15     60      -20     70 1950    -15     78      -20     20      -32     42 1960    -20     30      -15     40      -20     10 1970    -5      30      -30     40      -15     20 }\datatable   \begin{document}% \begin{tikzpicture}   \begin{axis}[     x tick label style={       /pgf/number format/1000 sep=},       ylabel=Population,       ybar,       enlarge x limits=0.15,       bar width=0.8em,     after end axis/.append code={         \draw ({rel axis cs:0,0}|-{axis cs:0,0}) -- ({rel axis cs:1,0}|-{axis cs:0,0});     }   ]   \addplot +[forget plot] table {\datatable};   \addplot table [y index=2] {\datatable};    \addplot +[forget plot] table [y index=3] {\datatable};   \addplot table [y index=4] {\datatable};    \addplot +[forget plot] table [y index=5] {\datatable};   \addplot table [y index=6] {\datatable};   \legend{Far,Near,Here}   \end{axis} \end{tikzpicture}  \end{document}     But, when I want to plot a graph with positive min values , I'm getting graph which is  starting with zero instead of given positive value.  \documentclass[border=5mm]{standalone}  \usepackage{pgfplots}  \pgfplotstableread{ Year    FarMin  FarMax  NearMin NearMax HereMin HereMax 1930    20     50      10     30      15     40 1940    10     60      15     60      20     70 1950    15     78      20     20      32     42 1960    20     30      15     40      20     10 1970    5      30      30     40      15     20 }\datatable   \begin{document}% \begin{tikzpicture}   \begin{axis}[     x tick label style={       /pgf/number format/1000 sep=},       ylabel=Population,       ybar,       enlarge x limits=0.15,       bar width=0.8em,     after end axis/.append code={         \draw ({rel axis cs:0,0}|-{axis cs:0,0}) -- ({rel axis cs:1,0}|-{axis cs:0,0});     }   ]   \addplot +[forget plot] table {\datatable};   \addplot table [y index=2] {\datatable};    \addplot +[forget plot] table [y index=3] {\datatable};   \addplot table [y index=4] {\datatable};    \addplot +[forget plot] table [y index=5] {\datatable};   \addplot table [y index=6] {\datatable};   \legend{Far,Near,Here}   \end{axis} \end{tikzpicture}  \end{document}     Please help me to plot the graph with positive min values. thanks!


I have a problem making faces while modeling. When I make a face in Blender and try to put loop cut I just can't .... Anybody knows another way to connect/make faces ? Please answer me..

why does the loop-cut-and-slide operation ignore certain faces but happily cut others?the model is symmetrical so it is a bit strange to pick 3 faces that won't get cut. I tried applying it to see if it was just a graphics glitch causing the purple line to not display over everything, but it did end up cutting only what the line was selecting, instead of the whole mesh.    as requested,here's a paste of the blend:


I read many of the other questions about this linker error, but I still wasn't able to solve it yet...  vector.hpp  #ifndef vector_hpp #define vector_hpp  namespace vec {  template<class T> class Vector { private:     T* arr;     unsigned int numberOfElements;  public:     Vector();     ~Vector();     void push_back(const T&);     void pop_back();     void pop_front();     unsigned int size() const;     T& at(int);     T& front();     bool empty() const;      T& operator[](const int) const; };  }   #endif   vector.cpp (not everything, would be too long)  #include "vector.hpp" #include <iostream>  namespace vec {  template<class T> Vector<T>::Vector()         : arr(nullptr), numberOfElements(0) {     return; }  template<class T> Vector<T>::~Vector() {     delete[] arr; }  template<class T> unsigned int Vector<T>::size() const {     return numberOfElements; }  ... }       patientenliste.hpp  #ifndef patientenliste_hpp #define patientenliste_hpp  #include "vector.hpp" #include <iostream> #include "patient.hpp"  using namespace std;  class Patientenliste { private:     vec::Vector<Patient> liste;  public:     Patientenliste& operator+= (const Patient&);     vec::Vector<Patient>& getPListe();      friend ostream& operator<< (ostream&, const Patientenliste&); };   ostream& operator<< (ostream&, const Patientenliste&);  #endif   patientenliste.cpp  #include "patientenliste.hpp"  Patientenliste& Patientenliste::operator+= (const Patient& p) {     liste.push_back(p);     return *this; }  vec::Vector<Patient>& Patientenliste::getPListe() {     return liste; }  ostream& operator<< (ostream& os, const Patientenliste& p) {     if(p.liste.size() == 0)         os << "Keine Patienten in der Liste.";     else         for(unsigned int i=0; i < p.liste.size(); i++)             os << p.liste[i] << endl;     return os; }   I have some more files/classes in my project but every class which uses my Vector-class I get the Linker-error:  patientenliste.cpp:(.text+0x32): Nicht definierter Verweis auf vec::Vector<Patient>::size() const' patientenliste.cpp:(.text+0x5e): Nicht definierter Verweis aufvec::Vector::size() const' patientenliste.cpp:(.text+0x6c): Nicht definierter Verweis auf `vec::Vector::operator [ ] (int) const'  (in english "Nicht definierter Verweis auf" means "undefined reference to") I have absolutely no clue about what's going wrong...  I already tried it wihtout the namespace vec, but that didn't work either.

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 have a Google Analytics account for a site I now am helping with.  There is a history where no filters were applied and I would like to apply a filter to make all the URLs lowercase to match them up.  I see plenty on removing querystrings and such but nothing along the lines of replacing all uppercase chars with lowercase ones.  Is it possible?

I have a Google Analytics account for a site I now am helping with. There is a history where no filters were applied and I would like to apply a filter to make all the URLs lowercase to match them up.  I see plenty on removing querystrings and such but nothing along the lines of replacing all uppercase chars with lowercase ones.  I already have a filter for data going forward but need to do it with older data  if I can.  Is it possible?


For polynomials of one variable with only and all nonzero integer coefficients, do there exist any where the polynomial consists of more than one term, and the square of the polynomial has the same number of terms or fewer than the polynomial?  For instance (to contrast), $(x + 1)^2 = x^2 + 2x + 1$  The polynomial in parentheses has two terms, but the square of the polynomial has three terms.  Another instance, $(x^2 - x + 2)^2 = x^4 - 2x^3 + 5x^2 - 4x + 4$  The polynomial in parentheses has three terms, but the square of the polynomial has five terms.  Note:  This is not a duplicate of another question.  That merely requested that that [p(x)]^2 had to have fewer nonzero terms than p(x).  Mine requires that p(x) 1) must have all of its terms' coefficients be nonzero and integers, and 2) the number of terms could be equal, not just fewer.

I saw this problem on a problem set and I have absolutely no idea how to proceed in a feasible way.     Does there exist a polynomial $f(x)$ with real coefficients such that $f(x)^2$ has fewer nonzero coefficients than $f(x)$?   Any help would be appreciated.


I've asked my question before, and I am writing this new question with some edits based on my previous problem.  I am building a small FM Modulator ( Transmitting ) simulation on (Multisim). I've used a circuit that I had from Google, and welling to use it for my simulation. Note that this simulation is only for (Educational and Learning Purposes), Therefore, I've replaced the mic and the antenna with some signal generator and oscilloscope or signal analyzer.  The circuit that I used for my transmitter as follows:    When I built that circuit on Multisim, I've made many variable capacitors to notice any changes on the result and how the signal would be effected when the simulation is running.  I've placed function generator with ( Sinusoidal Function ) with ( 1 KHz ) Frequency on the input. On the other hand, The output has both of an oscilloscope and a Signal Analyzer.  the output was weird on oscilloscope. But signal analyzer has almost a Sin function signal same as output. So the system has worked as Integrator, Not a modulator.  Example of the built circuit including the input and output stuff:    After having many changes on the circuit and too many tries, I've tried to add a capacitor attached to resistor in series with a signal generator to check if it removes the DC or ripples. and tried to connect the grounding to the circuit directly.. I had some other weird results as Follows:    Also, I've used another circuit (just a test), Used a function generator on the input, and added a carrier function generator on the emitter of the transistor, and put some oscilloscope to analyze the output as follows:     The output was also weird. Therefore, I guess the problem is how I am using the circuit and how I apply the input and output devices.  As for my information, when I am applying a (Sin) function signal to the input. the modulated output should be as follows:    Any suggestions whats wrong in my circuit and what changes do I have to make to have the expected results?

I am new to the telecom simulations system specially multisim, which I am having a project that I want to simulate.  My project in (Analog Communications) is consisting to have FM Transmitter (Modulator) that accepts a generated signal (Sin, Cos) and get me the modulated output as a Graph.  I've found this FM transmitter circuit (3 km range):   ![two muppets][1]  and I am building that circuit on Multisim, and I failed. Because I faced many problems, first of, the variable capacitor symbol is weird here in the multisim, and the regular capacitor doesn't have variable options. Secondly, when I Use signal generator as (Sin, Cos), the output gets weird after 5 second of the simulation.  I want to show the input signal (before modulation) and the output signal (transmitted or modulated).  I guess my output result where not the as expected, as the signal (Sin with phase 90°) is giving weird result of few seconds of simulating.  Below are screenshots of the simulation results within time.          Any ideas how to edit or fix the above circuit to have this output is similar to what it should be?


se community,  i would like to write my masters thesis in tex using miktex + texstudio. i wrote my bachelors thesis using bibtex and now switched to biblatex + biber. i was searching for a citation style for biblatex that is as close as possible to iso 690. this is the closest match i could find:   Unfortunately, there is no numbering in the bibliography.   Here is my MWE:  \documentclass{article}  \usepackage     [         backend=biber,         citestyle=numeric,         bibstyle=DIN %       style=numeric     ]     {biblatex}  \addbibresource{LiteraturMWE.bib}   \begin{document}      zitat buch \cite{book} \\      \printbibliography     \nocite{*}  \end{document}   And my .bib file  @article{article,     author  = {Autor Artikel},      title   = {Name des Artikels},     journal = {Zeitschrift Name},     year    = 1993,      number  = 2,     pages   = {201-213},     month   = 7,     note    = {Notiz},      volume  = 4 }  @book{book,     author    = {Autor Buch},      title     = {Buch Titel},     publisher = {Herausgeber Name},     year      = 1993,      volume    = 4,     series    = 10,     address   = {Adresse},     edition   = 3,     month     = 7,     note      = {Notiz},     isbn      = {3257227892} }   If possible, i would like to have numbers like style=numeric. Is there a way to implement this at some point in the DIN.bbx? Is this even the right place for making this change?  Thanks in advance, Sklibbi

How can I set biblatex to insert "1. " before first bibliography item and so on? The bibliography is sorted by author and the numbers are not meant to be used anywhere else.


LaTeX allows me to write a matrix up to 10 columns only. But I want to write a matrix of dimension 13. Can anyone help me to write it?

I'm using bmatrix environment from the amsmath package, and I'm trying to do something like this:  \documentclass{article} \usepackage{amsmath}   \begin{document}      \begin{equation}          \begin{bmatrix}              1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11\\          \end{bmatrix}     \end{equation}  \end{document}   However, pdfLaTeX returns an error: "Extra alignment tab has been changed to \cr", and in the output the extra element is moved to the next row. (If I remove one element, then it works perfectly fine). I guess this means that I've hit some hard limit on the number of tab stops in a matrix. Is there a way to change this?  The elements in the matrix are short and could fit perfectly on a single row.


I am trying to find the size of a file without using stdio library. This way (see below) works perfectly, but I can't find a way to make that work without stdio library.  int getfilesize(const char *filename){     int size;    FILE *f;     f=fopen(filename, "rb");     //pointer check    if(f==NULL){       return (-1);    }     fseek(f, 0, SEEK_END);    size = ftell(f);    fclose(f);     return(size); }

How can I find out the size of a file I opened with an application written in C ?  I would like to know the size, because I want to put the content of the loaded file into a string, which I allocate using malloc(). Just writing malloc(10000*sizeof(char)); is IMHO a bad idea.


I am trying to edit a PDF in Photoshop. I want to keep the white margins on the page, but each time I pull the PDF into Photoshop, it automatically crops to the size of the image on the page. I previously used Adobe CS5, and I was able to adjust the canvas size after flattening the image to adjust my white space accordingly (Sometimes I need white space around my image, sometimes not). Now have Creative Cloud and cannot figure out if this is a setting I can change.

I wish to open a pdf in photoshop , remove some content and then resave it.  When i do this the new pdf has trimmed margins. What is the best approach to keep the margins the save as the original file. I appreciate indesign or other software would be a better for this job


If we join a shunt through a galvanometer,it makes an ammeter.but in parallel arrangement voltage is same and only some amount of current is passed and not the total current of circuit.so how does the ammeter gives the value of total current in circuit????

A galvanometer can be converted into an ammeter by connecting a low resistance (called shunt resistance) in parallel to the galvanometer.    Firstly, why do we need to connect the resistance?  If a resistance is connected in parallel, then some of the current will flow through resistance. So how can the current in the circuit be determined? Won't it be inaccurate, as some of the current flows through resistance?


Company A's share price in the market continues to rise while at the same time, the company keeps announcing that they are issuing new shares for multiple M&A transactions. How is this possible ? Isn't it true that new shares will generally dilute the existing share value? Or is it because the market expects that the M&As will soon/immediately increase the total market cap ? Are there other explanations for this phenomenon ?

When a public company issues new shares, the total number of shares traded in a secondary market goes up. Assuming there is no change in the fundamentals of the company and the profitability, I would expect that the share price of the existing shareholders would fall. However, this does not always happen in real life.  A quick Google search says that a company can only offer new shares if they have "unissued capital". My questions are:   When can a company issue new shares? How does it affect the existing shareholders? What changes in the balance sheet after such an issue?


I other words can I find a number m for any number $n$ such that $\varphi(m)=n$? It would be great if you could also present a proof or a link to a paper that contains a proof Edited note: I forgot to mention $n$ must be even as $\varphi(m)$ is always even.

I was reading about Euler's totient function on wikipedia, and it eventually led me to this book on google:  .  Anyway, the books lists many assertions without proof, only references which I can't find. One I could not solve for myself said that not all even numbers are values of $\phi(n)$. The sequence of even non-values of $\phi(n)$ starts:  $14, 26, 34, 38, 50, 62,\dots$  After thinking about it for a while, I've made little headway. Looking at 14 specifically, I suppose if such a solution $a$ to $\phi(x)=14$ were to exist, $(a,m_i)=1$ for $1\leq i\leq 14$, for some $m_i\lt a$ and so there must also exist inverses $\overline{a_i}$ such that $\overline{a_i}a\equiv 1 \pmod {m_i}$ for each $i$. I'm looking for some contradiction, possibly of the Chinese Remainder Theorem, to show such $a$ cannot exist.   Is there some way to generalize which values are not taken by $\phi$, or at least explain why this is the case? I was hoping to see why $14$ is the least such integer such that this is true, but values $1$ to $13$ must be indeed taken. I suppose this would also explain why 26 is the next such value that is not taken, while $15$ to $25$ are.


How do I upgrade my Ubuntu to 16.04 ? It is now 12.04. If I upgrade the version will it delete all my installed apps ? Kindly help.

I am currently using Ubuntu 10.04. I know there is a 10.10 release, but can I upgrade directly to 11.04? Could you walk me through the steps please?


Do I need an apostrophe-s in reference to major concepts?   For example, I see both versions as in:    Planck’s constant  Planck constant    Are both forms considered correct?

When is it required to use 's in phrases like below (examples taken from Wikipedia)?   James Bond theme 007 theme Boba Fett motif Droids motif Yoda's theme ...   Are there any rules for eliding Saxon genitive?  How does the situation change if we have something instead of somebody?


In school, we learn that $T = Fd$, where $T$ is the torque, $F$ is the force perpendicular to the moment arm, and $d$ is the length of the moment arm. If I was the first physicist to come up with this model for torque, what might my train of thought be? In other words, how does one come up with this model?

I understand the equations of angular motion and how they relate to one another, however it is not clear to me where the torque equation comes from.   We have $F=ma$. By solving for the angular interpretation of linear acceleration, we have $$a=\frac{dv}{dt}r=\frac{d\omega}{dt}r=\alpha r$$ and thus $F=m\alpha r$.   With $\tau=Fr$, $\tau=m\alpha r^2$. When we have multiple torques we can add them up because $\tau$ is linearly related to force and force is a sum. By defining $I=\sum{m_ir_i^2}$, we have $\tau=I\alpha$  I understand that the concept of inertia is really an abstraction. We see the discrete $\sum{m_ir_i^2}$ or $\int{m_ir_i^2}$ forms frequently when dealing with equations of angular dynamics and thus decide to name the quantity moment of inertia based on the common role it plays in the equations (eg: for kinetic energy)  My question, a clarification   However, I'm unclear about how we know $\tau=Fr$. Is $\overrightarrow{\tau}=rF$ a wholly mathematical corollary of newton's laws of motion, (without creating a tautology), or a later development backed by empirical research.


Given $m > 0$, fix a reduced residue system (RRS) $r_{1}, r_2,\dotsc , r_{\varphi(m)} $ mod $ m$. Let $x$ denote the sum $r_1 + r_2 + \dotsb + r_{\varphi(m)}$. What is $x$ mod $m$?  The problem is that I'm stuck. So suppose that $m = 2k + 1$. Then the RRS would include an even number of elements since all even numbers are relatively prime to $m$. But I don't know what to do with this information and I also don't know how to solve for if $m$ is even. Any help will be appreciated.

Show that if $c_1, c_2,\ldots, c_{\phi(m)}$ is a reduced residue system modulo $m$, $m \neq 2$, and $m$ is a positive integer, then $c_1 +\cdots+ c_{\phi(m)} \equiv 0 \pmod{m}$   From the problem statement, I only know that $\gcd(c_i, m ) = 1$. Is there any related theorem that I missed?  A hint would be greatly appreciated.  Thanks, Chan


What does Obj::* mean?  What is it called?  template<typename Return, typename Obj, typename... Args> void addRouteSyncReturn(                    Return (Obj::* pmf) (Args...), ) { ... }

I came across this strange code snippet which compiles fine:  class Car {     public:     int speed; };  int main() {     int Car::*pSpeed = &Car::speed;     return 0; }   Why does C++ have this pointer to a non-static data member of a class? What is the use of this strange pointer in real code?


I have a code like this:    if (args.ElementType == typeof(SomeFirstClassName))   {     args.Result = GetResult<SomeFirstClassName>(args);   }   else if (args.ElementType == typeof(SomeSecondClassName))   {     args.Result = GetResult<SomeSecondClassName>(args);   }   How I can simplify this code, if I will have a many types? For example, can I do something like below?  args.Result = this.GetResult<**args.ElementType**>(args);   I cannot put the variable Type (args.ElementType) to the <>. Is it limitation of C#?

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


The sequence ($x_n$) is defined by $x_0=1$ and $x_n=1+\frac{1}{x_{n-1}}$ for $n\in ℕ^*$, then how could I find the limit of it? By trying some, I've found that the answer is $\frac{1+\sqrt5}{2}$, but I'm looking for a "legit" way to find it.

Problem: Find with proof limit of the sequence $a_n=1+\frac{1}{a_{n-1}}$ with  $a_1=1$  or show that the limit does not exist.  My attempt:  I have failed to determine the existence. However if the limit exists then it is easy to find it.  The sequence is not  monotonic and I have failed to find any monotonic subsequence subsequence. The sequence is clearly bounded below by $1$. I have observed that the sequence is a  continued fraction so it alternatively increases and decreases.   So, please help me.


I have a game that is 44 days since the opponent played and one that is 22 days. When will they be closed? I play on Android

When I accidentally clicked "resign" while the game was on my opponent's turn, I got this message:     You can only resign when it is your turn.  But fear not!  If your opponent does not make a move in a reasonable amount of time they will be resigned automatically.   What is the "reasonable amount of time" referred to, here?


I know the right answer is the former one thanks to Google, but is there a reason behind it other than idiomatic usage?

What is the difference between electric and electrical and their usage?  For example, what is the difference between "electrical machine" and "electric machine"?


I have a database that is stored in txt format.`        I would like to transform it to a MySQL database so that the special characters like ā or ă remain. It does not work if I just export it.

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


How to draw a kiviat diagram like the following?

This question led to a new package:      Is there a way to draw  easily?


Find the prime factor decomposition of $100!$ and determine how many zeros terminates the representation of that number.   Actually, I know a way to solve this, but even if it is very large and cumbersome, and would like to know if you have an easier way, or if I am applying wrong. Setting by $\left[\frac{b}a \right]$ the quotient of $b$ with $a$, we have too $E_p(m)$ the largest exponent power $p$ dividing $m$, and found the demonstration of a theorem that says (that in my text says it was discovered that Lagendre) $$E_p(n!)=\left[\frac{n}p \right]+\left[\frac{n}{p^2} \right]+\left[\frac{n}{p^3} \right]+\;...$$always remembering that there will be a number $s$ such that $p^s\geq n!$ which tells us that $$\left[\frac{n!}{p^s} \right]=0$$ thus making the sum of a finite $E_p(n!)$. So that I can address the first question I asked, really have to get all the cousins $(p_1,p_2,...,p_k)$ and make all $$E_{p_1},\;E_{p_2},\;E_{p_3},\;...,\;E_{p_k}$$ with $p$ and cousin $1<p<100$. And to find the zeros have to see how we both exponents in numbers 5 and 2.     Example $$10!=2^83^45^27\\p<10\\E_2(10!)=5+2+1=8\\E_3(10!)=3+1=4\\E_5(10!)=2\\E_7(10!)=1\\$$

How can we find the prime factorization of $100!$. My only idea is to write it as,  $$(1)(2)(3)(\color{red}{2})(\color{red}2)...$$  And count the factors.  But that would take way to long. Any ideas?


One of my favorite things about the StackExchange set of sites was always broadening my knowledge of different subjects by going to the Multicolider SuperDropdown and visiting the trending questions, not just on StackOverflow, but from all the sites.  With the most recent change to the top bar, is this now impossible?  Where I would normally see a list of hot questions from various StackExchange sites, I know see just a list of StackExchange sites that I participate in most, followed by other sites.

Before today, I would visit Stack Overflow every day and click somewhere in the upper-left corner (I've forgotten what it said, and it's gone now!) and if I didn't have any notifications I would see a list of interesting questions from various sites in the Stack Exchange network which - I believe - were classified as "hot".  Now this new top bar has appeared, and I have no idea how to get this list any more. I'm not really sure what it was called so my searches have been useless as well.


I'm training a neural network for regression. The input vectors consist of $92$ different features, I want to discard features with small variance (standard deviation).   There are two ways that came up to me:   Decide the number of features to keep, say $N$. Then keep the $N$ features with the biggest standard deviations. Choose a $\sigma_{min}$, then discard features whose standard deviation is smaller than this $\sigma_{min}$.   For the second approach, I don't know how to choose such a $\sigma_{min}$, there are also two ways that came up to me:    Just arbitrarily choose a $\sigma_{min}$, say 1e-5. Let $\sigma_{min}$ to be $\text{mean}\{\sigma_i\}_{i = 1}^{92}$    Which approach should I choose?

I'm training a neural network for regression. The input vector consists of $140$ entries.   For each feature vector entry, I calculate both min and max over the training set. The difference max-min of some entries are smaller than 1e-5. I understand I can normalize such feature entries by say MinMaxScalar. However, if the difference max-min is this small, can I discard such entries since they seem to be so insensitive?


Find a number $0 \leq a < 73$ with $a≡9^{794}\mod 73$.  I know that $a$ and $73$ are relatively prime and $a^{72}≡1 \mod73$. But I couldn't use the theorem.  Can someone help me please?

I've read about Fermat's little theorem and generally how congruence works. But I can't figure out how to work out these two:   $13^{100} \bmod 7$ $7^{100} \bmod 13$   I've also heard of this formula:  $$a \equiv b\pmod n \Rightarrow a^k \equiv b^k \pmod n $$  But I don't see how exactly to use that here, because from $13^1 \bmod 7$ I get 6, and $13^2 \bmod 7$ is 1. I'm unclear as to which one to raise to the kth power here (I'm assuming k = 100?)  Any hints or pointers in the right direction would be great.


f1 and f2 are two files, I want to know what does this two commands in linux,  cat f1 f2 .. > f1 and       less f1 f2 …>f2 . I dont have linux in my computer to test them.

Redirection is not allowed here. Is cat not allowing? But isn't redirection independent of any command running with it?  $ cat bk > bk cat: bk: input file is output file  Why does the following redirect empty the file:  $ less  bk > bk   awk also works in the similar way as less in regard to redirection. awk is the one with which I actually found the problem, while the above examples are meaningless   In general, what are the right way to use redirect?


I am writing a regex to find any instances of words that start with & and end with ;. There could be multiple copies on the same line, on different lines, or whatever. I just want to find anything that looks like  &amp;  &dog;  &cat; and &dog;  or similar. I think my check for the ; is too greedy in my example. How do I fix my regex to find the specific words I need without selecting anything else?

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


$$\displaystyle \lim_{x \to \infty} x^{1/x}$$ It's supposed to be calculated with L´Hospital rules, but I can´t find the way of express the limit as a quotient.

I encountered a problem: calculate $\lim\limits_{x\to\infty} x^{1/x}$  My solution is quite weird and I find no document explaining whether I am right or wrong!  My solution:  As $\lim\limits_{x\to\infty} 1/x = 0$  then $\lim\limits_{x\to\infty} x^{1/x} = \lim\limits_{x\to\infty} x^0  = 1$  My question is: Whether I am right or wrong, and could you please explain why?


What is the maximum power of $2$ which completely divides $3^{1024}-1$?  I proceeded thus: $\phi(2^n)=2^{n-1}$ for all $n\ge1$ $$3^{1024}=3^{2^{10}}\equiv1\pmod {2^{11}}$$ $$3^{1024}-1\equiv0\pmod {2^{11}}$$ Since $\phi(2^{11})=2^{10}$.  So, maximum power of $2$ must be $11$. But the answer says it is $12$. Where am I wrong and how to solve it correctly?

Highest power of two that divided $3^{1024}-1$     Q: I did from binomial and expansion but is there a smarter way ?   My approach : $ 3^{1024}-1 $ can be $(3^{512} + 1)$ and $(3^{512} – 1)$ $\quad $Again $( 3^{512} – 1 )$ is written as $( 3^{256} + 1 )$ and $( 3^{256} – 1)$ $\quad \quad $Again $( 3^{256} – 1 ) $ is written as $( 3^{128} + 1 )$ and $( 3^{128} – 1)$ $\quad \quad \quad $Again $( 3 ^{128} – 1 )$ is written as $( 3^{64} + 1 )$ and $( 3^{64} – 1)$ $\quad \quad \quad \quad $Again $( 3^{64} – 1 )$ is written as $( 3^{32} + 1 )$ and $( 3^{32} – 1)$ $\quad \quad \quad \quad \quad $Again $( 3^{32} – 1 )$ is written as $( 3^{16}+ 1 )$ and $( 3^{16} – 1)$ $\quad \quad \quad \quad \quad \quad $Again $( 3^{16}– 1 )$ is written as $( 3^{8}+ 1 )$ and $( 3^{8} – 1)$ $\quad \quad \quad \quad \quad \quad \quad $Again $( 3^{8} – 1 )$ is written as $( 3^{4} + 1 )$ and $( 3^{4}– 1)$ $\quad \quad \quad \quad \quad \quad \quad \quad $Again $( 3^{4}– 1)$ is written as $(3^{2} + 1)$ and $( 3^{2} – 1)$    $\quad \quad \quad \quad \quad \quad \quad \quad \quad $Again $( 3^{2} – 1)$ is written as $( 3^{1} + 1 )$ and $( 3^{1} – 1)$ $\quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad $or $ 2^2 $and$ 2^1$          Now it can be observed that each of $( 3^{512} + 1), ( 3^{256} + 1) , ( 3^{128} + 1) , ( 3^{64} + 1)$ , $( 3^{32} + 1)$ , $(3^{16} + 1) , (3^{8} + 1)$ , $(3^{4} + 1) , ( 3^{2} + 1)$ is divisible by $2$ but not by $ 2^{2}$.              In other words, maximum power of $2$ that can divided each of $( 3^{512}+ 1), ( 3^{256}+ 1) $ , $ ( 3^{128} + 1) , ( 3^{64}+ 1)$ , $( 3^{32} + 1) , (3^{16} + 1) , (3^{8} + 1) $,$ (3^{4} + 1)$ and $( 3^{2} + 1)$ is $1$.           As they are total $9$ terms hence expression is divisible by $2^9$ and rest two terms $2^2$ and $2^1$ will be divisible by $2^3$. Hence, maximum power of $2$ that can divide $3^{1024} – 1$ is $12$.


I had a dataset that consists of 20000 chess matches. In this dataset, there are columns and variables- such as the players' ratings- that might have an impact on binary data, a white player is more likely to win. To test this hypothesis, my lecturer told me to perform a nested regression model where I could see the effect of each of these variables. Since it's binary data, I thought about making a nested logistic regression model. However, I don't know how to do that and how to do that in python. Can someone please help?

I had a dataset that consists of 20000 chess matches. In this dataset there are columns and variables- variables like the players’ ratings- that might have impact on a binary result, white player winning more. To test this, my lecturer told Me to perform a nested regression model where you could see the affect of each of these variables. Since it’s a binary outcome, I thought about making a nested logistic regression model. However, I don’t know how to do that and how to do that in python. Can someone please help?


The badges, curious, inquisitive and socratic are described as:     Ask a good question on N separate days, and maintain a positive question record   However the term good question is not explained. From my account at least it doesn't refer to the good question badge:      Question score of 25 or more   I think these badges' description should be clarified, probably to something like:     Ask a question on N separate days with a score of one or more, and maintain a positive question record

A couple of months ago, I suggested a set of badges for . The responses were... mixed. The  can be summarized:  In practice, all this would do is encourage people to ask yet more stupid, worthless questions and we have quite enough of that as it is.  We believe that one of the main things holding back many of our beta sites is that when people have questions they aren't in the habit of asking on the site. Even our flagship site, Stack Overflow, doesn't get many questions from its most knowledgeable users. Perhaps they don't have questions, but far more likely they find answers without needing to ask. Our subtle bias against asking (questions => clueless) means we lose out on what might be our best source of excellent questions. So we went back to the drawing board and designed a badge set that should not encourage worthless questions:  Asked a well-received question on X separate days, and maintained a positive question record.  In order to award badges, we need to define our terms:  positive question record   (total questions - negative questions - closed - deleted)/total questions >= 0.5  It triple counts a question that is downvoted, closed, and deleted. If you ask one that hits that trifecta, you'll need to ask three better questions to dig yourself out. My own record of asking does not meet the criteria:   (44 - 0 - 12 - 12)/44 = 0.4545...  My  looks a lot better; I had a bunch of questions from the beta period that have been subsequently (and rightfully) deleted. With care, I could bring my record into positive territory with 4 questions. The takeaway is that people can't sweep past indiscretions under the rug by deleting them. And they can recover from a bad start as long as they don't ask more bad questions.  well-received question on X separate days A well-received question is one that's open, not deleted, and has a score > 0. If you ask at least one well-received question in a  and none of your questions that day are deleted, downvoted, or closed, you get one more day of credit toward the badge. Whenever the badge criteria is checked, previous asking days are re-evaluated so that there's an incentive to fix downvoted and/or closed questions. The no-deleted-questions criteria is to prevent people from asking several questions at once and deleting any that aren't upvoted or answered to ask another day. (Though this is a losing strategy in the long run.)   My proposed badge names and levels:  Asked a well-received question on 5 separate days, and maintained a positive question record.  Asked a well-received question on 30 separate days, and maintained a positive question record.  Asked a well-received question on 100 separate days, and maintained a positive question record. In addition, since some outstanding individuals ask on more than 100 days, the gold badge may be awarded multiple times. Over on English, Oishi-sama (now a ) would have a remarkable . Bronze and silver badges are only awarded once. We've decided to hold off on multiple awards for now. See the . Neither the names nor the levels nor even the descriptions are set in stone. Please play around with  to get an idea of how the badge works using our public data. Since the query does not account for deleted questions, it's a bit more generous than the actual badges would be. This version of the badge set should encourage a habit of well-received questions over time and encourage people to fix poorly received questions.  I'd like to express my gratitude to the Parenting community for participating in our .


Show that the plane with countably many points removed is path-connected under the Euclidean topology. This is quite an interesting issue, hopefully everyone will help you

Does $\mathbb R^2$ remain connected when countably many points are removed? Does it remain path connected?  This is not homework but is in response to working several problems where countable or uncountable many points are removed and the pattern always holds.  Thank you.


How to alter database name from test to test1?

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


I'm using this code to train a neural netowrk in MATLAB:  x = Input_data % with 13 features (unnormalized data) t = out_data % (unnormalized data)  trainFcn = 'trainlm';  % Levenberg-Marquardt backpropagation.  % Create a Fitting Network hiddenLayerSize = [10,5]; net = fitnet(hiddenLayerSize,trainFcn);  % Choose Input and Output Pre/Post-Processing Functions % For a list of all processing functions type: help nnprocess net.input.processFcns = {'removeconstantrows','mapminmax'}; net.output.processFcns = {'removeconstantrows','mapminmax'};  % Setup Division of Data for Training, Validation, Testing % For a list of all data division functions type: help nndivide net.divideFcn = 'dividerand';  % Divide data randomly net.divideMode = 'sample';  % Divide up every sample net.divideParam.trainRatio = 70/100; net.divideParam.valRatio = 15/100; net.divideParam.testRatio = 15/100;  % Choose a Performance Function % For a list of all performance functions type: help nnperformance net.performFcn = 'mse';  % Mean Squared Error    % Choose Plot Functions % For a list of all plot functions type: help nnplot net.plotFcns = {'plotperform','plottrainstate','ploterrhist', ...     'plotregression', 'plotfit'};  % Train the Network [net,tr] = train(net,x,t);  % Test the Network y = net(x); performance = perform(net,t,y)  % Recalculate Training, Validation and Test Performance trainTargets = t .* tr.trainMask{1}; valTargets = t .* tr.valMask{1}; testTargets = t .* tr.testMask{1}; trainPerformance = perform(net,trainTargets,y) valPerformance = perform(net,valTargets,y) testPerformance = perform(net,testTargets,y)    % View the Network view(net)   Output of my neural network:  performance =     2.4135e+04   trainPerformance =     2.2552e+04   valPerformance =     1.8569e+04   testPerformance =     3.7084e+04     Why MSE and performance outputs are so high!?

I'm training a neural network but the training loss doesn't decrease. How can I fix this?  I'm not asking about overfitting or regularization. I'm asking about how to solve the problem where my network's performance doesn't improve on the training set.    This question is intentionally general so that other questions about how to train a neural network can be closed as a duplicate of this one, with the attitude that "if you give a man a fish you feed him for a day, but if you teach a man to fish, you can feed him for the rest of his life." See this Meta thread for a discussion:   If your neural network does not generalize well, see:


I have got the question at my Lie Groups course.  The Lie subgroup is a submanifold of a Lie Group which is also a subgroup.  Assume the Lie Group $G$ acts on a smooth manifold $M$. The stabilizer of a point $G_x$ is a subgroup, I need to show that it is a Lie subgroup as well, i.e. a submanifold.  The statement is mentioned in  question.  I know that every subgroup of a topological group is closed, so $G_x$ is closed, but looks like we should use that M is a manifold and that the acting is continuous, but I have no clue how to make the coordinate definition of a submanifold work here.  UPD , ,   Looks like this question was answered two times already but I didn't find it in a brief inspection.

Let $G$ be a Lie group acting smoothly on a manifold $M$. Then, for each $p \in M$, it is obvious that the isotropy group $G_p = \{ g \in G : gp=p\}$ is a closed subgroup of $G$. A standard theorem () about Lie groups tells you that closed subgroups are (embedded) submanifolds, so this is true in particular of the isotropy group $G_p$. I must confess, however, that for me this theorem is really more of a "fact". The proof looks a little complicated, and I have never gone through it. So, I would like to know     Question: Is there a way to see that $G_p$ is a submanifold more directly, i.e. can this be shown with less work than it takes to prove the more general statement about closed subgroups?


Consider following problem from Evans  Assume $\Omega$ is connected. A function $u\in H^1(\Omega)$ is a weak solution of $$(1)\quad\left\{\begin{array}{ll} -\Delta u(x)=f & x\in\Omega\\ \frac{\partial u(x)}{\partial n}=0 & x\in\partial\Omega\end{array}\right.$$ if for all $v\in H^1(\Omega)$ there holds $$\int_\Omega\nabla u\cdot\nabla v\,dx=\int_\Omega fv\,dx \,.$$ Suppose that $f\in L^2(\Omega)$. Prove $(1)$ has a weak solution if and only if $$\int_\Omega f\,dx=0.$$  It is quite difficult. Do I need to use Lax Milgram. How would I go about problem?

Let $U$ be connected. A function $u \in H^1(U)$ is a weak solution   of Neumann's problem   \begin{equation} (*)\qquad\left\{ \begin{array}{rl} -\Delta = f & \text{in } U \\ \frac{\partial u}{\partial \nu} = 0 & \text{on } \partial U \end{array} \right. \end{equation}   if   $$ \int_U Du \cdot Dv \; dx = \int_Ufv \; dx $$   for all $v \in H^1(U)$. Let $f\in L^2(U)$. Prove $(*)$ has a weak solution   if and only if   $$ \int_U f \; dx =0. $$   For the only if part I set $v=1$. However I do not see where to start the if part. I was thinking of the Lax-Milgram theorem. That's where I'm now.


I want to create an Ubuntu 14.04 iso with is all installed packages and software. Ubuntu is installed on Vmware workstation.  I want to be able to install this iso on new systems.

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


I want to show the user, his/her email address on their "My Account" Page. I am not using any modules for the registration page, but just the default Drupal 7 registration fields.   How can i display user name and email address fields to the user on "My Account Page"?

I am using drupal 7 default user_register module, when a user registers with all the required fields, it successfully registers but when I click that user in people> tab his/her profile is displayed in which email is not appearing as you can see in the screen shot. Whereas when I clicked on edit link on the right side of that user email address exists.


I have simple javascript:  function createNewCheckboxt(name, id){     var elem = document.createElement('div');      var checkbox = document.createElement('input');     checkbox.type = "checkbox";     checkbox.name = name;     checkbox.value = name;     checkbox.id = id;      var label = document.createElement('label')     label.htmlFor = id;     label.appendChild(document.createTextNode(name));      document.getElementById("brand").appendChild(elem);     document.getElementById("brand").appendChild(checkbox);     document.getElementById("brand").appendChild(label); }   how to add class for styling? Because when I add div.class="checkbox" doesn't work

I have an element that already has a class: <div class="someclass">     <img ... id="image1" name="image1" /> </div>  Now, I want to create a JavaScript function that will add a class to the div (not replace, but add). How can I do that?


In order to have an encrypted file who's key can be changed without needing to encrypt the whole file again, I'd like to encrypt the file with a main key ,and then encrypt that main key with another one which the user will keep.  My question is - can I also encrypt a MAC (Message Authentication Code) key and store it in the file beside the MAC itself, or will that introduce a weakness? (The user will have another MAC key to authenticate the main (encrypted) encryption and MAC keys.)  Let's assume using AES-CBC and HMAC-SHA256  EDIT  This is the general idea:   Encrypted main_AES_Key || main_MAC_Key (encrypted with user-stored_AES_Key). IV. MAC of all of the above (using user_stored_MAC_Key). Encrypted message (using main_AES_Key). IV. MAC of 4+5 (using main_MAC_Key).

Encrypt-then-MAC does provide ciphertext integrity, but no plaintext integrity. With MAC-then-Encrypt it’s the other way around: Plaintext integrity but no ciphertext integrity.  What comes to mind is that it could make sense to use both to fix that “partially missing integrity” issue:  $$\tt …\ MAC_2(ENCRYPT(plaintext,MAC_1(plaintext)))$$  Trying to research if this would introduce more problems instead of solving them, I wasn’t able to find any useful papers that provide a security analysis of this approach. Also, I wasn’t able to find any papers discussing related schemes.   Ignoring potential speed impacts and focusing strictly on the security aspects… is there any obvious reason I’m not seeing why such a scheme should not be considered in the first place? Or do related references/papers exist and I was simply too inapt to find them? (If, what should I be looking for?)    EDIT: As some confusion was expressed in the comment area – please note that the above LaTeX merely represents a readable hint at what I’m talking about. It is not meant to describe a whole formula (which I assumed be clear due to the prepended “$…$” and the fact that there is no $key$ in the above LaTeX either). The reason to prefer posting a hint instead of a complete formula was simple: the complete formula renders/formats much less readable and could have confused some people – which I wanted to prevent. Obviously, “what is less confusing to some, is more confusing to others”. That’s something I honestly hadn’t anticipated…  my bad. Here’s the whole thing:  $$CypherText = IV || Encrypt(PlainText || MAC_1(PlainText, MacKey_1), IV, CipherKey) || \\ MAC_2(IV || Encrypt(PlainText || MAC_1(PlainText, MacKey_1), IV, CipherKey), MacKey_2)$$ Don’t even ask how this would look if I wouldn’t be using a <sub> tag… yet, it may help understand why I opted-in to posting a hint.


everybody.  I'm new to blender and I think I got one of those beginner problems. I am trying to make a goat and one of the faces won't let me loop cut it. It just skips the face.    I would be glad if you could help me.  Thanks!

Alright so I've seen some postings about loop cuts and done some research. I am very new to blender and modeling overall. I am trying to loop cut this concrete barrier. Now I'm following a tutorial and kind of did my own thing in some areas. I cleaned it up following some instructions in another answer here on stack exchange.  I can't for the life of me figure out why I can loop cut around the whole bottom:   ...but not the whole middle:   I see this marked as answered by another question. That question refers to ngons and inside faces. Now once again I'm totally new to this. I looked on the inside. I don't believe I have inside faces or any ngons by the terms I've read online in my research.  Here is a wireframe picture and the inside view:     Maybe I'm missing something the answers on other posts are saying. If so and you know what it is I'd be very appreciative of what it is.


I want to give permission to a user to do shutdown command without password. Shutdown command need root privileges. If I give NOPASSWD in /etc/sudoers, the user can do all command that need root privileges without entering password. I want the user just has shutdown command permission without password, not other commands.  My exact goal is to do shutdown automatically after finished downloading a huge file. So, the user can do this:  wget *download link* || shutdown -hP now   I read somewhere that sudo can only remember password for about 15 minutes. So, if I do  sudo wget *download link* || shutdown -hP now   or  wget *download link* || sudo shutdown -hP now   and downloading process take more than 15 minutes, it will asking for password when I'm not around.  So, How do I add a command permission to specific user to do it without password?

On one particular machine I often need to run sudo commands every now and then. I am fine with entering password on sudo in most of the cases.  However there are three sudo commands I want to run without entering password:   sudo reboot sudo shutdown -r now sudo shutdown -P now   How can I exclude these commands from password protection to sudo?


Just now using MacOs Sierra's Mail client. Compared to what happened on El Cap, which worked fine. It seems that now Gmail is accumulating drafts, in other words, once the email is sent, there may be one or many drafts of the email in the drafts folder. Probably corresponding to how many autosaves happened.  Can I stop this from happening?

I am having a bit of an issue here with the default mail application in mac OS El Capitan. I am using my gmail account on the mail client and it is autosaving drafts when I compose messages ... I have done some searching and found various answers saying that I can turn it off by going to Mail --> Preferences --> Accounts and after selecting the account in "Mailbox Behaviours" box just uncheck the "Store draft messages on the server" check box ... as explained in this tutorial that I have found  ... But there is a issue ... I don't have that option in my preferences .. please see this screenshot of my preferences screen.    I am really confused on this ... Oh forgot to tell this is my first Mac experience. Looking forward to your answers. Thanks :)  UPDATE: I have upgraded to macOS Sierra ... but the issue still persists ...


Situation: when a user self-marks their post as a duplicate, it shows as closed by "community" rather than the original poster.  Problems: this is not clear at all to most users of SE what has happened. It looks like the question was "mod closed" as a duplicate against the asker's wishes.    Suggestion: instead of the community user "closing" the post, have the final close user be the asker (or make it "Community & Asker"). This will help clear up confusion and streamline the process for understanding what happens.

Currently, when the original poster of the question votes to close a question, the close vote is attributed to the Community user, which can lead to confusion on who actually voted to close the question.    Yes, it does say that the question author authorized a pending duplicate vote and whatnot, but that isn't indicated anywhere except for in a hidden thing that most won't look to see.  Like nicael , there really isn't a point to hiding that the question author approved a duplicate vote. Even if they didn't at the most specific level vote to close, it's makes for a better user experience to have something more like this:


Why the code's result is that? -3.0531133177192E-16  I think the result should be zero.          $a = floatval('-0.92');         $b = floatval('-0.55');         $c = floatval('1.38');         $d = floatval('0');         $e = floatval('0.09');         $temp=$a+$b+$c+$d+$e;         var_dump($temp);         die();   I'm a php fresher, I'm really confused by this result, So any answer will be appreciated.

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


Evaluate the following limit. $$\lim_{n \to \infty} \cfrac{\sum_{k=1}^n\lfloor kx\rfloor}{n^2} $$  I'm not sure how to proceed from here. Normal methods don't seem to apply here, because of the presence of $\lfloor\cdot\rfloor$ (greatest integer function). Although, I do get a feeling that Sandwich Theorem may come into play here. Not sure how. May be taking interval of $\lfloor x\rfloor$ as : $x - 1 <\lfloor x\rfloor< x $ . Any one who can guide me through?

This question came from the prelim exam I took last month. I have a proof that seems a bit unwieldy to me (posted as an answer), so I'm opening it up to ask if there are other ways of showing this.     Let $x$ be any positive real number, and define a sequence $\{a_n\}$ by   $$ a_n = \frac{ [x] + [2x] + [3x] + \dotsb + [nx] }{n^2} $$   where $[x]$ is the largest integer less than or equal to $x$. Prove that $\displaystyle{\lim_{n \to \infty} a_n = x/2}$.


I am planning to do a thesis in the Elasticsearch(a search engine based on the Lucene library) parameter optimization using some machine learning or optimization algorithm(automate the optimization of Elasticsearch parameters/settings based on current data/conditions). Which Machine learning or optimization algorithm do you suggest for it?

Gradient descent and many other methods are useful for finding local minima in cost functions. They can be efficient when the cost function can be evaluated quickly at each point, whether numerically or analytically.    I have what appears to me to be an unusual situation. Each evaluation of my cost function is expensive. I am attempting to find a set of parameters that minimize a 3D surface against ground truth surfaces. Whenever I change a parameter, I need to run the algorithm against the entire sample cohort to measure its effect.  In order to calculate a gradient, I need to change all 15 parameters independently, meaning I have to regenerate all the surfaces and compare against the sample cohort way too many times per gradient, and definitely way too many times over the course of optimization.  I have developed a method to circumvent this problem and am currently evaluating it, but I am surprised that I have not found much in the literature regarding expensive cost function evaluations.  This makes me wonder if I am making the problem harder than it is and that there might be a better way already available.  So my questions are basically this: Does anyone know of methods for optimizing cost functions, convex or not, when evaluation is slow?  Or, am I doing something silly in the first place by rerunning the algorithm and comparing against the sample cohort so many times?