The Godfather Baptism Killings

Question: In The Godfather, can anyone that is more familiar with the Catholic faith, tell me if Michael would be considered absolved of his sins considering that he agrees to "renounce satan and all of his works"? Having done this after all of the hits of the crime bosses are carried out?
The Baptism Murders
Comment: I'm puzzled at why you changed your accepted answer.  In the scene in question, a baptism was taking place, and Michael Corleone was not the one being baptized.  That being the case, his answers referred to the *infant being baptized*, and not to himself.  *That* being the case, iterationx's answer is irrelevant.  Your question didn't ask generally whether someone who commits murder can be absolved.
Comment: Like I said, both were good answers and each answered a different part of my question. Thank you for your effort.
Answer: No, Michael Corleone would not be absolved, because he was not answering for himself.
A godparent at an infant baptism speaks on behalf of the infant.  When the priest asks, "Do you renounce Satan?" and the other questions, he's asking this of the infant to be baptized, not of the godparent. The godparent answers because the infant can't speak for him/herself at that age.
An older child or adult being baptized would answer the questions for him/herself.
Comment: @dmcgill50 Micahel would be an excellent candidate for Godfather. Just a very bad candidate for godfather.
Comment: That would seem fairly obvious.  The godparent is supposed to help the godchild grow in the faith.  Michael is not exactly the best candidate for this.  But unfortunately there are a lot of what we might call cultural godparents, who are chosen in order to honor that person, rather than because that person would be good in that role.
Comment: Then to take it one step further, considering the character of Michael, wouldn't we think that he might be considered invalid as a candidate for Godfather?
Answer: He would need to be firmly resolved to not commit another murder again and go to confession to be absolved, or have perfect contrition.
The Old Law teaches that sins are forgiven through a priest, Numbers 15:22-25.  Jesus Christ was the fulfillment of the Old Law and rendered it void, however the New Law corresponds to the Old Law in many ways.  One of these ways is that confession to a priest is also a characteristic of the New Law.
Jesus Christ gave the Apostles to absolve sins in John 20:21-23.
Also in Matthew 18:18 we see Biblical proof of confession.
It is Catholic doctrine that a single Mortal Sin will remove man from a State of Grace also known as the State of Justification or the State of Sanctifying Grace.  If one dies without the State of Justification, he will be condemned to Hell.
When one confesses one's sins to a valid Priest, we say that "he is absolved of his sins", it means that a person is restored to a State of Grace.   One who is restored to a State of Grace may still have to suffer the fires of Purgatory for a time.  Purgatory is taught in 1 Corinthians 3:15, the passage ends with "he himself shall be saved, yet so as by fire" - this indicates a place with fire that is not Hell and that ultimately leads to Heaven.
Firmly resolved means that one cannot be planning on committing the sin again in the future.  If one confesses adultery for example, and is still living with his girlfriend, then that confession would be invalid, and the sins would not be forgiven, it would in fact be sacrilegious and the confession itself would be a mortal sin.
St. Theresa of Avila tells us that "The majority of Catholics are damned due to bad confessions"
For confession, the fear of Hell is adequate for the sins to be absolved, this is known as imperfect contrition. However Perfect Contrition is a form of sorrow that arises from a love of God.
Practically speaking, a devout Catholic would go to confession.  However if a Catholic found himself on a deserted island, and was in a state of Mortal Sin, then he would not lose all hope, because he can still be restored to a State of Justification.
Comment: Thanks! Wish I could give both of you credit for the "answer"!! Both were excellent.
Comment: Purgatory is not held to be necessarily a place, but might only be a process.

The Godfather Baptism Killings


Is it possible to call component method instantiated by $A.getComponent()?

Question: I have a table with dynamic number of rows. But all of the has the same structure: summary row and details row. The details row implemented as separated lightning component. Also I have a "+" sign on the summary row that should expand details row and call a method of child component. Currently I'm seeking for required details component by looping the array of details components returned by component.find('') method. But I assume it's not very efficient. I've checked the developer guide and found out that I can get a component by it's global id Finding component by Id But when I try to call a method of that component I get an error (something like "there is no such method"). So do I need to do something more to convert aura$html to actual component or it's not possible at all?Is it a bad practise to instantiate child components in the <aura:iteration> tag and it's better to create them dynamically using JS?
Comment: How do you know your component's global Id? This is generated at run time. I think the global Id you're passing to getComponent is not the correct one. All of the HTML that you see that has the property "data-aura-rendered-by" is actually from the aura:html component, which is not the component I think you want. You're not going to see your component's global Id in the DOM anywhere. To get the correct global Id, you'd need to call `component.getGlobalId();` when your component is created.
Comment: That is not going to link to your component, that will link to the Html Component. Is there a reason you don't already have a reference to the component since you created it via $A.createComponent() ?
Comment: Agreed, how are you retrieving the component using getComponent? If you do $A.getComponent(id) + ""; Does it show you the component you expected?
Comment: @frontendloader, I use id from "data-aura-rendered-by" attribute. As mentioned in the Developer Guide in this example: https://developer.salesforce.com/docs/atlas.en-us.200.0.lightning.meta/lightning/js_cb_find_by_id.htm
Answer: I'm working on this right now. It appears that aura:id can't take variables, so calling <c:MyComp aura:id="{!index}-childComp" /> will fail.
Instead I'm doing:
<aura:iteration items="{!v.insights}" var="insight" indexVar="indx">
   <c:MInsightCell aura:id="minsight-cell" insight="{!insight}" index="{!indx}" maxCount="{!v.insights.length}"/>
</aura:iteration>

(where index is an attribute on my child component).
To then access the component I do:
var next_index = swiper.activeIndex + 1;
var next_id = next_index+'-minsight-cell';
debugger;
var slides = component.find("minsight-cell");
var next_slide = slides[next_index];
next_slide.preload(next_id);

(I'm using the Swiper library which keeps of track of which index it's on...)
Moral: aura:id is limited, but required if you want to use methods on components.
Answer: Do you have an <aura:method/> in your component markup? You'll need to expose the method using this tag in order to call it.
https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/js_cmp_methods.htm
Creating child components inside of <aura:iteration/> is fine. If you're going to modify any values in the collection that created those components you'll want to do it from the component that contains the collection. Don't allow the child components to modify themselves.
Comment: Yes, I have `` in the markup and I can successfully call it when I find component using `component.find()` method in controller. But I can't call the same method if I get component by `$A.getComponent()` method.
Comment: @steals have you ever solved this?
Comment: yes, check the answer bellow it describes the approach


Sum(), ForEach() with Lambda in a hierarchical List Collection

Question: I have to list the number of documents related to items in a hierarchical tree.
The specification states:
The tree will only ever be 2 levels deep.
The higher level items will list not only the number of documents in it's folder, but also the total count of documents in the child folders.   They want this total to include the documents in the current folder.
I've developed the solution below, it works, however it just seems complicated, hard to maintain and probably not the most efficient way to do this.  Also, if the tree is ever more than 2 levels deep, this will fail.
class Item
{
    public int Id { get; set; }
    public int ParentId { get; set; }
    public int DocumentCount { get; set; }
    public int ChildItemCount { get; set; }
    public int ChildCount { get; set; }
}

static class Program
{
    static void Main()
    {
        var items = new List<Item>
        {
            new Item {Id = 1, ParentId = 0},
            new Item {Id = 2, ParentId = 1},
            new Item {Id = 3, ParentId = 1},
            new Item {Id = 4, ParentId = 2},
            new Item {Id = 5, ParentId = 2},
            new Item {Id = 6, ParentId = 3},
            new Item {Id = 7, ParentId = 3},
            new Item {Id = 8, ParentId = 3}
        };
        // setup
        var rnd = new Random();
        items.ForEach(c => c.DocumentCount = rnd.Next(1, 10));

        // act
        items.ForEach(z => z.ChildCount = items.Count(x => x.ParentId == z.Id));
        items.ForEach(z => z.ChildItemCount = items.Where(x => x.ParentId == z.Id).Sum(y => y.DocumentCount) + z.DocumentCount);
        items.Where(k => k.ParentId == 0).ToList().ForEach(z => z.ChildItemCount = items.Where(x => x.ParentId == z.Id).Sum(y => y.ChildItemCount) + z.DocumentCount);

        // output
        items.ForEach(i => Console.WriteLine("Id: {0}, ParentId: {1}, DocumentCount: {2}, ChildCount: {3}, ChildItemCount: {4}", i.Id, i.ParentId, i.DocumentCount,i.ChildCount, i.ChildItemCount));
        Console.ReadKey();
    }
}

This gives the output below which is technically correct and meets the spec, but I just feel the solution is not the best solution.  Can anyone think of a better way to do this?
Id: 1, ParentId: 0, DocumentCount: 8, ChildCount: 2, ChildItemCount: 46
Id: 2, ParentId: 1, DocumentCount: 7, ChildCount: 2, ChildItemCount: 16
Id: 3, ParentId: 1, DocumentCount: 8, ChildCount: 3, ChildItemCount: 22
Id: 4, ParentId: 2, DocumentCount: 2, ChildCount: 0, ChildItemCount: 2
Id: 5, ParentId: 2, DocumentCount: 7, ChildCount: 0, ChildItemCount: 7
Id: 6, ParentId: 3, DocumentCount: 9, ChildCount: 0, ChildItemCount: 9
Id: 7, ParentId: 3, DocumentCount: 1, ChildCount: 0, ChildItemCount: 1
Id: 8, ParentId: 3, DocumentCount: 4, ChildCount: 0, ChildItemCount: 4

Answer: You can create lookup for children. That will involve single enumeration over items collection instead of enumerating all items for each calculation of each item.
I.e. you currently have 2 * N * N iterations for calculating child count and child item count. With lookup you will have N + N + N iterations
var children = items.ToLookup(i => i.ParentId);

foreach(var item in items)
{
    var subitems = children[item.Id];
    item.ChildCount = subitems.Count();
    item.ChildItemCount = subitems.Sum(i => i.DocumentCount) + item.DocumentCount;
}

Explanation: Let's look on this line
items.ForEach(z => z.ChildItemCount =
    items.Where(x => x.ParentId == z.Id).Sum(y => y.DocumentCount) + z.DocumentCount);

Here for each item in items collection you enumerate every item in items collection to get only items which are children of current. That gives you N * N iterations totally. Count is calculated same way.
Now lets look on my code.
var children = items.ToLookup(i => i.ParentId);

