Here is the error I got while trying to install octave:  $ sudo add-apt-repository ppa:octave/stable $ sudo apt-get update $ sudo apt-get install octave The following packages have unmet dependencies:  octave : Depends: libarpack2 (>= 2.1) but it is not going to be installed           Depends: libcholmod2.1.2 but it is not going to be installed           Depends: liboctave3 (= 4.0.2-1ubuntu5~octave~trusty1) but it is not going to be installed           Recommends: default-jre-headless but it is not going to be installed E: Unable to correct problems, you have held broken packages.   I have tried many ways to install octave, but they have failed.

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


I am getting 56 bytes for the following. Can anyone explain how is that?  #include <stdio.h>  typedef struct how_many_bytes {     long s[4];     char c, e;     int i[2];     char *d;     } How_Many_Bytes;  int main(){         printf("%lu ", sizeof(How_Many_Bytes)); }   Shouldn't it be (4*8) + 1 + 1 + 2(for padding) + 4 + 4 + 8 = 52 bytes

Why does the sizeof operator return a size larger for a structure than the total sizes of the structure's members?


I use Kubuntu 17.04 with Apache2, Mysql and PHP7 to run Wordpress test for testing purposes. I use NetBeans editor to edit files on the server.  When I installed I was facing "non writable directory" when trying to auto-update WP to newer version, so Ive set group to www-data. It fixed, but it was not editable by NetBeans, so Ive set it to chmod 777.  Ive also tried FTP, but I don't want to run another service on my laptop and connect each time I make changes.  I know it's not the best practise to have chmod 777 even for localhost testing. Is there any other way to keep the /var/www/ writeable for NetBeans (and other utilities) and Wordpress at once?  Thanks

I want to stop having to use sudo everytime I work in /var/www. How can I do that? I simply want to put all of my sites into this directory and work with them without too much pain.


There is a display issue in  page. when you will scroll down to end of page side bar is merging with footer.

Here is a screenshot from  page, with the floating sidebar: (all good so far)        After I scroll down to footer it just combines both:        Can it please be fixed?


How to access Raw file system?  My Portable harddisk was working fine. But once I accessed it from linux terminal. And Later when try to use it in window it says You need to format it before you can access  In Ubuntu also when I plug it, it does not appear.  Tried to access through chkdisk but says Raw file system could not be processed.  Is there any way I can get back data inside it?  recovery software does not preserve folder when it recovers data. Also When I tried it it says "1 days remaining to process" nearly 350GB data.

My Portable harddisk was working fine. I once accessed it from a linux terminal. Later when I tried to use it in window it said You need to format it before you can access  In Ubuntu also when I plug it, it does not appear.  I tried running chkdisk but Windows says Raw file system could not be processed.  Is there any way I can get back the disk data?  Recovery software does not preserve folder when it recovers data. Also When I tried it it says "1 days remaining to process" nearly 350GB data.


I have a site with forums. The forums are currently at forums.example.com (a subdomain). I've heard that for SEO and usability in general it's better to have them at example.com/forums. Regarding security and maintainability, however, it would be better to host the forums in a seperate VirtualHost (or to be exact, a seperate cPanel account).  Is this even possible, should I want to do this?

This is a  about Apache's mod_rewrite.   Changing a request URL or redirecting users to a different URL than the one they originally requested is done using mod_rewrite. This includes such things as:   Changing HTTP to HTTPS (or the other way around) Changing a request to a page which no longer exist to a new replacement. Modifying a URL format (such as ?id=3433 to /id/3433 ) Presenting a different page based on the browser, based on the referrer, based on anything possible under the moon and sun. Anything you want to mess around with URL   Everything You Ever Wanted to Know about Mod_Rewrite Rules but Were Afraid to Ask!  How can I become an expert at writing mod_rewrite rules?   What is the fundamental format and structure of mod_rewrite rules? What form/flavor of regular expressions do I need to have a solid grasp of? What are the most common mistakes/pitfalls when writing rewrite rules? What is a good method for testing and verifying mod_rewrite rules? Are there SEO or performance implications of mod_rewrite rules I should be aware of? Are there common situations where mod_rewrite might seem like the right tool for the job but isn't? What are some common examples?   A place to test your rules  The  web site is a great place to play around with your rules and test them. It even shows the debug output so you can see what matched and what did not.


This happened while voting on Academia Stack Exchange today. Not the biggest of priorities, of course, but still, figured I should throw it up here.

Over on Lifehacks (a beta site with the standard beta template) we're having an election. I just cast my votes and was presented this tooltip:    Please fix the escaped line break tag so it either displays an actual new line or is simply replaced with a space.


