When courts set a new precedent, are the negatively impacted parties given any leniency?

Question: Suppose the courts set a precedent by interpreting ambiguous law in a way that negatively affects one of the parties of a case. When deciding on remedies, damages, or a criminal sentence, will courts sometime show any consideration for the losing party since they could not know how the law would be interpreted?
Comment: Rules for this will be different in different countries. Do you have a particular one in mind? The rules will also vary in different types of cases, particularly civil vs criminal. Did you have a type or area of law in mind?
Comment: @DavidSiegel I don't have a jurisdiction or an area of the law in mind. It is a broad question. I can come up with ways to make the question more specific if it's required by the community. An answer that explains how (and why) it is different in different areas of law would be appreciated. For example, it appears that there is an "rule of lenity" in criminal law, but I wonder why there is no similar concept in civil cases where the government is a party.
Comment: A broad question is fine. But when an asker needs or wants info for a particular jurisdiction, it is more likely to be given with precision when the jurisdiction is mentioned, It is fine indeed to ask for a comparison of the rules in different countries.
Answer: This answer is under United States law.
Usually, when a court interprets the law in a way that was previously ambiguous, parties are not given any leniency for not knowing in advance how an issue will be resolved.
Sometimes, when a court overrules prior precedent with a new precedent the court will grant some leniency, if there is an easy way to do so.
For example, in the Colorado case of Warne v. Hall, 2016 CO 50, the Colorado Supreme Court made the level of detail required in documents commencing civil lawsuits in the state was made much more strict, reversing long standing prior binding precedents in the state on the issue.  The U.S. Supreme Court had done the same thing in federal cases, but the Colorado Court of Appeals at the time had repeatedly declined to apply the federal standard to state court cases. In Warne, the party whose legal documents were held to be insufficiently detailed was allowed, on remand to the trial court for further proceedings, to try to amend those documents to meet the new standard (for what it is worth, he didn't succeed on remand).
This is usually not done, however, in "writing on the wall" situations where the new decision overruling prior law was obvious from an amendment to the statute that an older case interpreted, or from a previous new court precedent that overruled prior law in some circumstances and made it very likely that addition related binding case law would also be overruled, even if the previous landmark precedent didn't necessarily have that result.
An exception applies in cases where a law enforcement officer is accused of violating someone's civil rights. In those cases, liability is only imposed on the officer if the fact that the conduct violated the plaintiff's legal rights was "clearly established" by statutes and case law at the time that the law enforcement officer took the action giving rise to the lawsuit, under a doctrine known as "qualified immunity". If the law was ambiguous at the time that the law enforcement officer took action, "qualified immunity" bars the lawsuit.
Similar considerations apply in favor of the government in some habeas corpus litigation in federal court (where a state court conviction is collaterally attacked after direct appeals are exhausted).
Comment: isn't there leniency for criminal ambiguity? I kind of remember as if there was in the U.S. or California
Comment: @kisspuska I found this: https://en.wikipedia.org/wiki/Rule_of_lenity, but it does not seem clear how this principle is used in modern American jurisprudence (the Wikipedia page mentions Lockhart v. United States (2016), where the judges apparently did not follow this principle even though Scalia mentioned it as a concern).
Comment: @Sid Yep, that's the word. I read it over now, and it does seem that some states codified this otherwise very much reasonable construction — Florida and Ohio, but it seems the Supreme Court narrowed or even overturned this in that case you cited.
Comment: @Sid The rule of lenity is limited to criminal cases where there is an ambiguous criminal statute. It has not application in civil cases, and usually a court will rule that its interpretation is the plain reading of the statute.


Lead free solder latest technology?

Question: Back when I was working in a electronics company in 2004, we had a new directive coming in - RoHS. Since then, we were forced to use lead free solder. I understand the dangers of lead poisoning, but we always had trouble using the lead free solder. It melts at a higher temperature, so we had to heat up our iron to a higher temperature, but then, the copper tracks on the PCB became easier to peel off due to this. Further more our iron tips got corroded way faster. I read about lead free specific iron tips recently, guess that is no longer a problem. How is the latest lead free solder these days? Does it still need a higher temperature to work with? Is there any latest technology in lead free solder that maybe allow us to use at similar temperature as the leaded one?
Comment: I am familiar with all of the concerns that you listed. We also switched to LF around the same time. I can say that the pcbs that we get handle the high temps much better now ( for both hand soldering and reflow). We did switch our medium range soldering irons a good Hakko units, and the tips last forever (and are still affordable), even with the higher temps). For rework, preheating really helps, as well as a good gel flux. Everything we do now is LF, and there's no job that we haven't been able to accomplish yet.   Good luck!
Comment: It's the same as far as temperature and heating goes. Don't use a crappy soldering station. In fact, don't even use a decent one. Use a *really* good station with *really* good tips. You're not going to get away with a one-tip-does all with lead-free.
Comment: There are some bismuth-containing solders that melt at lower temperatures, but the bismuth tends to ruin some other properties of the solder that makes it not a good idea to use. There's germanium-doped solder, which gives you similar performance to SAC305 (better in some regards) for slightly cheaper since it contains no silver, but its melting temperature is a degree or two *hotter* than SAC305, so it doesn't help either. Unfortunately, there just aren't any formulations out there that can straight replace 63/37.
Comment: beware sac305 paste formulations in applications that see aggressive changes in temperature... The bismuth and indium containing alloys can be almost indistinguishable from 60/40 leaded solder and in some ways outperform it.
Comment: IME, nothing is as nice as 63/37 in yielding bright well-wetting joints. Cheap lead-free (just tin with a bit of copper) is a bit nasty- dull joints, high melting point (about 50°C higher than eutectic SnPb). I think the lead-free generally might be [more brittle](http://www.civil.northwestern.edu/people/qu/Qu%20Papers/Gao%20-%20IEEE_T_CPMT%20-Brittle%20Versus%20Ductile%20Failure%20of%20a%20Lead-Free.pdf) which can cause failures in things like large BGAs with a lot of thermal cycling.
Comment: @ChrisKnudsen care to share the brand/model of the LF that you use? We already are using Hakko irons right now.
Comment: From what I can tell, there's quite diverse flavours of Hakko. The Hakko I'm using right now - which is of poor quality overall - only allows you to set the temperature and that's it. But I've seen other Hakko models which display the live tip temperature. I guess Hakko has a broad product range, but the ones I've used are plain bad.
Answer:
But we always had trouble using the lead free solder.

Yes, nobody likes it. It's somewhat harder to work with overall, even to this day.

but then, the copper tracks on the pcb became easier to peel off due to this

This was a big problem when RoHS was new and not nearly as much of a problem nowadays. Though naturally it depends a lot of the PCB quality - some PCBs meant for mass production are simply not designed to have components re-soldered multiple times, RoHS or not.

Further more our iron tips got corroded way faster.

Higher temperature means shorter tip life. For RoHS solder you typically use around 350°C as professional setting, whereas for leaded you would do around 320°C.
I haven't noticed any major quality improvement of solder tips since the introduction of RoHS.

But how is the latest lead free solder these days? Does it still need a higher temperature to work with?

Yes. Approximately 30°C higher temperature.

Is there any latest technology in lead free solder that maybe allow us to use at similar temperature as the leaded one?

As mentioned in comments, there is specialised solder containing bismuth with lower melting points. I have no personal experience of using it, but from what I hear it is slightly more brittle and should preferably only be used for special jobs with heat-sensitive components. There are some versions of it with more silver etc that are better, but then it turns more expensive instead. Also, flux core wire might not be available. See Any drawbacks to "low temp" lead-free solder paste?

Lead free solder latest technology?


Custom schedule for automated send?

Question: We have a regular newsletter that we want to send out 6 days a week (Mon-Sat). Right now, the scheduler only gives the option of every day or every weekday. Is there anyway to specify the days or do I just have to create a duplicate automation just for Saturdays? We manually change the send once in a while and I'm just worried that having two automations is going to lead to editors making a mistake.
Answer: If you select "weekly" as the cadence, there is an option to choose the days of the week and you can select as many as you need. I just selected Mon-Sat.
Answer: As you mentioned you can either create a separate Automation that would run only on Saturdays or if it is crucial to run everything within one Automation with that specific schedule then you can do that:

Create Data Extension, let's call it "Sunday_Check" with the field "isSunday" (Boolean, nullable);
In your Automation that would have a daily running schedule set as a first step Script Activity:

In the Automation add Verification Activity to validate "Sunday_Check" Data Extension having Count is greater than 0 then stop the automation
This way, each day you would have a check whether today is Sunday and if it is then the DE would be populated with a record, and the Verification Activity would stop the Automation because of that. On other days, it would simply let the Automation run the next steps.

Custom schedule for automated send?


Can I use BC558 PNP transistor with 5V DC supply?

Question: How will I know what is the VCC voltage range required so that transistor can work? I was checking the datasheet and couldn't understand much on it. My requirement is that I have got 5V DC supply. I want to connect 5V DC positive to Collector and Emitter and ground to base. This way, If I pass current from base to emitter then the current should pass from Collector and Emitter. I am planning to connect LED with a resistor between collector and emitter. How should I know what resistance value is required? Like If I want to limit to 5mA current in the LED. I need to know the gain value of the transistor. Also, what is the voltage across the transistor CE and CB? How to see this in the specification?
Comment: Your textual description of the circuit will destroy the transistor and makes no sense. Show your schematic.
Comment: Show your schematic.
Answer: You should use this circuit

simulate this circuit – Schematic created using CircuitLab
And need to work in saturation region so please read this
Bjt base current calculation
And in your case \$ V_{CC} = 5V \$ and \$I_{led} = 5mA\$ we have
$$R_C \approx\frac{V_{CC} - V_{led}}{I_{led}} \approx 470\Omega...680\Omega$$
Depend on the LED color.
$$R_B = \frac{V_{IN} - V_{BE}}{ \frac{I_{led}}{10}} \approx \frac{4.3V}{0.5mA} = 8.6k\Omega $$
In practice, I will use \$10k\Omega\$
And for PNP I need more info. Because we need to know from where the signal at the base is coming from, and his voltage range.
But in general, the circuit diagram will look something like this

simulate this circuit
Comment: some changes required for a PNP transistor...
Comment: Ah, yes BC558 is a PNP indeed.


Retrieve Last n rows from mysql within a loop

Question: Here's the scenario.
I have 2 PC clients (Client CA and CB) and 1 MYSQL server (S1). CA generates and stores data on S1 constantly, CB obtains data from S1 and generates a graphic with it.
CB needs to poll records from S1 all the time, that's why I have it within a while loop. How do I retrieve the last n records within the loop without getting duplicates from previous queries?. I.E.
n = 100,
CA inserts 100 records, CB gets last 100 records
CA inserts 50 records, CB gets last 100 records. 50 of these records are the same from previous query,
Please help.
Answer: Add a field to your table that tracks when the record was inserted.
Next, have the CB client track what was the most recent timestep that it has retrieved, and then limit its selects to only records that are more recent than the last time that was pulled.
Answer: I presume you store some timestamp with your data in column "create_time":
SELECT * FROM my_table WHERE create_time > time_modified_on_every_iteration ORDER BY create_time LIMIT 0, 100

And your loop:
Date lastDate = some_very_old_date;
while(true) {
  rows = sql_query.getData(time_modified_on_every_iteration = lastDate);
  iter = rows.iterator()
  while (iter.hasNext()) {
    // do stuff with current row
    if(!iter.hasNext()) {
      // last cycle
      lastDate = iter.current.getCreate_time();
    }
  }
}

Apologies for not precise syntax, it's about the idea.
Answer: If you have the potential for multiple records created during the same second I would suggest using an auto incrementing id instead of a timestamp. Then, as for the timestamp examples given, you can simply query for records with an id greater than that of the last received record -
SELECT * FROM tbl WHERE id > last_received_id ORDER BY id ASC LIMIT 100;


SDL Web8 : setup the Components PROMOTE/DEMOTE for specific non-administrators user group access

Question: In SDLWeb8, I  want setup the Components PROMOTE/DEMOTE for specific non-administrators user group access. Is it possible to setup. Currently it will support only administrators. Anyone have idea about this setup.
Answer: The way it is designed, Promote/Demote will work for anyone with the required permissions on the source and target locations.
For instance, to move UP ("Promote") a component, the user must have the permissions to:

Create components in the target publication and folder
Delete components in the source publication and folder

In other words, it does not require administrator privilege.
Comment: Thanks for information Nuno. any idea what permissions I want setup for use?
Comment: Well, the users need to be able to do these operations - so you need (again, for the component example) Component Management Rights in both publications, and Write on the target folder, Delete on the Source folder. Given that Promote/Demote applies to every building block (any "RepositoryLocalObject") you may have to play around with the permissions until you find the right balance. The idea behind this rule was that we should NEVER bypass the current permissions set by the customer.


Ubuntu Touch - Unav offline tiles - can Foxtrot GPS tiles be used?

Question: At last Unav has been configured to allow map tiles to be stored in the phones memory. Has anyone tried to load tiles from Foxtrot GPS or are the file protocols or file names different? Details of offline mapping for Unav here - Unav.me
Answer: The simple answer is  - you can use the map tiles from FoxtrotGPS - you just need to copy them from your PC to your phone downloads and then move them to navigator.costales using the move command in the phone terminal

mv ~/Downloads/maps ~/.local/share/navigator.costales


Is there any default defect template available, so that we can fill the sheet and upload to QC directly with all defects by the End of the day

Question: We are forced to use HL ALM QC to raise defects. Currently we were using Rally to raise defects for Agile projects. But now on, we need to use HP QC, to raise the defects. For rally, i have created my own template , where i fill the columns with all N number of defects and directly upload in Rally using Addin. So i could save my time in raising the defects all at once. Is there any default defect template available like rally, so that we can fill the sheet and upload to QC directly with all defects by the End of the day.
If so, please help me out.
Answer: I haven't used HL ALM QC but, if it allows users to import bugs from spreadsheets or CSV file, then I'm sure it will also have an option to export existing bugs.
You can export one such bug report and the exported file will then become your default template which you can use for reference.
There is a very good article here on defect management in HP ALM QC. It also explains about importing issues from files and also has a screenshot of a sample excel sheet which was used to import bugs in their example. You can use this as a reference to make a sample template.
Comment: Great idea.. thanks.. i will try this approach and see if it works and customizing the report


Military band music

Question: Which instruments typically double up (play unison) in military bands? I have googled this question in different ways, but without an answer.
Comment: A clarification: By "doubling", do you mean having, say, several tubas playing the same tuba part, or do you mean two or more different instruments playing in unison?
Answer: This would be purely up to the composer/arranger and the particular sound they want. Short of a rule to follow, the best option is to do a study of orchestration of martial music. That study could be done primarily in two ways.

Study scores in the IMSLP library. For example, the music of John Philip Sousa is there, so his scores can be examined for his choices of doublings.
Listen to military bands. The US Army Band, for instance, has its own YouTube channel.
Comment: This wouldn't necessarily be reflected in the score if the question is about having multiple instruments play the same part (as is normal for string instruments in a classical orchestra).  Many band performances I've seen reflected this practice.
Comment: @phoog Do you mean as when the first and second violins play in unison?
Comment: No, that's not what I mean (and of course that is something that would be evident from the score). I mean as when there are 8 violinists in the first violin section. This happens in bands as far as I'm aware, although with fewer players in the section, perhaps three or four to a part; for example, I recall seeing a video of one band playing The Stars and Stripes Forever with a piccolo section playing the piccolo solo rather than a single player.
Comment: @phoog Got it. It didn't even occur to me to think of that as doubling. I took the OP to mean different instruments. PiedPiper's answer makes more sense to me now.
Answer: It depends on the size of the band. Some bands are so small that there is one player per part (maybe not even that, some parts might not be covered). In the case of a huge band almost everything might be doubled (or tripled, or more). In general, any time there are more players of an instrument than there are parts for it, some of the parts will be doubled. Mostly the first parts are doubled, but in some cases it can make more sense to double a lower part (e.g. if the first player is very strong and all the others much weaker).
For average sized bands (30-40 piece) you can generally rely on each of the B-flat clarinet and flute parts to be doubled and maybe the first trumpet/cornet.

Military band music


leaky bathtub not sure where the leak is

Question: We had drips from ceiling right below bathtub upstairs. It only happened  when the tub was filled with water(even small amount, so probably not overflow issue). I don't see any bathtub crack. What can be the root cause ?  Thanks!!
Comment: Hello, and welcome to Stack Exchange. Where relative to the supply/drain is the leak? Can you get beneath the tub? How does the drain plug work? (A picture or two would really help.)
Comment: What kind of tub is this? AFIK the possibilities are  fiberglass, steel, or porcelain on cast iron.
Answer: You have not yet established whether the leak is in the supply valves or in the tub or drains.
With the tub valves off for a sufficiently long time,  I presume you have no leaking, right? If so, that eliminates the supply piping before the valve seats. When you open the valves, water is admitted into the mixing chamber of the valve and it could be leaking as you fill the tub (crack in the valve body or around the valve stems).
Fill a bucket elsewhere in the house and pour it into the tub. If it leaks, then you have eliminated the valve(s) and it is in the drain of the tub. If it does not leak, it is in the valve(s).
Answer: I would plug the tub drain, place a stack of coins in the bathtub, and fill up water to the level of the coins.  Wait for some time and if the water level is below the coins, then you have a crack in the tub. Else it's your drainage that is leaking.


Can I use a 42 tooth max derailleur on my 13-32 tooth 9 speed freewheel?

Question: I have a 13 to 32 tooth 9 speed freewheel. I wanted to upgrade my bike by getting a clutch derailleur on it but couldn't find much 9 speed derailleurs with a clutch that were under my budget of $60. I finally came across the microShift advent which meets all my needs but as I did further investigation I found that its max tooth capacity was 42. I wanted to know if the max tooth capacity needs to be met for it to work properly or if I can just slap it on without any worries. And would I have to buy the matching shifter to go with it to make it work or could I use my current 9 speed shifter with it? Thanks in advance.
Answer: Rear derailleur's not only have a max large cog spec, they also have a MINIMUM large cog spec and a minimal tooth count on the high side (small) cog.  You state you'd like to continue using your 13-32 9 speed cassette.  When on the Microshift website, and filtering for rear derailleur options for a small cog of 13-14 tooth, the options do not include an Advent rear derailleur or a clutched one.  Basically they are 6/7 speed rear mechs that can handle a small cog of 13 teeth.  Delving further into the website, specifically the clutched rear derailleurs (Advent 9 speed), the specs are rather slim on information but it appears the Advents are designed for max large cog of 42-46 teeth.  Based on their absence when filtering options are set to a 13-14 tooth small cog, that too is out of their spec.
That said, it's possible they (Advent 9s clutched rear der) may work ok with your cassette, however, the large 10 tooth difference in your cassette compared to the Advent max large specs, could be a little too much to expect of the Advent to handle without problems.
Regarding the shifter issue, the information I read from Microshift, is that the Advent rear ders are only compatible with Advent shifters.  Two other models of 9 speed rear ders are the Mezzo and the Marvo. These are compatible with Shimano mountain shifters, however, none are clutched and each has a minimum small cog of 11-12 teeth.  Here's the Microshift website's 9s rear mechs.
You don't mention what the rest of your drivetrain is composed of, but a clutched rear derailleur is really only beneficial in a 1x system in combination with a narrow-wide chainring for the chief purpose of assisting in chain retention.  If you have a 2 or 3x front drivetrain, the front derailleur will keep the chain on just fine.  A 1x drive train's chain retention can be bolstered by using a chain guide, which is basically a front derailleur cage.  Then a clutched derailleur becomes less necessary.  On the flip side, a clutched rear derailleur in a 1x system that does not have a narrow-wide chainring is lacking 50% of the optimal set-up and would need a chain guide at least.
Essentially, it's not making a lot of sense based on your information and noting your limited budget, to get a clutched rear derailleur, until you're willing or able to acquire properly spec'd components to go with it.  This is especially so if you are currently running a front derailleur.
Comment: Probably not, but it's clear now your motivation for the derailleur upgrade. With the plan to go to 1x, perhaps just add a wider range cassette to the list and proceed with the clutched derailleur plan.  To bolster that thought, I'd point out that with the 32 front ring and your current cassette, the high gear 32/13 isn't very high and the 32/32 low gearing isn't very low by today's standards. Pricing of wide range 9 speed cassette is favorable (compared to 10, 11, 12 speeds). I bought a new 9s  SunRace 11-42 cass for around $35 USD a couple summers ago.
Comment: Some words of encouragement: rear wheels--both new and used--with 135mm spacing and HG freehubs (splined, Shimano style) are currently very good values in most areas. They are being heavily discounted as the industry moves to wider spacing, disc brakes, and Microspline/XD driver hubs.  Many used options include the cassette.  It's far more economical to buy a whole new wheel rather than replacing a hub and re-lacing the spokes even if u could diy it. Bicycle "Co-ops"  in larger urban areas are great sources of discounted parts and help
Comment: Jeff's answer is all well and good, but from my direct experience swapping out a Sunrace-class 12-40t cassette where a Shimano 12-32 was before (42t narrow-wide single), there is no way a 42t cassette would make it without an extension hanger on the XT derailer, as it *just* makes it at full-loose on the slack tensioner without interference meshing on the 40t.  Since the Advent is coming at the same problem from the other direction, there should be just enough slack tensioner adjustment to effectively shift on the 32t, although you may want to yank a few links out to make it more optimal.
Comment: In my front I have a 3x consisting of a 42, 34, and 25 tooth chainring. I will be very soon upgrading to a 1x 32 tooth narrow wide chainring with a chain guide. My main reason for wanting a clutch was to reduce chain slap. I have tried a chainstay protector but wasn't pleased especially after feeling the lack of chain slap on my friends clutched derailleur. With the components I will soon be upgrading to is it possible to remove the majority of chain slap without a clutched derailleur?
Comment: Must mention too, that it's best practice to install a new chain with a new cassette as running an unstretched chain extends the working life of a drivetrain.
Comment: I would add a wider range cassette if I could but I'm unable to without buying a whole new rear hub because its a freewheel. I wouldn't be able to fit a cassette on a freewheel hub because a freewheel hub is threaded instead of having splines. And I've always just stayed on my first cog in the front anyways which would be 24/32 and never really shifted it so at this point 32/32 would be an upgrade. Just kinda bummed that I won't be able to get a clutched derailleur without buying a whole new hub and cassette, but thanks for the clarification.


ClickOnce application how to auto start up after login

Question: I would like to have application auto start up after login.
something like you have start up links.
Any idea how to do this?
Answer: As @codeConcussion said you can make your application launch on start up using various solutions (add shortcut to start up group or update startup registry entry), but there's clean up problem. You can take a look on my article, where this issue is solved.
Answer: The typical approach is to add a shortcut to the user's Startup folder or add a new registry key from you application code. It's a hack though because it won't be removed on uninstall.
Here's more info.
Answer: You can pass command line parameters with ClickOnce.  You could have one normal link and then one link that contains a command line parameter that you can read in the startup to activte the app after they login (or any action you want).


Where should I ask "X"?

Question: If I'm not sure what Stack Exchange site to ask a question on, what's the recommended protocol? Do I ask the meta-question here on meta.stackoverflow.com? It looks like there are several "Where should I ask..." questions here, and the FAQ doesn't really cover this area.
Comment: Alternatively, ask in the place that *seems* most proper to you. If it doesn't belong there, it'll get migrated elsewhere. That's really what migration is designed for; it was never intended as an insult to the asker whose question gets migrated.
Comment: This is tough, as it's unlikely that any single person is sufficiently versed in what's on-topic at every SE site to be able to direct every question.
Comment: @Gabe But it's not all that unlikely that somebody visiting meta might recognize that a question belongs on a site they frequent, or at least be able to point the asker to a site-specific meta for clarification.
Comment: Some questions, of course don't fit any site - 3d graphics seems to be one (unless a new SE's come along I'm not aware of?)
Answer: Asking here is fine. As I mentioned in my comment, either somebody will be able to give you a definitive answer, or at least will point you to a site-specific meta if it's hard to tell 100% if your question would belong on that site. You can then get further clarification there if needed.
We even have a tag dedicated to this entire concept; tag your question here with site-rec!
Comment: @Yar Both approaches are good. You can follow Jeff's advice and if you're still not sure where to post the question, follow mine. :)
Comment: 2 upvotes, so it's fine but not really good? Also Jeff's answer, which is the opposite, also got 2 upvotes only? Hmmmm....
Answer: I'd start by browsing the directory:
https://stackexchange.com/sites
There's a fairly succinct definition of each site there.
While there are some grey areas of overlap between sites (the example I always use is URL rewriting questions, which could be on SO, SF, or even Webmasters), it's not too difficult to resolve by asking yourself "what's my job title" or "what professional hat do I usually wear?" and ask it of that community.
In other words, if you have a question about motorcycles, you don't start yelling out your question on crowded street corners hoping someone will answer. You go to the place where motorcyclists hang out, first...
Comment: Thanks, that helps me. Yet you should consider: Not always is ones question related to ones job (title) or profession!! It may be a hobby, it may be a new (!) industry or job or entrepreneurial venture that one might want to start. So with this lack of knowledge, it sure might be not so easy to decide! Additionally, if the question is on the vicinity of several topics or at an overlapping intersection (like the circles forming SE!), what is one supposed to do?

