High Voltage Power supply with current limiting output

Question:
I found this simple PSU design on the web. I tried to use it but already 5 MOSFETs and 2 npn transistors are blown. I use IRF840 and BC546 or KSD1616AGBU transistors and fixed value resistors in place of VR1. The load is about a 60 Ohm resistance wire and i mesaured the current which is 4 Amps so it's not limited. The voltage is somewhere between 250 and 300 Volts. When the current rises on R2 it's supposed open Q2 transistor that would set the gate and source of the mosfet equal hence it would close it down but it doesn't happen. After the failure i measured the mosfet and the source drain is shorted (I assume the diode is gone) but i'm no sure what's going on. Can anyone help me what may possibly go wrong or just recommend a proper circuit that does the job? I searched through the web and found some circuits but they seem to be just a more complex variation of this one using the same current sensing techinque so i'm a little uncertain. Thank you
Comment: QI needs a big heat sink.
Comment: Draw a schematic of _your_ circuit.
Comment: I suspect what's killing you is the power-on surges. Try placing a \$10\:\Omega\$ resistor between the output of your 4-diode bridge's positive terminal and \$C_1\$. For starters, anyway. \$R_2\$ is already going to limit currents to perhaps \$200\:\text{mA}\$, so you'll only lose \$2\:\text{V}\$ with the addition, at \$C_1\$. But I'm mostly curious if this helps you. If it does, then we've isolated the problem.
Comment: @Jasen Somehow, I guess I sort of assumed there was a heat sink. But perhaps you nailed it!
Comment: For a resistive wire you should really use PWM to control the power. It makes no sense to use a linear regulator.
Comment: I appreciate all your help. My mistake was that i replaced the 3.3 Ohm resistor with a 1.1 Ohm and it allowed approx. 0.6A current to flow. With 300V it gave 180W on the FET. I should have drawn a circuit and shown that. My apologies. I used the resistive wire only for experimental purposes because it can handle high watts. Thank you all.
Answer: The reason your mosfets are shorting is simple. You are pushing WAY too much power through them. Yes they are rated for 400 Volts. And yes, they are rated for 10 amps. But their wattage rating is only 125W. At 300 volts and 4 amps, you are trying to get 1200W of power out of this circuit. At best, shunt regulators like this have 60-75% efficiency, so at 1200W out, that little FET is trying to dissipate 300W or so all by itself. Frankly, I'm amazed the whole thing did not go up in smoke. For what you are trying to do, you probably need 4-8 of those mosfets in parallel to drive that kind of load.
Comment: Thank you very much. Your answer pointed me to the right direction. Because I didn't have a 3.3 Ohm resistor i put in a 1.1Ohm which allows approx. 0.6A current to flow and with 300V it results in 180W on the mosfet. I found a 4.6 Ohm resistor and it works fine with it. Now I measured only 0.11A and the FET doesn't blow any more.


Why does the server in S/KEY authentication only store a single password?

Question: I've been reading about the S/KEY One-Time Password system on wikipedia here and was wondering why the server only stores a single password and not the list of one-time passwords like the client does.  In other words, why is the implementation not a simply a password-to-password compare but instead a cryptographic hash function is run on the password and then the result of that hash function is compared to the previous One-Time-Password the client sent to the server?
Answer: Applying the hash function assures that only the next password in sequence will be valid.  There is no reason to store the previous state, or the client's original secret.  Once a valid key is used, the server stores the hash of it (which is the same algorithm used to generate the list of hashes in the first place.)  This puts the burden of storage on the client, meaning the server doesn't need a 1000 rows in the database for each user.
Of course, this algorithm was developed in the days before hardware boxes capable of testing 1.5 trillion hashes per second were commercially available.
Comment: Is the burden of storage issue more related to who is responsible if the passwords are leaked versus storage capability?
Comment: It started as both, really. S/KEY makes storage and the key change mechanism simple on the server, and the user's secret is always protected (as much as a hash can protect a password.) And the amount of storage per user is fixed. This used to be critically important in the days of mag tape and punch cards, long before the advent of terabyte drives and SANs. These days we think nothing of keeping megabyte sized digital photos of users, and storing a few extra kilobytes of keys wouldn't make much of an impact. The concern today is the inadequacy of hashing as a protection mechanism.


Connect raspberry pi to wifi on customer location

Question: I need to install the raspberry pi at a customer location and then make the pi connect to the customer's wifi. Is there a convenient way to do this without needing a monitor, keyboard and mouse attached to the raspberry pi?
Edit: I am using Pi 4 and the latest Raspberry Pi OS Full (64 Bit, Debian Bookworm). I also don't have wired (ethernet) access to the router. Ideally, I would like to provide the customer with the ability to enter the wifi credentials themselves when connecting the pi to the wifi
Comment: This is Pi 4 and the latest Raspberry Pi OS Full (64 Bit, Debian Bookworm). All I need is to connect the pi to the internet to set it up.
Comment: Is this a wired connection or WiFi? If wired then you don't need to do anything except plug it in. If WiFi you need the `ssid` and `password` which can be pre-defined on the Raspberry and it should just connect. To let the customer enter their own `ssid` and `password` you'll need to write a program that collects those and stores them in /etc/NetworkManager/system-connections (in an .nmconnection file). That could be done with a bash script that runs `nmcli`.
Comment: @Dougie I found this - https://github.com/balena-os/wifi-connect. But I couldn't get this to install. The script they have provided errors out as mentioned in this issue - https://github.com/balena-os/wifi-connect/issues/411. Do you know any solution similar to this?
Answer: There are many ways of doing this (depending on who is doing it and what equipment they have).
See How do I set up networking on Raspberry Pi OS - Bookworm for general pointers.
If I were doing this I would enable ssh then connect the Pi Ethernet to a router or laptop. (This is how I setup a new Pi.)
You can then setup using nmcli:-
nmcli dev wifi list will scan for wireless networks.
sudo nmcli --ask dev wifi connect ssid will connect to a network.
Comment: thanks! Is it possible to do this using GUI? We want this process to be as simple as possible since the pi might get disconnected from the wifi in the future when we are not around. In such a situation, we would like the clients to themselves reconnect the pi to the wifi.
Comment: @RSK did you read the linked post? It explains all the options.


Remove lookup value once selected in a record

Question: If I select a value on a lookup field on a particular record, is there a way that this selected lookup value gets hidden and does not display in another record? Lets say  I have an object Object1__c which has a lookup field (Object2__c). Object2__c has 3 records "A, B and C". Now I create a new record on Object1__c and select value "A" on lookup field. Now when I create a 2nd record on Object1__c , the lookup field should only give me the option to select either B or C. not A. Is this poosible?
Answer: Lookup fields such as your Object1__c.Object2__c field can have a lookup filter defined. To exclude the already selected Object2__c instances in such a filter, you then need say a checkbox field Object2__c.InUse__c to use in the filter expression. A trigger can populate that checkbox field on insert/update/delete/undelete of Object1__c.
The trigger would look like this in its basic form:
trigger Object2InUse on Object1__c (after insert, after update, after delete, after undelete) {
    Set<Id> o2Ids = new Set<Id>();
    if (Trigger.isInsert || Trigger.isUpdate || Trigger.isUndelete) {
        for(Object1__c o1 : Trigger.new){
            if (o1.Object2__c != null) o2Ids.add(o1.Object2__c);
        }
    }
    if (Trigger.isUpdate || Trigger.isDelete) {
        for(Object1__c o1 : Trigger.old){
            if (o1.Object2__c != null) o2Ids.add(o1.Object2__c);
        }
    }
    if (o2ids.size() > 0) {
        Map<Id, Integer> m = new Map<Id, Integer>();
        for (Id id : o2ids) m.put(id, 0);
        for (AggregateResult ar : [
                select Object2__c i, count(id) c
                from Object1__c
                where Object2__c in :o2ids
                group by Object2__c
                ]) {
            m.put((Id) ar.get('i'), (Integer) ar.get('c'));
        }
        Object2__c[] o2s = new Object2__c[] {};
        for (Id id : m.keySet()) {
            o2s.add(new Object2__c(Id = id, InUse__c = m.get(id) > 0));
        }
        update o2s;
    }
}

and the filter criteria on the Object1__c.Object2__c field would be:
Object 2: In Use EQUALS False

Answer: The answer to your question depends entirely on how you define the look-up relationship. For example, is it a formula? Think of the case where a look-up is to a User. With the exception of where someone is the Owner or the WhoID, It doesn't matter to which User. It's often arbitrary and the same one could be selected many times over.
One could make a similar analogy to a look-up for Contacts when a relationship isn't specified. Unless you define a relationship through a formula in the look-up involving the recordID's, I don't see how it would be possible to do what you ask.
Comment: Thanks for your inputs. But how to create it.
Comment: It almost seems as though you need to create some kind of junction object that sits in-between the two to act as a "dynamic filter", where once a record has been used, it becomes no longer available for additional look-ups. I'll have to give it some further thought and think about how that could be implemented.
Answer: To control what will be displayed in the lookup popup using the standard functionality, you may have a look at Lookup filters:
https://help.salesforce.com/apex/HTViewHelpDoc?id=fields_lookup_filters_defining.htm
But I guess you can't do it with that.
Validation Rules are not option, because the do not help to filter the possible options. So it looks like you have to think about a Visualforce page.
Comment: Thanks for your inputs. VF page is not an option as its just about creating records through Standard Salesforce detail page.
Comment: Beside Lookup Filters there is no other option to control the available objects in the lookup popup. At least as far as I know. On standard pages you could probably try very hacky things by injecting a custom javascript and bypassing the standard lookup process entirely by something custom - but this would end up in other problems...
Answer: You could do this with a Visualforce page and populate the lookup value with an <apex:selectList/> where the <apex:Options/> (List<SelectOption>) come from a SOQL query on Object2__c. You could keep track of what records from Object2__c you've already added in a Set<Id> or List<Id> and then simply update the List<SelectOption> SOQL to not include what you've already added.
As previously mentioned, filters or validation rules wouldn't work for this scenario.


Addressing Form objects with dynamic name

