As an alternative to your class and background starting equipment you can roll to see how much GP you have and you can "buy" your equipment while making your character.  Does the same "buying" rule apply without taking that option but instead with the GP given to you through your background?

So if I'm correct, when you chose your starter gear and wealth you can either choose to roll some dice depending on your class and buy everything from that or you can choose the starter gear from your class and add the background items (including some gold). Here are my 2 questions:   If I choose the gear from my class, do I have to take all the equipment from only one of the (a) or (b) choices, or can I freely mix-and-match choices from the two sets? Can you spend the extra gold you get from your background on extra equipment (e.g. some soap and some fishing equipment) or do you have to start with that gold in its pouch?   The reason I ask is that I have recently created a level 1 wood elf druid and I mixed-and-matched the gear from the class, so that I chose a shortbow as a "(b) simple weapon" for the first point and a "(a) Scimitar" at the second point. My DM wasn't so happy about this, as he can't understand why I'm mixing (a) and (b).  He also wasn't so happy with me spending my 10gp from my outlander background. I decided that my druid wouldn't lay so much worth in 10gp compared to a bunch of stuff I got for that (e.g. some soap and some fishing equipment and some other useful things) and he seems to think that I'm supposed to just start with the gold instead.


It seems like with the basic "DROP" iptables rule, an outbound attempt will still wait the duration of its timeout.  For instance, if I block an IP address outbound, then attempt to connect to it via telnet, it will wait until its timeout is hit.  Is it possible to specify that the connection must be immediately rejected and/or closed?  For instance, if I have:  target     prot opt source               destination          DROP       tcp  --  0.0.0.0/0            208.79.143.151      tcp dpt:443    And then if I run:  # telnet 208.79.143.151 443 Trying 208.79.143.151...   ... it will just hang until it eventually times out the request. Is there any way to get linux to more abruptly fail outbound connections (in situations where you cannot modify the application)?

Is there any reason why I would want to have   iptables -A INPUT -j REJECT   instead of   iptables -A INPUT -j DROP


The usual \rightarrow has its long version \longrightarrow, exactly as \mapsto has its long version \longmapsto. I was wondering if there exists a basic command for a long \hookrightarrowas well. The stupid try \longhookrightarrrow sadly doesn't work.

I know what my symbol or character looks like, but I don't know what the command is or which math alphabet it came from. How do I go about finding this out?


This is my sample table, is it possible to get the distinct value of animals and get its letter with commas and count the letter of specific animals?  Query: Select animals, letter From pet;   +--------------+--------------+  | animals      | letter       |  +--------------+--------------+  | dog          |    d         |  | dog          |    o         |  | dog          |    g         |  | cat          |    c         |  | cat          |    a         |  | cat          |    t         |  | mouse        |    m         |  | mouse        |    s         |  | mouse        |    e         |  +--------------+--------------+   This is my expected output, count the letter to get total, count every item before the comma symbol,:   +--------------+--------------+--------------+  | animals      | letter       |   total      |  +--------------+--------------+--------------+  | dog          |    d,o,g     |     3        |  | cat          |    c,a,t     |     3        |  | mouse        |    m,s,e     |     3        |  +--------------+--------------+--------------+

Using MySQL, I can do something like:  SELECT hobbies FROM peoples_hobbies WHERE person_id = 5;   My Output:  shopping fishing coding   but instead I just want 1 row, 1 col:  Expected Output:  shopping, fishing, coding   The reason is that I'm selecting multiple values from multiple tables, and after all the joins I've got a lot more rows than I'd like.  I've looked for a function on  and it doesn't look like the CONCAT or CONCAT_WS functions accept result sets.  So does anyone here know how to do this?


I'm trying to understand what an offset in a hex dump is. In particular, what purpose does an offset serve? I have googled many times but not found anything.

I downloaded Hex Workshop, and I was told to read a .dbc file.     It should contain 28,315 if you read   offset 0x04 and 0x05   I am unsure how to do this? What does 0x04 mean?


I searched the Web to find an conterexample for this statement: If every cyclic subgroup of group $G$ is normal in $G$ then every subgroup of $G$ is normal in $G$.  But couln't find any. It seems it is a right proposition. Please give me a hint to start.

Exercise 11, page 45 from Hungerford's book Algebra.     If $H$ is a cyclic subgroup of $G$ and $H$ is normal in $G$, then every   subgroup of $H$ is normal in $G$.   I am trying to show that $a^{-1}Ka\subset K$, but I got stuck. What I am supposed to do now?  Thanks for your kindly help.


Imagine that I lifted 100 kg object 1 cm above the ground and keep it there. I would like to know how much energy do I need to spend to keep this object there? I understand that in basic sense energy required is 0.  But in reality, I spend energy to keep say my hand rigid to keep the object lifted. Or I can attach a drone to the object and burn gasoline to keep it afloat. Any formulas?

I read the definition of  as  $$W ~=~ \vec{F} \cdot \vec{d}$$  $$\text{ Work  =  (Force) $\cdot$ (Distance)}.$$ If a book is there on the table, no work is done as no distance is covered. If I hold up a book in my hand and my arm is stretched, if no work is being done, where is my energy going?


As you can see below, we're missing some words.    User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.71 Safari/537.36

The placeholder text on Stack Overflow is:     Use comments to ask for more information or suggest improvements. Avoid comments like    So, what kind of comments should be avoided? I seem to recall that it was only      Use comments to ask for more information or suggest improvements.   before.  Screenshot:    I notice the same on Meta. Tested in latest Chrome and Firefox versions on OS X.


