I've earned the "Disciple" hat today (17/12/2020), but, when I check the hats I got so far, the "Disciple" is not shown in the earned hat list - even if the user has the "Disciple" on.  - where I earned the "Disciple" hat.  - just found at random that has the same "Disciple" but, it's not shown in their earned hat list. Is this a bug?

Till a couple of hours back I was having a collection of 20 odd colorful hats. All of a sudden now it seems a gust of wind made me lose a couple of my hats. I am aware about :  I fixed a bug in the secret definition of Vexillologist, removed the hat from all users (since a good number who earned it should not have, based on a bug in the sql) and reawarded to all users who should earn it. Anyone who is earning it now will get a new WB inbox notification. So if you are trying to figure out the hat, just look at hats awarded from [now - 5 minutes] and on.  Were there more similar incidences?  PS: I've managed to hide my Vexillologist hats within my cupboard up till now


i am working LWC for last one year and this one question always comes in my mind, why we need to use "this" notation to access LWC properties. I know this is a global variable in javascript and lwc model works on concept of shadow DOM. Also Only the lwc javascript requires this notation to access it not for the locally defined(with const,let and var) javascript variable. Thanks in advance.

I am trying to understand what exactly is the difference between window and this in the context of a LWC component.  According to this  the Locker intercepts calls to the Window and uses Secured Window instead which acts as:     Secure wrapper for the window object, which represents a window containing a DOM document.   As for this what I  was:     To add an event listener to an element that a template doesn’t own,   call addEventListener directly: this.addEventListener()   What does salesforce mean by an element that a template doesn't own? Isn't window an element that the template doesn't own?


My wife helps out a friend with managing the social media accounts of their small business. For that, she would like to have three independent Firefox instances installed on her Ubuntu laptop, because she frequently uses different logins for facebook, twitter, etc. at the same time. Additionally, she wants that   Firefox remembers the logins, but separately for each instance, so she can always be logged in e.g. facebook with three different accounts. Logins and passwords should not be shared between the instances. Each firefox instance is somehow distinguishable by a different theme color or something. all of the instances share her Home folder, where she keeps all her files Any changes to her workflow are not debatable :-)   What I tried:  First, I wanted to just create three different users and run one version of firefox as each. Then I though about the home drive problem, and resorted to Docker. I created three docker containers running firefox, used an extension to color the tabs and mounted the home folder. Unfortunately, firefox seems to run very unstable in a docker container, tabs frequently are crashing, and there are additional problems (e.g. sound) that are for sure solvable, but I am asking if anyone knows another way to achieve her goal?  Apparently, firefox creates some hidden folders in the HOME directory, where stuff like extensions and logins are stored. Is there a way to change that location? Any other ideas? I was reading about "Profiles" in firefox, but was not able to find that in the newer versions (she uses v57 I think).

I run Ubuntu 14.04 and want to use one installation of Firefox with two different profiles for the same logged in Ubuntu user.  How can I set this up, so that I may easily launch both profiles from the Unity launcher?


The following picture appears on the  on :    My minimal knowledge of Star Trek tells me that these men are Captain Jean-Luc Picard (on the right), First Officer William Riker (on the left), and Lieutenant Worf (in the background), officers on the Enterprise during Star Trek TNG.  But where does this picture originate? Is it a screenshot taken from an episode of Star Trek? If so, which one? A Youtube clip including this scene would be great, if anyone has one!  Bonus points if you can explain why they're wearing funny hats: this picture's  is "404_funny_hats.jpg".

On the three Stack Overflow chat servers, the  page displays the following image:    Is it from an actual episode, or is it a 'shop?


I try to plot this matrix (image) with this code but the shape of my equation has problem(second image) How I could correct it?       \documentclass[12pt]{article}     \usepackage{amsmath}     \usepackage{nicematrix}     \usepackage{amscd}     \usepackage{tikz}     \usetikzlibrary{arrows.meta, matrix, quotes, positioning}     \begin{document}             \begin{equation}\label{key}                 \left[ \left. \left( t_{A}\vert E_{\lambda_{i}}(A)\right)\right| X^{i}, X^{i} \right] =                 \begin{tikzpicture}[LA/.style = {Straight Barb-Straight Barb,                         shorten <=1pt, shorten >=1pt,                         draw=blue}                     ]                     \matrix (m) [matrix of math nodes,                     left  delimiter={[},                     right delimiter={]}                     ]                     {                         \lambda_{i}&&0&\\                         &\lambda_{i} &&\\                         0 && \ddots &\\                         &&& \lambda_{i}\\                     };                     %\draw (m-1-3.north east) -- (m-5-3.south east);                     %\draw (m-4-1.north west) -- (m-4-5.north east);                     %                     \draw[LA] (m-3-1.south west |- m.south) to [" $d_{i}$ " '] (m-4-4.south east |- m.south);                     %\draw[LA] (m-5-4.south west |- m.south) to ["2" '] (m-5-5.south east |- m.south);                     %                     \coordinate[right=5mm of m.east] (e);                     \draw[LA] (m-1-3.north east -| e) to [" $d_{i}$ "] (m-4-4.south east -| e);                     %\draw[LA] (m-4-5.north east -| e) to ["2"] (m-5-5.south east -| e);                 \end{tikzpicture}             \end{equation}     \end{document}   .

Lets say I have a 5x5 matrix. I want to place 2 leftrightarrows (with descriptions "3", "2") underneath the matrix, but really close to it: first pointing from col1 to col3 and second from col4 to col5. Plus updownarrows with similar outcome. How can I achieve that?  draft:  1 1 1 | 1 1  <--> <->


I need to draw a tangent to a graph at time = 4, 10, 16, and 24 on this graph. How would I go about drawing a tangent on it and measuring the gradient of the tangent?  \begin{tikzpicture}[rotate=90] \begin{axis} [     width=20cm, height=14cm,     title={Investigating the affect of concerntration on rate of reaction},     xlabel={Time (s)},     ylabel={Volume Displaced (cm$^3$)},     grid style=dashed,     ymajorgrids = true,     xmajorgrids = true,     mark size = 1, ] \addplot[scatter , mark=halfcircle* , only marks , mark size=2.9pt , thick , smooth , color=orange ]     table{data/2.9-conc1.dat};  \addplot[scatter , mark=square* , only marks , mark size=2.9pt , thick , smooth , color=red ]     table{data/2.9-conc2.dat}; \legend{7:3,5:5} \end{axis} \end{tikzpicture}     Here are the results:  X   Y 2   2.8 4   11.2 6   19.8 8   28.2 10  37.4 12  45.5 14  54.4 16  63.3 18  73.0 20  82.4 22  92.1 24  103.3 26  113.2  X   Y 2   10.8 4   26.0 6   43.0 8   60.0 10  79.4 12  98.5 14  119.0 16  139.2 18  163.1 20  187.0 22  211.8 24  238.5 26  267.7

I am drawing some graphs with tangents. I calculated the tangent should be centered at x=57/27 which is approximately x=2.11. I'm currently using the pos and sloped keys for nodes to draw tangents, but I'm not happy about the result; the tangents don't really align.   I think this is because the pos key calculates the actual length of the graph while the graphs don't have the same length.  I'm sure I can somehow let LaTeX do the calculations for me so as to align the slopes vertically at an x value of my choice. But how?  PS: The below document requires a working installation of gnuplot to compile.    \documentclass{standalone}   \usepackage{pgfplots} \pgfplotsset{compat=1.10} \usetikzlibrary{arrows, decorations.markings,intersections}  \makeatletter \tikzset{     nomorepostaction/.code=\makeatletter\let\tikz@postactions\pgfutil@empty,      my axis/.style={         postaction={             decoration={                 markings,                 mark=at position 1 with {                     \arrow[ultra thick]{latex}                 }             },             decorate,             nomorepostaction         },         thin,         -,         every path/.append style=my axis     } } \makeatother  \definecolor{headtitle}{RGB}{167,63,63}  \begin{document} \begin{tikzpicture}   \begin{axis}[%       axis line style={my axis},       xlabel = $U_A$,       ylabel = $S$,       xmin = 0, xmax = 3.25,       ymin = 0,       xtick={1,1.5},       xticklabels={$U_{B,\mathrm{initial}}$,$U_{A,\mathrm{initial}}$},       xticklabel style={             inner sep=0pt,             anchor=north east,             rotate=35         },       ytick=\empty,       height=.66\linewidth, width=\linewidth-4.5\tabcolsep,       axis lines*=left,       every axis y label/.style={at=(current axis.above origin),anchor=east},       every axis x label/.style={at=(current axis.right of origin),anchor=west}]%     \addplot+[mark={},draw=headtitle] gnuplot[raw gnuplot] {%       set samples 51;       plot [0:3] log(3*(3-x)+1);       } node[sloped,above,pos=.63333,       minimum height=1cm,minimum width=1cm] (SB) {} node[pos=0.6,pin=45:{\color{black}{$S_B$}}] {};      \addplot+[mark={},draw=headtitle] gnuplot[raw gnuplot] {%       set samples 51;       plot [0:3] log(9*x^2+6*x+1);       } node[sloped,above,pos=.83333,       minimum height=1cm,minimum width=1cm] (SA) {} node[pos=0.25,pin=-15:{\color{black}{$S_A$}}] {};       \addplot+[mark={},draw=headtitle] gnuplot[raw gnuplot] {%       set samples 51;       plot [0:3] log(9*x^2+6*x+1)+log(3*(3-x)+1);       } node[sloped,above,pos=.775,       minimum height=1cm,minimum width=1cm] (St) {} node[pos=0.525,pin=165:{\color{black}{$S_\mathrm{total}$}}] {};      \path (SB.south east) edge[headtitle,very thick] node {} (SB.south west);      \path (SA.south east) edge[headtitle,very thick] node {} (SA.south west);      \path (St.south east) edge[headtitle,very thick] node {} (St.south west);   \end{axis}% \end{tikzpicture}% \end{document}


In Argentina I was once charged the "gringo" rate for a bus and was later told I could have negotiated the price because locals pay less.   From an ex-colleague who spent 6 months in China I heard you need to negotiate everything, especially at markets, for cab rides and accommodation. I also heard the same about Mexican and Peruvian markets.   This  strongly recommends price negotiation because it's a cultural norm "in the East".  also seems to have a culture that expects prices to be negotiated.  What are some tips to negotiating prices (for things or services) across cultural boundaries ? If it's for sale, is it safe to assume it's negotiable ? How do I know what the local value of something is, that is, am I being ripped off ?

While I've done quite a bit of travel now and back myself to handle situations when it comes to border guards, sorting accommodation and / or transportation, one thing I still struggle to come to terms with is haggling in the markets, be it for food, clothing or other.    Image © Peter Morgan, 2014   What is the best way to go about this? I'm generally either worried I'll offend them, or that they're trying to rip me off anyway, so it's a weird combination of awkwardness inside my head ;)


