I cannot get WIFI working with Realtek adapter.  lshw -C network WARNING: you should run this program as super-user.   *-network UNCLAIMED        description: Network controller        product: Realtek Semiconductor Co., Ltd.        vendor: Realtek Semiconductor Co., Ltd.        physical id: 0        bus info: pci@0000:02:00.0        version: 00        width: 64 bits        clock: 33MHz        capabilities: cap_list        configuration: latency=0        resources: ioport:d000(size=256) memory:ef100000-ef10ffff  lspci  lshw -C network WARNING: you should run this program as super-user.   *-network UNCLAIMED        description: Network controller        product: Realtek Semiconductor Co., Ltd.        vendor: Realtek Semiconductor Co., Ltd.        physical id: 0        bus info: pci@0000:02:00.0        version: 00        width: 64 bits        clock: 33MHz        capabilities: cap_list        configuration: latency=0        resources: ioport:d000(size=256) memory:ef100000-ef10ffff

I just purchased a Lenovo Yoga 730 15" laptop, and installed Ubuntu 16.04 in place of Windows 10. Install seemingly worked fine, but now I have no wifi device available.  Tried a reinstall just to be sure, and the same issue is happening. I don't believe it to be a hardware issue, as wifi was working without issue on Windows before I wiped it out.  When I run rfkill list I see:  0: ideapad_wlan: Wireless LAN Soft blocked: no Hard blocked: no   But when I run lspci I only see one item in the list claiming to be a network device:  3a:00.0 Network controller: Realtek Semiconductor Co., Ltd. Device b822 (rev ff)   I have a USB wifi adapter and that gets me connected without issue, but obviously that is not the desired solution.  Does anyone have any insight on what might be causing the issue?  Output from modinfo -p rtl8822be:  fix_rate: (int) debug_level: (int) swenc:Set to 1 for software crypto (default 0) (bool) ips:Set to 0 to not use link power save (default 1) (bool) swlps:Set to 1 to use SW control power save (default 0) (bool) fwlps:Set to 1 to use FW control power save (default 1) (bool) msi:Set to 1 to use MSI interrupts mode (default 1) (bool) dma64:Set to 1 to use DMA 64 (default 0) (bool) aspm:Set to 1 to enable ASPM (default 1) (int) debug:Set debug level (0-5) (default 0) debug_mask:Set debug mask (default 0) (ullong) disable_watchdog:Set to 1 to disable the watchdog (default 0) (bool)


Surely someone has found the solutions to the hard sphere collisions (in $n$ dimensions) of two bodies of mass $m_1$ and $m_2$, respectively--that is the resultant velocities (or momenta) of the two bodies after a hard sphere collision given $\vec{p}_1$ and $\vec{p}_2$.  I have a solution (both for elastic and inelastic collisions), but I wonder whether or not it's correct. FYI, here are my solutions for elastic, hard-sphere collisions: $$ \vec{p}_{1f} = \vec{p}_1 + 2\frac{\left(m_1\vec{p}_2 - m_2\vec{p}_1\right)\circ \hat{r}}{m_1 + m_2}\hat{r}, \\ \vec{p}_{2f} = \vec{p}_2 - 2\frac{\left(m_1\vec{p}_2 - m_2\vec{p}_1\right)\circ \hat{r}}{m_1 + m_2}\hat{r}. $$ wher $\hat{r}$ is in the direction of the "hard sphere" (i.e. the unit vector connecting the two centers of the two spheres).  You can see that my formulation trivially conserved momentum--the question is whether or not it conserves energy as well. If it helps, here is my .  For these purposes, you should skip to the section on n-dimensional cases (page 6).  I wrote this as a reference to myself for doing physics simulations since I could not find any reference on hard sphere collisions (other than references setting up the problem which give no solutions). Here is an abbreviated work on finding the final momenta from the elastic case: Just as in the $1$D case, we add and subtract the same momentum from each particle--except now we are adding and subtracting a vector: $\vec{p} = p\hat{r}$, which means that $|\vec{p}| = p$ (such that $\vec{p}_{1f} = \vec{p}_1 + p\hat{r}$ and $\vec{p}_{2f} = \vec{p}_2 - p\hat{r}$).  This gives the final energy as: \begin{align} E_f = \frac{|\vec{p}_1 + p\hat{r}|^2}{2m_1} + \frac{|\vec{p_2} - p\hat{r}|^2} {2m_2} \end{align} We now write the final energy in terms of the magnitude of $p$ and the dot product between $\hat{r}$ and $\vec{p}_1$ and likewise for $\vec{p}_2$.  Note that if you choose the direction for $\vec{p}$ to act a priori (like in the hard-sphere case), the dot products $\vec{p}_1\cdot \hat{r}$ and $\vec{p}_2\cdot\hat{r}$ will be known: \begin{align*} E_f = \frac{p_1^2 + p^2 + 2p\hat{r}\circ\vec{p}_1}{2m_1} + \frac{p_2^2 + p^2 -  2p\hat{r}\circ\vec{p}_2}{2m_2} \end{align*} As usual the elastic case greatly simplifies: \begin{align*} \require{cancel} \cancel{\frac{p_1^2}{2m_1}} + \cancel{\frac{p_2^2}{2m_1}}= \frac{\cancel{p_1^2} + p^2 + 2p\hat{r}\circ\vec{p}_1}{2m_1} + \frac{\cancel{p_2^2} + p^2 -  2p\hat{r}\circ\vec{p}_2}{2m_2} \\ \frac{m_1 + m_2}{2m_1m_2}p^2 - 2\frac{m_1 \vec{p}_2\circ\hat{r} -  m_2\vec{p}_1\circ\hat{r}}{2m_1m_2}p = 0 \end{align*} This leads to a trivial solution of $p = 0$ (no collision occurs) and: \begin{align} \frac{m_1 + m_2}{2m_1m_2}p - 2\frac{m_1 \vec{p}_2\circ\hat{r} -  m_2\vec{p}_1\circ\hat{r}}{2m_1m_2} = 0 \\ p = 2\frac{m_1 \vec{p}_2\circ\hat{r} -  m_2\vec{p}_1\circ\hat{r}}{m_1 + m_2} \end{align} Hence my solutions of: $$ \vec{p}_{1f} = \vec{p}_1 + 2\frac{\left(m_1\vec{p}_2 - m_2\vec{p}_1\right)\circ \hat{r}}{m_1 + m_2}\hat{r}, \\ \vec{p}_{2f} = \vec{p}_2 - 2\frac{\left(m_1\vec{p}_2 - m_2\vec{p}_1\right)\circ \hat{r}}{m_1 + m_2}\hat{r}. $$

I am trying to calculate the final velocities of two equal mass 2-dimensional circles after an elastic collision. I have tried to figure it out using formulas I know from high school physics, but nothing seems to work. My known variables are:   initial x and y velocities for each circle x and y distances between the centres of the circles at the time of the collision   The variables I would like to solve for are:   final x and y velocities for each circle   Here are diagrams showing all the variables:


I am trying to insert multiple record into my Access Database. Currently I can insert a single transaction record with the code below  Try     sql = "INSERT INTO  tblINV_SalesRecord " &_            "(transID, itemcode, itemname, itemunits ) " &_            "VALUES ('TGR011111','Cheese','INV0234','5')"      Using con1 As New OleDbConnection(dbProvider & dbSource)        Dim command As New OleDbCommand(Sql, con1)        con1.Open()        command.ExecuteScalar()         MsgBox("Record Inserted")     End Using Catch ex As Exception       MsgBox("An Error Occured")       MessageBox.Show(ex.Message & " - " & ex.Source) End Try   Now what I am trying to do is to insert multiple items purchased by customer in a single SQL statement. My code is shown below.  Try     sql = "INSERT INTO  tblINV_SalesRecord " &_            "(transID, itemcode, itemname, itemunits ) " &_            "VALUES ('TGR011111','Cheese','INV0234','5')," &_                   "('TGR011111','Cake','INV0114','2')," &_                   "('TGR011111','Burger','INV0217','3')" &_       Using con1 As New OleDbConnection(dbProvider & dbSource)        Dim command As New OleDbCommand(Sql, con1)        con1.Open()        command.ExecuteScalar()         MsgBox("Record Inserted")     End Using Catch ex As Exception       MsgBox("An Error Occured")       MessageBox.Show(ex.Message & " - " & ex.Source) End Try   But it returns Error. Please how do I get this resolved?

I am using MS Access 2003. I want to run a lot of insert SQL statements in what is called 'Query' in MS Access. Is there any easy(or indeed any way) to do it?


I'm looking for a word or phrase to describe someone who thinks that their perspective is the only one, or is the universal fixed norm against which all other perspectives are judged. They think that if they have never personally experienced something, it thereby doesn't exist.   An example is an older heterosexual white man who thinks that oppression hasn't existed in 100 years.  I'm looking for a better descriptor than "ignorant" or "narrow-minded." Thank you.

Is there a single word describing someone who is like a frog in a well? The frog believes the well is the entire world. How can I describe people who think that their own small environment is the entire world?