Here lookup is created. Internally it looks like enumerating over items and adding them to appropriate groupings of lookup. You can think of lookup as a Dictionary<TKey, List<TValue>>.
Next we do enumerating of all items (that's another N). In body of this loop we get children of item (getting appropriate group by key is pretty fast O(1) operation, comparing to enumerating all items and filtering them). Good news here is behavior of lookup when key not found - it simply returns EmptyEnumerable (i.e. empty array of TValue), so we don't need to check anything - further calculations will work without problems:
foreach(var item in items)
{
    var subitems = children[item.Id];
    // ...
}

Next we do two operations. First is getting count of items in group. Grouping implements ICollection with Count property, and it simply returns count of items in group, without enumerating them:
item.ChildCount = subitems.Count();

Second operation is calculating sum of documents in group. Thus total number of items in all groups will be N then enumerating all groups will take N iterations:
item.ChildItemCount = subitems.Sum(i => i.DocumentCount) + item.DocumentCount;

UPDATE: Thus you want ChildItemCount to contain sum
Comment: Hi Sergey,  while I like how your solution is cleaner and an improvement, it fails to give the correct solution for the highest level. (item id 1)  a second foreach would be needed to calculate this value, which gives the same number of iterations as my solution.  Your solution is definitely easier to understand.
Comment: @NigelJoyce just verified - it returns correct value for top-level item - 2 children and correct total documents value
Comment: using your solution,
Id: 1, PId: 0, DC: 1, CC: 2, CIC: 9
Id: 2, PId: 1, DC: 5, CC: 2, CIC: 19
Id: 3, PId: 1, DC: 3, CC: 3, CIC: 7
Id: 4, PId: 2, DC: 5, CC: 0, CIC: 5
Id: 5, PId: 2, DC: 9, CC: 0, CIC: 9
Id: 6, PId: 3, DC: 1, CC: 0, CIC: 1
Id: 7, PId: 3, DC: 2, CC: 0, CIC: 2
Id: 8, PId: 3, DC: 1, CC: 0, CIC: 1

Item Id: 1 should actually be 27  (19 + 7 + 1)

I think it's close, but not quite there.
Comment: @NigelJoyce can you explain in words what should be value of CIC? If it should be sum of subitems CIC + DC, then you should do two things - enumerate items in their parent ids descending order, and use CIC when calculating sum. I.e. `foreach (var item in items.OrderByDescending(i => i.ParentId))` and `item.ChildItemCount = subitems.Sum(i => i.ChildItemCount) + item.DocumentCount;` Sorry, its too late here, will be back in 7 hours
Comment: The OrderByDecending is part of the solution.  `item.ChildItemCount = subitems.Sum(i => i.DocumentCount) + item.DocumentCount;`  needs to be changed to `item.ChildItemCount = subitems.Sum(i => i.ChildItemCount) + item.DocumentCount;`
Answer: @Sergey's answer does a beautiful job at flattening your solution's complexity; this is more of a style review.
Your lambda parameters are arbitrarily named:

items.ForEach(z => z.ChildCount = items.Count(x => x.ParentId == z.Id));

Consider giving a somewhat meaningful name to these identifiers:
items.ForEach(item => item.ChildCount = items.Count(child => child.ParentId == item.Id));

Better naming and proper whitespace make it easier to read your code; you didn't need to come up with y, it's in a scope that's a sibling of that of x, but it's harder to tell when everything is on one line:

items.ForEach(z => z.ChildItemCount = items.Where(x => x.ParentId == z.Id).Sum(y => y.DocumentCount) + z.DocumentCount);

Breaking the line and lining up the dots makes it easier to see the scopes created (and iterations), at a glance:
items.ForEach(item => item.ChildItemCount = items.Where(child => child.ParentId == item.Id)
                                                 .Sum(child => child.DocumentCount) + item.DocumentCount);

Comment: Ah, yes you are right about y being a sibling of x. I missed that.  The production code has meaningful names, I just used single letter parameters for the example code.  Maybe that's why I missed the scope issue :)
Comment: Another good reason to post your *real code* on this site ;)


Windows 8.1 Alt Gr, win key