Where should I ask "X"?


Data sources for Alexa and Compete rankings

Question: How do Alexa and Compete get their data?  which one is better?
Answer: From Alexa:

Gathering Web Usage Information
  In addition to the Alexa Crawl, which
  can tell us what is on the Web, Alexa
  utilizes web usage information, which
  tells us what is being seen on the
  web. This information comes from the
  community of Alexa Toolbar users. Each
  member of the community, in addition
  to getting a useful tool, is giving
  back. Simply by using the toolbar each
  member contributes valuable
  information about the web, how it is
  used, what is important and what is
  not. This information is returned to
  the community with improved Related
  Links, Traffic Rankings and more.

From Compete:

Compete's clickstream data are
  collected from a 2,000,000 member
  panel of US Internet users (about a 1%
  sample), using diverse sources. Using
  a rigorous statistical normalization
  methodology, Compete creates precise
  projections of the behavior of the
  entire US Internet browser population
  on monthly and weekly basis. In
  addition, Compete provides daily
  estimates of share of consumer
  attention garnered by the top Internet
  sites and the velocity of change of
  this attention. Compete is the only
  commercial web analytics provider to
  make its data freely available online
  for all Internet users.

From my own experience, I think Alexa is more reliable, because its user database is bigger.
Answer: It's not really that easy to compare, because they deal in different metrics.
Looking at Compete's Unique Visitors for a site that i'm involved in, they give an average of 4,000 unique visitors per month. Google Analytics for the site average 180,000 unique visitors per month.
For Alexa, the metrics are all expressed as a percentage of global stats, or "
unique pages per day" -- things that no one else uses, so there's no way to gauge the accuracy of the stats.
However, i believe that the problem is the small, US-centric sample which penalises non-US sites (FYI, the site i'm talking about here is for a business in South East Asia).
Moreover, looking at the textual information that Alexa presents, i'm concerned that it's several years out of date, which makes me doubt the efficiency of the system. According to Wikipedia:

On November 27, 2008, Amazon announced that Alexa Web Search was no longer accepting new customers, and the service would be deprecated or discontinued for existing customers on January 26, 2009

The Wikipedia article is a good read, as it talks about the accuracy of stats.
Final word: trust only verified stats!
Comment: yes, for Alexa, the metrics are all expressed as a percentage of global stats. Still, it is possible to get estimation based on these data. i.e. http://www.rank2traffic.com/, http://netberry.co.uk/alexa-rank-explained.htm


How should you tell a very intelligent 4 year old that her dad isn't her dad

Question: I've recently found out that the man I thought was my daughter's father isn't. How do I tell my baby that someone else is her dad?
Comment: Please include more details. Is the person you thought was her dad active in her life? Why do you think she needs to know? Etc. Thanks.
Comment: How are both of these men currently involved in her and your life and what changes to that involvement would you be comfortable with?
Comment: The person I thought was her father wants nothing to do with her now and her biological father wants to be apart of her life
Comment: @Jellyfish: Has the bio dad been part of her life since before the revelation? Is he a complete stranger to your daughter?
Comment: "Apart of her life" or "a part of her life"?
Comment: As it is, this question is just too vague. It doesn't include any context about the type of relationship the child has with either of these "father" figures, so the answers will always have to make too many assumptions.
Answer: I think you need to separate the emotional and biological aspects for the time being. She will happily relate to any parent-figure provided, but is probably too young to understand the biology of parenthood.
Let her bio father be a part of her life to whatever extent you feel comfortable. She will probably start calling this guy "Daddy" without any prompting (the opposite case, where a step-parent can't be called "Daddy" seems to be a regular problem). Then in a year or three, when you judge her old enough, you can get an age-appropriate sex education book, and use that to explain to her how she came to be born and what "Father" really means.
Answer: First, if you referred to him previously as Dad or Daddy or something like that, perhaps you could transition to referring to him as "John" or whatever his name is.
In terms of cognitive understanding of this news, it might help to lay some groundwork with picture books about aspects of genetics that small children can understand, medical science and testing in general, and conversations about nontraditional family configurations.
The way I paved the way for my son to understand that we had adopted him, is that I started telling him the story of his adoption very early on.  He didn't understand yet -- that's how early.  I didn't tell it every day or anything, but I repeated it from time to time, in a somewhat ritualistic way.  As he got older, I gradually added more details.  I would tell him the story while something else was going on, for example during dressing.
You can't do exactly that, but I think you can abstract from that that not everything you tell her will be understood completely, at the time, but there is a paving the way going on.
Also you can draw a family tree.  It's okay to have an important person in the picture who isn't related by blood, marriage or adoption in the tree.  You can just draw that person without a standard connecting line.  Maybe you could use a squiggly connecting line.
There is a good book that explains to a small child how human reproduction happens, Making Babies: An Open Family Book for Parents and Children Together by Sara Bonnett Stein.  I read this with my children and I liked it.  I don't remember what the terminology was but I think it might have been egg and sperm, but if not, you can introduce the terms yourself, and make simple pictures.
You can come back to the book from time to time, and when you see that she is understanding it pretty well, then you can tell your daughter, let's say her name is Rachel, the story of her birth, for example:
John wanted to make a baby with Mommy.  And Fred wanted to make a baby with Mommy too!  Then Rachel was born!  Mommy was so happy when Baby Rachel was born.  Mommy thought that Baby Rachel came from John's sperm, but then there was a surprise!  John and Fred went to the doctor and had some tests, and the doctor said, "Surprise!  Baby Rachel came from Fred's sperm!"  Do you remember where Mommy kept Tiny Baby Rachel safe and warm, before being born?
This could be a warm way of finishing the story, with a cuddle and thinking about how safe she was in Mommy's tummy (or uterus if you prefer).
I hope you'll be careful how you talk about John pulling his disappearing act, and not connect the dots for her, until she's older.  But if you feel sad about him disconnecting from you two, it's okay to say that -- as long as you're careful not to set her up for thinking that it's her fault.  In other words, I hope you can find some unrelated reason for him not visiting any more.  When she's older you might say that maybe he felt hurt when the surprise happened.
Answer: In addition to volunteering with allot of kids I am a known sperm donor, which means I've donated sperm for women who want to have a child.  Some times I'm lucky enough to have the parents choose to allow me to visit the child I donated for.  A side effect of this is that I've had allot of experience with children who did and didn't know I was their sperm donor, as well as seeing how they responded to being told.  I think I have a good idea how kids respond to this situation.
And the truth is...a 4 year old doesn't care.  Seriously, at 4 years old they don't understand anything about biology or how they were born.  Their genetics and where it came from is way over their head.  Even if you explain that sort of thing to them explicitly they will just ignore it and ask if they can get back to playing now.  I know because I've tried (when the parents allow/want it) to explain how I donated to a 4 year old and they don't care, one even gets annoyed at me for trying to talk about boring stuff when she wanted to play.  They have 0% interest in biological parenthood at this phase.
What they do care about is who is in their lives.  Who loves them, who cares for them, who tucks them in at night.  Plenty of kids value me as an honorary Uncle or godfather, rather or not I'm their biological father.  I know kids who I'm not related to who are deeply attached to me and kids I donated sperm for, but who the parent's didn't choose to allow me to be in the life of, who mostly don't care who I am even when the parents explain it to them.
To give an example I donated for a girl who has a brother two years older then her I didn't donate for.  Both of them know me as Uncle Drew.  Their parents didn't decide to tell them I donated for my 'niece' until she was 5 and he 7.  Their response when they found out was a resounding 'meh'.  Neither cared at all about the biological aspect.  My nephew is now 8 going on 9 and better understands how I became a member of his family, but he still loves me just as much despite knowing I'm not biologically related to him, because all he, or any kid, cares about is that I spend time with him and care for him.  Likewise the girl I did donate for still doesn't understand how I helped (she will tell you I helped get her 'out' of mommies tummy), despite multiple attempts to explain it.  All she cares about is that I come over to visit once a month and spend time with her.
By contrast last year I was lucky enough to be invited to the birthday party of a 6 year old who I donated for but had never had a chance to meet before.  Her mother's were planning to tell her who I was after the party, but in the meantime I asked her if I could play with her and we spent the day playing with all the other kids and having allot of fun.  Eventually near the end of the party her older sister called her away for a moment and apparently told her who I was, this was not how the mom's planned to tell her.  She came up to me and asked "are you my daddy?"  and I had to explain how I was a donor but had promised her moms not to try to be a daddy.  She looked at me and said in the cutest whimsical voice "but I've never had a daddy before".  However despite her moment of whimsy when I asked if she wanted to go talk with her moms about it more she decided she would rather stay at the playground to play, and immediately forgot about all the biological stuff.  She enjoyed my visit because I played with her all day, but outside of asking me 2 questions, she completely forgot about the revelation of biological relationship immediately.  Kids just don't care about it at that age!
So what should you do with your daughter, I say let the biological father start to see her if he wants contact, assuming you aren't 100% oppose to it (and well legally he could still force it, so it's probably better to do it on your terms).  If the other presumed father wasn't in the girls life then the girl won't miss him or care that he is gone.  He will be quickly forgotten and be a non-issue to her.  She doesn't understand what parenthood really means so even if you told her he was 'daddy' it was nothing but a word to use for the guy to her.  You might want to consider using a different word for dad for the biological father then what you used for the presumed father at first though, just to avoid confusion on the labels; though I doubt it would be a problem for her anyways.
Now rather or not the biological father should be called 'father' is a bit more complicated, and depends allot on how much contact he wants and rather or not you are open to that level of contact.  It may be safer to start her out with visits without trying to suggest any particular term for the biological father, just to make sure that the two get along and regular contact is something you want before explaining.  If his involvement isn't going to be much you may want to stick with telling her that 'he helped me have you' without using the phrase father at first so as not to give her the idea he is going to be playing the role of father, ie a male regularly part of her life, like she sees on TV, if that isn't what you two want.
However, you have allot of leaway here.  She will not ask questions, kids are shockingly indifferent to this stuff.  I understand your concern, but please trust me as someone who's witness these discussions quite a few times she will accept whatever you tell her without batting an eye and move on.  It will not be a shock or hardship to her in any way if you tell her now.
The only thing you don't want to do is wait.  The longer you wait the harder it is to tell her, and the more likely she will take offense.  It's best to tell her now while she is still very young.
Answer: What role does the person who you thought was your daughter's father play in her life? Do you know who the biological father is and what role he will play?
You first need to sort out the adults. Then you find out how your daughters's life will change, and that's what you talk about to her.

How should you tell a very intelligent 4 year old that her dad isn’t her dad


Proving that every set $A \subset \Bbb N$ of size $n$ contains a subset $B \subset A$ with $n | \sum_{b \in B} b$

Question: If $n\in \Bbb N$, $A\subset \Bbb N$, $|A|=n$, how to prove that there exists a subset of $A$ such that the summation of its element is divisible by $n$?
Comment: And that subset must not be empty?
Comment: @JeppeStigNielsen is $0\in\mathbb{N}$?
Comment: @oldrinb I was referring to the searched-for subset of $A$, not to $A$ itself. $X\subseteq A\subset\mathbb{N}$.
Answer: Let $A = \{ a_1, \ldots, a_n \}$. Consider the numbers $0$, $a_1$, $a_1 + a_2$, $\ldots$, $a_1 + a_2 + \cdots + a_n$ modulo $n$. There are $n+1$ numbers and only $n$ residue classes modulo $n$, so by the pigeonhole principle there exist $i$ and $j$ such that $a_1 + \cdots + a_i$ and $a_1 + \cdots + a_i + \cdots + a_j$ are equal modulo $n$. Hence $n$ divides $a_{i+1} + \cdots + a_j$.
Answer: Consider the $\rm\:n\:$ partial sums $\rm\: n_1,\,\ n_1\!+n_2,\,\ n_1\!+n_2\!+n_3,\ \ldots\ (mod\ n).$ If one is $\equiv 0\:$ we're done, else two are $\,\equiv,\,$ so subtracting them yields a tail sum $\equiv 0.$
Remark $\ $ Here's a similar Pigeonhole argument: $ $ if $\rm\:n\:$ is coprime to $10\,$ then every integer with at least $\rm\:n\:$ digits $\ne 0\:$  has a contiguous digit subsequence that forms an integer $\ne 0\,$ divisible by $\rm\:n.\:$ Hint: pigeonholing, two of the $\rm\:n\!+\!1\:$ numbers $\rm\:0,\ d_1,\ d_2 d_1,\ d_3 d_2 d_1,\, \ldots,\:d_m\!\ldots d_1\:$ must be $\rm\:\equiv\, \ (mod\ n),\:$ so subtracting them $\:\ldots$
Answer: Let $A=\{a_1,a_2,\dots,a_n\}$.
Look at the numbers $a_1$, $a_1+a_2$, $a_1+a_2+a_3$, and so on up to $a_1+a_2+\cdots+a_n$. If two of these sums are congruent modulo $n$, say $a_1+\cdots +a_i$ and $a_1+\cdots +a_j$, where $j\gt i$, then their difference $a_{i+1}+\cdots +a_j$ is congruent to $0$, and we have found a non-empty subset of $A$ with sum divisible by $n$.
On the other hand, if  $a_1$, $a_1+a_2$, $a_1+a_2+a_3$, and so on up to $a_1+a_2+\cdots+a_n$ are all distinct modulo $n$, then one of them must be congruent to $0$.


What does "in using" mean?

Question: A sentence I found has the phrase "current trends in using business applications".
What does in using mean here?
Answer: In using is not a constituent—a distinct part of the sentence.
A preposition phrase headed by in is the usual way of telling what kind of trend you are talking about. For instance, we speak of

trends in fashion
trends in music
trends in economics
trends in marketing
trends in programming

Note that last two trends have -ing words as the object of the preposition in. When an -ing form is used this way it is called a gerund—it acts as a verb and as a noun at the same time.

It can act like a noun in acting as the object of a preposition or a verb, or as the subject of a verb:

I live by writing. Writing is my profession.  I enjoy writing.

It can act like a verb in taking its own subject (expressed usually as a possessive, but in some circumstances by an objective pronoun) and its own objects:

My writing answers gives me great pleasure.

In the sentence fragment you quote, using business applications is a gerund phrase—a gerund plus its object in this case—acting as the object of the preposition in.  You might paraphrase the sense thus:

trends in how business applications are used
Comment: "trends in how business applications are used" oh now it makes sense :) thanks btw.
Answer: It just means the same as 'while using' or 'in the use of'. So to rephrase your sentence:
state current trends in the use of business applications
So it's not the trends in the applications themselves but how people are using them to accomplish their goals.
Comment: I am not exactly clear can you explain it more properly?

