Regular expression "\\d?" giving incorrect output
SCJP6 regex issue
I'm new to Ubuntu. What's the application extension for development reasons? I know Windows is mainly .exe and Mac is .dmg or .app. Does Linux have an unique one? Best way to randomize an array with .NET Pull down resistor on logic gate input I would like to use a pull-down resistor on the input of a NOT logic gate. I am using a 5V microcontroller, and I want to ensure that the input of the gate will never be floating (eg. microcontroller damage).  General information:  The logic gate I am using is a HD74LS04 inverter whose datasheet can be found . I am testing the output by placing my positive multi-meter lead on R4 and the negative lead on GND. With the digital pin floating, the output of 1Y is 4.33V. This is the expected behavior.  The logic gate requires a minimum of 2.0V for Vih. If I understand this circuit correctly, I expect the voltage at pin 1A to be 3.76V since R2 and R3 will form a voltage divider. This value seems plenty to signify a 'high' in the logic gate.  R2 exists to protect the digital pin. Ideally, I would have liked R2 to be 1KΩ. Increasing the value of R2 means I have to increase the value of R3 to maintain the same voltage divider. During testing I found that if R3 was any value over 3.3KΩ, the pin 1A would not get pulled down all the way if I left the digital pin floating.   Tests: If I disconnect everything except GND and Vcc and place the positive lead of my multi-meter on pin 1A (now floating) and the negative lead to GND, I read 1.49V. Placing a pull-down resistor (R3) on pin 1A to GND with a value of 100Ω changes the reading to 0.02V. Increasing the resistor's value to 330Ω increases the reading to 0.07V. At the value I need, 3.3KΩ, the reading increases to 0.60V. Finally, changing the resistor's value to 1MΩ increases the reading to 1.47V and actually changes the output of pin 1Y to low.  The test that uses the 3.3KΩ resistor is concerning. The reading I took (0.60V) seems to be approaching the Vil maximum of the logic gate which is 0.80V.   Questions:  This must be a trivial question, but why does an R3 value of 3.3KΩ not pull pin 1A all the way to GND? Is there a formula for determining the correct pull-down resistor value? Other answers I found on here simply state 10KΩ as a 'good' value for a pull-up resistor. I'm not sure where that value comes from or if it is applicable to a pull-down resistor.         &ndash; Schematic created using   Edit: Although Ignacio's answer technically answers the question, I thought I would share some information I found for others who may come across this question.  User 'Papabravo' on the  states that the calculation for a pull down resistor can be calculated by taking the Vil (0.8V) and dividing it by the "standard TTL load" of 1.6mA. As Ignacio pointed out, my specific logic gate can source up to 0.4mA, so the calculation would be 0.8/0.0004A which equals 2KΩ. For safety, I performed the calculation at 0.5V in order to give myself some headroom.  Other Resources: The equation $y^2 = x^3 + k$ for $k = (4n-1)^3 - 4m^2$, with $m, n \in \mathbb{N}$ and no prime number that p is congruent to 1 modulo 4 divids m, doesn't have any answer and its proof can be obtained by using quadratic reciprocity law.  Do you know answers of this equation for two or three different values of $k$? In addition, do you know any reference about that? 3.8 GPA, but 3 Fs and 1 D on transcript Converting Older United States Dollar Bills I received from my Dad 150 American Dollars about 12 years ago. I never have thought to change this money but a few days I tried change it in a currency exchange in Sydney and the guy didn't change it because the series are old.     What do I have to do to change this money? Why does my material panel look different? Complete beginner here.  I'm trying to follow  tutorial on Anisotropic shaders, but my property panel looks nothing like the property panel in the tutorial.  For example, when creating a material, this is what his property panel looks like:    But this is what mine looks like, if I follow the same path:    I'm sure I'm missing something obvious.  How can I see the property panel shown in the tutorial? Can I configure Ubuntu to never install a specific package even if it is required by another package I install? How to typeset asymmetrical confidence level limits / uncertainties? I have scripts calling other script files but I need to get the filepath of the file that is currently running within the process.   For example, let's say I have three files. Using :   script_1.py calls script_2.py.  In turn, script_2.py calls script_3.py.    How can I get the file name and path of script_3.py, from code within script_3.py, without having to pass that information as arguments from script_2.py?  (Executing os.getcwd() returns the original starting script's filepath not the current file's.) How does the system determine which one close reason should be displayed on a closed question, given the close votes? When voting to close a question, it's possible for users to vote for any close reason, even if others have voted for different reasons. However, in the end, once the question reaches five close votes for any reason, only one of those reasons can be displayed.  How does the system determine which one close reason to display, given the votes made by users? bash aliases equivalent for powershell? By default my Windows PowerShell starts in C:\Users\Santosh, my XAMPP installation is in D:\ so the htdocs folder is located at D:\xampp\htdocs. If I have to edit something in htdocs folder then I have to type full cd D:\xampp\htdocs\ (autocompletion is not so kind) then edit that file.  If this PowerShell were a Bash I would do this in .bash_aliases file:  alias htdocs='cd D:\xampp\htdocs'  Is it possible to maintain Bash aliases like file and alias any command in PowerShell? How to eliminate Cycles artifacts with many overlapping volumes? I have encountered an issue with Cycles Volumetrics in a recent scene. I am using Blender 2.72, and both CPU and GPU render options. In both I get a solid black artifact when I have two volumes overlapping, as in this campfire smoke test:    I have a solid cube, with a volume scatter and volume absorption material, duplicated by a particle system. As you can see, when the particles get higher up and farther apart, and are no longer overlapping, the artifacts disappear. Facebook message notification showing blank message Since I updated the system to 10.11.5, the Facebook message notification is not showing message text.   Is this a bug in this software upgrade of OSX? Find the limit if it exists of $S_{n+1} = \frac{1}{2}(S_n +\frac{A}{S_n})$ What prevents this magnetic perpetuum mobile from working? Natural Sounding Text to Speech? If $S$ is a nonempty subset of group $G$, then $S^{|G|}$ is a subgroup of $G$. Let $G$ be a group with $|G| = n$ and let $ \emptyset \ne S \subseteq G$.   I want to show that $S^n$ is a subgroup of $G$ where by $S^n$ I mean the set $\lbrace s_1\cdots s_n \; | \; s_i \in S\rbrace$. Using CBC with a fixed IV and a random first plaintext block I'm very confused about tenses.  I have examples in two different situations here. Situation 1: I went to New York two months ago and was talking to someone about it.  A. This is the first time I've been to New York. B. That was the first time I'd been to New York.  Which is correct in a daily conversation?  Situation 2: I'm going to New York next month and talking to someone.  A. This will be the first time I've been to New York. B. This is the first time I've been to New York. C. This will be the first time I go to New York.  Which sentence is appropriate?  According to a grammar article I've read before, I think it says that I can use this sentence in both cases:  This is the first time I've been to New York.  But I'm not sure if this is really so. So I'd like to know which tense I should use in each case. Could you explain it?