How can I interpret the descriptive statistics of logarithmic transform variables    mean  maximum minimum  standard deviation  kurtosis Skewness ?  In case I use log transformed form of the variables in my analysis,  do I have the right to use the descriptive statistics of the non transformed variables?

Because of larger values of variables, I did a log- transformation in my dataset. Now I want to give a descriptive table regarding my variables like mean, max, min, median, skewness, kurtosis. Can I give standard measures like arithmetic mean or should I give geometric mean? In terms of skewness or kurtosis, do I need a transformation?


Can someone please confirm if I understand this correctly: When neither R nor S are on (both are 0) it seems to me that at first both outputs are 1, then it feeds back through, and both go to 0, and then back to 1, infinitely?  But this assumes that all the signals travel precisely exactly as fast. As I understand it, in the real world there are teensy variations in the response times of the electronic components, which will lead to one of the outputs being stably on and the other being stably off. However, the collapse of the oscillating circuit is NOT due to the logic of the circuit, but the imperfections of the real world.  Again, as I understand it, if we had perfect components with no variations that could perfectly replicate the circuit in the image, then both outputs would oscillate between being on together and off together forever - or at least until R or S is set.  Now for the big question: is this 100% correct, or have I made a significant mistake? Because trying to understand the off-state of this circuit has been breaking my brain. (Just a regular fellow with no electronics experience here and a bit of understanding of logic.)

In this diagram     what would be the beginning state for Q?  Since the first NOR for S and R rely on previous results, there must be something for the first iteration?  NOTE: I'm in a first year digital logic class, so the question is for theoretical use (table making, various homework problems it applies to, etc.), not actual implementation.  Just for things like "if R is __ and S is __ what is Q?"  Simple things like that.


I notice that entering an old date in the "birthdate" field returns the error "Date must be later than 1920/01/01" which is actually not true, because you can enter a date of 1920/01/01.  Also, are the developers assuming no one on the site is older than 94? I know that SAS database dates have a range begin at 1920. Tell me they are not using SAS to power Stack Exchange.