What does "in using" mean?


Two routers connection

Question: I got two routers. A D-link DSL and an Aztech HW5503g. I connect to internet through dlink. The default ip address of dlink is 192.168.1.1 and that of aztech is 192.168.2.1. As I want the computers connected in in two router to use the same subnet, i configured as said in http://routersetup.blogspot.in/2007/08/connecting-two-routers-wired.html ie disabled DHCP in aztech and connected the two routers on the numbered ethernet port (not WAN). Everything works fine. I can access internet with any router. The problem is I cant access web interface of second router( Aztech 192.168.1.2) when i connected through either of the router. How can I access the web interface in second router in this setup?
Answer: If I understand correctly, and just talking about the routing problem:

router1 IP/network is still 192.168.1.1/24 (or in other words, 192.168.1.1/255.255.255.0)
router2 IP/network has been changed to be 192.168.1.2/24 (iow, 192.168.1.2/255.255.255.0) ?

Did you really change his network to ? it seems as if you did not.
For example if you changed it to, say, 192.168.1.2/32 (or 192.168.1.2/255.255.255.255) it would explain the problem: any request outside of its lan (ie anything else than from 192.168.1.2/32) would then be routed to the default gateway if there are no specific routes saying something more precise, and that default gateway is probably on another interface altogether (wan?)
You should then:

