BGP multipath with different ASNs feasible for production networks?

Question: on Cisco (this command is hidden for some reason)
#bgp bestpath as-path multipath-relax

The default BGP behavior only installs only routes with exact the same AS_PATH into RIB. With multipath-relax, the AS_PATH only needs to be of the same length.
What problems can it potentially cause? Why isn't is used more often?
As a transit provider, does this feature complicate troubleshooting (I am thinking about end-user complaints about network performance)? Does it make it more difficult to know the path specific traffic took at a given time? Is there something else to that can assist troubleshooting. I am not sure about scalability and cost for NetFlow in SP network.
Comment: I've instructed several customers to use it, I've not heard of any issues. draft-lapukhov-bgp-routing-large-dc-05 heavily relies on this feature
Comment: I'm looking for a similar feature in Juniper JunOS... Is there any? http://networkengineering.stackexchange.com/questions/6735/junos-similar-feature-to-ciscos-bgp-bestpath-as-path-multipath-relax
Comment: Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you can post and accept your own answer.
Answer: bgp bestpath as-path multipath-relax was introduced by CSCea19918.  Normally eBGP load-balancing requires the candidate routes to be equal-cost paths; i.e. identical BGP attributes:

same Weight
same Local-Pref
same AS-Path (both the AS numbers, and the AS path length)
same Origin
same MED
different next-hop

As you mentioned, this command relaxes the same AS-Path requirement so any candidate eBGP AS-Path with the same AS-path length could be used for eBGP load-balancing (this will not load-balance between eBGP and iBGP paths).  If you run BGP between multiple ISPs and you are looking for better egress load-balancing between your upstream connections this may help you out.

What problems can it potentially cause?

There isn't much danger as long as you're an enterprise customer that doesn't give transit service to another ASN; for a transit provider it might be perfectly safe, but I can't be sure there aren't routing loops if a transit ASN uses this feature.  At first, I thought there would easily be a loop in transit ASN cases, on more reflection I can't find a real problem.

Why will it is rarely used?

Good question, it's been around since at least 2005.
Comment: Could you please explain how it can cause loops with #bgp bestpath as-path multipath-relax  (not #bgp bestpath as-path ignore)?
Answer: The   basic  issue   is   that  the   BGP   speaker  configured   with
"multipath-relax"   gets  into   a  control   plane  <->   data  plane
inconsistency; i.e.  it advertises  only the  best path,  but installs
multiple paths in the forwarding  that have different ASPATHs than the
best. This breaks the basic tool BGP has to detect loops - ASPATH loop
check.

A (distorted) scenario below. I am sure you can come up with
a better example with a bit more time at hand.

            ...............
            : R4  AS1 (10/8)
           /:..............
     ..../......
     :  R5 AS2
     :....\.....
       /   \  ...............
     /      --:--R1
  R6 AS4      :    \    AS3
     \--------:--- R2
              :    /
              : R3 (10/8)
              :..............

In this example,
- R3 in AS3 and R4 in AS1 announce a prefix 10/8. R5 in AS2 receives
  the prefix from R1(AS3) and R4(AS1).
- AS2 is configured with 'multipath-relax' and chooses both paths
  for multipath forwarding, though it selects AS1's path as best.
- R5 advertises the prefix with AS_PATH "2 1" to R6, and R6 in turn
   to R2.
- Because of some specific policy, it is possible that R2(AS3)
  chooses R6's path as best. If it happens, there is a loop.
  Note that R1-R2-R3 represents the physical connectivity of
  the routers in AS3.

Comment: Thanks for the example. Do you mean R3 selects R4 as the best path for 10/8, R5 forwards part of the traffic to 10/8 back to AS3 at R1? Why is this caused by multipath-relax? Without multipath-relax, the R2 - R6 - R5 -R1 loop can still exist if there isn't proper outbound filtering( or simple 10/8 to null0 at the originating AS). It appears to me the issue here is BGP hijacking. Am I understanding it wrong?
Comment: No. What I mean is: (a) R3 has its own external best path, (b) R1 chooses R3 as the best, but because of the physical connectivity, has to send traffic towards R2 to reach R3, (c) R2 selects the external path (received from R6) as best. This is related to multipath-relax, since R5 chooses a path from AS3 for multipath forwarding that it does not disclose. Thus ASPATH loop prevention technique fails in AS3.
Comment: I still don't get how this could be prevented without multipath-relax. R1 sends traffic to 10/8 via R2 and R2 chooses R6 as exit (weight), R5 can choose R1 as best for 10/8 even without multipath-relax and cause a loop. ASPATH loop prevent cannot prevent loops caused by preferring an external exit point for internal network. If R1 picks R5, R2 picks R6 as best for 10/8, loop is formed regardless, no?
Comment: Not sure how that would be a loop. R1 picks R5 as best => implies that R5 picks R4 as the exit for traffic (otherwise, an AS_PATH loop would have been detected). Thus, traffic flow paths will be: R1->R5->R4 or R2->R6->R5->R4 or R5->R4 or R3.


VoIP call security: How does encrypting signalling protocol (SIP) protects RTP?

Question: Checking the data packets from many VoIP applications shows that SIP packets are encrypted with TLS. So the captured session shows no SIP signals at all, just simple TCP and TLS/SSL packets.
But surprisingly, RTP packets are well visible, with (dynamic) payload type, SSRC and data. In many cases where RTP is encapsulated with STUN, wireshark can dissect RTP from it. Of course, encrypting signalling packets hides the attacker to see which codec, bit rate is used, but does it protect from RTP packet being decoded, if somebody captured the session ? Applications used for example: LINE and KakaoTalk.
Answer: You are right in the fact that securing SIP communication is not sufficient.
RTP has got SRTP as his secured counterpart, so you may use

SIP over TLS to secure the control channel communication,
SRTP to encrypt the data channel communication (SRTP will need to rely on another protocol, like ZRTP, to securely exchange the keys/ More information can be found on SRTP Wikipedia page).

Of course you need your software/devices to be compatible with these protocols. Wikipedia also maintains a comparison chart between SIP software including the support of these security protocol.
Comment: So why encrypt SIP, just for the sake of hiding the used codecs and sip username ?
Comment: Because SIP is the control channel, handling all the technical dialogue. If someone listen or tamper with the SIP dialogue, then he actually gains control on the technical aspect of the communication, he could do any nasty thing one could imagine (sniff your SIP account password, impersonate you or your correspondent, alter negociated parameter for instance to remove you SRTP encryption, etc.). You don't want another person to take control of you communication, do you? So you want to secure your control channel, this is as simple as that :).


How do I create an AND filter for the same field

Question: I am having a problem with a view filter. I have one field called Category. The field contains a comma separated list of id numbers that represent different categories. I want to create a filter that will filter out all records that contain one id number, but not another. So my filter is Category=5601 AND Cateogry<>5612. Whenever I create this filter, the result ends up as OR instead of AND.
Answer: By default, drupal filters with AND. Maybe you clicked the rearrange and/or option by mistake intsead of just adding a new filter. Try removing both and creating again by clicking add.


Is there a way to include a google charts panel alongside cartodb map?

