locking objects and thread synchronization
Why is it a bad practice to lock the object we are going to change?
How and why do you use an image histogram? I realize that an image histogram is a graphical display of an images tonal distribution (i.e. horizontal darks to lights, vertical pixel distribution), but how does one really use it and why? I mean, can't you determine everything you need just by looking at the image? Are there any areas that should be avoided and are there any steps I should take to protect myself from radiation? Trying to format USB (using Linux/fdisk) so it shows up on my Mac I have a USB drive that I can see/access/modify/etc in Linux/Ubuntu but it doesn't show up on my Mac OSX.  I did sudo fdisk /dev/sdb (where my USB is) and then g to create a new GPT partition table, n to make a new partition, used all default settings, then w to save and exit.  Then I did sudo mkfs.fat -F32 /dev/sdb1 to format the partition with a FAT32 filesystem.  I ejected the USB and put it in my Mac and it doesn't show up / get detected.  What did I miss? I am doing some challenges. This is one them. I am trying to brute-force 4 digit pin with the password to get my desired answer. After connecting to the port It prompts me to enter the password then space then 4 digit pin. I tried to brute-force the pin using the script:  #!/bin/bash   nc localhost 30002   sleep 2    for i in {0000..9999};       if [[ $(echo 'UoMYTrfrBFHyQXmg6gzctqAwOmw1IohZ $i' &lt;/dev/stdin) = ^Wrong*]];                         then          continue       echo '[+] Pincode Cracked! Pincode = $i'       fi   done  but it seems that this doesn't input the pass and pin to stdin, before i tried doing something like this -&gt; if [[ $(echo 'UoMYTrfrBFHyQXmg6gzctqAwOmw1IohZ $i') = ^Wrong* ]]; What am I doing wrong here? UPDATE: Okay, so after researching around. I wrote this: for i in {0000..9999} do     if [ (echo &quot;UoMYTrfrBFHyQXmg6gzctqAwOmw1IohZ $i&quot; | nc localhost 30002 | grep -o Wrong) == &quot;Wrong&quot; ]    then       sleep 0.1       continue    fi    echo &quot;- - - - - - - - - - - - - - - - - - - - - - - - [$i]&quot; done  This might even work but as you can see it opens new connections in the loop which makes it really slow and exhaust the system. VAR/VECM/ARDL optimal lag selection Question 1: Is it necessary to consider AIC and the BIC criteria when selecting the lag for a VAR, VECM or ARDL model OR can I use something else?  Example: Can I pick 12 lags because the model simply produce great results when I do or do I have to use the AIC/SIC criteria?  Question 2: A simple google search tells me that its possible to select lag 4 when quarterly data, 12 when monthly etc. Is that a valid approach ? I found the question  Regarding the number of answers votes and also according to my personal taste I like to capitalize titles. But what exactly are titles? Only the single main book title? What about other smaller semantic parts? Chapter headings, sub-chapter, ... Sometimes I see a comma after the proper name:     Hello Mr. Black,      In order to give you....   But my native language is not English and I think that the comma in this phrase should be placed before the proper name:      Hello, Mr. Black.      In order to give you....   What is the correct punctuation in English? Generator of rational functions unchanged under $\sigma(X) = X + 1$ Let $L = K(X)$ be the field of rational functions over a field $K$ with characteristic $p &gt; 0$, and let $\sigma \in \operatorname{Aut}_K(L)$ with $\sigma(X) = X + 1$.   Show that $G = \left&lt;\sigma\right&gt;$ is finite, and determine a generator of $L^G = \{ f \in L: \rho(f) = f$ for all $\rho \in G \}$ over $K$.    My solution so far: $G = \left&lt;\sigma\right&gt;$ is finite because char $(K) = p &gt; 0$ and therefore $\sigma^p (X) = X + p = X $.  A rational function unchanged under $\sigma$ will also be unchanged under any $\sigma^n$, so we don't have to worry about powers of $\sigma$ I think.   Any ideas for finding a generator? Thanks. Eevee - Light inside a bulb lamp not passing through glass Using Eevee, I'm trying to simulate a light bulb. I have a sphere with glass material and inside it, I have a Point light. But the light is not passing through the glass:  However, if I disable the sphere object, the light is working:   How to make the light inside a bulb lamp pass through glass (using Eevee)? Here my test project: How can I prevent my mail from being classified as spam? When sending or forwarding emails using a personal or company domain using a  website or email client, how do I prevent the email from being incorrectly marked as spam? How do I set a user environment variable? (permanently, not session) This is irritating me. I seen several suggestions (all using different files and syntax) and none of them worked.  How do I set an environment variable for a specific user? I am on debian squeeze. What is the exact syntax I should put in the file to make ABC = "123"? Another way to write least prime factor. Variable with colon dash ${VAR:-} Warning: preg_replace(): Unknown modifier How can I do a "broad" search for flights? Several airline and trip planning sites will allow you to check "I am flexible with my dates" or a similar option.  Is there any way to also search more broadly for location?  For example, if you wanted to leave from YYZ or YKF and arrive at any airport in California, can a search for such flights be done somehow?  I ask because when I plan plane trips, I want the lowest price.  I'm OK with leaving a day or two later if I save $200 (same with the return trip).  There are 3 airports within 80 km of me, I'll leave from the one with the cheapest flight. And I'm also OK with changing the trip to spend time exploring San Francisco instead of lying on the beach near San Diego, and that sort of thing.  Normally this would take dozens of searches, but I'd like to see it all at once. Only squares instead of letters and numbers are displayed in my calculator and other apps in Ubuntu 18.04 How can I get my graphics card to be recognized in System Info? I am new to Linux/Ubuntu. I installed Ubuntu 11.10 on my Lenovo IdeaPad y510.   System info says    Graphics: unknown.   Driver: unknown,   Experience: Standard.   What should I do to use all my laptop hardware components to work properly with Ubuntu? Screenshot: C# "internal" access modifier when doing unit testing I'm new to unit testing and I'm trying to figure out if I should start using more of internal access modifier. I know that if we use internal and set the assembly variable InternalsVisibleTo, we can test functions that we don't want to declare public from the testing project. This makes me think that I should just always use internal because at least each project (should?) have its own testing project. Can you guys tell me why I shouldn't do this? When should I use private? White background with filmic blender Chrome: Site has updated in the background I keep getting these notifications despite not having an RT tab open. What gives?