reset router2 to its default
connect to its lan interface with a laptop/pc, with that laptop/pc in the good (default) network too (if your router has dhcp by default, just let it assign a correct ip. If not, put an IP on your PC that is in the same lan as the router2 default network, and on a different IP than the router2 default IP)
check network config: assign it the 192.168.1.2/24 ip (or 192.168.1.2 / 255.255.255.0)
Comment: simpler could be : just go back to the first setup (router2 have its hosts on 2.x and provides internet via router1), and add on it a route saying "192.168.1.0/24 is also on the WAN interface, going to 192.168.1.1". and on 192.168.1.1 add a route saying "anything for 192.168.2.x/24 should go to router2's IP of 192.168.2.whateverhisipisinthatsetup(maybe dhcp assigned in that case, or you can fix it via assigning mac@ to, say, .1.2)"
Comment: Let me explain my situation. Router 1 is connected to internet through dsl. 192.168.1.1/24. Router 2 got 5 ethernet ports. 4 of them marked 1 to 4 and the 5th as WAN. If i connnect a cable between router 1 ethernet and router 2 WAN , pc connected to router 2 got internet and router2 assignes internal ips with 192.168.2.1/24. Now you cant see computers connected in router1 through router 2. So i changed the router 2 same subnet as that  router 1 192.168.1.2/24 and disabled the DHCP. Now router 1 acts as the DHCP Server. (check the link in the question).
Comment: otherwise (2nd setup): if you put both routers in same LAN, connect them with their LAN interface (and put their IPs on the LAN side). WAN interface on router2 is then unused (you could use it to create a separate lan, or a separate access to another internet gateway, or whatever)
Comment: if in the same lan, and if you still want to use router2 as a Wifi provider, it still can have its dhcp enabled, but both DHCP shouldn't overlap (ie, on router 1 give it, per ex, the range .10-.99 and on router2 the range .100-.199)
Comment: I am already in the 2nd setup as you said. The problem is that the web interface and telnet port are not open in this setup. My internet is just working fne on both routers
Answer: You disabled DHCP but did not change the default statically assigned address on the Aztech. You'll have to reset and configure the routers address before you disable DHCP.
Comment: I have already done that. I changed ip of aztech to 192.168.1.2 and even assigned the mac address of aztech to this ip on dlink. I can see the aztech is assigned as 192.168.1.2 on the Dlink's ARP table. I cant even ping to 192.168.1.2. The whole setup works if I used the default config ie connect through the WAN port. But the problem is that they are two distinct networks
Answer: Ok, going in setting the IP on the Aztech as something in the other routers range whilst still letting it be DHCP in the first step, then going back in and setting it to relay on in the second step solves the problem.
Assign the ip for the aztech router the same ip on the first router with the aztech mac address (reserve the IP).
Make sure attached PC is given a static ip in the range so it can talk to both routers.
Answer: You mentioned the aztech as being 192.168.2.1, and later as trying to reach it on 192.168.1.2. Was the first address a typo?

