What does "single-action" mean?

Question: I know that single-action when used for handguns mean that the gun doesn't have to be cocked in order to fire, but I also saw the phrase "single-action rifle", "single-action shotgun", "single-action submachine gun". I was wondering if "single-action" meant the same thing for all guns, because as far as I know only handguns have to be cocked. After googling, I heard "single-action rifle" meant "bolt-action rifle", is this true?
Answer: Most guns have to be 'cocked', not just handguns. Sub-machine guns, machine guns, rifles, shotguns, all are cocked before use. Example discussion for bolt-action rifles:

Bolt action is a type of firearm action where the handling of
  cartridges into and out of the weapon's barrel chamber is operated by
  manually manipulating the bolt directly via a handle, which is most
  commonly placed on the right-hand side of the weapon (as most users
  are right-handed). When the handle is operated, the bolt is unlocked
  from the receiver and pulled back to open the breech, allowing the
  spent cartridge case to be extracted and ejected, the firing pin
  within the bolt is cocked (either on opening or closing of the bolt
  depending on the gun design) and engages the sear, then upon the bolt
  being pushed back a new cartridge (if available) is loaded into the
  chamber, and finally the breech is closed tight by the bolt locking
  against the receiver.

Bolt Action
Answer: You aren't working from an appropriate definition of "single-action": (Firearms, Gunnery, Ordnance & Artillery) (modifier) (of a firearm) requiring the hammer to be cocked by hand before firing.
Double-action means the trigger both cocks and fires the gun as explained in this article about the difference between double and single action.
The difference between a hand gun and a rifle is basically barrel length and the stock on a rifle that allows you to shoulder it. The "action" doesn't matter.
The "Trigger" article in Everipedia explains what is meant by an "action" when discussing firearms.

There are numerous types of action, where action refers to the mechanism (the trigger, hammer, and safeties considered as a unit) or to the logic of how it is built and how it is used. They are categorized according to which functions the trigger is to perform. In addition to releasing the hammer or the striker, a trigger may cock the hammer or striker, rotate a revolver's cylinder, deactivate passive safeties, select between semi-automatic and full-automatic fire such as the Steyr AUG (see progressive trigger), or pre-set a "set trigger". Most modern firearms use the trigger to deactivate passive safeties but this does not change how they are identified.
Comment: So all guns can be double or single action?
Comment: @VOXuser No, there are different types of firing mechanisms on guns that wouldn't be described as single-action or double-action.
Comment: like which ones?

What does "single-action" mean?


Staged Event Driven Architecture - Weblogic

Question: When should I go for Staged Event Driven Architecture ? Do you see any issues in implementing SEDA in weblogic by having multiple Queues/MDBs as stages ? Any insights on disadvantages using SEDA ?
Comment: Hi, did you have any news on this question ? I am interested too.
Answer: Do you have any specific concerns you want to address?  WebLogic JMS is very high-performing so this should not be a problem.
As you have probably learned at this point, message replication between distributed topic members can cause duplicate messages in some cases.  There is a new feature in WebLogic 10.3.4 that you should look at for this called 'Partitioned Distributed Topics'.
Here are some links for reference:
http://www.oracle.com/technetwork/middleware/weblogic/learnmore/weblogic-javaee6-webcasts-358613.html
http://www.youtube.com/OracleWebLogic


Setting height field in Create TIN" tool in ArcMap when using it in model?

Question: When using the tool on its own, you can pick the height field manually. I want this choice to be an option in a model, however I cannot add any parameter for the options in the box. Is this somehow possible?
Answer: The 'Height Field' can't be a standalone option, since it is always related to each of the input feature classes. But you can se the 'Input feature class' as parameter of the model, the Height Field option will be visible:
Set Input Feature Class as parameter:

The this is what you get when running the model:
Comment: @MapEngine - No, indeed. The data type of this parameter is `value table`, not `feature class`. You'd probably better use python to do this.
Comment: This works when I do the following: rightclick on tool --> make variable -> from parameter -> input feature class. It does not work when I use some output (from a clip for example) and connect it as input feature class OR insert a feature class variable and connect it as input feature class.
Comment: I guess I'll have to, there's no value table variable, nor did other variables I tried work. Thanks for the help!


Windows XP updates on a fresh install

Question: I am imaging a large number of pc's using dell image direct and the new pc images do not include updates for windows xp sp3. So I am having to download all of the updates for each machine, this takes a huge amount of time. I was wondering if there is a way to download the updates once, save them, and apply them to all of the computers without using group policy?
Comment: Sounds like you just need to update the image that you're deploying -- rather than the approach you've asked about.
Comment: Updating the orginal image would be the best way to solve the current updates each machine needs.  Can that be done?  I posted the simple manual way and John T posted a centralized managed solution.
Answer: You have a few options.
1 - Configure a WSUS Server which can download all the updates once then apply them to all your machines.
2 - Use WSUS Offline Update to create an update binary and run it on all machines via startup script or method of your choice.
3 - Update one machine fully, then use an imaging solution such as Clonezilla to take a fresh image, and apply it to all machines.
If this will be a domain environment, you may want to look into Microsoft's System Center Configuration Manager (SCCM) which integrates a whole bunch of Microsoft products into one, including WSUS.
Answer: You can download the update from Microsoft here
Then you can just put that on your network file share area and install from that on all your machines.
This would be the manual way to install and avoiding downloading the updates multiple times.  If you would like a more automated centralized method, check out JohnT's answer.
Comment: I think they are talking about the 100+ updates that come after SP3
Comment: @Moab Yah, I am hoping OP returns to give us some more information.  If he wants the more advanced solutions, I will just delete this answer because I am just mentioning the simple manual way of approaching this.
Answer: Slightly late to the party but AutoPatcher it downloads updates from Microsoft's servers to a local disk such as a USB key and that can be transferred from computer to computer to install the updates.
If you want a more centeralised method then WSUS is the way to go.
Answer: There is a 3rd party solution if you cannot get a WSUS server set up.
http://www.michaelboman.org/how-to/ctupdate
.
Answer: One way would to do the following:
install it one one computer and do the updates
download this ISO (TRK)
use the mclone utility to copy your current install to all other pcs
mclone works like this, You setup the ISO to boot into an mclone server mode and set all of the other pcs to boot into the mclone client mode. Once all of the other PCs have established a link (not really a connection as mclone is UDP centric), start it up on the server and all of the computers will get an exact image of the first one. Very easy to do and VERY fast (uses my entire network speed... which at gigabit is really really fast)
this is a free solution that works consistantly for me and is really simple to use
Comment: also, you don't need to burn 100x ISOs either. TRK can be loaded straight to memory, allowing you to use the same CD on all of the PCs... it loads really really fast... taking probably < 2 mins per machine (really most of that is just waiting too so with a few cds you can keep busy the whole time instead of just waiting...)

Windows XP updates on a fresh install


How to remove salt & pepper noise from speech signal?

Question: I'm having a lot of problems with my project:

I added salt and pepper noise by inbuilt function
I DWT function with Haar family
Now I want to remove noise from original speech signal.
I don't know how to do this
Comment: Try moving median
Comment: Is this a homework problem?  You are required to use Haar wavelets to solve it or can you use other methods?
Answer: If you are forced to use the Discrete Haar Transform, then note that the Discrete Haar Mother Wavelet is nothing but a [1 -1], or in other words, a discrete differentiator, as shown below:

As such, it can/will severely accentuate sudden transitions in your waveform, ie, salt and pepper noise.
Note, that the first dyadic scale of the DHT will be composed of coefficients computed from the signal correlated with the Haar Mother wavelet. At this level, salt&pepper noise will correlate very well, and will give you large wavelet co-efficients in the wavelet space. One can then simply null the large values out, and then perform an inverse Discrete Haar Wavelet Transform, (IDHT).
It is strange that you would be required to use the Discrete Haar Wavelet Transform, (over, say, the Stationary Wavelet Transform), because nulling co-efficients in the DWT space and inverse transforming can lead to aliasing. This effect might be small for the problem you describe however.
Another possibility would be to simply perform the DWT, identify the large wavelet co-efficients within the last half of the DWT transform, (corresponding to high correlations between SP noise and the Haar Mother Wavelet), identify those large co-efficients, and simply null them out in the time domain, without doing an inversion. This will get around the problem of aliasing in the inverse transform.
Answer: What's this for? How complex of a solution do you need? A simple solution (a moving average) or a complex solution?
There's a whole field dedicated to complex solutions: compressed sensing. It sounds like you're reconstructing from uniform projections. There's a PhD thesis called reconstructing from noisy random projections that might help you.
Any algorithm in compressed sensing is viable with wavelet transforms. Any function where the signal of interest is sparse is workable, since Candes proved (back in 2004) that any signal of mostly 0's is reconstructable.
I know for a fact that iterative soft thresholding works via some measurements, but I'm unsure about if noise is included in those measurements, so I tested it.
I used a 2D case, since that's what I had on hand. The noise is a uniform distribution from 0 to 25 (so +/- 5% of the maximum). The first graph is the results, and the second the reconstruction (only taking ~3 seconds on my machine).


YouTube on Chrome on MacBook Air uses excess CPU

Question: I have a problem with YouTube on Chrome on my MacBook Air. If I start YouTube the CPU goes to about 100% immediately. If I kill the YouTube (YT) tab the CPU stays at 100% for about 15 - 16 minutes then drops off to almost nothing. Activity Monitor shows me that it is the main Google Chrome process itself (not helper or renderer) using all the CPU and it has the Google icon next to it. I am running Mojave 10.14.3. This is a relatively new problem for me. I do not have this issue when I run YT on Safari.
Answer: Use the YouTube App instead to watch your video; it uses less CPU.
To open YouTube videos from  Chrome, right click the in the address bar, select open this link then choose an app icon.


Discretization of path integral and linear interpolations

