Remotely disable saved cookies/logins on gmail?

Question: I just left my job (yay! freedom! money is for suckers) and realized I forgot to clear cookies on my PC. I can call an (ex) coworker and have them do it maybe, but I'd feel safter if it could be turned off somewhere in officially. Is there a way to make it so that the cookies on that computer no longer allow login to Google services? Reddit might be nice, too.
Answer: As pointed out in this Web Applications Stack Exchange answer, you can change your Google Account & Reddit passwords to prevent any one else from accessing your accounts from your former office PC.
Answer: On a computer (and not mobile device), log into gmail. Once inside, scroll down to the bottom of the page and on the right-hand corner you'll see "Last account activity" and below it the word "Details." Click details and a window will pop up with a tab that says "sign out all other sessions" click that and your done signing out of every location you may be logged in.
Answer: you can also view your current logged in device from here:
https://security.google.com/settings/security/activity
=)


How to know which pages/sites are most used (hit count) for a web application?

Question: How to get view count and most visited sites at a web application level as a whole in SharePoint on premises.
Other than Popularity Trends is there any other way to achieve this?
Answer: You should get to know about Google Analytics, Google Analytics is a web analytics service provided by Google and the most interesting part is, it is a freeware. It can be used to track and report the website traffic.
You may get lots of blogs regarding Google Analytics for SharePoint. Listed few below,
https://www.harepoint.com/Articles/GoogleAnalyticsSharePoint.aspx
https://zimmergren.net/integrating-the-google-analytics-api-in-sharepoint-in-order-to-enable-users-to-review-analytics-data-directly/
http://www.letsharepoint.com/how-to-enable-google-analytics-in-sharepoint-2013-office-365/
Answer: "Use Google Analytics" is the easy answer to this question.  However...over the past few years Google Analytics has morphed into more of an advertising tracking solution than a web analytics solution, which means it isn't a good choice for SharePoint Intranets.  Plus, GA's Terms of Service doesn't allow you to store usernames in the reports.
http://www.analyticsmarket.com/blog/sharepoint-and-google-analytics
SharePoint sits on top of IIS, and the IIS web logs contain the information you're looking for. Just find a way to process the IIS logs, and you'll be all set.


Does Haste make attacking a must?

Question: When I play a card with haste, do I have to attack or use an ability, or can I just play it without attacking?
Answer: No, haste gives you the choice to attack or activate abilities with the tap (or untap) symbol in the cost, but does not create a requirement. If a creature is required to attack it will be explicitly spelled out like with Juggernaut. (As far as I know there are no cards that require you to activate an ability)

702.10b If a creature has haste, it can attack even if it hasn't been controlled by its controller continuously since his or her most recent turn began.
702.10c If a creature has haste, its controller can activate its activated abilities whose cost includes the tap symbol or the untap symbol even if that creature hasn't been controlled by that player continuously since his or her most recent turn began.
Answer: No, having haste doesn't mean the creature has to attack.  Especially if you cast your creature during the second main phase: it couldn't attack that turn, period.
Haste has other benefits than attacking the same turn, like activating tap abilities.  Mad Prophet can use its ability the turn it comes into play, unlike other looters (e.g. Reckless Scholar).
Comment: If you cast a creature with haste in the second main phase, it can attack that turn if there's a another combat phase. Not too common, but there are  several cards that initiate a second combat phase, like Aggravated Assault.

Does Haste make attacking a must?


Solar Eclipse Viewing

Question: I know it is not safe when viewing a solar eclipse to look directly at the sun. I know you can purchase solar eclipse glasses online but how do you make your own solar eclipse glasses that are safe to use for solar eclipse viewing (and let us throw in the transit of Venus)?
Comment: Most of Astro.SE was migrated here, and this is the right place to ask in the post-Astro.SE era. However, I don't know how many of the regulars from astro are visiting this site consistently.
Comment: Shopping recommendation are off-topic for the site, so I stripped out the last sentence. I don't know how much expertise we have, but the rest is a good question.
Comment: @dmckee - That is fine, I would of asked this on the Astronomy SE Site but unfortunately that was shut down, hope someone can help here. =>
Answer: Making your own eyewear for direct viewing of the sun is probably not too practical. You essentially need a filter that blocks well over 99% of the incoming light. You can use #14 or #16 welder's goggles for this, or obtain specialized filters designed for this purpose. These filters are a glass substrate with a metal deposition layer on them that is designed to transmit only a small fraction of the light.
As an alternative to direct viewing, it is much easier to make a system for projection viewing of the sun. In this case, you would create a projected image of the sun on a surface, and observe the image. You can look up "solar pinhole viewer" or check out these instructions for details on how to put together a simple solar viewing system with stuff you may have around the house (cardboard, paper and aluminum foil): http://www.exploratorium.edu/eclipse/how.html
For more on observing the sun, see this article:
http://www.skyandtelescope.com/observing/objects/sun/Viewing_the_Sun_Safely.html
Comment: @anna: I cut a hole in the end of a shoebox and stretched aluminium foil across it so I could make a set of holes in graded sizes (to optimize the focus/light tradeoff) and projected on a sheet of paper at the other end.
Comment: A pinhole device is what I used for the partial (total in parts of Mexico) eclipse visible in the south western US in the 90's. Cheep, easy and effective.
Comment: @dmckee you mean watching the image from a pinhole on an A4 paper? That is what I have used anyway. When I was a child my mother blackened well a piece of glass with soot from a candle.So well you can see nothing through it. The sun shows up. It is also interesting to watch the shadows, particularly of leaves as the eclipse progresses.
Answer: I don't think I would recommend any of the traditional ways of making them - it's too easy to make a mistake and hurt your eyes.
The best way to view an eclipse is with a pinhole camera use telescopes/binoculars to project the image onto a wall.
If you want to look at it directly a piece of welding glass (the screen from a welding mask) is probably the cheapest easiest safest way - you should be able to get it from a car parts / machine store.
edit - just for the lawyers: Welding glass for electric arc welders strongly blocks UV, the wavelengths you have to worry about. Older gas welding masks might not have good UV blocking.
Answer: If you have a camera on your phone point it at the sun and look at the screen. any camera with a screen will do. this way you can take pictures too
Comment: How sure are you that this won't damage your camera?
Comment: Don't use your camera phone. Yes, it would work for viewing. But it would probably damage the image sensor since it doesn't have the correct lens.

Solar Eclipse Viewing


When generating html, do you including formatting such as newlines and tabs?

Question: Sometimes I add a \n at the end, and the relevant number of \t the beginning, and sometimes not - what's the recommended way to do this?
Answer: It depends whether you want the HTML to be human readable or not. In most cases however, I would suggest that generated markup should always be human-readable, as it makes debugging a whole lot easier.
Answer: I always include \n's. The reason is simple: sometimes stuff doesn't work and I want to be able to read the generated HTML to help find the problem.
Answer: It depends on how often you are going to have to manually debug the HTML.  If you will need to look at it yourself, rather than just browsers, then some basic formatting will make life a lot easier.  If you are confident you'll never need to look at it (as most people seem to be), then you don't need to.  I tend to do basic formatting with basic indentation - but I'm not an optimist in such matters (and I've had to look at the stuff more than once, and been grateful that I've done the basic formatting).
Answer: Though I do out of habit, there's no need to at all when you've got something like Firebug which shows you the HTML tree all nice and pretty. (Though it does show you the generated HTML, rather than the raw HTML...)
Answer: I personally include such characters as it makes the initial debugging much easier, albeit at the cost of a little extra code for you. If having humans be able to read it later is a goal feel free. Another thing to keep in mind is that most developer tools probably have the ability to format the HTML for readability.
Try to consider who you are writing the code for yourself right now, other developers to maintain in the future or the person looking at the html (who likely does not care about formatting).
Good luck.
Answer: I generally find new lines more important than indentation.  If my goal is readability during debugging, that's usually enough to be able to read the code effectively.  If my goal is output that someone else is going to read, I sometimes try to add a little more style to it.
Answer: I tend to use Firebug when debugging which auto formats HTML and CSS anyway, so I don't bother. I have written tools to create neat tabbed HTML however.
Answer: I personally include the HTML formatting (tabs/new lines) when I'm doing HTML only, but when I have a loop or generally generating HTML with a script (PHP) I usually don't worry about the HTML formatting. I do sometimes when I'd end up wtih such a massive amount of HTML it'd be unreadable.
To me the most important part is speed--in "properly" formatted HTML, the spaces and new lines can be 25% of the file size. One of the reasons JavaScript is so often minimized.


How can I find out the power usage of one Acces Point with OpenWRT?

Question: I have one Yuncore AP with OpenWRT connected via PoE to a switch. I can get the power and current usage consulting Power Status table in the switch, but I need obtain these values on the AP side, and I couldn't find a way to get them in OpenWRT.
Answer: In general it is unlikely this information will be available from the client side.

The client hardware (POE injector stuff, even if integrated into the device) is usually not sophisticated, and won't have telemetry.

The client hardware can't measure line losses, which may be a significant amount of power depending on the length of the cable, power draw, and voltage. Even if it did have a number, it wouldn't be very accurate.


Thermal Conduction through 1D rod having non-uniform cross sectional area

Question: I recently came across the formula $Q=kA(T_2-T_1 )t/l$. I have a question regarding the interpretation of the formula.
1.)Does Q refer to the amount of heat that flows through a cross sectional area A, of a conductor in the steady state, having length $l$, having temperatures of $T_2$ and $T_1$ at its ends, in a time interval of $t$?
2.)Thus, if I have a conductor having non-uniform cross sectional area, and I want to find out the amount of heat that flows through a particular cross sectional area $A_1$, will I be able to use the formula?
$Q=kA_1(T_2-T_1)t/l$.
3.)I am basically asking whether A refers to the cross sectional area of a uniform conductor or any particular cross sectional area of a non-uniform conductor.
I am in class 11, so please avoid any complicated answers. Thanks in advance!! Please answer each part of the question individually
Answer: The formula you stated is only valid when the system is in steady state and the conductor has uniform cross-sectional area. If the area changes, then you will have to use integration to calculate $k$ for the whole body.


Does Mauritania require a visa for children travelling with their parents?