Two routers connection


View Song Lyrics in iTunes

Question: Assuming I have songs with lyrics already added to them, how do I easily view them when listening to a song?
Comment: @Am1rr3zA : Given the accepted answer, the requirement you added in was *not* part of my question. Ideally I did not want an entirely seperate application, but zenopolis' answer provided third party software that integrates into iTunes. It's quite a bit buggy, but I'm using it and I love it. Needless to say, I rolled back your edit, because it was inaccurate.
Answer: With reference to the current version (iTunes 10):
Without adding third party software, you will need to actively select the currently playing song to view its lyrics.

⌘+I opens the Info window for the selected song
esc closes the Info window

If you open the Lyrics tab in the Info window, it will open in the same tab the next time you open it.
Visualizers
If you want to view the lyrics without interacting with your Mac, you might want to consider adding a third party visualizer. One such visualizer is Cover Version (freeware).
(NOTE: With OS 10.7.4 & iTunes 10.6.3, CoverVersion shows my lyrics with a upper case letter height of three pixels.  I opened the info window and changed the font from 12 pt. to 144 pt., but it didn't change the Viz.  But it's open source, so I could fix it if I were sufficiently ambitious.)
After you have installed the visualizer, you will need to select it in iTunes. For example:
View > Visualizer > Cover Version

Use ⌘+T to toggle the visualizer on/off
You can choose the menu item View > Visualizer > Options... to configure some visualizers  (For example, in Cover Version you can switch off the background graphics to make the lyrics easier to read)

Other Third Party Software
If you want to display lyrics while using your Mac for other tasks, you'll need to use a third party application.
Examples include:

Get Lyrical from Shullian Productions (Donation Ware)
LessLyrics from Ixhan (Freeware)
Comment: Disclaimer - I haven't tested Get Lyrical or LessLyrics myself
Comment: I KNEW something like Cover Version **had** to exist! Thank you!
Answer: I'm not sure how long it has been there, but the last three or more versions of Music/iTunes have lyrics display built in.  When a song is playing, if it has lyrics installed, the lyric icon will be highlighted.  Tap it, and the lyrics appear.  When the next song starts, the lyrics will automatically change, too.  Unfortunately, they don't automatically scroll.
Comment: You're referring to iOS, right?
Comment: iOS, iPad, MacOS—all of them.  I doubt it was there when you posted the question, but it's there now and has been for more than a year.  I use it to follow along with audio for my language learning.
Comment: Huh, I so rarely ever used the mini player, and certainly never since the great iTunes -> Music breakout happened. Same layout as AppleTV music playback, nice. However, I have different behavior than you described. The lyrics in songs without timed lyrics aren't showing up at all for me, lyrics with timed (live) lyrics do automatically scroll, I'll have videos of this soon.
Comment: I don't use mini-player.  I added images, but somehow they weren't saved.  Now they are.  I don't have AppleTV nor a subscription to Apple Music.  But the non-scrolling behavior as in the images works for me with all songs in which I have added lyrics with Get Lyrica or by hand-pasting.
Comment: I can't believe I didn't notice that icon on the toolbar. Sounds like we both learned something, because if you use the mini player you get live lyrics if the song data includes it. I'm not sure if it exists outside of Apple Music streamed (backed?) tracks though. I haven't actually looked into the data format and seen if I can get it on my own imported tracks. And also iTunes Music Store purchased tracks I have no idea about.
Comment: P.S. I can't believe you annotated those with Papyrus…
Comment: I don't like Papyrus.  But I wanted something that would be obviously added.
Comment: The lyrics sidebar supports live lyrics if the data is present in the song https://i.imgur.com/YRjLXgb.png
Answer: There's no built in way without right-clicking/control-clicking the song and selecting Get Info but you can download widgets such as Desktop Lyrics
Comment: Don't suppose you'd know of anything that works in the sidebar? Or perhaps a bottom bar? (Like the album art bar, but full width of iTunes, or at LEAST the full width of the library pane.)
Comment: You could look through the software on the apple website here http://www.apple.com/downloads/macosx/ipod_itunes/ but I don't think you can get plugins for iTunes on the Mac which would show anything in the actual iTunes window.
Comment: If the lyrics show in Get Info, they will also show in the sidebar.  I don't recall whether that was available in 2011, but I have been using it for a long time.
Answer: Get Lyrica from the Mac App Store, it's only $2 and worth much more. This will find lyrics for songs in iTunes and add them automatically to the song file. Very cool.
As to displaying lyrics automatically when the song plays... sounds like a feature Lyrica should add! I'll mail the developer.
Answer: I search a lot about this issue before and the best free solution I was found is to use Get Lyrical. it didn't use your lyric that added to them with iTunes.
Comment: But I want it to use the lyrics I have.

View Song Lyrics in iTunes


Dietary Supplement data

Question: Does this data contain recall data (or any data) on dietary supplements for humans or dietary supplements for animals (which is handled by the Veterinary Drug department)?
Comment: Thanks for this suggestion of data to include in the openFDA API. What kind of information would be most useful? Recall enforcement reports only, or other kinds of data?
Answer: I do not have an official answer (I am just a community member passionate about the project)
Dietary Supplements - YES
If you search for a recent dietary supplement report from http://www.fda.gov/ForConsumers/ConsumerUpdates/ucm153239.htm on the https://api.fda.gov/drug/enforcement.json API endpoint, you do get results. Note this is the drug enforcement report endpoint, not the food enforcement report endpoint.
For example: https://api.fda.gov/drug/enforcement.json?search=bee%20pollen&limit=1 matches the most recent update from the aforementioned FDA link (http://www.fda.gov/ForConsumers/ConsumerUpdates/ucm401676.htm).

Veterinary Drugs - NO
Animal and veterinary recalls and market withdrawals appear to be listed at http://www.fda.gov/AnimalVeterinary/SafetyHealth/RecallsWithdrawals/default.htm. When I do a search on the food and drug enforcement report API endpoints, I don't get any results.
When I do a search on the device enforcement report endpoint, I get some results when I search  keywords for recent animal drug recalls... however they have older dates so they must be previous ones. Bottom line: doesn't seem like recent animal/veterinary drug recalls are in any openFDA at this time.

Dietary Supplement data


how to stop/pause a pod in kubernetes

