Dynamic Time Warping (DTW) for time series with different step sizes

Question: Is it possible to use Dynamic Time Warping (DTW) algorithm as a method to find the similarity between two time-series data that have different step/measurement sizes? For example, one is measured every hour and the other is measured every day.
Answer: Yes, first DTW allows to match several timepoints from one sequence to a single timepoint of another sequence. Second, if some implementation, which you use, does not allow for this, you could simply interpolate one of ypur timeserieses to match timestep of another.
Comment: Thanks a lot. I am now thinking about 'units of measurements'. For example, the data points in a time series are measured based on 'megawatt' and the other one is in 'kilowatt'. Is the DTW still applicable? I mean without unit conversion.


what to learn to write a comprehensive strong paper?

Question: to write an excellent comprehensive paper, what topics and techniques must an economist learn? One of my former professors wrote a paper I read, there are theories, calculations, and empirical tests. As far as I am concerned, general equilibrium calculations were used, and time series analysis was also used. On the other hand, what skill set is necessary for mathematical modeling in a paper? I try to make a list, -DSGE,-GE -time series analysis, -RBC, and -intermediate game theory are on my list now. Apart from focusing on micro or macro, to write some comprehensive papers, what tools are necessary for an economist or what do you recommend to learn... thank you
Answer: This depends on exact subfield or even topic you are interested in. For example, there are people who only work on theory, and there you only need strong math background and nothing else. If you work on applied economics you don't need as strong math background but you need good programming skills.
Generally speaking:
Theoretical Work
Requires very strong mathematical background, regardless whether we talk about micro or macroeconomics.
In macroeconomics there is probably slightly more focus on differential equations than in micro but you still need it for micro.
Important areas of study are:

Linear Algebra
Advanced Calculus (e.g. multivariate calculus, calculus of variations...)
Differential Equations
Control Theory
Topology
Real Analysis
Set Theory

This list is not exclusive, but note depending on what topic you work on some of the above are not as important. For example, if you wanna work on DSGE models you don't really need to know set theory. However, in micro set theory can be important.
Applied Work
You don't need as strong math skills as for theoretical work, but you need to be familiar with programming in R or Python or at least know decent programs like Stata at very least. You still need to know some of the math above but not so deeply as for theory. For applied work you mainly need:

Linear Algebra
Advanced Calculus
Statistics & Econometrics
Strong Programming Skills (preferably R or Python)
Good Database Skills

However you should still understand enough of the math used in theory in your field to be able to test some theories unless you want to just be purely applied economists, but best empirical papers usually refer to some theories.
Numerical Modeling
Here you need similar math skills to theoretical work plus:

Discrete Math
Good Programming Skills (however here mainly in Matlab, Octave, Python or Julia)

However, again you don't need to know everything above at the same time, it depends on what topic exactly you want to write paper about.
For example, in applied work, time series analysis is mostly important in macro and cross sectional or spatial analysis in micro with panel data analysis being somewhat important in both.
Comment: For theory "you only need strong math background and nothing else."  Why do you think so? Asking for a friend,
Comment: For applied work, I would emphasize econometrics over programming, though it depends on what one means by strong programming skills vs. strong econometric skills.
Comment: @MichaelGreinecker well what other skills you need for pure theory paper? I suppose you could add good interpersonal skills (for coauthors) and good writing skills.
Comment: @RichardHardy I would say they are equally important. Knowing properties of various estimators is not helpful if you don't have a way of actually carrying out estimation.
Comment: @1muflon1, if that is what you call strong programming skills, then by all means they are needed. But it seems to me the programming skills needed to carry out estimation can be acquired quite fast, unlike a decent understanding of econometrics.
Comment: @1muflon1 Economic intuition? Knowledge of the relevant facts? Sometimes knowledge of philosophy, linguistics, computer science,...


JQuery slider change wait half a second before executing

Question: I'm using a JQuery slider for altering some get values of an ajax request. Whenever the the slider changes, it sends a new request with the new values. However: the slider updates it changes too fast. So when I slide it and then drop it somewhere, it sends multiple request at intervals of values I crossed during the sliding. So for example, if I move the slider from 5 to 10, it sends out a request for 6, 7, 9 and finally 10. And it then takes 4-5 seconds to finally update the content to 10.
Is there a way that I can set if, for example, the slider has been on that value for half a second, only then it will make the request? Or do you guys have other solutions?
Thanks in advance!
EDIT: this is the code I'm using:
$("#slider-range").slider({
range: true,
min: 0,
max: 5000,
values: [ 0, 1250 ],
slide: function( event, ui ) {
    refresh();
    }});

And refresh() sends the request and updates the DOM
Answer: Without showing us some code, you probably have an event bound on the change event, there is however a Stop event available.


Why don't unions negotiate members-only contracts in right-to-work states?

Question: How unions are generally formed is that the workers at a company take a vote, and if a majority vote for collective bargaining, then all the workers get represented by a union in negotiations with the employer.  And  many companies negotiate with the union and make an agreement where all employees have to be members of the union and pay union dues as a condition of employment.  Some conservative states, however, pass what are known as "right-to-work" laws, which prohibit employers from requiring union membership and dues as a condition of employment.
This creates a problem for unions, because unions spend time and money negotiating a contract for all employees, and employees get the benefit of higher wages and better working conditions regardless of whether they're actually paying dues.  So we basically have a collective action problem: employees have no incentive to pay dues, because they can just freeload off of other people paying dues.  Thus the rates of union membership in right-to-work states are dramatically lower than in non-right-to-work states.
To the extent that changes in working conditions impact all workers, there's nothing that unions can do about this, but concerning salary and health benefits, why don't unions take advantage of the provision in the National Labor Relations Act that allows them to negotiate members-only contracts?  This is where the contract negotiated by the union only applies to dues-paying union members.  This way, people won't have an incentive to avoid paying dues, because then they won't benefit from the union contract.
As far as I'm aware, pretty much no unions in right-to-work states negotiate members-only contracts.  Is there a reason for this, like legal or logistical obstacles?  Would there be disadvantages for unions if they did this?
Comment: If an employer requires union membership, isn't it likely the union is in the pocket of the employer. I can't see many employers actively requiring union membership unless it's a political boondoggle which actually ends up disempowering the workers. Certainly that's how I've seen it work here in the UK...
Comment: @PeterDavidCarter Unions can be great for companies that don't have the ability to negotiate with each employee for each thing on the contract. When unions and employers work together, both the company and the workers end up better off.
Comment: @DavidRice just to be clear, I started a trade union at an old job and took the massive career hit that resulted. I'm now back on track and completely agree with what you say, though I also believe that truly great employers don't need trade unions to understand their employees are just as important as their customers.
Answer: Unions can negotiate member only contracts if they want, but it wouldn't really help them at all. They have no power to say what non union members would be getting and non union terms are basically guaranteed to be the same or better than what the union can offer, because anything worse can be opted out of by joining the union. Therefore, the best possible case for unions is to get identical terms as non union workers, and really sell the idea that the union is the only possible way to get any future improvements.
Comment: And considering union dues, the salary for non-union members would be effectively higher than union even if it was the same outlay for employers
Answer: Because unions can't unilaterally negotiate terms and conditions for non-union members.  It's an agreement between employer and organized workers, and with the addition of the employer setting the wage level of the non-negotiated employees. The employer would have to want to not match the pay for the other workers, which is not up to the union.
So, basically, the premise is that the unions would say "we're only requiring you to include our represented workers at this wage," AND the employer turning around and low-balling everyone else with compensation policy.
If the premise is that employers can save money by not paying union wages, then this is, interestingly enough, a self-destructive long-term strategy, to pay less to the non-union workers.
Scenario #1: Union wage is negotiated, non-union members get paid less.
Results -

Non-union members are unhappy with employer
Non-union members see a very tangible benefit to union membership
Formerly non-union members sign up to get those benefits
With greater numbers and loyalty, the union is stronger
The union has greater leverage with which to negotiate better deals
Rinse and repeat until it is nearly an all-union shop, with much higher union pay levels than if they did not have the strength of membership they gained, and there is pretty much no one else for the employer to pay a lesser wage to.

Scenario #2 - Union gets wage levels set, employer matches the deals for non-union members.