Question: Recently I got an automatic windows update and it seems it has "bugged" some things out. For example my AltGr (right alt) is not working anymore as it should and when I hold the windows key down it's constatly flashing through metro and desktop, which is preventing some win key shortcuts from not working, eg. win+s, win+r, win+d, ...
Comment: It seems that the microsoft updates are the problem, I have a Samsung laptop aswell and use no virtual machines. I guess we'll have to wait for the fix.
Thanks for that link.
Comment: Probably same issue as here: [Polish diacritical signs not working](http://superuser.com/q/928555/194694)
Comment: Ctrl+Alt should be the same as AltGr.
Answer: OK I managed to correct the problem and now things work as it should. I payed close attention to this post Polish diacritical signs not working. It seems that the new Synaptics drivers update is the root of this problem.

Windows 8.1 Alt Gr, win key


Can installing Snort make me vulnerable?

Question: I am using Ubuntu and am wondering if installing Snort on my host can make me more vulnerable?
Comment: As Graham Hill suggested in his answer, can you please add the role of this server? What software will run on it, etc.
Comment: it is not server, it is home desktop. for personal use. just wondering what kind of solution can be for protecting my home computers, for lonely protection i would use PSAD. but i wanted to protect my LAN,and mostly want to learn about IDS.
Comment: Are the devices behind a firewall?
Comment: You can also always experiment on a virtual machine.
Comment: @user53427 Is your desktop or some services (SSH, web server, FTP, etc.) accessible from Internet? Do you use a router which share the Internet connection?
Answer: Any software you install on your machine that takes input from other machines you do not control makes you more vulnerable.
You must balance the additional risk you add by installing Snort against the costs of any treatment for that risk you might implement and the benefits of installing it.
We can't do that for you because we don't know your threat model or why you want to install Snort.
Answer: Yes. But with the latest and greatest version, perhaps not so much that I would worry about it in your case.
You can always google 'snort vulnerabilities' and note that most really bad known exploits relate to old versions. That is a pattern you'll see often.
For protecting your home computer:

Backup
Update your software
Close down all services you do not use
Anti-virus software with latest virus definitions
Hardware based/stand alone 'stateful' firewall with packet inspection

Not necessary in that order..
Snort is great, but depending on your background it's possible you should start somewhere else. And definitely use third-party software vs Snort.


Tris vs quads in substance painter

Question: I've downloaded Substance painter a couple days ago. Online i've read that is better to triangulate your model before exporting it to substance painter and this has confused me a lot. What's the point of retopo in quads when dynotopo aready works with tris? And if I'm goingo to animate a subject and so that I'll need a good edge flow won't trianguating break this?
Thanks in advance and sorry for my poor english.
Answer: If you have a good quad edge flow and then triangulate it, it won't break its  quality to animate it.
I think internally all game engines triangulate the model anyways.
That being sad. I used Substance painter sporadically and did not triangulate the mesh before. It works fine.
Comment: Thanks!! That's exactly what i needed. Two more question: do i have to triangulate before or after the uv unwraping? And in case I don't want to animante my mesh do i still have to retopologize it?
Comment: The graphic card needs the mesh triangulated so all engines do triangulate the meshes. The problem with not triangulating is that if your engine chooses to triangulate the mesh in a different way then substance painter the normals can get a bit wonky. I would recommend doing the triangulation before texturing. Especially if you have glossy smooth surfaces.
Comment: @gigggig96 You should triangulate after uv unwrapping. You do not necessarily need to retopologize it if you do not want to animate it. You can see Meshes on Sketchfab that have millions of polys and still are fast to rotate around, zoom in on etc. If it is a static object for a game it would make sense to retopo it though. Also unretopoed meshes might be harder to UV unwrap by hand.

Tris vs quads in substance painter


Can Wine software use Unity Application Menu?

Question: Wine applications which I used show menu under window top border. Is there any way to use global application menu in Wine applications? Will this function be available in next releases of Wine/appmenu possibly?
Comment: I have a feeling what you need is right here :) http://askubuntu.com/questions/47067/can-i-add-wine-application-category-list-to-unity-dash Seems to explain exactly what you're trying to do...hope this helps!
Comment: No, I`m talking about global menu on top of the screen.
Answer: I'll note that Mark Shuttleworth asked me this exact question about a year ago when Unity was first being shared with us.
Wine cannot use the global menu, and probably won't ever.  The reason is that Unity's global menu requires fancy rewriting of each windowing toolkit (GTK, for instance) -- this is why some applications like LibreOffice don't actually yet use the global menu: they were written with toolkits that Unity doesn't yet support.
To make the global menu work in Wine would require an even more invasive rewrite of Wine itself - Wine isn't just implementing the Windows graphical toolkits, but must also act as a window manager.  Windows applications have almost no qualms about doing very strange things, and likely many applications would break in bizarre ways if their menus were moved or worked even slightly differently.


Concorde time efficiency

Question: What is the efficiency of Concorde TSP solver program. And is it have any weaknesses? I build my own exact solver and I want to compare it to Concorde. What would be the best way to do this?
Comment: In the worst case, the runtime will be exponential -- I think internally it uses (I)LP solvers. You could look at the benchmarks listed, and run both Concorde and your own solver on the same computer to get comparable results. It will be extremely difficult to beat a highly optimized state of the art solver with something you can roll yourself in any decent time, but it is fun :-)
Comment: @Juho As I understood its hard getting in to his worst case, since he been able to solve inputs of thousands cities.  Exponential solution will blow up already at 20 as for best known complex for this is O(N^2 2^N). 20 will be more then 20M tests. And yet concord doing thousands in minutes. So I can't just run a random compares on my pc.
Comment: But the size of an instance doesn't imply hardness. The solver probably employs clever heuristics and tricks that work well for many cases. Perhaps you need to find instances that you can still in some reasonable time, and then run those on Concorde. Other than that, I guess you should think what is it that you want to benchmark exactly.
Answer: In the paper "Evolving L-Systems as an intelligent design approach to find classes of difficult-to-solve Traveling Salesman Problem instances" by Farhan Ahammed and Pablo Moscato, the authors show how to build instances which causes Concorde to run in its worst-case time.
So, you may compare your solver with Concorde on instances generated that way, besides comparing on randomly generated instances and/or specific test-case instances.
Here is the paper's abstract:

The technique of computationally analysing a program by searching for instances which causes the program to run in its worst-case time is examined. Concorde [2], the state-of-the-art Traveling Salesperson Problem (TSP) solver, is the program used to test our approach. We seed our evolutionary approach with a fractal instance of the TSP, defined by a Lindenmayer system at a fixed order. The evolutionary algorithm produced modifications to the L-System rules such that the instances of the modified L-System become increasingly much harder for Concorde to solve to optimality. In some cases, while still having the same size, the evolved instances required a computation time which was 30,000 times greater than what was needed to solve the original instance that seeded the search. The success of this case study shows the potential of Evolutionary Search to provide new test-case scenarios for algorithms and their software implementations.
Answer: Concorde works with symmetric instances of the TSP, that is, where the distance from city A to city B is the same as the distance from B to A.  To solve an asymmetric instance with Concorde one would need to reduce the problem to a symmetric instance by node splitting. Targeting the asymmetric TSP directly is one possibility to make large improvements on Concorde's performance.
Comment: I think he is just asking how to compete his program against Concorde, not how to improve Concorde.
Comment: From his earlier posts, he's restricting to Euclidean TSP, anyway, so he's only considering symmetric cases.
Answer: If anyone is interested in hard instance of TSP, I extracted the optimal tour found by Concorde from this website : http://www.or.uni-bonn.de/~hougardy/HardTSPInstances.html
 There is a link to their paper in it.
Some of those instances are solved in hours by Concorde, while having less than 200 cities.
See : https://github.com/Butanium/monte-carlo-tree-search-TSP/tree/master/tsp_instances/HARD

Concorde time efficiency


Is explicitly stating "inductive hypothesis" necessary in proof by induction?

Question: In one of my proofs, I wrote "Assume, {stating inductive hypothesis}" and in inductive step "We know that ... holds for k-1" instead of writing "Inductive hypothesis: {stating inductive hypothesis}" and "... holds for k-1 from inductive hypothesis".
My instructor considers my proof to be wrong/inaccurate because I didn't explicitly state that this is inductive hypothesis. It is not even math or proof course. Would such proof be acceptable?
Comment: Your proof is acceptable. Those who don't understand mathematics confuse rigurosity with blueprints and made-up rules. "Inductive hypothesis" is just a phrase and can be expressed in many other ways (as you did); there is no wise old man on an island that ordered mathematicians to do so, shall the world crumble otherwise. Don't worry, fellow, you just have a lousy teacher.
Comment: I'd say this was up to your instructor.  In practice, it's quite common for mathematicians to omit phrases like that when they are clearly understood.  But any given instructor may require that proofs be written out in a precise form.
Comment: Well, this is a very strange decision from the instructor, that's for sure.
Comment: Your proof is completely legitimate, but as a student sometimes it's just easier to do the little things for your professor. I can't tell you how many times I have been forced to write "thus the inductive hypothesis holds by the principle of mathematical induction"
Answer: It's not necessary, but it's often enforced in introductory proof-based classes and such to get you used to the flow, and probably to make it easier for professors to address problems regarding such. ... though why you'd be required to do so outside of a mathematical context is beyond me.
That said, explicitly stating this, that, or the other isn't truly necessary. What's important is the underlying logic and process. For example, in my abstract algebra classes, we've done several proofs by induction without explicitly stating the steps.
Of course an argument can be made that explicitly stating the steps can help in terms of clarity, especially for novices. But after seeing ever-so-many induction proofs, you kind of get a "feel" for the overall flow and can see when one is proceeding inductively even if it's not explicitly stated. That's a common theme in mathematics - once there's a sort of common understanding between two people (e.g. reader and author), they might omit the finicky details/notations in favor of brevity and ease of communication.
So, a tl;dr - your proof is completely valid, and your professor is likely enforcing the restriction for moreso their own uses (common errors in the class, making their own life easier, etc.) than your own.


GRUB from windows?

Question: So, basically, I have a dual boot setup with a windows drive partition and a linux drive partition, but I can only access the Windows partition and need Grub to get into Linux... which I need to get into Grub. Is there any fix for this?
Comment: Your question is very unclear. Better add details with, where useful, some screenshots.
Comment: Sounds like your dual boot setup is improper. Do you still have the directions you followed? Don't even have a PC to test, but someone else can likely point out what went wrong if you edit with that info.
Comment: Seems clear to me, the Ubuntu installer did not install Grub so now I can only boot into windows. But Grub can not be installed from windows, it only has linux versions as far as I know. Is there an alternative?
Comment: I think my dual boot setup is proper, one hard drive with a windows partition and an Ubuntu partition. But the Ubuntu installer did not install Grub like it's normally supposed to.
Answer: There are a few possibilities.

You installed ubuntu first and windows second, this leads to windows bootmgr overwriting grub on the mbr (if you're using mbr grub that is)

Solution: Reinstall grub, or reinstall Ubuntu.

You are using an EFI version of grub and probably bootmgr, these can coexist rather nicely. If you're not booting into grub the reason is that it is not selected as the default EFI boot option.

Solution: Select grub/linux as the default EFI boot option from the bios.

Grub is not an option in the EFI boot manager in the bios

Solution: Install grub on the mbr the good old fashioned way, and select the drive on which you wrote grub to mbr as the default boot device.
If none of the above work (though I'd be particularly surprised if that last one doesn't; it's usually my lazy way out of efi boot problems heh, always works for me) then there's something wrong with your installation of grub and you need to carefully install it the right way; manually. You can look up how to do all these things on your own.
If you cannot access your linux installation by selecting the correct booting option from the bios, there are live cds/dvds/usbs that you can use to bypass it instead. I imagine what you used to install ubuntu in the first place could work. At least you should be able to chroot your way in.

GRUB from windows?


What are these black and white spotted areas leaves on my basil plant?

Question: My basil has a weird problem that seems to be spreading on the leaves. It's basically white spots that are thinner surrounded by black spots.
I tried to find information online but couldn't find this.
Thanks for the help!
Comment: I would suggest that you amputate.
Answer: This looks like an insect that eats the material between the walls of the leaves: a leaf miner.  You can see the translucent areas where the leaves have been eaten and the black spots are "frass" or excreta from the adults.
Seeing as this is a plant that you want to be able to consume the leaves of this makes applying any pest control difficult.  As it is an annual I agree that throwing the plant out is the most effective method of control.
You should also check your other plants in case they might have issues as well.
I suspect this is thrip as the damage looks similar to here.  If I'm right you should be able to use a magnifying glass and see the adults or larvae on the undersides of the leaves.  The adults fly and can spread to many other plants.
Comment: Thank you! I will try to amputate more and see if it stops. Do they go away when I replant the basil after a while?
Comment: @euge9522  If they are on other plants they will spread back.  Thrip are very hard to get rid of
Answer: It looks like Thrips. I have them on my basil, but some of the basil is fighting them off with the plant's immune system. I have spots like that and then I have leaves with a dead Thrip under the leaf.
I got my basil from Johnnyseed.com They are the Prospera trademark type of the Genovese sweet basil. They are resistant to Fusarium wilt and downy mildew, but it seems they are fighting much more. I grew some this year and the deer stay away from it. I have a mole boring large cavities under everything but the basil. I used round-up year round on one end of the garden and everything is dying from diseases spread from the round-up to kill everything. I will need to use copper sulfate, and bleach to treat the garden to get rid of the ground born diseases, before I can use it next year but the basil is still growing strong, and it is getting close to 6 feet tall, and some leaves are 4 inches long, and mid summer there was some at 5 inches long. I am sure the seeds could be better as plants for next year. I have a picture I just put up with the dead bugs under my leaves.


How good are entrepreneurial opportunities for faculty members?

Question:
How easy is it for faculty members working at a reputable university to become entrepreneurs?
If the faculty member sees an opportunity for a great product and wants to set up a small office with a few engineers working with one or two students, will the university sponsor such a venture?
How enthusiastic or forthcoming will the industry and VCs in general be towards this?
Lastly, how common are such professor-run companies for, say engineering faculty in top US schools?
Comment: Who owns the copyright/patent of the research? Will the university claim ownership of the startup company?
Answer: This is quite common in American universities, and there are probably thousands of start-ups that have arisen out of university-based research. The question of financing such a venture is of course a challenging one to answer, but with the right contacts, is usually available.
I can think of at least four or five such start-ups in the department I attended for graduate school, and I imagine there are several more in the planning stages.
As for how enthusiastic industry and VC's are, well, I think it depends entirely on the strength of the idea, and how "market-ready" the concept is. The sooner it's ready to go, the more enthusiastically people will flock to it.
Comment: Who owns the copyright/patent of the research? Will the university claim ownership of the startup company?
Comment: Usually there's a patent- and revenue-sharing process at most universities. Typically the university will get some percentage of the total revenues, while the researchers get a substantial chunk (numbers I've seen vary from 30% to 70% of the total).
Answer: I think the main issue is that a lot of entrepreneural mindset is eliminated from faculty, but if the faculty has the right mindset there is no limitation to a venture, especially if the faculty has tenure.


Is it true that power transformer has maximum efficiency at full load?

Question: Is it true that power transformer has maximum efficiency at full load? In other words, is that possible practically?
Answer: All transformers are going to put out at least somewhat less power than is put in.  In other words, there is no such thing as a perfect 100% efficient transformer (In real practical applications.  Games can be played in a lab with superconducting materials and air cores to get close to 100% efficiency, but at best that's just for the transformer itself without system level considerations like how the power goes in and what happens to it after it comes out).  Furthermore, in real transformers efficiency is traded off versus ultimate cost.  It might be possible to make a particular transformer more effecient, but that would also cost more, possibly make it heavier, bigger, etc, so the manufacturer picked a tradeoff that they felt was best for the target market.
There will be some maximum efficiency for any model of transformer at various operating points, including at full load.
Or, if you're asking whether maximum efficiency occurs at full load, then probably not.  The size of the core is one of the major cost factors of a transformer.  Manufacturers aren't going to make it any bigger than necessary to meet the specs.  The more power a transformer has to handle, all else kept constant, the bigger the core needs to be.  Put another way, for any size transformer there will be a power level at which the core no longer acts "nicely" to allow for efficient operation.  This doesn't happen abruptly at one point.  Therefore at maximum power the not-nice effects are probably already starting at least a little bit.  So to answer your question (if this is really what you asked), no, the maximum efficiency of most transformers is probably not at their maximum power level.
Of course the best way to determine this for any given transformer is to look at its datasheet.
Comment: From Olin's words alone you might conclude that a transformer is most efficient at almost zero load, but it also has a base (idle) power consumption, so in practice the best efficiency is achieved somewhere between zero and maximum load.
Answer: The losses in a transformer comprise of fixed and variable. Fixed are not dependent on the load and are a function of the design( as Mr olin's note above-- design is also a compromise between cost and efficiency). Variable losses depend on the loading. Thus when seen per unit of load( efficiency), fixed losses will keep decreasing with increase in load while variable will increase, mostly in a non linear manner. Thus at some point of load the total losses will start increasing and that point is max efficiency point. This may not be max power point as max power point indicates the capacity of machine and not its efficiency


Copy email to the clipboard with Outlook VBA

Question: How do I copy an email to the clipboard and then paste it into excel with the tables intact?
I am using Outlook 2007 and I want to do the equivalent of

"Click on email > Select All > Copy > Switch to Excel > Select Cell > Paste".

I have the Excel Object Model pretty well figured out, but have no experience in Outlook other than the following code.
Dim mapi As NameSpace
Dim msg As Outlook.MailItem
Set mapi = Outlook.Application.GetNamespace("MAPI")
Set msg = mapi.Folders.Item(1).Folders.Item("Posteingang").Folders.Item(1).Folders.Item(7).Items.Item(526)

Answer: I must admit I use this in Outlook 2003, but please see if it works in 2007 as well:
you can use the MSForms.DataObject to exchange data with the clipboard. In Outlook VBA, create a reference to "Microsoft Forms 2.0 Object Library", and try this code (you can of course attach the Sub() to a button, etc.):
Sub Test()
Dim M As MailItem, Buf As MSForms.DataObject

    Set M = ActiveExplorer().Selection.Item(1)
    Set Buf = New MSForms.DataObject
    Buf.SetText M.HTMLBody
    Buf.PutInClipboard

End Sub

After that, switch to Excel and press Ctrl-V - there we go!
If you also want to find the currently running Excel Application and automate even this, let me know.
There's always a valid HTMLBody, even when the mail was sent in Plain Text or RTF, and Excel will display all text attributes conveyed within HTMLBody incl. columns, colors, fonts, hyperlinks, indents etc. However, embedded images are not copied.
This code demonstrates the essentials, but doesn't check if really a MailItem is selected. This would require more coding, if you want to make it work for calendar entries, contacts, etc. as well.
It's enough if you have selected the mail in the list view, you don't even need to open it.
Comment: if you "browse" for the reference, look for "fm20.dll" in your ...\system32 directory
Comment: Couldn't find the ref so I just put it in a form.
Comment: I am using Outlook 2013 on Windows 8.1. It copies only two junk characters on clipboard. Any idea how to fix this? I could not find fm20.dll under windows folder so followed @ArlenBeiler 's advice.
Comment: As I don't have Win8, I can only give generic hints: 1) on Win8/64bit try searching in ...\Windows\SysWOW64; 2) make a full search for FM20.DLL; 3) try downloading/registering FM20.DLL; 4) further reading http://stackoverflow.com/questions/18668928/excel-2013-64-bit-vba-clipboard-api-doesnt-work
Answer: I finally picked it up again and completely automated it. Here are the basics of what I did to automate it.
Dim appExcel As Excel.Application
Dim Buf As MSForms.DataObject
Dim Shape As Excel.Shape
Dim mitm As MailItem
Dim itm As Object
Dim rws As Excel.Worksheet
'code to open excel
Set appExcel = VBA.GetObject(, "Excel.Application")
'...
'code to loop through emails here
Set mitm = itm
body = Replace(mitm.HTMLBody, "http://example.com/images/logo.jpg", "")
Call Buf.SetText(body)
Call Buf.PutInClipboard
Call rws.Cells(i, 1).PasteSpecial
For Each Shape In rws.Shapes
    Shape.Delete 'this deletes the empty shapes
Next Shape
'next itm

I removed the logo urls to save time, and when you're dealing with 300 emails, that translates into at least ten minutes saved.
I got the code I needed from a TechRepublic article, and then changed it to suit my needs. Many thanks to the accepted answerer of this question for the clipboard code.
Answer: Ok so I will have to make certain assumptions because there is information missing from your question.
Firstly you didn't say what mailformat the message is... HTML would be the easiest, the process will be different for RTF and not possible in plaintext
Since you are refering to tables I will assume they are HTML tables and the mail format is HTML.
Also it is not clear from your question if you want the table content pasted seperately (1 excel cell per table cell) and the rest of the emails bodytext pasted into 1 cell or several?
finally you haven't really said if you want the VBA running from Outlook or Excel (not that important but it affects which intrinsic objects are available.
Anyway code sample:
Outlook code to access the htmlbody prop
Dim mapi As Namespace
Set mapi = Application.Session
Dim msg As MailItem
Set msg = mapi.Folders.Item(1).Folders.Item("Posteingang").Folders.Item(1).Folders.Item(7).Items.Item(526)
Dim strHTML as String
strHTML = msg.HTMLBody
' There is no object model collection for html tables within the htmlbody (which is a string of html) you will need to parse the html and collect the tables before inserting into Excel.

Comment: That doesn't say how to copy it, which is part of what I was wondering, hence the downvote.
Comment: Well ok fine, but putting text into a dataobject is trivial. i see that I missed that part of the question. bad assumption on my part, however the interesting code is getting the text to begin with.
Answer: After a while again, I found another way. MailItem.Body is plain text, and has a tab character between table cells. So I used that. Here is the gist of what I did:
Sub Import()
    Dim itms As Outlook.Items
    Dim itm As Object
    Dim i As Long, j As Long
    Dim body As String
    Dim mitm As Outlook.MailItem
    For Each itm In itms
        Set mitm = itm
        ParseReports (mitm.body) 'uses the global var k
    Next itm
End Sub
Sub ParseReports(text As String)
    Dim table(1 To 1000, 1 To 11) As String 'I'm not expecting to see a thousand rows!
    Dim drow(1 To 11) As String
    For Each Row In VBA.Split(text, vbCrLf)
        j = 1
        For Each Col In VBA.Split(Row, vbTab)
            table(i, j) = Col
            j = j + 1
        Next Col
        i = i + 1
    Next Row
    For i = 1 To l
        For j = 1 To 11
            drow(j) = table(i, j)
        Next j
        hws.Range(hws.Cells(k, 1), hws.Cells(k, 11)) = drow
        k = k + 1
    Next i
End Sub

Average: 77 emails processed per second. I do some minor processing and extracting.


Not clear about relative position bias

Question: I've been reading the Swin Transformer paper and came across relative position bias concept. I'm not able to figure out how is it more effective than positional embeddings. I hope someone can explain it intuitively. Thanks in advance!
Answer: With relative position bias, you are extending the concept of self-attention to also encode the distance between any two tokens. Basically you let the model itself learn the relative distance between any 2 tokens instead of feeding that information yourself. Most of the time (as shown in the paper), the model does a good job at figuring out the relationships between various tokens. If that is the case, it is always better to make the model generic by giving it the flexibility rather than providing this data & forcing the model to use it. Usually generalized models perform better. This is the simplest reason to not feed explicit positional embeddings. For more details on the bias parameterization, you can refer to the relevant section in - https://towardsdatascience.com/swin-vision-transformers-hacking-the-human-eye-4223ba9764c3

Not clear about relative position bias


Are outdated hints allowed?

Question: The "Hint 5" on this problem is going to be outdated in three days already outdated.
Should I edit the hint when it gets outdated?
Are similar hints that highly depends on time allowed?
Answer: Hints that are easily outdated can be a problem, but probably not in this particular question. If the hint referred to knowledge that's likely to change and be unavailable to future solvers, that's clearly something that should be avoided as it could possibly make the hint unusable and misleading. Let's say for example that you refer to a particular Stack Exchange user's profile picture. If the user changes their profile picture, there is no indication to future solvers of that particular puzzle that the hint is no longer valid.
However, in the linked question the hint reads

Where was the last Winter Olympiad held?

Questions come with dates and timestamps, and past Olympic hosts are public knowledge, so even if someone comes to this puzzle years from now they can still figure out what is meant by the hint.
Comment: Furthermore it's very easy to modify this hint to "Where was the 23rd Winter Olympiad held?" - that information is never going to change.

Are outdated hints allowed?


Is there a formula for finding the series of numbers based on an average.

Question: So I am working on a program that does a scrolling effect. the image is 1200pixels wide, and each time it scrolls, it should move an average of 2.67 pixels. However I am using a function that does not accept decimal points. so it has to move either 2 or 3. I know there will be 450 total steps. So my question is there way way to find a series of exact number of 2 and 3s I will need to get 2.67 as an average, and know that there are 450 numbers in the set.
Answer: If you have 1/3 of the numbers in your sequence as 2 and 2/3 as 3, then you will have the average you are looking for.
So you would want to have a collection of 150 2's and 300 3's. This gives you an average of 2.6666 which rounds to 2.67.
Answer: Here's some sample code that calls yourFunction 450 times, each time passing either the value 2 or the value 3, and the sum of the parameters passed to the 450 function calls will be 1200. It also scrolls about as smoothly as you can, that is, any $n$ iterations of the loop will scroll a total of about $n \times 8/3$ pixels.
for (int i = 1; i <= 450; ++i)
{
  int previous_total_scrolled = 1200 * (i - 1) / 450;
  int new_total_scrolled      = 1200 * i / 450;
  int scrolling_increment     = new_total_scrolled - previous_total_scrolled;
  yourFunction(scrolling_increment);
}

This is just to give you an idea about how the integer arithmetic works for this problem. You need to adapt this to your desired program control flow, of course, and it can be optimized as well. (For example, in an actual program I probably wouldn't want to keep recomputing previous_total_scrolled when I know I computed the exact same result during the last iteration of the loop.)


Automatic distinction between PC-USB and Wall Adapter-USB

Question: I want to ask if it's possible and an advice on how to make an automatic distinction between an PC-USB port and Wall-USB adapter. I've a battery charger IC (for example http://www.mouser.com/ds/2/405/bq24074-556796.pdf) where I can set max. IN current. I have no problems to set it to 500mA, but I'll always charge the battery at 500mA in PC and Wall-Adapter. But I want to charge the battery at 1-1.5A when I connect it to Wall-Adapter and when I connect it to a PC I don't want to fry PC usb port and charge battery at 500mA. Something like in a smartphone. I thought about sending some data via usb to know if it's an PC or Adapter but I need something more safety and always working.
Comment: You can't check for a short between D+ and D- like everyone else?
Comment: You can get ICs which do all of the detection for you and then switch the USB D+/D- lines through to the rest of your device. MAX14578 is one.
Answer: There are two main ways that USB high current is indicated (Apple's way and everyone else.)
Apple uses a resistor divider to set D+ and D- at various voltages to indicate between 500mA and near 2A charge.  1.1 and 1.5A I think in there.  I would have to think if this puts a kink to below if you use an Apple charger.
Everyone else shorts D+ and D- together.  Many USB charge controllers handle the detection on the USB data lines.  If you are making a one of device, that is an easier route.
For your own detection, tie D+ to VCC with 10k resistor.  Tie D- to GND with 100k resistor.  Read D-, if high you can pull high current.  If low, you can't.
For your Mouser linked chip: Pull EN2 low with 10k resistor.  Connect D- to EN1 to enable full current if data lines shorted or 100mA if not.
Comment: The Apple chargers use 50k ~ 75k resistors to pull the datalines to 2V ~ 3V depending on current and series, in most cases that I remember. So a 100k pull-down might not have a high enough EN voltage any more. The chip does also say it has a 285kOhm pull-down to GND close to where it says to always connect them, so... bit confusing there.
Comment: Yes, I was looking at using a common charger, rather than Apple's own standard.
Comment: I was just making the point, because the OP names no brands at all. But it'll work for most, if not all non-Apples that I know of.


Is the 月-like radical in 前{まえ} identical to 月?

Question: I am a bit confused with the following facts.

Is the 月-like radical in 前{まえ} identical to 月?
Comment: Related: http://japanese.stackexchange.com/q/15479/3437
Answer: As you yourself observe, 月 looks different on its own than as an element in 前, in which it represents a simplification of 舟.  So no, they are not identical.
As an element in other characters, the element that looks like 月 variously represents other historical elements, including 肉, 舟, 丹, and 月 itself, among others.  In some characters the derivation is still significant in how they're written—there are variants of 錆 where the lower-right 丹 was simplified to 円 instead of 月, for example.  A lot of characters contain this element, so we can expect to see some variation in how it appears.
But we can try to find patterns.  When does the left side curve?  Here are my observations, based entirely on how I perceive the current forms of the characters, ignoring their history:

月 itself is written with a curve.
In left-right characters where one side is written like 月, it is written with a curve:
月肋肌肘肝肚肛朋股肢肪服肬肭肱胎胞胆肺朏胖脉胙胚胛胝脂脇胴
朕胸脈脆胱胼胯豚脱脚脳朖脛脯脹腔腕勝腆腑腋脾腓腰腫腺腹腸腱
腦腮腟腿腴腥膜膀膈膊膃膝膵膣滕膕膤臟膓膠膨膳膩膰縢臈臆謄膽
朦膾膿臉膸臍臑臓臘騰臚朧臙・明胡朔朋期朗朝
In certain characters descended from the above, it's also written with a curve:
朋:萠崩堋棚弸繃鵬硼
明:萌盟
朝:廟潮嘲
胡:湖楜瑚葫糊醐蝴餬
朔:遡塑溯愬槊
滕:藤籐
縢:籘
服:箙
豚:遯
肋:筋
In certain other characters it's also written with a curve:
望・覇霸・閒燗癇・羸瀛贏・朞
The rest of the time, the left side of 月 is typically written straight:
有肖肓侑肴肯肩育青冐郁宥胤削背胃前胥胄陏囿屑哨宵脅脊骨俞能
消娟悁涓捐兪峭悄狷脩梢情清剪猜脣偸逍淆菁揃喩随硝愉堕婿惰散
晴渭渝喟隋壻稍揄靖楕膏熊煎潸滑賄腎絹瑜蛸骭逾楡睛錆聾體髑髓
魘龕静猾愈精態榾趙誚蜻膂瘉骰酳厭撒請膚徹罷撤翦瘠銷磆箭墮蝓
蝟籠襲髏鶺鶻霄龍謂靜鞘諭骸輸覦骼隨踰橢鮪膺臀鍮瀞壓蹐膸臂癒
擶鵑繖髀擺羂鮹寵瀧髄蘢鯖羆壟隴轍霰瓏

These are just my own observations.  They aren't intended to be taken as absolute rules, and you may find variation in handwriting or in different fonts.  For example, I've noticed that in some fonts on my computer, 潸 falls into category 4 instead of 5.  But I think that overall the above is relatively accurate.
Answer: In terms of historical development, no, the 月 in 前 wasn't originally the same character as 月 "moon".  As you can see in the old Kangxi dictionary here (slightly left of the center of the page, towards the top), the old form of 前 was 止 on the top and 舟 on the bottom.  The 止 on the top simplified into 䒑, and the 舟 on the bottom transmogrified into 刖.  See also en.wiktionary.org/wiki/前#Translingual.
UPDATE: Looking again at the Kangxi entry, I realized that there were two old variants.  The bottom part of modern 前 is based on the bottom part of the second variant of the old character, consisting of 舟 on the left and 刂 on the right.  That 刂 piece is still there in 前, so the 月 portion of the modern 前 character is entirely derived from the 舟 part of the old character.


Resistor technologies that guarantee failure mode of OPEN and not short--need docs to prove

Question: From chats with several resistor manufacturers, it seems that there's a consensus that certain resistor technologies at high impedance ~120Kohm or more will always open and never short. Does anyone have documentation that reinforces this "fact"? Any ideas?
Comment: Look into carbon composition (bulk, not film) resistors. Overhauling old vacuum tube gear, the hotter running ones tend to be 130% or more of rated value. Don't have specific documentation, sorry,  just saying that's where I'd start looking.
Comment: Ohmcraft has a line of printed resistors that can withstand pretty surprising pulses.

http://www.ohmcraft.com/uploads/WP_SuperiorPulseResistorCapability.pdf

You might consider giving them a ring and seeing if they can guarantee fail-open.
Answer: You might be looking for fusible resistors.  They are designed specifically for to open when overloaded. There's a helpful discussion on the EEVblog forum.
Examples of fusible resistors are those from Vishay and TE.
Comment: Is there any reason you can't use the fusible resistor in series with the 60k-120k resistor that you need?  So what if the 60k fails short, the fusible resistor will open.
Comment: Fusible resistors and chip fuses seem to be limted to very low ohmic values and we need ~ 60K-120K ohm.
Answer:
Resistor technologies that guarantee failure mode of OPEN and not
  short--need docs to prove

I think these resistor types probably fit the bill: -

If you need to research others - there are several brands of wire wound resistors that are regarded as fail-safe when it comes to the design of zener barriers for use in potantially explosive atmospheres.
Here are some other types - try searching "approved safety resistor"
Comment: Have you tried asking UL what they would consider appropriate?
Comment: Yes, trying to. They are being difficult. Hence looking for some concrete docs. Perhaps the better angle is the single-point of failure route raised by @spehro (maybe I need to hire someone to find something that helps in UL916?)
Comment: Explored this with TT on a conf call this morning and all agreed that it will likely fit the bill. But the issue remains how to convince UL that a failure that ends up as a short is impossible.  Safety resistors seem to have very low ohmic values and we need ~ 60K-120K ohm.
Answer: Well, certainly avoid carbon film resistors!
I don't think it is true. I think that the most likely candidate (metal film resistors) have been shown to drop in resistance due to pulse load damage.

Damage Caused By Pulse Loads

More than 80% of the failures attributable to pulse load damage,
  equivalent to 0.04 ppm overall, displayed helical shorts within the
  device, causing a large fall in resistive value. A further small
  number of failures, contributing around 0.01 ppm, displayed a positive
  change in resistance. These failures arise from irregularities in the
  ceramic surface that compromise the sputtering process and the
  formation of the resistive film. Harsh pulses can then cause local hot
  spots that gradually destroy the sputtered resistive layers and the
  neighbouring resistive film.

For safety-critical applications you may have to put two resistors in series.
Edit:-
Could you use a resistor in series with an approved Y-rated capacitor?
I also note that sometimes UL-listed ESD wrist straps use two resistors in series
(one at each end). That's a clear example where a resistor failed short could expose someone to severe risk of electrical shock.
Comment: From what I've understood, placing even 4 resistors in series will not guarantee an open failure instead of a short.  In other words, there could be a cascading failure that will result in all resistors in series shorting.  So we're back to the original question: assurance that failure will result in an open and not a short.
Comment: I mentioned it because it does seem to satisfy UL requirements for some applications- no single point failure can cause a hazard. There are UL recognized fusible resistors, but not 100K ohms AFAIK.
Comment: Funny -- that's been my argument as well.  Seems like the no single point of failure argument can fly for much more safety-critical applications, but no for ours!? This is actually for a wall switch, filed under ENERGY MANAGEMENT EQUIPMENT - UL 916. Nothing in the standard seems to deal with single point failure, etc.
Comment: The particular piece of equipment I have in mind could easily completely take out a single-family dwelling (WMD anyone?).
Comment: Is there a UL doc that describes this single-point of failure point, or is it specific to each standard. UL916 doesn't seem to talk about this either way.
Comment: I don't know if they were that prescriptive, just know that it passed.


How to import query result from splunkstorm to your app?

Question: You can run query on splunkstorm and you get some specified data formed in a table. I created a project on C# and trying to retrieve data from storm to app.
What I tried: installed SDK, started splunk server. But I can't find a way to connect to my splunkstorm.com account execute queries.
The question is how can I import query result from splunkstorm.com to my app?
Answer: My way is to write a small BASH Script witch cll the REST API of SPLUNK and saves the data to an CSV file. Then I take the file an do something interesting (build report, make robustness check, ...). This way look complicated, but in real life it is much easier. Plus, you can test your query independly of your code. This will speed up your development and your debugging. By the way, some SPLUNK SDK Versions, Java SDK too, have nasty bugs.


Does there exist a non-trivial Ultrafinitist set theory?

Question: Does there exist a set theory T-which has not yet been proved to be inconsistent-and in which
one can prove the existence of (1) the empty set (2) sets that are singletons and (3) sets which
have non-empty proper subsets. T has no axiom of infinity but-as with Quine's NF-one can prove in
T the existence of a universal set (i.e a set of all sets). However-unlike Quine's NF-the universal
set of T should be finite. One can think of T as being formalized in the classical first order predicate
calculus, using the same language as ZF.
My motive in seeking a set theory such as T is to find out whether there exist set theories that might
be acceptable to an ultrafinitist (as conforming to the principles of that viewpoint), while still
allowing a certain amount of arithmetic to be carried out in them.
Comment: What was Skolem's reaction  to Skolem's paradox?
Comment: The general goal of this question seems interesting to me, regardless of the merits of this specific proposed set of axioms. People who want a universal set are generally people who are interested in claiming the existence of the biggest infinities they can name without having inconsistency. Ultrafinitists want exactly the opposite. If someone could make a model that did both at once, and its properties were sufficiently compelling, it would probably cause some serious indigestion on both sides, like Skolem's reaction to Skolem's paradox.
Answer: Perhaps I have misunderstood your requirements, but it seems that the following trivial theory has all your desired properties. Namely, let $T$ be the theory asserting

There are exactly three distinct objects: $E$, $P$ and $V$.
$E$ has no members.
$P$ has only $E$ as a member.
Everything is a member of $V$, including $V$.

This theory is clearly consistent, since we can write down a finite model, with three elements. In fact, this is the only model of $T$. But meanwhile, it has all your properties, since it asserts that $E$ is empty and that $P$ is a singleton and that $V$ has a nonempty proper subset, namely, $P$. Finally, $V$ is finite, since it has exactly three elements.
(One quibble, you said in (2) that you wanted "sets" and not just a set that was a singleton. In this case, please add another set $Q$ to the theory that has only $P$ as a member, and also make $Q$ an element of $V$.)
I suspect that you may have in mind that the theory should also include additional unstated set-theoretic principles.
Comment: Another point to think about is why we would consider your example trivial. It feels trivial because it's only got 3 members, but would it be any less trivial if it had 4 members, or too many members to describe within the length limit that MO sets for posts? Remember, the goal is to make a finite universe of sets.
Comment: The issue we need to get the OP to clarify is whether #2 means that (a) at least one singleton set exists, or (b) for every set, a singleton exists containing only that set. If a, then your model works. If b, then as I argued in my answer, no model exists.
Comment: Ben, yes, I agree with all that.
Answer: I have been studying a theory I call Modular Arithmetic (MA). MA has the same axioms as first order Peano Arithmetic (PA) except Ax( ~S(x)=0 ) is replaced with Ex( S(x)=0 ). MA is consistent because it has arbitrarily large finite models base on modular arithmetic. The upward Löwenheim–Skolem theorem proves MA must have infinite models. MA can be made into an ultra-finite theory by adding an axiom like Ax( x=0 or x=S(0) or ... or x=Sn(0) ) where Sn(0) is some finite number of applications of successor to 0 (a numeral).
Coming up with a set theory based on MA is problematic. It is simple to show MA is omega inconsistent. The predecessor of 0 must be non-standard (not a numeral) in any infinite model of MA. If the predecessor of 0 is standard we can prove the model is finite using induction. This means Ax( ~S(x)=0 ) is true for all standard natural numbers in any infinite model. A set theory based on MA can't be well ordered or well founded, either. (x =< y) <-> Ez( x+z=y ) is trivially true for any x and y. Using S(x) = x U {x} as a definition of successor is inconsistent with the axioms of MA.
In ZF, even the Axiom of Pairing allows the construction of arbitrarily large sets. Assuming we could come up with a set theory for MA, it would have the properties you ask for. One way to do this would be to encode sets as binary expansions of natural numbers. Element x is a member of the set if the x'th bit of the expansion is true. This would allow us to have sets of size log2(n) where n is the size of the universe. We can equate 0 with the empty set. We can define singleton sets for "small" elements of the universe. We could also define sets with subsets. We could do a reasonable amount of arithmetic by choosing n large enough. We could have sets and do math on sets as large as 100 by having a universe of size 2^100.
Answer: If there is such a theory, I doubt that an ultrafinitist would like it. The universal set V has to contain itself as an element, and that means you can have chains of unlimited length of the form $x \in y \in \ldots \in z$. But an ultrafinitist doesn't want objects of infinite size, and V smells very much like an object of infinite size (depth).
Depending on the exact interpretation of your axiom #2, and what you mean by set equality, I don't think such a set theory exists. If #2 is meant to say that for any set, there is a singleton containing that set as its member, then we have the existence of $\emptyset$, {$\emptyset$}, {{$\emptyset$}}, ... and all of these are elements of V. If set equality means what people usually take it to mean, then these are all unequal, so V is infinite.
[EDIT: more material added below]
If, on the other hand, the meaning of your axiom #2 is as assumed in JDH's answer, and not as assumed in mine, then there is no generic machinery in your axioms for building new sets out of old ones. This raises the question of the specific meaning of "a certain amount of arithmetic." In JDH's answer, the objects P and Q can be identified with the numbers 1 and 2, and we can clearly make models where this process extends up to some larger integer, such as 387. Then you have a theory with enough objects in it to name the first 387 integers. Is this enough arithmetic? To make this a compelling realization of what we have in mind for a set theory, I think you would want to describe things like "the set of all odd integers less than 153," but your axioms don't have enough machinery in them to generate anything like that.
I think the basic problem here is that if we're going to be ultrafinitists and only admit the existence of integers up to some size $n$, then any set theory that can describe the existence of all sets made out of those integers is going to have a number of sets much, much larger than $n$ --- unless we don't provide enough machinery to generate a rich universe of sets out of these integers, in which case it won't feel like a compelling realization of what we have in mind when we talk about a set theory. This problem is bad enough without the universal set. The universal set just makes it infinitely bad.
Comment: I don't think ultrafinitists would accept the arguments in your first two paragraphs: they're essentially the same as the argument that from 0 and S, one obtains infinitely many natural numbers; and this is exactly the kind of induction instance that ultrafinitists reject.  In particular, "$V \in V$" seems no worse than "$0 \leq 0$", which I'm pretty sure ultrafinitists accept.
Comment: Perhaps the requirement should be that the universal class is finite?
Comment: @Charles: I don't think the argument in my second paragraph depends on any assumption that V is a set rather than a proper class.
Comment: @Peter LeFanu Lumsdaine: In the second paragraph, I'm sketching an argument within ZFC, not within an ultrafinitist theory. The OP asked (if I'm understanding correctly) whether there are models of his/her axioms within ZFC that are finite. In other words, when the OP says, "the universal set of T should be finite," I think this has to be understood as a statement within ZFC, to be proved within ZFC, about a model of the axioms in ZFC. I don't think "finite" has a definition within the theory the OP was proposing.
Answer: It appears to me that meaningful ultrafinitist arithmetic is possible, but it has limitations e.g. cannot include functions growing too fast such as exponentiation to a variable power. Proving the existence of $x \mapsto 2^x$ would require a stronger form of induction than accepted by some ultrafinitists.
This MO question seems relevant: Is there any formal foundation to ultrafinitism?
Comment: Thanks to you all for your insightful comments. Joel, that is a really neat little model which certainly satisfies my requirements
and you are right that I am going to need additional axioms-only it
is not at all clear to me what those should be. I would like to be able to carry out Nelson's arithmetic in T and also to have 2^x not
defined for all sets x (just as Nelson does when x is a number
variable). The existence of a universal class is probably not needed
and may make things more complicated.


Why cosmic background radiation is not ether?

Question: why cosmic background radiation is not ether? I mean it's everywhere and it' a radiation then we can measure Doppler effect by moving with a velocity.
Answer: The luminiferous aether was, by definition, a hypothesized medium that was needed for electromagnetic waves to propagate through space. The cosmic microwave background isn't needed for photons to move; indeed, they move through space even if one removes (shields) the cosmic microwave radiation. So that's why CMS isn't luminiferous aether.
On the other hand, the aether also made a particular prediction, the existence of a preferred reference frame. In this sense, the CMB plays the same role as the aether. Cosmologists use the reference frame associated with the CMB as the preferred coordinate system. However, this ability to pick a "preferred" coordinate system depends on the environment – the CMB is just some property of the environment that could possibly be different as well (e.g. if you shield it). In this respect, it still differs from the luminiferous aether that couldn't have been shielded and that guaranteed the existence of a preferred coordinate system in any situation, regardless of details of the environment.
Comment: It may be worth noting that CMB's "rest frame" is still a non-intertial frame. This is trivial to show in GR, as no frame can be globally inertial. Equivlently, one can reason that two ships at rest with respect to the CMD "rest frame", but seperated by supercluster-scale distances will still not appear at rest with respect to each other (due to hubble expansion) which conflicts with the fact that being at rest is a transitive property in an inertial frame.
Comment: Agreed. The relative motion of the CMB frames defined at various points - the Hubble expansion - is the very same obstruction as the spacetime curvature, after all. ;-) That's what prevents us from using the flat spacetime of special relativity to describe a generic cosmology, i.e. a curved background of general relativity, using any coordinates. It's just physically not flat i.e. not special relativistic.
Answer: There are a couple of misconceptions here. The CMB radiation is thought to be the (historical) light left over after the big bang. Due to space expansion, it has been red-shifted towards the microwave region of spectrum. While on the other hand, ether is the medium required for light to travel when it was thought as a longitudinal pressure wave (like sound)...
In light of your question, you're saying that the red-shifted EM radiation acts as a medium for light to travel... - which is certainly untrue..!
Answer: Why cosmic background is no ether is not a question it is a statement.
A question would be is the cosmic background an ether?
For one thing it is an inertial system.
This inertial system can be found by anyone in the universe.
One can find(calculate) his or her velocity to it.
Since a inertial system is sufficiant to describe physical phenomena in it has all the properties to state that Lightvelocity is constant c in it.
If Michelson knew what we now know about Cosmic Background Radiation he would not have build his large interferrometers to measure the velocity of the solar system to the universe and special relativity would not have emerged.
Comment: This is total nonsense. How in the world can you claim that the existence of the CMB is inconsistent with relativity?


How can I download a huge folder from Google Drive?

Question: I have a folder shared with me on Google Drive that is much larger than 2 GB. When I try to download it Drive zips the folder but stops when the file size of the zip archive is larger than 2GB.
How can I download this huge folder from Google Drive?
Answer: Use Google Takeout.
In the archives, select Google Drive and select the folder you intend to download. If the folder size is greater than 2GB, it gives you the content in different zip files and send email confirmation, so that you can download
Answer: Use the open source command-line tool drive to sync the whole folder to your local hard disk recursively, downloading the contained files recursively instead of in one huge ZIP archive.
Use a command like this:
drive pull "Google Drive Folder Name to Download"

This will download only changes and new files, so a one-way sync from remote to local. It will ask for confirmation after presenting what would change.
Google Apps files (Google Docs, Google Sheets etc.) will be included only as *.desktop files with links to their online versions, since their native format is not accessible. However, you can also tell the command to include exported versions of Google Apps files (which it will do whenever detecting a new or changed Google Apps file):
drive pull -export=docx,xlsx,pptx,svg "Folder Name"

For more information, see drive help pull.
Answer: You can use rclone utility. Install via apt install rclone.
Syntax:
rclone copy --drive-root-folder-id 1-shared-id-XXX-YYYY gdrive: localdir

where gdrive is the name of your remote that you've configured.
Check the configuration steps at https://rclone.org/drive/.
GitHub project: https://github.com/rclone/rclone.
Answer: I found that JDownloader 2 does the job perfectly if you want to download a large folder from Google Drive (eg. 20 GB) and don't need to recreate all the original directories.
Just use the function "capture links" after pasting the shareable link of your Drive folder.  Then, select all the links JDownloader finds, and hit "download". The result is perfect.

From the JDownloader Website: JDownloader is a free, open-source download management tool with a huge community that makes downloading as easy and fast as it should be. Users can start, stop or pause downloads, set bandwith limitations, auto-extract archives and much more. It's an easy-to-extend framework that can save hours of your valuable time every day


Webcast based website in php

Question: I have a client who's requirement is that he wants a website which would be able to stream through uploaded videos through search. And the most demanding requirement is that they have certain events held every week and they want those events covered and recorded on camera and this video should be visible on the website live.
I know how to make website in php but I don't know what is the requirement for a webcast based website specially the camera and bandwidth requirement.
<code>Also what are the requirements and methods for a website which can stream videos uploaded on server.I am totally new to video streaming and don't know how to do it in php.
</code>
Please explain me the way to implement it.
Comment: if you put them on youtube, you don't have to worry about bandwidth
Comment: And even though you don't know how to do that - you still was hired?
Comment: I have to give the client the requirements for the site and camera, my role will be to develop site modules which i can and the client has other guys for other tasks according to the requirement.
Answer: Try the HTML5 webcam capture.
It was highlighted during Google IO.
I think you need to Google for the method. I have not really used it just yet.
Answer: As an alternative to Red5 that could be more suitable for what you are trying to do is the Nginx-RTMP module. https://github.com/arut/nginx-rtmp-module If you currently use, or can use Nginx, the module is easy to configure and work with. It can accept and feed live video over RTMP to flash-based players like JWplayer, and simultaneously create HTTP Live Streams for playing on Apple devices (and other devices like ROKU, etc.).
I have it setup on a couple servers, and have been very pleased with the results. It accepts video over RTMP and just does a great job IMHO.
With Nginx-RTMP, I use scripts that run ffmpeg to stream pre-recorded files "live" to the server. And then when we actually want to have a real live video feed, just stop ffmpeg and stream from our live location either with a computer running ffmpeg (like from a studio with a video feed), or with OSBroadcaster on a phone or tablet, or really any software or app that can stream video over RTMP.
You can automate all this with some PHP back-end, so your pre-recorded material automatically gets stored on the server (Nginx-RTMP can record your stream too) and displayed on the proper page in an HTML5 video element or flash-based video player, or both. And when the live feed is actually live, you can have PHP show a player window on your page that is displaying the live stream.
This is over-simplified of course, but hopefully you can get a feel for how it works.
See also How to set up your own private RTMP server using nginx for more info on the Nginx-RTMP module.
As for camera, it totally depends on the situation, and that's kindof a whole other arena. You could use something like a webcam, or a tablet/smartphone that streams via RTMP, or a professional camera that feeds into a computer running an RTMP client streamer like ffmpeg (I think VLC works too). Or Teradek and some other companies make some little hardware boxes (Teradek Vidiu) that you can plug in a video input and they will encode and stream the video over RTMP to whatever server you specify.
Bandwidth depends on a lot of factors: how many viewers you will have, the video quality and resolution, and how many simultaneous streams you need to support (multiple live streams from different locations, etc.)
Your upload bandwidth (camera to your streaming server) can range from 100kbps or so on up to a few Mbps, depending on the requirements for your video. To give you a typical example though, if you are streaming standard definition video at 24-30 frames per second, with a good codec like h.264, you can expect a decent quality stream to take up around 400-700kbps. It can vary a lot from that, but that's a good starting point. If you are sending 720p30, you may want to use about 1-1.5Mbps or so. 1080p30, maybe 1.5-3Mbps, UHD, 5-6Mbps. But like I said your choice of bitrate will vary based on your quality needs.
Then what you stream out, you multiply that rate by the number of viewers that you want to support, add one more for your upload stream, and you have your total bandwidth needed. There are other things to take into consideration, but you have your starting point.
Answer: I did a lot of research and found that we have to use a flash kind of server.
For that we have 2 choices : RED5 and Flash.
RED5 being open source while Flash is not free.
for such kind of webcasting we require such server installed and then use the appropriate api and embed the flash player into your webpages.
These special servers are required as we need to process requests without refreshing the page and then load the content dynamically.

Webcast based website in php


Subtracting lines/stroke from a vector shape

Question:
I made this logo in illustrator (pictured above) and cannot for the life of me figure out how subtract the lines from the black text so that I can place it onto different backgrounds without having the lines show up. I attempted to use pathfinder to do this but, it doesnt work. I believe this has something to do with the fact that they are just lines with a stroke on them. Can anyone please help me??
Answer: You most likely need to expand the strokes, then the various pathfinder tools the get exactly what you need. From your question you seem to be familiar with the pathfinder options so:
Select the stroke lines you need to change. Then under the effect menu, go to path then outline stroke. From there you can use expand appearance, making them fill and not stroke.
After that the pathfinder tool will work as it should.
If not select all and try expand or expand appearance on the whole thing.
Lastly you may have a layer issue. So open the layer window and play with that.


BMW 118d Radio Problem

Question: So I installed a after market radio. Apparently BMW doesn't have a ACC+ wire, only a constant 12V (yes it was weird for me also) I checked all the cables with my multi meter but there wasn't a single ignition 12v
So I connected a cable straight from the fuse box where I found a 12V ignition socket. Hooked it up to the radio and it worked, radio turns on and of with ignition. BUT THE PROBLEM IS, my radio won't remember anything, for more or less 15 minutes without the key ignition it does remember everything but if I leave the car without ignition for a hour or so it lost everything, the original BMW radio didn't had this isue at all.
So does anybody know what is the problem and how I can solve this ?
Answer: Most cars, including BMW, have a key controlled ACC supply - usually position 1 on the key, with position 2 being the ignition (battery warning lights etc) and position 3 being start - (some older diesel vehicles had position 3 as engine heaters, with position 4 as start.
Find the wires connecting to the ignition switch - under the steering column and check there with your multimeter.
Comment: Thank you but what I don't understand is the fact that the continues 12V is always giving me power, yesterday after leaving the car in the garage for a couple hours I checked and it still gave me 12V and the continues usually supposed to save all the settings..
Answer: You did not supply your year so I just guessed at one. E81 >2005/08 Looking at the power supply schematic you are correct. I did not dig much deeper then the schematic and not being familiar with bmw radios this is mostly just guessing but Your aftermarket is probably designed differently requiring a KAM (keep alive memory) supply at all times. and the power supply is probably being cut off after a hour or so for some reason. BMW and MB like to cut power to modules when they sense certian faults. leave a meter hooked up and shut the car up for a few hours and  see if the supply is still there.

BMW 118d Radio Problem


Conservation of momentum on moving charge

Question: The  forces of attraction or repulsion between two stationary charges are the action and reaction forces between them. So when we move one of the charges then the other charge also gets affected. But the force goes in the speed of light. So when one charge is moved apart the force between them decreases. But the other charge can't feel it instantly. So in this time both two charges don't attract other in the same force. So action force isn't equal to reaction force. Thus conservation of momentum is violated. How can this happen?
Comment: Is this actually a question?
Comment: @Dr Sheldon Sorry. Edited now.
Answer: You are actually completely correct about this. There are many situations with electromagnetism (EM) that violate the conservation of mechanical momentum. Note the use of the word "mechanical" in mechanical momentum.
It turns out that the EM field also contains momentum. In EM the total momentum is conserved including the momentum of the field as well as the mechanical momentum. In CGS units the momentum density of the field is $\frac{1}{4\pi c}E\times B$.
So whenever the mechanical momentum is decreased you will find that the field momentum increases, and vice versa. The mechanical momentum is not transferred instantly, as you correctly suspect in your question. The field carries momentum at a maximum speed of c, consistent with the usual universal speed limit.
Answer: The charges would either fall on each other or  diverge to infinity, if they were a  closed system ( classically, quantum mechanically they could be in the energy levels of an atom). It means that they are kept stationary by an external force, and thus the system is not closed. Momentum conservation holds for  closed isolated systems. In addition , moving the holder of one of them, introduces acceleration, i.e.dp/dt and so the system is not closed and needs a different analysis  too, as accelerated charges radiate.
There is no problem with momentum conservation.


recevering data from broken screen on micromax yureka having broken screen

Question: MY screen of Micromax Yureka is broken and I can't see anything, Plus my usb debugging is off. Is there any way to recover data?
Comment: Welcome to the Android Enthusiasts! Please see our [broken-screen tag-wiki](http://android.stackexchange.com/tags/broken-screen/info) (scroll down to the "data recovery" section). You'll even find a similar question there: [How to backup broken screen phone when USB debugging IS NOT enabled?](http://android.stackexchange.com/q/67352/16575) (but unfortunately, the answers there won't help you much as they are Samsung specific, using *Kies* for that). But checking the others should get you started.
Answer: A non-device specific approach would be to access your device through adb.
This route requires you to have a custom recovery already installed on your device.
Boot your device into recovery mode.
Connect to pc, open a terminal, and execute the following...
adb shell mount /data
adb shell mount /system
From there you can, if you need to, pull the entire /data partition [most anyway] Symlinks and some firmware files may error out.
adb pull /data
and so forth. If you have permission denied when pulling,run the following,
adb shell mount -o rw,remount /data
No. You can not do this with a stock recovery though Yureka might be different.


Physical Interpretation of d'Alembert Operator

Question: $$\mathop{{}\Box}\nolimits=\frac{1}{c^2}\frac{\partial^2}{\partial t^2}-\mathop{{}\bigtriangleup}\nolimits$$ is the d'Alembert-operator. It seems to consist of an oscillation and a diffusion. Is there a simple physical interpretation of it?
Answer: This is the wave operator. For example, a solution is the plane wave $A e^{i(\vec{k}\cdot\vec{x}\pm\omega t)}$ where $\omega=|\vec{k}|c$.
Diffusion involves a first-order time derivative, not a second-order time dervative.
Physically, the meaning is that the "acceleration" of the field at a point is negatively proportional to the difference between the field value at that point and the average of the field values on an infinitesimal sphere around that point. If the value is higher than nearby, it will decrease, and vice versa.
This sounds similar to diffusion, in that the field tries to "even itself out", but the second-order time derivative means that it overshoots and oscillates rather than relaxing to an evened-out value.
Answer: Re.
$$\mathop{{}\Box}\nolimits=\frac{1}{c^2}\frac{\partial^2}{\partial t^2}-\mathop{{}\bigtriangleup}\nolimits$$
This is the operator for the classical wave equation which in one dimension  is
$$\frac{\partial^2f}{\partial x^2}-\frac{1}{c^2}\frac{\partial^2f}{\partial t^2}=0$$
It may be easiest to get a physical interpretation (or intuition) in the one dimensional time space domain where the solution is of the form $f(x-ct)$ or $f(x+ct)$.
see
https://physics.stackexchange.com/a/395212/45664
"From the geometry alone, it was only needed to note that a change in t multiplied by the velocity yields the same results (as measured by the second derivative) as a change in x --that is, a translation of f(x−ct)."
The details are given in the link above.
Note that $\bigtriangleup x=\bigtriangleup ct$ in the denominators of the wave equation.  So it is about a change in $x$ being the same as a change in $t$ when scaled by $c$, which is apparent by examining $f(x-ct)$ or $f(x+ct)$.


How do you remove hair from around your anus

Question: The scholars state it is recommended to do this as filth can attach to the hair and it is included in the definition of pubic hair. Now I don't wish to use a razor but just a trim - looking in a mirror underneath and small scissors is very hard. If you are unmarried or the wife doesn't want to assist what can you do? Only a doctor if he is examining that area may see it without it being haraam. What other options are available? I can't think of any more.
Comment: You could use then men hair removal creams instead.
Comment: Hair removal cream on sensitive skin in the pubic region has a good chance of giving you chemical burns. Maybe ask someone who knows about those products (a beautician or someone in a waxing studio) about possibilities?
Answer: From my experience.
At young ages when the hair start to appear I used to use a small scissors but that would take long time and sometimes you may hurt yourself. After that one my friends said he used a razor so I tried it with caution I used to use the fix blades which are not flexibility nowadays I used one of Gillette razors with flexible blades they are very good because it somehow does not hurt the skin When I was young that was easy because no belly there hehe but now it is harder with my belly. If you have a big enough mirror in the bath room that would help.
Answer: Very easy. Use disposable razor (eg gilette) and any sensitve shaving cream (eg nivea). Place foot onto high place (bath tub edge/sink surface) to access under carriage. Hold razor in thumb and first finger. Run strokes towards groove/crack starting with butt cheek of the leg on the floor. Repeat otherside. Gentle slide of razor is totally safe with safety razor.
The scrotum (ball sack) should be done first. Just pull the skin so it is stretched and gentle strokes will clean pubic hair. DO NOT USE MACHINES OR SCISSORS.
Answer: If you are unmarried or the wife is unwilling to help, and removal creams are out of the question, then I suggest that using a mirror and a small scissor is the best way to cut the hair, and then using a razor to shave the shorter hairs after the longer ones have already been cut with the scissors.
Answer: it's quite a shame that even now in 2018 men arent taught about self grooming properly, there's 3 ways I absolutely recommend trimming the hair around the anus, cheeks, testicles and even penis, please read;

Yes it's possible to shave and it can be safe IF you use aloe vera based shave gel, and a standard disposable razor (don't use the brand BIC) test the gel on your skin first so you're aware if it irritates or not, then apply the gel on the pubic areas and short gentle strokes, I promise if you do this correctly it will not cut you, finish off by rinsing with cool water, dry and then apply shave balm followed by talc powder if possible.
yes it's also possible to trim as long as you do NOT expose the teeth of the blade of your trimmer directly on your skin and especially around the testicles region, use a guard preferably grade 0.5 to grade 1, rinse with cool water and dry.
This to be honest is the best way you can now buy hair removal cream for men and no it's not feminine to use dont feel embarrassed or ashamed, do a patch test on your arm or leg first to see how it reacts, if all is good then apply on your pubic area leave for roughly 3-5 mins if you feel it stinging slightly then wash off with cold water straight away, do the same once times up, then dry gently and finish off the same way in number 1.

thank me later brothers.


Pyspark: Convert column to lowercase

Question: I want to convert the values inside a column to lowercase. Currently if I use the lower() method, it complains that column objects are not callable. Since there's a function called lower() in SQL, I assume there's a native Spark solution that doesn't involve UDFs, or writing any SQL.
Answer: Import lower alongside col:

from pyspark.sql.functions import lower, col

Combine them together using lower(col("bla")). In a complete query:

spark.table('bla').select(lower(col('bla')).alias('bla'))

which is equivalent to the SQL query

SELECT lower(bla) AS bla FROM bla

To keep the other columns, do
spark.table('foo').withColumn('bar', lower(col('bar')))

Needless to say, this approach is better than using a UDF because UDFs have to call out to Python (which is a slow operation, and Python itself is slow), and is more elegant than writing it in SQL.
Answer: from pyspark.sql.functions import lower

df = df.withColumn("col_name", lower(df["col_name"]))

Comment: Welcome to Stack Overflow! While this code may solve the question, [including an explanation](//meta.stackexchange.com/q/114762) of how and why this solves the problem would really help to improve the quality of your post. Remember that you are answering the question for readers in the future, not just the person asking now. Please [edit] your answer to add explanations and give an indication of what limitations and assumptions apply.
Answer: You can use a combination of concat_ws and split
from pyspark.sql.functions import *

df.withColumn('arr_str', lower(concat_ws('::','arr'))).withColumn('arr', split('arr_str','::')).drop('arr_str')

Answer: Another approach which may be a little cleaner:
import pyspark.sql.functions as F

df.select("*", F.lower("my_col"))

this returns a data frame with all the original columns, plus lowercasing the column which needs it.

Pyspark: Convert column to lowercase


How to find mutations related to disease for a protein?

Question: I have done research on the protein (CYP3A4). I have its function, purpose and diseases (breast cancer, prostate cancer, testicular cancer, lung cancer). I am however having trouble finding the mutations of the protein and how it correlates with the diseases, specifically breast and prostate cancer.
Comment: What is your question? If you want to know more about the protein the way to go is to read papers about it.
Comment: Where do I find such papers
Comment: Does anyone know about my question and can help?
Comment: [Pubmed](https://www.ncbi.nlm.nih.gov/pubmed), [Google Scholar](http://scholar.google.com)... As it is written, your question is just too broad (also unclear because there is no real "question"). Please clarify and narrow it down to focus on a specific issue.
Answer: I think I understand what you are asking so I will make a little guide to find what you need:
NOTE  the mutations you are searching for are probably on gene level so you can search your protein on Uniprot and then use the gene name to search on DisGeNET, you typ in the gene you are searching for:

Then you hit the search button and this will give you a result like this:

You can see that this site uses a sort of text-mining, in other words it is searching for the gene name associated with disease in articles. The score is an indication for how good the text-mining "worked". As mentioned in the manual:

We have developed a score to rank the gene-disease associations
  according to their level of evidence. DisGeNET gene-disease
  association score takes into account the number and type of sources
  (level of curation, model organisms), and the number of publications
  supporting the association. The score ranges from 0 to 1.

Then you have to click the browse details... in the down right corner. This will guide you to another summary page like this:

(NOTE I omitted a lot of rows to avoid huge images in the answer, so there will be more rows in your result). Because you were interested in prostate cancer I will click on Prostatic Neoplasms:

You can click on the 3 to obtain the 3 articles where the combination of the CYP3A4 and Prostatic Neoplasms was found. This will give you a list like:

As you mentioned in your question

"where do I find such papers"

You can easily click on the PMID this will guide you to the article, for example the first article:

CYP3A4 polymorphisms--potential risk factors for breast and prostate
  cancer: a HuGE review(link).

I think this will help you to find the papers related to the protein + disease, you can further read the papers to find mutations which cause these diseases.


Can tomato sauce with cooked pork in it be eaten after sitting out in pot and a/c overnight?

Question: I made tomato sauce with browned pork roast pieces in it and cooked it for around 6 hours and left overnight by mistake until the next morning. Lots of sodium and water. My apartment a/c is set at 75 degrees C. Can this be safely eaten after reheated to boiling for an hour and then refrigerated before eating for dinner that night?
Comment: I think you are be messing up your temperature scales.  75° F(arenheit) is a comfortable room temperature.  75° C(elsuis) is 25° hotter than the hottest spot on the planet in the last 24 hours (Semawa, Iraq at 49.5° C)
Comment: 75° C = 167° F I highly doubt this was the actual temperature of the apartment.
Comment: My a/c is set for 75 degrees C. it is summer and hot outside. I have a digital thermostat. What is your point Debbie? I appreciate your help.
Comment: thank you both for your help! I really appreciate it! My family and I enjoyed the sauce with the pork and it was delicious! Thank you all for your comments and help!
Answer: It is not possible that your A/C is set to 75°C. That's significantly hotter than the hottest outdoor temperature ever recorded on earth (54C or 129F). Yes, food held at 75 degrees centigrade is out of the danger zone. If, however, the A/C is really set to 75 degrees Fahrenheit (which is a normal room temperature), the food will not be safe, unless it is extremely acidic (compare ketchup). While salt can be a preservative (compare kimchi and salty pickles), excess water inhibits that effect.
Comment: @JosieFerro Please be sure you understand. Your apartment temperature WAS NOT 75C. From [Wiki](https://en.wikipedia.org/wiki/Highest_temperature_recorded_on_Earth): "The highest confirmed temperature on Earth... was 54.0 °C (129.2 °F) recorded both in Death Valley, California on 20 June 2013, and in Mitribah, Kuwait on 21 July 2016". Your apartment is 75F, which IS in the danger zone. Your sauce was in the danger zone too long to be considered safe. I edited the answer to hopefully make it abundantly clear.
Comment: rackandboneman:  I only added water to reheat this morning before refrigerating. Is it still ok to cook to boiling before eating tonight?
Comment: Hey, it was my job to be deadpan (though I thought it was still unambigous :) ), and her job to clarify for posterity:). I think salt concentrations and when they are enough to preserve (or guarantee lactic fermentation) should be made another (interesting) question :)
Comment: Background: In food safety circles, the term "water activity" is used a lot. It is very relevant when determining whether a food is or is not a perishable food subject to 2/4 hour rule. The lower the more stable. Salt and sugar lower it. Water raises it. Acid helps if it is concentrated enough. Very salty food tends to safely ferment, creating acid that also helps. Water dilutes acid. Salty and acidic enough to be stable is likely going to be condiment grade salty and acidic, not palatable bulk food grade.


Tongue and frozen metal

Question: I understand that when you put your tongue on frozen metal, your tongue sticks to the metal but how does having a layer of ice covering the metal prevent your tongue from sticking?
Answer: When you touch your tongue to metal colder than the freezing point of water, your saliva freezes and your tongue gets stuck.  The metal conducts away the heat from your tongue.  When there is a layer of ice covering the metal the ice partially melts when your warm tongue touches it and your tongue doesn't stick.  The ice is not nearly as good a conductor of heat as the metal.
Comment: Yes! One reason aluminum ice trays are no longer used. Wet fingers too easily stuck to the tray!

Tongue and frozen metal