I have url regexp which will find the urls. Here is my regexp   (?:(?:https?|ftp):\/\/|www\.)[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&amp;:/~\+#]*[\w\-\@?^=%&amp;/~\+#])?/gi   but, this regexp is not matching with following url   https://www.dpd.co.uk/apps/tracking/?parcel=15505969270050*18538&geoSession=37418a6f-ed43-405f-a596-782d7d78a9651   how I can match with these type of urls. Please help.

How can I check if a given string is a valid URL address?  My knowledge of regular expressions is basic and doesn't allow me to choose from the hundreds of regular expressions I've already seen on the web.


I've tried deriving a proof for this using the handshaking lemma, but that was unsuccessful. Could someone please explain to me how they would do this proof?

Show that, in any finite graph with at least two vertices, there must be two vertices with the same degree.  HINTS ONLY!


I'm using Debian on a headless server that I'm connecting to via ssh.  When I installed Debian, I did not create a root account, so the first user created was in the sudo group. Then I added that user to another group, but in my ignorance I used:  sudo usermod -G NewGroup UserName   instead of:  sudo usermod -aG NewGroup UserName   Without the 'a' (append), this removed the user from every group (including sudo) other than the default UserName group.  I've learned my lesson now, but is there any way to regain superuser access to this installation?  This is a test environment with nothing to backup or recover, so I can simply reformat if all is lost, but I thought I'd ask anyway.

I forgot my root password...actually I think I know what it is because it is the same password I have for pretty much everything but in the Terminal in tell me "Sorry, try again." Is there a way to reset the password? If so how?


I am trying to use mathpazo font, but I have some issues getting the \mathcal working with small letters  this is my template  \documentclass[11pt]{amsart} \usepackage{geometry}                % See geometry.pdf to learn the layout options. There are lots. \geometry{letterpaper}                   % ... or a4paper or a5paper or ...  %\geometry{landscape}                % Activate for for rotated page geometry %\usepackage[parfill]{parskip}    % Activate to begin paragraphs with an empty line rather than an indent \usepackage{graphicx} \usepackage{amssymb} \usepackage{epstopdf} \usepackage{mathptmx} \usepackage{accents} \usepackage{amssymb} \usepackage{amsfonts}  \usepackage{mathpazo}    \begin{document} \maketitle %\section{} %\subsection{}  just some test  $ \infty \mathcal{l}$  \end{document}

The standard font used for \mathcal does not include any lowercase characters. The Comprehensive LaTeX Symbols List suggests redefining \mathcal to use Zapf Chancery. However I do not particularly like that font. For example the uppercase "I" is very hard do distinguish from the non-mathcal "I". Are there any good alternatives?


I'm thinking mostly of the cryptic crossword puzzles that appear in the major English newspapers such as the Times and the Guardian.  The person who creates the puzzle is a compiler, the compiler of the crossword puzzle.  What would be a good word for a person who tries to complete the puzzle?   'Taker' doesn't seem quite right.  An example is:  Winston was an enthusiastic ____ of crossword puzzles, especially the one in the Guardian.

What is the term for, or the name for, a person who enjoys solving word puzzles, crosswords, etc.?


How can I delete duplicate rows where no unique row id exists?  My table is  col1  col2 col3 col4 col5 col6 col7 john  1    1    1    1    1    1  john  1    1    1    1    1    1 sally 2    2    2    2    2    2 sally 2    2    2    2    2    2   I want to be left with the following after the duplicate removal:  john  1    1    1    1    1    1 sally 2    2    2    2    2    2   I've tried a few queries but I think they depend on having a row id as I don't get the desired result. For example:  DELETE FROM table WHERE col1 IN (     SELECT id     FROM table     GROUP BY id     HAVING (COUNT(col1) > 1) )

What is the best way to remove duplicate rows from a fairly large SQL Server table (i.e. 300,000+ rows)?  The rows, of course, will not be perfect duplicates because of the existence of the RowID identity field.  MyTable  RowID int not null identity(1,1) primary key, Col1 varchar(20) not null, Col2 varchar(2048) not null, Col3 tinyint not null


I am learning Android app development. I wanted a cheap tablet to test how apps looked on tablet as opposed to mobile. I bought a cheap tablet from wish.com. OK, stop laughing at that last bit... it seemed like a good idea at the time. What I received (and was subsequently refunded for), was a tablet that seems to be locked to only the Chinese app store that was already installed. I can't install Google Play (I have tried multiple versions), and therefore it is pretty useless to me. I did manage to install a version of Droid Info which pulled up various data, build number, kernel, Android version etc. Is there any way I can use that data to find, and flash the device with a clean version of Android that might work? This thing is good for nothing but the bin, otherwise. Appreciate any suggestions. UPDATE --- Screenshot below of what is displayed on the 'about this device' section of the OS settings. Hope that sheds some light on the device model.

There are several reasons to be looking for a ROM:   Upgrading or downgrading your stock ROM Looking for firmware from a different region/language Flashing a custom ROM for different features, removing bloat, etc.   But where can one find ROMs in the first place?  What sites are likely to have the ROM I need?  ; please add to the wiki answer instead of posting separate answers.  See also:


I just flagged a comment as it was no longer needed, over at The Workplace. After flagging, the new "Thanks for flagging" green dialog appeared, but it was positioned strangely (near the corner of the Top Bar), when I recall it appeared near the flag:    This happened to me on Firefox on my Ubuntu OS.  Note that this is not a duplicate, because the other question is only about the previous case where this happens only when the comment is automatically deleted, while this problem seems to be happening all the time, even when it's not automatically deleted.

For some comments, the comment is automatically deleted when you raise a flag. This includes certain keywords and short +1 comments. But when you raise that flag with the new comment flag interface, the "thanks for flagging" shows up in the top right when the comment is deleted:      As opposed to what happens when you raise a flag on a comment that doesn't auto-delete:


I have a script that will try to extract the file's base name and then I do additional work with it. Only when using this script with a file with this naming convention (including spaces and characters - not really sure what's triggering the error), do I get the basename extra operand error.   The file name: JERASH - XZ 837367432.pdf  Here the script once executed generates error:  filetimestamp=$(date "+%F-%T") timenow=$(date -u)      for file in files/input/*     do       printf "Break 1 \n"       #filename no extension:      filenamenopath=$(basename $file)      filenamenoext=${filenamenopath%.pdf}      printf "Break 2 \n"      #check if file is pdf       printf "File Name with No Path:" $filenamenopath      printf "Break 3 \n"   And here is the error:     Break 1  basename: extra operand ‘XZ’

Or, an introductory guide to robust filename handling and other string passing in shell scripts.  I wrote a shell script which works well most of the time. But it chokes on some inputs (e.g. on some file names).  I encountered a problem such as the following:   I have a file name containing a space hello world, and it was treated as two separate files hello and world. I have an input line with two consecutive spaces and they shrank to one in the input. Leading and trailing whitespace disappears from input lines. Sometimes, when the input contains one of the characters \[*?, they are replaced by some text which is is actually the name of files. There is an apostrophe ' (or a double quote ") in the input and things got weird after that point. There is a backslash in the input (or: I am using Cygwin and some of my file names have Windows-style \ separators).   What is going on and how do I fix it?


var   iMath, iAfr: integer; begin   if cbMath.checked then     iMath := sedMathf.value div sedmatho.value and iMath * sedmathm.value   else     sedAfrm.setfocus; end;   My variables do not want to be initialized, how can I prevent this or fix this?

I'm new to Delphi, and I've been running some tests to see what object variables and stack variables are initialized to by default:  TInstanceVariables = class   fBoolean: boolean; // always starts off as false   fInteger: integer; // always starts off as zero   fObject: TObject; // always starts off as nil end;   This is the behaviour I'm used to from other languages, but I'm wondering if it's safe to rely on it in Delphi?  For example, I'm wondering if it might depend on a compiler setting, or perhaps work differently on different machines.  Is it normal to rely on default initialized values for objects, or do you explicitly set all instance variables in the constructor?  As for stack (procedure-level) variables, my tests are showing that unitialized booleans are true, unitialized integers are 2129993264, and uninialized objects are just invalid pointers (i.e. not nil).  I'm guessing the norm is to always set procedure-level variables before accessing them?


I want every part have a new counter.  \documentclass[UTF8,10pt,a4paper]{article} \author{wsy} \title{test} \begin{document} \maketitle  \tableofcontents \part{part $1$} \section{part 1, section 1} \part{part $2$} \section{  how to make this section label become 1}  %(* now  it is 1 *) \end{document}

Some document elements (e.g., figures in the book class) are numbered per chapter (figure 1.1, 1.2, 2.1, ...). How can I achieve continuous numbering (figure 1, 2, 3, ...)?  And vice versa: Some document elements (e.g., figures in the article class) are numbered continuously. How can I achieve per-section numbering?  \documentclass{book}% for "vice versa" variant, replace `book` with `article`  \begin{document}  \chapter{foo}% for "vice versa" variant, replace `\chapter` with `\section`  \begin{figure} \centering \rule{1cm}{1cm}% placeholder for graphic \caption{A figure} \end{figure}  \end{document}   Bonus question: Is it possible to adjust the numbering of the sectioning headings themselves? Can I, e.g., switch from per-chapter to continuous numbering of sections in the book class?


If $x-\left\lfloor x \right\rfloor +\frac { 1 }{ x } -\left\lfloor \frac { 1 }{ x }  \right\rfloor =1$, then $x$ is irrational.  I am thinking of using the contrapositive: If $x$ is rational, then $x-\left\lfloor x \right\rfloor +\frac { 1 }{ x } -\left\lfloor \frac { 1 }{ x }  \right\rfloor \neq 1$  However, I don't know how I would approach this after that point. My first guess it to create a rational number, $\frac { a }{ b } $ such that $a,b\in\mathbb{Z}$, but I don't know how to manipulate it from there to get to the right hand side. I guess the floor function is throwing me off.   I would appreciate a hint/nudge in the right direction so that I can arrive at the solution by myself.

Prove : $$ \text{If } \; x-\lfloor x \rfloor + \frac{1}{x} - \left\lfloor \frac{1}{x} \right\rfloor = 1 \text{, then } x \text{ is irrational.}$$  I think the way to go here is to falsely assume that $x$ is rational, thus having $x=\frac mn$ with $m,n$ integers and go with that, we also know that $x$ with the celling belongs to the integers and that $\frac 1x$ with the celling gotta be a $0$. Still can't prove it. Thank in advance !


I want to search for files in an entire directory tree, but I don't want to see folders in the results. I want to see only files.  How can I exclude folders from showing up in the results under Windows Vista?

I've had some issues with the new search function in Windows 7. The Search in Windows XP was packed with so many more options. The only option I can access now are Date Modified and Size.  Any pointers to how to get more options in the Windows 7 Search, or links to external programs that can make my life easier?


I have used try - except and it works, but I was wondering if we can perform a similar function with for - if and else.  # check for "NA" values, ignore the entries which have them     # index: DeptTime = 4,Deptdelay = 15, Arrtime = 6, ArrDelay = 14     for index in flight_data[1:]:         try:             x_dept.append(int(index[4]))             y_dept.append(int(index[15]))             x_arr.append(int(index[6]))             y_arr.append(int(index[14]))          except ValueError:             pass   For instance, can we do something like this to get the exactly same answer?   # check for "NA" values, ignore the entries which have them         # index: DeptTime = 4,Deptdelay = 15, Arrtime = 6, ArrDelay = 14         for index in flight_data[1:]:             if index[4] =='NA' or index[15] == 'NA' or index[14] =='NA' or index[6] == 'NA':              pass              else:                 x_dept.append(int(index[4]))                 y_dept.append(int(index[15]))                 x_arr.append(int(index[6]))                 y_arr.append(int(index[14]))

I was recently teaching myself Python and discovered the LBYL/EAFP idioms with regards to error checking before code execution. In Python, it seems the accepted style is EAFP, and it seems to work well with the language.  LBYL (Look Before You Leap):  def safe_divide_1(x, y):     if y == 0:         print "Divide-by-0 attempt detected"         return None     else:         return x/y   EAFP (it's Easier to Ask Forgiveness than Permission):  def safe_divide_2(x, y):     try:         return x/y     except ZeroDivisionError:           print "Divide-by-0 attempt detected"         return None   My question is this: I had never even heard of using EAFP as the primary data validation construct, coming from a Java and C++ background. Is EAFP something that is wise to use in Java? Or is there too much overhead from exceptions? I know that there is only overhead when an exception is actually thrown, so I'm unsure as to why the simpler method of EAFP is not used. Is it just preference?


Say I have a decorator like this:  def repeat(repeat_count):     def decorator(func):         def wrapped(self):             for X in range(repeat_count):                  func() # Do Function         return wrapped     return decorator   and a class like this  class SomeClass(object):     def __init__(self, do_count):         self.some_method = repeat(do_count)(self.some_method)      def some_method(self):          print("I'm Doing Something")   Because a decorator just returns a method, it's clear that this works. However it unbinds the some_method function from the class instance, so I can no longer do something like:  >>> sc = SomeClass(10) >>> sc.some_method() # TypeError: wrapped() missing 1 required positional argument: 'self'   I get an exception because self is no longer automatically passed. To make this work I can simply do this:  sc.some_method(sc)   but I'd much rather not. Is there any way to rebind the method to the instance, preferably without any extra imports (as TypeMethod) would be able to accomplish.

I've read that it is possible to add a method to an existing object (i.e., not in the class definition) in Python.   I understand that it's not always good to do so. But how might one do this?


In particular, I have  $$\frac{\partial r}{\partial x} = \frac{\partial (x^2 + y^2 + z^2)^{1/2}}{\partial x} = \frac{x}{(x^2 + y^2 + z^2)^{1/2}}= \frac{x}{r}$$ does this mean $$\frac{\partial x}{\partial r} = \frac{r}{x}$$ ? If it is, can we safely assume that this is so for all partial derivatives?

In lectures we're told:  $$\dfrac {\partial y} {\partial x} = \dfrac 1 {\dfrac {\partial x} {\partial y}}$$  as long as the same variables are being held constant in each partial derivative.  The course is 'applied maths', i.e non-rigorous, so don't confuse me.  But anyway, if we have:  $$\xi = x - y \qquad \eta = x$$  Then $\dfrac {\partial x} {\partial \xi} = 0$ and $\dfrac {\partial \xi} {\partial x} = 1$.  The rule presumably fails because one of the partial derivatives is $0$.  But then isn't this rule useless? Since I cannot use it without checking that the partial derivative isn't in fact $0$, but then I've worked out the partial derivative manually anyway.


Example: If we are inserting 10 records in an object, Where 5 records are correct and the remaining 5 records are incorrect.     •   In Database.insert 5 records will be inserted, remaining 5 records will be failed.(i.e. Partial DML Operation).      (record.addError is in after insert trigger.)     (no workflows, flows, or process builder on that object       or validation rules)  Assumption: database.insert goes first time through trigger and in the end of after insert trigger we can do soql and see 10 records ids and etc.(they are not committed yet) then before commit to DB occurs error and system starts again insertion(now only of the correct records) and in trigger goes these 5 correct records(so it goes to trigger the second time) and process continues till the end.  Question: tell me please is that correct? (before answer check please :) ).

I've been trying to leverage custom roll up functionality and found that Database methods is perfoming dml twice. First time it's inserting/updating all records and second time only ones that can be processed. Is it correct? I'm afraid that I'm missing important part in documentation     The optional allOrNone parameter specifies whether the operation allows partial success. If you specify false for this parameter and a record fails, the remainder of the DML operation can still succeed. This method returns a result object that can be used to verify which records succeeded, which failed, and why.   Since I've placed static boolean to check if trigger has been run, I'm loosing data.  If we create test based on the following    @isTest public class Test_accountTrigger {     @isTest     static void Test_saveResult() {         Account[] accts = new List<Account>{             new Account(Name='Account1'),             new Account()};         Database.SaveResult[] srList = Database.insert(accts, false);     } }   Given trigger will be executed twice  trigger accountTrigger on Account (before insert) {     system.debug('accountTrigger.sise: ' + trigger.new.size()); }   Debug  22:25:31.1 (362723328)|USER_DEBUG|[2]|DEBUG|accountTrigger.sise: 2 22:25:31.1 (498071498)|USER_DEBUG|[2]|DEBUG|accountTrigger.sise: 1   I'm trying to update multiple child records within ETL and inside Salesforce update correspondent Parent records with flag allOrNone set to false. If any of those fails I'm adding error to child record. Since I have static boolean check, my first attempt of updating parent records is reverted and second is never happened.


GPG error: http://ppa.launchpad.net vivid Release: The following signatures couldn't be verified because the public key is not available:       NO_PUBKEY 09589874801DF724

I added some extra repositories with the Software Sources program. But when I reload the package database, I get an error like the following:     W: GPG error:  trusty InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 8BAF9A6F   I know I can fix it using apt-key in a terminal, according to the official Ubuntu documentation. But I would have liked to do it graphically. Is there a way to do this without using a terminal?


I encountered in the literature the term zero-dimensional ideal, however I can not find a relevant definition anywhere in Atiyah-MacDonald or Matsumura. In fact, I encounted the statement:      $I$ is a zero-dimensional ideal of $k[x_1,\dots,x_n]$ $\Leftrightarrow$ $k[x_1,\dots,x_n]/I$ is a finite-dimensional $k$-vector space, where we assume that $k$ is algebraically closed.   Question 1: What is the definition of the dimension of an ideal?  Question 2: How do we prove the above statement?  Question 3: Is $k$ being algebraically closed a necessary condition for the statement to be true?

Let $K$ be a field and $A$ an affine $K$-algebra. Show that $A$ has (Krull) dimension zero (is artinian) if and only if it is finite dimensional over $K$.


how can I deploy a sharepoint page using xml modules, with content already inside the publishing page content field? Any examples I can use?

I have create page layout and uploaded it to the master page gallery in a module, now I want to create a publishing page from this page layout, I know I should use a module and upload an .aspx page to the pages library. But what's the content of this .aspx page will be? for my page layout I know the exact html and everything, but for my publishing page what should I write inside? should I create an .aspx page with minimal html?


I've seen many articles on DDoS protection, but none work. I need protection for a socket server i'm running on the server. It's running on port 9876 and it's for a flash-based game. when it gets attacked, the whole dedicated server goes offline for a few minutes. I have CSF firewall installed, and I tried configuring the portflood settings, but nothing helped.   my question is: how can I stop or slow down attacks on port 9876, it is NOT a webserver. it is a socket server written in PHP. I also have another one running on 9875 that is in python, but either way, how can I stop or slow down attacks??

This is a  about DoS and DDoS mitigation.   I found a massive traffic spike on a website that I host today; I am getting thousands of connections a second and I see I'm using all 100Mbps of my available bandwidth.  Nobody can access my site because all the requests time out, and I can't even log into the server because SSH times out too!  This has happened a couple times before, and each time it's lasted a couple hours and gone away on its own.  Occasionally, my website has another distinct but related problem: my server's load average (which is usually around .25) rockets up to 20 or more and nobody can access my site just the same as the other case.  It also goes away after a few hours.  Restarting my server doesn't help; what can I do to make my site accessible again, and what is happening?  Relatedly, I found once that for a day or two, every time I started my service, it got a connection from a particular IP address and then crashed.  As soon as I started it up again, this happened again and it crashed again.  How is that similar, and what can I do about it?


What will happen if you drive a car at the speed of light and keep headlights on?   Will it be behind the car or just work like normal?

If a car is travelling faster than the speed of light, do the headlights still work?  If you can help because i really need to know i am going on a trip with my car tomorrow!


I have a weard problem. I have two seperate files, with absolutely same code, one with problem, one without.  code:   <?php  $kll="šžćčš";  ?>  <html xmlns="http://www.w3.org/1999/xhtml">  <head>  <!-- Meta Tags --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta name="description" content="" />  <!-- END head --> </head> <!-- BEGIN body -->  <body>  <?php echo $kll; ?>  </body>    Now, when rendered it should output simple result as: šžćčš, but in one file it doesnt, it outputs: �����  What bugs me is that the code is absolutely the same for both files. You can check it out:   (bad one)  (good one)  Any help please? Thank you

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 just got a brand new dell XPS 13 and I went to set it up. I typed in the wifi password and realized I got it wrong. So I ended up hitting a button in the bottom right corner. For some reason it reset the computer and when it booted back up, it didn't save any of my info and I'm stuck with the guest account.   I don't have any internet connection in the guest account and can't set it up. What can I do to create an account and have full control of my laptop? The guest account won't allow me to create a new account.

I'm working on a Ubuntu system, and my client has completely forgotten his administrative password. He doesn't even remember entering one; however it is there.  I've tried the suggestions on the website, and I have been unsuccessful in deleting the password so that I can download applets required for running some files. Is there a solution?


I am trying to gain a better understanding about states of matter, the last paragraph is the most important one to be answered.  It is my understanding that when a solid is dissolved into a liquid, at least some of it is individual molecules or atoms are are not attached to other molecules and atoms of the same type, instead they are completely separate, not part of any solid structure. In that situation, are those molecules or atoms a solid, a liquid or something else?  Additionally, if I have an individual atom or molecule in a vacuum, which at that temperature and pressure would normally be solid, is it still considered a solid? What if that single atom or molecule would be a liquid at that temperature and pressure, is it still considered a liquid?  Is there something fundamental about the state of an atom or molecule that, independently of other atoms or molecules of the same type, determines if it is in a solid, liquid or gas state (plasma I understand)? Are there observations, tests or measurements (other than temperature) that could be applied to an individual atom or molecule in a vacuum that could be used to test its state (perhaps how it reacts chemically with other substances, perhaps how it interacts mechanically with other substances, how it moves, perhaps how it responds to radiation)?

If the walls of the box were made of a completely inert material, what state of matter would the atom be in? Or would it not have one? I realized this is a duplicate of several other questions.


So, for the 4th time now, all process tools on my mac stopped working (top, pgrep, kill, Activity Monitor, etc).  I can't find a pattern nor any log on what's causing it.  When it happens, iTerm freezes and I can't open other terminal apps. I can start a terminal through VisualStudio Code though.  I tried to use ps, top et al to find what is wrong, but the commands never output anything (seems like they "freeze" or something).  Activity Monitor don't show any processes at all.  The only way to "fix" the issue is to reboot, which I dislike (if I where to reboot to fix things I would use windows xp).  So, I don't know what to do or where to look. Has anyone ever seen anything like this? What can I do?    EDIT:   macOS 10.13.2   EDIT2:  I didn't have htop opened when the issue happened, so I don't think it is related to the htop question  EDIT3:  Just rebooted my mac and I indeed had a tab open with htop running. So it is probably the same thing.

Since the upgrade to High Sierra my MacBook is crashing regularly in a catastrophic way that forces me to trigger a hard reset every time.  I suspect  being the culprit, but I can't tell for sure.  This is what happened about half a dozen times now:  I'm working in either iTerm2 or the Terminal app. Suddenly and seemingly at random iTerm2/Terminal crashes. I'm still able to Force Quit it then.  But then the whole system is left in a really messed up state where I can't start any Apps anymore. Even worse, triggering a restart won't succeed in shutting down the system. My only option left then is to hard-reset the MacBook.  First I suspected iTerm2 and used the Terminal app instead. But exactly the same thing then also happened using the latter. It does not seem to be connected to anything particular I'm doing in the Terminal.  I do have the habit though to always have an instance of htop (version 2.0.2, installed via brew install htop) running in some terminal pane to be able to conveniently monitor processes and CPU/Memory usage while I'm working.  So a running htop instance is the only common precondition for the crashes I can identify.  Because I don't know how to further encircle this problem, I resort to asking here:  Is anyone else experiencing (similar) problems with running htop on High Sierra? And does anyone maybe even have a solution for this?  Suggestions about what I could do to get to the bottom of this would also be very welcome.


This question is here just to avoid you choosing the wrong Ubuntu version number.  So, this is not about:     nor about   nor   nor   nor   nor .   So in the answer below a simple guide as to what Ubuntu version is good for you, independent of future releases!

What's the meaning of the numbering for different versions? Do they signify something?


Why didn't dd make a bootable Windows USB stick?  Has anyone tried to burn a Windows 7 USB installer in Ubuntu?  Usually I run dd to burn linux ISOs, and I thought it would work for Windows 7, but the stick I burned with dd doesn't boot up on my Thinkpad T42.  The dd command ran successfully, so why didn't it work? Do you think the boot information wasn't recorded into the USB stick correctly?  dd if=SW_DVD5_Win_Pro_7w_SP1_32BIT_ChnSimp_-2_MLF_X17-59520.ISO of=/dev/sdb bs=1M

I'd like to create a Windows bootable USB stick, but I don't have a Windows machine with me at the moment to do so. How could I achieve the same using Ubuntu?


Competent wizards, (as Voldemort clearly is) can effectively cast spells without speaking.  Dumbledore does this to reveal Harry under his invisibility cloak:     J.K. Rowling: Dumbledore, who could perform magic without needing to say the incantation aloud, was using ‘homenum revelio’   Why does Voldemort always say 'Avada Kedavra' when casting the spell?

Snape is a powerful wizard, who is capable of casting spells non-verbally. And, we know that even complex spells like Avada Kedavra can be cast non-verbally. Using non-verbal magic should have been second nature to Snape.  However, when Snape cast Avada Kedavra on Dumbledore, he did speak the name of the spell. Is there any reason why chose to cast a verbal spell here, when we would normally expect him not to?  Shouldn't the act of casting verbally have alerted the Death Eaters that something was up, possibly to his wish not to kill Dumbledore?


I noticed last night whilst checking our active sessions list on our firewall for something else, that a server was generating outbound IRC connections.  Last night there was around 60 connections but this morning it's much less.  [root@prod12 ~]# netstat -nputw | grep 6667 tcp        0      1 10.109.131.20:44242         66.198.80.67:6667                SENT    4280/bash tcp        0      1 10.109.131.20:46549         208.64.123.210:6667              SENT    4280/bash tcp        0      1 10.109.131.20:35862         208.83.20.130:6667               SENT    4280/bash [root@prod12 ~]#   There is nothing IRC related on this server intentionally. Does anyone know what virus or whatnot this looks like so that I can search online for removal?

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


I am working on a python program that involves coin flips. How can I get a python program to list out all possibly combinations of 4 coin flips?  So I want the program to output:  HHHH,  HHHT,  HHTT, etc.  Thanks in advance!

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


Was anyone able to explain why $$E(U_2) = 0$$   I don't quite understand what the relevance of the underlined statement - "by the symmetry of $U_1$" in determining $E(U_2)$ is   edit: I get it now, was brain dead on the night of asking this question. thanks for the responses anyway

What's the definition of a symmetric distribution? Someone told me that a random variable $X$ came from a symmetric distribution if and only if $X$ and $-X$ has the same distribution. But I think this definition is partly true. Because I can present a counterexample $X\sim N(\mu,\sigma^{2})$ and $\mu\neq0$.  Obviously, it has a symmetric distribution, but $X$ and $-X$ have different distribution! Am I right? Do you guys ever think about this question? What's the exact definition of symmetric distribution?


I've just learnt about the contour integral of a complex function, but I'm having trouble figuring out what it is calculating visually. I understand it is somewhat analogous to the line integral for real functions so should I be thinking about it like the $\mathbb{R}^2 \rightarrow \mathbb{R} $  version of that (as the complex plane is isomorphic to $ \mathbb{R}^2)? $

In normal line integration, from what I understand, you are measuring the area underneath $f(x,y)$ along a curve in the $x\text{-}y$ plane from point $a$ to point $b$.  But what is being measured with complex line integration, when you go from a point $z_1$ to a point $z_2$ in the complex plane?  With regular line integration I can see $f(x,y)$ maps $(x,y)$ to a point on the $z$ axis directly above above/below $(x,y)$.  But in the complex case, when you map from the domain $Z$ to the image $W$, you are mapping from $\mathbb{R^2}$ to $\mathbb{R^2}$ ...it is not mapping a point to 'directly above/below'...so I don't have any intuition of what is happening with complex line integration.


You've got a discrete uniform distribution - what is the expected number of trials until each point is hit at least once?  I started my thinking with maybe a Geometric distribution representing each individual point - if your probability of success is 1/100 in the uniform distribution, then would the number of trials until first success be 100? That is for one point so to have 100 points = 10000 trials until you hit 100 points?? That doesn't sound right, because if you fail to hit one specific point, you've succeeded in hitting a different point, so it's not exactly a matter of first success at one point. What am I missing?  Follow up question: how about after 100 trials, what percentage of points are expected to have been hit?

What is the average number of times it would it take to roll a fair 6-sided die and get all numbers on the die?  The order in which the numbers appear does not matter.  I had this questions explained to me by a professor (not math professor), but it was not clear in the explanation.  We were given the answer $(1-(\frac56)^n)^6 = .5$ or $n = 12.152$  Can someone please explain this to me, possibly with a link to a general topic?


I've been wondering how to do this for a while but I couldn't find anything that gave me answers. I'm trying to make a realistic-ish model but I don't know how to round the edges.

I have looked at other similar questions on this site but couldn't answer my question. I have a model made of cubes the edges look very sharp (I would put a picture here but I don't have the required rep) is there a simple way to make the edges round?


It's my first time using ubuntu so I don't know how to use it very well yet... How can i install python 3.5.2 ? It has already the version 2.7.12 . My Ubuntu version is Ubuntu 16.04 LTS (desktop).

I'm looking to pick up some programming skills and after looking into it a bit, I came across an article that recommended that I learn Python as a way of getting started at programming before moving on to other languages. I realize Python 2.x.x is preinstalled in Ubuntu, but I was wondering if it's possible to upgrade to Python 3.x.x as the site's documentation seems to indicate that 3.x.x is where the language is going in the future.  Failing that, how do I update Python 2.7.6 to 2.7.8?


These are given conditions. n(=the number of observations) = 60 . Sample mean is 2.1 Then I want to calculate 95% Confidence Interval of lamda, which is a mean of Poisson distribution. I Know that Central limit Theorem must be used. But I want to solve this question conveniently by using R. Is there a method to make my feeling cool?

Would like to know how confident I can be in my $\lambda$. Anyone know of a way to set upper and lower confidence levels for a Poisson distribution?    Observations ($n$) = 88  Sample mean ($\lambda$) = 47.18182   what would the 95% confidence look like for this?


In my application I am running the same winform in different contexts to control visibility of buttons, enabeling of text fields and the winform header text. The way I decided to do this is simply by passing a string to the form constructor and check it with a couple of if statements that in turn contain the desired winform tweaks.  if (formContext == "add") {     Text = "Add member"; } if (formContext == "edit") {     Text = "Change role";     userTextBox.Enabled = false;     searchButton.Visible = false; }   This works fine, however the "Text" keywords get a blue squigly line added by ReSharper with the following message: Viritual member call in constructor. Is this a potential problem or just some sort of overly enthusiastic ReSharper message.   Any clarification or suggestions for improvement of my implementation would be much appreciated.

I'm getting a warning from ReSharper about a call to a virtual member from my objects constructor.   Why would this be something not to do?


How can I find the complete path of the INPUT (r_in_name) and OUTPUT (r_out_name) rasters for the gdal datasets in the following code: from qgis.processing import alg from qgis.core import QgsFeature, QgsFeatureSink import numpy as np from osgeo import gdal, gdal_array, osr @alg(name="quantilizearaster", label=alg.tr("Quantilize a raster)"), group="rastertools", group_label=alg.tr("Raster Tools")) @alg.input(type=alg.RASTER_LAYER, name="INPUT", label="Input layer") @alg.input(type=alg.RASTER_LAYER, name="OUTPUT", label="Output layer") def quantilize(instance, parameters, context, feedback, inputs):     """     This algorithm takes an INPUT raster and quantilize its values in five classes; result is a quantilized OUTPUT raster.     """  source = instance.parameterAsRasterLayer(parameters, "INPUT", context) output_raster = instance.parameterAsRasterLayer(parameters, "OUTPUT", context)  r_in_name =   # r_in_name must be a string of the complete path to the INPUT raster, including its file name (*.tif) r_out_name =  # r_out_name may be a temporary OUTPUT raster file       dataset = gdal.Open(r_in_name)     band = dataset.GetRasterBand(1) nodata = band.GetNoDataValue() array = dataset.ReadAsArray()  new_array = array nan_array = array  nan_array[array == nodata] = np.nan  percentile_80 = np.nanpercentile(nan_array, 80) percentile_60 = np.nanpercentile(nan_array, 60) percentile_40 = np.nanpercentile(nan_array, 40) percentile_20 = np.nanpercentile(nan_array, 20) percentile_0 = np.nanpercentile(nan_array, 0)  for i, v in enumerate(new_array):     for j, element in enumerate(v):         if element > percentile_0 and element <= percentile_20:             new_array[i,j] = 1         if element > percentile_20 and element <= percentile_40:             new_array[i,j] = 2         if element > percentile_40 and element <= percentile_60:             new_array[i,j] = 3         if element > percentile_60 and element <= percentile_80:             new_array[i,j] = 4         if element > percentile_80:             new_array[i,j] = 5  new_array[ new_array != new_array ] = nodata  geotransform = dataset.GetGeoTransform() wkt = dataset.GetProjection()  # Create gtif file  driver = gdal.GetDriverByName("GTiff") output_file = r_out_name  # r_out_name may be a temporary OUTPUT raster file  dst_ds = driver.Create(output_file,                        band.XSize,                        band.YSize,                        1,                        gdal.GDT_Int16)  #writting output raster dst_ds.GetRasterBand(1).WriteArray( new_array ) #setting nodata value dst_ds.GetRasterBand(1).SetNoDataValue(nodata) #setting extension of output raster # top left x, w-e pixel resolution, rotation, top left y, rotation, n-s pixel resolution dst_ds.SetGeoTransform(geotransform) # setting spatial reference of output raster srs = osr.SpatialReference() srs.ImportFromWkt(wkt) dst_ds.SetProjection( srs.ExportToWkt() ) #Close output raster dataset  dataset = None dst_ds = None   return

I am generating new raster files from vector layers on a project. I would like to save them in the same directory as the project or layer files.   How do I find this path using PyQGIS?


I have a problem understanding when the default constructor of a class member is called. My class MyClass has a member of class Reader. In the constructor of MyClass I need to call the constructor of Reader and catch an Exception in case it fails. Because in the rest of MyClass's functions, I need to know if it was instantiated successfully and if I can use it. I know that I can call the default constructor in the initializer list. But when do I call it in the constructor? What's the common approach here?  class MyClass { public:     MyClass() {         hasReader = true;         try{             //Call Reader constructor here         }         catch(Exception)         {             hasReader = false;         }     }  protected:     Reader mReader;     bool hasReader; };  class Reader { public:     Reader()     {         bConnected = true;         if (something fails)         {             bConnected = false;                throw new Exception();         }     }  protected:     bool bConnected; };

Here's a curious one. I have a class A. It has an item of class B, which I want to initialize in the constructor of A using an initializer list, like so:  class A {     public:     A(const B& b): mB(b) { };      private:     B mB; };   Is there a way to catch exceptions that might be thrown by mB's copy-constructor while still using the initializer list method? Or would I have to initialize mB within the constructor's braces in order to have a try/catch?


I need to create an empty binary file with given size in java. What is the fastest way to do this? I also need to update UI simultaneously. I use following code to do this. But it’s not very fast. Can everyone help me? Tnx  public static void create(String pathAndName, int fileSize) {     FileOutputStream fileOutputStream = null;     try {       fileOutputStream = new FileOutputStream(pathAndName);       int length = 10 * 1024;       byte[] buffer = new byte[length];       int len = buffer.length;       int createdSize = 0;        int percent = 0;       int lastPercent = 0;        while (createdSize < fileSize) {         createdSize += length;         if (createdSize > fileSize) {           len = fileSize - (createdSize - length);         }         lastPercent = percent;         percent = (int) (((double) createdsize / fileSize) * 100);         if(lastPercent != percent){           updateUI(percent);         }         fileOutputStream.write(buffer, 0, len);       }      } catch (Exception e) {       e.printStackTrace();     }     if (fileOutputStream != null) {       try {         fileOutputStream.close();       } catch (IOException e) {         e.printStackTrace();       }     }   }

Is there an efficient way to create a file with a given size in Java?  In C it can be done with  (see ).   Most people would just write n dummy bytes into the file, but there must be a faster way. I'm thinking of  and also of …


I am completely not a computer expert but I would like to download Ubuntu. I have windows 10 currently and would like to keep it alongside with Ubuntu. How can I make this happen?

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


I've been googling this and all I find is that the glitch world is random whenever you die, and it was recommended to go onto world 1-3 and keep suiciding to activate it.  I've been suiciding over and over probably 100+ times and she hasn't glitched a single time.  I've 100%'d the chapter, i.e. all worlds A+ and all bandages, but I can't seem to get her to glitch so that I can try the glitch world. Any ideas? I've read posts saying she does it after <10 deaths unusually, so my 100+ suiciding seems a bit excessive.

While playing one of the dark world stages in Level 1 of Super Meat Boy, I reached the end of the stage after dying several times. However, Band-Aid Girl, instead of doing her normal crying animation, was messed up in appearance: glitchy and spinning around. Though I initially hesitated, I brought myself to touch her and complete the level, only to find myself in World -1. This stage was quite difficult and featured arcade-style play with only three lives as with the world zones. When I got game over and went back to the map screen, this stage was now accessible as a stage before the first stage of the Forest light world stages.  I managed to unlock the same sort of stage in the Salt Factory world.  I'm guessing that there are six of these, one for each of the normal worlds as well as the secret world. But I'm still not sure as to how I go about unlocking them.  Under what circumstances does Band-Aid Girl become glitched up, allowing me to unlock the negative levels? Is it determined by chance or do I have to die/not die a certain number of times to get her to become glitchy? Does this only occur on certain levels?


I have two Mac book Pros:    A 2013 Unibody retina that I use every day An older 2006 model with removable battery that I use a couple of times a month (when not in use, it's not connected to the AC. I recently replaced the battery, as the old one swelled apart).   I use them as desktop replacements, so I don't use the battery that often.   What's the best way to prolong battery lifespan? - If keeping the machines hooked up to the AC is a bad idea, then for how many hours each day should I use the battery?    Here is my research: There's a lot of conflicting advice.   Calibration  A lot of sources, say you should calibrate the battery by letting it run down to 0% each month. For example, this , this  article. All these articles were written in 2013/12 and cite Apple.com as the source for this advice.  However, the  page makes no reference to calibration. Is this because calibration is a bad idea, or is it because Apple no longer sells devices with removable batteries and so the advice is different?  Deep discharge  Other sources, such as this  question, imply that letting the battery drain is a bad idea, so using the AC whenever possible is actually a good thing.   Please note I am talking about the overall battery life span (e.g. the time the battery has before it needs to be replaced) and not increasing the day-to-day hours of the battery.

My friend told me that I need to disconnect the power cord when the battery is fully charged. Otherwise, I will shorten the life of the battery.  Other people say you should drain it once a month or point out that for long term storage, you should charge it to 50% and then periodically (3 to 6 months) bring it back to 50% and store it again.  I am going to use my laptop at home 90% of the time. So, I plan to have the power cord connected all the time.  I'd prefer to just plugging in my MacBook Pro and letting it be on charge long term and occasionally taking it away from the charger when I'm not at home or my desk.  Are these specific recommendations worth the inconvenience?


Is there a difference between "can't you" and "don't you"? As in:     You just can't behave properly, can't you?   vs.     You just can't behave properly, don't you?   I don't understand their difference (if there is).

I want to ask about two sentences, and what would be the correct way to form a question:   It's very important that we eat healthy food, ...........?  Which would be the correct question tag: (isn't it) or (don't we)? It's a must that all applicants follow the rules of the competition, ..........?  Which would the correct question tag: (don't they) or (mustn't they)?   Please could you tell me the correct answers, and, more importantly, why those are correct?


Consider the position and momentum operators $\hat q$ and $\hat p$, defined respectively in terms of creation and destruction operators in the usual way: $$ \hat q = c (\hat a + \hat a^\dagger), \qquad \hat p = \frac{i\hbar}{2c} ( \hat a^\dagger - \hat a), \tag 1 $$ for some constant $c$, where $\hat a$ and $\hat a^\dagger$ satisfy the canonical commutation relations: $$ [\hat a, \hat a^\dagger] = 1, \qquad [\hat a,\hat a] = [\hat a^\dagger, \hat a^\dagger] = 0. \tag 2$$ If follows immediately that, as expected, $[\hat q, \hat p] = i \hbar$.  My question is now: starting from these definitions of $\hat p$ and $\hat q$, how can I derive the common relation $\hat p = -i \hbar \frac{\partial}{\partial q}$, or some equivalent version of this relation? In other words, how can I compute the value of $\langle q | \hat p| \psi \rangle$, or equivalently of $\langle q| \hat p | q' \rangle$?  If I try to simply compute this using the definition of $\hat p$ given in (1) I get nonsensical results, I'm gessing because of $|q \rangle$ being not normalized eigenstates. What method should then be used in this context?

I have a question about deriving the coordinate representation of momentum operator from the commutation relation, $[x,p]= i$.  One derivation (ref W. Greiner's Quantum Mechanics: An Introduction, 4th edi, p442) is as following: $$ \langle x|[x,p]|y \rangle = \langle x|xp-px|y \rangle = (x-y) \langle x|p|y \rangle. $$ On the other hand,  $ \langle x|[x,p]|y \rangle = i \langle x|y \rangle = i \delta (x-y)$. Thus $$ (x-y) \langle x|p|y \rangle = i \delta(x-y). \tag{1} $$  We use $(x-y) \delta(x-y) = 0$. Take the derivative with respect to $x$; we have $\delta(x-y) + (x-y) \delta'(x-y) = 0$. Thus $$ (x-y) \delta'(x-y) = - \delta(x-y). \tag{2} $$  Comparing Eqs. (1) and (2), we identify $$ \langle x|p|y \rangle = -i \delta'(x-y). \tag{3} $$  In addition, we can add $\alpha \delta(x-y)$ on the right-hand side of Eq. (3), i.e. $$ \langle x|p|y \rangle = -i \delta'(x-y)  + \alpha \delta(x-y), $$ and $[x,p] = i$ is still satisfied. We can also add $$ \frac{\beta}{\sqrt{|x-y|}}\delta(x-y)$$ on the RHS of Eq. (3).  Here $\alpha$ and $\beta$ are two real numbers.  My question is, what is the most general expression of $\langle x|p|y \rangle$? Can we always absorb the additional term into a phase factor like Dirac's quantum mechanics book did?  Thank you very much in advance.


Question: Is it possible to find, locate, or install the windows 10 boot manager through the grub 2 command line? If so, what are those commands? I cannot boot into windows of course and i can not enter ubuntu either. If the questions above are not possible, what are my options? I only want/need windows. Situation: I have a dual boot (windows 10 & Ubuntu) installation on my laptop HDD, and no longer wanted to keep ubuntu on my hdd. I wanted to erase all trace of ubuntu so that i could safely transfer data to an ssd. So Naturally, as someone new to linux, i thought it made sense to simply delete the linux partition from Windows’ Disk Manager since windows was (pre)installed first. Then migrate the data over to the clean ssd. Problem: After deleting the linux partition and extending the c drive to take over unallocated space, I can no longer boot windows. As soon as i turn on my laptop, the GNU GRUB ver 2.04 shows up. In the command line it displays: “grub> ” (It is Not grub rescue) Typing “exit” simply brings me back to the same screen. The UEFI menu that i have doesnt have any option change the boot back to windows bootmgr. I dont have a windows installation disk, or any external windows backup device that was recommended. And I dont currently have but could make another ubuntu live usb, if necessary. But it would be cool if i could do this in grub Neither the hdd nor the ssd can boot windows nor ubuntu. But both devices bring up the GRUB> command line. I now know that data migration moves everything except the boot manager itself. Ive also learned that installing ubuntu gave the booting reigns to ubuntu and took that control away from windows. Which is why uninstalling ubuntu from windows caused this issue.. So my question is, since ubuntu is gone, is windows boot manager also erased? Or is it possible to locate it through GRUB?

I have absolutely no experience with Linux, and I desperately need to get my computer back up and running again with Windows.  How do I remove Ubuntu and reinstall Windows?    Editor's note: many of the answers are about removing Ubuntu from dual-boot but keeping Windows (which is a bit complicated), while other answers are about removing Ubuntu from single-boot (which is easy: basically just format the disk while installing Windows). The question as written is ambiguous between dual-boot or single-boot.


Let X be a nonsingular variety of dim n over an algebraically closed field k. Let Y be an irreducible closed subscheme defined by a sheaf of ideals $\mathscr I$.  Then I want to prove that  Y is a nonsingular variety over k iff  (1)  $ \Omega_{Y/k}  $ is locally free, and  (2) the sequence $ 0 \rightarrow \mathscr I/\mathscr I^2  \rightarrow \Omega_{X/k} \otimes \mathcal O_Y \rightarrow \Omega_{Y/k} \rightarrow 0 $ is exact.   This is a theorem from Hartshorne's Algebraic Geometry (Chapter II, theorem 8.17).Assuming (1) and (2) and proving Y is nonsingular is okay. But the other way is not clear.  So I will assume Y is nonsingular.  The subdivision (1) follows directly as Y is nonsingular (In fact  $ \Omega_{Y/k}  $ will be locally free of rank q = dim Y)  . But am not able to do the 2nd subdivision.  We have the following exact sequence $ \mathscr I/\mathscr I^2  \rightarrow \Omega_{X/k} \otimes \mathcal O_Y \rightarrow \Omega_{Y/k} \rightarrow 0 $ (which is called the second exact sequence in literature). Let us name the map  $ \mathscr I/\mathscr I^2  \rightarrow \Omega_{X/k} \otimes \mathcal O_Y $ as $ \delta $ and the map $\Omega_{X/k} \otimes \mathcal O_Y \rightarrow \Omega_{Y/k}  $ as $ \phi $.  My aim is to prove that $\delta$ is injective. I will mimic the proof of Hartshorne and try to tell what I have not understood there-  Let y $\in$ Y be a closed point. Then ker $\phi$ is locally free of rank r= (n-q) at y, so it is possible to choose sections $ x_1, x_2,...x_r \in \mathscr I $ in a suitable neighbourhood of y, such that $dx_1,dx_2,...,dx_r$ generate ker $\phi$  (This is because X is nonsingular, so $\Omega_{X/k} \otimes \mathcal O_Y $ is locally free $ \mathcal O_Y $- module of rank n, and Y is nonsingular,  so $\Omega_{Y/k}$ is locally free $\mathcal O_Y$-module of rank q). Let $\mathscr I'$ be the ideal sheaf generated by $   x_1, x_2,...x_r $, and Y' be the corresponding closed subscheme.   So far everything is fine. Now he says- By construction. the $dx_1,dx_2,...,dx_r$ generate a free subsheaf of rank r of $\Omega_{X/k} \otimes \mathcal O_{Y'} $ in a neighbourhood of y. I don't understand why $dx_1,dx_2,...,dx_r$ generate a free subsheaf of rank r of $\Omega_{X/k} \otimes \mathcal O_{Y'} $ in a neighbourhood of y? This is my first question.  Now suppose we assume this. It follows that in the exact sequence for Y' $ \mathscr I'/\mathscr I'^2  \rightarrow \Omega_{X/k} \otimes \mathcal O_{Y'} \rightarrow \Omega_{Y'/k} \rightarrow 0 $, we have $\delta $  injective ( Here also $\delta$ is the map $ \mathscr I'/\mathscr I'^2  \rightarrow \Omega_{X/k} \otimes \mathcal O_{Y'}$ and it is injective  because its image is free), and $\delta $ is injective says that this is a short exact sequence and $ \mathscr I'/\mathscr I'^2 $ becomes locally free. So $\Omega_{Y'/k}$ also becomes locally free of rank (n-r).  Now he says that the previous part of the proof shows that Y' is irreducible and nonsingular. But according to me the previous part assumes irreducibility and proves nonsingularity.. I am not able to conclude that Y' is irreducible from the above data. This is my second question. Can any one please help?

I can't understand the proof of theorem 8.17 from Hartshorne's "Algebraic Geometry". Namely, he says that we have an exact sequence  $$ 0 \to \mathcal J'/\mathcal J'^2 \to \Omega_{X/k} \otimes \mathcal O_{Y'} \to \Omega_{Y'/k} \to 0  $$ and there are $x_1, \dots,x_r$ such that $dx_1, \dots, dx_r$ generate a free subsheaf of rank $r$ in a neighborhood of $y \in Y$. It follows that $\Omega_{Y'/k}$ is locally free. Why?


In this I want that scanner is run continuously, when check out the words no sequence from list and type them. The problem is that after the first scanner is completed, the next one does not work. How can to do this programm that it works continuously?. Thanks.   System.out.println("Check out one of the names: John, Mike, Nick:");      Scanner s=new Scanner(System.in);     String a=s.nextLine();     if(a.equals("John"){     System.out.println("This is John");     }      a=s.nextLine();     if(a.equals("Mike"){     System.out.println("This is Mike");     }      a=s.nextLine();     if(a.equals("Nick")){     System.out.println("This is Nick");     }

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?


After the latest update of windows the the windows search is not working tried resetting the computer but the after few minutes again search engine stopped working again.

The Search menu on my Windows 10 suddenly stopped working. When I click the Search icon or type something in the Start menu, it just shows a blank search window.    I've tried rebuilding the index, SFC /scannow, DISM Restore, and creating a new local user account. None of them worked.   Windows 10 1909 build 18363.592.


Assuming $M^{\perp} = \{ f \in X^* : f(M) = 0 \}$  how can we show that $M^{\perp}$ is isometric to $(X/M)^*$?

Let $X$ be a normed space and $Y$ a closed subspace of $X$ and $Y^0=\{f \in X^*|f(x)=0,\forall y \in Y\}$.  Prove that $Y^0$ is isometricaly isomorphic with $(X/Y)^*$.  I have to find  a function specifically between $Y^0 $ and $(X/Y)^*$.  One idea is the function $S: Y^0 \longrightarrow (X/Y)^*$ such that $S_{f}(x+Y)=f(x)$ but i have a difficult time to proved that it is bounded and an isometry.  Can someone help me please or give another idea for an bijection?  Thnak you in advance.


I was going through the difference between inheritance and composition. Everyone has praised composition over inheritance, so questions is how do we make choice ? Also if we didn't use inheritance at all then what are we going to miss as per OOP principal ?

Why prefer composition over inheritance?  What trade-offs are there for each approach?  When should you choose inheritance over composition?


The definition of a Hilbert space is a complete inner product space. I am struggling to imagine what an incomplete inner product space would look like, especially since inner products by definition must be maps on vector spaces whose scalar fields are either $\mathbb R$ or $\mathbb C$. Since $\mathbb R$ and $\mathbb C$ are complete and inner products are (sesqui)linear, it seems that any inner product must be complete. Is the definition of Hilbert space redundant?  In short, what's an example of an inner product space that is not complete?  It seems one of the following must be the case:   All inner product spaces are complete, and the definition of Hilbert space is redundant. Inner products can be defined on more general fields than $\mathbb R$ and $\mathbb C$, for example $\mathbb Q$ and other subfields of $\mathbb R$. The definition of Hilbert space simply rules out these incomplete subfields from consideration. There exist genuine inner product spaces over $\mathbb R$ and/or $\mathbb C$ that are not complete, which would be the most interesting and unexpected situation.

That is, what are some good examples of vector spaces which are inner product spaces but in which not every Cauchy sequence converges?


If $R$ is a commutative ring and $I$ and $J$ are ideals s.t. $I+J=R$ then show that $IJ=I\cap J$.  I've already shown that $IJ \subset I\cap J$, now I need to show the reverse inclusion.   I'm a bit lost, so far i'm just figuring out what pieces I have to work with.  Such as:  $\forall r\in R$ $\exists i\in I ,j\in J$ s.t. $i+j=r$  $\forall ij\in IJ$, $ij=i_1$ and $ij=j_1$ for some $i_1\in I$, $j_1\in J$.  Also, if I let $x\in I\cap J$, then $x=i_2=j_2=i+j$ for some $i_2\in I$, $j_2\in J$  Anyone, having problem getting to the conclusion here, thanks in advance

So I basically have to prove what is on the title.      Given $R$ a commutative rng (a ring that might not contain a $1$), with the property that $I+J=R$, (where $I$ and $J$ are ideals) we have to prove that $IJ=I\cap J$.   One inclusion is easy. If $x\in IJ$, then $x=\sum a_ib_i$ where $a_i\in I$ and $b_i\in J$. Thus for any fixed $i$, we have that since $a_i\in I$, we have that $a_ib_i\in I$, and the same argument shows that $a_ib_i\in J$, thus $\sum a_ib_i\in I$ and $\sum a_ib_i\in J$, this means that $x=\sum a_ib_i\in I\cap J$, and thus $IJ\subset I\cap J$.   I am having troubles proving the other inclusion. Any comments?  Thanks


I'm using an ajax call to insert a menu.html inside my index.html, the call for the jquery script menu-script.js which handles the hide\show feature of this nested menu is properly loaded and executed into the index.html(indeed the menu is all closed), however the on.('click', function(){.. etc is not fired when menu items are clicked.  This is the script:  $(function() { $('body').addClass('js'); var menu = $('#menu'),     menulink = $('.menu-link'),     menuTrigger = $('.has-subnav > a');  menulink.on('click', function(e) {     console.log('menulink cliked');     e.preventDefault();     menulink.toggleClass('active');     menu.toggleClass('active'); });  menuTrigger.on('click', function(e) {     console.log('menutrugger cliked');     e.preventDefault();     $(this).toggleClass('active').next('ul').toggleClass('active'); });  $('a[href*=#]:not([href=#])').on('click', function() {     console.log('ahref?');     if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {         var target = $(this.hash);         target = target.length ? target : $('[name=' + this.hash.slice(1) +']');         if (target.length) {             $('html,body').animate({ scrollTop: target.offset().top }, 600);             return false;         }     } });   And the menu.html (part of it):

                 Manuale Base

Per iniziare

Razze

Classi

Abilitàs

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


From the Wikipedia entry on the  (emphasis mine),     From the CMB data it is seen that the earth appears to be moving at 368±2 km/s relative to the reference frame of the CMB (also called the CMB rest frame, or the frame of reference in which there is no motion through the CMB). The Local Group (the galaxy group that includes the Milky Way galaxy) appears to be moving at 627±22 km/s in the direction of galactic longitude l = 276°±3°, b = 30°±3°.[82][10] This motion results in an anisotropy of the data (CMB appearing slightly warmer in the direction of movement than in the opposite direction).[83] From a theoretical point of view, the existence of a CMB rest frame breaks Lorentz invariance even in empty space far away from any galaxy.[84] The standard interpretation of this temperature variation is a simple velocity red shift and blue shift due to motion relative to the CMB, but alternative cosmological models can explain some fraction of the observed dipole temperature distribution in the CMB.[85]   What does the bold sentence mean?

It seems that we are . This is the speed of our galaxy relative to the cosmic microwave background. Where does this rest frame come from? Is this special in any way (i.e., an absolute frame)? EDIT: I think the more important question is "where does the CMB rest frame come from?".


I am taking a course in Open Source Programming this semester and have been asked to download any Linux distro, so I chose Ubuntu. I have set up my java environment and now I need to install Eclipse IDE.   I have followed the answers to similar questions via here and still haven't been able to get the job done.   sudo apt-get install eclipse-cdt sudo snap install -classic eclipse   these are similar commands I have tried on my newly installed Ubuntu system.

Trying to install Eclipse on fresh Ubuntu. Got error:    If I type java command I have output:    Can I install default OpenJDK or should I go to Oracle site and download Java there? Why I can't use OpenJDK?


I'm fairly new to java only starting this year, sophomore year in high school, I am currently working on a side project and can't get this block of code to work, I know where it's not working I just need help knowing why.  public Timer[] t = new Timer[3];  public TimerTask tt[] = new TimerTask[3];  public int ttc = 0;  public int[] hasBought = new int[3]; public int[] j = 1;  public void run() {     for(;ttc<3; ttc++)     {         System.out.println(ttc+"a");         tt[ttc] = new TimerTask()                 {                      @Override                     public void run()                     {                         System.out.println(ttc+"b");                         count += (j*hasBought[ttc]);                                                 }                  };          System.out.println(ttc+"c");         t[ttc].scheduleAtFixedRate(tt[ttc] , 1000, 1000);     }   From what I currently know this should all run fine and print 0a 0b 0c 1a 1b 1c 2a 2b 2c and it should also start 3 timers but it is printing 0a 0c and coming up with a NullPointerException error. The 2nd part makes sense because the TimerTasks obviously aren't being initialized because it isn't printing 0b.  EDIT  I'm not sure what is causing the problem but I'm guessing it is something to do with these lines:  tt[ttc] = new TimerTask()                 {                     @Override                     public void run()   EDIT  I'm not having problems with a NullPointerException, I know what one is and how to fix it, I don't understand why the TimerTask isn't initiating.

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


I am looking for municipal-level administrative boundary data (NUTS 5) for Poland. Since it is public information, I thought the data would be readily available, but I can't seem to find it anywhere. I have checked the usual sources.  has data down to the county (powiat) level, and  seems to only have data down to the provincial level. I have looked at many of the Polish government's sites, but while I can find plenty of GIS data viewers, I can't find a way to download the administrative boundary data I am interested in. To make matters more complicated, I would really like historic data, but I would settle for current NUTS 5 level data.

After learning about the  datasets I've working with the following layers, from the USA data   Country boundaries State boundaries County boundaries City boundaries ZipCode/Postcode boundaries   What I am trying to find is the equivalent (where appropriate) of the same data for various countries.  Is there any free administrative boundaries available as shapefiles for other countries?


Where can I see count of votes casted by me on comments posted by other users.  I can see my question & answer votes count on my user dashboard screen. Can I also see my comments votes count.    Can anyone please point to such query/screen etc.  Note : I am not asking for voting pattern/score on comments left by me.

Yesterday I upvoted a comment that had interesting links. I didn't do any other activity in that question apart from giving my upvote to that comment because it had some links I wanted to check later.  Now a day has passed and I want to view that comment to bookmark those links, but I can't see any way on Stack Overflow to see comments that I've upvoted. Can I see these votes? If not, why is this feature missing?


How do I install a custom font on an html site?   For example, I was working on a wedding website, and I was finding a lot of nice fonts for that subject, but I can't find the right way to add that font to the server, or to include that font with CSS?

Is there a way to add some custom font on a website without using images,  or some other graphics?  For example, I was working on a wedding website, and I found a lot of nice fonts for that subject. But I can't find the right way to add that font on the server. And how do I include that font with CSS into the HTML? Is this possible to do without graphics?


Is there a solution to the infamous floating point math error in JavaScript due to the 64-bit floating point representation?     Im trying to make a math intensive application based on JavaScript, however, due to this error in JavaScript, it always results in inaccurate output.   For ex.:      0.1 + 0.2 = 0.30000000000000004     whereas the expected is      0.1 + 0.2 = 0.3  I wonder how the financial organizations like (PayPal) are still up with there javascript applications.

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


One of the most fundamental sentence from the English “phrasebook” that almost every beginner will learn is this sentence, using which one can ask another one’s nationality or country/region of origin.  However, this sentence has always troubled me.    The word where is an adverb in this context, and it functions as an adverbial; from is a preposition, and it functions as part of the subjective complement in this sentence.  Id est, when responding to this clause, people may say, for example, “I am from Milan.”  Now, in that response, I is a pronoun functioning as the subject, and the rest of the sentence, am from Milan, is the predicate, which is comprised of the copula, or the linking verb, am, and the subjective complement, from Milan, which is a spatial adverbial.    What I have learned about English grammar prescribes that an interrogative/relative adverb, such as where or when, cannot follow a preposition, because an adverb alone functions as an adverbial, and the structure “preposition + noun/pronoun” ought to correspond to an adverb.  Id est, the phrase from Milan (preposition + noun) can and should correspond to that adverb where, and structures such as from where are illegitimate.    I think it is fairly common that adverbs do not follow prepositions.  People always say clauses such as where are you at is grammatically incorrect, because at is a preposition and where is an adverb, so it should simply be where are you.  Therefore, what troubles me is that why the phrase where are you at is incorrect and criticized, while I have not seen people avoiding where are you from.    In my humble opinion, the canonical form of this clause should be from which country/region are you, or at least which country/region are you from, but it seems awfully pedantic and there is a highly probable chance that the utterer will get thrashed…

Like many others, I commonly find myself ending a sentence with a preposition.  Yes, it makes me cringe.  I usually rewrite the sentence, but sometimes (in emails) I just live with it.  To, with... you know who you are.  Should I keep fighting myself on this one, or is it okay in some circumstances?


I'm looking for a way to get the list of all my upvotes on Stack Overflow, however after looking through the , seems there is no way to achieve that.  And I know I can view my upvotes in votes tab, however I'm looking for an official API to query the list.

For the sake of curiosity I want to visualize my vote activity on Stack Overflow. I can scrape it easily from HTML, but it would be elegant to accomplish it using an API.


Somehow I have set a hotkey that start DoubleCommander whenever I press AltGr+s. Unfortunately I forgot which program is responsible for that behavior and therefore how to change it back.  How do I find out which program is responsible to change it back?

Given a hotkey, how can I find which program owns it?


We define a relation 𝑅 on the integers as follows: For all integers 𝑥, 𝑦 ∈ Z, 𝑥𝑅𝑦 if and only if 5|(𝑥 − 𝑦).   How do I prove that 𝑅 is an equivalence relation. How do I give a description of the equivalence class [2] and find at least 3 members of this equivalence class?

Define $x\sim y$ means 5 divides $(x - y)$ for $x$ and $y$ integers. Show that is an equivalence relation.  Equivalence relation means it satisfies reflexity, symmetry, and transitivity.  reflexive: $x\sim x$ means 5 divides $x$  symmetry: $x \sim y \rightarrow y\sim x$ means 5 divides $x - y$ and 5 divides $y - x$: $$5/(x - y) = 5/(y - x)$$ so symmetry is satisfied.  I am not sure if I am right here and I am lost on how to prove it is transitive any suggestions would be greatly appreciated


A Google Doc was published and I would like to know how many unique viewers have accessed the document.  Ideally, unique anonymous views would tallied each time a unique IP address accesses the doc.

I've recently posted a Google Document on a forum and I'd like to know how many people saw and when. I could see how people were opening and closing the doc live, with those user icons popping up next to the share button. But nothing in the UI indicates where (if at all) a document stores it's viewing statistics.  Is there a way to do this?


I am trying to develop a GIS application in QGIS using the Python language. Unfortunately, I encountered a problem from the outset is that of import and qgis.core qgis.gui. the Problem in the python console is as follows:  import qgis.core  Traceback (most recent call last):   File "<pyshell#0>", line 1, in <module>     import qgis.core ImportError: DLL load failed: Le module spécifié est introuvable.   I am using:   OS : Windows 7 , 32 bits QGIS : 1.8 ( Lisbona )  Python : python 2.7

I am working on Python plugins for QGIS. I set my variables as   PATH :=C:\OSGeo4W\apps\qgis;%PATH% PYTHONPATH:=C:\OSGeo4W\apps\qgis\python   But when I try to run my .py file in IDLE I get an error saying:  Traceback (most recent call last):  File "C:\rt_sql_layer_working\DlgQueryBuilder.py", line 30, in from qgis.core import * ImportError: DLL load failed: The specified module could not be found.   What should I set for the PATH variable??


I tried to add value price tag several selects but I get some strange results.  I would appreciate help to know that certain numbers do not sum well.  Here I leave the link to the example jsfiddle.net    javascript Function:  sumValues('#priceList', '#totalPrice'); function sumValues(list,total){   var allListElements = $( "select" );   var sum = 0;   $( list ).find( allListElements ).each(function() {     sum += Number($('option:selected', this).attr('price'));   });   $(total).empty();   $(total).append(sum+' €');  }   html Code:
       <select class="participant" name="price1" style="width: 100%" onchange="sumValues('#priceList', '#totalPrice')">         <option value="0" price="0"> 0€ </option>         <option value="1" price="10.62" selected="selected"> 10.62€ </option>     </select>     <select class="participant" name="price2"  style="width: 100%" onchange="sumValues('#priceList', '#totalPrice')">          <option value="0" price="0"> 0€ </option>          <option value="1" price="13" selected="selected"> 13€ </option>     </select>


I have an assignment to compare the execution times for sorting large arrays of integers with mergesort and quicksort. The implementations of the algorithms are copied from a book. They both sort integers in ascending order. I am then asked to state how much faster quicksort is on average. However, with my (albeit small) sample size of tests, I found that mergesort was quicker by a small %, which leads me to believe i'm testing improperly.   I have 2 programs, one for mergesort and one for quicksort. Their main() code is the same (shown below). I create an array of random size between 0 and some chosen upper limit. Then I fill the array with random integers. Then I sort the array and print it. I use the currentTimeMillis() to check the runtime of the programs. I do tests of 10 runs for quicksort and mergesort, add the total time and divide by 10 to get the average running time for the sorts. I did not find that quicksort was faster than mergesort on average. I've also tried using a fixed array size, but the results still do not hint at quicksort being faster. What would be a -proper- way to test?  public static void main(String[] args){         /* create an array of some size 0 to 100000 with            random integers and measure the time it takes            to sort the array in ascending order (where sort() is either quicksort             or mergesort.)         */         long a = System.currentTimeMillis();         Random rnd = new Random(System.currentTimeMillis());         Integer[] array = new Integer[rnd.nextInt(100000)];         for(int i = 0; i < array.length; i++){             array[i] = rnd.nextInt();         }         sort(array);         System.out.println(Arrays.toString(array));         long b = System.currentTimeMillis() - a;         System.out.println("Program runtime: " + b + "ms");     } }  Expected result: Quicksort average running time should be some % faster in comparison to mergesort, for large random integer arrays.  Actual result: Mergesort was slightly faster in most tests  (10K elements, 100K elements, 1000K elements).