Question: I have successfully included charts in infowindows (e.g. https://github.com/CartoDB/cartodb.js/blob/develop/examples/infowindow_with_graph.html) but I would like to include charts in panels alongside a cartodb map. Is there a way to adjust the code in the link above to achieve this?
Comment: Thats great Andy,
Im trying to do something similar but my tables dont have numeric values, I want do draw charts on string values. For example I have a column that is divided by 3 values; inspected, not inspected and active. I would like to draw a piechart with the % of inspected, not inspected and active. Could you show me an example for doing this?? Thanks
Answer: You can use click events to get the data from the object you click on and control where that data goes by using the callback object.
First put the draw_chart function from that example in the click event below:
sublayer.on('featureClick',function(e, latlng, pos, data, subLayerIndex) {
    draw_chart([data.pop_min, data.pop_max], data.name);
});

You can then edit draw_chart to put the chart into whichever div element you want.
See a basic working example here. It uses most of the code from the example you included.
Check out the CartoDB.js documentation for more information.


Pumping lemma for an involved non context free language

Question: Hi I'm trying to show $C=\{wzzw^R|w,z\in\{0,1\}^+\}$ is not a context-free language.( I have this believe because $C=\{ww|w\in\{0,1\}^+\}$ is not a context free language.) I'm really struggling to come up with a string that captures the essence of irregularity of this language: I tried strings like $s=1^p0^p1^p0^p1^p1^p$ but there are too many cases to deal with and most of the examples I saw only use 1 or 2 cases, so I believe the direction I'm going is wrong. Can you provide a hint on which string to pick as the 'pumping string'? Thank you.
Comment: $\{ww^{R}|w\in\{0,1\}^+\}$ is a context-free language.
Comment: Sorry my bad, I meant ${ww}$ instead of $ww^R$
Answer: Suppose that $C$ were context-free. Then the following language would also be context-free:
$$
C' = C \cap 0(100+110)^+0.
$$
What does $C'$ look like? Suppose that $x = wzzw^R$ belongs to $0(100+110)^+0$, where $z,w \neq \epsilon$. Note that the first two symbols of $x$ are $01$, and last two are $00$. This shows that $w = 0$, and so $zz$ belongs to $(100+110)^+$. Thus $|zz| = 3m$ for some $m \geq 1$. Since $|zz|$ is even, $m = 2k$, and so $|z| = 3m/2 = 3k$. Therefore $z$ belongs to $(100+110)^+$, and we conclude that
$$
C' = \{ 0 zz 0 : z \in (100+110)^+ \}.
$$
If $C'$ were context-free, then so would be the language
$$
0^{-1} C' 0^{-1} = \{ zz : z \in (100+110)^+ \},
$$
obtained by taking left and right quotients with $\{0\}$. Finally, if we define a homomorphism $h\colon \{a,b\} \to \{0,1\}^*$ by $h(a) = 100$ and $h(b) = 110$ then the following language would also be context-free:
$$
h^{-1}(0^{-1} C' 0^{-1}) = \{ zz : z \in (a+b)^* \}.
$$
Since this language is well-known not to be context-free, we conclude that so is $C$.
Comment: The context-free languages are closed under intersection with *regular* languages.
Comment: thank you, but I thought CFL is not closed under intersection?


What are my model rights about paid photos?

Question: If I pay a photographer for a photoshoot and all images taken and edited of me, do I need their permission to use it for Magazine articles or promotional purposes including event flyers? Do I still have to credit them when posting? Do the photographer have the right to leave their watermark on images paid for?
Comment: What did the contract between you and the photographer say about these things?
Comment: What does your lawyer say?
Comment: Probably one first thing you need to do is think of yourself as 2 separated entities, 1 the model, 2 the client. Approach this from the client's point of view.
Comment: This is probably a difficult question to provide a correct general answer, as the legislation about copyright and other intellectual property varies from country to country. Maybe it also also depend on whether the intended magazines are national or international.
Answer: Just because you've paid doesn't mean some automatic rules come into force. As mentioned in the comments above, it depends on the specific agreement between you and the photographer. So, what did you agree with them?
If this is a real situation and not just hypothetical, and the photographer is arguing that you don't have legal right to use the photos as you wish, the simplest and cheapest solution might be just to walk away and have your photos re-taken by another photographer, with a satisfactory agreement in place beforehand this time.
Edit to add: Personally, it does seem unusual to me that the photographer would insist their watermark be kept on photos that you have paid them to take of you and supply to you. I wonder if this is not such a straightforward situation as made out to be.
Answer: I think that it depends on which country You are living and do You have a professional status at any organization. In my country, when photos are paid and customer have those photos then customer have right to give free those photos to anyone. But photos can't resell or modify, for example removing your stamp isn't legal.
This is simplified version of your rights to the photos You have taken, edited and planned.
-Tomi Karjalainen
Answer: The only inherent rights you may have as a model are the right against misappropriation and the right of publicity. In the US these are state rights; but not all states, nor all countries, have laws granting/supporting these rights.
Any other right contrary to existing law would have to be transferred *in writing (by contract). That includes your use of the images other than personal, and the photographer's commercial use of the images.
It is within the photographer's rights to watermark the images provided; it is considered to be part of copyright management. And it is generally a violation for you to remove the watermark (USA/UK/etc); doing so has significant penalties of its' own in the US (DMCA violation).

*some rights could be transferred by inference (e.g. verbal contract), but that can be very messy/uncertain.


Magento 2 How to get Admin Customer Edit Page edited Tab details

Question: Please check the screenshot highlighted part, How can I get which tab  is edited when save the customer
Answer: I have found out the file which is triggering the change, from there you can find which tab has been changed, the JS file path is - "vendor/magento/module-ui/view/base/web/js/form/components/area.js".
In this, there are two functions - initElement() and onChildrenUpdate().
Please check the below screenshots for how I have debugged which one is the element by printing out its label name. You can also use the help of UiRegistry.Please let me know if this was helpful. Thank you.

This is the image for the output in the console for which the tab has been edited.
Comment: Hi @Bharath thank you for the answer but i'm looking any way to get which tab is edited from php side in save controller


Non-coprime solutions to x^n+y^n = z^2

Question: Let $n$ be an odd prime. I know that the equation $x^n+y^n = z^2$ has no non-zero coprime solution in integers whenever $n \geq 5$, and that there are infinitely many solutions as soon as one drops the coprimality condition. As a curiosity, my question is: is there a way to parametrize all the non-coprime non-zero integer solutions to this equation (using different parametrization families, if necessary)? If it helps, take $n$ small, say $n = 5$ or $n = 7$.
Comment: $(a(a^p+b^p))^p+(b(a^p+b^p))^p=((a^p+b^p)^{(p+1)/2})^2$.
Comment: Do you know a single parametrization?
Comment: Not off the top of my head, but I'm guessing (probably wrongly) that it shouldn't be too hard to come up with such a parametrization (not covering *all* solutions though)?
Comment: @joro I was looking at your MO thread http://mathoverflow.net/questions/109125/integer-solutions-of-xn-yn-zn-1 , and I was wondering whether your parametrised family for $n = 5$ to the equation $x^n + y^n = z^4$ covers all the non-zero solutions with $x \neq \pm y$.
Comment: I doubt it is complete. Though it gives some solutions.
Comment: If $(x,y,z)$ is a non-trivial solution, do we expect the ratio $\frac{x}{y}$ to take infinite many values?
Comment: Don't know. Believe abc implies quite large gcd(x,y) for all solutions.
Answer: The answer to the question depends on the parity of $n$.
Suppose that $n=2k$ is even. Let $(x,y,z)$ be a nonzero solution to your equation, with $y\neq 0$.
Then $(x/y,1,z/y^k)$ is also a solution of the equation. Hence to construct all the integral solutions you need to find all the rational points on the hyperelliptic curve $z^2=1+x^n$. For $n\geq 5$ there are only finitely many such points and for each point you find a one-dimensional family of solutions of the form $(tx,ty,t^k z)$ with $\gcd(x,y,z)=1$.
If $n=2k-1$ is odd then you can find all the integral solutions as follows. Let $x,y$ be coprime integers and write $x^n+y^n=ts^2$. Then $(tx,ty,t^k s)$ is a solution.
So $((x^n+y^n)x,(x^n+y^n)y,(x^n+y^n)^k)$, $x,y\in \mathbb{Z}$ parametrizes a subset of all the integral solutions. For fixed $x/y$ you will miss at most finitely many solutions.
However, I doubt that you can give an algebraic description of all the integral solutions.

Non-coprime solutions to x^n+y^n = z^2


Can you turn Airplane Mode off after you land or finish taxiing?

Question: Can you turn Airplane Mode off after you land or finish taxiing on a plane? I have seen some turn it off after landing and some after taxiing and I have never heard an official rule stating which one is correct.
Comment: It probably depends on the country and the airline, but in my experience in most cases you can turn off airplane mode after landing.  I've been on flights where we were told to keep it on until the doors opened, but I think that was some years ago and the rules have changed over the last few years (for example, as to whether all electronic equipment must be entirely off during takeoff and landing).  Most commonly, the cabin crew announces when mobile phones can be used, so I haven't paid much attention to the actual rule -- I just do as I'm told.
Answer: There are two ways of looking at this. The physical 'can you' and the legal.
From the physical, every single transmitting device on a plane has to be certified to legally fly on the plane in transmitting mode.  Most devices 'probably' won't interfere, but even adding a wifi router onboard takes hours of testing, compliance, and certification (source: I was on the Qantas wifi programme team).  Since they can't possibly certify every single variant of mobile phone, it's easier to just say 'turn it to airplane mode'.
From a legal point, If you forget, or don't bother (and our scanners could see this happening on almost every flight), it almost certainly won't make a difference, but you are technically transmitting onboard an aircraft with a non-certified/compliant device, which is illegal in many countries.
You're also meant to legally always follow instructions of the flight staff.  They might seem like just friendly hosties, but there are serious consequences available in most countries for disobeying instructions of the flight crew.
So if you're told to keep it off, and they forget to tell you it's ok, technically you shouldn't be turning it on again until you disembark (usually into the terminal).  Again, it almost certainly won't do anything bad, but you asked 'can you' vs 'should you' so I'm trying to cover both.
Easy option: It's a few min of peace of quiet from your phone and the outside world.  Enjoy it :)
Comment: And yes, you've probably heard the safety briefing a thousand times, but if you can't recite it back in your sleep, you need to pay attention to it.
Comment: (Also I seem to recall having been on several flights recently where we were told over the PA during taxiing that "you may now use mobile phones and other electronic devices with radio transmitters").
Comment: @Jan let's take this to the [chat]. But no, just for testing.
Comment: If you put a wifi router on a plane, do you also provide a way for passengers to get their wifi _devices_ certified to transmit?
Comment: @HenningMakholm they all implement wifi in the certified 802.11x manner, so that's been approved as long as that's all the device is doing. Bluetooth seems to be ok these days too.
Comment: I'm curious about those scanners: are they on every flight or did you just have them around for testing as part of the WiFi installing process?
Answer: The effect of leaving Airplane Mode off: your phone will be trying to connect, using maximum battery power, to any phone company cell it can ping during the flight. The connection is guaranteed to fail since at airplane speeds you will be out of that cell's range before a successful handshake is concluded—or at least before significant amounts of data are sent or received. You won't be happy because of battery drain. The phone company won't be happy because any cell that receives your attempt to connect (that's not impossible over several miles with no buildings to interfere) will be attempting to locate your now-far-away phone to hand over to another cell, at maximum signal strength and power; plus, of course, you are briefly using a slot that could be available for another user who won't be miles away by the end of the opening handshake.
I know there are stories that your cellphone can somehow interfere with the plane's navigational system, but that's not the case.
Once you have landed, and are taxiing to the gate, you can establish a successful connection and use your phone just you would leaving the airport in a car. (This supposes cell coverage in the airport vicinity, which is a given at any major city.) This doesn't answer any question about legal regulations, which vary from one country and airline to another, but explains the physics.
Comment: +1 and to remember when you are travelling on the underground as well: _Trying_ to connect to WiFi or a cell tower and failing takes more out of your battery than actually succeeding and having a connection.
Comment: Several underground railways have cells to maintain service, even on the train. For the others, Airplane Mode.
Answer: On all flights I have taken in the past couple of years, this information was either available in the airline's information leaflets in the seatback pocket or it was announced when we landed – or both. I cannot remember a flight I took recently where the passengers were asked to keep their handheld devices in flight mode until the aircraft came to a complete stop; they all had some sort of do what you want after touchdown.
My experience is limited to flights in Europe, East Asia and between those two. Legal standards may differ.
Answer: Actually, in Europe you can have your phone or any other device throughout the flight without Airplane Mode enabled. EASA (European Union Aviation Safety Agency) gave permission for that almost 5 years ago)
But it is the airline company's final decision.
Comment: Your last sentence about the company deciding is the most important. If they have not done the necessary tests to ensure no interference then they are entitled to ban usage.
Answer: As others have said, this will depend on country and airline.  That said, in the US, immediately after the wheels touch the ground, I quickly turn off my Airplane mode as my phone will shortly be able to get cell signal for 4G.  A few seconds later, attendants have explicitly said that although passengers should stay seated, they can turn off Airplane mode and surf the web as they please.  Makes sense since after landing, it should be smooth for the most part getting from the runway to the gate.
Comment: +1. Almost all the other answers, including the accepted one (?!), address use of transmitting mode *in flight*, which was not the question at all. The question was at what point *after landing* it can be used.


K-type thermocouple alumel/chromel soldering

