can 'ls' output JSON?
convert bash `ls` output to json array
Are getters and setters poor design? Contradictory advice seen I'm currently working on a simple game in Java with several different modes. I've extended a main Game class to put the main logic within the other classes. Despite this, the main game class is still pretty hefty.  After taking a quick look at my code the majority of it was Getters and Setters (60%) compared to the rest that is truly needed for the logic of the game.  A couple of Google searches have claimed that Getters and Setters are evil, whilst others have claimed that they are necessary for good OO practice and great programs.  So what should I do? Which should it be? Should I be changing my Getters and Setters for my private variables, or should I stick with them? Proof that every finite dimensional normed vector space is complete Can you read my proof and tell me if it's correct? Thanks.  Let $V$ be a vector space over a complete topological field say $\mathbb R$ (or $\mathbb C$) with $\dim(V) = n$, base $e_i$ and norm $\|\cdot\|$. Let $v_k$ be a Cauchy sequence w.r.t. $\|\cdot\|$. Since any two norms on a finite dimensional space are equivalent, $\|\cdot\|$ is equivalent to the $l^1$-norm $\|\cdot\|_1$ which means that for some constant $C$, $\varepsilon &gt; 0$, $k,j$ large enough, $$ \varepsilon &gt; \|v_j - v_k\| \geq C \|v_j - v_k\|_1 e_i= C \sum_{i=1}^n |v_{ji} - v_{ki}| \geq |v_{ji} - v_{ki}|$$ for each $1 \leq i \leq n$. Hence $v_{ki}$ is a Cauchy sequence in $\mathbb R$ (or $\mathbb C$) for each $i$. $\mathbb R$ (or $\mathbb C$) is complete hence $v_i = \lim_{k \to \infty} v_{ki} $ is in $\mathbb R$ (or $\Bbb C$) for each $i$. Let $v = (v_1, \dots , v_n) = \sum_i v_i e_i$. Then $v$ is in $V$ and $\|v_k - v\| \to 0$:  Let $\varepsilon &gt; 0$. Then $$ \|v_k - v\| \leq C \|v_k - v\|_1 = C \sum_{i=1}^n |v_{ki} - v_i| \leq C^{'}n \varepsilon$$  for $k$ large enough. How to: Unlimited Bash/shell history? Is there a way to define an unlimited history in Bash ? Feature request: Add pronouns to usercards? One of the questions people have raised about the new rules about pronouns is how users will know what pronouns are preferred.   We've had a trolling question which got  when the user included their preferred pronouns at the bottom of the question, and I agree that particularly on Stackoverflow (rather than sites like Interpersonal Skills or Workplace), this should be considered as 'noise' since it isn't the strict Q&amp;A this site is about. (The codez should work whatever your gender).  Currently, the suggested way of displaying your pronouns is to put it in your profile's 'About Me' section. However, this is suboptimal, since it requires opening a new page.  I suggest adding a 'preferred pronouns' field in the user profile, and displaying this on a user's usercard. There's currently a 'new contributor' label, so it could be similar to that, with she/her pronouns or whatever they choose.  In comments, it could be appended to the reputation score that currently gets shown when you hover over a name:   4,305 reputation, she/her pronouns  The default would be blank. No flair updates, no hover-in-comments update. If a user fills in this field in their profile, then it will show. Do I end up richer paying down a mortgage or contributing to an IRA? I have $10,000 extra cash that I can either use to pay down my 5% mortgage, or contribute to my IRA.  I'm 30 years old.  I hope to pay off the mortgage in about 5 years.  I'm stymied, because:   Paying $10,000 into my mortgage earns me $500 a year (in interest savings) for the life of the mortgage -- hopefully 5 years. Paying $10,000 into my IRA earns me roughly a $3000 lowering of my tax bill now (plus CD ROI of about 1% at retirement time.)   So I can get $2500 ($500 a year over 5 years), after which I will have paid my mortgage off with other money; or I could get $3000 in cash right now plus a bit of extra money when I retire.  Even ignoring the future benefits of the IRA contribution, it feels like I should put the money into my IRA: it's an immediate 30% return on investment, as opposed to a 5% return for 5 years.  But if I always make that decision, I won't be paying off my mortgage early, and that $500 will stretch out over 30 years, costing me $15,000!  Which actually leaves me with more money in the end?  What basic principle of math am I missing?  Update:  The principle of math I was missing is that, assuming I'm taxed at the same rate when I retire as I am taxed now, I end up with exactly as much money as if I had invested the $10k and not received a $3k tax reduction.  (Of course, my income level and tax laws will have changed by then, but let's ignore that.)  So the question simplifies to, "Should I put $10k toward eliminating a 5% debt or toward a 1% investment?" in which case I should clearly put it toward the mortgage.  I was confused by the government incentive into thinking that retirement investment was a sweeter deal than it actually is.  This is probably their goal, and probably a noble one :) Troubleshooting why Powerbank Doesn't Charge Cell Phone I have powerbank that provides 5v (presumably regulated) power, as typical of most usb interface powerbanks. I have been trying out my powerbank with different phones. It works on all except one. I have tried it with various USB cables, making sure I didn't overlook anything foolish. Then, I looked at the AC adapter of the phone that it didn't seem to be compatible with. The adapter read: 5.4v DC output. The device's official website or manual doesn't tell me what the input voltage should be. So I have the following questions   Is the fact that the device's AC adapter creates a DC 5.4v output enough to assume that, this is the correct voltage for my cell phone? If 5.4v is the input voltage, then when I attempt to power it with a 5v power bank, am I hurting it? Thus far, it just seems to be non-responsive when I try this. It seems another explanation is polarity mismatch. I'm aware that laptops have a polarity correction feature, which could explain why I can charge this phone via my laptop. Is there any other way to tell if polarity is an issue, given that I don't have access to detailed product information (unless the official website is updated, or something)   So that's the gist of it, I'm not sure why my powerbank isn't charging my phone. And I'm having difficulty troubleshooting the underlying problem by myself. Any tips big or small will be appreciated. I would like to use the sentence     He was 'over-eager' to implement his plan, leading to failure.   I am looking for a single word which expresses over-eagerness in a negative sense.  TIA How are PCA and classical MDS different? How about MDS versus nonmetric MDS? Is there a time when you would prefer one over the other? How do the interpretations differ? App version: 1.0.35 Device: Nexus 7 Problem: Users with weird/unusual name won't display on the Android app, there will just be a blank space where the username should be. For example,  user is showing as:   On a question:   On their profile: Let $\{a_n\}$ be defined as follows: $$a_1 = 2, a_{n+1}=\dfrac{1}{3-a_n}$$ $n \geq 1$.   Does $\{a_n\}$  converge?    Using the monotone convergence thereom, if the sequence is both bounded below and decreasing, $\forall n\in\mathbb{N}, n\geq 1$, then we can say the sequence converges.  I'm having trouble proving that the sequence is bounded below by induction.    Claim: The sequence is bounded below by $0$.  Base Case:  $n=1$  $a_1 = 2 \geq 0$, so this holds.  Induction Step  Suppose that $a_k \geq 0$, for some $k \in\mathbb{N}$. (IH)  Prove $a_k \geq 0\to a_{k+1} \geq 0$  I have some difficulty here.  $a_{k}=\dfrac{1}{3-a_{k-1}} \geq 0$  $a_{k+1}=\dfrac{1}{3-a_{k}}$, but we know $a_k \geq 0$, but we don't know how much bigger. It could be that $a_k = 4$, and then I have $a_{k+1}=\dfrac{1}{3-4}$, which is negative, and does not confirm with my claim of being bounded below by $0$. Have I gone somewhere wrong in my induction? Why are comments overlapping the sidebar? On , the comments are overlapping the related questions sidebar. Is this something to do with the weird formatting of the first comment?    Browser: Mozilla/5.0 (Windows NT 6.0; rv:16.0) Gecko/20100101 Firefox/16.0 I'm not quite sure how this happened, but somehow a completely empty hierarchy of directories has ended up in my repository:  com/ com/companyname/ com/companyname/blah/ com/sun/ com/sun/java/ com/sun/java/jax_rpc_ri/   I think what happened was that these directories did have files in them, but then a developer realized he/she shouldn't have checked them in in the first place since these are by-products of the build process, so he/she removed the files but somehow the empty directories are left in the repository as ancient relics.  How can I remove this from CVS? The only results I seem to be able to find on google say that there shouldn't be a need to remove empty directories as CVS won't keep them around in the first place, and that the -P (prune) options to cvs update should remove them from the working directory  - which is zero help if you actually have empty directories in your repository.  A cvs remove and cvs commit doesn't seem to take care of this situation:  $ cvs remove -Rf com cvs remove: Removing com cvs remove: Removing com/companyname cvs remove: Removing com/companyname/blah cvs remove: Removing com/sun cvs remove: Removing com/sun/java cvs remove: Removing com/sun/java/jax_rpc_ri $ cvs commit com cvs commit: Examining com cvs commit: Examining com/companyname cvs commit: Examining com/companyname/blah cvs commit: Examining com/sun cvs commit: Examining com/sun/java cvs commit: Examining com/sun/java/jax_rpc_ri $ ls -l com total 24 drwxrwxr-x  2 matt matt 4096 Oct 15 14:38 CVS drwxrwxr-x  9 matt matt 4096 Oct 15 14:38 companyname drwxrwxr-x  4 matt matt 4096 Oct 15 14:38 sun   It's still there!  Does SVN have this weird behavior too? Attribute field names truncation when creating shapefiles I am wondering what is the expression that truncate a given name to the 10 characters name used in ESRI shapefiles when an object is saved as shapefile with the function writeOGR in R. For example, the attribute field from a spatial dataframe "Ablepharus kitaibelii" is converted to "Ablphrk" when saved as shapefile, how the truncation is done? Uninstall apps locked by phone vendor How is the passage of time handled in Pokemon? I stopped following the Pokemon anime a while ago, but I know the series has had Ash go through many regions, including retreading at least one of them.  When Ash was about to get his eight badge, Misty mentioned that they'd been on the road for a year at that point.  I saw some recent episodes, and Ash looks nearly identical to when he first started as a trainer.  Normally I'd attribute that to cartoon sitcom logic, where the characters never age; but in a series with continuity and references to earlier seasons, this makes no sense.  What's the official word on a timeline for the Pokemon anime? What is the use/meaning of 'swap area' while linux installation? When i installed ubuntu in my x86 machine, I had to configure some memory as 'swap area'.  What is the use of this memory and what is the importance of this memory in linux file systems?  How can I determine the exact size of 'swap area' in a machine for the safe working of linux inside in it? Why does your reflection suddenly turn upside down while slowly walking away from a curved mirror? Many people should have realised, when looking into a concave curved mirror (or even a rather reflective spoon in that fact) at a close distance, you will see a slightly distorted reflection. But as you move further away, the image will suddenly become upside-down.  why is this? Black screen when creating movie I've rendered about 300 frames for a short clip. The frames look fine, but when I compile into a movie all I get is a black screen. I haven't been able to find anything to solve this problem. The individual frames are well lit, capture what I want them to, look great. Just creating the AVI or MPEG results in a clip that has nothing but black. Why does a Ubuntu guest in VirtualBox run very, very slowly? I'm using currently Ubuntu 12.04 LTS as a host machine, and I've virtualized three machines:   a Xubuntu 12.04 guest a Windows 7 guest a Ubuntu 12.10 guest   All the guests have the same VirtualBox default settings, but Ubuntu 12.10 is slower!  The installation took 1h 40 min! (Normally, it takes 40 minutes.) Now it is impossible to use it, and all operations are very, very slow.  I'm using VirtualBox version 4.2.4.  Any ideas?  Why is it slow? And how can I make it faster? What is the point of Sauron making the One Ring? Why would Sauron make himself a ring that he invested most of his power in? Wouldn't it be better to keep the power in his physical form and not risk leaving his power in a physical form that could be stolen (which did happen when Isildur took it). Because of its being in the form of a ring, its power could be abused by someone else to attack him.