Question: I am using Cognos web reporting and we commonly use Javascript to manupulate the tool generated objects.
In this case, I have some textboxes on the page which are generated by Cognos and I can access them in javascript as: fW._textEditBoxAsia.value
Here, fW is the form name and _textEditBoxAsia is the tool generated field name for textbox.
I want to actually loop through all the textboxes and I know their names will be _textEditBoxAmerica, _textEditBoxEurope, _textEditBoxAustralia, and so on. I have the list of regions in an array. I just want some dynamic way to address the textboxes.
So, something like this:
for (var i=0; i< array.length; i++)
{   (fW._textEditBox + array[i].value).value = 0 ;   }

Can you please guide me on how to achieve the above?
Answer: for (var i=0; i< array.length; i++)
{
    document.fW["_textEditBox" + array[i]].value = 0;
}


What is the difference between a Diphthong and a heterosyllabic sequence of two vowels?

Question: For example what is the difference between /aɪ/ and /a.ɪ/ or between /au̯/ and /a.u/? how they be distinguished from each other?
Comment: the fact that it isn't even entirely settled whether syllables exist in all languages, let alone how to define syllables, even in those languages where their existence is relatively uncontroversial makes this a rather trickier question than it might first seem
Comment: It's the difference between _I_ and _Ayee!_
Comment: In reading the responses, you should clearly distinguish what implicates an auditory difference and what implicates a theoretical distinction.  For instance, in classical Greek and Latin versification, two consecutive short vowels can never end a verse, but a diphthong always can.  This difference means that such Greek and Latin speakers felt a rhythmic difference between the two, but doesn't reliably tell you how they made this distinction in regular speech.
Answer: You can think of a diphthong as being like a vector. It starts at a given point and immediately starts changing in quality till it reaches (or doesn't quite reach) its endpoint. The two symbols used to represent it can be thought of as beginning and end points of the vowel. The fact that one of the two symbols used has a short length mark reflects the fact that diphthongs normally increase or decrease in intensity.
Two consecutive vowels, in theory, are two separate monophthongs that don't change in quality. However, in realty there will often be some change in vowel quality during the production of a notional monophthong.
The difference phonologically is that a diphthong is a single phoneme whereas two monophthongs is two phonemes!
Answer: The difference is that aʊ is a sequence within one syllable, and a.ʊ is a sequence in two syllables. In the domain of one-syllable representations, where are two sub-variants: long diphthong ("acts like two vowels") and short diphthongs ("acts like a single vowel"). The appropriate question then is, how does the analyst decide which is the correct analysis?
These issues are decided based on analogical reasoning. The long / short question may be resolved by reference to contrastive monophthongal length, indeed it is a classic argument for the two timing slot theory of long vowels that long vowels and diphthongs behave the same way for processes that count the number of vowels (stress, tone assignment, syllable structure). Somethings vowel sequences behave like short vowels, in which case one posits a mono-syllabic mono-moraic analysis (examples: North Saami short dipthongs, Anii diphthongs in general).
Diagnosing the difference between monosyllabic bimoraic [au] and bisyllable bimoraic [a.u] requires having a diagnostic that clearly identifies syllables rather than moras (timing slots), and that is very hard to come by – this is why the prosodic analysis of diphthongs is so slippery. There are a few languages such as Kikamba which present a surface contrast between long vowels and bisyllabic (identical) vowel sequences (the realization is a durational difference), but usually, there is no contrast. One generally looks for evidence of the type "acts as a unit" or "acts as two units". It has proven notoriously difficult to establish beyond a reasonable doubt that any language has syllables (which is why Strict CV theory is a viable theory). Generally, analysts (not Strict CV participants) assume that the syllable is a universally-available unit, which means that you always have the option of [VV] versus [V.V]. In that theoretical context, the decision is usually made by reference to some other structural claim, such as "In this language, all syllables have an onset". If that is so but there are also two-vowel sequences, then they must be monosyllabic diphth.ngs.


How to greet your workmates casually in Japanese IT field office?

Question: How 30-50 year old Japanese male would say hello to another male colleague in same age in same organisational level in IT company? I'm looking for everyday based not formal way to communicate.
Comment: Tell us the reason why you posted this question. (1) Because it is necessary at the workplace where you actually work. (2) Because you want to know the conversation at the workplace that you don't know in order to introduce Japan or something like that.   If your answer is (1), do as Japanese colleagues do in your workplace.
Answer: my colleagues always say おっす to me
Comment: Hi taikun, please expand on your answer in a manner that addresses the OP's question with fact. For example, why is it acceptable for おっす to be used in this setting and what leads you to believe this?
Answer: おはようございます and お疲れ様です are still the most common choices. But the actual pronunciation can be heavily slurred depending on the politeness level, and it may sound to you almost like "おやざーっす", "おつかさーっす" or even "おわーっす". After all, you say it every day, and everyone can understand what has been said.
おっす is usually used between close friends outside the office. It may be acceptable depending on the atmosphere of your office, but you should not be the first to start using this.
Comment: Another common method of saying お早うございます, is by letting the first part be silent and only say something like ざぃます.


What's the difference between "For once" and "At once"

Question: Please show me the meanings,when to use and can it be allowed to misuse these two ? (Also greetings from VietNam!)
Answer: They are completely different. For once means for this one time. Typically it's used when something is an exception to the norm; it doesn't necessarily mean that the event being described is unique.
Say if I am habitually late to the office, but one day manage to make it in at 8 am on the dot. My colleague might remark:

Well, Verbose, you're on time for once!

This doesn't mean I have never been on time before or will never be on time in future; it simply means that my being on time is a rare event, and can in some exaggerated sense be considered unique.
At once means immediately:

Come here at once!
  When I heard the good news, I called to congratulate her at once.

There is no overlap in meaning between the two phrases.
Comment: You've missed an opportunity to illustrate the two idioms with the same formulation: *Verbose, clean up your mess at once/for once!* But still worthy of an upvote.
Comment: @deadrat Or I could have brought you into the conversation with "Get rid of this dead rat at once!"


How are polyatomic ions formed?

Question: I know that there should be a covalent bond between polyatomic ions, such as $\ce{SO4^2-}$. But what causes it to suddenly gain electrons and become an ion?
Comment: @Karsten Your answer is fine. The body of the question, though, still raises my objection.
Comment: $\ce{H2SO4}$ is electrically neutral. When two protons are extracted from it, the electron pair that belonged to the two $\ce{H-O}$ bonds are donated to the oxygen atoms, resulting in a negative charge for both of them.
Comment: This is a wrong question to ask, in that the literal answer to it is useless. What causes things to suddenly gain electrons? Electrons, that's what. You see electrons, you grab them. There ain't no such thing as a free electron.
Comment: @IvanNeretin I answered the question in the title, which is not a wrong question. It is  very broad, however, so I kept my answer specific to the example mentioned.
Answer:
But what causes it to suddenly gain electrons and become an ion?

In principle, you can get a polyatomic ion by adding atoms to a monoatomic ion, or by changing the number of electrons in a (neutral) molecule, or by splitting a (neutral) molecule into positive and negative ions, or by reactions of other ions.

[...] such as $\ce{SO4^2-}$

I am not aware of the existence of $\ce{SO4}$, so just adding two electrons to a molecule probably doesn't happen in this case. Here are some formal scenarios to get sulfate, some of them more conceptual than realistic:
$$\ce{HSO4-(aq) <=> H+(aq) +  SO4^2-(aq)}$$
$$\ce{S^2-(aq) + 2O2(g) -> SO4^2-(aq)}$$
$$\ce{Na2SO4(s) -> 2Na+(aq) + SO4^2-(aq)}$$
$$\ce{S2O8^2−(aq) +2I-(aq) -> 2SO4^2−(aq) + I2(aq)}$$
$$\ce{SO3(g) + 2OH-(aq) -> SO4^2- + H2O(l)}$$
Some of these reactions are redox (electron transfer), some are acid/base (proton transfer), some are dissociation or hydration, and some are combinations of these.
Here is a reference for the second scenario (which looked unlikely to me so I looked it up), with a lot of different sulfur-containing ions as intermediates: https://doi.org/10.5935/0103-5053.20160197
Comment: *Groan*, you shouldn't answer something like that without clarification. OP probably just doesn't know what dissociation is. There are good reasons why we close questions like this one.

How are polyatomic ions formed?


Control system basic feedback loop, what's happening at the initial state?

Question:
How can the system output be dependent on itself, when at the initial state there is no system output? I don't understand how it can work physically.
Answer: There will be a system output. Say you're controlling a motor shaft, and the sensor is an encoder that measures the angle of the motor from 0 - 360 degrees. When the system is turned on, the motor shaft has a rotational position, which is measured by the sensor. The motor will then turn to the angular position dictated by the reference signal.
Think of the output as being a state, ie a speed, position, temperature. When the system starts, the output has an initial state. A motor might have zero speed, oven might have ambient temperature.
Answer: Depending on the exact circuit, the output either slowly builds up or "jumps" to a certain value as soon as the power is applied.
Maybe your understanding here is that the output's "existence" is dependent on all of the previous blocks, but the reality is that you can have an output on its own without anything else. The rest of the blocks simply provide control or limits for that output.


US non-provisional application for a non-resident

Question: I submitted a provisional patent application from a foreign country to USPTO a few months ago. I researched and determined that my idea is worth a proper patent application (I made it public). Is that possible that me or my lawyer without USA residentship go there to submit a non-provisional application with my passport? Or are patent application at USPTO offices for USA residents only?
Comment: If you find my answer helpfuly I'd greatfully appreciate it if you could accept it!
Answer: Your attorney will have to be admitted to practice before the USPTO (pass the patent bar) before he will be able to submit the patent on your behalf. Otherwise the US patent laws do not discriminate against foreign nationals filing on their own behalf.
See generally: http://www.uspto.gov/web/offices/pac/doc/general/foreign.htm
You can always hire a US patent attorney or agent if you want someone with expertise in US patent laws to assist you or to file on your behalf.
Short answer: Utility patent applications at the USPTO are NOT limited to US residents
FYI--you don't actually have to travel to the USA to submit an application. It can be done by mail, or electronically. File electronically here


"Could not find or load main class Grails" when building Grails app in Jenkins

Question: I've installed Jenkins and had some luck getting it to run tests and deploy code, but we're starting to write all of our web apps in Grails and those are perhaps the most important of all.
It currently runs on a Windows machine, installed as a service.
I've installed the Grails plugin for Jenkins. In "Manage Jenkins/Configure System" I have JDK 188.8.131.52 configured and pointed to its install directory (the install automatically checkbox is unchecked). I have 3 versions of Grails installed on the machine, 1.3.7, 2.0.4, and 2.3.4. Each of these is configured in Jenkins, "install automatically" is unchecked, and each points to the dir that version is installed in.
In the job configuration, I select a specific grails version (2.3.4) from the dropdown, and I have non-interactive and plain output checked. The targets field is set to this value:
<code>"war -Dgrails.env=ci etp"
</code>
When I click the "build now" button, it attempts to build the Grails app. The console output follows:
<code>Started by user anonymous
Building in workspace C:\Users\joyler\.jenkins\jobs\Test Grails Project Automation\workspace
Fetching changes from the remote Git repository
Fetching upstream changes from ssh://email@example.com/st/etp
Checking out Revision 0a909c7a6b591e65078004026624ac9e0227d6f5 (origin/master)
[workspace] $ cmd.exe /C '"C:\grails\grails-2.3.4\bin\grails.bat "-Dgrails.work.dir=/C:/Users/joyler/.jenkins/jobs/Test Grails Project Automation/workspace//target" war -Dgrails.env=ci etp --non-interactive --plain-output --verbose && exit %%ERRORLEVEL%%"'
Error: Could not find or load main class Grails
Build step 'Build With Grails' marked build as failure
Finished: FAILURE
</code>
It's obviously seeing the Grails installation, or else it wouldn't even be able to run grails.bat.
I expected this to be a breeze, even dotnet builds were simple once I figured out where the exes were. What am I missing? Is there a good way to troubleshoot this that I'm too dumb to see?
Answer: Try running Jenkins as admin, that solved this problem for me, it had to do with symlinks not being availlable to the user running Jenkins.
Comment: I will try this... it makes sense, I changed the user Jenkins runs as to solve another problem. Thank you for the answer.


Libre office Draw How to change font color of pdf form fillable text box

Question: I hope i'm just missing something small, but i am unable to change the default font color of a form fillable text box in libreoffice Draw. My end goal is to convert a regular PDF to one that is form fillable. What keeps happening is i get a default black form fillable text box with white text. What i want is a white/transparent text box with black text.
I have tried to edit the properties of the text and text box under control properties > General I can set the font, font size and background color of the text box but i can't seem to find the option to set the font color. When I export the document to PDF File > export as PDF and I tick off create PDF form What I get is a white text box on my pdf (good) When I click to fill it out it turns black with white text. (Bad). When I click away i get white text on a white textbox background so you are unable to read it.
After perusing the forms for a bit, I am unable to find a solution so i'm hoping someone here can help
I can provide pictures if needed
I have also tried setting all the styles to black font color ranter than default font color. Running LibreOffice V 188.8.131.52 on Ubuntu V 20.04
Answer: This is a bug of LibreOffice.
You can check https://bugs.documentfoundation.org/show_bug.cgi?id=106810


Decomposing left regular representation of cyclic group over $\mathbb{Q}$

Question: Let $G$ be a cyclic group of order $p$, where $p$ is prime.  Let $V = \mathbb{Q}(G)$ be the rational group ring of $G$.  How do you explicitly decompose $V$ as a direct sum of irreducible representations?  If we were working over $\mathbb{C}$, then I know that the irreducible representations of $G$ are just $1$-dimensional representations where the generator of $G$ acts by a root of unity (though even there I don't know an explicit decomposition of the left regular representation).  But over $\mathbb{Q}$, I don't even know the irreducible representations.
Answer: $$\mathbb{Q}[\mathbb{Z}/n] = \mathbb{Q}[X]/(X^n - 1) = \mathbb{Q}[X]/\displaystyle\prod_{d|n} \Phi_d = \bigoplus_{d|n} \mbox{ } \mathbb{Q}[X]/\Phi_d = \bigoplus_{d|n} \mbox{ } \mathbb{Q}(\zeta_d).$$
Comment: The $\mathbb{Q}[\mathbb{Z}/n]$ action on $\mathbb{Q}(\zeta_d)$ is given by $\alpha \cdot x = \pi(\alpha)x$ where $\pi: \mathbb{Q}[\mathbb{Z}/n] \rightarrow \mathbb{Q}(\zeta_d)$ is the quotient map. It follows that the $\mathbb{Q}[\mathbb{Z}/n]$-submodules of $\mathbb{Q}(\zeta_d)$  are exactly the $\mathbb{Q}(\zeta_d)$-submodules of $\mathbb{Q}(\zeta_d)$ i.e., the ideals of $\mathbb{Q}(\zeta_d).$ As $\mathbb{Q}(\zeta_d)$ is a field, $\mathbb{Q}(\zeta_d)$ contains only two such modules: $0$ and $\mathbb{Q}(\zeta_d)$. Irreducibility follows.
Comment: The key point here being: the rational regular representation of $\mathbb Z/n\mathbb Z$ is isomorphic to $\mathbb Q[X]/(X^n-1)$ with the generator of the group acting as multiplication by $X$. And there is an implicit statement that the subrepresentations determined by the cyclotomic polynomials are irreducible, which may noy be obvious to all.
Comment: Great, so for $n$ a prime number this is the direct sum of a copy of the trivial representation and one other representation.  Where can I read about this sort of thing (for instance, the fact that the subrepresentations determined by cyclotomic polynomials are irreducible)?


How to quantitatively measure work done by a biological system?

Question: Thermodynamic efficiency can be expressed as the ratio of Work done(W) to Energy invested (Q).
<code>Thermodynamic efficiency= W/Q
</code>
How can one measure work done by a biological system?
Comment: Shouldn't this be `W/Q`? If `Q/W` then "thermodynamic efficiency" is very high when you do little work but put in a lot of energy. Doesn't seem very efficient.
Answer: Measuring the work done by a biological system seems pretty impossible. Imagine how many different ways one cell of your body uses energy (ATP). You can't really measure all the work done by every cell on a macro scale. Metabolic efficiency has been defined as... "health". That seems just a little ambiguous. That's why we use things like averages to determine if energy use is normal or not, such as in metabolic age.
In short, work is a more tangible term in discrete physics examples, but there is so much complicated energy use in biological systems that total systemic work can't be easily defined.
Answer: Just like with work in non biological systems, one needs to consider the path that the system takes. The definition of work for a process depends on a path. As well, different types of potential energy can be equilibrated for different systems.
So what's your system? Let's say a plant is in a sealed system, with a movable piston. It starts with a small amount of CO2 gas and a lot dissolved in solution. Then the plant is placed in a light source, which can enter the closed system and drive photosynthesis. As the plant makes oxygen it comes out of solution and increases the volume/pressure of gas in the system. As a result, the photosynthesis could do work against the piston. Then, since the energy inputted from the light source can also be readily estimated, the thermodynamic efficiency of "driving a cylinder using photosynthetically derived oxygen gas."


Get into recovery mode on Xperia ray

Question: I want to install a custom ROM in my Xperia ray. I have rooted my phone, unlocked the bootloader, and also installed ClockworkMod recovery. I have downloaded the custom ROM and Gapps on my SD card. But I am not able to enter recovery mode. I am always sent to safe mode.
I have tried the first two pages on google but had no success.
Please help.
Comment: Check your ClockworkMod recovery installation. Have you edited the permissions of CWM files once you've copied them into the system?
Answer: Download Android Studio, install ADB SDK, then open command prompt, change directory to
C:\Users\[UserName]\AppData\Local\Android\sdk\platform-tools

Then hit the following in command prompt
adb reboot recovery

Then your phone enters recovery mode. I did the same in my Xperia Ray and succeeded.
Answer: TWRP recovery with modified kernel
I was unable to boot into recovery mode, when trying to root my Sony Xperia Z5 for the first time.
It worked after modifying my Android 7 Nougat kernel with this tool: https://forum.xda-developers.com/xperia-z5/development/root-automatic-repack-stock-kernel-dm-t3301605
After that I had to but also could enter recovery mode via "adb reboot recovery". Which then worked well for me.
Trying to install lineageos... .zip, the check for right device was wrong in my case.
Installing zip file '... .zip'
Checking for MD5 file...
Skipping MD5 check: no MD5 file found
E3004: This package is for device: E6633,E6653,sumire,sumire_dsds; this device is .

E:unknown command [log]
Updater process ended with ERROR: 7
Error installing zip file '....zip'
Updating partition details

It can be changed easily as desribed here:
https://forum.xda-developers.com/showthread.php?t=2522762
Worked well for me.

Get into recovery mode on Xperia ray


Is it ok for services to reference one another?

Question: I have a service that needs information implemented by another service in the same layer. Is it good practice for one service to take a dependency on another service in the same layer?
Comment: I would think that the best practice is to extract the part that's used in both web services, and have both services use that.
Answer: Yes. I have seen architectural diagrams of SOA (Service Oriented Architecture) where exactly this happens. A service should be written in such a way that it doesn't care if user is calling it, a service in the 'same layer', or it is being combined into a composite service.
The Open Group SOA Reference Architecture diagram shows services calling services in the 'same layer': Figure 22-2 (http://pubs.opengroup.org/architecture/togaf91-doc/arch/chap22.html)
The Open Service Integration Maturity Model (OSIMM) has a good diagram if you search for it. There used to be a good write up from Kim Clark and Brian Petrini but IBM have annoyingly taken down the 'old' content (original link, wayback machine as it was but no images, low res version but most likely to stay up, University of Vienna)
Answer: I use my services within each other. This way I am able to reuse my service methods, instead of copying algorithms all over the layer.
In my experience, one thing to be aware of is circular dependency.

When initializing a service class, say in the constructor, initializing other service object fields may lead to never ending circular calling if the field also depends on the initializing service.
When calling a method, a service method may call another service call and that may also call another service method which can lead to circular call again.
Answer: you could use "chain of responsibility" design pattern to achieve this.
http://www.blackwasp.co.uk/ChainOfResponsibility.aspx


Connect my 2015 Macbook Pro to my 2019 iMac as an external monitor

Question: I have a 2015 Macbook Pro (Thunderbolt 2 port) for which I would like to use my iMac 2019 (USB-C Port) as an external monitor. What type of adapter and cable should I buy to make this work?
Comment: This is not possible, although Apple employees may tell you otherwise. Here's a brief synopsis of my recent experience: 1. Apple Support says yes, a new (2019) iMac *can* be used as an external display 2. Local Apple Store concurs 3. Tech Support rep concurs 4. Further technical questioning leads support rep to dig deeper 5. Tech Support rep places me on hold, eventually returning to apologize for misinforming me. A new (2019) iMac *cannot* be used as an external display. Employee confusion on this point is somewhat understandable as it's fueled by their personal experience....
Comment: ....Apparently, Apple commonly uses older iMacs as external displays in their tech support areas. Seeing this, employees assume iMacs have this capability, obviously not realizing that it's been removed in newer models.
Comment: see https://support.apple.com/guide/mac-help/use-your-mac-as-a-display-mchl7d43ecb2/mac -- I've not had time to try it yet, but from the title it probably provides a more recent, working answer (?)
Answer: Some newer iMac models cannot be used as external monitor for another Mac.

Use your iMac as a display with Target Display Mode - System Requirements

iMac (Retina 5K, 27-inch, Late 2014) and later iMac models can't be used as Target Display Mode displays.
Answer: Nimesh Neema is correct, you cannot use your iMac in Target Display Mode as this feature has not been supported in iMacs manufactured for about the past five years.
However, there are some software options you can investigate, but I have no personal experience with them. Two of these options are listed below:

Air Display
Mirroring360

In summary, they promise to allow users to share their Mac screens on a variety of devices, including other Macs.
Answer: Apple has dropped Target Display Mode support to the 5K iMacs since the bandwidth restrictions when it debuts. There are news mentioning the Intel chip or whatsoever giving further restrictions to the later iMacs and Apple has officially removed TDM support since 10.13.
You may use a pricey workaround like game capturing device to display (and capture) HDMI signal as an app on iMac. It is initially for YouTubers' use.


Workouts with one arm

Question: I had surgery performed on my shoulder. This greatly limits the exercises that I used to perform at the gym. What, if any, workouts can I do with one arm?
Comment: What does your physical therapist say to do?
Comment: There's some evidence that training one side of the body in light of an injury also has benefits for the non-trained side of the body. As for what you can do, that really depends on the nature of the injury (or surgery). You can do single arm dumbbell training for the upper body, while doing body-weight exercises for the lower body and core. Obviously not forgetting any rehab exercises you've been given, train those several times throughout the day (unless advised otherwise)
Comment: Do you permanently not have use of your one arm? If its temporary you should not overwork the good side so you don't get imbalances.
Comment: Let's not forget the elastic band.  If you would normally loop it around something and pull with both hands, you could *tie* it instead of looping, and pull with one hand.
Answer: I'm assuming the standard 4-6 weeks was your prognosis?

When attempting to recover from a rotator cuff injury, the
main goal is to strengthen the muscles of the shoulder evenly and targeting your external rotators.
Workouts and not designed build muscle, but rather stabilization and
flexibility.
I know you want to lift the way you normally do I'd highly recommend seeing a Physical Therapist to set you up with a plan during your recovery.

You do not Want this to become a recurring injury, besides lower back pain RO cuff injuries can very easily become chronic

Each subsequent injury the collagen becomes weaker.  This is because collagen lacks a blood supply and instead of healing normally with fibers running parallel to each other, it's forms a random matrix (picture a plate of spaghetti).
Eccentric exercises are one proven way to combat this. They've been show to encourage collagen fibers regrowth in a more aligned pattern.  Again you should be doing this with your PT during the healing phase.
Answer: I like exercise bands. One arm curls. [reverse] fly is my favorite. Keep your core tight to counter the torque from the one armed fly to avoid moving your body. I do that more for a core workout than an arm workout.

Workouts with one arm


Does trypsin strip flask coating?

Question: Mammalian cell/tissue cultures sometimes require flasks coated with proteins. My uneducated guess is that these proteins mimic the ECM, perhaps the basal lamina, so finicky contact-dependent cells can attach to it.
For instance, I have a BEAS-2B tracheal culture which requires a coating of albumin, fibronectin and type I collagen. This is applied by incubating an empty plastic dish or flask with a solution of these proteins overnight. I give this as an example of what a "coat" constitutes. You answer should be general enough to apply to at least the most common coat types, or if it depends on the coat, you should explain how.
Likewise, there is some variation in how the trypsinization occurs. To have a starting point, let's say I am trypsinizing according to typical ATCC recommendations: 5 minutes with 0.25% Trypsin-0.53 mM EDTA, then inactivate with equal volume medium. I haven't worked with a cell that can withstand this noticeably (but then I haven't worked with any exotic cells).
My question: When I trypsinize the cells to passage, what happens to the coat?
Since trypsin is a protease that cleaves even the attachment of cells to plastic, I am guessing that it will also destroy the coat. After the trypsin and cells are removed, the flask will have a tiny fraction of the protein coat that it had before, and will not support cells that require a coat any longer.
Am I correct in thus deducing that coated flasks cannot be reused after trypsinization? Are any of the alternative detachment reagents an exception to this?
Comment: Interesting question. Since I don't have a real answer at the moment, I would say it depends strongly on the incubation time. The longer you digest, the more of the coating will be digested, too.
Comment: Generally the coating is of poly D-Lysine. Proteases act only on L-amino acids. Moreover the amide bond in PDL is between the ε-amino group & carboxyl instead of the α-amino group as in peptide bonds. So, I guess nothing should happen to the usual coated flasks. I have used the same flask for 2 rounds of trypsinization, and the cells seemed to be fine.
Comment: A small correction: PDL is not ε-amide, nonetheless the D-conformation would make it resistant to protease.
Comment: @Chris Good point, edited.
Comment: @WYSIWYG That's an interesting point. However, what about the coat I mention? Corning fibronectin is isolated from human plasma, Corning collagen I is from cow plasma, and NEB does not clearly explain where they get their albumin (they say "fraction V") but I think it's also purified from an animal product. I thought all of these would come out as L-isomers.
Answer: Generally the coating is of poly D-Lysine. Proteases act only on L-amino acids. So, I guess nothing should happen to the usual coated flasks. I have reused the flask even after 2 rounds of trypsinization, and the cells seemed to be fine.
In your case, the matrix is made of proteins isolated from animal sources. They are susceptible to proteolysis. You are right to assume that these flasks should not be reused. If you have a shortage of flasks then you can buy uncoated petriplates (which are cheaper) and coat them yourself.
Answer: You should check the composition of the coating by using trypsin, e.g. poly-L-lysine or poly-D-lysine are usually applied:

Polymers of both D- and L-lysine are used to coat solid surfaces.
  Poly-L-lysine has been reported to improve the protein coating of
  ELISA plates. 6,7 However, in culture applications, certain cells can
  digest poly-L-lysine. In this situation, poly-D-lysine should be used
  as the attachment factor so that the cells are not disrupted by
  excessive uptake of L - lysine. The lower molecular weight
  poly-D-lysine (30,000 - 70,000) is easier to use because it is less
  viscous in solution, but the higher molecular weight poly-lysine
  (>300,000) provides more attachment sites per molecul e. The molecular
  weight poly-D-lysine often preferred by users is the 70,000 - 150,000.

Poly-D-lysine Hydrobromide - Sigma

Trypsin does not seem like to hydrolise poly-D-lysine. Roughly it is specific to L-Lys and L-Arg, so if your coating contains these amino acids (in your case it does), than it will be degraded.

Trypsin (EC188.8.131.52) is part of the serine protease family. Trypsin
  cleaves lysine and arginine at the C-terminal side of the peptide. The
  hydrolysis rate is slower if an acidic residue is on either sides of
  the cleavage site and no cleavage occurs if a proline residue is on
  the carboxyl side of the cleavage site. Trypsin optimum pH is pH-7 to
  9. Trypsin will also hydrolyze ester and amide linkages of synthetic derivatives of amino acids such as: benzoyl L-arginine ethyl ester
  (BAEE), p-toluenesulfonyl- L-arginine methyl ester (TAME),
  tosyl-L-arginine methyl ester, N-α-benzoyl-L-arginine p-nitroanilide
  (BAPNA), L-lysyl-p-nitroanilide, and benzoyl-L-tyrosine ethyl ester
  (BTEE). Serine protease inhibitors that inhibit recombinant trypsin
  include TLCK (N-p-tosyl-L-lysine chloromethyl ketone), PMSF
  (phenylmethanesulfonyl fluoride), benzamidine, soybean trypsin
  inhibitor, and ovomucoid.

Trypsin Human, Yeast - ProSpec, or Sigma here

After incubation with 1mg/mL trypsin solution at 37°C for 1h, neither
  PLL nor PDL was found to be hydrolyzed, as indicated by the constant
  number of molecules found on the surface. The reason is that the
  entire polylysine chain was adsorbed to the surface, and steric
  hindrance and electrostatic repulsion prevented trypsin molecules from
  approaching the cleavange sites. To make polylysine exposed and
  available to trypsin digestion, a DSU SAM surface was created. A
  uniform coating of 5nm chromium and 30nm gold was first introduced on
  the slides. On top of that metal coating, an amine-active
  cross-linker, DSU SAM, was formed to covalently immobilize
  AF532-PLL/PDL molecules. After the free peptide molecules were
  removed, the slide was incubated with 1mg/mL trypsin at 37°C for 1h.
  The trypsin and cut polylysine fragments were then thorougly washed
  off. Intact PLL and PDL molecules had similar fluorescence intensities
  and surface number densities before trypsin was introduced. However,
  it is clear that trypsin digested PLL but not PDL. From over 30 images
  of different areas of the slides, for PLL the average numbers of
  molecules counted were 227±16 and 0 per frame before and after
  hydrolysis, respectively. In contrast, the corresponding numbers for
  PDL were 241±15 and 234±20 per frame, respectively. As explained in
  Emil Fisher's analogy of the lock and key, the L-isomer can fit the
  active site of trypsin bettern than the D-isomer. One reason is that
  only the L-isomer undergoes a coil to α-helix transition upon binding
  with the enzyme, while the D-isomer remains disordered.

2008 - Applications of single-molecule detection in early disease diagnosis and enzymatic reaction study

So the result depends on the type of the coating. Btw. I think the easiest way to decide would be to check it with an experiment. (Note that I know nothing about coatings, just trypsin.)
Answer: In case someone finds this thread and wants an answer. In this paper (J Biomed Mater Res A. 2005 Oct 1;75(1):1-13.) the authors show that trypsinization does indeed remove the protein coating from the culture vessel.

Does trypsin strip flask coating?


Countable nouns which have the same/similar meaning with crap/garbage?

Question: I wonder if there are countable nouns that can be used to describe the same meaning with crap/garbage. Preferably in oral English?

This TV series is a/an _______, I don't want to watch it!
Comment: Use a counter to get a countable noun: *a piece of crap*, *a pile of garbage*, etc.
Comment: A countable equivalent of crap is _turd_. Be careful though because it is quite vulgar. _Crap_ is vulgar too, but not as much.
Answer: You can always quantify noncountable nouns using a counter word.
Example #1:

This TV series is a bunch of crap. I don't want to watch it!

Example #2:

This TV series is a crock of shit. I don't want to watch it!

And that's basically how it's typically done in English. There are literally dozens of counter words to choose from: a pile of crap, a piece of shit et cetera. Take your pick.
As for countable words, it's very difficult to fill in that black, to be perfectly honest. If you really do want to use a different construction there, then you need to get familiar with idioms expressing the idea of something being of inferior quality. One possible idiom that comes to my mind that would possibly work in your particular context would probably be the pits:

This TV series is the pits. I don't want to watch it!

Though, there are still a lot of simpler ways to say it:

This TV series sucks, man. I don't want to watch it!
Comment: I really appreciate this answer,  but isn't there a real countable noun to replace "crap"?
Answer: If you are strictly looking for countable (or singular) nouns, some  similar words are joke,  farce, flop, and drag.

joke noun (RIDICULOUS)
  [ U ] infml something considered to be so bad or worthless that it is ridiculous:
The playing conditions on the muddy field were a joke.
The midterm exam was a joke (= too easy).
farce   noun (SITUATION)
  [ C ] a ridiculous situation or event, or something considered a waste of time:
The meeting turned out to be a farce since no one had prepared anything.
drag noun (BORING EVENT)
  [ U ] infml someone or something that is unpleasant and boring:
Waiting in a doctor's office is such a drag!
flop noun (FAILURE)
  [ C usually sing ] infml a failure:
The movie was a complete flop.

(Cambridge Dictionary)
Answer: Despite there being a number of different words for garbage, like rubbish, trash and so on there are very few countable noun versions. As Cookie Monster has already mentioned, you can use collective nouns to quantify those nouns.
With regards to your specific example, a word like dud, bomb or bust could be used. While its definition is slightly different, it's often used in a similar context.


how to run postgresql 7.4 on debian lenny

Question: Question says it all really, how can I run postgres 7.4 on debian lenny? Our developers don't have the resource right now to modify a legacy application we have to work with pg 8.3, and debian etch is no longer supported.
Answer: Note that PostgreSQL 7.4 is also not supported. So you might as well go with Etch, since you're going to be on an unsupported version whatever you do.
Your other option is to build from source. PostgreSQL 7.4 should build fine on lenny.


How to create multiple IDs with same UID in AIX ? How to change UID of IDs in AIX?

Question: How to create multiple IDs with same UID in AIX ?
How to change UID of IDs in AIX ?
Answer: You cannot.
The (eventual) mkuser command will not create IDs with the same UID. Quoting the mkuser man page:

Note
ID collision detection in the target registry is always enforced regardless of the dist_uniqid system attribute.

Using either smitty or the command-line will land you in the same situation.
As for changing a user's UID, you would use the chuser command or smitty (which then calls chuser), but it uses the same restriction as mkuser does:

However, when the ID is changed using the chuser command, ID collision checking is also controlled by the dist_uniqid attribute in the usw stanza of the /etc/security/login.cfg file. The behavior of ID collision control is the same as that described for the mkuser command.

For extra fun, check out the command that smitty runs during a User change (smitty chuser):
   x() {
     if [ $# -ge 2 ]
     then
       for i in "$@"
       do
         spam="$spam \"$i\""
       done
       eval chuser $spam
     fi
   }
   x id='1234' username

Comment: That code is... not good.  Why not just `chuser "$@"`? Or does it rely on `spam` not getting reset?
Comment: @K That structure is one that a lot of smitty menus use, so I suspect the author copy/pasted a different one and replaced the guts for the `chuser` flags, none of which need any special handling. The smitty menu generates that code based on user input in the menu. It does at least quote the data going into it (twice), but I was amused at the author's choice for the variable's name.


void method not getting called in magento custom payment gateway integration

Question: Edit: This is a revised question and I am hoping that it will give me some answers :)
(The original question is below the line)
I am trying to integrate a custom payment method in magento in which the workflow is similar to Paypal Standard. Which means the user will be redirected to the payment gateway for filling in the CC details. So far I have implemented this part and it's working perfectly fine.
The problem is when the order is cancelled from the admin, I need to call the update api of the payment gateway. So in the custom payment method model class, I set the $_canVoid variable to true and implemented a void method which would make the call to the api. But it doesn't get called.
After looking up the calling functions and putting breakpoints in magento's core code, I have found that void is not called because the canVoid method of Mage_Sales_Model_Order_Payment returns false which in turn is because the following expression evaluates to false
$authTransaction = $this->getAuthorizationTransaction();
I thought this is happening because I haven't implemented the authorize method in the payment method model. So I added authorize method but even that isn't getting called. In the config.xml file "authorize" is added in payment_action node.
I am not able to figure out when and from where will authorize method be called and what would I have to do so that void works upon order cancellation.
Please help..

Original Question:
I need some basic understanding of payment gateway related concepts like authorize and capture.
To give a background, I am trying to integrate a payment gateway similar to paypal standard in magento. I have completed the checkout part of integration. ie upon checkout, a hidden form with parameters is submitted as in paypal and the shopper enters the credit card details on the payment gateways site. This part works well..
Now besides this, I need to call the update-api of the payment gateway to set the status of the transaction as cancelled whenever any order is cancelled. So I added the following code in my payment methods model class
protected $_canVoid = true;

public function void(Varien_Object $payment) {
    // some code here..
    var_dump($payment); exit;
}

But this method isn't getting called at all. After looking through the code, it seems that
magento looks for an authorization transaction and if not found, doesn't call the above void method. Does it mean that it's necessary to call authorize method first and then only it can be void ? But with the user entering the credit card details on the payment gateways website,
as per my understanding, I don't need to implement either authorize and capture as it's taken care of by the gateway service. Kindly correct if this is wrong..
I checked the Paypal Standard code in magento and there is no void method there too. Does it mean that for paypal standard like payment gateways, this wouldn't work in magento ?
Any help is appreciated.
PS. I have already gone through this question - Magento Payment flow but it doesn't quite explain why the void method wouldn't get called in my case.
Comment: Have you ever visit this site? [Creating Your Own Payment Gateway](http://roysimkes.net/blog/2009/11/creating-your-own-payment-gateway-for-magento-part-1/)
Comment: thanks for the link. i see that it's for payment methods where the credit card info is accepted on the store website itself. In my case, the shoppers enter the cc details on the payment gateways' site. So I guess, the payment method class in magento doesn't need to authorize/capture. but i need to make a call to the update-api to void/refund when order is cancelled and credit memo is clicked. My question is, is this possible or have I not understood the concepts of authorize/capture/void (in general) not clearly ?
Answer: If you want to void an authorization, you have to prevent transaction from being closed.
Of course you can do it the bad way (re-implementing _addTransaction just like authorize.net implementation)
But the best approach is to call setIsTransactionClosed method with false, in the authorize method of your custom payment gateway.
It's an undocumented feature, and you'll have a hard time finding it in your IDE as this method sets an internal member of Mage_Sales_Model_Order_Payment through PHP's magic __call method.
$payment->setIsTransactionClosed(false);

Comment: where do `$payment->setIsTransactionClosed(false);` supposed to be written?


FIFA 14 PS4 Career Mode Virtual Pro Low Match Ratings

Question: I have consistently low match ratings when playing my striker.  Even in games where I get a goal or two or an assist or two my ratings will stay sub 7.0.  I never have any successful 1 on 1 or key dribbles despite stats at the end of the match saying I complete most of my dribbles.  I even get the skill boosts for beating players off the dribble.  Occasionally out of nowhere I'll get a 9+ contributing the same stats as any other game.  Any ideas of what's going on?
Comment: So I partly figured it out last night.  I started demanding the ball more.  Passing and running all over the pitch.  I found this greatly boosted my score.  I guess I wasn't doing enough at first.
Answer: Ratings in FIFA for strikers aren't solely based on how often you score. There are several factors:

Goals
Assists
Number of successful passes
Percentage of shots on target
Key passes
Dribbling
Positioning

So if you shoot 10 times to get 1 goal, that will reduce your rating.
Comment: I have been paying attention to these stats.  I seem to get less touches in FIFA 14 than previous iterations.  I've been playing the series for a whlie and getting a good match rating was usually not a problem.  I should also add that I've already exceded my season objectives and usually meet my upcoming fixtures objectives, but still end up with low match ratings.
Answer: So I partly figured it out last night. I started demanding the ball more. Passing and running all over the pitch. I found this greatly boosted my score. I guess I wasn't doing enough at first.
Answer: It seems to be linked to the in-match team tactics set by your coach.
If it's 'defensive', doing your job as a striker and staying in position for counter attack will make your match rating drop down steadily even after 5 goals and 5 assists... If it's 'offensive' during the whole match you can get 9.8 as a striker just by staying in position and passing the ball.
You can try to make the coach switch to 'offensive' by being overly aggressive at every counter attack occasion, maintaining successful attack situations with a lot of passing in opponent territory, but that's the only way.


How to create this inset effect on text?

Question: I'm new to Adobe Illustrator and am having a hard time getting text to have this kind of inset look. I see that the top right of the text edges contains a shadow and the bottom left contains the highlights.
Answer: Looks like a Photoshop Bevel and Emboss, set to pillow emboss with an additional inner shadow to me. In other words, I'm not certain the image you posted is an Illustrator-generated image at all.
You can do this in Illustrator, however, it's not as easy as ticking and adjusting a few Layer Style options. You customarily need to create actual objects for the highlights and shadows.

Right-click the image and choose "Open Image in New Window/Tab" to see it larger.
(I masked some of the Transform effect window.. the other options can all be left at their default settings.)
The gist is (in case images don't load)...

Add a new white fill via Appearance panel, move it below the base fill, then use Effect > Distort & Transform > Transform to move the white fill slightly downward.
Then add a black fill via the Appearance Panel below the base fill and use Effect > Distort & Transform > Transform to move the black fill slightly upward.
On the base fill add Effect > Stylize > Inner Glow set to black and Multiply to create an inner shadow effect.

You can further refine as needed, but these are the basic steps.
For further refinement, you can use the Pathfinder commands to create additional (separate) objects to indicate shadows, and a slight gradient on the base fill helps as well....
Comment: Thank you so much. Side note - What program are you using to draw the arrows and boxes?
Comment: I open screenshots in Photoshop to combine and add notes. They are manually added, nothing automated.


Save session of Play Audio file

Question: i want save play Audio file session when my application Terminate.
is this possible in iPhone?
i am developing ebook application in this application i have add new functionality (i.e when application launch,page scroll and Audio file play simultaneously ) and while application terminate and re- launch the application, application start last state of application.
my query is how to save session state of Audio file, i have done save state of scroll offset but i don't not know how can i do save state of session of Audio file.
does anyone know above of the query ?
Thank you,
Milan
Answer: Assuming you're using AVAudioPlayer, the currentTime property allows getting and setting the current position in your audio file.
AVAudioPlayer Class Reference.

Save session of Play Audio file


Concealing conversion

Question: Is a convert allowed to conceal the fact that they are a convert, as long as they don't outright lie or take a position of authority that a convert is not allowed to take?
Comment: Cases of embarrassment.
Comment: How is this different from anyone else lying about anything else?
Comment: IIRC there's no prohibition of lying per se. There's however a branch of theft called Gneivas Daas, which is a kinda fraud. As long as it is not monetary it has no Halachic implementations, besides maybe being somehow just and pious. However, people might claim, that they would act differently had they known that you're a convert.
Answer: Excellent question. You have no obligation to reveal you are a convert nor is it anyone's business. Unless: you are joining the type of community that requires you to provide proof you are Jewish (assuming the conversion is kehalacha from a recognized orthodox beis din). Regarding Shidduchim, whether you're conversion is a full conversion or merely lechumra you don't have an obligation to mention it until you have met a potential match a couple times (a descendant of anusim is considered a full conversion now a days). This is brought down by poskim based on a Gemara meforeshes Yevamos 45b where Rav answers regarding a son of a non Jew and Jewish mother that he should go to a place where know no one knows them and conceal it. The Rov of Crown Heights, HaGaon HaRav Zalman Shimon Dworkin z"l once officiated a wedding of a convert lechumra and a Cohen being that as the term implies, when there is a Chazaka(1) that the person is Jewish he/she only goes through the process of conversion out of doubt. Even if you are a full convert there's no obligation for you to explicitly express you are a convert in a resume, that's up to the other side to find out when making reference calls. Nevertheless, most of the times in Shidduchim it's better to be upfront about things. When it comes to getting called up to the Torah I heard from a prominent Rov who said that although lechatchila it's better to use ben Avrohom Avinu, in a case where the person is sensitive you may omit Avinu or even say ben Reb Avrohom. A convert who's biological or adoptive father is Jewish or another convert in a case of embarrassment or feeling uncomfortable because of Kavod Habrios he may be called up by the name of the person who raised him. In truth there is nothing to be ashamed of in this case but you don't have to carry the title as a badge. The same Din applies regarding a Baal Teshuva. If a random person asks you if you are a Ger directly and you're not comfortable with answering, I suggest you somehow cleverly dismiss or ignore the question and change the subject making it clear you don't want to touch it. Hope this answered you're question!

The Din might be different when the Giur Lechumra is done because there is an essential Sofek without a Chazaka like in a case of IVF where the egg belonged to a gentile Jewish woman. In such a case I don't know if the Giores Lechumra may marry a Cohen. See this Teshuva.

Link Link Teshuvos about how a Ger gets called up to the Torah.
Comment: Brachot 43b and Avoda Zara 58a
Comment: Actually you're allowed to outright lie in a case of embarrassment but it's better not to do so that's why I wrote "change the truth". I'm gonna change that and add the details.
Comment: You're welcome! Blessings for a Kabbolas HaTorah BeSimcha UbePnimiyus. That's the Chabad Nusach (:
Comment: Thank you very much this answer was very satisfying :) Do you know the source for that Gemara that you can change the truth? I feel as though I remember reading that a man can go by a different name than that of his father if he is embarrassed of him but I can't seem to find it now.
Comment: Thank you very much Yehoshua you've been very helpful and kind :)
Answer: A convert is inevitably forced to reveal his past in certain cases. One such case would be a marriage, in which not only is it standard practice for the officiating beis din to require proof of one's Jewish identity, but also where his name will be recorded on the kesubah as "ben Avrohom Avinu". Similarly, when called up to the Torah a convert will be revealed for the same reason.
Nevertheless, a convert doesn't have to reveal his status to everyone. Additionally, there is a mitzvah to not embarrass others (based loosely on Vayikra 19:18, 25:17), so if a convert would become embarrassed if his past were revealed, it seems to me that one should not spread the information when not absolutely necessary.
Comment: 'his name will be recorded on the kesubah as "ben Avrohom Avinu". Similarly, when called up to the Torah a convert will be revealed for the same reason.' From my observation, I haven't seen converts have the "Avinu" part added to their fathers name, it's usually just "Ben Avraham", which doesn't definitively indicate he's the son of a convert. Someone might just have a dad named Abraham.
Comment: Thank you very much Ezra, you answer was very helpful for my learning :)
Comment: I have known a situation in which an adopted ger is known using the name of his adopted father rather than ben Avraham.
Comment: There is precedent of converts using a different name for their father aswell, for example Rav Samuel Bar Yehuda. The Rabbi is praised for revealing that he is a convert (as it was previously a secret). Yevamot 101b 16. But according to the Chief Rabbinate of Israel a convert does have to be clearly defined as such in a get.
Comment: @sabbahillel I was just wondering about that… I found a Teshuva about a case of a Ger who's father is Jewish and raised him as his son, if it causes him embarrassment he ma use his father's name instead of Ben Avrohom Avinu. I added the link above by my answer.
Comment: @Salmononius2 You're right many times because of embarrassment simply ben Avrohom is used but in the case of a Get it's different. שו"ע אה"ע (סי' קכט ס"כ): "בגט גר כותב פלוני בן אברהם אבינו". בית שמואל (שם ס"ק לט): "ואם לא כתב אבינו צריך לכתוב הגר, ואם לא כתב גט פסול דמשמע שהוא בן אברהם"

Concealing conversion


Why is the path fibration a strong Hurewicz fibration?

Question: In May and Sigurdsson "Parametrized homotopy theory" there is a general treatment of Hurewicz style model structures in Chapter 4, see definitions 4.2.1 and 4.2.2. I am trying to adapt these to a more general setting. There is an "observation" after Lemma 4.2.4 stating that $X \to \mathrm{Cyl}(X)$ and $\mathrm{Cocyl}(X) \to X$ are strong Hurewicz cofibration and fibration, respectively. The text makes it sound as if this holds for a purely formal reason, i.e., no geometry of the interval is used. Is this really the case? I do not see this, and it is crucial for what I am trying to do to know the exact geometric requirement on the interval for this to hold. I think I am missing some fairly obvious use of the lifting properties, and my excuse is that I am not a homotopy theorist.
Comment: I'm too sleepy to be sure, but [this paper](http://arxiv.org/abs/1204.5427) might help.
Answer: Andrej, thank you for your reading of May and Sigurdsson, which I wish we
had made more accessible.   I don't have time to check anything, but my
recollection is that the verification of the observation is easy, whether
or not it is formal, and works equally well in homological analogues.  I
think we inserted it only for reassurance, since it is of course
to be expected.  It is obviously true when spaces are restricted to be compactly
generated since then there is no ``strong'' distinction. (MS could not just
restrict like that because of point-set problems with parametrized function spaces).
The paper of Schw\"anzl and Vogt noted in Karol's answer is the original source
for the distinction between strong and ordinary Hurewicz cofibrations and fibrations
and may well be helpful.   A crucial non-formal thing, noted just after the
observation you refer to and emphasized more strongly in Schw\"anzl and
Vogt is the need for a good cylinder object:  $\partial I \longrightarrow I$ has the LLP
wrt $h$-acyclic $h$-fibrations.  (Of course, that fails for simplicial sets.)
In case you are thinking about model structures, I'll say a bit about that
(probably repeated from another comment or answer).  There is a mistake in the
general proof of the factorization axioms in the paper of Cole that Karol refers
to and in MS (4.4.2) and MP ("More Concise'').  A fix is given in: T. Barthel and E. Riehl.
On the construction of functorial factorizations for model categories. Algebraic
& Geometric Topology 13 (2013), 1089--1124.  (That is the paper referred to by Omar,
but their fix does not seem directly relevant to the precise question you ask).   They and I
are just finishing a related paper "Six model structures for DG-modules over DGAs'',
in which their fix is again utilized and is described in full categorical generality.
If anyone is interested, I will be happy to say why ``six'' and why that is also to be
expected in topological contexts of interest (but I sometimes get scolded for digressing).
Ok, Karol, but briefly:  Six projective type model structures should appear whenever has a category $\mathcal M$ of structured objects enriched in a  category $\mathcal V$ with two model structures (like the $h$- and $q$-model structures on spaces, $R$-modules, and, conjecturally, certain categories of spectra).  The category $\mathcal M$ then has three natural subcategories of weak equivalences, the structure preserving homotopy equivalences ($h$-equivalences), the homotopy equivalences of underlying objects in $\mathcal V$ ($r$-equivalences, where $r$ stands for relative), and the weak equivalences of underlying objects in $\mathcal V$ ($q$-equivalences).  These can be expected to yield $q$-, $r$-, and $h$-model structures with accompanying mixed
$(r,h)$-, $(q,h)$-, and $(q,r)$-model structures.  And they are interesting!
Comment: I, for one, would like to read more about these six model structures.
Comment: Thanks for the comments. I was aware of the problems you mention in the last paragraph, as my starting point was Barthel & Rhiel. I might as well explain what I am doing. I am trying to get Hurewicz style model structure inside extensional type theory, or in categorical terms in a locally cartesian closed category. This in particular means no excluded middle in general. The consequence is bizarre: paths cannot be concatenated as usual. But I have a cunning plan (which involves the lccc structure in an essential way), which however involves checking a lot of details.
Comment: Just to make sure: by underlying (weak) homotopy equivalences in a $\mathcal{V}$-enriched categories do you mean morphisms inducing (weak) homotopy equivalences on all (fibrant?) representables? Or does it depend on the notion of a "structured" object?
Comment: I assume that I have a forgetful functor, U say, from M to V. A map f in M is an r-equivalence if  Uf  is an h-equivalence.  It is a q-equivalence if Uf is a q-equivalence.  In our algebraic context, V has h and r model structures that happen to coincide, which makes the definition look more natural.
Answer: An explicit proof can be found in Cole's Many Homotopy Categories Are Homotopy Categories (Lemma 3.4). Some topological properties of the interval are used and it seems crucial to the argument. These properties are essentially that $I \times I$ retracts onto both $I \times \{ 0 \}$ and $I \times \{ 0 \} \cup \{ 0, 1 \} \times I$ and that $(I \times I, I \times \{ 0 \})$ and $(I \times I, I \times \{ 0 \} \cup \{ 0, 1 \} \times I)$ are homeomorphic as pairs of spaces.
This doesn't hold e.g. for the simplicial interval and it seems that constructing Hurewicz type model structures on simplicial categories is much more subtle. Some theory for pretty general enrichments is developed in Strong Cofibrations and Fibrations in Enriched Categories by Schwänzl and Vogt.
EDIT: I have realized that I misread your question. You were asking about the projection $X^I \to X$ while the above applies to $X^I \to X \times X$ which is more subtle. With Cole's definition of strong fibrations it is obvious that $X^I \to X$ is one. May and Sigurdsson use a slightly different definition but Cole proves that they are actually equivalent (see my comments below).
Comment: I am sorry but this does not seem very helpful. In my case the starting point is a general cofibration $i: A \to X$, whereas Lemma 3.4 in Cole considers a specific case which is easily related to the geometry of the interval.
Comment: I don't understand your remark. In the proof of Lemma 3.4 Cole starts with the case of an arbitrary acyclic cofibration ($g : Z \to W$ in his notation) and then reduces it to "a specific case which is easily related to the geometry of the interval". The reduction itself also heavily uses topology of the interval.
Comment: Maybe this will clarify things. Actually, it's Cole's definition that is a priori stronger than May's and Sigurdsson's. For Cole a strong fibration is a map with RLP with respect to all acyclic cofibrations, for May and Sigurdsson it is one with RLP with respect to pushout products of arbitrary cofibrations with $\{ 0 \} \to I$. Cole proves that every such pushout product is an acyclic cofibration (Prop. 2.10) and that every acyclic cofibration is a retract of such a pushout product (Prop 2.13)...
Comment: ... Thus the definitions coincide and Lemma 4.3 indeed proves that $X^I \to X \times X$ is a strong fibration in both senses.
Comment: Ok, thanks, I will have another look. Your comments are helpful.


How to improve the startup time of an Android app?

Question: What is the recommended best practice for minimizing the startup time of an android application?
Comment: Whats you app about?
If you load much files, maybe you can load them at runtime?
If you do much calculations, maybe you can save the results and reuse them? you should get more specific for a good answer.
Answer: Start by understanding what makes it take so long to start up; then work to minimize that time.
That may sound flippant, but it's not. There's no one magic bullet for improving program performance. Database optimizations, threading, and other techniques may help, but no one could make a sound recommendation without knowing what makes it take a long time in your particular program.
In the case of Android apps, there are tools such as Traceview that can help you determine what your program is doing while it starts up.
Answer: Get long-running work off the main application thread, using AsyncTask or your own background threads.
Use Traceview to figure out what is taking your time.


Is Indra of the Vedas the rain god Indra?

Question: After seeing the answer here, I have a feeling that the Indra of the Vedas is not the rain god Indra we have in the Puranas. Do any verses in the Vedas show the Indra mentioned there is the same as the rain-god?
Comment: puranic and vedic depiction of indra is totally different ..
Comment: So in this case the answer is not right as it simply quoting from one text and no attempt to show the similarities is made.
Answer: Is Indra of the Vedas the rain god Indra?
Yes, as per Rigveda, Indra of the Vedas is the rain god Indra.
Rigveda 1.32.11

English Translation: Guarded by Ahi stood the thralls of Dāsas, the waters stayed like kine held by the robber. But he, when he had smitten Vṛtra, opened the cave wherein the floods had been imprisoned.
Rigveda 1.32.1, 1.32.2, 1.32.3

English Translation: I WILL declare the manly deeds of Indra, the first that he achieved, the Thunder-wielder.
He slew the Dragon, then disclosed the waters, and cleft the channels of the mountain torrents. He slew the Dragon lying on the mountain: his heavenly bolt of thunder Tvaṣṭar fashioned.
Like lowing kine in rapid flow descending the waters glided downward to the ocean. Impetuous as a bull, he chose the Soma and in three sacred beakers drank the juices.
Maghavan grasped the thunder for his weapon, and smote to death this firstborn of the dragons.
Rigveda 1.7.6

English Translation: Unclose, our manly Hero, thou for ever bounteous, yonder cloud,
For us, thou irresistible.
Note: In most of the Richas of Rigveda, Indra is mentioned as rain god or slayer of Vrita (who blocked the rain). But there are few Richas (like in the link provided in your  question) where Indra is mentioned differently, it's because Richas in Rigveda are from different different Sages.
Comment: @RakeshJoshi Agreed..no God is a god of single thing..and after all Indra is king of all Devas..
Comment: You can get English translation from here: http://www.sacred-texts.com/hin/rigveda/
Comment: @Tezz Thank you! Editing the answer with this link.
Comment: Post the English translations. Some links and images don't work for some browsers.
Comment: Indra is god of rain but not rain ALONE.


EPSON Printer driver for download

Question: I have tried to find a printer driver for EPSON L360 on websites, running for Ubuntu 14.04. But I could not get one.
Answer: http://download.ebz.epson.net/dsc/search/01/search/searchModule
Here are the drivers from Epson. Enter L360 for model. and select Linux in the OS dropdown menu.
Answer: I came here looking for a solution to the same question and then after a little trial I could install the printer and scanner driver for Xubuntu 18.04. Here is how you can do it.
Download the Epson printer and scanner drivers from the Epson website: http://download.ebz.epson.net/dsc/search/01/search/?OSC=LX
Open terminal and navigate to the Downloads directory
You can try to install them with
sudo dpkg -i epson-inkjet-printer-escpr_1.7.6-1lsb3.2_amd64.deb  epson-printer-utility_1.1.0-1lsb3.2_amd64.deb

If the installation fails with error listed below, that means there are dependency problems.
dpkg: dependency problems prevent configuration of epson-inkjet-printer-escpr:
 epson-inkjet-printer-escpr depends on lsb (>= 3.2); however:
  Package lsb is not installed.

dpkg: error processing package epson-inkjet-printer-escpr (--install):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of epson-printer-utility:
 epson-printer-utility depends on lsb (>= 3.2); however:
  Package lsb is not installed.

dpkg: error processing package epson-printer-utility (--install):
 dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.30-0ubuntu2) ...
Errors were encountered while processing:
 epson-inkjet-printer-escpr
 epson-printer-utility

Type the following commands and the drivers should get installed
sudo apt install -f

Hope this helps you and someone else looking for the solution. If it worked for you, please consider marking it useful.

EPSON Printer driver for download


npm and git is very slow in some folders

Question: In most places inside my home directory, npm install and git clone runs very slow, but not in ~/Library. npm install takes tens of minutes in reify stage. While git does not take that long, it takes many times more than in normal folders especially in resolve delta stage.
The most weird thing is that it performs normally in some folders but becomes extremely slow when run in other folders.
Slow folders include ~/Downloads, ~/Desktop, /opt, and ~/repos I created, and normal folders include ~/Library, /tmp, `mktemp -d` and right inside /usr/local.
I tested multiple times in those folders, but the result was the same. It always runs slow in slow folders and always normal in normal folders.
When I first installed the node, there was no problem installing packages or pulling git repo, but after some days, maybe after I installed docker, that weird thing started to happen.
Is there anything that I can try to make npm and git faster everywhere?
I suspect that some antivirus is making file write slow, but I have no third-party antivirus installed. If the builtin antivirus system is causing this problem, I want to exclude some folders or completely disable it.
I have plenty of storage space and it has about 100% of free space.
Memory space might be tight but it cannot explain why it's not slow in some folders.
I have tried granting Full Disk Access to Terminal app, but everything was the same.
node v16.18.2 installed by nvm
npm v8.19.2
MacBook M1 Pro bought days ago
Monterey (not upgrading to Ventura for reasons)
Answer: I just found that Microsoft Defender was installed when I was not noticing, and it was the problem.
I uninstalled it and everything's fine now.


best practices to import text into html

Question: What is the best practice for importing text into html from a multipage InDesign document, from designer to non-designer. Document designed on a mac going to CMS on PC - hand off the InDesign File or strip text into word file? Supplying all images and pdf as go-by?
Answer: More people are likely to be able to open a PDF than InDesign, especially with font considerations. I prefer to get work in PDF format. I can easily extract the text and I can pull the document into PhotoShop to slice it up. You just have to make sure the quality/compression settings are right so it doesn't muck up the JPEGs too much.

best practices to import text into html


How would one calculate a geographic estimate from a dataset of people?

Question: Given you had a large dataset of people with a name and country. How would you calculate an estimate of the origin country from one of the names? If i looked up a name, Kim and just averaged the rows from each country, it seems to me that my numbers would be skewed since the dataset might contain a lot more names from a given country in the first place. How can i make up for this uncertainty?
Comment: @ Stromgren If I understand correctly from your comments below, this is a joint [`P(Kim,US)`] versus conditional [`P(Kim|US)`] probability question. I would suggest that you incorporate some of your explanations in your comments into the question to increase clarity.
Answer: Welcome to the site.
I am not sure what you mean when you write "averaged the rows from each country". You can't average countries.
If your data set is a random selection of the world's population (lots of luck a true random sample of that!) then you can say, for each name, what proportion are from each country. You can also say, for each country, what proportion of people have each name.
But I don't see any sort of average you could take here.
Comment: Hey Peter. Thanks for your answer.
I may have formulated my question badly. I'm not used to doing statistics. I will try to paint out my situation better.

I have a huge dataset, each row containing a first name and a country. My goal is to use this data to provide a probabilistic guess of where a certain name is from. So, at first thought i wanted to fetch all the rows with a given name and then count how many instances of each country was returned. My problem is that some countries will have a lot more data than others. So my question is: How can i make up for this?
Comment: Oh I see.  Why not just use proportions? E.g. "2% of people in America are named Michael, but only 0.01% of people in China are?" etc.
Comment: Yes, this is exacly what i'm trying to do. My problem lies in how i would calculate these estimates. An example: I'm looking up all rows with name "Kim". I get 75 rows from "US" and 25 rows from "GB". So 75% and 25% of course. But my data is random. I might have 50.000 rows of people from "US" and only 10.000 rows of people from "GB". So "US" would get much higher estimates. I want to make up for this difference. My intuition tells me that i, in some way, will have to  put the total number of rows from each country into my calculation? But i can't seem to think it longer than that :)
Comment: "My goal is to use this data to provide a probabilistic guess of where a certain name is from."  You already know which country each name is from.  My sense is that, given a new name, you want to guess which country that name is from.  You could get into all sorts of complex methods such as neural networks, but why not simply assign as your guess the country that has the highest % of its names matching that name?
Answer: You have a lot of rows with names and states. The number of rows don't seem to match the size of the population of the state. You need to standardize the results.
In order to move forward we need to assume that the sample you have is random. If its not then this method may be flawed.
Here is how I would do it:
Count the rows of the name and sum it up by state. Divide the sum of the name rows with the total number of rows of the state. The resulting number have to be standardized. I recommend using the population of the state as a weight. The standardization is done by multiplying the resulting number of the former division with the population of the state. Now you get a state by state comparable number. The next step is to do this calculation for the same name in every country. Calculate the sum of the comparabe numbers for each name in each state and divide each comparable number by the sum and multiply by 100. Now you get the percentage point that the name is from the specific country in question. The total percentage points for each name should equal 100 %.
Now, if you have a name and asks yourself which state this name comes from, you should have the probabilities from the above calculations.
Comment: Taal: I just want to answer the question put forward. "How would you calculate an estimate of the origin country from one of the names?" That is, we draw a name at random and want to find out the most probable origin country for that name. For me it is impossible to calculate an estimate of the origin country without weights.
Comment: I'm not saying you're wrong, but I'm confused as to why you'd standardize the results - could you provide further logic behind your reasoning?  To me, I see it as there are ~30,000,000 people in the UK.  Let's say there's 58,000 named "Kim." 58,000/30,000,000  = .0019333.  If he wants to represent the probability as a decimal, there it is.  If he wants to express it as a percent you just...obviously multiply by 100.

If he meets the requirements with the size of his sample size per name per country, and the data in the database is truly random then: Central Limit Theorum.
Comment: Thus that decimal representing the true probability of the population (.0019333) of randomly finding someone named "Kim" in the UK would eventually converge with a p probability and +/- desired confidence interval of it not (or least getting quite a close approximation). There's probably some metric I'm stupidly missing that would actually describe one's approximate residual's as they converge the estimated probability with the central limit theorum though - as although there's a chance it will hit it exactly beforehand, there will be some form of variance.
Comment: I do genuinely appreciate your answer (as I was hoping my criticism would not come off as hostile, but instead "curious" for lack of a better word), but have a few more questions - unfortunately I have to finish a bit of work first - but I may ping you back here in a few days.
Comment: Taal: I will try to elaborate a little. What Stromgren is actully asking about is: "How do you compare averages in different countries". For me the question is about comparability and standardization. The easiest way forward is to attach weights. Why? Because even if the proportion namned Kim in the US (population around 300 million) and Sweden (9 million) is the same, the chance that a random person namned Kim is from the US is many times greater than from Sweden.
Comment: Wow, I just realized I completely missed that, LOL.  That kind of worries me - that I swung that hard in the complete wrong direction.....
Answer: It sounds you want this: If you were to imagine all countries on the planet did not exist except for the UK (as an example) because, let's say...aliens invaded and took everyone else out (but the UK didn't know about it and never will because they live in a giant impenetrable bubble they don't know about - just making sure that our aliens are not messing with your results  - at least as you survey their first names - so that the element of "randomness" is upheld....then again maybe you wanted the data only for that time period.  Or after.  Because the first name ratios may change if they got inside the bubble ....unless they took everyone out at complete random too, then you'd be fine.)
And then you go to the UK and met someone there at random.  You want to know what the probability is that their name would be, for example, "Sam".
Essentially, the probability for each country for a given name.
Is this correct?
If so, then you can either
A) Find this data online already if you looked hard enough (opendata.stackexchange.com may help)
B) Or if you want to generate the values yourself (and depending upon your needed accuracy)...then the database you're using has to be very accurate (or actually just also completely random as well as big enough to also be big enough for you - I don't know how to calculate that metric.) and your first name data has to be completely random or at least completely randomly drawn from whichever specific countries your first names come from - there can be absolutely nothing in common with between who your first names represent or where they came from besides the fact that they were all random and thus will likely have random similarities (lol).  Then again these rules lax depending upon how accurate you need/want to be.
You'd just do exactly what you said to get the best possible guess from the amount of names you have.
For each name you put in that is from the UK, record that that name appeared once and someone from the UK's population appeared once.
At the end, assuming you went through enough names for each countries sample size requirements (and your p value requirements are achieved, which is the probability that your conclusions/results occurred strictly by chance and you cannot trust your data,  it's usually put at around .05 or 5%...there's also a confidence interval around that, but I don't think you need to worry about it much...you probably have enough names...maybe).
Then, as you said before, divide the number of unique names you recorded for each name for each country by the number of times you recorded that anyone's name appeared from that country.
<code>(number of times the name "Sam" appeared and lived in the UK)
-----------------------------------------------------------
 (number of times any name appeared that lived in the UK)
</code>
=
The probability that name ("Sam") would be randomly selected from the population of that country (the UK here).
This has a p value in a -/+ confidence interval. The p value is probably 5% if that's what you chose (5% is "generally considered" to be acceptable that you're data is not wrong) when figuring out how many names you'll need.  It is probably in a +/- confidence interval of 2.5% (also common figure) if that is also what you chose when figuring out how many names you'll need.


Is it grammatically correct to say "I don't feel a shred of sleepiness"

Question: I've heard people say "she doesn't have a shred of decency." Is it grammatically correct to say "I don't feel a shred of sleepiness?" I'm in doubt because I am thinking: a shred is a very small piece scraped from something larger. And sleepiness is not an object so technically it can't be a "shred"... Please enlighten me :)
Comment: Neither is decency an object! Your sentence is _grammatically_ correct, but that doesn't mean it's a usual or common expression.
Answer: It is correct, but it is not a common way to express this sentiment, I'd usually go with one of the constructs afforded by not in the least.
Answer: Yes, this is fine to say. "Shred of decency" is a set phrase and is by far the most common thing to have a shred of but anything similar can work.
As you mentioned, "shred" simply means a very small amount.
You can be different amounts of sleepy. It is normal to say "I am not that sleepy" or "I am very sleepy" and sleepiness can be used on this scale as well. Sleepiness is a thing that can be present in large or small amounts. "There was a lot of sleepiness in her voice" could be used to mean "She sounded very sleepy".
"Excessive sleepiness can impair your focus" means being too sleepy can make it difficult to focus.
Sleepiness is not a physical object but it is an uncountable noun and can be used as such.
You will find lots of examples were sleepiness is used with an amount which means "shred of" is fine here.
Please see this google book search to see many example of "shred of sleepiness": https://www.google.co.uk/search?tbm=bks&hl=en&q=a+%22shred+of+sleepiness%22
Comment: "There was a lot of sleepiness in her voice" would instantly indicate that you are not an native English speaker. "Shred of" is used with very few nouns - evidence & decency spring immediately to mind. Sleepiness isn't one of them. Many of those books appear to be from non-native English speakers, so are not good references.
Comment: If you search instead for "A shred of" , sleepiness doesn't get a look in. https://www.google.co.uk/search?q=%22a+shred+of%22&safe=active&sca_esv=563362597&tbm=bks


How do you prove with calculus that a regular n-sided figure has the maximum area for its perimeter?

Question: I'm a student in high school (currently taking calculus) and I just realized it is an assumption to say that a square, for example, has the largest area for its perimeter for 4 sided figures. I was wondering if there is a way to prove (with math up to the level of high school calculus) that this was the case.
Comment: See https://mathproblems123.wordpress.com/2012/04/27/2523/.
Comment: There are many possible ways. Have a look at pages $111+$ of [my notes](https://drive.google.com/file/d/0BxKdOVsjsuEwdjBEM1dpRkhMa2s/view)
Answer: This is not the most general family of quadrilaterals, but since you seem to be interested in the most accessible solutions...
Let's restrict to the family of rhombuses with the same size sides, say $s$ the area is $A=s^2\sin\theta$, where $\theta$ is the angle. This will be have an extremum when $dA/d\theta=s^2\cos\theta=0,$ so $\theta=\pi/2.$ By the second derivative test, it is a maximum.
Of the family of rhombuses with a given length side, the square has the maximum area.


How do I remove plastic shelf brackets that have broken off in the hole?

Question: A shelf fell from my bookcase.  It was supported by plastic brackets.  They broke off at the face of the side of the shelf.  How do I get them out so I can put new brackets in place?
Comment: We'll need a picture for this one... although if you mean they're adjustable shelves and plastic "L"-shaped brackets with a round peg that fits into one of a series of holes and the bracket broke off leaving the peg in place... you may be able to get it with a drywall screw or a straightened fishhook jammed right into the end of the peg.
Answer: Plastic plug in a hole, I've always found drilling into it with a bit slightly smaller and stopping the drill, then pulling it straight out works dandy. If not, it gives to a place to try using a screw (and a nailpuller on the screw if it's REALLY stubborn) more easily. Then look for metal replacement brackets in the correct size for your bookshelf so it does not happen again.
Comment: Great advice. I had the best luck with this using the smallest drillbit I had. 1/16 worked pretty great.
Answer: A dry wall screw with threads on it worked like a charm
Answer: Previous answers should work, but if the broken pin spins in the hole without letting the screw grab hold, then a panelling nail could be the answer:

Also sometimes called ring-shank nails.  The ridges on the nail give it tremendous holding power.  Just drive in part way and pull out...
Answer: Using the somewhat smaller diameter drywall screw did not work for me, but re-drilling the hole with the appropriate diameter drill did (ejecting the broken plastic bracket remnant in the process).
Answer: I heated a screw tip and stuck it in the plastic and let it sit for a few seconds so that it would cool and then pulled it out.