Zap the [advice] "meta-tag"

Question: Seriously, there's 403 questions tagged <code>[advice]</code> on Stack Overflow, 79 SU, 24 SF.  It must be a contender for the most useless tag ever.
Answer: Agree. The very picture of a meta tag ..

How can you tell you're using a meta-tag? It's easier than you might think.

If the tag can't work as the only tag on a question, it's probably a meta-tag. Every tag you use should be able to work, more or less, as the only tag on a question. Meta-tags, like [beginner], [subjective], and [best-practices], are useless by themselves — they tell you nothing at all about the content of the question.

If the tag commonly means different things to different people, it's probably a meta-tag. In a cruel, ironic twist, the meaning of the tag [subjective] itself … is actually subjective. Ditto for [best-practices] and [beginner]. Best practices to whom? Beginner by what criteria? These tags are impossible to define by anything remotely resembling an objective metric. In comparison, the the meaning of tags like [java], [c#], and [javascript] are crystal clear to all but the nuttiest of nutbags.

... burninating it now.
Comment: Bah, I got sworded :-(
Comment: while I agree [advice] is a poor tag, why not just make it so meta-tags can only be added after one or more tags are added?  that way you can have the best of both worlds.  meta-tags are not useless.

Zap the [advice] "meta-tag"


Can't get Connected React Router set up properly

Question: I'm trying to update to connected-react-router while updating all my React, Redux and Router versions.  I am having trouble with the root reducer and store creation.
The previous reducer code that was working was...
const appReducer = combineReducers({...reducers, router: connectRouter});

export const rootReducer = (state: IAppState, action: IAppAction) => {
    return appReducer(state, action);
};

And for index.ts was:
import 'rxjs';
import { createStore, applyMiddleware, compose} from 'redux';
import { createEpicMiddleware } from 'redux-observable';
import { routerMiddleware } from 'connected-react-router';
import { logger } from 'redux-logger';
import { api, endPointKeys } from '../config';
import { IEpicDependency } from '../models';
import { rootReducer} from './root-reducer';
import { rootEpic } from './root-epic';
import { appHistory } from '../app-history';

const dependencies: IEpicDependency = { api, endPointKeys };
const epic = createEpicMiddleware(rootEpic, { dependencies });
const middlewareList = [epic, logger, routerMiddleware(appHistory())];
const windowlfDefined = typeof window === 'undefined' ? null: window as any;
const composeEnhancers = windowlfDefined.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__   || compose;
const middlewares = composeEnhancers( applyMiddleware(... middlewareList));
const store = createStore(rootReducer, middlewares);
export { store };

Now that I add in connectRouter...
import { combineReducers } from 'redux';
import { connectRouter } from 'connected-react-router';
import { IAppState } from './state';
import { IAppAction } from './app-action';
import { reducers } from './reducers';
import { History} from 'history'

export const rootReducer = (state: IAppState, action: IAppAction,history: History) => combineReducers({...reducers, router: connectRouter(history)});

it produces the error for router of...
Type '(reducer: Reducer) => Reducer' is not assignable to type 'Reducer, AnyAction>'.
  Types of parameters 'reducer' and 'state' are incompatible.
    Type 'Reducer<{ router: RouterState; }, AnyAction> | undefined' is not assignable to type 'Reducer<{ router: RouterState; }, AnyAction>'.
      Type 'undefined' is not assignable to type 'Reducer<{ router: RouterState; }, AnyAction>'.
I don't fully understand why state and action were able to not be passed before but by adding the history parameter, index.ts now demands three parameters be passed and I don't know that there's anything passable in this situation.  How do I change this to get it working? Thanks in advance
Answer: Found how to do it!
const appReducer = (history) => combineReducers({
    reducers...
    router: connectRouter(history)
  })

const rootReducer = (state, action, history) => {

  if (action.type === LOGIN && action.payload) {
    state.forgot = null;
  } else if (action.type === LOGOUT) {
    state = undefined
  }

  return appReducer(history)(state, action);
}


Tracing your Jewish roots

Question: How do you find out about your Jewish lineage if you only have very limited information (ex a place of birth, grandfather's name?)
Comment: If a Jewish person's lineage is not related to Judaism,  then I don't know what else is. Without Jews, what is Judaism?
Comment: see this good book (https://www.amazon.com/Generation-Jewish-Genealogy-Family-History/dp/1118104420) or ask on a site like https://www.jewishgen.org/
Comment: That is why people will have a *giyur misafek* (conversion because of doubt). Note that even if the grandfather can be proven to have been Jewish, the grandmother (mother's mother) will still have to be proven Jewish.
Answer: Nice timing, Terri!
A couple of weeks ago I was given a pile of books, and in it was one called Finding Our Fathers: A Guidebook to Jewish Genealogy by Dan Rottenberg.  It has step by step instructions for finding out information about your Jewish relatives.  It also has a list of over 2000 Jewish names in the back, with information about what families are related to them, places of origin, etc.  I'll summarize a bit from this book as my answer:
First of all, arm yourself with a notebook.  Prepare a simple family tree, and fill in all the names you can as far back as you can. A good way to get starting information is to locate elderly relatives and talk to them.  One of them might just have your information. If they don't, they will surely help you fill in your tree with some names of your forbears. You have a birth date - if he's not still living somewhere, do you know where he did live, or where he's buried? Visiting graves can give you more information, sometimes a lot more if several generations are buried there.  At the least, you will have his and his father's Hebrew names to work with after the visit.
Back to finding information on just your grandfather--did he live in the United States?  If he did, and you found approximately where he lived, you can start by researching online census information.  Ancestry.com gives you some access without having to subscribe.  The National Archives' site http://www.archives.gov has step by step instructions on Census records, as well as other good information, such as ship passenger lists.  You can also look for birth, death, and marriage information in the public records of the location he lived.  If he wasn't born in the US, you can get information about him in the public records of the country he was born in. If they still exist, the synagogues and other Jewish institutions near his birthplace also might have good information.
Hopefully, this answer can get you started.  The book gives plenty of other sources for information, such as Jewish libraries and archives in the US(American Jewish Archives, American Jewish Historical Society, YIVO Institute, etc) and worldwide, for the generations when your family was...wherever it was.  Happy hunting!

Tracing your Jewish roots


Why, where and how we use envelope detector in AM demodulation?

Question: I have studied AM modulation and demodulation. But i can't understand the purpose of envelope detector in demodulation. So my question is:
Why, where and how we use envelope detector in AM modulation?
Comment: this is one way detect carrier amplitude changes to recover baseband data signal before a "slicer" or precision comparator.
Answer: I don't understand how you could have studied AM demodulation and not understand the purpose of an envelope detector. Something is lacking in your studies.  In any case, in AM (the M stands for modulation) all of the information is contained in the  amplitude variations of the carrier.  That amplitude variation is usually called the envelope of the resultant AM signal due to its appearance on an oscilloscope.  Hence, to recover the signal information, the envelope of the AM signal must be extracted.  This is the job of the envelope detector, hence the name.  For analog AM, such as ordinary broadcast radio, an envelope detector is as simple as a diode and a low pass filter. Any communications textbook can provide more information.
Comment: I think "have studied" should be replaced by "am studying" or "am learning". Not all languages use progressive tenses.
Answer: An envelope detector is the cheapest and fastest way to demodulate an AM signal.

simulate this circuit – Schematic created using CircuitLab
The purpose of the diode is to only allow the positive alternations of your input signal (or negative if you flip the diode) to pass to the RC circuit, and detect either the positive (or negative) envelope of your signal.
Then the capacitor will gradually charge up until the voltage across it reach the maximum value of the rectified voltage. The time constant of the RC circuit must be well choose so that the discharging time of the capacitor is not too short or not too long. In fact, the time constant must be big compare to the carrier period and short compare to the modulating signal period.
Answer:
i can't understand the purpose of envelope detector in demodulation

Think about feeding the output of an AC power variac to a half wave rectifier with a filter capacitor and load. The peaks of the AC voltage would produce a dc voltage on the output of the rectifier. Now slowly move the variac output producing a bigger then a smaller AC voltage and note that the output DC rises and falls with the changes in the AC voltage from the variac.
The diode, capacitor and load resistor ARE an envelope detector.
Now speed this scenario up with the variac control being replaced by an audio signal modulating an RF carrier and you still have an envelope detector that demodulates the audio. Previously the power AC was the carrier and the movement of the variac wiper was a slow moving sub-audio signal.
Answer: Here's the concept represented graphically, below, and if you left-click the image it'll probably be displayed full-screen.
MCW is a 1MHz carrier modulated by a 1kHz signal, D1,C1, and R1 comprise the envelope detector, and AF is the detected 1kHz modulating signal.
Note that AF is pulsating DC.
Answer: AM modulation is of two types

AM with large carrier (AM-c)
AM with suppressed carrier (AM-SC)

the suppressed carrier type AM has also has two types AM-DSB(double sideband) and AM-SSB(single sideband). the large carrier one is also double sideband but it is called AM-C that is AM with carrier.
Now coming to the question AM with suppressed carrier is difficult to demodulate because carrier is suppressed(not present) and to demodulate we need to multiply signal with carrier, therefore comes to the picture synchronous detection technique in which a carrier is generated at the receiver side which is then multiplied with the receiving signal.
In case of AM-C which employs envelope detection technique a carrier is already present in the signal. so baseband signal (message signal) and carrier signal form an envelope which is AM-C and this envelope is detected by envelope detector.
envelope detector is nothing but a diode followed by low pass filter. when you will see the diagram of AM-SC and AM-C the difference you will see is that in AM-SC there is a phase reversal at zero crossing. the phase of the envelope changes to 180 while in AM-C there is no phase reversal. so that is another reason to use different demodulation techniques and also the concept of modulation index. it is very wide topic first you need to study different modulation demodulation techniques


Parsing PDF Content

Question: I have a PDF attachment. I want to add the contents of this attachment to another VF page that is rendered as PDF. Is there any way to parse the PDF contents in salesforce, which allows us to parse the content of the PDF and add them to another page?
Answer: I doubt there is such feature in salesforce. But many online services as aspose might help you here although most of them are cost money.
Answer: The answer to your question would be "it depends". As background, in the late 1990's I was in the Desktop Publishing business and was a volunteer sysop in the Adobe Forum on CompuServe. I also beta tested their software. So I have some intimate knowledge of the subject and what one can do with these files.
I say "it depends" because it would greatly depend on your knowledge of the postscript printer language. "PDF" is an acronym for "Portable Document File" (now correct thanks to nudge from sfdcfox). PDF's are derivatives of output files originally intended for processing by postscript printers. There are many 3rd party PDF editors, readers and software printer drivers (RIPs and emulators) available. There's even a WORD plug-in for creating PDF forms. What all that means is that if you're familiar with the language, you can do most anything you want.
If you want to "roll your own code", I suggest you visit the Adobe web site to review the postscript docs, API, etc. You'll probably also want to look at Adobe AIR for Salesforce as that might come in handy as well even though it's primarily used for adding Flash animations to VisualForce pages. I say that because I believe it provides access to other Adobe developer functions as well, but can't say that for certain as I've not spent any time playing with it.
Otherwise, if the first attachment is rendered from another VisualForce page, your best bet would be to create a custom controller that combines the functionality of the two different VisualForce pages and print them both at once. The latter would require far less development time than rolling your own PDF processor; something that's not a trivial task.
Comment: Not trying to nitpick, but the file format is actually the "Portable Document Format" (e.g. see Wikipedia), and while it is true that it was derived from a "PS" (PostScript) file, a PDF file is significantly more complex, including possible compression and font tables. It is highly unlikely that any PDF of any size would be directly accessible in salesforce.com, due to the amount of CPU time given, plus the fact that one cannot "directly" manipulate bits in Apex Code (there is no "byte" type, for example).
Comment: Oops! You're right about the name being Portable Document Format. Was too early in the morning when I wrote this. That said, if one is basically trying to join the two files into one, I don't see that as being nearly as difficult as creating a general PDF RIP. No doubt that one would have to assume no encryption or overall file compression of the PDF. But then, my experience goes back to Acrobat 3 and there have been many new features implemented since then.(grin) I know of booklet layout software for printers that was fairly simple & I could see this being similar.

Parsing PDF Content


How do I denote (shade/hatch) a curved surface in a technical drawing?

Question: I am creating some 2d technical drawings, is there a standard way to shade/hatch a curved surface?
Comment: I'm no expert in tech drawing, but I found this PDF on drawing section views: http://user.engineering.uiowa.edu/~mie032/Support/EG/EG07_Section_Views.pdf - which seems to suggest only the flat surface of the cut section is typically shaded.
Answer: As @Billy Kerr 's linked document correctly shows, in a section view, the area hatched is only the portion of the object directly sliced by the section plane.
In some section drawings, one may choose to also use shading to indicate form, if the view ends up confusing and the object forms are complex; in those cases, great care must be taken to clearly differentiate the cut poché from the surface shading to avoid any confusion - this is why in most simple technical drawing sections, the illustrator chooses to eschew surface shading completely - for simplicity and clarity.
In architectural sections, sometimes we keep the surface shading to help clear form reading - I did that in this perspective section of a sub-assembly of a complex interior door - though for this example the sectioned area doesn't have a  hatch, it has a poché, which indicates it having been sectioned, but not any specific materiality:

But more typically in architectural sections we only hatch cut areas, and avoid surface shading, and if a section is not schematic, we show the hatch for the relevant sectioned material, just as is common in other technical drawing typologies:

Here's a super-quick example (at client's site w/ none of my typical CAD tools - this was Affinity Designer running fast and loose) to show conceptual relationships:

Hope that helps.
Comment: That's great. I was curious, because I don't remember learning anything about it, but have seen technical drawings with various different gradient hatching denoting curves. I like the concept of the last image above. I may incorporate that into my work.


How do you subtract two time values in military format in Google Apps Scripts for a spreadsheet?

Question: One column is labeled Checkin Time and the other is labeled Checkout Time and finally I have a column that is labeled Total Time Worked.  The cells in the Total Time worked column should subtract the time in the checkout time column from the time in the Checkin Time column.  How do I do this in the script?  The times in the Checkin and Checkout cells are in the military time format which I got from the timestamp upon the form submission.
Answer: Here's a script that should do what you need:
var MilitaryTime = function(value) {
  this.timeValue = parseInt(value, 10);
  this.hour = Math.floor(this.timeValue / 100);
  this.minute = this.timeValue % 100;
  this.totalMinutes = this.hour * 60 + this.minute;
}
MilitaryTime.fromMinutes = function(totalMinutes){
  var hours = Math.floor(totalMinutes / 60);
  var minutes = totalMinutes % 60;
  return new MilitaryTime(hours * 100 + minutes);
};
MilitaryTime.prototype.subtract = function(otherTime) {
  return MilitaryTime.fromMinutes(this.totalMinutes - otherTime.totalMinutes);
};

function militaryTimeDiff(startTime, endTime) {
  var diff = new MilitaryTime(endTime).subtract(new MilitaryTime(startTime));
  return diff.totalMinutes;
}

The militaryTimeDiff takes as arguments two time values in military format (HHMM) and returns the total number of minutes between them.
You can use it in your spreadsheet formula like this (replace the cell references with the correct ones):
=militaryTimeDiff(A1, A2)

Note: this only works correctly for values within the same day. If you have, for example start time = 2350 and end time = 0125, the function will not realize that the times represent two different days and will return a negative difference.
Answer: With the following piece of code you can subtract military formatted times.
Code
/**
 * Subtract Military Formatted Times
 *
 * @param {cell} checkin The time at which you have checked in
 * @param {cell} checkout The time at which you have checked out
 * @return The time difference in Military Time Format
 * @customfunction
 */
function myTime(start, end) {
  var diff = getMs(end) - getMs(start);
  return Utilities.formatDate(new Date(diff), "GMT", "HHmm");
}

function getMs(value) {
  var h, m, vSub, vLen, v = value.toString();
  vLen = v.length + 1, vSub = Math.round(vLen / 2, 0) - 1;
  h = v.substring(0, vSub), m = v.substring(vSub);
  return (h * 60 * 60 * 1000) + (m * 60 * 1000);
}

Screenshot

Explained
The getMs()  function breaks down the string into two pieces, dependent upon the length of the string; hours and minutes. Returned are the amount of milliseconds.
The myTime() function will calculate the difference between the checkout and the checkin time and return a military time format.
Example
I've created an example file for you: Subtract Military Times
Add the script under Tools > Script editor  and press the save button.


Permissions to a document library

Question: So I'm not sure how to do permissions or best practice for my situation.  So I work for a real estate company and when they buy a property they have documents for each stage of the project.  Stages are as follows: Due Diligence -> Purchasing -> Management
Some people will only need access to the due diligence and some just need access to purchasing, and others to only management.  So reading up on this it looks like I might go the way of making three different document libraries, and then basing permission on those libraries, however documents will have to be moved from one library to the next as it progresses through the property purchase stage. Is there a way to base permission off metadata tags or content type on the documents, and just use one document library?
Answer: I would just make one document library with three folders, uninherit those folders to make unique permissions, and then create a workflow that takes the document and moves it to a different folder. You can create a view that looks at all documents and the folder it's in.
Comment: My fear with folders is that if they make folders, they will not use any of the tagging.  I know its policy and user training.  Thank you for the response, curious to see what others think how to do this.  Also we will eventually have numerous properties, and will need to expand this out.
Comment: Have different views and different forms for the respective stages of the document. You can have three links that say "Upload Due Diligence" "Upload Purchasing" and "Upload Management" with three separate custom forms created in sharepoint designer that hones the fields you care about for each category.

Permissions to a document library


Maven - How to find correct groupId/artifactId to include dependency in POM

Question: In general, what is the best strategy for finding the groupId and artifactId for a well-known dependency for use in a Maven POM? For example, how would I find the correct entry for the MySQL JDBC driver? It's not mentioned on the mysql.com site, so I would usually spend time looking for another POM that already uses the Maven repository version of the jar. This can't be the best way.
Answer: I would suggest to use http://search.maven.org
Answer: M2Eclipse, the maven integration of eclipse, supports local searchable indexes of maven repositories. So you can right-click a project or a pom.xml and do
<code>Maven -> Add Dependency
</code>
A dialog appears where you can search for artifacts from your local indexes. Wouldn't want to miss it.
If that's not an option, use mvnrepository.com
Comment: http://mvnrepository.com is the main repository where you can find most of the .jars you want and there  annotations for your pom.xml file. Plus they provide the other dependecies of the artifacts you use.
Answer: Most of the time my IDE does this for me. But when I'm not sure I search manually; Google really helps.
You can also search on maven search engines like this mvnrepository.com.
Answer: I use http://repository.sonatype.org.
Answer: Maven site suggests to browse biblio to get maven co-ordinates; http://www.ibiblio.org/ .
Say for log4j

First, we need to know what the groupId, artifactId, and version are for log4j. We can browse ibiblio and look for it, or use Google to help by searching for "site:www.ibiblio.org maven2 log4j".

Maven metadata for log4j: http://mirrors.ibiblio.org/maven2/log4j/log4j/maven-metadata.xml
Answer: In my experience the best option is mvnrepository.com. for example in your case, just type mysql in the search text field. you will find all available artifacts that contain mysql string. in your case the one fit your needs is: mysql-connector-java
for each artifact you have a general description that helps you decide what is best for you.
once you click it you get all the available versions and once you click on a version you have all sort of information about it like the code you need to add to your pom.xml, the artifact dependencies and so on...
Answer: 1. Go to http://search.maven.org
2. Search in the required jar with groupId/artifactId or Just with basic text.
Like for your case


What is the lightest cipher that provides AES like security?

Question: The lightest, or fastest cipher, that is well known and quite secure like AES. Is ChaCha20 a good option? Are there any better alternatives that are faster but still as secure?
Answer: I don't have enough reputation to add this as a comment:
NIST is currently in the process of standardizing a lightweight cipher is intended to provide "AES-like" (i.e., >128-bit) security. However, the evaluation process is still on going and it will still take some years to produce official standards, so it's best not to use any for security critical use cases yet.
Here is a link to the finalists: https://csrc.nist.gov/Projects/lightweight-cryptography/finalists
You may also consider the ASCON (also a finalist of the aforementioned LWC competition) or ACORN ciphers for lightweight uses, but again, no standards have been produced here: https://en.wikipedia.org/wiki/CAESAR_Competition


How to get current date for timezone in javascripts

Question: I have a pattern format of timezone as below "2021-10-29T18:01:23+07:00",
and so I want to get the current time with the same time zone as above, can someone help me with this problem,
I tried this code but it doesn't work
new Date().toGMTString()

Thank you so much.
Comment: [this maybe?](https://www.delftstack.com/howto/javascript/initialize-javascript-date-to-a-particular-timezone/)
Answer: In generall I would recommend looking into MomentsJS. It is very helpfull when working with Date. It comes with Format Functions and also with features where you can safely add or deduct Date.
MomentJS Docs: https://momentjs.com/
Answer: With native Date methods, the closest you can get is with use of:
new Date().toISOString() // '2021-11-02T13:12:26.229Z'

But this returns GTM time, to obtain local time in your specified pattern, you have to format it yourself:

function formatDateString(date) {
    //Function to format numbers (prepending leading zero and adding sign)
    const f = (n, sign = false) => (sign ? (n < 0 ? "-" : "+") : "") + n.toLocaleString('en-US', { minimumIntegerDigits: 2, useGrouping: false });

    //Compute Date, Time and Zone
    const d = `${date.getFullYear()}-${f(date.getMonth() + 1)}-${f(date.getDate())}`;
    const t = `${f(date.getHours())}:${f(date.getMinutes())}:${f(date.getSeconds())}`;
    const z = `${f(-date.getTimezoneOffset() / 60, true)}:00`;

    //Return it all together
    return `${d}T${t}${z}`;
}

var mydate = new Date();

console.log(mydate.toISOString());
console.log(formatDateString(mydate));

Or you can use 3rd party library like MomentJS.


EMP blast effects and ranges

Question: Could I have some info on what would be realistic ranges for EMPs from nuclear bombs of different yields?  I'm unclear about that.  Of course it depends on altitude and blast yield, and some electronics can take more than others, but just in general what area would it affect?
Answer: Starfish Prime had an EMP blast radius of approximately 900 miles. More if elevation is taken into effect.
This Wiki page shows a map with most of the US affected, which would be approximately 1500-2000 miles.
But of course this all depends on yield, height of detonation, bomb design. The Wiki hints at a super-powerful gamma detonation that would produce a much more intense EMP, but its existence is not confirmed.
You've got a lot of leeway to work with. For a limit, I'd suggest staying within the visual horizon, as suggested but not confirmed in the article linked.
Comment: It's worth noting that EMP does its damage by inductive coupling.  Move a magnet (or an EMP-generated magnetic field) across a wire and you induce a current.  The longer the wire, the more current can be induced.  It's not generally the computer motherboards that are at risk... it's the power cables that conduct a massive induced current that blows the computer's circuits.  Turn off the power strip before the EMP and your computer would likely survive.  Hard drives, on the other hand, and all other magnetic media... all would be wiped clean.
Comment: Yes, but the article notes (and correctly so) that everything from the natural planetary magnetic field over the location to weather at the time to the location of mountains and whether or not there is a high water table or not can and will affect the strength of the blast.  If you're doing this for a story, I wouldn't bother with that level of detail (unless it is something useful for the plot of the story :-) )
Comment: "The EMP at a fixed distance from an explosion increases at most as the square root of the yield." That 'at most' is pretty critical. The article then goes on into considering how much of the detonation is used for EMP effects (higher percent for smaller bombs, smaller percent for thermonuclear explosions...) And JBH is absolutely right. Any given nuclear EMP would be a calcu-guesstimated crapshoot.
Comment: I see.  As for the starfish prime blast, would it be reasonable for a very rough estimate to say that a blast at the same altitude with four times the yield would be able to have the same effects at twice the distance (by the inverse square law)?
Comment: Actually, that doesn't make sense now that I think about it.

EMP blast effects and ranges


What is the purpose of Gradle?

Question: I could use a little help understanding the concepts behind Gradle(plugin v 0.7) in the context of Android Studio 0.4.0. I have not used Gradle before and it's causing me nothing but problems. I'm not seeing its purpose/benefit because I don't know enough about it.
Some specific questions I have

What are these dependencies? I'm making a simple app with a
navigation drawer, targeted to API 11+ where it should be natively
supported. What dependencies could I be using?
What is a Gradle wrapper? What changes, if any, does it make to the completed application?
Why does Gradle need to be online constantly? I don't have
internet access on my personal laptop when I'm at work. It's gotten
to the point that I can't run or test my app because Gradle can't
resolve some resource without internet access.
Why is it important that Gradle uses Groovy? I have searched
around the internet and that tends to be something people like about
Gradle but they don't usually explain why Groovy is important or
what it does for an Android app.

Sometimes it's tough as an intermediate programmer as information tends to be overly simple or overly complex. Aside from my specific questions, any additional information you can provide would be useful. I'm not looking to debate the pros and cons of Gradle vs other tools that may do the same thing, I'd just like to know more about Gradle and its use so I can make informed decisions.
Thanks
Comment: Take a look at the offical website http://www.gradle.org/overview
Comment: Are you familiar with how build tools (like Maven as well as Gradle) provide value as a general matter? And how Maven works? Just curious about your frame of reference.
Comment: No I haven't used Maven before. I have academic experience with Eclipse/ADT which uses an ANT plugin. I thought ANT was only for error checking (maybe I was wrong?) I have read that Gradle is based on Maven and ANT but don't have any more understanding than that.
Comment: Also, take a look at the android docs for the new build system,  http://tools.android.com/tech-docs/new-build-system
Answer: Some of your questions are general in that they speak to why build tools are a good thing as a general matter. Others get to Gradle specifically. I will try to address both categories as succinctly as possible while trying to avoid others' nitpicking terminology.
Build tools like Maven, Gradle, SBT, Leiningen, etc. help to automate tasks that we would otherwise have to manually perform or "manually automate." I use the latter to describe  what I used to do with Ant--writing custom tasks to compile, run, generate Javadoc, etc. so the tasks could be automated for the future. By conforming to conventions originally defined by Maven and adopted by the others subsequently (like putting your source in src/main/java), this becomes possible. If I follow the conventions, the build tool can compile, run, generate Javadoc, test, and everything else with minimal extra work.
Now to your questions (in order):

Another critical function of build tools is to reduce "jar hell" by managing dependencies in a consistent way across builds. I just specify which version of Apache Commons or Google Guava or Spring or Jackson I want (or even range of versions) and the build tool will download them and put them somewhere so they can be in the classpath and in the build if applicable (like a war file). I can also define scopes--like I want this dependency to be available at compile time but this other one only at runtime. Do I need to provide it explicitly, or will it be available? Stuff like that.
This is Gradle specific. As described here, the Gradle wrapper helps teams run Gradle without having to manually install Gradle while also maintaining consistency. Everyone uses the same version. Once you set it up, you never have to worry about it, and all the Gradle tasks you want to use are available via the wrapper, so you need not even care that it's there. You can choose to install Gradle directly and run it directly, but I rarely see the point.
This is general. I mentioned dependency management earlier. In order to fetch these dependencies, the build tool needs to get online where they are available from Maven Central or a bunch of third-party repositories. Another Maven innovation adopted by the others is repository management, so compiled artifacts are published to a repository according to convention so other projects can use them. Usually, you don't care about that. You just tell the tool you need a certain dependency, and it knows how to grab it because everyone follows the conventions. In situations where you are without internet access (something I am quite familiar with), your options are to just grab all dependencies when you are online and then optionally to set up a local Maven repository like Nexus or Artifactory to publish those artifacts to. Then you tell your build tool to look there as well as Maven Central, etc.
Maven is configured with XML, and that seemed really cool at the time. But there are two consequences. One is the configuration becomes very verbose. Another is that it gets hard to do custom things. You have to do everything declaratively in XML, which many find to be a pain. You configure plugins in XML, or you write your own and wrap it in a way Maven can understand and can be configured in XML. It is a lot easier and more powerful to do custom build stuff in code. Gradle chose Groovy for this because Groovy makes for nice DSL's and is really easy to learn for Java developers coming from Maven. SBT chose Scala and Leiningen chose Clojure because those build tools target those languages/platforms, so a Scala developer, for example, doesn't have to learn anything new to use SBT besides the DSL. But the broader point is that relying on code rather than XML has a lot of benefit.

Hope that helps.
Answer:
What are these dependencies?

There are so many cool libraries you might decide to use. And a lot of these libraries are supporting the integration with gradle now. So no more importing the project and hosting it yourself. Everything is hosted on mavencentral. You still need the support library for example, even if you decide to target API 11+.

What is a Gradle wrapper?

A gradle wrapper is an awesome tool, if you're working in a team, or especially on an open source project. You don't need to have gradle installed. The gradle wrapper will download and cache all its dependencies on the first run. So all the developers on your team can build the project really quickly.

Why does Gradle need to be online constantly?

Because the dependencies need to be synced. You're in luck, if you are using Android Studio though.
The latest version supports a "gradle offline mode".
From the release notes:

Studio now supports Gradle Offline mode. This is useful if you find
  yourself without a network connection, and your dependencies are using
  the plus-syntax to pick up the latest available version. In that case,
  Gradle will once per day (by default) connect to the artifact
  repository to see if there is a more recent version. If that network
  connection fails, the build fails. If you don't have a network
  connection, this is problematic. You can now open the Compiler >
  Gradle options and enable Offline mode, which will tell Gradle to
  ignore update-to-date checks:

Why is it important that Gradle uses Groovy?

You write gradle plugins in Groovy. And all your gradle tasks in build.gradle as well.

Caution: I'm not an expert in gradle. In fact a relatively new user as well.
Comment: Thanks for the screenshot, it was a big help
Comment: Nice job mentioning Gradle Offline mode in Android Studio.
Answer: I understand what everyone states as far as why the online portion of Gradle is necessary, but for those of us behind firewalls at work, or when we might be working offline, it really puts a burden on us to have to go online at least once to be able to compile in offline mode.
I just don't understand why this requirement is placed on the project. What if I'm starting an entirely new project in Android Studio that I want to test a concept with? I can't do it unless I'm online at least once. What if I don't have access to internet at that time and want to do this? What then?
Seems like an unnecessary requirement that burdens the developer with unnecessary issues that could be avoided. Again, I understand the reason behind it, but still, to force a requirement of at least compiling once online in order to use offline seems a little ridiculous.
I want to use Gradle, but at this point in time, it's something we can't even use at work due to the online requirement. I'll have to work with our security department to determine what holes to punch in our firewall in order to allow this through as well as setting up our proxy correctly to allow it.
So, at this time, I cannot recommend Gradle for use at my place of employment which means we also will continue using Eclipse for Android development as opposed to Android Studio. Seems like a limiting requirement that doesn't seem necessary.
Comment: I have the same problem. Downloaded and started Android Studio. Just can't do it as it tries to download some Gradle dependencies and it just hangs there waiting. I'm behind a proxy :(. Is there a way to disable Gradle and move forward. I'm willing to find the dependencies manually, by myself and write build scripts than the IDE failing to start-up. :(
Answer: Let's assume, that understanding of the following points serves as aggreeable basis:

What are classes, interfaces, APIs, packages, modules and libraries.
What are module dependencies and what means "dependency management".
A complexity of modern applications. Even if you do a simple "Hello, world" app (would it be a desktop application or web-application), it should include a dozen (if not a hundred) of various libraries. All these libraries provide infrastructure to your app, but many of them are not directly related to it's logic.
If your app is not "Hello, world", then hiding it's complexity (by proper modularization) and automating it's assembly and testing (by use of proper build tools) becomes crucial to success.

With this understanding in mind (and taking into account precious considerations, listed by dear colleagues above) it makes sense to start talking gradle, ant, ivy and maven.

What is the purpose of Gradle?


use continuous data or group based on score?

Question: I have done a research where I grouped participants based on their scores on Beck Depression Inventory (BDI-II). In study 1, my groups were healthy controls (scores 0-13) vs depressed (>13). In study 2, they were regrouped to mild, moderate and severe depression in addition to the control group. I've been under the impression that what I do is fine, but reviewers in a journal I send the paper for have mentioned that it reduces the power of study and that it is "unconventional" to group based on BDI scores (and not clinical interview). They have suggested that I erase the groups and re-do the analysis with the continuous BDI-II scores. But doing this would mean completely rewriting the paper.
I need opinions from people who are better than me in statistics. Is it worth re-doing the analysis? Does it reduce the power really that much? is it really that unconventional?
I will be very grateful to get your opinions. thank you in advance!
Answer: Grouping your observed data reduces power because it erases all differences within the groups.
For example, if the main effect of the intervention is to reduce depression from 12 to 4, but will not affect depression at levels 12 and above, grouping the data would erase that kind of difference.


How to start with elliptic functions

Question: I need to start with elliptic function and elliptic integrals. I would like to have three or four fundamental references. If possible one easy and introductory with the very basic stuff, two intermediate and finally the "must have" bible on the subject. I don't know if anyone has something to suggest me.
If available also videos would be interesting.
Thank you in advance
Comment: Maybe start here https://en.wikipedia.org/wiki/Jacobi_elliptic_functions and stop there https://dlmf.nist.gov/22.
Comment: Ok, now can you give 4 books in between?
Comment: @Daco. Sorry, no.
Comment: I was writing an answer when I realized there is a very similar question already. Is there anything that is not answered in this question: https://math.stackexchange.com/questions/405383 ? Maybe this is also relevant: https://math.stackexchange.com/questions/181503
Comment: See the last part of [my answer](https://math.stackexchange.com/a/1793756/72031).
Answer: I found the complex analysis text by Frietag very good for getting started on Elliptic Functions.
After the first half of the book on complex analysis you have the necessary information about meromorphic functions, the way residues, zeros and poles match up and also the weierstrass product and mittag-lefler partial fractions methods. This makes the construction of $\wp$ transparent as the search for a natural meromorphic function with poles on lattice points.
Then the theory of Laurent series is applied to get the Eisenstein series and their relationships, as well as finding the elliptic curve equation. There is some abstract algebra next to study the field of elliptic functions on a lattice. The next chapter follows naturally by looking into modular transforms that preserve lattices and theta functions.
Answer: Some references for Elliptic Functions are:

("Easy") Complex Analysis (Ch.5, Ch.6) - E. Freitag & R.Busam

(Intermediate) Modular Functions and Dirichlet Series in Number Theory - T. Apostol

(Intermediate) Elliptic Functions - J.V. Armitage & W.F. Eberlein

(Reference) Die elliptischen Funktionen und ihre Anwendungen ( Erster, Zweiter, Dritter Teil ) - Robert Fricke

UPDATE 10/5-'21
(Intermediate) Elements of the Theory of Elliptic Functions - N.I. Akhiezer

How to start with elliptic functions


Setup a non-GUI user?

Question: It's possible to create a user such that

Login is possible via command line interface, e.g. tty, ssh, etc;
Login is impossible in GUI, e.g. lightdm, gdm, etc;
It has password, ideally also has home directory.
Comment: What is the purpose? what if they logged in and then used `startx` to bring a GUI up? you want it only for specific users?
Answer: In Ubuntu 16.04,
you can configure the access.conf  file according to your needs.
First, create a standard user (without Admin privileges).
Then edit the file /etc/security/access.conf and add a line that will disallow any local logins except the tty that you will define.
In the following example, the user with username localuser can log in (in local machine) only from tty1.
- : localuser : LOCAL EXCEPT tty1

Now we need to activate the access.conf file.
Here is the Trick on how to activate in Ubuntu.
For some reason, when I tested this on my Ubuntu 16.04 configuring the default /etc/pam.d/login file, (the pam_access.so line already exist there, and I just uncommented it) it didn't work.
But it did work when I added the line in /etc/pam.d/common-account
Edit the file and insert the following line below pam_deny.so.
account required                        pam_access.so

No restart of any service is needed. Just log out and test if the new user can log in from Lightdm, GDM or any Display Manager you have.

Setup a non-GUI user?


Read connection setting from a text file

Question: I am developing a transformation (on pentaho 4.4.0) which basically reads data from one oracle DB (11g), makes some transformation and loads data into another Oracle DB. Now for DB table input/output when I need to select a connection I have to select it from a drop down menu in 'Edit Step'. When I edit the connection, it asks me settings, like Host name, database name, port number, user name, password.
What I want is, to create a text file called 'Pentaho_connection_properties' in some directory on my machine where I will save all these info and as soon as I choose a connection name from the connection drop down menu, Pentaho should automatically read the file and populate the settings corresponding to that connection name. The purpose is to get rid of this manual process to entering settings again and again for multiple use of same DB.
Please let me know how this can be done. I will appreciate if you can be little explicit since I am new to Pentaho.
Thanks
Answer: Switch to using database repositories. Connection definitions are shared throughout an entire database repository.


Send email on task list insert

Question: Can someone tell me how to tweak my code so the email alerts are sent out when my list of tasks is inserted?
global class  sched_TeamMemberExpiration implements Schedulable {

    //Make class schedulable
    global void execute(SchedulableContext ctx) {
        CronTrigger ct = [SELECT Id, CronExpression, TimesTriggered, NextFireTime
                          FROM CronTrigger WHERE Id = :ctx.getTriggerId()];

        //Get List of Team Members
        list<Account_Counselor__c> TeamMembers = new list<Account_Counselor__c>();
        date d                      = system.today().addDays(-60);
        date d2                     = system.today().addDays(-14);

        TeamMembers                 =[Select Fields and Criteria];

        List<Task> taskList = new List<Task>();
        RecordType TaskType = [Select Id from RecordType WHERE Name = 'Account Admin Task'];

        //Loop through Team Members
        for(Account_Counselor__c TM:TeamMembers){

            string lastdate = null;

            //Fix Date
            if(tm.Last_Overall_Date__c != null){
                lastdate = tm.Last_Overall_Date__c.format();
            } else {
                lastdate = 'Never';
            }

              Task t            = new Task();
              t.Subject         = 'Inactive Team Member detected! - ' + TM.Hub_Name__r.Name;
              t.Type            = 'Account Administration';

              t.Description     = TM.Hub_Name__r.Name +
                                    ' is no longer active on this account.  Their last activity on this account was on: ' +
                                    lastdate +
                                    '. \r\n' + 'Please remove this employee from the Team Members section of the Account page in CRM, as well as from any other applicable enrollment or client systems.';

              t.WhatId          = TM.Account__c;
              t.RecordTypeId    = TaskType.Id;
              t.OwnerId         = TM.Account__r.Backup_Owner__c;

              taskList.add(t);

        } //End for each Team Member loop

        insert taskList;

    } //end schedudle class
} //end main class

Answer: I figured it out. Here is how you do it for other searchers.
for(Account_Counselor__c TM:TeamMembers){

            string lastdate = null;

            //Fix Date
            if(tm.Last_Overall_Date__c != null){
                lastdate = tm.Last_Overall_Date__c.format();
            } else {
                lastdate = 'Never';
            }

            Task t              = new Task();
            t.Subject           = 'Inactive Team Member detected! - ' + TM.Hub_Name__r.Name;
            t.Type          = 'Account Administration';

            t.Description       = TM.Hub_Name__r.Name +
                ' is no longer active on this account.  Their last activity on this account was on: ' +
                lastdate +
                '. \r\n' + 'Please remove this employee from the Team Members section of the Account page in CRM, as well as from any other applicable enrollment or client systems.';

            t.WhatId            = TM.Account__c;
            t.RecordTypeId  = TaskType.Id;
            t.OwnerId           = TM.Account__r.Backup_Owner__c;

            Database.DMLOptions dlo = new Database.DMLOptions();
            dlo.EmailHeader.triggerUserEmail = TRUE;
            t.setOptions(dlo);

            taskList.add(t);

        } //End for each Team Member loop

        insert taskList;

Send email on task list insert


When form submission fails, password field gets blanked, why is that the case?

Question: I've recently asked a question about blanking the password fields in UX for usability purposes, but It seems all the sites use this approach for security reasons. Why is it insecure to post back the same pass that user has entered?
Comment: You never send back the password. Google around about caching
Comment: good point never thought about it that way.
Comment: @SachinKumar: How about having the server make note of the password, and send back dummy values (different values in the two fields; possibly encoding the session ID) and saying that if the form is submitted with the same dummy values, the server will simply reuse the values that were submitted before?
Answer: Good question. Having the benefit of looking at some of the answers, and pondering over this myself, I actually don't see any major security benefits from clearing the password from the partial form returned to the user, but there definitely are some risks worth considering.
From a security architecture point of view (as @Roryalsop already touched on), you usually want passwords flowing only in one direction. From the user to the application, never back. This applies on all layers, and this one-way-system gives benefits from a security point of view. Having an exception to this rule might or might not be a good idea. But that's why your question is interesting. Does this scenario deserve an exception?
Lets look at some attack vectors and see if nulling the password protects against any of those:

sniffing the traffic - if an attacker is able to intercept communication between the user and server, it can sniff the password sent in the first place by the user. I see no benefit in emptying it on the response
malware on the server or client side - the same. It can intercept the initial password.
cached data - this was already mentioned briefly by @SachinKumar but is worth expanding. There's an increased chance that if the server returns the password with the response, it might end up cached somewhere (the server memcached, a proxy server along the path, the client's browser history etc). Client requests are never cached. Server responses are! This is probably the biggest risk I see. Proxies can be probably be eliminated from the equation by using SSL, and if the server uses correct cache-headers and sets the input field correctly, this can also mitigate browser-caching. That said, it's still possible that the value gets cached somewhere, even accidentally and that's probably not desirable.

But then, nulling the password is easy enough, shouldn't damage user-experience too much and keep things cleaner from a security standpoint. I would still suggest you keep doing so.
If you're worried about user-experience, try to follow the advice you were already given on UX - perform extra validation on the client side, just so the user gets early feedback. Don't replace the validation on the server. This is the most important validation ultimately. But for user-feedback, client-side validation can work wonders to improve user experience and you don't have to take even a slight risk of the password being cached (or change your security architecture by making an exception).
Comment: I actually emptied the pass fields, and used client side validations. Now I'm neither worried about security nor about UX. thanks for thorough explanation of the subject.
Answer:
Why is it insecure to post back the same pass that user has entered?

Because if you then view source on the posted back page, the password will be visible in plain text. This goes against the principle that passwords should only be one way - i.e. passwords can be input but never output. For example, when storing passwords in database, these should be hashed rather than encrypted to prevent them from being extracted if an attacker manages to view the data. Following this principle everywhere will lead to a more secure system.
In this case it can prevent "shoulder surfing" and it can protect against it being cached by the browser and then later viewed.
It is possible to have a good UI and follow this principle. For example, the system could store the hashed and salted password in the server side session state, and then on the post back the form only shows the other fields. Once this have passed validation, the password from the session state is used rather than the ones that the form would have provided. Of course, care must be taken here to invalidate the session if the user does not continue with the registration process so that this password does not override the one set by the next visitor from that browser. otherwise a session fixation attack may be possible.
Comment: well it is visible to the user itself, is there something else here I'm missing?
Comment: I suppose it makes it more vulnerable to "shoulder surfing" attacks (in the case the user views source). None the less it's good practise never to output a password in plain text.
Comment: What about populating the "enter password" and "confirm password" fields with different "dummy values" of suitable length, and saying that if the fields are submitted with the proper dummy values server should use the previously-submitted values?
Comment: @supercat: Yes, that's what I'd do. It is really bad UX entering the password multiple times due to a validation error elsewhere and could be a security flaw itself as the user will get frustrated and type an easy to type password instead of a secure one.
Comment: @SilverlightFox: There may be room for argument about whether the potential confusion resulting from showing the wrong number of password dots would be more or less of an issue than having the server send something indicating the length of the password; another approach would be to superimpose "" on the password fields until they're modified.
Answer: 2 key points here:

If you have a mechanism to send the password back to the user, then you give an attacker a way to get that password.
If you can send the password to the user it means you aren't storing it hashed, but using either clear text or reversible encryption. however as @yoav points out, in thus particular scenario IT won't yet have been encrypted, so this point is irrelevant here.

Both of these have risks.
This is why most websites have password reminder and reset mechanisms, so they don't need to send the password back to you. They may send a one-time password to you as a reset, that you must then change.
Some will send your password in an out of band route, but these are getting rarer as the risks continue to build.
(of course the security of password reset mechanisms is another matter)
Comment: Regarding point #2 : When the server gets the password from the user, it is usually in cleartext form (perhaps over SSL), it **then** hashes it and compares it etc. If however you do any validation prior to that and reject the form on the server, you still have the password in clear-text form regardless of the form of storage. Therefore, I think your conclusion that it means you are using clear text or reversible encryption is therefore invalid.
Comment: Good point - in this scenario you are right, it hasn't yet been encrypted.


Performance difference between unary and binary operator

Question: Is there actually a performance difference between -foo and (-1)*foo where foo is a variable of type int?
In theory the unary operator should be faster. But I think the compiler will optimise this out.
Comment: The only definite answer is to inspect the generated instructions.
Comment: This is a question that is easily answered by [godbolt.org](https://godbolt.org/z/BDZ8mD). gcc 8.2 with -O2 compiles them to the same thing using the `neg` instruction. Edit : Even with no optimization, it produces the same assembly but with extra steps.
Comment: _"But I think the compiler will optimise this out."_ I think so too, but you should follow @Quimby's advice.
Comment: @Quimby: Even that is only definite as far as your compiler and settings are concerned. Which is to say, there is no answer both definite and general.
Comment: @FrançoisAndrieux FWIW clang won't optimize away the multiplication without optimizations.
Comment: @cHao ok, I agree with that.
Answer:
Is there actually a performance difference between -foo and (-1)*foo

Theoretically there can be. The C++ standard makes no guarantees either way.
However, assuming type of foo is an integer, then there is absolutely no difference between the observable behaviour of those expressions. The compiler is therefore in that case allowed to generate an identical binary program for either expression. A ideal optimiser should generate the program that that performs better.
Whether your real compiler generates the same output for both programs is another matter - no real compiler is ideal. You can find out by using the compiler for both alternative programs and then comparing the output.
Comment: Of course, the conduct of your compiler today is no guarantee of what a future version of your compiler might do with the code, nor of how it might be compiled for a different target platform. At the end of the day, the most important factor may be which form of code is simpler to read, or is a more clear expression of your intent.


Fructofuranose vs fructopyranose

Question: What's the difference between the two molecules? I can always read about β-D-fructofuranose in the chemistry books, but unfortunately, I've never found any info concerning β-D-fructopyranose. Is there a big difference between them (apart from their ring structure)?
And where can the furanose and the pyranose form be found in nature?
Comment: While I don't have time to write up a full answer, I've always found it interesting that the reason you don't use honey as a sweeter in baking is because of the poor control of sweetness which is caused by the furanose-pyranose interconversion at high temperatures. You can read more about it at https://biochemislife.wordpress.com/2013/03/15/honey-what-happened-you-were-once-so-sweet/
Comment: @FelipeS.S.Schneider I think you removed a part of the original post..? The extra question was in the edit, which was rejected anyway. You may check the revision history :)
Comment: @WilliamR.Ebenezer You're absolutely right, my fault. I just added the question again. Thanks for spotting that one out :)
Answer: They are isomers. Both of them have the same molecular formula ($\ce{C6H12O6}$) but different structures.

Structure of β-D-fructopyranose

Structure of β-D-fructofuranose
Comment: Could do with some elaboration, I suppose.
Answer: Fructopyranose is the free form of fructose. When fructose is attached to another glucose forming sucrose or attached to other fructose making fructans, it does so in its furanose form.
When invertase breaks down sucrose into glucose and fructose, the furanose form of fructose that occurs in sucrose, is now a pyranose form that can be metabolized in the liver by fructolysis.
I hope this helped you!

Fructofuranose vs fructopyranose


Manually Stopping Single Email Journeys?

Question: My company sends our single emails out in Journey Builder so that we can leverage Einstein STO, Path Optimizer A&B tests, and other segmentation splits. These "journeys" are always running, even after the send. This journey will never be used again. Should I be manually stopping these journeys after everyone in my Data Extension has received the email? It's a little confusing to see a journey running from months ago, and there is always a little fear that these Data Extensions might get updated somehow and these old emails would be sent out to new DE records.
Is there a better way to do this than manually stopping the journey each time?
Thanks!
Answer: You can stop them, if the same journey need to be re-used in future you can create a new version of respective journey and update the emails before activating them.


Workout and Supplments for fast results

Question: I got a big day coming up after 13 weeks. I think its plenty of time for me to loose my belly fat, i am 35 inches waist, with a baby bear belly. I resumed gym, after 3 months just 2 days ago and burning 400 cal on tredmill and doing chest, abs (short of mix) exercises everyday. I have removed sugar from my food and bread. So i eat 4-9 eggs (boiled n white part) and rest of day try to eat chicken, lightly fried and from my last instructor what i got supplements list, which are , having said that someone told me, that is too much of supplements. Which now confuses me, to take or not. As i spend good amount of money, just to add it to my routine to loose belly fat and gain mass.
So my question is, how much should i working out everday and what diet should i take, not that i loss mass, but to loss my belly and have somewhat flat tummy (if not good abs), and what should i be eating and avoiding and if i should continue with supplements? When will i start seeing some results.
Comment: It is a bit difficult to understand your question, please see http://fitness.stackexchange.com/help/how-to-ask
Comment: The only things you need on that entire list are fish oil, a good multi vitamin(opti-men is nice but will turn your pee yellow for the first few round abouts), and whey.(not necessary if you eat enough meats, most people use whey out of convenience). BCAAs and glutamine are bro science supplements at best, and also, taking BCAAs with whey(in your intra and post workout)is redundant since most if not all whey powders have the same typical amino acid blend. you do NOT need any of that other junk. just supplement with the necessities in the morning and be done with it, you don't need a schedule
Answer: It's important to note that the word "Supplement" means to supply what the primary food does not.  I agree that you are taking too many supplements, and if you are not careful it will be at a level which might cause detrimental effects.
Nutrition / Supplementation
There needs to be a proper balance.  First, let's look at your description of dietary changes:

Removing sugar: good move.  It provides nothing of value and is just extra calories.
Removing bread: verdict is out on this one.  A good high fiber bread can be a convenient way to eat lunch on the go without causing too much detriment
Eating eggs: good move.  They are like nature's multivitamin.  Nothing wrong with 4-9 eggs a day, but you'll have to watch the fat content if you eat the yolk.
Eating chicken, lightly fried: Not a great move.  Chicken is a great food to eat when you trying to get rid of some fat, but frying it adds fat and if you aren't careful will cause you to have more calories than you think.

The primary goal for your diet is to make sure you are eating good things in the right amounts to achieve your goals.  To lose weight, you need to know roughly how many calories you burn normally.  After that, you adjust by dropping a couple hundred calories at a time until you are losing roughly 1-2 pounds a week.

Protein should be reasonably high: 1.8g per kg target body weight
Fat should be at least: .35g per kg target body weight
Carbohydrates make up the rest.

The number I gave for fat content is the minimum amount to maintain health.  Keep in mind that there is 9 calories for every gram of fat.  Compare that to both protein and carbohydrates which is only 4 calories per gram.  You have to eat the minimum amount of fat your body needs to maintain proper function to burn fat and not muscle.  After that, you have to find the right balance between fat and carbohydrates where you feel satisfied from your food but are still losing weight.
As far as supplements go, you really should keep it simple:

A sports multivitamin, take the dose on the package (example: Opti-Men by Optimum Nutrition)
About 3g Omega-3 (look at the package, mg of fish oil is not the same thing)
If you live outside the tropical belt, Vitamin D3, 2500 IU a day

You can spread the supplements out as you see fit throughout the day.
If you have a hard time getting your protein in while cutting calories, you may consider a whey protein supplement.  Make sure you look at the package so you aren't getting one with lots of sugar or dextrose in it (i.e. not a bulking protein mix).
Above all, get your sleep.  About 8 hours sleep a night will make sure you are burning as much fat as you can while preserving as much muscle as you can.  Not getting enough sleep causes your body to hold on to fat and burn more muscle.
Training
Strength training should be about 3 times a week.  If you do about 20 minutes of cardio work per day it should help with health, recovery, and burning fat.  However you do need to challenge yourself during strength training.  If you are beginner, you want to hit the following areas:

Legs
Core
Chest/Arms/Shoulders

A good beginner program would look like this:
Workout A

Squats: 3x8
Bench: 3x8
Pull-up/Chin-up: 3xAMAP (as many as possible)

Workout B

Squats: 3x8
Bench: 3x8
Deadlift: 1xAMAP

When 3x8 gets too tough to keep adding 5 lbs each time you go in, switch to 5x5, then 3x5, and finally 3x3.
If you aren't used to free weight and feel more comfortable with machines, then swap out squats for leg press and leg curl and add in core specific work.  By working bigger muscles, your body transformation will go better.
Comment: so what should I do on supplements that I m having, although that was given to me after my body assessment by my instructor. He isn't dietriation but a trainer. If I am taking that much, how much I need to intensify my workout? How and when I see the change. My each rep is of 15.
Comment: 15 rep sets are fine, but use the heaviest weight you can muster for 15 reps.  The biggest thing is that full body movements incorporating your largest muscle groups will do the most for body transformation.  Chest is important, but don't neglect the legs (which were conspicuously missing in your description of the program).
Comment: As to the supplements in your possession, you can use them up for now, although I would slow down the Vitamin C to 1000 mg a day.  You'll find that a number of those supplements have minimal effect.  Educate yourself by going to Examine.com and see what the supplement is supposed to do for you and what appropriate dosing should be.
Comment: Those supplements, if taken how much you till i need to workout like how many sets and with each set, how many rep?
Comment: @Nofel, I'm not sure I understand.  Supplements like Vit. C don't correspond to the work you put in.  They help your body function better when it is short on a micronutrient.
Comment: I have a lazy body and routinue, I get fatigued easily and I cannot do more than 3 set each, my question is that if I take those supplements I need to work more than 3 set each? So how much is good to consume what I take. I need to maximize my workout for loosing my belly fat, say in few months. I do however in 2 weeks have seen outcome in my arms as my biceps and tri and whole arm size seem bigger but I hardly see any effect on my belly fat.
Comment: I gave the doses for supplements in my answer.  3 sets of 8 is a lot of work.  Keep at it.  As to the belly fat, be patient.  If your body weight is going down about 1-2 lbs a week you are losing more fat than muscle.  Do you have any estimate on the amount of body fat you are carrying?
Comment: also you mentioned beginner workout, how much sets and rep will be in advance workout?
Comment: Advanced training varies the sets and reps over the space of 1-3 months.  Take a look at routines like Wendler 5-3-1, Juggernaut Training, or the Cube method for examples of what advanced training routines look like.  Guaranteed, you will be putting in more work on an advanced routine than on a beginner routine.

Workout and Supplments for fast results


ValidationRule with Indexer Issue

Question: Our company is using indexers for our framework, so that we can quickly bind data to a window without having to create a property for each data source. Since WPF (unlike Silverlight?) requires you to use OnPropertyChanged("Item[]") to indicate a change, all items that use an indexer are refreshed on the UI. This functionality causes a problem when a control uses both a ValidationRule and accesses the data through an indexer. It seems that in calling the OnPropertyChanged for an indexer property, it refreshes the data on the control to what is in the data source when there is an error with the control. Since there is not a way to call OnPropertyChanged for a indexer property with a key value, a change to another control ends up reverting what is in the control that has the error.
My question is: Has anyone been able to use both indexer properties and ValidationRule, together, such that a control with an error keeps its error until the user fixes the control?
If not, does anyone have any suggestions? We like using the indexer property, since this makes setting up binding much quicker than creating a property for every data field (our applications are centered around CRUD).
Answer: The solution, that was found, was to implement a DynamicObject. Doing this removed the indexer from being used, and sidestepped the problem.

ValidationRule with Indexer Issue


Making a Scrollviewer fill the available space in a DockPanel

Question: I somewhat of a WPF noob and am using a DockPanel to display the text content of an email in a TextBox in a ScrollViewer. The panel has a button bar and area for the email headers at the top, a button bar at the bottom, a panel at the right and the email itself should fill the remaining space dynamically:
[Banner at top, below which is a button bar and box with email headers. At the bottom is another full width button bar. The space between them is divided into a fixed-width panel at the right and a large text box for the email contents.]
http://rowlandsoftware.com/Screenshots/LongEmail.png
(The DockPanel sits inside a grid that provides the bit at the very top and is used when the email is not visible.)
The problem is that if the email is too short or too narrow, the textbox fails to fill the remaining width. In this screenshot, you can see some of the underlying stuff between the box and the panel:
[Between the text box and the panel is a column that is not filled. Part of what lies under it can be seen.]
http://rowlandsoftware.com/Screenshots/TooNarrow.png
The XAML is:
<code><DockPanel x:Name="EmailCanvas" Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="2" Visibility="Collapsed" Height="Auto">
    <DockPanel x:Name="topButtonBar" DockPanel.Dock="Top" Height="50" Background="White">
        <Button x:Name="btnReturn" DockPanel.Dock="Left" Content="Return to List" Click="btnReturn_Click" />
        <Image Width="15" Source="Images/transparent.png" />
        <Button x:Name="btnTextToggle" Content="Plain text" Click="btnTextToggle_Click" />
        <Button x:Name="btnZoomOut" Content="Zoom Out" />
        <Button x:Name="btnZoomIn" Content="Zoom In" />
        <Image Width="150" DockPanel.Dock="Right" Source="Images/transparent.png" />
        <Button x:Name="btnPrint" DockPanel.Dock="Right" Content="Print" Width="100"/>
        <Image DockPanel.Dock="Right" Source="Images/transparent.png" />
    </DockPanel>
    <StackPanel x:Name="EmailHeaders" Orientation="Horizontal" DockPanel.Dock="Top" Width="Auto" Background="Linen">
        <StackPanel Orientation="Vertical">
            <TextBlock Text="Subject:" FontSize="16" />
            <TextBlock Text="Time Sent:" FontSize="16"/>
            <TextBlock Text="Other Recipients: " FontSize="16"/>
        </StackPanel>
        <StackPanel Orientation="Vertical">
            <TextBlock x:Name="labSubject" Text="Subject:" FontSize="16" />
            <TextBlock x:Name="labDateTime" Text="Sent:" FontSize="16"/>
            <TextBlock x:Name="labSpare" Text="Other Recipients:" FontSize="14"/>
        </StackPanel>
    </StackPanel>
    <DockPanel x:Name="bottomButtonBar" DockPanel.Dock="Bottom" Height="80" >
        <Image Width="150" DockPanel.Dock="Left" Source="Images/transparent.png" />
        <Button x:Name="btnDelete" DockPanel.Dock="Left" Content="Delete" />
        <Image Width="150" Source="Images/transparent.png" />
        <Button x:Name="btnSave" Content="Save" />
        <Image Width="150" Source="Images/transparent.png" />
        <Button x:Name="btnReply" Content="Reply" />
        <Image Width="150" DockPanel.Dock="Right" Source="Images/transparent.png" />
    </DockPanel>
    <StackPanel DockPanel.Dock="Right" Orientation="Vertical" Background="White" Width="150">
        <Button x:Name="btnAttachments" Content="Attachment"/>
    </StackPanel>
    <ScrollViewer x:Name="eTextViewer" VerticalScrollBarVisibility="Auto" HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch">
        <TextBox x:Name="eText" Background="White" HorizontalAlignment="Stretch" TextWrapping="Wrap" FontFamily="Verdana" FontSize="18" IsReadOnly="True" />
    </ScrollViewer>
    <!--Image Width="Auto" Height="Auto" DockPanel.Dock="Bottom" Source="Images/white.png" /-->
    <WebBrowser x:Name="eHTML" Height="Auto" DockPanel.Dock="Top" Visibility="Collapsed" />
</DockPanel>
</code>
The box is extended only to fill the available height, not the width. The documentation for the DockPanel.LastChildFill Property says,

If you set the LastChildFill property to true, which is the default setting, the
  last child element of a DockPanel always fills the remaining space, regardless
  of any other dock value that you set on the last child element.

msdn.microsoft.com/en-us/library/system.windows.controls.dockpanel.lastchildfill%28v=vs.110%29.aspx
That does not appear to be the case: in my program it is only filling height, not width. LastFillChild=true is the default, but explicitly setting it to True or False doesn't make a blind bit of difference.
Interestingly, if you set DockPanel.Dock="Top" on the ScrollViewer, it fills the available width but not the height, leaving some of the underlying stuff showing between the text box and the bottom button bar. Again this is contrary to the documentation which says that the dock value set on the last child element is ignored.
Setting HorizontalAlignment="Stretch" to both the ScrollViewer and the TextBox and HorizontalContentAlignment="Stretch" to the ScrollViewer makes not a jot of difference.
So my question is, how can I ensure that the textbox fills the available space in the DockPanel even when the contents of the email are too short?
UPDATE: I have just noticed that if I remove the WebBrowser that is set initially to Visibility="Collapsed", then it works fine. I guess that its presence fools the DockPanel into regarding it as the LastChild even though it is Collapsed.
However, I need to toggle between displaying the email in the web browser and the text box, so removing it isn't an option. Both need to be treated as last child when they are visible. Any ideas?
UPDATE 2: So I wrap the scrollviewer and the web browser in another container, e.g. grid, which is the Last Child. Then I can toggle between the the two but they both fill the space.
Thanks guys. I wouldn't have got there without humiliating myself in public ;)
Answer: DockPanel will work, but beware of Collapsed items. Although the documentation says that a collapsed item has no effect on layout, with DockPanel it does if it is the LastChild.
The solution in my case was to add another container as the last child, and place the two items that I wanted to toggle between in that container. Then both will fill the remaining space in the panel.


Best GNU/Linux Based Firewall distribution

Question: I want to setup a firewall for a network of 200 devices. Can anyone please guide me which GNU/Linux distribution to use ?
Comment: http://blog.stackoverflow.com/2011/08/gorilla-vs-shark/
Answer: Base answer for just iptables: The one you are most familiar with.
Beside that, I would suggest using something with additional security measures like SELinux or AppArmor.
Answer: Depends on  your knowledge. Most commercial firewalls which use a unix as a background would use bsd/freebsd.
Me, I like slackware, but it depends what you want and how much you know. Redhat of course comes with support (because you have to pay for it and its against all their stuff to use it without support.. sigh) but if you dont know much about linux then this maybe a better option because they can help you.


Bonferroni correction on 7 types of complications and 4 comparisons

Question: I am writing a meta-analysis on the complication and reoperation rates after 5 treatment modalities of distal radius fractures. Currently I am doing a post hoc analysis on the differences of 7 types of complications between the 5 treatment modalities seperately(4 comparisons, 4 of the treatments compared to the gold standard). I want to use the conservative Bonferroni correction for the alpha and read the other articles on multiple comparisons and the bonferroni correction. I am just not sure what number to divide the alpha by. Should I divide the alpha(which I set at 0.05) by 4 because of the 4 comparisons or not?
Answer: Divide your alpha by the total number of hypothesis checks you are about to do in experiment.
Comment: If you want to state that your entire experiment (paper, study, or whatever) is significant at 1 - Alpha_global, then divide by 28 (all the pyhothesis included in your experiment). On the other hand if you want to state that complication A's family of tests is significant at 1 - Alpha_global, then divide by 4. However the later case implies that you do not bear a responsibility of your whole study being significant at the level you used.
Comment: Well, just compute (or estimate) how many Null Hypotheses are there that you are going to try to reject, using t-test or whatever method you prefer. If that number is 448 (the number of p-values you will compare to alpha), then do it.
Comment: Bonferonni method is designed for the most conservative case of independent hypotheses. It guarantees that your family-wise p-value (type I error chance in a whole study) <= global alpha in any hypothesis set, dependent or not. If you think your hypotheses maybe not independent (secondary will depend of primary) then Bonferroni's is too strict, but it still guarantees the result. I do not know in detail methods of alpha adjustment in case of certain hypothesis dependence.
Comment: For each complication type I had 4 hypotheses. Should I divide my alpha by 4 or by 28(4*the 7 types of complications)?
Comment: The primary outcome measures are the complication rate and reoperation rate. 4 comparisons were done on both of them too. The types of complications are a secondary outcome measure. If I want to uphold to your first statement: should I actually divide my alpha by 4(complication rate)*4(reoperation rate)*28(4*7type complications)=448?
Comment: Does it matter if concerns primary or secondary outcome measures?
Comment: Thank you very much for all your help. The total number of hypotheses is 50. So I will use a global alpha of 0.001


If electric fields add, and intensity is proportional to $E^2$, doesn't superposing light violate energy conservation?

Question: We know that the energy in a wave goes as electric field amplitude squared($E_0^2$) as given by poynting vector but the amplitude of electric fields are added linearly. To see why this creates a paradox, consider 2 lasers both with linearly polarized lights with electric field $E_0$. The total energy coming out of these lasers is then proportional to $2*E_0^2$. Now, suppose you find a way to add the amplitude of these 2 waves coherently so that the crest and trough match exactly with each other giving a net amplitude as $2*E_0$. Now, the energy carried by this wave would turn out to be proportional to $4*E_0^2$ which is greater than the energy we started out with!!!. How is this possible?
Answer: Indeed, if you manage to superpose two electromagnetic waves, each with intensity $I$, so that they're traveling in the exact same direction with the exact same phase and frequency, then you'll get a wave of intensity $4I$. This isn't a violation of conservation of energy -- it's a proof that you can't do this without adding additional energy to the system.
For example, suppose we started with two waves traveling in different directions, then tried to superpose them using mirrors. This is impossible, because you would require a mirror that takes light rays traveling in two different directions and reflects them so that they exit in the same place in the same direction. This violates existence and uniqueness.
It's easy to have a mirror system that gets the two waves in the same place traveling in slightly different directions, but then you'll get interference fringes. The intensity will vary between $4I$ and zero, averaging out to $2I$.
As another example, suppose you sourced the first wave by vibrating a charge sinusoidally, doing total work $W$ in the process. You might think that by vibrating a second charge in the path of the wave emitted by the first, in the exact same way, with just the right phase, will create a wave with total energy more than $2W$. This is true, but that's simply because vibrating that second charge will take more energy than the first, since you will have to do work against the existing electric field.
This last example is precisely what is happening in your example with the laser. The second laser has to do extra work, which ultimately comes from the laser's power source. In all cases, energy is conserved.
Comment: knzhou, would you consider addressing the (idealized) case of combining two laser beams with a power beam splitter?
Comment: Does this answer the question? Nothing was said about adding more energy, just about what happens with what was given. Is there evidence that two light beams can just add in such a way in any case?
Comment: @user47014 What, is there evidence that interference happens? That might actually be one of the most well-tested facts in all of physics. Literally thousands, maybe tens of thousands of experiments require it to work just as expected.
Comment: @knzhou I mean can beams add together constructively only, without an interference pattern--i.e. without destructive interference also, that conserves energy so it evens out to just adding the intensities.
If you have a link to a video where two beams add to a stronger intensity without creating any interference pattern, I would like to see it
Comment: @user47014 The whole point of my answer is that it's basically impossible to do this in practice.
Comment: @knzhou yes but that gets back to whether this answers the question, which is really about what is the math of adding two waves together
Comment: @knzhou

It could be a duplicate of what was asked here

https://physics.stackexchange.com/questions/333260/how-to-explain-the-relationship-between-waves-amplitude-and-intensity/489680#489680
Answer: Is is the key point of interference in optics (Young double slits or Michelson interferometer...).
On a bright fringe, the intensity is $4I0$ but this is compensated by the dark fringes, with zero intensity. Energy is conserved but with a different spatial repartition.
Sorry, I understand the question a little better. (sorry for my poor english)
Indeed, if we double the field, the power is multiplied by 4.
It seems to me that the problem is to believe that the power to be supplied when we draw two antennas indefinitely near each other is simply the sum of the individual powers when they are alone. Very close, they will interact with one another and it will take more power to make them radiate ?
Comment: Yeah, I understand the redistribution of energy in the Young's Double slit experiment but in this case, there is no destructive interference by design. The lasers are made to coherently interfere exactly.
Comment: The field of the laser is not $E0$ in all space, it is rather of the form ${{E}_{0}}\cos (\omega t-kx)$ in a simple model.
Comment: In my question I have specified that the crests and troughs of the laser match. So, the field of both the lasers are considered to be E*cos(wt-kx)  which are made to coherently intefere.
Comment: Sorry ! I have completed my answer. Hope it can help.


Multiple Double slit experiment

Question: In school, I am learning about the Double Slit experiment and it's implications on Quantum Mechanics. I was wondering if the double slit experiment was possible with many different slits and screens. For example, if there were 5 sets of slits, light would pass through the first set of slits, and go into a second set of slits, which would be angled at 45˚(or some arbitrary angle) to the first one. If this process is repeated 5 times in total, would there still be some interference effect observed on the final screen.
Comment: This may not be a direct answer to your question, it may help in part.http://physics.stackexchange.com/questions/287538/experiment-in-the-dark-fringe-raises-questions
Answer: A double slit is usually in a first approximation (which you are dealing with in school, probably) just a pair of point sources which are a distance $d$ apart. Sure, each of the slits has technically a width $w$, but unless you are looking at double-slit diffraction and not the simpler$^1$ double-slit interference, you don't care about the size of the individual slits.
Now, the Huygens-Fresnel principle states that in the double-slit experiment, both slits act as point sources emitting spherical waves which will interfere everywhere on the other side on the slit screen. The detection screen is just there to allow for a simple geometric calculation of the pattern along that particular screen.
If you put a second slit screen behind the first one, possibly angled at an angle, no matter what kind of interference pattern might show up along that second slit-screen, the slits will still be pointlike and the secondary (and all subsequent after that) interference pattern will be more or less the same as the first one, barring intensity losses.
So in the first order approximation used in school and introductory optics classes, the interference pattern will not look any different.
Now, of course, if you extend your calculations to account for the diffraction each of the slits composing the double slit, their width $w$ comes into play and since the Huygens-Fresnel principle still says that each point in the slit emits a spherical wave, you will have to take into account the intensity variations the first screen will cause on subsequent ones.

$^1$ Interference and diffraction are more or less the same thing in the sense that both are well explained with the Huygens-Fresnel principle. Usually in school, one deals only with double-slit interference, but you can of course ask what happens to the single-slit properties of each of the slits and how they effect the overall interference picture. That runs under the name of double-slit diffraction, see e.g. in these great MIT notes
Comment: So, can I do an experiment with this setup from which I can get more precise interference patterns? And also, if I take 5 pairs of slits and angle them at 45˚ to each other, why would I not get a circular diffraction pattern, because that is the most intuitive pattern that I would except to see, or am I just getting confused with the experiment
Comment: @Sumant Yes, because both of the slits emit a half-spherical wave, you could fan your five double slits in 45° angles to make the light make a 180° turn and you'd still see the usual interference pattern, just keep in mind that with each passing of the slits, the pattern will get dimmer and dimmer (though uniformly dimmer in first approximation)
Answer: The most common way to work out the solution for this kind of problem is by using the wave function.
It works like this: Before the particle is observed (the observation is in this case the particle hitting the screen) its motion is described by a wave.
The wave has a "wavy" dinamics described by Shroedinger's equation which can be completely solved, in principle, in any situation. The wave passes through any kind of experiment you like, maybe a lot of slits, as you said, and than, when we want to "observe" the particle, we make the wave hit a screen.
Finally, the amplitude of the wave at the screen will give us the probability of the particle hitting each part of the screen.
The problem here is determining the way the wave function passes through your experiment. But an interference pattern is still going to happen in some way.
Maybe if you have a complicated set of slits, with angles between then and so on... the final pattern won't be simple or "beautiful" to see... as you would expect from an experiment made with water waves, for exemple, where they pass through many sets of slits.

Multiple Double slit experiment


What is the significance of the proton and neutron being approximately the same mass?

Question: The mass of a proton is $1.673 \times 10^{-27}$ kg and the mass of a neutron is $1.675\times10^{-27}$ kg. (Approximate.) Would anything be different if they had different masses? Is there a "reason" that they are so close in terms of mass? What is being the same mass doing for them?
Comment: Besides the fact that a neutron decays in to a proton and two very light particles?
Comment: A photon can decay into an electron and positron, it doesn't mean anything about its mass
Comment: @MartinBeckett the photon does not decay. you are describing an interaction of the photon with a field .  http://hyperphysics.phy-astr.gsu.edu/hbase/particles/lepton.html#c6 . Think, in the center of mass of the electron and positron the momentum is zero, but a photon , which also should  exist for this center of mass, can never have zero momentum. Thus it is a two particle interaction, photon+ field
Answer: Most of the mass of proton and neutron arises due to the invariant mass of the system of moving virtual quarks and gluons that make up the protons and neutrons. Although gluons are massless, yet their energy makes up the mass of protons and neutrons, by the virtue of mass-energy equivalence. The mass of protons and neutrons are roughly of the order of $10^2$ more than of the 3 valence quarks (uud for proton and udd for neutron) that "supposedly" make them up and most of it comes from these virtual gluons and quarks. In addition some of these quarks form additional bound structures like mesons, which mediate strong force between nucleons.
The significance of protons and neutrons having the roughly same mass is that the strong interaction has a much larger contribution to the Hamiltonian than the electromagnetic interaction or weak interaction at the given distance (or energy) scales. Indeed this was the exact reason why Heisenberg introduced the isospin model. Simply put,
$$ H = H_{strong} + H_{weak} + H_{electromagnetism}$$
Since the strong interaction dominates over weak and the electromagnetic ones at this scale,
$$ H \approx H_{strong} $$
and since the strong interaction doesn't depend on the nature of the nucleons in question, the masses of proton and neutrons are equal.
Comment: "are equal " within the width introduced by the existence of electromagnetic and weak contributions in higher orders


Drupal view filter to show only one of a certain item

Question: I'm fairly new to Drupal, and am using Node Import to take a TSV file and turn it into nodes.  I'm hitting a problem, though, with automating updates to the nodes.  Again, I'd like to take a Tab Separated Values text file, and load it into my site via Node Import (or whatever else anyone might suggest) and then only show updated Nodes.
Here's a specific example:
I have a Node with the following info:
StoreId Name Address Phone Contact
01 Name1 Address1 Phone1 Contact1
02 Name2 Address2 Phone2 Contact2
etc.
The info pulls into the nodes just fine (Thank you Node Import!), but we also want to process updates to the nodes.  So far I have two ideas... figure out how to delete duplicate (previous) instances of the same StoreID, or just save the node with the duplicate StoreID (and new other info) and just display the most current version.  In Views, I can get it to show the nodes and everything, but I can't figure out how to only display the most recent version of each StoreID.  A view of views would work, but I can't seem to get that to work, either.
Any ideas or other approaches I could take?
Thanks in advance for the help!
Answer: Someone made a patch for node import that does what you are looking for here. I haven't tried it but it looks promising.


How to determine significant figures involving radicals and exponents

Question: How do you determine the significant figures for solving equations with radicals and exponents? For example, how do you evaluate $x = \sqrt{4.56^2 +1.23^2}$?
Comment: Please see http://meta.math.stackexchange.com/questions/5020/mathjax-basic-tutorial-and-quick-reference for information about how to write mathematics on this site.
Comment: Are you asking about the number of significant figures in the answer or how to do the calculations to arrive at the answer?
Answer: Here is an abbreviation of the explanation I use in my 11th grade Chemistry and 12th grade Physics classes. This uses precision as is often used in American secondary schools, though it is not usually explained in quite this way.
There are two ways to measure precision: significant figures and decimal places. Significant figures (also called significant digits) are used in multiplication, division, powers, roots, and some other operations. Decimal places are used in addition and subtraction. In any operation, the proper precision of the answer equals the lowest precision of the operands. If multiple operations of the same kind are done consecutively, do rounding after doing all the operations. If two consecutive operations are of different kinds, you must round after each operation.
In your case, you have squaring, followed by addition, followed by a square root. This is significant figures followed by decimal places followed by significant figures, so we must round at each step.
First is squaring, which uses significant figures. If you think of this as powers, the $2$ is exact and does not affect the precision of the answer. In either case, each square has three significant figures, so we round each to three sig figs, getting
$$x=\sqrt{20.8+1.51}$$
Next we add one decimal place to two decimal places, giving one decimal place.
$$x=\sqrt{22.3}$$
Finally we take the square root of three significant figures, giving three sig figs.
$$x=4.72$$
Is all that clear?
Comment: What would be the scenario on handling powers? i.e. $5.1^4$
Comment: @Another.Chemist: This is like squaring: powers use significant digits. The $4$ is (probably) exact, so we ignore that for deciding precision, so the answer should have two significant digits, just as $5.1$ does.  That give an answer of $680$. Note that the trailing zero when there is no decimal point in the number is not significant. This method has its weaknesses, since $5.05^4$ is about $650$ and $5.15^4$ is about $703$. I teach my classes that this method is simple and useful but has its problems. My classes like simple.
Comment: @RoryDaulton I do not understand this sentence: "If multiple operations of the same kind are done consecutively, do rounding after doing all the operations. If two consecutive operations are of different kinds, you must round after each operation". Why not always rounding after all the operations?
Comment: @Emmet: If you try to round only after all the operations (with a mixture of significant-digit and decimal-point operations) it is difficult to know which precision to use for your final answer. Rounding after each operation makes that easier.
Comment: @RoryDaulton I see, thank you.