Non-union members, getting paid as much, see no benefit to joining the union, since they get the benefits for free.
Less of the union membership sees a benefit to paying dues, since everyone gets the same wage.
Union membership wanes at this company.
Union has less leverage and clout with which to bargain.
Subsequent deals see the employer being able to offer much less in compensation and other concessions than they might have with a stronger union.
With smaller negotiated packages, union members see even less benefit to paying dues.
A cycle sets in until the union is either toothless, or gone, entirely, with the employer getting to dictate wages as they please, saving huge money in worker compensation.
Answer: If a union negotiates for members only benefits, non-union workers doing the same job at the same place of employment would cost less. This creates an incentive for the business to hire non-union labor for those positions, arguing union members out of a job. While there is a loss because the non-union labor doesn't pay dues, the union still enjoys a net gain overall.
Answer: The appropriate law governing such things is the National Labor Relations act. The only provision of the entire Act that refers to majority representation is Section 9(a), which is a conditional provision that specifies that if and when a union represents a majority of the employees in an appropriate bargaining unit it automatically becomes the exclusive representative of ALL the employees in that unit.
Therefore "members only" agreements refer to "minority representation" or less than a majority of workers. Believe it or not unions would welcome such an occurrence. It is the companies that are steadfast against these agreements. First, since it involves less than a majority elections would not be required. Second, companies who do not wish a union presence fear this type of agreement because it establishes a union presence which could eventually lead to majority representation. Finally, although the Supreme Court and the Board long ago validated minority-union contracts that resulted from pre-majority collective bargaining, there has never been a case reviewing the enforceability of the right to engage in such bargaining.
While the concept of "members only" agreements has been established by legal precedent the implementation and enforceability in the real world is far from clear.
Answer: Philosophically, a members only contract doesn't mesh well with the union ideal of collective action in the workplace that benefits all workers. Practically, members only contracts are unlikely to gain much through collective bargaining as the leverage is so much less without a substantial portion of the workforce participating in the union and the economic disadvantages for dues paying members will probably outweigh the advantages under the contract, so few will be enticed to join.
It's a chicken and egg problem in that it takes a good existing contract to draw new members, but negotiating a strong contract takes a preponderance of support. Going with the traditional workplace-wide union benefits the most people, and the free rider problem can be combatted by making the connection directly with real contract gains made possible by strong union negotiation.
Comment: @SJuan76 "would force to reveal union membership" -- is union membership secret?
Comment: Philosophically, members of trade unions that are active (and assume the lost wages of strikes and the risk of employer reprisals) would grab all of those employees who play "hide and wait" while smiling at their boss, put those in a bag and toss the bag into a river. Those employees weaken the negotiating power of those workers who challenge the employers. Unfortunately, "members only" agreements will mean a competitive disavantage to union members and also would force to reveal union membership.
Comment: @CarlG Absolutely. Think I am more focused in the European system, without *union shops* and the like. Union membership can mark you as a *troublesome* employee that might ask for his rights to be respected or even (shock!) use his rights of participate in strikes. In a work environment it is not that difficult to guess who is more active in defending his rights, but making union membership publicly available could mean discrimination to get hired. Union membership can only be recorded (e.g. database) if there is an absolute need to do so, and those records become automatically confidential.
Comment: @SJuan76 the *European system*? I believe a such doesn't really exist - I think it is very individual from country to country how this works. In Denmark for example, no one hides their union memberships, because it is extremely common to be in one, almost regardless of your trade; where people traditionally are in a union that represents their trade (e.g. Nurses, Police, Finance, Electricians, Carpenters etc.). Some Unions are very broad in terms of who they represent, some are very narrow. It is very unlikely here to be discriminated because of union memberships.
Answer: Since unions are required to represent all employees, (including non-union workers), in right to work states, why can't the union negotiate terms that place non-members in a lower pay-scale than members of the bargaining unit? Example:
Union factory workers make $20/hr.
Non-union workers make $16/hr.
Susie Union makes more money than Johnny Nonunion doing the same job, but He still has the "right to work".
Comment: From the company's point of view why bother paying non-union workers less, if they could just join the union and instantly increase their salaries? I is harder to administer and will in the end probably end up with the company having to pay equal salary regardless. Why not just do it from the beginning? The union cannot force the company to pay non-union workers less.
Comment: As an anecdote, I worked for a company that originally had several unions involved, depending on department.  Overtime, the unions were voted out, as the benefits provided to the non-union employees were generally better than what the unions had bargained for.   I believe one of the final straws was when all of the non-union employees (salary and hourly) were given a substantial productivity bonus.  The company offered to grant the bonus to the union employees as well (even though not contractually obligated).  The union declined the offer.


Question about units and electric field equation?

Question: So the electric field is defined as having units of newtons per coulomb. I dont understand the concept of like a unit test charge. I understand that multiplying the electric field by the test charge cancels out units but I don't conceptually understand the units. I get the concept intuitively. It's basically saying that if you introduce a positive test charge to some point P that depending on what type of charges are around that you will have some sort of vector with both magnitude and direction going away or towards that test charge. Is newtons per coulomb basically saying that we have no idea what the charge in the area actually is but once we find it out that we can figure out the magnitude?
Comment: It's force per unit charge E=F/q since the Coulomb force is F=Eq=kQq/r^2. It does not matter what the value of q is. What is it that you are not understanding? You need to explain a little more.
Comment: I don't understand the phrase "you will have some sort of vector with both magnitude and direction going away or towards that test charge".   What does that vector represent to you, the E field due to the test charge, the E field at the location of the charge, or the force on the charge?
Answer: Given a configuration of charges, what would be the force on an arbitrary charge placed at some point $P$? It would depend on both the position of $P$ relative to all source charges (and their charges) as well as the charge of the particle we are trying to calculate the force upon.
Lets replace our initial charge at $P$ with some other charge. What would be the force now? Would it be wise to repeat the above calculation again, one charge pair at a time?
It seems redundant to calculate the force on the new charge by going through the entire procedure again. From Coulomb's law we know that the force must have increased proportionally for every source-'new charge' pair. Also, with superposition, that implies the total force on our new charge has also increased proportionally. So, the effect of changing just the charge at $P$ while keeping the source config. same was to increase the overall force proportionally.This implies that all the information regarding the source config. is contained in something that is independent of the charge at $P$ since it was the same for both our cases. Also this "something" must exist at every $P$.
This charge-at-$P$-independent something is called the electric field. To make it independent of the charge-at-$P$ aka test charge, we simply divide the force by it - this leads to the definition:
$$\vec{E}=\vec F/q_{test}^1$$
Thus the benefit at this stage is that by defining the field we can calculate the force on any charge.
But their is an additional advantage. By dealing in terms of only this construct of field, we need not bother ourselves with what generated that field. As mentioned, all the information regarding the individual influences of source charges are included in the field.
While the mathematical expressions for the field of the point charges may seem trivial sums of their individual formulae, the field first point of view allows one to predict the behavior of test charges  in arbitrary electric fields even if we don't have a model of the test charges that produced it.
The point of the electric field is to define it everywhere and then forget about the rest.

In the above discussion, the field may seem a mere syntactic simplification to make calculations easier. But the field of any charge
is as real as the charge itself. It reaches out and touches others. It has energy and inertia. It can carry currents posses impedance and create and destroy particles. The notion of fields is of fundamental importance in physics.

$^1$ Since the field is test charge independent, we might as well take it to be unit or $1C$. The field then becomes numerically equal to the force.


Can a body escape a black hole by being thrusted?

Question: I am told many time that nothing can escape black-hole because black-holes escape velocity is more than speed of light. But we know object don't necessarily have to exceed speed of light to escape a gravitational body. Rockets can escape earth with lower than escape velocity if  constantly thrusted. In the same way would it be possible to make an object cross event horizon from inside by constantly pushing?
Comment: It's all about space and time and what is the direction forward in time. A roughly equivalent question would be "can a body travel backwards in time by being thrusted?"
Comment: Not directly related to your question, but you said, "Rockets can escape Earth with lower than escape velocity if constantly thrusted." That depends on what you think "escape" means. Some might say that the rocket has not "escaped" from Earth unless you can turn off the motor and it doesn't fall back. But if it doesn't fall back when you turn off the motor, then that means that it _is_ moving faster than escape velocity. [Note: escape velocity is not a single number. It's a _function_ of distance from the center of the gravitating body. The further out you get, the lower the escape velocity.]
Answer: The quick answer is no because time and spatial coordinates twist roles. As well as you can only move in one direction in time (forwards), inside a black hole you can't go backward in the radial coordinate. Looking at the invariant arc length of a static and spherical black hole, neglecting angular motions (Schwarzschild-type):
$$ds^2 = -\left(1 - \frac{r_s}{r} \right)dt^2 + \frac{dr^2}{1 - \frac{r_s}{r}},$$
where $r_s$ is the event horizon radius, we see that for $r<r_s$ the temporal coordinate pass to be positive whereas the radial coordinate pass to be negative:
$$ds^2 = \left|\left(1 - \frac{r_s}{r} \right) \right|dt^2 - \frac{dr^2}{\left|1 - \frac{r_s}{r}\right|}, r<r_s.$$
Time behaves like space, and space behaves like time inside a black hole.
T.
Comment: Thanks , But didn't understand the equation as I have just finished Highschool physics. But I did understand that the answer is No
Comment: Maybe, I have been too technical. The point is that the special fact about time is that it must preserve causality, this means that there is a privileged direction of time flowing: from past to future. Whereas for spatial coordinates there isn't this type of constraint, you can go from right to left and vice versa. Inside a black hole, space behaves like time and time like space, implying that an observer does not have any other option than falling forward: from the event horizon to the singularity, as well as out of a black hole an observer does not have the option of going backward in time.
Answer: A less technical answer: a black hole is defined as an object that has a horizon from which nothing can escape from the inside to the outside. This also holds for light, which is the fastest anything can move. So the answer to your question is: no, nothing can escape.
So a black hole is an object very different from any other massive object in our universe.
It is all well and good to define a blak hole in such a way, but the question then is: do black holes really exist? The answer to that question is a clear yes. General Relativity predicts their existence, and maybe even more fascinating, black holes have been observed by astronomers.
If you want to understand technically why that is the case, the best thing you can do is study physics at university. Mind you, General Relativity is not something they will teach you in the first few years.
Disclaimer: a black hole is a concept from classical physics and my answer is valid in that framework. If you consider quantum physics then there is something called Hawking radiation, which says that light can, in fact, escape a black hole, albeit in such a small amount that it can probably never be observed (and that is even further down the physics curriculum). It is also fair to say that a fully fledged consistent theory of general relativity and quantum physics is lacking so you may still be able to contribute to a complete understanding of black holes as a future physicist.


Why does dispersion of light behave in the opposite way for diffraction compared to refraction?

Question: When blue light is shined through a diffraction grating it bends less than a longer wavelength, let's say red light. The shorter the wavelength the less it is bent by diffraction. When the same procedure is performed by passing the light through a medium, let's say glass, the opposite is true. The blue light bends more than the red. Shorter wavelengths bend more. It's interesting to me that they are not just different, but that they are the exact opposite. Why is this?
Thanks for addressing this question.
Comment: Refraction of different colors depends on the dispersion of the medium, which can make blue bend more or less (depending on the material). Diffraction applies momentum perpendicular to the diffraction surface, so the first order will always deflect blue less than red by energy conservation.
Comment: Doesn't diffraction take place inside a medium like glass because it would deliver momentum perpendicular to the glass surface too. Many diffraction grating are even made of glass. It perplexes me that diffraction would not happen in the medium.
Comment: @JonCuster: That should be an answer.
Comment: As a concrete example, the index of refraction of silica glass is an increasing function of frequency within the visible portion of the EM spectrum, but it decreases from 3x10^15 Hz to 4x10^15 Hz (in the UV).
Comment: Not sure what you mean by that should be an answer.
Comment: @Lambda: I mean that Jon Custer's comment answers your question, and he should post it as an answer.
Comment: @Lambda Blue light always diffracts more than red light. The pattern you see from the diffraction grading is caused by overlapping  interference patterns. That's why some areas have mixed colors.
Answer: Deflection angle due to a diffraction grating depends on the spacing between the grating lines, and not on the index of the grating (assuming air-grating-air).  Longer wavelengths are deflected through larger angles by a diffraction grating.
On the other hand, when light is refracted by a prism, the deflection angle depends on the refractive index of the medium, and refractive index for each wavelength depends on the electronic and quantum properties of the medium.  In most glasses the index decreases as wavelength increases in the visible ranges, so the deflection angle (assuming air-prism-air) decreases with increasing wavelength. But there are exceptions.  See for example Anomalous Dispersion.  In the narrow portions of the spectrum where the index increases with increasing wavelength, the deflection angle from a prism will increase with increasing wavelength.  So, though it's usually true in refraction that "shorter wavelengths bend more", it's not always true.


Steps to Create a Signed Desktop App for Windows 8?

Question: I have a desktop application that I created for nopCommerce.  One of the features is to allow users to drag and drop images from windows explorer into my app, and the images are uploaded to the selected product.  In the past, Windows 7 and prior stopped them unless they disabled UAC, and that was fine with most users.  However in Windows 8 they can still disable UAC (really, really disable it with a reg setting) but not having UAC on breaks the Metro apps.  In testing I've tried running it as admin and that did not work.  Only disabling Uac in the Group Policy registry setting really worked.
I need to take the next step(s) and get my app Windows 8 compatible, obviously so they can use windows explorer drag and drop without having to disable/enable UAC all the time.  I've done a lot of research and I think I need to:

Purchase a code signing certificate
Sign my code using SignTool
Sign the Installer just to be safe (??)
Include a manifest that describes the required permissions...what should that look like?
Is there anything else I need to do when I build the app using VS2012?

Am I on the right track?....I'm pretty much at a loss on this!   Thanks for your time.
Answer: This is the certification requirements, a big long list. plz make sure your app complies with these.
http://msdn.microsoft.com/en-us/library/windows/desktop/hh749939.aspx


What is the good wording and place for file size error message?

Question: What would be a good wording and place on the form for file type error message?
I am especially interested in the case when a user may not understand clearly the difference between file types.
Comment: Without context there are simply far too many possible solutions to such a question.
Comment: Why let the error happen in the first place?  Design the file picker so it will only accept / see valid files type(s)
Answer: The placement should be where the user is looking (the submit button and the form). The fact that something went wrong should be made VERY clear: the form changes color, etc...
Re the wording - I'm assuming you're talking about non-techies who are asked to send PDFs (as for example) and send word docs or something else instead. The error msg itself should be written in a non-techie way.
"I'm sorry but I can only read files saved as a PDF. This file was saved as a Microsoft Word document. Please go back to the word doc and "Save As" a PDF and then try uploading again.
Comment: Better than a "Required filetypes: X, Y, Z." However, assuming they have a specific program may be too much. Background details on what is submitted would help know how well this can go~.
Comment: True. The example msg was too specific. "Please return to your document and Save As a PDF and then try uploading again." would be better.  That way you don't have to be concerned about what file type your user uploaded (aside from the fact that it wasn't the expected type.)