There is a restriction on setting your birthday:     Oops! There was a problem updating your profile:   - Birthday must be after 1920/01/01   I realize the number of 90 year old users is small, but shouldn't the restriction be a bit more relaxed, such as larger than any ?  Either 120 or 150 seems appropriate.  For example, my grandfather turns 90 next year (and just barely misses the current cutoff), but I can't imagine he's the only one around that age who is computer literate and still active enough to be interested in (the increasingly broad range of) SE sites.  I don't think he has contributed yet (mostly because of the comment restriction, I'd see him commenting before asking or answering), but I have emailed him with links that I know he's read.  Incidentally, the error message is wrong: birthday must be after 1919/12/31 and using the next day is accepted.


Hi I'm trying to make a screen that will have a bunch of platforms that will place themselves randomly around a JFrame. I know how to do the stuff to make the character jump and to deal with the collisions just not a way to place the platforms on the screen randomly so they are close enough together that the character could reach. Any help is appreciated.

I want to randomly generate reachable platforms on the fly for a 2D game.  Right now, I am just creating platforms at random x,y positions.  Only 4 platforms can exist at once, so once the 5th one is generated the 1st one is removed (fifo).  So, I want to ensure that the player can jump from his current platform to at least one other at any given time.  I was thinking of using some variant of the distance formula to calculate the location of the next platform being generated.  I was hoping someone could help me out with the formula for calculating the next platforms possible x,y positions.  The player variables I am assuming will be important are speedX, speedY, and gravity.  From here, I should be able to calculate the maximum distance to plug into the distance formula.    However, I am thinking that some variation of the distance formula that contains a variable for slope would be better in my case.  I want to ensure that the player will never get stuck on a platform with no where it can jump.  Also, I want to ensure that platforms aren't generated on top of each other.  Formulas/images/code are a huge plus.  Here is how jumping is currently working.  Field speedY:Float = 4 Field GRAVITY:Float = .05  Method Update:Void()     If KeyDown(KEY_SPACE) And not jumping Then         dy=-speedY         jumping = true     EndIf       If jumping         dy += GRAVITY         local tempY:Float = y + dy         y = tempy     Endif End Method   Edit: I now understand that the formula is just the displacement of basic projectile motion.     Except, in my case, we don't care about cos/sin because the angle will always be the same.


I read in a recent post that you can simulate a light being visible to the camera by adding an object and using the following node setup:    It works as intended, but creates jagged edges:    There is a workaround to get rid of the jagged edges by connecting "Is Camera Ray" to the "Strength" input of the "Emission" node:    Great!, but now the object becomes dimmer:    How can I have a non-jagged light source while maintaining brightness?

Often when a mesh light is visible in the camera, the edges are not anti-aliased.  No matter how many samples I do, the lamp border always looks jagged and pixelated.  Is this a rendering error? How can I get around this issue?    And zoomed in 4x:


How might I run 3+ versions of google chrome so I can log into to 2 different google accounts.  More specifically I am looking to have separate icons in the dock for the 3 separate running applications.  How might I run duplicate and or copy versions of the same application.  The following  by Mark works for a lot of applications but not for Google Chrome.  It appears the following might work .

How might I run 3+ versions of google chrome so I can log into to 3 different google accounts.  More specifically I am looking to have separate icons in the dock for the 3 separate running applications.  How might I run duplicate and or copy versions of the same application.  The following  by Mark works for a lot of applications but not for Google Chrome.  It appears the following might work .


I'm wondering why it is causing a null pointer exception. I'm trying to trigger Connect() function from another class which should have connect me to the database.  MainController class:  DBConnect dbConnect; @FXML private TextField logInField; @FXML private PasswordField passwordField; @FXML private Button logInButton;   @FXML private void buttonClicked() throws SQLException {     dbConnect.Connect(); }  @FXML private void initialize(DBConnect dbConnect) {     this.dbConnect=dbConnect; }   DBConnection class:  Connection conn; Statement st; ResultSet rs;  public void Connect() throws SQLException {     conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/bookcase", "root", "1234");     if(conn.isValid(10))     {         System.out.println("Connection reached");     }     else     {         System.out.println("Something went wrong!");     } }   It seems that the dbConnect property is not initialized, but i've already done it in initialize() method, which should be triggered after FXMLLoader loads the rest of the data, am I right? Am i using referance for the Connect() function from the other class correctly ? Regards

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?


My sister needs a camera. Can anyone guide me which one to buy, as I have no knowledge about it.  She is studying Architecture, and she often goes for site seeing and she needs to take picture(mainly buildings, structure, interior)  I asked some of my friends which camera will be good for her, they said  Point & Shoot will be good. There are many point and shoot cameras available in the market which one to buy? can some one give me some more specification or details, so that I can buy a good camera to my sis, from architectural view point.  Preferred brand- Nikon

I need a P&S camera for my family. They would probably use it for family functions,trips etc. I want a camera with flash for taking good night photos with a decent quality. They are not technically inclined and I dont want much manual features apart from the normal modes (potrait,sports,landscapes). Decent picture quality for normal conditions is the criteria I am looking for. If the camera looks little big, it is an added advantage.  I have looked at few models like Fujifilm Fine Pix F800 EXR, the Panasonic Lumix DMC series and a Nikon P510. But I am confused with all the options and the different reviews on different sites. My thinking is that for a point and shoot camera, it is better to consider brands other than Nikon and Canon since they may provide better value for money.   Can someone recommend some good resources for analysis and what kinds of cameras I should consider - a bridge camera, a basic point and shoot, or some other type?


The numbers of references didn' t appear in beamer? How to solve?

I would like to add my bibliography to my presentation in IEEE format. What should I add to my preamble and code.  \documentclass{beamer} \setbeamertemplate{footline}[page number]  \usepackage{graphicx} \usepackage{booktabs} \begin{document} \section{Reference} \begin{frame} \frametitle{Reference}  \end{frame}   I'm using the same bibTex which I use to make the IEEE paper.


Maybe a stupid question...but I often see the usage of \csname in code -- especially in packages. Can someone explain what its purpose is?   As far as I see it generates a new command based on an argument.

What exactly do \csname and \endcsname do? What are their job? I have glanced at the Texbook and some other books, but none of them was clear enough to me. Can anyone please give a simple example to clarify this issue?


How can I prove the following? The RHS is not about SIN     If $\alpha = \beta + \omega$, then    $$1 + \cos\alpha+\cos\beta+\cos\omega = 4 \cos\frac{\alpha}{2}\cos\frac{\beta}{2}\cos\frac{\omega}{2}$$   I've already tried that one: $$\cos (\alpha+\omega) + \cos\omega +\cos\alpha + \cos 2(\alpha+\omega)$$ What more can I do?

I humbly ask for help in the following problem.  If  \begin{equation} A+B+C=180 \end{equation} Then prove \begin{equation} \cos A+\cos B+\cos C=1+4\sin(A/2)\sin(B/2)\sin(C/2) \end{equation} How would I begin the problem I mean I think $\cos C $ can be $\cos(180-A+B)$. But I am unsure what to do next.


In Munkres, problem 20 of Section 2-6, it says that 14 distinct sets can be formed by complementation and closure. I see only five so far. Let f be the function of closure mapping and g be the function of complementation mapping. It is clear, f,g, fg,gf, and gfg are the 5 of 15 distinct sets. What are the rests? Was there any topological argument associated with it? How can I understand this intuitively and pictorially?

Here's Prob. 21 in Sec. 17 of the book Topology by James R. Munkres, 2nd edition:  Consider the collection of all subsets $A$ of the topological space $X$. The operations of closure $A \to \overline{A}$ and complementation $A \to X-A$ are functions from this collection to itself. (a) Show that, starting with a given set $A$, one can form no more than $14$ distinct sets by applying these two operations successively. (b) Find a subset $A$ of $\mathbb{R}$ (in its usual topology) for which the maximum of $14$ is obtained.  My effort: Based on the feedback I've had from the valued Mathematics Stack Exchange community, I would like to ammend my effort as follows: Let $\mathcal{P} (X)$ denote the power set (i.e. the collection of all the subsets ) of $X$, and let the functions $f \colon \mathcal{P} (X) \to \mathcal{P} (X) $, $g \colon \mathcal{P} (X) \to \mathcal{P} (X) $, and $i \colon \mathcal{P} (X) \to \mathcal{P} (X) $ be defined as follows: $$f(A) \colon= \overline{A} \ \ \ \mbox{ for all } \ \ \ A \in \mathcal{P} (A),$$ $$g(A) \colon= X - A \ \ \ \mbox{ for all } \ \ \ A \in \mathcal{P} (A),$$ and $$i(A) \colon= \mathrm{Int} (A) \ \ \ \mbox{ for all } \ \ \ A \in \mathcal{P} (X).$$ Then we have the following couple of results $$f(f(A)) = f(A), \ \ \ i(i(A) = i(A), \ \ \ \mbox{ and } \ \ \ g(g(A)) = A \ \ \ \mbox{ for all } \ A \in \mathcal{P}(X).$$ Moreover, we also have the following two relations: $$f(g(A)) = g(i(A)) \ \ \ \mbox{ and } \ \ \ g(f(A)) = i(g(A)) \ \ \ \mbox{ for all } \ A \in \mathcal{P} (X).$$ How do we show that $$f(g(f(g(f(g(f(g(A)))))))) = f(g(f(g(A))))$$ and  $$g(f(g(f(g(f(g(f(A)))))))) = g(f(g(f(A))))$$ for all $A \in \mathcal{P} (X)?$. Please also refer to  link.


I have committed the code but i want to undo that commit, i have revision and branch number as well, i am unable to undo.  My clientis tortoise SVN, committed from IntelliJ Idea. Please help.

I committed a bunch of files (dozens of files in different folders) by accident. What is the easiest, cleanest (and safest!) way to 'undo' that commit without having to delete the files from my working directory?


Consider:    Per the above I recently flagged a post on Stack Overflow, and yet I  the .  Is there something else I have to do to get that badge?

Did the margins for the silver & gold specialty badges change recently? I reached 400 votes for the , but it's been ~2 days and still haven't been awarded the badge.  I gather there's a delay to make sure votes aren't reversed/etc...  On a side note, what does it take to get a Citizen Patrol badge?  I've flagged numerous things, comments and questions alike.


Every time I try to upgrade to 19.10, I get a message saying “An upgrade from ‘cosmic’ to ‘eoan’ is not supported with this tool”. How can I upgrade?

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


Similar symptoms to the last year's problem  and  and same workarounds: Either, open and close the Web Developer Inspector (Cntrl+Shift+C); Or, Restore-Maximize the browser window.  It's an old "unsupported" browser Firefox 52.9 32bit, so if not fixable, I'll keep using the Win+KeyDown & Win+KeyUp combination to re-render the page with corrupted comments. Not every page needs it. I look at the last comments: if they're missing a timestamp, there might be some MathJax missing too.  UPDATE: I was asked to edit the question to address that "Some community members have suggested a similar question that may solve your problem". Well, a reiteration that my Firefox is not supported, which I stated already in my question, does not solve my problem. I'm looking to collect workarounds here. Pressing a number of keys to resize the body is one solution, also please take a look at another thread  where I'm asking for an automatic Javascript user-script that would do the workaround for me each time after the page is loaded.

Looking at , I noticed the times for the comments are missing:    When I reload the page, I see the times on the comments for a fraction of a second, and then they are gone.  On shorter comment threads, I sometimes do see the comments.  Initially I thought that they seemed to disappear if and only if the comments thread gets collapsed due to a large number of comments.  When I click on "show 14 more comments", all comments are shown, including the times, but for shorter comment threads, I sometimes do, sometimes do not see them all; I cannot fully reproduce this.   on Linux (Ubuntu xenial 16.04), no user scripts.


import java.util.function.Function;  public class Playground {     public static void main (String[] args) {         Object o = null;         System.out.println(o);         Function<Object, String> toStringFunc = Object::toString;         String s = toStringFunc.apply(o);         System.out.println(s);     } }   This code will result in a NullPointerException being thrown, reported at the line containing toStringFunc.apply(o).  This is a trivial example, so it's easy to see that o == null, but how in general can we understand why this line of code would throw a NPE, as toStringFunc, the only variable being dereferenced in that line, is not null.

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


I have tried finding a solution to this through  and  I'm currently creating a form. it uses radio buttons which are assigned to make rental = 1 or 0 <input id="rental" name="rental" type="radio" value =0 class="form-control input-md" > Buy
 <input id="rental" name="rental" type="radio" value =1 class="form-control input-md" > Rent
  rental is then assigned to $rentalfromform within this if statement: if (isset($_GET["rental"])){ $rentalfromform = $_GET["rental"]; }else{ $rentalfromform = '1 OR rental = 0'; }  this is then used and binded within the following SQL and PDO $sql = "SELECT *  FROM $this->tableName  WHERE addressHouse REGEXP '[^a-zA-Z0-9]" . $locationfromform . "[^a-zA-Z0-9]'  AND strippedPrice < ? AND title LIKE '%" . $bedroomfromform . "%' AND (rental = ?) OR addressJob LIKE '%" . $locationJobfromform . "%'  AND jobTitle LIKE '%" . $keywordfromform . "%' AND jobstatus LIKE '%" . $statusfromform . "%'  AND salary LIKE '%" . $salaryfromform . "%'";  $stmt = $this->conn->prepare($sql); $stmt->bindParam(1, $pricefromform, PDO::PARAM_INT); $stmt->bindParam(2, $rentalfromform, PDO::PARAM_INT); $stmt->execute(); return $stmt->fetchAll(PDO::FETCH_ASSOC);  rental within the database is a TINYINT(1) datatype. If there is no value entered by selecting a radio button within the form I would like to return all of the values within the MySQL database regardless of the values of the rental column. My problem appears to lie within the if statement $rentalfromform = '1 OR rental = 0'; It only returns results where rental = 1. It ignores the OR. If I change it to $rentalfromform = '0 OR rental = 1'; It only returns results where rental = 0. It ignores the OR. I have also tried: '1 OR 0', 'NULL', '!NULL', '', ' ' and 'NOT NULL' amongst a list of similar operations. I guess the = within the SELECT statement is the issue for some of these as NULL would need to have IS... IS NULL Has anyone got any clever workarounds for this, I can't seem to find one. This is my first time posting a question. I am aware that the rest of my code isn't perfect as I am new to this technology.

Why can't I pass the table name to a prepared PDO statement?  $stmt = $dbh->prepare('SELECT * FROM :table WHERE 1'); if ($stmt->execute(array(':table' => 'users'))) {     var_dump($stmt->fetchAll()); }   Is there another safe way to insert a table name into a SQL query? With safe, I mean that I don't want to do  $sql = "SELECT * FROM $table WHERE 1"


Ok, so I am afraid my hard drive or whole computer will explode. I am getting a new one, so is it possible to just copy my Skyrim saved games on a USB drive, and then just copy them on my new computer's hard drive? Will it work that way? Or is there a reliable way to save them through the cloud in Steam or something?   TL;DR: What is the best way to backup Skyrim save games and put them on my new computer's hard drive if the old one breaks?

I can't find those that I need to delete. What's the location of those files?  How can we manage them?


I'm at a crossroads where I need to decide if I'm going to stick with bigserial as my primary key, or change to uuid (non-auto-generating—my API server will generate the ID using uuid v4 and insert it). I've spent hours researching bigserial vs uuid primary keys, and it seems no one can agree on what the disadvantages of uuid would be (if any). My database isn't that complicated: it's a series of tables with pretty basic relationships, I'm typically only inserting one row at a time, I have a handful of jsonb fields I'm using here and there. Write speed/frequency will only be significantly high on one table in particular. The reason I started looking into UUIDs wasn't because I think I'll ever run out of bigint keys (9 quintillion, if I recall), but more from a standpoint of obfuscation. Right now I'm having to hash the IDs on the front-end to avoid showing the user DB IDs in the URL (e.g. /things/2732). Using , I can instead have URLs like /things/To2jZP13dG. But I thought I could go a step further and just use UUIDs which don't give any clues as to # of records. What I don't like is the added effort of having to encode IDs before passing them to the back end and decoding them there, and then when querying batches of 50-100 items to return to the client, having to mass encode all those IDs before returning them to the client. One argument for random UUIDs (uuid v4) was:  If your primary key is an incrementing ID, those are stored physically next to each other. That database page can have contention as many people are writing to it.  Random IDs prevent contention by spreading the writes all over the DB  But then I found a contradictory statement :  Regular random UUIDs are distributed uniformly over the whole range of possible values. This results in poor locality when inserting data into indexes - all index leaf pages are equally likely to be hit, forcing the whole index into memory. With small indexes that's fine, but once the index size exceeds shared buffers (or RAM), the cache hit ratio quickly deteriorates.  I know the folks at Heroku are fans of using UUIDs as primary keys. For whatever it's worth, I wasn't planning on having Postgres auto-generate the IDs at all. Instead, my API server would generate a v4 UUID and pass that to the database (this would allow my API server & front end client to be more efficient and not have to always use RETURNING id statements in my queries). Does anyone have a canonical answer on the true cost of INSERT statements when using uuid as the primary key?

I would like to build a distributed system. I need to store data in databases and it would be helpful to use an  or a  as a primary key on some tables. I assume it's a drawbacks with this design since the UUID/GUID is quite large and they are almost random. The alternative is to use an auto-incremented INT or LONG.  What are the drawbacks with using UUID or GUID as a primary key for my tables?  I will probably use Derby/JavaDB (on the clients) and PostgreSQL (on the server) as DBMS.


Skype appears to have done something to prevent stopping it from auto-running on startup. There is no longer a setting to prevent it from starting on boot. The settings that remain mean I can hide it from the tray (but they still run it in the background -- it's got 4 processes in task manager: Skype > SkypeBridge, Runtime Broker, SkypeApp, Microsoft Skype).  It no longer appears in "start-up" tab of task manager either.  I only use it occassionally, but it's a pain logging out because then one has to find one's password making quickly contacting someone a pretty rubbish UX.  Are Microsoft really that evil, or did they move the setting somewhere and I've missed it? I just want to use Skype when I want to run it, and not have Microsoft control when it gets run, is that asking too much? Is the only route now to delete it and force my elderly relatives to use something else?  (Are there other apps they're shadow running?)  Windows 10, Skype version 8.42.0.60

How to stop Skype from starting automatically when booting Windows 10?  I can't find such an option, either in the Skype app settings or in the Task Manager > Startup tab.


I recently set up a dualboot with Ubuntu 17.04 and Windows 10 (Home 64). My system came with 8GB of RAM and 512GB of SSD. I followed some tutorials and most of them recommended a 15-25GB partition to install Ubuntu, regardless of the available space on the hard drive or SSD. Here's the partition breakdown:  Ubuntu partition: 25GB, the OS takes up about 5GB and I allocated 10GB for swap space Windows (C:) partition: 450GB, the OS takes up about 30GB  The remaining space on the Ubuntu partition is roughly 10GB out of 25GB. I'm trying to understand the file system. So everything in /home directory and / (root) is in the 25GB partition.   How do I access (or make use of) the rest of the SSD on the primary (C:) drive which is roughly 420GB (not including Windows OS) for bulk storage (projects, assignments, etc)? Would this also be a good place to install SDKs and other developer tools & packages? Should I allocate a separate partition for this?  If this isn't the right approach, is there a way to re-adjust the partition sizes to make sure I have plenty of bulk storage? Like re-allocating space from Windows (C:) drive and adding it to /home. Looks like most people work out of the /home directory and store all their work directories there, should that partition be as big as it can?

I have a laptop with win7 installed. I have now made a 60gb partition which I want to install ubuntu into. The question I have, before I do the installation, is how large each of the root, swap, and home partition should be? I have read some place that root could be as small as 8GB, but isn't that too small? Since I guess beside ubuntu all the softwares installed will reside there as well? And I think I'm going to set my swap to be 2GB large.  My main concern is how large should the root partition should be. I'm mainly going to use ubuntu for programming and browse the web.


Can anyone tell me how to solve this recurrence efficiently $F(n) = F(n-1) + F(n-2) + F(n-1)*F(n-2)$. I will be provided value of $F(0)$ and $F(1)$ and have to calculate $F(n)$.  $0 \le N \le 10^9$

I have encountered this question in a coding competition and want the formula for $f(n)$. Is there any way to do this?


As an amateur mathematician and lover of the sciences I have a well working knowledge of classical mechanics, quantum mechanics, general relativity, quantization, and so on...  But recently I've been intrigued in the concept of string theory and have considered reading Polchinski's text book on the matter. As a lover of mathematics first most are there any different branches of mathematics used in proofs in string theory other then the types of mathematics used in the subjects I have listed above?

I'm interested in cutting edge string theory studied by research physicist. I'm wonder what  mathematics is needed and how far am I in terms of mathematics background needed and how much more mathematics do I need in order to study it properly and reach my goal. My mathematics level is at calculus/Linear algebra.


I am new to ML. I am trying to implement k-means which uses a BIC function that takes cluster and data points as arguments and returns BIC value. I need a function to find best k value that is maximise the BIC. Can anyone provide a code snippet for BIC function in python. I searched everywhere I couldn't find exact what I needed

I am currently trying to compute the BIC for my toy data set (ofc iris (: ). I want to reproduce the results as shown  (Fig. 5). That paper is also my source for the BIC formulas.  I have 2 problems with this:   Notation:   $n_i$ = number of elements in cluster $i$ $C_i$ = center coordinates of cluster $i$ $x_j$ = data points assigned to cluster $i$ $m$ = number of clusters    1) The variance as defined in Eq. (2):  $$ \sum_i = \frac{1}{n_i-m}\sum_{j=1}^{n_i}\Vert x_j - C_i \Vert^2 $$  As far as I can see it is problematic and not covered that the variance can be negative when there are more clusters $m$ than elements in the cluster. Is this correct?  2) I just cannot make my code work to compute the correct BIC. Hopefully there is no error, but it would be highly appreciated if someone could check. The whole equation can be found in Eq. (5) in the paper. I am using scikit learn for everything right now (to justify the keyword :P ).  from sklearn import cluster from scipy.spatial import distance import sklearn.datasets from sklearn.preprocessing import StandardScaler import matplotlib.pyplot as plt import numpy as np  def compute_bic(kmeans,X):     """     Computes the BIC metric for a given clusters      Parameters:     -----------------------------------------     kmeans:  List of clustering object from scikit learn      X     :  multidimension np array of data points      Returns:     -----------------------------------------     BIC value     """     # assign centers and labels     centers = [kmeans.cluster_centers_]     labels  = kmeans.labels_     #number of clusters     m = kmeans.n_clusters     # size of the clusters     n = np.bincount(labels)     #size of data set     N, d = X.shape      #compute variance for all clusters beforehand     cl_var = [(1.0 / (n[i] - m)) * sum(distance.cdist(X[np.where(labels == i)], [centers[0][i]], 'euclidean')**2)  for i in xrange(m)]      const_term = 0.5 * m * np.log10(N)      BIC = np.sum([n[i] * np.log10(n[i]) -            n[i] * np.log10(N) -          ((n[i] * d) / 2) * np.log10(2*np.pi) -           (n[i] / 2) * np.log10(cl_var[i]) -          ((n[i] - m) / 2) for i in xrange(m)]) - const_term      return(BIC)    # IRIS DATA iris = sklearn.datasets.load_iris() X = iris.data[:, :4]  # extract only the features #Xs = StandardScaler().fit_transform(X) Y = iris.target  ks = range(1,10)  # run 9 times kmeans and save each result in the KMeans object KMeans = [cluster.KMeans(n_clusters = i, init="k-means++").fit(X) for i in ks]  # now run for each cluster the BIC computation BIC = [compute_bic(kmeansi,X) for kmeansi in KMeans]  plt.plot(ks,BIC,'r-o') plt.title("iris data  (cluster vs BIC)") plt.xlabel("# clusters") plt.ylabel("# BIC")   My results for the BIC look like this:     Which is not even close to what I have expected and also makes no sense... I looked at the equations now for some time and am not getting any further locating my mistake ):


Can i prove that   $$\sin(\pi) = 0 $$  by letting $$x= \pi$$ in its series expansion?? and somehow work something from there without just saying "the series is equal to $\sin(x)$ thus $\sin(\pi) = 0 $  Thanks in advance

Prove $\sin(\pi/2)=1$ using the Taylor series definition of $\sin x$,   $$\sin x=x-\frac{x^3}{3!}+\frac{x^5}{5!}-\cdots$$   It seems rather messy to substitute in $\pi/2$ for $x$. So we have  $$\sin(\pi/2)=\sum_{n=0}^{\infty} \frac{(-1)^n(\pi/2)^{2n+1}}{(2n+1)!}.$$  I'm not too sure where to go from here.  Any help would be appreciated! Thanks!


By equating $F_{\rm gravitation}$ to $F_{\rm centripetal}$, the formula for the velocity of an object traveling along a certain orbital becomes $\sqrt{\frac{GM}{r}}$. The formula for angular momentum can be written as $L=mvr$. In elliptical motion, for example, when earth travels further away from the sun, the radius increases. Therefore, writing the formula of $L=mvr$ as $L=\sqrt{\frac{GM}{r}}mr$, it can be seen that as $r$ increases angular momentum should increase. However, this shouldn't happen because no net torque was applied.

Why is angular momentum conserved when a planet revolves about sun in an elliptical orbit? Why is linear momentum not conserved in this case?  Please use the minimum amount of equations and try to explain using pure physics logic if possible.


In sftp, put * or get * do not get the hidden files or directories inside a dir.  What to do if I want to use sftp to copy entire dir, along with the subdirs that are hidden?  For example, a .git directory inside the directory. I do not require the scp commands. How to do that in a sftp shell?

I'm just learning to use sftp, and I want to copy a directory from the remote computer to my local computer. If I try  get [directory]   it gives me this error:  Cannot download non-regular file: /home/mpirocch/Documents   get -R doesn't work, either.


Im tryng to boot my computer with Linux w/ Ubuntu through a Usb stick/flash drive. I know how to do it from a windows computer but not from another linux machine...Help?

edit OK thanks to you i found the file but now every time i put a 'iso' file it says 0.0B (like its Not weigh any..) what to do now:


I've seen many differing opinions on how the discovery of the Higgs boson (specifically due to its mass) has effected theories of Super Symmetry, but all seem fairly biased. I'm wondering if someone could explain which SUSY models are invalidated (if any), why the mass of sparticles being hugely different to their counterparts is important/unimportant?  i.e. "SUSY is invalid due to the Higgs being much more massive than predicted in their models (so sparticles must have >> mass than their counterparts)"   whilst also seeing,  "SUSY models are favoured, and only need to be adjusted slightly to compensate for the Higgs mass"

I'm a complete noobe in physics and quite honestly need help. My question is simple, based on CERN's tentative findings stating the Higgs boson at a mass of ~125 GeV: Is the physics community leaning more towards supersymmetry or multiverse?


Let $X_1,X_2$ be independent random variables each having a exponential distribution with mean $λ = 1$.   (a) Find the joint density of $Y_1 = X_1$ and $Y_2 = X_1 + X_2$.  (b) Get the marginal density of $f_{Y_1}(y_1)$ and $f_{Y_2}(y_2)$.  These are what I've found so far.  $$f_{X_1}(x_1)=e^{-x_1}, f_{X_2}(x_2)=e^{-x_2}$$ $$f_{X_1,X_2}(x_1, x_2)=f_{X_1}(x_1)f_{X_2}(x_2)=e^{-x_1-x_2}$$  Also, since $Y_1=X1$, $f_{Y_1}(y_1)=e^{-y_1}$ right? Similarly, since $Y_2=X_1+X_2$, $f_{Y_2}(y_2)=e^{-y_2}$  However, is it guaranteed that $Y_1$ and $Y_2$ are independent? or else how can I solve these problems??  Oh, and I haven't learned the Jacobian so it would be grateful if you avoid using it.

Let $X_1$ and $X_2$ be independent random variables each having a exponential distribution with mean $\lambda = 1$.  (a) Find the joint density of $Y_1 = X_1$ and $Y_2 = X_1 + X_2$.  (b) Get the marginal density of $f_1(y_1)$ and $f_2(y_2)$.  $f(x_1)=e^{-x_1}$, $f(x_2)=e^{-x_2}$  Since $X_1$ and $X_2$ are independent, $f(x_1, x_2)=f(x_1)f(x_2)=e^{-x_1-x_2}$  However, how could I find the joint density?  I mean, it is quite easy to find marginal ones from the joint one, but how can I do the opposite?


Let $A_{n\times n}$ is Hermitian matrix,and $A_{n\times n}\neq I_{n\times n}$,where $I_{n\times n}$ is Identity matrix,  prove or disprove   $$4A^5+2A^3+A=7I$$  my try: if such this condition: then matrix $A$ Characteristic polynomial  $$4\lambda^5+2\lambda^3+\lambda=7$$ $$(\lambda-1)(4\lambda^4+4\lambda^3+4\lambda^2+4\lambda+7)=0$$  then I can't  since  Hermitian matrix :

$n$ is a positive integer. Besides the identity matrix $I_n$, does there exist other  $n\times n$    $M$, such that the following equality  $$4M^5+2M^3+M=7I_n $$  hold?  I try this: Since  $4M^5+2M^3+M=7I_n$, then   $$(M-I_n)(4M^4+4M^3+6M^2+6M+7I_n)=0$$  but, What should I do next? Thanks!


Is there a way I can pick all n-combinations from a list  Suppose my list is [1,2,3] is there a way I can get the result as  [ [1] , [2] , [3] , [1,2] , [2,3] , [1,3] , [1,2,3] ]   p.s I don's want both [1,2] and [2,1] to be returned.  I'm sorry if the question is framed poorly

I have a list with 15 numbers in, and I need to write some code that produces all 32,768 combinations of those numbers.   I've found  (by Googling) that apparently does what I'm looking for, but I found the code fairly opaque and am wary of using it. Plus I have a feeling there must be a more elegant solution.  The only thing that occurs to me would be to just loop through the decimal integers 1–32768 and convert those to binary, and use the binary representation as a filter to pick out the appropriate numbers.   Does anyone know of a better way? Using map(), maybe?


Let $\alpha:[0,1]\to\mathbb{R}$ be a continuous function, and suppose that for any continuously differentiable "non-constant" function $\beta:[0,1]\to\mathbb{R}$ with $\beta(0)=\beta(1)=0$ satisfies the following integral equation:$$\int_{0}^{1}\alpha(x)\beta'(x)\,dx=0.$$ Prove that $\alpha$ is constant on $[0,1]$.   It looks very similar to a well-known problem(such as the above integrand of the form $\alpha(x)\beta(x)$, where $\beta(x)$ is any continuous function on $[0,1]$), but I don't know how to prove it.  I'd be grateful if someone could give me some advice. Thank you.

Let $g:[0,1] \rightarrow \mathbb R$ be a continuous function and assume that    $$ \int_{0}^{1} g(x) \phi'(x) dx = 0 $$   for all continuously differentiable functions $\phi: [0,1] \rightarrow \mathbb R$, where $\phi (0) = \phi(1) = 0$. Show that $g(x) = c$ for all $x \in [0,1]$ for some constant $c \in \mathbb R$.    My thoughts are applying integration by parts with $G(t) = \int_{0}^{t} g(x) dx $, since now we get  $$ 0 = \int_{0}^{1} G(t) \phi'(t) dt  + \int_{0}^{1} g(t) \phi (t) dt $$  which doesn't really go far. The second thought was applying MVT for definite integrals, which doesn't go far either as the conditions are hardly satisfied.   Any hints?


It's easy to prove  $\sum_{i=0}^n {{i}\choose{ k}} = {{n+1}\choose{ k+1}}$ by induction with ${{n}\choose{ k}} = {{n-1}\choose{ k-1}} + {{n}\choose{ k-1}}$, but what is its combinatorial proof?

After reading , the most popular answer use the identity $$\sum_{t=0}^n \binom{t}{k} = \binom{n+1}{k+1}.$$  What's the name of this identity? Is it the identity of the  modified.  How can we prove it? I tried by induction, but without success. Can we also prove it algebraically?  Thanks for your help.    EDIT 01 : This identity is known as the  because, on Pascal's triangle, when the addends represented in the summation and the sum itself are highlighted, a hockey-stick shape is revealed.


My goal is: run some native Windows 10 apps at startup time  The way I would do it with an installable app is right click on the app from then start menu, go to containing folder and then make a shortcut to the executable file   in shell:startup but there is no such an option to go to containing folder for apps installed from Microsoft store

I want to know where the Metro applications (Mail, People, Messages, ...) executable file path is.  Also, how can I run Mail application when my PC starts?


I don't mean "why is it 1, not 0" as in  which was closed as a dupe of . I mean why is it changed at all?  I understand that lowering the rep is an easy way to prevent certain actions - commenting, voting, chatting, flagging and presumably many more - but it doesn't prevent all of them. You don't need any rep to ask, to answer, to comment on your own question, or to comment on answers to your own question. Presumably code is in place to check whether users are suspended and keep them from doing these things. So why does the rep go to 1?  A side effect is that it screams "this user is suspended" to people who would otherwise not have noticed. I got some rep on an ancient answer today, +30 in all, and noticed on my second visit to the question (trying to figure out what was causing the interest in it) that the person with the other answer on the question had a rep of 1 even though the score of the answer was higher than it had been on my earlier visit.  I clicked through to the profile, and sure enough the user is suspended to cool down. I have no idea why and what for, because I haven't seen any other activity from that user. In such a circumstance, it feels odd for me to even become aware of the suspension. I'm not saying remove that information from the profile, I understand why it is there, but I am curious about the big waving LOOK AT ME flag that a reputation of 1 represents.   Is there a technical reason for it? Did it make coding some of the suspension stuff easier? Or is it in fact supposed to be a nudge-wink to others who happen to read the user's questions or answers? Is it supposed to sting a little, like a scarlet letter of some kind? I am genuinely asking why it is done, not saying that it shouldn't be or quibbling about 1 vs some other number.

I have some questions regarding suspended users:   Why do suspended users have a reputation of one? According to the default reputation of a new user, he/she will have reputation of one and he/she has the privilege of posting questions. When comparing this, this is getting violated when compared to suspended users' reputation. Even though they have one reputation point, they cannot post questions. As suspended users do not have privilege of posting questions, there is no use of making "Ask Question" visible. This is an unnecessary server hit. Am I right? As suspended users do not have the privilege of answering questions, there is no use of making "Answer Question" visible.


What's the correct way to pronounce 'dogged' ("He was dogged"/"dogged pursuit")? Is the 'e' silent or a schwa? Is it the same for the past of 'to dog' and for the adjective? (What I tried so far: I asked Google translate to pronoune "He was dogged" and the e was silent; I looked it up in Merriam Webster's and it says the e is a schwa, but only for the adjective... I trust Merriam Webster's more than Google, but I still can't rule out that maybe the adjective is different than the past tense of the verb...)

When I first read Romeo and Juliet in high school, I remember being intrigued by pairs of words such as,     beloved/belovèd    and      learned/learnèd   where there's an accent grave on the 'e' of the last syllable of one of each pair of word.  One thing I've always thought is that, strictly interpreted, beloved can really only be used as an adjective; if one wants to refer to the noun, as in my beloved, it should properly spelt as belovèd.  Similarly, I've always thought that learned is, strictly speaking, only acceptable as the past tense of the verb to learn, and that if one wanted to refer to the adjective form meaning "educated", as in learned scholar,  it would properly be spelt as learnèd.  I don't remember where exactly I got these impressions from, and I don't know if they are correct.  So my question is: Were there or is there any semantic difference between such pairs of words, or is it just a spelling idiosyncrasy? If there were such differences, do any persist to the present day?  Addendum: These aren't the only such pairs; there are others, I distinctly remember seeing many in lots of Shakespeare's plays...


SQL-noobie here that wants to modify the following stored procedure into one that selects a specified amount of rows starting from the specified row. For example I want to select 5 rows starting from the 10th row, ie 10, 11, 12, 13, 14, 15.  Here is what my SP looks like atm:  SELECT Posts.Slug, Comments.commentId, Comments.[date], Comments.name, Comments.[text] FROM Comments  INNER JOIN Posts ON Comments.postId = Posts.Id WHERE Comments.approved = 0   I don't need to order the results as I want to read sequentially, in-case that matters.  Thanks!

What is the best way (performance wise) to paginate results in SQL Server 2000, 2005, 2008, 2012 if you also want to get the total number of results (before paginating)?


Is it possibole to make on the desktop shortcuts to some websites. Using Google Chrome.  The websites where I want to link are: Facebook, my webmail and some others.

I want to create an internet shortcut within a specified folder in Ubuntu 12.04. How do I do this?


I am trying to create a beginner level program to better understand programming in python. A simple while true loop that adds a value of 1 to X and prints "help" or "doing something" depending on if x is less than or greater than 10; and then breaks when x is greater than 20. Im also attempting to add in a keyboard interrupt as well to break the loop if its not too complicated.. Any tips help, I get an error   Traceback (most recent call last):   File "so.py", line 23, in <module>     help()   File "so.py", line 11, in help     x += 1 UnboundLocalError: local variable 'x' referenced before assignment   Code:  import time  x = 1  try:      def help():          print("Help.")         time.sleep(2)         x += 1       def doStuff():          print("Doing Stuff")         time.sleep(2)         x += 1      while True:          if x < 10:             help()         elif x < 20 and x > 10:             doStuff()         else:             break  except KeyboardInterrupt:     exit()

How can I create or use a global variable in a function?  If I create a global variable in one function, how can I use that global variable in another function? Do I need to store the global variable in a local variable of the function which needs its access?


I have the following chart yet the blue bar doesn't display correct:   \begin{tikzpicture}   \begin{semilogyaxis}[ybar,   xticklabels={{2}, {10}, {28}, {112}, {224}, {392}}, xtick = {2, 4, 6, 8, 10, 12},          width = 0.45*\textwidth,          xtick style={draw=none},          ymajorgrids=true,          ylabel={Transmission Speed (kbps)},           xlabel={Message Size}, xticklabel style={rotate=90},] \addplot [draw=blue,pattern color = blue, pattern = north west lines]                 coordinates {(2, 473000)}; \addplot [draw=red,pattern color = red, pattern = north west lines]                 coordinates {(4, 88500)}; \addplot [draw=green,pattern color = green, pattern = north west lines]                 coordinates {(6, 2320)}; \addplot [draw=yellow,pattern color = yellow, pattern = north west lines]                 coordinates {(8, 1160)}; \addplot [draw=black,pattern color = black, pattern = north west lines]                 coordinates {(10, 251)}; \addplot [draw=black,pattern color = black, pattern = north east lines]                 coordinates {(12, 164)};    \end{semilogyaxis} \end{tikzpicture}   I can't see why the 2, 473000 coordinates are missing.

I have a xbar chart in pgfolots. I want to have multiple addplot commands. I use symbolic y coords and ytick = data. Problem 1 is that I want all bars centered in respect to the ytick. Problem 2 is that the labels of the second addplot are missing. Background: I want this special layout because I want to have nodes near coords later in the addplot command (only for specific bars).     \documentclass[border=5mm,tikz]{standalone}  \usepackage{tikz} \usepackage{pgfplots}  \begin{document}  \begin{tikzpicture} \begin{axis}[     xbar,     symbolic y coords = {A,B,C,D,E},     enlarge y limits = 0.15,     ytick = data,     width = 160mm,     height = 90mm,     xmin = 0,     xmax = 10,     title = {One \texttt{\textbackslash addplot}},     ] \addplot[fill=green] coordinates {(1,A) (2,B) (3,C) (4,D) (9,E)}; \end{axis} \end{tikzpicture}  \begin{tikzpicture} \begin{axis}[     xbar,     symbolic y coords = {A,B,C,D,E},     enlarge y limits = 0.15,     ytick = data,     width = 160mm,     height = 90mm,     xmin = 0,     xmax = 10,     title = {Two \texttt{\textbackslash addplot}},     ] \addplot[fill=green] coordinates {(1,A) (2,B)}; % A-B \addplot[fill=green] coordinates {(3,C) (4,D) (9,E)}; % C-E \end{axis} \end{tikzpicture}  \end{document}


I had comments deleted on a question, losing some interesting information, which prompted me to raise  about how to see comments.   shows that there is indeed no current way of viewing deleted chatty comments.  I understand that some comments containing sensitive information shouldn't be shown after they are deleted by a moderator, but in the majority of cases, it would be show how the question and answers developed if the comment history were viewable.  So I propose:  To implement a way of allowing users to see the history of deleted comments, and for those with delete comment privileges to be able to opt-in to hide the deletion from this history.    Also note that  is about users seeing deleted comments on their own posts, and doesn't mention sensitive information. This is about users being able to view all comment history except comments marked as sensitive upon deletion.

I know that moderator access tool (10k) is required in order to view deleted posts. I am talking about showing deleted comments on users' own posts.   For example,   has  comment which seems for another user (not for me) but I think there should be some comment by another user (which is deleted) and this is the comment for that as a reply. (This is only my guess, there may be no deleted comments as I can't judge).   So, how about letting me see the deleted comments on my own posts?  Hence I am requesting to allow users to show deleted comments on their own post. (Or introduce a new privileges near about 3k etc for being able to see deleted comments on own posts)


Just downloaded the latest version of Ubuntu, What do I do now?  I see where it is downloaded in my downloaded folder, but how do I run this operating system?

I would like to see a full how-to guide on how to install Ubuntu.


I am looking for a list of "Conditions of applicability of linear regression" to finish a work, but I cannot find any reference of this in any book.  I founded something in several links, but in one of this the conditions are 5, in another 4, in another 10, so I am not sure what are the correct list of "Conditions of applicability of linear regression"  Thanks.

What are the usual assumptions for linear regression?   Do they include:   a linear relationship between the independent and dependent variable independent errors normal distribution of errors homoscedasticity   Are there any others?


I am trying to perform automated calculations with latex using lualatex. I need to be able to printout calculations like "M = a+b" while maintaining all functionalities and options wihtin the math environment. However, along multiple parts of the document, I need o:  Declare "a=5" (a = \SI{5}{kilo\newton\metre}) Declare "b=6" (b = \SI{6}{kilo\newton\metre}) type "M = a+b" Get the automated output M = 5+6 = 11 Set the unit assigned to the output of the equation ( for example 11 KN . m)  In addition I need to be able to:  Decide whether a and b are substituted within the equation along with their units or not (for example M = 5 kN . m + 6 kN . m = ...) or just (M = 5 + 6) Decide whether the output of the equation is assigned a unit or not Set the multiplication symbol to (Asterisk: \ast) or (x: \times) since it is more appropriate to use (Asterisk:\ast) as a symbol for multiplication. Maintain the same syntax rules used in the "Math" environment ($......$) when displaying the substituted equation I am using siunitx package, need the units to follow its settings. Need to be able to set how numbers are displayed using the \num command or math environment commands (\frac{}{}...) Using brackets, braces .... and so forth setting the variables so that they can be redeined later in the following parts in case the same equation is used multiple times   \documentclass{article} \usepackage{amsmath}  \usepackage[per-mode=symbol,inter-unit-product = \cdot, exponent-product = \ast, output-product = \ast, group-separator = \text{~}, group-minimum-digits={3}]{ }  \usepackage{luatexbase} \usepackage{luacode} \usepackage{lualatex-math} \usepackage[bidi=basic,layout=lists.tabular]{babel} \babelprovide[import=en,maparabic,main]{english} \babelfont[english]{rm}{Times New Roman} \usepackage{nomencl} \makenomenclature   \begin{document}  \nomenclature{$a$}{.....} \nomenclature{$b$}{.....}  \printnomenclature   \begin{gather} M=a+b \begin{aligned} a &=definition + units.... \end{aligned} \end{gather}  \end{document}   Upon seeing the post  I have noticed that it handles solving mathematical equations, however the process of variable declaration is not handled. In addition to Embedding units in the output as well as in the numbers within the equation itself. I am not familiar with lua, so I do not know if there is an easier manner through which equations can be evaluated since I have noticed that too much coding is required for evaluating simple expressions.

Here is the code.  \documentclass{article} \begin{document} \directlua{tex.sprint(tostring(math.sin(math.pi)))} \\ \directlua{tex.sprint(tostring(math.tan(math.pi/2)))} \end{document}   I am expecting the answers as 0 and error . The code above gives some very small and big number. Can I get the expected answers by some modifications in code?


As a lowly physics undergrad who has been chewing on this 2nd postulate of special relativity for a year or more, I simply can't wrap my head around reasons why it is true or how Einstein might have been convinced enough to propose this postulate.  Consider Alfred who is riding in a car travelling at 88 m/s with his headlights on and Bernard who is on the side of the road hitch hiking. Why does the light propagating from Alfred's car move at $c$ relative to both Alfred and Bernard, and not at $c$ + 88 m/s relative to Bernard?   The nifty results of special relativity all kind of hinge on this idea, and asking my professors in class hasnt really yielded an answer much more than "because we have never observed a case otherwise".

That the speed of light is constant for all inertial frames is the second postulate of special relativity but this does not means that nothing can travel faster than light.   so is it possible the point that nothing can travel faster than light was wrong?


I am stuck in my research with the following problem which occurs when proving a theorem.          If $x,y\in \mathbb{R}^+$ and $x>y$, is it true that     $(x-y)^{((x-y)/(2x-y))}\times (x+y)^{(x/(2x-y))}>x$?      I plugged in a range of values for $x$ and $y$ and always found this holds. However I am not sure how one can prove a statement of this nature? Can someone help me with this?

If $x,y\in \mathbb{R}$, and $x>y$, how to show $(x-y)^{((x-y)/(2x-y))}\times (x+y)^{((x)/(2x-y))}>x$?  I know I have to use AM-GM inequality, but it is not clear how.


How can I make a little wider bar ?! Is that possible without defining any new commands ?  Here is a screenshot of the entry on which I want to typeset a wider bar.

Following the question "" which is simply about the lengths of both, I'd like to know when to use \bar and when to use \overline from a semantically viewpoint.  I always used \bar, because up until now I only had single letter mean values to type. But now I came to a problem where I needed a wider "bar".  Then I just tried  \documentclass{article}  \begin{document}   \[ \bar{a} \overline{a} \]   \[ \bar{abc} \overline{abc} \] \end{document}   where one can see that they also differ in position (\overline is lower), and also in thickness (\overline is thicker).  So, the question here is:  What does \bar represent semantically? And when to choose it over \overline and vice versa?


The label on the favorite star is invalid if the question is not marked as favorite.

When viewing a question, when I hover over the star icon (under the voting module) the tooltip says I've made it a favorite when I haven't yet.


How can I test if $\sum_{n=1}^\infty\frac{\cos(n) + i*\sin(n)}{n}$   ($i^2 := -1$)  is (absolute) convergent? I have tried to use the ratio test and the root test but I didn't succeed. Help appreciated!

I think that the series $$\sum_{n=1}^{\infty} \dfrac{\sin(n)}{n}$$ converges conditionally, but I´m not able to prove it. Any suggestions ?


I want to write a fmod() function double fmod(double x, double y) {     double mod = x;      while(mod >= y)     {         mod -= y;     }          return mod; }   But fmod(1.2, 0.05) returns 0.05

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


I am developing an application must intercept a process and prevent it from executing fully until a users credentials are verified. I have no idea where to go or to begin researching.  I know it is possible as Kaspersky AntiVirus has something similar - when you launch application A, it checks its white list for application A and if it is not found, it halts execution and prompts the user with a question - only when the user clicks Allow, execution resumes.

Is there a way to monitor processes starting in the system before they start?  Example: On programs like ZoneAlarm or Antivirus programs, when you run a program it asks you if you allow running this program or not before it runs...


I have the following test to parse via regex  {id=ID, catalogId=A2A01, marketingCode=CODE, productId=PRODUCT_ID, sku=SKUINFO}   I am using the following Regex pattern  (?<=marketingCode=)(.*)(?=, )   However is matching   CODE, productId=PRODUCT_ID   How do I make it just match   CODE

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


I am searching a way to catch an NullPointerException in a Runnable class. I have this method called by run :  private void cooccurrence(int contextIndex, int targetIndex) {         try {             Double old_value = X.get(contextIndex, targetIndex);             X.set(contextIndex, targetIndex, old_value + 1);         }catch (NullPointerException e) {             X.growData(X.nz_length + 1);             X.addItem(contextIndex, targetIndex,  1);         } }   and I have this code in another class which call a class ThreadForX implements Runnable :  final BlockingQueue<JSONObject> queue = new ArrayBlockingQueue<>(5000000); int json_object_in_queue = 0;  ExecutorService pool = Executors.newFixedThreadPool(2);  DMatrixSparseTriplet X = new DMatrixSparseTriplet(200000,200000,0);  JSONObject inQueue_jsonObject; while ((inQueue_jsonObject = queue.poll()) != null) {         Runnable readTweet = new ThreadForX(contextLenght, inQueue_jsonObject, X, final_vocabulary);         pool.execute(readTweet); } pool.shutdown(); while (!pool.isTerminated()) { }   As you can see, the NullPointerException is really important to add an item so I need the values of contextIndex and targetIndex

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


I have a created a webform in drupal, now i want to create webform.tpl.php for this webform. How to do this? Any suggestion

I am in need to theme webform in D7.  How can I do that ?  In the search I've come to know that by using web-form-nid.tpl.php we are able to theme a drupal individual form.  Could any one guide me in this case to theme a webform.


I've seen some code samples and tutorials that use  def main():     # my code here  if __name__ == "__main__":     main()   But why? Is there any reason not do define your functions at the top of the file, then just write code under it? ie  def my_function()     # my code here  def my_function_two()     # my code here  # some code # call function # print(something)   I just wonder if there is any rhyme to the main?

Given the following code, what does the if __name__ == "__main__": do?  # Threading example import time, thread  def myfunction(string, sleeptime, lock, *args):     while True:         lock.acquire()         time.sleep(sleeptime)         lock.release()         time.sleep(sleeptime)  if __name__ == "__main__":     lock = thread.allocate_lock()     thread.start_new_thread(myfunction, ("Thread #: 1", 2, lock))     thread.start_new_thread(myfunction, ("Thread #: 2", 2, lock))


I have taken it on myself to reproduce some of my university's PPT templates (not that I necessarily love the design, but I have some good reasons for undertaking this venture) using Beamer. I have taken the below image of one of the templates and, using bezier curves, converted it into Tikz code.   The result looks pretty good to me, the only problem is, when defining the control points which describe the curves in the picture, some of the point lay off of the screen (i.e. they are negative values), which lowers the bottom edge of the bounding box of the Tikz image, and has the effect of "shifting up" the whole image (the largest negative value lay at the bottom edge of the page, shifting 'y=0' up by some amount). Essentially, the thing that solved  problem is what is causing mine.  Is there any way to allow either the control points to exist outside of the bounding box or let the edge of the box "slide" off the page? Or maybe some other solution that I'm not thinking of? I am fairly practiced with LaTeX in general, but not so much with Tikz or Beamer specifically. I'm not sure if the solution will be Beamer- or Tikz-specific, but this seems very much like a Tikz thing to me. If there is another way to define the curves, I would be open to learning new things, but drawing beziers with control points is so dead-simple that I would hate to leave this method.  MWE:  beamerthemeMWE.sty:  \RequirePackage{tikz} \RequirePackage{mwe}  \definecolor{CincinnatiRed}{RGB}{224,1,34}  \newcommand{\footerheight}{2}  \setbeamertemplate{navigation symbols}{}  \setbeamertemplate{footline}{   \leavevmode\hbox{%     \begin{tikzpicture}         %red swoopy bit         \path[fill=CincinnatiRed] (\paperwidth,\footerheight) .. controls %         (0.898*\paperwidth,0.752*\footerheight) and (0.557*\paperwidth,-0.381*\footerheight) .. %         (0,0.548*\footerheight) -- (0,0.957*\footerheight) .. controls %         (0.529*\paperwidth,-0.169*\footerheight) and (0.882*\paperwidth,0.723*\footerheight) .. (\paperwidth,\footerheight); %         %black swoopy bit         \path[fill=black] (0,0) -- (\paperwidth,0) -- (\paperwidth,\footerheight) .. controls %         (0.898*\paperwidth,0.752*\footerheight) and (0.557*\paperwidth,-0.381*\footerheight) .. %         (0,0.548*\footerheight) -- cycle; %         %white line         \draw[white] (\paperwidth,\footerheight) .. controls (0.872*\paperwidth,0.647*\footerheight) and %         (0.555*\paperwidth,-0.228*\footerheight) .. (0,0.148*\footerheight); %         %university logo         \node[anchor=south east,inner sep=0pt](UC_logo) at %         (0.966*\paperwidth,0.129*\footerheight){\includegraphics[scale=0.09] %         {example-image-a}};     \end{tikzpicture} }}   mwe.tex:  \documentclass[aspectratio=169]{beamer} \usetheme[]{MWE}  \begin{document} \begin{frame} \end{frame} \end{document}

I have a problem with TikZ's auto-cropping/auto-calculating the bounding box for a tikzpicture.  Look at the following example:  \documentclass{article} \usepackage{tikz} \begin{document} Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam scelerisque massa quis nibh egestas, sed aliquam justo gravida. Integer eget felis vel erat auctor sagittis. In eget ligula eu velit rutrum sodales sed at velit. Proin id blandit ante, tristique bibendum magna.  \begin{center} \begin{tikzpicture} \node[draw,circle] (A) at (0,0){A}; \node[draw,circle] (B) at (3,3){B}; \draw (A) to (B); \end{tikzpicture} \end{center}  Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam scelerisque massa quis nibh egestas, sed aliquam justo gravida. Integer eget felis vel erat auctor sagittis. In eget ligula eu velit rutrum sodales sed at velit. Proin id blandit ante, tristique bibendum magna.  \begin{center} \begin{tikzpicture} \node[draw,circle] (A) at (0,0){A}; \node[draw,circle] (B) at (3,3){B}; \draw[bend left=90,looseness=2] (A) to (B); \draw[bend right=90,looseness=2] (A) to (B); \end{tikzpicture} \end{center}  Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam scelerisque massa quis nibh egestas, sed aliquam justo gravida. Integer eget felis vel erat auctor sagittis. In eget ligula eu velit rutrum sodales sed at velit. Proin id blandit ante, tristique bibendum magna. \end{document}   This produces the following output:   As you can see the cropping of the picture with the straight lines is perfectly fine. However, for the curved lines there is too much (unnecessary) white-space before and after the picture.  I know I can manually fix this by changing the boundingbox or simply using \vspace, but is there an automatic way to get accurate bounding boxes?  (Note: This is very similar to , but the answers there do not seem to help with the automatic calculation, mostly checking first what the bounding box is and then applying some sort of clipping.)


I know that the dot product and cross products of two vectors represent their components acting in each other's direction but it always puzzles me to think why and how, particularly what bangs my head the most is the intuition for cross product. Please answer in an intuitive manner for both along with a few examples of real life situations. Any answer will be of great help. If someone refers to the images given on Wikipedia articles for the products, what I want is an intuitive explanation of geometric references.

I get the physical significance of vector addition & subtraction. But I don't understand what do dot & cross products mean?   More specifically,    Why is it that dot product of vectors $\vec{A}$ and $\vec{B}$ is defined as $AB\cos\theta$? Why is it that cross product of vectors $\vec{A}$ and $\vec{B}$ is defined as $AB\sin\theta$, times a unit vector determined from the right-hand rule?   To me, both these formulae seem to be arbitrarily defined (although, I know that it definitely wouldn't be the case).   If the cross product could be defined arbitrarily, why can't we define division of vectors? What's wrong with that? Why can't vectors be divided?


I have integer variable a and another integer variable p. p is position. I want to flip the integer bite at position p. If the bit which is at position pof the variable a is 0 I want to change it to 1 and if the bit which is at position pof the variable a is 1 I want to change it to 0. How can I do it? I am writing it in Java but explanation in any language is fine.

How do you set, clear, and toggle a bit?


I’m starting a campaign with some friends with me as the DM even though I’d rather be a player, I am the only person in my group who has had experience being a DM. I asked my friends if a DM is allowed to have a PC and not an NPC but they did not know either. Can I have a PC?

I'm forming a group of new players along with myself to play D&D 5e together. The DMing will probably fall to me, and maybe another friend. However, I'd also like to sometimes have my own character and play as that character.  What are my options for my character to still level up and influence the story, if I DM and play?  If we rotate, does my character just go on vacation whilst I'm DMing and level up accordingly? Or do I do the quests, playing my own PC along with the group whilst I DM? (Will that spoil the fun?) Do I join in as a player in the next episode, and receive double XP to compensate for the sessions my character missed out on?


This is not a duplicate of , because the linked question asks about the existence of a something larger than class. My question is about a construction of an infinite series of $\mathrm{Class}_1, \mathrm{Class}_2, \mathrm{Class}_3, \dots$ by a specific repeatable method using types.    The collection of all sets is a class. I think we can collect classes and continue this process as follows:   The collection of all sets is $\mathrm{Class}_1$. The collection of all $\mathrm{Class}_1$ is $\mathrm{Class}_2$. The collection of all $\mathrm{Class}_2$ is $\mathrm{Class}_3$.   ...    First, let's look at how to construct natural numbers.   Let $\mathrm{N}$ be the type of natural numbers. $1:\mathrm{N}$ . If $n:\mathrm{N}$, then $\mathrm{suc}(n):\mathrm{N}$ . All terms of $\mathrm{N}$ are constructed by repeating rules 2 and 3 finitely.   In addition to this, we need to define propositions and axioms of them:   $a:\mathrm{N}, b:\mathrm{N}\vdash a=b:\mathrm{Prop}$ . $\forall n:\mathrm{N}. [\mathrm{suc}(n)\neq 1]$ is true. $\forall m:\mathrm{N}. \forall n:\mathrm{N}. [a\neq b\Rightarrow \mathrm{suc}(a)\neq \mathrm{suc}(b)]$ is true. If $\varphi(1)$ and $\varphi(n)\Rightarrow \varphi(n+1)$ are true, then $\forall n:\mathrm{N}. [\varphi(n)]$ is true.   In summary, the above process has 6 parts:   Define a type $T$. Define initial terms of $T$. Define construction rules of $T$. The extension of type $T$ is the closure of 2 and 3. Define the propositions of $T$. Define the axioms of $T$.     Let's construct $\mathrm{Class}_1$.  The initial term of $\mathrm{Class}_1$ is $\emptyset$.  The construction rules are    $A:\mathrm{Class}_1\vdash \mathcal{P}(A):\mathrm{Class}_1$ $A:\mathrm{Class}_1, B:\mathrm{Class}_1\vdash A\cup B, A\cap B, A\times B, A\coprod B:\mathrm{Class}_1$ $A:\mathrm{Class}_1, (x:A(\varphi(x)):\mathrm{PropositionInContext}_1\vdash \{x\in A| \varphi(x)\}:\mathrm{Class}_1$   etc.  The axioms are something like this:   $A:\mathrm{Class}_1, B:\mathrm{Class}_1\vdash \forall x: \mathrm{Class}_1 (x\in A\cap B\Leftrightarrow x\in A \wedge x\in B)$ $A:\mathrm{Class}_1, B:\mathrm{Class}_1\vdash \forall x: \mathrm{Class}_1 (x\in A\cup B\Leftrightarrow x\in A \vee x\in B)$ $A:\mathrm{Class}_1, (x:A(\varphi(x)):\mathrm{PropositionInContext}_1\vdash \forall x:\mathrm{Class}_1(x\in \{x\in A| \varphi(x)\}\Leftrightarrow x\in  A \wedge\varphi(x))$   etc.  The extension of $\mathrm{Class}_1$ is the closure of above rules. Let $\mathrm{Ext}(\mathrm{Class}_1)$ be this set. $\mathrm{Class}_2$ is constructed similarly but its initial term is $\mathrm{Ext}(\mathrm{Class}_1)$. Generally, the initial term of $\mathrm{Class}_{n+1}$ is $\mathrm{Ext}(\mathrm{Class}_n)$.    Is it possible to construct an infinite series of classes this way?

Classes can be considerd as "larger" than sets in the sense that any set is a class.  Is there mathematical object which is "larger" than classes ?


import java.io.IOException; import java.util.ArrayList;  public class CheckClass {     static ArrayList<String> curr2=new ArrayList<>();     public static void main(String[] args) throws IOException     {     ArrayList<String> curr=new ArrayList<>();     System.out.println(curr);     CheckArr(curr);     System.out.println(curr);     }     private static void CheckArr(ArrayList<String> curr) {         curr2.add("hi");         curr=curr2;         System.out.println(curr);     } }  Its output is : [] [hi] []  Can anyone explain how i can change the reference of curr to curr2. I just switched from C++ to java. I think it has something to do with internal pointer mechanism of java, can you explain this concept.

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?


Can Ubuntu have any disk-defragment tools, like Microsoft Windows.   Or any other tools equivalent for it?  I read:

Why is defragmenting unnecessary in Ubuntu?


According to the tab on the right I can ask question.   But we would never say that. I can ask a question. However, question is neither an an abstract nor uncountable noun.   I also noticed the same rule in an online system I use - I can add order.   Are these phrases incorrect or is it a rule that justifies omitting the articles?

Recently, in many new online software I often see that developers omit articles in short sentences, especially on action buttons or tooltips.     For instance: "Add new task" (not "Add a new task"), "Create project" (not "Create a project"), but often in the same software I can see "Make a copy". What are situations it can be justified?


I want to use ext4 on my external HDD, but it must be cross-platform. (At least Linux, Win7 & WinXP).  Unfortunately, I haven't found any proper driver allowing Windows to WRITE to ext4. I've found , but it only reads ext4.     9. ext4 extent read-only, no  size truncating and expanding support   More:     Supported Ext3/4 features:         flexible inode size: > 128 bytes, up to block size   dir_index:    htree directory index   filetype:     extra file mode in dentry   large_file:   > 4G files supported   sparse_super: super block backup in group descriptor   uninit_bg:    fast fsck and group checksum   extent:       reading, writing with no extending.   journal:      only support replay for internal journal         Unsupported Ext3/4 features:         journal: log-based operations, external journal   extent: size truncating & expanding, file deletion   flex_bg: first metadata group   EA (extended attributes), ACL support      Also, I have found a patch for Ext4Fsd v0.50 ():     New: Matt Wu has made a new release 0.50 at   ext2fsd.com.  Support for ext4 extents and fix   for BSOD on Windows 7.   I don't think it will be safe. Also I've read some words about writing ext4 in Windows could cause data loss on the disk...  What is the External HDD used for? - First, it will store backups, then family movies, pictures. Some music, and etc. It will be connected to a Raspberry Pi, if I finally receive it. It won't really move, just when it is used to migrate computer's data to a new one. The largest files it will store are Clonezilla disk images (I don't know, if they will be large files or not).  Can someone provide a solution for this problem? Or is there NO important enough difference between ext4 and ext3, and I should use ext3? - (If yes, then can I use Ext2Fsd for that ext3 mount?)  Thank you!

Is there a way to read ext4 partitions from Windows? If so, what can I do?


I am currently surrounded by a long list of WiFi connections and every time I boot up my MacBook Pro, it switches away from what should be the default for the public WiFi connection.    How can I force my Mac OSX to recognize the domestic connection it should be using?  Is there also any way to block the listing of other WiFi connections, especially because there are so many?  I have tried going through the Network listings to delete the surrounding superfluous signals and have not been able to.  Is there something I'm missing?  Do they specifically have to be connections I've joined?  Is it not possible to block out the other domestic signals around me?

I have multiple network access in the same area.  How can I reorder the priority to which the connections are made ?


Let $f:X\rightarrow Y$ be any map. The graph of f is the set $\Gamma_f=\{(x,f(x))|  x\in X\}\subset X \times Y$.  Assume that Y is compact. Prove that if $\Gamma_f \subset X \times Y$ is closed then $f$ is continous.   I was able to prove the converse (where it was also given that Y is Hausdorff), but I'm having trouble proving this direction.

The graph of $f$ is $G(f) = \{(x,f(x)) : x\in X\} \subseteq X\times Y$  $X$ and $Y$ are metric spaces.  a) Suppose $f$ is continuous and prove that $G(f)$ is a closed set.  b) Suppose that $G(f)$ is compact and prove that $f$ is continous  For a), the definition of a closed set that comes to my mind is a set that contains all its limit points (or was it accumulation points?), is there another equivalent definition that may b more helpful to prove a)? Is it possible to prove this directly? Because at first glance the only way I could imagine to prove this is by contradiction or contrapositive.   I imagine that the proof of b) will be immediately derived from a).


