Testing methods called from another method
Making a private method public to unit test it...good idea?
Then what is the probability that out of $n$ men $A_1,A_2,....,A_n$ each aged $x$ years,$A_1$ will die and will be the first to die Let $p$ be the probability that a man aged $x$ years will die in a year time.Then what is the probability that out of $n$ men $A_1,A_2,....,A_n$ each aged $x$ years,$A_1$ will die and will be the first to die?  The probability that a man aged $x$ years will die in a year time$=p$  The probability that a man aged $x$ years will not die in a year time$=1-p$  But from here on,i got stuck.Some hints and suggestions are welcome. How do I find a command if I don't know its name? As a Unix beginner, I often find myself wanting to know the name of the command that achieves a particular function I'm after. How can I go about finding out the name of the command, given a description of what it does? I would have read this about 20-25 years ago.  I believe the subject was an alien individual, but it could have been a non-standard human instead.  The hook of the story was that the subject lacked an organ like the  that allows the halves of the brain to communicate efficiently, allowing the illusion of a single consciousness.  The subject is conscious, and has thoughts, but is subject to hearing commands like "Wash your hands!" "Fetch water!" within its head.  I recall the subject (and others like the subject) believing that the voices are their gods talking to them.  To the reader it becomes clear that this is a separate part of the subject's own mind that is responsible for long-term planning and simply can't communicate with the rest of the mind in the way a "normal" human is accustomed to. I'm using Linux Mint. My login shell (cat /etc/passwd | grep myUserName) is bash.  After I start my graphical desktop environment and run a terminal emulator from it, I can see that .bash_profile is not sourced (environment vars that are exported in it are unset). But if I log in from a text console (ctrl+alt+F1) or manually run bash -l from the terminal emulator, .bash_profile works fine.  Am I wrong when I think that .bash_profile should be sourced when X starts and all export'ed vars should be available in the terminal, running from X?  P.S. Placing everything in .bashrc and sourcing it from .bash_profile is not good idea (): environment stuff should be sourced only once. Saving Working Files as PSD or TIFF? I was reading a few articles about how people saved their working files and it got me thinking about my own method. I used to save everything as a PSD, but recently I have started saving my working files as TIFF's. I use Windows, so I don't know if it's different for Apple users but with a PSD, all I can see is that "PSD" icon. But a TIFF file shows up as a normal image (that I can edit), so I found it really great when I have a lot of working files for one project and could just quickly preview it without opening the program.  That being said, I am no expert in which method is better. And I know a lot of people here are pretty seasoned users in all things Adobe, so I was wondering what your two cent on the whole topic is?   Is there really any difference to saving it as a PSD or TIFF? Is there something I should specifically know about saving my files as a TIFF rather than a PSD? "many a time" means "many times"? Good refactoring support for C++ The Visual Studio refactoring support  for C# is quite good nowadays (though not half as good as some Java IDE's I've seen already) but I'm really missing C++ support.  I have seen  and am currently trying it out, but maybe one of you guys know a better tool or plugin?  I've been working with  now for a week or two and got totally addicted. Thanks for the tip, I'll try to convince my boss to get me a license at work too.  I've been bughunting for a few days since Visual Assist X kept messing up my Visual Studio after a few specific refactorings, It took me (and customer support) a week to hunt down but let's say for now that Visual Assist X is not a good combination with . What is 'Currying'? I've seen references to curried functions in several articles and blogs but I can't find a good explanation (or at least one that makes sense!) Mobile web refresher, part 3 Login screen loops unless you login as Guest I am running a VMWare Player with a Ubuntu 12.04 LTS Precise Pangolin as Guest on my Windows 7. Sometimes I get the shutdown blue screen error in Windows, this time it happened when I was running the Player. When I restarted everything Ubuntu gave me the &quot;Login Loop&quot; on adminstrator login. I log in and there's this black screen where I can only read:  piix4...smbus:0.0.0.07.3 Host Smbus controller not enabled .    When I go to the prompt in root mode it fails to update and only upgraded, specially some plugins ( I think graphic plugins) which also appear in one an error message after quitting the prompt, but they´are successfully installed. They are not the error message. After that I have been working with the Fail/safe Mode recovery panel. When I try to update via Root I get errors like this: W:failed to fetch http://extras.ubuntu.com/ubuntu/dists/precise/release.gpg could not        resolve 'extras/ubuntu.com  There are 8 more like this referring to areas like: -archive/canonical.com -ppa.Launchpad.net -security.Ubuntu.com -Us.archive.ubuntu.com - release.gpg                         precise-updates/release.gpg                         precise_backport/release.gpg   Final Message: some index files failed to download.....they have been ignored or old files are used. The black screens most of the time pass by too fast for me to pick up any information. But in general I think I have done everything I was able to in the recovery panel including updating network and graphic packages and recovering filesystem packages and the basic stuff ( I am a beginner regarding Linux ) in the root prompt. Now I am stuck in this screen with graphic options: - Run in low-graphics mode just for one session - Reconfigure Graphics - Troubleshoot the error - Exit to console login  I am trying to choose to reconfigure graphics but the mouse disappears in the virtual machine screen and sometimes when options change it´s only the first and last option. But this happens from the blue without messages. This particular option menu is in the regular GUI style against a black screen in Terminal style. Really strange. Isn't finding the inverse of $a$, that is, $a'$ in $aa'\equiv1\pmod{m}$ equivalent to solving the diophantine equation $aa'-mb=1$, where the unknowns are $a'$ and $b$? I have seem some answers on this site (where the extended Euclidean Algorithm is mentioned mainly) as well as looked up some books but there is no mention of this. Am I going wrong somewhere or is this a correct method of finding modular inverses? Also can't we find the Bézout's coefficients by solving the corresponding diophantine equation instead of using the extended Euclidean Algorithm? Norm and unit sphere From command line open package installer Can moving tables to another MySQL database help performance? I want to know if I using different databases can help performance.  I have one big table support_chat with more than 5 million rows. I need to scan this all the time (3s with ajax) to check new messages on support.  If I move this table to another database in the same computer, can it help anything? (let users, sells, comments table faster)  For example:  db1  users table sells table comments table support_chat table // move this table to db2   db2  support_chat table   They want to keep old things due legal reasons, to have a user support history. If I multiclass into 2 or more spellcasting classes, how do I determine my known/prepared spells? How to get the keyboard to input Japanese? need initfamfs modules. 15.04 is anything else supposed to be here? I am using Ubuntu gnome and my keyboard is unresponsive for encryption password. Do I need any more modules, and if so where do I add them.  # List of modules that you want to include in your initramfs. # They will be loaded at boot time in the order below. # # Syntax:  module_name [args ...] # # You must run update-initramfs(8) to effect this change. # # Examples: # # raid1 # sd_mod Converting LiDAR files from LAZ to LAS format I'm trying to convert LiDAR files from the LAZ format (the compressed version) into LAS (the uncompressed version) using  software.   However, I am not really sure how it works. I created a new output folder as I entered in the app interface, but it is totally empty.  I also had tried the following code in the command prompt window:   D:\LiDAR\Laszip\laszip.exe *.laz    and got a message saying 'no input specified'.  In my folder, there are about 100-ish.laz files as well as one imu.laz. Any suggestions? To translate a vector by 10 unit in the X direction, why do we have to use a matrix?    We can just add 10 to the mat[0][0], and we got the same result too. How to force Mac window to foreground?