Question: I have a MySQL pod running in my cluster. I need to temporarily pause the pod from working without deleting it, something similar to docker where the docker stop container-id cmd will stop the container not delete the container. Are there any commands available in kubernetes to pause/stop a pod?
Answer: So, like others have pointed out, Kubernetes doesn't support stop/pause of current state of pod and resume when needed. However, you can still achieve it by having no working deployments which is setting number of replicas to 0.
kubectl scale --replicas=0 deployment/<your-deployment>

see the help
# Set a new size for a Deployment, ReplicaSet, Replication Controller, or StatefulSet.
kubectl scale --help

Scale also allows users to specify one or more preconditions for the scale action.
If --current-replicas or --resource-version is specified, it is validated before the scale is attempted, and it is
guaranteed that the precondition holds true when the scale is sent to the server.
Examples:
  # Scale a replicaset named 'foo' to 3.
  kubectl scale --replicas=3 rs/foo

  # Scale a resource identified by type and name specified in "foo.yaml" to 3.
  kubectl scale --replicas=3 -f foo.yaml

  # If the deployment named mysql's current size is 2, scale mysql to 3.
  kubectl scale --current-replicas=2 --replicas=3 deployment/mysql

  # Scale multiple replication controllers.
  kubectl scale --replicas=5 rc/foo rc/bar rc/baz

  # Scale statefulset named 'web' to 3.
  kubectl scale --replicas=3 statefulset/web

Comment: Thanks for the tip, i think  should be
Comment: As I understand it, if there's an hpa, this is not possible.
Comment: That's correct. That's the reason I started with a statement what all have suggested and the answer is mostly in context of the question
Comment: Actually, this is the right way to stop Deployments. This option also works for StatefulSets but won't for DaemonSets. DaemonSets need to be deleted and created again.
Answer: No. It is not possible to stop a pod and resume later when required. However, You can consider the below approach.
In k8s, pods are abstracted using a service. One way I can think of isolating the pod(s) is by updating the pod selector in the service definition.
That way you can control the traffic to pod(s) using service definition. Whenever you want to restore the traffic update the pod selector value back to what it was in the service definition.
Comment: too bad it doesnt help pods whose source is kafka/eventhub (and i wish to pause them,  launch new pods and if it fails resume the old ones)
Comment: Hi @MartinKosicky , that's exactly my use case, I have a container consuming from eventhubs trhough kafka protocol. did you find a solution? The only tworkarrounds that cames to my mind are ugly (change credentials, multiprocesses inside a container instead multiple containers in a pod, etc).
Comment: @karlos9o we actually just deleted the old pods,  since its eventhub/kafka sourced, the zero downtime is not so important here. But if you really want it you can kubectl apply and change some configuration (pause processing). That should trigger redeploy of the pods
Comment: Services are not meant to be abstractions of pods. Services are just a way to route different types of network traffic and port mapping. Scaling the number of replicas of a Deployments, and specifically the replica set to 0 (if there is no HPA present) would actually delete all instances of the pod
Answer: With Kubernets, it's not possible to stop/pause a Pod. However, you can delete a Pod, given the fact you have the manifest to bring that back again.
However, if you want to delete a POD, knowing that it will immediately be launched again by the cluster, run the following kubectl command.
kubectl delete -n default pod <your-pod-name>

Comment: The pod will immediately come back again because the replicaset will re-create it -- that's its job. So this doesn't actually answer the question.
Comment: I think this is a valid response. There's nothing like "stopping" a pod.
Comment: The question is not about deleting a pod.
Comment: sometimes you want it to come right back. If a pod gets corrupted (running in an infinite loop or some nonsense), killing it and launching another is sometimes needed.
Answer: For me it worked when I scaled the pods down to 0 in Helm's DeploymentConfig details in Openshift Console.

how to stop/pause a pod in kubernetes


Cannot load .gltf file to use iwith Three.js in my react website

Question: I have the .gltf file of my 3D model in the public folder of my project, I then used "npx gltfjsx filename" command to generate a .js React component from the .gltf file. In that .js file I have the line:
const { nodes, materials } = useGLTF('C:/Users/jaime/Desktop/NFS-site/public/FSFenix_Render.gltf')

The error I am having is that the response of the HTTP request for the file is a HTML and not the .gltf file. The error shows up like this in the browser:
Could not load ./FSFenix_Render.gltf: Unexpected token '<', "<!DOCTYPE "... is not valid JSON
I've tried using relative and absolute paths, I've tried switching the gltf file from the /public directory to the /src directory. I have no ideia how to fix this.
Answer: When using useGLTF in the react-three-fiber library, ensure that the path to the .gltf file is relative to the root of your project. Instead of using an absolute path, use a relative one starting with /. For example:

import { useGLTF } from '@react-three/drei';

const { nodes, materials } = useGLTF('/FSFenix_Render.gltf');

Place the .gltf file in a folder that is accessible to your application, such as the public folder. Make sure the .gltf file exists at the specified path. After making these changes, restart your project.
Comment: ty so much, it seems that that was the problem


Why was this question closed?

Question: Any plans to ban body scanner opt out after Brexit? I asked a very specific question: whether plans exist or not. I did not ask what will happen. How on earth can the existence of these plans be a matter of opinion? We have seen people here (Gayot , especially ) who had excellent sources of materials ordinary people would be very hard pressed to find. This is why I asked what I asked. It's just people can't be bothered to read.
Comment: You ask about things to happen after Brexit. While at this time there is still no certainty Brexit will happen and if so, how. Reason enough to close. The other reason also stand. We can guess what is going to happen after Brexit, we can not know.
Comment: Come on, in the comments there are at least three telling you why we think this question had to be closed.
Comment: None of them has anything to do with the question, it has to do with what people presumed I asked.
Answer: The problem with all the Brexit travel questions is that no certainty exists anywhere in the process, starting from very basic questions such as whether or not the UK and the EU will allow unrestricted flights between each other. Yes, there might be a policy document somewhere deep on Gov.UK which mentions the possibility of removing the body scanners opt out, but what good does it do at this point? Britain might end up staying in the EU eventually or end up accepting EU's policies in body scanners to align airport security between the two regions.
Feel free to reopen this question a few weeks after Brexit actually happens (if it ever does) and I'm sure we could dig up a proper answer then.

Why was this question closed?


On Minecraft Bedrock Edition, how do you find Mooshrooms?

Question: I've looked in most biomes, but can't find the red Mooshroom.  How do I find them?
Comment: -1, this is something you can google. This shows no research effort.
Comment: Didn't know we were bothering you?
Answer: In Bedrock Edition, Mooshrooms only spawn at a light level of 7 or higher, and in the Mushroom Fields or Mushrooms Field Shore biomes:

Mooshrooms spawn at light level 7 or above in Mushroom Fields and Mushroom Field Shore biomes. 5% of them spawn as babies.

What makes it hard to find them is that the particular biome they spawn in is quite rare.  These biomes seem to generate most commonly as islands in the ocean, so perhaps start searching around any oceans.

The mushroom biome usually generates as a single island surrounded by ocean, though it occasionally generates touching land on a side
Answer: Mooshrooms can spawn on a mycelium island in the ocean. Mycelium islands can be great because no mobs spawn there! Mycelium islands look like grass islands, but the grass is gray instead of green, there are mushroom trees and mushrooms everywhere.


How does whatsapp stay in background without being closed?