Protect linux partition from windows

Question: I want to duel boot windows and Ubuntu, however i don't want anything on windows to be able to access my Linux partition. Is there anyway to do this without encryption? As i don't want to slowdown read/write times on my Linux system.
Comment: What's your threat model? The last time I checked, Windows didn't have pre-installed support for any of the file systems your Linux is likely to use. On the other hand, with sufficient rights on the windows side, you can read (and write!) the hard drive byte by byte.
Comment: remove windows partition from /etc/fstab file to stop auto mounting windows partition @Da google
Answer: You have 2 options, to stop deletion.

Separate hard-disks, and hardware switches.
If you want to do it with the same hard-disk, then you will need some virtualisation software to run under MS-Windows.

There is no other way, as MS-Windows is an operating system, it can do what ever it wants with the hardware.
To stop read, then you can use encryption (your solution).

Protect linux partition from windows


Is there a way to move an Android project from one workspace to another

Question: Is there a way to move an Android project from one work space to another?
My hard drive crashed and I had to re-install everything, now when I open the old workspaces, eclipse cannot find any of the imports.
Answer: I moved projects several times succesfully.
On re-installing, did you defined the workspace to directory that contains old projects?
Did you tried to import manually?
And finally, try those answers


Zucchini in Australia and courgette in New Zealand! Why?

Question: I can probably understand why the plant is called zucchini in the US and courgette in the UK- could be traced to the proximity of the UK to France but how come it's got two different names in Australasia?
http://en.wikipedia.org/wiki/Zucchini
Comment: Related: http://english.stackexchange.com/questions/109992/courgettes-vs-zucchini-under-a-historical-perspective
Comment: @tchrist It's part of Australasia which include Australia. Thanks for pointing out the mistake.
Comment: I was unaware that New Zealand was part of the Australian continent.
Comment: Related:https://english.stackexchange.com/questions/154263/did-courgettes-ever-have-an-english-name. The fact is that neither "zucchini" nor "courgette" are "English".
Answer: Depends whether you have more Italian (zucchini) or French/English (courgette) immigrants. I suspect that New Zealand only had English immigrants who used the English term - which was originally from French.
Answer: Both countries have had plenty of British migrants. However, in New Zealand there's a greater proportion of Scottish (historically politically tied with France) and in Australia it's the Irish. For the latter they weren't the Zucchini eating kind, that only came with migration from continental Europe when the name Zucchini came in.
The name also stuck more with Australian culture with 'Bananas in pyjamas' being supplemented with 'Zucchinis in bikinis'
Answer: It's a theory, I suppose, but Australia is - and always has been - more than five times the size of the other country, so far as population goes.
Until the late 1940s Australia had few Italian immigrants, as the population was largely composed of English, Irish and Scottish - just as the other place was. So Australia had a similar mix of people as its much-smaller neighbour, was settled by Europeans (English, Irish and Scottish) much earlier, with a smattering of continental Europeans, including French owing to the significant gold-rushes in the 19th century.
Italians came to Australia in large numbers following WWII and brought their language and cuisine with them, but zucchinis were unheard-of until at least the 70s except by those of Mediterranean heritage. Few went across the Tasman.
The question mentions "Australasia", a term rarely if ever heard in Australia, but common in the other country.
It does not really exist except there and in geography books.
Comment: Rubbish, it's heard a plenty


How to show text in the news webpart in SP2013?

Question: I have a SP2013 portal. I didnt build it, but there is a webpart with news articles in it. I see only the title and a read more hyperlink. I would like to show also the first 2 rows of the news article. How can I configure this?
Comment: After looking at your profile, it's clear that you have a very low amount of accepted answers. Care to fix that?
Answer: found the solution. When you go to webpart settings you can change the item style. I selected another item style and now I see title, date and intro tekst of 2 rows.


DAO Governance Off Chain

