Find deleted username from SID in Windows Active Directory

Question: I have a need to find a username that was deleted from the AD using only the SID.  I understand that Windows AD leaves being a Tombstone file that might contain this information.  Can someone give me the syntax of a command or post a document that might point me in the right direction?
Answer: Viewing deleted objects in Active Directory - http://support.microsoft.com/kb/258310
Unless the user has been deleted for longer than the tombstone lifetime of your AD, it will be in there.
Edit: And here's a better article, with pictures! - http://www.petri.co.il/deleted-objects-in-active-directory.htm
Answer: I also googled around and indeed, do as mentioned on the site http://www.petri.co.il/deleted-objects-in-active-directory.htm.
Only, in the search box you choose as filter (&(isDeleted=*)(objectSid=yourobjectSID))
Example:
Filter: (&(isDeleted=*)(objectSid=S-1-5-21-1601936709-1892662786-3840804712-315762))
Answer: I found this post helped easily find the deleted user (in my case group) name from a SID.  It seemed much easier than the previous solutions posted.
Import-Module ActiveDirectory
get-adobject -Filter 'isdeleted -eq $true -and name -ne "Deleted Objects" -and objectSID -like "Enter SID here"' -IncludeDeletedObjects -Properties samaccountname,displayname,objectsid

Notes:

Run in the domain where the deleted account resides
Works on Windows 2008 R2 and above, I didn't try lower versions
If you run 'Active Directory Module for Windows Powershell', you won't have to import any module


composite video on boot

Question: Being a newbie, I am not sure what is even going since the display is scrambled. I am using a television as a monitor that accepts composite video. I boot the pi and hold shift then press 1 2 3 4. 3 and 4 change the display but it is distorted and I have no idea what is shown on the screen. I have tried 2 monitors with the same results. I am using the 4 pin plug and 3 rca plugs. Please help, I am lost. Reply was to edit a file on the first partition. Where exactly is that? What is see does not have a config file there. I haven't figured out how to access the larger partition. (US and NTSC)
Comment: What country are you in? (More specifically what TV system do you use?)
Comment: You should press `4` to select `NTSC` as listed in  `INSTRUCTIONS-README.txt`. If that does not work you have limited options. NOTE there are many different TRRS connection options and not all work with the Pi. It is possible you have a cable which is unsuitable.
Comment: I created a config.txt and placed it the root as well as in a folder named boot. I tried several selections of aspect ratio and this didn't seem to change. It appears the start of the trace is 1/3 screen down and 1/3 screen to left. Far right goes about 2/3 way and dead ends, where going left it runs off screen and continues on the right. It is shifted both down and left. Aspect ratio change didn't appear to effect it. Using 4.
Comment: The following may help with the connection. http://www.raspberrypi-spy.co.uk/2014/07/raspberry-pi-model-b-3-5mm-audiovideo-jack/ Nothing you do with config.txt, wherever you put it, will help - NOOBS does not read it.
Comment: This was the breakthrough I needed! My cables ground is in the wrong position. I decided to try HDMI to composite, kind of pricey, but it works. Thanks for all the suggestions and help.
Answer: There's a file called /boot/config.txt on the first partition of your SD card. Edit the file as below to force the RPi to use the 4 pin plug.

Uncomment the line that starts with sdtv_mode=2.
Add the line hdmi_ignore_hotplug=1
Comment out the line that starts with hdmi_force_hotplug=1
Save the file and reboot the device.

If you're having problems with this, you may need to set the sdtv_aspect ratio.
sdtv_aspect=1 #  4:3
sdtv_aspect=2 # 14:9
sdtv_aspect=3 # 16:9

Note: commented lines start with a # character. Uncomment means to remove this character, and to comment the line means to add it.
A more in-depth tutorial can be found here, and you get can get more information about the config.txt file in general here.
Comment: This answer is misleading. Most users who buy preinstalled cards will have NOOBS. NOOBS does not have a `config.txt` (and even on Raspbian it is not /boot/config.txt).
Comment: That is where config.txt is stored, at least on my instance of Jesse. NOOBS will install Raspbian, and gives you an editor to change the config file if you select it.
Comment: You state "on the first partition of your SD card" which will be mounted in `\boot` if you can get as far as installing Raspbian. The OP is still trying to fiddle with it on Windows, and can't install.

composite video on boot


Adding code at the end of each list item