How do I get a method's execution time?   Is there a Timer utility class for things like timing how long a task takes, etc?     Most of the searches on Google return results for timers that schedule threads and tasks, which is not what I want.


I want to max out my IRA and I am investing in a mutual fund with 5% front-load fee.  Does that mean that I can contribute $5,500 max for IRA but have real IRA balance $5,500 less $275 = $5,225 as a result?  Or, can contribute $5,789 so my after fee balance becomes $5,500?  Our financial adviser said that first case is how it works, but he was not able to point me to any IRS documentation confirming it.

I contribute the max to my Roth IRA every year ($5500 in 2013, for example). However, let's say I use that money to buy two stocks, with a commission $10 each, so I am effectively only contributing $5480. Admittedly this is pretty small but that extra $20 would have compounded, and if I follow this pattern every year it is like a 0.36% expense ratio. The same would apply to tax-deferred accounts like a traditional IRA. So I am wondering, is it possible to use external money (aside from the $5500 Roth contribution) to pay trading commissions? First of all, is this legal? I hypothesize perhaps not if the government wants to discourage lots of trading in tax-advantaged accounts. If it's legal, do any brokerages support this?


I was reading a paper today modeling capacitances, and came across self-capacitance of a disc. After skimming google, it looks like this is defined as "the capacitance between the object itself, and infinity." There are examples online of the self capacitance of a hollow conducting sphere, but this is very straight forward since you simply integrate from the radius $R$ to infinity and out comes the self capacitance.  The paper says the self-capacitance between 2D disc-shape object and infinity is $C_0 = 8 \epsilon_0 R$. This is also confirmed by wolfram .   I attempted to calculate this myself. I followed the derivation of an electric field at a distance $x$ from the center of a disc at this page  to get a result of $$E_x = \frac{Q}{2\pi \epsilon_0 R^2} \left(1 - \frac{x}{(x^2 + R^2)^{1/2}}\right)$$  I took it the rest of the way myself, calculating the potential. I used $$V = -\int E \cdot dx$$ where by mathematica $$\int_0^{\infty} \left(1 - \frac{x}{(x^2 + R^2)^{1/2}}\right) dx = R$$  Thus for the capacitance I get the result  $$C = \frac{Q}{V}$$ $$C = -2\pi \epsilon_0 R$$  So obviously the negative shouldn't be there, which I'm less worried about, but the factors aren't even close to correct. Somehow I'm missing a $4/\pi$  Anybody see anything wrong with my approach here? Thanks