Question: Does Mauritania require a visa for children travelling with their parents?
Does it matter if the children have separate passports? Does it matter if the children are registered in their parents' passport?
Comment: How old are the children?
Answer: The Islamic Republic of Mauritania makes no apparent exclusions to its comprehensive visa policy, per its London Embassy visa information:

Please note that all types of visas for all nationalities are now obtainable on arrival at Nouakchott airport and at the border.
Visitors need to ensure they comply with the following requirements:

Passports must be valid for at least 6 months.
Invitation letter for business travellers.
Hotel booking and or letter from Mauritanian host.

The page also lists visa fees, according to country of origin and length of stay.
As not all of its 34 embassies and 25 consulates have email contact, you may want to send an enquiry to London email@example.com for clarification in advance of travels.


Server SSLv2 enabled on non-webservers

Question: Using Nessus I'm scanning our internal network for vulnerabilities and exploits. I've found a large number of instances where SSLv2 is enabled and is as a result, being flagged as a vulnerability.
I understand the limitations of SSLv2 and even the limitations of SSLv3 so I'm quite happy to proceed with disabling SSLv2 on our Windows 2008 R2 boxes.
My question is that if these servers are not web servers and have no reason for clients to attempt to initiate a HTTPS session is it an exploitable vulnerability? Could an attacker still use a 'roll-back' attack and connect with SSLv2?
Answer: SSLv2, enabled on a SSL server, is a potential vulnerability only if all of the following are true:

There is some client who wants to connect to that server and exchange sensitive data through that SSL tunnel.
The client agrees to use SSLv2 too.
The client and server don't implement the version rollback detection system described in RFC 2246, section E.2.

Under all these assumptions, then an attacker may force server and client to use SSLv2 even though both support SSLv3 or more. This in turn may imply some weakness depending on the underlying protocol (the biggest issue with SSLv2 is lack of verified termination, so attackers can force silent truncation, which is a problem if the underlying protocol is not self-terminated).
Given what you say, it is highly improbable that these "SSLv2 support" is a problem in your case.
However, a more interesting question is: what are these servers anyway ? Why would a machine operate a network service, ready to do SSL, if there is no intended client at all ? Why not switching off these unused services ? The issue is not a question of SSLv2 vs SSLv3, but more a question of having network-capable services open for no good reason.
Comment: I completely agree. This is our fundamental issue, we have servers running services which are not required and therefore increasing the potential attack vector - I guess this is a drawback of Windows Server OS's. I wanted to confirm that the threat still exists even though the server is not intended to have HTTPS session and as your bullet points suggest, it's still very possible to exploit the vulnerable protocol. Thanks for your input.

Server SSLv2 enabled on non-webservers


Uniqueness of continuous extension from $A$ to $\overline{A}$ for maps into a Hausdorff space

Question: I want to prove the following.

Let $A$ be a subset of $X$. Let $f:A \to Y$ be continuous. Let $Y$ be Hausdorff. Show that if $f$ can be extended to a continuous function $g:\overline{A}\to Y$, then $g$ is uniquely determined by $f$.

Assume the contrary.$g_{1}$, and $g_{2}$ are the extended $f$. Consider $B=\lbrace x\in\bar{A}\vert g_{1}=g_{2}\rbrace$ which is a subset of $\bar{A}$. Note $g_{1}$ and $g_{2}$ agrees on A due to the restriction mapping. So $A$ is a subset of $B$. Since $g_{1}$ and $g_{2}$ are continous on $\bar{A}$, we have that $B$ is closed. $B$ being closed implies that $B$ contains all of its limit points and it also include those limit points of $A$. So $B=\bar{A}$.
Why I did not use the Hausdorff condition? This seems very wrong to me. I see that Hausdorff may be necessary to argue that $B$ being closed by that it is a point set. How do I see B being a point set?
Comment: To showing $B$ is closed.
Answer: Using Hausdorff to  show $B$ is closed:
$Y$ is a Hausdorff space then the set $D=\{(y,y)\in Y\times Y\ ,\ y\in Y\}$ is closed in $Y\times Y$. Now let $h:\overline{A}\to Y\times Y$ the map defined by $h(x)=(g_1(x),g_2(x))$ it is a continuous map, and $B=h^{-1}(D)$ is closed.
Answer: if $A$ is already closed then there is nothing to prove. so we may suppose that there is a point $a$ in the boundary of $A$ such that $g_1(a) = b_1$ and $g_2(a)=b_2$ where $b_1$ and $b_2$ are distinct points.
since $Y$ is Hausdorff we may choose disjoint open neighbourhoods $V_1$ and $V_2$ of $b_1$ and $b_2$. and we must have:
$$
a \in U = g_1^{-1}(V_1) \cap  g_2^{-1}(V_2)
$$
since $a \in \partial A$ there must be a point $a^* \in A \cap U$
consider $g(a^*)$...
note that a simple counter-example shows the necessity of the Hausdorff condition for Y. take Y to be a two-point space on the set $S=\{x,y\}$ with topology specified by the open sets: $\emptyset, S, \{x\}$
let $A$ be $\mathbb{C}$ with the origin removed. can you see how to construct the counter-=example?


International travel with cockatiel bird

Question: I am travelling internationally from US to middle east as a round trip. Do you know which airlines accept birds in the passenger cabin?
Comment: I'm voting to close this question because it's more suited to Travel SE
Comment: Related, because it explains the guidelines of airplane flights with pets: https://pets.stackexchange.com/questions/26498/rabbits-as-hand-luggage-in-airplane
Answer: Did some research as this wasn't immediately obvious to me.
First, you have to find an airline that will even allow you to do that. There are multiple options but none of the ones I found regularly fly outgoing flights to the U.S other than returning the planes, which you can still board, but that's not the point.
The airline I found was Delta. I know. I just said Delta.
International travel with a pet bird can be complicated and requires careful planning. Depending on the type of bird you have or the destination country, you may need to obtain various permits, certificates, and documents before your trip. You may also need to follow quarantine and health regulations to ensure the safety of your bird and prevent the spread of diseases. Some airlines allow pet birds to travel in the cabin or the cargo hold, but others may not accept them at all. You should contact your airline directly or visit their official website to review their current policies and procedures for flying with birds. You should also check the requirements of your destination country and any stopover countries on your itinerary, as they may differ from the U.S. regulations.
Here are some general tips to help you prepare for your international travel with your pet bird:

Make sure your bird is healthy and fit for travel. Consult your veterinarian and obtain a health certificate and a vaccination record for your bird. You may also need to get a microchip or a leg band for identification purposes.
Obtain the necessary permits and documents for your bird. Depending on the species and origin of your bird, you may need to apply for a CITES permit, a USDA APHIS export permit, a U.S. Fish and Wildlife Service declaration form, and/or an import permit from the destination country. You should also check if your bird needs a passport or a pet travel scheme (PETS) certificate.
Prepare a suitable carrier or crate for your bird. The carrier or crate should be spacious, comfortable, secure, and well-ventilated. It should also have food, water, and toys for your bird. You should label the carrier or crate with your contact information and a "Live Animal" sticker. You should also familiarize your bird with the carrier or crate before the trip.
Plan your travel itinerary carefully. You should avoid traveling during extreme weather conditions, peak seasons, or busy hours. You should also allow enough time for check-in, security, customs, and quarantine procedures. You should also inform the airline staff and the airport authorities that you are traveling with a pet bird and follow their instructions.
Monitor your bird's condition and behavior during and after the trip. You should check on your bird regularly and make sure it is comfortable and calm. You should also look for any signs of stress, illness, or injury and seek veterinary attention if needed. You should also follow the quarantine and health regulations of the destination country and report any problems to the authorities.

I hope this information helps you plan your international travel with your pet bird.
I wish you and your feathery friend a safe and enjoyable trip. I'm heading to Nevada tomorrow, so you're not the only one who's travelling!
Answer: Generally, transporting pets by air is better avoided if at all possible, especially  across national borders due to the quarantine (and possibly protected-species) laws others have mentioned. Since you say this will be a round trip, I would suggest finding someone willing to take care of your bird while you are away from home.


Can Ruby import a .NET dll?

