Exploring beyond event horizons

Question: In the expanding universe the velocity of separation between galaxies depends upon how far they are. If they are much far away will they have relative velocity of separation greater than speed of light and if so how can we even detect such galaxies.
There are things like Quantum information that can travel faster than light using entanglement, is there any any possibility to detect such unseen horizons using such effects?
Comment: possible duplicate of [Is it possible to have faster-than-light movement in General Relativity?](http://physics.stackexchange.com/q/36500/)
Comment: possible duplicate of [What is the theoretical limit for farthest we can see back in time and distance?](http://physics.stackexchange.com/questions/67412/what-is-the-theoretical-limit-for-farthest-we-can-see-back-in-time-and-distance)
Answer:
If they are much far away will they have relative velocity of separation greater than speed of light and if so how can we even detect such galaxies.

We can't detect such galaxies. Redshift goes to infinity at the cosmic horizon, and we cannot see beyond. Note that the cosmic horizon is different from the Hubble sphere: At the former, relative velocities according to parallel transport along the light ray reach $c$, whereas recession velocities reach $c$ at the latter. As far as observable effects go, the Hubble sphere is largely irrelevant.

is there any any possibility to detect such unseen horizons using such effects?

No, entanglement cannot be used that way -  it is completely useless without a classical channel of information to 'compare notes'. If one of your particles vanishes behind an event horizon, such a channel is unavailable (Note that from your point of view, the particle will actually never cross the horizon, but gets frozen in time and become unobservable due to redshift).
The fact that the particles are quantum correlated instead of classically doesn't really matter. Instead of using entangled particles and the cosmological horizon, you could take a red ball and a blue ball and put them into two boxes without looking. Then, throw one of the boxes into a black hole and open the remaining one. You'll instantaneously know which ball ended up in the black hole - but what will such an experiment tell you about its interior?
Comment: can we have a situation like this in which we have three galaxies A,B and C.A farthermost B in middle and C our position.A is beyond Cosmological Event Horizon for us i.e. C but not for B. Can B observe its state can transmit it to us.
Comment: @ReXdean: no; the cosmic horizon is an *event* horizon, so you have to take into account the time of arrival: the signal emitted at A will reach B at a point in time that lies beyond C's horizon
Answer: Even in special relativity, the claim that light always travels at a constant speed of c is only true in inertial reference frames, in non-inertial coordinate systems like Rindler coordinates, the coordinate velocity (change in position coordinate with respect to coordinate time) may vary. In general relativity, all coordinate systems covering large regions of curved spacetime are non-inertial, although in infinitesimal regions of spacetime you can have "local" inertial frames, and according to the equivalence principle light must be  measured to have a local speed of c in all local inertial frames.
If you use the particular choice of time coordinate most common in cosmology (chosen so that the average density of matter/energy is approximately uniform across large regions of space at each moment of coordinate time), and use proper distance to measure distance between galaxies or light rays (where proper distance is the distance that would be measured by a series of short rulers laid end-to-end at a particular moment of coordinate time), then you can define a "velocity" in terms of the rate proper distance is changing with coordinate time. The total velocity of an object at any proper distance D can be broken down into a sum of "recession velocity" due to the expansion of space (the velocity that an average galaxy at that distance would be expected to be moving away from us) and "peculiar velocity" due to the object's motion relative to what we would expect for an "average" bit of matter at that distance. The recession velocity at proper distance D, i.e. the expected velocity for an average bit of matter at distance D, is given by Hubble's law as v = HD, where H is the Hubble "constant" (the name is a bit misleading since the value is thought to change over time, though it is assumed constant over space). And for light rays, it works out that their peculiar velocity is always equal to c, so if a light ray is emitted directly towards us from a distance D, its initial velocity relative to us will be HD - c.
The recession velocity HD becomes equal to c at the radius of the Hubble sphere, and yet it is possible for light emitted from that distance or greater to eventually reach us. How can this be? As explained in section 3.3 of the paper that PhotonicBoom linked to, Expanding Confusion: Common Misconceptions of Cosmological Horizons and the Superluminal Expansion of the Universe, it's a consequence of the fact that H is thought to be decreasing over time (it may seem confusing that this is possible even in models where physicists say the rate of expansion is accelerating, but what they mean by that is that for a given galaxy expanding away from us its recession velocity will increase over time, which need not conflict with the claim that if we pick a fixed distance D, the recession velocity of an average galaxy at that distance will decrease with time). Quoting from the pdf version of the paper in the link (note that $v_{rec}$ is the recession velocity, $D_H$ is the radius of the Hubble sphere, $a$ is the scale factor, and dots indicate time-derivatives):

We have seen that the speed of photons propagating towards us ... is
  not constant, but is rather $v_{rec} - c$. Therefore light that is
  beyond the Hubble sphere has a total velocity away from us. How is it
  then that we can ever see this light? Although the photons are in the
  superluminal region and therefore recede from us (in proper distance),
  the Hubble sphere also recedes. In decelerating universes $H$
  decreases as $\dot{a}$ decreases (causing the Hubble sphere to
  recede). In accelerating universes $H$ also tends to decrease since
  $\dot{a}$ increases more slowly than $a$. As long as the Hubble sphere
  recedes faster than the photons immediately outside it,
  $\dot{D_H} > v_{rec} - c$, the photons end up in a subluminal region and approach
  us. Thus photons near the Hubble sphere that are receding slowly are
  overtaken by the more rapidly receding Hubble sphere.

However, the cosmological models currently seen as best supported by evidence do include an event horizon such that light emitted from outside this horizon will never reach us no matter how long we wait, see Fig. 1 of the Davis/Lineweaver paper (particular the third graph, which is a "conformal" one where the paths of light rays are always represented as straight lines at 45 degrees from vertical), along with my answer here.
So the final part of your question could be rephrased as, "would it be possible to use quantum entanglement to communicate (or observe) regions beyond our event horizon?" According to quantum mechanics, the answer is no, because there is a general theorem called the No-communication theorem which shows that measurements of one part of an entangled system can never be used to communicate information to an experimenter measuring a different part of the same entangled system. And there is also this general result in quantum field theory (the relativistic version of quantum mechanics), showing that no form of faster-than-light communication is possible in QFT.
Comment: I'm glad we agreed in the end. Nice answer. +1 from me!
Answer: Such galaxies cannot be detected. and Quantum entanglement is just a correlation between two bits of information and it no way does, and no way can be used to transfer information faster than the speed of light. Any light sent from such galaxies towards ours would show a wavelength of infinity after considering Doppler shift. In short these galaxies can never be detected. This boundary beyond which galaxies move away by the expansion of space time at supersonic speeds is called a Cosmological event horizon. No information from outside this boundary would be able to reach inside if the expansion continued so.
Comment: @ReXdean: Sure, but what's the point? Take a red ball and a blue ball and put them into two boxes without looking. Then, throw one of the boxes into a black hole and open the remaining one and you'll know which ball ended up in the black hole. What will such an experiment prove?
Comment: So if a entangled particle is implanted on such a galaxies which is going to disappear in the Cosmological event horizon will we still be able to get to know its state after it had disappeared in Cosmological event horizon??
Comment: @Christoph Wiki says: Quantum teleportation is a process by which quantum information (e.g. the exact state of an atom or photon) can be transmitted (exactly, in principle) from one location to another, with the help of classical communication and previously shared quantum entanglement between the sending and receiving location.http://en.wikipedia.org/wiki/Quantum_teleportation
Comment: @ReXdean: **with the help of classical communication**
Answer: These galaxies are not out of reach. The Hubble Sphere is the volume of space surrounding an observer where everything inside the sphere moves away from the observer with a speed less than c.
Following this logic it immediately follows that the Hubble Sphere is equivalent to the cosmological event horizon that @Hritik is discussing in his answer. Interestingly enough, this is not the case, as evidence shows that our universe is actually expanding away from us in an accelerating rate.
This implies that the Hubble sphere is expanding as fast as the universe, and thus astronomical bodies which once were receding away from us at a speed faster than $c$ will emit light which will eventually enter out Hubble Sphere. This is discussed in a very interesting Veritasium episode about Universe misconceptions.
It seems that wikipedia's facts might be wrong in the page I have linked above. A paper by Tamara M. Davisa and Charles H. Lineweaver called Expanding Confusion: Common Misconceptions of Cosmological Horizons and the Superluminal Expansion of the Universe linked by Veritasium in the youtube comments section supposedly clears this up but I don't have enough time to read this now.
Also as I stated in the comments, quantum entanglement does not imply faster than light information travel since quantum entanglement is just a correlation between 2 qubits. Not information is travelling at all.
Comment: The paper by Lineweaver and Davis you link to actually contradicts your claims--for example, p. 2 says "As we will see, the Hubble sphere is not a horizon. Redshift does not go to infinity for objects on our Hubble sphere (in general), and for many cosmological models we can see beyond it." It is true that objects on the Hubble sphere have a recession velocity equal to c, but see section 3.3, titled "Misconception #3: Galaxies with Recession Velocities Exceeding the Speed of Light Exist but We Cannot See Them."
Comment: It seems to me its supporting it. Specifically it says: *"In accelerating universes, H also tends to decrease since $\dot{\alpha}$ increases more slowly than $\alpha$... Thus photons near the Hubble sphere that are receding slowly are overtaken by the more rapidly receding Hubble sphere."* But, I will read the paper more carefully when I have more time!
Comment: note that *recession velocities* reach $c$ at the Hubble sphere, whereas *relative velocities according to parallel transport* along the light ray will reach $c$ at the cosmic horizon, so in a way, the horizon *is* where 'relative veocities' reach speed-of-light; it's just that if spacetime isn't flat, you have to be careful about what you mean by 'relative velocity'
Comment: The part I was disagreeing with was in the initial version of your comment where you said "From this logic it immediately follows that the Hubble Sphere is equivalent to the cosmological event horizon that @Hritik is discussing in his answer"--as seen in Fig. 1 the cosmic event horizon is distinct from the Hubble sphere. But I see you edited your answer to add "Interestingly enough, this is not the case" after that statement, so with that change I don't disagree with what you say.
Comment: @Hypnosifl I thought you misunderstood me so I edited to clarify.

Exploring beyond event horizons


How to pass data between two unrelated components in React?

Question: Heyy guys, how can I pass data from one component (let A) to another component (let B) in React ? i.e, suppose I have two different components A and B, B is not a child component of A and also both A and B doesn't have a common parent...so how can I pass the data from component A to component B then?
Comment: Hi and welcome to stack overflow, that is a good question you have but first please provide us with a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example), and secondly here is [an answer](https://stackoverflow.com/questions/52173330/share-data-between-react-components-with-no-relation) to your question existing in our site.
Comment: Does this answer your question? [Share data between React components with no relation?](https://stackoverflow.com/questions/52173330/share-data-between-react-components-with-no-relation)
Comment: in short, the best way is through a service which sits at the root/app level. You will need to read more into that as it is a suggestion, or you can use redux to create a data store which can be accessed from any component's context
Comment: As an aside, I am of the opinion that React's built in `context` API is the way to go, and Redux has largely been rendered redundant by it.  https://reactjs.org/docs/context.html
Answer: You can use the context API in React for passing data between unrelated components.


Remission of excommunication of a schismatic group

Question: How can the excommunication of a schismatic group be lifted, for the purposes of reconciliation? If no reconciliation happens, does the excommunication resume?
Comment: @geremia, I'm asking a generic question about what the guy on Pints with Aquinas said, he didn't really know the answer, but he did give an example of a person who had their excommunication lifted for one day
Comment: The SSPX is not in schism, nor are its priestly members or faithful excommunicated. Perhaps you're referring to [Benedict XVI's 2009 lifting of the SSPX bishops' excommunications](https://www.newliturgicalmovement.org/2009/03/papal-letter-about-lifting-of-sspx.html)? That referred to 4 specific bishops consecrated by Archbishop Marcel Lefebvre in 1988, not a "schismatic group".
Comment: @geremia, I think that's a matter of opinion, which we all know is just the Greek for Dogma.
Answer: Excommunication and Schism refer to two distinct things.
Excommunication is a punishment leveled for various offenses; sometimes it is latae sententiae (of the sentence being passed; that is, automatic as declared in the law) and other times it is ferendae sententiae (of the sentence to be passed; that is, must be declared by some judicial process).
Excommunications can be given for various acts including schism.
Schism is a refusal to assent to the authority of the Supreme Pontiff.
Because an excommunication is a punishment, it can be lifted by the authority who declared it or their superior in law. In the case of automatic penalties, the law defines who has authority -- some such penalties are reserved to the Apostolic See.
A punishment could be lifted as an act of mercy, similar to a granting of parole or even a pardon in civil law. This act of mercy could be done as a way to bring about reconciliation in a different way. The purpose for a penalty like excommunication is to warn someone they have gone too far and call them back to communion.
If no reconciliation occurs, there is no automatic way for the excommunication to be reinstated. It would either need to be directly declared or that party would have to commit another offense.
Answer: Remission of excommunication is discussed in

1983 Can. 1358 §1. Remission of a censure cannot be granted unless the offender has withdrawn from contumacy according to the norm of can. 1347, §2; it cannot be denied, however, to a person who withdraws from contumacy.

Thus, a schismatic group like the schismatic Eastern Orthodox would have to  withdraw from its contumacy of refusing submission to the Roman Pontiff before its excommunications can be remitted.
The 1917 Code can. 2242 §3 clarifies what constitutes contumacy:

One is said to have withdrawn from contumacy when one truly repents of the delict committed and at the same time gives appropriate satisfaction for the damages or scandal or at least sincerely promises this; the judgment about whether or not the penitence is true, and satisfaction is sufficient, or the promise concerning these is sincere belongs to him from whom absolution of the censure is requested.


Does any spreadsheet allow you to create your own functions?

Question: I've always been frustrated when using spreadsheets by the inability to define my own functions when there is no existing function to (cleanly) do what I want.  Does any spreadsheet offer this ability?
Answer: I dont use spreadsheets other than Excel, but Excel is capable of doing just about anything using VBA, including custom functions.  Check out this article to see a basic example.
Comment: Libre Office will allow custom functions as well http://help.libreoffice.org/Calc/User-Defined_Functions
Comment: Very interesting.  This could possibly make my Excel life much happier, but I assume it has all the problems that go along with macros: if you share your spreadsheet with others they get a Big Scary Warning(TM) that opening the file could cause tooth decay and disembowel their pets, as well as enlist their computer in a botnet aimed at taking down the department of defense.
Comment: Just let people know that the file contains macros, that way any warning wont send them into panic.
Comment: I don't really consider it a separate answer. To be honest with you the answer to the question as presented is simply yes. I could easily see people voting to close the question since it shows very little effort at prior research. It also invites multiple perfectly valid answers with potential discussion of the pros and cons of the various options. Having said that, feel free to make it an answer if you would like to.
Comment: Hehe, same time as you.  Looks like you're link is for Excel 2007, while mine is Excel 2003.  Good to have options.
Comment: @EBGreen: care to make that an answer?  If you don't, then I will.  Also, it would be very helpful to know if LibreOffice has the same macro baggage that MS Office does: do custom functions leave people open to malware?  And is there any good strategy for sharing your LibreOffice sheets with MS Office users?
Comment: Im not knocking LibreOffice, I am actually writing a document in it right now on the other screen.  However, if you want to ensure portability, you are best to use MS Office.  Most people dont use LO or OO and I dont know how well macros in them will translate to MS Office.
Answer: Apple iWork Numbers
This cannot be done in Numbers, unfortunately.
Google Apps
Custom functions are supported in Google's spreadsheet, using JavaScript.
LibreOffice Calc
LibreOffice Calc supports custom functions.
Microsoft Excel
Custom functions are possible in Excel, going back at least as far as Excel 2003.

Given that there are several choices, it's hard to know which one to choose.
If you (or your employer) have a prior commitment to a Microsoft-based solution, or (conversely) to an open-source solution, then the decision is basically already made.  If you're an Apple fan (as I am) you'll use Numbers whenever possible, and only abandon it when you need features beyond what it provides.  But (in my opinion) the solution with the biggest upsides and fewest downsides is Google spreadsheets:
You don't have to worry about (real and perceived) threats from macros in your spreadsheets.  You don't have to worry about whether you can share the file with others: you just grant access to anyone you want, and it's "in the cloud" for them whenever they want.  Soon you'll even be able to edit your spreadsheets offline.
You're exposing your information to the Google Information Borg (if you even care), and you're giving up some elegance (as compared to Numbers) and a fuller feature set (as compared, at least, to Excel, if not also to the others), but those may not be a big deal.
If, on the other hand, you're already using Excel (as most of us are) and you can live with the downsides of both the risks involved in using macros, and of the annoying warnings to anyone you share your files with, and of the messiness of managing your functions (if you put them in a separate file then you'll need to distribute that to others every time you give them a spreadsheet using those functions, but if you put them inside the file then you'll be doing a whole lot of copying and pasting, and your later improvements won't propagate to earlier spreadsheets) then a very strong case can be made for sticking with Excel.  With very little doubt it's the most powerful of the bunch, and it really doesn't have a bad UI by any means.
Comment: You may add the classic spreadsheet, Lotus 1-2-3, which has supported user-defined @functions since before most of the other competitors even offered spreadsheets.
Comment: I don't think I'll get any points for it if I accept my own answer, but no other answer was as comprehensive. (Which is my fault, actually, because of the way I worded the question.)  I've up-voted all the useful answers and comments that helped me put this together.
Comment: That's interesting, since one of the notable flaws in Lotus Notes' formula language is that it does *not* support user-defined functions.  I've always assumed that it was initially borrowed from 1-2-3, as many of the functions have the appearance of being very much like those you'd find in a spreadsheet.
Answer: This is rather simple using Funfun in Excel. Funfun allows you to use JavaScript directly in Excel so that you could define all sorts of functions by yourself. With the help of the Funfun Excel add-in, you could use the data in the spreadsheet and also output data into specific cells.
Basically what you need to do is
1). Insert the Funfun add-in from Office Add-ins store

2). Create a new Funfun or load a sample from Funfun online editor

3). Write JavaScrip code or define your own function.
4). Run the code directly in Funfun
I defined a sample function in Funfun online editor that could calculate the probability density using the mean and standard deviation stored in the spreadsheet. You could check this sample on the link below.
https://www.funfun.io/1/edit/5a368f1645ac15144af3fde5
You could easily link this sample to your Excel using the Step2) above.
Disclosure: I'm a developer of Funfun.
Answer: I found a Microsoft article discussing how to create custom function is Excel 2003.
http://office.microsoft.com/en-us/excel-help/creating-custom-functions-HA001111701.aspx
I imagine this applies to newer Excel versions as well.
Answer: Excel does this great, using VBA.  I have a number of custom functions that I've created, from basic to complex, to do everything from returning the current cell's sheet name to custom formatting charts. Many of my functions began in Excel 2003 and I've migrated up to Excel 2010(64bit).  It's worth noting that it takes a bit of extra programrming to get them to work in both 32 and 64 bit environments.  To create your first custom function:

I recommend using a clean, separate workbook that you can save as an .XLA file that can be used as an Add-In.  This allows you to call your custom functions from any of your other workbooks, instead of limiting them to the workbook you use them in.
Select Visual Basic from the developers tab.  If that tab isn't shown, you'll need to activate it in Options>Customize Ribbon>Main Tabs.
In VBA, right-click Modules and choose Insert>Modules.
Enter your code (the following will return the sheet name for the cell you call it in):

Function SheetName(rAnyCell)
Application.Volatile
SheetName = rAnyCell.Parent.Name
End Function

Save your Module and return to Excel.
In any cell, type =sheetname(A1) and it will return that worksheet's name.

You're correct about this carrying Excel's Macro "baggage", so you'll need to keep that in mind regarding the environments in which it will be used.  But, on the whole, its a huge benefit and allows substantially improved workability.
Comment: Have you published your functions anywhere?  Would you please?  I'd love to see what you've come up with.  Thanks!
Answer: In the Google Apps environment, you have the possibility to create stand-a-lone functions with Google Apps Script (GAS). This is cloud based javascript quite similar to Google Webtool Kit (GWT).
Within a google spreadsheet you can build functions that are available only within the workbook. See the following answer on Super Users; this example is used as a function.
Working example included: custom functions


Zend Form Decorators for bootstrap twitter form

Question: Can you detail how to setup the form decorators to end up with the following html? I'm not very good with the form decorators.
twitterbootstrapform
Answer: Take a look here:
Zend_Form decorators for Twitter's Bootstrap
https://github.com/Emagister/zend-form-decorators-bootstrap
Answer: If you are a real Zend Form lover it should be possible to create a nice decorator that will give you the desired results. A easier solution, especially if you're not that good with Zend Form decorators, you could use a viewScript. See http://framework.zend.com/manual/en/zend.form.standardDecorators.html#zend.form.standardDecorators.viewScript


My reverse lights stay on when I'm driving

Question: Lights staying on please advise me what to do
Comment: Welcome to Motor Vehicle Maintenance & Repair! Please add as much information as you could. Such as: Car model, year, if it's a manual or automatic and when this occurred.
Comment: Did you get any aftermarket backup or off road clearance camera installed? Or did the previous owner had this installed?
Answer: The most likely cause of that is a failed switch, in this case failing in the 'on' position. You can check this by disconnecting the wiring from the switch (which will either be on the gearbox or near the gear lever) and checking that the lights don't come on.
Assuming this is the case, a new switch will be cheap, although depending on it's position it may be awkward to fit.


How is the hashrate calculated?

Question: Where does the data come from?
Answer: As RedGrittyBrick already wrote, the difficulty to create new blocks is adjusted every 2016 blocks. The difficulty provides an expected amount of hashes performed to find a block, which allows a general estimate how much hashrate exists on the network. Additionally, some websites compare the number of published blocks with the expected number of blocks found to provide a higher resolution than whole difficulty periods. Since blocks are found in a random process, these charts often jump around a lot as even a constant hashrate can have a large variance of blocks found per day.
As an example, let's take a look at this chart of Blocks per Day for the last three months. The blocks found range from 89 on 2022-12-24 to 180 on 2023-01-06.
via transactionfee.info
Meanwhile, the self-reported hashrate of mining pools in the last three months looks like this:
via miningpoolstats.stream
While we do see a drop in the self-reported hashrate on Christmas Eve (partially explained by an extreme winter freeze in Texas that had miners yield power for heating homes) that aligns with the lowest block count, the self-reported hashrate ranges between 200 EH/s and 287 EH/s while the block count maximum is double the minimum.
This is underscored when we compare the self-reported figures with miningpoolstats.stream's estimated hashrate on the network:
via miningpoolstats.stream
So, the hashrate can be estimated from the difficulty of the blocks and the count of blocks found, but the random process makes it easy estimate much larger swings than seem to be present in the actual hashrate.
Comment: Great data! The shorter the sampling period, the more noise is in the result. I guess anything less than a day does not make sense, and even one day is too short. From the swings in this graph I guess the websites that I've seen use approx. one day as sampling period (e,g, https://www.coinwarz.com/mining/bitcoin/hashrate-chart).
Answer: The total network hashrate can be estimated from the network difficulty recorded in the block headers over a reasonable sample period.
There is a relationship between the two because the difficulty is adjusted every 2016 blocks (about two weeks at 10 minutes per block) with the aim of keeping block production rate near constant as total network hashrate changes.
See How can I calculate network hashrate for a given range of blocks where difficulty changes somewhere within the range? for calculation
Comment: @Poseidon, yes I was referring to the fifth data item described at https://en.bitcoin.it/wiki/Protocol_documentation#block : *"bits" ... "The calculated difficulty target being used for this block "* -- Looking at a period spanning a recalculation would give you an idea which direction the hashrate is trending. Murch's answer describes ways to get greater precision.
Comment: When you say `network difficulty recorded in the block headers` here are you referring to the difficulty of the solution accepted by the network (over a sample period)?
Comment: Ok thank you, I find this relevant because the bits is just the target difficulty while the network accepted solution difficulty represents the actual difficulty solved by a miner. They are relatively similar though.

How is the hashrate calculated?


Combination of lagrangian relaxation and column generation

Question: I am solving an integrated scheduling problem and have dealt with coupling constraints using Lagrangian relaxation to decompose the problem into two separate problems. However, it is still difficult to solve the two decomposed problems directly using the solver. Based on the structure and nature of the problems, the column generation algorithm can be used to solve them separatly, but I have not found in the relevant literature that the column generation algorithm can be used to solve Lagrangian subproblem for example, I would like to ask if this combination of Lagrangian relaxation and column generation algorithm can be used?
Answer: In theory, nothing forbids it.
I don't remember seeing any such example in the scientific literature. But here is an example of an algorithm using nested column generation, i.e. the pricing subproblem is solved by column generation as well:

Vanderbeck F (2001) A Nested Decomposition Approach to a Three-Stage, Two-Dimensional Cutting-Stock Problem. Management Science 47:864–879. https://doi.org/10.1287/mnsc.47.6.864.9809

Just be careful that usually, column generation based algorithms are not the fastest ones, while many Lagrangian subproblems need to be solved.
There should also be a couple of possible optimizations such as keeping a common column pool for all subproblems.
Comment: Dear @fontanf, Would you please, w.r.t the fact that the Lagrangian relaxation cannot guarantee to find a feasible solution, at least finding a feasible solution highly depends on the LR heuristic, is it reasonable to use that as the solving process on the pricing problem?
Comment: @A.Omidi Lagrangian relaxation, as well as column generation procedures, solve relaxations of the problem. They can both be embedded inside a branch-and-bound algorithm to get exact algorithms. For an exact branch-and-bound based on column generation (branch-and-price), the pricing problem must be solved exactly at some point. For a column generation based heuristic, having an exact pricing is not required. One needs to find a good compromise between resolution time and solution quality
Comment: Dear @fontanf please, take a look at your mentioned email on Github. Thanks
Comment: @fontanf Thanks for your reply. I will read this article.
Answer: It is hard to say anything specific without knowing more about the problem, and if you are looking for practical solutions or theoretical ones. However, your description reminds me of packing/resource sharing problems. These have been studied quite a bit, often in the context of multi-commodity flow problems, but the results can be applied to a wide collection of problems. You might want to look into the 1994 and 1996 papers of Grigoriadis and Khachiyan. (https://onlinelibrary.wiley.com/doi/abs/10.1002/net.3230260202) (https://www.jstor.org/stable/3690236)
Comment: Thank you very much. I'm going to read this and think if it's of the same nature as my question.


Question about the Moore-Penrose pseudoinverse

Question: Suppose I have a matrix $A$ that is not invertible, but such that $A + \epsilon I$ is invertible for all $\epsilon$. I'm wondering whether we can say something like
$$\underset{\epsilon \to 0}{\lim} (A + \epsilon I)^{-1} = A^{\dagger}$$
where $A^{\dagger}$ is the Moore-Penrose pseudoinverse of $A$. In essence, can we plug $\epsilon = 0$ into the limit, so long as we swap out the inverse for a pseudoinverse? It seems intuitive to me, but I don't see a way to prove or disprove it. Any insight would be appreciated.
Comment: If we define $x_\epsilon$ to be the minimizer for the function $(1/2) \| Ax - b \|_2^2 + \frac{\epsilon}{2} \| x \|_2^2$, then I think we have $\lim_{\epsilon \to 0^+} x_\epsilon = A^\dagger b$. (Is that correct?) This is intuitive because $A^\dagger b$ is the least norm solution to $Ax - \hat b$, where $\hat b$ is the projection of $b$ onto the column space of $A$.
Answer: No. Consider the diagonal matrix $A=\begin{pmatrix} 1 & 0 \\ 0 & 0 \end{pmatrix}$
its pseudo inverse is also $ \begin{pmatrix} 1 & 0 \\ 0 & 0 \end{pmatrix}$.
However $(A + \epsilon I)^{-1} = \begin{pmatrix} {1\over 1+\epsilon} & 0 \\ 0 & {1\over \epsilon} \end{pmatrix}$ and the limit is singular.


How do I set up LBRY App on my Raspberry Pi?

Question: Can I run the LBRY App on my Raspberry Pi which I have connected to my TV?
I want to watch movies and listen to music from LBRY, on my TV.
Comment: What LBTY app? Is this a Linux app? If the app and its documentation are available online you should include a link.
Answer: From the lbry website you can find the download link for Linux, so yes, it should work.
But maybe also consider the Open Source Media Center which has a specific distribution for the raspberry pi.
Comment: The plain linux one will not work if there are native code compiled bits in there.
Answer: I believe there is a version for Pi being built, it's currently in beta and can be found at https://lbrypi.com/downloads
It looks like it is going to be a great addition to the lbry protocol
Comment: There's certainly one here: https://github.com/lbryio/lbry-desktop#install
Answer: Yes you can install LBRY App on raspberry pi but you have two ways to do it compile from source code, or download prebuild binaries. If running from source you also need build daemon for armhf arch. As for main app you need build it witch command yarn build --arch=armv7l After you build deb file you need apply manual fixes like change arch in control file inside deb file (armv7l to armhf).
Comment: This is a more thorough explanation, but I would like to see all the steps, like 1.
2.
3.


Priority rules for abridging Selichot

Question: If the minyan doesn't have enough time allotted for Selichot to finish everything listed in the Selichot book for today, so you need to cut some parts out, what are the rules of priority for what should be cut out first, last, or never?
Comment: Isaac, I have seen abridged versions under the theory of "tov me'at b'chavanah" (can anyone verify if they do this in Chaim Berlin?), but why can't the minyan just start earlier?
Comment: Not every shul can scrape together enough people who are willing to devote two hours to shul every morning for a week or more.
Answer: The least I've seen is Ashrei, kaddish, (don't remember about the pesukim), s'lach lanu-intro to 13 midos-13 midos until lechol korecha, pizmon, intro+13 midos, the rest like a regular fast day (including only one ashamnu), niphilas apaim, shomer...
Answer: There are the many things that are simply Yeish Nohagim, that could be (and often are) skipped.  There is also the final Keil Melekh and Hashem HaShem that according to Kabbalah and Minhag Beit El don't belong there.
However, really a competent posek should be consulted.

Priority rules for abridging Selichot


Which of the following pieces of SQL is most efficient

Question: I need to add the date part of GetDate() to the time part of a stored DateTime.
Naively I thought I could do the following:
declare @testTime DateTime = '2013-04-23 13:55:06'
select cast(getdate() as date) + cast(@testTime as time)

but this gives the following error:

Operand data type date is invalid for add operator.

I did some more research and have come up with three possible ways of doing the calculation:
declare @testTime DateTime = '2013-04-23 13:55:06'

select dateadd(dd, 0, DATEDIFF(dd, 0, GetDate())) + cast(@testTime as time)

select cast(cast(GetDate() as date) as datetime) + cast(@testTime as time)

select dateadd(day, datediff(day, @testTime, GetDate()), @testTime)

All three produce the same result but I'm not 100% happy about implementing any of them, though the third way seems to be a better way - though I have no evidence for this.
Which (if any) of the three is the most efficient?
Is there a better way?
Comment: The first two don't work for me. The 3rd one is the way I would have done it.
Comment: @JamesAnderson - It could be the SQL Server version. I've updated the tags.
Answer: You could use DATETIMEFROMPARTS (Transact-SQL)
select datetimefromparts(
                        datepart(year, getdate()),
                        datepart(month, getdate()),
                        datepart(day, getdate()),
                        datepart(hour, @testTime),
                        datepart(minute, @testTime),
                        datepart(second, @testTime),
                        datepart(millisecond, @testTime)
                        )

Update:
The first two of your queries.
select dateadd(dd, 0, DATEDIFF(dd, 0, GetDate())) + cast(@testTime as time)

select cast(cast(GetDate() as date) as datetime) + cast(@testTime as time)

require that the database compatibility level is SQL Server 2008(100). If they are executed in compatibility level (110) or (120) you will get

Msg 402, Level 16, State 1, Line 3 The data types datetime and time
  are incompatible in the add operator.

so you should not consider those at all.
The last query
select dateadd(day, datediff(day, @testTime, GetDate()), @testTime)

works just fine.
I did a test over 1000000 rows in SQL Server 2014 and the datetimefromparts version took 650 ms and dateadd/datediff took 350 ms.
Answer: Tested on SQL 2005 only:
declare @testTime DateTime
set @testTime = '2013-04-23 13:55:06'
select cast(substring(cast(getdate()as binary(8)),1,4)
            + cast(@testTime as binary(4))
            as datetime)

Why, how?
-- These two have the same last 8 hexadecimal digits,
-- and vary one digit before that
-- This shows that the date and the time
-- are physically separate 32-bit numbers
select cast(getdate()   as binary(8)) union all
select cast(getdate()+1 as binary(8))
-- last 32-bits: get time
select cast(getdate()   as binary(4))
-- first 32-bits: get date
select substring(cast(getdate()   as binary(8)),1,4)

Some will argue that I should not be relying on undocumented internals of data-structures in code. That may be true. But if for some reason performance matters enough, I think CAST should be quicker. I haven't done any timings.


Mutual information formula

Question: What is the formula for finding mutual information (MI) feature to feature?
Is this formula correct
$$ \mathrm{MI}=p(t_1,t_2)\log_2\left(\frac{p(t_1,t_2)}{p(t_1)p(t_2)}\right) + (1-p(t_1,t_2))  \log_2\left(\frac{1-p(t_1,t_2)}{(1-p(t_1))p(t_2)}\right)?$$
i am doing a project in sentiment analysis.here pt1t2 is the probability of cooccurence of t1t2 together.so is in the part of finding probabilty of not occuring together,is in the denominator (1-pt1)*(1-pt2) or as given in the equation .
Answer: This has already been asked and here is a very good answer with a code:
Link

Mutual information formula


While we split data in training and test data, why we have two pairs of each?

Question: Why do we split the data into two parts, and then split those segments into training and testing data? Why do we have two sets of data for each training and test data?
Answer: For any Machine Learning model, the available data is usually split into three sets:
Training Set:
The part of data used to train the model and learn the parameters of the network.
The data that remains after allocation of the Training Dataset, is split into the Validation and Test sets.
Validation Set:
This sample of data is used to provide an unbiased evaluation of a model fit on the training dataset. This helps in tuning model hyperparameters to improve the model performance. Eg: Changing the number of clusters ($k$) in a K-Means algorithm, or the pooling layers in a CNN.
Test Set:
After training, this part of the dataset is used to used to test how well the model generalizes to unseen data and estimate its performance.
Another possibility (going by your question), is the use of Cross-Validation. This is performed when the dataset is too small.  In such a case, a random split is performed on the dataset resulting in k non-overlapping subsets. The test error is then estimated by taking the average test error across k trials.

[Image Source]
Comment: You're not answering the question "While we split data in training and test data, _why we have to pairs of each?_" or addressing the confusion completely. The OP thinks that both the training and test datasets are again divided into two chunks.
Comment: As far as I know, I have never come across a scenario where such a split has been used. I clarified his doubt by answering the general approach to splitting a dataset (without explicitly hinting at the fact that he might have a misconception). If you are aware of a case where such a splitting condition is used, you are free to elucidate on it.
Answer: Are you talking about (X_train,y_train) and (X_test,y_test).
If yes, then X represents the data(features) and y represents the labels of that data. That's why you get a pair when you divide it into training and test data
Answer: Usually we are splinting the data into 3 chunks for example 70% for training, 10% for validation and 20% for testing. The first two chunks are going to be used for training. The reason you need the validation dataset is to tune your hyper-parameters and see how well your model can generalize. Once you have a model that achieves a fairly good performance on the validation dataset, you're measuring its accuracy on the test dataset.
Comment: You're not answering the question "While we split data in training and test data, _why we have to pairs of each?_" or addressing the confusion completely. The OP thinks that both the training and test datasets are again divided into two chunks.
Comment: Btw, I didn't downvote this answer and I am not sure why someone would.


Gnome-terminal cannot send EOF after pasting huge amount of data

Question: I am using gnome-terminal version 3.6.2. When I copy a sufficiently large amount of data (in my case, 86KB appears to be "sufficiently large") and then paste it into gnome-terminal, most of the data appears in the terminal, and then it appears I'm hitting some kind of buffer limit, as I can only see the rest of my pasted data in the terminal after hitting enter (or inputting additional data, or ^C, or whatever). My guess is that this buffer might be around 64KB in size, but I am probably totally wrong. Anyway, when I paste this much data into the terminal, there is a good chance (more than half the time) that ALL instances of gnome-terminal that I have open and any instances that I open after that point will no longer be able to send an EOF/Control-D. I can operate within gnome-terminal normally, except that I cannot send an EOF to the terminal using Control-D.
In a failed attempt to resolve my issue, I have reassigned "eof" to other character sequences, for example using: stty eof ^J
Power-cycling the entire machine does not fix the problem. I'm not sure yet what the catalyst is, but after some days, the issue resolves itself. However that is of course not an acceptable solution, to wait it out. What is happening? What else could I try?
Answer: I found elsewhere a suggestion to run stty sane which as you might imagine resets to sane defaults. This solves my problem, but after taking a close look at what the differences could be, I'm still not sure exactly what about that particular command is fixing the problem. It works, though. Thanks for playing the rubber duck.


Differentiability $\implies$ partial derivatives exist?

Question: Say I have a differentiable mapping $f: G \to \Bbb{R}$, where $G$ is an open subset of $\Bbb{R^n}$. This implies that the directional derivative $\frac{\partial f}{\partial u}(x_0)$ exists in every direction ( except in the direction $u=0$ ). Now, since the partial derivative is a special case of the directional derivative, may we conclude that the partial derivatives $\frac{\partial f}{\partial x_i}(x_0)$, where $x_0  = (x_1, ... x_n )$, also exist?
Comment: I personally think the directional derivative in the direction $u=0$ should just be $0$. There is no part of the definition of directional derivative that actually requires $u\neq0$ to make sense, so why should one limit the definition?
Comment: Yes. All partial derivatives are directional derivatives in some coordinates, and differentiability is maintained under linear maps. (Note I'm awkwardly trying to use what you already know here. Proving the result directly is just as easy)
Answer: For sure the partial derivatives $$\frac{\partial f}{\partial x_i}(x_0)$$ do exist and if $L = f^\prime(x_0)$ is the derivative of $f$ at $x_0$, we have
$$\frac{\partial f}{\partial x_i}(x_0) = L(e_i)$$ where $e_i$ is the $i$-th vector of the canonical basis.


Is it normal to have several one or two month extensions after a fixed term contract postdoc?

Question: I'm frustrated by these short term contracts and would like some advice. I've been offered several one or two month extensions after my fixed term ended in May. My PI said he may have longer term funding next year but for now he wanted me to stay while waiting for grant results. I wondered if I should continue to live on these short term contracts and wait for the uncertain grant results or start looking for another job? I want to stay in academia.
Comment: What keeps you from looking for another job now? I see little point in waiting for an uncertain proposal outcome, where, in case of a rejection, you will have to seek new employment from an unemployed situation.
Comment: If you like working with them, there's a good chance you can continue the collaboration even if you find a new postdoc somewhere else. If the PI is sane, he will also understand your situation and support your applications.
Comment: How "pie in the sky" is this future funding? Is the PI just keeping you dangling?
Comment: It's a sign your PI wants to keep you - they're scraping together soft money to keep you around while applying for funding.  Whether this fits with your needs is another matter
Comment: We've tried applying another grant with similar proposal but got rejected last year. This time we apply with another research council which is probably equally competitive. PI had good record of getting funding from this council though, so I'm not sure...
Comment: Because I really like working for this team so I've been clinging onto the potential funding. Now that I realized it is probably more realistic to have more options at hand than putting all eggs in one basket.
Answer: As a fixed-term postdoc you should pretty much always be looking for another job, and your PI should expect this. Unless you have more than about 18 months left it is worth keeping an eye out for other plausible postdocs - it takes time to go through the process, if you get it they may be flexible about start date, and even if they aren't you have probably gained a year or so of security if the new job is 2 years. If you have longer than that left, is there anything semi-permanent you would be competitive for? It is a bad idea to wait until your postdoc is almost finished to start looking - academic jobs are difficult to get and you should expect to make multiple applications before finding something.
So definitely start looking now, if you haven't already. Of course it is nice to have an extra couple of months to fall back on if you don't get something else, but that's how you should think of them. And you should think of the possibility of your PI getting extra funding as no different to any other potential job you haven't got yet - you need to be pursuing multiple options to give yourself the best chance to get one of them.
Comment: For my first postdoc, one PI said: "the first job of a postdoc is to apply for faculty positions.  The second job is to work on their project"
Comment: I would add the caveat that in my field there's a yearly application cycle, so applying earlier than expected for another postdoc is seen as pretty rude. People expect you to look for the next job in the fall before you job ends, so typically <12 months before the end. Leaving a postdoc at any time for a tenure track position (or into industry if you're feeling really unhappy) is generally acceptable.
Comment: @Well... thanks, that's useful to know. It may be that what you describe is also country-specific; I'm not familiar with that sort of system.
Comment: actually in my field this is worldwide. See http://insti.physics.sunysb.edu/itp/postdoc-agreement.html
Comment: @Well... I've read the document and don't understand how that differs from anything else. Aren't they just undertaking not to have deadlines more than 8 months before the start of a postdoc? I've never seen any postdoc in my field advertised that far in advance anyway. And I can't understand anyone being offended if you leave a postdoc 1 year early in order to start a new 3-year position. I've certainly known people do that with the blessing of their PIs.
Comment: @Especially Lime, that document specifically mentions a common deadline of Jan 7 to require someone to respond to an offer of a postdoc. The vast majority in my field are advertised in the fall, deadlines to apply in November and December, then offers over Christmas and decisions to accept by January 7. The jobs start the next fall. It's like applying for college sort of, except you know where you're going by January instead of like April.
Comment: @Especially Lime it does ruffle feathers in my field to leave 1 year early just for another postdoc. That means applying to leave 2 years early, and often that's right when you arrived. But I think my field is probably an outlier because the postdoc job market is so competitive.
Answer: My advice would depend on your options. I suggest that if you have no other good options that you continue with this. But simultaneously you can and should look for something more permanent.
A short term situation can help get you over the bridge to something better, but don't neglect the search for that something better. And if you have to leave "at a moment's notice" then be prepared to do that.
I can't say whether it is "normal". It can be a good thing if you work it right, however. Just keep your acceptance contingent on a better offer.
Answer: To me, this sounds like your PI is effectively trying to give you a bit of bridge funding to keep you around while they try to get real funding for you.
This is not "normal" in the sense of a desirable situation, but you already left desirable outcomes behind when your position ended without you having either received a new contract from your PI or having obtained a new position for yourself elsewhere.
You need to be searching hard for a new position elsewhere.  If your PI happens to land grant money in time to make you an offer for a position, that's great, since it sounds like you'd like to keep working for them.  But right now, they don't have it to give you, or else they would already have done so.  If you want to stay in academia, you're going to have to start finding your own positions and money, and now is the time to do so.
The only remaining question is whether you are better off staying employed on short-term contracts with your current PI while you search.  Having a short gap on a CV won't hurt your search for a new position, but if you're enjoying working with your current PI and doing so won't inhibit your search, there's no reason not to stay employed while possible.
Comment: It does sound like you and your PI would like to keep working together, but the world might not support you two doing that right now.
Comment: He mentioned he didn't want to end my contract and go through recruitment process again when he got the grant money. But that money is not guaranteed and all he could offer right now is two months contract. I really like working for this team but it seems like it's a risky bet on what might not come through. I should definitely look for other opportunities now.
Answer: I actually think this is not completely abnormal- with a caveat. This is always a possibility when your PI has some additional funding floating around; however it is in most cases intended to give you a backup when you have applied for other positions but were unsuccessful. In other words, it should be used as a lifeline to give you a few more months to find another position.
If you find yourself here, hopefully it is only because you were applying for lots of other things, and are still waiting for decisions on some of them. In any case, you should be applying for everything as if your future career depends on it (because it does). Do not count on your professor being funded to keep you around, because this is far from guaranteed.
Answer: It's sometimes seen as bad form to keep a postdoc past the end of a fixed term contract (excluding the +1 year in the typical 2+1 format of my field). Though I know of labs in adjacent fields where this practice is pretty common.
The general guide is if you want someone around longer, recruit them for a more prestigious position. A 5-year job is more prestigious than 2-year, tenure track is the best, etc. Extracting continuous fixed term work is a little scammy, but it definitely happens. See also: keeping a grad student around forever in TAships so you don't have to pay them a postdoc salary when they are basically at the level of experience of a postdoc, and intimately familiar with your lab (good for you, bad for the student who probably needs more broad experience).
Definitely keep looking for another job.
Comment: @MorganRodgers I'm saying that if they had less predatory advisors, they would have graduated a long time ago and would now be working as postdocs. They have years of experience in the lab, and they are free labor if being supported by TAships, so there's a huge incentive to not graduate them and keep them around to exploit high quality labor without having to pay for it. It's a scam and it's wrong, and I've seen it happen.
Comment: @MorganRodgers even without the fact that grad student labor is cheaper, some advisors drag their feet on graduating students because the students are so useful in the lab due to their many years there. In that sense they're more valuable even than a postdoc who has to get familiar with the equipment. It's also not great practice, because the student's career would often benefit instead from getting more varied experience in different groups (and obviously, from receiving the degree they have more than earned)
Answer:
Is it normal to have several one or two month extensions after a fixed term contract postdoc?

Unfortunately, yes, in many places.
In the research groups in which I have encountered in the USA, UK, and Canada, more than 90% of employees are on temporary contracts.  In all of them, the situation you describe happened.  I've seen colleagues who were on their 17th contract extension.  I've seen colleagues who chained temporary contracts at the same institute for more than 30 years.  When project n ends before project n+1 started, either the advisor would find bridge money 1 or 2 months at the time, or colleague would be temporarily unemployed.  When an extension happened, sometimes the new contract would come several weeks before the end of the last one.  Sometimes several days before.  Sometimes after, which either means working for free hoping the promised retroactive pay was going to happen, or filing UB40.  If you need a visa with a contract renewal the situation is even worse.
This is my experience at universities, where each professor is more or less their own island.  The situation may be a bit better at (government) research labs, but I'm not sufficiently familiar with those to comment on it specifically.
It's the fate of those who stay in Academia and are good enough to produce good research but don't manage to get tenure.  I've personally managed to avoid this by securing my next post-doc well before my previous one finished, which has had the effect that I've never actually finished a post-doc to the nominal ending date; no one has blamed me for this in the slightest.
Some countries have laws or policies protecting how long one can be on temporary contracts or how many temporary contracts can be chained.  In those, such researchers will be either forced out of academia or forced out of the country.  If you find yourself on your 10th short contract, you may want to think about alternatives to academia — or not, if you're happy to accept the perpetual uncertainty.  This is academia in 2020.
Comment: It may be worth noting that this works much better in government or industrial labs, where the overlaps and bridges can be amortized across many groups.  In the university setting, the problem is amplified by the fact that it is often the case that each PI is effectively their own economic island.
Comment: @Reginaldv Yes, the situation is even more precarious for those who need a visa.  The cases I know about didn't; that may be due to a survivership bias, as those in similar situation who need to renew their visa every time may have given up or failed to renew the visa indefinitely, depending on visa conditions.
Comment: *Some countries have laws or policies protecting how long one can be on temporary contracts or how many temporary contracts can be chained. In those, such researchers will be either forced out of academia or forced out of the country.* Exactly the situation in Germany and Austria, where you practically become barred from your profession after the second contract renewal "for your own good" (unless you're employed on grant money). Practically, because legally you would become eligible for a permanent position, i think, which admin and/or profs try to avoid.
Comment: @henning--reinstateMonica Yes, and temporary contracts at Dutch meteorological institute KNMI tend to be 23 months and they're likely not alone in that.  Just shows that such laws don't solve the underlying problem, which would need much more structural reform.
Comment: Yes this is exactly what happened. I got my last extension after the one before expired. There is also visa problem too because the time waiting for visa extension is already longer than the contract extension. I have to live in constant fear that I will be deported out of the country.
Answer: No, that is not normal.
Yes, you should look for another job.  Never rely solely on a possible grant for the future of your employment.


Low poly candle holder

Question: I am seeing a lot of low poly candle holders on thingiverse for printing but would like to make my own. I haven't seen many tutorials. Can someone point me in the right direction to make something like this http://www.thingiverse.com/thing:18672
Answer: Add a Circle with 6 vertices and extrude it (E). Subdivide it adding edge loops (Ctrl+E). Snap the cursor to the top edge loop (Shift+S-->Cursor to Selected). Enable the proportional editing, increase the editing ring with Mouse Scroll and rotate (R) the top edge loop as pictured below.

Add the Solidify Modifier and play with its Thickness value.
Answer: Start by adding a cylinder and adjust the vertices count to 6 in the operator panel

Next, add a simple deform modifier and set it to twist. Adjust the angle as desired.

Add some loop cuts with Ctrl+R (I added 5),  and delete the top face in edit mode. Add a solidify modifier as well if desired and adjust the thickness as needed.
Following these steps, you should be able to achieve this kind of result:
Answer: Screw Modifier
Just add the modifier to the choosen cross-section shape (an exagon for example).
With the options provided you should be able to easily control many aspect of the shape such as the overall height, the number of steps and the number of turns.

Then you could stack a Triangulate modifier for a better control upon the way non-planar faces are splitted.
Comment: This worked for me, but then I couldn't figure out how I got to your point.  When I create a cylinder and then add the screw modifier I end up with a ton of vertical lines which distort how I see the picture.  I can go in afterwards and remove them but then I end up with two separate objects.  I'm not sure what I am missing.
Comment: Maybe that's because you should not start from a "cylinder", but from a cross section figure, which I intend as bidimensional (a triangle, a square, a pentagon, an exagon...). Try to add a "circle" object instead and set the number of vertices to 6.

Low poly candle holder


SATA card with good hotswap ability

Question: I'm building a Win2k8 backup machine with a removable SATA drive enclosure. The idea is that each week someone will pull out a drive and pop another one in. I need this to work without having to manually rescan disks or reboot. My question is which SATA controller would you recommend that has good hot-swapping ability?
Comment: +1 -- I too would love to see an answer to this!
Answer: Any hardware controller from the 3Ware 9xxx series will do fine, for example 9650-SE4LP.

SATA card with good hotswap ability


How do i remove   — – special characters from my XML files

Question: this is a sample of the xml file
<row tnote="0">
<entry namest="col2" nameend="col4" us="none" emph="bld"><blst>

<text>Single, head of household, or qualifying widow(er)—$55,000</text>

<text>Married filing jointly—$115,000</text>

</blst></entry>
<entry colname="col6" ldr="1" valign="middle"> </entry>
<entry colname="col7" valign="middle"> 5.</entry>
</row>

the — etc represent HTML 4.0 entities. i want to store each line's text as an element of an array, but not if the line is just
if e.text.strip =~ /^&#x20[0-9][0-9];$/ then
next
else
subLines << e.text
end

but it doesn't seem to be working...is my regEx incorrect?
Comment: What language is this code in? What does `strip` do?
Comment: No, character references do not represent entities. It's the other way round: Entities are used to represent character references. `—` is an entity reference and the entity named *mdash* represents the value `—` (see http://www.w3.org/TR/html4/sgml/entities.html#h-24.2.1). So the entity reference `—` references to the character reference `—` that references the Unicode character U+2014.
Comment: @Gumbo: `U+nnnn` notation uses hex numbers, not decimal: `U+2014`
Comment: @Alan Moore: Ah yes, of course it does.
Answer: &#x...; isn't an entity reference, it's a character reference. To an XML parser, — is absolutely identical to the raw character —, so when you look at the DOM produced by an XML parser through a property such as element.text you won't see anything with an ampersand in it, but a simple — character.
So in principle, you'd match it with a regex something like /[—– ]/. However, if you are using Ruby 1.8, you've got the problem that the language itself doesn't have support for Unicode, so the character group in /[—– ]/ won't quite work properly: it'll try to remove every byte in the UTF-8 representation of –, — and  , which will likely mangle any other characters.
A simple string replace for each target character would work correctly, as that doesn't require special character handling. (Naturally if you included characters like — directly in the source code you'd also have to get the file encoding of that script right, so probably easier to use a string literal escape like "\xe2\x80\x94".)
Answer: Because your regex is of the form /^...$/, it will only match against the entire string.  You will only skip text that consists entirely of one HTML entity.


Recover RPC URL in Metamask

Question: Can an application retrieve what RPC URL is the user using in Metamask?
Using the window.ethereum API I can recover the net_version and confirm that it is the expected one. But can I also retrieve the RPC URL in order to read the data from the same URL?
Comment: I just realized there is a similar discussion here: https://ethereum.stackexchange.com/questions/69782/get-rpc-url-ip-of-metamasks-current-provider
Answer: Assuming you need this to confirm that you are on the expected blockchain, and considering a blockchain is a decentralised network of nodes, not sure whether knowing the IP of the node you are connected to will tell you any relevant information.
On the other hand, the chain id will indeed tell whether you are on the mainnet (1), a public testnet (3, 4, 42...) or a local blockchain (1337, ...).
Once said that and application-wise, the IP is commonly defined at the moment of defining the provider, for instance:
<code>const providers = [
    new Web3(new Web3.providers.HttpProvider('http://127.0.0.1:7545')),
    new Web3(new Web3.providers.HttpProvider(`https://ropsten.infura.io/v3/${infuraKey}`)),
];
</code>
Nevertheless, since a blockchain keeps the same global state across all nodes, there shouldn't be differences when reading data from one node or another (different IPs) within the same network.
Comment: Since Metamask does not inject the provider anymore, the idea is to read using the RPC URL selected by the user

Recover RPC URL in Metamask


HP P410 ADU (hpacucli) generates empty report

Question: I'm trying to monitor hard drive's smart status. I've tried smartctl tools and HP's own hpacucli to generate ADU report. However, neither of them are useful. smartctl does not show values like Power On Hours or Hard drive temperature. ADU report shows them empty.
What's the right way to monitor hard drives with HP raid controller?
Smartctl: smartctl -a -d cciss,0 /dev/sg0
    smartctl 5.41 2011-06-09 r3365 [x86_64-linux-2.6.32-20-pve] (local build)
    Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net

    User Capacity:        3,000,592,982,016 bytes [3.00 TB]
    Logical block size:   512 bytes
    Logical Unit id:      0x5000c5003f11a168
    Serial number:        XXXXXXX
    Device type:          disk
    Local Time is:        Sun Jul 14 22:42:08 2013 HADT
    Device supports SMART and is Enabled
    Temperature Warning Disabled or Not Supported
    SMART Health Status: OK

    Current Drive Temperature:     <not available>
    Read defect list: asked for grown list but didn't get it

    Error Counter logging not supported
    Device does not support Self Test logging

Hpacucli: hpacucli ctrl all diag file=/usr/monitor/report.zip ris=on xml=on zip=on
    Smart Array P410 in slot 1 : Internal Drive Cage at Port 1I : Box 1 : Drive Cage on Port 1I : Physical Drive (3 TB SATA) 1I:1:12 : Monitor and Performance Statistics (Since Reset)

    Serial Number                        XXXXXXXX
    Firmware Revision                    0003
    Product Revision                     ATA     ST33000650NS
    Reference Time                       0x00001715
    Sectors Read                         0x00000000f868ca8b
    Read Errors Hard                     0x00000000
    Read Errors Retry Recovered          0x00000000
    Read Errors ECC Corrected            0x0000000000000000
    Sectors Written                      0x0000000016dd925d
    Write Errors Hard                    0x00000000
    Write Errors Retry Recovered         0x00000000
    Seek Count                           0x0000000000000000
    Seek Errors                          0x0000000000000000
    Spin Cycles                          0x00000000
    Spin Up Time                         0x0000
    Performance Test 1                   0x0000
    Performance Test 2                   0x0000
    Performance Test 3                   0x0000
    Performance Test 4                   0x0000
    Reallocation Sectors                 0xffffffff
    Reallocated Sectors                  0x00000000
    DRQ Time Outs                        0x0000
    Other Time Outs                      0x0000
    Drive Rebuild Count                  0 (0x0000)
    Spin Retries                         65535 (0xffff)
    Recovers Failed Read                 0x0000
    Recovers Failed Write                0x0000
    Format Errors                        0x0000
    Self Test Failures                   0x0000
    Not Ready Failures                   0x00000000
    Remap Abort Failures                 0x00000000
    IRQ Deglitch Count                   0 (0x00000000)
    Bus Faults                           0x00000003
    Hot Plug Count                       0 (0x00000000)
    Track Rewrite Errors                 0xffff
    Write Errors After Remap             0x0000
    Background Firmware Revision         0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
    Media Failures                       0x0000
    Hardware Errors                      0x0000
    Aborted Command Failures             0x0000
    Spin Up Failures                     0x0000
    Bad Target Count                     0 (0x0000)
    Predictive Failure Errors            0x00000000

Answer: You're not supposed to use smartctl and the like directly with these controllers. The HP Smart Array controllers use a variety of techniques to determine drive and system health. S.M.A.R.T. is one of them, but not the ultimate determination. It makes to sense to take advantage of the purpose-built tools available.
So in your case, configure your hp-snmp-agents to send an email when there's an issue. On Linux, emails default to the root user and a message in the syslog, but configuring an alert destination can be handled in /opt/hp/hp-snmp-agents/cma.conf.
As for the hpacucli utility, running hpacucli ctrl all show config detail provides most of the relevant array health information.
Answer: for me working like this
 smartctl -d cciss,0 -a /dev/cciss/c0d0

Device supports SMART and is Enabled
Temperature Warning Enabled
SMART Health Status: OK

Current Drive Temperature:     31 C
Drive Trip Temperature:        68 C
Elements in grown defect list: 0
Vendor (Seagate) cache information
  Blocks sent to initiator = 3203138637
  Blocks received from initiator = 3715997197
  Blocks read from cache and sent to initiator = 484569203
  Number of read and write commands whose size <= segment size = 1111593814
  Number of read and write commands whose size > segment size = 0
Vendor (Seagate/Hitachi) factory information
  number of hours powered up = 14706.28
  number of minutes until next internal SMART test = 33


Converting windows-1252 encoding to UTF-8 in Silverlight

Question: In my Silverlight Application I am getting an XML File encoded with windows-1252.
Now my Problem it won't display correctly until the windows-1252 string is converted to a UTF8 string.
In a normal C# enviornment that wouldn't be that big of a problem: There I could do something like this:
Encoding wind1252 = Encoding.GetEncoding(1252);
Encoding utf8 = Encoding.UTF8;
byte[] wind1252Bytes = ReadFile(Server.MapPath(HtmlFile));
byte[] utf8Bytes = Encoding.Convert(wind1252, utf8, wind1252Bytes);
string utf8String = Encoding.UTF8.GetString(utf8Bytes);

(Convert a string's character encoding from windows-1252 to utf-8)
But silverlight doesn't support windows-1252 - it is unicode only.
PS
I stumbled upon "Encoding for Silverlight" http://encoding4silverlight.codeplex.com/ - but it seems there is no support for windows-1252 there either?
EDIT:
I solved my problem on the "Server Side" - The actual problem is still open.
Answer: Encoding for Silverlight is a third party encoding system but only supported all DBCS (Double-Byte Character Set) now. However, windows-1252 is SBCS (Single-Byte Character Set).
But you can write a encoder/decoder for Encoding for Silverlight, I Think will be very easy.


Why is the vote of no confidence on the prime minister for Conservative MPs only?

Question: There will be a vote of no confidence in the prime minister of the UK today, but it is limited to Conservative MPs only and requires a majority of them to pass the motion. None of the media coverage I saw explained why the vote is limited to Conservative MPs. If the vote is open to the opposition as well, there will be a very good chance for the PM to lose. So what is the justification for this limitation? Why can't the opposition vote?
Comment: Not to be confused with; https://en.wikipedia.org/wiki/Motions_of_no_confidence_in_the_United_Kingdom
Comment: Related: https://politics.stackexchange.com/questions/73478/is-there-enough-support-in-the-uk-parliament-for-a-no-confidence-vote-in-the-pm
Answer: Because it's not a vote of confidence in the Prime Minister, it's a vote of confidence in the Leader of the Conservative Party, who also happens to be the Prime Minister. See the announcement from the Chairman of the 1922 Committee, Sir Graham Brady:

The threshold of 15 per cent of the parliamentary party seeking a vote of confidence in the leader of the Conservative Party has been exceeded. In accordance with the rules, a ballot will be held between 1800 and 2000 TODAY MONDAY 6th JUNE — details to be confirmed. The votes will be counted immediately afterwards. An announcement will be made at a time to be advised. Arrangements for the announcement will be released later today.

The vote is being held under the rules of this committee - made up of all Conservative party MPs. The full process of the confidence vote and any subsequent leadership election is explained in this House of Commons Briefing Paper here. If Boris Johnson is unsuccessful in a confidence vote, he will remain as Prime Minister until a new Conservative party leader is chosen, who will then be invited by the monarch to form a government and take over as Prime Minister.
Comment: @AlexanderThe1st - We don't have a president, so changing the PM doesn't need to result in a general election. In fact, it's more common for a new PM to become PM as a result of an internal leadership change than because they've won an election; https://fullfact.org/news/unelected-prime-ministers-common-or-not/
Comment: In a de facto two-party system the lack of support of the opposition for anything undertaken by the party in power can all but taken as read. So ironically (or paradoxically) calls from the leader of the opposition for the PM to resign are not as big a deal as they ought to be.
Comment: So essentially it's using internal party politics to avoid the possibility of dissolving parliament and bringing about another snap election as a result of losing a vote of no confidence?
Comment: @AlexanderThe1st: The UK does not like coalitions, as a rule of thumb. At the moment, the Conservative party holds an absolute majority, and does not need a coalition to govern.
Comment: @AlexanderThe1st Leadership changes as a result of internal party politics without immediate elections are by no mean rare in Canada (see Jason Kenney, or basically every conservative Alberta premier in the last 20 years; federally, how Paul Martin came to power). The difference is that in Canada the parliamentary party usually does not have the power to remove a party leader in most parties' constitutions (a power that's reserved to the members' convention).
Comment: @Valorum: That's a fair point - I'm just used to Canadian politics where this would have been handled in a separated leadership convention, at least in my understanding. At least in my experience, changing the PM usually comes with changing who can get a coalition government to agree with them in parliament, if that changes.
Comment: @AlexanderThe1st: Funny that you say that, given that Canada has _never_ had a coalition government.
Comment: @Vikki: I might be using coalition a bit more broadly than the official definition, by including minority governments - though I will concede that those involve sort of effectively merging one party's position into the larger one for them to hold power. And for which [changing the Premier did happen in B.C. at least, recently](https://en.wikipedia.org/wiki/2017_British_Columbia_general_election#Aftermath). With the caveat that official coalitions have been attempted, and failed federally and provincially as well.
Comment: @Vikki: You could consider the unity government of 1917 as a Canadian coalition government
Answer: I want to clarify one thing: It is possible for a Parliamentary vote of no confidence to be held, in which case the entire parliament would be voting for the fate of the government, including the opposition. Such a vote can be called by the leader of the opposition, who in this case would be Keir Starmer.
One reason I wanted to clarify this was that Boris Johnson had almost 150 of the conservative MPs vote against him, and it is such that Johnson's majority in Parliament is only around 40 or so MPs. It would not be impossible or even unlikely that in the event of a Parliamentary vote of no confidence, enough of these MPs would vote against the government for the vote to succeed. In this case, either the government must resign or the PM must ask the Queen to dissolve parliament such that new elections can be held.
Comment: The other important difference is that, in a leadership contest, only the members of the Conservative party get to vote, and the Conservatives almost surely hold onto their majority (unless something *really* wild happens, such as the party splitting over the new leader). A Parliamentary vote of no confidence (probably) leads to a general election, at which point those MPs who voted against the government are immediately forced to explain themselves to their constituents, who might not be pleased that they brought down the government.
Comment: "It would not be impossible or even unlikely that in the event of a Parliamentary vote of no confidence, enough of these MPs would vote against the government for the vote to succeed."

It would be extemely unlikely that ANY of these MPs would vote in favour of a no confidence motion on the government and any who did so would lose the Tory whip and be ineligible to stand as a Tory in a future election.

One of the primary reasons for Tory MPs voting against Boris Johnson is that they think he will lose a General Election, they will have no interest or appetite for bring that GE forward.
Comment: Also, having won the vote of no confidence as leader of the Conservative party, Boris Johnson has another year before he can be replaced as leader (unless he resigns, which I think is highly unlikely). So a snap election now would mean an election while the party is still lead by Johnson; Conservative MPs who want him gone might still reason that it is better to wait to replace him with somebody more popular before holding a general election.


My bike has a 10 speed cassette. MTX hub motor takes 9 speed cassette can I remove last cog of my cassette without issues?

Question: I need some advice. I have a Giant Anthem 2012 dual suspension bike. And want to put a 1500 watt 26" MTX cassette type rear hub motor onto it. I believe the MTX wheel can take up to a 9-speed cassette. Not sure if it can take anymore; if anyone does, can you please let me know as I have a 10-speed cassette and want to transfer this onto the MTX hub motor wheel? If it can't take my 10-speed cassette, What would happen if it couldn't take 10 speed cogs and I had to take one of the cogs away to make it a 9-speed cog? Would this create any complications with my gears? And if I took, let's say, the last big cog away from the 10-speed cog to make it a 9, would that just mean I couldn't use the last gear? Sorry for so many questions. I am new to all this and don't know a lot about bikes. That is why I joined up here—to learn from people who are in the know. Thanks
Comment: Personally, I'd say that a 1,500W motor nudges your ebike from the realm of pedal assist into the realm of motorbikes...
Comment: Hey Chris, where did you get the information about the compatibility of up to a 9-speed cassette for the hub motor? I tried to look a bit and could not find any meaningful documentation regarding that.
Comment: I'd suggest asking the vendor of the motor if your cassette will fit. And while you're at it you may want to check if that beast is still street legal after you built it.
Comment: What brand is the cassette and the derailleur? What exact type of hub motor? You cannot just create a 9-speed cassette by removing one cog. And even just installing a 9-speed cassette on a bike with 10-speed shifter is not  something that is supposed to work. The number of gears your bike is trying to use is determined by the shifter. Based on how much cable the shifter pulls that is translated by the derailleur to the movement between the cogs by a certain distance. The whole complex must be compatible.
Comment: The cassette and the derailleur is a Shimano Dyna sys and the hub motor can be seen on this website :

https://www.ebikemasters.uk/product-page/29-1500w-mtx-rear-wheel-motor-kit
Comment: OK, it is something completely different to what I thought it is.
Answer: Cassette, derailleur, shifter lever, chain wheel and even chain must all be compatible to work together. There are some other compatible combinations than just all the number of gears but at least read this question.
Assuming you do not change the gear ratio of the previous 9 gears, it should be no difference for the hub and its controller. I am less sure if it will work well with the 10th gear or if the gear ratios are different but for some simpler programmed controller it may. Or put two identical sprockets.


Unpublish an item using Experience Editor Mode in Sitecore

Question: I have a requirement to be able to unpublish an item using experience editor mode in Sitecore. It requires to either unpublish a module as a whole or to unpublish a particular item from that module(as we are using dynamic placeholders). Currently, I only see an option to publish an item. Any thoughts on this. Thanks in advance.
Comment: Can you define a "Module"? Publishing only really relates to items.
Answer: Not sure which version of Sitecore you are on though. But with newer versions of Sitecore, e.g. Sitecore 9.1, you can certainly do that from Experience Editor too, similar to how you do from the Content Editor. From the "Home" Tab, click on "Settings". You should see a dialog box open for Publishing Settings as can be seen in the below screenshot. There you can either select any version you want to unpublish or the Item as a whole. If you select the item, you would see the "Publishable" checkbox. Just uncheck that, click on "Ok" and save it. If you want to do it for Versions, click on the "Versions" tab and you will see, Publishable from, Publishable To, and Publishable fields there too, for all the versions of the selected item. If you are not seeing this "Settings" option in your "Home" tab, you would need to provide access for it to your user or role.

But if its previous versions of Sitecore, wherein even if you are logged in as an admin, but you still do not see this button there, you can simply copy the "Button" responsible for marking it unpublishable, to your Page Editor/Experience Editor's menu ribbon. Tried and tested steps are as below based on Sitecore 7.1:

Log in to core DB.
Navigate to "/sitecore/content/Applications/Content Editor/Ribbons/Chunks/Publish Restrictions".
Right-click on "Publish Restrictions", and select "Copying" -> "Copy To". And then select the "Sitecore/content/Applications/WebEdit/Ribbons/WebEdit/Page Editor" and then click "Copy" at the bottom. Then you should see this button at path "Sitecore/content/Applications/WebEdit/Ribbons/WebEdit/Page Editor" that path too. The screenshot below for reference:

Now open any page in Page Editor/Experience Editor, and you should start seeing the "Change" button there, from where you can mark it unpublishable.

Screenshot below for reference:


Visual c++ Express - recover source

Question: As a newbie I used my original.cpp file as a template for a different project and somehow I managed to lose it. (I normally use CodeBlocks and I am not very familiar with VS)
I have the .../Release/original.obj and the .../Release/vc100.pdb files and obviously the *.manifest and *.exe files. Is there any way I can recover my original code? fwiw it is mainly math functions that is a pain to rewrite but maybe recoverable? Thanks.
Comment: If you lose source code it is Game Over in C++. There is nothing that can reconstruct C++ code from an .obj file. Having the .pdb available may give you symbolic information, but the code structure is lost. When writing C++ make sure you **never** lose your source code. As mentioned above, an SCM is mandatory.
Answer: Your options are most likely limited.
The best option is to try to recover the original file itself. Did you copy it to a new location and then delete the original? If so, there is a chance that the raw data might still be written to the hard drive and you can try an undelete tool such as Recuva (google "undelete" for plenty of alternatives). Be aware that as you continue to use the same disk, the chance of recovery goes down, because you are constantly exposed to the risk that new data is written to the same blocks. This includes installing and using the undelete tool, so the recommended practice for recovering a file is to turn the machine off as soon as you realise (ideally by cutting the power), and boot/undelete from another disk/machine to access the drive.
Failing that, you can try to decompile the object file. This will not replicate your original code, but with some (most likely: a lot of) effort you could reverse engineer and restore it manually, particularly if the code is still fresh in your mind. Have a look at this question.
For your future projects, I highly recommend using a version control system such as Git. Being able to recover from accidental overwrites like this is just one of the many benefits it provides.

Visual c++ Express - recover source


Mapping a branching tile path

Question: I'm working on a game (and have asked a couple questions on it already), and now I have another question to ask of you guys.
The level format in this game is set up as a tilemap of Uint16's (I'm using SDL) which are indices into an array of tilemapData structs.  One of the bits of the tilemapData struct is the isConductive bit/boolean.
The use of this bit is basically to create paths that connect various objects together into a single "powerNet."  I've got some code below on the current method (which works, but I'll cover why I really hate it after)
void findSetPoweredObjects(unsigned long x, unsigned long y, powerNetInfo * powerNet) {
  //Look for poweredObjs on this tile and set their powerNet to the given powernet
  for (int i = 0; i < level->numChunks[CHUNKTYPE_POWEREDDEF]; i++)
    if (level->poweredObjects[i]->position[0] == x && level->poweredObjects[i]->position[1] == y)
      level->poweredObjects[i]->powerNet = powerNet, powerNet->objectsInNet++;
}

void recursiveCheckTile(bool * isWalked, powerNetInfo * powerNet, unsigned long x, unsigned long y, tilemapData * levelMap) {
  //If out of bounds, return
  if (x < 0 || y < 0 || x >= level->mapDimensions[0] || y >= level->mapDimensions[1]) return;
  //If tile already walked, return
  if (isWalked[x + (y * level->mapDimensions[0])]) return;
  //If tile is nonconductive, return
  if (!(level->tiles[levelMap->map[x + (y * level->mapDimensions[0])]]->flags & TILETYPE_CONDUCTIVE)) return;

  //Valid tile to check, see if there's a poweredobj on the tile (link it to the net if it is) and check the adjacent tiles.
  isWalked[x + (y * level->mapDimensions[0])] = true;

  findSetPoweredObjects(x,y,powerNet);

  recursiveCheckTile(isWalked, powerNet, x - 1, y, levelMap);
  recursiveCheckTile(isWalked, powerNet, x + 1, y, levelMap);
  recursiveCheckTile(isWalked, powerNet, x, y - 1, levelMap);
  recursiveCheckTile(isWalked, powerNet, x, y + 1, levelMap);
}

bool buildPowerNets(void) {
  //Build the powernets used by the powered objects
  //TODO: Rewrite buildPowerNets() & recursiveCheckTile() to avoid stack overflows and make it easier to backtrace powernets in-game
  bool * isWalked;
  isWalked = new bool[(level->mapDimensions[0] * level->mapDimensions[1])];
  unsigned long x, y;
  tilemapData * levelMap = level->layers[level->activeMap];
  for (y = 0; y < level->mapDimensions[1]; y++) {
    for (x = 0; x < level->mapDimensions[0]; x++) {
      if (isWalked[x + (y * level->mapDimensions[0])]) continue;
      isWalked[x + (y * level->mapDimensions[0])] = true;
      if (level->tiles[levelMap->map[x + (y * level->mapDimensions[0])]]->flags & TILETYPE_CONDUCTIVE) {
        //it's conductive, find out what it's connected to.

        //But first, create a new powernet
        powerNetInfo * powerNet = new powerNetInfo;
        powerNet->objectsInNet = 0;
        powerNet->producerId = -1;
        powerNet->supplyType = POWER_OFF;
        powerNet->prevSupplyType = POWER_OFF;
        powerNet->powerFor = 0;

        //Find adjacent tiles to this one, add them to it's powernet, and then mark them walked.  Then repeat until the net is done.
        recursiveCheckTile(isWalked, powerNet, x, y, levelMap);
      }
    }
  }
  delete isWalked;
  for (int i = 0; i < level->numChunks[CHUNKTYPE_POWEREDDEF]; i++)
      if (level->poweredObjects[i]->powerNet == NULL) return false;
  return true;
}

Note that returning false means that the function failed (in this case, it didn't properly link all of the objects).
My worry is that the function to walk the conductive tiles will flat-out fail on more complex maps because of a stack overflow.  What are some ideas for how to mitigate this risk with these functions?  I can provide more info on the structs used if it's needed.
I've thought of modifying the code so that recursiveCheckTile only makes a recursive call when it reaches a junction and just interatively follows the conductive path it's on otherwise, but that still seems to be only a partial solution since I can't know ahead of time how twisted or branching the path might be.
If it makes a difference, speed is entirely unimportant here, since this function only runs once when the map is being processed before being used, and so using a little extra time won't hurt.
Answer: Flood fill
It looks like you're basically doing a flood fill of your grid. You can eliminate the recursion by employing a queue or a stack of squares that need to be checked. See the "alternate implementations" section of the Wikipedia article for pseudo-code.
The advantage of maintaining the queue/stack yourself is that you will remove squares from the list as you visit them, whereas in the recursive solution the squares remain on the stack even after you have visited them.
Here's the "simple" alternative implementation from the Wikipedia article adapted to your problem:
1. Set Q to the empty queue.
2. Add node to the end of Q.
3. While Q is not empty:
4.     Set n equal to the first element of Q
5.     Remove first element from Q
6.     If n has already been visited:
7.         Go back to step 3.
8.     Mark n as visited.
9.     Add the node to the west to the end of Q.
10.    Add the node to the east to the end of Q.
11.    Add the node to the north to the end of Q.
12.    Add the node to the south to the end of Q.
13. Return.

Note that you can use a stack or a queue for this, either will work. Here are some cool—and mesmerizing—animations showing the difference visually:
Queue-based flood fill

Stack-based flood fill

Connected-component labeling
You may also find the connected component labeling page interesting if you ever end up having multiple power nets on the same grid. It basically helps you figure out if you have multiple disconnected power nets, and when you do it tells you which one each square belongs to.
Comment: Those animations are awesome.
Comment: The connected-component labelling is great, since there could be hundreds of powernets in the grid (Well, going by the capabilities.  I'd be astounded if any of the level designers actually made that many)
Answer: You can rewrite this function iteratively.
Think of it this way:  You're implicitly using the call stack as your path stack for your search algorithm.  Each time you call recursiveCheckTile you're pushing a node onto that stack.  The call stack is relatively small, however, so you're blowing it out quickly.
You need to manage your path stack explicitly.  Instead of making a call to a recursive function for the four adjoining nodes, push a node onto this explicit stack.  Your algorithm will look like this (pseudo):
add starting node to stack

while( nodes on stack )
{
    pop node
    if( node is conductive )
    {
        add node to powerSet
        push 4 adjoining nodes onto stack
    }
}

This will yield the same traversal (depth-first), but your stack will be explicit so you can allocate gobsmacks of memory for it.

Mapping a branching tile path


Index was outside the bounds of the array

Question: This is my code where I am getting error "Index was outside the bounds of the array."
var objectData = new object[colRindas.Count, 4];
     int i = 0;
     foreach (DeArtIzm izm in colRindas)
     {
         objectData[i, 1] = izm.ArtCode;
         objectData[i, 2] = izm.ArtName;
         objectData[i, 3] = izm.Price;
         objectData[i, 4] = izm.RefPrice;
         i++;//Place where I get that error
     }

What seems to be the problem hare, cause I can't find the problem.
Answer: Arrays are 0-indexed instead of one.
foreach (DeArtIzm izm in colRindas)
     {
         objectData[i, 0] = izm.ArtCode;
         objectData[i, 1] = izm.ArtName;
         objectData[i, 2] = izm.Price;
         objectData[i, 3] = izm.RefPrice;
         i++;//Place where I get that error
     }

Comment: Also, he should reset his debugger symbols.  Clean the solution (ensure the .pdb file is deleted).  Out of synch symbols would explain why the exception was thrown on `i++`
Answer: in C#, Arrays are Zero-based by default (i.e. The first element has the index 0).
So you need to start with objectData[i, 0], and end with objectData[i, 3].


what function fulfills these conditions?

Question: So I know that if $f(x) = x^{-1}$, than $f(f(x)) = x$ but $f(x)$ is not necessarily $x$. So now, is there $g(x)$ such that $g(g(x)) \neq g(x) \neq x$ but $g(g(g(x))) = x$? If so what is it, else why not?
Comment: A real-valued example is $f(x) = \frac 1{1-x}$, which has the required property for all $x$ except $0$ and $1$.
Answer: Think about rotation about the origin by $120$ degrees. In the complex plane, consider $f$ defined by $f(z) = z e^{\frac{2\pi}{3}i}$. Then, clearly, $f^2(z)$, $f(z)$, and $z$ are all distinct, unless $z \neq 0$. However, $f^3(z) = z e^{2\pi i} = z$.
Comment: *Sigh*, I knew there was something obvious staring me in the face.
Answer: If you allow $g\colon \mathbb{C}\to\mathbb{C}$, then $g(z)=ze^{\frac{2pi i}{3}}$, a counter-clockwise rotation by $2\pi/3$ in the complex plane, satisfies your conditions. In that case $g(g(g(z)))=z$, but $g(g(z))\neq g(z)\neq z$ for $z\neq 0$.
This construction works for other values as well:

$f_2(z)=ze^{\frac{2\pi i}{2}}=-z$ is a rotation by $\pi$ with $f(f(z))=z$.
$f_4(z)=ze^{\frac{2\pi i}{4}}=iz$ is a rotation by $\pi/2$ with $f(f(f(f(z))))=z$.
$f_5(z)=ze^{\frac{2\pi i}{5}}$ is a rotation by $2\pi/5$ with $f(f(f(f(f(z)))))=z$.
etc.

It's worth mentioning that the listed functions aren't the only possibilities. For example, $f_4(z)=-iz$ would have worked just as well, and you already gave a different example of $f_2$ in your question.
Answer: In general if you are considering linear functions from $\mathbb{R}^d$ to $\mathbb{R}^d$ which are diagonalizable, then if your linear transformation matrix is represented as $MDM^{-1}$ where $D$ is the diagonal matrix of eigenvalues, then your matrix will satisfy your constraints as long as $D$ has all third roots of unity some of which are not $0, \pm 1$.
Comment: I got to "are considering linear functions from" before I couldn't under stand anything.