Lets say we have a single plate that has a charge of $+Q$ on it. A plate with charge $-Q$ is infinite distance away. Will the plate with $+Q$ have a capacitance associated with it? Why or why not? I was thinking that because the distance between the plates is infinity, the capacitance is zero, but according to my TA, that is not the case. There is always some sort of "absolute" capacitance for the plate with $+Q$ (a capacitance will exist between the plate and air?). Can someone help me out in understanding this?


I am trying to find out how many fix point free permutations of 5 elements there are. A permutation is fix point free, if $\pi (i) \neq i$. I am trying to solve this problem using the inclusion exclusion principle but I really have no idea how to approach this problem. I hope somebody can help.

I read many articles on the derivation of the derangement formula but I can't understand them clearly. At first I read . I understand the recursive derivation of derangement. But I am interested in understanding the inclusion-exclusion based formula for derangements.


Is it possible to make a weapon in Minecraft that applies status effects when it hits an entity, for example a Sword that poisons and slows whoever's hit by it.  Also can you give a weapon a custom durability that would make it break after it's first hit?

I'm not the most experienced person when it comes to commands. I worked out how to do stuff like when holding x you have y effect. I wanted to think of something that gave other people an effect when hit. Here is what I came up with but I got stuck when it said it couldn't execute the command.  /scoreboard objective add nokill dummy  /scoreboard objective add poi dummy  /scoreboard players set [player] nokill 1  /scoreboard players add @a poi 1 {SelectedItem:{id:minecraft:diamond_sword,display:{Name:{Poison sword}}}}  /execute @a[score_poi_min=1] ~ ~ ~ /effect @p[score_nokill_max=1,r=5] {HurtTime:1} minecraft:poison 10 1