Question: Android usually kills background processes if they do not have a persistent notification. Why do apps like whatsapp and Facebook not get killed?
Comment: Because they run a service I'd say :) I'm not using WA or FB, so I cannot be sure here: To higher their priority, apps can register a service and have an icon shown in the notification tray, so the OOM killer considers them "more important" and "kills other stuff instead", if possible.
Comment: I think having an icon in the tray is irrelevant (my WA doesn't have one anyway). As long as the service runs as at a "service process" *or higher* priority.
Answer:
Android usually kills background processes if they do not have a
  persistent notification.

Well most often this is the case, but Android OutOfMemory Killer (the component within Android responsible for killing processes) uses fairly complex logic and criterion to kill apps and processes which host these apps.
In Android, every application runs in a Linux Process. Each Linux Process has a Virtual Machine (Dalvik Virtual Machine or ART Virtual machine) running inside it. There is a limit on the memory a process can demand and it is different for different devices and also differs for phones and tablets.
When Android is running short on Memory space (may be because so many apps are simultaneously running in a device) OutOfMemory killer comes into picture and start killing processes of Apps which are in background first.
Now, apps such as WhatsApp, Facebook uses something called Service and Push notification mechanisms. Service allows app to run some code run in background and even though if App is Killed by OOM Killer, Service can be restarted again by Android when sufficient memory is available to make it run.

Why do apps like whatsapp and Facebook not get killed?

This is not true as Android can kill apps based on their state (such as foreground or background). It is just that the Apps and their component(such as Service) are being restarted as when they receive Push notifications, so that user can interact with the app.
So, as and when Push notification is received (means WhatsApp message), Android can restart the killed app's component(in this case WhatsApp).
This way Android is hiding the complex details of Memory management and process management from user and making sure that user can interact with an app without any issue.
Comment: I wrote this answer based on my experience as a android developer - there exist plenty of documentation to explore how OOM Killer work and simple google search should help to get handle of it. I did not added those links in my post to keep it simple and understandable to layman's mind and not developer point of view.
Comment: Is there a way to prioritize whatsapp over facebook, e.g. using tasker to kill something first to prevent the OOMK killing another app? I hear task managers are bad, but this type of bypassing seems desirable?
Comment: This answer has a nice explanation! Do you have any official sources to link to corroborate the logic?


High frequency use of thyristors

Question: Can I use an SCR such as BT151 or BT136 (or even a triac such as TYN616), to pass a high voltage(400V) high frequency signal (pulsed DC at 50KHz) for a fixed period?
such as 1 second on, then off for another second, then on again?
Answer: No. The off time is not enough for the thyristor to turn off AND the rate of rise of voltage (dv/dt) is going to be high enough to turn the thyristor on even without gate current.
Both factors are too high for general-purpose thyristors by at least an order of magnitude.
Use a MOSFET, a BJT or an IGBT. Or even a relay.
Answer: No SCR's latch on as long as there is a positive voltage difference across its anode and cathode
Comment: Hi. Thank you for the quick reply. But wont the pulsed DC reach below the Vth for the SCR, so if I shut off the control pulse, the next time the pulsed DC reaches zero, the SCR should shut off?
Comment: So it is the voltage source and the gate that is pulsed?  SCR's are very slow at switching
Comment: The voltage source pulses at 50KHz. The gate at 1Hz. But, like Spehro Pefhany said, I need to use MOSFETs. Thank you for your input.

High frequency use of thyristors


How to validate proper implementation of ERC-1155 contract?

Question: I want to implement an ERC-1155 contract. Using TDD we would first write a test.  Which begs the question of is there a way to validate that your contract properly implements ERC-1155?
Answer: With erc165 or 1820, the requirement of 1155 is include erc165 and in their eip they also say this:

Smart contracts implementing the ERC-1155 standard MUST implement the
  ERC-165 supportsInterface function and MUST return the constant value
  true if 0xd9b67a26 is passed through the interfaceID argument.

So to determine if the contract implement erc1155 you first try to check if the contract implement erc165, you can follow this guide to see if the contract implement erc165.
Then after that, you detect if the contract implement erc165, you just call to the contract supportInterface function with the interfaceId 0xd9b67a26 and if it return true, then it is erc1155 contract, else it is not properly implement erc1155.
Comment: @StevenT.Cramer i think the only way to do it now is to call every standard erc1155 function to see if each standard function work. Then after that you can try the fallback function for the contract. And if all that work try to transfer token to contract address one implement tokenReceived and one not to see how it's respond. Or transfer token from contract address to another.
Comment: thanks for the input. But just because we implement an interface doesn't validate that it is implemented properly.  So was hoping for some integration test harness for the ERC-1155 interfaces.
Comment: I think so.  I have looked around and the reference implementation doesn't even run and there are 3 issues that have no comment.  So I think the answer is ... write my own integration tests to test the standard.  And I guess I hope I get it right.


System requirements for Cometd/Bayeux Usage on Android

Question: I'm trying to implement a Cometd/Bayeux server on Android using iJetty.  The Jetty implementation itself works just fine serving static pages along with servlets.  I am trying to up the ante a bit and create a Bayeux application on the phone but I'm having some trouble.  I can hit the page that has the dojo cometd scripts on it, but I am unable to subscribe to the channel.  When I view firebug/chome developer tools, I see a series of posts/gets that last a couple of milliseconds (~14).  However, when I run a cometd application on a normal machine, the posts/gets last several seconds (~14 seconds) before timing out and reopening the connection.  This second scenario makes sense to me with my understanding of how continuation in HTTP works.  So I'm thinking that something is not allowing those connections to hang open and prematurely returning a value and consequently closing the connection.  I would post my source but I'm not sure what to post short of posting everything...(it is open source though so if you want to have a look it's at http://webtext-android.googlecode.com).
So my question is, does anybody think that there could be some underlying limitation imposed by the Android system that is preventing these servlets from working? Are there assumptions that are made by the Jetty Bayeux implementation with regards to the underlying system? Or is it more likely that somehow I have a bad implementation of the ContinuationCometdServelt?  I should note that all of the posts/gets from the client return 200 OK messages so I'm not inclined to think that the Android system is simply terminating the connection.
I know this is a bit off the wall and I'm definitely trying to do something a bit out of the ordinary but any suggestions or tips would be greatly appreciated.
Comment: +1 because running Jetty on an Android device is nerdy : )
Comment: try to catch me white and nerdy...
Answer: In case anybody discovers this and has similar problems (this applies to all cometd implementations regardless of host), I discovered that the issue was with using the Google js library.  For some reason, the dojo scripts I was loading from Google (1.4) didn't have a valid implementation of cometd.  I switched my dojo script to the one that was used by the jetty-1.6.23 example and it works perfectly.


With a launcher for a terminal application, how can I keep the terminal open after the program is complete?

Question: I have a terminal command I run from an application launcher. This works great, however sometimes the command fails, so I'd like for the terminal to stay open so I can see the results. How can I do this?
Answer: Assuming your command is called mycommand, I'd change my launcher to run this:
gnome-terminal -e "mycommand|less"

If you want a more permanent, perhaps cleaner solution, open up gnome-terminal, go to Edit, Profile preferences and click the Title and Command tab. Change the "When command exits" option to "Hold the terminal open".
When you execute commands, it should now leave the terminal open when something runs.
Edit: If you don't really care about the terminal, you could just use xterm's hold flag:
xterm -e "mycommand" hold

Comment: To keep the default terminal 'when command exits' action, I suggest creating a new terminal profile, set it to stay open after a command exits, and pass gnome-terminal the `--tab-with-profile=PROFILENAME` option. You can have many profiles for different bahaviours this way :-)
Comment: `xterm -hold -e mycommand`
Answer: Your launcher is running a script right?
At the end of your script add
read -p "Press any key to exit > " -n1 junk
echo

Then your script will wait until you choose to end it.
Comment: +1, and to show the prompt only if the command fails (returns a non-zero exit code) one could do `command || read -n1 -p "Command failed. Press any key to exit..."`
Answer: In your .desktop shortcut, use this
Exec=gnome-terminal -x bash -c "YOUR_SCRIPT; exec $SHELL"

After your script is finished, the Bash process will replace itself with a new invocation of itself.
If you need to pass quoted arguments to your script, you have to escape the quotes:
Exec=gnome-terminal -x bash -c "YOUR_SCRIPT \"arg with spaces\"; exec $SHELL"

Answer: A slightly different approach from the other answers: run your command and if that fails, then spawn a shell.  This way you don't have to hold the terminal open (which doesn't distinguish between command success or failure), and you might find that shell particularly useful in failure.  To close it, just use Ctrl-D (EOF), "exit", Alt-F4 (or whatever your window manager uses to close windows), etc.
success-or-shell
#!/bin/sh
[ $# -eq 0 ] && {
  echo "$(basename $0): no command" >&2
  exit 1
}
"$@" || {
  echo "failed: $?"
  exec $SHELL
}

Place this file somewhere, such as ~/bin, then use "success-or-shell your original command" in your launcher.
Answer: This question has a good answer, that worked for me.
Long story short: every terminal emulator has a different way to keep its window open when a command exits.
If you want to use a specific terminal app, then you can add the appropriate command-line option it provides, if present, like roxterm --hold. Or for just your own use, you can toggle an option in the settings window for that emulator (like "keep window open after command exits").
If you want to use the default terminal app, (like via x-terminal-emulator or exo-open) then you need to use a trick in the script itself: open another shell at the end of it, like ...; bash.
This also works well for applications that have a "Custom Action" feature, like Application Finder (xfce4-appfinder) and Thunar. For example:
Thunar
Name: Show Path in Terminal
Command: exo-open --launch TerminalEmulator bash -c "echo '%f';bash"

Application Finder
Pattern: $
Command: exo-open --launch TerminalEmulator bash -c "%s;bash"

In the above examples, exo-open --launch TerminalEmulator opens the default terminal emulator, and everything after that is read as a command to run. bash -c runs a new bash shell process with the specified command. "...;bash" is the command, that when finished, runs a new bash shell process which keeps the terminal window open.
Another idea is to add sleep 36500d to the end of a script, which gives you 100 years to review the output.
You can also have your script listen for a terminal close signal, and override (or "trap") it.
Desktop Entry
Exec=exo-open --launch TerminalEmulator bash -c "function handle_sigint() { echo 'SIGINT received... but I will not close by myself.'; }; trap 'handle_sigint' 0; while true; do echo 'Running script...'; sleep 1; done;"

This all works for a script file. Unfortunately, I'm having trouble getting any of the above to work from a desktop entry file (.desktop).
Answer: This answer gives the best answer I've seen so far to doing what you want.  They recommend making a script with the commands to execute and use it with the --init-file parameter (bash specific, but you could probably do the same for csh/tcsh/zsh, etc):
#!/bin/bash --init-file
commands to run

... and execute it as:
xterm -e /path/to/script
# or
gnome-terminal -e /path/to/script
# or
the-terminal -e bash --init-file /path/to/script/with/no/shebang

Answer: Use the watch command.
Format: watch -n60 myCommand, or watch -n60 "my command string"

the -n specified the number of seconds to wait between calls to myCommand; ex: the above command will call myCommand every 60 seconds, forever.
If the command is multiple words, put it inside double quotes: "my command string".

Let's say you want a Launcher which displays the disk usage, and stays open for the reader to see. I'd simply use this command inside the Launcher:
watch -n60 "df -h", which calls df -h now every 60 seconds.
I like this over the accepted answer of gnome-terminal -e "mycommand|less" because I'm running Xubuntu, which uses a different terminal by default.
Answer: Try right-clicking the launcher and entering properties.
There should be an option to keep the terminal window open

In the .desktop file, there should be the entry X-KeepTerminal=true
Answer: AFAIK, The terminal won't be held open unless you use the "hold" option for your respective terminal emulator.
For example, for the xfce4-terminal, in order to make a launcher (menu item) that executes some command in a terminal window that is to be held open even after the command finishes its execution, one must use the following command for the launcher/menu item:
xfce4-terminal -H -e 'put command to execute here'

(-H is the hold flag that is required to prevent the terminal window from closing after command execution.
-e flag makes the terminal execute the command in the string following -e when the terminal starts up
)


How is "beta" relevant to long-term ETF investors?

Question: A portion of my investment portfolio is in index-tracking ETFs. On the whole, my ETF portfolio is diversified across many countries and industries. I intend to hold these ETFs for 20-40 years. I noticed that some financial data providers give a "beta" statistic for my ETFs. Given my long-term investment horizon, should I care about the "beta" of my ETFs? What is the relevance of the "beta" volatility measure in the context of a diversified index-tracking ETF portfolio where the positions are held for decades?
Comment: I believe, there are various betas in existance. Soem betas are believed to guarantee higher growth than the average. This serves you as a long term investor.
Answer: For equities and equity ETFs, Betas typically means "sensitivity to market returns". Meaning that if you have a Beta of 1.5, when the market goes up 2% one day, then the ETF on average will go up 3%. It's not an exact result, meaning it's not a certainty, but it's an average calculated from the history of price movements of the ETF compared to the movements to the market overall.
In more practical terms, a higher beta ETF is more risky than the market on average, and thus should expect higher returns. And vice-versa; a low-beta ETF is "safer" than the market on average. You can also have zero beta (the ETF movement is not correlated to the market at all) and negative beta, meaning the ETF tends to move against the market. Those are typically only found in ETFs that use derivatives to speculate on other factors than market price (e.g. "beta-neutral" or "inverse" funds).