I don't see a case where template template parameters would ever be useful, when they could be simply replaced with one template parameter that would work just as well. Referring to my example:  template<template<typename, typename...> typename Cont, typename T, typename... Args> void Foo(Cont<T, Args...> container) {   for (auto i : container)     std::cout << i << " ";   std::cout << std::endl; }  template<typename T> void Bar(T container) {   for (auto i : container)     std::cout << i << " ";   std::cout << std::endl; }   These will function identically, and Bar will work on any container defining an iterator (allocator not needed). Foo however, does the same thing, but is a lot more confusing to write (and more confusing to understand). I don't know if I missed the point on template template parameters, but they really seem useless to me as a single template parameter will deduce the type too, albeit without the other parameters.  Also - should I be using typename or class for the template template parameter?   template<typename> class T   or   template<typename> typename T

I've seen some examples of C++ using template template parameters (that is templates which take templates as parameters) to do policy-based class design. What other uses does this technique have?


Obviously, it depends on the question/answer you're posting. But on average, is there some magic number of characters that will get you the best reputation bump?  My original hypothesis was that we'd get a unimodal shaped graph, increasing towards some optimal value as more information was added to posts, and then decreasing as the posts became overly verbose. Of course, I wasn't expecting an exact integer number that was the magic length e.g. 1047. Rather, I would have expected a sort of window in which the posts performed best.  I set out to investigate this, just for our biggest site, , and composed a query that gives us a map from post length to average score:    The results: there seems to be some truth to my original hypothesis, but much noise. I ran the above query and then ran it again three more times, each time restricting the post score by some upper limit to try to remove outliers. Below are the results. Can someone with a statistical background improve on these results and provide a solid interpretation of them?  In the following graphs we have number of characters on the x axis and average score on the y axis. I should really have labelled the graphs (will do next time).   No Limit on Score  It seems to be an ever so gentle slope upwards and then downwards, but it's fairly flat for the most part, other than the outliers.    Score <= 100  Again, there are what look like outliers. But there's a pretty smooth looking shape up to around 16K and then outliers start to dominate. The sweet spot seems to be between 16K and 30K.    Score <= 20  It seems to be a sweet spot between around 24K and 33K, roughly.    Smoothing  Perhaps what's needed to make these results more sensible is some sort of sliding-window smoothing. For the <= 20 case, we see the graph jump between positive and negative values. This demonstrates that we probably don't have enough data to plot the "true" relationship between exact number of characters and average score, i.e. the relationship that would emerge as we approached an infinite number of posts.  A commenter below points out that binning is probably what we want here.   Update  All of the above graphs were quickly mocked up in Excel; an astute commenter points out that this is probably the reason for the rounding to integer values causing the very weird choppy looking final graph. The related question gives more statistically sound results, and should be consulted instead of this one. Also, the related question talks exclusively about question length rather than merely post length. From a data analysis point of view this probably makes more sense. Questions and answers are different things so mixing up their analysis as above probably doesn't make sense.   Another problem with the above is that we are missing the sample size per data point. Sample size is crucial when attempting to draw any statistical conclusions from data.