I have a fresh install of ubuntu 17.10 .. After installation, I was able to browse the internet, but 1 day later, and even though wi-fi appears listed as working, it is not.   I've searched around for some solution to this and have seen that I should run   gksudo gedit /etc/NetWorkManager/NetworkManger.conf    and make changes there.. however, gksudo is not something which comes with 17.10, I think, and I can't install it as no internet..   Is there a work around for this problem?   And since this is apparently a bug from 17.04 (?) is it not fixed in 17.10?

I installed Ubuntu 17.10. Now I am having trouble with gksu:  $ gksu -dg synaptic No ask_pass set, using default! xauth: /tmp/libgksu-HgUjgQ/.Xauthority STARTUP_ID: gksu/synaptic/8760-0-alex-XPS-15-9530_TIME4974977 cmd[0]: /usr/bin/sudo cmd[1]: -H cmd[2]: -S cmd[3]: -p cmd[4]: GNOME_SUDO_PASS cmd[5]: -u cmd[6]: root cmd[7]: -- cmd[8]: synaptic buffer: -GNOME_SUDO_PASS- brute force GNOME_SUDO_PASS ended... Yeah, we're in... Unable to init server: Could not connect: Connection refused (synaptic:8767): Gtk-WARNING **: cannot open display: :1 xauth: /tmp/libgksu-HgUjgQ/.Xauthority xauth_env: (null) dir: /tmp/libgksu-HgUjgQ   If I don't use -g, the password dialog is disabled. So looks like a problem with creating a tty for root.  Any advice?