Question: My question is actually a generalization of this scenario: I'm using the xhfill package to fill the last line corresponding to each item in a given list (set through the enumitem package) with a horizontal filling rule (terrible typesetting, but it's required  for some legal documents). I wonder if there is a way to automate adding the rule command after the text for each list item instead of having to add it manually. My point is actually if there is a way to do this so that any command or macro may be added at that point.
Comment: Hi, please prepare a [minimal working example](http://meta.tex.stackexchange.com/questions/228/ive-just-been-asked-to-write-a-minimal-example-what-is-that) so we all are on the same page and know the basics of your question.
That way it's much easier to help.
Answer: Next time, please provide a Minimal Working Example as Johannes_B mentioned. That would have made it easier to help and more likely that my answer actually will be of some use (which I'm not sure about).
Is this the kind of thing you are looking for? This image shows a 'legal' enumeration between two 'regular' enumerations.

The code uses the before* and after* options provided by enumitem:
\documentclass{article}
\usepackage{enumitem}
\usepackage{xhfill}
\newcommand{\xfill}[2][1ex]{{%
  \dimen0=#2\advance\dimen0 by #1
  \leaders\hrule height \dimen0 depth -#1\hfill%
}}
\newlist{mylegal}{enumerate}{1}
\newif\iffirstlegal\firstlegalfalse% We need a toggle to track whether the item is first in the list or not
\setlist[mylegal]{%
  label=\arabic*.,
  before*={% This saves the standard definition of \item and then redefines it to add the fill if the item is not first on the list; if it is the first item, it omits the fill but toggles the firstlegal switch so the next item will trigger it
    \let\olditem\item% save the standard definition of \item in a macro, \olditem
    \firstlegaltrue% set the toggle for first item in the list to true
    \def\item{\iffirstlegal\olditem\firstlegalfalse\else \xfill{.5pt}\mbox{}\olditem\fi}% new, temporary defition of \item
    },
  after*={% This takes care of adding the fill for the final item on the list and just makes sure that \item is reset to its standard definition
    \xfill{.5pt}\mbox{}% fill for final item in list
    \let\item\olditem% restore standard definition of \item
    }%
  }

\begin{document}

% Get a baseline so we know what the regular enumerated list looks like...
A regular enumeration:
\begin{enumerate}
    \item An item
    \item Another item
\end{enumerate}

% Demonstrate the effect of the new list environment
A legal enumeration:
\begin{mylegal}
     \item An item
     \item Another item
\end{mylegal}

% Make sure that \item is correctly reset by comparing the output here with the baseline
A regular enumeration:
\begin{enumerate}
    \item An item
    \item Another item
\end{enumerate}

\end{document}

Note that the way this works involves redefining \item to add the fill first. This is why it is necessary to exclude the first list item (we don't want a line before we start) and to handle the final list item specially (since it would otherwise not get a line at all).
Comment: It fits perfectly what I was looking for. I thought the MWE would not be needed for this question and when I came back your answer was already available, so the MWE was not needed anyway.  I'll keep it in mind for future posts, though.


Manual of Pehlwani techniques?

Question: Are there any manuals or similar resources describing Pehlwani techniques (preferably in English or Hindi)?
Comment: E.g. some tackles: *dhobi, puthhi, saaltu, bagaldoop*.
Comment: I did a bit of poking around, but the best I've found so far are some partially translated Iranian texts in the parallel Pahlwani style.
Answer: The most comprehensive manual seems to be The Science of Wrestling, Vol. 1 (1927). It details throws, pins, chokes, joint locks, counters, combinations, and entries:

Further resources are detailed below:
Textbooks

Pehlwani: Identity, Ideology and the Body of the Indian Wrestler, Vol. 1, Vol. 2 (1989)
Wrestling in Indi: Indian Wrestlers, Indian Wrestling Coaches, Pehlwani (2010)
The Wrestler's body: Identity and Ideology in North India (1992)

Documentaries

Punjabi Wrestling (2019)
Comment: Excellent work!

Manual of Pehlwani techniques?


Problems making a smooth character rotation

Question: My character has an angle rotation, when the player touches the screen it automatically face to the place that the player touched, using atan2(y,x) and Math.radiansToDegrees methods, but I want it to do that smoothly, is to say, save the required angle in a variable, and the current one in another, and depending of the 2 values, make it to rotate to left(if the required angle is to the right side of the current) or to the right. I've been almost an hour thinking about this, but I  couldn't solve it.
Answer: Have a currentRotation and a desiredRotation you will also want some helper function to give you the shortest angle distance, so let's just call that angleDist or whatever. (You want that because sometimes going clockwise is shorter or vice versa).
Then all you need is to interpolate between them somehow.
currentRotation += expFactor * angleDist(currentRotation, desiredRotation);

You can do any interpolation or tweening or whatever that you want there.
As a sidenote, in almost all cases converting away from radians seems like a bad idea.
If your question was specifically about how to figure out which way to rotate.
//Assuming both angles are between 0 and 2Pi
double diff = desiredAngle-currentAngle;
//If diff is smaller than 0 we add 2Pi so that it ends up in the 0 to 2Pi range
//You can imagine this as making the current angle zero, but preserving the relative difference
if(diff<0)diff+=2*Math.Pi;
//Now if the angle we want to get to is bigger than half a rotation we go the other way
return diff<=Math.Pi ? diff : diff-2*Math.Pi;

Hope this helps.
Comment: Thank you very much! After sleeping I found out the solution, but your method seems better, thanks!


Quantify the area of a shape in Inkscape

Question: In Inkscape, is there a way to automatically calculate the space / area a shape occupies? I am representing data in complex shapes and I need a way to scale them accordingly.
Answer: To automatically obtain the area of a shape in pixel, cm and so on simply select the shape, go to Extensions > Visualise Path > Measure Path ... and select the desired output. It does not work for objects though (for example rectangles drawn with the Create rectangles and squares tool). Convert them to paths before (Path > Object to Path).
Comment: It works for me on Inkscape 0.92.3.  However, it does not appear to support anything other than regular paths.  For example, I was not able to get results for an entire group, but it worked for individual paths once I ungrouped them.
Comment: The indications are all good, but nothing happens either with Length, Area, or Center of Mass. I have Inkscape 0.91.
Comment: Just great. Thank a lot +1. I was calculating rooms surfaces in an office plane and that made the task a piece of cake.
Comment: Yes, Works like wonder in Inkscape 0.92 !  Had to install `python-lxml` and `python-numpy` as prerequisites for the area-finder to calculate... but that helped us four friends divide six plots of land in ratios of 21:21:37:69 like a magic wand !  Wish the Egyptians and Romans had something like this too !!!


Reset download state of start screen tiles in Windows 8?

Question: After installing Windows 8.1 a while ago, I noticed that a lot of the apps that I have downloaded and installed on the computer still show the "Install" icon in the lower right hand side of the tile, and in the "All Apps" view.
Notice how apps that I have installed (as in, launching them opens the app, not the Store) like Calendar, Reading List, Skype, Mail, Music, and News still show a little "download" indicator at the bottom right:

And it's not just a problem with the tiles, Windows really does seem to think that they're not installed, because in the All Apps view it still asks to "Install" the app (here's a snipping of the M section in my All Apps view, notice how Mail asks to "Install"):

Resetting things like App Licenses in the Store (or using WSReset) doesn't help, and I can't seem to find any reason for only a few of my apps to do this. Has anyone else encountered anything like this, or know how to fix it? Thanks!
Answer: Go to the Windows Store. Right click or swipe down, go to your Apps and just install them. The upgrade keeps your apps as a placeholder you just have to install them again basically. One easy step.
Comment: The apps are already installed, the Start Screen just shows them as uninstalled. I can launch the apps just fine


How can I edit multiple text files as one virtual document?

Question: My main goal is to be able to constantly keep track of individual text fragment word and character counts while simultaneously being able to read the entire long document as a whole.
Comment: Based on the rephrased question, you might try any forms based GUI designer out there -- one such example is a Microsoft Access form. Basically, you would create text boxes or text areas where you enter your custom text, and then with a small amount of Visual Basic code, concatenate them all together in the output, and you could fit all that on one screen. This would be pretty easy to implement, depending on how fancy you wanted to make it.
Answer: As I discussed on Root Access, the broad class of tool you're looking at is an outline text editor. Outline editors let you work in blocks of texts, treat them as discrete units, and link them together, perfect for your use case.
As far as ANYONE I have talked to who needs/has used one has told me, literature and latte's scrivener is the program to beat, though this answer on Ask Ubuntu suggests a few alternatives.
Comment: I just had a browse through that AU question, and [Kabikaboo](https://launchpad.net/kabikaboo) seems like a great choice for the OP (in that all text is kept as unformatted as possible, but still retaining the benefits of a tree-like layout).  Great find; just note that some of these programs won't keep the individual text fragments in different *files* which could be edited manually (of course many outline text editors allow you to import and export manually, but they usually save the outline text tree itself in a different format for quick loading/saving).
Comment: yeah. I actually was talking to the OP about this on chat, and suggested these. Posted here primarily as reference. I've spoken to enough schievener users that it was the first thing that came to mind - I dug up the AU link cause the OP was asking for free alternatives. I've not dug deep into them yet, I've been looking for something like this to replace my herd of postits and notebooks ;p
Answer: If you're willing to consider a bit more than plain-text, then this is very possible.  Two such ways are using Markdown (which doesn't have native include support, but several document processors do) or LaTeX.

Markdown
With minimal markup, the Pandoc route may be what you want, since your text fragments just need to be written as Markdown documents (which, without using any additional features, are still just plain-text documents; this is the formatting system used here on Super User and the other Stack Exchange websites).  Inspired by this SO question, let's say the text fragments are in the current working directory:
01_introduction.md
02_examples.md
03_discussion.md
04_conclusion.md

These can be merged & rendered as a single file with Pandoc using the command:
pandoc *.md > merged.html

Pandoc is also compatible with the LaTeX format which may also serve your needs, although there are indeed several other LaTeX document editors/compilers which might be better suited to the task.

LaTeX
Consider creating a rather simple LaTeX document, and place your plain-text files into several other files.  You can then use the LaTeX \input{filename} command (or \include if you need that functionality) in the parent document to join and render all of the individual text fragments as a singular document.
So, you might want to create a parent .tex document to wrap all of your sub-.tex files (which just contain plain-text; LaTeX's \include works similar to that of the C/C++ programming languages).  So let's say you have the same Markdown files as before, but renamed from .md to .tex (e.g. now you have 01_introduction.tex, 02_examples.tex, ...).
You can then make another file to compile (e.g. 00_parent.tex), which just contains the following (see this article for more advanced ways to set up a LaTeX document):
\documentclass{minimal}
\begin{document}
    \input{01_introduction.tex}
    \input{02_examples.tex}
    \input{03_discussion.tex}
    \input{04_conclusion.tex}
\end{document}

You can then compile the 00_parent.tex file with your favourite LaTeX editor (like TeXWorks) or just compile it from a terminal using the native LaTeX tools or any others you might like (Pandoc also seems to support LateX).
Comment: Thanks. Although I had given some consideration to LaTeX, I hadn't thought about Markdown to solve this problem. Both of these look very nice, but after having used Scrivener for a day or two now, I'm utterly blown away by how much better it is than anything else like it that I know of. By far the best aspect of Scrivener for me is the "[Scrivenings](http://www.literatureandlatte.com/scrivener.php?show=features)" mode which is difficult to explain in the space provided, but it _perfectly_ matches my need. Many thanks to all for your help.


In PubMed results sometimes there are no links to read the article?

Question: In PubMed results sometimes there are no links to read the article.
For example https://pubmed.ncbi.nlm.nih.gov/23009275/
Why is this?
Comment: I think you need to ask PubMed to be sure, but I suspect the most likely explanation is simply because the article isn't available online. They can't give you a link to something that doesn't exist. That article does provide a PMID, which will allow you to find the article in print form.
Answer: As suggested by @CareyGregory you need to speak to PubMed about that. I have noticed that recently too with quite a few articles.
The one linked can actually be read at https://www.ajmc.com/view/a09_12aug_rls_sethi as it is open access.
Going off tangent a little, interestingly the author information is weird to me too as there are only 2 authors, and 2 authors don't make an et al. citation as far as I am aware. The citation for this article is
Sethi, K. D., & Mehta, S. H. (2012). A clinical primer on restless legs syndrome: what we know, and what we don't know. The American journal of managed care, 18(5 Suppl), S83-88.


Raleigh Montage mountain bike crank question

Question: Will a modern Shimano crank set be compatible to replace an oval tech Shimano set from the 1980's.
It's for a Raleigh Montage Mountain Bike.
Answer: Shimano make a number of triple cranks for 7 or 8 rear speeds. These can be found in Shimano's Acera, Altus and Tourney lines.
The chainline standard for triple cranks is 47.5mm (chainine is how far the center of the middle ring is from the center line of the frame, see here for details). I'm guessing an bike from the 80's might have used a narrower chainline. If possible, measure the chainline of the original crank. If it's within a few mm of 47.5mm a modern triple crank will work.
I think the chainring spacing should work fine with the Suntour thumb shifters. I'm guessing the front shifter isn't indexed, or has many index points for fine adjustment of the front derailleur.
You will need to replace the bottom bracket along with the crank. 'Three piece' cranks for a square taper or Octalink axle need a specific axle length to get the correct chain line. The Montage has a square taper axle but it's very unlikely to be the correct length for a replacement crank.
From what I can tell the Montage frame has a standard 'English' threaded (1.370" X 24 tpi) bottom bracket shell. You will need to check the width, it should be 68mm, if it is, a new cartridge bottom bracket will fit.
Answer: Focusing on the oval part of your question - here's a pic of a 1987 Montague clearly showing the oval chainrings it had stock:
 from http://www.retrobike.co.uk/forum/viewtopic.php?f=6&t=210861
They're listed as "SR Ovaltech Alloy triple chainset" so if you're going for a concourse or a period-correct rebuild, that's what you need.
Another option is any non-round chainring.  Shimano Biopace would have been available between 1983~1993. All these not-a-circle chainrings look "wobbly" while spinning, but don't stand out when the bike is at rest.   Simply keep watching your local auction sites for "biopace" and they will turn up eventually.
Most of these chainrings will be built for 5 bolt spiders, so you will need a 130 or 110 mm BCD spider, and a bottom bracket to suit those crank arms.  It is 99% likely that you need a common english 68mm bottom bracket, and it will use a square taper to connect to the cranks.
I personally have biopace big and medium chainrings on a road bike, and I find them unnoticeable while riding.  I only got them because they were almost unused.  So if you're after a functional bike, use what you have and forget originality.

While you could fit an Octalink bottom bracket cartridge in a standard English thread, then you would require three-piece octalink cranks, not a more modern 2 piece crankset.  However this would probably let you run with whatever 4 bolt spider and then 4 bolt chainrings.


How do I stop Pencil drawn shapes from being transparent? - Adobe Illustrator

Question: Every new shape I draw in the Pencil tool always comes up as transparent, where as other tools (rectangle, ellipse, polygon, etc.) always keep their default or previously chosen fill color. Although thankfully I just have to press D to fill in the default color, it quickly becomes a hassle to remember when I'm rapidly building shape and sometimes disrupts my workflow. Isn't there a way to just keep its default color, like how the other shape tools behave?
Answer: Double click the pencil tool in the toolbar to bring up the pencil tool options.
Tick the box to "Fill New Pencil Strokes". Then choose your fill color and your new Pencil strokes will be filled.
As you will see this is fine if you are drawing closed paths but becomes a bit strange if you are drawing open paths. Hence the option to have them not filled.
Answer: You should set the fill or stroke color before you draw... when you select the pencil tool both are set to empty(disabled) state.


Manually Inserting Joomla Show Cart NON sef URL

Question: I have been having some SEF URL issues so I updated my Joomla SH404SEF module and I discussed my issues with a support guy from the company that supplies the 404SEF module and he realized that somebody had manually inserted an SEF URL for the Show Cart link, and that was messing up their module's URL conversion. So he asked me to disable the SEF module for now, and to MANUALLY insert the default NON SEF URL for the "Show Cart" link and I have no idea how to do that! He said that this NON SEF URL should be somewhere in my Virtuemart component, but I looked everywhere for it and didn't find it!! Any help would be tremendously appreciated.
Thanks!
Tao B.
Answer: you could grap the link from the minicart which displays the products in the cart and has a text link called "show cart" which links to the items in the cart. This is from the minicart module so if you don't have it installed you won't know what I'm talking about. Publish the module, right click on "show cart" grab the code and you'll be able to manually insert it. Review this file:  / administrator/components/com_virtuemart/html/shop.basket_short.php


Which software tool is used to make three dimensional graphics shown in the following photo?

Question: After visiting the website form the the WOLF corporation, I could watch such graphics with breathtaking view. May I ask please how to make such graphics?
Comment: Hi. Welcome to GDSE.  There's no way to tell which 3D software was used. It could be literally any one of them.  There's Blender (which is free and Open Source), and paid software such as Cinema 4D, Maya, 3ds Max, etc.  If you want tutorials for how to make 3D models and scenes, there are tutorials on youtube. There's [a good one here](https://www.youtube.com/watch?v=UWyER_hax_A&feature=emb_logo) for Blender.
Comment: Yup - I've done this kind of interior iso-section view in Modo, blender, and SketchUp, and have also done 'em directly in architectural BIM modelling tools like ArchiCAD and Revit - you can even do 'em in MagicaVoxel if you've the patience of a dragon...
Answer: The easiest way is to get a home- or interior planning program, a "floor planner". There you can build rooms and walls and place 3D models of nearly everything usual stuff like carpets, furnitures, catering equipment, kitchen tools, faucets, doors, windows, lights etc... Everything is freely movable, the colors are selectable and the camera view is freely adjustable. Programs regularly have a big selection of ready to use 3D models.
There's numerous options available, also freeware and limited free versions.
A good option is to get a general 3D modeller. SketchUP can be recommended also for this purpose due its simplicity and its vast library of ready to use models in their 3D Warehouse.
This is one randomly selected but typical snippet of a floor planning software ad. I do not claim anything of its value when compared to others:

Then there's one possibility to get all for free: Check what's available from big global furniture marketing companies. I've seen at least one which has in their website a scene building application. Do not expect they allow you to sell or otherwise distribute the generated model or image.


In what ways can I obtain a Master Ball?

Question: Where can I get a Master Ball in Pokemon Sun & Moon? I'd like a reference just in case since I find trying to catch legendaries without them very painful -- up to how many Master Balls can I find/get and where can I do so?
Comment: In theory, you can get unlimited Master Balls from the lottery. Getting a match of all 6 numbers on the lottery will rewarded you with a Master Ball.
Answer: You recieve a single Master Ball as part of the main storyline.
There are two ways to get additional Master Balls, with no limit to the number you can recieve in total.

Playing the lottery at Hau'oli Tourist Center will give a Master Ball if you match 5 numbers.
Playing the Big Dreams Lottery in the Festival Plaza will award a Master Ball as the top prize. Higher stars increases the chances of getting this prize.
Answer: You get one free Masterball free during your playthrough of the storyline. However, you can get more (and potentially unlimited) through the lottery at Hau'oli city - if 5 out of 5 of the numbers match, you will get a Masterball as a prize.
Answer: A way I found to easily get a master ball is to find Pokemon with the pickup ability and run around until you find one.
Comment: [The Bulbapedia page for Pickup](http://bulbapedia.bulbagarden.net/wiki/Pickup_(Ability)) lists all items which can be received through the ability. Master Balls are not and never have been available. The only types of Pokéballs that have ever been available through Pickup are Great Balls and Ultra Balls.
Comment: This doesn't work, sorry.


When would Google crawler give up crawling a URL with 5xx error

Question: How many times will Google crawler attempt to recrawl a URL that has a 5xx error occurring intermittently? When would it give up and drop the URL from the Index?
Comment: If the error is "intermittent" (or even if it's permanent), I can't really think of a reason why it would ever stop _trying_ to crawl that URL (providing there are links to it, etc.).
Answer: When Google determines that your site is having problems, it will slow down the rate at which it crawls.   If your site is less responsive, or is giving Google 500 errors, Google will make fewer request per day to your site as a whole.
Googlebot will never give up on any particular URL.   Google will come back and try that URL again.   How soon it comes back is determined by how important the URL is.    It may take weeks for Google to try an unimportant URL again, but it may try again in a couple hours if the URL is well linked from other sites and has a history of being updated frequently.
Comment: I thought google gives up on URLs that return a 410 response code.
Comment: They crawl 410 URLs less frequently, but Googlebot will still check them occasionally.
Answer: There is no easy way to measure this as there doesn't appear to be a hard limit and Google is so complex it's difficult to measure.
However, the more intermittent the service the lower an URL will rank as it accrues a performance penalty. This would lead me to guess that it's based on a curve rather than a binary 'indexed' or 'not indexed'.
The only thing you can be certain of is whether an URL is indexed or not.


Relationship between vegetarianism and global warming

Question: It is said that going vegetarian can help reduce global warming. What research has been done to support this or against it. Also, if true, to what extent is it effective as compared to other methods like reducing emissions from industries, having low-polluting vehicles etc.?
Answer: There is an Oxford University study on the Dietary greenhouse gas emissions of meat-eaters, fish-eaters, vegetarians and vegans in the UK it concludes that

...an average 2,000 kcal high meat diet had 2.5 times as many GHG (higher greenhouse gas) emissions than an average 2,000 kcal vegan diet.

It concludes that

moving from a high meat diet to a vegetarian diet would reduce your carbon footprint by 1,230kgCO2e/year, and moving from a high meat diet to a vegan diet would reduce your carbon footprint by 1,560kgCO2e/year.

As a comparison for scale, an economy return flight from London to New York has a carbon footprint of 960kgCO2e according to this carbon footprint calculator.
Comment: Nice, thats a whole lot of carbon associated with a flight. I would also like to know the comparison with vehicular usage and industrial pollution, will wait for more answers.
Comment: Use the carbon calculator in the link at the end of the question if you want to know that.
Answer: The most extensive study and publication on this subject is 2006 FAO's report titled "Livestock's long shadow". In chapter 4 it analyzes the role of livestock industry in greenhouse gases emissions and states it's responsible for about 18% of GHG emissions, more than transportation sector. We can hence infer that stop consuming meat has higher impact than improving the technologies related to transportation.
Another study worth to be quoted is "Total Environmental Impact of Three Main Dietary Patterns in Relation to the Content of Animal and Plant Food". It states that meat consumption has a great impact on environment, including climate change, leading to similar conclusions as the previous source.
Deforestation is strictly related to GHG emissions and climate change, since destroyed forests provoke CO2 emissions (see FAO 2006 for a detailed explanation). A 2016 publication by Nature proyected several scenarios to 2050. The main differences were determined by the diet. Again, this means that leaving meat can deeply have impacts on world future and climate change.
Similar conclusions were found in another study called "Analysis and valuation of the health and climate change cobenefits of dietary change". Here researchers find that:

health and climate change benefits will both be greater the lower the
  fraction of animal-sourced foods in our diets.

Finally, additional reference can be found in the "facts" page of the documentary "Cowspiracy".


Is it more efficient to heat a room using an air conditioner (heat pump) when the windows are open?

Question: In general, using an air-conditioner for heating is more efficient than a standard electric heater or radiator. But in our home, we keep the windows open all the time, in order to decrease the chance of infection. Is air conditioning (heat pump) still more energy-efficient than an electric heater? If not - what is the most efficient heating method in this situation?
(Note: the outside temperatures are about 5-15 celsius).
Comment: Heat pump is the more general term for bi-directional (heat/cool) as opposed to "cool only" in common use.
Comment: I am puzzled by the use of "air conditioner" here.  When I think of an air conditioner I think of a device used to cool.  Maybe a translation issue?  Does "air conditioner" refer to central heating as opposed to space heaters set around?
Comment: @manassehkatz-Moving2Codidact the first article I found re: "air conditioner" for heat pump was UK.  Clearly my location radar is on the blink!
Comment: I'm not sure if there's anything worse than electric resistance heat. If you want to feel warm with the windows open you need radiant heat, not forced air. I've seen people that don't pay for the boiler with their windows open all the time, because they also have little control over it and it's too hot.
Comment: @Willk my air conditioner has a "cooling mode" and a "heating mode". See for example here: https://efficientcoolheat.com/air-conditioning-more-efficient-than-radiators/
Comment: I believe the OP is actually referring to a heat pump.   There is no way an A/C unit can heat a home. If a heat pump, yes, much more efficient than electrical resistance heaters....but geeze, I wouldn't want to pay your power bill!
Comment: You could mount it in the window backwards, I suppose LOL.   Something that uses freon to heat is called a heat pump.  It is able to air-condition too.  When someone says "air conditioner" that means something *that can't* do that.  I think what happens is, people in the UK buy "mini-splits" a lot for air conditioning purposes, and have no earthly idea they have a heat function.
Answer: A heat pump is still going to be more efficient than resistance heat - a good one at those outdoor temperatures will produce 4-7 times more heat from the same electrical input - even a poor one will manage 2-3 times the heat output.
So, whether or not the windows are open, a heat pump is more efficient than resistance heat. At those temperatures we don't even have to question the heat pump's technology. Below 0°C some older or less well designed heat pumps actually switch to resistance heat backup, while newer/better heat pumps can operate efficiently to -25°C.
However, there are much more efficient ways to ventilate than simply opening windows, specifically several versions of "heat recovery ventilators" which exchange air while transferring heat between the incoming and outgoing air streams.
Comment: Gotta agree with Ecnerwal. HRV is much more efficient, but there are equipment and installation costs.   In the long run, it would certainly save tons of money and you'd get the ventilation you desire...but running electrical resistance heating in cold weather with windows is not a good idea.  Note to POCO:  lift the control rods on the reactor, we need more power (Sorry, couldn't resist).
Comment: And if you live in an area with high humidity, then an ERV may even be better than an HRV.
Comment: Have you considered a UV light in the ducts. I have them in both delivery and return ducts and keep the house closed, much lower energy bill that way. They are on 24/7 and the blower in the furnace is and always on 24/7.
Comment: Thanks! I have never heard of heat recovery ventilators before. I have to check if they are available at my country.
Answer: Every heating option will be dreadfully inefficient since you are heating the great outdoors.
A heat pump will be more efficient than straight electric coil heating as long as it is operating in conditions where its COP is better than 1.0.
A heat pump will be more efficient than gas heat depending on a complex and arm-waving array of facts, depending on whether you are min-max-ing for operating cost or carbon emissions. Given that the best combined-cycle natural gas power plants are 50-60% efficient with a tailwind, and random vented gas furnaces are 70-90% efficient depending on design and drafting, you need to have a COP of 1.3 to 1.8 for them to be a net carbon gain vs burning gas locally.
Armed with COP and natural gas furnace effiency for your conditions at that time, you can number-crunch on cost of gas vs electricity, and energy extractable from each.  Figure the number of BTUs, kWh or joules in a unit of gas x its cost x the furnace efficiency, vs the number of BTUs (3410) or joules (3.6 million) gotten from 1 kilowatt-hour x its cost x the COP of the heat pump.
Unfortunately I don't think Britain has a unit like the American BTU :)
Comment: 'Unfortunately I don't think Britain has a unit like the American BTU' - that made me chuckle, BTU means British Thermal Unit!
Comment: The metric unit of energy is the Joule not the calorie, and "calories per KWH" is not a unit it's a scale factor between two different unit systems, like "inches per light year" which would also be an "ungainly" number. In the UK energy from the utility companies is priced per KWH whether it is electrical or gas, a conversion factor is used to convert from the volume measured by the gas meter to the KWH value that goes into the bill.
Comment: *You* might want to run your theories about infection control by some actual epidemiologists. Ventilation works.
Comment: The standard unit of heat in most metric countries is simply the kilowatt hour.
Comment: @Reid I won't fight. Removed.
Comment: @Rodney Interesting. In the US each utility type has its own billing unit, sometimes more than one! In a system I develop, BTU is the universal value (i.e., convert everything to BTU for overall energy usage comparison).
Comment: @Rodney I see what you mean. Units fixed.  When I initially searched for a metric unit that handles like the BTU (energy to heat 1 pound of water 1 degree F) what I found was calories.  But you're right, joules or KWH is more malleable.
Comment: @J... thanks, fixed.
Comment: @EricDuminil Yes I did, edited. I will probably end up dealing with Kelvin-watt-hour when I'm arguing about heat pumps, though LOL. Gotta remember that lower case H though!
Answer: We'll just pretend you never asked how to let a heat pump run with open windows 24/7, okay?
Ventilation is indeed a good way to reduce the risk of infection. But you don't need to ventilate all the time. You could simply measure the CO2 concentration, which correlates with the concentration of airborne aerosols particles. See "Exhaled CO2 as a COVID-19 Infection Risk Proxy for Different Indoor Environments and Activities" and "CO2 monitoring recommended to manage COVID-19 spread in schools and offices"
If the CO2 concentration gets above 1000ppm, you can cross-ventilate until it drops below 500ppm.
You could buy a CO2 traffic light, which blinks red above a certain threshold. I built mine with a Sensirion SCD30 sensor + ESP8266 microcontroller + NeoPixel LED ring. The corresponding code is open-source and available here.

Even in a crowded classroom, it was enough to ventilate for 3 minutes every 20 minutes. With 3 people in a 70m² flat, we have to ventilate every 4 hours.
Comment: @ErelSegal-Halevi you should probably ask on a better site about ventilation parameters. These are well established in the public health community. CO₂ concentration is not one I'm aware of. AFAICT they tend to be expressed in exchanges per hour.
Comment: @Reid: Sure, ventilation can be described with [1/h](https://en.wikipedia.org/wiki/Air_changes_per_hour). This value is typically used as a rule of thumb in ventilation design (see [here](https://en.wikipedia.org/wiki/Air_changes_per_hour#Air_change_rate_recommendations)). And once you live or work in a building, it's kind of hard to calculate it without a [blower door](https://en.wikipedia.org/wiki/Blower_door#Airflow_at_a_specified_building_pressure). A CO₂ sensor provides an easy and relatively reliable way to see how much fresh air is coming in. I'll add sources.
Comment: @Reid: Another point I forgot : the risk of infection obviously depends on the occupancy, but air changes per hour doesn't depend on the occupancy. It's safer to be alone in a room with an air change rate of 2, than to be 4 people in a room with an air change rate of 12.
Comment: downvoter: constructive criticism is welcome!


How do I make people able to hear a sound played using commands regardless of where in the world they are?

Question: I'm making a map. i am trying to use the /playsound command. There is going to be a boss battle at the end, and I need my music disc to play. I know how to play a sound, but I want it so people can hear it no matter where they are in the final boss area. Because if they walk far enough away, they won't be able to hear it.
Comment: What commands are you using?
Comment: I'm using /playsound only. But I don't know if /execute would work for this.
Answer: Arguments Used
For the target selector use @a this will play the sound to all players. Then, for the volume argument, put in something like 999, this will create a large sphere of audio.
Example
I use a /execute to get the proper location of a player.
/execute @p ~ ~ ~ /playsound mob.enderdragon.growl @a ~ ~ ~ 999

Comment: I know that, but when they walk away, the sound will begin to quiet down, and eventually be silent until they go back to where they first heard the sound. And I need them to always hear the sound no matter where they are.
Comment: Is he talking about increasing the sound area then? Sorry I must have misunderstood.
Comment: No thats much better IMO. I originally flagged it because just saying use the @ selector seemed more like just basic command information rather than an answer to the OP. But your edit makes it clear the direction you were going with it. Thanks for taking the time to clarify!


When does Rowf's Badge Shop get new inventory?

Question: How often (or under what conditions) does Rowf's Badge Shop in Toad Town get new or different badges?  I'd hate to miss a great badge because I didn't visit the shop at the right time.
Answer: The badges won't change before you buy them. After that, the empty slots will be filled up when you re-enter town (if new badges are available, usually after a chapter finishes). So, don't worry, just buy the ones you don't actually need later when you got some spare coins.
Comment: Also, [here's](http://www.mariowiki.com/Badges#Paper_Mario_2) a list of all badges, including a mention after which chapter which badges can be bought
Answer: If you are close to the end of the game all of the badges should be available. To make him change his inventory all you have to do is go in and out of the door to the flower fields and they will be different every time. The badges are pretty expensive so this also Gives you a good chance to get some coins too. Just equip the money money, pay off, and zap tap badges. And as long as you have at least 50 hp just head up to the north west path(upper left path). Cross the thorns and start a battle with the bee there. Keep selecting do nothing until your hp is low and then kill the bees if the zap tap (electric touch effect) has not killed them already by itself. You will get 20 coins every battle. Go back to toad town to check badges and replenish health and repeat until you have all the badges that you want. Hope this helps.
Comment: Welcome to the ArQAde and thanks for your additional info - I never observed this effect but then again I usually didn't wait long to buy all new badges... However, please do _not_ abuse the `edit` feature to make a comment, you'll be able to do so in time when e.g. this answer got some upvotes (like the one from me :)


Write an expression as a full derivative

Question: Is there a command that tells Mathematica to try to write the terms (if possible) of an expression as total derivates? Example: I want to tell mathematica to write
-Sin[t]+g[t]

as
D[Cos[t],t]+g[t]

instead. Is this possible?
Mathematically, this is basically (up to some constants) equivalent of Mathematica testing if the terms are analytically integrable (i.e. if they have closed form expressions).
Answer: Here I define the expression and integrate it term by term using Distribute. Then I differentiate each term but with a Defer wrapping it, so the derivatives aren't actually carried out. FInally, I replace the terms that weren't integrated by the original function:
expression = -Sin[t] + g[t]

(* ==> g[t] - Sin[t] *)

integrals = Distribute[Integrate[expression, t]]

(* ==> Cos[t] + \[Integral]g[t] \[DifferentialD]t *)

original =
 Map[Defer[D[#, t]] &, integrals] /.
  Defer[D[Integrate[f_, __], _]] :> f

$\partial_t \text{Cos}[t] + \text{g}[t]$

The reason I used Defer is that it allows you to copy the output and evaluate it by pasting it in a new cell. You could alternatively replace Defer with HoldForm if you want a more "stable" output. Then you have to explicitly use ReleaseHold if you want to evaluate the derivatives in the output expression.
Comment: I'll try this at once. I'll let you know how it goes. Thanks.
Comment: May I ask what is the role of e.g. (* ==> g[t] - Sin[t] *) is.  Do I need to change that if I want to use different functions instead of Sin t and g[t]? @Jens
Comment: @LoveLearning No, those things in `(* ... *)` are *Mathematica* comments that I only included to show what the output of the previous line is.
Comment: Yeah I noticed after some playing around. I thought `"..."` = comments but I guess...


Resources for studying the Lebesgue integral at the undergraduate level

Question: I am a physics major in my second year, and I hope to learn about the Lebesgue integral. To give a sense of what I know so far: I went through 2 years worth of calculus courses and am currently doing a reading project based on the text "Understanding Analysis" by Stephen Abbott. What other texts/resources would you suggest for learning the about the Lebesgue integral?
Comment: I see that you can't make up your mind, but it's _Lebesgue_, not Lebesque.
Comment: Are you familiar with measure theory? If not, start from learning it. The theory of Lebesgue integration is fully based on measure theory, knowing it is a must for this topic.
Comment: Oh dear @TonyK, will make a correction
Comment: @Mark no I am not familiar with the measure theory at the moment, will make a note of that, thank you
Answer: You don't need a thorough grounding in Measure Theory to understand Lebesgue integration. The basic idea of Lebesgue integration over $\Bbb R^n$ is based on step functions, not Measure Theory. You do need to understand the idea of a null set, but that is as far as it goes.
One way of looking at the difference between Riemann integration and Lebesgue integration is that Riemann integrates by taking vertical slices of the area under the curve, whereas Lebesgue integrates by taking horizontal slices. The advantage of Lebesgue's approach is evident in that a Lebesgue integrable function is always Riemann integrable, but the converse is not true. When I was at university 40 years ago, they didn't even bother teaching us Riemann integration, because Lebesgue integration is so much better -- and just as easy to grasp, in my opinion.


Is there permanent damage done when exercising through cramps?

Question: I had decided to bike a longer route than I usually do and ended up getting caught in the rain and biked back to my car with some extreme leg cramps. It was extremely painful, but I didn't want to get caught past dark in the rain and the trip back was a little less than 2 hours. I had barely made it back before my legs completely locked up, but the cramps gradually let up and I was able to walk normally again with just some minor muscle soreness. I understand that the situation that I put myself in was preventable, but I was curious if there is any permanent damage done when pushing through cramps when exercising.
Comment: Also: Does the same apply for running through a stitch?
Answer: I highly doubt it.  In general, cramps are caused by electrolyte imbalances and make your muscles contract uncontrollably for a period of time.  The long term damage would be no more than what would happen if you contracted your muscles for the same amount of time.  Now, you will need to fix the electrolyte imbalances with proper rest and hydration.
According to the article that I linked to, the only time you should be concerned is if you chronically get the cramping in the same set of muscles without causing the cramp by your exercise.  It's an indication of nerve root disease.  However, that doesn't apply to the situation you described here.
The best prevention for cramps is a good hydration routine.  When you are doing long distance biking or running, you should probably keep some Gatorade or other sports drink on you so you can remain hydrated throughout your ride.  The sports drinks help maintain the proper electrolyte imbalances so you don't experience the severe pain that you did.
Answer: There is almost no direct evidence that muscle cramps are caused by electrolyte or water imbalances (given normal hydration prior to start).  https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3445088/  Its most likely due to the muscle being "pre-tight" and stretching is the best prevention and therapy.  No one knows actually the cause of cramps.
Answer: I'm going to provide a slightly different answer on this:

if there is any permanent damage done when pushing through cramps when
  exercising?

Potentially. Similar to DOMS, a lot of the focus on training through the discomfort assumes that you can hold perfect form. If you are squatting, as an example, and develop pain your left leg, there is a very good chance you will reflexively transfer weight to your right side. While this is a natural and terrific way for our bodies to adapt in real-time to injuries, it's a big issue if you're trying to hold good form during exercises that have a big price tag for bad form.
With DOMS, cramps, and even just being really tired, I would caution folks to ensure they are holding a proper form. Not favoring one side or another, and not trying to work around the pain by shifting the load a bit.


Conference paper published in journal

Question: I want to know that's it is written on some conference website that paper will be published at Scopus indexed journal. What that means. Is that paper is considered a conference paper or journal paper after publishing.?
Thanks
Comment: @TalhaAnwar Well, _submitted for uploading_ or _submitted for publishing_ are both problematic. The word _submitted_ weakens the notion. Getting back to your question: _Published_ has an understood meaning to academics, _uploaded_ does not.
Comment: Typically this would still be a conference paper, but can you share the web page? It would make it easier to verify what is being offered.
Comment: Please check this [link](http://icebehi.poltekkesdepkes-sby.ac.id/)
Comment: The linked website looks rather dubious: _Accepted, presented and selected papers will be submitted for uploading to Journal of Physics: Conference Series (IOP Publishing), Lecture Notes in Electrical Engineering (Springer Verlag), and Materials Science Forum..._ Firstly, three venues are listed. Secondly, it mentions only _selected papers_. Thirdly, the term _uploading_ is used, rather than _publishing_.
Comment: Regarding your question, rather than _published at Scopus indexed journal_ I think you mean _indexed by SCOPUS_.
Comment: what is the difference between uploading and publishing?
Answer: I'll give a specific example of a fairly high-ranking robotics journal (no affiliation). Robotics and Automation Letters (RA-L) is a recently-started journal of the Robotics and Automation Society, which is coupled with flagship robotics conferences (IEEE International Conference on Robotics and Automation (ICRA), the IEEE Conference on Automation Science and Engineering (CASE), and the IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS)).
Since it has only started in 2016, the impact factor (JCR Impact Factor of 3.6 for 2019) is so-so amongst established journals, but in my opinion really high for a relatively young journal.
Publication in RA-L when coupled with the above three conferences (IROS, ICRA, CASE) works like this:

When submitting to a conference, you have an option to submit the paper for RA-L special issue in addition
RA-L special issue deadline tends to be 2-3 weeks prior the conference submission deadline
Technically, the journal submission could be rejected while the paper is still accepted for conference presentation and publication in conference proceedings (but I haven't heard of that actually happening)
If accepted to RA-L, the paper will still be presented in conference sessions, but will be indexed as part of RA-L special issue associated to that conference.

Conference paper published in journal


Solving a circuit containing a resistor and inductor in parallel

Question: I am working on a problem involving a resistor and inductor in parallel with eachother - I am trying to work out the voltage across the inductor as a function of time.
It is clear to me that I will need a formula for 0 < t < 1ms and one for t > 1ms (Because the switch is closed then opened again) however I am really struggling to get my head around how I will work this out.
If someone would be kind enough to point out the logical steps for this problem it would be much appreciated - I am wondering if I need to work out a thevenins equivalent circuit then try to solve, however when I attempt this I find the resistance would change with time which wasnt helpful in solving. I have tried my textbooks and google but I couldn't find a worked solution or notes on how to solve such a circuit.
Many thanks!
Comment: The keyword is: "transient state". Don't use Thevenin, to solve this circuit use classic Kirchoff's laws, but remember that voltage across the inductor is a function of inductance, current and time U=L*(di/dt). Another method (IMHO much simpler) is  to use Laplace transform.
Comment: You might try Thevenin's for the first 1mS, put a current source in parallel with 500ohms, 125ohms and L. Then solve separately for what happens after 1mS, with the current in the inductor continuous at 1mS.
Answer: A key thing to remember is that the current in an (idealised) inductor cannot change instantaniously but the voltage can (this is the opposite of the ideal capacitor where the voltage cannot change instantanously but the current can)
There are three stages to consider (I will assume all variables use si units).
Before t=0:
The voltage and current in the inductor are zero.
Between t=0 and t=10-3
We can replace the voltage source and two resistors with a thevin equivilent circuit. This works out to a 24V supply with a 100 ohm series resistance. We now have a series LR circuit supplied by a 24V supply with zero current at t=0
We could solve the series LR circuit from first principles but I just went and looked it up on google and found http://www.electronics-tutorials.ws/inductor/lr-circuits.html . This tells me that the equation for this case is.
$$I=\frac{V}{R}(1-e^{-Rt/L})$$
Where I is the current in the indctor, L is the inductance and V and R are the 24V and 100 ohm we got from our thevinin calculation above.
After t=10-3
The only components relavent now are the inductor and the 125 ohm resistor. The current in the inductor at the start of this phase will be the same as the current in the inductor at the end of the previous phase but it is now forced to go through the resistor, this will cause the voltage on the inductor to reverse and the energy stored in the inductor to discharge. I'll leave you to either work out and solve the differential equation or google for the equation needed in this case.
Answer: For t < 0:
Since it was left open for "a long time", then its safe to assume that the inductor has been completely drained of energy. So \$V_L = 0\$.
For 0 < t < 1ms:
Taking the Laplace transform of the components and simplifying (as a voltage divider):
$$V_L(s) = \dfrac{120sLR_2}{R_1R_2 + sLR_1 + sLR_2}$$
$$= \dfrac{24s}{s + 500} = 24\dfrac{s}{s + 500} = 24(1 - \dfrac{500}{s + 500})$$
Inverse Laplace gives:
$$V_L(t) = 24(\delta(t) - 500e^{-500t})$$
Since t > 0, this results in:
$$V_L(t) = - 12000e^{-500t}$$
For t > 1ms:
The inductor drains all its stored energy through the resistor using the standard equation.


What does 'There's only so much I can do' mean?

Question: Does the sentence 'There's only so much I can do' mean "I've done everything I could" or "There's still something I could do but my power is limited and it may not be enough"? In other words, is that "so much" already done or not?
Comment: I thought I already did. Native speakers aren't always particularly careful about verb tenses in contexts like yours (where *pragmatically*, if someone has limited ability ***now***, that was also true in the past, and will continue to be true in future). And we often use Present Tense where strictly speaking we're not talking about "current, ongoing" actions. In short, saying *There's only so much I **can** do* doesn't necessarily imply anything at all about whether I ***have done, am doing,*** or ***will do*** as much as I can/could.
Comment: In many cases, a native speaker would say *There **was** only so much I **could** do* if he'd ***already*** done it. But since it could be seen as a "generic" assertion concerning the speaker's limited powers of action, it would also be fine to use Present Tense regardless of whether there was any *specific* contextually-relevant need for action (which the speaker isn't sure he can / could adequately deal with).
Comment: @FumbleFingersReinstateMonica Could you specifically address my last question?
Comment: FFRMonica is right. "There is only so much I can do" might equally well refer to a past, present, future, or hypothetical situation. The context of the conversation would make clear what is meant.
Answer:
There is only so much I can do

does not formally address the past at all. In context, it may be possible to infer that nothing, something, or everything was done in the past, but the words above on their own are silent on the issue.

Now that I have two children to care for, there is only so much I can do

certainly implies that I used to be able to do more. In a formal sense, it only speaks to a difference in past and present capacity and is silent on action. However, it usually would be intended to imply that I previously used to do something without necessarily implying that I used to do everything.
Similarly

There was only so much I could have done

does not imply anything about the present or future. Again, it does not formally say anything about action; it formally speaks only to past capacity. Usually, however, it would be intended to imply that something, but definitely not everything, was done in the past.
They are vague usages that formally speak only to capacity, but usually imply partial action.


How do you determine 32 or 64 bit architecture of Windows using Java?

Question: How do you determine 32 or 64 bit architecture of Windows using Java?
Comment: @Jesper because many times running java is not the sole purpose. many times you might have developed a program/application that is supposed to run specifically on 64 bit machines (or 32 bit machines) (the reason can be anything). in such places i'll need to check what version of of windows architecture is present ..
Comment: @Jesper Another situation where discerning between 32 or 64 bit OS is of paramount importance is when a Java program must start an external executable, for which both versions exist. Like writing Selenium tests, where the right browser driver must be started. And the same need exists for discerning the operating system itself. I'm sure one can think of several more cases where something that is supposed to be "abstracted away" is not.
Comment: Why would you want to know this? Java is supposed to run the same on any OS for which there is a JVM - your Java program shouldn't care if it's running on a 32-bit or 64-bit OS.
Comment: Related: [How do I detect which kind of JRE is installed — 32bit vs. 64bit](http://stackoverflow.com/q/807263/304)
Comment: @Jesper You said it: _supposed_
Answer: I don't exactly trust reading the os.arch system variable.   While it works if a user is running a 64bit JVM on a 64bit system.  It doesn't work if the user is running a 32bit JVM on a 64 bit system.
The following code works for properly detecting Windows 64-bit operating systems.   On a Windows 64 bit system the environment variable
"Programfiles(x86)" will be set.  It will NOT be set on a 32-bit system and java will read it as null.
boolean is64bit = false;
if (System.getProperty("os.name").contains("Windows")) {
    is64bit = (System.getenv("ProgramFiles(x86)") != null);
} else {
    is64bit = (System.getProperty("os.arch").indexOf("64") != -1);
}

For other operating systems like Linux or Solaris or Mac we may see this problem as well.  So this isn't a complete solution.  For mac you are probably safe because apple locks down the JVM to match the OS.  But Linux and Solaris, etc.. they may still use a 32-bit JVM on their 64-bit system.   So use this with caution.
Comment: +1 After quite a bit of research I'm going to use this. But I'm curious, on this machine (Windows 8.1 64 bit) the environment variable `ProgramFiles(x86)` is not listed under "This PC" / Properties / Advanced System Settings / Environment Variables, yet `System.getenv("ProgramFiles(x86)")` does return the value `C:\Program Files (x86)`, which of course is great because it sounds like such variable cannot be modified or removed by users; is that the case ? Is `ProgramFiles(x86)` some kind of "internal" environment variable ?
Comment: "I don't exactly trust reading the `os.arch` system variable." The reason for this behaviour is that for e.g. [JNI](https://en.wikipedia.org/wiki/Java_Native_Interface) is important to know the arch of **[JVM](https://en.wikipedia.org/wiki/Java_virtual_machine)**, not underlying OS (if you need to load into Java code your own platform dependent shared libraries, they need to be the same arch as JVM).
Comment: this is still not reliable at all because one can erase environment variables before spawning the process. The better way is probably checking the existence of `%Windir%\SysWOW64` (meaning 64-bit process) and `%Windir%\Sysnative` (meaning 32-bit process running in 64-bit Windows)
Answer: Please note, the os.arch property will only give you the architecture of the JRE, not of the underlying os.
If you install a 32 bit jre on a 64 bit system, System.getProperty("os.arch") will return x86
In order to actually determine the underlying architecture, you will need to write some native code.  See this post for more info (and a link to sample native code)
Answer: I used the command prompt (command --> wmic OS get OSArchitecture) to get the OS architecture. The following program helps get all the required parameters:
import java.io.*;

public class User {
    public static void main(String[] args) throws Exception {

        System.out.println("OS --> "+System.getProperty("os.name"));   //OS Name such as Windows/Linux

        System.out.println("JRE Architecture --> "+System.getProperty("sun.arch.data.model")+" bit.");       // JRE architecture i.e 64 bit or 32 bit JRE

        ProcessBuilder builder = new ProcessBuilder(
            "cmd.exe", "/c","wmic OS get OSArchitecture");
        builder.redirectErrorStream(true);
        Process p = builder.start();
        String result = getStringFromInputStream(p.getInputStream());

        if(result.contains("64"))
            System.out.println("OS Architecture --> is 64 bit");  //The OS Architecture
        else
            System.out.println("OS Architecture --> is 32 bit");

        }

    private static String getStringFromInputStream(InputStream is) {

        BufferedReader br = null;
        StringBuilder sb = new StringBuilder();

        String line;
        try {

            br = new BufferedReader(new InputStreamReader(is));
            while ((line = br.readLine()) != null) {
                sb.append(line);
            }

        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            if (br != null) {
                try {
                    br.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }

        return sb.toString();

    }

}

Answer: I wanted to share my Java code solution to this (the one alike is a native code).
I would like to add up to Mr James Van Huis's answer; since the property os.arch System.getProperty("os.arch") returns the bitness of JRE, this can actually be very useful. From the article:

In your code, you first need to check the size of IntPtr, if it returns 8 then you are running on a 64-bit OS. If it returns 4, you are running a 32 bit application, so now you need to know whether you are running natively or under WOW64.

Therefore, the IntPtr size check is the same check you perform by looking at the "os.arch". After this you can proceed with figuring out whether the process is running natively or under WOW64.
This can be done using the jna library(e.g. NativeLibrary) which offers use of the native functions you need.
//test the JRE here by checking the os.arch property
//go into the try block if JRE is 32bit
try {
    NativeLibrary kernel32Library = NativeLibrary.getInstance("kernel32");
    Function isWow64Function = kernel32Library.getFunction("IsWow64Process");

    WinNT.HANDLE hProcess = Kernel32.INSTANCE.GetCurrentProcess();
    IntByReference isWow64 = new IntByReference(0);
    Boolean returnType = false;
    Object[] inArgs = {
        hProcess,
        isWow64
    };
    if ((Boolean) isWow64Function.invoke(returnType.getClass(), inArgs))    {
        if (isWow64.getValue() == 1)    {
                //32bit JRE on x64OS
        }
    }
} catch (UnsatisfiedLinkError e) {  //thrown by getFunction

}

Something like this might also work, but I would recommend the first version, since it's the one I tested on x64 and 32bit JRE on x64 OS. Also it should be the safer way, because in the following you don't actually check whether or not the "IsWow64Process" function exists.
Here I am adding an example of the JRE check, just so it is complete, even though it's not hard to find.
Map<String, Integer> archMap = new HashMap<String, Integer>();
archMap.put("x86", 32);
archMap.put("i386", 32);
archMap.put("i486", 32);
archMap.put("i586", 32);
archMap.put("i686", 32);
archMap.put("x86_64", 64);
archMap.put("amd64", 64);
//archMap.put("powerpc", 3);
this.arch = archMap.get(SystemUtils.OS_ARCH);
if (this.arch == null)  {
    throw new IllegalArgumentException("Unknown architecture " + SystemUtils.OS_ARCH);
}

Answer: (Only for Windows) Check if
C:\Windows\SysWOW64
exists.
if the directory exist, it is a 64 bit process.
Else, it is a 32 bit process.
Answer: You can try this code, I thinks it's better to detect the model of JVM
boolean is64bit = System.getProperty("sun.arch.data.model").contains("64");

Comment: The OP asks about the OS not the JVM
Comment: Does nor work, checked on Windows 10 (64bit) with Java 8 32bit.
Comment: It could work or not; in some OS this key is absent. Check https://stackoverflow.com/questions/807263/how-do-i-detect-which-kind-of-jre-is-installed-32bit-vs-64bit, the most voted answer. In my Win10 it is present.
Answer: Maybe it 's not the best way, but it works.
All I do is get the "Enviroment Variable" which windows has configured for Program Files x86 folder. I mean Windows x64 have the folder (Program Files x86) and the x86 does not. Because a user can change the Program Files path in Enviroment Variables, or he/she may make a directory "Program Files (x86)" in C:\, I will not use the detection of the folder but the "Enviroment Path" of "Program Files (x86)" with the variable in windows registry.
public class getSystemInfo {

    static void suckOsInfo(){

    // Get OS Name (Like: Windows 7, Windows 8, Windows XP, etc.)
    String osVersion = System.getProperty("os.name");
    System.out.print(osVersion);

    String pFilesX86 = System.getenv("ProgramFiles(X86)");
    if (pFilesX86 !=(null)){
        // Put here the code to execute when Windows x64 are Detected
    System.out.println(" 64bit");
    }
    else{
        // Put here the code to execute when Windows x32 are Detected
    System.out.println(" 32bit");
    }

    System.out.println("Now getSystemInfo class will EXIT");
    System.exit(0);

    }

}

Comment: Well, user Boolean had already the same way but in a better code.
Answer: You can get the "real" os arch from command line.
You can use "wmic cpu get AddressWidth".

If do you want the processor arch, you can use "wmic cpu get DataWidth"
I write a simple java static code to try this.
(Disclaimer: You need use ProcessBuilder if you want reuse this code)
public static String getOsArch() {
    String arch = null;
    try {
        arch = HotUtils.executeCmd("wmic cpu get AddressWidth");
        arch = arch.trim();
        arch = arch.replace("\n\n", "\n");
        arch = arch.replace(" ", "");
        arch = arch.trim();
        return arch.endsWith("64")? "64": "32";
    } catch (IOException ex) {
        Logger.getLogger(HotUtils.class.getName()).log(Level.SEVERE, null, ex);
    }
    return arch;
}

public static void main(String[] args) {
    System.out.println(HotUtils.getOsArch());
}

public static String executeCmd(String cmd) throws IOException {
    Runtime rt = Runtime.getRuntime();
    Process proc = rt.exec(cmd);

    BufferedReader stdInput = new BufferedReader(new InputStreamReader(proc.getInputStream()));
    BufferedReader stdError = new BufferedReader(new InputStreamReader(proc.getErrorStream()));

    StringBuilder out = new StringBuilder();
    String s;
    while ((s = stdInput.readLine()) != null) {
        out.append(s);
    }

    while ((s = stdError.readLine()) != null) {
        out.append(s);
    }
    return out.toString();
}

Comment: Why -1? Give me feedback, this is a hard but effective way to that.
Answer: System.getProperty("os.arch");

Comment: On 64b windows, but 32b jvm it prints "x86" for me. So I guess it doesn't say the version of system but rather virtual machine.
Answer: You can use the os.arch property in system properties to find out.
Properties pr = System.getProperties();
System.out.println(pr.getProperty("os.arch"));

If you are on 32 bit, it should show i386 or something
Comment: on 64-bit OS running a 32-bit JVM, this will return x86, indicating 32-bit. While this is correct for the JVM, it is wrong for the OS, which is what the OP asked.


Finite State Machine

Question: My task is to design a FSM whose output goes high for a single cycle whenever the pattern 10110 is detected on its input. I am assuming I will need five state bubbles.
Comment: We're not here to do your homework for you.
Answer: State 0 is only needed immediately after reset. A 0 in state 2 should go back to state 1, and state 4 should go back to state 1 immediately after emit. Also, you have 2 transitions for state 3 on a' (only the one to state 4 is needed).
A lot harder than I thought it would be. And even this is probably more complex than it needs to be. State 4 indicates a match.
Comment: Thank you.  What does the emit mean in state 4?  Would that be a'?
Comment: That would be emitting 1 on the output.
Comment: Ah, alright.  So what input would I have on state 4 going to state 1?  Or would I just draw an arrow?
Comment: There wouldn't be an input for it; it would be an automatic transition. We need to separate out state 4 explicitly since we can't have an emit on every entry to state 1 (e.g. 0 -> 0).
Comment: That will fail to match 0110110.
Comment: Alright so remove the a' and a coming from state 4 and just put an arrow going to state 1?  Because I can't write emit on the transition lines, only a or a'.
Comment: That is correct. We use the 0 we received before going into 4 as part of the next sequence, but only if a 1 is received after.
Comment: Correct. It's used to catch runs of 1s greater than 2.
Answer:        |    1         0
-----------------------
INITIAL|    1   INITIAL
     1 |    1        10
    10 |  101   INITIAL
   101 | 1011        10
  1011 |    1     10110
 10110 |    -         -

I cant post pictures, so I chose to fall back to 'table' version of the FSM (if you reconstruct the picture from it, everything would be clear).
Left-most column in the table represents possible states (6 in total - INITIAL,1,10,101,1011,10110), top row  represents possible inputs (0 and 1). Content of the table represents transition from one state (left column) to another state under given input (top row).
explained:
You start and wait in INITIAL state reading any 0s that come in.
When you hit 1, you transit to state 1 then you continue from there in similar fashion ... Basically the names of the states represent the longest "good" read part of the input, but this is only for better orientation, you could name the states whatever you want. State 10110 is final. If you reach it, you should fire the signal or whatever.
Here is a catch in your question, though: you havent specified if you just want to fire the signal every time the last 5 digits are 10110, or if you want to 'reset the counter' after you find that sequence.
Therefore you can add transition from state 10110 to 101 under 1 and to INITIAL state under 0, if you want to fire a signal every time "the last 5 digits on input were 10110".
Otherwise add transition from state 10110 to INITIAL state under both 0 and 1 (that means "forget everything you read so far and start again").
Answer: Although Ignacio Vazquez-Abrams' answer is close, it fails if 0110 is input from start.
Comment: This will not accept 110110

Finite State Machine


別に to mean "not particularly"

Question: I hear 別に used as "not in particular", did this usage come about just directly from the meaning of "separately"? So when used, it means that someone has a separate interest, like, etc. and hence they don't particularly have the interest, or share the like?
Answer: No, this negative expression means "Not really", "I'm not interested", "I don't care", etc.
I think this 「別に…」 is the shortened form of "別に言いたいことはない" or "別にそういうわけではない", and 別に here roughly corresponds to particularly.
Something positive, like "これとは別のものが好きです" or "私はこれとは別に、言いたいことがあります" is not what the speaker want to say.
Comment: @Monburan Yes, "別に" can be very rude, and the best-known example is [this one](https://www.youtube.com/watch?v=IXpYtOFe9jk). But a single-word answer is always rude in an interview anyway :)
Comment: Naruto's answer sounds good to me. I think Naruto's English translation ("Not really", "I don't care" etc.) conveys this well, but I also want to explicitly note that I've been told 別に could come off as rude, curt or at least very casual when used in reply to someone asking about a potential interest. (Please someone let me know if you disagree!)

別に to mean "not particularly"


Qt and OpenCV 2.0 integration problems

Question: I have a Qt application that uses OpenCV for image processing.
Everything was working fine with OpenCV 1.0 but when I upgraded to
OpenCV 2.0 it started crashing.
I noticed that it only crashes whenever OpenCV functions are called
inside Qt slots.
For instance, the following slot:
<code>void TestClass::on_testButton_clicked() {
   IplImage* src = cvLoadImage("test.jpg");
   IplImage* dst = cvCreateImage(cvGetSize(src), src->depth, src->nChannels);
   cvThreshold(src, dst, 100, 255, CV_THRESH_BINARY);
}
</code>
crashes when testButton is clicked.
However, if I call the same cvThreshold function in any other place,
such as inside the main() function
or inside the Widget constructor, it works fine. Also, if I put the
same code in a separate function and
call that function with QtConcurrent::run() inside the same slot, it
works fine too.
Why this behaviour? Are there any restrictions about the operations
that can be done inside Qt slots? Which changes in OpenCV 2.0 functions
may be causing the conflict?
Thanks in advance
Answer: Never mind, I was using OpenCV's precompiled libraries,
which were created with a different version of mingw.
I compiled the library with cmake+mingw and using
the generated libraries solved the problem.
Comment: don't forget to accept your answer if it solves your problem.. that way the question won't be marked "unanswered" .. plus, you'll get a badge. :)
Comment: @Andres: How did you manage to compile opencv+Qt with cmake+mingw? If I try that, I get an error that a file named `Windows-gcc.cmake` is missing.

Qt and OpenCV 2.0 integration problems


In Numbers 23:19, what is the significance of God being compared to a "MAN that lies" and a "SON OF man that relents?"

Question: I am looking for a meaningful explanation to Numbers 23:19. What is the significance of God being compared to a "(ish) MAN that lies" and a "(ben adam) SON OF man that relents?"
Comment: Better translation would be "not a person, who lies; nor a human who relents." Still can ask why those particular choices of term for "person", but don't get caught up in the "son" business. "Ben-Adam" is another way of saying "human."
Comment: https://judaism.stackexchange.com/questions/79914/why-is-yhvh-called-a-man-of-war-in-shemot-153
Already answered this question.
Answer: There is a beautiful lengthy piece from Rav Yaakov Tzvi Mecklenburg in his Haketav Vehakabalah on this verse. In short, although "Ish" and "Adam" both have connotations of being both wicked (במות אדם רשע,  איש אשר אין מעצר לרוחו) and righteous (ויקרא את שמם אדם ביום הבראם, משה איש אלהים), there is nonetheless a fundamental difference between them.
The term "Adam" refers to one who has a very base, coarse, and crass nature. As his name testifies, he is one who is very earthly and connected to physicality. The term "Ish" refers to one who has a very refined, sensitive, and nuanced nature. The root of this name is "Yeish-יש" or "there is", representing the truly good and spiritual nature of the world as it is inherent and eternal(ישיות וקיום נצחי).
In our verse, the "Ish" refers to a person who is naturally a trustworthy person and one who calls upon him for a task assumes with certainty that he will execute it. Yet ultimately he is just a man, and something outside of himself can be the cause for this task never coming to fruition, even with all of the efforts of the "Ish". The term "ויכזב" in our verse refers to the failure of a given thing, like
לא יכזבו מימיו" - ישעיהו,נח,יא".
"Adam" in our verse refers to a person who is naturally an untrustworthy person who would regret even accepting the task. This is the understanding of "ויתנחם" in our verse.
Bilaam announces that not only is God not like a lowly, untrustworthy, and incapable man, rather he is not even like an upstanding, trustworthy, and capable man. For even a man as lofty as he is a mere mortal and subject to forces beyond him, this is not so with God, as he is the source of everything and subject to nothing.
I highly recommend reading the piece in full.
Answer: Rav Hirsch explains that an oracle speaks in parables and and can use terms that can be misinterpreted or have multiple meanings. For example the story of King Midas and the Oracle at Delphi in which the message was A mighty kingdom will be destroyed and King Midas thought he would win while he was actually soundly defeated. Hashem explicitly stated that Bnai Yisrael would be blessed and Bil'am was forbidden to curse them.
As Rav Hirsch explains

לא איש וגו. Immediately on your first request Hashem told me regarding this people כי ברוך הוא that it was blessed. Hashem does not
speak in the ambiguous words of the oracles. If Hashem says that
something is blessed it it is blessed, and there is not phase of it
that is accessible to the reverse. And if Hashem has once said לא תאור
את העם ("thou shalt not curse the people") He does not afterwards
change His mind and give permission for the opposite.
Answer: "Ben Adam" is an extremely common phrase in the Bible, particularly in the book of Psalms. It is also how G-d refers to Ezekiel. (See for example Ch.2 v. 1)


how can i add HTML codes to my sharepoint site?

Question: I got a website. I want to change object's alignments ,margin and padding. I am clicking "Edit page". Then , i am clicking which web part i want to change and "Edit source "on the top. It pops-up HTML editor. I am changing code. Then clicking Ok. It is normal for now. When i press "Save", all the changes is going.
Comment: I would advise using Internet Explorer for editing code snippets, as I have found that using Google Chrome can result in the text disappearing once you have saved the changes
Comment: you say use F12 ?
Comment: No, when editing webparts via the GUI, use Internet Explorer rather than Google Chrome.
Comment: Internet Explorer are not used widely as compared to chrome/mozilla/edge within an organisation. Better try editing fixing responsive in chrome only
Answer: To add HTML code snippet in a page we can make use of Script Editor or Content Editor Web Part

Prefer Script Editor as its easy to handle the html code snippet here , Content Editor Web Part may some time misbehave.


Combine, minify, and replace references to JS and CSS files

Question: Is there a solution out there that will combine and minify js and css files, and then replace the references to them in the original html files? I've found a number of solutions that will minify and combine, but none that will replace the references in the original html file. The  Web Minifier Maven plugin from http://mojo.codehaus.org/webminifier-maven-plugin/ does exactly what I want for JS files, but doesn't deal with CSS files. Is there anything that does? Our build process uses Maven, so the solution needs to be either a Maven plugin or a script.
Comment: Did you find a solution for this? I'm trying to do exactly the same thing right now.
Comment: You can give this library a go. I am biased of course ;)  https://nuget.org/packages/RxLoader/
Answer: Google Closure Tools provides all of this functionality.
References

Closure Tools Reference (includes compiler and HTML templates).
Closure Stylesheets

The Closure-compiler supports Maven integration.
Comment: Could Closure combine (inline) all related js, css into html, make it a single html file?


What does Augustine suggest that the slave do instead of killing his master?

Question: I was just wondering this question from Book One of Augustine's On Free Choice of the Will
Comment: Is there any particular quote from this text about slavery that brings the question to mind? This might help provide context for an answer.
Comment: No, I don't have the text
Comment: Augustine didn't offer any advice for what a slave should do instead of killing his master, that I know of. He only pointed out that there are different *motives* for killing, some of which are justifiable, others which are evil and punishable. He stated that killing someone simply to remove an obstacle to your own freedom to do evil is motivated by *lust* rather than merely the desire to live *without fear*. So I gather that it might be justifiable for a good slave to kill an evil master, but wrong for an evil slave to kill at all, and a good slave would never kill a good master regardless.
Answer: Nothing directly but implicitly - obey.
There is extensive discussion in Free Choice of the Will of masters slain by their slaves  (I.4.9.25 ff.) I think Augustine indirectly follows St Paul on this subject. The slave could indeed kill her or his master but that is not the way of Christian spirituality. The following extract from Margaret Mary might help. Her language is that religiously engaged  - not what a philosophical reader nowadays generallly encounters - but the ethical point is easily extractable:

Like
   every good ancient scholar, he [Augustine] gives
   us the etymology of the word ['slave'], stating
   that prisoners of war, instead of being
   killed were preserved by their conquerors, and were called servi from  that fact. For by nature and as God
   first created us, no one is the slave,
   either of man or of sin. But servitude
   is penal, and is the sanction of the
   natural law. If nothing had been done
   in violation of that law, there would
   have been nothing to restrain by penal
   servitude. Since this is so, Saint Paul
   urges slaves to submit to their masters
   and serve them heartily and with good
   will, so that if they cannot be freed by
   their masters, they may themselves
   make their slavery in some sort free,
   by serving, not in fear, but in love,
   until all unrighteousness pass away,
   and God be all in all. ( Margaret Mary, 'Slavery in the Writings of St. Augustine', The Classical Journal, Vol. 49, No. 8 (May, 1954), pp. 363-369: 363-4.)

The text in the background here is St Paul's 'Letter to Philemon', addressed to the owner of a runaway slave, Onesimus. Paul directs Onesimus to return to his master, Philemon, and asks his Philemon to be reconciled with the slave. Even as a slave Onesimus will have the freedom of being obeying willingly as Philemon's brother in the Lord. Slavery dos no harm to his spritual life and development.
This answer leads us into theology but you raise a genuinely ethical issue in asking why a slave should obey rather than kill her or his master. The issue of freedom-within-slavery arises more familiarly to philosophers in the (non-Christian) writings of Epictetus.


Embedded Linux USB Audio Issue

Question: I have a Corewind WiFiG25 board based on the AT91SAMG25 400 MHz following
Arm processor running Linux 3.6.9 built using Buildroot. I am attempting to play mp3 files using mpg123 connected to an ALSA device consisting of a USB connected TI PCM2900C CODEC. The files play, but they "crackle" during playback.
I suspected the processor of being overloaded playing the files, but the top command reveals less than 20% CPU utilization. To further test this hypothesis I made the CPU very busy to see if the issue got worse. I made the CPU busy using the following command
cat /dev/zero > /dev/null

This consumed 95% or more of the CPU. The issue did not get worse, but instead the audio noise vanished completely and the audio was great. I then suspected power management issues were involved.
I configured the kernel without power management, but that did not improve audio performance.
I have searched extensively for other ideas or approaches in an effort to validate my latest thinking, but to no avail. Lots of discussion on how to enable power-management and audio issues on linux desktop systems, but not this sort of embedded environment.
Any thoughts, hypotheses, test, etc. you might think of would be welcome. I would rather not leave the cat /dev/zero > /dev/null in my final system :)
Answer: Try a more up to date Linux kernel (like the latest version), and if the problem persists, report the bug to the maintainers of this platform in the mainline Linux kernel.

Embedded Linux USB Audio Issue


How to have a checklist to show your athletes?

Question: I want a checklist that I can show, but I do no want those who are not achieving as well not to fell left out. I want this for a gymnastics class, so that they can see how well they are doing.
Answer: Include a bunch of easy-to-achieve items so that everyone has some things checked off. Depending on the age of your athletes, they might realize that some of the items are really just filler/nonsense.
If that's still not enough, then do the checklists on separate pieces of paper that you hand out and go over with each athlete individually.
I'm not super familiar with gymnastics, but a list might look something like this.

On time and ready to go at start of every class
Appropriate attitude
Helpful with other students
Puts away equipment at end of class (?)
Warm up (?)
Complete easy activity 1
Complete easy activity 2
Complete easy activity 3
Complete moderate activity 1
Complete moderate activity 2
Complete moderate activity 3
Complete difficult activity 1
Complete difficult activity 2
Complete difficult activity 3

The idea is that even your "worst" students will have half the checklist done.
Also, one other thought may be to focus (at least partially) on improvement rather than achievement. So even if they're bad at some item on the checklist, if they're making progress, it can be encouraging for them to hear that that's recognized.


How to use a coupon bond to purchase a bond?

Question: I have been stomped on this question say I am a US investor and I want to just receive JPY coupon using my US coupon. How do I do this? Is a just a straight exchange of paying fixed US coupon and receiving fixed JPY coupon? Or is it more complicated than that
Comment: Is this a hypothetical situation? If you were an institutional bank you could enter into a _currency swap_ but I'm wondering if you want something more practical (swaps are usually done at very large scale).
Comment: its a hypothetical situation, Just want a simple version, what is being exchange and is it at a fixed rate or floating rate?
Answer: A common way to do this is with a currency swap. With a currency swap, you agree to pay either a fixed or floating amount each period in exchange for a fixed or floating amount amount in a different currency. They are only traded over-the-counter, typically by investment banks on a very large to hedge specific risks.  With floating-rate swaps, the floating rate is typically determined by some industry standard interest rate quote.
As an example, Say you entered into a float-float swap with a notional of $1,000,000 where you pay a coupon in the amount of the Secured Overnight Funds Rate (SOFR) and receive a coupon in JPY calculated using the Mutan interest rate (the standard overnight rate for Japan). Each quarter (or month, depending on the terms of the contract), you pay the other side USD and they pay you JPY.
If you have a fixed-rate bond, and thus want to pay a fixed amount of USD, you could to a fixed-to-float swap, but the mechanics would be similar; you'd pay a fixed amount of USD in exchange for a floating rate in JPY.
There are also fixed-fixed swaps, where you trade a fixed amount of one currency for a fixed amount in another, but they are less common. Swaps are typically used to protect against interest rate risk is specific currencies (hence the floating leg), but a fixed-fixed swap is possible. The "exchange rate" would be fixed at the onset of the swap and be based on the market's expectation of future exchange rates.
Comment: As a fixed US bond owner, why can't I just swap my fixed US coupon and receive fixed JPY coupon and not floating rate?
Comment: @the_brass_bottle You can, but they are less common. I've added that.


Implementation of PSK modulation/demodulation

Question: I want to implement a BPSK modulation/demodulation using a microcontroller (Arduino Due). The carrier signal should be at 1-50 MHz and the information rate at 300 KHz. For the sender part I would implement it using two DDS driven by one oscillators. But I cannot figure out how to do this at the receiver side. I found out that the ADC's sample rate of the Due is limited to 1 MHz and too low for sampling the received signal. So does this mean that I have to preprocess the signal analogously?
Comment: Undersampling demodulation springs to mind. Try looking at software radio receivers.
Answer: Partially you question is answered in this topic. Probably you need analogue carrier recovery circuit, for example Costas loop-based circuit. Good theoretical review of BPSK Costas loops is given in this article.


How to install pip install pycairo? getting error

Question: when I'm Try to install the Pycario im getting this error please help me to solve this error. Im using Ubuntu 20
$ /workspace/development/frappe-bench/env/bin/python -m pip install --quiet --upgrade -e /workspace/development/frappe-bench/apps/erpnext_uyn_customizations
  error: subprocess-exited-with-error

  × Building wheel for pycairo (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [15 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-cpython-39
      creating build/lib.linux-x86_64-cpython-39/cairo
      copying cairo/__init__.py -> build/lib.linux-x86_64-cpython-39/cairo
      copying cairo/__init__.pyi -> build/lib.linux-x86_64-cpython-39/cairo
      copying cairo/py.typed -> build/lib.linux-x86_64-cpython-39/cairo
      running build_ext
      Package cairo was not found in the pkg-config search path.
      Perhaps you should add the directory containing `cairo.pc'
      to the PKG_CONFIG_PATH environment variable
      No package 'cairo' found
      Command '['pkg-config', '--print-errors', '--exists', 'cairo >= 1.15.10']' returned non-zero exit status 1.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pycairo
ERROR: Could not build wheels for pycairo, which is required to install pyproject.toml-based projects
ERROR:
subprocess.CalledProcessError: Command '/workspace/development/frappe-bench/env/bin/python -m pip install --quiet --upgrade -e /workspace/development/frappe-bench/apps/erpnext_uyn_customizations ' returned non-zero exit status 1.

I try to get my frappe custom_app. when I try to pull the app im getting this error please help me how to sort
Comment: https://stackoverflow.com/search?q=%5Bpip%5D+No+package+cairo+found
Answer: You need cairo to build pycairo, see [the docs]. To install cairo and its headers, run
sudo apt install libcairo2-dev


ADP API Client Secret for OAuth

Question: Our company currently uses the ADP Run app and we are working with the ADP API for an in-house web app (NodeJS) that will get employee clock / time data. The API is pretty straight forward but I am unable to authenticate to get a bearer token because we can find a "client secret" anywhere for our account and I have been unsuccessful in getting this information from any contacts at ADP. We have the CSR certs and the Client ID but not a client secret and we can't connect to the API without it. Could someone who has experience in working with ADP API please point me in the right direction on how to obtain this for an account?
Answer: A brief skim suggests to me that that API uses the authorizaton_code OAuth2 flow, which does not use a client secret.
password and client_credentials flows both require secret, but not authorization_code.
Answer: Your representative should provide you with your ClientID and Secret.
I am trying to call on ADP API as well. I can generate an accesstoken in Node referencing their documentation, https://developers.adp.com/articles/guides/build-dataConn-app-w-dev-lib-Nodejs, but I don't know how to grab it and use it to access other ADP endpoints.
Grabbing the accessToken within ADP API

ADP API Client Secret for OAuth


Why do firms reduce both price and supply during a recession?

Question: Could anyone explain why firms reduce both price and supply of goods and services during a recession with a practical real life example for better understanding ?
Answer:
Why do firms reduce both price and supply during a recession?

From a purely theoretical standpoint, it is not that firms (suppliers) reduce price. Instead, they reduce supply, which is visualized as the supply curve shifting to the left, which in turn might intersect the demand curve at a different equilibrium price.
In a recession the demand contracts. If/when the contraction of demand outweighs a contraction of supply, the result is a lower equilibrium price. A reduction of supply tends to preclude the steeper decrease of price that would occur if only the demand contracted.


What is the purpose of Browse Information generated by Visual Studio

Question: I got a huge C++ third-party project with set of project in one solution. So build time is rather long and Browse Information generation takes a lot too. So what  is the purpose of Browse Information? What functionality will be lost if i disable Browse information generation?
Answer: Visual Studio 6 required browse information to do the things that Doug T. mentioned.
Newer versions of visual studio can use the browse information file, but by default use a newer Intellisense database.  For those versions, there is basically an Intellisense daemon that builds the database in the background instead of being directly embedded in the build process.  It really helps to have more than one processor or core when using Intellisense.  Otherwise it can really bog down your system.
Comment: very true, the dual core processors help. That's one of the reason I sometimes just want to be able to just develop in vim. I could do that on 90's hardware:)
Answer: From here

Select Generate Browse Info under the
  C/C++ project settings tab, for any
  source-files that you want to be
  included. This is very useful for
  searching for function definitions and
  declarations - just right-click a
  function / variable and select "Goto
  Definition Of..." and the IDE will
  take you straight there.

You will lose some ability to easily navigate your code. This may matter a lot in a very large code base. I know that without it and tools like Visual Assist X, I would be lost. Still, Visual Studio has a very efficient find-in-files operation that cannot be completely replaced with browsing tools.