I am implementing a scenario where user inputs an numeric answer in the edit text, which is being compared with addition of two numbers while inputting text using addTextChangeListener. I am trying to calculate true and false counters. I get true counters perfectly in below code.   etTestAddAnswer.addTextChangedListener(new TextWatcher() {                 @Override                 public void beforeTextChanged(CharSequence s, int start, int count, int after) {                  }                  @Override                 public void onTextChanged(CharSequence s, int start, int before, int count) {                     if (etTestAddAnswer.getText().toString().length() == (String.valueOf((firstDigit + secondDigit)).length())) {                         if (etTestAddAnswer.getText().toString().equalsIgnoreCase("")) {                             etTestAddAnswer.setError("Left Blank");                             YoYo.with(Techniques.Wobble)                                     .duration(750)                                     .playOn(tlTestAddAnswer);                         } else {                             if (Integer.parseInt(etTestAddAnswer.getText().toString()) == (firstDigit + secondDigit)) {                                 correctCounter += 1;                                 etTestAddAnswer.setText("");                                 Toast.makeText(AdditionTestActivity.this, "Correct", Toast.LENGTH_SHORT).show();                                 if (finalCounter < 10) {                                     initGame();                                 } else {                                     testAddTime.cancel();                                      //Toast.makeText(AdditionTestActivity.this, "True Answer :" + correctCounter + "\n" + "Wrong Attempts" + falseCounter + "\n" + "Time " + toolbarTimeTestAddition.getText().toString(), Toast.LENGTH_SHORT).show();                                 }                             } else {                                 YoYo.with(Techniques.RubberBand)                                         .duration(750)                                         .playOn(tlTestAddAnswer);                                 etTestAddAnswer.requestFocus();                                 falseCounter += 1;                                 Log.d(TAG, "False Answers: " + falseCounter);                                 etTestAddAnswer.setError("False Answer, \n Try Again..!!");                             }                          }                      } else if (etTestAddAnswer.getText().toString().length() > (String.valueOf((firstDigit + secondDigit)).length())) {                         YoYo.with(Techniques.RubberBand)                                 .duration(750)                                 .playOn(tlTestAddAnswer);                         etTestAddAnswer.requestFocus();                         Log.d(TAG, "onTextChanged: " + falseCounter);                         //falseCounter++;                         etTestAddAnswer.setError("False Answer, \n Try Again..!!");                     }                 }                  @Override                 public void afterTextChanged(Editable s) {                  }             });   But the false counter is incorrect. Like if i am on fifth question and give my first wrong input, the false counters log is like this:  1 2 3 4 5   It should only increment one. Any ideas??

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


I'm trying to implement a kind of "search as you type" feature with the Search bar.  Essentially, I'd like to have the user begin to type, make some kind of ajax request after each key, and then populate a div with "Related searches" as they type.  Any good plugins for this or should I bake it up from scratch?

I am currently trying to create a wordpress search function that shows live results underneath the search bar. There is an example on the  website (screens below). I'm not looking for an autofill like you would find on Google.com which completes words you type, rather I want it to find actual posts on the site.   I tried doing a scrub through Wordpress Answers and other similar resources but have only run into implementing a Google type search which is not what I am looking for. Any help or points in the right direction would be greatly appreciated.


I am running perl script to check whether the IP is present or not. I am getting the error in script.  Perl script: I used  use URL::Encode; library, but it threw the below error:  Can't locate URL/Encode.pm in @INC (@INC contains: C:\Strawberry\perl\lib\CPAN C:/Strawberry/perl/site/lib C:/Strawberry/perl/vendor/lib C:/Strawberry/perl/lib .)  So I used direct path as below:  use lib 'C:\Strawberry\perl\lib\CPAN';  my $json_hash={}; $json_hash->{'username'}=$username; $json_hash->{'response'}=$response; $json_hash->{'control'}=$control;  my $json_query=URL::Encode::url_encode(JSON::to_json($json_hash));   Suggest me any alternate library or a way to use this library

I get this error:  Can't locate Foo.pm in @INC  Is there an easier way to install it than downloading, untarring, making, etc?


I've made a model that's PS1-eqse in the vain of games like Mega Man Legends, but whenever I try to render it in Blender, it looks absolutely atrocious.  I've disabled Anti-Aliasing, turned off MipMaps in Blender Preferences, which DID make the pixel textures clearer, but only in viewport. But it still looks awful.   Anything else I can do to make the render show the pixel textures clearer?

I have a problem. I am going to make a minecraft animation in blender. But when I put a minecraft texture on a 3d cube that is 16x16x16 it is very low resolution is there a way to get the texture in a better resolution or is there a way to make blender make the texture better?  I hope you have an answer. Thanks in advance


There are complex matrices $A$, $B$ such that $AB - BA = B$. Prove that $0$ is the only eigenvalue of $B$.  I know that $tr(B)=0$. I tried different transformations and I ran out of ideas. Can you please help me?

Let $A$ and $B$ be two real $n\times n$ matrices such that $AB-BA=A$ Prove that $A$ is not invertible and that $A$ is nilpotent.  My attempt is the following. It holds that $AB=(B+I)A$ If $A$ were invertible, $B=A^{-1}(B+I)A$. Taking trace on both sides yields $tr(B)=tr(B)+n$, hence $n=0$, which is a contradiction. I can't prove that $A$ is nilpotent though.


I'm trying to get my installation to boot to GRUB so I can fix a driver issue before the installation crashes.  Unfortunately I can't figure out how to get that to happen.  Pressing Shift on power-up doesn't work.  Ctrl+ Alt+F1 doesn't work.  Pressing  E doesn't work.  No matter what I press, I end up at the Ubuntu loading screen and then a login prompt (which then hangs as soon as I try to type in the password box).

I want to know if there is a way to switch to console mode from the boot menu.  I have an NVIDIA 1070 and every time there is an update, the GUI stops working. All I need to do is re-install the drivers; however, to do that I need to be in console mode. EDIT: I should have added more information to this question but I'll comment on all answers. In short: I've tried text instead of quiet splash I do see booting activity in text mode; however, I don't get a login screen and ctrl + Alt + F1 doesn't help because GDM keeps trying to restart. Previously I managed to kill GDM through multiple tries but is not working since the latest update. EDIT: After searching for runlevel, I've found  but I think it required me to have a running system to make changes -- please correct me if I'm wrong.


Cross product is defined in three dimensions the resulting vector have the same magnitude as the area of the parallelogram formed by the 2 multiplied vectors and its direction direction is perpendicular to the first two vectors. so Can we come up with an equation using the same analogy but in 4-dimensional space(so that the resulting vector's magnitude is the volume of the parallelepiped formed by the three input vectors and it's direction is -somehow- perpendicular to the first three vectors)?

Wikipedia introduces the vector product for two vectors $\vec a$ and  $\vec b$ as $$ \vec a \times\vec b=(\| \vec a\| \|\vec b\|\sin\Theta)\vec n $$ It then mentions that $\vec n$ is the vector normal to the plane made by $\vec a$ and  $\vec b$, implying that $\vec a$ and  $\vec b$ are 3D vectors. Wikipedia mentions something about a 7D cross product, but I'm not going to pretend I understand that.  My idea, which remains unconfirmed with any source, is that a cross product can be thought of a vector which is orthogonal to all vectors which you are crossing.  If, and that's a big IF, this is right over all dimensions, we know that for a set of $n-1$ $n$-dimensional vectors, there exists a vector which is orthogonal to all of them.  The magnitude would have something to do with the area/volume/hypervolume/etc. made by the vectors we are crossing.  Am I right to guess that this multidimensional aspect of cross vectors exists or is that last part utter rubbish?


I just posted , and after tagging it as such added the 'ruby' tag as well, since (of course) Capybara is used from and written in Ruby.  Although 'capybara' was the first tag, Stack Overflow chose 'ruby' as the primary tag to display in the title.  Why is this?  What are the effects of this?  Is there any way to change this other than just removing the 'ruby' tag?  Because Ruby is a much more general category than Capybara, it seems to me that making 'capybara' the primary tag makes more sense and will be more likely to make it stand out to the right people.  Is this correct?  But on the other hand, a good portion of Rubyists know something about Capybara, so I'd like to keep the 'ruby' tag there too, so they notice it too.

I noticed that, sometimes, the tags I add to a question are not shown in the same order I wrote them, when the question is saved. Are they shown in a particular order? If they are, in which order they are shown?


I've got this tree-like key (think object OIDs--it's very similar) to store and index in a table, for which queries want to select subtrees thereof. The most straightforward way to do this on a btree is to use the tree path as the single key and descend the key with a starts-with operation to find the row blocks. So the obvious representation is VARBINARY(n)*. I cannot think of a way to express starts with in a way that SQL Server can figure out to use the index thereof. The next-most obvious is to pack the data into some VARCHAR with a binary collation and use a like operation; however I've discovered that like @n + '%' will never use an index, but only like 'literal%. Adding the WITH INDEX hint still scans the index in its entirety because SQL server just doesn't understand. I really don't want to think about how to escape arguments in SQL so I can build an EXEC. That's just madness and a security disaster waiting to happen. Expressing this in ordinary recursive tables and querying with recursive SQL is out of the question. The recursive query will power-sink the database server. I actually have the data in a long string of long variables right now and can select my serialization form. As I said, the natural form is VARBINARY and it really would look like 0x000000100004A010000000D0000A000. The most common query is of the form "give me everything starting with 0x000000100004A01" or in natural model, the first n values from the string of long values. I could write them in the form a.b.c.d.e.f... but the individual numbers are long and come from clicking on things on the GUI. Roughly speaking I'm looking at a plausible form of CREATE TABLE Record (    RecordId BIGINT NOT NULL IDENTITY(1,1),    RecordedDate DATETIME NOT NULL,    RecordClass CHAR(1) NOT NULL,    UserId INT NOT NULL,    ObjectId VARBINARY(384) NOT NULL,    RecordValue NVARCHAR(100) NULL,    OwnerId BIGINT NULL, -- Joins to another table    SubOwnerId BIGINT NULL, -- and yet another table    PRIMARY KEY (RecordId) ) CREATE INDEX name ON Record(RecordedDate); CREATE INDEX name ON Record(OwnerId); CREATE INDEX name ON Record(SubOwnerId); CREATE INDEX name ON Record(ObjectId);  What is the best way to do a starts-with index? *I've computed the largest possible n and it's less than 400

I have a SQL query that I am trying to optimize:  DECLARE @Id UNIQUEIDENTIFIER = 'cec094e5-b312-4b13-997a-c91a8c662962'  SELECT    Id,   MIN(SomeTimestamp),   MAX(SomeInt) FROM dbo.MyTable WHERE Id = @Id   AND SomeBit = 1 GROUP BY Id   MyTable has two indexes:  CREATE NONCLUSTERED INDEX IX_MyTable_SomeTimestamp_Includes ON dbo.MyTable (SomeTimestamp ASC) INCLUDE(Id, SomeInt)  CREATE NONCLUSTERED INDEX IX_MyTable_Id_SomeBit_Includes ON dbo.MyTable (Id, SomeBit) INCLUDE (TotallyUnrelatedTimestamp)   When I execute the query exactly as written above, SQL Server scans the first index, resulting in 189,703 logical reads and a 2-3 second duration.   When I inline the @Id variable and execute the query again, SQL Server seeks the second index, resulting in only 104 logical reads and a 0.001 second duration (basically instant).  I need the variable, but I want SQL to use the good plan. As a temporary solution I put an index hint on the query, and the query is basically instant. However, I try to stay away from index hints when possible. I usually assume that if the query optimizer is unable to do its job, then there is something I can do (or stop doing) to help it without explicitly telling it what to do.  So, why does SQL Server come up with a better plan when I inline the variable?


I want to wrap words in <p> tag into <span> tags using .append() and then target the <span> tags via:  jQuery(document).ready(function() {     jQuery('.editable span').bind("mousedown", function() {          // do stuff to <span> tags...      }); });   But it doesn't work. As far as I know, $(document).ready() just listen to newly added elements, right? What am I doing wrong?   For testing, here is a . As you can see, the jQuery('.editable span')... part isn't being triggered when you click on the span tags.

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


I want to fill a small array with unique values from a bigger array. How do I check the uniqueness?   Here's what I have:  int[] numbers45 = new int[45];  for (int i = 0; i <= 44; i++)             // I create a big array {     numbers45[i] = i + 1;                 }           Random r = new Random(); int[] draw5 = new int[5];                 //new small array   Console.WriteLine("The 5 draws are:");  for (int i = 1; i <= 4; i++) {     draw5[i] = numbers45[r.Next(numbers45.Length)];  //I fill the small array with values from the big one. BUT the values might not be unique.     Console.WriteLine(draw5[i]); }

What is the best way to randomize the order of a generic list in C#? I've got a finite set of 75 numbers in a list I would like to assign a random order to, in order to draw them for a lottery type application.


I'm new to ubuntu , I'm using the latest version. I've been trying to download apps from the software center but I keep getting this error notification(below). Can anybody tell me how to fix this please.  installArchives() failed: dpkg: error processing package tzdata (--configure):  package tzdata is not ready for configuration  cannot configure (current status `half-installed') Errors were encountered while processing:  tzdata dpkg: dependency problems prevent configuration of python-tz:  python-tz depends on tzdata; however:  Package tzdata is not installed. dpkg: error processing package python-tz (--configure):  dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of python-matplotlib:

I am getting error while using sudo apt-get upgrade stating:  dpkg: error processing libgfortran3:amd64 (--configure):   package libgfortran3:amd64 is not ready for configuration   cannot configure (current status `half-installed') Errors were encountered while processing:   libgfortran3:amd64 E: Sub-process /usr/bin/dpkg returned an error code (1)   It does not seem to block the installation/upgrade other applications. I believe this problem arose due to direct shutting down of my PC while the application was being upgraded.  How can I fix this?


Could anyone clear up which is - grammatically - correct, "the USA" or "USA"?   There are no doubts about unrolled, i.e. full name, so the Unites States [of America] are definitely to be used with "the", but I used to come across with both "the USA" and "USA" when said by native speakers.   My question refers particularly to the ABBREVIATION when used in a simple sentence or speech flow (not when filling in official forms). Example:      We're going to spend our next holiday in ... (the USA OR USA?).   Imagine that one HAS to use the abbreviation (exactly USA, not another name of the nation/country, so NO options here, please) in his/her speech and has to decide upon using the definite article before it to sound absolutely traditionally correct.

say that it's based on the context, but they suggest the form without the.  However, when I read , the first sentence is the following:      The United States of America (USA or U.S.A.), commonly referred to as the United States (US or U.S.) and America, is a federal republic consisting of 50 states and a federal district.   I always thought that it was with the definite article like "The United States" or "the USA" or "the UK" or "the United Kingdom" etc.   Are there any situations when the definite article is omitted in these cases mentioned above?


Let $f:\langle 0,\infty)\to \mathbb{R}$ be a function which is bounded in each bounded interval.      Show that if $\lim_{x\to\infty} (f(x+1)-f(x))=L$ then    $$\lim_{x\to\infty}\frac{f(x)}{x}=L.$$   It looks like that one should use derivatives (I guess) however I got nowhere!  Any suggestions?

Let $f:[0,+\infty)\to\Bbb R$ be a function bounded on each finite interval. I want to show that if $\lim\limits_{x\to+\infty}[f(x+1)-f(x)]= L,$ then also $\lim\limits_{x\to+\infty}\dfrac{f(x)}x = L$


Currently I use ubuntu 18.04 as main operating system. and I need to install windows 10. I don't want to format my ubuntu. Because I usually do my work in ubuntu.

I have Ubuntu on my laptop. Now I want install Windows 7 in a dual-boot. How can I do this? I can't lose my Ubuntu files, and I'm afraid that I might break . Go  for UEFI only!


I install ubuntu12.10 than I install windows 7 and now I have access only at windows :( i didn't find any solution for this... can you help me please?  thanks

I installed Windows 7, which ate Ubuntu's boot file. When starting up the computer, it now goes straight to Windows, without giving me the option of booting Ubuntu.   How can I get Ubuntu back?


I was given the following exercise as homework: find the limit of $b_{n+1} = \sqrt{2 + b_n}$, $b_1 = \sqrt{2}$, with a hint that $b_n < 2 \forall n \in \mathbb{N}$. I have proven that $b_n$ is strictly monotonically increasing and strictly bounded above by $2$ by using induction over $\mathbb{N}$ (which means that it has a limit, by the monotone convergence principle). However, now I need to prove that  $$2 = \text{sup}\{b_n : b \in \mathbb{N}\}$$  In order to prove that the limit is indeed $2$. By definition, I would only have to prove that $\forall \epsilon > 0 \exists n \in \mathbb{N} : 2 - \epsilon < b_n$, which is intuitively true, but I have been so far unable to prove it.  Any hints will be appreciated.

(Fitzpatrick Advanced Calculus 2e, Sec. 2.4 #12)  For $c \gt 0$, consider the quadratic equation $x^2 - x - c = 0, x > 0$.  Define the sequence $\{x_n\}$ recursively by fixing $|x_1| \lt c$ and then, if $n$ is an index for which $x_n$ has been defined, defining  $$x_{n+1} = \sqrt{c+x_n}$$  Prove that the sequence $\{x_n\}$ converges monotonically to the solution of the above equation.  Note: The answers below might assume $x_1 \gt 0$, but they still work, as we have $x_3 \gt 0$.    This is being repurposed in an effort to cut down on duplicates, see here: .  and here: .


I want to make something that has a black glossy shader when a light hits it, e.g. the sun, but when no light hits it at all it turns into an emission shader. I can't figure out how to actually do this, I've tried using the Light Ray inputs but it didn't work.

Essentially I want to turn a material into a kind of night-light. For this character I'm working on, I wanted the crystals on him to glow in the dark... And I got them to glow using various shader nodes. However I can't find a balance that looks bright enough in the dark, and not washed out in the light. So I was thinking perhaps there might be a node that could change the light emission of the crystals depending on the amount of light from external sources. In truth I don't even know if this is the best way to go about accomplishing what I want... Which is to have only barely semi-transparent crystals that glow brightly in the dark and appear as solid colors with a slight emission  when in the light. The other question is... will something like that carry over into unity? Because if not I'd rather save myself a lot of heartache. Here's a picture of what I have so far:


Show that $p\mid 2^n-n$ for infinitely many $n$. $p$ is a prime and $n$ is an integer.    I tried using Fermat's little theorem and got $2^p-p\equiv2\pmod p$ and $2^{p-1}-(p-1)\equiv2\pmod p$. So I can't even find one $n$ that satisfy the condition.   Any helps and hints appreciated. (even just one $n$ that works for every $p$)

I found the following question and can't make much headway with it.  Show that there exist infinitely many positive integers $n$ such that $2^n \equiv n \mod p$ where $p$ is a odd prime...  I started by writing the number as $n=(p-1)k+c$ which implies $$2^c \equiv c-k \mod p$$ where I used Fermat's Little theorem. Now if $k$ is of the form $pm$ for some integer $m$ we get $n=(p-1)(p)m+c$   $$2^c \equiv c \mod p$$ and we have reduced $n$ to some smaller integer $c$ but I can't figure out how to find the smallest number $c$ which would then generate infinitely many $n$.  Any help in finding a possible approach to this would be highly appreciated.


When I ran a command, I got the following error:     You need to be root to perform this command.   What is root and how can I become it?

I get this error whenever I try to install programs using the terminal:  home@ubuntu:~$ apt-get install myunity E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied) E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?   Also I'm unable to install updates using the terminal.


#include <iostream>  namespace oo{    class A{   public:     template<typename T>     static T get_value(){return static_cast<T>(55);}   };    template <typename T=A>   class B{     public:     static double f(){return T::get_value<double>();}   };  }  int main(int argc, char *argv[]) {   using std::cout;   using std::endl;    cout << oo::B<oo::A>::f() << endl;    return 0; }   Considering the example up here, it compiles with an error "type name is not allowed" which refers to "double" and arguments in "get_value()".  Someone has righted this wrong by rewriting the function f() as followed:  static double f(){return T::template get_value<double>(); }   Yet, I do not quite understand the use of "template" here. Could anyone explain that to me, please?  Thanks in advance for your comments.

In templates, where and why do I have to put typename and template on dependent names? What exactly are dependent names anyway?    I have the following code:  template <typename T, typename Tail> // Tail will be a UnionNode too. struct UnionNode : public Tail {     // ...     template<typename U> struct inUnion {         // Q: where to add typename/template here?         typedef Tail::inUnion<U> dummy;      };     template< > struct inUnion<T> {     }; }; template <typename T> // For the last node Tn. struct UnionNode<T, void> {     // ...     template<typename U> struct inUnion {         char fail[ -2 + (sizeof(U)%2) ]; // Cannot be instantiated for any U     };     template< > struct inUnion<T> {     }; };   The problem I have is in the typedef Tail::inUnion<U> dummy line. I'm fairly certain that inUnion is a dependent name, and VC++ is quite right in choking on it. I also know that I should be able to add template somewhere to tell the compiler that inUnion is a template-id. But where exactly? And should it then assume that inUnion is a class template, i.e. inUnion<U> names a type and not a function?


This question is answered a number of times in the net, but none of those answer resulted useful in my case.  The problem  Accessing a remote machine using private key, I usually require root permissions, which imply writing a long password and is annoying.  For the purpose of having sudo su, I tried following steps:   Ensure the line <user> ALL=(ALL) NOPASSWD: ALL is in /etc/sudoers Ensure the user is in sudo user group: $groups <user> ->  sudo   But trying sudo su will just prompt me for my own password: [sudo] password for <user>:  The question  How to have password-less sudo su?

On a sandbox VM environment, I have a setup of Ubuntu Linux which is firewalled and cannot be accessed from outside the local system.  Therefore, on that VM, I'd like to give the administrative user (which I set up) the ability to run anything with sudo and not need a password.  While I know this is not secure, this VM is not on all the time, and requires my personal passcode to run.  So even though this is not "secure", is there a way to get the desired functionality?


My attempt to prove is the following:  Suppose $(x,a) \in R$ and $(a,y) \in S$, since $R\circ S=S\circ R$ then $(a,y) \in R$ and $(x,a) \in S$.  Suppose $(y,b) \in R$ and $(b,z) \in S$, since $(a,y) \in R$ and $(y,b) \in R$ and $R$ is transitive then $(a,b) \in R$, once again because $R$ is transitive and $(x,a) \in R$ and $(a,b) \in R$ then $(x,b) \in R$.  Since $(x,b) \in R$ and $(b,z) \in S$ then $(x,z) \in R\circ S$ meaning it is transitive.  Is this answer correct?

Suppose $R$ and $S$ are transitive relations on $A$. Prove that if $S \circ R \subseteq R \circ S$ then $R \circ S$ is transitive.   First, I'm wondering if my proof is correct? Second, I'm really curious as to if there are any more elegant ways of proving this statement? It took me a long time of playing around with different possibilities to find this argument. Are there any shortcuts I am missing, or any related theorems about relations that people find are helpful when trying to prove statements like the one above? Here is my proof:   Suppose $S \circ R \subseteq R \circ S$. Let $x,y,z \in A$. Suppose $(x,y) \in R \circ S$ and $(y,z) \in R \circ S$. Since $(x,y) \in R \circ S$, we can choose some $a \in A$ such that $(x,a) \in S$ and $(a,y) \in R$. Similarly, since $(y,z) \in R \circ S$, we can choose some $b \in B$ such that $(y,b) \in S$ and $(b,z) \in R$. We have $(a,y) \in R$ and $(y,b) \in S$, so $(a,b) \in S \circ R$. Since $S \circ R \subseteq R \circ S$, $(a,b) \in R \circ S$, so we can choose some $c \in A$ such that $(a,c) \in S$ and $(c,b) \in R$. We have $(x,a) \in S$ and $(a,c) \in S$, so since $S$ is transitive, $(x,c) \in S$. We also have $(c,b) \in R$ and $(b,z) \in R$, so since $R$ is transitive, $(c,z) \in R$. Hence, $(x,c) \in S$ and $(c,z) \in R$, so $(x,z) \in R \circ S$.


I'm trying to make a soundboard and I wanted to add a class to make it run easier and I get more points with a class if I use it.  However I get a NullPointerException and I would like to know why the problem happened. If someone can explain it to me that would be perfect.  The NullPointerException occurs when calling `sound1.run().  import ddf.minim.*; import ddf.minim.analysis.*; import ddf.minim.effects.*; import ddf.minim.signals.*; import ddf.minim.spi.*; import ddf.minim.ugens.*;  PImage soundboard; PImage [] array= new PImage[0];  sound sound1;  Minim minim;  AudioPlayer player; Boolean player1= false;  void setup() {     size(451,385);     minim = new Minim(this);     player = minim.loadFile("deadmau5.mp3");     soundboard = loadImage("sb.png"); }  void draw() {     image(soundboard,1,CENTER);     sound1.run(); }  void mousePressed() {     player1=!player1;     if (player1) {         player.play();     } else {         player.pause();     player.rewind();     } }  class sound {      float x = 1;     float y = 1;      void run() {         draw();     }      void draw() {         rect(x,y,100,100);          }   }     One more question that I must ask: when I rewrite code, sometimes it overwrites on my current code and I want to know how to stop that, even if I use space it still overwrites the code.   Thank you guys!

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 citing a book in my report. I want to add the equation number to the reference i.e. I want the reference to appear like [10, eq.8.145].  Thank you.

I would like to cite the item (iii) of proposition 3 of a reference. How can I do it? Which ways do you suggest? This is a question not only about LaTeX, but also about style. One option I have seen to cite pages of a reference is \cite[p.~333]{Audet}. Is there something similar to cite theorems, propositions and so on?


How can I get the highest Damage-Per-Round (both melee and ranged using pact weapon and Eldritch Blast) and AC possible (with DPR being more important than AC) with a Variant Human Blade Pact Warlock (Fiend)? Assume the character uses standard ability array or uses point-buy and prioritizes STR, CHA, and CON in that order. Also assume multiclassing and feats are allowed.

How can I get the highest Damage-Per-Round (both melee and ranged using pact weapon and Eldritch Blast) and AC possible (with DPR being more important than AC) with a Dragonborn Warlock taking the Pact of the Blade and a Fiend as otherworldly patron? Assume the character has the standard ability array or uses point-buy and prioritizes STR, CHA, and CON in that order. Also assume multiclassing and feats are allowed.


This is my code, where after searching a lot and working around. I couldn't seem to resolve my problem.  Really sorry for this trivial problem  \documentclass[12pt,twoside]{report} \usepackage[utf8]{inputenc} \usepackage{graphicx} \graphicspath{ {images/} } \usepackage{mathtools} \usepackage[caption=false]{subfig} %\usepackage{caption} %\usepackage{subcaption} %\usepackage[a4paper]{geometry} \usepackage{graphicx,bm} \usepackage{physics} \usepackage{dsfont} \usepackage{xcolor} \usepackage{breqn}   \colorlet{linkequation}{red} \usepackage[colorlinks,linkcolor=red]{hyperref} \newcommand*{\field}[1]{\mathbb{#1}}%  \usepackage[style=authoryear]{biblatex} \addbibresource{thesisbib.bib} \title{     {My most productive work}\\     {\large Institute}\\     {} } \author{Name} \date{Day Month Year}  \begin{document}      \maketitle \chapter*{Abstract} Abstract goes here  \chapter*{Dedication} To mum and dad  \chapter*{Declaration} I declare this and that..  \chapter*{Acknowledgements} I want to thank you all...  \tableofcontents  \chapter{Introduction} \input{introduction}  \chapter{Experiments} \input{chapter02/chapter02}  \chapter{Theory 1} \input{chapter03/chapter03}  \chapter{Theory 2} \input{chapter04/chapter04}  \chapter{Theory 3} \input{chapter05/chapter05}  \chapter{Conclusion} \input{conclusion}  \printbibliography \end{document}   Output doesn't seem to give any bibliography. I'm using \parencite in order to cite my references.  The error I'm getting.       This is BibTeX, Version 0.99d (TeX Live 2018) The top-level auxiliary file: Thesis.aux I found no \citation commands---while reading file Thesis.aux I found no \bibdata command---while reading file Thesis.aux I found no \bibstyle command---while reading file Thesis.aux (There were 3 error messages)

Running the minimal example  \documentclass{article} \usepackage{filecontents} \begin{filecontents*}{\jobname.bib} @ARTICLE{example,   author  = {Other, Anthony Norman},   title   = {Some things I did},   year    = {2014},   journal = {J.~Irrep. Res.},   volume  = {1},   number  = {1},   pages   = {1-10} } \end{filecontents*} \usepackage[backend=biber]{biblatex} \addbibresource{\jobname.bib} \begin{document} Hello\cite{example}. \printbibliography \end{document}   I get the warning There were undefined references.  I have read  and know that I need to run:   LaTeX Biber LaTeX   However, my editor is only set up to run BibTeX. How do I go about setting up my editor/IDE to be able to run Biber, and how do I run the LaTeX/Biber/LaTeX cycle?  Answers (sorted alphabetically by editor name)                    Answer guidelines   Each answer should be for one editor. If the editor is cross-platform, if possible give a single answer with notes covering the minor platform variations. Please edit the question to include new answers in the 'link list' Each answer should be 'stand alone', i.e. don't say 'It's almost the same as editor Y but ...' for the editor part Instructions for 'build tools' such as arara or latexmk are welcome but should explain how to set up the editor in question as not all editors allow simple addition of arbitrary tools


I am trying to draw an image in my frame but I keep getting a NullPointerException. Here is what I have so far  package windows; import BreezyGUI.*;  import java.awt.Graphics; import java.awt.Label; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; import javax.imageio.ImageIO;  public class Title extends GBFrame{     static Graphics g ;     private BufferedImage bg;     public Title(){         bg = null;         try {             bg = ImageIO.read(new File("resources/images/TitleImage.png").toURI().toURL());         } catch (IOException e) {             e.printStackTrace();         }         g.drawImage(bg, 0, 0, null);     } }   but it always ends up printing:  Exception in thread "main" java.lang.NullPointerException at windows.Title.<init>(Title.java:22)   The image i need, TitleImage.png, is inside the folder "images" in the source folder "resources".  Any help for a beginner is appreciated.


I have a collection of Bernoulli RVs $\{X_1, \ldots, X_N\}$ and know the success probabilities of each: $\{p_1, \ldots, p_N\}$.  Is there, in general, a way to efficiently compute the probability of observing at least $K$ successes without enumerating possible outcomes?

I'm trying to figure out an algorithm to compute the probability of obtaining at least k successes after N independent events that have different probabilities of success, i.e., the probability of obtaining at least k heads on N coin flips where each flip has its own probability of heads.  I think this is called a Poisson Binomial distribution and I suspect the solution may involve dynamic programming, but I need help getting started.


After installing Ubuntu on my HP pavilion DV6 through CD version 16.04 and erasing Windows, computer turns to black screen everytime I boot. I have done some research and the fn+F3 doesn't seem to work (increasing brightness) my computer is quite old and the F10 key for example doesn't work... The only option I have now is to Press escape while boot Press E to change parameters Erase "quiet splash" either for Nothing or for "acpi_backlight=vendor" .   "nomodeset" also allows me to start the computer and use it normally. What I would like now is to save these changes so I could start the computer normally with no manipulation.   The problem is I can't seem to find a way to save these changes and make them default. Thank you for your time and attention !  Michael

I need to add the boot parameter foo=bar to my kernel. How can I do this once for testing, and permanently if testing was a success?


Suppose I have one binary predictor $x$ and I fit an OLS model: $$y = \alpha + \beta I(x=1) + \epsilon$$ Alternatively I can fit the following model $$y = \beta I(x=1) + \beta I(x=0) + \epsilon$$ Why does the second model give me a higher R-Squared? R example: results <- numeric(1000) for(i in 1:1000) {   X <- rnorm(1000)   b <- X > 0      y <- rep(0, 1000)   y[b == TRUE] <- 1      y <- y + rnorm(1000)      rsq0 <- summary(lm(y ~ b))$r.squared   rsq1 <- summary(lm(y ~ b - 1))$r.squared      results[i] <- rsq1 - rsq0 }  mean(results > 0) # This equals 1

In a simple linear model with a single explanatory variable,  $\alpha_i = \beta_0 + \beta_1 \delta_i + \epsilon_i$  I find that removing the intercept term improves the fit greatly (value of $R^2$ goes from 0.3 to 0.9). However, the intercept term appears to be statistically significant.  With intercept:   Call: lm(formula = alpha ~ delta, data = cf)  Residuals:      Min       1Q   Median       3Q      Max  -0.72138 -0.15619 -0.03744  0.14189  0.70305   Coefficients:             Estimate Std. Error t value Pr(>|t|)     (Intercept)  0.48408    0.05397    8.97   <2e-16 *** delta        0.46112    0.04595   10.04   <2e-16 *** --- Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1   Residual standard error: 0.2435 on 218 degrees of freedom Multiple R-squared: 0.316,    Adjusted R-squared: 0.3129  F-statistic: 100.7 on 1 and 218 DF,  p-value: < 2.2e-16    Without intercept:   Call: lm(formula = alpha ~ 0 + delta, data = cf)  Residuals:      Min       1Q   Median       3Q      Max  -0.92474 -0.15021  0.05114  0.21078  0.85480   Coefficients:       Estimate Std. Error t value Pr(>|t|)     delta  0.85374    0.01632   52.33   <2e-16 *** --- Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1   Residual standard error: 0.2842 on 219 degrees of freedom Multiple R-squared: 0.9259,   Adjusted R-squared: 0.9256  F-statistic:  2738 on 1 and 219 DF,  p-value: < 2.2e-16    How would you interpret these results? Should an intercept term be included in the model or not?  Edit  Here's the residual sums of squares:  RSS(with intercept) = 12.92305 RSS(without intercept) = 17.69277


I don't have sufficient rep, but I'd like to accept as a duplicate    Should we be able to add a vote to close for duplicate if we asked it, even if the rep is too low.

Okay, take this question:   I found out that there was essentially a duplicate question of mine, but specified in very different terms than the question I asked. Therefore, to aid future searchers or search engines, I don't want to delete the question -- people searching using the phrases I used should be able to find the duplicate question. But people shouldn't be allowed to post to my question either, because it is a duplicate.  However, there's no way to really tell the engine that the question should be closed as a dupe.  If the community thinks that the question is not a dupe, then one could use the same 5 vote reopen scheme used for current closures.  (For the record, I saw  which is similar, but what I'm looking for is more specific in that I think the only valid closure reason should be duplication)


In my HTML I have a div:  <div id="devicelayout">     Some text here </div>   and corresponding CSS:  #devicelayout {     width:1078px; }   Once my page is loaded, how do I change the rules of CSS #devicelayout?

I know it is possible to add new CSS classes definitions at runtime through JavaScript. But... How to change/remove CSS classes definitions at runtime? For instance, supose a I have the class below: <style> .menu { font-size: 12px; } </style>  What I want is, at runtime, change the font-size rule of the .menu class, so that every element in the page who uses this class will be affected. And, I also want to know how to remove the .menu class definition.


I saw a post about fix your alias in .bashrc.   And he says after you put your alias in .bashrc , you need to use:  . ~/.bashrc   I do not quite understand what the first dot(' . ') does here. What's its function and what is it called?

I came across this example when trying to mount a usb device inside a openvz container and I have never seen the construct in the second line before. Can you explain what it signifies?  #!/bin/bash . /etc/vz/vz.conf


var a = Date; Object.defineProperty(window, "Date", { get: function() { console.log(this); return a; } });  (new Date); Date();   How can I know, when Date is being called as a constructor(with "new"), and when it's being called as a function?  Update  answers don't work for this case. this is always equal to a window

Given a function:  function x(arg) { return 30; }   You can call it two ways:  result = x(4); result = new x(4);   The first returns 30, the second returns an object.  How can you detect which way the function was called inside the function itself?  Whatever your solution is, it must work with the following invocation as well:  var Z = new x();  Z.lolol = x;  Z.lolol();   All the solutions currently think the Z.lolol() is calling it as a constructor.


I've tried looking at posts on this issue but am still having some trouble with this error in my code. So in the fourth line, I create an instance variable called SongDatabase to access the SongDatabase class. But when I get down to the line, SongDatabase.addNewSong(); under case 1, I get a java.lang.NullPointerException: null error.  Interface class:  public class Interface  {     Scanner console = new Scanner(System.in);     private SongDatabase SongDatabase;      public static void main(String[] args) {         Interface intFace = new Interface();         intFace.run();     }      private void run() {         switch (userInput) {         case 1:              SongDatabase.addNewSong();             break;         case 2:             SongDatabase.removeSong();             break;         case 3:             SongDatabase.sortSongs();             break;         default:             System.out.println("Please enter a valid number.");             break;      } }   SongDatabase class:  public class SongDatabase {     Scanner console = new Scanner(System.in);       private Song song1, song2, song3, song4;  public void addNewSong() {                 if (song1 == null) {             song1 = getFromUser();         }         else if (song2 == null) {             song2 = getFromUser();         }             else if (song3 == null) {             song3 = getFromUser();         }         else if (song4 == null) {             song4 = getFromUser();         }         else {         System.out.println("The database is currently full. Please delete a song before adding a new one.");        }         }   I've stepped through the debugger and I know that the instance variable, SongDatabase = null, which is probably causing the error? I previously had a line   SongDatabase SongDatabase = new SongDatabase(); SongDatabase.addNewSong();   instead, but I realised this was creating a new SongDatabase object everytime and wiping what I had stored in there so I had to change it. I'd really appreciate a solution because I have no clue, thanks!

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?


How can we prove the inequality $e^x \le x + e^{x^2}$ for $x\in\mathbb{R}$?

Does anybody have a simple proof this inequality  $$e^x\le x+e^{x^2}.$$  Thanks.


Consider the following problem:     Let $a_1, \ldots, a_n$ and $b_1, \ldots, b_n$ be real numbers such that   $$a_1^k+\cdots a_n^k= b_1^k+ \cdots+b_n^k$$   for all $1\leq k\leq n$.   Then there is a bijection $\varphi:\{1, 2, \ldots, n\}\to \{1, 2, \ldots, n\}$ such that $a_i=b_{\varphi(i)}$ for all $i$.   This can be proved using , which gives that the polynomials $p(x)=(x-a_1)\cdots(x-a_n)$ and $q(x)=(x-b_1)\cdots(x-b_n)$ are identical.  My question is, can this be said about countable sequences. More precisely, is the following true?     Let $a_1, a_2, a_3, \ldots$ and $b_1, b_2, b_3,\ldots$ be real numbers such that   $$a_1^k+a_2^k+a_3^k+\cdots = b_1^k+ b_2^k+b_3^k+ \cdots$$   are equal for all $k\geq 1$ (Here we insist that both sums are convergent for each $k$).   Then there is a bijection $\varphi:\mathbb N \to \mathbb N$ such that $a_i=b_{\varphi(i)}$ for all $i$.

Let $(a_n)_{n≥0}$ and $(b_n)_{n≥0}$ be two sequences of a nomed algebra such that $\sum{\| a_n\|}$ and $\sum{\| b_n\|}$ converge, and$ $$$\forall n, \  a_n, b_n \neq 0$$  Show that $(\forall  k \in \mathbb N^*,  \ \sum_{n=0}^{\infty}{a_n}^k = \sum_{n=0}^{\infty}{b_n}^k) \implies \exists\ \sigma \in{\mathfrak S}_{\mathbb N} \ ,\ (a_n) = (b_{\sigma(n)})$  The vector-space should be a finite-dimensional $\mathbb R$-vector-space.   I do not see how to deal with the hypothesis. If you have ideas/hints...  It would be relevant to deal with complex sequences even if it is less general. But I don't think one can generalize using real and complex cases.


I am looking for a ring element which is irreducible but not prime.    So necessarily the ring can't be a PID. My idea was to consider $R=K[x,y]$ and $x+y\in R$.  This is irreducible because in any product $x+y=fg$ only one factor, say f, can have a $x$ in it (otherwise we get $x^2$ in the product). And actually then there can be no $y$ in $g$ either because $x+y$ has no mixed terms. Thus $g$ is just an element from $K$, i.e. a unit.  I got stuck at proving that $x+y$ is not prime. First off, is this even true? If so, how can I see it?

Show that $2,3, 1-\sqrt{-5}, 1+\sqrt{-5}$ are irreducible over $\mathbb{Z}[\sqrt{-5}]$, but not prime and that 1 and -1 are the only units.   Let $N$ be the norm map into $\mathbb{Z}$ and let u denote the unit, then because it is a homomorphism it follows that :   $N(xy)=N(x)N(y)$ and thus with $N(u)N(u^{-1})=N(uu^{-1})=N(1)$ it follows that the norm of u is a divider of 1 and thus also a unit of $\mathbb{Z}$. Therefore we have in $\mathbb{Z}[\sqrt{-5}]$: $\forall a,b \in \mathbb{Z}: N(a+b\sqrt{-5})=(a+b\sqrt{-5})(a-b\sqrt{-5})=a^{2}+5b^{2}=1 \ \ \Rightarrow u= \pm 1$  Now it is to show that $2,3,1-\sqrt{-5}, 1+\sqrt{-5}$ are irreducible over $\mathbb{Z}[\sqrt{-5}]: $  Assume $1-\sqrt{-5}$ is reducible, then there must exist $a,b \in \mathbb{Z}[\sqrt{-5}]$ so that $N(1-\sqrt{-5})=N(a)N(b) \Rightarrow N(a)=N(b)= \pm (1-\sqrt{-5})$ But since $1-\sqrt{-5}$ is not a quadratic remainder of $5$, there doesn't exist a solution for the equations $a^{2}+5b^{2}= \pm (1-\sqrt{-5})$ And the exactly same argument also works for $2,3$ and $1+\sqrt{-5}$.  Thus we have shown that $2,3,1\pm \sqrt{-5}$ are not reducible over $\mathbb{Z}[\sqrt{-5}]$.   Now we show that they are not prime:   Assume that 2 is a prime in $\mathbb{Z}[\sqrt{-5}]$, then because of $2\cdot 3 = (1-\sqrt{-5})(1+\sqrt{-5})=6$ it must hold that $2|(1-\sqrt{-5})$ or $2|(1+\sqrt{-5})$. But with $a,b \in \mathbb{Z}[\sqrt{-5}]$ it immediately follows that for :   $(1\pm\sqrt{-5})= 2(a+b\sqrt{-5})$ $2b = \pm 1$. So 2 is not a prime in $\mathbb{Z}[\sqrt{-5}]$.   Assume that 3 is a prime in $\mathbb{Z}[\sqrt{-5}$, then: $(1\pm \sqrt{-5}) = 3(a+b\sqrt{-5}) \Rightarrow 3b= \pm 1$ it follows that 3 is not a prime in $\mathbb{Z}[\sqrt{-5}]$.  Assume that $1\pm \sqrt{-5}$ is a prime in $\mathbb{Z}[\sqrt{-5}]$, then: $3 = (1\pm \sqrt{-5})(a+b\sqrt{-5}) \Rightarrow (1\pm \sqrt{-5} )a = 3$ which is not solvable in $\mathbb{Z}$. And also $2=(1\pm \sqrt{-5})(a+b\sqrt{-5})=(1\pm \sqrt{-5})a$ which is also not solvable in $\mathbb{Z}$ and thus $(1\pm \sqrt{-5})$ can not be a prime in $\mathbb{Z}[\sqrt{-5}]$.   Tell me if this proof is correct. Please.


If $\sum_na_n=\infty$ and $a_n\downarrow 0$ then $\sum\limits_n\min(a_{n},\frac{1}{n})=\infty$     My  idea:  $$b_{n}=\min(a_{n},\tfrac{1}{n})\Longrightarrow b_{n}\le a_{n},b_{n}\le\tfrac{1}{n}$$ then I don't know how to go on.

Let $a_n$ be a sequence decreasing to $0$, and $\sum {{a_n} = \infty } $.   Show that:$$\sum {\min \left( {{a_n},{1 \over n}} \right)}  = \infty $$   If there's $N_0$ such that $\forall n>N_0: \min(a_n, {1\over n}) = {1\over n}$  or $\forall n>N_0: \min(a_n, {1\over n}) = a_n$ then, the problem is trivial.    Otherwise, let us define $b_n = \min(a_n, {1\over n})$ and two subsequences: $$b_{n_k} = {1 \over n_k},\quad b_{n_l} = a_{n_l}$$  $$\sum {{b_n} = } \sum {{b_{{n_k}}}}  + \sum {{b_{{n_l}}}}  = \infty  + \infty $$  Is that right?


I am implementing some default styles for a div for a "condition id" as (id="default")
 /* if(id == "default") */   I need to set some other styles (class="changeStyle"), if the "condition id" is changed i.e. (id != "default")
 /*if(id != "default") */   which should be added dynamically, if it's finding the (id != "default").   Any suggesstion/example would be highly appreciated.

How can I change the class of an HTML element in response to an onclick or any other events using JavaScript?


I am having troubles understanding variables {_,0} in the following example.  In script tmp.sh:  func()  { echo $_ echo $0 echo $1 }   calling tmp.sh with parameter x:  ~$ ./tmp.sh x ./tmp.sh ./tmp.sh x   and sourced tmp.sh with parameter x:  ~$ . ./tmp.sh x x bash x   As I understand $_ and $0, the later is for the first argument as in first example it's ./tmp.sh. Why it's equivalent to bash in the second example?  What does . expand to, and the former, which I am not sure about, return last parameter with sourced bash, and equivalent to $0 in unsourced bash. Is that the case?

Could you explain the following sentences from Bash manual about $_, especially the parts in bold,  maybe with some examples?      At shell startup, set to the absolute pathname used to   invoke the shell or shell script being executed as passed in the environment   or argument list.      Subsequently, expands to the last argument to the previous   command, after expansion.      Also set to the full pathname used to invoke each   command executed and placed in the environment exported to that command.     When checking mail, this parameter holds the name of the mail file.


.pdf files supports , you can view the model from any angle by mouse movements - sort of like looking through the viewport, only the object is fully rendered, "real", etc. This requires a .ud3 file. Blender does not export a .ud3 file. Any alternatives to achieve this?

I would like to have a way of getting the design sheets(aka blueprints) like you can in CAD software.  Is there a plugin or addon or some form of python script that can export a PDF(vector screenshot) of the GUI(primarily the 3D view)?


Id like to know how the complex numbers are derived from axioms. Most textbooks talk of them as starting from the complex plane. Is there a way to derive the complex properties from say the properties of fields or is there some peano axiom like system for complex numbers.

I posted this question nearly 10 days ago, but am still really not satisfied with the answers I got, I have no prior education in abstract algebra, group theory, or other abstractions, and most of the answers I got involved defining sets, groups and other things I am unfamiliar with, my question was,  How does one know the notion of real numbers is compatible with the axioms defined for complex numbers, ie how does one know that by defining an operator '$i$' with the property that $i^2=-1$, we will not in some way contradict some statement that is an outcome of the real numbers.  For example if I defined an operator x with the property that $x^{2n}=-1$, and $x^{2n+1}=1$, for all integers n, this operator is not consistent when used compatibly with properties of the real numbers, since I would have $x^2=-1$, $x^3=1$,thus $x^5=-1$, but I defined $x^5$ to be equal to 1.  How do I know I wont encounter such a contradiction based upon the axioms of the complex numbers.  I reiterate here again, Please don't use terminology, or abstract math, that hasn't been taught in say a thorough collage level calculus 1 course.  Here's a link to the same question I asked 8 or so days ago:


After installing windows 10 as second partition I used EasyBCD2.3 to start ubuntu as well. After 1 week of working fine now none of the OS willt start. It says that     BOOTMGR is missing   Should I reinstall both operating systems or is there any other solution?

I installed Windows 7, which ate Ubuntu's boot file. When starting up the computer, it now goes straight to Windows, without giving me the option of booting Ubuntu.   How can I get Ubuntu back?


I'm relatively new to C++ and I feel like I'm in over my head. I'm trying to create a graph structure that can take any kind of data by using templates. Here is c_graph.h  #pragma once #include <vector> #include <unordered_map> #include <unordered_set>  template <class T> class c_graph {     private:         std::unordered_map<T,std::unordered_set<T>> adj_matrix;      public:          '' GRAPH OPERATIONS OMITTED '' };  template <class M> struct node { public:     M val;      node() {      }      node(M v) {         val = v;     } };   I would like to support using data directly (hence the template T on the graph), or wrapping the data in a node struct, which is defined at the bottom. My reason for the node struct is sometimes you want different nodes in the graph to have the same data, which wouldn't work with the unordered_map on the outside of the adjacency matrix without a data wrapper.  However I've run into an issue with the unordered_set class. It doesn't have a hash function for node. I read about this problem online and the solution seems to be something like  namespace std {     template <class M> class hash<node<M>> {     public:         size_t operator()(const node<M> &n) const         {             return reinterpret_cast<size_t>(&n);         }     }; };   I have another .cpp file that is trying to use c_graph<node<char>>  However for the life of me I can't get my code to compile. I've tried placing the hash snippet inside c_graph.h, where I get a bunch of linker errors  error LNK2019: unresolved external symbol "public: void __thiscall c_graph<struct node<char> >::add_node(struct node<char>)"...    and I've tried placing it inside c_graph.cpp, where I get  error C2338: The C++ Standard doesn't provide a hash for this type.

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


I copied the twig file from the user view in my theme.  I want to display:   "Online" if the user is logged in. "Absent" if the user has not had any activity for more than 15 minutes. "Offline" if the user is disconnected.   How to do this with twig ?  {# /**  * @file  * Default theme implementation to present all user data.  *  * This template is used when viewing a registered user's page,  * e.g., example.com/user/123. 123 being the user's ID.  *  * Available variables:  * - content: A list of content items. Use 'content' to print all content, or  *   print a subset such as 'content.field_example'. Fields attached to a user  *   such as 'user_picture' are available as 'content.user_picture'.  * - attributes: HTML attributes for the container element.  * - user: A Drupal User entity.  *  * @see template_preprocess_user()  *  * @ingroup themeable  */ #}

      {{ content.user_picture }}     {{ user.label }}      {% if logged_in %}        En ligne     {% else %}        Hors ligne     {% endif %}

   The preceding code displays the status of the current user.  For example for comments I want to display the status of the author of the comment (not the node). I have this line of code in the comments twig file.  Can I reuse the code to obtain the status of the author of the comment ?  {{ drupal_entity('user', comment.uid.target_id, 'comment') }}

I want to display the status of the user on the account page. I added the following code in the theme I am using. It works, but users are never displayed offline. Why? What is wrong in the code? user.html.twig
   {% if status == 'Online' %}      Online   {% elseif status == 'Absent' %}      Absent   {% else %}      Offline   {% endif %}
  bootstrap_subtheme_front_office.theme <?php /**  * @file  * Bootstrap sub-theme.  *  * Place your custom PHP code in this file.  */  use Drupal\Core\Database\Database;  /**  * Implements hook_entity_presave().  */ function bootstrap_subtheme_front_office_preprocess_user(&$variables) {   // get user object   $user = $variables['elements']['#user'];   //- The user has logged in at least once   if ($user->getLastLoginTime()) {     if (account_is_logged_in_less_then_thirty_minutes($user->id())) {       $status = 'Online';     }     else {       $status = 'Absent';     }   }   else {     $status = 'Offline';   }   $variables['status'] = $status; }  /**  * @param $uid  *  * @return bool  */ function account_is_logged_in_less_then_thirty_minutes($uid) {   $connection = Database::getConnection();   $query = $connection->select('sessions', 'sessions')     ->fields('sessions', ['sid', 'uid', 'timestamp'])     ->condition('sessions.uid', $uid, '=')     //- chef if the user was online in 30 minutes (60 * 30)     ->condition('sessions.timestamp', \Drupal::time()         ->getRequestTime() - (60 * 30), '>')     ->execute();   //- Get result.   $results = $query->fetchAll(\PDO::FETCH_OBJ);   return (count($results) > 0) ? TRUE : FALSE; }


have a custom setting called product and under that i created two fields called and other is string field BD__c. i want to display picklist value based on string matching record. my custom setting looks like  AAA |1,2,6,8|| common for all BBB |1,2,6,8 || common for all NNN|8 || only when BD is 8  CCC| 1,2,6|| only when BD is 1,2,6 DDD|1,2,6 || only when BD is 1,2,6 I configured the custom setting as above   so my require is to display AAA BBB CCC and DDD when BD is 1,2 or 6, and Display NNN,AAA,BBB when  it is 1or 2,6. so when string value is 1,2,6,8 it should show AAA, BBB when its 8 it should show NNN, but i can see all the values even if BD__c==8 Here is my apex controller method. can someone suggest me what i am missing Or can someone just help me how to disply values on controller based on other field value. i also tried to print the value by using getvalue() but it is though null pointer exception and when i ma fetch data though. getall(0 it is display`` all the data is all the condition  public List < SelectOption > getTR_picklistvalue() {     system.debug('******Start of getTR_picklistvalue');     List < SelectOption > options = new List < SelectOption > ();     options.add(new SelectOption('', '--Select--'));     Map < String, picklistvalue__c > Prod = picklistvalue__c.getAll();     List < String > keys = new List < String > (Prod.keySet());     keys.sort();     for (String key: keys) {         if (Prod.get(Key).BD__c == '1,2,6,8')             Options.add(new SelectOption(Prod.get(Key).picklistvalue__c, Prod.get(Key).Name));         else             Options.add(new SelectOption(Prod.get(Key).picklistvalue__c, Prod.get(Key).Name));         //options.sort();     }     return options;  }//get all value ..not showing data based on condition   `  /**   public List<SelectOption> getTR_applicationlist() {                system.debug('******Start of getTR_applicationlist');         List<SelectOption> options = new List<SelectOption>();         options.add(new SelectOption('','--Select--'));          Map<String, applicationlist__c> Prod = applicationlist__c.getAll();            for(String ProdValue  :Prod){         applicationlist__c Prod1 = applicationlist__c.getValues('1,2,6,8');            if(Prod1 != null){              String applicationValue1 = Prod1.application__c;             string applicationName1 = Prod1.Name;                                   options.add(new SelectOption('applicationValue1','applicationName1'));}            if(currentUser.LR_Firm_ID__c != null && currentUser.LR_Firm_ID__c == 8){                          applicationlist__c Prod2 = applicationlist__c.getValues('8');                String applicationValue2 = Prod2.application__c;                string applicationName2 = Prod2.Name;                 if(Prod2 != null){                               options.add(new SelectOption('applicationValue2','applicationName2'));}}             else{              applicationlist__c Prod3 = applicationlist__c.getValues('1,2,6');                 if(Prod3 != null){                 String applicationValue3 = Prod3.application__c;                string applicationName3 = Prod3.Name;                    options.add(new SelectOption('applicationValue3','applicationName3'));}            }  }        return options; } **/   // using getinstance method thoghing null pointerexception

i have a custom setting called product and under that i created two fields called  and other is string field BD__c. i want to display picklist value based on string matching record. my custom setting looks like AAA |1,2,6,8 BBB |1,2,6,8 NNN|8 so when string value is 1,2,6,8 it should show AAA, BBB when its 8 it should show NNN, but i can see all the values even if BD__c==8  Here is my apex contoller method. can someone suggest me what i am missing  public List < SelectOption > getTR_picklistvalue() {     system.debug('******Start of getTR_picklistvalue');     List < SelectOption > options = new List < SelectOption > ();     options.add(new SelectOption('', '--Select--'));     Map < String, picklistvalue__c > Prod = picklistvalue__c.getAll();     List < String > keys = new List < String > (Prod.keySet());     keys.sort();     for (String key: keys) {         if (Prod.get(Key).BD__c == '1,2,6,8')             Options.add(new SelectOption(Prod.get(Key).picklistvalue__c, Prod.get(Key).Name));         else             Options.add(new SelectOption(Prod.get(Key).picklistvalue__c, Prod.get(Key).Name));         //options.sort();     }     return options;  }


Is there a way to tweak the regional settings and , while preserving greek locale, I can change the decimal separator to en_US? as this is necessary for google earth to work ?   I don't see any button to change the number format in the Language Support dialog.

At System → Administration → Language support →  Text. I can only choose standard locales, but I would like to fine-tune. For example in Windows I could customise things like time and date format, measure units, decimal separator, currency, etc manually - how can I do this in Ubuntu?


If I update a method parameter to a new object will this be available for the entirety of the JVM life?  For example:  Class 1:  Pojo p = new Pojo("A");  class2.method2(p)  Class 2:  public void method2(Pojo p) {   p = new Pojo("B"); }   I know this is a bit of a silly example and the new object should be returned instead of updated like this but curious to know what the behavior will be in terms of scopes / garbage collection.

I always thought Java uses pass-by-reference. However, I've seen a couple of blog posts (for example, ) that claim that it isn't (the blog post says that Java uses pass-by-value). I don't think I understand the distinction they're making. What is the explanation?


Let G be finite group,z(G) denotes center of Group of index n,then number of elements in every conjugacy class are almost n.

If the center of a group $G$ is of index $n$, prove that every conjugacy class has at most $n$ elements. (This question is from Dummit and Foote, page 130, 3rd edition.)  Here is my attempt: we have  $|G| =|C_G (g_i)| | G : C_G (g_i)| $  $|C_G (g_i)| =|Z(G)| \cdot  |C_G (g_i):Z(G)| $.  Then   $|G|= |Z(G)|\cdot |C_G (g_i):Z(G)|\cdot | G : C_G (g_i)| $.  Then  $n = |C_G (g_i):Z(G)|\cdot  | G : C_G (g_i)| $.  But $|C_G (g_i):Z(G)|$ is positive integar as  $ Z(G)$ is   subgroup of  $C_G (g_i)$.  If $| G : C_G (g_i)|$ bigger than $n$, then $|C_G (g_i):Z(G)|\cdot | G : C_G (g_i)|$ is bigger than $n $.  But   $|C_G (g_i):Z(G)|\cdot | G : C_G (g_i)|=n$, contradiction.  Then $| G : C_G (g_i)|\le n$ and this completes the proof.   Is this proof right or not ??!!!


While reviewing definite integrals, $\int_a^bf(x)dx$; I recalled that a definite integral could not only be solved by the difference of the anti-derivatives of intervals b and a, $F(b)-F(a)$, via the 2nd fundamental theorem of calculus, but also through the Riemann summation: $$\lim_{n\to\infty}f(x_i^*)\Delta x;\ \textrm{where}\ \Delta x=\frac{b-a}{n}\ \textrm{and}\ x_i^*=a+(\Delta x)i$$ Given this, I tried out an integral over an example polynomial. The difference of anti-derivatives would've given a sufficient answer, but I wanted to try it with Riemann sums. While attempting to solve this example, I came across sums of the form $\sum_{i=1}^ni^k$. Thankfully, I recalled the formulas for $k=\{1,2,3\}$ which were as follows: $$\sum_{i=1}^ni^1=\frac{n\cdot(n+1)}{2}$$ $$\sum_{i=1}^ni^2=\frac{n\cdot(n+1)\cdot(2n+1)}{6}$$ $$\sum_{i=1}^ni^3=\frac{n^2\cdot(n+1)^2}{4}$$ This allowed me to solve the problem, however I wondered about orders of k greater than 3. What is the general formula for $\sum_{i=1}^ni^k$ given any value of k and how would I prove it?

Who knows about the summation of this series: $$\sum\limits_{i=1}^{n}i^m $$  where $m$ is constant and $m\in \mathbb{N}$?  thanks


I was solving a few questions involving dynamic programming. I initialized the dp table as - n = 3 dp = [[False]*n]*n print(dp)  #Output - [[False, False, False], [False, False, False], [False, False, False]]  Followed by which I set the diagonal elements to True using - for i in range(n):     dp[i][i] = True  print(dp)  #Output - [[True, True, True], [True, True, True], [True, True, True]]  However, the above sets every value in dp to True. But when I initialize dp as - dp = [[False]*n for i in range(n)]  Followed by setting diagonal elements to True, I get the correct output - [[True, False, False], [False, True, False], [False, False, True]] So how exactly does the star operator generate values of the list?

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


I'm not certain if this is possible in Java. Also, I'm not able to figure out what to query on Google for this. Anyway, I want a method that takes as an argument a Class (interface or class) and the method's return type is an instance of that Class. I don't want to have to recast an Object after the fact.  I'm not certain if this feature exists or what the syntax would be. Let's say I have a class named XYZ and here is my pseudo method.  private XYZ createInstance(XYZ.class, other args) {   ...   // create an instance of XYZ with other args named "_xyz_"   ...   return _xyz_; }   Now assume XYZ is some sort of generic syntax. Is this possible at all in Java? Thanks for any help.

Is it possible to create an instance of a generic type in Java? I'm thinking based on what I've seen that the answer is no (due to type erasure), but I'd be interested if anyone can see something I'm missing:  class SomeContainer<E> {     E createContents()     {         return what???     } }   EDIT: It turns out that  could be used to resolve my issue, but it requires a lot of reflection-based code, as some of the answers below have indicated.  I'll leave this open for a little while to see if anyone comes up with anything dramatically different than Ian Robertson's .


Prove or disprove:  Suppose that a and b are positive integer then φ($a^b$) = a$^{b-1}$ φ(a)  I try many positive integer and I think it is true statement but please any help how can I start to prove it if it is true statement ?!  I know that if a is prime then φ($a^b$) =$a^b$ - $a^{b-1}$ and φ(a)=a-1.

Possible Duplicate:             For positive integers $m$ and $n$ where $d=gcd(m,n)$, show that $$\phi(mn) = \phi(m)\phi(n)\frac{d}{\phi(d)}$$   This is just the generalization of the multiplicative property of phi function.I have tried to solve this in the same way as the proof of multiplicative property but couldn't get far.Please help.


Every once in a while, I hear about how Darth Vader's name translates to "Darth Father", so those who spoke a foreign language had a clue that he was someone's father. One high profile example of this is Pitch Perfect, where a character who had never seen The Empire Strikes Back predicts the twist ending:  Beca: [Movie endings] are so predictable, like, the guy gets the girl, and that kid sees dead people, and Darth Vader is Luke's father. Jesse: Oh, right, so you just happened to guess the biggest cinematic reveal in history? Beca: "Vader" in German means "father". His name is literally "Darth Father". Jesse: Huh.  Personally, I think that Beca is full of it because "Vader" is a Dutch word, not German (although "Vater" is). But it did raise the question: prior to the release of The Empire Strikes Back, did anybody actually predict that Vader is Luke's father? Or is this just a case of Monday morning quarterbacking?

Arguably the most famous scene in Star Wars is when Darth Vader reveals to Luke Skywalker that      He is Luke's father.   This surprise was kept secret to most of the crew and even the cast , with Dave Prowse, the actor playing Darth Vader, delivering a fake line, the actual line being overdubbed. (Of course, Darth Vader wasn't voiced by him in the first place; all lines were overdubbed by James Earl Jones).   Like Mark Hamill relates in :     But, for example, your big scene, one of the classic cinematic moments when Darth Vader divulges his true identity, is no longer a revelation.       It's such a great moment! The fake line that was put in there just to try and keep the secret was "You don't know the truth: Obi-Wan killed your father!" But as much as I enjoyed leaking false information, it was a wonderfully hard secret to keep because (Irvin) Kershner, the director, brought me aside and said "Now I know this, and George knows this, and now you're going to know this, but if you tell anybody, and that means Carrie or Harrison, or anybody, we're going to know who it is because we know who knows."   So how do we explain ?       And [David Prowse] offered a glimpse of a possible plot for the second sequel. Darth Vader and Luke Skywalker, the young hero in the first film played by Mark Hamill, are hooked up in a do-or-die light saber duel when Luke learns that Darth is, in fact, his long-lost father.   So exactly how secret was this secret anyway?    As DVK points out , the newspaper article is probably authentic.


In the context of learning topology, I'm triyng to see how to show that there is no bijective continuous function $f:(0,1) \to [0,1]$ using some basic topology facts such as the definition of continuity.  In this setting, $f$ is continuous if for all open $U$ in $[0,1]$, the set $f^{-1}(U)$ is open in $(0,1)$. Equivalently, we could swap "closed" for "open" in this definition.  As a first thought, I don't see any problem with the fact that, if such an $f$ exists, it would satisfy $f^{-1}([0,1]) = (0,1).$ I think this is OK because the set $(0,1)$ is closed in $(0,1)$. Is this correct? If so, what basic topological theorems do we use to prove this statement? Do we need to go to compactness?

Does there exist a continuous bijection from $(0,1)$ to $[0,1]$? Of course the map should not be a proper map.


In the example below, we see C1.__init__() has been executed before either of the class objects have been instantiated. Is there any way to avoid this?  Python 3.7.5 (default, Nov  7 2019, 10:50:52)  [GCC 8.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> class C1: ...     def __init__(self): ...        print('C1.__init__ executed') ...  >>> class C2: ...     def meth_C2(self, c1=C1()): ...         print('C2.__init__ executed') ...  C1.__init__ executed

Sometimes it seems natural to have a default parameter which is an empty list. Yet . If for example, I have a function: def my_func(working_list=[]):     working_list.append("a")     print(working_list)  The first time it is called the default will work, but calls after that will update the existing list (with one "a" each call) and print the updated version. So, what is the pythonic way to get the behavior I desire (a fresh list on each call)?


I got notifications saying "waiting for network" when I tried to download a video file.  How do I get rid of those notifications without restarting the device?  They seem to be unclearable. Why?  Is there a notification removal app that I can use?

A certain app I use gives me crucial notifications that I need, but also notifies me almost daily that over 80% of my RAM is used. I would like to allow this app to send me all notifications except those that contain the string "80% of your RAM" in the text of the notification.  Obviously, there is no way to filter a certain app's notifications in stock Android (other than blocking all of a certain app's notifications, but that's not what I want!), but is there a way that I can block notifications if they contain a certain string of text?  Nexus 6P running Android Marshmallow 6.0.1, if you're curious the app in question is .


I have been tweaking too much my Gnome Desktop and it became bogus. It appears many unpleasant visual details that makes the use boring.  I have tweak many things like main menu background color, various themes and tweaked the windows managers Compiz and Metacity.  How can I reset everything from window appearance to desktop tweaks?  I am using currently Gnome Shell and can be noticed in the printscreen the edges of the window are weird and the background of it.  Thanks

I was playing around with some settings, and now I need to reset GNOME to it's defaults - how do I do that?


I don't seem to be able to get a straight answer on this, so hopefully somebody can help.  If I include a mysqli_connect() statement in my PHP script and also include my MySQL username and password, will those details be vulnerable at any point? Obviously anything between PHP brackets is not served up on the client side (and therefore should not be viewable when viewing the source etc.) however is there any other way that those details could be compromised?

When a PHP application makes a database connection it of course generally needs to pass a login and password. If I'm using a single, minimum-permission login for my application, then the PHP needs to know that login and password somewhere. What is the best way to secure that password? It seems like just writing it in the PHP code isn't a good idea.


I've got the following code: \begin{tabular}{r|l}      {Column 1 content}&{\begin{itemize}          \item Column 2 content      \end{itemize}} \end{tabular}  But for some reason, the editor I'm using to code - Latexian - keeps giving me errors at lines  3 and 4 of this code, stating  LaTeX error: Something's wrong - perhaps a missing \item Line 59: \item C  In the PDF preview, the list displays without bullet points, but the table appears properly formatted. What does this error mean, and how can it be fixed?

I want to create a table like the picture below, and i wish to itemize the lamba_1 > lamba_2 > 0 using 'item style', which is the cell of each categories. Can someone help me?


I  would   need   to stripoff "domain\"  from  "domain\name"   to extract name  which can   be any name or the  word name  literally   >>> s="domain\name"  >>> x=s[5:] >>> print(x) n ame >>> s="domain\bh16" >>> x=s[5:] >>> print(x) h16 >>> x=s[4:] >>> print(x) ih16

I have a string that contains both double-quotes and backslashes that I want to set to a variable in Python. However, whenever I try to set it, the quotes or slashes are either removed or escaped. Here's an example:  >>> foo = 'baz "\"' >>> foo 'baz ""'   So instead of baz "\" like I want I'm getting baz "". If I then try to escape the backslash, it doesn't help either:  >>> foo = 'baz "\\"' >>> foo 'baz "\\"'   Which now matches what I put in but wasn't what I originally wanted. How do you get around this problem?


I have written: "They knew me from having seen me through the window, and from inquiring about me from John and Angel." Should that be "to John", or even "of John," ?

May one use inquire with instead of the somewhat overly official and potentially archaic inquire of?  It would be best if you could go through all the correct propositions commonly used with inquire with example sentences.


It is given that $T$ is a linear transformation from $\mathbb R^n$ to $\mathbb R^n$ such that $T^2 = k T $  for some $k\in \mathbb R$.   Then, one or more of the options are true    $\|T(x)\| = |k| \|x\|$ for all $x\in \mathbb R^n$.  If $\|T(x)\| = \|x\|$ , for some non- zero vector $x\in \mathbb R^n$ then $ k =\pm 1 $.  $\|T(x)\|  >  \|x\|$ for some non- zero vector $x\in \mathbb R^n$, then T is singular.  $ T = k I $ where I is an identity transformation.    Please suggest how to proceed.

Let $T$ be a linear transformation $T:\mathbb{R}^{n}\rightarrow\mathbb{R}^{n}$ such that $T^{2}=\lambda T$ for some $\lambda\in\mathbb{R}.$ Then which of the following is/are true?  $1.\|T(x)\|=|\lambda|\|x\|$ for all $x\in\mathbb{R}^n.$  $2.$ If $\|T(x)\|=\|x\|$ for some non-zero $x\in\mathbb{R}^{n}$, then $\lambda=\pm 1.$  $3.T=\lambda I$ where $I$ is the identity transformation on $\mathbb{R}^{n}.$  $4.$ If $\|T(x)\|>\|x\|$ for a nonzero vector $x\in\mathbb{R}^{n},$ then $T$ is singular.  According to me since $T^{2}=\lambda T$ we have $T$ satisfies the polynomial $x^{2}-\lambda x.$ So choices for its minimal polynomial are $x,x-\lambda,x(x-\lambda).$ So $3$rd option is clearly incorrect and $4$th option is not satisfied if $T=I$ and hence correct one. I am confused in first two options . Please help me. Thanks in advance.


When browsing the source code for the django_filters library, I found a class declaration syntax that I've never seen before: inheritance with arguments. I could not find an explanation in the official python class .  Here is the , snippet below:  class FilterSet(BaseFilterSet, metaclass=FilterSetMetaclass):     pass   what does metaclass=FilterSetMetaclass in the class definition do?

In Python, what are metaclasses and what do we use them for?


Assume we have a lot of complex class CAnimal, and all members of that class are COM Interop compliant. And we have a lot of another class CRecord that has defined public List of CAnimal class as property animals, and is not COM Interop compliant due public usage of generic List<T> type.  for example  [ComVisible(true)] [ClassInterface(ClassInterfaceType.AutoDual)] [Guid("E58D82B8-9537-4378-92AB-E63F2FAF1EE8")] public class CAnimal {   public int id { get; set; }   public string Name { get; set; } }  [ComVisible(true)] [ClassInterface(ClassInterfaceType.AutoDual)] [Guid("E58D82B8-9538-4378-92AB-E63F2FAF1EE8")] public class CRecord {   public List<CAnimal> animals { get; set; } }   Criterias:  - animals property can be also a null;  - has to be strongly typed in COM inteop import (project that consumes this COM interop)  What would be the best practice for COM Interop exporting the List<T> since it is not supported by COM Interop : "Type library exporter warning processing 'Animalia.CRecord.get_animals(#0), Animalia'. Warning: Type library exporter encountered a generic type instance in a signature. Generic code may not be exported to COM."

I am attempting to return a collection of departments from a .NET assembly to be consumed by ASP via COM Interop. Using .NET I would just return a generic collection, e.g. List<Department>, but it seems that generics don't work well with COM Interop. So, what are my options?  I would like to both iterate over the list and be able to access an item by index. Should I inherit from List<Department>, implement an IList, IList<Department> or another interface, or is there a better way? Ideally I would prefer not to have to implement a custom collection for every type of list I need. Also, will List[index] even work with COM Interop?  Thanks, Mike  Example .NET components (C#):  public class Department {     public string Code { get; private set; }     public string Name { get; private set; }     // ... }  public class MyLibrary {     public List<Department> GetDepartments() {         // return a list of Departments from the database     } }   Example ASP code:  <% Function PrintDepartments(departments)     Dim department     For Each department In departments         Response.Write(department.Code & ": " & department.Name & "
")     Next End Function  Dim myLibrary, departments Set myLibrary = Server.CreateObject("MyAssembly.MyLibrary") Set departments = myLibrary.GetDepartments() %>
Departments
 <% Call PrintDepartments(departments) %>
The third department
 <%= departments(2).Name %>   Related questions:


I'm trying to declare a method inside class dynamically. For example :  class Foo (object):     def __init__ (self):         super(Foo, self).__init__()         dict_reference = {a:1, b:2, c:3}         # This will add atributes a,b and c ...         self.__dict__.update(dict_reference)         # ... but I want methods instead, like self.a() return 1         d = {}         for k in dict_reference.keys():             exec "def {method_name}(): return {data}".format(method_name=k, data=dict_reference[k]) in d         del d['__builtins__']         self.__dict__.update(d)         # That's the only solution I found so far ...   There is another solution ?  Cheers

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?


I have a collection of typewritten pages that formed the basis of a third year problem solving course offered about 25 years ago at U. Waterloo. I've been slowly working through the problems and have come up with a solution to one of the questions but was wondering if anyone had a better solution.  The question is: Find the smallest natural number composed only of ones and zeros which is divisible by 225.  My solution: We are looking for a positive integer $k$ so that $N=225k$ has only ones and zeroes in the digits.  Since any multiple of 5 has a 0 or 5 for the last digit, then k must be even.  But $2\times 225=450$, so it really means that $k$ must be a multiple of 4.  Now $N=900K$, where $4K=k$.  Let $100K=\sum_{i=0}^\infty a_i 10^i$, where (potentially) an infinite number of the $a_i$'s vanish.  The solution method is to look at each term $a_i$ starting with $a_0$ and choose the $a_i$ so that the ones digit of the product $9a_i + c_{i-1}$ is a one or zero, where $c_{i-1}$ is the carry from the previous product.  This forms a tree, starting with $a_0$ at the root.  The smallest $N$ is found from the smallest limb of the tree.  Each of the following congruences are $\mod 10$.  We choose $a_0$ so that $9a_0 \equiv 0$ or $9a_0 \equiv 1$.  Only $a_0=9$ works here, so there is a carry of 8 when considering $a_1$.  Then we have the congruences $9a_1+8\equiv 0$ or $9a_1+8\equiv 1$.    This gives two options to consider for $a_1$: either $a_1=8$ with a carry of 8 or $a_1=7$ with a carry of 7.  The first just leads to a larger number for $N$, so we ignore it and move on to $a_2$.  This has four options, but the only one we can use that has smallest $N$ is $a_2=6$ with a carry of 6.    Continuing in this way leads to $K=12345679$ and $k=4\times 12345679 = 49072716$, which means that $N=11111111100$.  This was verified by a simple computer program I wrote that checked all of the smaller multiples.  Question for the group:  For different numbers from 225, this leads to very dense and deep trees when solving for $a_i$.  In fact, I had a originally solved this question using 255 instead of 225 because I misread it, which had a much denser tree because none of the branches could be eliminated at each step.  Does anyone know of a cleaner/simpler solution?

Every positive integer divide some number whose representation (base $10$) contains only zeroes and ones. One can easily prove that using pigeonhole principle.  Some examples: 2 -> 10 3 -> 111 4 -> 100 ...   But how to find the smallest answer? Is there any way to find it efficiently?


I was trying to solve one exam question, where question was asked that what is the sizeof class A and class B?  class A {     char c;     short s;     char c2;     int i; }; class B {     int i;     short s;     char c, c2; };   As per me   sizeof class A : 8  (char:1, short:2, char:1, int:4  -- No Padding)  sizeof class B : 8  (int:4, short:2, char:1+1  -- No Padding)  When I tried in my system then I got different output than what I was expecting  sizeof class A : 12   sizeof class B : 8   When I made some changes in the class  class A {     char c,c2;     short s;     //char c2;     int i; }; class B {     int i;     short s;     char c, c2; };   Then Output was sizeof(A): 8 and sizeof(B): 8  Can someone please explain me that how output is 12 & 8? Thanks in advance

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


I want to install a Ubuntu touch on my Xperia Go smartphone, but I can't find any tutorial.. Can anyone create tutorial how to install or port it? Thanks!

I would like to port Ubuntu Touch to a device that is currently not supported. What are the requirements for doing this and where do I begin?


I'm in the process of writing php based code as an exercise in OOP (its a WP Plugin, but I don't believe that the question is WP specific, so posted here).  I've got loads of ideas and stuff floating around my head much quicker than I can type them into working code. So I'm wondering if there's a standard method for scribbling them on a sheet of paper that will represent dependencies, links, etc? Or even if anyone has any ideas that work for themselves?

I'm trying to choose a tool for creating UML diagrams of all flavours. Usability is a major criteria for me, but I'd still take more power with a steeper learning curve and be happy. Free (as in beer) would be nice, but I'd be willing to pay if the tool's worth it. What should I be using?


A lily pad sits on a pond. It doubles in size every day. It takes 30   days for it to cover the pond. If you start with 8 lily pads instead,   how many days does it take to cover the pond?   I think that the answer is $27$, but I don't really think that makes sense intuitively. I think that, intuitively, the answer should be less than $30/4$ since it is increasing at an exponential rate.

A lily pad doubles in area every second. After one minute, it fills the pond. How long would it take to quarter fill the pond?   To me this seems like we can set up a fraction-like equation:  $$\frac{60 \ \text{seconds}}{1} = \frac{x \ \text{seconds}}{1/4}$$ then $x = 15$ seconds. But the answer is $58$ seconds which really makes no sense to me. Any suggestions are greatly appreciated.


I am looking for a proof of the following inequality   Let a be a positive real number. Prove that for every natural number n   $$(1+a)^n\ge 1+na.$$   Can you help?

I'm asked to used induction to prove Bernoulli's Inequality: If $1+x>0$, then $(1+x)^n\geq 1+nx$ for all $n\in\mathbb{N}$. This what I have so far:  Let $n=1$. Then $1+x\geq 1+x$. This is true. Now assume that the proposed inequality holds for some arbitrary $k$, namely that $$1+x>0\implies (1+x)^k\geq 1+kx,~\forall~k\in\mathbb{N}\setminus\{1\}$$ is true. We want to show that the proposed inequality holds for $k+1$. Thus multiplication of $(1+x)$ on each side of the above inequality produces the following result: $$(1+x)(1+x)^k\geq (1+kx)(1+x)\implies (1+x)^{k+1}\geq 1+x+kx+kx^2\cdots\cdots\cdots$$  I'm not sure where to go from here.


What's the way to create a listview with images on the left side and text right after it? (Note: the images were previously downloaded from the Net) Thanks in advance!

I am using a ListView to display some images and captions associated with those images. I am getting the images from the Internet. Is there a way to lazy load images so while the text displays, the UI is not blocked and images are displayed as they are downloaded?   The total number of images is not fixed.


Let $R$ be a commutative ring,  $A$ a subring of $R$, and $x$ a unit in $R$. Show that every $y \in A[x] \cap A[x^{-1}]$ is integral over $A$.  I'm supposed to use the fact that there exists an integer $n$ such that the A-module $M = Ax +..... +Ax^{n}$ is stable under multiplication by $y$.  How do I prove the existence of such an $n$ and then proceed using the claim?

Let $A$ and $B$ be two commutative rings with a unit element, with $B$ subring of $A$. Suppose $x$ is an invertible element in $A$. Then prove that the intersection of the two rings $B[x] \cap B[x^{-1}]$ is integral over $B$, i.e., prove that for any $a \in B[x] \cap B[x^{-1}]$ there is a monic polynomial $f$ with coefficients in $B$ such that $f(a)=0$.


When we put hands on A/C it gives cold winds. These winds have high kinetic energy but low temperature. How ? *don't confuse with A/C being heat pump , just an example, take antarctic blizzards. I can't understand the paradox of low temperature winds. Temperature is something defined by kinetic energy

So I was thinking... If heat I feel is just lots of particles going wild and transferring their energy to other bodies, why am I not burned by the wind?  When I thought about it more I figured out that wind usually carries some humidity, and since particles of liquid are moving same speed as the wind, they are basically static relative to each other, so no energy is transferred between them (wind and water particles). And if that water sticks to my skin and wind blows, it'll evaporate thus taking energy from my skin and make me feel cold.  Thing is, I don't think that's really the case but even if it is, if I somehow dry out the wind, will it burn me if it's strong enough? And winds can reach some pretty high velocities (though I must admit I'm not sure if they are comparable to movement of atoms in warm bodies etc...).  So. Bottom line. Can I be burned by wind in some perfect scenario?


Is there a Linux package that can output any text passed to it in a bigger size, essentially without changing font size of the terminal. Basically looking for something like this;  $ echobig "hi there!"  _     _   _   _                   _  | |   (_) | | | |                 | | | |__  _  | |_| |__   ___ _ __ ___| | | '_ \| | | __| '_ \ / _ \ '__/ _ \ | | | | | | | |_| | | |  __/ | |  __/_| |_| |_|_|  \__|_| |_|\___|_|  \___(_)   Probably accepting arguments like horizontal and vertical widths for characters to be around.  Edit: I'm looking for a program that accepts text, and prints them. Not 'image-to-ascii' converters.

How do I echo/print block lettering in the terminal like:   ?  figlet and toilet don't help. Neither do  or  unicode characters.  This is not a duplicate. As I said, figlet, banner and toilet have no styles for what I want, as depicted in the image.