Projectile motion maximum distance to origin

Question: Is there an elegant or easy way to derive the maximum distance from the origin to a point of the parabola created by projectile motion (assume initial position is the origin)? Other than differentiating with respect to $x$ and equate to zero the distance given by $\sqrt{x^{2}+y^{2}}$?
Comment: Wouldn't this question belong better at Math Stack exchange? It seems like you just want the maximum distance from the origin to a point on an arbitrary parabola, which doesn't really involve much physics does it
Comment: You want the maximum distance of _all_ the parabolas with fixed initial speed, or the point of intersect of _a_ parabola to the ground? It is not clear from the question.
Comment: The $\theta$ is given but otherwise arbitrary. And yes as @JohnRennie says, the maximum distance from the origin is not necessarily the maximum horizontal distance, it can be other distance from the origin in the course of the flight. In specific what I want is given an initial speed and an angle find the maximum distance from the origin to a point of the projectile's trajectory.
Comment: There is no maximum distance from the origin to a point. Each point as _one_ distance. There is a maximum distance to _any_ point on the path.
Comment: For ONE dimension, you have-$H_{max} = \frac{u^2}{2g}$
Answer: You want the velocity vector to be perpendicular to the radius vector.  So calculate the position and trajectory as a function of $t$.  When the dot product of the two vectors is zero, that is the maximum distance.  This will only work if the trajectory is high enough that the maximum is not a the impact on the ground.
Answer: Actually distance is the complete length traced by the Particle So if you ask about distance for a given angle Theta ( which is Not mentioned in the question Too) Then It is the Point on Same Level wrt to initial Point (if It is projected on Ground)  and if theta is arbitary for a particular speed Then Also max distance is at  Same Point but for which theta is the max distance Covered        can be the question.
The distance is perimeter of the Parabola which can be caluclated only by Integration (as far as i know) and after trying It i end up with an implicit equation in theta which by finding got its Maxima nearly at 57.2 degree
Answer: Yes - calculate the time it takes for the object to hit the ground (using the y-component of its motion) and then calculate the total distance travelled (using that time and the x-component of its speed).

If you can't change the path of the parabola, then yes that's what you'l have to do.
Remember that you can just remove the root before differentiating! The max of $\sqrt{x(t)}$ will be at the same t as the max of $x(t)$. - an useful trick you can sometimes use.
Comment: This calculates the horizontal distance travelled, but that might not be the maximum distance from the origin during the flight. Suppose the projectile was sent almost vertically. The maximum distance will be near the top of its trajectory not when it hits the ground.
Comment: It will be if the user is allowed to choose $\theta$; that's not clear - edited.


Infinite current draw for BLDC/Synchronous AC motor

Question: I have recently created a motor that runs off of outlet power, single phase 120 V AC. My stator is taken from a universal motor from a vacuum cleaner and has two windings on either side, wired to form opposite polarities at every cycle of the AC sine wave. My rotor sits inside the stator and is made of a LEGO body with 4 neodymium magnets arranged in a N, N, S, S configuration each 90 degrees apart from each other. This allows the rotor to rotate either clockwise and counterclockwise depending on the orientation of the permanent magnets and the initial position of the sine wave when it is plugged in. When I plug it into a surge protector, I can only run the motor for around 1-2 seconds at no load before the breaker switch pops. It is worth mentioning that the universal motor from which I took the stator from originally had a brush DC type rotor inside complete with a commutator, brushes, and its own set of 16 windings. Current was being used by both the stator and rotor, but when I replaced the original rotor with my permanent magnet design all the current was being directed only to the stator, which I feel like is what is causing the massive current spike as the current is not being used by multiple components anymore. In the vacuum cleaner I'm pretty sure the current was used by different components such as valves before it got sent to the motor. Is there a way I can design a circuit to limit the current draw from the surge protector? Perhaps I can create a transformer to drop the current, or create a soft start but I do not know how. Maybe I can wire lightbulbs in parallel to act as resistors and drop the current before it gets sent to the motor. My theory is that by adding more resistive components the motor can only receive a limited amount of current and cannot "pull" more current from the power source because of the resistors in the way. However the more components I add the more current is needed for them to operate, so the effect might cancel out. What is the most efficient way?
Comment: Sounds pretty dangerous. Be careful. Running it at a lower voltage (from a step-down transformer) might reduce the current draw. Monitor the transformer to make sure it does not over-heat. Don't leave this thing running when you are not paying attention to it. Fire is a real possibility.
Comment: You would put the lightbulbs in series, not parallel.
Comment: If it was a series wound motor, the field winding would be very low impedance and the rotor would be higher impedance. (Check with a DMM!). In that case, directly connecting the field winding to mains will pop breakers. You need to start again with a proper design.
Comment: Yep. the only reason I went with a BLDC design is because it was far easier to make a rotor out of permanent magnets than to create a motor that needed to have 16 different working electromagnetic windings, not to mention proper tension and placement of the brushes to get optimal drive. In fact, the whole purpose of this project is to create a generator, not a motor so I only care about it generating electricity when I turn the shaft.
Answer: You need to first study basic circuit theory more carefully. You also need to understand more about motors.
The rotor of the motor connected in series with the stator is what controlled the current as the motor was used originally. The rotor had resistance, but more importantly, the rotor generated a voltage called "back electromotive force (EMF). that opposed the current.
120 volts is way too much voltage to apply to just the stator. You could connect resistance in series to reduce the current, but that will generate quite a bit of heat and waste energy. It would be better reduce the voltage with a transformer. You need an AC ammeter to measure the current with whatever you can find to connect in series temporarily. You could start with incandescent lightbulbs, but just one will probably limit the current too much. You probably need several lightbulbs connected in a parallel group with the group connected in series with the motor.
Also, with your 4-pole rotor, only two poles will be effectively engaged with the two-pole stator.
If I wanted to do something like this, I would use the stator of a shaded-pole fan motor with a 2-pole rotor. A stator like that would not need anything to reduce the current.
Comment: Yea I wanted to use a 120 VAC to 12 VAC transformer to drop the voltage but I'm worried about the multiplied current coming out of the secondary. I know that current kills so that is why I'm reluctant to use one, unless there is a way I can safely insulate the lines. In the meanwhile I will definitely try the series configuration you mentioned and buy a multimeter to measure the fluctuations in current and voltage.
Comment: 12vac won't cause enough current to flow through your body! Once the voltage is above 60VAC is when you need to concern yourself with electrocution.
Comment: okay thanks for the clarification
Comment: Most multimeters can not measure high enough AC current for what you described. You may want to consider a clamp-on ammeter,
Comment: thanks for the recommendation


Allowed states vis-a-vis allowed dynamics in generalized probabilistic theories (GPTs)

Question: In his work on information processing in GPTs http://arxiv.org/abs/quant-ph/0508211 Barrett speculates that the trade-off between allowed states and the allowed dynamics in a GPT is optimal in quantum theory, allowing for information processing capabilities not all of which occur in either the generalized no-signalling theory (GNST) or the generalized local theory (GLT). I'm wondering if this optimality is related to the symmetry of the associated polytope (of allowed states) in the theory, and in what exact manner. Any ideas?
Answer: There has indeed been some work on relating the geometry of the state space to the limitations of the theory. First, work relating the local state space to the non-locality present in a theory developed by Janotta et al. They consider the local state space to be a regular polygon. For a large number of sides, the non-locality tends towards Tsirelson's bound. That is, in the infinite limit, the state space is quantum and so, self-dual. The issue of self-duality of state space has been explored and means that the space of effects is isomorphic to the state space.
Relating this to the optimality of quantum state space one can think about reversible computation. In order to have a model of quantum computing that encompasses the circuit model and more general state spaces, one can develop reversible computing for all possible GPTs. Firstly, reversible computations in box-world are trivial as shown by Gross et al. This means that reversible dynamics for box-world is limited to permutations and relabelling of data. If we want reversible dynamics on a less trivial level, e.g. the power to map from one bit to another bit, then this leads to self-duality as shown by Mueller and Ududec. Since the self-duality in the previous paragraph indicates a trade-off in non-locality, they also speculate that this reversible computation limits non-locality. So they connect a computational principle to the structure of the state space, very much in the spirit of Barrett's paper.
Comment: Thanks Matty! That helps. I'm only beginning to study these questions, and the papers you pointed out are quite pertinent.
Comment: http://arxiv.org/abs/0805.3553 is also a paper that relates GPTs to teleportation. The notion of duality and the structure of the state space becomes relevant if we want to teleport states.


Is it possible to see stack trace of previous crash on launch with Fabric / Crashlytics?

Question: The context
The majority of my app's crashes are in third party code like advertising SDKs. We can test our integration with the SDKs, but there's no way to test everything that our users will see. And with ad SDKs, they are remotely configured and load different ads all the time. A malicious or poorly configured ad seems to be a very common crash.
What I'm trying to accomplish is to detect that the crash was caused by a third party and then disable that SDK for the next session, thereby giving the user a sort of "safe mode" to run the app in so they don't experience crash after crash upon relaunch. I could just do this for all crashes and turn off every SDK, but I'd like to be more deliberate if possible.
What is possible, as far as I've determined
If your app crashes, Fabric will tell you through its CrashlyticsDelegate methods, e.g. - (void)crashlyticsDidDetectReportForLastExecution:(CLSReport *)report;.
These methods give you a CLSReport object, which tells you all the information that you set on Crashlytics (e.g. user info, custom keys and more). Unfortunately, this object doesn't tell you anything about the crash itself.
For reference: https://docs.fabric.io/apple/crashlytics/advanced-setup.html#control-submission-behavior
My question / feature request
If I could get the stack trace of the crash, I could easily figure out which SDK caused the crash and decide to not turn that one on. Any ideas how to get this?
Answer: Thanks for reaching out about this. This method was created in order to allow for opt-in crash reporting and not for inspection of the stack trace. I'm afraid there isn't a good way to get the stack trace on relaunch. However, I think it's an interesting use case and will let the team know!