I want to install these packages to my Ubuntu server from USB as i have tried many thing by editing mirrors in /etc/apt/sources.list to install some packages for Ubuntu server 14.04 know I want to try installing them from USB so would any one guide me how should I?  sudo apt-get install git build-essential libacl1-dev libattr1-dev libblkid-dev libgnutls-dev libreadline-dev python-dev python-dnspython gdb pkg-config libpopt-dev libldap2-dev dnsutils libbsd-dev attr krb5-user docbook-xsl libcups2-dev libpam0g-dev ntp -y

I have a friend who has got a computer that is not connected to the Internet. Is there any way to install software offline easily?


Updated the question as there is no solution till now and now i am using 17.04   athul@black-box:~/Downloads$ steam Running Steam on ubuntu 17.04 64-bit STEAM_RUNTIME is enabled automatically Installing breakpad exception handler for appid(steam)/version(1490228413) libGL error: No matching fbConfigs or visuals found libGL error: failed to load driver: swrast  athul@black-box:~/Downloads$ LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/lib32/nvidia-340/:/usr/lib/nvidia-340/" steam Running Steam on ubuntu 17.04 64-bit STEAM_RUNTIME is enabled automatically Installing breakpad exception handler for appid(steam)/version(1490228413) libGL error: No matching fbConfigs or visuals found libGL error: failed to load driver: swrast   Second Method used to work for a while though early before update.

