How to fix grub menu item for Windows 10

Question: TL;DR both Ubuntu and Windows boot fine from f8 and grub menu once upon a time. I decided to upgrade Win10 from slow HDD to SDD, and then Windows Boot Manager gave me two Win10 options. I reformatted the old HDD because I didn't need two win10, and that's when grub menu stop booting into Windows. Even so f8 menu still boots both OSes fine.
Not entirely sure how to explain my problem, I'll try my best. Been running Ubuntu 20.04 from a 1TB SSD for a few months, I decided to install Win10 on an old 500 GB HDD. I noticed the Win10 installer didn't create its own EFI on the HDD, but rather created its boot entry in the main 1TB SSD efi partition along with Ubuntu efi. Not sure if most people have one EFI partition per drive or per system, but either way Win10 installer didn't really have any options for this. Booted on Ubuntu to update the grub menu, and then a Windows Boot Manager menu item was added. Things worked great every menu item on grub worked fine.
Fast forward to now I installed a new Win10 on a new 1TB SSD, since the old HDD was too slow on boot and response. Things worked good, but on grub menu when I launched Windows Boot Manager I now had two Windows OS options. I decided to reformat the old HDD so when I selected Windows Boot Manager it would boot straight into the new Win10 rather than seeing two options.
That was a big mistake, now I could not boot into any Windows either from F8 boot options, or grub menu. I popped the installer to boot cmd prompt, then ran bootrec commands and I was able to boot into Windows 10 with F8. Also if I put Windows Boot Manager as the first boot option, the new Win10 OS launches with no problems. I thought all things would be fixed by now. I put Ubuntu back to boot option 1, I select Windows Boot Manager from grub menu and Windows 10 boots fine only once, any subsequent tries gives me a blue screen of RECOVERY everytime about a device not found error code 0x000000e.
I've tried all kinds of things, efibootmgr, boot-repair, update-grub, I've look at the UUID and it seems to be correct for Windows Boot Manager.
The biggest question is that I don't know what's broke, windows boots fine, so it leads me to believe the grub menu is broken, but I thought grub just uses efi entries, but then I don't understand how Windows still boots fine.
bcdedit:
Windows Boot Manager
--------------------
identifier              {9dea862c-5cdd-4e70-acc1-f32b344d4795}
device                  partition=\Device\HarddiskVolume3
path                    \EFI\MICROSOFT\BOOT\BOOTMGFW.EFI
description             Windows Boot Manager
locale                  en-US
default                 {d0fb23a8-0a09-11eb-9dac-82074bc046f4}
resumeobject            {928ea8ee-0a01-11eb-8113-806e6f6e6963}
displayorder            {d0fb23a8-0a09-11eb-9dac-82074bc046f4}
timeout                 30

Windows Boot Loader
-------------------
identifier              {d0fb23a8-0a09-11eb-9dac-82074bc046f4}
device                  partition=C:
path                    \Windows\system32\winload.efi
description             Windows 10 Pro
locale                  en-US
recoverysequence        {d0fb23a9-0a09-11eb-9dac-82074bc046f4}
recoveryenabled         Yes
osdevice                partition=C:
systemroot              \Windows
resumeobject            {928ea8ee-0a01-11eb-8113-806e6f6e6963}
bootmenupolicy          Standard

efibootmgr:
~ ❯❯❯ efibootmgr -v
BootCurrent: 000C
Timeout: 1 seconds
BootOrder: 000C,0000,000D,0009,000A,0004,0005,0001,0002,0003
Boot0000* Windows Boot Manager  HD(1,GPT,f00bcd52-36bd-4a75-9dc8-098d39d94539,0x800,0x100000)/File(\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.22.214.171.124.}....................
Boot0001* UEFI:CD/DVD Drive     BBS(129,,0x0)
Boot0002* UEFI:Removable Device BBS(130,,0x0)
Boot0003* UEFI:Network Device   BBS(131,,0x0)
Boot0004  UEFI: PXE IP4 Intel(R) Ethernet Connection (7) I219-V PciRoot(0x0)/Pci(0x1f,0x6)/MAC(a85e45e7f8fa,0)/IPv4(0.0.0.00.0.0.0,0,0)..BO
Boot0005  UEFI: PXE IP6 Intel(R) Ethernet Connection (7) I219-V PciRoot(0x0)/Pci(0x1f,0x6)/MAC(a85e45e7f8fa,0)/IPv6([::]:<->[::]:,0,0)..BO
Boot0009  UEFI: PXE IP4 Intel(R) Ethernet Connection (7) I219-V PciRoot(0x0)/Pci(0x1f,0x6)/MAC(a85e45e7f8fa,0)/IPv4(0.0.0.00.0.0.0,0,0)..BO
Boot000A  UEFI: PXE IP6 Intel(R) Ethernet Connection (7) I219-V PciRoot(0x0)/Pci(0x1f,0x6)/MAC(a85e45e7f8fa,0)/IPv6([::]:<->[::]:,0,0)..BO
Boot000C* ubuntu        HD(1,GPT,f00bcd52-36bd-4a75-9dc8-098d39d94539,0x800,0x100000)/File(\EFI\UBUNTU\SHIMX64.EFI)
Boot000D* UEFI: PNY USB 2.0 FD 1100, Partition 1        PciRoot(0x0)/Pci(0x14,0x0)/USB(7,0)/HD(1,GPT,9ea75237-6b11-4b0b-ad58-54fe8ebe30ba,0x800,0x1df2edf)..BO

Both SSD drives info with lsblk:
Disk /dev/nvme1n1: 931.53 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: Samsung SSD 970 EVO Plus 1TB
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: D38640D2-C120-4733-A4F8-9B4F1FFE7138

Device         Start        End    Sectors   Size Type
/dev/nvme1n1p1  2048      34815      32768    16M Microsoft reserved
/dev/nvme1n1p2 34816 1953523711 1953488896 931.5G Microsoft basic data

Disk /dev/nvme0n1: 931.53 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: Sabrent Rocket Q
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 041DB30D-EAB3-460B-A8EC-F056C3B33024

Device           Start        End    Sectors  Size Type
/dev/nvme0n1p1    2048    1050623    1048576  512M EFI System
/dev/nvme0n1p2 1050624 1953523711 1952473088  931G Linux files

efi part info with blkid:
/dev/nvme0n1p1: UUID="8505-DD3A" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="f00bcd52-36bd-4a75-9dc8-098d39d94539

Comment: I think I might have found the issue hibernation and fast boot seems to be locking the windows hdd.
Comment: Most likely hibernation since fast boot was enabled before and didn't cause any problems. Will monitor for a few days but reboot and shutdown to grub menu boots Windows fine now.
Answer: Here's how I found Windows partition was locked. I was in the process of restoring EFI partition with clonezilla pre-windows installation. I noticed clonezilla saying could not read Windows partition due to hybernation or fast boot. Didn't pay much attention to it since I was focused on the ESP partition.
Then I re installed Windows 10. To my surprise I was still getting BSOD with grub menu, but not F8. That's when I checked Windows hybernation setting and fast boot on uefi settings. And then Win10 from grub menu booted fine both on restart or after shutdown.
Three days troubleshooting because Windows locks the drive during shutdown.


My breastfed 7 month old wakes every 2 hours during the night?

Question: My baby just turned 7 months. He was a great sleeper from a younger age as I got him waking only 1-2 times a night at one stage but then we done a few trips away from home over the last few months and it threw him right out then he got sick/teething. But now we are back home and he has been waking every 2 hours during the night and he expects to be fed every time. My boobs are so empty throughout the night due to feeding so much. I have gone in after a while of him crying to pay him but his cry gets worse and chucks himself around, I've tried picking him up and rocking him but his cry gets worse as he try's to put his head down to feed, I've tried a lullaby comforter, I've tried the self soothing thing but he could go from half and hour or more it seems and his cry gets to a point it sounds like he would get a sore throat from it all…. This is my 4th baby and my others were never like this. Please help! I need sleep to help with my other kids also.
Comment: Hi! Welcome to Parenting.SE.  Have you checked on the various similar questions we have to see if any of them are useful? This is a pretty common issue, and a distressing one for obvious reasons!  For example, [this one](https://parenting.stackexchange.com/questions/12450/8-month-old-wakes-up-crying-for-2-hours-after-30-minutes-of-sleep?rq=1) is really similar.
Answer: I don't really have an answer for you, but some things to consider/think about.
Is there any chance that your milk production isn't keeping up with the (energy) needs of your baby?

For the short term, you could consider bottle-feeding your baby during the night. This might help in two ways:

If your baby is too hungry to sleep, then a good bottle feed would fill him better than sucking the last drops out of an empty breast. That in turn would allow him to sleep longer stretches.
The bottle-feeding duty can be shared with your partner, allowing you to catch more sleep.

For the longer term, take a critical look at his eating/drinking habits and see if you can find a way to send him to bed with a stomach full enough to last the night. That could mean giving him an additional meal, either of milk or of solids.
Comment: I absolutely support this - we did a bottle feed for last meal to supplement breastfeeding, and it meant not only could my wife get some rest, but I got some amazing time with all 3 of my babies that I would not otherwise have had.
Answer: If you always feed him to sleep it's very likely this is a sleep association issue, rather than lack of food, as babies can sleep through the night from 3 months or so. A baby's sleep pattern is not constant — there are periods of light sleep and periods of deep sleep (aka "sleep cycles"). If your baby wakes between cycles he is unable to get himself back to sleep without breast feeding because that's the way he knows how to fall asleep.
There are a few options here that are basically on the spectrum between "live with it" and some degree of sleep training. Basically, you need to somehow break this association and help him fall asleep unaided. We sleep trained our daughter at 4 months with the Ferber method and it went well — by the third night she was sleeping all the way through. But! It's not a one-stop solution. It is easy to fall back into a pattern of regular waking and sleep associations. This happened to us after a run of sickness, teething, and so on — we fed her to sleep a couple of times and before we knew it we were back on multiple wakings. Fortunately it's usually quite easy to get back on track again.
If you haven't already I would read Ferber's book. The sleeptrain sub on Reddit is useful too.
Note: sleep training is a divisive issue and some people are very against it. I am comfortable with the decisions we made and their outcomes and I'm not going to be drawn into any kind of debate or argument about sleep training.
Comment: Hi and welcome! This is a q&a site; discussions or debate are not encouraged. Comments are meant to ask for clarification or additional information that might be helpful. If there is an unwelcome comment, flag it and it will be deleted, or a string of comments might be moved into a chat room. In light of that, that last phrase is unnecessary here. :) I, too, Ferberized our children and was happy with the result if sad while it was happening. I also recommend it. :)
Answer: You can try cosleeping with the baby, then it is much easier to feed and get enough sleep. If he drinks your breasts empty, they will produce more milk so that he does not need to suck out every last drop desperately, so it should all readjust in time.
If you can't produce enough milk, try feeding him something that fills the stomach well in the evening (e.g. oatmeal or milk rice).
My experience:
I think my child drank around every two hours day and night until I introduced him to food (around 6 months old). Then daily breastfeeding sessions got less frequent, but nightly not. I kept up the nightly breastfeeding until 18 months, then finally weaned him. And if I remember correctly, it was every 2-3 hours that he wanted to drink during nighttime, right to the end. Yes, it was definitely not a need for food at that age, just a convenience he was used to. But one that I decided to endure to have my peace and sleep (and an alive teddy bear to cuddle).


