Should a variable be declared inside or outside a loop?
Declaring variables inside or outside of a loop
Bluetooth disappeared in Windows 10 I have a Lenovo G580 laptop. In the past, using Windows 8, I could use Bluetooth to connect to other devices.  Installing Windows&nbsp;10, Bluetooth simply disappeared. I can't find anything related to Bluetooth in the Device Manager, also in Settings → Devices.  There is no Windows&nbsp;10 Bluetooth driver for my laptop.  What can I do? Sydney Airport international airline transfer My dad is flying to Christchurch, New Zealand, for the first time and I booked him tickets with 1 stopover in Sydney. I booked with Qantas and I just realized that his connecting flight in SYD is operated by Emirates (codeshare). He is flying from MNL with Qantas and arrives in SYD at 6:10AM and yhe next flight to CHC is at  7:50AM with Emirates. He only has 1 hour and 40 minuted before his next flight, assuming the flight is on time.  I have never been in SYD myself so I don't know how it works. PS: I won't be applying for a transit visa for him as he won't be leaving the airport and I assume it's not a case of separate tickets but airline codeshare. My questions are:   Will Qantas allow luggage check-in straight to CHC?  If the answer is yes, can he take his boarding pass to CHC at the Transfer Desk to avoid long queues at Emirates check-in counter? If answer to #1 is NO, obviously he will have to claim baggage to check in with Emirates.  How long will it take to go through customs and Immigration? I am worried that 1 hour and 40 minutes won't be enough. Can he skip the queue and ask people to let him pass? Is there any desk at the Sydney airport I can contact to assist him? I cannot afford the Meet and Greet services offered by some companies at the airport. I am wondering if I can call the Sydney airport concierge to help my dad get to his next flight. I am willing to pay but not as much as the airssist or fasttrack charges.   Thanks. ReSharper likes to point out multiple functions per ASP.NET page that could be made static. Does it help me if I do make them static? Should I make them static and move them to a utility class? I am trying to burn a shapefile to a raster using GDAL's RasterizeLayer. I pre-create an area of interest raster from a different shapefile, given a specific pixel size. This AOI then serves as a base for all following rasterizations (same number of collumns and rows, same projection and geotransform).  The issue occurs, however, when I go to burn the shapes to their own raster, based on the same pixel size and projections. The link below (don't have enough rep to post the image), shows the original shapefile in tan, and the dark pink where RasterizeLayer has burned data. The light pink is nodata values for the dark pink raster data. The grey is the AOI based on which the shapefile burn was completed.  Given the extents of the shapefile polygons, I would expect to see burn values in the bottom two corners, as well as the two pixels underneath the data that does show. Obviously, however, this is not the case.    As follows is the code that I used to generate these. All of the shapes were created using QGIS, and were all created in the same projection.  (It should be noted that the gridding in the picture shown was just to give an idea of the pixel size I was using.)  from osgeo import ogr from osgeo import gdal  aoi_uri = 'AOI_Raster.tif' aoi_raster = gdal.Open(aoi_uri)  def new_raster_from_base(base, outputURI, format, nodata, datatype):      cols = base.RasterXSize     rows = base.RasterYSize     projection = base.GetProjection()     geotransform = base.GetGeoTransform()     bands = base.RasterCount      driver = gdal.GetDriverByName(format)      new_raster = driver.Create(str(outputURI), cols, rows, bands, datatype)     new_raster.SetProjection(projection)     new_raster.SetGeoTransform(geotransform)      for i in range(bands):         new_raster.GetRasterBand(i + 1).SetNoDataValue(nodata)         new_raster.GetRasterBand(i + 1).Fill(nodata)      return new_raster  shape_uri = 'activity_3.shp' shape_datasource = ogr.Open(shape_uri) shape_layer = shape_datasource.GetLayer()  raster_out = 'new_raster.tif'  raster_dataset = new_raster_from_base(aoi_raster, raster_out, 'GTiff',                                 -1, gdal.GDT_Int32) band = raster_dataset.GetRasterBand(1) nodata = band.GetNoDataValue()  band.Fill(nodata)  gdal.RasterizeLayer(raster_dataset, [1], shape_layer, burn_values=[1])   Is this a bug in GDAL, or is RasterizeLayer burning data based on something other than just the presence or lack of a polygon within a specified pixel area?  The files that I was using can be found . Merge two arrays as key value pairs in PHP Why do circuits work so fast? Drift velocity (explained to me as how fast the electrons are moving) is really slow. My book says the electrons move at around 10 mm/ s.  If electrons move so slowly how do circuits work so fast? If you make a basic circuit with just a light bulb, the bulb lights up almost immediately after you connect the wire to the positive terminal. Total combinations from number of unique combination? How can you find count of the total combinations possible if you have the count of unique combinations? Suppose I need to form a sum of $3$ using $\{1,2\}$ Unique combn. $(1+1+1)$, $(1+2)$ hence '$2$' unique but total is '$3$' i.e, $(1+1+1)$, $(1+2)$, $(2+1)$ I know the elements used to make the combination Note: Number of unique combinations (ie. 2 here) is known. How can I find the total number of combination given the unique combinations? Seeking GeoServer tutorials? What are sources where I can learn how to use GeoServer?  I know of these two sites:    - which in fact is not working (at least at the moment)  - not only (tutorials) for GeoServer   But I am interested in more complex information, and not to read only documentation. Finding the value of $\int_0^{\pi/2} \frac{dt}{1+(\tan(x))^{\sqrt{2}}}$ The problem: Find the value of $\displaystyle\int_0^{\pi/2} \frac{dx}{1+(\tan(x))^{\sqrt{2}}}$   I tried a few different substitutions and the closest I got to an okay looking integral is $$\int_0^\infty \frac{t^2 \, dt}{t^{1/\sqrt{2}}(1+\sqrt{t})},$$ which still looks scary. How do I approach this integral? How do you create grass? Let $a,b,c\in\mathbb{R}$ such that $\sqrt{a^2+b^2}=1&lt;c$.  Find $I:=\int_{0}^{2\pi} \frac{1}{a\cos(t)+b\sin(t)+c}dt$.  So, I set $z=e^{it}$ and then $dz=ie^{it}dt$ and so $\frac{dz}{iz}=dt$. Therefore,  $\begin{align*} I &amp; =\frac{1}{i}\int_{|z|=1} \frac{dz/z}{a\cdot\frac{z+z^{-1}}{2}+b\cdot\frac{z-z^{-1}}{2i}+c} \newline &amp;=\frac{2}{i}\int_{|z|=1} \frac{dz}{a\cdot(z^2+1)-ib\cdot(z^2-1)+2cz} \newline &amp;=\frac{2}{i}\int_{|z|=1} \frac{dz}{(a-ib)z^2+2cz+a+ib}\newline &amp;= \frac{2}{i}\int_{|z|=1} \frac{dz}{(z-z_+)(z-z_-)}\end{align*}$  Where $z_{\pm}=\frac{-2c\ \pm\ \sqrt{4c^2-4(a+ib)(a-ib)}}{2(a-ib)}=\frac{-c\ \pm\ \sqrt{c^2-(a^2+b^2)}}{(a-ib)}=\frac{-c\ \pm\ \sqrt{c^2-1}}{(a-ib)}$.  Therefore, if we define $f(z)=\frac{1}{z-z_-}$, we get that $f$ is analytic in $\{z:|z|\leq 1\}$ since  $$|z_-|=\Bigg|\frac{-c-\sqrt{c^2-1}}{a-ib}\Bigg|=\bigg|c+\sqrt{c^2-1}\bigg|&gt;|c|&gt;1$$  Finally from Cauchy's Integral Formula:  $$I=\frac{2}{i}\cdot 2\pi i\cdot f(z_+)=4\pi \frac{1}{z_+-z_-}=\frac{2\pi(a-ib)}{\sqrt{c^2-1}}$$ Which is not always real... So my question is what is the problem.  Moreover, sometimes it is correct, e.g. $a=1,b=0,c=2$ gives the correct answer $\frac{2\pi}{\sqrt{3}}$. When you earn one tag badge, and then don't click "Track the next one" in the tag badge progress tracking box for a while, and then earn a second tag badge, that box continues to show "Congratulations, you earned [the same badge as before]", rather than updating to show that you've actually earned another tag badge since then.  For instance, right now  looks like this:    Even though I  a few weeks ago and then  yesterday, my profile hasn't updated to show the new achievement.  I also didn't get the "cipher" tag badge until after the 3am watershed, even though tag badges usually appear as soon as I visit my profile after earning them (for instance, I earned the "tags" tag badge on meta.SFF.SE today the very instant I clicked on my own profile there after having become eligible for the badge). Even when I went to look at the list of my progress towards different tag badges on Puzzling, which I thought would jog the system into realising I'd actually earned the badge, "cipher" still showed up as 99/100 score even after I'd gone well past 100, until last night when the badge was finally awarded and "cipher" disappeared from my list of badges to track.  TL;DR: if I don't click "Track the next one", my tag badges update slower than they should.  It's a very unimportant bug, but there must be more people than just me who like to see the "Congratulations" thing there for a while and rest on their laurels before moving on to track their progress towards the next milestone. Example of a Subgroup That Is Not Normal Can you kindly provide an example of a subgroup that is not normal?  I have been told many times that, for coset multiplication to be defined, the subgroup must be normal.  I have seen the proof and examples of quotient group multiplications.  Now, I am trying to find out where the process will break down if the subgroup is not normal.  Suppose that $x \in a_1H = a_2H, y \in b_1H = b_2H$, where $H$ is not normal. So $x = a_1h_1 = a_2h_2$ for some $h_1, h_2 \in H$, and $y = b_1h_1^* = b_2h_2^*$ for some $h_1, h_2 \in H$.  $xy = (a_1b_1)(h_1h_1^*) = (a_2b_2)(h_2h_2^*)$.  However, both $h_1h_1^*, h_2h_2^*$ are still elements of $H$.  So I don't see how $a_1b_1H \neq a_2b_2H$. How long can a flag remain active? I have flagged the following question as a duplicate.    Now I want to know: after how long time will it be stated as active?  I do not have problem with anything here. I just want to know after how long time the request (of a duplicate question) will automatically be rejected or approved.  OK, I got the things, so it will remain active until moderators will have a look at it...  But don't you think we should have a limit that after a certain number of days this kind of request will be dropped (or cancelled)? Change rep required to downvote on MSE Why does .NET use banker's rounding as default? According to the documentation, the  method uses a round-to-even algorithm which is not common for most applications. So I always end up writing a custom function to do the more natural round-half-up algorithm:  public static decimal RoundHalfUp(this decimal d, int decimals) {     if (decimals &lt; 0)     {         throw new ArgumentException("The decimals must be non-negative",              "decimals");     }      decimal multiplier = (decimal)Math.Pow(10, decimals);     decimal number = d * multiplier;      if (decimal.Truncate(number) &lt; number)     {         number += 0.5m;     }     return decimal.Round(number) / multiplier; }   Does anybody know the reason behind this framework design decision?  Is there any built-in implementation of the round-half-up algorithm into the framework? Or maybe some unmanaged Windows API?  It could be misleading for beginners that simply write decimal.Round(2.5m, 0) expecting 3 as a result but getting 2 instead. Given the following components  DECLARE @D DATE = '2013-10-13' DECLARE @T TIME(7) = '23:59:59.9999999'   What is the best way of combining them to produce a DATETIME2(7) result with value '2013-10-13 23:59:59.9999999'?  Some things which don't work are listed below.    SELECT @D + @T       Operand data type date is invalid for add operator.     SELECT CAST(@D AS DATETIME2(7)) + @T       Operand data type datetime2 is invalid for add operator.     SELECT DATEADD(NANOSECOND,DATEDIFF(NANOSECOND,CAST('00:00:00.0000000' AS TIME),@T),@D)      The datediff function resulted in an overflow. The number of dateparts   separating two date/time instances is too large. Try to use datediff   with a less precise datepart.   * The overflow can be avoided in Azure SQL Database and SQL Server 2016, using .    SELECT CAST(@D AS DATETIME) + @T       The data types datetime and time are incompatible in the add operator.     SELECT CAST(@D AS DATETIME) + CAST(@T AS DATETIME)      Returns a result but loses precision 2013-10-13 23:59:59.997 For natural numbers $a$ and $b$, show that $a \Bbb Z + b \Bbb Z = \gcd(a, b)\Bbb Z $ For natural numbers $a$ and $b$, show that $a \Bbb Z + b \Bbb Z = \gcd(a, b)\Bbb Z $  I just basically said that the gcd of a and b { written as C } obviously divides aZ and bZ, therefore it can be rewritten as  CdZ + CeZ -> C[dZ + eZ] -> CZ[d+e] where Cd=a and Ce=b.   if a and b and C are natural numbers, then  so are d and e. the sum of d and e is an integer, that when multiplied by an integer produces an integer. therefore  CZ[d+e] = CZ, so aZ + bZ = GCD(a,b)Z  { Where C is the gcd(a,b) } How to prove that you have significant ties with family in your home country? How can I prove the immigrant officers that I have significant ties in my home country?  Are there any documents that I need? I've been reading a lot about the oxidative dissimilation etc, and often I see different sources use NADH and NADH2 in the same reactions. One source uses NADH and another uses NADH2 in the exact same way. Is there a difference or is it just a different name for the same substance?