Quick question as I can't seem to find a question regarding installing Ubuntu alongside Windows 10.  I've followed the instructions in the Ubuntu installation documentation as I'd like to install Ubtunu alongside windows 10, at least until I get the hang of Ubuntu. However, I can't find the UEFI editor in Windows 10 at all. (It isn't displayed where the tutorials say it is).  So, my question is, what is the best way for me to have both Ubuntu and windows 10?  Thanks in advance,  Nic

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


Prove that  $ n < 2^{n}  $ for all natural numbers $n$.  I tried this with induction: Inequality clearly holds when $n=1$. Supposing that when $n=k$, $k<2^{k}$. Considering $k+1 <2^{k}+1$, but where do I go from here?  Any other methods maybe?

I am currently in the process of learning how to prove statements by induction. For the most part, I understand but I am at most clueless when it comes to prove some inequalities.  For example, I am having a hard time proving that: $n < 2^n$ is true. (Even if it's clear that it is indeed true!)  In the induction step, I am stuck with: $n + 1 < 2^{n + 1}$  I don't know what would be the assumption I should make from this statement.  Anyone could point me in the right direction? Thanks!


There's a certain answer which contains something very useful to me which I fairly regularly go back and reference, however I often have difficulty finding the Q&A again because the question is different to what I want from the answer. I've since just saved a copy of the answer on my phone since it was difficult to search from Google or the site's search.  Would it be okay to ask a better phrased question and then have it marked as a duplicate of the other question since while the questions are different the answer of the other one will provide an answer to the new question while also providing a simpler and more efficient way to search for the Q/A.  Is it okay to ask duplicate questions for this purpose?

Is it OK to ask a duplicate question simply for the purpose of linking your exact question to an identical, yet differently worded question?  For example, I want to know why, in bash, the EOF tactic/input redirection does not work when inside an if/elif/else block. The answer is in an unrelated question   What I want to do is ask a question along the lines of "Why does EOF and input redirection not work inside an IF block", then either immediately answer the question by linking to the other question, or request the question be closed as a duplicate.


In real numbers, the number of rational numbers is more or the number of irrational numbers is more ?

Question 1: Why are irrational numbers uncountable and rationals countable?  I really struggle to understand this. I initially thought it had something to with the fact that between any two numbers there will always be a irrational number. But now it has come to my attention that the same holds for rational numbers. So I can't really see the difference between them. What is it that makes the difference? Why can we line up all rational numbers one-to-one with the natural numbers, but not the irrationals with the naturals?  Sorry for a perhaps basic question, but I really, really struggle with it. Thanks.


I checked Cambridge dictionary, but it gives both pronunciations (with a 'k' and with a 'S' - sorry, I don't know phonetic symbols) as correct. However, for most words with more than one "correct" pronunciation, there is always one more used/accepted. What is the case with "celtic"?

Both /kɛlt/ and /sɛlt/ are considered acceptable pronunciations of the noun  and similarly of the adjective . Is there a reason for the different pronunciations? Which is the more common? Is each variant perhaps particular to a geography? Scottish vs. Irish, maybe?


import java.util.* ;  class Main {     public static double op(String operation, double number1, double number2) {         double x = 0;         if (operation == "+") {             x = number2 + number1;         }         else if (operation == "x" || operation == "*") {             x = number1 * number2;          }         else if (operation == "/" || operation == "÷") {             x = number1 / number2;          }         else if (operation == "-") {             x = number1 - number2;          }         else {             System.out.println("Error: Please re-execute the program and try again!");         }         return x;     }      public static void main(String[] args) {         Scanner input = new Scanner(System. in );         System.out.println("Please enter a number...");         double x = input.nextDouble();         System.out.println("Please enter an operation.... +, -, /, *");         String y = input.next();         System.out.println("Please enter your other number...");         double z = input.nextDouble();          System.out.println(op(y, x, z));      } }   I want this function to return the correct value when the operation is performed. However, it always returns 0 the initial value assigned. Please help!!!

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?


When I run this in test, NullPointerException occurs in the following line : Account acc = accRepo.findAccountById(Long id); As if the findAccountById(Long id) returns null. But when I call this method directly inside any other test method it works fine. My Repository file public Interface AccountRepo extends JpaRepository<Account,Long>{          @Query("select a from Account a where a.id  = ?1")     public List<Account> findAccountById(Long id);  }  Service Interface and Implementation public Interface AccountService{     Account showAcc(); }  @Service public class AccServiceImpl implements AccountService {          @Autowired     private AccountRepo accRepo;      @Override     Account showAcc(){         Long id = 10L;         Account acc = accRepo.findAccountById(id); // Null Pointer exception at this line         String name = acc.getName();         System.out.println(name);     }  }   @Autowired AccountServiceimpl accServImpl;  @Test public void testAccount(){          accServImpl.showAcc(); }

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'm trying to run a private server for the game RuneScape.  After some time a player of mine went to a minigame I have programmed in the server named pestcontrol. The player tried to join it but in order to be able to start it he needs 5 other players in order for it to work.  So, he logged out.  But then after that his account got nulled which caused other people to get nulled too.  I have managed to fix that.  But then he was invisible, I couldn't see his character ingame. So then i worked it out by declaring the following:  if (player == null) return;   This did work and made him visible again. But then the error still occurs with this line of exception:  java.lang.NullPointerException at net.kagani.game.player.controllers.pestcontrol.PestControlLobby.forceClose(PestControlLobby.java:52) at net.kagani.game.player.ControlerManager.forceStop(ControlerManager.java:317) at net.kagani.game.player.ControlerManager.login(ControlerManager.java:66) at net.kagani.game.player.Player.sendInit(Player.java:1396) at net.kagani.game.player.Player.run(Player.java:1233) at net.kagani.game.player.Player.start(Player.java:886) at net.kagani.executor.PlayerHandlerThread.initPlayer(PlayerHandlerThread.java:273) at net.kagani.executor.PlayerHandlerThread.processLoginSession(PlayerHandlerThread.java:231) at net.kagani.executor.PlayerHandlerThread.run(PlayerHandlerThread.java:65)   If someone could help me out with this ( redirect me to it ) cause i am willing to learn alot. This is the class itself:  package net.kagani.game.player.controllers.pestcontrol;  import net.kagani.Settings; import net.kagani.game.WorldObject; import net.kagani.game.minigames.pest.Lander; import net.kagani.game.player.controllers.Controller; import net.kagani.utils.Utils;  public final class PestControlLobby extends Controller {     private Lander lander;      @Override     public void start() {         this.lander = Lander.getLanders()[(Integer) getArguments()[0]];     }      @Override     public void sendInterfaces() {         if (player == null)             return;         int remainingTime = lander.getTimer().getMinutes();         player.getPackets().sendIComponentText(407, 3,                 Utils.fixChatMessage(lander.toString()));         player.getPackets().sendIComponentText(                 407,                 13,                 "Next Departure: " + remainingTime + " minutes "                         + (!(remainingTime % 2 == 0) ? " 30 seconds" : ""));         player.getPackets().sendIComponentText(407, 14,                 "Player's Ready: " + lander.getByStanders().size());         player.getPackets().sendIComponentText(407, 16,                 "Commendations: " + player.getCommendation());         player.getInterfaceManager().sendMinigameInterface(407);     }      @Override     public void magicTeleported(int teleType) {         player.getControlerManager().forceStop();     }      @Override     public boolean sendDeath() {         player.getControlerManager().forceStop();         return true;     }      @Override     public void forceClose() {          player.getInterfaceManager().removeMinigameInterface();         System.err.println("This is 1 error output that declares it here");         lander.exit(player);     }      @Override     public boolean logout() {         lander.remove(player);         return false;     }      @Override     public boolean canSummonFamiliar() {         player.getPackets()                 .sendGameMessage(                         "You feel it's best to keep your Familiar away during this game.");         return false;     }      @Override     public boolean processObjectClick1(WorldObject object) {         switch (object.getId()) {             case 14314:             case 25629:             case 25630:                 player.getDialogueManager().startDialogue("LanderD");                 return true;         }         return true;     } }


I have 4 classes, Main, class A, class B, class C. I initiated a variable in Main, outside a loop_1 : int x=0 and then passed it into class A that uses a loop_2, and then from there straight into class B which is a part of that loop and right into class C.  I intended that after class A would finish the loop I'll get System.out.Println with X.  The problem is that I get x=0 every time. I have a checkUp System.out.println in class C and I see it grow there, But as I try to print x from class class A I always get x=0.  Note: I have  Main Class  public class SocketMain    {  public void mainMethod{  int x=0;  for (int edition = 0 ; edition<29 ; edition++){   classA.Method1(x);   x=0;   } }   class A (SelfNote : // InstrumentPage)   public class classA  {  public static void Method1(int x)  { for (int loopCounter = 0 ; loopCounter <29 ; loopCounter ++){   classB.Method2(x);    }   if (x=0) System.outprintln("FirstIf" +x);  if (x>0) System.out.println ("SecondIf" +x);     }   Class B (SelfNote : //TestClockOfInstrument)   public class classb           { public static void Method2(int x) {      classC.Method3(x);    }   Class C (SelfNote : //SocketChanges)   public class classc { public static void Method3 (int x) {  if (someThingHappens == 1)   x++;  System.out.println ("Check X" +x);   }

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?


By non convergent I mean DIVERGENT and NOT that it converges to a value outside the space. Examples are appreciated. Thanks

A Cauchy sequence doesn't necessarily converge, e.g. take the sequence $(1/n)$ in the space $(0,1)$.    Maybe my intuition is wrong but I tend to think of this as, "it does converge but what it converges to is not in the space".  Are there any examples of a Cauchy sequence that does not converge and avoids this type of saying?


The pages I am trying to get to work are . The issue is that I have been specifying a specific height for the middle div so that it would stay "connected" to the title above and the select list below. It works great, except that the whole thing doesn't stay the height of the window. I found out when I had a problem with an emulator that was changing my screen resolution. The way my browser displays it now, it's only about 2/3 the height of the window. Also, if I go from max to min on the window, the height then goes past the bottom of the window. The width is fine, but the height is the problem. If you look at the page and view the source, you can see that I'm using divs, with one that acts as a container for everything, then a div for the titlebar, a div for the bottom bar and the center div for the content.

I am working on a web application where I want the content to fill the height of the entire screen.  The page has a header, which contains a logo, and account information. This could be an arbitrary height. I want the content div to fill the rest of the page to the bottom.  I have a header div and a content div. At the moment I am using a table for the layout like so:  CSS and HTML    #page {     height: 100%; width: 100% }  #tdcontent {     height: 100%; }  #content {     overflow: auto; /* or overflow: hidden; */ }

...

...

     The entire height of the page is filled, and no scrolling is required.  For anything inside the content div, setting top: 0; will put it right underneath the header. Sometimes the content will be a real table, with its height set to 100%. Putting header inside content will not allow this to work.  Is there a way to achieve the same effect without using the table?  Update:  Elements inside the content div will have heights set to percentages as well. So something at 100% inside the div will fill it to the bottom. As will two elements at 50%.  Update 2:  For instance, if the header takes up 20% of the screen's height, a table specified at 50% inside #content would take up 40% of the screen space. So far, wrapping the entire thing in a table is the only thing that works.


In the context of traveling, I have heard of and used the phrase "coming down" when referring to a journey from one place to another place that is further south. Perhaps, it's because I have always related the "down" part to "from north to south". For example:      My cousin in New York is coming down to visit me (in Atlanta) next   week.   Recently, a friend of mine used the phrase to refer to any journey regardless of the direction of travel. For example:      She is coming down from Miami to join us in Atlanta.   Is the phrase used only to refer to traveling south? Or is it not related to the direction?

I am travelling geographically down the country from north of the city of London. Do I state "I am travelling down to London" or do I state "I am travelling up to London" in reference to its capital city status?


I have:  string content;   which is inputed by the user.   For example:  content = "I am new to this site".   I want to loop through this string and for each word in the sentence I want to run a function which processes the word.   something like this:  for(int i = 0; i < stringSize; i++){ //remove a word from the string process(word); }   Any help would be much appreciated. Thank you

I'm trying to iterate over the words of a string.  The string can be assumed to be composed of words separated by whitespace.  Note that I'm not interested in C string functions or that kind of character manipulation/access. Also, please give precedence to elegance over efficiency in your answer.  The best solution I have right now is:  #include <iostream> #include <sstream> #include <string>  using namespace std;  int main() {     string s = "Somewhere down the road";     istringstream iss(s);      do     {         string subs;         iss >> subs;         cout << "Substring: " << subs << endl;     } while (iss); }   Is there a more elegant way to do this?


The standard derivation for $\frac{\mathrm{d}}{\mathrm{d}x}\sin(x)$ involves using the fact that  $$\lim_{\Delta x \to 0}\frac{\cos(\Delta x)-1}{\Delta x}=0$$  It's trivial to show that  $$\lim_{\theta\to 0} \cos(\theta)-1= 0$$  but the first limit doesn't follow directly from the second without a bit more work to handle the division.  How can we make this more rigorous?

How do I find:  $$ \lim_{x\to0}\frac{1-\cos(x)}{x} $$  Using the squeeze theorem.  Particularly, how would I arrive at its bounding functions?   If possible, please try not to use derivatives.


I´m new to Latex. I use Texmaker with Miktex and Texworks. I have to submit an article to the American Mathematical Monthly. I´d like to know, step-by-step how to download and where to save  the files I need to use a new package that is not stored. Concretely, I have to use a template from:    and from    I go to both urls but I don´t know what do after that. Both are the urls to which The Amercian MAthematical Monbthly send me to be able to use their template.  Thanks a lot.

I know how to define a package or a class, but how do I make it available (to myself) at all times?  Say I have the package file commonstuff.sty (or myprettyclass.cls), that I want to be able to include in any .tex file I create on my computer. Where do I put it? Do I need to run some installer on it, or is it enough to keep it in a certain folder?  Note: I know I can just place it in the same folder as the .tex file, but that's not what I'm after here. I'm looking for a way to "install" the package centrally on my computer.


I'm trying print the day ranges from today up to a year ago. So i can apply this to a sql query in my other code. I know my algorithm works but i need to subtract 1 day from the format '2014-05-15' Here is the code  from datetime import date, timedelta import datetime current_date = datetime.date.today() datecounter = 0 while datecounter != 365:     print current_date     date_start = current_date     print date_start     # current_date = current_date.timedelta(days=1)     print current_date     print 'the date is between', date_start, 'and', current_date     datecounter += 1   im looking for this code to output  the date is between 2014-05-16 and 2014-05-15 the date is between 2014-05-15 and 2014-04-14   etc  i wrote a contrived example based on the logic, if you would like to run it yourself, you may better understand what i am trying to do.  x = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] curdate = 5 for i in x:     print curdate     date_start = curdate     curdate = curdate - 1     # print curdate       print ' the date is between', date_start, 'and', curdate     print ' ---------- '

I have a Python  object. What is the best way to subtract one day?


I've created a program that iterates through dates and sends data specific to those dates from an Excel spreadsheet to a web form.  I want to break out of all loops if one or both of the following conditions are met:    The end of the month is reached;  The iterated date reaches the current date   So far, breaking out of the loop works for the first condition but not the second.  I've tried checking the date in the excel document against the current date and breaking if the two are equal, but it doesn't work.  Any thoughts?  sg.theme('DARKTEAL') layout = [[sg.Text('Date to Start Summing', font=('Arial', 10), visible=True),            sg.In(key='-CAL-', size=(12, None), default_text='MM/DD/YYYY')],           [sg.CalendarButton('Calendar', key='-OUTPUT-', target='-CAL-', pad=None, size=(10, None), font=('Arial', 10),                              format='%m/%d/%Y')],           [sg.Text('Filename', key='-FOUTPUT-', font=('Arial', 10))],           [sg.In(visible=False),            sg.Input(key='-DIR-', size=(20, None)),            sg.FileBrowse('Browse', target='-DIR-', font=('Arial', 10))],           [sg.OK(font=('Arial', 10)), sg.Cancel(font=('Arial', 10))]]  window = sg.Window('Data Collector', layout, grab_anywhere=False, size=(400, 280), return_keyboard_events=True,                    finalize=True)  event, values = window.read() window['-OUTPUT-'](values['-CAL-']) window['-FOUTPUT-'](values['-DIR-']) acedate = (values['-CAL-']) file = (values['-DIR-']) window.close()   # length of bx measures x = len(df.columns) # used to determine when at end of row z = 1 # location of column to start summing b = 1 # number of days in the month c = len(df.index) # used to stop once last day of month reached y = 1 # slices date chosen from calendar (dd) to determine where to start summing n = int(values['-CAL-'][3:5]) # today's date (used to stop once current day is reached) d = datetime.today().strftime('%Y-%m-%d')  while n < c:     while z < x:         m = df.iloc[n, b]         z = z + 1         b = b + 1         if pd.isnull(m):             tab()             continue         else:             ActionChains(browser) \                 .send_keys(str(m)) \                 .perform()         if z == x:             n = n + 1             y = y + 1             z = 1             b = 1             enter()             if n == c or str(pd.to_datetime(df.iloc[n, 0]).date()) == d:                 break             time.sleep(5)             page_up()             time.sleep(5)             bx_select()             time.sleep(2)             clear()             time.sleep(5)         else:             tab()             time.sleep(0.5)

Given the following code (that doesn't work):  while True:     #snip: print out current state     while True:         ok = get_input("Is this ok? (y/n)")         if ok.lower() == "y": break 2 #this doesn't work :(         if ok.lower() == "n": break     #do more processing with menus and stuff   Is there a way to make this work? Or do I have do one check to break out of the input loop, then another, more limited, check in the outside loop to break out all together if the user is satisfied?


I'm totally new with c++ and I'm using eclipse.  but... I don't know why I get this error at the main function:     ERROR: ::main must return int   My code is:  void main() { char a; while (a!='q') {     string ln = "enter option: ";     cout<< ln;      switch(a)     {     case 1:         if (a=='1')             func1();         break;     case 2:         if (a=='2')             break;         break;     } } }

What is the correct (most efficient) way to define the main() function in C and C++ — int main() or void main() — and why? And how about the arguments? If int main() then return 1 or return 0?  There are numerous duplicates of this question, including:       — For C++, with a very good answer indeed.     Related:


---- Minecraft Crash Report ---- // You're mean.  Time: 4/8/19 3:39 PM Description: Unexpected error  java.lang.IndexOutOfBoundsException     at java.nio.Buffer.checkIndex(Buffer.java:540)     at java.nio.DirectIntBufferU.get(DirectIntBufferU.java:253)     at bma.a(SourceFile:271)     at bma.a(SourceFile:220)     at bao.a(SourceFile:1694)     at bao.a(SourceFile:1652)     at bjb.a(SourceFile:125)     at hd.a(SourceFile:70)     at hd.a(SourceFile:13)     at ej.a(SourceFile:174)     at bao.p(SourceFile:1585)     at bao.ak(SourceFile:774)     at bao.f(SourceFile:728)     at net.minecraft.client.main.Main.main(SourceFile:148)  A detailed walkthrough of the error, its code path, and all known details is as follows: ---------------------------------------------------------------------------------------  -- Head --  Stacktrace:     at java.nio.Buffer.checkIndex(Buffer.java:540)     at java.nio.DirectIntBufferU.get(DirectIntBufferU.java:253)     at bma.a(SourceFile:271)     at bma.a(SourceFile:220)     at bao.a(SourceFile:1694)     at bao.a(SourceFile:1652)     at bjb.a(SourceFile:125)     at hd.a(SourceFile:70)     at hd.a(SourceFile:13)     at ej.a(SourceFile:174)  -- Affected level --  Details:     Level name: MpServer     All players: 0 total; []     Chunk stats: MultiplayerChunkCache: 0, 0     Level seed: 0     Level generator: ID 00 - default, ver 1. Features enabled: false     Level generator options:      Level spawn location: World: (8,64,8), Chunk: (at 8,4,8 in 0,0; contains blocks 0,0,0 to 15,255,15), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)     Level time: 0 game time, 0 day time     Level dimension: 0     Level storage version: 0x00000 - Unknown?     Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)     Level game mode: Game mode: survival (ID 0). Hardcore: false. Cheats: false     Forced entities: 0 total; []     Retry entities: 0 total; []     Server brand: ~~ERROR~~ NullPointerException: null     Server type: Integrated singleplayer server Stacktrace:     at bjf.a(SourceFile:289)     at bao.b(SourceFile:1972)     at bao.f(SourceFile:742)     at net.minecraft.client.main.Main.main(SourceFile:148)  -- System Details --  Details:     Minecraft Version: 1.7.10     Operating System: Windows 10 (amd64) version 10.0     Java Version: 1.8.0_51, Oracle Corporation     Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation     Memory: 46900048 bytes (44 MB) / 201326592 bytes (192 MB) up to 2147483648 bytes (2048 MB)     JVM Flags: 8 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xmx2G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M     AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used     IntCache: cache: 12, tcache: 94, allocated: 0, tallocated: 0     Launched Version: 1.7.10     LWJGL: 2.9.1     OpenGL: GeForce GTX 1060/PCIe/SSE2 GL version 4.6.0 NVIDIA 419.67, NVIDIA Corporation     GL Caps: Using GL 1.3 multitexturing. Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported. Anisotropic filtering is supported and maximum anisotropy is 16. Shaders are available because OpenGL 2.1 is supported. Is Modded: Probably not. Jar signature remains and client brand is untouched. Type: Client (map_client.txt) Resource Packs: [vanilla] Current Language: English (US) Profiler Position: N/A (disabled) Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used Anisotropic Filtering: Off (1)   So what's wrong with Minecraft? Why does it crash when I try to run 1.7.10?

Whenever I try to run older versions of Vanilla Minecraft it won't allow me to create or load a world in Singleplayer. If I try, it will start to generate the world, then crash.  Error Message:  ---- Minecraft Crash Report ---- // Oh - I know what I did wrong!  Time: 2/1/16 10:14 PM Description: Unexpected error  java.lang.IndexOutOfBoundsException     at java.nio.Buffer.checkIndex(Buffer.java:540)     at java.nio.DirectIntBufferU.get(DirectIntBufferU.java:253)     at bls.a(SourceFile:270)     at bls.a(SourceFile:220)     at azd.a(SourceFile:1675)     at azd.a(SourceFile:1633)     at biv.a(SourceFile:113)     at gu.a(SourceFile:70)     at gu.a(SourceFile:13)     at ef.a(SourceFile:164)     at azd.o(SourceFile:1566)     at azd.ad(SourceFile:753)     at azd.e(SourceFile:704)     at net.minecraft.client.main.Main.main(SourceFile:103)   System Details:    -- System Details -- Details:     Minecraft Version: 1.7.2     Operating System: Mac OS X (x86_64) version 10.10.4     Java Version: 1.8.0_60, Oracle Corporation     Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation     Memory: 148530064 bytes (141 MB) / 285257728 bytes (272 MB) up to 1048576000 bytes (1000 MB)     JVM Flags: 5 total; -Xmx1G -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:-UseAdaptiveSizePolicy -Xmn240M     AABB Pool Size: 18497 (1035832 bytes; 0 MB) allocated, 18497 (1035832 bytes; 0 MB) used     IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0     Launched Version: 1.7.2     LWJGL: 2.9.1     OpenGL: Intel(R) HD Graphics 6000 GL version 2.1 INTEL-10.6.31, Intel     Is Modded: Probably not. Jar signature remains and client brand is untouched.     Type: Client (map_client.txt)     Resource Packs: []     Current Language: English (US)     Profiler Position: N/A (disabled)     Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used     Anisotropic Filtering: Off (1)   Is this a system problem, is there a problem with my system settings that would cause this error? If so, what steps can be done to correct it. If not, what could be the problem?


I have a question that I need help with getting started (possibly I would be back for more help).     I have a measure space $(X,A,\mu)$ that is finite, and $f \in L^{\infty}(\mu)$. Also, defined is $a_n = \int_X\,|f|^n\,d\mu$. I need to show that the limit is: $$\lim_{n\to\infty}\,\frac{a_{n+1}}{a_n} = \|f\|_{\infty} .$$   I am stuck on getting started, anybody have any suggestions?  thanks much


I was wondering what you and other players would do when coming across a new monster in a campaign. You obviously want to try to figure out what weaknesses this creature has, what it's resistant to, etc.  Is it more usual to ask 'out of character', or is it more common to roll some kind of in-game check to identify the creature?

I was recently running a game with my players, whose characters were in combat with a . According to the Monster Manual, Scarecrows have immunity to poison damage, but my players weren't rolling checks to gain information about the creature. When one of my players attacked it with their poisoned weapon, I was stuck wondering how to proceed.  When player characters' attacks fail because of immunities or resistances (or do double damage thanks to vulnerabilities), is it a best practice to flat out tell them about the resistances (etc.), or hide the results and pretend they work?


I have 3 lists out of which 1 is empty. I want to take count of lists in a list which are not empty.  For example:    a = ['username', 'username', 'social']  b = []  c = ['username', 'instead', 'added']   Combining all the lists together:  combine = [a,b,c]   Counting the non-empty lists:  count = sum(x is not '' for x in combine)   When I am running the above code, I have getting 'count=3' but I want 'count=2'  Please help me how should this can be done.

For example, if passed the following:  a = []   How do I check to see if a is empty?


Suppose $\alpha\colon G → H$ is a homomorphism of groups and $g \in G$ has finite order.  I want to show that $\alpha(g)$ has finite order and that the order of $\alpha(g)$ divides the order of g  What I have done is say that $ord(g)=n$ so $g^n=e(G)$ so:   $$α(g)α(g)^{-1}=e(H)=α(gg^{-1})=α(e(G))=α(g^n)=α(g)^n$$  but this gives me that the order of $\alpha(g)$ is n and the second part of the question is asking: If $\alpha$ is injective, show that the order of $\alpha(g)$ is equal to the order of $g$. So this cannot be true for $\alpha$ unless it is injective.

Suppose $f : G_1 \to G_2$ is a group homomorphism and let $x\in G$ be of finite order. Does the order of $f(x)$ divide the order of $x$?


I'm reading How to Prove It: A Structured Approach (Velleman) Second Ed.  Doing all the end of chapter exercises for chapter 1 and having trouble on problem 5a which reads     Show that $P \leftrightarrow Q$ is equivalent to $(P \wedge Q) \vee (\neg P \wedge \neg Q)$   Clearly they're equivalent to each other based on the truth tables. But is that really the best way to 'show' it? I was able to derive the second form from the first in all the other questions that asked to show two forms are equivalent so far.  Here's what happens when I try to derive it:     $$P \leftrightarrow Q$$   $$ \text{Form of biconditional} $$   $$(P \rightarrow Q) \wedge (Q \rightarrow P)$$   $$ \text{Form of conditional}$$   $$ (\neg P \vee Q) \wedge (\neg Q \vee P)$$   From here it appears to match the form of a distributive law but with mismatched negations. I just don't know where to go from here...

I am currently working through Velleman's book How To Prove It and was asked to prove the following  $(P \leftrightarrow Q) \equiv (P \wedge Q) \vee (\neg P \wedge \neg Q)$  This is my work thus far  $(P \to Q) \wedge (Q \to P)$  $(\neg P \vee Q) \wedge (\neg Q \vee P)$ (since $(P \to Q) \equiv (\neg P \vee Q)$)  $\neg[\neg(\neg P \vee Q) \vee \neg (\neg Q \vee P)]$ (Demorgan's Law)  $\neg [(P \wedge \neg Q) \vee (Q \wedge \neg P)]$ (Demorgan's Law)  At this point I am little unsure how to proceed.   Here are a few things I've tried or considered thus far:  I thought that I could perhaps switch some of the terms in step 3 using the law of associativity however the $\neg$ on the outside of the two terms prevents me from doing so (constructing a truth table for $\neg (\neg P \vee Q) \vee (\neg Q \vee P)$ and $\neg (\neg P \vee \neg Q) \vee \neg (P \vee Q)$ for sanity purposes)  I can't seem to apply the law of distribution since the corresponding terms are negated.  Applying demorgans law to one of the terms individually on step 2 or 3 doesnt seem to get me very far either.  Did I perhaps skip something? Am I even on the right track? Any help is appreciated


I am a new Ubuntu user and doing my first steps slowly... I have a wireless usb like in this issue with the same problem.    After read it, I tried to follow the steps but i had problems...   I downloaded driver and patch on downloads and moved to /tmp I went to terminal then typed...  sudo apt-get install --reinstall linux-headers-generic build-essential cd /tmp tar xjf DPO_MT7601U_LinuxSTA_3.0.0.4_20130913.tar.bz2 cd DPO_MT7601U_LinuxSTA_3.0.0.4_20130913/    but in this step I don't know what to do. I have to change ~/(ADD THE PATH) for anything?  patch -p0 < ~/(ADD THE PATH)/rt2870-mt7601Usta-kuid_t-kgid_t.patch

I am trying to install a Ralink wifi adapter in Ubuntu Desktop 14.04.  The system is not detecting the wifi.   lsusb lists the device as:  Bus 002 Device 004: ID 148f:7601 Ralink Technology, Corp.  I have the rt2800 USB driver listed in "/etc/modules"; Following some instructions on the web, I tried this command:  echo 148F 7601 | sudo tee /sys/bus/usb/drivers/rt2800usb/new_i  lsmod | grep rt2800 returns the following:  rt2800usb              26581  0  rt2x00usb              20041  1 rt2800usb rt2800lib              83150  1 rt2800usb rt2x00lib              48886  3 rt2x00usb,rt2800lib,rt2800usb mac80211              545990  3 rt2x00lib,rt2x00usb,rt2800lib crc_ccitt              12627  1 rt2800lib


I've added maven to my path, but it doesn't seem to be persisting to the path beyond the lifetime of the terminal application.  I've modified my ~/.bashrc, but it still isn't storing the modified path.   Here is my ~/.bashrc:  export JAVA_HOME=`/usr/libexec/java_home -v 1.7` export PATH=$PATH:/Users/chris/Dev/Libraries/apache-maven-3.1.1/bin   And here is the result of echo $PATH:  chriss-macbook:~ chris$ echo $PATH /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin   Why isn't my modified path getting persisted between terminal sessions, and how can I solve that?

I found a lot of people figuring out why instruction similar to this :   Put X to your ~/.bashrc and you can do Y    don't work.  It always turns out that Mac OS X's bash's startup files (or Mac's Bash itself) doesn't source ~/.bashrc file, either in the login shell, or in a shell spawned from window system - like Terminal app in Mac OS X)  Why is this, when all other Unix-like systems with Bash I've worked with before have done this?  PS:  I found what Bash itself says about startup files (which could be helpful) :     When Bash is invoked as an interactive login shell, or as a   non-interactive shell with the --login option, it first reads and   executes commands from the file /etc/profile, if that file exists.   After reading that file, it looks for ~/.bash_profile, ~/.bash_login,   and ~/.profile, in that order, and reads and executes commands from   the first one that exists and is readable. The --noprofile option may   be used when the shell is started to inhibit this behavior.   Source :


There were two books in the set. Humans are living in another galaxy within an alien culture. They discover that they were grown by this other species based on DNA code beamed from Earth ages before. A group of humans are eventually given permission to make their way back to earth. During their travels they piece together the history of humanity and what befell them.  I have searched every author I can think of but can't find them. It feels so much like a Baxter novel but I don't see anything by him.

I'm looking for a specific scifi book that I read years ago, I only partially remember the story, and I don't remember the author or the title.  What I remember of the story is:   An alien race picks up a signal from humans that includes instructions on how to make their own humans (genetic instructions). The humans grow up knowing they are created and are taught by the alien race. They are eventually given resources to build a ship, and go looking for their origins. They eventually find the solar system, but nobody answers. They find some stations orbiting earth and find that the station is very old, so old in fact that humans have long been extinct and other creatures have reached local space, and have been looking around the station as an archeological dig. I think they refer to two developed races from earth, but one developed from rats.   If anyone know what story this is, and can point me at it, its been driving me crazy for at least 15 years, and I think it's actually been much longer, since I can't remember when I read it.


So I'm having trouble calling a template member function of a template class. When I try to do it I get the following error:  test.cpp:19:5: error: invalid operands of types ‘<unresolved overloaded function type>’ and ‘unsigned int’ to binary ‘operator<’   and clang++ says:  test.cpp:19:5: error: reference to non-static member function must be called     arrIn->partition<NPart>(NULL, NULL);     ^~~~~~~~~~~~~~~~   Any ideas how to fix this?  Thanks!  #define NULL 0  template <class V, unsigned int N> struct SubArray { public:   template <unsigned int NDIM>   void partition(const int dimsToPart[], const unsigned int numParts[]) {     // bla...   }  };  template <unsigned int N> struct CartTopology { public:   template <class V, unsigned int NArr, unsigned int NPart>   void scatterArrayBlocked(SubArray<V, NArr> *arrIn, SubArray<V, NArr> *arrOut,     const int dimsBefore[], const int dimsAfter[]) {     arrIn->partition<NPart>(NULL, NULL);   }  };  int main(int argc, char** argv) {   SubArray<int, 2> arr;   CartTopology<2> top;   top.scatterArrayBlocked<int, 2, 2>(&arr, NULL, NULL, NULL);   return 0; }

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?


The usual $\left[ abcd... \right]$, places [] delimiters left-and-right, and spans the expression's height.  Contrariwise, I want to more-or-less $\underset{]}{\overset{[}{ abcd... }}$, placing [] "delimiters" top-and-bottom. Moreover (obviously), I want the [] sideways/horizontal, so to speak. And then I also want them wide, spanning the width of that abcd... expression.  Any way to do that, the more straightforward the better (i.e., optimally just some LaTeX directives without special packages, etc)? Thanks.

I'm trying to put a nice square bracket over a complex text, it should look like an \overline but with ending like  \ulcorner and \urcorner. The presence of \overrightarrow and \overleftarrow makes me believe that is possible to decorate the end of the \overline bar.  I know the existence of \overbrace, but I need a square bracket; moreover, \overbrace takes too much vertical space


On a normal distribution curve, standard deviation tells us how much data fall in each group around the mean, according to empirical law. So, for example of SD = 14 and sample mean($\bar{x}$) = 50, as shown in figure below:  If the data is normally distributed, 68.2% of the data will be around the mean inside SD units on each side to mean. Real data is hardly normally distributed, so how do I interpret Standard Deviation values I get from software, for example,  of Python?

In a normal distribution, the  imparts standard deviation a lot of meaning, but what would standard deviation mean in a non-normal distribution (multimodal or skewed)? Would all data values still fall within 3 standard deviations? Do we have rules like the 68-95-99.7 one for non-normal distributions?


What we do in this proof is :   We say let $G$ acting on the left cosets of $H$ in $G$ where $H$ is a subgroup of $G$ , with $ | G : H | = p$  We consider $K$ as the kernel of the action  such that $ | H : K | = k$,   Then we make a statement that $ G/K $ is isomorphic to a "subgroup" of $S_p$ ,  I know the first theorem of Isomorphism is applied here , but I am a little confused ,   According to the first isomorphism theorem ,  $ G/K $ should be isomorphic to $S_p$ and hence , $ |G/K| = |S_p|$ , i.e $ |G/K| = p!$ ..  From where does that "subgroup" term comes from ?  I know , only that "subgroup" helps in completing the proof as , that implies $|G/K|$ divides  $p!$ , but the actual statement of the theorem confuses me , could anyone help me with this?

Assume that $G$ is finite with $p$ the smallest prime dividing its order. Suppose $H < G$ with $[G:H]=p$. Prove that $H \lhd G$.  I've seen this question a few times on here but all the proofs I saw appeal to the First Isomorphism Theorem. I had old class notes showing this proved solely with group actions and orbits but I could only make out some of it so I recreated it from scratch. Can you guys check this for me?  Let $H$ act on the set $G/H$ by left multiplication. Consider the orbit of $H$ itself. $\mathcal{O}_H=\{hH \mid h\in H\}$ and $hH = H$, thus $\mathcal{O}_H$ contains one coset, namely, $H$. Let $x\in G - H$. What can be said about $\mathcal{O}_{xH}$? This action of left multiplication partitions $G/H$ into disjoint orbits of cosets. Because $|G/H| = p$, the sum of the sizes of the orbits is equal to $p$. We already know that $|\mathcal{O}_H| = 1$ therefore       $|\mathcal{O}_{xH}| \leq p-1$. The Orbit-Stabilizer theorem gives us  $|\mathcal{O}_{xH}| |Stab_{xH}| = |H|$. We see that $|\mathcal{O}_{xH}|$ divides $|H|$ and hence divides $|G|$. But since $p$ was the smallest prime dividing the order of $G$, $|\mathcal{O}_{xH}| = 1$.  The immediate consequence is that $|Stab_{xH}| = |H|$. As $Stab_{xH} \leq H$, we have $Stab_{xH} = H$. Therefore for every $h \in H$, $hxH=xH$. This implies  $x^{-1}hx\in H$ and thus $x^{-1}Hx = H$ for all $x \in G$. Therefore, $H \lhd G$.


I need to make an icon like this  so that it is in blue color (instead of black). I can't use Hue/Saturation/Curves because they do not transform black color. I can't also use fill tool because I need to preserve borders, which are partially black with some transparency. The preferred tool is GIMP.

I'm pretty new to Photoshop. I would like to change the color of this object on my .png image:   But anyway I try, it becomes this fuzzy with the new color:    How can I change it's color to stay in it's original shape?


I need help in the following: inside my book I have images (basically photographs) and figures (results of mathematical calculations), in the epigraph in all cases appears the figure legend. What I'm after is that in the epigraphs of the images the legend appears: image 0.0 (where 0.0 is the chapter and image number).  Example:  Figure 1.1 blah blah blah  Image 1.1 blah blah blah  Figure 1.2 blah blah blah

I am writing a book, and would like to be able to have the photographs labelled with an independent numbering system to my figures.  In the text I would refer to, for example, figure X and separately to photograph X, so I want them to have different numbering systems, just as equations and figures do.  Is it possible to have a different \begin{figure} environment so that the numbering can be separated?


I want to use PHPStorm or Sublime Text to change files in /var/www directory.  But in PHPStorm I can't even open files and in Sublime Text I can open, view and change files, but it always asks for my password when I save it.   How I can do this without always being asked for a password?

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


You sometimes see on tank trucks or petrol tankers carrying gas or oil or other liquids that catch fire quickly the word inflammable painted in bold red on them.Should not the correct word be ?

Why are not infamous and inflammable the opposite of famous and flammable, like incomplete, inactivity, inappropriate and so on?


Occasionally, in an otherwise-anonymous paper review, the reviewer will voluntarily sign their name, revealing their identity to the author.  Should reviewers do this, and under which circumstances?  (For the purposes of this question, assume that the reviewer knows the author's name - that is, the review process is not double-blinded.)

In my field (chemistry), review is always done in a single blind process, i.e. the author does not know who the referees were, but the referees do know who the authors are. In ten years, I have never seen a referee breaching this anonymity, e.g. by signing their review, unless they got prior approval by the editor (in order to continue discuss things further with the authors, once the manuscript was accepted for publication).  So, it seemed logical to assume that in single blind peer-review, the reviewer should not disclose his identity without the editor's consent. Yet, some people have told me ( and ; also IRL a friend from human sciences) that they have seen people sign their reviews, or write emails to them after the review but before the paper is published.  So, in single-blind peer-review, can you reveal your identity without the editor's consent? Does it depends on the customs of each field, or is there a hard rule? (in which case, the few anecdotes I heard were outliers)


Prove that the sum of the first $n$ squares $(1 + 4 + 9 + \cdots + n^2)$ is  $\frac{n(n+1)(2n+1)}{6}$.  Can someone pls help and provide a solution for this and if possible explain the question

I am just starting into calculus and I have a question about the following statement I encountered while learning about definite integrals:  $$\sum_{k=1}^n k^2 = \frac{n(n+1)(2n+1)}{6}$$  I really have no idea why this statement is true. Can someone please explain why this is true and if possible show how to arrive at one given the other?


Most of the math equations use single character as variables name and functions name, there are also Greek alphabets as well.  This is not acceptable in programming since it is too difficult to maintain, good code should be easy to understand. However math people seems to be fine with strange notations and difficult-to-remember variable names.

I have much more experience programming than I do with advanced mathematics, so perhaps this is just a comfort thing with me, but I often get frustrated when I try to follow mathematical notation. Specifically, I get frustrated trying to keep track of what each variable signifies.  As a programmer, this would be completely unacceptable no matter how many comments you added explaining it:  float A(float P, float r, float n, float t) {   return P * pow(1 + r / n, n * t); }   Yet a mathematician would have no problem with this:     $A = P\ \left(1+\dfrac{r}{n}\right)^{nt}$      where   $A$ = final amount   $P$ = principal amount (initial investment)   $r$ = annual nominal interest rate (as a decimal)   $n$ = number of times the interest is compounded per year   $t$ = number of years   So why don't I ever see the following?  $\text{final_amount} = \text{principal}\; \left(1+\dfrac{\text{interest_rate}}{\text{periods_per_yr}}\right)^{\text{periods_per_yr}\cdot\text{years}}$


I read  and some others regarding the layout of on object, but I still don't get exactly how it looks like.  Here are my specific question:  For each class (meaning that if I have a 2 super-classed I would have 2 pointers), virtual functions have 1 vtable pointer for them. where is it inside the object? Assuming the following: class A{void virtual f(){}; int x;}; would the address of an object A a be the same as the address of a.x or of a.f [or maybe point to a default method such as the C-tor / D-tor Incorrect, as class methods are not stored inside the object as explained ]  Example:      class A{     int x;     void f(){}     void virtual g(){}     void virtual h(){} };  A a; std::cout << sizeof a; // result = 8  class A{     int x;     void f(){}     void virtual g(){} };  A a; std::cout << sizeof a; // result = 8  class A{     int x;     void f(){}     //void virtual g(){} };  A a; std::cout << sizeof a; // result = 4   From these examples it can be seen that when encountering a number (n > 0) of virtual functions, a pointer (4-bytes, on my 32-bit machine) is added to the object. Would it be added before other data members?  What would be pointed by:  A a; int *p = (int*)&a;   I checked it out with this. Is it right to assume from the following that the vtable pointer always precedes other class members?:  class A{ public:     A(int y){x=y;}     virtual void g(){}     int x;     virtual void f(){} };  int main () {     A a(42);     int *p = (int*)&a;     std::cout << *p << std::endl;      // = 4215116 (vtable address?)     std::cout << *(p+1) << std::endl;  // = 42     return 0; }

I am looking for details of the VTable structure, order and contents, and the location of the vtable pointers within objects.   Ideally, this will cover single inheritance, multiple inheritance, and virtual inheritance.  References to external documentation would also be appreciated  Documentation of GCC 4.0x class layout is  and the Itanium, and more broadly GNU, ABI layout documents are .


With an CSV layer Qgis workspace [loaded as a delimited text layer], an external algorithm is ran; outputting (writing) new values to certain rows in the layers source CSV file.  The writing works properly (CSV can be opened in text editor immediately after ext. process to show the correct values in question), yet a problem arises in the Qgis updates.  The changed values; when viewed in the attribute table depict a 'NULL' value.  Although removing and reloading the layer properly updates the attribute table, I would like to avoid such; as important temp. display-label data / settings needs to be retained.[Possibly the only option?]  I have tested the following scripts without resolve:              csvDelimTextLayer.reload()             csvDelimTextLayer.updateFields()             iface.legendInterface().refreshLayerSymbology(csvDelimTextLayer)             iface.mapCanvas().refresh()     Spending some more time revealed the following work-flow:          -The algorithm which updates the CSV is activated          -The updates only show a 'NULL' value in the attribute table          -Immediately after confirming 'NULL's, save project and close QGIS          -Upon reopening the QGIS and the project, the proper data is displayed.  Additionally (and perhaps most importantly) now every time the algorithm is ran - the reflected changes (and values) are properly viewable in the attribute table without having to resave and restart QGis.      Does this indicate an error or missing step in my initial method of allocating data in PyQgis when writing and loading the CSV; which upon saving and restarting QGis is fulfilled?

I have been trying for a long time to connect a external table data[csv] through Excel (for exmaple) with QGis with the objective to each time i change any data in table(for example data location - coordinates [X ; Y]),this changes occur in QGis real time.  Is there any procedure to get it?.


I was looking for a powerful Notebook and found the Asus VivoBook  N580VD-DM070T. I've done some research about problems with Ubuntu, but could not find anything for this model. Does anyone have experience with Ubuntu on this model?

I have a device on which I would like to install Ubuntu. How do I find out if Ubuntu will work on it?


I'm seeing tons of similar questions but never this scenario, or at least not with a solution...  I have an Acer Aspire laptop, no optical drive, with Windows 10 installed. BIOS is set to Legacy boot, and Windows works perfectly.  I downloaded Ubuntu 15.10 x64 and put it on a USB stick after using DISKPART to prepare the drive. I want to dual-boot Windows and Ubuntu.  When I boot from USB in Legacy, I get "Operating System Not Found". I've tried changing USB ports and drives, using both FAT32 and NTFS when formatting, never makes a difference.  I change BIOS to use UEFI instead of Legacy, and the USB drive boots perfectly and starts installation. In the installation process, it tells me that installing Ubuntu in UEFI will hose my other operating system. I think it'll let me do a full wipe of the hard disk and install, but I want to keep my Windows partition.  I'm assuming that if I can just get the USB drive to boot in Legacy mode, everything will be fine, but I can't figure out how to do that. Otherwise, if I could change my Windows partition so that it's UEFI instead of Legacy, I assume that would work too.  Any way you can think of to do either of these, or any other solution?  EDIT  I wouldn't consider it a duplicate of the other question because I'm hoping to stay in Legacy mode so I can keep my Windows installation - that question is for a UEFI installation.

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


We're remodeling our bathroom and I would like to remove a wall that appears to be there for looks because of the style in the late 60s. I'm wondering if there is any possibility that this wall is a load bearing wall or if I'll have any issues when I remove it. It appears to be more of a decorative wall to me but I would like a second opinion. The wall runs perpendicular to the ceiling joists but there isn't anything bearing down on it when I go in the attic and the exterior wall which I know is load bearing is only about 5ft away. There are 3 or 4 ceiling joist that cross the wall and I plan to replace 1 (maybe more) of the ceiling joist because we found some termite damage when we pulled off the drywall. Any help would be greatly appreciated!   I have attached 2 pictures of the wall I am referring to and I can go into the attic to take more picture if that would help to see what's up there.       EDIT:   Here are pictures of the attic above the wall. In the first image the wall I'd like to remove is just on the other side of the duct work. Second image is for a reference on how far away the duct work is from the wall. Third image is of the top of the wall (looking down onto it from the attic) with the insulation moved out of the way.   [![Wall location in attic][1]][1] [1]:   [![Wall distance from vent][2]][2]  [2]:   [![Top of wall from attic][1]][1]  [1]:

Other than looking up blue prints, which many homeowners may not have, are there ways to determine if a wall is load bearing?  Methods I can think of might include:   Going up in the attic to check if ceiling trusses run perpendicular to the wall If the wall is an exterior wall   Any others?


I am trying to prove: $A \subseteq B \implies B^\circ \subseteq A^\circ$   where $A^\circ$ is polar cone of $A$ ($A$ convex cone) and  $B^\circ$ is polar cone of $B$ ($B$ convex cone)

Show that if C $\subseteq$ D then $D^*$ $\subseteq$ $C^*$  where * is dual cone operation. Can somebody explain it.


I am using QGIS 2.18.9 and I have a problem. I dissolved a small map with about 1000 small regions into one big polygon, with Vector->geoprocessing tools->dissolve.    But after the dissolving there are little dots everywhere. After zooming in I found that these are all little holes in the layer.   Now I want the dissolved layer to not have any holes. Is there an easy way to do that?

The dissolve tool (vector>geoprocessing tools>dissolve) renders some artifacts on shapes with high number of polygons. I’m using a  with 3222 polygons and I’m trying to dissolve it using the field “municipio”, but when the dissolve tool ends calculating the new shape has some artifacts     Does anyone had a similar problem? How to work around it?  I’ve also used v.dissolve from GRASS and the dissolve polygon from SAGA, but the problem persists. I’ve used the same shapefile on ArcGIS 9.3 with the dissolve tool. None artifact/error was produced.  Edit 1  I'm trying to use the v.clean tool as sugested by WhiteboxDev. However I'm getting this error:     An error has occured while executing Python code:      Traceback (most recent call last):   File   "C:/PROGRA~1/QGISCH~1/apps/qgis/./python/plugins\processing\gui\ProcessingToolbox.py",   line 181, in executeAlgorithm   File   "C:/PROGRA~1/QGISCH~1/apps/qgis/./python/plugins\processing\algs\grass7\Grass7Algorithm.py",   line 511, in checkBeforeOpeningParametersDialog   File   "C:/PROGRA~1/QGISCH~1/apps/qgis/./python/plugins\processing\algs\grass7\Grass7Utils.py",   line 361, in checkGrass7IsInstalled   File   "C:\PROGRA~1\QGISCH~1\apps\Python27\lib\ntpath.py", line 96, in join   TypeError: object of type 'NoneType' has no len()      Python version:   2.7.4 (default, Apr  6 2013, 19:54:46) [MSC v.1500 32 bit (Intel)]      QGIS version:   2.4.0-Chugiak Chugiak, 8fdd08a      Python path:   ['C:/PROGRA~1/QGISCH~1/apps/qgis/./python/plugins\processing',   'C:/PROGRA~1/QGISCH~1/apps/qgis/./python',   u'C:/Users/CERCOTRICHAS/.qgis2/python',   u'C:/Users/CERCOTRICHAS/.qgis2/python/plugins',   'C:/PROGRA~1/QGISCH~1/apps/qgis/./python/plugins',   'C:\PROGRA~1\QGISCH~1\bin\python27.zip',   'C:\PROGRA~1\QGISCH~1\apps\Python27\DLLs',   'C:\PROGRA~1\QGISCH~1\apps\Python27\lib',   'C:\PROGRA~1\QGISCH~1\apps\Python27\lib\plat-win',   'C:\PROGRA~1\QGISCH~1\apps\Python27\lib\lib-tk',   'C:\PROGRA~1\QGISCH~1\bin',   'C:\PROGRA~1\QGISCH~1\apps\Python27',   'C:\PROGRA~1\QGISCH~1\apps\Python27\lib\site-packages',   'C:\PROGRA~1\QGISCH~1\apps\Python27\lib\site-packages\GDAL-1.11.0-py2.7-win32.egg',   'C:\PROGRA~1\QGISCH~1\apps\Python27\lib\site-packages\PIL',   'C:\PROGRA~1\QGISCH~1\apps\Python27\lib\site-packages\jinja2-2.7.2-py2.7.egg',   'C:\PROGRA~1\QGISCH~1\apps\Python27\lib\site-packages\markupsafe-0.23-py2.7-win32.egg',   'C:\PROGRA~1\QGISCH~1\apps\Python27\lib\site-packages\python_dateutil-2.2-py2.7.egg',   'C:\PROGRA~1\QGISCH~1\apps\Python27\lib\site-packages\pytz-2014.2-py2.7.egg',   'C:\PROGRA~1\QGISCH~1\apps\Python27\lib\site-packages\win32',   'C:\PROGRA~1\QGISCH~1\apps\Python27\lib\site-packages\win32\lib',   'C:\PROGRA~1\QGISCH~1\apps\Python27\lib\site-packages\Pythonwin',   'C:\PROGRA~1\QGISCH~1\apps\Python27\lib\site-packages\Shapely-1.2.18-py2.7-win32.egg',   'C:\PROGRA~1\QGISCH~1\apps\Python27\lib\site-packages\six-1.6.1-py2.7.egg',   'C:\PROGRA~1\QGISCH~1\apps\Python27\lib\site-packages\wx-2.8-msw-unicode',   'C:\PROGRA~1\QGISCH~1\apps\qgis\python\plugins\fTools\tools',   'C:\Program Files\SpiderOak\shell_extension_lib\shared.zip']   Not entirely sure if this error is QGIS related... Any idea why I'm getting this error and how can I solve it?


Given sequences $\{a_n\}$ , $\{b_n\}$ of positive real numbers and $\textrm{ limsup } \frac{a_n}{b_n} < \infty$. Prove there is a constant M such that $a_n \leq Mb_n$          Defn: Let $(a_{n})_{n=1}^{\infty}$ be a bounded sequence. Define the sequence $c_n = \sup \{a_{k}: k \geq n\}$ for $n \geq 1$. If the sequence $c_n$ converges, then the value it converges to is the limit superior of $(a_n)$.      Attempt:  So given that the lim sup is finite, it means there exists a value M such that for all $n > k$, $$\frac{a_n}{b_n} < M \\ \Rightarrow \ a_n \leq Mb_n$$   Comment: Surely there is more to it than this and I have missed something.....

Suppose $a_n$ and $b_n$ are sequences of positive numbers such that  $\limsup \frac{a_n}{b_n}<\infty$  show that there is a constant $M>0$ s.t $a_n\le Mb_n$ for all $n\ge 1$  My idea:  as i know hat $M=\limsup a_n$ if and only if for all $\epsilon >0$ there is $N\in \mathbb{N}$ so tthat $n\ge N$ implies $a_n<M+\epsilon$


I have four int columns with two of them having a value in 10s, and the other two have it in 100s. Should I, for the ease of applying the following algorithms, normalise the data, or would it not have any discernible impact? i) k-NN ii) SVM iii) Naive Bayes iv) Logistic Regression v) Decision Trees.

My understanding is that when some features have different ranges in their values (for example, imagine one feature being the age of a person and another one being their salary in USD) will affect negatively algorithms because the feature with bigger values will take more influence, is it a good practice to simply ALWAYS scale/normalize the data?  It looks to me that if the values are already similar among then, then normalizing them will have little effect, but if the values are very different normalization will help, however it feels too simple to be true :)  Am I missing something? Are there situations/algorithms were actually it is desirable to let some features to deliberately outweigh others?


I feel I might have been hellbanned, and I'd like to know if there is any recourse.  Per :   A hellbanned user is invisible to all other users, but crucially, not himself. From their perspective, they are participating normally in the community but nobody ever responds to them. They can no longer disrupt the community because they are effectively a ghost. It's a clever way of enforcing the "don't feed the troll" rule in the community. When nothing they post ever gets a response, a hellbanned user is likely to get bored or frustrated and leave. I believe it, too; if I learned anything from reading The Great Brain as a child, it's that the silent treatment is the cruelest punishment of them all.   I asked a question earlier, , but even if it wasn't it hasn't gotten any replies positive or negative.  For a community as vibrant and active as SO, this seems very odd.  Admittedly, I am a "Question Asker" and while I try to answer any question I feel I can add value to, my main interaction with the site has been to ask questions. Some of those questions may be sub par, too specific, annoying to look at, or whatever, but I never meant the community any harm. The fact is, I am not a schooled programmer and do not have a sliver of the knowledge that the typical "answerer" has. But I fear that because of this my questions have been deemed unworthy, and I have been hellbanned.  If indeed I have been hellbanned, this feels pretty lousy from the perspective of a user who had no malintent.  Even if my questions are bothersome, I still visit the site, see the ads, count towards visitor metrics, and to be deceitfully eliminated from the community seems harsh and unwarrnanted.  If I haven't been hellbanned, then I apoligize for my paranoic question here, and if I have been I'd like to know if there is any action I can take short of deleteing my account and moving on with my life?  Honestly, this is a cause of great anxiety for me.

Given , I must say I think the idea (making that user's content visible to only them) is a good one.  However, the people in whose hands that power will be placed terrify me.  Jeff is saying that he doesn't like that bans can degenerate into meta-discussions about the fairness of banning, and in that respect I agree with him. But the meta-discussions do accomplish one thing -- they get more than one person to look at the ban and weigh in on what they think.  This isn't that I don't trust moderators (or, indeed, diamond moderators), but I don't trust any one single human being with an irrevocable and complete banhammer, where there's no potential to dispute things. (And if the user doesn't know they're banned, there's no potential for dispute)  Basically, I'd sleep a lot more soundly at night knowing that if one of these "enhanced bans" are put into place, that at least two people have looked at the "problem child", and only after more than one person has signed off on such a ban, does that go into effect. I don't care exactly what that process is, but I don't want to have to worry about pissing off a moderator and getting banned as a result.  We all get pissed off here -- it's part of any community. But "the nuclear option(s)" need(s) to be decided upon by someone with a cool head, not someone who's pissed off.


We say that Luna is Earth's moon. That's like looking at it from the Earth's perspective, or from a wider perspective. What is Earth to Luna from Luna's perspective?  In an application I've been coding, I create an object for each planet and in each object, there are two properties moon and master. For example,  earth : {     radius : 60,     moons : [ luna ],     master : null, }, luna : {     radius : 15,     moons : [],     master : earth, },   I chose master but I'm curious if there's a better or more technical term for that.    I wasn't sure if I should ask this in  or in here. So, advise if I was wrong.

A satellite is an object which orbits another, what it the word for a object which is being orbited?  The moon is a satellite of Earth, the Earth is a __ of the moon?


I have a program that I am writing and I have it completed but I keep receiving an error in a counter that I am using.  The purpose of the program is to build a plate stacker and I have finished that but need to write a counter based on the particular colors used (how many green plates...etc.).  As I know several classmates use this site to cheat, I will not post the code in whole but only the fragments I feel are necessary.  Below is an example of a statement that I am using to attempt to get a count of the beige plates in the text file.  The statement is in a while loop with the other colors having the same coding.  I also have initialized the counter (int beige = 0;) prior to this and outside of the while loop:           if(line == "beige")         {             beige++;         }   I have a System.out following these statements to display the count but it always comes up as 0 so I believe the problem is in this particular fragment.  If I need to send additional coding I will but I believe it is something to do with this or the placement of it in the while loop.

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?


This is a simple question on difference. I have seen the following situation -  for example how many day you spend on a travel when the travel date was 14-Aug-2014 till 25-August-2014. The answer for this is 25-14+1, which is 12 days. However, if I would have just subtracted, then the answer would have been 11, which is wrong. Now, the question, when I should do the difference + 1, and when I should just subtract. What is the idea behind it? How to identify when to apply what? The date part I know is just by experience, but I am worried I might fail in a similar situation where the application is different. Can someone please explain me this in detail?

Here's an example question from the :     On the last day of a one-week sale, customers numbered 149 through 201 were waited on. How many customers were waited on that day?   Possible answers: 51, 52, 53, 152, 153.   The correct answer here is 53, which is the result of (201-149) + 1 = 53.  What's the reasoning in adding the +1?


Is it possible to create some kind of directory watcher and trigger a script when the folder is not empty?  I have a CentOS machine with jenkins CI on it. i would like to create a job that will move all build artifacts to my web server folder each successful build. is it possible?   I want to avoid timed triggered cronjob.

There is a directory A whose contents are changed frequently by other people.  I have made a personal directory B where I keep all the files that have ever been in A.  Currently, I just occasionally run rsync to get the files to be backed up from A to B. However, I fear the possibility that some files will get added in A, and then removed from A before I get the chance to copy them over to B.  What is the best way to prevent this from occurring? Ideally, I'd like to have my current backup script run every time the contents of A get changed.


Good day legendaries, I am Nodejs and Javascript newbie.  I have routes getting value from a common variable that is on top of them.  let commonVariable = "theDefaultValue";  //some route just to get commonVariable value route.get("/", async (res, req) => { });  //some routes below that change commonVariable value route.post("/", async (res, req) => {   //changing commonVariable value   commonVariable = "anotherValue"; })   My concern is, how is the value of commonVariable after some routes change it, will other routes get the original value?

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


I am learning about closures. I found this code online. However, I am not able to make sense of why it is working.  const addTo = x => y => x + y; var addToTen = addTo(10); addToTen(3);   It returns 13. However, I do not understand why though.   Could somebody please explain why that is happening?  Thanks a lot for your time and have a wonderful day :D


I am trying to make a press enter to send data using jquery but my code is not working. Anyone can tell me what i am missing here ?  <textarea name="reply" class="reply" id="replyChat" placeholder="Write your message"></textarea>   JS  function SendMessage() {         $.ajax({         type: "POST",         url: "/ajax/reply",         data: dataString,         cache: false,         success: function(html) {             $('.messages-body').append(html);         }       });      }     $('#replyChat').bind('keydown', function(e) {       if(e.keyCode==13) {         SendMessage();     }   });   $('body').on("click",".reply-btn",function() {      SendMessage();  });   Click function is working fine just keydown doesn't work here.

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 have been looking at various graduate programs in the UK, and noticed a lot of people under the title "lecturer" taking incoming PhD students. I've completed some graduate studies on a master's level in the United States. Would doing a PhD under the supervision of a "lecturer" be different than doing one under the supervision of a professor? I read online that in the UK, "lecturer" is analogous with "assistant professor". Can someone explain this to me?

What are the US equivalent ranks to the Lecturer, Senior Lecturer, Reader (or Associate Prof), Professor ranks of the UK system? Is it correct that in the US system they are Assistant Prof, Associate Prof, Full Prof and Chair/Endowed Prof, respectively? I know that in the British system, there are further sub-levels in each of these ranks whereas in the US system there is no further gradation within each rank. So I am looking for only rough equivalence.  Edit: It would be great if a formal/informal reference which compares the two is also pointed out.


I have a .ttf font file which I want to use in my arch linux terminal. I followed the instructions for installing fonts on the wiki:   These are the steps I tried:  [root#archserver ~]# cp my_font.ttf /usr/share/kbd/consolefonts/ [root#archserver ~]# setfont my_font.ttf Bad input file size   I am new to Arch so I'm probably missing something, do I need to convert from .ttf to .psf.gz?

I would like to change the system (console) font of my ubuntu server to a custom () font. Is this possible?  I've tried to use:  dpkg-reconfigure console-setup   but the only allows me to choose from the default system fonts.


On my ASUS GL552VW laptop (with 4 cores intel i5-6300HQ processor) with Xubuntu 16.10 32bit and kernel 4.8.0, I was having video playing in chromium and I launch npm install in ansi term in emacs 25 and there was a lag when I move my mouse and CPU indicator show 100%.  Is it because 4 cores wasn't working? If so then what kernel options should I use to enable 4 cores in my processor? Or maybe it's because nvidia drivers?  I have this in my /etc/default/grub:  GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_osi="   the output of sudo lshw -class cpu show one core enabled, different then the other question so it's not duplicate:    *-cpu                             description: CPU        product: AMD Sempron(tm) M120        vendor: Advanced Micro Devices [AMD]        physical id: 4        bus info: cpu@0        version: 15.6.2        serial: To Be Filled By O.E.M.        slot: CPU 1        size: 2100MHz        capacity: 2100MHz        width: 64 bits        clock: 200MHz        capabilities: x86-64 boot fpu fpu_exception wp vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext fxsr_opt pdpe1gb rdtscp 3dnowext 3dnow constant_tsc rep_good nonstop_tsc extd_apicid eagerfpu pni monitor cx16 popcnt lahf_lm svm extapic cr8_legacy abm sse4a 3dnowprefetch osvw ibs skinit wdt hw_pstate vmmcall npt lbrv svm_lock nrip_save cpufreq        configuration: cores=1 enabledcores=1 threads=1   out of LC_ALL=C lscpu  Architecture:          i686 CPU op-mode(s):        32-bit, 64-bit Byte Order:            Little Endian CPU(s):                1 On-line CPU(s) list:   0 Thread(s) per core:    1 Core(s) per socket:    1 Socket(s):             1 Vendor ID:             AuthenticAMD CPU family:            16 Model:                 6 Model name:            AMD Sempron(tm) M120 Stepping:              2 CPU MHz:               800.000 CPU max MHz:           2100.0000 CPU min MHz:           800.0000 BogoMIPS:              4200.05 Virtualization:        AMD-V L1d cache:             64K L1i cache:             64K L2 cache:              512K Flags:                 fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc rep_good nonstop_tsc extd_apicid eagerfpu pni monitor cx16 popcnt lahf_lm svm extapic cr8_legacy abm sse4a 3dnowprefetch osvw ibs skinit wdt hw_pstate vmmcall npt lbrv svm_lock nrip_save

I recently noticed my computer is highly sluggish (recent install of Kubuntu 13.04 by the way). I have a Toshiba Satellite P70-A PSPLPC-01Y007 laptop with an Intel i7 quad-core, 16 GB of ram. It appears to look correct in the kinfo. So I ran mpstat -P ALL:  Linux 3.8.0-30-generic (Isogen)         13-09-02        _x86_64_        (1 CPU)  10:07:13 AM  CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest   %idle 10:07:13 AM  all   11.07    3.02    2.90   36.25    0.00    0.12    0.00    0.00   46.64 10:07:13 AM    0   11.07    3.02    2.90   36.25    0.00    0.12    0.00    0.00   46.64   I noticed when I had chrome open with 10 tabs, typical of an engineer, but it kept freezing horribly. After I ran top, I realized the CPU kept hitting 100% and only one CPU/core is listed. Couldn't find a solution so far. How can I get it to register all 4 cores?  cat /proc/cpuinfo | grep -E "(core|model\ name)" model name      : Intel(R) Core(TM) i7-4700MQ CPU @ 2.40GHz core id         : 0 cpu cores       : 1   as well as  sudo grep -i smp /var/log/syslog Sep  2 10:02:41 Isogen kernel: [    0.000000] Linux version 3.8.0-30-generic (buildd@roseapple) (gcc version 4.7.3 (Ubuntu/Linaro 4.7.3-1ubuntu1) ) #44-Ubuntu SMP Thu Aug 22 20:52:24 UTC 2013 (Ubuntu 3.8.0-30.44-generic 3.8.13.6) Sep  2 10:02:41 Isogen kernel: [    0.000000] found SMP MP-table at [mem 0x000fe1b0-0x000fe1bf] mapped at [ffff8800000fe1b0] Sep  2 10:02:41 Isogen kernel: [    0.000000] smpboot: Allowing 1 CPUs, 0 hotplug CPUs Sep  2 10:02:41 Isogen kernel: [    0.010390] Freeing SMP alternatives: 24k freed Sep  2 10:02:41 Isogen kernel: [    0.062244] smpboot: CPU0: Intel(R) Core(TM) i7-4700MQ CPU @ 2.40GHz (fam: 06, model: 3c, stepping: 03) Sep  2 10:02:41 Isogen kernel: [    0.063005] smpboot: Total of 1 processors activated (4788.97 BogoMIPS) Sep  2 11:18:52 Isogen kernel: [    0.000000] Linux version 3.8.0-30-generic (buildd@roseapple) (gcc version 4.7.3 (Ubuntu/Linaro 4.7.3-1ubuntu1) ) #44-Ubuntu SMP Thu Aug 22 20:52:24 UTC 2013 (Ubuntu 3.8.0-30.44-generic 3.8.13.6) Sep  2 11:18:52 Isogen kernel: [    0.000000] found SMP MP-table at [mem 0x000fe1b0-0x000fe1bf] mapped at [ffff8800000fe1b0] Sep  2 11:18:52 Isogen kernel: [    0.000000] smpboot: Allowing 1 CPUs, 0 hotplug CPUs Sep  2 11:18:52 Isogen kernel: [    0.010393] Freeing SMP alternatives: 24k freed Sep  2 11:18:52 Isogen kernel: [    0.062271] smpboot: CPU0: Intel(R) Core(TM) i7-4700MQ CPU @ 2.40GHz (fam: 06, model: 3c, stepping: 03) Sep  2 11:18:52 Isogen kernel: [    0.063032] smpboot: Total of 1 processors activated (4788.73 BogoMIPS)   EDIT: But when I run sudo lshw -class cpu, I get this:  *-cpu                           description: CPU        product: Intel(R) Core(TM) i7-4700MQ CPU @ 2.40GHz        vendor: Intel Corp.        physical id: 4        bus info: cpu@0        version: Intel(R) Core(TM) i7-4700MQ CPU @ 2.40GHz        serial: To Be Filled By O.E.M.        slot: U3E1        size: 2400MHz        capacity: 2400MHz        width: 64 bits        clock: 100MHz        capabilities: x86-64 fpu fpu_exception wp vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 fma cx16 xtpr pdcm pcid sse4_1 sse4_2 movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid        configuration: cores=4 enabledcores=4 threads=8   So it recognizes that it has 4 cores with 8 threads, as well as says that all 4 cores are enabled. It is also hyper-thread, so even if running only on one core, it should see two.


Recently I ran into a problem with HTML that took me a while to figure out.  HTML is not case sensitive, but it turns out that the values of id and name attributes are case sensitive.   This made me wonder what else do I need to know. Are there any other rules about id and name values?

When creating the id attributes for HTML elements, what rules are there for the value?


I'm not sure if my syntax is correct here. I'm specifically looking to do this:   Redirect all traffic to the root domain (mydomain.com) to a www version (www.mydomain.com). Redirect all http traffic to https on specific subdomains (or root domain to https:/www)   So if someone goes to the root domain (any page) they will go to the  version of that page.  If they go to two specific subdomains (www and clients) using http, they'll be redirected to the https version (either . or . respectively).  If they go to any subdomain other than www or clients, then do not force https.  Here's what I came up with:  # FORCE ROOT TO WWW RewriteEngine On RewriteCond %{HTTP_HOST} ^domain\.com$ [NC] RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L] # END FORCE ROOT TO WWW  # FORCE SSL RewriteEngine On RewriteCond %{HTTPS} off RewriteCond %{HTTP_HOST} ^(www|clients)\. [NC] RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L] # END FORCE SSL   This doesn't seem optimal. Is there a better way?  Also, this is a WordPress site and there are other rules in htaccess. Should this go at the very top of the htaccess file.  Thanks much.

I'm looking for a way to force SSL and www.  I've been able to force both separately but together I keep running into redirection issues. The following code works when handling a URL in this format: http://example.com and properly redirects to https://www.example.com but when the incoming URL is https://example.com it will not forward to https://www.example.com - Any suggestions?  EDIT: it should also send http://www.example.com to https://www.example.com.  RewriteCond %{REMOTE_ADDR} !127\.0\.0\.0 RewriteCond %{SERVER_PORT} 80 RewriteCond %{HTTP_HOST} !^www.example\.com$ RewriteRule ^(.*)$ https://www.example.com/$1 [R,L]


I need help in writing test class for following apex class. Could anyone please suggest how to create test data,test the following method defined in apex class with positive and negative scenarios and use of System.assertEquals() to make sure each scenario had the expected outcome. customAppName field is multiselect picklist on customObject public with Sharing class abcService{   @AuraEnabled    public static List<customObject> xyzMethod(){          UserAppInfo userAppInfo = [SELECT Id, AppDefinitionId FROM UserAppInfo WHERE UserId =        :UserInfo.getUserId() LIMIT 1];       AppDefinition appDefinition = [SELECT DurableId, Label FROM AppDefinition Where DurableId =        :userAppInfo.AppDefinitionId LIMIT 1];       String appName = appDefinition.Label;       System.debug('appName------->' + appName);       return [SELECT custom fields FROM customObject  WHERE customAppName includes (:appName)];           } }  When I started creating test data got fields not writeable issue for UserAppInfo and AppDefinition. Based on the comments mentioned in the post, I started with test class but not able to cover the scenarios. @isTest public class abcServiceTest{     @testSetup    public static void testSetup(){         }  @isTest static void testPositiveScenario(){ //Passing App name          User u = someClass.testUserCreate();     System.runAs(u){                           Test.startTest();                  customObject__c customObjectObj = new customObject__c(custom_Id__c = 'Id_01', custom_Name__c = 'Test Name AA', customAppName__c = 'Test App AA');         insert customObjectObj;         List<customObject__c> customList = [SELECT custom_Id__c, custom_Name__c, customAppName__c FROM customObject__c WHERE customAppName__c INCLUDES ('Test App AA')];         System.debug('customList---------->' + customList);         System.assertEquals(1, customList.size());               Test.stopTest();     }    }  @isTest static void testNegativeScenario(){         User u = someClass.testUserCreate();     System.runAs(u){         Test.startTest();                  customObject__c customObjectObj = new customObject__c(custom_Id__c = 'Id_02', custom_Name__c = 'Test Name BB', customAppName__c = 'Test App BB');         insert customObjectObj;         List<customObject__c> customList = [SELECT custom_Id__c, custom_Name__c, customAppName__c FROM customObject__c WHERE customAppName__c INCLUDES ('Test App CC')];         System.debug('customList---------->' + customList);         System.assertEquals(0, customList.size());                  Test.stopTest();     }    }     }  Could anyone suggest how to have xyzMethod() covered. Any kind of help is appreciated.

This is a canonical question and answer developed by the community to help address common questions. If you've been directed here, or your question has been closed as a duplicate, please look through the resources here and use them to shape more specific questions. To browse all canonical questions and answers, including more unit test resources, navigate to the  tag.  This canonical question is intended to address several classes of common questions by providing a quick summary and links to comprehensive resources:   How do I start writing my first unit test?  How do I unit test this code?  I need help writing this unit test.   Salesforce Stack Exchange looks for detailed, specific questions that the community can help you with, and can't write tests on your behalf. We feel that working with the resources below can help you get started, and we encourage you to make an attempt to write your test and return to SFSE with your specific questions when you encounter challenges you can't resolve.


Generally，the value of environment variable SHELL  is /bin/bash, it means normal shell  environment is Bash，However，the /bin/sh is the link of Dash, what is the Dash effect？  Another question: Although our shell environment is bash, why sometimes it will go wrong because of dash？

I am wondering what the point of sh being symbolic linked to dash is? I understand that dash is supposed to be faster than bash, but I am uncertain why the original sh shell isn't present in sh.   Or if anything why isn't sh linked to bash?


Can anyone please remind me the name of a Sci-Fi tale that a man lives in a strange building and can't get out. He starts to search other strange things.   I can't really remember the story, but I know that in the end the building turns out to be a spaceship and flies away.

My mom read this story in the 1950's when she was a teenager. She recounted the story to me and my siblings many years ago, probably trying to entertain us on some road trip. She has always wanted to go back and re-read it, and of course, we want to read it, too! But she can't remember the title or who wrote it.  The protagonist is a guy who works in an office building and notices one day that the janitor has an extra eyeball in the back of his head that is normally hidden by his hair. The man gradually comes to realize that several people working in this building are aliens. With some snooping, he figures out that the office building is actually a spaceship.  One day, the building starts vibrating, and this guy knows he's got to get out. He hurries downstairs and runs outside. The ground beneath his feet continues to shake. Suddenly, he realizes that the spaceship encompasses the entire block. He sprints toward the street, but just as he reaches the sidewalk, a metal wall shoots up from the ground, basically encapsulating the entire block with him inside, and the block blasts off into outer space.  Can anyone help track down this story?


Below I have a Php Registration form that is working well, but am a bit concerned as the form is wide open for an Sql injection attack, I am aware about it but have very limited coding knowledge to prevent it, but still learning.   Have managed to add a Captcha to prevent bots from auto-filling the form and submitting, but unfortunately the same can't be said of being able to validate the First name and Last name,am just wondering how can I safeguard myself against such an attack.  The Relevant code is shown below, Thank You!  1) Check.php  <?php     session_start();     $captcha = $_POST['captcha'];     $captcha_answer = $_SESSION['captcha_answer'];      if($captcha != $captcha_answer) {         echo 'Captcha is incorrect!';     }     else {         echo 'Captcha is correct, congratulations! :)';     } ?>     <?php        if(isset($_POST['registration']) && $captcha == $captcha_answer)     {         require "connection.php";            $FirstName = strip_tags($_POST['FirstName']);          $LastName = strip_tags($_POST['LastName']);          $Msisdn = $_POST['Msisdn'];          $month = $_POST['month'];          $day = $_POST['day'];          $year = $_POST['year'];          $date = $year . "-" . $month . "-" . $day;          $dob = date('y-m-d', strtotime($date));          $Gender = $_POST['Gender'];          $Faith = $_POST['Faith'];          $City = $_POST['City'];          $MarritalStatus = $_POST['MarritalStatus'];          $Profession =$_POST['Profession'];          $Country = $_POST['Country'];          $query="insert into users set FirstName='".$FirstName."',LastName='".$LastName             ."',Msisdn='".$Msisdn."',dob='".$dob."',Gender='".$Gender."',Faith='".$Faith."',City='".$City."',MarritalStatus='".$MarritalStatus."',Profession='".$Profession."',Country='".$Country."'";       mysql_query($query)or  die("".mysql_error());               echo "Successful Registration!";                } ?>        2) Registration.php

Sign Up

It's free and anyone can join
      <form method="post" action="check.php" enctype="multipart/form-data">

             FirstName:	             <input type="text" name="FirstName" maxlength="10" required="" >

             LastName:	             <input type="text" name="LastName" maxlength="10" required="">

If user input is inserted without modification into an SQL query, then the application becomes vulnerable to , like in the following example:  $unsafe_variable = $_POST['user_input'];   mysql_query("INSERT INTO `table` (`column`) VALUES ('$unsafe_variable')");   That's because the user can input something like value'); DROP TABLE table;--, and the query becomes:  INSERT INTO `table` (`column`) VALUES('value'); DROP TABLE table;--')   What can be done to prevent this from happening?