How to automate stackdriver monitoring? Why stackdriver apis are used for?

Question: How can I create new stack driver chart for any VM or cluster or pods created in Stackdriver automatically? Is there any way to achieve stackdriver charts as soon as any resource mentioned above is created in GCP  environment? What are the stackdriver apis are used for ?
Answer: In can not be done automatically in stackdriver monitoring you need to access you Workspace after creating it, and ADD Chart in your Dashboard.
Stackdriver monitoring API gives you access to over 900 Monitoring metrics from Google Cloud Platform and Amazon Web Services. You can create your own custom metrics and can organize your cloud resources using groups,it's uses filters to select metrics, to fetch time-series data, and to collect monitored resources into groups.


How does the maintain load test work?

Question: A project site in my company is currently working on testing the settlement of our piles using the maintain load test, so my boss is asking me to find out some information on this. In particular, he asked me a) how the maximum allowable settlement is calculated and b) what must be done if the allowable settlement is exceeded.
Answer: The settlement of piles can be determined by conducting a load test. The procedure for the pile load test is as follows ¹:

Preliminary piles shall be tested to not less than twice the working load of the pile or other loads stated in the Contract. Working piles shall be tested to not less than 1.8 times the working load.
Test loads shall be applied and removed in three stages as

Stage   Test Load

I 25% max. test load
II    50% max. test load
III   100% max. test load

Unless otherwise permitted by the Engineer, the test loads shall be applied in increments, and removed in decrements, of 25% of the working load. Increments of load shall not be applied until the rate of settlement of the pile is less than 0.1 mm in 20 minutes.

Various types of equipment are required for the determination of settlement of pile foundations. Following is the list of equipment required ¹:

Kentledge, anchor piles, or other anchorages supported or installed at suitable locations to provide adequate reactions against jacking.
A load-measuring device which shall consist of a load column, pressure cell, or other appropriate system, calibrated before and after each series of tests, or whenever adjustments are made to the device, or at time intervals recommended by the manufacturer of the equipment.
Four deflectometers accurate to 0.025 mm.
Precision leveling equipment accurate to 0.25 mm.
A reference frame for supporting deflectometer and providing a datum for deflectometer measurements.
Working platforms.
Screens and protection from exposure to conditions that may affect the test.
Hydraulic loading equipment.

The allowable limit on settlement of an individual pile during load tests is around 10mm at working loads ². If the allowable settlement is exceeded, the engineer may ask for 1.5 times that settlement at 1.5 times the working load to ensure elasticity. If the allowable settlement is exceeded, the engineer may need to re-evaluate the foundation design and consider remedial measures.
The Images are in reference to the Borj Khalpha project.

(1) Determination of Piles Settlement by Load Test - The Constructor. https://theconstructor.org/geotechnical/determination-of-piles-settlement-by-load-test/7389/.
(2) Bored Piles Design: geotechnical considerations - Ingeoexpert EN. https://ingeoexpert.com/en/2021/07/06/bored-piles-design-geotechnical-considerations/.
(3) Pile Load Test | Purpose of Pile Load Test - Engineering Projects. https://bestengineeringprojects.com/pile-load-test/.
(4) PILE TESTING SPECIFICATION FOR DRIVEN PILES - G & P. https://gnpgroup.com.my/wp-content/uploads/2017/03/SP006.pdf.
(5) Numerical and Theoretical Study on the Settlement of Capped Piles .... https://downloads.hindawi.com/journals/ace/2020/3978780.pdf.
(6) Pile Load Testing for Bored Piles in Soil - STRUCTURE mag. https://www.structuremag.org/wp-content/uploads/2021/05/282106-C-StructuralFoundations-Ng.pdf.
Comment: redesign the foundation. these are pre-construction tests just to determine if the foundation is strong enough.
Comment: I guess there are techniques to do that, but I am not sure if it is practical. I am not aware of any remedial work on the big projects. I myself had a job that called for a small pocket of bad soil to be excavated and replaced with designed fill. but that was because the strata underneath were competent. and we did not load test any caissons. they had drilled test holes and had the profile of the site.
Comment: What are some of the remedial measures taken in the case of failure?
Comment: What about improving the soil via compaction/grout?

How does the maintain load test work?


Identifying Ancient Artifact

Question: You are a group of archaeologists and scientists investigating an ancient cave. You set up and verify a presurization system at the entrance, which you can use to suck all the air out of the room, or set it to whatever pressure you wish, reasonably. You have unlimited storage space, and an unlimited quantity of air to introduce. However, any air you use must be Earth average.
Once that is set up, you move further into the cave. There, you find resting on a perfectly flat floor an ancient artifact. Its visible attributes are not important to the problem. You have verified that it is entirely composed of a single compound, and make a request to your head scientist that you take a sample to determine what it is, but he denies your claim, saying he wants it intact, complete, and untouched. He gives you permission to make whatever measurements you wish, but you may not touch it, move it, or put anything beneath it. He gives you a series of attributes he wishes for you to find, the chief of which is density. How do you find density?
Comment: Funny answer: Archimedes' principle. Rise the air pressure in the cave until the object starts to float, and you will have the density (equal to the current air density) :D
Comment: I would assume we have the equipment to measure the temperature of the room (and the artifact, since if it has been in there for so long they should be at equilibrium?). Are we allowed to heat the room, and by proxy, the artifact, though?
Comment: This post is borderline off-topic, because it *looks like* more of a real-life science question than of a genuine puzzle.
Answer:
 Density is mass per spatial volume.  You are unable to disturb the object by movement or touching, so its heft and therefore mass are unknown via that avenue of investigation.  Allow for its volume to be known because we already measured it by visual and trigonometric methods.  The only substance which we allow to contact the object's surface is average Earth air.  We know nothing of the object's electromagnetic or thermal properties, so we cannot use those to figure mass.  All you have is the gravitational constant.  I would recommend evacuating the cave of air to a nearly perfect vacuum, then measuring the gravitational lensing of a few lasers shone past the object.

You'd need instruments to make some very, very fine measurements, but if you could calibrate well enough then that's one ideal (i.e. probably not practical) way to do it.
Or,

 If you wanted to use chronometers, use the very slight differences in gravitational acceleration on falling masses.  Erect a canopy over the precious artifact prior to dropping anything over top of it, and compute the effect of that canopy's mass on the acceleration of the falling bodies.

Granted, neither of these are likely to be tenable in many practical situations, so if that is a criteria for your puzzle then it would seem that my suggestions fail.
Answer: The answer is:

 X- Rays used by archaeologists.
For years, researchers have used X-ray technology to get a deeper look at anything from molecules to ancient tombs.X-rays penetrate matter, and are attenuated (absorbed and scattered) to different degrees depending on the material, its density, and its thickness. This phenomenon is made visible to the eye by creating shadow radiographs. Typically, a piece of film is placed behind the object. The X-rays that pass through the object strike the film, exposing it like sunlight expose photographic film. Once the film is developed, the areas that have received rays will appear black whereas the areas that have not will appear white. Variations of gray between the two extremes in changes in the density of the material or differences in materials.The difference in radio-opacity of various materials and their corrosion and degradation products allows conservators and archaeologists to not only see individual components of a piece but also to get information about the condition of the object.
Comment: I will try to contribute. X-rays has to be calibrated in function of known densities and the thickness of the object. We do not know its shape, but it's volume can be easily retrieved by modern 3D reconstruction tecnique from images with does not touch the object. Also some elements vary their density in function of air density. so measurements have to be done varying air density in the cave, which is allowed.

Identifying Ancient Artifact


What would one call a list of people to be killed?