Question: I am using a K-type thermocouple for my project. I want to to use a connector which has alumel and chromel pins, but there is a problem there. Is it possible to solder alumel/chromel pins to a PCB?
Comment: You need to go from alumel/chromel to copper at some point. This point needs to be your Cold Junction Compensation point. For various mechanical reasons, it's often easier to get the CJC temperature reading at the connector, this means you can simply use copper connectors and have that as the CJC point, meaning you are only soldering copper.
Answer: While having this issue, we developed an elegant solution. If the pins are selectively plated with gold on the end which needs to be soldered, then they can be readily tinned. The process is similar to ENIG plating of printed wire boards. The nickel underplating joins readily with the chromel and alumel; the gold plating protects the nickel from oxidation.


RedHat 7 msodbcsql17 problems

Question: I initially asked this on StackOverflow, but it is not application development issue in my opinion. Basically, I have a C++ application which connects to SQL Server using msodbcsql17 package. It is running on RedHat 7 linux server. When deploying this app to a new environment, the local administrators installed the latest available msodbcsql17 package with yum, which is 188.8.131.52-1. Our application hangs when connecting to the DB, systemctl is not able to stop it, only by killing it after some time. I checked in our lab, app works fine with msodbcsql17 version 126.96.36.199.1-1. So I tested versions by taking one of our lab servers, cloning it, and verifying app is working fine on both. I upgraded one of the servers to 17.6 version of msodbcsql17, app broke "as expected". So I downgraded it to 17.4 version, and app is still broken.
As far as I can tell, the installed binaries (everything in /opt/microsoft folder) is the same on the two servers. Other than this I can only see a single symlink from /usr/lib64 which points to an SO file in /opt/microsoft. According to yum, no other dependencies were installed or removed, I checked this by exporting 'yum list installed' to a file and comparing them by diff.
So what I tried is to use rsync to copy files from original working server to new server. I first just did dry-runs, but didn't find any difference. So I copied over entire /usr folder, still not working. Then I copied over entire /etc folder with rsync, I changed back hostname and IP configuration (obviously these files were overwritten also), and the app started working again. So I broke it again by installing the latest version of msodbcsql17, removing it and installing previous version, and did another rsync dry-run. On the usr folder, no differences, rsync only logs that it is skipping symlinks (skipping non-regular file "tmp"). However on the etc folder there were a few differences, and for the life of me, I can't see what is the problematic file here:
<code>sudo rsync -r --dry-run --out-format="[%t]:%o:%f:Last Modified %M" firstname.lastname@example.com:/etc/ /etc/ | less

[2020/12/16 00:59:54]:recv:hostname:Last Modified 2019/11/07-17:10:40
[2020/12/16 00:59:54]:recv:ld.so.cache:Last Modified 2020/12/16-00:40:20
[2020/12/16 00:59:54]:recv:odbcinst.ini:Last Modified 2019/11/27-17:03:27
[2020/12/16 00:59:54]:recv:sysconfig/network-scripts/ifcfg-ens160:Last Modified 2019/11/07-17:09:02
[2020/12/16 00:59:54]:recv:tuned/active_profile:Last Modified 2020/09/15-09:51:08
[2020/12/16 00:59:54]:recv:tuned/profile_mode:Last Modified 2020/09/15-09:51:08
</code>
/etc/hostname and /etc/sysconfig/network-scripts/ifcfg-ens160 are obviously different. /etc/odbcinst.ini was regenerated during msodbcsql17 installation, but contents are the same according to diff. As for the rest, again, contents are same according to diff Well, except for ld.so.cache which is binary, but size is different, I copied this file over manually and it didn't solve.
So I'm not sure what exactly is fixing the problem here. Most interesting part: if I rsync the /etc folder with the latest msodbcsql17 installed, the app starts working again. So almost like something breaks in the /etc folder?
Answer: Ok, after some more extensive checks, it seems I missed the very first one: odbcinst.ini is actually different! During the 17.6 msodbc install, one line was removed. After adding it again, it started working immediately:

Why was this line removed, I don't know. Or, in case of fresh install, this line was never added to odbcinst.ini. Anyway, it works now.

RedHat 7 msodbcsql17 problems


How would you approach this design?

Question: I have ControlA which accepts an IInterfaceB which has a property of type
List<unknownType>
In an event of ControlA i need to add a new instance of unknownType to the List in IInterfaceB...
unknownType needs specific properties so i immediately thought it could be an interface, but quickly realised interfaces cannot be instantiated...
How would you design this system?
EDIT the current inheritance chain looks like this:
topLevelClass -> baseObject -> IBaseObject (which is implemented in topLevelClass)

so if i added a new class to the chain it would need to do the inheriting and implementing which would be impossible (afaik)
Answer: If I'm interpreting this correctly, you could add a constraint on unknownType to be of some interface that contains the properties you need:
class ControlA
{
    void Frob<T>(IInterfaceB<T> something) where T : IHasSomeProperties, new()
    {
        something.ListOfT.Add(new T() { SomeProperty = 5 });
        something.ListOfT.Add(new T() { SomeProperty = 14 });
    }
}

Answer: Would a restriction on the type work?
List<T> where T : IInterface

Answer: Your specification isn't specific enough to answer well, but try putting constraints on T.
public interface IInterfaceB<T>
    where T : new()
{
    List<T> Whatever { get; }
}

This allows you to do this:
T iDoNotCare = new T();

Answer: Why does List have to be an unknowntype? Why can't it be a real class, the has the real properties you need with a constructor for you to instantiate? If you need to extend that class, you can then inherit from it. Based on the information you're providing, if all you need is a few properties in the class that goes into this List, then a good old class should do the trick.

How would you approach this design?


How can US presidents commute criminal sentences?(i.e. Manning Jan 17), but UK Prime-ministers can't?

Question: What grants US Presidents the power to give Presidential Pardons, and why can't (or don't) UK Prime-ministers do it?
Comment: Because it's a different country with different laws? I'm not sure how else to answer this question to be honest. It would probably be better to just reduce it to "Why can the U.S. President commute criminal sentences?"
Comment: Hint: Look higher https://en.wikipedia.org/wiki/Royal_prerogative_of_mercy. Or lower (statutory pardon by the Parliament, mentioned in the link but seems that does not have its own page)
Comment: @Carpetsmoker: Different countries, but with a shared legal root (Common Law)
Comment: The U.S. Constitution gives the US President the power to issue pardons.
Answer: The US President's Pardon-Power
The United States Constitution gives the President the ability to pardon criminal offences:

he shall have Power to grant Reprieves and Pardons for Offences against the United States, except in Cases of Impeachment
  [Source: Article II, Section 2.1]

Similar Powers in the United Kingdom
In the United Kingdom (and likely other Commonwealth nations) the monarch (or Governor-General, on their behalf) can pardon crimes through the royal prerogative of mercy.
As with many other powers of the royalty, in today's world it is only exercised at the request of the appropriate minister. In this case, it is the  Secretary of State for Justice (or Defence, in military cases).
Comment: There is also a cultural difference.  The prerogative of mercy is rare, and never as a political gift for one's allies. It is an exceptional part of the justice system.  In the US it is a regular part of the justice system.


Can I switch this outlet for a USB outlet?

Question: Does anyone know what kind of outlet is this one:

...and can I safely swap it with this one?