Question: What are good methods for DAO decisions to be implemented off chain? If a company is looking to start a DAO to manage a specific centralized service (say a website, manufacturing plant, etc) through decentralized means, how can DAO votes be implemented off chain on that centralized service? Are there enforcement mechanisms that will work?
Answer: For what I know, the best way is to enroll the executive party in the Dao. I will provide financial incentive to deliver and they will be paid in crypto. If they don't want or can't enroll their company in a Dao, they can have an interface but the risk is centralisation.
Comment: If the executive is in the DAO, what ensures that the executive does what the DAO votes for them to do off-chain? What would the repercussion be if the executive does not follow through?
Comment: They should not have the findings and even lose part of their money (Dao token) si they are incentivised not to cheat or underperform.
Comment: This also requires that the Dao contains some verifiers who will be checking the work (it can be any Dao stakeholder in case of a virtual work like a website) but it can be expert companies that are also enrolled in the Dao and provide their verification services to the Dao and get paid with the token.
Answer: One way is with executors like discussed above, but another option is to have votes off-chain and then use an oracle to push the values on-chain.  Gnosis multisigs (via their Zodiac tool pack (https://github.com/gnosis/zodiac ) have a a few options).
I know tellor works with them in this manner, where you have a snapshot vote off-chain and then the oracle brings it back on-chain to be executed.
Answer: Great questions @YigalZamora ,
this is one way to do it :
Perform activities off-chain and after a decision is finalised, write the output of that on chain. This works similar to a soft fork or investment allocation. Pls read more here abt the benefits and risks:

https://www.coindesk.com/learn/2016/06/25/understanding-the-dao-attack/

DAO Governance Off Chain


Slightly weaker adjective than "heavily" in "heavily used"?

Question: This is a very simple question, but I found it's something hard to search for on the internet. When something is used a lot, we can say "something is heavily used". If it's almost abandoned, we can say "something is barely used". Then if something is fairly well-used so that you can find it here and there but still not in the level of heavily used, what adjective should I use in this case?
Answer: I would probably describe it as:

Fairly well-used.

Or (perhaps a little stronger in some cases):

Quite well-used.
Answer: Since I did find this hard to search for, I'll include options I can think of for various levels of use.  These are not all synonyms for each other, just examples that could convey the level of usage.  Some are going to be more or less appropriate depending on the context.
Sees a lot of use
Well-loved, well-worn, heavily used, extensively used, used a lot/ton, used often/frequently, used all the time, it's my go-to noun, my noun of choice
Sees some use
Fairly well-used, sees moderate usage, sees its fair share of use, used plenty, used enough, used from time to time, used sometimes, used semi-regularly, there when I need it
Sees almost no use
Gathering dust, gathering cobwebs, lightly used, barely used, never used, sees no use, used sparingly, used rarely, avoided as much as possible


What caused this tree to only have branches on the top?

Question: My husband and I saw this tree (see image) when we were on a local walk in a wooded area. We were wondering why it would be so tall with all its branches on the upper portion and nothing on the lower part of the trunk. He is convinced that it was pruned this way by a person, whereas I think this is naturally occurring (maybe it grows tall like this to get the light, only this hypothesis doesn't make sense for this particular tree because there are no other trees nearby to compete for light). We have a bet going, please help us settle it!
Comment: Are you sure that the tree grew like this and not in a closely planted forrest? My first impression was of a forrest after felling most of the trees or after a storm got through.
Comment: pine trees do naturally lose their lower branches over time. I had trees like that on my property and I know nobody pruned them to be that way,
Comment: Yes, it's possible it grew in closer proximity to other trees. There are woods very nearby (you can see other trees in the original photo). We looked for stumps or other evidence of trees that used to be next to this tree and did see a few dead tree pieces on the ground.
Answer: Its not the just the pine trees that lose (or shed) the lower branches, its a well-known phenomenon of most tress that exhibit the vertical growth beyond a certain height.
Its just that, it is more noticeable in Pine trees and to an extent in case of Eucalyptus trees as well.
The most fundamental reason for shedding seems to be the case that those lower branches become redundant as they are over-shadowed by the upper branches. It is kind of natural self-pruning mechanism that allows such trees to sustain overall growth.
Comment: +1 True, I see similar, although not nearly as extreme, "self pruning" in many of my trees that are in my small woods.  Often, when the lower  branches become scraggly and unsightly, I will prune them myself.   And, HI, glad to see you again!
Answer: When trees grow close together, as was likely the case for the tree in your picture, there will not be much light reaching the lower branches. Those lower branches will die back.
Usually those trees stay close together till they are all felled. This kind of having trees growing close together, all of the same kind of tree, is mostly done for timber but in the past there were lots planted for masts for sailing ships.
In some climates trees grow this close together naturally, tropical rain forest might well be the best known one, or maybe in much of the world this kind of natural forests have been cut down as it provided timber for the taking.
Trees that grow in an open space will usually spread their branches wider and while the bottom ones will drop off when the higher ones overshadow them, these trees will never grow into a narrow plume above a naked trunk, as the tree in your photo.
I have seen people cut off the lower branches of city trees but those will rarely been pruned to this extend.
As felling is mostly done very efficient, I guess this is the result of a storm, which uprooted many of the trees leaving this one behind by accident.
Answer: This tree would not grow this way in isolation.
From the image it seems quite probable to me that this was at some point a re-forested pine or spruce tree plantation. These are industrially managed tree plantations optimised for wood production per area. Saplings which are pre-grown in other locations are planted extremely close together and will shoot up close to each other, competing for light and leading to a very dense and dark forest. This is bad from an ecological standpoint (little diversity, little variance in ecosystems for various species), but gut for business... lots of wood to sell.
The lower branches in such growths will inevitably die off since they aren't worth the effort anymore for the tree as there is hardly any light reaching them. You'll end up with many high trunks and a very dense canopy far up in the treetops.
In the picture shown I'm guessing that the rest of the plantation trees were felled and for some reason this one tree was left standing. Or there was a storm who flattened an area of plantation forest and this tree was a lucky survivor (I have seen many such examples before).


Is it a problem if a user posts "many" self answered questions?

Question: So I am sure it is not malicious but figured I would bring it up anyways. I recently noticed a certain user having a large amount of self answered questions in their reputation. The answers themselves are worth answers in my opinion but doesn't this sort of go against the idea of the site of helping others? I do know it is allowed, but wanted to see if anyone has thoughts on to how many are too many, if at all?
Comment: *"doesn't this sort of go against the idea of the site of helping others"* - This is not the main idea of this site. The main idea is to build a knowledge database with question and their answers. Helping others with their question is just a way to build that database. Writing your own answer to your own question is just another way.
Comment: https://meta.stackexchange.com/help/self-answer
Comment: How is it _not_ helping others to increase the sum of useful knowledge easily found on the internet?
Answer: If they're low quality questions, or low quality answers, then it's a problem, and you should treat the situation exactly the same as any other time where you see a user with a pattern of providing low quality questions or answers, whether they're self answered or not.
If they're quality contributions, both in the questions and the answers, then the more the better.

doesn't this sort of go against the idea of the site of helping others

The idea of the site is to create a useful repository of knowledge.  Not to help one person find an answer to their question.  If the questions are creating a useful resource that's likely to be helpful to other people searching for answers to the same question, then that's in line with the site's goals.
Comment: @EricF If you think that the question isn't a good question, there are tools available to you to indicate as much.  You can downvote it, vote to close it (if merited), etc.  If you feel that the answer is not useful, you can likewise indicate as much through votes on it as well.  This is no different for a self answered question than it would be for a question that *wasn't* self answered.
Comment: My thought was that a user can just go on some wiki, think of a random question, then provide a random answer on this site which may not be a "good" question but simply something to boost their reputation. I guess the decision if a question is "good" is subjective though
Comment: Makes sense. Thanks for the answer
Answer:
The answers themselves are worth answers in my opinion.

If the answers are worthy answers keep him busy with doing such things again and again by supporting him.
He spend his time to convert his knowledge in a QA format and posted here to help others.

will go against the idea of the site of helping others

No
people will benefit from this. Now or in future.
He made a QA post because he has to go through the situation. People in future, if go through the same situation, it will be very helpful for them.
In short
If they are good question and answer, try to encourage him to do so more and more


Store more apps on iPhone 5c 16gb

Question: So I recently moved from an Android phone to an iPhone 5c. One of my favorite features of Android was the ability to store apps on the SD card. It's apparent that there's no solution like this for an iPhone, as iPhones don't have an SD card slot. My question, however, is what alternatives may exist to storing extra apps on my 5c. I've come to find out that apps alone are filling my device. Using iCloud, I can sync just about everything else wirelessly, but regardless, I still could use some more breathing room just for my apps. Is there any sort of cloud based solution for this, or anything else for that matter? I've hunted around but can't seem to find any definitive answers.
Comment: Unfortunately, there really isn't anything that I'm aware of (aside from @ArchonOSX's answer). My understanding is that the higher capacity models of it's iOS lineup are an integral part of it's profits. Also, because of the sandboxing that happens (which helps make iOS very secure), options become mainly limited to web-apps - which are in some cases plentiful - for storing the bulk of the app elsewhere.
Answer: About the only option is to have all the apps you want on iTunes and load them onto your iPhone as desired. Of course you can't have them all at the same time because of your memory limitations but you could change sets for vacation or work for instance.
Or you can buy an iPhone with more memory.
Those are the only options Apple leaves you.
Happy Day!
Comment: Thanks for your answer. I was thinking something like this might have to be the solution. It might not be super elegant but at least it's a solution. Thanks again.
Answer: iOS does not have the concept of a file system for users to access in the first place. Even if you use a dock to USB / camera card adapter, the OS will read files from th storage and ingest them into the photo app.
Short of a jailbreak, you will not be able to extend the storage in an analogous manner to Android, OS X, Windows of other computer-like OS.
Comment: @ThoughtSpaceDesigns  Perhaps I should have finished the thought. Not only can you not run apps on local storage, you cannot run them on network attached storage. With iTunes radio, we have the beginnings of a streaming service, but apps seem quite a long while till they would be cloud sourced.
Comment: This is a bit unrelated. Perhaps I was unclear. I'm mainly looking for a way to run apps from the cloud.

Store more apps on iPhone 5c 16gb


Getting binary data using SqlDataReader

Question: I have a table named Blob (Id (int), Data (Image)). I need to use SqlDataReader to get that image data. Note that I dont want to Response.Binarywrite() the data to the browser. I just need that binary data as byte[] to use the same for some internal operations. Only way I can think of is getting id using SqlDataReader and the again use SqlCommand.ExecuteScalar() to get that as byte[] for a given id. Can I use just the SqlDataReader (SqlCommand.ExecuteReader) to get that image data as byte[]? Am I missing anything?
Answer: You should be able to get it via: (byte[])reader["Data"].
Also note that the image data type is deprecated, and will be removed in a future version of SQL Server; use varbinary(max) instead.
Comment: I don't even see an `Items` collection on the `SqlDataReader` in .NET 4.0.
Comment: Is the Items collection deprecated?
Answer: Yes, you can use SqlDataReader.GetBytes. You probably want to pass in null for the buffer in the first call, to find out how much data there is, and then call it again with an appropriately sized buffer.
You may just be able to use the indexer and cast the result to a byte array - I'm not sure. Worth a try :)
Comment: @ydobonmai: Why bother with a different buffer size when you already have a buffer of the right size? And you should use `bytesRead` instead of `curPos`; you're currently always assuming that it reads a full buffer amount.
Comment: ind ndx = rdr.GetOrdinal("");
            if(!rdr.IsDBNull(ndx))
           {
            long size = rdr.GetBytes(ndx, 0, null, 0, 0);  //get the length of data
            byte[] values = new byte[size];

            int bufferSize = 1024;
            long bytesRead = 0;
            int curPos = 0;

            while (bytesRead < size)
            {
                bytesRead += rdr.GetBytes(ndx, curPos, values, curPos, bufferSize);
                curPos += bufferSize;
            }
           }
Comment: SqlDataReader.GetBytes() sounds like a very efficient method since you can reuse the same array (if it has the proper size). So you don't create a new array for each column as (byte[])reader["Data"] would do.
Answer: In .NET Framework 4.5 you can use GetStream method to access binary data as Stream.
Answer: From MSDN. Not sure why I couldn't find that before.
    SqlConnection pubsConn = new SqlConnection("Data Source=localhost;Integrated Security=SSPI;Initial Catalog=pubs;");
    SqlCommand logoCMD = new SqlCommand("SELECT pub_id, logo FROM pub_info", pubsConn);

    FileStream fs;                          // Writes the BLOB to a file (*.bmp).
    BinaryWriter bw;                        // Streams the BLOB to the FileStream object.

    int bufferSize = 100;                   // Size of the BLOB buffer.
    byte[] outbyte = new byte[bufferSize];  // The BLOB byte[] buffer to be filled by GetBytes.
    long retval;                            // The bytes returned from GetBytes.
    long startIndex = 0;                    // The starting position in the BLOB output.

    string pub_id = "";                     // The publisher id to use in the file name.

    // Open the connection and read data into the DataReader.
    pubsConn.Open();
    SqlDataReader myReader = logoCMD.ExecuteReader(CommandBehavior.SequentialAccess);

    while (myReader.Read())
    {
      // Get the publisher id, which must occur before getting the logo.
      pub_id = myReader.GetString(0);

      // Create a file to hold the output.
      fs = new FileStream("logo" + pub_id + ".bmp", FileMode.OpenOrCreate, FileAccess.Write);
      bw = new BinaryWriter(fs);

      // Reset the starting byte for the new BLOB.
      startIndex = 0;

      // Read the bytes into outbyte[] and retain the number of bytes returned.
      retval = myReader.GetBytes(1, startIndex, outbyte, 0, bufferSize);

      // Continue reading and writing while there are bytes beyond the size of the buffer.
      while (retval == bufferSize)
      {
        bw.Write(outbyte);
        bw.Flush();

        // Reposition the start index to the end of the last buffer and fill the buffer.
        startIndex += bufferSize;
        retval = myReader.GetBytes(1, startIndex, outbyte, 0, bufferSize);
      }

      // Write the remaining buffer.
      if(retval > 0) // if file size can divide to buffer size
          bw.Write(outbyte, 0, (int)retval); //original MSDN source had retval-1, a bug
      bw.Flush();

      // Close the output file.
      bw.Close();
      fs.Close();
    }

    // Close the reader and the connection.
    myReader.Close();
    pubsConn.Close();

Comment: One note on this: if you don't set CommandBehavior.SequentialAccess on the ExecuteReader call (eg getting the reader from another part of a data layer), it will do horrible things to your memory (creating a blob-sized byte array for every call to GetBytes()); This solution should ONLY be used with CommandBehavior.SequentialAccess as demonstrated here.
Comment: Could anyone offer comments on how one decides on the buffer size? The example uses 100, but why not 10 and why not 10,000? What are the factors that one needs to consider?
Answer: Use this function for safe and flexible bytes reading:
    ///
    /// Reads all available bytes from reader
    ///
    /// <param name="reader"></param>
    /// <param name="ordinal"></param>
    /// <returns></returns>
    private byte[] GetBytes(SqliteDataReader reader, int ordinal)
    {
        byte[] result = null;

        if (!reader.IsDBNull(ordinal))
        {
            long size = reader.GetBytes(ordinal, 0, null, 0, 0); //get the length of data
            result = new byte[size];
            int bufferSize = 1024;
            long bytesRead = 0;
            int curPos = 0;
            while (bytesRead < size)
            {
                bytesRead += reader.GetBytes(ordinal, curPos, result, curPos, bufferSize);
                curPos += bufferSize;
            }
        }

        return result;
    }

Comment: Since you already have the correct size, better do `int bufferSize = size > int.MaxValue ? int.MaxValue : (int)size;`
Comment: In practice there is no need for the loop. Just call reader.GetBytes once with the correct size parameter : reader.GetBytes(ordinal, 0, result, 0, result.Length)
Answer: No need of using the reader. Just use a dataset to fetch values from the database(using stored Proc or any other method) and just type cast it with byte(code below) and store it in a byte array. Your work is done.
byte[] productImage;
productImage = (byte[])ds.Tables[0].Rows[0]["Image"];

Answer: This is an old question, and I had been using Anton Bakulev's answer above for a while, until I ran into a case where my data was actually bigger than the 2GB that int curPos could handle. When I tried changing that bufferIndex argument to 0, well anything that was beyond the bufferSize returned corrupted. (Also, that tiny buffer size made loading anything above 2MB a literal PAIN).
No, you probably should not have over 2GB of data in a single column in your database. Try to avoid that. But just in case, here is a more robust, and streamlined, version of the code, as an SqlDataReader extension method:
public static byte[] ParseStrictByteArray(this SqlDataReader reader, string columnName)
{
    int colIdx = reader.GetOrdinal(columnName);
    long size = reader.GetBytes(colIdx, 0, null, 0, 0);
    byte[] imageValue = new byte[size];
    // essentially, we are loading all this data in memory, either way... Might as well do it in one swoop if we can
    int bufferSize = (int)Math.Min(int.MaxValue, size);
    //int.MaxValue = 2,147,483,647 = roughly 2 GB of data, so if the data > 2GB we have to read in chunks

    if(size > bufferSize){

        long bytesRead = 0;
        int position = 0;
        //we need to copy the data over, which means we DON'T want a full copy of all the data in memory.
        //We need to reduce the buffer size (but not too much, as multiple calls to the reader also affect performance a lot)
        bufferSize = 104857600; //this is roughly 100MB
        byte[] buffer = new byte[bufferSize];
        while (bytesRead < size)
        {
            if (size - bytesRead < bufferSize)
                bufferSize = Convert.ToInt32(size - bytesRead);

            bytesRead += reader.GetBytes(colIdx, position, buffer, 0, bufferSize);
            //shift the buffer into the final array
            Array.Copy(buffer, 0, imageValue, position, bufferSize);
            position += bufferSize;
        }
    }
    else
    {
        //single read into the image buffer
        reader.GetBytes(colIdx, 0, imageValue, 0, bufferSize);
    }

    return imageValue;
}

Getting binary data using SqlDataReader


Is the net torque of an only translating rigid body zero, independent of the point chosen?

Question: I know that the Newton-Euler equations can be proven using the center of mass as reference, but I was wondering if this is a special case, or if you can provide a counter-example. We know that when a rigid body is only translating the net torque through the center of mass is zero. Is this true when we evaluate the torque using other points too?
Comment: at least I cannot understand your question, can you clarify, maybe use some more words?
Comment: @trula I'm sorry I worded it poorly. I tried to clarify what I'm asking.
Answer: No, it is not true; for example, consider a uniform-mass ball of radius $r$, which has a force $\boldsymbol{F}$ acting horizontally through its centre, such that it translates without rolling. The torque about its centre of mass is zero (because it is not rotating), but the torque calculated about its contact point with the ground is not zero:
\begin{equation}
\boldsymbol{\tau} = \boldsymbol{r}\times\boldsymbol{F} \neq 0\,.
\end{equation}
Answer: The net torque on an object can be defined as
$$\boldsymbol{\tau}=\frac{\mathrm d {\mathbf p}}{\mathrm d t}\tag{1}$$
where $\mathbf p$ is the angular momentum. The angular momentum of any body about any general point is
$$\mathbf p=I_{\text{COM}} \boldsymbol{\omega} +m\mathbf r\times \mathbf v$$
where $I_{\text{COM}}$ is the moment of inertia of the body about its center of mass, $\omega$ is its angular velocity, $\mathbf r$ is the position vector of the center of mass, $m$ is the mass of the body and $\mathbf v$ is the velocity of the center of mass of the body. Plugging this into $(1)$, we get
\begin{align}
\boldsymbol{\tau}&= \frac{\mathrm d (I_{\text{COM}} \boldsymbol{\omega} +m\mathbf r\times \mathbf v)}{\mathrm dt}\\
&=\underbrace{\frac{\mathrm d (I_{\text{COM}} \boldsymbol{\omega})}{\mathrm d t}}_{\text{Term 1}} + \underbrace{\frac{\mathrm d (m\mathbf r\times \mathbf v)}{\mathrm d t}}_{\text{Term 2}}
\end{align}
Since the rigid body is only translating, thus the term 1 becomes 0 (Here we have assumed that $I_{\text{COM}}$ is constant). Now applying product rule to differentiate term 2,
$$\boldsymbol{\tau}=m\left(\frac{\mathrm d \mathbf r}{\mathrm d t}\right)\times \mathbf v + m \mathbf r \times \left(\frac{\mathrm d \mathbf v}{\mathrm d t}\right )$$
Here we have assumed that $m$ is constant. Now, since our reference point is stationary, thus, $\mathrm d \mathbf r/\mathrm d t=\mathbf v$ and, also, $\mathrm d \mathbf v/\mathrm d t =\mathbf a$. Thus
$$\boldsymbol{\tau}=m\mathbf v \times \mathbf v+ m \mathbf r \times \mathbf a$$
Since the cross product of a vector with itself yields a zero vector, thus,
$$\boxed{\boldsymbol{\tau}=m\mathbf r \times \mathbf a}\quad \equiv\quad \boxed{\boldsymbol{\tau}=\mathbf r\times \mathbf F}$$
This is your final expression of torque. It is only zero when $\mathbf r$ and $\mathbf a$ are along the same line, or any one of the two of $\mathbf r$ and $\mathbf a$ is zero.


Definition of mass

Question: In high school physics, I was taught that mass was just how much "stuff" or matter there is in an object. However, now that I am learning physics again in college, I am taught that mass of an object (inertial mass) is how resistant an object is to acceleration. Which one's the correct definition of what mass is?
Comment: Related: [What's the difference between the five masses: inertial mass, gravitational mass, rest mass, invariant mass and relativistic mass?](https://physics.stackexchange.com/q/8610/2451) and links therein.
Comment: Well, mass can also be energy.
Comment: They amount to the same thing, surely?  The more "stuff" there is in an object, the more resistant it is to acceleration.
Comment: @LeoLiu What's true is that $E^2 = m^2 + p^2$. Photons have no mass, so $E^2 = p^2$, i.e. $|E| = |p|$. A photon has both momentum and energy all while being massless. What you're referring to as "the effects of having mass" are really the effects of having momentum and energy, which massive and massless particles can both possess. There are observable differences between massive and massless particles, so it's important not to conflate having mass and having momentum and energy.
Comment: Before ever hearing of mass in the classroom, I heard it's resistance to acceleration. Then in the classroom I heard it's "amount of matter". Only the resistance-to-acceleration version enabled me to understand it. I wonder why anyone would feel satisfied with the amount-of-matter version.
Comment: The answers to https://physics.stackexchange.com/questions/70186/are-newtons-laws-of-motion-laws-or-definitions-of-force-and-mass contain the answer to this question.
Comment: @LeoLiu Mass and energy are different. An on-shell photon really is massless, but it nevertheless has energy.
Comment: @Charles Hudgins You are right, this means that photons possess momentum and could damage human skin. So sometimes the effects of having mass and possessing energy are the same because both of these two situations must imply momentum. (My previous answer was ambiguous)
Answer: This is a deep question.   There are (at least) two definitions of mass:

gravitational mass is how something is influenced by gravity, which is the $m$ in $F = Gm_1m_2/r^2$, and is more-or-less 'how much stuff there is';
inertial mass is how resistant to acceleration something is, and it's the $m$ in $F = ma$.

If we call these two versions of mass $m_G$ and $m_I$, then we can conduct experiments which ask whether they are the same (or to be more precise, whether there is a constant ratio between them, which ratio can be absorbed into $G$).
It's easy to see how to set up such experiments in principle.  Given the two equations above we can equate the forces to get
$$m_{I,1} a = \frac{Gm_{G,1}m_{G,2}}{r^2}$$
or
$$\frac{m_{I,1}}{m_{G,1}} = \frac{Gm_{G,2}}{a r^2}$$
Well we can measure all the quantities on the right hand side of this, and we expect the left-hand-side always to be $1$ if the two definitions of mass are equivalent.  Even if we can't measure $G$ or $m_{G,2}$ very well, we can repeat the experiment with lots of objects on the left-hand-side and we should always get the same answer.
The weak equivalence principle (WEP) says that they are the same, and experiment has so far borne this out.
There are various stronger equivalence principles which matter in General Relativity in addition.  I won't go into them here as I am always confused about exactly which is which.  However it's fairly easy to see that if we want a theory of gravity which states that gravity is about the geometry of spacetime, then we really must have only one definition of mass, and so we need to claim rather strongly that all definitions of mass are equivalent.
Comment: This does not answer the OP's question. You're explaining the difference between inertial and gravitational mass, but the question is only about the concept of inertial mass and how it's related to "how much stuff" there is in an object. You answered the question you _wish_ the OP had asked.
Comment: @Wood: my take is that gravitational mass *is* how much stuff there is: that's why I answered it the way I did.
Comment: For a second I thought you meant "we use cams to measure ...".
Comment: @tfb: No sorry needed, I was just amused. =)
Comment: For a second I thought you were going to say that inertia mass could be different from gravitational mass due to the difference between rest mass and relativistic.
Comment: @user21820: fixed, sorry
Answer:
Which one's the correct definition of what mass is?

In a way, both.
Mass is a fundamental measure of the amount of matter in an object, or as you say, a measure of the amount of "stuff" in an object. At the same time it is a numerical measure of its inertia. Because mass is a fundamental property, definitions of mass can tend to be circular, as a fundamental property is difficult to define in terms of something else.
Newton's first law, that objects will remain in their state of motion unless acted upon by a net force, is a statement about the inertia of objects. Newtons's second law says that an object of mass $m$ will experience an acceleration $a$ when subjected to a net force $F_\text{net}$, or $F_\text{net}=ma$. If the net force is zero, the acceleration is zero and the object will remain in its current state of  motion.  Based on that, the first law can be considered as a special case of the second law.
Hope this  helps.
Answer: Making use of Newton's second law, the two definitions are indirectly equivalent, see:

The net force applied to an object is proportional to its acceleration.

The constant of proportionality is itself the mass, the matter measurement of an object.
$$ F = ma $$
Therefore, for a given net force, mass and acceleration are inversely proportional, i.e., if you have a higher mass you will have less acceleration. That can be interpreted as resistance to acceleration.
Answer: Strictly speaking, neither is correct. First, as you will learn, the more rigorous and general formulation of Newton's second law is not $\sum \vec{F}=m\vec{a}$, but $\sum \vec{F}=\frac{\mathrm{d} \vec{p}}{\mathrm{d} t}$, where $\vec{p}$ is the momentum. This is because the former is valid only for non-relativistic constant mass particles, while the latter is valid for variable mass systems and relativistic particles. Also, the mass as inertia definition is more philosophical than physical since does not let us determine the mass of a particle or a system of particles, so it is bogus.
Regarding the mass as amount of matter definition, it is a tautology, since when you look for the definition of matter it says that is "anything that has mass and volume".
You can further research by reading the following paper:
http://www.physicsland.com/physics10_files/mass.pdf
Comment: The formula $\sum \vec{F}=\frac{\mathrm{d} \vec{p}}{\mathrm{d} t}$ does not respect Galilean Invariance. For variable mass systems check this [Wikipedia](https://en.wikipedia.org/wiki/Variable-mass_system).

Definition of mass


Rewriting Magento 2 classes vs Plugins

Question: Magento 2 has the concept of Plugins/Interception/Interceptors opposed to Magento 1.
These act like a before|after the event for every public method. Which is nice.
You can also use the around plugin in order to replace the functionality of a method.
But Magento 2 still offers the possibility of rewrite classes more or less the M1 way.
I would like to see some examples where rewriting classes are the way to go instead of using plugins.
I know this is useful when you want to change the behavior of a core protected method, but are there other cases where a rewrite is recommended or needed?
Comment: Related: http://magento.stackexchange.com/questions/93932/magento-2-plugin-vs-observer
Answer: The obvious reason to use a rewrite instead of a plugin is when you need to override a private, protected or final methods.
But also consider the following scenarios.
1st scenario (absolute sort order):
Rewrites can be useful when you need your code to be run before plugins.
I know you can do it by setting the plugin sortOrder, but you cannot be sure your code will always be the first when someone (not you) is going to install 3rd party components.
2nd scenario (exclude code):
If you need to exclude or rewrite just a piece of code in a method, a plugin could be a sub-optimal way.
I know you can use an around plugin and avoid calling the proceed, but this could break other plugins in the stack.
3rd scenario (code style):
You should use rewrites when you need to rewrite a behaviour, plugins should be used to modify the output or run code before/after.
A plugin, should always run the original code to avoid breaking other modules.
My conclusion:
If you can consider a core method as a black box with an input and one output and you are agnostic about its internal mechanisms, then a plugin could be the best option.
If you need to change an internal behavior, a rewrite could be the best option.
Comment: 1st scenario is slightly inaccurate (I think it's only the wording) since a before or arround plugin runs (or can run) before the actual method code.
Comment: Yes, my wording was not correct. My point was about the relative sort order with the actual method.
Answer: Great question, I asked myself the same thing the other day and here's what I came up with:

First, plugins cannot be used for final methods, final classes and classes created without dependency injection I reckon that's a very specific case but that's one case where you can't use plugins
Second, you need to keep in mind the definition of a plugin. It is used to work on a method level whereas preferences are used to work on the whole class level. It is not obvious for everyone so it's good to keep that in mind.
Finally, and I reckon that's the most important, it seems like plugins can only be used to extend the behavior of any public method within a Magento class. Thus it seems like you cannot use plugins with protected/private methods.

Source: Magento U Fundamental Course
Comment: Ok. Good reasons. I don't know what to say about the second point though. If you want to pluginize a lot of public methods from the same class, I think the safest way is to create a single class that acts as a plugin for all of them. (my opinion). I will leave this open 2-3 days to see if someone comes up with other reasons. If not....the checkmark is yours.
Comment: @marius as an addition: as Plugins should be Domain specific, I think it should be at least best practice to only define multiple plugins in one class, if they are an implementation of the same feature. With a rewrite, you don't have this option as you always change a whole class. So I think that would be one reason to at least try to avoid rewrites
Comment: @Marius you're absolutely right re: second point. For some reasons I thought you had to create several plugin files for every method you wanted to pluginize but I think that's what observers do, not plugins. That'd be cool if more people reply to see if there's more reasons (non obvious).
Comment: @DavidVerholen. I totally agree. But I was asking for reasons to use rewrites instead of plugins.
Comment: yes I think this could be a reason to use plugins since you can define feature specific plugin classes, while a rewrite can only be done once
Comment: so I think very superficially spoken it would be plugins for extending functionality and rewrites for changing functionality

Rewriting Magento 2 classes vs Plugins


Who decides whether something is standard English or not?

Question: During a chat with a native English-speaking friend, he used the phrase "get on with it". I asked him about it, and he said it is a slang phrase. I looked it up online, and this phrase shows up on Urban Dictionary, so it seems my friend is correct in saying that it is slang. But who decides whether a word or phrase is proper English or slang?
Comment: Pretty much everything on Urban Dictionary is not standard English.
Comment: Xiu, if you replace the word "correct" with "standard" this question might be better, I would say.
Comment: ***I** do!* Seriously, for most purposes, *all* native speakers are qualified to say whether their terminology is "proper" English or "slang". If they use a word on the assumption that it's one or the other of those classifications, that's how they mean it to be understood. And in general, the people they're talking to will have the same understanding, even if certain people in certain other groups of native speakers might feel differently.
Comment: The OED documents usage, it doesn't determine it.
Comment: whereabouts on urban dictionary?: http://www.urbandictionary.com/define.php?term=get%20on%20with%20it
Comment: After reading all comments & answers here, it's clear there's no such thing as "standard English": think of it as the language [Diogenes' "honest man" speaks](http://en.wikipedia.org/wiki/Diogenes_of_Sinope). Every native speaker (NS) thinks they speak "correct English". Nonsense: if every NS's English is "correct", if "everybody, and nobody" decides, then "correct" is just another meaningless & useless term: it's like choosing correctly between "[the lady & the tiger](http://en.wikipedia.org/wiki/The_Lady,_or_the_Tiger%3F)". It's always someone's else's choice.
Comment: @BillFranke: Broadly speaking, every native speaker *does* speak correct English. And yes, "correct" is a fairly useless term. Why does that bother you so much?
Comment: @ruakh: Because "correct" is the wrong word except when talking about English test answers. The actual standard used is "I understand what you're saying", not "Your English follows the rules". It always bothers me when people neither say what they mean nor mean what they say. Doesn't it bother you?
Comment: @BillFranke: Perhaps there are people who really *only* notice or care about whether they understand someone; but they are certainly atypical. Most native speakers really will notice if someone goes around saying things like "She are coming." (And personally, I set very little store by English tests. They generally have little basis in reality.)
Comment: @ruakh: If you're an English student, English tests are a daily reality. Maybe you don't remember acquiring English, though. Native speakers don't say "She are coming"; "She be coming", however, is another issue. "Correct" implies an objective standard beyond basic grammar, but FumbleFingers' answer "I do!" reveals the true subjective standard. "Correct" really means "Whatever works in context", & that can't always be determined beforehand. Usage is so much more than following myriad & sometimes conflicting & confusing rules.
Comment: @BillFranke: "Native speakers don't say 'She are coming'": Yes, exactly. That's what makes it incorrect, and it's the reason that most native speakers will notice if someone says it.
Comment: The Oxford English Dictionary...of course.  :)
Answer: SHORT VERSION:
Everybody, and nobody.
LONG VERSION:
Some countries have formal institutions which lay down rules which state what language is considered proper. English does not. All speakers and writers get a vote, and may exercise that vote as many times as they wish, both by speaking or writing themselves and by hearing and reading and approving what others speak or write. It is the most completely democratic institution in the world.
This is not to say there are no rules. There are, many thousands of them. Language at bottom is nothing but rules.
But the rules govern within larger and smaller communities. The rule which says that the present indicative form of the verb be which is used with the pronoun he shall be is is very widespread, but there are substantial communities where be is employed in some or all circumstances. By contrast, the community which maintains the rule that shall shall be employed in the first person where will is called for in the second and third persons is small and growing continually smaller. And the community which holds that my brother shall be referred to and addressed as Quid is quite small: probably only nine people.
So when you ask this question—which is an important one, and passionately debated—you must also specify 'correct to whom'? To whom are you speaking or writing?
And when you have specified to whom you will have answered your question. They determine what is correct English.
Comment: @SF The people you're talking to - the people asking the questions.
Comment: @SF. "Standardized" tests emerge from a specific speech community, and the grades reflect that community's standard of what is "correct" - which may or may not be what (just for instance) you or I regard as "correct".
Comment: I have to upvote this, since it says pretty much exactly the same as the comment I wrote before scrolling down to read it!
Comment: +1; but even when there *is* a formal institution that lays down supposed rules, the reality is that correctness works just the same way as in English.
Comment: @ruakh  Oh, yes. Academies can oppose innovation, restrain innovation, even in some circles suppress innovation; in some cases they may also encourage innovation; but in the end the writers will follow their own stars, and their readers'.
Comment: Well... Who decides which answers on English tests are correct?
Comment: @StoneyB: ...standarized tests, like the FC?
Comment: Your pretty sure theirs no incorrect English...
Comment: @SF On the contrary: I'm sure there are lots and lots of ***different*** correct Englishes - and lots of incorrect Englishes for each of them. (I'm also sure there are lots and lots of carelessly designed tests of English, but that's another matter.)
Comment: Could you maybe link to the community referred to which uses *quid* for *brother*?
Comment: @AlanCarmack It's my family, and it only uses *Quid* for one person: my parents' third child, the *tertium quid*.
Answer: Slang describes a special kind of vocabulary, so Get on with it isn't slang. It's an informal idiom, almost entirely confined to speech. The distinction you have in mind is perhaps not so much between what is slang and what is 'correct English' as between Standard English and nonstandard English. In the words of the linguist Richard Hudson,

Roughly speaking, Standard is the kind of English which is:

written in published work
spoken in situations where published writing is most influential, especially in education (and especially at University level)
spoken "natively" (at home) by people who are most influenced by published writing - the "professional class" '.

Another linguist, Peter Trudgill, has said

Standard English . . . is the variety of English normally used in
writing, especially printing; it is the variety associated with the
education system in all the English-speaking countries of the world,
and is therefore the variety spoken by those who are often referred to
as "educated people"; and it is the variety taught to non-native
learners. But most native speakers of English in the world are native
speakers of some nonstandard variety of the language, and English . .
. can be described . . .  as consisting of an autonomous standardised
variety together with all the nonstandard varieties which are
heteronomous with respect to it. Standard English is thus not the
English language.

There is no body that says what is Standard English in the way that the French Academy says what is Standard French. If you want to know in what contexts a word or a construction is used a good dictionary will help, or perhaps a corpus-based usage guide such as 'The Cambridge Guide to English Usage'. But there is really no substitute for paying attention to the way in which native English speakers and writers use the language in different situations.
Comment: @mcalex. Most native speakers don't know much about language, and the terms used to describe. But, if they've had a modest amount of education, they do have some idea of what to use when.
Comment: @mcalex Just because a native speaker says something is true, doesn't mean for sure it is.  Even native speakers can be wrong :)  "Get on with it" is not slang.  It *is* an idiom, which is probably what your friend meant.
Comment: @mcalex: Their subconscious impressions of usage are generally correct. But their conscious applications of terms like "slang" are unreliable. If a speaker genuinely treats a word as slang -- e.g., using it only with friends -- then it's most likely slang. But if a speaker merely *describes* it as "slang", that doesn't mean as much.
Comment: ... but it was a native speaker who said it *was* a 'slang phrase' in the first place
Comment: @WendiKidd I understand that, I was merely pointing out a possible cause of confusion given the last sentence of the answer.  ;-)
Comment: @mcalex Oh!  Silly me, missed that entirely.  Sorry!
Comment: so do pay attention to 'em, or don't?  :-)
Comment: Yeh, that's more or less it.
Answer: My linguistics prof had a nice buzzword for the standard flavor of a language. He called it the socio-economically preferred dialect.
Who decides what is or isn't in the socio-economically preferred dialect is, why, the socio-economic elite which practices and promotes that dialect, through its media and various institutions.
There isn't a single such a dialect of English because there are numerous English-speaking societies in the world, with their own socio-economic elites with their own dialects.
If we were to identify something as Standard English for the entire world, it would have to be some kind of cmmon subset of all those dialects. Unfortunately, one of the implications would be that some objects would be left without names. For instance petrol appears in the socio-economically preferred dialect used in Britain, but in America's equivalent dialect it is gasoline.  So in an international Standard English that is understood by everyone, there can be no word for a highly refined-fuel for spark-ignited internal combustion engines.
Comment: Identifying dialects is a nice way to escape the prescriptive versus descriptive trap. An utterance is not correct or not; but rather, which dialect does it belong to, if any.
Comment: "The socio-economically preferred dialect": absolutely! Language is socially judged everywhere; language is culture, not just grammar rules. But when we teach English as a foreign language (EFL), we teach both _petrol_ & _gasoline_: the international standard cannot afford to be exclusive.
Comment: This is closely related to the idea of a [prestige dialect](http://en.wikipedia.org/wiki/Prestige_%28sociolinguistics%29).  As Wikipedia says, "the most prestigious dialect is likely to be considered the standard language, though there are some notable exceptions to this rule".
Answer: I think these are great answers though I'd like to advance a couple of examples that clarify and simultaneously confuse the picture.  I have long relied on examples such as diplomacy, law, medicine, aviation, navigation, hard sciences  and commerce to demonstrated that consistent rules and definitions are an absolute for a society to remain intact, if they weren't, people and nations couldn't function.
In all these cases, precision with definition and standard usage is a must.  It doesn't take much imagination to visualize what happens when they are not.  Chemistry recognizes metals such as gold as transitional metals.  At first when I heard this I was indignant saying to my son that given the accepted definition of the word 'transition', that telling ones bride to be that her gold wedding band was in fact a transitioning metal would not be met with joy.
Then I realized it was accepted language within a specific discipline I simply wasn't familiar with since I also knew that gold was non-reactive to just about anything and thus such a claim made no sense. So that helped me further understand that discipline specific bodies, such as the ones I mentioned above, governed the use of language within those disciplines and that they were international in scope and more or less accepted final authorities.
Countries couch as Iceland are a unique footnote but show the complexity of how language is developed and regulated,  the Icelandic people jealously guard their own language and, as I understand their practice,  will create a new word rather than adopt a foreign word precisely to preserve the integrity of their unique linguistic tradition.  Importantly, however, they are fluent in languages that call upon international understanding.
I would advance the position that there are indeed narrow bodies of people that govern the vocabulary and use of language but that often they are 'industry' or activity specific because it's the only way to reliably assure understanding and cooperation.  The vernacular and slang of everyday local, regional and even national speech would overwhelm and impossibly complicate fundamental areas of human activity.  This being the case, formal English and rules (now being taught everywhere) are vital to assure vital activities can take place effectively.  Vernacular changes daily, nuclear disarmament treaties and banking contracts and agreements should not.


Avoid Facebook API session_start

Question: I'm getting "session has already been started by session.auto-start or session_start()" error in my Zend Framework Application when I try to instantiate Zend_Session_Namespace. I assume it's facebook api's problem which tries to start the session by its own, I haven't used session_start() anywhere in my application. Is there any way to avoid this from happening?
Answer: Maybe not the best solution but I solved it by editing in the Facebook class constructor the session_start() method and replaced it with Zend_Session::start();
Comment: I think that this is a fine solution. If the Facebook API were rewritten for Zend use it would probably include this sort of fix in it.
Answer: Check your PHP ini file for this type of code
session.auto_start = true
If it's true then set it to false.
When you instantiate a Zend_Session_Namespace it will call session_start. The cool thing is that if you instantiate multiple namespaces only the first one will call session start.
If the session is started manually by you then you might get this error.
Another thing you could try is this

Zend_Session::setOptions( array( 'strict' = 'off' ) );

This will disable any namespace objects from automatically starting the session, allowing you to choose when to manually start the session yourself.

Avoid Facebook API session_start


get past events through the graph api

Question: I can't seem to be able to access past events in the graph api, it only seems to give me access to the current events, either the events API is broken, or facebook does not provide access to past events, but there is nothing in the docs that would suggest that...
Answer:
I'm having a similar problem. There is a workaround using FQL, though it will only display current events and past events from the last 2 weeks.
Example Query:
SELECT name, pic_small, eid from event WHERE eid in (SELECT eid FROM event_member WHERE uid = me())

You need to set "start_time" condition in your query.Works for me.
FQL example that retrieves current & past events :
SELECT name FROM event WHERE eid in (
   SELECT eid FROM event_member
   WHERE uid = {you page or user id here}
   AND start_time > '2001-11-02T12:35:00+0200'
)
Since FQL doesn't support ( Select * ), address FQL manual to query more fields https://developers.facebook.com/docs/reference/fql/
Answer: I'm having a similar problem. There is a workaround using FQL, though it will only display current events and past events from the last 2 weeks.
Example Query:
SELECT name, pic_small, eid from event WHERE eid in (SELECT eid FROM event_member WHERE uid = me())
Answer: It turns out the Facebook pagination is broken for events, but there is a walk around by setting the "since" parameter to 0 and paginating upwards ans oppose to backwards...

get past events through the graph api


Eclipse 3.6.1 and Tomcat 7 problems

Question: Well, it is trivial problems... In fact I started using Tomcat 7 (why not) but when I do Run on Server, Eclipse always fails to get the right URL for the servlet, resulting in my trying to find the right combo for minutes. It's so annoying. Do you have any suggestions? Other servers work correctly, like Spring tc server.
Answer: I think the real problem is that the project doesn't get deployed at all (or do you actually manage to find it in the browser?).
I'm having problems running a project on Tomcat 7 from inside Eclipse, and have so far found no other "solution" than to manually package (using maven) the project and copy the war file into my tomcats webapps dir.
If the problem is really only the initial URL being wrong, then please disregard my answer :P
Otherwise, here's another question of similar sort: Troubleshoot Eclipse's "Run on server" deploy.
EDIT:
I've done some more research, and it turns out that the mojo plugin version 1.1. doesn't work (as well) with tomcat 7, because the deploy path has changed. I'm working on fixing it by adding this line to the pom.xml inside the <plugin> <configuration> tags:
<url>http://localhost:8080/manager/text</url>

But am still having some problems. Will update if I get it working.

Eclipse 3.6.1 and Tomcat 7 problems


Sleep time variable from file?

Question: I am wanting to know is it possible to have sleep in a bash script have a variable time that is read from a file? I am wanting to perform operations in the script that vary in length that will have the timings set by another script.
Comment: Yes. It is possible. Do you want to know how to pass a value from a file to the `sleep` command as a parameter or how to pass a value generated by another command as a parameter?
Comment: Long story short I am wanting to turn a gpio pin on, then wait for a specific time that is recorded in a file, then turn the pin off. Another script will be setting the wait time, and this will need to read it.
Comment: do you want to wait for a specific (absolute) time such as `2015-02-20 12:00:00+00:00` or do you want to wait given number of seconds e.g., `10` (sleep 10 seconds). What do you want to happen if your computer hibernates: do you want the script to wake up immediately or wait the rest of the time e.g., 3 seconds?
Comment: Dedicated server sending commands to raspberry pi over ssh, wont be any hibernation. It will be a given number of seconds, but will change daily, hence the need to read from file to get correct wait time
Answer: To sleep the number of seconds specified in timeout.txt file:
#!/bin/sh
read timeout <timeout.txt
date
sleep $timeout
date

Or using bash-specific syntax:
#!/bin/bash
date
sleep $(<timeout.txt)
date

Answer: Generally this is just a question of getting the information into your script, not so much about the sleep command.
Lets make a simple script 'sleepytime' to get the information from a file (I assume there is just one integer value in that file):
#!/bin/bash

sleep_time_X=$(cat "X.sleepytime")
sleep_time_Y=$(cat "Y.sleepytime")

echo "Going to sleep $sleep_time_X second(s)"
sleep $sleep_time_X
echo "Going to sleep $sleep_time_Y second(s)"
sleep $sleep_time_Y

then on the command prompt:
$ touch Y.sleepytime
$ touch X.sleepytime
$ echo "1" > X.sleepytime
$ echo "2" > Y.sleepytime
$ ./sleepytime
Going to sleep 1 second(s)
Going to sleep 2 second(s)

But it seems that is not a generally applicable approach. The sleep time might depend on factors outside of our control (e.g network requests, downloads etc). Then it would be preferable to wait until the job is done. This can be accomplished with the wait command. Let's make an additional script that calls our sleep script from above:
#!/bin/bash

# Call the sleep script and send it to background (with '&')
./sleepytime &

echo "Waiting for sleepyhead"
wait

The output is:
Waiting for sleepyhead
Going to sleep 1 second(s)
Going to sleep 2 second(s)

Note that the output of the first script comes after "Waiting for ...". Maybe that is an option for you...

Sleep time variable from file?


What exactly did Yahshua/Jesus do during his 40 day fast after being baptized?

Question: It is stated in the Gospels of Matthew, Mark, and Luke that during the 40 day period Christ was tempted by The Devil/Satan but not many other details are given. In the book of Isaiah (Isaiah 58:1-12), the Prophet Isaiah highlights what a pleasing and acceptable fast is according to The Creator. In order for his fast to be acceptable unto The Creator, what was Yahshua/Jesus doing during that period? Are there any stories, commentaries, articles, and/or resources that highlight or discuss what was going on during his 40 days? Thank you.
Comment: No other details are given in scripture and there are none that appear to be prophetic concerning that period of time. It was a time of voluntary deprivation, when Jesus made himself vulnerable to the temptation which was to try him to the utmost. Any attempt at conjecture would be merely an expression of opinion. Jesus authorised only his own chosen apostles to convey spiritual matters concerning himself. When none do so, no more can be said.
Comment: Actually, you raise a point there. Mark 1:12 _The Spirit drove him into the wilderness._ But I take that, it being the Spirit, this is not an involuntary or unwilling 'being driven'. Rather, the influences of the Spirit are _within_ one's own spirit. And I see no difference in this in Jesus' case (in his humanity). There is influence and there is response. It is not being 'forced' but being 'driven' of an influence. (Up-voted +1.)
Comment: @Nigel As always I appreciate your taking to respond beloved.  Being how there are no scriptures detailing the experience and none that appear to be prophetic what brings you to believe that it was voluntary?
Answer: The Bible tells us that after Jesus was baptised in the Jordan (Matthew 3:13) he was led by the Holy Spirit into the wilderness and fasted for forty days and nights.  The purpose of this period of total fasting was to prepare him for the ministry that would change the world.
Satan offered Jesus alternatives to God's plan, compromises that would satisfy His natural desires, and attacks upon His very identity as the Son of God (Matthew 4:3). Jesus used the Word of God, not His own strength, to defeat those temptations and remain victorious over sin.  Jesus demonstrated that fasting can strengthen us spiritually when we use it to draw closer to God.
After Jesus' fast, the devil left Him and "angels came and attended him" (Matthew 4:11). Luke 4:14 concludes the account of this testing time by saying, "Jesus returned to Galilee in the power of the Spirit."  He had conquered temptation and was ready to embrace the purpose for which the Father had sent Him.  He would not rely on His humanity to perform miracles, deliver the oppressed, or defeat death.  Fasting was a way to declare mastery over His human nature so that He would live every moment directed by the "power of the Spirit" (Luke 10:21).
Moses and Elijah took part in miraculous, forty-day absolute fasts. When Moses met God on the mountaintop to receive the tablets of stone, he ate no bread and drank no water (Deuteronomy 9:9). And, after Elijah defeated the prophets of Baal on Mt. Carmel, infuriating Queen Jezebel, Elijah fled for his life and spent forty days of fasting in the wilderness (1 Kings 19).
This type of fasting is quite different to the fasting described in Isaiah chapter 58.  The nation of Israel was rebellious and had sinned against the LORD.  Although they cried out for justice their hypocritical actions and injustice made a mockery of their fasting and apparent humility.  That is why Isaiah had to rebuke them.  Not so with Jesus, who was without sin and was the Son of God.
You ask what Jesus did during these 40 days in the wilderness.  He fasted, he prayed and he resisted temptation.  The following commentary (by Matthew Henry) regarding the events in the wilderness is helpful. It is a lengthy and detailed commentary, which concludes:

Christ was thus succoured after the temptation, [1.] For his encouragement to go on in his undertaking, that he might see the powers of heaven siding with him, when he saw the powers of hell set against him. [2.] For our encouragement to trust in him; for as he knew, by experience, what it was to suffer, being tempted, and how hard that was, so he knew what it was to be succoured, being tempted, and how comfortable that was; and therefore we may expect, not only that he will sympathize with his tempted people, but that he will come in with seasonable relief to them; as our great Melchizedec, who met Abraham when he returned from the battle, and as the angels here ministered to him.

Lastly, Christ, having been thus signalized and made great in the invisible world by the voice of the Father, the descent of the Spirit, his victory over devils, and his dominion over angels, was doubtless qualified to appear in the visible world as the Mediator between God and man; for consider how great this man was!

Source: https://www.christianity.com/bible/commentary.php?com=mh&b=40&c=4
Comment: First and foremost I thank The Most High for you even sharing and having it in your heart give your insight into the matter.  Concerning Isaiah 58 what leads you to believe that there are different types of fast? I see it as your end goal may be different but your approach within it (sincerity, dedication, etc) must be pure which I believe is the primary basis for all fasts.  Also, the assumption is that he prayed (I believe it to be true as well) but is that all he did (resisted temptation as well)?
Comment: Yes, I make an assumption that Jesus was in communication with his Father (through the Spirit and in prayer. I would not care to speculate any further.