Question: I know this sounds kinda morbid, but is there an english word for a list of people who are to be killed? Let's say, a hitman gets a list of targets, what would he call it? My first though was "hitlist", but I'm not really sure if this is an actual commonly used word or just a made-up term (there's a movie or something called The Hit List) that derivated from "hitman" as a synonym for "killer" ...
Comment: I believe "hit list" would be most recognizable term.
Comment: I don't know, but in my imagination the assassin keeps things non-specific: "He's on **my list**."
Comment: I looked 'hit list' up in two online dictionaries, including [this one](http://www.collinsdictionary.com/dictionary/english/hit-list).
Comment: If you are writing fiction, have fun with it. The Doomed. The Damned.The Select. The Unfortunate. The Chosen Ones. My *Friends* The Walking Dead...
Answer: 'Hit list' is generally the colloquial term, though I've seen things like 'Kill On Sight' (KOS) list used in certain online games.
Comment: A _hit_ is indeed a common slang for _a kill_, hence the _hit man_ and the _hit list_, or even _take out a hit on someone_.
Comment: @oerkelens I don't know about "take out a hit" but I've definitely heard "carry out a hit".
Answer: "Hitlist" is probably the most commonly used word for this, but I just want to point out that there's no single definitive answer. You will end up having to make up some phrase for it, and that phrase will depend highly on context. For example, it would be quite weird to describe a list of prisoners on death row as a "hitlist," unless you were trying to make a political statement about the death penalty. For death row specifically, I might say something like "list of death row inmates."
Comment: There's also "proscription list," which implies it's being done by someone in a position of political power: https://en.wikipedia.org/wiki/Proscription


Profinite Group, Compact Hausdorff Totally disconnected topological group

Question: If G is a compact Hausdorff totally disconnected topological group, and I want to show that G is profinite, I am interested in surjectivity for now. Let $\hat{G}$ be the profinite completion of $G$, and $\rho : G \to \hat{G}$ the usual continuous group homomorphism. we know that $\rho(G)$ is dense in $\hat{G}$, and is compact in $\hat{G}$ since $G$ is. $\rho(G)$ is hence also closed in $\hat{G}$, so $\rho$ is surjective. Is this reasonnable?
Answer: I don't know why you know that $\rho(G)$ is dense in $\hat G$, but yes, if $\rho$ has closed and dense image, it is surjective for sure!
Someone should have definitely answered this question before.
Hope that helps,


Lining up numerous gunshots

Question: Am doing a film with a lot of gun shots (single, semi-automatic, automatic). Was wondering some ideas on workflows. Drop in single gun shots into kontakt, drop in a marker at each muzzle flash or click sound,  and line up the midi notes? Or perhaps detect hit points, make a midi "groove" and line up the midi notes that way. Or better to just use audio and line up each gunshot that way? Am looking for the fastest, most automated workflow. I'm using Nuendo 6.
Answer: Automating it might be good for a first pass, but imho everything needs finessing as individual sound cues - whether background or foreground - and I find that more difficult & less satisfying via MIDI, prefer seeing the waveforms especially when layering elements where the attack has to be acutely accurately aligned...
I know its not Nuendo but in PT I marked up sync for each scene using memory location markers, and then set the grid to follow/snap to the markers so it became a non linear grid. This amde it faster for a first pass & when layering elements... but still had to get detailed to bring them to life...
Comment: Agreed. It will need finessing for sure. Thanks for the thoughts.
Answer:
Am looking for the fastest, most automated workflow.

I think the most automated workflow that doesn't have the risk of sounding too bad because of phase cancellation or bad timing is to load all gunshot samples to a sampler, route them to individual outputs, create tracks for recording every output, press record and play a few layered gunshots from the MIDI keyboard. Then select the best one and crop it, do quick adjustments, if needed, and there you have it. No guarantees that it'll result in the best gunshot sound or the kind of gunshot that you'd like though.
Answer: I would drop markers for each gunshot and tracklay each one separately. It might take longer, but you will have more control later. The idea of having stuff running through Kontakt sounds like a mixing nightmare (if you have multiple shots coming form one instance), or a waste of processing power (if you run multiple instances). I think any time you save in the tracklay will be lost in the mix when you come to setting up panning, eq and reverb. Also, if you need to return to the session later you are dependent on Kontakt running properly - best to have the audio itself locked in the session.
Answer: Good preparation and set-up with Kontakt can be a very effective way. In addition, it can be used for other projects.
Drop all shots in Kontakt. One instrument for one type of gun. Drop all instruments in a Multi-Instrument, save the Multi, record MIDI on several tracks with the appropriate MIDI channel, edit, bounce to audio.
Comment: This is what I was thinking. Will post back when I have a macro and workflow. Thanks for the responses.

Lining up numerous gunshots


Hurst estimation in small samples

Question: I'm trying to estimate the Hurst exponent of a time series which I believe behaves as a fractional Brownian motion. My problem is that all the estimation methods I have found so far (r/s, Whittle, etc..) work asymptotically as $N\rightarrow \infty$, while I have a relatively small sample, $N<300$. Do you know of any estimation method that works in small sample? Or maybe a small sample correction for the classic ones
Answer: i was using time series for N=5 and the basic time series can't be use to make a forecast, so i use the bootstrapping of the oruginal data. we can make a 100, 300, 500, or 1000 resampling from the original data, so the resampling data we can use it to forecast the future value, if you find the convergen in each resampling from 100 - 1000, you can use the methode.

Hurst estimation in small samples


Is it possible to change number of threads during program execution

Question: I'm running few openMP programs. Is it possible to change the number of threads during the program execution. For example, if a program takes 70sec to execute using default number of threads, can I change that number say after 30 sec.
Answer: Yes, you can certainly use omp_set_num_threads() to dynamically change the number of threads each time through your (say) iteration loop, and use that plus timing measurements to adaptively choose the number of cores you're using.
Answer: You can always create a new thread.  A better question you should ask yourself is if multi-threading will benefit you.  Remember, just creating new threads will not speed your program up and in many cases, can actually cause more harm than good (race-conditions, deadlocks etc).  Make sure you have an understanding of how threading works before jumping into it, which judging by your question, you do not.  Threading is a manly task, it puts the hair in your chest, but takes it off of your head!
http://www.inf.uni-konstanz.de/dbis/teaching/ss06/os/ch4.pdf


Who first used "N Men Enter, One Man Leaves" as a plot?

Question: The superficial similarities between the plot of Battle Royale (here's a trailer) and
The Hunger Games (here's a trailer) -- and a friend's sarcastic comparison to the titular Thunderdome in Max Max 3 -- led me to wonder: where did the "N Men Enter, One Man Leaves" trope originate? Is it ancient? Recent?
Comment: I'm *not* going to research this one, for the simple fact that it will *definitely* involve diving into TV Tropes and I just don't have time for that these days.
Comment: "Because nothing says decadent and evil like carnage as a spectator sport." -[TV Tropes](http://tvtropes.org/pmwiki/pmwiki.php/Main/GladiatorGames)
Answer: The exact "N Men Enter, One Man Leaves" can probably be traced back to Roman Gladiator fights, where at least one example from 264 BCE has three gladiators fight to the death.  It's likely that prior to that, other cultures had events that were similar.  Many gladiator fights were one on one though.
As far as what story or book first had the trope, it's hard to say.  As far as I can tell, both The Running Man and The Long Walk by Stephen King (writing as Richard Bachman) were the first that had contestants attempting to outlast other people in a fight to the death (as it were) for the entertainment of the people (in The Running Man, the fight was one man against most of the world, and it was an extension of gameshows of the time.  The Long Walk has more similarities with Battle Royal and The Hunger Games, but the contestants signed up for the event).  Since both books were published in the 80s, it's likely that there are earlier examples.
Death Race 2000, a movie about a ... erm, death race across the USA, again for entertainment, came out in 1975, and is based on the short story The Racer by Ib Melchior. There's some similarities between the world presented in Death Race 2000 and worlds of Battle Royal and The Hunger Games.  Finally, the episode "Fun and Games" from the original Outer Limits, aired in 1964, and had contestants from Earth fighting contestants from other planets to the death for the entertainment of an alien race (and the survival of all of Earth).
Doctor Who had a serial called The War Games, where humans from different time periods were dumped into an arena and fight to the death.  The "winners" would then go on to be a super army for aliens, this is almost a "multiple people enter, one comes out" situation.  On the other half of the trope, The Most Dangerous Game is about a hunter who hunts humans from 1924, and is perhaps the earliest (or at least, most famous) example of humans hunting humans as sport.
It's probably worth pointing out that the "reality show" version of this trope probably wouldn't appear much earlier than the 1950s, when TV shows and gameshows specifically became wildly popular, since the trope requires the audience to be familiar with the idea of people humiliating themselves for fame and money.
Found new information: The short story The Prize of Peril, by Robert Sheckley published in 1958, contains perhaps the earliest example of "deadly reality show", and was likely an inspiration for "The Running Man". A link to the complete story is on wikipedia.
Comment: What?!  *The Running Man* was originally written by Stephen King?  Wow, I never would have imagined one of his books to end up starring Arnold when turned into a movie.
Comment: +1 for Sheckley; he's the classic writer of this kind of story, and a good place to start looking.
Comment: Excellent examples. Hopefully someone can find something older that's as close a match as the Stephen King ones are.
Comment: @Plutor I've added a few more possibilities to my answer, and a reason why it probably didn't appear until the 1950s or 60s.
Answer: Theseus and the Minotaur? circa 800 BC
Comment: That was more a case of *X* men and women enter, and *no one* leaves.
Comment: I think you mean 800 BC.


.NET (web) How to execute some code after all events are handled?

Question: I have this .NET web app that draws a table in Page_Load.
Then after that it handles the events, which should change the table drawn in Page_Load.
This is very inefficient.
Is there a way to execute the code (which draws the table) after it finishes handling all events? (instead of doing it in Page_Load)
Thank you in advance.
Answer: You need to handle an event that occurs after the control events, but before the page is rendered, such as LoadComplete or PreRender.
Check out the ASP.NET Page Life Cycle Overview for more info.
Answer: Check out the OnPreRender event in the page lifecycle.
-Oisin
Answer: You could also put the code in a Timer tick event with an interval of 1, which will fire after all the events.


How to know register for I2C communication in pi

Question: I want to communicate between raspberry pi 1 and a board with V850ES controller. To write/read to/from raspberry pi from/to the controller, I need to know the register address. How to find that? I  searched in data sheet but couldnt happen to find it. Kindly help.
Comment: Which version of the Pi are you using? Have you enabled I2C via raspi-config?
Comment: The SOC can only act as a master - not a slave.
Comment: Register address?  The register address of what?  The Pi or the V850?
Comment: Thanks everyone for the concern. I am using Raspberry pi 1 and done every configuration related to I2C till installing i2ctools. I want Register address of both pi and V850 as I want to read as well as write onto raspberry pi. Cant raspberry pi act as slave??
Comment: There is no workable solution known for making the Pi run as an I2C slave.  There is hardware support but no one has been able to create a workable driver in all the years since the Pi was launched.  You must assume the Pi runs as a master only.
Answer: i am hopping your V850ES is a i2c slave device.
every i2c slave device has an address, so check if you can detect is or not.
if you don't have i2c tool installed .
do this
update your pi.
sudo apt-get update
upgrade to the latest os.
sudo apt-get dist-upgrade
make sure you also enabled i2c in your kernal. sudo nano /etc/modprobe.d/raspi-blacklist.conf then add a # on the 3rd line. sudo nano /etc/modules Add i2c-dev to a new line.
then try to install i2c tool.
sudo apt-get install i2c-tools
make sure your pi and sensor i2c voltage level are same. if you dont know how you can do that get a pi shield like this.


Input delay/lag in Forza Horizons 3 on PC with Xbox One Controller

Question: I'm having what feels like a few hundred ms input delay in Forza Horizons 3. My graphic settings defaulted do medium.
Comment: I couldn't find much info about this on other sites, so I posted this so it will help others that are googling the same issue.
Answer: This is caused by the video setting being at 30fps. Change it to 60fps and this will solve the issue.
Comment: Also, welcome to Arqade!
Comment: Could also be caused by using a TV as a monitor, although I assume the solution you posted is the one that worked in your situation.
Comment: That is true, in which case turning on "Game mode" setting on the TV would be the correct solution. But this was a very strange, Horizons 3 specific "bug". Going from Rocket League with lag-less input to Horizons 3 with what feels like large amounts of input lag was very strange.

And thanks!
Answer: Changing it to 60fps may workaround the issue, but introduces others (stuttering, and frame rate dips below 30FPS).
On my AMD R9 290 card, I've found that disabling shader cache and/or 'surface format optimisation' in the AMD Catalyst / settings app seems to reduce the input lag, but I didn't have time to test it much (11pm last night).
I remember some old config tools had the option for "Max prerendered frames" for the GPU, and given that the 30hz mode is supposed to set 33ms 'frame pacing' I wonder if that could be a fix..
For the record I'm running a 2500k CPU (4.5ghz) with 8GB RAM and SSD.
Answer: If you have a laptop with Optimus, take a look at the solution mentioned in this YouTube video:

Essentially, go into the Device Manager and disable the Intel iGPU. The Windows desktop will freak out a little bit, but the game should run smoothly and without any input lag in 1080p. Otherwise, bumping down the resolution to 900p is enough to eliminate any lag.


What does the mute switch on the iPad do?

Question: We got an iPad not long ago, and I noticed that the so-called "Mute" switch doesn't mute the sound for all apps. I am aware of the iPhone mute switch dilemma, but what exactly does the mute switch on the iPad do? Is it like the iPhone's mute switch or is it different?
Comment: On the iPhone it's called the `Ring/Silent switch` https://support.apple.com/en-us/HT208353
Answer: The iPad mute switch is identical to the iPhone's mute switch except it can't control a ringer/vibration choice. Other than that, it's effect in-app will be identical.

Not all apps respect the 'mute' switch. Apps that have no purpose EXCEPT to be listened to (music apps, youtube, etc.) will not be any different in either switched mode.
Frequently, games or other apps with "ambient music" will silence the music and often the sound effects as well when the switch is set to mute.

It is due to this inconsistency that I choose to set the switch to control orientation lock, and just use the volume controls as needed.
Comment: One of my pet peeves however is that notification sounds are not muted when turning the volume all the way down, and only when really muting the device :) Whatever you configure the physical button for though, you can still access the second functionality by double-clicking home and swiping to the media controls.
Comment: Is this inconsistency documented anywhere? I'm trying to figure out the mute button on my iPhone and was surprised that alarms are not silenced in mute mode.
Answer: From Apple's KB article on the iPad's side switch:

When you mute your iPad, only certain sounds are muted.

Sounds such as alerts, notifications, sound effects, and game audio are muted.
Media playback (such as music, podcasts, movies, videos, and TV shows) are not muted.

So, that would explain why background music/videos aren't muted when I'm using our iPad.
Comment: That link may have been updated. It seems to point to the following page *Rotate the screen on an iPhone without a Home button*
Answer: One of the main reasons why I use the mute button is to effectively turn-off the sounds made by notifications. It's handy because you don't have to manually go into Settings and mute the specific notifications for the apps, however the main drawback to using the mute button is that it mutes everything so you won't be able to hear all of the notifications when using it as opposed to manually selecting which notifications to mute in settings.


What is the difference between Jupyter Notebook and JupyterLab?

Question: I am new to Jupyter Notebook, what is the key difference between the Jupyter Notebook and JupyterLab, suggest me to choose the best one, which should be used in future.
Answer: Jupyter Notebook is a web-based interactive computational environment for creating Jupyter notebook documents. It supports several languages like Python (IPython), Julia, R etc. and is largely used for data analysis, data visualization and further interactive, exploratory computing.
JupyterLab is the next-generation user interface including notebooks. It has a modular structure, where you can open several notebooks or files (e.g. HTML, Text, Markdowns etc) as tabs in the same window. It offers more of an IDE-like experience.
For a beginner I would suggest starting with Jupyter Notebook as it just consists of a filebrowser and an (notebook) editor view. It might be easier to use.
If you want more features, switch to JupyterLab. JupyterLab offers much more features and an enhanced interface, which can be extended through extensions:
JupyterLab Extensions (GitHub)
Comment: I would actually argue that Jupyterlab looks fancier but has fewer features
Comment: JupyterLab is not friendly for displaying data visualizations, e.g. plotly. Reason I switched to Jupyter notebook.
Comment: This doesn't really explain what the differences are
Comment: @Kaisar What challenges have you encountered with plotly i JupyterLab?
Comment: Worth noting that recent release of plotly added better support for Jupyterlab: https://community.plotly.com/t/introducing-plotly-py-5-0-0-a-new-federated-jupyter-extension-icicle-charts-and-bar-chart-patterns/54039
Comment: I think it's time to default to jupyterlab. One surface-level difference is that notebook has a narrower page width, which sort of gets in the way of wide plots and outputs. Jupyterlab doesn't do this.
Comment: @Kaiser
 You are right that the vanilla jupyterlab wont' render plotly. It is solved by installing the  jupyter labextension plotly (jupyter labextension install jupyterlab-plotly). There are other labextensions that are interesting such as table of content, markdown, drawio, git, nbdime for notebook diff.
Comment: Jupiter Lab has file browser.
Comment: I switched to Lab quite sometime back and everything worked fine except 'plotly'. After struggling much I am now planning to switch back to Notebook.
Comment: I wrote the code to get a sankey diagram and JL wouldn't display it. However, the same code worked in Jupyter notebook.
Comment: I think to beginner equals me, is better start with Jupyter Notebook!
Comment: https://jupyter.org/install gets the user to install Lab
Answer: 1 - To answer your question directly:
The single most important difference between the two is that you should start using JupyterLab straight away, and that you should not worry about Jupyter Notebook at all. Because:

JupyterLab will eventually replace the classic Jupyter Notebook.
Throughout this transition, the same notebook document format will be
supported by both the classic Notebook and JupyterLab

As of version 3.0, JupyterLab also comes with a visual debugger that lets you interactively set breakpoints, step into functions, and inspect variables.
2 - To contradict the numerous claims in the comments that plotly does not run well with JLab:
JupyterLab is an absolutely fantastic tool both to build plotly figures, and fire up complete Dash Apps both inline, as a tab, and externally in a browser.
3 - And you would probably also like to know this:
Other posts have suggested that Jupyter Notebook (JN) could potentially be easier to use than JupyterLab (JL) for beginners. But I would have to disagree.
A great advantage with JL, and arguably one of the most important differences between JL and JN, is that you can more easily run a single line and even highlighted text. I prefer using a keyboard shortcut for this, and assigning shortcuts is pretty straight-forward.
And the fact that you can execute code in a Python console makes JL much more fun to work with. Other answers have already mentioned this, but JL can in some ways be considered a tool to run Notebooks and more. So the way I use JupyterLab is by having it set up with an .ipynb file, a file browser and a python console like this:

And now you have these tools at your disposal:

View Files, running kernels, Commands, Notebook Tools, Open Tabs or Extension manager
Run cells using, among other options, Ctrl+Enter
Run single expression, line or highlighted text using menu options or keyboard shortcuts
Run code directly in a console using Shift+Enter
Inspect variables, dataframes or plots quickly and easily in a console without cluttering your notebook output.
Comment: "not worry about jupyter" the issue is that documentation on blog posts and SO questions solve problems for jupyter rather than jupyterlab and the solutions will sometimes work for jupyterlab and sometimes not - this makes understanding how the two relate quite important. \
Comment: @AttRigh Sure, but the OP was also specifically asking `which should be used in the future`. I would not hesitate to focus on JupyterLab.
Comment: Also, if you install JupyterLab (`pip install jupyterlab`), it also comes with Jupyter Classic. So you might as well install JupyterLab since it has both.
Comment: The Anaconda distribution comes with both installed. Relevant link for your answer: [Migrating to Notebook 7](https://jupyter-notebook.readthedocs.io/en/latest/migrate_to_notebook7.html): _it was decided late 2021 to continue developing the Jupyter Notebook application and sunrise it as Notebook 7. Notebook 7 is built on top of JupyterLab components and delivers new features like realtime collaboration, debugger, and theming._.
Comment: Point #2 is pretty weak. "People are actually wrong about the fact that they've had trouble using this thing" isn't exactly a solid argument.
Answer: At this time (mid 2019), with JupyterLab 1.0 release, as a user, I think we should adopt JupyterLab for daily use. And from the JupyterLab official documentation:

The current release of JupyterLab is suitable for general daily use.

and

JupyterLab will eventually replace the classic Jupyter Notebook. Throughout this transition, the same notebook document format will be supported by both the classic Notebook and JupyterLab.

Note that JupyterLab has a extensible modular architecture. So in the old days, there is just one Jupyter Notebook, and now with JupyterLab (and in the future), Notebook is just one of the core applications in JupyterLab (along with others like code Console, command-line Terminal, and a Text Editor).
Comment: By now (as of mid 2021), there is no reason not to use JupyterLab. Just conda install jupyterlab and it will pull in the notebook and other things it needs. JLab is versatile as the underlying JLab extension framework provides rich customization and extension capabilities. As far as I know, the jupyter folks are putting their effort almost all in jupyterlab now.
Answer: Update regarding Jupyter Notebook (Aug 2023)
Several posts have mentioned that JupyterLab will eventually replace Jupyter Notebook (for good reason, Project Jupyter told us so). However, this is no longer quite the case. Jupyter Notebook v7 is the next fully supported version of Jupyter Notebook. It is based on RetroLab (formerly JupyterLab classic), which means it shares the same internals as Jupyter Lab, but aims to preserve the classic Jupyter Notebook experience.
From the intro to the Jupyter Notebook 7 migration guide:

For a while, the plan was to progressively sunset the Classic Notebook
and not maintain it anymore. However, the Classic Notebook is still
widely used and it is still the default user interface for Jupyter in
many scenarios. Many users and organizations have not been able to
switch to JupyterLab yet. For some users, JupyterLab can also be a
more complex environment to use, especially for beginners.
Following the feedback from the community, it was decided in late 2021
to continue developing the Jupyter Notebook application and sunrise it
as Notebook 7. [1]

Notebook v7 will continue to provide the document-centric experience preferred by many users, where each individual notebook opens in a separate browser tab and the visible tools and menus are focused on the open document. Support for all Notebook v6 extensions cannot be guaranteed but a few that were identified as critical for Notebook users will be ported to Notebook v7. In some cases built-in functionality will be available in v7 that were previously provided by extensions, and in other cases extension authors will release updated versions for Notebook v7.
Highlighted features in Notebook v7 (and therefore reasons to consider migrating from v6 to v7) include: a debugger, real time collaboration, table of contents rendering, theming and dark mode, internationalization, accessibility improvements, support for many JupyterLab extensions, and compact view on mobile devices. [2]
Personally I am still using Jupyter Notebook v6 however, this looks like good news and I plan to try out v7 soon :) See the Jupyter blog announcement, the JEP 79 and the migration guide for more details.
Note: NbClassic extension is also available in Notebook v7 and JupyterLab
For those who are upgrading to Notebook v7 or JupyterLab but do want to have the "classic" look and feel of Jupyter Notebook, there is the NbClassic extension. Thanks to @Wayne for this note - see his related answer new-jupyter-notebook-interface.

NbClassic provides the classic interface on top of the new Jupyter
Server backend, it can coexist with other frontends like JupyterLab
and Notebook 7 in the same installation. NbClassic preserves the
custom classic notebook experience under a new set of URL endpoints,
under the namespace nbclassic. [3]

References:
[1] https://jupyter-notebook.readthedocs.io/en/latest/migrate_to_notebook7.html
[2] https://jupyter-notebook.readthedocs.io/en/latest/migrate_to_notebook7.html#new-features-in-notebook-7
[3] https://github.com/jupyter/nbclassic
Answer: (I am using JupyterLab with Julia)
First thing is that Jupyter lab from my previous use offers more 'themes' which is great on the eyes, and also fontsize changes independent of the browser, so that makes it closer to that of an IDE. There are some specifics I like such as changing the 'code font size' and leaving the interface font size to be the same.
Major features that are great is

the drag and drop of cells so that you can easily rearrange the code
collapsing cells with a single mouse click and a small mark to remind of their placement

What is paramount though is the ability to have split views of the tabs and the terminal. If you use Emacs, then you probably enjoyed having multiple buffers with horizontal and vertical arrangements with one of them running a shell (terminal), and with jupyterlab this can be done, and the arrangement is made with drags and drops which in Emacs is typically done with sets of commands.
(I do not believe that there is a learning curve added to those that have not used the 'notebook' original version first. You can dive straight into this IDE experience)
Answer: This answer shows the python perspective. Jupyter supports various languages besides python.
Both Jupyter Notebook and Jupyterlab are browser compatible interactive python (i.e. python ".ipynb" files) environments, where you can divide the various portions of the code into various individually executable cells for the sake of better readability. Both of these are popular in Data Science/Scientific Computing domain.
I'd suggest you to go with Jupyterlab for the advantages over Jupyter notebooks:

In Jupyterlab, you can create ".py" files, ".ipynb" files, open terminal etc. Jupyter Notebook allows ".ipynb" files while providing you the choice to choose "python 2" or "python 3".
Jupyterlab can open multiple ".ipynb" files inside a single browser tab. Whereas, Jupyter Notebook will create new tab to open new ".ipynb" files every time. Hovering between various tabs of browser is tedious, thus Jupyterlab is more helpful here.

I'd recommend using PIP to install Jupyterlab.
If you can't open a ".ipynb" file using Jupyterlab on Windows system, here are the steps:

Go to the file --> Right click --> Open With --> Choose another app --> More Apps --> Look for another apps on this PC --> Click.
This will open a file explorer window. Now go inside your Python installation folder. You should see Scripts folder. Go inside it.
Once you find jupyter-lab.exe, select that and now it will open the .ipynb files by default on your PC.
Answer: If you are looking for features that notebooks in JupyterLab have that traditional Jupyter Notebooks do not, check out the JupyterLab notebooks documentation. There is a simple video showing how to use each of the features in the documentation link.
JupyterLab notebooks have the following features and more:

Drag and drop cells to rearrange your notebook
Drag cells between notebooks to quickly copy content (since you can have more than one open at a time)
Create multiple synchronized views of a single notebook
Themes and customizations: Dark theme and increase code font size
Answer: I am more productive with Jupyter Notebook, and I don't need fancy stuff.
I have been using Jupyter Notebook on daily bases for my work in Python, R, and Julia since 2015. I tried Jupyter Lab several times, but it just doesn't feel right. From time to time, I would have some small obstacles from Jupiter Lab's side that would inflict my chain of thoughts and my work. I don't need that, and my clients don't pay me to "play" with the editor's issues.
So, I don't plan to change Jupyter Notebook soon, but I am afraid if the development stops.
Comment: You'll want to look into NbClassic and how the Jupyter developers intend to maintain that. See [here](https://stackoverflow.com/a/76837597/8508004) for additional information and links to further resources.


Another SDK like OpenNI

Question: I am taking information for my project and I need to see libraries ans SDKs. Searching in the web I found that OpenNI has a lot of functions and when I try to found another SDK, I dont find any other. I am working with a Kinect and a XTION so I need an SDK who works in both.
Is there any other SDK o set of libraries that works well in both?
Thanks!
Answer: Try the Point Clound Library (PCL). They claim to have support for both. I've used it with Kinect, it works quite well.
------> Point Cloud Library

Another SDK like OpenNI


Charge distribution for Poisson's equation

Question: I was trying to get Poisson's equation for a discrete charge system. But my calculation is giving result. I used the scalar potential $\phi(r)=\frac{kq}{r}$, where r=$\sqrt{x^2+y^2+z^2}$ to find $\nabla^2\phi$. And i got
$$\nabla^2\phi=\frac{q}{4\pi\epsilon_o}.\frac{3r^2-3x^2-3y^2-3z^2}{r^{\frac{5}{2}}}.$$
At origin,$\nabla^2\phi=\frac{0}{0}$
This result is indeterminate at origin, and also when $r\to0$, but according to Poisson's equation, $$\nabla^2\phi=-\frac{\rho(r)}{\epsilon_o}$$
And for a point charge, $\rho(r)\to\infty$.
$$\nabla^2\phi=\infty$$
at origin.
Why my result and this result vary?
Answer: The potential that you consider is that of a point charge, which has charge density $$\rho(\mathbf{r})=q\delta(x)\delta(y)\delta(z).$$ If you are not used to delta-function, we can state this in words: the charge density is zero everywhere, except a single point (the one where the charge is located.) That is, anywhere outside this point, the potential satisfies the Laplace equation:
$$
\nabla^2\phi(\mathbf{r})=0.$$
Indeed, this is the result obtained in the OP (if we do not forget that $r^2=x^2+y^2+z^2$.) It is not valid at the point where the charge is located, where the denominator becomes zero as well. The way to go around is either use delta-function or build an infinitesimally small Gaussian surface around the charge, convert the Poisson equation to integral form, and show that the integral does not vanish (but rather takes value proportional to $q$.) as the surface radius is reduced to zero. That $\mathbf{r}=0$ is a special point is seen already from the form of the potential, which is singular at this point.
Comment: Ok. So it means that 0/0 can take up the form of $-\frac{\rho(r)}{\epsilon_o}$. Where $\rho(r)=q\delta^3(r)$.
Comment: $0/0$ is mathematically poorly defined. We can speak only of the limit or of generalized function/singularity (which seems to bypass the problem, but is actually grounded in more mathematical theory.) You could try considering potential of a small charged ball, which will not have singularity, but cutoff at the ball surface.


How do I add TF2 to Steam library?

Question: When I click on play now on Team Fortress 2 in Steam, nothing happens.  I have uninstalled and reinstalled steam on my computer, still nothing.  It won't even add it to my steam account.
Answer:
Login to steam.  This will work in the Steam client or your browser, but it may be easier to follow the instructions in a web browser.
Go to TF2's store page
Click Play Game where would normally you would Add to Cart:

Now TF2 will be in your Steam library and you should be able to find it in your list of games and install it.
Answer: Go to the Community hub, search for "Team Fortress 2". Look through the contents and hover over player's profile to see who is playing TF2 right now. If you found someone visit their profile and click on "Join Game".
Steam should prompt you the following.

How do I add TF2 to Steam library?


How does a $2 \pi$ pulse in Cirac Zoller give a -1 sign to the state?

Question: I understand the first step in the Cirac-Zoller controlled-phase gate; about how to move the state from the electronic state to the vibrational mode state. However, I am unable to understand how a $2\pi$ pulse gives the -1 sign to the state and how it is applied conditioned on the vibrational mode. Any help is appreciated.
Comment: Can you include a reference to the "Cirac-Zoller controlled-phase gate"?
Comment: Can you elaborate on what you do (and do not) understand about it?
Comment: It is okay. He is asking about the implementation of C-NOT gate using the scheme of Cirac-Zoller (https://en.wikipedia.org/wiki/Cirac-Zoller_Controlled-NOT_Gate) where the second step is a $2\pi$ "pulse". I can answer the question in detail.
Comment: @SiddhāntSingh I see, thanks for the reference. Ideally, that should have been in the original question itself. Anyway, I've reopened the post now. Feel free to write up your answer.
Comment: I think I can close this question. I have posted another question on the Hamiltonian of the system. If I can get answer to that, I can figure out the CIrac-Zoller gate myself.
Answer: CNOT in ion traps is not implemented in one go. It is decomposed in terms of SWAP gate. The general decomposition they use is:
\begin{equation}
\operatorname{CNOT}_{jk}=H_k \operatorname{SWAP}^{-1}_k C_j(Z) \operatorname{SWAP}_kH_k
\end{equation}
where $j,k$ are the labels for the control and target ion (qubit) respectively, in the array. $H$ is Hadamard gate and $C(Z)$ is the control-Z operation.
Hadamard is just rotations, so we can ignore that for a while and focus on the middle three gates, they are the three crucial steps of the algorithm of Cirac-Zoller implementation in the right order.
The circuit is as shown (Source: Nielsen and Chuang, pg.323)

The Control-Z is what the $2\pi$ pulse is in the second step.
If you follow this scheme of Nielsen and Chuang (sec-7.6.4), the $2\pi$ pulse implements this operation as follows:

We need to switch $|01\rangle \leftrightarrow |10\rangle$ for the control-Z. This is done as follows. We need a way to swap qubits between the atom's internal spin state and the
phonon state (little perturbation over the spin states). This can be done by tuning a laser to the frequency $\omega_0-\omega_z$, and arranging for the phase (which can always be done by the laser) to be such that we perform the rotation $R_y(\pi)$ on the subspace spanned by
$|01\rangle$ and $|10\rangle$, which is just the unitary transform
\begin{equation}
C_{SWAP}=|00\rangle \langle 00|+|01\rangle \langle 10|-|10\rangle \langle 01|+|11\rangle \langle 11|
\end{equation}
on the $|00\rangle, |01\rangle, |10\rangle, |11\rangle$ space. If the initial state is $a|00\rangle + b|10\rangle$ (that is, the phonon is initially $|0\rangle$), then the state after the swap is $a|00\rangle + b|01\rangle$, so this accomplishes the desired swap operation, which is the second step in Cirac-Zoller. Note here that $2\pi$ pulse is just the $R_y(\pi)$ here which is equivalent by just a convention.
The frequency notation is explained in the last image.
I would suggest to read thoroughly the section 7.6 of Nielsen and Chuang to make a complete understanding.


Why is the charge distribution of printed dipole antenna different from patch antennas?

Question: Why in planar dipole antenna current is perpendicular to the feed while in patch antenna the current is parallel to the feed line?
Is the direction of current dependent on the input supply terminals? What are the differences between patch antenna and dipole antenna?
Comment: Remember that these can only be momentarily "snapshots" of what happens and not representative for the whole period of your signal, and also not snapped at the same phase of the input signal. Also, as said in Tim's answer that's not how things look like in a patch antenna.
Answer: Feed direction is fairly irrelevant, as long as it doesn't interfere with the antenna element(s) themselves.
Also the patch diagram is somewhat erroneous, but it depends on what size the patch is.  A resonant patch of square geometry will have several resonances at nearby frequencies (due to different patterns of charge between its edges/corners), and therefore be more difficult to tune, or to use over a wide bandwidth (certainly, there are better designs when bandwidth is desired).  Electrically-short patch antennas have a largely uniform charge density and achieve resonance through internal structures (e.g. high-K dielectric substrate) or matching components.
As for contrasting with the dipole, suppose the patch antenna is longer (in the direction of current flow) than wide.  Then suppose the ground plane (not shown, but implied under the substrate) was brought up to the same level (top surface), opposite the patch shown.  Basically mirroring the structure.  Now bend the feedlines out at an angle, and finally remove the ground plane (somewhat optional), et voilà, the left diagram has been transformed into the right diagram.  In the course of this transformation, of course impedance and radiation pattern have changed


Back up a 12.04 system, then upgrade to 13.04 using a liveusb, then restore backup to regain files. Does that work?

Question: i'm getting ready to upgrade my 12.04 install to 13.04, but i have seriously personalized my system with external PPAs, Ubuntu Tweak, and the like. I backed up my system with Deja-Dup, and I was wondering if once my upgrade is finished, i can get all my settings back in 13.04 by restoring from Deja-Dup.  Will it even be able to restore? Anyway, it's not a huge deal if it can't. I'm still going to upgrade.  I have all the important stuff safe.  It would just be a pain if i had to set up all my settings again.  If you got any ideas, please say.  I'd really appreciate it. Thanks.
Answer: Short answer is no! Don't rely on Deja Dup. You are better off saving all files manually and then putting them back after your install. Here's what happened to me at the weekend:
I did a full deja dup back up on 12.04, selecting a tried and trusted external HD as backup location. No encryption on the back up. Then I did a clean install of 13.04.
My first action after successful install was to restore from deja dup. No can do! It says "no backups to restore".
A look at the relevant folder in the drive shows it contains 1007 volumes of difftar.gz archived files but deja dup, which created these, does not recognise them.
I have been trying to get to the data through the command terminal but all commands are met with responses like "Command line error: Expected 2 args, got 0"
I may be able to get at this data by manual unarchiving each of the 1007 volumes but imagine the time and hassle....
Perhaps I have done something fundamentally wrong (i.e. just followed the deja dup directions). If anyone has advice it would be much appreciated.
Answer: This worked fine for me, moving from 13.10 to 14.04.  The part about cloud backup using Copy.com is not necessary or required, but it's a nice additional safeguard and free.  Also encrypted.

Set up Copy.com (or other choice of free cloud backup utility) to sync a folder on my Ubuntu machine.  Create softlinks in that folder of any files which need more immediate or constant backup -- they don't actually have to be moved into the folder since links accomplish the backup just as well.  You can, however, move files into the sync folder if you really want them to exist only in your cloud backup and its local sync copies on whatever machines you set up.
Create a machine-specific named backup folder for each of your machines inside of the cloud sync folder.  On each of your machines, configure the ubuntu backup utility to backup your home folder to the corresponding backup folder inside the cloud sync folder.
Many common apps cause slight problems with the backup app by unnecessarily setting the wrong permissions on hidden folders inside of your home folder. In most cases you can safely chown -R foo:foo ~ where foo is your username and typically your user group name.  That will set all permissions recursively under your home folder such that backups will not fail for that reason.
Now your regular ubuntu backups will be made and also the backup files themselves will be further backed up to the cloud.
One other suggestion is to add /usr/share/fonts to your backup settings since it's no fun to go and re-download all of your preferred extra fonts after a system reinstall.
At this point you can safely do a clean install of Ubuntu, like from a USB stick (recommended... just use the built-in System Disk Creator which finally works this year, no longer necessary to reach for Unetbootin, though that still works too).
From the clean install, you will of course lose all your installed software and solutions for making that easier is the subject of some other post.  But as far as your personal data (and fonts, if you choose), just set up Copy.com or your choice of cloud sync as one of the first things you do with the clean new system, then do the same ubuntu backup settings config as before.  As soon as your initial sync completes, the ubuntu backup utility is ready to restore your home folder just as you had it before the system install.  Do make intelligent choices at this point if there are config file conflicts; in some cases you may want to accept the new versions of certain files if your new OS version has made certain types of changes.  But that's beyond the scope of this answer.

Good luck and enjoy the resilience and safe recovery that this brings.


How is the strength of a DDoS attack measured?

Question: The DDoS attack on Dyn by Mirai malware that disrupted the internet was largest of its kind in history. Experts say that its strength was 1.2 Tbps. I don't understand the math behind it. How is the strength of a DDoS attack calculated?
Comment: It's unclear what you are asking: don't you understand what 'TBps' means (Terabytes per second, i.e. unit of bandwidth) or don't you understand how one can measure bandwidth of an attack or don't you understand how bandwidth relates to strength of an attack?
Comment: i know what Tbps stands for. so its just measuring the bandwidth huh. I was thinking there is more behind it. Anyways you know sometimes we never expect simple things. But, thanks buddy
Answer: It sometimes is hard to measure the exact size of a DDoS attack. When links get saturated you can't tell from the victim's perspective how much more traffic was sent to your network than your network's links could handle. If your network has a 100Gbps uplink, you can't tell the difference between a 100Gbps attack and a 1.2Tbps attack from within your network, since the effect is the same: the link is saturated.
The only place you can check that is at the upstream networks of the network under attack. But it can be the case, especially with enormous attacks as on Dyn, that even links on their network get saturated, so you'd have to check statistics for traffic towards the victim of the DDoS on their upstream networks as well.
Calculating the exact size of the attack may get even more complex when networks between the attackers and the victim are filtering some of the DDoS traffic. Some network automatically filter or rate limit known bad outbound traffic from their network, so it never even reaches the network under attack or its upstreams.
To sum it up: it's hard to give an exact measurement of the size of a (large) DDoS attack, but by aggregating statistics of the network under attack and its upstreams you can make an educated guess.
Comment: It turns out that the OP didn't know what 'Tbps' meant a bandwidth calculation ...
Comment: great man, it'll help @ Teun
Answer: Tbps or terabits per second. Is a measure of the amount of data being sent every second. bits and bytes differ in that a byte is 8 bits, and a bit is basic binary, either 1 or 0. here we are dealing with bits.
1000 bits = 1 kb or kilobit.
1000 kb = 1 mb or megabit
1000 mb = 1 gb or gigabit
1000 gb = 1 tb or terabit.
so from this you can kind of get a scope of the amount of data being sent per second.
it's calculated likely from logs off internet backbone routers or even real time monitoring of traffic. No rocket science here.


Area of a special isosceles spherical triangle

Question: I was asked to calculate the area of the following isosceles triangle.

Let $\triangle ABC$ be an isosceles spherical triangle with $d(A,C)=d(B,C)$. Then $C$ lies on the perpendicular bisector of $AB$. Let $M$ be the midpoint of $AB$. Suppose $d(A,M)=d(-M,C)$. Calculate the area of $\triangle ABC$.

I already made a sketch and observed that $d(A,M)=d(-M,C)=\pi-d(M,C)$.
Let $\alpha$, $\beta$, $\gamma$ denote the interior angles corresponding to $A$, $B$, $C$ respectively.
If I assume without loss of generality that, because $C$ lies on the perpendicular bisector of $AB$, the angle $\gamma$ is divided into two equal angles $\gamma_1$ and $\gamma_2$ belonging to the right triangles $\triangle AMC$ and $\triangle BMC$. Since
$$\operatorname{area}(\triangle ABC) = 2 \cdot \operatorname{area}(\triangle AMC) = 2 \cdot \operatorname{area}(\triangle BMC)$$
I only need to calculate $\operatorname{area}(\triangle AMC)$.
Since $\operatorname{area}(\triangle AMC)=\alpha + \gamma_1+ \frac{\pi}{2}-\pi$, I need $\alpha$ and $\gamma_1$. I first tried to calculate $\gamma_1$ using the spherical Law of Cosines, and I got this:
$$\cos\gamma_1=\cos\alpha \cdot \cos\frac{\pi}{2} - \sin\alpha \cdot \sin\frac{\pi}{2} \cdot \cos d(A,M)=-\sin\alpha \cdot \cos\left(\pi-d(M,C)\right) \tag{1}$$
From the spherical Law of Sines, I get:
$$\sin\alpha= \frac{\sin d(M,C)}{\sin d(A,C)} \tag{2}$$
But now I do not see how to proceed. I would like to calculate the right-hand sides of $(1)$ and $(2)$, but this does not seem possible with the data I have. Or is this meant to be solved another way? I am not allowed to use Napier's rule since it was not proven in the lecture.
Answer: A more geometric approach starts with extending the line segments $MC$ and $MA$ to their meeting point $-M$.
This creates a bi-angle between $M$ and $-M$ with area $\pi.\, AC$ divides this bi-angle into two congruent triangles because $d(A,M) = d(C,-M)$, so $\bigtriangleup$$AMC$ has area $\frac\pi2$ and $\bigtriangleup$$ABC$ has area $\pi$.


Note durations in instruments

Question: I am so confused about note durations in guitar. I know what note duration is. In guitar, if i play the low E string, it vibrates for a long time(sustain). I have no problem with the fretted notes because I can mute it by lifting my finger off.  I see players that doesn't mute and it makes the solo sound rich but sometimes it is unwanted. If one note is played and the next is played, does the second note cancels out the first note?
Comment: I think this question shows you have a misunderstanding as to what note duration is. It's probably worth reading about such terms as legato and staccato, as well as damping notes and letting notes ring
Comment: There are several different implications involved in this question. Please specify more clearly exactly what it is you need explaining. Any answers now would end up far too long.
Comment: I'm having a hard time getting a grip on what you're asking. One thing that might help is to pick your most important question and ask only that question. You can edit this by clicking the grey "edit" text in the lower left. Consider clicking that "edit" and removing all but one of your questions. One thing I can say is that it is very, very common to play more than one note at a time on both guitar and piano. And you can play one note and hold it and then play another note and have both notes still ringing. That happens all the time.
Comment: Are you asking how to stop a resonating string, or whether or not a string should be allowed to continue to ring if the sheet music does not explicitly say so?
Comment: lollel - please read all the comments and try to identify what it is you are actually asking. Currently your question doesn't make much sense. I think Tetsujin and ggcg have written very good answers, but we can't really tell if they answer what you need answered. If you can edit your post accordingly, we can hopefully reopen.
Comment: I think the question is: "do note durations always have to be played according to their literal theoretical interpretation, or can I sometimes legitimately let a note ring much longer than its written time value, if it's easier to play or clearly sounds better or correct that way, or maybe it wasn't even meant to be played strictly as written." It's a good question.
Answer: The question is confusingly worded but it sounds like you're looking for solutions to damp unwanted, unfretted strings from vibrating after the intended note duration.
This is done by either left or right hand depending on the situation.
Left hand - just rest a finger on the string to damp it.
Right hand - rest a finger, or the palm of your hand to damp.
Basically you use anything that's not currently needed elsewhere to cover off strings you don't want to ring. Initially that may feel like a lot of juggling, but eventually it becomes second nature.
Comment: @Tetsujin - I think this may be at the heart of the OP's problem. An awful lot of classical guitar music is written in a simplified manner. I come across stuff which if payed exactly as writ sounds awful. The bass note is often shortened, but obviously the piece sounds better when it's let ring. Even found this on guitar exam music - had a student from a different teacher who actually taught the piece with truncated bass notes. Sounded awful - but could have been technically correct, but it sure wasn't musical! Discretion, maybe?Sheet music for guitar isn't set in stone always, figuratively or
Comment: But does that change the sheet music if i don't mute?
Comment: I have no idea what you mean by that, really.
Comment: I mean if you just ring out the string, the note duration will be longer, so i am asking whether it would change the sheet?
Comment: The sheet is printed. it's figuratively set in stone. If you play a note longer than is written it's either wrong but you get away with it because it sounds fine, or wrong & sounds bad.
Comment: @Tim - for sure, I'm with you on interpretation… but we don't have enough in question or comments to really work with.
Comment: Quite frankly I think the question should be improved or closed.  It seems like everyone of confused by the wording.  But we could help the OP clarify for us.
Comment: @ggcg - check out the OP's other questions. It's not getting any clearer, I'm afraid :\
Answer: "If one note is played and the next is played, does the second note cancels out the first note?"
I think that this is at the heart of your question.  I assume you know what a whole note, half note, etc are and how long they should last in terms of beats in a given time signature and tempo.  However you seem to be confused about whether it is necessary to stop a note as soon as its required duration is over or if you can let it ring as you play other notes.  This is a very interesting question and one that I think, if properly interpreted, could lead to many interesting answers.
A strict interpretation of the sheet music would indicate that once a note duration is finished you don't play it any more.  On a woodwind or other instrument it might seem clear when a new note is played the last note is stopped.
What a guitarist does will depend on several factors.
First, the guitar is an instrument that decays fairly quickly compared to other instruments (depending on type and construction) and the notes are not driven like on a woodwind, brass, or bowed instrument like violin.  As such, once a note is plucked its life is pretty short.  This leads to the opposite problem to the one you just described.  Namely, how can I keep the note going if it dies before its time is up.  Guitarists will apply tremolo technique to simulate a driven note, like the violin.  But that does not mean they should when playing whole notes in a baroque era piece.  The technique is usually called out specifically for effect.  So in many cases holding the note down will not really cause problems as it will die on its own anyway.
Second, the classical guitar (acoustic more generally) relies on resonance to improve the overall quality of sound and volume.  When you play a G on the high e string the open G string should vibrate in sympathetic resonance, as will other strings that have G as a harmonic.  This is a desired feature and one that classical guitar texts will urge the player to take advantage of.  Along these lines many guitarists will finger notes in a chord that are not going to be played just to achieve this effect.  In other words you want to use the left hand to finger notes not in the music but that are in sympathetic resonance to notes in the music to create a full rich tone.  I only do this with chords and chord melodies where multiple notes are already indicated in the music.  I would do it on a fast scale run for example as there isn't time to move quickly and perform additional gymnasts. Regardless one does not typically mute strings while playing scale runs (unless the sheet music calls for it) and the "ringing" adds a nice reverb effect.
Third, related to time are a few factors.  One is the resonance and decay issue mentioned and the other is whether or not you can (1) lift the finger up to stop the note, or (2) dampen it with another finger without creating ugly buzzing sounds.  Whether or not a player chooses to do this on their own depends on whether they feel it needs to be done, all things considered, and that they can actually do it without making a mess.  Also, you may have no choice but to lift them as they will be needed sooner than later and you don't want them locked down.
Fourth, does the sheet music ask for a specific technique to be used.  In some cases the composer may not want ringing and in other they may want more.  In some cases there will be notes in the sheet music indicating what to do.  Guitarists will often practice a piece several different ways to create multiple interpretations of the music.
Next, style is a factor.  If the music is a fast staccato percussive piece then the more things resonate the worse it may sound.  In contrast for a slow ballad the resonance can add effect.  If there is a true dead spot in the music then the guitarists should in fact mute using one of the techniques mentioned in previous answers.
One final issue may be key or chord change where previous notes conflict with the new chord.  In this case you really want to make sure the older notes are damped to avoid unintended harmonies.
You had motivated your question with "I see players that doesn't mute and it makes the solo sound rich but sometimes it is unwanted", well that is correct, sometime resonance is wanted and sometimes not.  The real issue to me is are you seeing 2 different guitarists play the exact same piece differently or are you commenting on what you think is 2 conflicting ways to play the guitar?  In reality both methods are valid and I'd expect a guitarist (acoustic) to master both methods.  They can then choose to use them as an interpretive tool or execute them when the sheet music demands it.  As for whether a stop to duration in the sheet music demands a stop in the note, that is a matter of taste as other strings will resonate anyway.  A guiding principle for me is if the note that is ringing is in harmony with the next note in a chord melody sequence I don't worry about the ringing and leave it if it sounds good or if I don't need that finger right away.  But if there would be conflicting harmonies or if I'm playing single note lines I do not attempt to let it ring.
I hope that addresses some of your thoughts.

Note durations in instruments


How many 90 day periods in 2 years

Question: Traveling across USA having entered using the visa waiver program, having been approved for an ESTA. If I enter Canada for a few days, and then re-enter the United States, does my 90 days refresh upon re-entry?
Comment: The title and body of your question are quite different... What is your actual question?
Comment: I don't believe the suggested Q&A is quite appropriate as the OP probably does not live in Canada.
Answer: Generally, you do not get a new 90-day period on VWP if you have only been to Canada, Mexico, or adjacent Caribbean islands since your last stay on VWP. So you would only be admitted until the expiration of your previous 90-day period.
However, if you travel beyond those countries, e.g. it you go to Central America, and then return to the US, you can get a new 90-day period of admission on VWP, and there is no "limit" to the number of times you can enter on VWP in a 2-year period.  (Of course, whether to admit you is still at the discretion of the officer, and if you visit the US too frequently you are more likely to be denied entry for immigrant intent.)
Answer: No, not only does it not 'refresh' it it, but the days spent in Canada (and Mexico) count to the 90 days.
See answer to us visa waiver program - Leaving Mexico after 90 days as part of ESTA requirements for more details.
Comment: The reality is rather more complicated than "days spent in Canada and Mexico count to the 90 days."

How many 90 day periods in 2 years


How to calculate orientation of line segments using open source GIS?

Question: I'd like to calculate the orientation of line segments relative to north direction using open source tools. Which tools or functions would you recommend?
Comment: agreed, no need to do more any more work than absolutely necessary
Comment: Just to note unlike your question about line lengths this can be done mathematically really without the direct need of a GIS system (especially if the coordinates are projected). The line lengths is more difficult mainly because the longest line is not necessarily from one vertex to another vertex.
Comment: @Andy W.: Yes, I figured that a GIS wouldn't be necessary, but it would be nice to know if it's already implemented somewhere :) I'm feeling lazy.
Answer: To get an angle from a line you just need to find the angle of the normalized direction. The Atan2 function is available on every computing platform I have used, even calculators. The basic idea is to get a normalized vector for the direction of that line then get the angle.
var normal = line.Direction.GetNormalized();

For your case since you need it to be north (+y hopefully) relative and possibly clockwise you could reverse the inputs to Atan2 like so:
var radians = Atan2(normal.x,normal.y);

And if you need counter-clockwise negate the result of Atan2. For degrees just multiply by 180 then divide by PI. Also note that when the result is negative you can add 2*PI.
if(radians < 0) { radians += 6.28... }

Edited: to correct an error for counter-clockwise.
Note: only works if North is always up.
Comment: Open source version: http://gist.github.com/604912
Comment: Hey, I just found out I could really benefit from this code in my task. One thing, I have no idea which is the programming language it is written, could you please tell me so that I can use it? Is it java, javascript, c? thanks in advance!
Comment: @umbe1987 That code is JavaScript but it should be easy to translate to any language as it is a simple function.
Answer: To muddy the water a bit: what projection are your line segments in? The answer depends! If you're it's a Mercator projection, Dandy's answer works. (In a Mercator, lines are rhumb -- by definition, holding the same compass direction for their length.)
In general, however, a line on a map will not correspond to the same compass direction (azimuth) along its entire length -- so your question doesn't always have an answer.
It might be acceptable for you to just assume your lines are rhumb, or to calculate two directions -- one at each endpoint, or to compromise and calculate the direction at the midpoint . . . .
Comment: Thank you for your comment, you're right. Luckily the lines are in a Mercator projection.
Comment: Should have clarified that a bit better. That would definitely take the easy out of it.
Answer: GRASS GIS (http://grass.osgeo.org/) offers native directed graphs (i.e. vector lines). See "Vector network" screenshots here. Furthermore, there is the m.cogo tool included.
Comment: So m.cogo adds the orientation (and distance) to attribute table or will it just output the same format it needs for the reverse operation (bearing + distance to coordinates)?


One shot manga about two strangers that meet each other in heaven

Question: I read this one shot years ago like around 2007? All I can remember is it was a one shot about a guy and a girl that die and are complete strangers. They meet in the afterlife and talk about their lives. Eventually God is willing to give one of them a second chance and they fight over who should get it saying the other person deserves it more. In the end the girl gets a second chance I think...
Comment: Welcome to the site! This is a good start with detail. If you remember anything else at all though please [edit] that detail into the question. For example, did you read this online? If so can you remember what site? When you say they fight, do you mean an actual physical fight or more of an argument? Do we see anything that happens after she gets a second chance or does it end there? Why does God give one of them a second chance? etc.
Answer: I had a similar memory of a one-shot just like you described and after almost 6 years I found it (hopefully it's the own you're looking for)
Name: Happiness upon you / 幸せをあなたに / Shiawase wo Anata ni
By: Avogado6
(If it's not what you meant, sorry and hope someone else can help)
Comment: Hi, welcome to SF&F!  It would be great to get this old question answered; can you provide some more details about this, so it's possible to see how well it matches the question?
Comment: Note: This looks reasonably likely.  Boy was killed by abusive dad, girl bullied into suicide, meet in line for reincarnation.  Get randomly assigned their next life; boy gets a good life with good parents, girl gets abusive family.  As they wait for their turn, boy asks to look at her ticket, shows her his.  As his number comes up he runs through the reincarnation gate with her ticket, ensuring she gets a good life.  (They don't fight, though, he simply tricks her.)


texlive on Mac: how do I "switch repository" as message says

Question: I run OS 10.10.5 on Macs. I have teX Live Utility version 1.21. When I run it I get a window that says :Repository has a different TeX Live version, The repository at http://mirror.ctan.org/systems/texlive/tlnet has TeX Live 2015, but you have TeX Live 2014 installed.  You need to switch repositories in order to continue."  I do not know what this means. What do I do? How do I "switch repositories"?
Comment: It means that updates for TeX Live 2014 are no longer available on CTAN. What version of TeX Live Utility are you using? It should automatically switch to the backup repository for TL 2014 in this case.
Answer: You can change your repositories with Configure > Manage Repositories.
Note that one can only update to TeX Live 2015 (which is highly recommended, as it contains many improvements) by downloading a fresh installation of MacTeX.
Comment: Under Configure > Manage Repositories only the URLs to different download sites can be managed, none of which indicate that they would be only for the updated TexLive version?


Salesforce1 Add Standard Actions in page layout

Question: Does anybody know, how to add a custom (action) button like this?
I just can use the default edit, delete an clone actions.
Following the Salesforce1 App Guidelines , it should be possible
to add custom actions to this section.
Answer: Indeed, it is true that most custom buttons will not be visible in the Salesforce1 context.
Custom buttons that DO work are those linked to a visualforce page where the standardController is set to the object on which your button is made.
Visualforce pages that don't use this standardcontroller won't work either.
Also keep in mind that your visualforce pages need to be marked as "Available for mobile".
You can set this by going on your visualforce page through the setup area.
But be mindfull with the use of this...
If you could achieve the same functionality via a publisher action (ex. create child records) with point and click, I would definitly advise to just use publisher actions instead.
EDIT since question is related to approvals in specific:
Approval processes and Salesforce1 is something that isn't fully integrated yet.
So indeed, the "submit for approval" that you would normally get isn't available.
You can read more about it here:
http://help.salesforce.com/apex/HTViewSolution?id=000187495&language=en_US
and here
http://help.salesforce.com/apex/HTViewSolution?id=000187389&language=en_US .
I do know that you could submit a record for approval via code.
You can read all about that here,
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_process_example.htm
So basically, you could create a visualforce page with a standard controller to your object where you put the code that submits your record for approval.
Comment: Ok, thanks! So in case of trigger an approval process with custom button, i just have the opinion to use publisher actions?
Comment: updated my answer since the question is more related to approval-specific logic. I'm not sure if there is a possibility to submit a record for approval through publisher actions though.
Comment: Yes,I know this sources, but i think, currently is the publisher action (post) related to the feeditem object the best way to trigger an approval process from Salesforce1
Comment: Do you just need users to be able to approve? (like this: https://help.salesforce.com/HTViewHelpDoc?id=approvals_for_chatter_enabling.htm&language=en_US) Or do you also want to submit records for approval to other users? I'm not sure how you would be able to submit records for approval via that way. If you could post some screenshots on how you eventually solved your issue, that would be great!
Answer: So my solution is a combination of the post publisher action.

and an trigger on the the Feed_Item object like this:
trigger Feed_Item on FeedItem (after delete, after insert, after undelete,

after update, before delete, before insert, before update) {
if(trigger.isBefore && Trigger.isInsert) {
      for (FeedItem f : trigger.new)
      {
         if (f.Body.startsWith('!')) {
           System.debug('-#-#-#-#-#-#-#-#-#-: ' + f.parentId);
           approval.ProcessSubmitRequest aprlPrcs = new Approval.ProcessSubmitRequest();
           aprlPrcs .setComments('Submitting record for approval.');
           aprlPrcs.setObjectId(f.parentId);
           approval.ProcessResult result = Approval.process(aprlPrcs);

           f.Body='Submitting record for approval';
         }
      }
}

}
=> i can submit my Custom Object for approval by typing ! into the post field...
Comment: that's pretty cool :). I'm wondering, what would be even nicer is to use a topic (for ex. "Request for Approval"). Then you could also easily see all records that were requested for approval. From spring14 you could even create a view showing all records of type X or Y that were submitted via approval this way. This is an interesting topic. Especially since there is for the moment no builtin way yet to submit records for approval from Salesforce1.


Word for misusability

Question: I'm trying to articulate a question on stackoverflow. In the question, I state that I'm designing an API, and I want to minimize "misusability" within that API. "Misusability" is not a word, as far as I know, so I'm asking whether there is another word that can communicate something along the lines of "misusable" or "not misusable".
Comment: "minimize the chance/likelihood of misuse"?
Comment: I might use the phrase "susceptibility to misuse."
Comment: or "minimize the scope for misuse"
Comment: [Pervertible is a word](http://www.merriam-webster.com/dictionary/pervertible); so *pervertibility* should be - dictionary.reference.com [has it](http://dictionary.reference.com/browse/pervert). It has sexual/moral connotations though that might not be desirable. That's the best I can come up with a for single word.
Answer: Perhaps misapplication or misapplicability will work for you.

misapplication noun: incorrect or improper use. "this silly gossiping is a serious misapplication of your time." (Merriam-Webster online)
Comment: I think *misapplication* is just synonymous with *misuse* and would still require words to indicate the ability to be misapplied (so *misuse* would be better). To include the ability the answer would need to be *misapplicability* but that sounds like the opposite of *applicability*, which is more about the API being unsuitable than misused.
Comment: @LittleEva Avon is right. I'm not looking for a synonym for misuse, but a way to describe the tendency or ability to be misused.
Comment: Something like, *misapply*? Some situation where something is applied inappropriately?
Comment: The ability of it to be misapplied/misused if I understand correctly.

Word for misusability


Magento 2 table name for product visibility

Question: In which db table magento is saving the product's visibility such as catalog/search , catalog, search, Not visible.
Answer: SELECT *
FROM `eav_attribute`
WHERE `attribute_code` = 'visibility'; # Example : attribute_id = 96

SELECT *
FROM `catalog_product_entity_int`
WHERE `attribute_id` = 96
    AND entity_id = '1'; # entity_id = Your Product Id

Visiblity
1 => Not Visible Individually
2 => Catalog
3 => Search
4 => Catalog, Search

Comment: It is best to also use `entity_type_id = 'product'` when searching the `eav_attribute` table as it is possible to have another "visibility" attribute (or if searching for something like status)
Answer: Cause:
This problem arises because the Scope of Visibility attribute is Store View by default. This means that it's value is set differently for each store.
Solution:
There are two solutions:-
1) Either, change the Visibility of the product to Nowhere for each store you have.
– While editing product, in the top left corner, you will see 'Choose Store View'
– Choose the store where you want the product visibility to Nowhere
– Now, edit the visibility to Nowhere and Save the product
2) The second solution is to directly change the Visibility attribute Scope.
– Go to Catalog -> Attributes -> Manage Attributes
– Edit Visibility attribute
– Change the Scope to 'Global'