Or is there anything power concerns that I should be aware of??
Comment: Try to look inside the box at the wires attached to the side of the receptacle. Is one of the wires *white*?  How do you feel about opening up your service panel?
Answer: Your existing outlet (NEMA 6-20) is used for 240 volts while your USB/outlet (5-15) is designed for 120 volts. Assuming the 6-20 is correctly wired, you cannot just replace it with the USB outlet. As well as supplying the wrong voltage to anything plugged into it, the USB charger that is built in will probably die, possibly violently!
(The key to knowing that it is for 240 volts is that the right-hand slot is horizontal instead of vertical. The T-slot on the left is for 20 amps and can accept either a 6-15 (15 amp) ot 6-20 (20 amp) plug.)
If you want to use the new outlet in that place, you will need to go into your fuse/breaker box and change the wiring to the outlet to 120 volts.
Comment: @BaratierErebusDuHalm 6-20 is the standard 240 volt 20 amp outlet. There's also the 6-15 and 6-30 for 15 and 30 amps. 5 series is always 120 volts and 6 series is always 240 volts. There's also the 14 series which adds a neutral to the 6 series for devices that use both 240 and 120 volts. See https://en.m.wikipedia.org/wiki/NEMA_connector for details.
Comment: what about just replacing it with a normal outlet (no USB)...  The room will be a music room and will be having guitar/bass amps and other studio equipment, so the 240V is needed as is to being able to plug the equipment.
Comment: It is against code and dangerous to put a 120 volt outlet on 240 volts. While what you plug into it may accept a wide range of voltages, someone else might, unknowingly, plug a 120 volt-only device into it and have it blow up in his face.
Comment: So the NEMA 6-20 is always used with 240V outlets?  thus any 240V device will have a compatible plug...
Comment: BTW, 120 and 240 volts are nominal. They really represent 110-125 and 220-250 volts.
Answer: You would need a 240v USB outlet.
They are common everywhere but north america, but the issue is getting the US plugs as well. The only places with US plugs and 240 are Japan and Columbia, so if you can find a combo USB outlet for those places it should work without rewiring or using bulky adapters.
If you just want USB (no AC), there's a ton of options because just about any universal or non-us adapter plate will work, and you don't have to match connectors: USB is the same worldwide.
Answer: It certainly resembles a standard outlet, doesn't it?  It's actually a NEMA 6-20 receptacle made for 240V.  I did a quick search for NEMA 6-20 receptacle+USB combos, and found none.
It is probably connected to the service panel with 12-2 cable, black/white/bare wires.  It's the same wire you use to hook up normal receptacles.  Except the white/black wires both land on a 240V/20A breaker and are both hot.  No neutral.
If you just yanked this out and fit a common USB+receptacle combo, it would fry everything you plugged into it.
Inside the panel, it could be rewired to land the white wire on the neutral bar instead of the breaker. The black wire can stay where it is.  Once this is done,  you must also simultaneously change out the receptacle for the common NEMA 5 type (you know the one) and yeah, you have a picture of a NEMA 5-15+USB one.
Answer: Since that outlet is 240V, the easiest solution is to keep the outlet in the wall and use an international adapter that will allow you to use a regular USB power adapter in it.  Most USB power adapters will work on a voltage range of 100-240 VAC and a frequency of 50-60 Hz, but verify that your adapter specifies that it works on 240 VAC and 60 Hz before doing this.
Below is an example of the international power adapter that you would need. This will plug into your existing outlet and allow you to use a normal USB power adapter on it as long as you verify that the AC power adapter works on 240 VAC and 60 Hz (which most of them do.)
Comment: That particular adapter is probably not code-compliant. It reminds me of what [at least one electrician calls a "Deathdapter"](https://www.google.com/search?q=big+clive+deathdapter)
Comment: Physically adapting a 240v outlet to fit a 120v device will probably fry the device.


How do we perform the time derivative of the perturbation series for the time-evolution operator?

Question: The following image is from Greiner's book, Field Quantisation, where he carried out the derivative in question. The only way I could make sense of it, was that the derivative acts only on the last integral of element $dt_n$ because the latter is essentially the only variable and all others depend on it (?); it gives the delta function $\delta(t-t_n)$; and that obtains $\hat H_1(t)$. When I isolate the corresponding integral however, it doesn't pan out. Furthermore, I still can't make sense of the $n$ and change of the sum range that the author claims comes from the symmetry of the integrand. How so ?
Answer: It is much simpler if we write the time ordered integrals in the form
\begin{align}
U(t,t_0) &= \sum_{n=1}^\infty \frac{(-i)^n}{(n-1)!} T \int_{t_0}^t dt_1\dots\int_{t_0}^t dt_{n-1} H(t_1)\dots H(t_{n-1})\\
&= \sum_{n=1}^\infty (-i)^n \int_{t_0}^t dt_1\int_{t_0}^{t_1}dt_2\dots \int_{t_0}^{t_{n-1}}dt_{n-1} H(t_1)\dots H(t_{n-1})\;.
\end{align}
Notice the change in the limits of integration now enforces time ordering. In this form $t$ enters only through the 1st integration boundary, so it is straightforward to differentiate using the fundamental theorem of calculus (we are taking the derivative of an integral) to get the required result.
Answer: Hint: The Schrödinger equation (8.43) can be proven by using

the group property
$$U(t_3,t_1)~=~U(t_3,t_2)U(t_2,t_1)$$
of the time-evolution operator $U$, and

Taylor expansion of $U(t+\delta t,t)$.

For more details, see my Phys.SE answer here.


How to arrange documents in a collection alphabetically in mongodb?

Question: How do I arrange my document names in a collection alphabetically and henceforth make my searches for a particular document faster?
Say I have a million documents in a collection. I want to search for a single document as fast as possible and I believe doing it alphabetically is fastest. How do I do it?
Answer: The simplest way to do what you're asking would be to use a well-considered compound index. This article from MongoDB explains it pretty well:

Compound indexes are indexes composed of several different fields. For example, instead of having one index on "Last name" and another on "First name", it is typically most efficient to create an index that includes both "Last name" and "First name" if you query against both of the names. Our compound index can still be used to filter queries that specify the last name only.

You can learn more about compound index creation from the MongoDB website and, if you enjoy books, Shannon Bradshaw goes into greater detail on this and other performance-related subjects.


Who is this pink-haired, bespectacled anime character?

Question: I was on Twitter when I met a girl with this anime icon and now I want to watch, but I don't know which anime is this character from.
Comment: Close vote retracted: Based on the given answer, this does appear to be a sci-fi/fantasy anime.  However, I'll be leaving my downvote since this is a poorly-researched question in my opinion.
Comment: I found it by using [WhatAnime.ga](https://whatanime.ga/?url=https%3a%2f%2fi.stack.imgur.com%2f3nIOD.jpg). The first results seem to be from some hentai anime, but the bottom two were a direct hit.
Answer: Kobayashi from Kobayashi-san Chi no Maid Dragon, or Miss Kobayashi's Dragon Maid, or  小林さんちのメイドラゴン. Synopsis of the show from Wikipedia:

As office worker and programmer Kobayashi gets ready for work, she is greeted by a large dragon right outside her front door. The dragon immediately transforms into a human girl in a maid outfit, and introduces herself as Tohru. It turns out, that during a drunken excursion into the mountains the night before, Kobayashi had encountered the dragon, who claimed to have come from another world. Subsequently, Kobayashi had removed a holy sword from Tohru's back, earning her gratitude. With Tohru having no place to stay, Kobayashi offers to let the dragon stay at her home and become her personal maid, to which she agrees.
Despite being efficient at housework, Tohru's unorthodox methods of housekeeping often end up scaring Kobayashi and bringing more trouble than help. Additionally, Tohru's presence attracts other dragons, gods, and mythical beings to her new home. One of these dragons, Kanna, shows up at Kobayashi's door, demanding that Kobayashi return Tohru to the other world. It is then revealed that she'd been exiled from the other world, and having nowhere else to stay, Kobayashi takes her in and becomes her guardian. As both Tohru and Kanna settle into the human world, Kobayashi starts to think of them as family.
Comment: ¯\\_(ツ)_/¯ [This chart](https://4.bp.blogspot.com/-lvgBgsc0IpM/U6GZllp0WfI/AAAAAAAAFLc/9IWG-K9OO6k/s1600/how-men-and-women-see-colors.png) describes me pretty accurately. I guess coral, pink, or reddish would all work ;D
Comment: [This image](https://static.zerochan.net/Kobayashi-san.Chi.no.Maid.Dragon.full.2074815.jpg) shows the character with the red hair.
Comment: @Gallifreyan Yeah, her description says red-haired, but it's pretty pale. I'm not sure I would call it red or pink, myself. Perhaps coral?


Appium with C# and visual studio not working on iOS

Question: I am trying to install a setup of Appium server on MAC and visual studio on a windows machine. I have installed Node.js version 8.9.4, and npm 5.6.0, Appium server version is 1.4.8 onto MAC, Xcode Version 9.0.1 (9A1004) and trying to launch my .app file. I am getting an error as:

An exception of type eOpenQA.Selenium.WebDriverExceptionf occurred
  in WebDriver.dll but was not handled in user code
Additional information: Unexpected error. System.Net.WebException:
  Unable to connect to the remote server >
  System.Net.Sockets.SocketException: The requested address is not valid
  in its context 0.0.0.0:4723
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot,
  SocketAddress socketAddress)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean
  connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress&
  address, ConnectSocketState state, IAsyncResult asyncResult,
  Exception& exception)
\ End of inner exception stack trace \
at
  OpenQA.Selenium.Appium.Service.AppiumCommandExecutor.Execute(Command
  commandToExecute)
at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String
  driverCommandToExecute, Dictionary`2 parameters).

Please help me solve this issue and launch the app.
I had one more doubt that how do we get the Uri address for the server.
Answer: <code>Unable to connect to the remote server > System.Net.Sockets.SocketException: The requested address is not valid in its context 0.0.0.0:4723
</code>
You're trying to connect to local appium server(0.0.0.0:4723) but you mention it at the beginning that your appium server is on mac machine so you need to pass it IP of that machine when you're creating session for a test run.


Ceiling fan light fixture comes on with fan

Question: I installed a new light fixture on my ceiling fan and apparently did something wrong with the wiring. The lights will only come on when the fan itself is running and are dim. It appears that they are somehow sharing the same power supply, I connected the light fixture to the white and black cords in the fan. I first attempted to connect the light fixture to the blue and white wires but this resulted in neither the fan or lights turning on. Any ideas on a fix?
Comment: Hello and welcome to stack exchange.  Can you post pictures of the current wiring, and any instructions that came with your fan?
Comment: How many light switches do you have in the wall? Can you post photos of the wiring at both the fan and switch ends?
Comment: I suspect you have a switch loop and disconnected too much stuff. We're gonna need some photos.  You can log in with the credentials you used before (check your email), [edit] your post, then hit the mountains-and-sun icon to add a pic.
Answer: White to white.
Black and blue (from the fan/light) both go to the incoming power if you only have a single switch. (three wires in one wire nut)
It sounds like what you did was hook them up in series. They need to be in parallel.
Answer: You need a separate switch wired to operate them separately. Running one off the other is why they turn on and off together.


Can anybody explain cvRemap with a code using cvRemap in OpenCV?

Question: OpenCV users know that cvRemap is  used for doing geometric transformations.
The mapx and mapy arguments are the data structures which give the mapping
information in the destination image.
Can I create two integer arrays holding random values from 1 to 1024 or from 1 to 768
if I deal with images (1024 X 768)
And then make mapx and mapy assigned with these values?
And then use them in cvRemap()?
Will it do the job or the only way to use mapx and mapy is get its value assigned by using the function cvUndistortMap()?
I want to know because I want to warp the images.
Just in case to tell you that I have already checked out Learning OpenCV book too.
Answer: I use cvRemap to apply distortion correction.
The map_x part is in image resolution and stores for each pixel the x-offset to be applied, while map_y part is the same for the y-offset.
in case of undistortion
<code># create map_x/map_y
self.map_x = cvCreateImage(cvGetSize(self.image), IPL_DEPTH_32F, 1)
self.map_y = cvCreateImage(cvGetSize(self.image), IPL_DEPTH_32F, 1)
# I know the camera intrisic already so create a distortion map out
# of it for each image pixel
# this defined where each pixel has to go so the image is no longer
# distorded
cvInitUndistortMap(self.intrinsic, self.distortion, self.map_x, self.map_y)
# later in the code:
# "image_raw" is the distorted image, i want to store the undistorted into
# "self.image"
cvRemap(image_raw, self.image, self.map_x, self.map_y)
</code>
Therefore: map_x/map_y are floating point values and in image resolution, like two images in 1024x768. What happens in cvRemap is basicly something like
<code>orig_pixel = input_image[x,y]
new_x = map_x[x,y]
new_y = map_y[x,y]
output_image[new_x,new_y] = orig_pixel
</code>
What kind of geometric transformations do you want to do with this?


Determining Memory Leak from Garbage Collection Log

Question: I am running my java file like this.
<code>java -Xmx8m -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -Xloggc:D:/MyExample/my.log MyJava
</code>
How do I interpret if there is memory leak in my program from the Garbage Collection log at my.log ?
Please do not suggest a tool to read my log. I want to know how to interpret the GC log to determine if there is a memory leak?
Comment: there isn't a real memory leak in pure Java (no native or JNI).
Answer: What you can have in Java is an undesirable retension of memory.  This is not a memory leak in the strick sense but can still be a problem.
The simplest thing to do is to look at how much memory is used after a FULL GC.  This tells you the amount of memory retained.  If the amount retained continues to grow after you expect it to remain stable you have a "leak" Only you can determine at what point you expect it to be stable (not increasing or decreasing significantly)


What's the best way to ask a merchant to accept Bitcoin?

Question: When I buy something off the internet, I'd like to ask the merchant to consider accepting Bitcoin. What's the best way to explain to a merchant what Bitcoin is, and what it would do for them? Any success stories?
Comment: Hi NYCBrit, I don't believe that this is a good fit for the Q&A format. "We expect answers to generally involve facts, references, or specific expertise; this question will likely solicit opinion, debate, arguments, polling, or extended discussion." I'll let others have their say before closing it though.
Comment: I like the question... But anyway, I think that suggesting bit-pay is a good idea because they deal with price fluctuation. Accepting bitcoins without a similar mechanism will probably result in heavy losses for the merchant.
Comment: This probably should be moved to the forum, probably under Project Development.
Comment: As a customer, you just don't: it makes no sense and you will be rightly ignored. The only way you can do such a thing is setting up a whole counseling firm aimed to professionally promote Bitcon's use (and helping, for a fee, to set it up).
Comment: Hi D.H., sorry you didn't like the question, I'll try to rephrase it as more of a question requiring facts.
Answer: Probably you should approach the merchant with a group of friends, and each one of you should separately ask him over the span of a couple days a question like: "I would like to buy X from you, but I would like to pay for it in Bitcoins. I understand that this is sort of payment gives you more work, so I am willing to pay Y% more. The current exchange rate at https://mtgox.com is Z USD/BTC and going up, so will you consider selling me X for Q amount of Bitcoins?" If the merchant is small, he probably will be okay with accepting Bitcoins for a moderate transaction, you can even offer waiting a bit until the Bitcoin exchange goes through (or say, a down-payment, so the merchant will know how this thing works before committing to anything). You would probably need to follow up a bit on that inquiry explaining some things about Bitcoins, but not including all the details on how the coins work probably works in your benefit (your email doesn't look like soliciting, but as a more genuine inquiry).
A bigger merchant will probably say no (unless they are tech-savvy), but after a couple people would ask about payment in Bitcoins, the lost opportunity costs would start adding up.
Generally, you can try convincing merchants with some benefits of Bitcoin technology, but probably nothing works better than money incentives and business opportunities.
(note: method not tested)


今何をしてる vs 今何をしてるの

Question: I think both are informal ways of saying "What are you doing (now)?"
What's the different between the る version and the るの version?
Answer: Firstly, it should be noted that ending a sentence with の like that is generally more feminine.
In more depth, の (when it is not a particle) can be viewed as a proxy for another word. In a sentence like this, I think it's generally to safe to say that it's something like 訳. Outside of that, in "何をしているの" the の tends to soften the speaker's tone (hence why it is generally feminine). In this case, the の is generally supplying a tone of seeking/giving explanation, which you'll see written in beginner-level Japanese textbooks.
In a similar, more masculine sentence, 今、何してるんだ, the の (here, shortened to ん) does not perform that softening role and is overshadowed by the だ which makes the sentence more forceful. However, the "explanation" intonation is still present.

今何をしてる vs 今何をしてるの


estimating class homework

Question: I have an estimating contracts class. the assignment calls for bidding on a excavating job. I am not able to determine the of amount of time I will need a supervisor for, but the assignment calls for paying one. It gives the per hour amount and how many hours per day. I having trouble with where I get the info to determine the amount of days it will take for the whoe
Comment: Hi rell, the background you share is hardly understandable. What's more the question you ask seems to be unanswerable--how one could possible answer how much time would take something that isn't defined in a question. Please update the question so it is more specific, otherwise you don't really give anyone a chance to answer it in a meaningful way.
Answer: You will need a Supervisor/Superintendent for every day that the excavation operation is going on. Excavation crews cannot work without supervision. It's a safety issue. So figure one Supervisor day for every crew day.

estimating class homework


How is Firefox safe mode triggered?

Question: Does anyone know what file Firefox uses, on a Mac, to trigger a startup in safe mode? I am on a Mac, and I have not been able to find out what Firefox does to mark that it needs to start up in Safe Mode. There have been methods to bypass safe mode, but I am looking for a way to nip it in the bud before the program launches.
Comment: "nip it in the butt" - Ouch! (I hope no-one edits it out, sounds more, umm, apt somehow :)
Comment: Why do you want to know? Is Firefox opening in safe mode without you explicitly setting this? Do you never want Firefox to open in safe mode?
Answer: It uses a command line argument, not a file. I believe this to be true on Firefox compiled for macs too.
<code>$ firefox --help
Usage: firefox [ options ... ] [URL]
       where options include:

X11 options
  --display=DISPLAY  X display to use
  --sync             Make X calls synchronous
  --g-fatal-warnings Make all warnings fatal

Firefox options
  -h or -help        Print this message.
  -v or -version     Print Firefox version.
  -P <profile>       Start with <profile>.
  -migration         Start with migration wizard.
  -ProfileManager    Start with ProfileManager.
  -no-remote         Open new instance, not a new window in running instance.
  -UILocale <locale> Start with <locale> resources as UI Locale.
  -safe-mode         Disables extensions and themes for this session.
  -jsconsole         Open the Error console.
  -browser           Open a browser window.
  -new-window  <url> Open <url> in a new window.
  -new-tab     <url> Open <url> in a new tab.
  -preferences       Open Preferences dialog.
  -search     <term> Search <term> with your default search engine.
  -private           Enable private browsing mode.
  -private-toggle    Toggle private browsing mode.
  -setDefaultBrowser Set this app as the default browser.
</code>

How is Firefox safe mode triggered?


Beginning model and prime lens

Question: I was thinking of buying a Canon EOS Rebel T6 to start of with DSLR. Is it a good option? Previously I have used Canon EOS 1200D and Nikon D3300 from some of my friends. And also should I buy the f/1.8 prime lens simultaneously? I want to click some portraits as well.
Comment: Which f/1.8 prime lens? There are several, including more than one at the 50mm focal length.
Comment: "Is it a good option?" Option for WHAT? Using as a doorstop? (probably a little expensive) For shooting sports for a wire service? For taking landscape photos at sunrise/sunset? For doing product photography? Etc.
Answer: The EOS Rebel T6 is a good option considering its low price. It is an entry level DSLR so if you are a beginner it should suit your needs.
Moreover given its low price you can afford to invest in a 1.8 prime lens to complement the kit one(if you are buying it). You will have to choose which focal length you want to have. The first 2 options that come in mind are the 35mm and the 50mm, if you want to shoot portraits the 50mm is obviously better.
Comment: Well it is usually an investment into better photos(if you know how to use it), that is what i meant.
Comment: I doubt you'll ever sell a 1.8 prime lens for more than you bought it new (unless the yen goes WAY up against the USD). A lens is an *expense*, not an investment!

Beginning model and prime lens


Page currently being edited by another user notification?

Question: Any thoughts on how I could let  users know when they go to a page in the backend that/if another user is currently editing that page? I don't need it to lock editing, just to present a notice that it's being looked at/edited by someone else
Answer: It would definitely have to be a plugin, but I'm not sure the right events are available for a plugin to pull it off right now.
Seems like there would need to be at least two that need to be created.  Some onDisplayEntry event that gets fired as soon as an entry page is viewed and another onEditEntry event that gets fired over AJAX as soon as any field value changes.


Importing 40 gb mysql file via phpmyadmin

Question: I have a 40 GB MySQL dump file. Can anyone give me the idea how to import the file via phpmyadmin?
Comment: Don't. There's clearly a difference of opinion about the scale of your operations between whoever only allows you access via PHPmyAdmin and your business requirements (requiring 40GB of data).
Comment: I'd say don't even try. Load it from the database server, not over a web interface.
Answer: If you really want to restore it with PHPmyadmin you have to split the files into little chunks, because PHP will block too large files, depending on the serverconfig.

Dump just the structure of your tables
Import them
Dump the data of your tables into a csv
split the csv (on windows you can do this with gsplit for example and on unix with the split command
Import the little chunks of data

But in general i'll recommend the commandline or contact your ISP
Answer: You better use a program like Sequel Pro or MySQL Workbench to import data if you don't have terminal access.

If you have terminal access use:
<code>mysql -u username -ppassword database_name < dump.sql
</code>
Answer: Don't do large restore with phpmyadmin, PHP will block you, you will have something like "Allowed memory size" after few megs loaded...
Max.
Comment: It depends - if I run my server, I can change the PHP settings as I wish, and even very big files could be uploaded that way.  I don't say phpmyadmin will digest it, so I basically agree with 'don't do it'
Comment: Sure, but if you have access on your servers, use the mysql client instead.


I want to add a user in CIVI using drupal

Question: I would like to create a user profile without administration privileges but can add people to our account. For example we have 3 employees, I want them to have access to the clients we serve but not be able to make administrative changes. I am able to add a user profile for drupal but not add it for civi.
Comment: Have a look at the CiviCRM permissions that Drupal offers via the People > Permissions screen
Answer: That is possible. The way I would recommend going about this is making a new role in Drupal for your staff.  People -> Roles -> Add role

After adding the role, you can then navigate to People -> Permissions and change settings as you wish! You can set specific access to CiviCRM with certain permissions granted, while others (more admin-level permissions) remain hidden from them. Then, simply set their drupal role to be the newly created role.


Updating cylinder's properties using a scipt

Question: I created cylinders using the bpy.ops.mesh.primitive_cylinder_add() command (I used this example). How can I update their radius (or any other property) using python script, instead of deleting the objects and recreate them?
I'm using those cylinders to display connection between areas in the brain, as part of an addon I'm implementing. I want to let the user to pick the radius of the cylinders (for rendering purposes), or to automatically change them according to the connections' strength (which may vary).
Comment: Creation is usually viewed as a one way operation with no long term guarantees.  Do you allow editing of the mesh such that the result is no longer recognizable to most people as a sphere? What is the larger picture of what you are trying to do?  You may get more help by answering that question.
Comment: My question is still the same above in the comments.  I tend to think at this time I can not provide any insight to you.  I do not understand your larger goal.  Please place you work in the question rather than a link.  Please state your experience with Python.
Comment: The link is just for the code how I created the cylinder. My end users are going to work wit Blender. I changed the layout and added some buttons. One of the options is to create connections between areas in the brain. I want to let the users the option to change the cylinders properties (like radius) after they created them. Does it make more sense?
Answer: An example using a custom property with an update method.
<code>import bpy
from bpy.props import FloatProperty
context = bpy.context
scene = context.scene

def bond_strength(self, context):
    self.scale.x = self.scale.y =  self.bond_strength
    return None

# create a custom property on all objects
bpy.types.Object.bond_strength = FloatProperty(name="Strength",
                                               default = 1.0,
                                               precision = 4,
                                               update=bond_strength)

# adds a slider to UI object properties panel. # would be in a custom Panel
if True: # only need to run this once
    def show_strength(self, context):
        self.layout.prop(context.object, "bond_strength")
    bpy.types.OBJECT_PT_context_object.remove(show_strength) # put in unregister
    bpy.types.OBJECT_PT_context_object.append(show_strength)

# add a primitive
bpy.ops.mesh.primitive_cylinder_add(radius=1.0)

#create more
cyl = context.active_object  # newly created cylinder

for i in range(4):
    cyl = cyl.copy()
    scene.objects.link(cyl)
    cyl.bond_strength *= 0.5
    cyl.location.x += 2
</code>
Answer: You can set the scale of any of the XYZ axis in Python which can effectively change the radius.
You can also consider shape keys.
Since any mesh object can be edited we do have a worst case scenario.  Near Worse case scenario might be all vertices deleted except 1 vertex.
Comment: So given that I already created a cylinder, what script should I use to change its radius, lets say from 0.05 to 0.1?


How to use last clicked x/y coordinates in a qgis action?

Question: I created an action (layer properties > actions) that opens an online map.
For the action I use this expression to dynamically generate the url of the map.
[% ürl" %]/?op=flyTo&cam=[% x($geometry)%],[% y($geometry) %],500.00&look=[% x($geometry)%],[% y($geometry)%],25.00

This works: the online map opens at the x/y position of the center of the object that you click.
For example:
https://pointscene.com/scene/85300c83/share/8a7f7c68262ccc1fbebdc38031f68dc4/?op=flyTo&cam=93618.37,436479.01,500.00&look=93618.37,436479.01,25.00
Question:
Instead of opening the online map at the center of the object that I clicked, I would like to open the map at the exact mapcoördinates that I clicked.
I noticed these coördinates are shown in the info tool window, as 'derived' data. But I can't find them in the expression builder.
So: how do I use the last clicked coördinates in my action?
Answer: @click_x and @click_y will give you those, however be aware they still only work on features and not just any place on the map.
Comment: Thanks Nathan, that's exactly what I need. However instead of `@click_x` and `@click_y` I had to use `$clickx` and `$clicky`


Saturation vapour pressure and the effect of ambient gas other than water vapour

Question: Water (or any liquid/solid for that matter) has a saturation vapour pressure (SVP) that follows the curve given by Clausius-Clapeyron. At room temperature the SVP of water is about $0.023$ bar, so in the atmosphere at $20$°C, the fraction of water vapour in the air above the sea (in equilibrium) will be $2.3\%$. If we had vacuum or 10 bar ambient pressure the partial pressure of water vapour would still be $0.023$ bar, right? What I'm confused about is, why the ambient pressure of dry air (or any ambient gas other than water vapour) is not relevant to this? Water vapour will accumulate in the gas from the liquid phase till it reaches the SVP. Is there no interaction with the other molecules in the air? I hope it's clear what I mean.
Answer: This is Dalton's law of partial pressures.  In the low density regime where all the gases can be treated as "ideal" the total pressure is simply the sum of all the pressures that the different components of gas (water vapour, nitrogen, oxygen, argon etc.) would exert if the other components were not there. In other words the the molecules of the gases don't see each other.  This is not exactly true of course, or the gas would never be able to relax to thermal equilibrium.
Comment: Ok, I see were your "ideal" gas comes into play where interactions are neglected, but I don't quite see how this applies to the liquid and gas phase mixture. Don't you have to consider the system liquid-gas together and not just treat it as an ideal gas? I'm wondering why the liquid water doesn't "care" about the other constituents making up the total pressure in the gas phase above.
Comment: It cares when it comes to *boiling.* The liquid can only turn into vapour on its  surface, as the pressure *inside* the liquid is the *total pressure*, water vapour plus all the rest. That's why a liquid can only boil (turn to vapour throughout its volume) when the vapour pressure is greater than or equal to the total atmospheric pressure.
Answer:
If we had vacuum or 10 bar ambient pressure the partial pressure of water vapour would still be 0.023 bar, right? What I'm confused about is, why the ambient pressure of dry air (or any ambient gas other than water vapour) is not relevant to this?

Assuming validity of the Clausius-Clapeyron equation, ambient pressure of the air may influence the equilibrium pressure of water vapor. This is because higher ambient pressure means liquid is more compressed so it has lower specific volume and latent specific heat can be changed by that as well. But liquid water is only weakly compressible, any effect of external pressure in ranges 1-10bar on any water property seems to be very weak so all this is usually neglected and for these ranges of pressure, we can use the approximation of constant specific volume.
High enough pressure is however needed to maintain part of water in liquid phase so that equilibrium between liquid and vapor can exist. If the pressure was decreased too low, the liquid would start to evaporate from inside - it would start to boil and eventually turn into all vapor or (if in closed vessel with enough liquid) find a new equilibrium between liquid and vapor.
Other gases such as air also don't interact with vapor or liquid water much so the evaporation process isn't affected by atmospheric gases.
This could change if the other gas was too dense or more reactive so its interaction with the water vapor or solubility in water was stronger. I would expect strongly soluble gases such as $\text{SO}_2$ or $\text{HCl}$ to change equilibrium between liquid and its vapor more visibly. For example, the solution can be hygroscopic and thus decrease the partial pressure of water in the gas phase.
This paper [1] studies partial pressure water dependence on concentration of $\text{H}_2\text{SO}_4$ in the water liquid phase and it says there is a dependence. Intuitively, latent heat $L$ in the C-C equation should be very sensitive to concentration of other polar molecules if there is enough of them (so that major part of water molecules are affected by them).
[1]     Crawford H. Greenewalt, Partial Pressure of Water Out of Aqueous Solutions of Sulfuric Acid., Ind. Eng. Chem. 1925, 17, 5, 522–523, https://doi.org/10.1021/ie50185a036
Comment: You probably meant to say "find a new equilibrium at HIGHER pressure", or?
Comment: That was not a good formulation, fixed.


Add icon on "Related" question list that shows answered status

Question: When you're viewing a question, there's a list of "Related" questions on the right. I propose that a small icon be added to the titles that indicates if they're currently answered or not. I often use this list to jump from question to question, and if I can easily identify ones that are still unanswered, that's ideal.
Answer: Very nice idea! The list of related questions is often very long and some further hints might be really beneficial for someone looking for answers (or questions).
Answer: It's unlikely we will do this, since we want people to explore related questions regardless of their status, or number of answers.
The only salient point is that the question has a strong relationship to the current question, based on

title match
tags match (heavily weighted)
body text match
Comment: An item missing from the list is * links to the question currently being viewed

This would make a lot of sense to include, yes?
Comment: @Jeff: yes, Jeff, but you are actually discouraging us, I only stick to query searches, now, they are so much more effective.
Answer: I've voted for this, but note that the current Related Questions feature gives you this when you start to ask a question. Another case of the Related Questions being better than Search.


Same app namespace for multiple apps for an ISV vendor

Question: For an ISV vendor, if a vendor has multiple apps. Can the vendor apps share the same namespace or it should be distributed by different namespace. The apps should be able to communicate/access with each other. If a vendor has App1 and App2, vendor should be able to sell App1 and App2 individually. If a customer buys App1 and App2, App1 should be able to access App2. If a customer buys App2, he is all good. He need not access App1. How do we need to list in the AppExchange? Is it App1+App2, App1, App2? Or just App1 and App2 individually as they bot have same namespace?
Answer: In Salesforce (classic) an app is a set of tabs that can be switched to via the select list in the top right hand corner of the screen. So you can certainly include multiple apps in a single AppExchange managed package (using a single namespace and single AppExchange entry). Those apps can share code as well as objects without having to resort to using the global keyword.
However, if you want to use the License Management App (LMA) to control access, the managed package as a whole as the thing licensed. So if in one managed package you include multiple apps that you want to charge separately for, you will have to manage/enforce that licensing yourself.
If you create two managed packages then you can have two namespaces and two AppExchange entries and the LMA will handle the licensing. However for them to be independently installable/usable you will have to avoid all compile-time dependency between them, meaning you will need to use dynamic SOQL to access the objects of one from the other and will not be able to directly invoke code of one from the other.
PS Just noticed you have lightning-components as a tag on your question: other rules may apply for those.
Comment: Keith, it is LMA. So, if a vendor has two apps individually hosted in the Appexchange. do they share the same namespace or a different namespace?
Comment: In my experience always different namespaces.
Comment: tagged lightning-components because my app is built using lightning components.
Answer: An ISV can not create two different managed package applications with the same namespace. The namespace is determined by the packaging org, and each org only supports a single managed package.
The licensing is all taken care of by the LMA and the customer needs to have the relevant licences to use each of the packages.
Your code is a different story and App 1 will need to use the App 2 namespace when working with components from that app and vice versa.


Help me with my friends code?

Question: My friend has asked me to decrypt his code but I haven't been given any clues and I was looking to see if any one could help me crack it. The code is: ╔á╔ª56╔áãÆ╔á╔ª56╔áãÆãÆ45╔áÓ½«2ãÆ45╔áÓ½«2╔ôÓ½«ÎÉ6ÔêéãÆ╔ôÓ½«ÎÉ6ÔêéãÆÎÉãÆ64ã¡Ó©úÎÉãÆ64ã¡Ó©úÓ©ú╔áãÆ4╔ªãÆÓ©ú╔áãÆ4╔ªãÆãÆÔêé4Ó½«╩ØÓ©úãÆÔêé4Ó½«╩ØÓ©úãÆ45╔áÓ½«2ãÆ45╔áÓ½«2ãÆÔêé4Ó½«╩ØÓ©úãÆÔêé4Ó½«╩ØÓ©úÓ©ú╔áãÆ4╔ªãÆÓ©ú╔áãÆ4╔ªãÆã¡5╔ª4ãÆÔêéã¡5╔ª4ãÆÔêé┬ÁÔêéãÆ╔▒45┬ÁÔêéãÆ╔▒45╔á╔ª56╔áãÆ╔á╔ª56╔áãÆ
Comment: Can you ask your friend if each symbol corresponds to a letter in the alphabet?
Answer: Partial answer: significant progress in analysing the text, but stuck
First, I noticed

 that each of the characters was in Code Page 850 (the character set used by DOS).

 (Note: this isn't technically true: I had to normalize them, combining the "letter plus accent" characters into their single-character form.)

After a bit of time trying to decode as a cryptogram, I found an interesting structure to them:

 The text can be divided up into sections of 10-14 characters, each of which repeats twice. So it starts ╔á╔ª56╔áãÆ / ╔á╔ª56╔áãÆ / ãÆ45╔áÓ½«2 / ãÆ45╔áÓ½«2 / ╔ôÓ½«ÎÉ6ÔêéãÆ / ╔ôÓ½«ÎÉ6ÔêéãÆ... (slashes added by me).

And even more structure:

 Many "chunks" of 2 or 3 characters in those lines were repeated. I marked all of them, and discovered an interesting piece of data coming out of there:

 If we count each of the individual digits as a chunk as well, then:
 - We have 16 different chunks total.
 - Each line is exactly 6 chunks long.

This suggested something to me:

 these could be representing colors in hexadecimal. There are no commonly-recognized hex colors that have the form __45__ (that I could find), so presumably the digits are encoded somehow too. (I'm still not sure how this encoding works, though -- I'll try to cryptogram it using lists of colors and see if I can break it that way.)

 There are many different lists of hex colors, so this next part may be difficult to do without having figured out the encoding. Starting with the first color, it appears that there's only one hex color satisfying the ablmac pattern in the list of extended web colors. That would be Orchid, DA70D6. Unfortunately, this doesn't seem to give anything for some of the other colors: for example, there's no color fitting __7D__ for the second line.

So, what next?

 Apart from the numbers, every single character in the message starts with a 1 bit (that is, it's not in ASCII range, but in the upper half of CP850.) This could be important to figuring out how the chunks are encoded. I didn't get anything out of various bit-manipulations on the results, though.

 It's also possible that it's not colors being encoded at all, but something else that would make the repetition make sense. Each line being repeated twice could just be confirming the division into lines, but there could also be something else to it.

Help me with my friends code?


Continuum and Choice sequence

Question: I am reading a paper on Brouwer's intuitionism. It mentions that according to Brouwer, the concept of continuum is perceived as a whole by intuition. However, it also mentions setting up choice sequences. If "continuum" is indeed perceived intuitively, why would we even attempt to use such choice sequence? We should automatically understand the notion "continuum". I fail to understand the relationship between choice sequence and intuition.
Comment: TLDR Philosophy to many metaphilosophical theories consists of bringing intuitions to the formal light of language and logic, and then exploring the ramifications. Thus, defining infinity in terms of algorithms rather than a transcendental object, besides furthering metaphysics, also shows relationships that exist between mathematics, computer science, and logic, and goes towards seeing formal systems as a distinct topic as one does when adducing such claims as the [Curry-Howard correspondence](https://en.wikipedia.org/wiki/Curry%E2%80%93Howard_correspondence).
Comment: "the concept of continuum is perceived as a whole by intuition" Correct: we "see" the geometrical line and that is the intuitive *continuum*, but mathematician tried to "build" it numerically: Cauchy, Weierstrass, Cantor. This historical process culminated with Cantorian set theory, that was unacceptable for Brouwer.
Comment: Thus, Brouwer attempted at a new "numerical" construction of the continuum (the natural numbers are acceptable for Brouwer): choice sequences.
Answer: As you have read, mathematical constructivism rejects mathematical objects as entities, and allows for existential quantification in the case they can be constructed, or in a more modern parlance, computed. Thus, the debate on potential and actual infinity, to the constructivist, is no debate at all, since actual infinity is a Platonic entity that our intuition somehow supplies us with, and lacks actual rigor in terms of using a formal systems, which can be seen as an algorithm that computably (or recursively in older language) creates theorems using a rule set that itself includes rules of logic. So, a choice sequence can be understood as an algorithmic grounding of the term infinity.
Why do all of this? Well, first of all, infinity is a very useful concept, especially in defining continuity, and continuity is a purported property of space-time. But for a constructivist, it creates a problem in metaphysical explanation (SEP), because a constructivist rejects notions like Platonic realms and transcendental truth in favor for, in terms of my own discipline, physical computation (SEP). A Platonist can wave Plato's wand of woo and just summon forth 'infinity' and claim there is some other physical reality. Of course, that's an empirical no-no because it violates a basic precept that the burden of proof falls on the claimant, and without an adequate proof consisting of empirical evidence, one is simply left to wonder why the woo isn't just voodoo.
Thus, a constructivist, particularly a robust defender of the project of materialism that stems from a physicalist conception of the universe needs an explanation of what this useful infinity is. The alternative to all of the non-scientific alternate universes, modal realisms, and transcendental realities boils down to accepting some form of nominalism (SEP) and conceding that the term 'infinity' has a semantic grounding that doesn't exist with an empirical character, but rather a linguistic one. In fact, one can simply ground it in physical computation, and now there is a metaphysical explanation of infinity that is nominalistic, AND to boot a series of techniques for proving theorems and finding axioms.
For instance, in reverse mathematics, one of the chief concerns is computing enumerable sets from computable total functions (which is a type of infinite mapping composed of an infinite domain). These sorts of metaphysical strategies for semantic grounding of 'infinity' have wide applicability, not just in mathematics, but in computer science as well, where programing languages as virtual machines are often defined in terms of operational semantics.
So, while strictly speaking one can just use intuition, and rely on Platonic mathematical philosophy to metaphysically justify mathematics, in the same way Plato did 2,500 years ago, the curious mind rejects such mathematical philosophy as a fiction and certainly lacking in the rigor that Hilbert is chiefly famous for insisting guide mathematics (and one should add mathematical formalisms of computer science and mathematical logic). There is nothing wrong with pretending infinity exists and the natural numbers "just are" to get through calculus in high school, but at higher levels of math PA, TM, RCA0, ZF, and the full burden of formalized systems of mathematics look for a more complete explanation, and for many of us, one compatible with philosophy of science.

Continuum and Choice sequence


.NET persistence framework that supports test data

Question: We are currently using SubSonic as our persistence layer because it's light but also because it allows us to feed in test data so our DAL can be tested without hitting the database.  I absolutely love that about SubSonic.  However, because we are also running into other issues with SubSonic, I'm now looking for an alternative while our project is still young.  Long story short, is there another persistence framework for .NET that will allow developers to sub in test data?
Comment: but do we actually test DAL with unit testing?? http://stackoverflow.com/questions/1257560/when-is-a-test-not-a-unit-test
Comment: We use BDD at our shop, so we write specs for the DAL.  We have caught incorrect query statements via our BDD specs.
Answer: AFAIK, hNibernate doesn't support for this feature as it is, but it could be achieved if you configure test DB to work in 'in-memory' mode. SQLite supports this mode.
Here is a sample of configuring and tests.
Answer: I doubt you will find that particular feature is another .NET ORM, but there is no reason you can't code it yourself.  If you want an ORM that scales with your project, NHibernate is the best choice.  You may want to poke around Ruby ORMs that run on .NET through IronRuby, but I'm not convinced you'd fine a workable solution.
Answer: UPDATE: After a lengthy search, we did end up switching to NHibernate as our persistence layer and changing our unit testing philosophy for the repository layer.  We concluded that we'll switch to integration testing the repository layer while still unit testing all other layers.
Here's our rationale:
If we just unit test the repository layer, we'll never know how the query will be executed on the database.  For example, if we use an in-memory solution like SQLite, all of our specs may pass at development time, but may actually fail once we deploy to production because of 1) differences in how each NHibernate data provider is implemented and 2) differences in how each product (SQLite vs MS MS SQL Server vs Oracle) implements data types, T-SQL, etc.


gdalwarp can't find libproj.dlib

Question: Thought I had finally got Python, GDAL and QGIS to play nicely together but just tried to do a batch transform using a bash script to call gdalwarp and it claimed it couldn't read the libproj.dlib file. Tried the exact same transformation in QGIS and it worked. Copied the code from QGIS into bash shell and it failed. QGIS is calling the same GDAL library so I don't get this at all. Anyone got any ideas?
This seems to be connected somehow, not sure how, to the EPSG codes for Swedish grids being changed every five minutes and the libraries not being up to date. That said why does QGIS manage the job when bash doesn't?
Comment: Getting worse. Tried entering source system as proj4 string but gdal baulked at the target epsg code and lack if lib file. It failed to transform the coordinates but it DID put the desired header into the file. From where did it get that? If it cant find the library then how the strong sweary word does it know all the metadata asked for via the epsg code?
Answer: Found this:
http://osgeo-org.1560.n6.nabble.com/Unable-to-load-PROJ-4-library-libproj-dylib-td5031442.html
and so added
export PROJSO=/Library/Frameworks/PROJ.framework/PROJ
to my .bash_profile
it works! I'm still running OSX 10.7 and I haven't needed this in my profile before so why I should need it now I can't say by the whole issue with paths is beginning to get a bit tiresome.

gdalwarp can't find libproj.dlib


What is the market share of programs written in .NET nowadays?

Question: We are currently migrating our Visual Basic 6.0 program to .NET. The target audience are just normal desktop users at home. Discussing this, we realized that we cannot come up with mainstream programs that seem to be written in .NET. Are we mistaken? Is there a good reason for this?
Comment: I think Visual Studio and Paint.NET are two mainstream programs that  are written in .NET.
Comment: Can you add code to your current product that reports back what .NET libraries the current users have?
Comment: @ThorbjørnRavnAndersen: yes, you can - Richard Grimes did just that when Vista came out, so you can use his techniques to see what binaries are built with the CLR loader for the apps you have installed. http://www.grimes.demon.co.uk/dotnet/vistaAndDotnet.htm (download at the bottom)
Answer: Your customer don't care if your program is written in .NET or not. Therefore, if you can ensure that the vast majority of your target audience can install and run your software without problems, you are good.
It's very difficult to find accurate information about .NET Framework penetration, so you shouldn't rely on any.
Why not targeting .NET Client Profile and ensure that it is installed along with your binaries? It's easy, simple and effective.

The .NET Framework 4 Client Profile is a subset of the .NET Framework 4 that is optimized for client applications. It provides functionality for most client applications, including Windows Presentation Foundation (WPF), Windows Forms, Windows Communication Foundation (WCF), and ClickOnce features. This enables faster deployment and a smaller install package for applications that target the .NET Framework 4 Client Profile.

I see another big advantage of porting your VB6 code to .NET: the ability to create version of your software that runs on Linux and OSX using Mono. Notable example of desktop applications written in .NET and cross platforms are available here.
Comment: right on the important point: customers don't care about the platform as long as it runs on their systems.  but not-so-right on the final paragraph: mono does work and is an impressive achievement; but it's a nightmare to have installed on end users.  the 'crossplatform' promise of .NET is dead on water.
Comment: @Javier: Well, except for Windows, Windows Phone, and XBox 360.  But the appeal of a bytecode-language dominating Windows was never, for me, cross-platform code; rather, it's that Windows is no longer tied to a particular architecture (x86 is a mess).  [The next version of Windows will also run on ARM](http://goo.gl/NX9Ot).  Also, it's nice that software can now take advantage of setup-specific features; basically, it's all the advantages of the Linux approach (compiling software on every new system), without any of the hassle.
Comment: @BlueRaja-DannyPflughoeft: right, .net (CLR, really) does deliver as a "cross-windows-platforms" platform.  Nothing to sneeze to, in fact
Comment: @BlueRaja: you forget that the stuff that was shown running on ARM was.. Microsoft's C++ code. Things like printer drivers and Office. They aren't .NET applications, so the argument that .NET is necessary is completely false.
Comment: @Javier: Is mono that bad at the installation? I installed a mono app (Banshee) on my Mac OSx and did not encounter any problem. For windows, mono is not required to be installed. As a developer planning to do mono app, I would be really happy if you could provide me with articles or any reference that demonstrate what your say.
Answer: My personal experience is that .NET is dominant in in-house, enterprise-level development. Most of these applications are not build for public consumption and so are not a part of our everyday vocabulary.
Still, there is a very compelling reason that so many large companies have adopted these technologies: programmer productivity and happiness. C# is a wonderful, productive programming language and the .NET ecosystem is rich with existing libraries to keep us having having to reinvent wheels. Also, WCF, while astoundingly complicated at times, is a very powerful framework for building communications between different systems.
In regard to your specific circumstance, I would only undertake the porting of your application if you will be doing lots of enhancements and changes to it in the future. If it is stable and in maintenance mode, you will regret any decision besides leaving it as-is.
Comment: +1 for "C# is wonderful". Its really a wonderful language
Answer: Depending on the definition of "main stream programs", there don't seem to be many of them to be written in VB6 either.
Of course, C# and VB.NET now has taken almost the place where VB6 was ~10 years ago. At least 98% is individual software you cannot buy in your local software store. But that does not mean there are no .NET programs out there. There are a lot - but you will have to search for them at the right places.
Answer: Actually, according to TIOBE, C# (a .NET language) is now the fourth most popular language in the world.
Also, I agree with another poster that clients do not care what language your app is written in, as long as it works.
Comment: Nah, that's just because C coders are Real Programmers, and Real Programmers don't ask for help.
Comment: I think the [number of tags on StackOverflow](http://stackoverflow.com/tags) is more representative than TIOBE search ranking.
Comment: Reading goat entrails is probably more accurate than TIOBE. By the way, I in no way advocate the sue of goat entrails for anything other than processing substances eaten by a goat.
Comment: @Gustav: yes, the number of tags on C# on SO just shows that it is a difficult language that more people need help with :)
Answer: Decide if there are features your market wants that you can only or more easily create in .NET. Consider that hiring new developers is another market to consider. You may or may not find more VB.NET devs that are suitable to your needs (level of experience, knowledge of domain, etc.). Do your current developers really want to make the switch?
I don't know about the home user market, but the business market is pretty heavy in .net apps.
Answer:
we cannot come up with main stream programs that seem to be written in
  .Net.

I'm pretty sure the ATI Catalyst graphics card control panel is written in .NET - so that's basically every PC which has an ATI graphics card. Big numbers of normal desktop users...
Another good example is Samsung Kies - which most people who have Samsung phones have installed..
Comment: Please explain the downvote?
Answer: VB6 is no longer supported by MS any more (ref: http://blogs.technet.com/b/lifecycle/archive/2008/04/16/end-of-support-for-visual-basic-6-0.aspx).  So if you have issues from a development standpoint, you will not get support from the source.
VB.NET, on the other hand, is still actively developed and supported.
The similarity between the .NET Framework and the Java JRE as well as the similarities between C# and Java itself has grown the C#/.NET developer community extremely quickly.
The supply of VB6 developers is going to dwindle while the VB.NET/C# ones are likely to increase and can keep your product moving forward.
Answer: I suppose it doesn't matter - what might matter more is what will the majority of programs be written in, in the future. Now MS are focussing on Win8 apps, you'd possibly be better off worrying about the adoption of HTML5+js and WinRT rather than legacy .NET.
Last thing you want to do is port everything to .NET and then have to do a lot more rework to make it work well with Windows 8.
Comment: ha! the truth hurts :) WinPhone8 actually shows this to be the case though, no more XNA, if you want fancy 3d graphics, you need the native SDK.
Comment: I don't see the correlation between XNA support on WinPhone 8 and .NET Framework support on Windows 8? (btw I wasn't the one that downvoted you, but calling .NET 'legacy' was kinda asking for it)


is there a way to force newly created linux/unix file permission to 775?

Question: My linux system default file permission is 666 with a umask of 0. It is 664 with a umask of 0002 and it is 644 with a umask of 022. How do i force newly created file to have a 775 permissions? Also how do I change the linux default file permission of linux box from 666 to something else like a 755? I am running a debian based system.
Comment: Just out of curiosity, why would you want this?  This would result a huge possibility for security problems.  Making files executable by default is going to be very dangerous.
Comment: I understand the ramification of such setting but i would like to know if it is possible to change it. If  it is not allowed i can undestand why. Now the question is : is there a way to change it yes or no? Thanks for the quick response.
Answer: umask doesn't turn on bits, it only turns them off.  If the application you use to create the file or directory doesn't try to create with the executable bit set (for instance, gcc or mkdir), nothing you do with umask will add an executable bit.


How to calculate percentage of DNA that ancestors contributed?

Question: In David Reich's book "Who we are and how we got here" there is a graph explaining that more we go back in our ancestors generations, the least we have chances to have any DNA inherited from one of these ancestors because the number of ancestors is doubling every generation while the number of stretches of DNA is only increasing by 71.

In the left side of the graph, there is a percentage indicating how many ancestors contributed to our current DNA. For example : 50% of 1024 ancestors after 10 generations.
I don't understand how this percentage is calculated and it is not explained in the book.
Could someone help me understand it please?
Answer: The answer I'm going to give is more or less copied from Graham Coop's post, but I'll try and summarise it here.
A single generation ago, we have 2 ancestors. If we go another generation back, we have 4 ancestors (your 4 grandparents). If we assume that there is no inbreeding within the ancestral population, every time we go back a generation, the number of ancestors doubles.
On the other hand, the amount of your DNA you inherit from each relative halves each generation. You get ~50% of your DNA from your mother and ~50% from your father. These are inherited in large blocks which are split up by recombination events. If you go back a generation, you inherit ~25% from each grandparent.
However, because of stochasticity in how recombination occurs, you don't inherit exactly 25% from each grandparent. What you really inherit is a value distributed around 25%. There is a nice discussion of the ins and outs of it here. As an extreme example, if your parents and grandparents transmit entire chromosomes without recombination, then it is possible not to inherit any DNA on that chromosome from the other grandparent.
It's quite unlikely ($p=4$ x $10^{22}$) that you don't inherit anything from a single grandparent. However, as you go back through generations, it's increasingly likely there are some relatives who don't contribute anything to your DNA.
For example, 8 generations back, there's around a 20% chance that any given ancestor didn't contribute anything to your genome. Therefore, we can say that the number of genealogical ancestors a given generation back is one minus the number of ancestors who contributed nothing. This is why, even though 10 generations back we might have 1024 ancestors, perhaps only around 50% of them will have contributed anything to your DNA.
I'm not entirely sure about how the figures in this book were calculated; whether it was from simulation or not. However, the results should be more or less the same as how Graham Coop calculated it in the above post.
Comment: Yes that's right, if we look at the Graham Coop's plot, him and David Reich seems to find the same chances to get ancestor's DNA (like 50% for 10 generations ago). But I don't understand how do we get from 1024 ancestors and 757 stretches to a 50% chances when 757/1024 = 74%.


Is Ganon Supposed To Revive Himself?

Question: I've been playing Zelda OOT on my N64 for a long while now, since I was around nine years old. It took me a while to first beat the game, and when I did, I discovered that I was able to beat the final boss, Ganondorf/Ganon over and over, and he/they would never permanently go away. I'm wondering if this is a feature of the game, and is supposed to happen, or if it's a bug and my cartridge is broken.
Comment: Downvoters don't have to explain themselves.  That happens just as part of downvoting: "This question does not show any research effort; it is unclear or not useful."
Comment: @AshleyNunn Perhaps the OP is referring to how once the game has been beaten and saved, it will revert to a point just before the final boss.
Comment: I see the ending credits, but then I can go back into the world and go into the boss room, and there he is again.
Comment: I'm not sure what you mean. Like you couldn't finish the game, never saw the ending credits?
Comment: @Parzival Likely the game saves before that state and then goes back to that because it isn't really expecting that behaviour - it assumes once you beat it, you're done.
Comment: maybe, but I'm still going to wait for an answer, and I hate it when people downvote for no reason, whoever did, please explain why.
Answer: This is intended behavior - there is no "post ending" gameplay, so the final save sets you right at the beginning of the final dungeon with all the puzzles complete. Your options from this point are to either turn back and explore Hyrule - and obtain any heart pieces/equipment you may have missed, or go beat Ganon(dorf) again. Or start a new save.
This is fairly standard for adventure games of this sort, and even more so for the era in which it was released/developed.

Is Ganon Supposed To Revive Himself?