Question: Consider the evaluation by discretization of the path integral $$\int e^{iS[x(t)]}\mathfrak{D}x(t),\quad S[x(t)]=\int_{t}^{t'}\left[\frac{m}{2}\dot{x}(\tau)^2-V(x(\tau))\right]d\tau.$$
One discretizes time with a partition $t_0,\dots, t_N$ with $t_k = t_0 + k\epsilon$ and $t_0=t$ and $t_N=t'$. A path $x(t)$ is discretized by taking the points $x_k = x(t_k)$ and connecting by straight lines.
Finally one has to discretize the action. My impression from some notes and texts is that one follows one "educated guess" procedure:

Replace derivatives by differences of neighboring points divided by lattice spacing $\epsilon$;
Replace integrals by Riemann sums;

So $S[x(t)]$ would be discretized as: $$S_N(x_0,\dots, x_N)=\sum_{k=1}^N \left[\frac{m}{2}\left(\dfrac{x_k-x_{k-1}}{\epsilon}\right)^2-V(x_k^\ast)\right]\epsilon$$
Where $x_k^\ast$ is some point along the straight line joining $x_{k-1}$ and $x_k$.
My question is: is this actually one educated guess or can the discretization be derived by applying the action functional $S$ to the polygonal path which linearly interpolates the points $(t_k,x_k)$?
For the free part it indeed works. If we apply $S$ to the linear interpolation we get the same as above. But for the potential part we end up with something like
$$\sum_{k=1}^N \int_{t_{k-1}}^{t_k} V\left(x_{k-1}+\frac{x_{k}-x_{k-1}}{\epsilon}(\tau-t_{k-1})\right)d\tau.$$
If one Taylor expands this, one gets something similar to the Riemann sum, but there are higher order corrections so that the "guessed" discretization would just be equal to first order.
So can the guessed discretizations be in some other way derived by applying the action functional to the linear interpolation path? If not, is there some other systematic procedure which gives it, or it is really just a guess?
Answer: In the end we take $\lim_{\epsilon\rightarrow 0}$. So first order matching is sufficient.
(Just a small comment but I don't have much reputation :))


Can I install Ubuntu on a brand new SSD from a flash drive?

Question: I'm thinking about buying a 30GB SSD for my laptop and want to know if it's possible to install Linux on it via flash drive with nothing else needing to be done. I just don't want to spend the money on it unless I know for sure I can do this.
Answer: Provided your computer supports booting from usb, yes you can to an ssd. If haven't booted from usb before you should try before purchasing.
Install unetbootin, create the live-usb, and the reboot the computer and press the appropriate F# key (varies from system to system) to enter either your BIOS, or your quick-boot menu.
If you enter the quick-boot menu, then choose your usb device, and it will try to boot from it.
If you enter the BIOS then you'll need to change your boot order to removable first, save your changes, and then exit the BIOS.
Answer: Should be able to fine.  I've never installed on laptop but several on desktop.
Answer: I've installed 12.04 on several 10GB drives with no problems by booting off of a flash drive to install it. As long as the laptop isn't too old and supports SATA--doesn't require a PATA (IDE) drive it should work fine.


Eclipse RCP: Add required plugins automatically to feature

Question: I find that Run Configurations has a "powerful" button on the "Plug-ins" tab. It's the "Add Required Plugins" button. When I deselect all, and then tick on my plugins on Workspace, and click this button, it helps me to include a good dependencies (minimum, required plugins) list, ready to run (validate successfully).
Now I have a product, feature-based. I already add my plugins to that feature. But it's not able to run (missing constraint, etc.)
How can I add dependencies to my feature in the "Plug-ins and Fragments" editor? Because when I click "Synchronize" in the .product file, a new collection of dependencies is generated based on my feature.xml which usually doesn't have enough plugins to run. It's very hard to add one-by-one, if we have a screencapture of the minimum, required plugins list as I said above.
Button "Add required" on Dependencies tab of .product file is not helpful in this case.
Thank you in advance!
Answer: Eclipse offers to initialize a feature using a given launch configuration. (The dialog after File-New.. -Feature)
You could create a new feature,
choose the launch-configuration,
open the resulting 'feature.xml' as text (Context menu/Open with),
copy the contents of the require section into your old feature,
delete the new Feature again.
(There has to be a better/more proper way to do this)


What is the practice regimen for the pro StarCraft 2 player?

Question: I'm wondering how pro StarCraft 2 players practice.  I mean if compared to something like a physical sport there might be some calisthenic, run some drills, etc.  It seems like one might also want to re-run certain engagements over and over again (how would somebody do that?) like drills.
Comment: Only doing that of their lives. Nah just trolling. But I heard some of them do play up to 12/14h a day
Comment: I don't have enough info to make a proper answer, but pros do many things similar to pro athletes: practice an awful lot, do specialized types of gameplay to focus on certain skills, research their opponents and the metagame, watch game videos, and have coaches that help them train and plug holes in their game.
Comment: Fun question! Mods should put this one out on Twitter see if we can get someone knowledgeable in on this.
Answer: I never considered pro-gaming myself or know anyone closely who live of it, but since I watch (maybe waaaay too many) videos, interviews and listen to podcasts (mainly State of the Game) I'd like to give some ideas around training in video games, especially StarCraft.
First of all: Stay healthy
Whenever a progamer gets asked what is important besides playing huge amounts of game he states something like your body is very important, you need to be fit to be able to think fast, play fast and grind endless games. As far as I know, nearly every player in e-sports does some workouts or runs to stay in shape, e.g. the guys from Evil Genius go to the gym and lift weights regularly (Geoff stated this in some SotG episode).
Youtube video: "Evil Geniuses: Bench Press"
Training houses
Especially (but not only) in South Korea most (all?) of the teams have their own training house. It makes things much easier when you have an environment where you can focus at your work with other people that do the same job. Also it is important to have someone around you can talk to if you have some problems, discuss ideas and test things. Usually they also have a dedicated coach who helps with certain problems, keeps an eye on special people and all this - like its known from every other professional sport.
Although specific methods may alter from team to team.
I heard in the oGs-TL house players have an house-intern league: Everyone has to play almost everyone else once a day. This not only gives you motivation since you want to improve your position but playing many different opponents gives you some wider vision and experience than only training over and over again against one specific person and matchup.
Back in November 2010, Giantbomb.com made a Video tour through the oGs-TL training house and also got some players and the oGs-coach for some interviews. For me its pretty interesting what they say about training and life there.
I think most team-houses have more or less strict schedules when players have to get up, hours to practice and relax and workout. At least 8-10 hours training each day should be really common, maybe it goes up to 15-16 hours before important events for some players.
Training at home
This should be the case for most American and European players.
They usually live on their own and make their own schedules without a coach or sth. The training is different for everybody. I consider every pro player also has some "closer" training partners for each match-up to discuss and try out certain strategies/builds, even if he is not in a team (White-Ra).

Methods

Laddering - grind as many ladder games as possible.
This gives a wide variety of opponents and strategies, especially some cheesy plays and gimmick tactics your teammates maybe never consider. It also helps to keep up/improve mechanics.
Test/Improve Build-orders
It can be done against computer opponents, in custom maps (YABOT anyone?) or against practice partners. It is purely time dedicated to make a build perfect for a strong early/midgame or against certain cheeses/all-ins.
Special Preparation
Before important events or matches where they know their rival in advance, players most of the time concentrate on the enemies styles. They analyze replays, think of ways to encounter the playstyle and maybe abuse it. Commonly one of the training partners tries to play the same way as the opponent so you can practice especially against that.

I heard in the training houses of Brood-War teams they usually had one coach for each race or even match-up. Coaches were also there to create new strategies/build and teach them to the player so he could focus on making the execution perfect.
Artosis made quite a couple tours through pro gaming houses and uploaded them to youtube - if you're really interested also watch some interviews with players and coaches.


Can I apply for a Ph.D. position with TOEFL iBT score 86 with writing score 23 while the university want total score 90 with writing 21?

Question: I am going to apply to a university in New Zealand where the university language requirement is the thing that I mentioned in the question. There are other language tests, but I took TOEFL iBT. I have 15 research articles, 7 of them published in high-ranked international journals, and have more than 10 years of research experience. The university does not want to secure a supervisor before submitting the documents, and they choose a supervisor for the candidates. I sent an email to the higher education department, but they just sent me a link containing the Ph.D. requirements that I have already studied. Can I submit the documents to compete for a Ph.D. position? My friends said try your chance and if you have good research background they might give you a position. A friend of mine who is an associate professor in Sweden says it is ok, but I do not know what to do.
Comment: @astronat the application fee, if there's one.
Comment: Just try, and the worst thing that can happen is that they reject your application.
Comment: With 10 yrs research experience and 7 publications in high-ranked journals as you put it, have you considered prospect of PhD by Publication (retrospective route)
Comment: What do you have to lose?
Comment: Thank you very much for your answer.
Comment: That's a good idea. I've never thought about this so far. Thank's a lot!
Comment: You could try asking the institution.
Comment: I'm voting to close this question because it's too specific to apply to other people.
Answer: You can definitely apply. They may just reject your application because you formally don't satisfy the criteria but in this case I would consider that unlikely. Both the particular department you apply to and the university administration want candidates who speak good English but for the department 'almost passed' is probably just as good as 'actually passed' for the language requirement. They care mostly about your academic skills and credentials.
If your application goes to the central administration first, there is a chance it won't even be forwarded to the department and you will be rejected outright. If the department gets your application and they want to hire you they still need to convince administration that you are a good candidate inspite of the language issue but that shouldn't be a big problem.
Comment: I really appreciate your answer. It was thorough and eye-opening about what happens if central administration gets our application or the department gets them first.
Answer: Yes, you can certainly apply for the Ph.D. position even if you haven't met the specific TOEFL score requirement. There is still a possibility of admission, especially if a professor is interested in your application and provides a supportive letter. Additionally, some universities may conduct interviews to assess your language skills. So, it is possible to be considered for admission, and your friend's suggestion is valid.
Comment: Thank you very much for your helpful comment.
Answer: You most definitely should apply. As @quarague rightly said in their answer, though,

If your application goes to the central administration first, there is a chance it won't even be forwarded to the department and you will be rejected outright.

A time-tested method to prevent this from happening is to tune your application to the research interests of some of the faculty -- and to contact them directly. Doing so, put yourself in their shoes: what a faculty needs is a graduate student enthusiastic about their research and having a sufficiently strong background (which you probably have). If some of the faculty get(s) interested in you, they will make sure that your application receives full consideration, no matter what the grades.
I know cases where this strategy worked.
Wish you luck!
Comment: thank you very much for your useful advice.
Answer: Just to provide a different perspective, in my department in the US, I know of a professor who couldn't get the grad school to budge and admit someone who didn't pass the English requirements.
Different country, probably a different field, so I recommend you get in touch with the department to learn if it is even within their power to admit someone that doesn't meet the requirements
Comment: Thank you very much for your comment.


How to do performance testing of dynamic website?

Question: I want to check a weather data is rendered in a page or not dynamically when page is loaded in html.Also wanted to know weather data that has appended dynamically is valid or not.Wanted to know how can i check its performance and also any tool that  help in performing this task.
Answer: The question seems to imply that you need to check whether the page is correct during the performance test.  There is a price to be paid for checking correctness during a performance test:

these tools are optimized for performance testing rather than functional testing, and so you may have to go through more effort to check a page's correctness than you would in a functional test using something like JUnit
checking correctness will require your test machine(s) to work harder, so you may need to run the test on more machines in order to generate enough load

Here are some other options to consider:

Make the performance test and the functional test separate tests.  Use a load-testing tool for the performance test, and something like JUnit for the functional test.
Check the functional part by hand while the performance test is running.  This is what I normally do.
Answer: In fact any load testing tool has validations and assertions. If you're looking for free and open source solution the most promising tools as for now are:

Gatling
Grinder
Tsung
Apache JMeter

You can check out Open Source Load Testing Tools: Which One Should You Use?, it highlights main features of aforementioned load testing tools, contains sample demo script and results and ends with comparison matrix.


Does using a macbook with an external monitor damage the health of the battery?

Question: I have an (oldish) MacBook Pro that I use with an external monitor, which requires that the MBP power adapter be plugged in all the time. Does that damage the health of the battery? I ask because my battery, replaced about a year ago, will now hold almost no charge after being used almost exclusively with the external monitor during working hours and plugged in all that time.
Comment: Welcome to Ask Different! [This answer](http://apple.stackexchange.com/a/31462/7749) might help you out, but it doesn't tackle any issues specific to external monitors.
Answer: While the external monitor itself is not the cause of the 'weakened' battery, leaving your MacBook Pro on AC power all of the time will definitely affect the battery's performance.  It is essentially under a constant state of charging, even though this is regulated by the charging circuit, which will eventually cause the battery's chemistry to begin to break down.
Current batteries will typically last the longest when used regularly, but not completely discharged with each use.
Comment: Recalling that using an external monitor **requires** that the MBP be on AC power, what should I do when I get my next MBP? Simply not use the external monitor part of the time and run down the battery? Or run down the battery at night away from the monitor? Or something else? I currently use the monitor all the time, 5 days a week, while at work.
Comment: @jst u can install insomniaX to turn on your macbook while lid closed to use external display..!!


What is an any % speed run in Diablo 2?

Question: I know what speed runs are, but what does 'any %' mean when speedrunning Diablo 2?
Answer: While I haven't played Diablo 2, I can tell you any% speedruns are speedruns with the goal of finishing the game as fast as possible, while allowing the player to ignore side content. The percent symbol refers to the % of activities completed in the game - in this case it refers to not completing side activities in the speedrun. Other speedrunners attempt to complete all activities available in the game, known as a 100% Speedrun.
Comment: "Any%" without qualifiers usually also means all (or great most) glitches and skips are allowed. So you're free to ignore a lot of the "main" content as well, as long as you're able to reach the end of the game. In case of multiple endings, any is OK, "bad ending" too.
Comment: Depending on the game, there are also 0% (or low %) runs, in which you must avoid as much content as possible. Most notably are Metroid games, where collecting upgrades must be avoided for a low % run.
Comment: For some games, there's also low%, which is basically "complete the game, but do as little as possible." For example, low% in *Super Mario Odyssey* (on version 1.0, with 2 player mode allowed) means "Complete the game with only three captures." (It's three because so far, nobody has figured out how to do it in two.)
Comment: @Nolonar Yeah, Metroid games are probably the best example of low% speedrun games out there due to how notoriously rife with sequence breaks they are. Fusion even allows for a 0% speedrun because it does not count mandatory upgrades towards completion percentage and you can sequence-break past the first missile pickup (which is otherwise functionally a forced pickup).
Comment: *[Comments Removed]* - The discussion regarding the contested edit has moved to [this meta](//meta.arqade.com/q/15627/28182) - the comments that sparked that meta have been [moved to chat](//chat.stackexchange.com/rooms/120251) for posterity.
Answer: You can see the rules and descriptions specifically for diablo 2 here https://www.speedrun.com/d2lod (press 'view rules' button)
Any% in d2 means that the timer starts on character creation of a lvl 1 Char in Act 1 and ends when Baal dies within the category difficulty (normal, nightmare, hell).
Answer: Generally, as @PausePause has said, Any% (without any qualifiers) involves using "any means necessary" to "complete the game" as quickly as possible - the quotations are there because what exactly those terms entail vary from game to game, and is generally agreed upon by the speed-running community of the individual game. The terms for Diablo 2 (As @jstq has provided) is a relatively uncontroversial example.
Typically, "completing the game" means defeating the final boss or reaching the end credits screen, and "any means necessary" allows for any glitches, bugs and exploits (AFAIK cheat codes are generally, but not always, disallowed).
This very permissive definition often allows for strange exploits that reach the end screen while skipping pretty much the entire game to qualify - search for "Super Mario Bros. 3 any%" for an example. Diablo 2 however does not seem to be one of those cases.
Also, do note that any% does not ban players from completing side activities - in fact, quite frequently speedrunners will go through technically unnecessary content if time spent playing said content can be offset elsewhere by whatever it unlocks (e.g. obtaining a fast vehicle)
Comment: Because in most cases, cheat codes are explicitly cheats, as in, it is clear that they are intended to be cheats. In the case of glitches, the definition is incredibly vague, and it is almost imposible to draw a hard line. Even for games which do have glitchless categories, the definition of glitchless is usually very arbitrary (decided by the community) because you can't know what is and isn't intended. Furthermore, some glitches are so omnipresent in a game that you need to make an active (sometimes ridiculous) effort to avoid them (ex: Bunnyhopping in many games)
Comment: @KaitoKid: In my experience, glitchless categories only even *exist* when the glitches that have been found are so overwhelmingly game-breaking that you end up with a completely different route if you use them. This is usually reserved for more dramatic glitches like wrong-warps, but for games like *Portal* and *Superliminal*, it sometimes just comes down to "don't go out of bounds" (because in those games, going out of bounds lets you skip 80-90% of the game).
Comment: @TylerH it's going to depend on the game. There's gray area in what "cheats" are truly cheating or part of the game. Is using the warp zone in Mario cheating? It doesn't really matter. All that matters is that everyone within a category follows the same rules. Is using a "god mode" cheat in an FPS cheating? Again, it doesn't matter so long as everyone in the category follows the same rules. -- According to speedrun.com, Any% allows warp pipes and warpless doesn't, just for reference. (https://www.speedrun.com/smb1)
Comment: Why is it that cheat codes are disallowed but glitches, bugs, and exploits are allowed? If you aren't supposed to cheat, then wouldn't using "unintended" cheats still be... cheating?
Comment: Hollow Knight's most popular category is "Any% No Major Glitches". This still allows a variety of skips, using offensive spells to extend jump range, or damage from enemies to reach otherwise unreachable places, and display mastery of the game mechanics. "All glitches" instead corrupts the world map generating a shortcut to one of the three dreamers to kill it three times through glitching save mechanics,and turn the final boss room into an environmental death trap for said final boss.
Answer: "Any%" for any game is generally defined as "reach the end credits screen without using cheat codes." Each community, such as Twin Galaxies, speedrun.com, Speed Runs Live, TAS videos, Speed Demo Archives, Awesome Games Done Quick, et al, will define their own set of rules, with at least TAS being a weird outlier compared to other communities.
For example, TAS (Tool Assisted Speedruns) allows some console commands, input-scripting tools for mouse and keyboard input, segmented speed runs (recording each section of the game over and over again for best results), any game glitches, and frame-counted timings so the run doesn't have to be played at 100% speed. Notably, TAS does not allow New Game+ content, if any such content is applicable to a game.
Other communities may only count RTA (Real Time Attacks), not segmented runs, may allow NG+ content or mods, or may allow (or not) certain console commands, glitches, frame rate limits, and more. There may also be different categories, such as "any%", "any% glitchless" (no intentional glitching allowed), etc, even within a single community.
In addition, each difficulty level is considered its own "any%" category, such as "any% normal" versus "any% hell". This means that you'll find different times for different difficulties, and all of them may be simultaneously a world record, despite having wildly different times.
In other words, there is not precisely one "any%" for Diablo 2, but instead a couple of dozen various types based on community rules and different categories within each community. The TAS run is only 22 minutes long, while most RTAs appear to be around the 1 hour, 12 minute mark. They are all perfectly valid in their own community's rules, even if they wouldn't be accepted elsewhere.
That's the beauty of speed runs. There's something out there for almost everyone, from "casual" RTA to hypercompetitive TAS, and everything in between. Some communities might even allow "joke%" runs, where the objective is to reach some arbitrary condition (usually not completion, but something absurd like "collect 100 buckets").
Also, there's tangentially related speed runs, like "low%", where every item you pick up, even currency, can count against you; the goal is to reach the end credits with the absolute minimum amount of pickups. These are interesting because a new, longer run can be the record if you eliminate a single item from a faster, but heavier, run.
So, in conclusion, what is "any%"? It's whatever the community you're playing with, or watching, agrees that it is, and there are different, conflicting versions of what counts for an any% run. It's up to you to decide what you consider a legitimate any% run community. You may also find people who speed run by their own rules and are not necessarily part of a community, perhaps because nobody else wants to play by those rules. Speed runs are not about notoriety, so much as it is about having fun. You get to decide what counts as fun or not.
Comment: And apparently I've speed run my fastest downvote with this answer. And no comment, either. If anyone cares to explain why this answer is so bad, I'd appreciate it.
Comment: TAS does not typically allow console commands, and typically does "allow" NG+ content (more specifically, TAS runs, like every other "type" of run, will specify whether or not they are NG+ runs. TAS, like segmented/RTA/etc., isn't a single category in itself, it's a type of run that is endlessly subcategorized). Also, it's extremely rare for a community to outright reject an entire category as invalid, though there have been exceptions (e.g., Twin Galaxies vs. glitches drama).
Answer: The "Any %" category means that the final score of the speedrun is judged entirely based on the finishing time regardless of what was done. This is in contrast to a "Low %" speed run, where a low % actually trumps a lower speed.
This is especially true in the speedrun records of Zelda: The Twilight Princess.  You can see that the Any % record is a little less than 3 hours but the Low % record is a ridiculous 24+ hours.
This video explains why the low% is so long, and it involves doing something really bizarre for many hours to skip a significant part of the game.

What is an any % speed run in Diablo 2?


What images to train on when discriminating against a certain class

Question: I am building an image classifier that discriminates against a certain class. As a toy example, let's say the classifier checks if the image is a hotdog or not (1 or 0). My question is what images would I be using to train on the 0 (not hotdog) class? Should I just use random objects or is there a more sensible way to go about this? Thanks
Answer: Think about the context in which you want to run your classifier later on. Will you want to extract still-usable food from garbage (so you can, say, turn it into livestock feed)? Then get a lot of garbage, separate it out and train your classifier. Do you want to automatically distinguish hot dogs from hamburgers and cheeseburgers? Then train it against such images.
Comment: Of course you can train your classifier against whatever labeled images you have. If you simply don't have a particular class of images (e.g., animals), then your trained classifier simply won't be as good at distinguishing hot dogs against such images later on. I fully appreciate that large amounts of labeled images are often not available or expensive. My answer was intended more to address where one should invest scarce resources in collecting training data in the first place. By all means use all training images you can get.
Comment: Hello, Stephan, What if there are many kinds of object on the negative side? and I can't good model all objects. as I collect more and more negative data, the data set become bigger and bigger, I have to increase the positive data set, but it's very hard to do that. Is there a better approach?


python selenium, find out when a download has completed?

Question: I've used selenium to initiate a download. After the download is complete, certain actions need to be taken, is there any simple method to find out when a download has complete? (I am using the FireFox driver)
Comment: with chrome, to monitor the download progress, just parse the `chrome://downloads` page. see also [How best to test file download links using Selenium](https://sqa.stackexchange.com/a/27342/57619)
Answer: I came across this problem recently. I was downloading multiple files at once and had to build in a way to timeout if the downloads failed.
The code checks the filenames in some download directory every second and exits once they are complete or if it takes longer than 20 seconds to finish. The returned download time was used to check if the downloads were successful or if it timed out.
import time
import os

def download_wait(path_to_downloads):
    seconds = 0
    dl_wait = True
    while dl_wait and seconds < 20:
        time.sleep(1)
        dl_wait = False
        for fname in os.listdir(path_to_downloads):
            if fname.endswith('.crdownload'):
                dl_wait = True
        seconds += 1
    return seconds

I believe that this only works with chrome files as they end with the .crdownload extension. There may be a similar way to check in other browsers.
Edit: I recently changed the way that I use this function for times that .crdownload does not appear as the extension. Essentially this just waits for the correct number of files as well.
def download_wait(directory, timeout, nfiles=None):
    """
    Wait for downloads to finish with a specified timeout.

    Args
    ----
    directory : str
        The path to the folder where the files will be downloaded.
    timeout : int
        How many seconds to wait until timing out.
    nfiles : int, defaults to None
        If provided, also wait for the expected number of files.

    """
    seconds = 0
    dl_wait = True
    while dl_wait and seconds < timeout:
        time.sleep(1)
        dl_wait = False
        files = os.listdir(directory)
        if nfiles and len(files) != nfiles:
            dl_wait = True

        for fname in files:
            if fname.endswith('.crdownload'):
                dl_wait = True

        seconds += 1
    return seconds

Comment: Way better than the accepted answer (that actually provides no solution at all).
Comment: This simply solved my problems! Agreed, much better than accepted!
Comment: Doesn't work anymore. Chrome no longer uses *.crdownload temporary files. It now uses some crazy temporary names for 'safety reasons'.
Answer: There is no built-in to selenium way to wait for the download to be completed.

The general idea here would be to wait until a file would appear in your "Downloads" directory.
This might either be achieved by looping over and over again checking for file existence:

Check and wait until a file exists to read it

Or, by using things like watchdog to monitor a directory:

How to watch a directory for changes?
Monitoring contents of files/directories?
Answer: import os
import time

def latest_download_file():
      path = r'Downloads folder file path'
      os.chdir(path)
      files = sorted(os.listdir(os.getcwd()), key=os.path.getmtime)
      newest = files[-1]

      return newest

fileends = "crdownload"
while "crdownload" == fileends:
    time.sleep(1)
    newest_file = latest_download_file()
    if "crdownload" in newest_file:
        fileends = "crdownload"
    else:
        fileends = "none"

This is a combination of a few solutions. I didn't like that I had to scan the entire downloads folder for a file ending in "crdownload". This code implements a function that pulls the newest file in downloads folder. Then it simply checks if that file is still being downloaded. Used it for a Selenium tool I am building worked very well.
Comment: I thinked the same some time ago, is nice.
Answer: I know its too late for the answer, though would like to share a hack for future readers.
You can create a thread say thread1 from main thread and initiate your download here.
Now, create some another thread, say thread2 and in there ,let it wait till thread1 completes using join() method.Now here,you can continue your flow of execution after download completes.
Still make sure you dont initiate your download using selenium, instead extract the link using selenium and use requests module to download.
 Download using requests module
For eg:
def downloadit():
     #download code here

def after_dwn():
     dwn_thread.join()           #waits till thread1 has completed executing
     #next chunk of code after download, goes here

dwn_thread = threading.Thread(target=downloadit)
dwn_thread.start()

metadata_thread = threading.Thread(target=after_dwn)
metadata_thread.start()

Comment: If you don't need authentication fine. But most cases we need....
Answer: As answered before, there is no native way to check if download is finished. So here is a helper function that does the job for Firefox and Chrome. One trick is to clear the temp download folder before start a new download. Also, use native pathlib for cross-platform usage.
from pathlib import Path

def is_download_finished(temp_folder):
    firefox_temp_file = sorted(Path(temp_folder).glob('*.part'))
    chrome_temp_file = sorted(Path(temp_folder).glob('*.crdownload'))
    downloaded_files = sorted(Path(temp_folder).glob('*.*'))
    if (len(firefox_temp_file) == 0) and \
       (len(chrome_temp_file) == 0) and \
       (len(downloaded_files) >= 1):
        return True
    else:
        return False

Comment: Good one, didn't think about it in this way. Works great
Answer: Check for "Unconfirmed" key word in file name in download directory:
# wait for download complete
wait = True
while(wait==True):
    for fname in os.listdir('\path\to\download directory'):
        if ('Unconfirmed') in fname:
            print('downloading files ...')
            time.sleep(10)
        else:
            wait=False
print('finished downloading all files ...')

As soon as the the filed download is completed it exits the while loop.
Answer: TL;DR

poll for the existence of the file
poll for non-zero filesize of that file

Observed Behaviour
I noticed that there can be a lag between a downloaded file appearing in the filesystem and the contents of that file being fully written, especially noticeable with large files.
I did some experimenting, using stat_result from os.stat() on Linux, and found the following,

when a file is first opened for writing

st_size == 0
st_atime == st_mtime == st_ctime

while data is being written to the file

st_size == 0
st_atime == st_mtime == st_ctime

once the writing is complete and the file is closed

st_size > 0
st_atime < st_mtime == st_ctime

Implementation

Poll for a file using glob with a configurable timeout

This is useful when you don't know exactly what the name of the downloaded file will be

Poll for the filesize of a specific file to be above a threshold

import glob
import polling2
import os

def poll_for_file_glob(file_glob: str, step: int=1, timeout: int=20):
    try:
        polling2.poll(lambda: len(glob.glob(file_glob)), step=step, timeout=timeout)
    except polling2.TimeoutException:
        raise RuntimeError(f"Unable to find file matching glob '{file_glob}'")
    return glob.glob(file_glob)[0]

def poll_for_file_size(file_path: str, size_threshold: int=0, step: int=1, timeout: int=20):
    try:
        polling2.poll(lambda: os.stat(file_path).st_size > size_threshold, step=step, timeout=timeout)
    except polling2.TimeoutException:
        file_size = os.stat(file_path).st_size
        raise RuntimeError(f"File '{file_path}' has size {file_size}, which is not larger than threshold {size_threshold}")
    return os.stat(file_path).st_size

You might use these functions like this,
try:
  file_glob = "file_*.csv"
  file_path = poll_for_file_glob(file_glob=file_glob)
  file_size = poll_for_file_size(file_path=file_path)
except:
  print(f"Problem polling for file matching '{file_glob}'")
else:
  print(f"File '{file_path}' ({file_size}B) is ready")

Comment: Stumbled on this answer as I am having the same issues, noticing an incosistent delay sometimes when the code seems to run faster than the system can write the file or something. Will try and implement this in my code and report back. The other answers do not seem to deal with this problem
Answer: x1=0
while x1==0:
    count=0
    li = os.listdir("directorypath")
    for x1 in li:
        if x1.endswith(".crdownload"):
             count = count+1
    if count==0:
        x1=1
    else:
        x1=0

This works if you are trying to check if a set of files(more than one) have finished downloading.
Answer: this worked for me:
fileends = "crdownload"
while "crdownload" in fileends:
    sleep(1)
    for fname in os.listdir(some_path):
        print(fname)
        if "crdownload" in fname:
            fileends = "crdownload"
        else:
            fileends = "None"

Answer: If using Selenium and Chrome, you can write a custom wait condition such as:
class file_has_been_downloaded(object):
def __init__(self, dir, number):
    self.dir = dir
    self.number = number

def __call__(self, driver):
    print(count_files(dir), '->', self.number)
    return count_files(dir) > self.number

The function count_files just verifies that the file has been added to the folder
def count_files(direct):
for root, dirs, files in os.walk(direct):
    return len(list(f for f in files if f.startswith('MyPrefix') and (
            not f.endswith('.crdownload')) ))

Then to implement this in your code:
files = count_files(dir)
<< copy the file. Possibly use shutil >>
WebDriverWait(driver, 30).until(file_has_been_downloaded(dir, files))

Answer: I got a better one though:
So redirect the function that starts the download. e.g. download_function= lambda: element.click()
than check number of files in directory and wait for a new file that doesnt have the download extension. After that rename it. (can be change to move the file instead of renaming it in the same directory)
def save_download(self, directory, download_function, new_name, timeout=30):
    """
    Download a file and rename it
    :param directory: download location that is set
    :param download_function: function to start download
    :param new_name: the name that the new download gets
    :param timeout: number of seconds to wait for download
    :return: path to downloaded file
    """
    self.logger.info("Downloading " + new_name)
    files_start = os.listdir(directory)
    download_function()
    wait = True
    i = 0
    while (wait or len(os.listdir(directory)) == len(files_start)) and i < timeout * 2:
        sleep(0.5)
        wait = False
        for file_name in os.listdir(directory):
            if file_name.endswith('.crdownload'):
                wait = True
    if i == timeout * 2:
        self.logger.warning("Documents not downloaded")
        raise TimeoutError("File not downloaded")
    else:
        self.logger.info("Downloading done")
        new_file = [name for name in os.listdir(directory) if name not in files_start][0]
        self.logger.info("New file found renaming " + new_file + " to " + new_name)
        while not os.access(directory + r"\\" + new_file, os.W_OK):
            sleep(0.5)
            self.logger.info("Waiting for write permission")
        os.rename(directory + "\\" + new_file, directory + "\\" + new_name)
        return directory + "\\" + new_file

Comment: I like the look of this. A little more complex than some other answers, but looks to be more robust. To adapt this for Firefox, look for files ending with .part instead of .crdownload
It might be worth using os.path.join instead of hardcoding "\\" to avoid the Windows vs Unix slash direction issue.
Comment: There's a bug in your code. You never increment the value of i. So if a download fails it will get stuck in the i < timeout * 2 condition.
Comment: I also found that every download would timeout if in a previous execution the browser crashed before finishing the download leaving a leftover .crdownload file in the downloads folder.
Answer: With Chrome, files which have not finished downloading have the extension .crdownload. If you set your download directory properly, then you can wait until the file that you want no longer has this extension. In principle, this is not much different to waiting for file to exist (as suggested by alecxe) - but at least you can monitor progress in this way.
Answer: create a function that uses "requests" to get the file content and call that one, your program will not move forward unless the file is downloaded
import requests
from selenium import webdriver
driver = webdriver.Chrome()
# Open the website
driver.get(website_url_)

x = driver.find_element_by_partial_link_text('download')
y = x.get_attribute("href")
fc = requests.get(y)
fname = x.text
with open(fname, 'wb') as f:
    f.write(fc.content)

Answer: This is VERY SIMPLE and worked for me (and works fot any extention)
import os, glob and time (not truly needed)

# count how many files you have in Downloads folder before download

user = os.getlogin()
downloads_folder = (r"C:/Users/" + user + "/Downloads/")
files_path = os.path.join(downloads_folder, '*')
files = sorted(glob.iglob(files_path), key=os.path.getctime, reverse=True)
files_before_download = files

print(f'files before download: {len(files)}')
finished = False

# ...
# code
# to
# download
# file
# ...

# just for extra safety
time.sleep(0.5)

# wait for the download to finish if there is +1 file in Downloads folder
while not finished:
    files = sorted(glob.iglob(files_path), key=os.path.getctime, reverse=True)
    print(len(files))
    if (len(files) == len(files_before_download)) or (len(files) == (len(files_before_download)+2)):
        print('not finished')
        finished = False
    else:
        print('finished')
        finished = True

last_downloaded_file = files[0]

Comment: Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer).
Answer: well, what if you check the size of the file until it has x size? There must be an average (Too bored to buid code, build it. Ideas helps too)
Answer: Based on the answers:

download_dir = '~/Downloads'

def check_downloaded_file(previous_cant_of_files_in_dir):
    new_file_was_created = False

    def _check_downloaded_file(driver):
        global download_dir
        nonlocal new_file_was_created

        if previous_cant_of_files_in_dir < download_folder_files_cant():
            new_file_was_created = True

        return (
            new_file_was_created
            and not last_downloaded_file().endswith('.crdownload')
        )

    return _check_downloaded_file

def download_folder_files_cant():
    global download_dir
    return len(glob.glob(os.path.join(os.getcwd(), f"{download_dir}/*")))

def do_and_wait_download(driver, todo, timeout=15):
    global download_dir

    previous_cant_of_files_in_dir = download_folder_files_cant()
    todo(driver)
    WebDriverWait(driver, timeout).until(
        check_downloaded_file(previous_cant_of_files_in_dir)
    )

def click_element(driver, find_by, value):
    driver.find_element(find_by, value).click()

def click_link_and_wait_download(driver, find_by, value, timeout=15):
    return do_and_wait_download(
        driver,
        lambda d: click_element(d, find_by, value),
        timeout
    )

Use as:
# If is just a click
click_link_and_wait_download(driver, By.ID, 'elementLink')

# If you extract the URL from element
url = driver.find_element(By.ID, "downloadButton").get_attribute('href')
do_and_wait_download(driver, lambda d: d.get(url))

Answer: If you know anything about the download filename (*.zip?), it is nicer to watch for future state than for crdownload. In my case I had to run this in a loop 700 times.
import glob
download_glob = r'C:\Users\user\Downloads\YourDownload*.zip'

def download_wait(dir_file_glob, expected_num_files, timeout=300):
    start_time = time.time()
    while True:
        if (len(glob.glob(dir_file_glob)) - expected_num_files) >= 0:
            return
        time.sleep(5)
        if time.time() - start_time > timeout:
            raise TimeoutError('No Download Found')

n_download_files = len(glob.glob(download_glob))
# activate download here
download_wait(download_glob, n_download_files+1)

Answer: The only solution that worked for me is:
def get_non_temp_len(download_dir):
    non_temp_files = [i for i in os.listdir(download_dir) if not (i.endswith('.tmp') or i.endswith('.crdownload'))]
    return len(non_temp_files)

download_dir = 'your/download/dir'
original_count = get_non_temp_len(download_dir) # get the file count at the start

# do your selenium stuff

while original_count == get_non_temp_len(download_dir):
    time.sleep(.5) # wait for file count to change

driver.quit()

Credits do @LamerLink on this post


Controversy, controversial -- Japanese equivalents?

Question: Are there good Japanese equivalents for controversial ("Trump is a controversial figure") and controversy ("The high school's new admission policy caused a huge controversy among both parents and students.")?  I see words like 問題, 議論, and 論争 in the dictionary but I'm not sure they capture the English meaning and nuance.
Comment: @KarlKnechtel That's actually a good one, it's just that 炎上 is relatively slang-ish, and isn't exactly "controversial". Something controversial would have people on both sides, but something 炎上 might be so bad that everyone is criticizing. It's more like "getting in trouble" than "striking up controversy". But I can see how it could be used in some contexts.
Comment: I don't know that I could write a proper answer, but how about 炎上する used attributively?
Answer: I'd suggest 物議を醸す as a relative clause, as in トランプは物議を醸す政治家 (Trump is a controversial political figure).
物議を醸す is an established saying, literally meaning "to brew controversy"
問題 simply means a problem, like a problem with car or a problem on a test, and has nothing to do with controversy.
議論 is simply discussion, no overtone on the discussion being "controversial". It can be a friendly 議論.
論争, or alternatively 争論, means an argument, aka a heated discussion where people argue over an issue.
All these three words are nouns, and cannot be used directly as adjectives. If you say 論争な事情 people will like be confused what do you mean.
Other than the idiomatic 物議を醸す, you can, however, say 論争を引き起こす, like 論争を引き起こすニュース, literally "News that brings up argument", aka "controversial news"
Comment: It might help to add 物議 is rarely (if ever) used predicatively like 〜は物議だ. It's almost always used as an object of some verb like 醸す, 呼ぶ, etc. By the way, 問題 is more adjective-like than the other nouns.


How can I  transfer my Terraria game from Windows to Ubuntu?

Question: I just dumped Windows because it broke on me and replaced it with Ubuntu. I was able to save the character and world files. Where do I put them to be able to use them on my new OS? I know Terraria runs on Ubuntu (am installing it now).
Comment: Terraria doesn't run on Ubuntu, so without knowing how you get around that technicality (Wine, most likely?), it's difficult to say.
Comment: @lunboks my Terraria (via Steam) runs without a hitch on Wine. http://appdb.winehq.org/objectManager.php?sClass=version&iId=24915
Answer: Since the only way to run Terraria on Ubuntu is through WINE as Ben Brocka and lunboks have suggested, I will answer your actual question, assuming that you are using WINE and if you are not, I would suggest that you revise your question to provide more information about your setup.
While I'm sure you knew this if you backed up your files, but to provide background for the answer, as per this question, the default behaviour is for saves to be in My Documents\My Games\Terraria\Players and worlds to be in My Documents\My Games\Terraria\Worlds as stated here.
You will want to put your character and world files in the paths mapped for My Documents\My Games\Terraria\Players and My Documents\My Games\Terraria\Worlds respectively. The default WINE behaviour if I read correctly is for My Documents to map to your home directory so it would be home/(user)/My Games/Terraria/Players and home/(user)/My Games/Terraria/Worlds for your respective username I believe. If you want and this is up to you, you can remap where My Documents maps to in wineconfig, but you will have to adjust where you put the save files accordingly.
Comment: Otherwise, if you need to configure something else it's in the .wine folder (/home/(user)/.wine/c_drive/.....)
Answer: Um... You don't need wine. Terraria works on Ubuntu now. There's a Steam for Ubuntu. You can do it through wine if you want but it plays a little slower. Also if you use Ubuntu's steam to install terraria you'll find your worlds in a different folder. /home/YOURNAME/.local/share/Terraria/ Replace YOURNAME with your username.
Answer: You've gotta use WINE, Terraria doesn't run on Ubuntu native. Here's a tutorial on making WINE work with it but I haven't done it myself. I wouldn't expect it to run perfectly but it's a start.


Predicting a cyclic target

Question: I'm familiar with using trigonometric functions to transform cyclic variables for use as features in training a model (most commonly hour of the day or month of the year); I'm now trying to figure out the best way of doing this for using these types of variables as the target for my model. (Imagine a model predicting the month when a particular event is most likely to occur, for instance). Neither using a strictly-increasing representation (so that January, 2018 is close to December, 2017 but very far from January, 2017) nor treating the month as a categorical variable is ideal, but the trigonometric encoding done for features requires both sin and cos parts to have a unique representation of each month, so using one of the two isn't a workable approach either.  Is there a better option that I'm missing?
Comment: You can still do the sin/cos trick, but use a bivariate model.
Answer: The relevant terminology is "multi-output" or "multi-target" regression/classification.  A survey article from a few years ago has some good discussion. This functionality is implemented in many packages (for instance, in sklearn (where it extends the functionality of other regressors, rather than being an independent implementation) and in R.
Comment: Keras' functional API also provides a good way to model multi-targets. See this post for a minimal example: https://datascience.stackexchange.com/a/64350/71442

Predicting a cyclic target


How to change the default validity length of a check in the US when emitting it?

Question: Checks issued by US banks are typically valid for 180 days, although it might vary depending on the state and the bank. When writing a check, how can I change its default validity length? I sometime would like to emit a check that is only cashable over the next 30 days.
Comment: I doubt that's possible, because it could be abused.  Someone could steal something by paying with a check that has a really short validity length.
Comment: @pacoverflow Sure, I guess that some note should be added on the check in this case to make the validity length explicit. How you quoted [here](http://money.stackexchange.com/a/39611/5656) there seem to be cases where noted are added when the validity length is different from 180 days.
Answer: It is up to you and your bank. See UCC Sec. 4-401:

An item is properly payable if it is authorized by the customer and is
  in accordance with any agreement between the customer and bank.

You need to talk to your bank about this, but generally banks protect themselves against various claims, including refusal to cash checks.
Checks that you give are a legal obligations to pay, and generally limiting the period doesn't limit your obligation. Even if the check becomes stale and the bank refuses to cash it - it keeps being your obligation to pay and may be enforced against you in the court of law.
Comment: @FranckDernoncourt you can sign a contract requiring the counterparty to cash the check within X days, otherwise your obligation to pay is void, but I doubt anyone would agree to that. Welcome to the US. Generally, if the check becomes stale - it is not your fault (i.e.: bounced check is not considered "bad check"), but you're still required to pay.
Comment: Thanks! Is there any way to put a time bound on the obligation to pay? It can be pretty inconvenient to have such lifetime obligations.
Answer: Many companies issue checks with "Not valid beyond 90 days" prominently printed on them. I don't know whether that's legally enforcable, but like "Unlawful to copy this key" for locksmiths it is a strong instruction to the banks that the "contract for payment" created by the check is not intended to be valid beyond that time.
Not all locksmiths respect other locksmiths enough to honor do-not-copy marks. (Don't get me started on that rant. "You won't like me when I'm angry.")
I don't know whether all banks respect other banks enough to honor expiration dates written on the check this way. But I have always assumed that most do.
I know there ARE strict limits on what kinds of modifications can be made by adding annotations to checks these days; that was one of the things banks demanded in exchange for processing checks more quickly than they used to. I don't know whether this one is actually meaningful, or considered only advisory. But that's the most likely path to investigate.


How does one write the name of a married female and spouse in a list of classmates?

Question: In a list of classmates, how is the name of a married female and spouse listed?  Is the female given name or her husband's given name written first?  How is the maiden name shown?
Comment: Umm... wouldn't you just give the name that they actually use? From the point of view of a class register, who cares what the husband's name is unless they have actually adopted it?
Comment: Well, you can put e.g. "Mary Smith (née Sanderson)".
Comment: There may be no "proper" way to do this, as you might irritate a few people with any scheme, but I've seen it done with the maiden name listed in parentheses before the adopted, married name.  This seems reasonable to me.
Comment: To clarify - this is a list of older graduates.  Most are married and the female graduates normally use their married name.  However, in a distribution list of graduates, they would more likely be known by their maiden name.  So, what is the proper way to show the maiden name?
Comment: Just saying Mrs. X Y ?
Answer: One term sometimes used is the French word 'née' (meaning 'born', literally, but referring to the maiden name in this context).  Hence:

Mrs Jane Smith (née Jones)
Mrs Cynthia Corning (née Stratton-Longbottom)

Etc.
I'm not sure whether 'Mrs' or 'Ms' is preferred when the context clearly shows that the lady is married.  I'm old-fashioned enough to think it should be 'Mrs', but modern style might use 'Ms'.  The referenced URL did not place brackets around the maiden name.
Also, in a list of classmates, the spouses would not not normally be given - the spouses were not, in general, part of the class.  However, if you are listing the people invited to an event, you can decide how to display both the names of those invited and the names that would have been known when they were in the class.  For example, you might have two columns, for example, the first listing one the 'Emily Post' approved forms, and the second listing the name that would have been used in class.  That might be too arid for the context in which the list is to be used, though.  You might list the class member's name, and then their spouse's name, if applicable:

Mrs Jane Smith (née Jones) and Mr John Smith
Mr Adam O'Hare and Mrs Susan O'Hare

This isn't the normal presentation, but the important information here is presumably the person who was in the class, and this shows that Jane Jones and Adam O'Hare were in the class but both are married.  It is self-consistent as presented, but you might omit the first "O'Hare", I suppose.
Comment: This is correct, though unless the list needed to be very formal, personally I wouldn't use "Mr", 'Mrs", or "Ms" at all - just *Jane Smith (née Jones)".
Answer: The Emily Post Institute recognizes the following forms:

Ms. Jane Smith and Mr. John Smith
  Jane and John Smith (informal)
  Ms. Jane Johnson and Mr. John Smith
  Drs. Jane and John Smith

Note that there is no informal form if the female uses her maiden name and that you should always use Ms. unless you know that Mrs. is preferred.
Also, the Emily Post Institute gives no formal guidance on whether or not to use the maiden name—however, it seems from various examples on their site that the husband's last name is preferred unless the wife has indicated otherwise.
Answer: What my school tends to do is include the woman's name, name she went by in school, graduation year (just to make sure the reader understands which one is the former student), and then the spouse's name. Eg:

Ms. Jane Smith (née Jones, '85) and Mr John Smith.

Another form I see them use is to insert the "Maiden name" right before the current last name. Eg:

Ms. Jane Jones Smith ('85) and Mr. John Smith

Here's some entries from my alma-mater's actual yearly report:

James '76 & Jill Jones '76 Deck
Michael & Cara Shimkus '84 Hall

In the first instance, it appears both husband and wife were students (probably a really sweet story there...), and in the second, just the wife.
Answer: Some same-sex couples are opting to change names these days.  If this causes a confusion, the (nee [birth name]) formulation is still apprpriate, but if the couple are male, you need to change the gender of the French:  (ne [birth name)  (omitting accents here).
Eric.


Should I tell my ex that he has a 3 year old son

Question: I found out I was pregnant when I was 20 and naive. I had been with two men a month apart. When I found out, I thought it was my current boyfriend who was the father.  I was blinded by emotions and ignorance to understand how pregnancy works at the time. I chose him. I rejected the "real" father multiple times telling him that he was not the father ( which is what I thought). Fast forward to now.. never did a paternity test. Until now. We did an ancestry test for fun. I found out the real father is the other man. I told my boyfriend and it broke him. Do I tell the ex? I want to... because he was so passionate about being a father and I feel I robbed him. He is still in the same town as us and works near my boyfriend. I feel the close proximity requires honesty from everyone. I feel it's best for my son. Honesty. Help me! Won't lying hurt my sons phsyche and development more than having "two dads"?
Answer: If it were me i would want to know that i had a child...also your child has the right to know who his real father is. It is better to have 2 loving fathers in his life then finding out years form now that you knowingly lied to him and kept his father away from him...
If you tell it now it will probably end up fine, wait to long and he might never trust you again after he finds out eventually.


Do resonant inductive coupling coils need to be on axis to transmit wireless power?

Question: I've recently become interested in Nikola Tesla's resonant inductive coupling method of wireless power transfer. I saw an experiment online and the resonant coils seemed to be on axis, or facing each other. I was just wondering if the coils can transmit power when perpendicular to each other.
Answer: To maximize the power transfer between two coils you want to maximizes the faction of flux from coil  1 that passes through coil 2 (parallel to the axis of symmetry). The coils might be coaxial or they might be wound on a loop of ferromagnetic material. If one coil were perpendicular (and centered on the other), the flux linkage would be zero.
Answer: Generally the coupling (mutual inductance) is maximized if the coils are coaxial.  This is related to the fact that, for a given separation, the field along the axis of a small coil or magnet is twice the field on its equatorial plane. The dipole-dipole interaction (which relates to small coils with relatively large separation) gives some insight into how the coupling can vary.  Interestingly, there are positions and angles where the coupling is exactly zero - which is sometimes a useful feature.
For two small coils at right angles, the coupling is maximized when the line joining their centers is at 45 degrees to either coil.


Lubricating squeaky European cabinet hinges

Question: Our kitchen cabinets are about 5 years old now and starting to squeak, some of them awfully. They have European-style hinges (KraftMaid is the cabinet brand and I guess these are Blum hinges). I'm an old hand with good old WD-40 and the trusty straw, but not these sorts of hinges. For the life of me, I can't cure the squeak. I have squirted WD in every crevice where I think there are moving parts, but the squeak persists. What am I missing here? Could someone point out where to stick the straw in these darn hinges, please? I hope disassembly isn't required to be able to get at the right spot in these hinges!
Answer: It may not be a matter of where, but of what. WD-40 isn't a great lubricant in some cases. It's very light and may not work on the nylon parts. It may also dissolve any actual grease that was present.
Maybe try something with Teflon, lithium, or silicone, or use basic 3-in-1 household oil.
Comment: I went with 3-in-1 initially but had trouble with drips on the vertical surfaces. I'll take a look at the other alternates you suggest.
Comment: Those hinges come off easily. You could lay them flat and put a single drop at the top and bottom of the articulation points. It doesn't take more than that. Put masking tape on the cabinet frame to mark the current position.


Guest Lecturer title

Question: I am IT Director of a Company and I'm regularly invited by Italian universities to do lectures on Innovation or Information Systems, usually 5/6 lectures per year. Can I claim University Guest Lecturer title in my CV?
Answer: I pretty strongly suggest that you don't claim a title of any kind unless it is formally conferred. That is, if you want your CV to be credible.
But there is a difference between "University Guest Lecturer" and "university guest lecturer". The first seems to be a title, but the latter is just descriptive. You can certainly describe what you do in a CV without making any claim to hold a position that the university hasn't actually conferred.
Caution is best, I think, in all such situations.
Comment: tl;dr: You can claim a title if and only if the university actually gives you a title.
Answer: A "lecturer" is usually considered an academic title. So if you are just giving an invited talk, that would usually be considered a seminar; if you are invited to teach an occasional 6-week long course, then maybe it could be justified to call yourself a "guest lecturer" for that period.
Whether or not you "can" do this is somewhat subjective. You do occasionally give lectures as a guest, so you are not technically lying. But I would suspect that if someone called you on this and you had to explain yourself, it would not look especially flattering.
Comment: Thx in effect i deliver Seminars so how i should call it? :)
Comment: If you regularly give seminars, you probably have contact to one or more members of that department. I would ask them. That way any questions about whether you correctly use that title probably never come up, and if they do, you have a perfectly reasonable answer.
Answer: Are your lecturing with a formal contract, or is it just a volunteer activity? Does your name appear on the course syllabus and on the university website?
If yes, that would fall into the case of "professore a contratto" (even if just for a part of a course), and I would endorse the translation as as guest lectures.
Otherwise, it would seem like an abuse of the title.

Guest Lecturer title


Removing Bearings From Headset

Question: I was servicing my headset on my Saracen Mantra Elite LSL 2019 but I couldn't remove the bearings, I don't know if there is a way to remove them that I don't know but I thought you were just supposed to pull them out.

Thanks
Comment: "just pull them out" may mean using a dedicated bearing puller or a cup remover. But I do not know what kind of bearings your headset uses.
Comment: Neither do I, I think they are cartridge Bearings
Comment: Use a pick to pull out the red plastic part which is a retainer for the bearing cone and race. It's a normal bearing race after you get the retaining ring off.
Comment: Does that get it out of the frame?
Comment: You can also remove the cups from the frame but you only do that if you wish to replace the entire headset assembly as the cups are pressed in. For a headset service, you only need to get to the bearing races. It is not a cartridge headset.
Comment: Thanks, I managed to get them out, thanks
Answer: According to 99Spokes, the Mantra SL is spec'd with a semi-integrated headset. In the S.H.I.S. naming system the upper headset is  ZS44.  This type features a pressed cup into the frame and into the cup a cartridge bearing is a slip fit (doesn't need to be pressed). The cup has a very shallow lip at the top that acts as a stop. Since the system adds very little stack to the head tube, it's known as Zero Stack (ZS).
Yes, the cartridge bearing should just be able to be plucked out by hand.  I wonder if you don't still have a dust seal still in place (I'm looking at the black ring around the perimeter) that is preventing you from removing the cartridge bearing. It looks to be a little too wide for an outer race of a cartridge bearing. The dust seal may sit in a groove machined into the cup so it may take a bit of work to free it from it's seat. Use a pick or small screw driver to remove it.  Take a look at the schematic for your headset. It's number 3 that I think is still in place and blocking the bearing removal.

Another possibility is that corrosion has somewhat cemented the bearing in the cup. Some penetrating fluid like WD40 may get it loose. Unless you plan on repacking the cartridge bearing with new grease, try to keep the penetrating fluid between the cup and the race. It's mostly solvent and will thin and remove grease should much get past the bearing seals.
Comment: Thanks, there was a small seal holding it in. Got them out easy, thanks

Removing Bearings From Headset


Site-specific folder redirection through group policy

Question: Suppose I have two sites - A and B - both with 5/5 Mbps WAN links that are connected via L2L VPN. Each Site is defined in AD Sites 'n Services with its own domain controllers, etc. The problem is that for folder redirection to work "well" I would ideally like the folder redirection to occur based on which site the user hails from - for example, if user in site A, folder redirection would work with a share on A. Or, if the user happens to move to B, the folders would redirect to a location on B. Finally, the storage servers responsible for A and B's redirection (the locations they are pointed to) would replicate. Is this type of functionality possible in Group Policy/AD? Or do I have to use a single "abstracted" share that can route to the appropriate, replicated store based on subnet?
Answer: You can do this one of two ways.
The way that I would recommend is as follows:

Create a DFS namespace for your shares, something like \\domain\users should do.
Add both servers to this DFS root.
Check the box so that clients prefer (or are required) to use a server located in their AD site. Yes, it's smart enough to determine this using subnets defined in AD Sites & Services
Set up replication between the two shares using DFS-R.
Make a GPO that redirects to \\domain\users and link it like you would any other OU. DFS is smart enough to refer them to the closest server based on info in AD Sites and Services.

The other way would be:

Set up DFR-R between the two servers, but don't add them to a namespace. This means the shares will be replicated, but won't share a common domain-based path.
You can link GPOs to sites, not just OUs. Link a GPO at each site that points to \\server1\users for site 1 and like one that points to \\server2\users at site 2.

I prefer the first choice, because using a DFS namespace makes file server upgrades a breeze and it allows you to only have to maintain one GPO, while still allowing users that might roam to either site to dynamically map whatever server is closest.
Either way, DFS (in whether it's replication, namespaces, or both) should be involved.
Comment: Awesome, thanks very much for the dfs namespace suggestion
Comment: I'm sure you're aware Microsoft [does not support](http://blogs.technet.com/b/askds/archive/2010/09/01/microsoft-s-support-statement-around-replicated-user-profile-data.aspx) a scenario such as this one where users could potentially be failed-over to another file server, modify stale/unreplicated data and experience data loss when DFS's "last writer wins" conflict resolution strategy overwrites newer data with old. Based on your experience, do you find Microsoft's concerns overstated? Or do you have a specific strategy to address this problem?


Custom field is not visible/editable after creation (Professional Edition)

Question: I am able to create a Custom Field on standard object (like Account or Contact) via API. I see this field was created in Salesforce UI as a custom field.
But, whenever I describe sobject via API - I don't see this field in list of fields. And of course if I try creating a new sobject via API, I get an error that this field doesn't exist.
Now, if I go to "Customize fields on Accounts page" and add this custom field to be visible here, it automatically becomes also visible via describe sobject API call.
Is there a way to perform something like that via API, or even better to make this field visible/editable via API but without adding it to Account page?
P.s. I am 'System Administrator'
Answer: It doesn't look like you'll be able to update this data without the field appearing on the layout, but with the Metadata API, you should be able to automate this.
I don't have a Professional Edition (PE) Org I can play around with, but based on previous knowledge, and what I can find in the docs, by default, PE Orgs don't have profiles, and as such, don't have Field Level Security (FLS). Profiles appear to be a paid Add-On for PE.
Salesforce Edition Comparison Chart
Furthermore, field visibility appears to be tied to the Page Layout. Any field that is not on the layout, is not visible.

Security Access in GE/PE
http://wiki.developerforce.com/page/Designing_an_Application_for_Group_and_Professional_Edition
Both GE and PE do not support custom profiles. As a result, when a
  customer installs your app, they will not be able to define which
  profiles have access to what. Therefore, you should be sure to design
  your app to work for the Standard User profile at a minimum.
  Furthermore, these standard profiles are not editable, and field-level
  security is handled on the page layout. In other words, any fields you
  want to access to must be on the page layout or they will not be
  visible by the API or Visualforce.
For instance, if you've create a custom Visualforce page that displays
  a field, this field must be on the default page layout for it to
  appear in the Visualforce page. The same is true with API integration.
  You cannot read/write to a field that is not on the page layout in GE
  and PE.

Since you have API access and were able to create the field using the API, you should be able to retrieve, update, and deploy the Page Layout for that specific object. If you create the field & include that field in the layout, you should be to view/edit this fields data via the API.
Take a look at the Layout Section of the Metadata API Developer's Guide.
Answer: When you create it via the UI, you are forced to choose which Profiles is the Object/Field visible to. Hence why you are able to see it via the API.
I would try checking visibility of the Object/ Field created via the API, i.e. via the UI, login and check that it is visible to the System Admin Profile (Manage Users > Profiles > Custom Object Permissions and check at least Read is checked)
For a field, you could check the Field Level Security is set appropriately
Comment: Hmm... I don't see 'Profiles' link under 'Manage Users'. I see it in my developer account, but I don't see in actual Salesforce account.
Comment: If you're System Admin, you should be able to see Profiles https://login.salesforce.com/help/doc/en/users_profiles_view.htm (unless its an Edition limitation)
Comment: Does your profile have the manage profiles permission?
Comment: @MikeChale How can i check that?
Comment: If you can, have a sys admin check. If not, click My Name\Setup\Personal Information. Your profile should be a link; click that add go to System Permissions. It should be in there.
Comment: @MikeChale and techtrekker thanks! It looks like this is the edition limitation after all.
Answer: In Professional Edition, we have two add-on features:

API
Custom Profiles with Multiple Layouts and Field Level Security (FLS)

In other words, with the second add-on feature, you actually get three features instead of just one. If you think Custom Profiles (and Layouts/FLS) should be automatically available in Professional Edition without paying an add-on fee, please vote up the following idea: http://success.salesforce.com/ideaView?id=08730000000BpxBAAS
Without the ability to create/edit custom profiles or manage field level security, field access is determined exclusively by adding it or removing it from the single page layout that exists with each object. As a result, until you add the field to the layout, your users won't be able to access it in the user interface or through the API.
Without knowing what add-ons you have, it sounds like you have API access but not Custom Profiles. As a result, until you add the newly created field to the layout, you won't be able to describe the object in the API and see the field - even if you're the System Administrator (remember, Modify All Data on the System Administrator profile does not count towards field level security or field access)


Recursively copy and rename to replace spaces with underscore

Question: I have a directory with 400 sub-directories each containing several hundred files many with filenames that contain spaces. I need to copy all of the files with spaces in the filenames, resulting two copies of those files, one with spaces and one with underscores replacing the spaces. I see a lot of code that comes close, but nothing that will copy, rename and replace spaces recursively. Any suggestions ??? Thanks....RW Linux rename using parameters and spaces?
Linux rename using parameters and spaces?
Answer: And yet it is not too difficult:
<code> for i in "$(find . -type f -name '* *' -print)"; do cp "$i" $(echo $i | sed 's/ /_/g'); done
</code>
This assumes your directory names do not contain spaces. If they do, the following bash script will work:
<code>  #!/bin/bash

 TGT=/path/to/targt/directory
 LIST="$(find $TGT -type f -name '* *' -print)"
 for i in $LIST; do
      dirpath=${i%/*}
      base=base=${i##*/}
      newbase=$(echo "base" | sed 's/ /_/g')
      cp "$i" $dirpath/$newbase
 done
</code>
If your directory names contain spaces, and you want those dulicated, you will have to specify better what you want to duplicate: the original files and the new ones, only the new ones, possible other files without spaces...
Comment: Thanks....
The directory names do not contain spaces.
Comment: @user2693196 if it works, you should accept my answer, so that users with similar problems searching for a solution may find it and be encouraged to use it.This both yields a faster response, and prevents a new useless post from being submitted.


How to enable device administrator for exchange after user has declined

Question: it appears that a user has declined the device administrator prompt for an exchange email account on samsung galaxy. It doesnt prompt anymore just displays a message about requiring a device administrator, but in the setting>location & security>device admin there are no options at all and nothing displyed.
 Is there another menu option somewhere to enable the device administrator for exchange after it has been declined?
Answer: Make sure you have asked for the right permissions in manifest.
Also check your manifest declarations
Check your xml file.
For reference check this
https://developer.android.com/guide/topics/admin/device-admin.html
Comment: OP didn't ask for his own app (development questions are off-topic here). Moreover, the corresponding permission must have been registered in the Manifest – or the user could not have "declined the device administrator prompt". Thus I'm afraid this does not answer the question.


Mirror image output from v2 pi camera in motion

Question: can anybody tell me how I can flip the mirror image output in motioneye .I am using a pi3 with a v2 8meg pi camera with the latest pi3 motioneyeos.I have now tested 3 different cameras with the same pi3 running the same pi3 motion software and the results were.
Usb web camera works perfectly.
Pi camera version 1 works perfectly.
pi camera version 2 works but camera image is mirrored.
Can anybody tell me if this is a os issue or pi camera issue.
Comment: Out of curiosity, didn't you already post [this question](http://raspberrypi.stackexchange.com/questions/47446/mirror-image-output-from-pi3-using-v2-camera-in-motioneye/47496#47496)? Did you just forget the password to your original account (you could always reset it and edit the original question)?
Answer: yes Grant it was me....still learning.
I have decided to post the answer to my own question from a post i found from  someone called Gavros:
If you are using the motioneyeos image, you can fix this by doing the following:
ssh into your device using putty.
create this file using the nano command:
nano /data/etc/userinit.sh
add the below line into the userinit.sh file
v4l2-ctl --set-ctrl horizontal_flip=1
save and reboot your device.
Thanks Gavros worked for me problem sorted.
Answer: I'm using the "motion" program but not under motioneyeos.  I was able to flip the image by putting the above mentioned "v4l2-ctl" command into /etc/rc.local and reboot.  Works great!


CDS spread term structure

Question: As I know a CDS is defined w.r.t. some unique Reference bond with a given maturity from a given issuer. Now, an issuer can issue bonds with different maturities and notionals. So, how are the Notional values of the underlying bonds normalized, if at all, in order to construct a term structure of CDS spread from an issuer?
Answer: They are basically not normalized.  If you buy 100mm of a CDS on an issuer, it gives you the right (in the event of default) to deliver 100mm of an eligible bond of any maturity and any coupon.  This can sometimes create unusual pricing effects if an issuer is close to default.  For example bonds of different coupons can trade at very similar prices if those bonds are both being sought for delivery into Cds contracts.
Comment: Fair point , cheers
Comment: Good answer, but I don't think that the phenomenon of the prices of all bonds converging to the recovery assumption as default approaches only started with the poularity of CDSs in the 1990s. Bonds behaved the same way long before.
Answer: This assumption:

CDS is defined w.r.t. some unique Reference bond

is not quite true. The term sheet mentions a reference obligation (sometimes more than one), but the swap references the entire tier of debt - all the obligations that are pari passu with the reference obligation(s) on the term sheet, usually all senior unsecured hard-currency bonds. Or bonds and loans if the term sheet says so.
If a credit event happens with some other obligation, then it (probably) triggers the CDS.
If physical settlement is chosen, which is unusual these days, then the protection buyer can deliver (almost) any other obligation.
The maturities of the swaps do not need to align with the maturities of any obligations. A standard swap matures on one of the "IMM Dates" (do not be confused -  not the 3rd Wednesday of a month, like some other products "IMM Dates", but the 20th of some months). Typically, the reference obligation is chosen to have a longer matirity than the swap. You may, of course, try to trade an OTC swap with any maturity, including matching some bond or loan maturity, but then it won't be a standard contract.

CDS spread term structure


How to get filters above the product grid Magento 2

Question: How can i get the filters above the product grid like in the screenshot?
Answer: Well you can't have it on the product grid as far as I know because this grid is rendered using a ui_component. These kind of filters are there when we create a grid using blocks. You need to remove this grid in your custom module and follow the link- https://jutesenthil.wordpress.com/2016/04/11/how-to-create-admin-grid-in-magento2-part5/ to make this kind of grid.


What counter-measures for cheating exist?

Question: Given how huge an advantage real-time external feedback to a player during championship games would give the player, do any of the major chess championships deploy counter-measures to prevent the same sort of cheats you might expect to find at a casino? If so, are these counter-measures well known?
Answer: There have been tournaments that require the players pass through a metal detector, and play in an isolated environment with no spectator contact.  Still, there was the whole Toiletgate incident during the 2006 Topalov-Kramnik match, so even these measures might not seem like 'enough.'  Besides resorting to strip searching the players, what else can be done except isolate them from the outside world during the games?
Answer: See, Cheating in Chess, by Frederic Friedel.
Abstract

Nowadays, players at all levels of chess can profit from computer
  assistance during a game. This is a new development and a serious
  problem for the game. This contribution lists the main forms of
  cheating and provides some occurrences from practice. The most
  prevailing one (Allwermann at the Böblinger Open) is placed in a
  historical context by describing previously noticed cases of cheating.
  Finally, the problem of cheating is addressed at the highest level of
  play. What are the possibilities and how can we prevent cheating at
  this level? Since there is no clear solution, the issue of cheating
  remains on the list of issues to be addressed very seriously in the
  near future.
Comment: @blunders - thanks. I understand editing and comments.  I was just wondering if adding "Abstract" the way you did automatically snagged some text from the link.  Anyway, I didn't know the bare links weren't permitted, so thanks for that info.  I'll dress them up more in the future.
Comment: Oh, that's cool.  Did you do that yourself, or is there a facility to insert the abstract automagically?


Can I establish a video call programmatically using UCMA 3.0?

Question: Is it doable using UCMA 3.0, to have video conferencing ?
Answer: What scenario do you have in mind?
UCMA is normally used as a server-based API, so it's not usual for a UCMA application to initiate or receive video calls (as there's no one at the application!), though I see no particular reason why this can't be done. I've not done it but I guess it would be do-able to create a UCMA application which, when you call it, connects to a video device - a sort of CCTV contact! If this is what you're interested in doing let me know and I'll see if I can put a code sample together.
However, you can also perform a back-to-back transfer, where an incoming video call (incoming to the UCMA application) is handed off to another user, whilst still giving the impression that it's been answered by the application. MSDN has a good four-part series on B2B.
You can also use UCMA to set up, invite, and manage video conferencing sessions between users, if that's more what you're interested in.


How Could One Accelerate the Convergence of the Least Mean Squares (LMS) Filter?

Question: How can the convergence of an LMS filter be accelerated?
Can we do better than the Vanilla algorithm?
Answer: I'd say there 3 approaches to do so:

Properties of the LMS Filter
There is an optimal step size given you know the spectrum of the correlation matrix. You may have a look at Wikipedia's Least Mean Squares Filter at Convergence and Stability in the Mean.
Some other approaches related to this might be those from Variable Step Size LMS. You may have a look at Review and Comparison of Variable Step Size LMS
Algorithms.

Methods of General Optimization
You may use approaches like Line Search and Backtracking for the near optimal per iteration step size.

Methods of Convex Optimization and Stochastic Gradient Descent
You may use optimizers which are used in the Machine Learning / Deep Learning community (Like FISTA) for stochastic gradient descent. Since both the LMS and many algorithms use the Stochastic Gradient Descent they will be valid.