This is just an idea I've been toying with , really. I'm curious about the correlation  between  question length and question quality. "Quality" here would be translated into "likelihood of not being closed."  Because when you go through Stack Overflow, most of the very short questions end up having issues of some kind.   But is there a way for us to measure whether there's a lower threshold whereby we are very certain that the question is problematic? For example, I doubt anyone would argue that you can make a great question with just 15 or so words.  For example, here's a demo I just ran & subsequently deleted:        But surely you'd rather see an example from the real jungle, here's a recent one:        My question is - why were the body-size limits determined to be  30 characters (though I believe there's a typo there, as it's not simply 30 char's)?


I have a material in Unity that contains a normal map, height map, emmission, occlussion, and detail mask but when translating it over into blender it seems to use a completely different system. Would anyone know how to get it to work? Thanks so much!

I created some texture maps in MindTex to use in Blender, but I can't figure out how to properly hook them up. The maps I have:  - Diffuse  - Normal  - Height   - Specular   - Gloss   - Self Illumination  - Reflection  - Ambient Occlusion   MindTex (left) vs. Blender (right)  As you can clearly see it's a pretty big difference.  is my material node setup in Blender. In the examples I don't actually use self illumination or reflection images, but including this in the answer would be helpful.


$a_n = \frac{1}{n}+ \frac{1}{n+1} +\dots + \frac{1}{2n}$ converges to a number between $\frac{1}{2}$ and $1$. I know that it converges to Ln(2) but we still haven't learned about integrals in my class,  so calculating its limits kills the purpose of the exercise.  I've been trying for a while, I tried with this theorem that states that if $a_n \leq b_n$ for all n greater or equal to some N, then $\lim_{n\to\infty} a_n \leq \lim_{n\to\infty} b_n$  So my aproach was to find two sequences such that their limits are $\frac{1}{2}$ and $1$, I used these $\frac{n}{2n+1}$ and  $\frac{n}{n+1}$, the limit of the first one is $\frac{1}{2}$ and the limit of the second one  is $1$, and we have that  $$\frac{n}{2n+1} \leq \frac{1}{n}+ \frac{1}{n+1} +\dots + \frac{1}{2n} \leq \frac{n}{n+1}$$ for all $n \geq 6$, I've been trying to prove that with induction but I have been unable to do it. Is there any other way to prove that the limit is between $\frac{1}{2}$ and $1$?, or if someone could give me a hint with the induction proof, I would be very grateful.

How do I prove that the limit of the sequence exists: $$a_n = \frac1n +\frac 1{n+1} + \frac1{n+2} + \dots + \frac1{2n}$$  I can find the limit as n goes to infinity, $\frac1{2n}$ goes to $0$, so the limit is $0$ right? But how do I prove that the limit exists? Do I have to use the $\varepsilon$ $\delta$ definition of a limit?    For part b) I have to show that the limit is less then $1$ but not less then $\frac12$, I thought the limit was $0$?


