Typescript: Length of empty array not zero I have an array which has a single element which I delete with the following code:  delete array[0]   At this point the array is empty. I'm therefore confused why array.length has an output of 1.   When I use console.log it displays the following:    Am I doing something fundamentally wrong or how do I check that the array is empty? Maybe an explanation of typescript array memory management would be useful.
Deleting array elements in JavaScript - delete vs splice What is the difference between using  on the array element as opposed to using ?   For example:  myArray = ['a', 'b', 'c', 'd'];  delete myArray[1]; //  or myArray.splice (1, 1);   Why even have the splice method if I can delete array elements like I can with objects?
How should I phrase a question that must be answered with an ordinal number (e.g., the third prime)? I want to make a question having an answer as follows:     5 is the third prime number.   The bold part is the answer. How to phrase the question? I was working on a tower and painted my own texture for it. I saved halfway though and took a break. When I returned to my little project, I could paint on the image and it shows up in the material view but not the render. I did everything in my power but still couldn't understand why?  I have used:   Nodes, including mapping and insert UV coordinates. Unwrap UVs Used lights Deleted and replace nodes Deleted and replace Mat Removed image and replace it Reload image Painted on mesh   Even though use blender, I am not a programmer. So I find it really helpful if someone could give me an answer. enclosing a lstlisting environment inside my own environment using matlab-prettifier I've just started using matlab-prettifier.    Since the line \begin{lstlisting}[style=Matlab-editor] is a lot to type, I created my own environment:  \newenvironment{myMP}      {\begin{samepage}\begin{lstlisting}[style=Matlab-editor]}      {\end{lstlisting}\end{samepage}}   I've used this syntax many times before, but in this case it doesn't work.  Is there any reason why I can't enclose the lstlisting inside my own one?  Here's sample code, illustrating the problem.  \documentclass{minimal} \usepackage[framed]{matlab-prettifier}%For matlab code \newenvironment{myMP}      {\begin{samepage} \begin{lstlisting}[style=Matlab-editor]}      {\end{lstlisting} \end{samepage}} \begin{document} \begin{myMP} matlab word \end{myMP} \end{document}   When I run this with pdflatex it returns a *, indicating that the environment wasn't closed properly.  Thanks! Store pictures as files or in the database for a web app? My question is fairly generic and I know there might not be an 100% answer to it. I'm building an ASP .NET web solution that will include a lot of pictures and hopefully a fair amount of traffic. I do really want to achieve performance.  Should I save the pictures in the Database or on the File system? And regardless the answer I'm more interested in why choosing a specific way.  Many thanks, Stefan   DUPLICATE: , ,  and probably some others.    COMMENT: Thanks for many good answers. I will go for a file based solution even if I like the idea of having a 100% database driven solution. It seems that there are today good solutions to do what I want with databases etc but I have a few reasons for not doing it.   I will be on a hosted solution, I have huge amount of storage(10gb) but only 300mb for the database. It will cost a lot for extra storage in the DB. I'm not an DB expert and as well not in control of settings of the DB. A DB based solution might need custom configuration as it looks like.   If we will move to run the site on our own server I might consider a DB based solution. thanks, Stefan If a ring element is right-invertible, but not left-invertible, then it has infinitely many right-inverses. Taylor series $\frac{z^2+z}{(z-1)^2}$ at $z=-1$ Where are icons stored? I want to change an icon of a specific theme. Where do themes save their icons? I'm trying to install pandas. When I do, it's automatically installing to the python installation for v 2.7.   How do I force pandas to install to the python 3.5 installation? Having some trouble proving this:     If $f:\mathbb{R}\rightarrow \mathbb{R}$ is differentiable and $\lim_{x\to \infty } f^\prime(x)=0$ show: $\lim _{x\to \infty } (f(x+1)-f(x))=0$   Attempt: from $\int \lim _{x\rightarrow \infty } f^\prime(x) \mathrm{d}x=0$ we can say that $f^\prime(x)=const$ would we then have to show that  $\lim _{x\to \infty } (f(x+1))$ is also a constant? From there if we show that both are equal then the difference is zero. I am on the right track?  Thank you for the help. How to change language using command line on CentOS 7? I use the following command line to set my system in English (installed in French) :  localectl set-locale LANG=en_US.utf8   However, when I boot into graphical mode, the desktop menu, directories names etc. are still in French.  The only way I can set everything in english is to use the graphical gnome menu "Applications > System tools > Settings > Region and Language".  Is there a way to change system language using command line as if I used the graphical menu?  EDIT :  In fact, my problem was coming from the fact that I was modifying through SSH with user root the system language but then loging through graphical console (workstation VM) under a standard user who has its language already defined. localectl works well but to define default language for a specific user, I must define $LANG in my .bashrc How to force the user to download a file, not to view it? Using a question mark mid-sentence How to create a Sierpinski triangle in LaTeX? I have been trying to recreate the following image in LaTeX    and for me personally it has to be done with pdflatex. Although answers using pst-fractals From Jake I got a good start which led to the following code  \documentclass{standalone} \usepackage{tikz} \def\level{5} \usetikzlibrary{lindenmayersystems}  \begin{document} \begin{tikzpicture}[l-system={step=5pt, order=\level, angle=120},rotate=180]     \pgfdeclarelindenmayersystem{Sierpinski triangle}{     \symbol{X}{\pgflsystemdrawforward}     \symbol{Y}{\pgflsystemdrawforward}     \rule{X -&gt; X-Y+X+Y-X}     \rule{Y -&gt; YY}     }     \draw [black] (3,2) l-system     [l-system={Sierpinski triangle, axiom=X, anchor=north east},fill=white]; \end{tikzpicture}  \end{document}   There are however two problems with the code.   I layer a black triangle behind the lindenmayersystem? How do I keep the size of the triangle consistent with different number of recursion levels. When looking at used camera bodies, a question that comes up a lot, is "how many shutter actuations, or clicks, does it have?"   What I am wondering is, how many is too many. In other words, is there a reference for knowing when a sensor is more likely to go? How should I judge a camera body with 20000 vs 5000? Is that a significant difference, or is that not even relevant.  Obviously this might something that is dependent on model, so if there is some information based on model that would be even more interesting.  One of the guys at Canon Tech Support said that this is completely irrelevant for the Rebel series cameras, but he is obviously slightly biased. :) Is a rational-valued continuous function $f\colon[0,1]\to\mathbb{R}$ constant? Let $f\colon[0,1]\to\mathbb{R}$ be continuous such that $f(x)\in\mathbb{Q}$ for any $x\in[0,1]$. Intuitively I feel that $f$ is constant, since $\mathbb{Q}$ is dense in $\mathbb{R}$.  How can I formally write this down? Upper bound for norm of Hilbert space operator It is a standard result that for a bounded self-adjoint operator $T$ on a complex Hilbert space $H$, we have $\|T\|=\sup_{\|x\|=1}|\langle Tx,x\rangle|:=M(T)$, where $M(T)$ is called the  of $T$. It seems that for any bounded operator on $H$, we have $||T||\leq 2M$. Why is that so? why ls reports a huge file and du does not? Problems in Creating InfoWindow on each individual circle with mouseover using Google Map API Panasonic Eneloop BK-3MCC (4th gen) - where I can find maximum discharge current? Im looking for some official information source about maximum current for Panasonic Eneloop BK-3MCC rechargeable batteries.  All I found is , there is just 1 table (nothing about maximum discharge current), charge and discharge characteristics.  UPDATE LINK:   / edited - I fixed my mistake, I meant 6A not 8A /  There is discharge characteristic for 6000mA discharge. So... I can safely draw 6A from that AA cell? Which computer science / programming Stack Exchange sites do I post on? There seems to be more than a few computer science/programming Stack Exchange networks (is that the correct term?). Stack Overflow, being the first, has by far the most users, questions, and answers.  What is the reasoning for creating the others, and are there clear guidelines for which kinds of questions should be posted? I can see a large amount of potential overflow, many cases of people not getting a good answer to their question, because the person who has the answer isn't browsing that particular network at the moment.  I understand that they were probably created for organizational purposes, but wouldn't it almost make more sense to just have them as categories under Stack Overflow, keep them separated but still connected, instead of making people have to create multiple 'account's, one for each network?  I am sure there was a very good reason to break them up, but as someone that is new to SE, it can be somewhat intimidating to decide which one to post in to ensure you get a good answer. For example, if I am a computer science student, my first instinct might to be to post in the computer science network, until I see that it literally has 1% of the users as the Stack Overflow network, which still seems to be for programming/computer science related questions.  So my second instinct would then to be to post it into the Stack&nbsp;Overflow site on the basis that I have a significantly higher chance of my question being seen and getting a good answer. Then I notice that there is also a 'programmers' network, and I don't even begin to know where that fits in. I, and I am assuming most people, will probably just post on Stack&nbsp;Overflow to be safe.  My question is, other than the short little description blurb of each one, is there a clear cut set of guidelines which what each network is intended for, what kinds of questions should go to each one, and is anything being done to encourage people to post in these newer, smaller (more specialized?) networks as opposed to just posting in big daddy Stack Overflow?  Now again, this is for computer science/programming/"why isn't this code doing what I want?" related questions, I am not saying that if I had a question about Linux or WordPress or something I would have the same confusion.