Actually I have installed the new Ubuntu 15.04 64bit, and when I'm trying to install Steam on it, there is a problem. In fact I have downloaded the deb package from steam website, installed it and when I start it nothing happens. I tried to start it from terminal and what I've got  $ steam Running Steam on ubuntu 15.04 64-bit STEAM_RUNTIME is enabled automatically Installing breakpad exception handler for appid(steam)/version(0_client) libGL error: unable to load driver: r600_dri.so libGL error: driver pointer missing libGL error: failed to load driver: r600 libGL error: unable to load driver: swrast_dri.so libGL error: failed to load driver: swrast


Each or Every for speaking about what the people like? For example, I want to say that the people all around the world like different kinds of music. How do I say it?      Each person likes different music   or    Every person likes different music   Also, Could you tell me here which is the correct one?      One learns the thing that he is interested in   or    A person learns the thing that he is interested in

At the end of every day you will be required to write a review.   At the end of each day you will be required to write a review.   Which one of those sentences is better if this action will repeat itself every day for longer period of time, several weeks for example, maybe even months?


I have to show that   $F_{n+k} = F_{k}F_{n+1} + F_{k-1}F_{n}$, where $F_{n}$ is nth Fibonacci element.  I was trying with mathematical induction applied to n and saying k is constant.   step for $n=1$ $F_{k+1} = F_{k}F_{2} + F_{k-1}F_{1}$ which is true, because $F_1=F_2=1$ step let say our theorem is true for some n step  I was trying to do it like this: $F_{n+1+k} = F_{n+k}+F_{n+k-1} = F_{k}F_{n+1} + F_{k-1}F_{n} + F_{n+k-1}$   but there is $F_{n+k-1}$and I do not know what to do with it.  Thanks!

Question: Let $F_n$ the sequence of Fibonacci numbers, given by $F_0 = 0, F_1 = 1$ and $F_n = F_{n-1} + F_{n-2}$ for $n \geq 2$. Show for $n, m \in \mathbb{N}$: $$F_{n+m} = F_{n-1}F_m + F_n F_{m+1}$$   My (very limited) attempt so far: after creating a small list of the values $F_0=0, F_1=1, F_2=1, F_3=2, F_4=3, F_5=5, F_6=8, F_7=13, F_8=21, F_9=34, F_{10}=55$ i can see that yes it does seem to work for instance $F_{6+3}=F_5 F_3 +F_6 F_4 = 10 +24 = 34 = F_9$. However, I really don't know where to begin as showing that this must hold in general terms. Should I be looking to use limits? Or perhaps induction? What is the best way to solve this?


When I insert a DVD, videos said it cant be played. so i go into the disc and select a VOB file and that does not work.I’ve tried VLC and it still does not work. Please HELP!

My machine can't play encrypted DVDs on a fresh install.  How do I add this capability?  Another useful bit of information would be what programs are best for playing DVDs, once I'm able to do so.  See the .  Will I be able to play DVD movies from ?