Driving a tow work in Louisiana and need to pick up a car in Mississippi, and bring back to Louisiana, do I need to stop at the weight station?

On US interstates, there are weigh stations for trucks.  Are they for trucks only? What are the exact categories of vehicles that must/may enter?   If I rented a UHaul or Penske truck, would I be required to enter into an open weigh station? I know that, when a speed limit sign says 70 Trucks 60, UHaul, Penske or large motorhomes are limited to 60 mph. Does that mean that they also need to submit to weigh stations? If I drove a 30 - 50 ft motor-home, would I need to go through the weigh station?   What dimensions or attributes of a vehicle would require it to submit to weigh stations?


I want to detect whether a process with a certain name and also specific command line arguments is already running. I use Process.GetProcessesByName to get the list of processes and tried to check the argument field of each processes StartInfo property - it's always empty. Why?  I tried starting with administrative rights. I worked around the issue by using a WMI query eventually, but am not satisfied ...

How can I obtain the command line arguments of another process?   Using static functions of the System.Diagnostics.Process class I can obtain a list of running processes, e.g. by name:  Process[] processList = Process.GetProcessesByName(processName);   However, there is no way to access the command line used to start this process. How would one do that?


I'm creating a command to switch between cameras using the testfor command to identify which camera the player is holding. My "cameras" are items with custom names 1,2,3,4, etc.  This is the code i am using:  /execute if entity @a[team=camera,nbt={SelectedItem:{id:"minecraft:black_stained_glass_pane",tag:{display:{Name:"camera 1"}}}}]   The code does not detect the renamed item. It detects if I remove the name, but I require the custom name for my project.  I've also tried this thing as said in other people´s question.  {Name:\"camera 1\"}}   But it does not work - the code turns red. I'm not sure what is wrong or how to fix it. I'm running Minecraft 1.14.2 Java edition.

I am in 1.13 Pre-Release 7 trying to make a one command creation and I need an item with a specific name. The command I use is /give @p diamond_sword{display:{Name:"Sword of Power"}} and it gives my a diamond sword, but it doesn't have the name.   This is me running the command.   This is the command not working.