Question: I am interested in using/learning RoR in a project where I have to use a .NET dll. Is Ruby capable of importing a .NET dll?
Answer: While IronRuby will make short work of talking to your .NET dll (it'll be literally no code at all), it was abandoned by microsoft, and it never got a large enough open source community to keep it going after that event. I wouldn't recommend it these days
Regarding the COM solution, this may actually be a good way to go.
You don't need the RubyCOM library - that lets other COM objects call into ruby code. To load COM objects from ruby, you just need the win32ole library, which comes as part of the standard library on windows ruby.
Whether or not you can load the dll from COM will depend if the .NET dll was built to be 'Com Visible'.
The .NET framework defines a ComVisibleAttribute, which can be applied to either an entire assembly, or specific classes within an assembly. If it is set to true for either the whole assembly, or any classes, then the dll will already be callable from COM without any wrapper code.
Here's a test I did.
Create a new .NET dll project (class library). Here's an example class I used:
using System;
using System.IO;

namespace ComLib
{
    public class LogWriter
    {
        public void WriteLine( string line )
        {
            using( var log = new StreamWriter( File.OpenWrite( @"c:\log.file" ) ) )
            {
                log.WriteLine( line );
            }
        }
    }
}

Now, under the visual studio project, there is a directory called Properties which contains AssemblyInfo.cs. In this file, there will be the following
[assembly: ComVisible( false )]

Change the false to true. If you don't want every class in the assembly exposed to COM, then you can leave it set to false in AssemblyInfo.cs and instead put it above each class you want to expose, like this:
[ComVisible( true )]
public class LogWriter ....

Now right click on the dll project itself, and from the popup menu, select 'properties'. In the list of sections, choose Build
Scroll down, and tick the 'Register for COM interop' checkbox. Now when you compile this DLL, visual studio will do the neccessary stuff to load the COM information into the registry. Note if you're on vista you need to run VS as an administrator for this to work.
Now that this is done, recompile your dll, and then create a new ruby file.
In this ruby file, do this:
require 'win32ole'

lib = WIN32OLE.new('[Solution name].ComLib.LogWriter')
lib.WriteLine('calling .net from ruby via COM, hooray!')

Where [Solution name] is to be replaced by the name of the solution you just created (default: "ClassLibrary1")
Ruby that ruby file, and presto! you should see that the text gets written to c:\log.file.
One problem with this solution is that it requires that the .NET dll is already Com Visible, or if it's not, you have the ability to recompile it. If neither of these things are true, then you may have to look at other options.
Good luck!
Comment: Thanks! I'll check the comVisible property of dll to see if I can implement this solution.
Comment: Using above code i am accessing .Net dll code and doing great but i want to know how to close this task... if i want to use this frequently.... if i use same code i frequently means will not run it again ... Is there any way to close /kill object?
Comment: What do you mean by kill the object? The .NET runtime manages the lifetime of COM objects for you. When the garbage collector runs it will check and see if any .NET code is referencing the COM object, and if not, it will clean it up. If .NET code *is* still referencing it, then to clean it up would cause an error.
Comment: I know this is an old question, but checking the box to "Register for COM interop", will that only work on the box on which it was compiled or will I have to register it on the box I intend to use it.
Comment: @OrionEdwards I know it's an old question but this could really save my day, after doing this registration, i created a new ruby file, saved it on my desktop and ruby'd it. i got this error:
`initialize': unknown OLE server:
Any idea on what might i be doing wrong?
Comment: How to register this dll properly?
Answer: You can also write a native -> C# wrapper DLL using managed C++
Export all the functions you want as C calls in the DLL, e.g.
extern "C" __declspec ( dllexport ) void CallManagedMethod() {
   Something^ myManagedObject ...
}

Then use FFI to call that DLL from Ruby
https://github.com/ffi/ffi
Comment: Hi!
I know it's been a while, but:
I've attempted this approach and everything goes smooth until the C++ wrapper DLL references .Net DLL method at runtime. Then I get "Could not load file or assembly" exception regarding .Net DLL. Any ideas why?
(Both DLL's are under the same folder as ruby script which exports and calls C++ function. .Net DLL call works OK if called from the C++ console application from the same folder.)
Comment: I don't know, sorry @VitaliyProkopenko. It worked for me back in 2011. I think that "Could not load file or assembly" can occur for many different reasons and you'll need to turn on extra diagnostic info. Perhaps raise a new question with more details? GL
Comment: Thanks, @Rich. Actually already opened one [here](https://stackoverflow.com/questions/67229089/ruby-ffi-call-of-c-function-fails-at-script-execution-time-when-referencing-me)
Answer: If you want to use 'normal' ruby (since I dont think IronRuby fully runs RoR yet) you might be able to go via COM - ie
"Your Ruby Code" -> RubyCOM -> "COM-Callable Wrappers" -> "Your .NET objects"

RubyCom
That's a bit convoluted though.
Edit: better COM-based option elsewhere in the answers
Answer: Another thing - it might be better to think about it more from a Service-Oriented Architecture point. Can you take that .NET DLL and expose it as a service?
Behind the scenes, you can write Ruby modules in C, so you can always write an interop to do what you need. It will limit your deployment to Windows platforms, though (I haven't tried Ruby->Interop->Mono)
Here's a presentation I gave a couple of years back called Ruby for C# Developers. It's a little dated (It was before John Lam's project got folded into IronRuby), but might help a little.
Comment: Expose the .NET dll as a SOA service is a way to go, but i'll have to check the security issues of doing this.
Answer: If you use IronRuby (Ruby implementation built on .Net) then it should be able to.  If you're already using .Net and want to try out Ruby then you might want to look into IronRuby.
Outside of IronRuby I'm not sure.  I haven't used Ruby myself, so I don't know what kinds of things it's capable of.
Answer: Although it's a dead project AFAIK, you may find the previous RubyCLR project by John Lam (who is now in charge of IronRuby) an interesting one.
Answer: If you are interested in ASP.NET MVC with IronRuby together, You may find yourself to check out this source code from Jimmy - http://github.com/jschementi/ironrubymvc/tree/master
Enjoy!

Can Ruby import a .NET dll?


Novell Client logout with windows logoff

Question: I have a windows 2008 R2 server that's running the Novell Client 2 SP2. I noticed that when I remote in to the system and then logoff of my remote session the Novell client also logs out. Is there a way to prevent the client from logging out as I have scripts running on the server which are expecting to see the proper drives mounted by the Novell client?
Answer: No.
The client is running under your user/security context, and when you logoff, your user context goes away... along anything running in it.
The only solution to this is to not log off.  If you disconnect the remote session, instead of logging off, your sessions, and anything running it, continue to run.
Comment: That's what I figured, is there a way to mount them as a daemon process so that users logging in/out wont cause this problem?
Comment: @LF4 I imagine so... at least in theory, you can have anything run as a system service, without any user context, but it's not trivial to convert an existing application or service into this mode - Domino Server, for example, (as of version 8) still needs to be run under a user context, and if it was easy to do, you'd think IBM would have done it by now.


Wind protection for solar installation

Question: A previous question here was relating wind deflection to drag creation in vehicle solar panel installations. In a residential installation drag is not the issue, but uplift is a critical concern.  Since the efficiency of solar panels is affected by temps there will need to be sufficient spacing above the roof. I'd like to know whether a solid or permeable windbreak could provide useful protection for the panels against damage from hurricane force winds or would it instead increase uplift?
Answer: Regulatory requirements will usually stipulate a mounting that will meet uplift conditions.
Uplift is very approximately proportional to velocity-cubed normal to panel (eg under it facing up - so slower than through flow velocity BUT may be close. Halving peak velocity reduces max uplift by factor of V^3 = 8 times !  So a permeable windbreak can help muchly.
NB: All advice worth what you paid for it (or less).
Check regulations.
Ask an engineer qualified to certify installations in your area.
Drag ~~~~= 0.5 x density x Area x Drag_Coefficient x Velocity^3
Density at sea level = 1.2 kg/m^3.
For A in m^2, V in m/S, g = 9.8 ~= 10
Force in kg ~= 0.06 x A x V^3
Comment: And hopefully :-(  the requirements in hurricane-prone regions were written to withstand said wind speeds.

Wind protection for solar installation


How unsafe is it to ride a bike with this dent in aluminium top tube?

Question: This didn't happen as part of a crash. In fact, I'm not sure what might be the reason. I just looked down and saw this while riding on a sunny day. My bike is always in my room and I live alone. I sit on my top tube from time to time during traffic light waiting. I sometimes descend on top tube. The frame is 23000 KM old. Always by 68-72 KG me. I had crashed before but never hit top tube.
Comment: Possibly duplicating https://bicycles.stackexchange.com/questions/77589/would-it-be-fatally-dangerous-to-ride-with-this-dent-pictures Same brand and model too.
Comment: Keep an eye on it, and don't undertake any transcontinental journeys.  But so long as you're alert for any signs of cracking it should be OK.
Comment: No more supertucking/top tube descending for sure.
Answer: That's pretty bad. No one here can tell you the risk of it actually breaking. What can be said is that it were to ever break, odds are it would happen at some outlier moment of extreme stress on the frame, such as unintentionally hitting a bump on a fast descent. What I would not do is make any assumptions that in any scenario where it broke, you'd get meaningful warning in addition to what you already have.
Canyon has a crash replacement program. The world is more pinched for components than frames right now, so they may even have frames to send. It would be wise to look that direction.
Comment: Signed up for crash replacement program. It is pretty good and so far it seems that you are right about frame availability. Thank you for advice.
Answer: I did not risk it. Like Nathan suggested, I contacted Canyon and described the situation.
They were kind enough to instruct me to not descend on the top tube and offered a crash replacement frame for 30% or 40% of the original price. I had to send the bike to them for maintenance, so the whole process took several weeks. I'm still riding the bike to this day with the new frame. I still descend on the top tube (though much less), and when I do, I try to keep most of my mass on the pedals instead.


How to study the correlation between GAN's input vector and output image

Question: A generative adversarial network (GAN) takes a vector of numbers as input and generates an image, based on the input. Each element of the vector causes some feature of the image to change, but the mapping between input and output is not clear, as often happens in deep learning. What is the best way to study the correlation between the vector elements and the output image features? The first approach that comes to mind is to manually change every element and check the result, however I am not sure that this is the best solution.
Answer: Let me first provide a brief introduction first
GANs as VAEs are generative models which means they learn exactly what you described: to map a typically small dimensional vector/tensor into a higher dimensional one, which in your case is (interpreted as) an image.
These 2 generative models differ in the actual learning strategy which results typically in making GAN outperform VAE in realistic image generation (but it's better not to get into the reasons for this here)
However in principle the Generator Network in GAN works in a similar way to the Decoder Network in VAE so as their output space is interpreted as an image, you can interpret their input space as a sort of semantic space hence the values you are setting define the semantic of the output image (in fact you observe the features change)
It is possible to say the generative model learns a  Semantic to Appearance Mapping hence it works the opposite way of the classifier model which learns an Appearance to Semantic Mapping
Unfortunately as it typically happens in NN this mapping are definitely hard to understand for humans, nevertheless this is an active area of research
So after this introduction, aimed at giving you an essential understanding of the problem, I can suggest you some papers to get into more details like this one
GAN Dissection: Visualizing and Understanding Generative Adversarial Networks
In case you found it not that clear, I'm planning to write a summary of this paper and publish it on my Medium so you could check it there (I'll update this answer or add a comment to notify about it)


Does $\mathbb{E}(|X_t|) = O(t)$ hold for a Lévy process $(X_t)_{t \geq 0}$?

Question: For a Levy process $(X_t)_{t\geq 0}$, we have $\mathbb{E}[X_t]=t\mathbb{E}[X_t^1]$ and $\text{Var}(X_t)=t\text{Var}(X_t^1)$. Does the same hold for the first absolute moment, i.e. does $\mathbb{E}[|X_t|]=O(t)$ hold? Assume there is no continuous part, and that the process has bounded jumps (the absolute moment of the compound Poisson part is O(t)), so:
\begin{align*}
X_t = \lim_{\epsilon\to 0}\int_{\epsilon<x<1,s\leq t}x\bar J(ds,dx)
\end{align*}
where $\bar J(ds,dx)=J(ds,dx)-\nu(dx)ds$ is the compensated jump measure.
Answer: For a symmetric $\alpha$-stable process $(X_t)_{t \geq 0}$, the scaling property $X_t \sim t^{1/\alpha} X_1$ implies
$$\mathbb{E}(|X_t|) = t^{1/\alpha} \mathbb{E}(|X_1|)$$
for any $\alpha>1$. This shows that we cannot expect $\mathbb{E}(|X_t|) = O(t)$ for any Lévy process $(X_t)_{t \geq 0}$. Even if we assume additionally that the process has no drift and diffusion part and that the process has bounded jumps, this is, in general, not true (see the counterexample below). There is the following statement on fractional moments:

Theorem: Let $(X_t)_{t \geq 0}$ be a Lévy process with Lévy triplet $(0,0,\nu)$. Suppose that there exist $\alpha,\beta>0$ such that $$\int_{|y| \leq 1} |y|^{\alpha} \, \nu(dy) <\infty \quad \text{and} \quad \int_{|y|>1} |y|^{\beta} \, \nu(dy)<\infty.$$ Then $$\mathbb{E}(|X_t|^{\kappa}) \leq C t^{\min\{\kappa/\alpha,1\}} \qquad \text{for all $t \leq 1$}$$ where $\kappa \in (0,\beta)$, $\kappa \neq \alpha$.

Roughly speaking, the behaviour of the Lévy measure $\nu$ at $\infty$ gives the existence of (fractional) moments whereas the behaviour of $\nu$ at $0$ determines the asymptotic of the fractional moments (for small $t$).
So, for a Lévy process $(X_t)_{t \geq 0}$ with bounded jumps (without drift and diffusion part), we have $\mathbb{E}(|X_t|) = O(t)$ as $t \to 0$ if $\int_{|y| \leq 1} |y|^{\alpha} \, \nu(dy)<\infty$ for some $\alpha \in (0,1)$.
The following lemma gives an example for a Lévy process with bounded jumps which does not satisfy $\mathbb{E}(|X_t|) = O(t)$.

Example: Let $(X_t)_{t \geq 0}$ be a truncated $\alpha$-stable process for some $\alpha \in (1,2)$, i.e. a Lévy process with Lévy measure $$\nu(dy) = \frac{1}{|y|^{1+\alpha}} 1_{(0,1)}(|y|) \, dy.$$ Then $\mathbb{E}(|X_t|) = O(t)$ does not hold.

Proof: Let $(Y_t)_{t \geq 0}$ be an independent Lévy process with Lévy measure $\frac{1}{|y|^{1+\alpha}} 1_{[1,\infty)}(|y|) \, dy$. Then $Z_t := X_t + Y_t$ defines a symmetric $\alpha$-stable process. By the scaling property, we have
$$\mathbb{E}(|Z_t|) = t^{1/\alpha} \mathbb{E}(|Z_1|).$$
Moreover, by the above theorem, we find
$$\mathbb{E}(|Y_t|) \leq C t$$
for all $t \leq 1$ for some constant $C>0$. Consequently, by the reverse triangle inequality,
$$\begin{align*} \mathbb{E}(|X_t|) &= \mathbb{E}(|Z_t-Y_t|) \geq \mathbb{E}(|Z_t|) - \mathbb{E}(|Y_t|) \\ &\geq t^{1/\alpha} \mathbb{E}(|Z_1|) - C t. \end{align*}$$
As $\alpha>1$ this clearly shows that $\mathbb{E}(|X_t|) = O(t)$ does not hold true for small $t$.
Further reading:

Luschgy, H., Pagés, G.: Moment Estimates for Lévy processes.
Sato: Lévy processes. (General results on moments, e.g. characterization of existence of moments in terms of Lévy triplet.)
Kühn, F.: Existence and Estimates of Moments for Lévy-type Processes. (This article provides moment estimates for a larger class of processes, so-called Lévy-type (or Feller) processes.)


How to find the nearest locations around a given latitude and longitude point?

Question: I have a database of locations. Each location is a latitude and longitude pair. Now for each query, I want to get top "X" nearest locations around a given latitude longitude point. How do I actually calculate the distance between two lat long points and is there any efficient algorithm to do this instead of a simple for loop?
Comment: This is more of a maths question than an engineering one
Comment: quadtree. You want a quadtree. It is a very nice data structure. I suggest to visit https://cs.stackexchange.com .
Comment: The equation can be found via google.
Answer: Your question comes down to a basic math problem.  You have two points in polar coordinates you want to find the distance between.
For simplicity, it is probably acceptable to model the earth as a sphere.  Convert each polar coordinate to cartesian.  Now you subtract them and compute the square root of the sum of the squares of the components.
Note that the above method gives you straight line distance.  If all your "near here" regions are small enough, then that is a valid approximation.  If your distance are large enough so that you want to take the curvature of the earth into account, then you need to find the angle between the two points as seen from the center of the earth.
Find the vectors from the center of the earth to each point, unitize these vectors, then take the dot product.  The angle between the points is the arc-cosine of this dot product.
Beware of precision.  On a computer, you will probably want to use "double precision" for any cartesian components.


Equivalent of mouse hover on a touch screen

Question: On the Samsung Galaxy Note, you can use the S Pen to achieve the equivalent of a mouse hover, even though its on a touch screen device. Does the Surface (or any of the new touch screen windows 8 all-in-ones) have similar capabilities?
Answer: A "long" click seems to work on my Surface - at least on websites.
I place my finger where I want to hover (for example my name at the top of the screen) and hold it there for a couple of seconds. The flyout menu will then appear (along with a another popup as well).
I believe this is really supposed to simulate a "right click", but seems to work for some things - it doesn't let me up vote comments for example.
Comment: This is a pretty bad solution on Microsoft's part. I experienced this today when testing our web application on both iPad's and Windows 8 tablets. iPad handles this every elegantly, but Windows - not so much.
Comment: I guess they thought most would be sold with the Type/Touch covers which come with a track pad :( But yes, it does seem a bit flaky - I guess the iPad handles it "better" because Mac's traditionally haven't had a "right mouse button" option - and so their users wouldn't miss a feature they don't usually have on their single button track pads and mice?
Answer: A hover action is simulated by a long press (tap-and-hold). However, that doesn't seem to work for all of my apps.
Answer: Digitizer pen input has long been supported in Windows. These easily support hovering the cursor. Without a pen, though, the best you have is either use a long press or a touchpad or mouse accessory (like the keyboard cover for the Surface).


How to add another Word document as a section in several and have it live linked

Question: So I can't seem to find the answer, however, I have a handbook, 10 of them, and want the general sections to be managed from master Word Documents. A section on Library for example is identical in all, so I put the information in a word doc called Library, then inset it into my 10 handbooks. When I change the Library.docx file contents, I want all 10 to update with the latest content. Is this possible?
Answer: Not sure if this is the same in all versions, I'm looking now at 2010.
Go to the Insert tab, in the Text group select Object, the Object dialog box opens. Select the Create from File tab, browse for the Library.docx file, and check off the Link to File checkbox and click OK.
Do the same for all your 10 handbooks. Now you can edit the Library workbook and all 10 workbooks will get updated.
Comment: Graeme, is this a satisfied answer? If yes, please mark as accepted. Otherwise, please edit your question to describe what's not working.
Comment: Apologies for delay. Yes that works a treat, just what I was looking for :)


Visa requirements to visit France and the UK for business purposes as a German resident (visa national)

Question: I am Indian nationality and working in Germany. I hold a German Resident Permit card with a valid work permit until end of 2018. My question is related to Visa. If I need to travel to France or UK for the purpose of attending meetings/trainings, do i need to have Visa for travelling to above countries?
Comment: This are two different questions, as there are different rules for France (as part of Schengen) and the UK (which is not part of Schengen.) Both questions have been asked before and have good answers. I vote to close this question because of that.
Answer: For France, you do not need a visa as it is a party to the Schengen agreement. This means, that your German visa / resident permit allows you to visit France freely.
For the UK, you will have to apply for a visa at the UK consulate in Germany.


SSIS Survivorship Nodes

Question: Are there any matching and survivorship nodes in SSIS besides the one offered by Melissa Data? Any implementations in SQL on survivorship would be great as well.
An example on my use case is that given that I have some 2 records of referring to the same customer, I want to come up with a golden record that will combine the demogs available (Example: record 1 has an empty email address, then record 2 has a filled up email address, golden record should return 1 row and the email address captured.)
Answer: The requirement you described is a scenario where DQS - Data Quality Services along SSIS would become a part of your data processing pipeline.
SSIS focuses itself on moving frozen data from point A to point B as fast as possible with no losses. Whilst it does offer capabilities to enrich or correct the data in transit (using canned or 3rd party tools) one should not become obsessed offloading this concern to ETL entirely.
The best place to mutate data is in the Data Lake/Staging zone with audits and logs in place and desirably so the changes are monitored and follow an approval process.

SSIS Survivorship Nodes


Silk screen layer over pad resist cutouts on pcb

Question: I am designing a SMD PCB and have noticed that some component silk screen outlines extend over the pad resist cutouts. Is this acceptable? If the resist cutouts are made after the silkscreen process I can see this working.
Answer: The silk screen is the last step in PCB production. The solder mask is the penultimate step.
If your silk screen is over (or too near) a pad, that should throw an error from your DRC. Most likely the silk-pad spacing in your DRC settings is greater than the solder mask expansion so you should not have the silk screen going over the edge of the solder mask unless it is too close to the pad (or unless you are doing something special on the solder mask layer such as removing it over a large area for some reason).
Keep in mind that the registration of the silk screen layer(s) may not be as good as the other layers so you may wish to set conservative DRC rules for the spacing, lest it end up on a pad and affect the soldering.
If the solder mask cutout is unrelated to a pad, I don't think running it over the edge of the cutout will cause serious problems but it might affect readability if your designators are very small.
Answer: This is usually fine, but it's good practice not to do it. I've never had a problem with this, and it should be an obvious check from the board house. To be totally safe, just move your silkscreen.
Answer: Most board houses will fix this for you, but when you make your gerbers you can fix it yourself by intersecting the appropriate solder mask layer with each silkscreen layer


Principal Component Analysis Singluar value

Question: While studying PCA, I saw this question but not able to solve. Given a data matrix X that is taller than it is wide, prove that every right singular vector of X with singular value s is an eigenvector of the covariance matrix, cov(X), with eigenvalue s2.
Answer: This is a straightforward application of definitions. Write out the right-SVD of $X$ as: $X=U\Sigma V^T$. The covariance matrix is then $XX^T = U(\Sigma\Sigma^T)U^T$. Notice that this is of the form $USU^T$, where $S$ is a square matrix. Moreover, since $\Sigma$ is tall (say, $m\times n$ for $m>n$), then $\Sigma$ breaks into a diagonal $n\times n$ matrix and a $(m-n)\times n$ matrix of zeros. So show that this implies $\Sigma\Sigma^T$ is diagonal. Now you can just read off the eigenvectors and eigenvalues of $XX^T$.


Pre-Roman structures in Northern Europe

Question: Do we have any surviving remnants or written accounts of pre-Roman buildings in Northern Europe?
Comment: Besides Stonehenge and the myriad other "henges"?
Comment: What do you mean by remnants? Remaining buildings or remains of buildings? There are archaeological sites with the foundations of pre-Roman buildings.
Answer: Celtic Culture and oppidum maps of northern europe and the la tene & Hallstad migrations

heat map of the megalithic cultures of europe

Map of megalithic sites in england and northern europe
Answer: There were many hillforts in Northern Europe built by the Celtics, some of which remain today, such as Solsbury Hill. Numerous Viking ring fortresses also exist, including Aggersborg.
Of course, there is also Stonehenge in Salisbury, and in Ireland Newgrange and the fortress Dun Aonghasa. Hope this helps.

Pre-Roman structures in Northern Europe


Clustering data with outliers without ignoring them

Question: I have 2 dimensional data about customer churn,i
Clustered them with k-means but because of
Outliers the clusters are not homogeneous.actually
Outliers are about customers which are  very important , so i can not ignore them,i used SOM method  too,but again it didn't work.please help me with this.
Comment: Maybe k-means is not the suitable solution for you? It sounds to me as if you are not trying to generalize. If you are, maybe you can assign weights to certain more impotent data and apply a weighted k- means. In any case, more details on your final goal and a biger picture of the problem may help to better answer your question.
Comment: The goal of k-means, as an unsupervised machine learning method, is to generalize. In other words, it aims to learn the distribution of your data and generalize to new cases. This in turn means two things. First, you cant care about a single point which does not represent the whole data distribution. Second, you wish for the system to classify correctly for new cases, not the data you learned from. What you are trying to do is called over fitting in the generalization world.
Comment: Do you have the header for your data? Imbalance in your features also matters but you are overfitting as previously was pointed out here.
Answer: A solution can be apply clustering without outliers, and then if it is needed, apply new clustering method on the set of outliers.
Finally, you can unify the clusters of the method with each other as the final solution.


Any open source or free Web Twain Scanner

Question: I already searching for some web twain sdk, but i cant afford the price. Is there really any open source or free web twain sdk that can access scanner from web api or javascript?
Answer: Have a look at Dynamic-Web-TWAIN

"a cross-platform scanning SDK designed for web document management
applications. With just a few lines of JavaScript code, you can
develop robust web applications to scan documents, edit images and
save them to file systems".

This is the only one I have come across. You can also search for more on github.
Comment: I am also searching for a good / affordably price solution. The above option is very expensive for me: +- 3000$ per server.
Answer: I've found someone suggesting this...:
Yes, there is an application that enables scanning on the remote machine. When someone opens the browser a connection between the web browser and that local machine application is established...
Please try this: ScanAppForWeb
Comment: At the moment, this looks spammy.  You should really declare if you have an affiliation to the site.


Are there some original papers or books related to applications of algebraic topology and algebraic geometry in complex dynamic systems

Question: Recently I have much interest in algebraic topology and algebraic geometry. I am a student of the field of complex dynamical systems. According to my knowledge, my friends told me that there are many applications of algebraic geometry and algebraic topology in reduction of dimension in statistics and some other fields. I want to know whether there exist some interesting applications of algebraic geometry and algebraic topology in dynamical systems. Any comments and advice will be appreciated. Thanks.
Comment: algebraic geometry and dynamical systems brings to mind the name of Christopher Byrnes to me.
Answer: The first application of algebraic geometry to dynamical systems that comes to my mind is the following preprint of Gromov -- very old one : ON THE ENTROPY OF HOLOMORPHIC MAPS
https://www.ihes.fr/~gromov/wp-content/uploads/2018/08/1024.pdf
A recent, excellent survey of dynamics on algebraic surfaces is :
http://perso.univ-rennes1.fr/serge.cantat/Articles/dyn-aut.pdf
Answer: Densely scattered around the boundary of the Mandelbrot set $M$ you can find a miriad of tiny "Babybrots". We know that they are quasi-conformally isomorphic copies of $M$; that is to say, they are deformed, but not to wildly. Still, it is VERY surprising that they are visually recognizable. All the gray regions below seem to be bounded by circles and cardioids:

(source: yahoo.co.jp)
Surprise, surprise! The largest interior component of $M$ is indeed bounded by a cardioid, and the large disk to its left is truly round. But all other components are bounded by real algebraic curves of high degree, and are no longer true cardioids and circles:

The paper A Parameterization of the Period 3 Hyperbolic Components of the Mandelbrot Set by D. Giarrusso and Y. Fisher studies these boundaries as algebraic curves, and shows how to construct explicit parametrizations in the cases of period 1 (The Cardioid $C$), period 2 (The Disk), and period 3 (the two largest "disks" above and below $C$, plus the tiny "cardioid" visible in the middle of the left antenna).
Answer: One place where papers on applications of algebraic topology — to dynamical systems as well as to statistics, data analysis, bio-medicine, computational geometry and other areas — gets aggregated is on the webpage of the Computational Topology group at Stanford. This page has a running listing of relevant preprints and papers that may form a good starting point for you.
Comment: Thanks for your advice, last year a professor in Chern's institue have given a report about algebraic geometry's applications in dimension reuduction's about the accuracy test of Fisher's table test, which give me deep and powerful impression.
Comment: The link is now redirected to http://appliedtopology.org/ with preprints listed at https://appliedtopology.org/preprints/.
Answer: The emerging field of arithmetic dynamics has seen a lot of attention lately, and it is very intimately connected to algebraic geometry (and, to a lesser degree, algebraic topology as well). I think you would enjoy reading Silverman's ``The Arithmetic of Dynamical Systems''.
Comment: Perhaps Algebraic Dynamics and Arithmetic Dynamics are more applications of Dynamical Systems methods in Algebraic Geometry and not vice versa?
Answer: Another good place to start is to track the output of Marion Mrozek and Konstantin Mischaikow, and their various co-authors. There is a whole group at the University in Krakow centered on Mrozek doing algebraic topology applications to dynamical systems.
Comment: I wanted to mention Konstantin's group at Rutgers (previously) at Georgia Tech which does essentially computational homology theory with applications to dynamical systems but only after I mention the the God Father, the late Charles Conley former professor at the University of Wisconsin and the Ph.D. thesis advisor of Konstantin Mischaikow. His survey paper on now famous Conley's Index theory should be the first read for anybody interested in involving heavy
algebraic topology in dynamical systems.
Comment: Also Rick Mockel (another former Ph.D. student of Charles Conley) and his students have found many interesting applications of Algebraic Topology in Celestial Mechanic. One of Conley's students (Kris MeCoord) wrote a bunch of celestial mechanics papers with Ken Mayer and my advisor Qiudong Wang at the University of Cincinnati
using nothing but Algebraic Topology techniques.
Comment: I think there is a typo in one of the names: it should be Mari*a*n instead of Marion.
Comment: See also the 2004 book, [Computational Homology](https://www.springer.com/gp/book/9780387408538) by Kaczynski, Mischaikow and Mrozek.
Answer: Methods from arithmetic algebraic work have been used in the work of Christoph Deninger on dynamical systems. References can be found on the arXiv at Cornell, for example the papers
"Number theory and dynamical systems on foliated spaces" (math/0204110, published in Jber. d. Dt. Math.-Verein. 103 (2001), 79-100), and his ICM contribution "Some analogies between number theory and dynamical systems" (Doc. Math. J. DMV, Extra Volume ICM I, 1998, 23-46). More recent papers concerning dynamical systems can be found on Deninger's website.
Answer: I think this expository article: Algebraic Dynamics, Canonical Heights and Arakelov Geometry of Xinyi Yuan is useful.
Comment: While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference.  Link-only answers can become invalid if the linked page changes.
Comment: @Alex Degtyarev :Thanks for your guidance.
Answer: You should look at the papers of Rafal Komendarczyk, and references therein (just look for his last name in google scholar).
Comment: In case it saves someone else a bit of effort, here's a link to this person's google scholar: https://scholar.google.com/citations?user=ao4xCvYAAAAJ&hl=en&oi=sra With dozens of papers, more context in this answer would have been nice, but I think the site norms were different back in 2011.


How to explain OOP concepts to a non technical person?

Question: I often try to avoid telling people I'm a programmer because most of the time I end up explaining to them what that really means. When I tell them I'm programming in Java they often ask general questions about the language and how it differs from x and y. I'm also not good at explaining things because 1) I don't have that much experience in the field and 2) I really hate explaining things to non-technical people.
They say that you truly understand things once you explain them to someone else, in this case how would you explain OOP terminology and concepts to a non technical person?
Comment: I've seen this same question nearly word for word a few times now.
Comment: @Michael can you post a few links ?
Comment: Related or duplicated: http://programmers.stackexchange.com/questions/4123/whats-the-best-way-to-really-understand-oop
Comment: Can someone with access add this as community wiki ? Thanks.
Comment: To understand Design Patterns (and so OOP) look at http://shop.oreilly.com/product/9780596007126.do the most intuitive book about it
Comment: Jurassic Park (the novel) is notable for having gotten this completely wrong. (TL:DR summary: it confuses objects with link libraries).
Comment: Note: Sometimes "I don't know" is the right answer.
Answer: I generally try and describe Object-Orientated-Programming by using real world examples.
For example, I might say that a class called Vehicle describes the minimum things that a vehicle is.  I'll ask the person to tell me what he or she thinks a vehicle is.  Sometimes they say things like "Well, like a car or a truck", and I'll nod and agree with them.  Then I'll ask what the differences are between a car and a truck.  Sometimes they mention size, sometimes the purpose, and other things.
Then I'll ask them to forget about a car, or a truck and just ask them to continue to describe a vehicle:
"Oh, well it moves"
"It has an operator, or a driver"
etc...
Soon, we know what a Vehicle is and I said that in OOP we would define a vehicle, and for the sake of argument say it can move, and give it a driver of sorts.  Then I'll ask, ok, so what does a Car have?
"Doors"
"Windows"
And then a truck....
"Doors"
"windows"
"More Wheels!"
Soon, after lots of discussion, the other person generally has identified:
1) What constitutes a vehicle
2) What constitutes a car
3) What constitutes a truck
4) What constitutes an aeroplane.
All without any technicalities.  We've divided up the properties of each in to the right areas.  They understand inheritance ("Yeah, a car is a vehicle, a truck is a vehicle, but a car is not a truck, it's SIMPLE, duh!").
They even understand polymorphism, "Sure, they basically do the same, but that might do it slightly different.".  We can talk about behavior and where that should live in our tree of objects.
Depending on their education and background, some get it faster than others.  But when I compare OOP to real-life objects, most people always get it.  In fact, I have found in conversations with non-technical people things I had never thought of.  Vehicles don't have to be manned, for example (drones), but would a programmer have thought of the operator of the vehicle as a property of it?  I am not saying it is right or wrong to have an operator mentioned, but it causes us to think about what we are modelling and what we are trying to achieve when we develop software.
Now, partial template specialization,  on the other hand....   :)
Comment: LOL +1 for a good answer, but I wish I could give you another for partial template specialization! I tend to use animal analogies, since inheritance is more natural in that context. Hell, you can even explain multiple (dual) inheritance that way!
Comment: Everybody uses cars as examples. That's why it's really depressing to work in a codebase that seems OOP-clueless that deals in cars.
Answer: Objects are nouns, methods are verbs.
Comment: Scarily enough, I have to explain this to programmers rather frequently.
Comment: Not always. For example: I object to your method. ;)
Comment: In JavaScript methods are also functions, properties, nouns, AND verbs.
Answer: Here is some version of my canned answer that I give to the ultra non-technical person:
Programming is an attempt to create a representation of reality on the computer.  There's a lot of tools and devices that exist that do this already -- think about how a spreadsheet makes it easier for us to represent accounting or statistics, or how a Powerpoint presentation allows us to store and display our presentations.
Sometimes we need to build custom representations of reality into new or existing applications that reflect our business processes.  There's lots of ways to program, and one of the most common ways to program is object oriented programming, where the code we build is specifically designed to replicate the concepts of reality.  The "things" in reality have attributes and behaviors.  For instance, a human being often has arms and legs, hair color, ethnicity, and can often Speak and Walk.
Speaking and Walking can come in different varieties, such as what language one is speaking, or the speed or manner at which one is walking.
Human Beings often have interactions with other types of "things," whether they be animals, other humans, other living organisms, or inanimate objects.  There are themes in reality that often need a way to be represented, such as interactions between "things," categorization of things, etc.  Consider business processes that go on in our organization.  There exists very complicated "business logic" that needs to get represented in the software that our organization uses.
Object Oriented programming provides a means to accurately represent these "real world concepts" and "business logic".
--> This statement is usually sufficient to stave off their curiosity (or perhaps bores them to tears), but if they have more questions, the above statement (I believe) lays a decent foundation for where the conversation can go.  I don't really think that the non-technical person is concerned too much with technical terminology such as "Abstraction," "Composition," "Polymorphism," etc, but if they are, the language I used in the canned statement allows me to pull examples based on it.
Answer: I always learnt OOP like this:
You have a clock, and it tells the time - well, in programming you put all the code and stuff you have to do all together (sounds pretty obvious, but people didn't used to do this way back in the early days). Anyway, that's called encapsulation.
Now you've got a clock thing, you might want an alarm clock - well, once you've got all the stuff together you can add things to it to make it do more - like set the alarm and make it ring. This is called inheritance.
Also, you look at the clock I have on my wrist, but you can other clocks that look different like a grandfather clock or a digital clock. It appears different, but it's still a clock - well, that's called polymorphism.
And there you have the 3 corners of object-oriented programming. All the rest is just coding.
Answer: I talked about a conversation I had with my wife about this very thing, in this answer here:
https://softwareengineering.stackexchange.com/questions/45464/how-to-convince-non-programmer-his-notions-about-computers-are-wrong/45467#45467
EDIT: The question I answered there got moderated away, so I'll reprise my answer here.
Sitting in a restaurant with my wife, she asked me "What does Object Oriented mean?"
I started bloviating about code reuse and encapsulation and polymorphism, and at some point I realized her eyes were terminally glazed over.
So I grabbed a Splenda packet out of the container. I said, "Here's an object. What are its properties?"
She said, "It's rectangular, it's made of paper, it contains splenda, it's blue, it has printing on it."
I picked up a sugar packet. "What does it have in common with this one?"
She said, "The rectangularness, the paper, that there is printing."
I said, "What about that they both contain something sweet?"
She said, "Sure."
I said, "So these are both instances of what we might call an abstract sweetener packet. A platonic ideal sweetener packet, if you like."
She said, "Sure."
I said, "And each one has properties inherited from the abstract packet, and then variations on that that are specific to its type of thing."
She said, "Right. Oh! And if I wanted to make, like, a Saccharine packet, I'd take the generic one, and set the details about it for the Saccharine, and then I'd have that!"
I said, "Bingo: Object Oriented Programming."
You and I know she just intuited her way to the Factory design pattern. Whatever. It illustrates inheritance, encapsulation, object class identity... Good stuff.
Comment: Drat.  Linked answer removed due to "reasons of moderation."  How ambiguously unhelpful! :-(
Comment: @OgrePsalm33 - Roughly reprised my answer.
Answer: I'd just tell them to sign up for a course in OOP if they really want to understand it.
I mean, all those analogies like Car.startEngine(); are, let's face it - pure rap. When I was first into OOP many years ago, I found these to only abstract the domain even further.
Instead of just explaining that OOP is about managing complexity of procedural languages, almost 80% of programming book authors assume that programmers are clueless idiots who need to be spoken in simple (see the irony here?) terms.
Yes, it's perfectly normal to go with explaining Lists and Vectors, because that's what we mostly work with, not Car.Engine and PoliceMan.Arrest (unless you are a game dev, but then again, you still must have had your share of the former).
Back to the topic, I would just tell them, I create untangible objects that exist purely in the programmer's mind, for the purpose of payroll processing/game play/space shuttle navigation, etc.
If they still have questions, stop discussing, because it ain't worth it. Most people fail at imagining abstract notions and need examples for just about everything (which means more simplification/specialization of the actual topic, really).
Comment: +1 OO was invented at Xerox SPARC precisely because they thought `Car.startEngine()` stuff would make programming simple for all and easy to intuit for the non-programmer or beginner. Well clearly that didn't work out at all...
Answer: This question seems a candidate for being closed, nevertheless...
Like most things, OOP is actually very simple to explain at a conceptual level. Programmers model objects; and:

objects have state (fields/data members)
objects have actions (methods/functions)
objects build upon each other (inheritance)

These are hundreds of finer details, sure. But if you're just trying to give someone the 10-second overview, I think that's a good start. Are there more specifics concepts you're having trouble explaining?
Answer: The Mobile Phone example:
Imagine you are a factory owner, you want to describe a generic phone

Step 1: List this generic phones properties eg: height, weight, colour, etc
Step 2: List this generic phones functions  eg: make call, receive call, send sms etc

Now that you have your generic "blueprint" create me the following phones:
Phone 1:

Height-> 102mm
Weight->  85g
Colour->  Pink

Phone 2:

Height->  125mm
Weight->  96g
Colour->   Red
Answer: I think the best way to explain to a non-technical type about OOP is to relate it to them.
Essentially OOD & OOP want you to think about the system you are designing and implementing as a world of interacting things.
So lets, for the sake of argument (which never goes well on the internet), say you're explaining to a refuse collector about OOD&P. His name is Bob. You used to go to school with him 15 years ago, you've bumped into him at a bar, and you're both feigning interest in each other's lives.
"So, John, you say you're a programmer. My nephew is into all that nonsense. Keeps going on about object orientated programming, or something. What's all that about?" Note that Bob is British from the way he misspells oriented.
"Well, Bob," you reply, cringing at orientated. "It's quite simple really. You collect refuse, right? What, generally do you in your job?"
"Well, I follow the van around town picking up rubbish and putting it in the van," replies Bob, quizzically.
"Excellent. Well, imagine I'm writing a programme to simulate that. In object oriented design the first step is to determine what objects there are. In your job there seem to be streets, bins, you and the van. Those are our objects. Next we need to know what behaviours each object performs. I'm not sure how it works in the real world, but lets assume that you are told about street that need clearing. There is one behaviour - streets notify when they need clearing. That means that something needs to be listening out for streets that need clearing. I guess since you follow the van, the van will listen out for streets that need clearing - that's two. A third is, obviously, you follow the van. Another is you put rubbish in the van. You also spot if a bin is full. I guess the van will need to notify you when it is full, and you will need to listen out for that. Those are our behaviours. That's essentially all you need for the design. Object oriented programming is essentially how you implement the design. It differs from language to language."
Bob has fallen asleep in his beer. You walk away.
Comment: Ah! The drive by down vote. Whimsical in its charms.
Comment: Cool story bro. Do you also tie onions to your belt?
Comment: Only the big yellow ones, because of the war.
Answer: I like the car example for explaining inheritance (I tend to use animals rather than vehicles but it's the same idea) but for explaining how an object-oriented program works I refer to an analogy I once read on Chris Crawford's website: the program is like a really efficient bureaucracy. All the different objects in the program are like the different departments in a bureaucracy; each department has it's own designated tasks, they have well defined inputs (who to talk to and what forms to fill out,) and other departments often don't know that much about what goes on inside. HR is like an abstract factory, IT is a singleton, etc.
Getting an error message because you typed the wrong thing in a computer program is exactly like filling out the form wrong to submit to an office.
Answer: OOP is a gross simplification if anything - an abstraction - of human thought process and understanding of the world to project functionality into a digital "void" to mimic familiar processes and classifications digitally. It is, in many regards, more about our primitive language state than us "thinking more like computers".
If programming mimicked reality or human thought it would be far more organic, chaotic and haphazard in nature - lateral even. Instead we simplify reality into baby steps, "2+2 logic", crude categories, re-usable little tools and prehistoric reasoning.
We're still trying to work out how to download our thoughts and desires into a protocol and common language and I for one think historians will be fascinated with its sophisticated crudeness one day - like we now see hieroglyphs.  It's not "clever" at all - it simply highlights how we can't easily explain how we decide or understand even the simplest of things. Computing is still at the "a dog is a dog because it's not a cat" level of thought evolution - it's millennia behind even basic spoken language.
Answer: There's two kinds of wizards. There's the guy who makes specific things happen with magic words. He's got a word for summoning fire. He's got a word for making a frozen chicken appear out of thin air. And another word for creating a pot of force (I prefer my force green, glowy, and translucent) full of friolating goodness. With the right application of his words he can produce a fried chicken.
And then there's the OOP wizard. Who just summons an imp who knows how to go the grocery store, buy a chicken (or ingredients for any other food you want him to prepare), cook it, and serve you dinner. OOP Wizard doesn't have to tell his imp how to do it. He just needs to let him know what he wants which in this case is fried chicken. Not only that, the OOP wizard can summon other minions to tell his imp-chef what to do.
So, the incantation guy impresses at parties but the OOP wizard is the one you want when you're going to start a magic restaurant with a bunch of characters (like say, a pissed off unicorn waiter, and a troll floor manager) who all have to work together. If you try to invoke every step of the problem of solving "restaurant" you can easily get tangled up in the details and it's really easy to make mistakes. The OOP wizard pre-trains his minions to sort out the details for him so he can just focus on solving the bigger problem by having his people interact.
Not to mention it's easier to re-use your chef-imp for your grade school cafeteria problem then it is to separate all the junk you might or might not re-use when you're doing it all one step at a time by calling words and words that call other sets of words (which will get more an more numerous as you have to handle a greater variety of problems).
To be fair, with very, very careful application, the incantation wizard can get it all done as fast as the OOP wizard. He can break things down in the right way such that calling the right spells requires no more work on his part than the OOP wizard. But the work is much harder to understand or duplicate and much harder to re-use large portions of because it's all tied together for one specific complex problem.


Foreign company failed to honor a merchandise cancelation

Question: I purchased two rugs in Morroco while on vacation.  I live in the US.  Eight hours later, I left a phone message and email with the merchant to cancel my order.  I made serveral attempts to stop shipment, via email, and with DHL.  I contacted my credit card company to dispute the transaction.  I never received paperwork from the merchant regarding their cancelation policy.  I made it painfully clear to the merchant NOT to send the rugs, I wanted to cancel, and I was disputing the purchase.  They sent the rugs anyway. I refused the order when it came to my house.  It was shipped back.  The credit card company closed the dispute in the merchants favor.  The merchant has my money and my rugs. They will not respond to any correspondence.  What recourse do I have?  Can I sue for my money back?
Answer: Probably no recourse
Morocco has consumer protection law that allows "The right of withdrawal: allow consumers, in certain cases, a withdrawal period of 7 days." The full text of the law is here but my 35-year old recollections of high-school French are not up to the task. However, a quick skim of this UN review of the law suggests that cancellation (or retraction) only applies to distance purchases (e-commerce) and it sounds as though you made the purchases face-to-face.
AFAIK, there is not a country in the world that protects in law "change-of-mind" cancellations of freely entered into contracts (e-commerce, door-to-door and some other sales excepted). While the experience of most of us in the Western world is that such requests will be honored, that is a commercial decision of the business - not a legally mandated one (at least, that is the law in the US, UK, Australia and New Zealand). Consumer protection law worldwide generally only requires a business to accept a return or cancel a delivery if the product is defective.
The facts of the case are that you did make a purchase and the contract you entered did not allow you to cancel it. They were your rugs and you chose to make the merchant a gift of them by sending them back.
Notwithstanding, international disputes are only worth pursuing is the amount is substantial - in the millions of dollars substantial - as the costs of recovering smaller sums is often orders of magnitude greater than the amount in dispute. Always assuming that you can recover the money even if you get a successful judgement.
Comment: @DavidSiegel agreed, but they tend to be in situations designed around high pressure sales techniques - utility account switching, door-to-door sales, Amway seminars, timeshare seminars etc which are often the cause of complaint.  Even in the EU, distance sales are all thats covered under an explicit right to reject, not purchases when you are present! :) In general, agree with you, just making it obvious that the laws you are talking about are intended to counter specific abuse cases in the past.
Comment: Note: US Federal law gives 3 days to cancel an purchase made at home or at a temporary location, such as a convention or show, with certain exceptions. Many states have broader rights to cancel. For example Ohio allows the consumer to cancel sales of "prepaid entertainment contracts, business opportunity plans, and hearing aids in addition to door-to-door sales, telemarketer sales, and second mortgages. " (https://www.justia.com/consumer/consumer-protection-law/canceling-contracts-cooling-off-rules/) See https://en.wikipedia.org/wiki/Cooling-off_period_(consumer_rights)
Comment: Florida allows cancellation of contracts for future services, for example.
Comment: @DavidSiegel none of which would've applicable here
Comment: Quite true that was in response to "*there is not a country in the world that protects in law "change-of-mind" cancellations of freely entered into contracts*" showing that there are quite a number of cases where such laws **do** exist. That is why I made it a comment, not an answer.


Flash lamp on TTL mode

Question: I would like to know physically what happens to the flash lamp when we use the compensation in his TTL mode (EV's +/-) I ask if the lamp will stay on for more or less time or we change the power in whatts of it ??
Comment: Does this answer your question? [What exactly does TTL flash sets its power to?](https://photo.stackexchange.com/questions/37254/what-exactly-does-ttl-flash-sets-its-power-to)
Comment: Different specific flash models can do it different ways.
Answer: A given electronic flash generally cannot modify its intensity, instead it modifies its time.
As a ballpark guide: a full power flash (power being a misnomer) is on for about 1/1000 of a second (1 msec), while a low power flash may be on the order of 1/25,000 of a second (40 µsec). High speed photography takes advantage of this by using electronic flashes at low power (actually energy) settings.
Comment: For small speedlights you are mostly correct. But there are plenty of different kinds of flashes that aren't speedlights. Even some mid-sized portable external battery powered "bare bulb" flashes can do it differently, and an increasing number of those and studio sized monolights are coming with TTL capabilities.
Answer: All xenon flashes work by charging up a capacitor, and then partially or fully discharging the stored energy of the capacitor through ionized xenon gas in the flash tube. (There is also a trigger needed to ionize the gas, but let's ignore that.)
Speedlights:
Speedlights work by fully charging the capacitor every time, and then using a high speed, high power switch to suddenly turn off the flow of current to the flash. As soon as the flow of current stops the xenon gas in the flash tube stops glowing almost instantly.
In manual mode, the flash lets the capacitor discharge through the flash for a fixed amount of time that is calculated to give the desired amount of light. (The change in brightness of the flash is not linear, so it isn't straightforward to figure out the amount of "burn time" required to produce a given amount of light.
TTL mode for most digital cameras uses a series of calibrated pre-flashes. The camera measures the amount of light visible in the exposure meter from those flashes, computes the amount of light needed, opens the shutter, and then fires the flash for the duration that gives the desired amount of light.
Most film cameras, on the other hand, open the shutter, begin firing the flash, and measure the total amount of light returned from the scene. When the light meter detects that the exposure is right, the system switches off ("quenches") the flash.
Studio flashes:
Some studio flashes also fully charge the capacitor and then quench the discharge electronically. Most, however, use a power setting to tell the flash how much energy to put into the flash capacitor. When the flash fires, it fully discharges the capacitor. If the capacitor was charged fully, you get a maximum power flash. If the capacitor was charged with half as much energy, you get half as much light. (I believe the relationship between capacitor energy and total light output is linear, but I'm not positive.)

Flash lamp on TTL mode


Where are the DNS settings for my Google domain?

Question: I purchased a domain through Google but I can't find the DNS settings page anymore. It used to be available from the control panel but not anymore. How do I access the DNS settings?
Comment: I'm voting to close this question as off-topic because it's not a question for end-users of web applications.
Comment: Arguably the question is about using Google's DNS _control panel_, which _is_ a web application. So I'm voting to leave it open (under doubt).
Comment: I would place this question in the same category as something like "how do I change the password of my router?", which involves a web interface, but is not strictly about an end-user concern with a specific web application.  Happy to consider other opinions and re-open if need be.  However, since it has an answer and will not be deleted by the system, I'd say that it serves as a good precedent for future questions of this type.
Answer: Login to your account.
On Tab Domain Settings, there's a sub section called "Domains"
There, you click on "Advanced Domain settings", which will take you to your domain services(ex: godaddy) console.
I am not sure if you could change the DNS settings right from your Google Apps console. I never saw that option. As far as I remember, this option was available at the GoDaddy's console page.
Comment: That's correct - I did this just yesterday.   One more thing though.   Nick says that he purchased his domain though Google - was this from Sites or Blogger, by any chance?   Now that there is no longer a free edition of Apps, there backdoor route (buying a domain via Blogger) works but has some twitches.   If you did buy it thru Blogger, then you need to log in to the domain with an admin user called BloggerHelper, after firsly re-setting it's password.


Place of death and rebirth

Question: I'm reading about bardos in the Tibetan Book of the dead. I'm wondering how is rebirth dependent on geographical location. For example, if dead occurs in Europe is it possible to get a rebirth in Asia? Is there any decision point for the deceased regarding parents or all happens depending only on past karma? Do we chose rebirth location and parents or not?
Answer: The exact place and circumstance of rebirth is an unconjecturable.

"The [precise working out of the] results of kamma is an
unconjecturable that is not to be conjectured about, that would bring
madness & vexation to anyone who conjectured about it.
AN 4.77
Answer: I haven't read the book you're referring, but I'll answer based on Dharma Sermons I have heard.
When a person dies, the next life is determined vi a random pool of types. This Types pool contains every thought, action the person has attached. Think of this pool having various sentient life forms such as Human, Deva, Brahma, Cats, Dogs etc.
Those who have done a ton of Maithree (Metta) Meditation + achieved Dyanas (Jhana) has the potential to be born in Brahma Realms.
The universe is made up of 31 Realms. Bottom is the Hells. Top is Brahma Realms. Distance and geography between each of these Realms is huge and different. But the thoughts and actions of the person can land him a life as Brahma, Deva, Animal or a Hell being.
So based on that, a person who dies in Europe has the potential to be born in Asia. For that, he should has factors created for that Asian birth. If you wish to be born in Asia, you can perform good deeds such as donating food to Buddhist monks and then wish something like this,
→ By the power of this good deed, the infinite power of Buddha, Dhamma, Sangha I wish for a human birth in Asia so that I can do X, Y, Z good deeds etc.
If you're trying to get an Asian Birth to follow Buddhism, please realize that you don't need an Asian Birth for that. You can follow Buddhism anywhere in the world.
Above wish is not guaranteed to get you whatever you want. BUT it'll happen whenever it happens. You're just putting your wish as a potential item in the queue/pool. Whether it gets selected or not is not something you can control or decide.
You can use the same strategy to wish for specific parents, but there is no guarantee it'll happen whenever you want.
Nope! Not everything occurs based only on Past Karma.
If your business fails, while that exact same business worked for someone else, why did that happen: → It's because of a Past Karma you have done coming back to you. Doesn't matter the logical reason it happened. That circumstance's root level reason is the Bad Karma you've created.
Now if you react this situation very angrily, you're creating new karma yourself. Your past karma only brought you failure. But your unawareness + anger caused you to create new karma.
Just like that, Not everything occurs based only on Past Karma. It may begin the circumstance, but it is not to blame for everything.
The person who is on the journey to become a Samma Sambuddha chooses his Birth Location, Parents and a couple of other things. BUT normal people like us cannot decide such things with 100% guarantee.
If you become Sowan (Sotapanna), then you'll be free from the 4 Hells forever. But that still doesn't mean you get to choose your birth location or parents.
All you can do is perform good deeds that burn your Raga (Lust), Dwesha (Anger) and Moha (Delusion) and then make a wish on that. There are cases on Tripitakaya how people wished for Beautiful Figure, Various Titles trillions of years ago and achieved exactly that. (e.g. Ambapali)
Hope this answers your questions!
Answer: Certain insecure which kind, good householder, not to speak about place, but Why beings take birth, even in most worse existences and circumstances? may give some ideas of the dangers of another birth. Good to seek the stream-enter therefore.
What ever would still ones desire at the moment of death, there one takes birth , when given, like good householder took here.

Place of death and rebirth


Get TypeError when using TfidfVectorizer in python

Question: I'm new to python and I'm needing your help.
I'm working with NLP, and I want to classify a field that is string.
I read the dataset
data = pd.read_csv("dataset.csv",sep=';',encoding='latin-1',error_bad_lines=False)

tokenize the field
data['campo']= data['campo'].str.split()

the output is:
1- [Su, inexperto, personal] 2- [Atención, al, cliente]

when I check tutorials that exist on the internet, to the majority, when tokeniza returns the separated words with apostrophe.

the problem is when I want to vectorize (TfidfVectorizer), I get an error and I think my problem is here.
Can you help me? Why do not I have the tokens with apostrophe?
After executing this, I add the possibility to vectorize the field:
Tfidf_vect = TfidfVectorizer (max_features = 5000)
Tfidf_vect.fit(data ['field'])

From here, I throw the error:

AttributeError: 'list' object has no attribute 'lower'

I thought I was coming for the subject of the lower, so I added:
Tfidf_vect = TfidfVectorizer (lowercase = False, max_features = 5000)

Tfidf_vect.fit (data ['field'])

and from there he shoots me:

TypeError: expected string or bytes-like object

Do you know what it is the problem?
Answer: Do not tokenize your text before feeding into tfidfVectorizer(), which means you have to remove the following line in your code.
data['campo']= data['campo'].str.split()

TfidfVectorizer internally does the tokenization. Try your following lines of code directly!
Tfidf_vect = TfidfVectorizer (max_features = 5000)
Tfidf_vect.fit(data ['campo'])


Weird issue with multiple Python installations on Windows

Question: I have 3 versions of Python (2.5, 2.7, 3.2) installed on a Windows machine, 2.5 being the default one (first in PATH and default for open action).
Now the weird thing appear when I run a python script with filename.py (without specifying the interpreter) or by clicking the file in Explorer: Python 2.5 is running the script (expected) BUT Python 2.7 PATH being inserted before the original system PATH.
Still if I look at the command line, it seems that Python 2.5 was executed.
Where is the first record in PATH (C:\Ptyhon27\) comming from, I can assure you this is added when the scripts runs, but by whom?

As you already observed I do have several versions of Python in PATH, this is not something anormal, because they can also have versioned executables instead and because Windows always picks the first one it the PATH.
Answer: Looking closely, it seems you have various versions of Python in your PATH environment variable.
The standard Python installer for Windows doesn't add itself to the PATH; I always do this manually for the version of Python I want to use by default. If you're using a different Python installer (such as ActiveState or Enthought) that may be the cause, but I haven't tried those.
In any case, you can edit your PATH environment variable manually and clean it up, leaving only the path to the version of Python you wish to be the default, as described here (scroll down a bit to get to the relevant section).
Comment: What's the point of having several versions of Python in the PATH? True, it is technically not an error. However, this can only lead confusion and I can't think of any benefit. Running `python` or `pythonw` will use the executable from the first version of Python on the PATH and the others will never be used.
Comment: It's not something wrong to have several versions of python on PATH.
Answer: You might be interested in the Python Launcher for Windows project, a.k.a. PEP 397. Install it, and remove all Python dirs from PATH, leaving only the launcher one, and use py/pyw instead of python/pythonw.
Answer: Ahh, I think I have it! You didn't mention exactly how you're running Python...
Python adds the directory from which the command is run to the PATH! If you run it from the command line, this will be the directory in which the Python file you execute is located, or the directory you ran Python from if you just opened an interpreter. However, various tools, interpreters and development environments start up differently, and some of them will use a certain Python interpreter (depends on their configuration) and add its location to PATH.
If you want more help, please give a detailed description of how you're running Python when this happens.


What would cause the water to stop when I turn a faucet to hot?

Question: When I turn the faucet to hot, the water stops running. Valves have been checked and I have hot water everywhere else.
Comment: did this just all of a sudden happen or where you gradually making your shower hotter to get it to a medium temperature?
Comment: Does it first get warm/hot and then turn off?  What happens if you open the valve part-way?
Comment: What type of faucet?
Answer: Very small pieces of debris (very frequently rust chips in homes with older galvanized pipes) can block one side or the other of the cartridge of a shower valve.
Newer valves have replaceable cartridges than can be examined and cleaned.  Just shutoff the water, open and close the valve to relieve pressure and undo the trim plate.
Note, examples are of Delta shower valves
The Cartridge is usually behind a finely threaded retaining nut (bonnet nut).

Sometimes the seals break and jam..  here's a Delta cartridge and seals


Why does a surface integral have two integrals?

Question: I am reading Modern Compressible Flow by John D. Anderson Jr and I am going through the integral form of the continuity equation, I am struggling to wrap my head around the fact that said form has two integrals associated with it. I have come across the expression before, but I just hadn't stopped to think about why it has two integrals, any help will be appreciated. My impression has been that when we use the infinitesimal fluid element approach where the fluid element is on a blob (random geometric shape), we use a single integral to show that we are summing the fluid elements over that blob but with the two integrals, that's throwing me off.
Comment: A surface integral *doesn't* have two integrals. It is a concept with its own symbol (and its own meaning) as you have posted. But one way to evaluate some surface integrals is to express the surface as a function of two variables, then integrate a functional expression defined parametrically in those two variables over the surface bounds. Then check to see if reversing the order of the variables in the integration changes the result. If it doesn't, the answer is probably correct. If it does, one of the answers may turn out to be useful, but you have to figure out which, if either, serves.
Comment: But there are many situations when this approach simple doesn't work. You may need to define the surface, or the functional, in other ways in order to get an answer. Green's theorem is a common example.
Answer: If you are doing surface integrals starting from single dimensional infinitesimals, then you need two integrals because areas are two dimensional. If your integral is formed such that it already happens to start with an infinitesimally thick slice of the surface then you don't need two integrals because part of the work is already finished.
Essentially, with two integrals you are building up from linear dimensions, to a slice, and to an area. The first integral integrates any one a slice of the surface. The second integral integrates all the slices to form the entire surface.
It progresses the same way to volume integrals, where the surface you have after two integrals is actually a cross section of the volume. Then the third integral adds up all the cross sections to get you the volume.


How to implement mutations with optional arguments in GraphQL?

Question: I am learning about graphql, and went through the https://www.howtographql.com/graphql-js/3-a-simple-mutation/ tutorial, and was interested in what the implementation of the updateLink mutation as follows would look like.
type Query {
  # Fetch a single link by its `id`
  link(id: ID!): Link
}

type Mutation {
  # Update a link
  updateLink(id: ID!, url: String, description: String): Link
}

The reason I am asking this is that every other mutation implementation I have seen uses only NON-optional parameters. I am curious if there is a community-agreed-upon pattern for extracting and applying only the provided non-null arguments(url, description) from the given context and applying them to relevant the database record.
I have considered checking if each variable is null as follows, but this approach looks way messier than I would expect compared to the rest of the 'magic' and simplicity that Graphql provides.
        updateLink(root, args, context) {
            if (args.url == null && args.description == null){
                return null
            } else if (args.url == null) {
                return context.prisma.updateLink({
                    id: args.id,
                    description: args.description
                })
            } else {
                return context.prisma.updateLink({
                    id: args.id,
                    url: args.url
                })
            }
        }

Please let me know if you found a cleaner way to extract and apply the optional arguments(url, description).
Another consideration I had was to make two separate update mutations as follows.
type Query {
  # Fetch a single link by its `id`
  link(id: ID!): Link
}

type Mutation {
  # Update a link
  updateLinkURL(id: ID!, url: String!): Link
  updateLinkDescription(id: ID!, description: String!): Link
}

The thinking here was with limited arguments and a declarative mutation name, one could force the arguments to be Non-Null. The main issue here is that one can have many update methods for tables with many columns, this would also start to look messy.
FYI I am using prisma as my ORM.
Answer: const resolvers = {
    Query: {
        info: () => `This is the API of a Hackernews Clone`,
        feed: () => links,
        link: (parent, args) => {
            // console.log(args)
            return links.find((link) => link.id === args.id)
        }
    },
    Link: {
        id: (parent) => parent.id,
        description: (parent) => parent.description,
        url: (parent) => parent.url,
    },
}

Comment: As it's currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer).