Dryer buzzing and greatly hot to the touch. What is wrong and what needs to be replaced?

Question: I have a dryer in my downstairs basement that has had the heating element replaced in the past. After it was replaced it worked fine until after a cycle. After the cycle and about 30 minutes later it started buzzing quite loud and was very hot to the touch. I had unplugged it just in case, but I don't know what this problem could be, apart from a broken breaker that doesn't work or a broken heating element. What should I do make sure the dryer works correctly and safely?
Comment: Heating elements do not buzz, they work or not. However the motor could buzz. It could be it just lost the start capacitor and will not turn. Check if it turns.
Comment: "What is wrong and what needs to be replaced?" and "What should I do to ensure I don't plug it in again and start either a fire or severely damage the dryer?" are two different questions with two different answers, The second question's answer is: Once it's unplugged, cut the plug off and throw the dryer away. :) But I suppose that's not what you're really after, so that question is edited. Please edit again if you really wanted to ask something else.
Comment: Depending on the dryer, some of them are quite simple.  Usually just a motor to turn, the heating element, and controls.  Buzzing might be from wires shorting, very bad.  Can google the make and model to find instructions for repairing.
Answer:
I have a dryer ... that has had the heating element replaced .... After it was replaced it worked fine until after a cycle. After the cycle and about 30 minutes later it started...

If you personally replaced the element, open the dryer up again and check what was done wrong. The replacement heating element probably had replacement instructions that can be perused carefully. A Youtube instruction video for your dryer type may help, or hire the dryer manufacturer's repair service to fix the problem.
If you had a repair person do the repair, have them come back and fix it. They may have done something wrong.
Answer: I suspect your duct is clogged and the lack of airflow burned up your first element.  Put the dryer on fluff and go outside and verify airflow.


Meaning of ~てやる

Question: Does ~てやる work the same way as ~てあげる does?
Does ~てやる have any other meanings?
Answer: I think that the other answers have already outlined the main differences between the two. ~てやる can be much less polite than ~てあげる, but both have the same basic meaning.

In the book 問題な日本語 by 北{きた}原{はら}保{やす}雄{お}, it's stated that expressions like 猫に[餌]{えさ}をあげる and 花に水をあげる have become frequently used even by the older generation in recent times, even though some people have an uncomfortable feeling when they're said.
It says that essentially, あげる was the 謙{けん}譲{じょう}語{ご} ("humble language") of やる. As a result, expressions like 先生にあげる ("give to a teacher") and 友達にあげる ("give to a friend") have been pointed out as correct, and expressions like 猫に餌をあげる ("feed a cat") and 花に水をあげる ("water a flower") have also been pointed out as incorrect by some people. However, due to shifts in the language, people have started using あげる in places where やる was used, as やる has connotations of 品がない ("lacking style") and 粗野 ("vulgar/rustic/rude") and あげる is a 上品な言い方 ("polite/elegant/gracious way of talking").
It also states that あげる has lost almost all it's humility and has largely changed from being 謙譲語 into 美{び}化{か}語{ご}, and that there is major trend to it only being used for people of equal or lower status. As a result, most students can't say things like これをあげます and カバンを持ってあげます to teachers. It also makes a hypothesis that as 差{さ}し上{あ}げる has come into more common usage, 差し上げる might have replaced the 謙譲語 usage of あげる.
Answer: ~てやる is synonymous with ~てあげる but used when the subject of the act (not the person being spoken to) is an inferior. You might define やる as "give or do to an inferior".
So "feed the cat" would be 猫にえさをやる
If your boss told you that your underling needs "a talking to" about something, you might say 私が言ってやります。
Comment: when you say "give or do" in your definition, you mean it can be a positive thing or a negative thing, right? does this also apply to "ageru"?
Comment: That's difficult to answer. The expression is only as positive or negative as the relationship between the speaker and the subject.
Answer: ~てやる works the same way ~てあげる does but this is really for inferior ranked people, pets or really close people.
You can use it in the same cases you can use お前. It can be really rude if misused so my best advice would be to avoid using it till you feel confortable enough in japanese.

Meaning of ~てやる


Commenting Core Data Model

Question: Is there a way to add comments to the entities, attributes, and relationships in the data model for Core Data? As my model becomes more complex, it would be useful to have comments, but I haven't seen any way to do this. Of course, it would also be helpful if the comments can be retained through migrations.
Answer: There is no way of adding comments directly to your Core Data model, but viewing the model in X-code you can switch to Table, Graph editor style in the lower right corner of the entity inspector. This view should serve plenty as documentation for your model if you've built it logically.
Of course you could always add a comment section in your App Delegate, covering the structure of your Core Data model, but I suppose you do know this alreay.

Commenting Core Data Model


conversion from asp.net web site(.aspx pages) to WCF service

Question: i have developed a web site using asp.net. In the web site if user enters username and password he will proceed to the next pages say home.aspx, dailyreport.aspx which is correct.
But the problem i'm facing is if the user enters url of the any page say domainname/projectname/dailyreport, then he will be in the desired page. then what is the use of having login page... how to deal with this issue....can anybody please help me. please as soosn as possible....
Answer: At a minimum, you need to enable Forms Authentication. This will ensure that any unauthorised users are redirected to a login page, from where they can access the site.
For more information about Forms Authentication, try this;
Explained: Forms Authentication in ASP.NET 2.0


Why is there a Bewilderbeast responding to king Toothless in HTTYD 3?

Question: In the hidden world scene 'king' Toothless calls out to the dragons of the hidden world. When the dragons respond next to the Light Furies, we see a Bewilderbeast that looks EXACTLY like Drago's Bewilderbeast from HTTYD 2. It's even missing his left tusk. Why is this Bewilderbeast not in charge? How did it end up here? I thought it died in HTTYD 2?
Answer: I think HTTYD 2 makes it clear that the Bewilderbeast was not killed, but rather retreated - we see him crawling back into the sea after he loses the loyalty of the other dragons during his confrontation with Toothless. Thus, it's likely that he returned to the Hidden World after that, but not as a king - his humiliation in battle with Toothless either caused him to lose any claim to kingship in the eyes of other dragons, or he himself acknowledged that he wasn't worthy of it and supported the Furies' rule.
Answer:
When the dragons respond next to the Light Furies, we see a Bewilderbeast that looks EXACTLY like Drago's Bewilderbeast from HTTYD 2.

That's because it is. Dean Deblois, the director, and multiple other cast and 'in the loop' members confirmed that it was Drago's Bewilderbeast. Once I'm able to find where it's confirmed, I'll edit this post.

Why is this Bewilderbeast not in charge?

Since we know that this is Drago's bewilderbeast, we know that his alpha-status was challenged. This was directly said in HTTYD2.

"He's challenging the alpha!"
"To protect you!"

So the battle ensued and at the end, Toothless had won the fight, making him the alpha. We know this because during the battle, the Bewilderbeast started to lose, and eventually completely lost his dragon army. Toothless had officially won the fight and this made him The King of Dragons. This is why all dragons follow his leadership now. Because he won the fight against an alpha and became the alpha.
So to answer your question of why isn't that bewilderbeast in charge? Because he lost his alpha status to Toothless.

How did it end up here? I thought it died in HTTYD 2?

We see at the end of HTTYD2 that it simply fled into the ocean. There was no indication that it, or even Drago himself, died. However I think we're to assume as much based on HTTYD3 and them talking about Drago's fall. And since you enter the Hidden World by either flying in, or over the waterfall, we can assume that the bewilderbeast swam into the Hidden World (or found another way in that isn't from above the water).


How quotes work in Magento

Question: I am not sure how quotes work in Magento. I saw that a quote id is assigned to customer when is created. Sometimes I see in sales_flat_quote table that for one customer there are 2 lines there...I mean there are 2 quotes.(actually one has store_id=0 and one store_id=1) When a users log in through API (custom code) it seems that a new quote is assigned to. I don't get what is happening..or how should this work..
Comment: is there any other information that is necessary to assist you with this question? If not, please answer it with your own answer or mark another answer as accepted.
Answer: A quote is actually a 'cart' object.
A customer can have many quotes. One for each website.
the quote object is not created when the customer is created. It is created when the customer adds the first product to the cart.
Also a quote is not necessarily assigned to a customer. You can have a quote when browsing the website as guest.
In that case the quote remains in the db after the session expires.
Comment: Thank you for your response!
One quote for each site which is given by store_id. When store_id=0 what does it mean?
I have just tested again: I created a new customer and in sales_flat_quote table I see the new customer id. Am I wrong that this mean that a quote is assigned?
Regarding the unassigned quote, I know that.
Comment: Store id 0 means 'Admin'. It means there is a quote created from the admin panel (and maybe the API - not sure about this) for that customer.
Comment: I have a method with this code
$session = Mage::getSingleton('customer/session');
$session->loginById($customer_id);
$quoteID = Mage::getSingleton("checkout/session")->getQuote()->getId();

return "Customer ID: ". Mage::getSingleton('customer/session')->getCustomerId().' Quote ID: '.$quoteID;
Let's say I don't have any quote yet in sales_flat_quote. After I call my method..I will receive a quote id and in the table I see a new record for my customer with store_id=0.
I don't get where the quote is created.
Comment: The quote is created when you call `Mage::getSingleton("checkout/session")->getQuote()`. Check how the method `Mage_Checkout_Model_Session::getQuote` works. If there is a quote for the specified customer it returns it. If not, it creates one and returns it.
Comment: Yes..my mistake I didn't look at that method. It seems that the problem is with Mage::app()->getStore()->getId()...which is 1 if I use website and is 0 in my method which extends API. So, even if my customer has already a quote which has been created from website, when I call my method it will be created a new quote with store_id=0. It is possible to get the quote id for my customer (with store_id=1) instead of creating a new one? What if there are multiple stores? How can I know what quote to return?
Comment: Just add at the top of your script this `Mage::app()->setCurrentStore(Mage::getModel('core/store')->load(1))`
Comment: Thank you! It worked! I am just wondering now what will happen in case of multiple stores...

How quotes work in Magento


Interface usage question

Question: Why is it that an interface seems to be exactly the same thing as the class but just the function declaration. What Are the major benefits to interface? Besides multiple classes sharing an interface but still it feels like what for? Each class will have it's own implementation thus why use an interface?
Answer: Using an interface means that the callers of the interface aren't tied to a specific implementation.
For example, if you're using C# and you need a sequence of data, you expect to see that in terms of IEnumerable<T>. You don't care what the implementation is - and requiring one specific implementation would limit how your code could be used.
Another example would be Stream - which is an abstract class rather than an interface, but the basic principle is the same. You can parse any kind of stream into an XmlDocument (to pick an arbitrary use of streams). It doesn't matter whether it's a FileStream, a NetworkStream, a MemoryStream or anything else, so long as it supports the required operations.
Answer: It allows two totally unrelated classes to implement the same interfaced, and as such can be used in the same way. (Like calling ISortable.Sort on two lists with a completely different implementation.
It's like multiple inheritance, only better. :)
And interfaces are used for sharing objects between processes as well (Google for COM or Automation).
Answer: This answer helped me to understand the interface usage.
I would like to upvote it once a day :-)
Answer: In statically typed object oriented languages, interfaces make it possible to use classes that only share the interface to be used polymorphicaly.
Answer: Interface normally used when you need to interact between different sub-systems. It also gives benefit of loose coupling and hide actual implemented objects.
Answer: When designing with interfaces, one underlines the behaviours expected without polluting with any implementation futile details.
An interface represents a contract, allowing the rest of the application to use through this interface any object that abide to this contract.
In a nutshell:

Clarity of design
Flexibility of design.
Answer: Interfaces (in general) provide Abstraction and Encapsulation.
Abstraction means that the client does not need to know more than in the interface to use the object.
Encapsulation means that the client cannot know more than is in the interface.
Together these are called information hiding.
So, to an extent, you are right that each class provides its own implementation so you do not need the interface. However, in that case the client becomes dependent on the implementation. Unfortunately, in the real world, implementation changes all the time. As implementation changes, all dependent code will have to be changed.
By using an interface, the client only depends on what is specified in the interface and not on the actual implementation. So the implementation may change and the client code may not necessarily require changing. Of course care has to be taken that the interface itself does not change.
Say you had a collection of objects. You then needed those objects sorted in some order. If you implemented your collection as a Tree then the code to sort is completely different from if you implemented a linked list. The client code, being exposed to these implementations would require changing if any details of these implementations changes.
If on the other hand you create an Interface, say Collection, that promises that any implementation would be able to sort itself but it does not tell you how it will sort, then your client code can depend on the ability to sort without knowing the details of sorting.
You can happily change the Collection type and the sorting algorithm without affecting the client code.

Interface usage question


What is the link between the metric signature of spacetime and fundamental field equations?

Question: The signature of Minkowski spacetime is 2, as is explained here: Metric signature explanation. The signature is related to the form the fundamental equations take, but I'm not totally clear on the link here. Furthermore I believe there is a link between second order PDEs and the metric of spacetime. I was wondering if anyone could clarify the links here, or could provide more details of how it goes.
I have been reading from the following essay: http://www.fqxi.org/data/essay-contest-files/Callender_FQX.pdf
Comment: I read the answer claiming the signature is 2 but I have never heard it referred to as 2.  I have always seen the (1,3) notation (or -,+,+,+ or +,-,-,-).  It doesn't make sense to add the diagonal elements and say the signature is 2.  A flat 2 dimensional plane space would also have signature 2 by that method which certainly is not the same as (1,3).
Comment: Obviously it's necessary to give the dimension and the signature, rather than *just* the signature.
Answer: Generically, the signature of the metric becomes important when writing down field equations because certain differential operators one may want to write down depend on the choice of metric.  For example, take the Laplace-Beltrami operator on a manifold with metric $g_{ij}$
$$
  \Delta f = \frac{1}{\sqrt{|g|}}\partial_i\Big(\sqrt{|g|}g^{ij}\partial_j f\Big)
$$
Using cartesian coordinates in Euclidean space $\mathbb R^4$ where $g_{ij} = \delta_{ij}$ one obtains
$$
  \Delta_{\mathbb R^4}f = (\partial_t^2+\partial_x^2 + \partial_y^2 + \partial_z^2 )f
$$
while in cartesian coordinates on Minkowski space $\mathbb R^{3,1}$ one obtains
$$
  \Delta_{\mathbb R^{3,1}}f = (-\partial_t^2+\partial_x^2+\partial_y^2+\partial_z^2)f
$$
Notice, in particular, that the sign in front of the $t$-derivative term changed from a $+$ sign to a $-$ sign because of the change in the signature of the metric.
Answer: Here is one type of answer:
The 'fundamental equation' for a massless field $\phi$ is
$$
g^{\mu\nu}\partial_\mu \partial_\nu \phi = 0~,
$$
where $g^{\mu\nu}$ is the (inverse) metric.  In Euclidean space, this is just Laplace's equation
$$
\vec\nabla^2\phi = 0~.
$$
To uniquely specify a solution to this equation in some region $V$ of space, you must give the value of the field $\phi$ at all points on the boundary.  (These are the simplest boundary conditions, anyway).
In Lorentzian space*time*, on the other hand, the equation is
$$
-\partial_t^2\phi + \vec\nabla^2\phi = 0~.
$$
This is very different.  Now a unique solution is obtained in some spacetime region $V$ by specifying the value of $\phi$ (and its time derivative) at all points on some Cauchy surface for $V$ -- a surface with the property that any (say) past-directed light ray beginning in $V$ intersects it at least once.
Comment: Interesting - I never thought about it that way. So basically you're using the (single-number) signature as a probe of the elliptical (signature = dimension) vs. hyperbolic (signature < dimension) nature of this equation?
Comment: Yes; I think this is important.  Although I'm now slightly worried about my answer.  What I've written is certainly the way that the boundary conditions for the two equations arise most naturally in physics, but it's not the full story.  My knowledge of the theory of partial differential equations is patchy at best...


Can we express max constraint as a linear constraint?

Question: I have a mathematical program with a constraint involving a maximum function. More specifically, the constraint is: $y = \max\{a_i x_i:1 \leq i \leq n\}$ where $a_i$ are constants and $x_i$ are binary variables. Can we express this constraint as a linear constraint?
Comment: Is this a constraint or an objective?  Usually in LP you see max/min in the objective.
Answer: First note that because your $x_{i}$ are binary variables you aren't really in the world of linear programming any more.  Rather, this problem is a mixed integer linear programming problem (MILP).
Depending on your other constraints and objective, this  may be doable by simply minimizing $y$ in the objective and enforcing the constraints:
$y \geq a_{i}x_{i}$ for $i=1, 2, \ldots, n$.
More generally, you can do this as follows.
I'm going to assume that the constants $a_{i}$ are positive.  If not, the same general approach can handle the case where some $a_{i} \leq 0$.
I'll also assume that the coefficients have been sorted so that $a_{1} \geq a_{2} \geq \ldots \geq a_{n}$.  This is just to simplify the notation- you can keep them in the original order if you're willing to keep track of the subscripts in writing the constraints that are given below.
Add binary variables $u_{i}$, $i=1, 2, \ldots, n$.  Add the constraint
$\sum_{i=1}^{n} u_{i}=1$
This ensures that exactly one of the $u_{i}$ is 1.  We will arrange things so that if $u_{k}=1$, then $k$ is the index of the $x$ variable that corresponds to the maximum of $a_{i}x_{i}$.
Next, add the constraints
$\sum_{i=1}^{k} x_{i} \leq n \sum_{i=1}^{k} u_{k} \;\; $, for $k=1, 2, \ldots, n$.
This ensures that if $u_{1}=u_{2}=\ldots=u_{k}=0$, then $x_{i}=0$ for $i=1, 2, \ldots k$.
Next, add the constraints
$(1-x_{i}) + u_{i} \leq 1$, for $i=1, 2, \ldots, n$
This ensures that if $u_{k}=1$, then $x_{k}=1$.
The combined effect of the above constraints is that if $u_{k}=1$, then $k$ is the index of the first $x_{i}$ variable that is 1.
Finally, add the constraint
$y=\sum_{i=1}^{n} a_{i}u_{i}$.


What is the R squared of a regression where none of the variables are collinear?

Question: If a regression has 100 observations and 100 variables and none of them are collinear, what is the r squared? I know that it means that the full rank assumption is satisfied, so does this mean the r squared equals 1? Also, what would the t-statistic for the 5th coefficient be?
Answer: (Most of this a linear algebra question is disguise!)
If the $100\times100$ matrix $X$ is full-rank, that means the columns form a basis for $\mathbb R^{100}$. Since $y\in\mathbb R^{100}$, $y$ can be written as some linear combination of any basis for $\mathbb R^{100}$, such as the set of columns of $X$.
That is, the columns of $X$ perfectly predict $y$, and there is no prediction error (at least not in-sample). Consequently, $y=\hat y$, and $R^2=1$.
$$
R^2=1-\dfrac{
\overset{n}{\underset{i=1}{\sum}}\left(y_i-\hat y_i\right)^2
}{
\overset{n}{\underset{i=1}{\sum}}\left(y_i-\bar y\right)^2
}\\
=1-\dfrac{
\left. \overset{n}{\underset{i=1}{\sum}}\left(y_i-\hat y_i\right)^2 \middle/ n \right.
}{
\left. \overset{n}{\underset{i=1}{\sum}}\left(y_i-\bar y\right)^2 \middle/ n \right.
}
\\
1-\dfrac{
\text{var}(y-\hat y)
}{
\text{var}(y)
}\\
=1-\dfrac{0}{\text{var}(y)}=1
$$
(This assumes not all values of $y$ are equal, but if they are, that is not an interesting regression problem.)
With zero residual variance, it does not make much sense to talk about the t-stats for any of the coefficients, since t-stats divide by residual variance and dividing by zero is frowned upon.
Comment: $\text{Var}$ (or $\text{var}$) could be a good alternative to $var$.
Answer: If none of the explanatory variables is colinear (i.e., each pair has zero correlation) then the coefficient-of-determination for the regresion is equal to the sum of the coefficients-of-determination for individual simple linear regessions of each explanatory variable against the response variable.  If you would like to learn more about the relationships between collinearity and the coefficient-of-determination in linear regression, as wel as a broader geometric view of regression, you can find some discussion of this topic in my paper O'Neill (2019).
Comment: @whuber: Yes, sorry all, in my haste to answer I didn't notice the piece of information that number of observations is equal to number of variables, so apply the other answer in that case.  I'll leave this answer up anyway, in case you're interested in the more general case where number of observations is greater than number of variables.
Comment: This is certainly true, yet I'm having a very difficult time reconciling it with my post (which also is correct…I hope). I think an implication of our two posts is that, if $99$ of the features are uncorrelated with the outcome, then that $100th$ feature must be perfectly correlated with the outcome, which I'm not sure I'd ever known until right now.
Comment: This is true but not useful, because in the present case, as @Dave's answer shows, we can determine $R^2$ without having to consider any of the partial $R^2$ values.
Comment: @Dave Perhaps the piece that will make you feel at home is to think about how strong of a constraint the pairwise non-colinearity is on explanatory variables.


Free Map matching benchmark data

Question: I have my own map matching algorithm and I want to compare it's accuracy to some other algorithms. Is there a free trace dataset that has a confirmed match for each trace (ground truth), so I can perform the comparison? Even more, I would be interested in a whole benchmark/test suite for this purpose.
Comment: If you are seeking open data then the place to ask will be the [opendata.se] Stack Exchange.
Comment: Would be interested to know if such a thing exists for evaluating our own system as well. Maybe some of the traces of openstreetmap?
Answer: This paper by Newsom and Krumm on map-matching includes a test dataset that you can use to evaluate other algorithms. It's called "Hidden Markov Map Matching Through Noise and Sparseness."
Comment: I know this article, but I don't think that one trace is enough for benchmarking.
Answer: Finally, I've found trace dataset suitable for the benchmarking, containing 100 traces from different parts of the world. It is described in the article called Dataset for testing and training of map-matching algorithms by Kubicka et al. (available on IEEE).
The dataset itself is stored on zenodo.org as an open-access dataset.

Free Map matching benchmark data


Wheel's torque and differential gearbox

Question: I know that the differential gearbox is providing a torque to the wheels; as the relation in the figure indicates : Tw (wheel torque) = Td (differential torque) × (ηd×nd). Where nd:is the differential gear ratio and η:is the effeciency of the differential gearbox. Now this torque at wheels (Tw), which is provided by the differential , is also = Rw×Fx (torque from road friction ) . My question is : Won't the torque from (Fx) on the wheels accelerate (increase) the wheel's rotational speed(ωw) ? If this is the case;now ωw is increasing. And since (ωd=nd×ωw);  then ωd(differential or driveshaft rotational speed) should also increase to maintain the gear ratio (nd) constant. So how would this differential/drive shaft rotational speed (ωd) increase to maintain this gear ratio (nd) constant ?
Comment: Why would the gear ratio be constant? the whole point of having gears is to match engine speed to road speed. Also will the torque be shared equally to both wheels?
Comment: So you are obviously saying that the gear ratio is not constant ; the gear ratio is teeth ratio of the input gear to the output gear . And of-course number of teeth will not change unless there was some magic happening in the gear-box
Comment: Based on this: *So how would this differential/drive shaft rotational speed (ωd) increase to maintain this gear ratio (nd) constant*
Comment: And there are gear drives with varying ratios…
Comment: @SolarMike Let's assume it the first gear ratio...
Answer: Interesting question! I think that the driveshaft would increase its speed from the engine itself as a response to the increase of the wheel's rotational speed.
Comment: What do you mean? the engine will increase itself's speed as a response ? how would the engine feel that response and on what basis will the engine speed increase? Please provide some logical evidence to your answer
Comment: @JesseFlynn cars can gain speed without throttle when going downhill. Easy.
Answer: The engine, transmission, differential and wheel are all essentially locked together  in a traditional transmission.  There are other ways to connect the four, but let's assume they are locked.  If the engine supplies more torque than required to keep the vehicle at a constant speed, the vehicle speeds up, and all the rotational speeds go up. This is strictly a function of engine load versus throttle position (or throttle position sensor input). Gear ratios have nothing to do with it, and remain constant.  If we are in a turn and the wheels are spinning at different rates, the difference in speed of the two wheels is seen in rotation of the differential plentary gear.
A modern continuously variable transmission will monitor engine load and speed and change the gear ratio to maximize performance and economy.  The differential gear ratio will remain constant.

Wheel's torque and differential gearbox


Mounting a filesystem?

Question: I know how to use mounting in linux and have used it many a times but I am not able to understand what mount actually means in operating system,its benefits and practical usage?
I have searched it on various sites but could not find useful links?
Answer: Mount means binding a device such as hard-drive to your file-system under "/" root directory .
For example home directory /home could be another hard-disk , when you mount it will seems /home .
Another example when you connect a usb , how can you access it if its not mounted , so mount enable you to access your device.
So mount tell your Os that a devices is linked to root top directory and is ready for use .
Note : You can apply permissions to mount point , and if you want to save a mount after reboot you should write it in fstab .
Answer: Benefits:

Control access to drive
No unnecessary read/write operations in a drive that you don't use
When unmounting successfully you are sure that all your data has been writen to the drive
Lower power consumption
Security benefits: no software can access a drive before it is mounted and mounting requires Administrator privileges

Practical usage: if you don't have UPS you can consider an unmounted drive as safely removed (like USB) in case of power loss.
http://en.wikipedia.org/wiki/Mount_(Unix)

Mounting a filesystem?


How to capture SQL with parameters substituted in? (.NET, SqlCommand)

Question: If there an easy way to get a completed SQL statement back after parameter substitution?  I.e., I want to keep a logfile of all the SQL this program runs.
Or if I want to do this, will I just want to get rid of Parameters, and do the whole query the old school way, in one big string?
Simple Example: I want to capture the output:
SELECT subcatId FROM EnrollmentSubCategory WHERE catid = 1
.. from this code:
    Dim subCatSQL As String = "SELECT subcatId FROM EnrollmentSubCategory WHERE catid = @catId"
    Dim connectionString As String = "X"
    Dim conn As New SqlConnection(connectionString)
    If conn.State = ConnectionState.Closed Then
        conn.Open()
    End If
    Dim cmd As New SqlCommand(subCatSQL, conn)
    With cmd
        .Parameters.Add(New SqlParameter("@catId", SqlDbType.Int, 1))
    End With

    Console.WriteLine("Before: " + cmd.CommandText)
    cmd.Prepare()
    Console.WriteLine("After: " + cmd.CommandText)

I had assumed Prepare() would do the substitutions, but apparently not.
Thoughts?  Advice?  Thanks in advance.
Answer: No, .Prepare doesn't do that, and in fact nothing in the Command does.  The parameter values are never substituted into the actual command string.  It is sent to the DB separately, which is good for several reasons:

This allows sqlserver (or other dbs) to cache the query plan for your query and reuse it next time.  When a different commandtext string is sent to the db each time, the database has to develop a plan each time.
By sending the parameters to the db compartmentalized, there is a nature defense against sql injection attacks.

Unless you're using a really old database (sql server 7?), .Prepare() is not necessary and does not actually do anything for you.  It used to be helpful in that it would compile the query on the server, but that is done for you automatically now.  I haven't use .Prepare() in a long time.
Hmmmmm.  Looking here it seems .Prepare() does still do something for you:  if any values are larger than the parameter defined length, the .Prepare() truncates the value, so that when you execute you don't get the error and the query succeeds. cool.
Comment: Thanks for all the answers - I chose this as the answer because it explained the reasoning the best.  Thanks all!
Answer: I usually add a utility function to my projects that, given a DbCommand object (the parent class of OracleCommand, SqlCommand, etc.) will log the query and parameter values.  It might look like this:
Public Shared Sub LogQuery(ByRef cmd As DbCommand)
    If cmd.CommandText Is Nothing Or cmd.CommandText.Length = 0 Then
        Return
    End If

    Dim logFile As CLog = New CLog("sql.log")
    Dim msg As New StringBuilder

    msg.AppendLine("*** Query ***")
    msg.AppendLine(cmd.CommandText)
    msg.AppendLine("*** End Query ***")
    msg.AppendLine("*** Parameters ***")

    For Each p As DbParameter In cmd.Parameters
        msg.AppendLine(String.Format("{0}: {1}", p.ParameterName, p.Value.ToString()))
    Next

    msg.AppendLine("*** End Parameters ***")

    logFile.WriteLog(msg.ToString() & System.Environment.NewLine)
End Sub

While I was writing this, it just occured to me that instead of logging the parameter values separately, you could do a little String.Replace()ing to substitute the parameter values into the query and then log it:
For Each p As DbParameter In cmd.Parameters
    msg = msg.Replace(p.ParameterName, p.Value.ToString())
Next

Comment: I think I'll be doing this as well -it accomplishes what I was looking for, in effect.
Answer: Parameters are not substituted. The sql as is, and the parameters are themselves passed as parameters to sp_executesql system stored proc
Answer: What is sent to SQL Server is not variables substituted with values but a prepared statement, this way it can be reused
Open up profiler in SQL Server and you will see what is being run is not SELECT subcatId FROM EnrollmentSubCategory WHERE catid = 1
Answer: This was recently asked here.  As the other answers point out, the parameters are sent out of band.
The Profiler is probably what you want to use for capture if you want to do it at the server, and you can create a trace and use it as a startup job.
Answer: You could build a wrapper around the System.Data.SqlClient Provider (*Ex. the provider registered in the config file as... * providerName="System.Data.SqlClient"). Essentially an intercept proxy you would have access to all the information passing through the Provider and could siphon-off what you need, aggregate and/or enrich it and send it to the logs. This is a bit more advanced but opens the door to capture a whole range of information and could be inserted/replaced/removed as a separate layer of concern.
Answer: Try the CommandAsSql NuGet package


Shloka regarding pradhāna and prakṛti

Question: I'm looking for the shloka which explains that there are two eternal principles: pradhāna or prakṛti.
Comment: By pradhana do you mean purusha?
Answer: B G. 15.16 dvaimuh purushho lokkae shra akshara yeva cha
Shra saravani bhoothani kutaaskhara uchyathye
There 2 types purusha/soul/jiva one is destructible and another is non destructible. All destructible bootha/jiva reach sky as their destination.
Adhyatmic interpertation: 2 types of jiva are Normal souls other is Lakshmi who is consort of sriman Narayana and who is lord of prakruthi who is non destructive. Under normal circumstances all jiva reside inside her that kootashtha and she is abhimaani of sky also.
Note:
Destructible means one who can have multiple bodies which are destroyed
Non destructible  Jiva her body cannot be destroyed who never takes up destructible body like us
Comment: Dear Prasanna R, thank you. It helped my understanding(^o^).
Answer: Srimad Bhagavatam 3.26.10
śrī-bhagavān uvāca
yat tat tri-guṇam avyaktaṁ
nityaṁ sad-asad-ātmakam
pradhānaṁ prakṛtiṁ prāhur
aviśeṣaṁ viśeṣavat
"The Supreme Personality of Godhead said: The unmanifested eternal combination of the three modes is the cause of the manifest state and is called pradhāna. It is called prakṛti when in the manifested stage of existence."
Comment: Dear Krsna prabhu, thank you so much(^o^). It solved my question.

Shloka regarding pradhāna and prakṛti


Firewall Authentication - logon failed

Question: I am attempting to use a Watchguard firebox 550e with Fireware XTM 11 to authenticate incoming traffic for RDP access.  I have configured the firewall to use my domain controller for Active directory authentication with a Windows 2000 server farm and added a couple of user accounts to the users list in the firewall, but when I attempt to log onto the authentication page for the firewall, I get Logon failed.  I know that the user names work and that the passwords are correct.  I am also certain that I have told it to log on using Active Directory instead of the FireboxDB.  I have tried using the username alone, the domain\username, and the email address.  I believe that the Search base is correct (DC=mydomainname,DC=com), and I did not change any defaults for sAMAccountName (and I do not recall making any changes to those items when configuring the domain structure).  Any assistance would be appreciated.
Comment: Are you not able to login with the FireboxDB creds either? Have you rebooted the device since making the changes to use AD auth?
Comment: I can logon to the device using either the Web based client, or the management software.
Answer: Few suggestions:

Check to see if you have an LDAP authentication test feature in your Firebox firewall, or find out if there are any logs concerning LDAP authentication.
Check to see if you have any error's related to LDAP or user acces in your Windows 2000
server security logs.

You'll need to find where this is actually error-ing out (user auth/firewall/server), if logs are not being helpful to you, perhaps tapping the connection with Wireshark in the middle might be helpful.
by the way, what do you mean by: "...and added a couple of user accounts to the users list in the firewall"
Comment: >>by the way, what do you mean by: "...and added a couple of user accounts to the users list in the firewall"<<  The firebox has the option to create and manage users on the device, thereby bypassing the AD authentication.  My goal is to use group permissions on the domain for access, so having to create additional users on the firebox and manage additional passwords is not really a viable option for me.

I will see if I can locate anything in the logs.  Thanks for the suggestions!!
Answer: Make sure the clocks on the firewall and the AD box are set from the same source, so they are consistent - thats a common issue.

Firewall Authentication - logon failed


Normandy, France: Where to see the WW2 landing craft?

Question: I am visiting Normandy, France, more specifically the town of Bayeux. Where in vicinity (I have a car) is it possible to see landing craft used during operation Overlord on D-Day? Preferably on an actual beach and not in a museum.
Answer: There is a LCVP based at the harbour of Carentan-les-Marais, about 50 km from Bayeux (more details in French). I don't think there is one on a beach anywhere, there might be one at the museum at Utah beach.
Answer: The remains of Mulberry harbour can be seen at Arromanches-les-Bains on the French coast. There's also a small museum that displays dioramas depicting the harbour in operation.

Source: Paris City Vision
Comment: I second this. You should absolutely go to the musem in Arromanches if you have the chance. It's quite small and quick to visit but absolutely worth it.There's a large window that lets you see the beach, with explanations about what happened, how they did it, etc., that adds so much to the overall experience. To me it felt like a window to history.
Answer: Nearest american landing craft can be seen in Overlord Museum near American Cemetery, Omaha beach.


Custom properties does not show in User Profile SharePoint 2010

Question: Custom user profile properties does not show in User Profile (person.aspx) nor Object model SharePoint 2010. The SSP is upgraded from 2007 to 2010. The normal settings are set in central admin but only core properties shows up. Anoyne know whats wrong?
Comment: Define "show up". Are the properties present in Manage User properties?
Or is it just the values that are missing when you manage User profiles?
Answer: I found the answer. There were multiple Profile Service applications associated to the Webapp. A aervice app without the properties was set as default. Still getting used to the service app concept. The properties were missing from the profile alltogether because of this. They appeared when I set the default to be the one with the properties.


Is it safe to keep your chemical (developer/fixer/stopbath) outdoor?

Question: Is it safe to keep your chemical (developer/fixer/stopbath) outdoor? Like balcony? But inside a storage with lid.
Comment: "outdoors" is pretty vague. Where do you live? Svalbard? Seville?
Comment: Why would any one would want to store chemistry outside.
Comment: Maybe because they (or some other household member) do not want things they consider noxious inside more than necessary....
Answer: Photographic chemicals are generally robust however they will lose their effectiveness over time. Exactly how long will be their shelf life is a variable. Developers tend to have the shortest shelf life. This is because the developing agents are relatives of benzene which was initially synthesized from coal. These agents have an affinity for oxygen. They readily react with dissolved oxygen that is in the water that constitutes the bulk of the developer solution. All developers contain preservatives that retard oxidation and neutralize the staining effect brought about as developing agents oxidize and revert to coal tar. These preservatives can only do so much, as time goes by; the developer solution oxidizes and turns black.
When we mix developers we generally start by diluting a concentrate to make a stock solution. The concentrate has a prolonged shelf life. The stock solution is likely good for about 6 months if full and well stopped up. If the stock solution bottle is not filled to the brim, its shelf life is about 2 months. If the stock solution is diluted to working strength (tank solution), its shelf life is reduced to about 24 hours.
Stop baths, prepackaged have an indefinite shelf life. When diluted with water, the shelf life is about 3 days.
Fixer concentrates have an indefinite shelf life. When diluted with water to make a stock solution, the shelf life is about 2 months if in a stoppered full bottle.  When diluted to working strength the shelf life is about 3 days.
Keep in mind,  many of the concentrates are highly concentrated. They may be super saturated solutions. Thus concentrates many not be able to tolerate low temperatures because of the danger that the solutes may fall out of solution. Should this happen, solids appear in the bottles. Most times, warming the bottle will cause these deposits to re-liquefy.
We mitigate oxidation by squeezing the air out of plastic storage bottles or by dropping in marbles to displace the air in stoppered bottles. The developer and some other solutions can be ruined by prolonged exposure to light. We use brown or green storage bottles to increase shelf life.   Old time darkroom workers blow into partially filled bottles and then quickly cap. The idea is, human breath is low in oxygen content. This is an unproven technique but it makes us old-timers feel better.
Let me add, the potions we use to process film and paper are very benign. The acids and alkalines are mild. The most prevalent odor is that of vinegar. If you are storing these bottles outside to protect your family from harm, you are exercising a super abundance of caution. Outside is OK provided these fluids are not exposed to high temperatures. Also, bright light should be avoided by the packaging.
Comment: Excellent.  To summarize: **Heat, Light, and Oxygen have a detrimental affect on the life span of Photographic chemicals**.  I use an inert gas, made for preserving wine in an open bottle, to displace the oxygen in my brown glass or solid plastic storage bottles.
Answer: The problem with photo chemistry is that it changes and becomes unusable. The rate of change is best controlled by limiting the amount of exposure to air and warmth.
Control the air by storing in the smallest bottle needed and making sure it has a good seal. Control for warmth by storing at room temp, or even better, in a fridge.
I'd say that, yes, you can store chemistry outside...as long as it's in a fridge, that happens to be outside ;-).


Why is the standard screenplay format just plain ASCII? Why don't use LaTeX or Word?

Question: I'm just curious. I don't know anything about screenwriting and I see scripts online have only one format and they are all plain text. Why don't they use LaTeX or Word? It will look nicer and the screenwriter can add images that sometimes can't be described by words.
Answer: There are a number of reasons why plain text is still fairly common in a number of industries.

Portability

Standard ASCII text files can be opened and written to by a staggering number of computer systems, to the point where you're going to be hard pressed to find a working computer that can't work with them at this point.
This remains surprisingly useful in the writing world in part due to the number of writers who work with rather oddball and legacy systems. [Try editing your friends fancy Office 365-2019 MS Word .docx file on an Osborne portable computer to see how well that goes...]

Reliability

Know what you can't mess up on while working in a format that offers no complex formatting or styling? - Formatting or styling...
I recently watched an MS word document eat at least ten employee-hours of a project's time due to someone accidentally copy-pasting styled text into a document that was being collaboratively worked on. This was in a highly technical and computer focused environment, which many writers often aren't a part of. As such formats and styles that are prone to generating technical headaches are going to remain avoided in industries that have no strong need for them.
Lower complexity files and formats are also at lower risk to corruption and error when passed between different systems. .docx is getting there, but it is still not free of risk of rendering or formatting issues when passed around between systems, especially if you're using newer or more complex features.

The editing/writing and reading headache factor

If you have no good reason to include fancy formatting, then why even bother with it? It takes more time and effort to do, and gains very little.
Consistency between documents is often far more useful than fancy layouts or flashy graphics - [There is also the viewpoint of: if you need to draw a picture, then the writing wasn't good enough.]
This is why we see simple Word docs with standardized formatting: They take less time to write, and are quicker and easier to scan through. [There is also a slight industry 'gatekeeper' effect as well: "If you haven't even figured out the standard formatting, then we 'know' you're not worth the time or effort to pay attention to." It is a weird bias, but 'humans are weird'.]
The last thing I need if I'm rushing final edits on a draft to share with a writing friend is to have LaTeX formatting go haywire on me because I made a minor typo...
[And remember, the only people who like LaTeX are LaTeX users... Everyone else sees them as crazy zealots who like to whip themselves with insane things like spelling things with alternating upper and lower case letters all for the sake of 'slightly prettier' text... The rest of us just say "Screw it, one font, one font size, and if needs more than dashes, quotes, or new lines, then it was probably a stupid idea to begin with..."] (Last bit was 'slightly' sarcastic and tongue in cheek)
Answer:
The screenplay format is a traditional format that was developed on typewriters before the advent of personal computers.
The traditional format has been preserved, because with the monospaced font and large whitespace one page of a script roughly equals one minute of screen time.
Unformatted texts are prevalent not only in screenwriting but in literary fiction writing as well, were many publishers and agents still prefer (but do not demand) typewritten-looking submissions because the formatting disctracts from the quality of the text itself. In fact, printing out unformatted text is a common recommendation for authors who want to self-evaluate their writing.
The format you found is not actually the only one. It is the American format that has become prevalent in many international film industries, but there are other formats, other screenwriting traditions, and they are still in use in places like Russia, China, and so on, and (even American) screenwriting software provides templates for many of these formats.
Answer: There's also a format called fountain, which is based on markdown, that can serve both purposes:

Preserving the typewriting-like style
Still be human-readable
While also be machine-readable without distracting too much
Answer: If you want to use LaTeX, there are a number of packages available on ctan.org: https://ctan.org/topic/drama-script .
Such packages enable you to:

format the printout or pdf in or close to a screenplay format using predefined macros
combine with other packages, like subfiles, to better organize files and parts
etc.

However, passing .tex files will only be useful when the recipient knows LaTeX, like some publishers do.
If you plan for exchange of scripts or files, it may be a good idea to think and talk that through beforehand. E.g. also using markdown approaches can cause pain, see fountain mentioned, pandoc and others.
Comparing Word with LaTeX, I'd prefer LaTeX with a good set of macros (\newcommand{ }). While Word can change formats, hence meaning, anytime, such macros open the opportunity for more consistent conversion of files, should that be necessary, e.g. via Perl, PHP, Python etc. Of course you can go crazy with LaTeX, too …

Let me add an example for those who are interested. I use package screenplay from ctan.org, which was published in 2006 and had its last update in 2012. As its manual states, it tried to get close enough to styles Academy Nicholl used (at that time).
Result:
Code:
I.e. just 33 lines created a two-page output after compile. A few words about the code itself:

the way you organize it, is up to you; adopting styles from programming, like indenting rules, won't hurt (see my demo for CLARISSA)
\documentclass{sreenplay} has all the macros and formatting
put relevant data first, in the so called preamble
\begin{document} and the typewriter is yours
all macros come from screenplay and are described good enough in the manual
I used comments, starting with %, to give some extra information
I deleted empty lines for short presentation: they don't hurt the compiler AND can improve readability of the code
colors depend on your ASCII editor; here it's IDE TexMaker, which I use with MikTex, which provides all latex-stuff
though the author discourages it, you can, as always in LaTeX, redefine macros via \renewcommand

Finally, here are the 33 lines-of-code for you:
\documentclass{screenplay}% this class provides all formatting
% ~~~ for coverpage ~~~~~~~
\title{A demonstrator}
\author{slim shady}
\realauthor{Real Slim Shady}
\address{Shadyville, UX\\Shady Drive 2322}
\agent{no agent}
% ~~~ so it begins ~~~~~~~~~~
\begin{document}
  \coverpage
Put plain text whenever with whatever needs to be said.

\fadein % ~~~ starting scene ~~~~~~~~
\intslug[day]{Johnny's house}
\begin{dialogue}{Johnny} After some description you would typically have some dialogue. \end{dialogue}
%
\begin{dialogue}[whispering]{Clarissa}
       After some description you would typically have \dots \paren{some dialogue}, don't you?
\end{dialogue}
\fadeout
% ~~~ next scene ~~~~~
\fadein
\extslug[day]{Johnny's garden}
\begin{dialogue}[glancing over his garden, thinking about something, heading for the next place]{Johnny}What if \dots?\end{dialogue}
\fadeout
% ~~~ next scene ~~~~~
\fadein
\intextslug[day]{Johnny's garage}
t.b.d.
\fadeout
% ~~~ c'est fini ~~~~~~
\theend
\end{document}

To add, I'd hide or absorb a few of the original macro-pairs in a dedicated macro, so I can write e.g.
\diag{Johnny}{frightened}{What is going on here? Do you think \paren{emphasize that} that's the way to do it?}

Answer: LaTeX is very difficult to learn how to use.
Most people are more comfortable writing in plain English than writing in LaTeX.
For example instead of writing The 16th of August LaTeX might require people to write, The 16^{th} of August.
Comment: The secret weapon is using \newcommand, i.e. defining your own shortcuts. Advantage: change in one place only, making it right everywhere as a result. // Arguments are similar when discussing reading sheet notes vs. playing music: it depends on what you want to achieve.


How to defend yourself when everything and everyone doesn't care/work?

Question: Is there a kind of "last resort" for self defense? I have gone to the authorities, other people, and they haven't cared that I was getting beat up. I weigh very little compared to my aggressors and I am normally outclassed (this is not a duplicate, as I just want the pain to stop, no matter what I have to do). I have learned several martial arts (aikido, JKD, Krav Maga, to name a few) and though my instructor says I am proficient I just get pummeled anyway. No one cares, nothing works, what can I do when I am in this situation!?!?
Comment: Describe the situation for us. And your age. This sounds like school bullying, which is a valid topic, but needs to be treated differently from street fighting in general. Also, switch to MMA. None of the things you mentioned training in will be particularly good at preparing you to actually fight than MMA would. And if you don't have MMA, seek out BJJ and Muay Thai, or BJJ and Boxing.
Comment: Just to check, did you post here previously under a different name? The situation sounds familiar, and I don't want to duplicate advice.
Answer: This is what you're not going to get from the dojo people, who view martial arts as a restrained, mannered, and honorable discipline.  That's the best view, but it takes a tremendous amount of hard work and dedication.  The ones who are good make huge sacrifices for their art.
The prize fighting enthusiasts understand martial arts even less. For them it's a sport—a way to prove their power, and maybe make some money.  But MMA is divided into two classes: champions and punching bags, and it's 99.99% the latter. The ones who didn't come from tough backgrounds don't understand the real world either.
What you're going to find across the arts is a lack of dimensional thinking, and an over-emphasis on applications and techniques as opposed to strategy and considered violence.  Violence is abhorrent.  It can feel good at the time, but it takes a toll on the psyche. People become addicted to pain and violence, and seek it out.  Many of them were physically abused.
Marines are a good example of fighters who understand the real world. Martial arts, applied in that field, is not a game or a sport or a mannered pursuit.  It's taught from the perspective of a life or death struggle. There's no guarantee you're going to win, but if you don't you're going to inflict as much damage as possible, with inhibition or restraint.

You need to make it understood that attacking your is not worth it

Your attackers see this as a game.  You need to convey to them that it is not a game to you.
Martial artists who reject this notion do so because:

They haven't experienced real violence, only controlled violence in safe spaces

Their understanding of the arts is shallow—they think it's about this or that art or application, not sheer determination and level of commitment

They don't understand that the decision to enter combat is a calculation, specifically a minimax calculation

I had a friend who used to carry a hammer in her purse because she had to walk in dangerous neighborhoods late at night.  She only had to use it once, and it freaked her out, but very few people want to get hit with a hammer.
I used to get attacked all the time because I was skinny and seen as an easy target.  I learned how not to be an easy target, and then how to convey that information.  I've had people twice my size opt not to fight, initially by conveying that I was willing to go to any length, and later via simple confidence.
The situation you are in is not good, and it doesn't sound like you have many options.

Find a real martial arts school with a teacher who understands the arts

Krav was designed to allow non-fighters like diplomats a chance to survive, and maybe get away, until help arrives. Resisting kidnapping was a main objective.  Not suitable for your needs, because no help is coming.
Aikido is like tai chi only—people are attracted to it because they don't like to fight, and they never test themselves outside their systems.  They don't train to strengthen their bodies sufficiently.  This arts on their own are too courtly and mannered.
Jeet Kun Do is not a martial art, but a philosophy, so those that teach it are generally frauds—Lee's prominent students like Inosanto had significant martial arts training before they learned Lee's MMA and way of fighting without form. Bruce Lee was talking about strategy, not this or that art.
Sometimes, if you show sufficient fighting spirit, your attacker will come to respect you, even if you get beaten.  I've even made one or two friends this way.

Note about real teachers: They don't hand out compliments to their serious students and tell them they're "proficient". Real teachers look at their students and are generally depressed, because they students have such a long way to go, and very few are going to stick with it and put in the time. Teachers hand out compliments to students who aren't serious about the arts b/c it's all about keeping up enrollments.  I think in 25 years my teacher told me I did something adequately perhaps 3 times.  And yet, I was tasked with teaching.  My teacher gave me special attention because of my commitment.  My si hings would give me brutal lessons on occasion demonstrate how unprepared I actually was, but they respected me because I kept with it. They didn't give those lessons to less arrogant students. I train harder today than I did when I was 25 specifically because I am never confident in my abilities. I always see myself as disadvantaged, but that can't matter. If you don't have a choice, you have to find a way to prevail.
Part of the point I'm trying to make here:

If you came to me with this problem, I'd send you to a teacher who specializes and whose credentials I know

Even if I taught for money, I wouldn't take your money.  But the teachers you've been going to aren't qualified, and are willing to tell you anything to get you to keep paying them to support their fantasy of being a master.


real or nominal GDP to compare to wage price index?

Question: The recent Australian budget projects trends over the next four years.  I'm looking at a summary here.  If I want to calculate the share of GDP going to wages, should I compare the percentage changes in the Wage Price Index to the changes in Real GDP or Nominal GDP?
Answer: Wage/labor share of income/output is total compensation of employees divided by total output (See Schneider 2011). This share is typically calculated using nominal wages and nominal GDP.
If you want to calculate wage/labor share of income/output then you should use total wages divided by nominal output:
$$ s_L = \frac{WL}{PY}$$
Where $s_L$ is the share, $WL$ are total wages (wages $W$ times labor input $L$) and $PY$ is nominal GDP (real GDP $Y$ times aggregate prices $P$). However, note it's not necessary to find statistics for $P$, $Y$, $W$ and $L$ separately most countries will track statistics for both $PY$ and $WL$ directly.
Note you cannot calculate it from wage price index alone. That is simply impossible. Wage price index only tells you how much wages risen over some period of time relative to some base point in time. That is insufficient information to figure out what was total compensation. In fact from wage price index you cannot even figure out what $W$ is, you can just use it to track how $W$ change over some period of time. And wage price index gives absolutely no information about $L$, so it is impossible to calculate the wage/labor share of income/output using only output and wage share index.


How can I prevent scope creep in my PhD project?

Question: I am a senior software engineer with experience in product management (which makes me addicted to proposing new features!). Now, I am an early-career researcher, and I am still looking at my PhD research as a product. This means I keep jumping between ideas and proposals, while the original idea (the big picture) is still the same one I started with. However, even after one year, I am still not clear about the scope. I am unsure about it. Any advice on how to manage this issue?
Comment: I'm in mathematics (at a research-oriented uni in the U.S.), so my experience may not be soooo relevant for you... However, with my PhD students, and in my own projects, it is actually _desirable_, and is inevitable, that with the information acquired along the way, the visible possibilities simply change. :)
Comment: @paulgarrett do you mean it is a feature not a bug (programmer's silly joke:)
Comment: A PhD that plodded along doing exactly what one originally thought would be very boring.
Comment: @AdhamEnaya, haha! Yes, definitely a feature, not a bug. :)
Comment: This seems like a question for your advisor. Set a scope with them and do enough for the degree. You can fly free thereafter.
Answer: To expand on my comment, which is to do "enough" for the degree and move on, let me suggest the following.
Keep a notebook. My preference is a set of notecards, actually that are originally sparse, but which can be revisited. When you get a flash for something that might be added to your project, just make a note of it in the notebook (leaving room for later edits). This is your "future work" cache and can later become the "work in progress" agenda.
Set a scope for the dissertation with the advisor and stick to it (as much as possible/appropriate) and spill the rest into the notebook.
When you finish the degree you have a lot of ideas that might be followed up, which is always a benefit to any academic.

It is a good idea to also review the notebook periodically to see if anything might be added without disturbing progress on the main line too much. That is why I like notecards. They can be carried and quickly annotated. Search here for "Hipster PDA" to read more on this idea.


Multiple writes in a relational database

Question: I'm pretty sure that with a relational database, it's faster and better to read 50 records at once than to make 50 calls for one record each. Is there a performance benefit from performing multiple writes all at once? If not, why not?
Comment: Performance aside, you'd be wise to do logically connected writes in a single transaction so if the last insert fails you can easily roll back the entire operation and not leave a bunch of orphaned records.
Comment: Agreed. I'm just trying to get a better sense for "how long things take" and where, in general, you can look when you need to scale your DB.
Answer: Probably depends on the RDBMS and the storage engine, but at least in MySQL/InnoDB, multiple writes in one transaction (as well the multi-insert syntax, which, afaik, is MySQL extension) allows you not to update non-unique indexes before transaction is commited, and the update of the index happens at once with all new values (since it's a b-tree, in this way its much faster). It's possible that RDBMS optimizes other writes as well, to have sequential instead of random writes.
Also, if there is a table-level locking (as in MyISAM), locking the table once, writting multiple records and then unlocking removes the overhead of lock/unlock for every write.
So generally, there is performance gain, but it depends on the database server used.
Comment: fwiw, multi-row INSERT is standard SQL.
Answer: Doing all your reads at once makes sense, although there are some problems in it which I'll touch on in a minute.
Doing all your writes at once poses a particular problem: the data is in the database until you put it there. If you're waiting for some optimization threshold (let's say 50) then transaction 1 is going to have to wait for (unrelated) transactions 2-50 to complete before it goes to the database. This means that in the mean time (which could be several [seconds, minutes, hours]) nobody knows what those records are, or if they're updated what the new values are. (Same with reads but the other way around. Your data may be out of date by the time you get to use it.)
Performance wise, I cannot imagine that combining writes closer together would not have some performance. (IF that was confusing to read, I meant "You should always get a performance boost by grouping.") If nothing else, you have a better chance to hit memory caches instead of disk caches than if you do them separately. @Darhazer brings up a good point about locking. So strictly from a total-time-spent-writing point of view, it would be better to group them. From an application performance point of view, it's difficult to say without an intricate knowledge of the business requirements of the app.


Are there instructions in OT , specifying guidelines on maintenance of tombs?

Question: In Matt 23:27, Jesus equates Sadducees and Pharisees to whitewashed tombs. Before the advent of long- lasting tombstones ,  the tombs , mostly formed of mud, used to be whitewashed and decorated with flowers on special occasions . Poor families which cannot afford to pay for permanent tombs, still have the tombs of their dear ones whitewashed, in many countries. That the practice was prevalent at Jesus' time indicates that Jews had been following it since long. My question therefore, is: Are there any instruction in the OT,  which deal with maintenance of tombs, especially whitewashing ?
Answer: I am not aware of any stipulation for tomb decorations within the Mosaic law.
If we take a similar versus from Luke 11:44 this might help,

"Woe to you [Pharisees], because you are like unmarked graves, which people walk over without knowing it."

I believe the rationale is an extension of Numbers 19:11-13:

11 "Whoever touches the dead body of anyone will be unclean for seven days.
12 He must purify himself with the water on the third day and on the seventh day; then he will be clean. But if he does not purify himself on the third and seventh days, he will not be clean. 13 Whoever touches the dead body of anyone and fails to purify himself defiles the LORD's tabernacle. That person must be cut off from Israel.

The penalty is severe cut off from Israel. Therefore, accidentally touching the tombstones could represent some form of touching the deceased.  It could also be they physically touch the deceased if the tomb collapses and would be problem in the Mosaic law. Given the nature of the penalty it is better to alert everyone to the presence of a tomb, by whitewashing it.
In your context the idea is that the dead body is unclean, whether it is a skeleton or recently deceased individual. This was analogous to the Pharisees being beautiful tombs. They probably looked fantastic and kept impeccable ritual. However, they would ultimately pay blood-money for Jesus betrayal, then get a man convicted of murder spared the death penalty for the singular purpose of a massive miscarriage of justice by crucifying Jesus, who was the number 1 threat to their power-base.
I would suggest their behaviour was a violation of at least 3 of the 10 commandments, "Do not murder", "Do not give false testimony", "Do not covert". Therefore, they were like dead bodies in a beautified tomb.


Is there any dedicated IR receiver IC with atleast 5 output pins

Question: I want  to know if there is any IC available that can decode an IR remote to its different pinouts  or I have only option to program a microcontroller to achieve it.
Comment: What do you mean by "different pinouts? Can you clarify what do you mean? Surely some IR decoder chips exist or at least have existed in the past, but they might have been preprogrammed MCUs anyway.
Comment: If you mean "five output pins" that's vastly different than "five pinouts".  A chip's "pinout" is the **pattern** of pin assignments -- i.e., what's pin 1, what's pin 2, etc.  Having the same chip function with different pinouts -- at least in the same sized package -- is not at all common.
Comment: why do you require a 5 pin configuration?
Comment: @TimWescott Yes you are right. I mean 5 output pins. Correcting my question.
Answer: Seemingly you expect something which has 5 separate outputs which can be activated one at a time by pressing buttons 1...5 on an IR remote controller.
The others have tried to say that this is possible, in theory such IC can exist. But you must have a remote controller designed just for that IC. Generally the codes used in remote control systems are complex and everyone is different. The code contains some identification of "who is sending", the wrong sender is ignored. Then there's the code of the wanted function, maybe only the number of the pressed button and finally some calculated redundancy data to detect and fix transmission errors. Everything can be encrypted to make 3rd party devices more difficult to make. Big entertainment electronics manufacturers such as Sony have licensed their coding systems to others. They can bill say $10000,- for the code details.
You may find an IR receiver which generates computer compatible raw serial data output from the voltage that an IR photodiode catches. But a programmed computer (=microcontroller) is needed to decode the raw data and launch the wanted operations. There's numerous "IR remote decoder" projects presented in the web. Search for them.
Finally some preprogrammed chips to decode some known IR remote coding exists. Here's a link to one story of one chip https://www.voti.nl/ir-3/index_1.html No idea is it really available and does it work. I wouldn't believe such articles if there's no direct manufacture's data available which shows the system is properly constructed.
Also chips for remote controllers exist. Again: No idea of the availability https://www.infraredremote.com/RS117.htm
Comment: Yes ir3. This is what I was looking for. Thanks
Answer: There is such a wide range of needs for IR remote control that there are very few or probably zero devices that receive and decode IR remote control signals.
You will need to do it with a microcontroller.
Do you have an IR transmitter?


Dynamic Languages and Variable Allocation

Question: How does a dynamic language decide how much memory to allocate for a variable?
eg. How does the compiler change variable= 5 to variable ="xxx" without too much memory overhead? When does it use the hardware stack and when does it use the memory heap?
Answer: The compiler allocates enough memory for each variable to hold a pointer plus whatever metadata the language runtime requires. But I think you mean to be asking how much memory is allocated for each object. In that case the answer is that it depends on the type of object. When a variable gets assigned to a different object, the pointer associated with that variable changes what it points to.
Answer: The answer, of course, varies by language - both the hosted dynamic language and the lower-level implementation language.  That which applies to Perl does not necessarily apply to Python, nor does what applies in Tcl apply in Java or LISP or ... well, do they count as dynamic languages.
In Perl, there's a C-level structure that goes by the name SV (scalar variable) that contains different storage for different versions of the variable's value.  These often heap-based; the storage for strings always ends up being heap based, though a pure numeric value that has never been converted to string might be in an SV that is strictly on the stack.  In Perl, these things are reference counted (and mortalized, or immortalized, and all sorts of other interesting terms).  More complicated types (AV, HV, RV, etc) are based on SV.


How Can I Use AirPlay Globally for System Sound?

Question: Is it possible (and how) to have all the system sound played on AirPlay? Or at least for some specific (random) application (e.g. Songbird)?
Comment: This question now has an answer here: http://apple.stackexchange.com/q/117643/60998. The question is not quite the same, but the accepted answer applies :-)
Answer: What you want is AirFoil by Rogue Amoeba. Plays any audio from your system via AirPlay.
Answer: If you have a newer Mac with Mountain Lion you can also use it's built in AirPlay functionality.
Go to System Preferences->Sound and select Apple TV from the Output tab. This will play all system sound from your Mac.
Answer: An easy way to do this in Mountain Lion is to hold down the option key and click on the speaker icon in the menu bar. You then get a list of possible outputs, and will be able to send all audio to your Apple TV or other AirPlay device by selecting it.


Can I change an existing Cartodb map to use a different dataset?

Question: I've created a map with lots of layers and info box info and sql codes, but now I need to use a different dataset from the one I was originally using. Is there a quick way to just swap out the dataset (all the fields are the same)? I haven't been able to find it on any of the documentations on Cartodb.
Answer: There's no official way to do this, but there's a trick you can use.
Add the new dataset you want to use as a new layer. If you need to copy the styles of the previous dataset, you can just copy and paste pretty easily in this view.
Now, delete the old dataset layer. This will just leave a single layer with your new data, and any changes you have made to the map itself such as adding elements, configurations, or metadata will remain. Also, with this approach you still have the same map with the same map id, so if you shared it already it will continue working!
You could also change the SQL query in your current layer to point to the new dataset, but this could point to confusions in the future and perhaps you can end up deleting something you don't want to. :-)
Comment: I thought about doing that, but then I was worried about other links the map may have with the old dataset, since I'm not sure in the backend what's linked and not linked?

Sorry for the late response. When I clicked on my profile, it said 0 answers to my question! Thank you for your help!
Comment: When you work inside the same map the ID of it doesn't change, so the links won't change. The old links that you might have shared will point to a specific map, and the layers that you have or don't have in your map are independent of that :-) You can always do a small test with another map if you want to be sure that you understand the behaviour.
Comment: I have the same issue; a dataset in a map which I would like to be able to update weekly without having to re-set the zoom-level opacity for labels or fills/lines and custom HTML colours outside of the ones in the CartDB colour picker.  I have found that I can copy the customized CSS html and paste it into the new layer, but some things don't seem to take.  a "replace dataset" button in the datasets window which retains links to maps using that dataset would be a great feature for CartoDB to add!
Comment: Copying the CartoCSS, even though it might seem that the CartoCSS contains the names of the tables to render won't switch the table. You can change the SQL of your layer for it to get the information from other table. By default, the query would be SELECT * FROM your_old_table, but you can change it by SELECT * FROM your_new_table. As far as the columns and types match, the map will keep working with your current styles. Otherwise, unexisting columns or types that don't match with your old data might break your styles.


Controlling darkroom chemistry temperatures automatically

Question: The temperatures in my house fluctuate wildly. I spend a fair amount of time before printing just bringing my chemistry to temperature. Are there any automated solutions or aids that help with this? I'm imagining an incubator rack where I can insert 4 1-liter bottles of solution and come back an hour later to find them all at 68F.
Comment: We're talking about chemicals for printing, not film developing, right? For printing, temperature isn't very crucial since paper develops more or less to completion in a few minutes time. For cooler temperatures, you should be able to add time and achieve the same result. Is your aim to avoid having to do this? Temperatures of the other baths should matter less.
Comment: @bvy This is for printing, yes. I've been focused on learning to develop negatives for a while, so maybe I'm over-focused on temps for printing. I am someone who works best with fewer variables though, so working with the same temperature all the time will help me achieve more consistent results.
Answer: I just googled for 68 F hot box to see what came up and I was surprised to see that home brewing may also be your friend here.
From the first random link I saw 9 Devices That Can Heat or Cool Your Fermenter

When it comes to fermenting, temperature is one of the most important
  steps towards happy yeast.
Ale yeast is happiest at 68 to 72°F, while lagers usually perform best
  at 45 to 55°F.

I followed a link to Amazon from that article and found: Inkbird Pre-Wired Dual Stage Digital Temperature Controller Outlet Thermostat 110V, 1000W Heating and Cooling for Fermentation Kegerator ect which costs $35.  Which could be the basis of a home built system for you.
So while I don't have a specific solution, looking at other hobbies that require temperature regulation will open up a bunch of different potential solutions.
Answer: I've been looking at this today and the new solution seems to be a suitable vessel (one of those plastic stacking storage bottles would probably be ideal) and a sous vide wand - lots of photographers are reporting that they are simple, fast and highly accurate in maintaining temperatures.
Answer: Adjusting and keeping the chemicals of the process is a challenge faced by every amateur darkroom enthusiast. Best is a water bath. Procure a plastic pan large enough to hold the bottles. It wouldn't hurt if there is room for the developing tank. You place the chemical bottles in the pan filled with water. The water level should be deep enough to half submerse the bottles. Now add hot water or ice to this water bath. The idea is to bring the solutions in the bottles to temperature. Once the temperature of the fluids are adjusted and checked, you can start the developing sequence. Load the film onto the reel in total darkness and place the film in a lightproof developing tank.  During the developing phase, you park the developing tank in the water bath; this keeps the fluid inside spot-on.
Throughout this darkroom regimen, you regularly check temperatures. You can simply add hot water or ice to the water bath. If you will be doing this on a regular basis you can get more elaborate.  You can install a thermostatic mixing valve on your incoming darkroom water line. These are expensive but worth the money. You will need a darkroom that has a working sink. You run tempered water into a pan that contains the bottles. Also, chemical laboratories frequently use a water bath. You can purchase an inexpensive electric water bath tray; check the web or find a chemical supply house. This tray uses a submersed electric water heater with a thermostat. Luckily, most color processes call for elevated fluid temperatures. This is no accident; setting the processing  temperatures high avoids the need to refrigerate the solutions.
If you need to adjust a fluid temperature quickly, use a plastic baggie filled with ice or hot water. You dunk this into the fluid, the baggie method keeps the temperature adjusting fluid contained so the chemicals are not diluted.
Comment: my question was about printing, actually. Maybe that wasn't as clear as it could be. Does your advice stay the same?
Comment: The chemicals are brought to the desired temperature using a water bath. Trays that will hold the chemicals are on the bench empty. When ready to process, pour the chemicals into the designated trays and proceed. When the developing of this batch of prints is complete, return the fluids to their containers in the water bath. This is a batch process. Inexpensive water bath trays are available from most chemical supply houses -- look at Edmunds Scientific.
Answer: They are pretty standard items in most labs... The problem is that they usually cost a fortune. Many of them have a hose and pump that allow you to circulate the cooling fluid (in your case, water) through some other apparatus or larger container. E-bay has some here. If you're into do-it-yourself, I'd suggest looking at thermoelectric coolers such as this. It can heat or cool contents depending on the polarity of the 12V power source. A cheap temperature controller such as this coupled with an 'H' bridge controller such as this or this. Some learning will be involved.
This is probably overkill for your application. A mixing valve like this might be better for you if you have a source of hot and cold water available and are willing to do some plumbing.
Answer: Try Jobo Color Processor or Jobo Tempering Box. New they used to cost a fortune (and I am not sure they are made new anymore) but they occasionally come up on the well known auction site.
Comment: Thanks, this is exactly what I was envisioning. Pretty dang pricey, you're right.
Comment: These were mainly used in the professional color business, where every degree counts and the costs were borne by the client. B&W printing processes are more forgiving. Also check out the Nova Print Processor - https://www.theimagingwarehouse.com/ProductGrp/Nova-FB-Print-Processor - these slots come in cheaper unheated and more expensive heated versions. They are pricey too, but super extra fun to use - you keep your chemicals there for months to end (replenishing your developer of course) and just pop into your darkroom for a quick print or two. No hassle with filling up and emptying trays.
Answer: For black and white applications, such a device might be overkill. Film and paper develop over a range of time/temperatures combinations (unlike color applications where time and temperature are crucial). It might be best to adapt your workflow to ambient temperature. But a water bath will bring your chemicals to temperature quickly. For long print sessions, you might consider a solution like floating trays in a large water bath (like a large sink) if your work area will accommodate it.
Answer: For my black and white processing I use a large washing up bowl half full with water. A 100w aquarium heater/thermostat and a separate imersive digital thermometer for accuracy.
Our darkroom setup is in the garden and can be quite cold at times. 20mins standing in the heated 20C water keeps the chemicals just fine.
I stand the film container in there too between agitations.
Once done, the water is reused to mix chemicals for the print trays.
Works a treat. All available via Amazon for £25.
Answer: One option is exploring thermostats for aquariums:
https://www.google.com/search?q=aquarium+thermostat
I can not recommend a specific model or brand, but it is an idea.
As all electric gear, disconnect it before putting your fingers inside the water.