django: more complicated filter

Question: I have these models:
class A(Model):
   pass
class B(Model):
   a = ForeignKey(A)
class C(Model):
   b = ForeignKey(B)
I have an instance of A called mya.
I want to find all B's for my A, for which there is at least one C.  I can do this in one line:
bsiwant = [c.b for c in C.objects.filter(b__a==mya)] (and uniquify it somehow)
...but presumably that would cause many queries.  Is there a way to do it with the filter such that a single query would be performed?
Answer: Actually, this should do it:
B.objects.filter(a=mya, c__b__isnull=False)

or
B.objects.filter(a=mya, c__b=F('id'))

Answer: vals = C.objects.filter(b__a=mya).select_related("b").distinct()
bsiwant = [c.b for c in vals]

Should do it in a single query.

django: more complicated filter


Finger elongates when rotating. Why and how do I fix it?

Question: I'm new to Blender and I've been following some hand rigging tutorials. However when I rotate the fingers they elongate. Why does this happen and how can I fix it so that they have more realistic movement. Please see screenshots below.
Comment: Hello, maybe try an Apply Scale (Ctrl A) in Object mode, if it doesn't work please share your file: https://blend-exchange.com/
Comment: Hi Nick, i know you are new here...but...think of calling a car maintainer you tell him your car won't drive. Then you make a picture of your car. Won't help much right? Same with your question. We have no idea what you did, how your rig is configured and what settings you made. So i recommend providing your blend file so we can figure it out on our own. thx. By the way: you have already 2 close votes because of lack of detail so you should improve/edit your question.
Comment: That worked! Thank you for giving me your time.
Answer: You have scaled your armature on an axis, you need to apply the scale in Object mode to prevent this kind of deformation (CtrlA).


Unzipped files mystery location?

Question: I used the Terminal to unzip a file by typing Unzip then dragging the file to terminal. The file unzipped successfully and a few GBs were used from my SDD. However, I have no idea where the files are !!! I can't find them in the same folder of the zip file.
Where would they be ?
Comment: Also try looking in ~/Documents
Answer: Maybe in your Home folder? It's the default folder the terminal points to. Try to open it through the Go menu in the finder.
Answer: If you can, search for the files name. If it shows up, press or long press (click or right click) the file. Hopefully you'll be able to see the file storage path.

Unzipped files mystery location?


Is there a way to edit the host name of Postgis layer?

Question: Recently I change my server to a remote host. That's means all my work there I used Postgis layers, the host name at the source is set to 'localhost' and I need to change to 'remotehostname'.
The content of the source appears with the complete connection, host, dbase, login and password and the query with, at the field "source layer" at general tab in the layer properties. I can select copy and paste, but this field can't be edited.
There is a way to edit this source?
Answer: You can open that QGIS project file in any text editor instead and do a simple Find + Replace to change the hostname quickly.
Find: host=oldhost
Replace: host=newhost


Meaning/importance of "yields" (bonds)

Question: After reading many articles on bond yields (yield-to-maturity) I'm still not getting what they are used for by investors. I understand the math behind its evaluation, but, say, what exactly I can tell when I look at yields of 2 bonds? If the yield of bond A is higher then it's a more attractive investment? Put it differently, what do investors get from those numbers on bond yields that The Wall Street Journal publishes every day? What's their thought process in this respect?
Comment: Honestly, just google this.  This is a first day in first undergraduate fixed income course kind of question.
Comment: A bond is an instrument for turning a set amount of cash into a regular income that continues until expiry (or default...). Yield is the key thing you need to know, because it tells you how much income your $100 will generate annually. Comparing prices of bonds with different coupons is apples and oranges.
Comment: Okay, bond A has 3% yield and bond B has 4% yield. Does it mean that B is better and everyone should prefer B to A?
Comment: Of course it's not quite that simple.  You might want to compare the maturities. If Bond B is a 30yr and Bond A is a 2yr then you might prefer Bond A.  If they are the same maturity you might prefer bond A if it is issued by the US government whereas bond B is issued by an airline during a pandemic.
Comment: Think of Yield as another measure of Price, one that is actually more meaningful for comparing bonds.  For a bond, if you know price, you can get yield, and vice-versa.
 YTM is the return you shall receive should the issuer not default on the coupons and principal from now until maturity.  If you compare two bonds with the same duration and one has a higher YTM (lower price) than the other, and the market is efficient, then the first one has a higher credit (default) risk.  There are also other kinds of risk, like prepayment risk, which can impact the yield or price of a bond.
Answer: Basically you are right to be skeptical about the use of the yield to maturity as a metric for comparing investments. It is useful, but imperfect, and it is important to understand its limitations.
The simplest measure of bond return is the current yield
$y_c = c/P$
which is the coupon divided by the price. If there was one coupon left, this might make sense. However this measure does not take into account the fact that for a typical bond, these coupons will be received over multiple years in the future and so their present value today is not $c$.
The yield-to-maturity $y$ is the next simplest yield measure that can be calculated that actually takes into account the timing of the cashflows and hence the time-value of money.
The value of $y$ is then the annualized period return that sets the total return of investing the price of the bond until the bond matures to holding the bond (with coupon frequency $f$) and reinvesting each of the received coupons until bond maturity.
$P (1+y/f)^N = \frac{c}{f} \sum_{i=1}^N {(1+y/f)^{N-i}} + 1$
On the left we have the (full) price of the bond invested for N coupon periods resulting in the calculated amount at maturity. On the right we have the sum over the coupons plus par, with each payment being re-invested at yield $y$ until maturity. Clearly this formula assumes that we can re-invest the coupon payments at the rate of return $y$ until bond maturity.
This formula can be rearranged to give
$P = \frac{c}{f} \sum_{i=1}^N \frac{1}{(1+y/f)^i} + \frac{1}{(1+y/f)^N}$
The key conclusion is that $y$ is only equal to the bond's total rate of return if it does not change over the life of the bond.
The assumption of an unchanging reinvestment rate means that this measure of return is flawed unless the term structure of interest rates is actually currently flat (at best you might like to think of it as some "average" rate of return). If it is not flat, then we should be using the current term structure of interest rates to determine at what forward rate we can reinvest each of the future coupons.
What does make the $P(y)$ formula useful is that given a price $P$, we can solve for $y$ and vice-versa. As a result, the yield is widely used as a more intuitive way of quoting bond prices. Traders will agree on a yield and the price follows uniquely.
To reiterate, as a measure of return the yield-to-maturity is flawed unless it remains constant (or the curve is flat). If not, it cannot even be used to compare the return of two bonds with different coupons and same maturity. Coupon effects may mean that two bonds with the same maturity priced using the same full term structure can have different yields. So it's only a rough measure of yield - in an ideal world a full term structure of interest rates would be constructed and used.
A great many risk measures (duration and convexity) are calculated by measuring the sensitivity of the bond price to changes in this yield. What these have in common is that they assume that the term structure of interest rates is moving in a parallel fashion - the same sized bump at every maturity. The weakness of these measures is somewhat mitigated by the fact that a trader hedging a 5 year bond will use a 6 year-bond and so the assumption of a parallel shift is not so bad as we would expect 5 and 6 year bond yields to move by about the same amount.
Anyone wanting to do better risk management would need to use more sophisticated measures of risk that involved perturbing zero rates, using some parametric yield curve fitting approach like Nelson-Siegel or key rate durations.
Comment: When I first studied fixed income, the professor abbreviated "yield to maturity" as PYTM. It is the promised yield to maturity, conditional on the issuer making all payments as promised. How much you will make taking into account that the issuer may default is an entirely different thing. I still find this gimmick helpful in explaining yield to maturity to beginners and still use the PYTM abbreviation when teaching; helps get the concept right the 1st time.
Comment: Sure. It ignores default risk. But then it is typically taught in the context of Treasury government bonds.
Answer: This should really be a comment to Dom's excellent answer (or to your question) but I don't have enough reputation to do so. For a textbook treatment that essentially covers the same points as Dom, see Chapters 1-3 of Fixed Income Securities by Tuckman et al (3rd edition). Somewhat unconventionally, the book starts by talking about Spot and Forward rates before Yields, but from a pedagogical standpoint it makes the point about the yield calculation implicitly relying on a flat term structure of rates more self-evident (other shortcomings of the yield calculation are also covered). The meat of the discussion can be found on pp. 99-114.

Meaning/importance of "yields" (bonds)


Is there a way to cluster data using a dependent variable?

Question: We are conducting research on neighborhood mail response behavior, i.e. what percentage of people in a neighborhood reply to a piece of mail.
Based on regression analysis, we know which factors (% black, % poor, etc.) influence mail response rates. I'm toying with the idea of using the significant variables from the regression model to construct clusters that could inform outreach/advertising in these different neighborhoods. In other words, clusters would help us identify what combination of reasons leads to different response rates in different areas.
How can this be done? I want the clustering to be informed by the mail response rates. Should I just include response rates as one of the clustering variables? Or is there a way to include response rates as a dependent variable? The clustering techniques I am familiar with are unsupervised, without a dependent variable.
Answer: Trying to conclude "which factors influence mail response" based on the regression has the same problem as assuming causation from correlation: it totally ignores confounders.
You can find a much better approach to this exact kind of problem from a recent paper: The Blessings of Multiple Causes.


How to set my own CRS in QGIS

Question: I want to transform WGS to MRT (GCS for Malaysia) using QGIS. Is "save as" to a new CRS the correct method? With ArcGIS, I can create transformation method to do transformation but I'm not sure in QGIS. If it is possible, how? And what is the string for xyz rotation, xyz translation, scale factor?
Answer: "Save As" to a new CRS is the correct method, however there are "better" ways to do this (Save As) operation in my experience. If I want to be 100% certain that transformations will happen accurately, I change my project CRS to the CRS that I want my export/transformation to be before doing the transformation.
If you already have some shapefiles or whatever that are in the MRT format, I'd load one of those, then right click on that one and "set project CRS to layer CRS" or something like that. Then you right click on the layer you want to reproject and 'save as', as you said, and set the CRS to "Project CRS".
qgis is really good at this stuff you should be fine.
Answer: QGIS uses EPSG codes and Proj.4 strings to read and write to spatial data. More info about the Proj4 parameters here. It is possible to create your own custom CRS in QGIS by either doing what boulder_ruby has described. Or you may edit a Proj4 string and then save it within QGIS with a custom name so you can reference it later when setting your project CRS or doing "save as" to transform your data.
also see this post on creating a custom CRS in QGIS.
hope this helps!

How to set my own CRS in QGIS


How to automatically create nodes from a bulk file upload

Question: I've got a hundred or so files (mixed types: pdf, ppt, doc, etc). I want to be able to upload these to my server, and then point my D7 site to the directory on the server that contains all of these files so that the site automatically creates a node for each file, with a single, different file attached to each node. Is there a module that will do this for me?
Answer: Using Bulk File Nodes you can create unlimited number of nodes at once .

Bulk File Nodes allows a user to upload or import many files at once, and have many individual nodes created, one for each file . Where this module significantly differentiates from other modules like Bulk Media Upload is that after uploading/importing the file(s), the user is given the opportunity to edit all of the fields for each node in a single form.

This module creates a node for each file and you can edit the fields of each node after uploading.

Solution 1
You are right, Bulk File Nodes works only with images. since you need to create nodes programmatically and assign the files to the nodes you can use the following code to create a node without a file field
$uid = SOME_USER_UID
$values = array(
        'type' => 'THE_CONTENT_TYPE',
        'uid' => $uid,
        'status' => 0,
        'comment' => 0,
        'promote' => 0,
        'language'  => 'en'
);
$entity = entity_create ('node', $values);
$ewrapper = entity_metadata_wrapper('node', $entity);
$ewrapper->title->set('THE_TITLE');

$ewrapper->save();

But from Attaching image files to nodes programmatically in Drupal 7
 you can use the following code to attach the file to the above node
$filepath = drupal_realpath('misc/druplicon.png');
 // Create managed File object and associate with Image field.
 $file = (object) array(
'uid' => 1,
'uri' => $filepath,
'filemime' => file_get_mimetype($filepath),
'status' => 1,
  );

// We save the file to the root of the files directory.
$file = file_copy($file, 'public://');

$ewrapper ->field_file[LANGUAGE_NONE][0] = (array)$file;

This code should be above $ewrapper->save(); line.
Solution 2
You can also create the nodes without file fields as described above. and for each node with $node variable Programmatically Attach Files to Node.
// We have complete file path.
$file_path = '/whatever/path/to/file/sample.pdf';

$file = new stdClass;
$file->uid = $node->uid;
$file->filename = pathinfo($file_path, PATHINFO_BASENAME);
$file->uri = $file_path;
$file->filemime = file_get_mimetype($file_path);
// Make it permanent, otherwise it will get deleted later.
$file->status = FILE_STATUS_PERMANENT;

// Save file object to make it a 'managed file'.
file_save($file);

// We will save file under this location.
$destination = 'public://PDFs/';

// Make sure destination directory exists before moving files to that path.
// This will create directory if it does not exists.
file_prepare_directory($destination, FILE_CREATE_DIRECTORY);

// Now attach file to the file field.
$node->field_pdf[$node->language][0] = (array) $file;

// Default file type field comes with this extra properties.
$node->field_pdf[$node->language][0]['display'] = 1;
$node->field_pdf[$node->language][0]['description'] = 'Our special PDF';

// Save node to make the attachment effective.
node_save($node);

Comment: Thank you! I found this module on drupal.org, but was put off by the line in the description: "Currently, the module only allows for uploading/importing images, but plans are under way to extend this functionality to other filetypes." Is it still the case that the module will only upload image files?
Comment: Did you try Multi Node Add module?
Comment: I've had a look at that module, but while it lets me create multiple nodes it doesn't seem to let me do that based on a list of files. Am I missing something?
Comment: @Jim I updated my answer
Comment: That's fantastic, thank you so much! I'd just started putting the scaffolding together for a custom module to do this, so it's great that I won't have to work out how to create all the nodes etc programatically. If I get time I'll release my module to contrib and will, of course, credit you if I do that. Thanks again! :)
Comment: @Jim you welcome


How to make zombies spawn faster and in larger groups in Minecraft?

Question: How to make zombies spawn faster and in larger groups using a command block on the Switch?
Comment: Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
Comment: Hi, and welcome to the site! Can you clarify: what have you tried so far?
Comment: Hello there, should it be a java edition question I would be able to answer you right away. So I would be providing you with some ideas instead of writing you an incompetent answer. Note that the following should happen in a datapack: in the tick function, check for new mobs without a certain tag and summon mobs at their location, finally tagging them with that specific tag. If you wish to have randomized zombie surges you could create a few randomization predicates in the datapack.
Answer: Here are several simple things that may help:

I don't know about increasing the total spawn rate of zombies but you
could increase the concentration of hostile mobs by lighting up
nearby areas as this forces the hostile mobs to only be able to spawn
in the dark areas that you want them to spawn in.

Alternatively, you could build the area in which you want zombies to
spawn in the air to make sure that you only load in the platform so
that hostile mobs can only spawn on the platform. If you you this
method you will need to be at least 128 above the highest point on
the ground to increase efficiency.

You could also increase the tick speed thus increasing the amount of mobs spawning

Here is a slightly more complex way that works on Java but I am not sure about Bedrock:

Spawn in zombie with a command block.
Use spread player command to spread all the zombies in a certain area into another area.

Here is a link for more details:
How do I teleport all nearby entities within a certain radius?
If possible, as commented by several people, could you be more specific and give us more information about why you need this for, whether you have access to command (which I assume you do as it is a tag) and several other factors that could help us help you.


Does the word "catching" apply to people?

Question: If we can say "I am running to catch the train", is it also appropriate to say that "I am going to the office early to catch the boss"?
Answer: I talk about "catching so-and-so before he leaves for the day" and similar wording all the time, and I've heard many others use it routinely. I'm frankly surprised by those who say they'd only use it when the boss is not around or that it would depend on their relationship to the boss. I'd never thought of it as offensive or demeaning or anything like that.
Note that "catching someone" is also used to describe having a romantic relationship, especially from the woman's point of view. As in, "Sally wants to catch Bob". And there's an idiom that "So-and-so is a good catch", meaning he is a man that women would consider a desirable husband because of his wealth, status, manners, good looks, etc.
Comment: I think it's the spontaneity implied by saying "I'll catch you before you leave." that makes me hesitate to use it in reference to someone who is a busy person (like a boss) or someone who has to have a structured schedule (like a boss). Does that make sense? You know how those hallway meetings where you catch someone have a way of blossoming into time-suckers?
Comment: I agree with @Jay. "Hi [boss], I'm glad I caught you." "[boss], did I catch you at a bad time?" - I don't see anything wrong with these.
Answer: Catching a train is idiomatic (you're not running to grab hold of it physically while it is moving - see 6th definition of catch at Dictionary.com). Catching the boss is sometimes used, especially with a before prepositional phrase (I've got to catch the boss before he leaves today), but that meaning of catch is only informal.
More formal would be I am going to the office early to see the boss.
Comment: What is the standard and more formal alternative? "Reach" has a similar meaning but ignores the notion of time.
Comment: Why say "catch" at all?  I'd suggest *see*, if you want to be formal.  *Meet with*, if applicable.
Comment: I said "catch" to emphasize time.
Comment: Well, I'm afraid "catch" doesn't really convey urgency.  It sounds like a spontaneous gesture, maybe because it's informal.  I realize "see" doesn't convey urgency, either, but I think that the verb there doesn't need to convey urgency.  "Going early" helps.  The fact that you're seeing the boss conveys a sense of importance, and not being able to miss the appointment.  I think it's fine with "see".  If you want to make it seem more urgent, you should probably add a sentence stating the fact:  *I am going to the office early to see the boss. It's really urgent.*
Comment: I agree that "catching" a person does not convey urgency as "catching a train" does, though it does express opportunity. So @Dave, if you're asking if it's an appropriate corollary use, then no. If you're asking if it's appropriate **etiquette**, as we seemed to have interpreted the question, then it depends on the level of formality in your office and with your boss.
Answer: Sure, I have heard that used with people (e.g. "I'll catch you later."). However, I'm not sure I'd use it in reference to a boss. It implies that she does not know you're coming to catch her. (It might be wiser to send an e-vite first!)
Comment: Even if you are talking to the boss, it's fine.  I would not have a problem saying to the boss "I want to catch you before you leave today".
Comment: Depends on the boss and your relationship. I would have a problem.
Comment: If you aren't talking to the boss, it's OK to use the phrase. +1


PyQt - QScrollBar

Question: Dear Stacktoverflow, can you show me an example of how to use a QScrollBar? Thanks.
Answer: <code>>>> import sys
>>> from PyQt4 import QtCore, QtGui
>>> app = QtGui.QApplication(sys.argv)
>>> sb = QtGui.QScrollBar()
>>> sb.setMinimum(0)
>>> sb.setMaximum(100)
>>> def on_slider_moved(value): print "new slider position: %i" % (value, )
>>> sb.connect(sb, QtCore.SIGNAL("sliderMoved(int)"), on_slider_moved)
>>> sb.show()
>>> app.exec_()
</code>
Now, when you move the slider (you might have to resize the window), you'll see the slider position printed to the terminal as you the handle.
Answer: It will come down to you using the QScrollArea, it is a widget that implements showing something that is larger than the available space. You will not need to use QScrollBar directly. I don't have a PyQt example but there is a C++ example in the QT distribution it is called the "Image Viewer". The object hierarchy will still be the same
Comment: Harald, thanks for the reply. I tried the QScrollArea, which seems simpler in my case. But I have a QFormLayout to put inside that QScrollArea, and this widget accepts only QWidgets. I created an empty QWidget around the QFormLayout, but then nothing is displayed.
Comment: Test the widget that you created with the layout first without the surrounding scroll area, if that displays correctly you will need to delve into the QScrollArea documentation, IMHO it is one of the more hairy parts of QT. In general a layout is not a widget, it is only formatting for the widget
Answer: In the PyQT source code distribution, look at the file:

examples/widgets/sliders.pyw

Or there is a minimal example here (I guess I shouldn't copy paste because of potential copyright issues)

PyQt - QScrollBar


ppa:mozillateam/ppa gone?

Question: I am trying to install firefox in a arm64 Ubuntu 22.04 Docker container from the mozillateam ppa, but it seems not to be available anymore. I also could not find it searching it manually at https://launchpad.net/ubuntu/+ppas.
Is the ppa really gone?
root@efb6e2e122ee:/home# add-apt-repository -y ppa:mozillateam/ppa
PPA publishes dbgsym, you may need to include 'main/debug' component
Repository: 'deb https://ppa.launchpadcontent.net/mozillateam/ppa/ubuntu/ jammy main'
Description:
Mozilla Team's Firefox stable + 115 ESR and Thunderbird 115 stable builds

Support for Ubuntu 16.04 / 18.04 ESM is included.
More info: https://launchpad.net/~mozillateam/+archive/ubuntu/ppa
Adding repository.
Found existing deb entry in /etc/apt/sources.list.d/mozillateam-ubuntu-ppa-jammy.list
Adding deb entry to /etc/apt/sources.list.d/mozillateam-ubuntu-ppa-jammy.list
Found existing deb-src entry in /etc/apt/sources.list.d/mozillateam-ubuntu-ppa-jammy.list
Adding disabled deb-src entry to /etc/apt/sources.list.d/mozillateam-ubuntu-ppa-jammy.list
Adding key to /etc/apt/trusted.gpg.d/mozillateam-ubuntu-ppa.gpg with fingerprint 0AB215679C571D1C8325275B9BDB3D89CE49EC21
Hit:1 http://ports.ubuntu.com/ubuntu-ports jammy InRelease
Hit:2 http://ports.ubuntu.com/ubuntu-ports jammy-updates InRelease
Ign:3 https://ppa.launchpadcontent.net/mozillateam/ppa/ubuntu jammy InRelease
Hit:4 http://ports.ubuntu.com/ubuntu-ports jammy-backports InRelease
Hit:5 http://ports.ubuntu.com/ubuntu-ports jammy-security InRelease
Ign:3 https://ppa.launchpadcontent.net/mozillateam/ppa/ubuntu jammy InRelease
Ign:3 https://ppa.launchpadcontent.net/mozillateam/ppa/ubuntu jammy InRelease
Err:3 https://ppa.launchpadcontent.net/mozillateam/ppa/ubuntu jammy InRelease
  503  Service Unavailable [IP: 18.104.22.168 443]
Reading package lists... Done
W: Failed to fetch https://ppa.launchpadcontent.net/mozillateam/ppa/ubuntu/dists/jammy/InRelease  503  Service Unavailable [IP: 18.104.22.168 443]
W: Some index files failed to download. They have been ignored, or old ones used instead.

I experience the same issue in my x86_64 Ubuntu 22.04 VM.
I also get a 503 when I try to do
add-apt-repository ppa:ubuntu-mozilla-daily/ppa

of https://launchpad.net/~ubuntu-mozilla-daily/+archive/ubuntu/ppa that seems to exist certainly. Maybe there currently is an issue with launchpad?
Answer: ppa.launchpad.net is currently down according to the Canonical Status Page.
This should be a temporary issue that should be resolved soon(ish).

ppa:mozillateam/ppa gone?


Physical meaning of the multipolarity of gamma radiation

Question: During my nuclear physics class, we talked about the multipolarity of gamma radiations but without going too much into the details, and I was wondering about the meaning of that, how can the radiation be electric or magnetic ?
Comment: [Multipolarity of gamma radiation](https://en.wikipedia.org/wiki/Multipolarity_of_gamma_radiation)
Comment: @JohnRennie I have already read the wikipedia page but I still don't really understand why we call them electric and magnetic
Answer: Think of the nucleus as a distribution of charges, which come from the protons, and a distribution of currents, which result from the motion of protons inside the nucleus.
The oscillation of these charges is what causes the emission of electromagnetic radiation from the nucleus. Gamma radiation is electromagnetic radiation after all.
Now, the most basic example of a charge distribution that emits electromagnetic radiation is the electric dipole. Think of two point charges oscillating in the $z$-axis with some angular frequency $\omega$ for example. The most basic example of a magnetic moment is the one caused by a current in circular motion in the $xy$ plane.
From electromagnetism, we know that these distributions can be expanded in a series of multipoles. In nuclear physics, one can use the operator (from Wong):
$
O_{\lambda\mu} = \sum_{i=1}^{A} e(i) r_{i}^{\lambda} Y_{\lambda\mu}^{*}(\theta_{i}, \phi_{i})
$,
where $e(i)=e$ for protons and zero for neutrons ($e = 1.6 \times 10^{-19}$ C), $A$ is the mass number, $Y_{\lambda\mu}(\theta, \phi)$ are spherical harmonics, and $r_{i}$ is the position vector for each nulceon. This operator can be used to calculate electric transition probabilities and moments.
Similarly, for the magnetic multipole operator (arising from currents):
$
O_{\lambda\mu} = \mu_N \sum_{i=1}^{A} \left\{ \frac{2}{\lambda+1} \left[ g_l(i) \vec{l}(i) + g_s(i) \vec{s}(i) \right] \right\} \cdot \nabla_i \left[ r_{i}^{\lambda} Y_{\lambda\mu}^{*}(\theta_i, \phi_i) \right]
$,
where $g_l(i) =1$ for a proton and zero for a neutron, $g_s(i)=5.586$ for a proton and $-3.826$ for a neutron, $\mu_N=3.1524512550(15) \times 10^{-8}$ eV/T, and $\vec{l}(i)$, $\vec{s}(i)$ are the angular momentum and spin operators respectively.
Using these operators one can calculate electric and magnetic moments, as well as probabilities, and can interpret the nature of the gamma radiation.
To summarize, gamma radiation itself is not intrinsically electric or magnetic but can be understood in terms of electric and magnetic multipole moments arising from the nucleus's charge and current distributions.
Answer: The classification into electric and magnetic multipole radiation is a general feature of the multipole expansion of the far field of a radiator, it can even be discussed purely classical. The Wikipedia article on multipole radiation has much more details and explicit formlae for the first few terms for electromagnetic radiation.
The names come about, because the electric multipole radiation is emitted by an ideal electric multipole whose strength oscillates, while the magnetic multipole radiation is emitted by an pulsating ideal magnetic multipole (or a pulsating current). Both kinds of radiation show both electric an magnetic fields (as is required for propagation of electromagnetic fields in the vacuum), but their orientation relative to the axes of the dipole are changed (roughly, the roles of the electric and magnetic field are switched).
Comment: I just mean the structure of far field here – not the emission process. (Although you can construct a classical emitter of higher multipole radiation – just put two dipole emitters of equal strength and in opposite next to each other).


Is there a way to 'reseed' the SubscriberID

Question: We've had a few mergers in the last few years and have migrated SFMC accounts twice. The problem is that we now have subscriberID's with multiple SubscriberKeys. They are obviously still unique within our current instance but we have years of historical data stored on SQL servers that update based on the SubscriberID so we're now getting erroneous updates. Basically I just want to reseed our current instances SubscriberID to a number that's higher than anything from our past instances to avoid more of these collisions.
Answer: Fixing this is non trivial as subscriber keys are immutable from a users view point. The only way to fix this is to engage with your account manager and ask for a subscriber key migration. Through this process the SFMC would be able to get in through their back end ( think it's called Synthro) and edit the tables.


Book set in Australia shortly after the invention of teleportation

Question: The book takes place in the near future somewhere in Sydney, Australia. It takes place after the recent invention of teleportation. It explores the social, political impact/consequences of  teleportation. You can't illegally teleport yourself into another country because they will block you also because they have their own separate networks. Roads are abandoned and most forms of transportation have been discarded. That's all I can remember
Comment: There is a whole cluster of Niven stories (mostly from the 1970s) on the social and economic consequences of teleportation, but I don't recall any set in Australia.
Comment: I don't think it's set in Australia, but Harry Harrison's *One Step From Earth* is one of the works that considered the implications.
Comment: @greg: Do you know when it was written? Nearest decade, at least?
Comment: my guess it was made not that long ago perhaps 1970 to present time frame.
Comment: Another novel where the social aspects of teleportation is Alfred Bester's *The Stars My Destination* (also known as *Tiger Tiger*, but it isn't set in Australia, and there is so much *else* going on that it doesn't really match the description given.
Comment: [Teleportation Wrecks Economy!](http://www.futureworld.org/PublicZone/MindBullets/MindBulletsDetails.aspx?MindBulletID=409)
Comment: @greg: Is the teleporting explicitly *called* "teleporting" in the story, or might they use some other term (jaunting, jumping, etc.)? Also, it's implied in your question but just to clarify - is the teleporting done through machinery, not some kind of mental ability?
Comment: I don't remember the details, but check F.M. Busby's wotks. Possibly Arrow from Earth?
Answer: It might be Sean Williams' The Resurrected Man, first published April 2005.

The author is Australian and at least some of the book is set in/around Sydney, specifically:

Unit 142, NorthWest Isobloc, Faux Sydney, UNITED REPUBLICS OF
  AUSTRALASIA

The book opens in the year 2069. Teleportation (D-Mat) is a relatively recent invention, which is still in the process of being integrated into society:

    Even in such countries as Quebec, where d-mat
  travel was illegal for humans and livestock, access was not out of the
  question. Not one government on Earth had outlawed mass-freighting by
  d-mat, a testimony to the power of business over principles. Per
  tonne, d-mat was both quicker and more efficient than any other rapid
  transport currently available. It also promised clean and
  environmentally-friendly manufacturing techniques that were already in
  use off-Earth. A d-mat booth produced an object from data and basic
  raw materials, but the data didn't have to come from another booth; it
  could come from its own internal memory, from a library, or a
  catalogue of items that could be integrated at will. Economic analysts
  were divided over whether d-mat mass-manufacturing would undermine or
  enrich the global economy, but one thing was certain: the laws
  permitting it would be passed one day, whether they were sound or
  not. ...     Fabian Schumacher, for
  example. He was not the creator of d-mat (the head of the initial
  research team and therefore nominal 'inventor', Nick Luhr, had been
  dead for a decade), but he was the man who had put the process into
  practise and continued to develop it in new and profitable ways.

Here's the book's description from the Amazon link above:

    Private detective Jonah McEwen is wanted for
  murder. Someone has been killing women who resemble Marylin Blaylock,
  his former colleague and ex-lover. The latest grisly discovery is
  right on his doorstep. He is the obvious suspect.
      The problem? He has been in a coma for three
  years - a coma he has no memory of entering. And there's worse to
  come.     Using matter transporter technology,
  or "d-mat," a serial killer know only as the Twinmaker has been
  brutally torturing and killing perfect facsimiles of his victims and
  leaving the originals alive. As legal arguments rage about whether
  this even constitutes murder, Jonah finds himself in the awkward
  position of defending his innocence when his own exact copy might
  actually be guilty.     Set in a time where
  the lines between human and machine are increasingly blurred, The
  Resurrected Man explores the future of terrorism, law enforcement, and
  globe-spanning conspiracies. A perfect blend of suspense and science
  fiction, the novel follows the complexities of Jonah and Marylin's
  relationship and their quest to find the killer before he strikes
  again, as well as unravelling the tensions between Jonah and his
  father - a man who has been dead for three years but who might yet
  hold the key to everything...     Nominated
  for the Aurealis Award and winner of the Ditmar Award, The Resurrected
  Man was hailed as a "tour de force" in Australia, the author's home
  country, and described as "compulsively readable" by Locus.
Comment: this could be it ; but I remember reading the description onreddit so it's impossible to determine if this is it
Answer: One Step From Earth was published in 1970, but I don't recall it having stories set in Australia, and if you were thinking of it you'd probably use the name "matter transmission".
So I'm guessing at The Teleportation Reality by Alexander Shoolman, published in 2011, ISBN 9780646570891 .


Certain applications hanging every few seconds, stops with external monitor

Question: I have an issue on my laptop where the graphical output of certain applications seems to hang every few seconds, but other than graphically hanging the application seems to carry on working, eg, audio still plays, key presses and mouse scrolls still register. The cursor still moves with the mouse during the hangs.
Affected:

Firefox 69
Gwenview 19.08.1

Not affected:

Chromium 77
xterm 349

I can't see any messages in dmesg or journalctl when the hangs occur and the CPU doesn't seem to jump. Plugging in an external monitor stops the issue, this is the only way I've found to stop it so far.
I have a Dell 9550 with an Intel 530 and an Optimus Nvidia GM107M. It does not appear to make any difference whether I enable or disable the Nvidia card. I am using dwm, not Gnome.
I have tried the following kernel boot parameters which did not work:

acpi_osi=! acpi_osi="Windows 2009"
acpi_osi="!Windows 2015"
nvidia-drm.modeset=0

And the environmental variable __GL_MaxFramesAllowed=1
I think the Nvidia issues have probably just been a distraction as I don't appear to be using the Nvidia drivers and the issue happens when the Nvidia card is disabled. However I assume it must be something to do with the graphics card(s) since plugging an external monitor in fixes the issue.
Answer: This issue was solved by removing the Intel Xorg driver and relying on the modesetting driver.
https://bbs.archlinux.org/viewtopic.php?pid=1866301#p1866301


Xcode keeps crashing

Question: I just started out programming for iOS. I tried adding an enter button for a simple calculator and changing its size, but Xcode keeps crashing. This is the report:
<code>Process:         Xcode [406]
Path:            /Applications/Xcode.app/Contents/MacOS/Xcode
Identifier:      com.apple.dt.Xcode
Version:         4.5.1 (1842)

Crashed Thread:  0  Dispatch queue: com.apple.main-thread

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000

Application Specific Information:
ProductBuildVersion: 4G1004
ASSERTION FAILURE in /SourceCache/IDEInterfaceBuilderCocoaTouch/IDEInterfaceBuilderCocoaTouch-1929/IBPlugin/Utilities/IBObjectMarshalling.m:651
Details:  Failed to arbitrate IBNSLayoutConstraint, IBUIButton, IBUILabel, IBUIView, and IBUIViewController.

Interface Builder encountered an error communicating with the iOS Simulator. If you choose to file a crash report or radar for this issue, please check Console.app for crash reports for "Interface Builder Cocoa Touch Tool" and include their content in your crash report.

Exception name: IBAssertionFailure
Exception reason: ASSERTION FAILURE:
Reason:     All views needing candidate constraints have already had constraints generated. This most likely indicates a bug involving layout of the following views:
    Layout engine frame ({{20, 20}, {282, 36}}) of <UILabel: 0x81f5560; frame = (20 20; 281 36); text = '0'; clipsToBounds = YES; opaque = NO; autoresize = TM+BM; userInteractionEnabled = NO; layer = <CALayer: 0x815cdd0>> does not match canvas frame ({{20, 20}, {281, 36}})
</code>
I've already tried reinstalling Xcode and resetting iOS simulator as well. I have Mountain Lion.
Comment: My guess is that you've got a corrupted xib file.
Comment: Verify that your constraints have a multiplier different from 0
Answer: Try this steps:

1) Right click on Storyboard in the navigator
2) Click on Show File Inspector
3) Uncheck "Use Autolayout"

Hope this helps

Xcode keeps crashing


Lighting variances on sport mode

Question: I'm trying to shoot continuous movement indoor im Sport Mode. The room is well lit but the photos come out with drastically varying lighting so some photos in the sequence are well lit while others are very dark. Any suggestions of how to fix this?
Comment: Could you provide a bit more info? Maybe 1-2 photos (small) that show the issue and your exposure settings?
Answer: Most probably, this is due to the lighting and its continuous pulses.
The Digital Picture has an excellent article called "Flickering Lights (Why are some of my pictures dark?)" that states:

The problem images [...] have usually been captured under fluorescent or gym/arena lighting and a short exposure was often used. Shooting action sports with a fast frame rate is most frequently the source – most of these images will appear properly exposed but an intermittent dark image glaringly appears.
The cause of this problem is usually not the camera, but the light themselves. [...] The more intermittent the light output, the more likely that your very short exposure may be timed to coincide with that light's low cycle. And the result is a dark image.
[...]
A great option is to strobe the venue. Securely mount [...] strobe lights in the venue's ceiling and fire them remotely [...]. This lighting technique promises the best-possible full-spectrum lighting.
[...]
The option that many [...] take is to simply deal with the conditions. Shoot in RAW and select an exposure that does not result in blown highlights when the lights are under full output.

The arguably best solution, however, is to get a fairly recent camera that features an anti-ficker-mode (such as the EOS 7D Mark II):

When enabled [...], Flicker Mode adjusts the shutter release timing very slightly so that the dim cycle of the lighting is avoided. In single shot mode, the shutter release lag time is matched to the light flicker cycle's maximum output. In continuous shooting mode, the shutter lag and the frame rate are both altered for peak light output capture. In my tests [...], the frame rate was reduced by 1-2 fps and shutter lag can be affected, making the camera feel slightly less responsive.
Answer:
Any suggestions of how to fix this?

Replace the lighting with a type that does not flicker at the rate of the cycle of the alternating current powering the lights.
Use shutter times longer than one-half full cycle of the flickering lights. For countries where alternating current is 50Hz, that would be 1/100 second. For countries with 60Hz AC, that would be 1/120 second.
Use a camera that has a "flicker reduction" feature that syncs the release of the shutter with the peak in the cycle of the lights' oscillation.

The variability you are seeing in your photos is due to the way many types of lighting convert alternating current into light. Although they look constant and steady state to our eyes, in reality they are flickering with the oscillations in the alternating current supplying them with electricity.
When shooting under any kind of flickering lighting, including fluorescent, each frame can have different brightness and color as the lights get brighter and dimmer due to the alternating current powering them. They tend to be bluer and fuller spectrum when at the brightest peak and browner and much more limited spectrum when at the dimmest part of the cycle. If you are using a shutter time shorter than half of the frequency of the current powering the lights, the color and brightness will change from the top to the bottom of the frame as the slit between the curtains of your focal plane shutter transits across the imaging sensor. The shorter the shutter time, and thus the narrower the slit between the first and second shutter curtains, the more pronounced this effect will be from one side of the frame to the other. Even with an electronic shutter you will see the effect with CMOS sensors, which scan across a sensor sequentially.
There are a few DSLRs now on the market that use the light meter to detect the timing of flickering lights and time the shutter to open when the lights are peaking. This allows the photo to capture the image as the light is at both its brightest and fullest spectrum. Since the shutter opens at the brightest point in the cycle, it allows shorter shutter times for the same ISO and aperture settings. This can be quite an advantage when shooting sports under flickering lights. It also allows more uniformity from one frame to the next which simplifies the post processing workload.
The accepted answer to Lots of noise in my hockey pictures. What am I doing wrong? gives a few tips on how to shoot, and process, sports taken under such flickering lighting.
It's not sports or indoors, but Should I use a 24-105 or a 70-200 lens for photographing a high school marching band? covers basically the same thing: shooting action under relatively dim flickering lighting. The accepted answer delves into a  lot besides just lens selection.
For more related reading here at Photography SE, please see:
Why are my football action shots blurry?
How to edit photos shot in fluorescent light
Is there a low light picture quality difference between 50mm 1.8 G and 85mm 1.8 G Nikon?
This answer to Color matching Product
Answer: I had the same issue when shooting my son's gymnastics meets and my daughter's soccer matches (outdoors, under lights). I learned (here, I believe) that I should turn off Auto White Balance, and instead select a fluorescent or tungsten balance (or use a meter to determine & enter the value in K).
While it still left some dark images on occasion (especially on high school soccer pitches which were horribly lit), it fixed most of the issues I had and it also fixed the weird color shifts that happened from frame to frame.

Lighting variances on sport mode


MySQL Replicate Databases without Tables or Content

Question: I would like to replicate all the databases from a MySQL master to a slave used for archiving data older than 30 days.  It isn't common for this data to be accessed so I would like it removed from the master.  I only need to replicate the database table structure without any content.  But only two tables (tablea and tableb) out of the 10 tables need to be created in the database structure.
The table content will be imported using an archive script that is using pt-archiver which is why I don't need the content replicated to the slave.  However when the main database is removed from the master it should also remove the database from this archive slave.  Is this possible using replication?
Answer: It isn't possible with replication as has been correctly pointed out, since that's not how replication works, nor can it be configured to work that way.  Replication either does or does not handle any given table (depending on configuration) but when replication does handle a given table, the data is replicated and replication depends on the rows in the tables starting out and remaining identical.
What I'm hearing you say is that you want some of the same schemas and tables on the 2nd server as exist on the master, but they will be populated via external means, and you want those tables to go away when they are dropped from the master.
Here is a high-level view of how this could be accomplished via automatic means using only things built-in to MySQL.
Obviously this is a dangerous operation if not carefully written since we're talking about the automated dropping of tables and databases, so... caveat lector.

enable the event scheduler on the archive machine
enable the federated storage engine on the archive machine
within another schema you create solely for the purpose of this exercise, define 2 FEDERATED tables that connect back to the master.  One of these points to information_schema.tables and the other points to information_schema.schemata.
write a stored procedure that selects from the archive machine's information_schema.schemata table, left join the federated schemata table on catalog_name, schema_name where schema_name not in ('mysql','information_schema','performance_schema','any','other','schemas','you want not','to be deleted','for sure')
take values from the resulting rows, which will be all of the databases that exist on the local machine but not on the master... and, using dynamic sql, drop those databases from the archive machine.
do the same thing with the information_schema.tables table, which will identify tables you can drop.
use the event scheduler to automate the running of this stored procedure.  Don't schedule it too often, perhaps only once a day, because selecting from the information_schema.tables table can be a resource-intensive operation. MySQL gathers stats when you do this that can be costly especially in terms of I/O.
Answer: How Replication works in MySQL:
Replication between servers in MySQL is based on the binary logging mechanism. The MySQL instance operating as the master (the source of the database changes) writes updates and changes as "events" to the binary log. The information in the binary log is stored in different logging formats according to the database changes being recorded. Slaves are configured to read the binary log from the master and to execute the events in the binary log on the slave's local database.
This means using replication you can't only copy structure of tables to slave it will replicate data also from master.
Replicate-do-table:
You should enable this option for tableA and tableB so that only these tables will get replicate others will be skipped.
http://dev.mysql.com/doc/refman/5.0/en/replication-options-slave.html#option_mysqld_replicate-do-table


Is there a word for a place in which the dead are washed before burial?

Question: In Islamic culture and tradition, the dead are washed before they are buried. The people who wash the corpse are called  corpse-washers. These people should be mahram to the dead. A mahram is an unmarriageable kin with whom marriage/sexual intercourse would be considered haram (illegal in Islam). Current usage of the term covers a wider range of people (including parents, siblings and children, but not cousins) and mostly deals with the hijab and its cultural and regional norms. The dead are washed and shrouded in a building in or near the graveyard. Is there a word to describe this place in English? We call this place in Persian a corpse-washer house.
Comment: What is the Persian/Arabic word? That might give a better hint to us. (I can't think of an English specific word yet)
Comment: It normally seems to be called a Ghusl room or Ghusl facility, after the ritual ([Ghusl](https://en.wikipedia.org/wiki/Ghusl)), but this isn't a single word. [Example](https://www.mfs.asn.au/ghusl-room.html).
Answer: Given that this is very specifically an Islamic cultural situation (or rather probably an Arabic one that came along with Islam) and that English is primarily spoken by people with a Christian background, the exact cultural situation is probably called in English using a loanword (the original Persian/Arabic word) by Muslims, or in general by that word or a loan translation (like 'corpse-washer').
But if you want to translate the culture and see what words correspond to what is done in cultures where they generally speak English, then one needs to look at the funeral process in English speaking cultures.
The morgue is the place at a hospital or health care place for temporary storage of dead bodies until funeral arrangements are made.
Usually the bodies are then transferred to a funeral home, where the body is prepared for a funeral (by many methods, embalming, cremation, etc.). The person who does this is called an

undertaker, mortician

or

funeral director

('funeral director' sounds like a business owner whereas 'undertaker' sounds like they do the work of dealing with the bodies. So I suspect 'undertaker' is closest to what you want.).
What an undertaker does is covered by all sorts of health regulations of which I do not know the details, but presumably there is some washing preparation of the body. There may well be Christian practices (similar across all generally Christian cultures in Europe) that call for washing of the corpse with corresponding vocabulary, but I don't think vocabulary is used nowadays (or at least is not common knowledge).
Not everything is immediately translatable word to word.
Comment: Piggybacking on the answer: corpses.are washed in funeral parlors.
Comment: @YosefBaskin Yes, the establishment/place/building is called a 'funeral home' or 'funeral parlor' (the latter a little older fashioned)


Generating a XSD file from Powerdesigner

Question: Is there a simple way to make Powerdesigner generate an XSD file? It generates an XSM file, but it's not the same specification. If there were a simple way of doing it, it would ease my life as heaven :P.
Answer: What would be the contents of this XSD file? A DTD definition?
In that case, it's managed as a different XSM "language" by PowerDesigner, so you'd have to change the language (from XML Schema Definition to Document Type Definition) in order to generate a diffferent schema.


monitoring pronounced /'mɑnəɹɪŋ/

Question: I'd like to know the steps that lead to the pronunciation of monitoring as /'mɑnəɹɪŋ/.
min 0:44 in the following video
https://genius.com/videos/A-linguist-breaks-down-the-emotion-behind-young-thug-s-vocal-style?utm_source=home_video_series
Comment: Vowel length and nasality are important to capture if you're gonna try to represent fast speech variants phonetically. The /a/ should be long and nasalized; in addition, the /n/ is flapped.
Answer: Actually, I do feel like I hear a consonant before the [ɹ], but I can't offer more evidence than my ears because of a combination of lack of phonetics knowledge and laziness (I'm not going to try to analyze a spectrogram, because I don't know much about how to and I'm not going to study it just to post an answer to this question).
The phone [ɾ], present in standard accents of American English as conditioned allophone of /t/ and /d/, has a relatively "weak" articulation; while this does mean that it can sometimes be elided entirely (but still heard by most listeners due to the "phonemic restoration effect"), it might also mean that you've just missed hearing it when it was actually phonetically present. I would guess that the closely following [ɹ] (also a relatively "weakly" articulated sound) could maybe also have some kind of masking effect.
I would transcribe the utterance as one of the following: ['mɑnəɾɹɪŋ], ['mɑnɪɾɹɪŋ], ['mɑnəɾɹ̩ɪŋ], ['mɑnɪɾɹ̩ɪŋ] (Actually, there's something else that John Lawler mentioned in a comment that I forgot about: rather than [n] (a nasal stop), technically the second consonant may be a nasal tap/flap, usually transcribed [ɾ̃].)
['mɑnəɾɹ̩]~['mɑnɪɾɹ̩] is a standard strong pronunciation of the verb  "monitor" in American English, so it doesn't take much to get to ['mɑnəɾɹɪŋ], just de-syllabification of the syllabic resonant [ɹ̩].
It's standard for original /t/ to be realized as [ɾ] in this context (intervocalic, directly following a stressed vowel and directly preceding a reduced vowel). See Wikipedia on flapping.
It's standard for original "weak" /ɪ/ to be realized as [ə] in American English; more precisely, it tends to be realized as the higher allophone of schwa, rather than the lower allophone that is usual word-finally (see Exodus word pronounciation - Why it is different from spelling for more detailed discussion of this). However, some American English speakers do feel like they don't fully have this merger, or that the merged vowel is better transcribed as [ɪ] or [ɨ]. See Wikipedia on the weak vowel merger.
Comment: I don't know how that's not just plain ['mɑnətɹiŋ] here. That's sure what it sounds like to me.
Comment: @tchrist: Well, I didn't hear a voiceless plosive, but it's possible that there was a brief one.
Comment: Thnx. The issue here is ɾ̃ vs n, yet I seem to hear exactly the one I am thinking of right at the moment

monitoring pronounced /'mɑnəɹɪŋ/


Cannot uninstall Foxit Reader plugin for Firefox

Question: I recently installed Foxit Reader plugin for Firefox, but I like to uninstall it now. When I open the addons window, there is only one option under this plugin: Disable. I just want to uninstall, not to disable. How can I do that?
Answer: You may have to do it manually. From the Mozilla KB:
Manually uninstalling a plugin
If you can't use an uninstaller program to remove a plugin, you can remove it manually:

In the Location bar, type about:config and press Enter.
Search for the preference: plugin.expose_full_path.
Double-click on the plugin.expose_full_path preference in the list to change the value to true.
Enter about:plugins into the Location bar to display the About Plugins page.
Each entry in the About Plugins page will have "File name:" followed by a path. Use Windows Explorer to navigate to the folder shown for the plugin you want to remove.
Rename the file to something other than its normal name - e.g. npswf32 becomes Xnpswf32.

The plugin will be removed.
Comment: This information is outdated (Dec 2014). For any firefox >V.22: expose_full_path is gone. **Instead**: enter `about:plugins` (instead of `about:config`) and there you get the paths. Navigating to each path, renaming from npWhatsover.dll to DISABLED_npWhatsoever.dll is my recommendation (for me was even possible while FF open), restart firefox and the cruft is gone (verify in `about:plugins` or the more visual end-user `about:addons`).


I would like to connect two Imac computers and use older one as a second screen. I would like to know how

Question: I have two 27inch Imac that I would like to connect. I would like to use the older one as a second screen. I am having a hard time getting this to work. Can someone help figure out what cables I might need? On the older Imac- there is a display port, firewire, and USB 2 ports. On the new Imac- there are USB ports and thunderbolt ports.  Can someone tell me what attachments or cables to buy to make this work?
Comment: Why do you think this will work? Do you have a specific source suggesting that it does? These are two different computers. You are trying to treat one of them like a monitor. That is not how it works. If you want a second monitor then you need a monitor and plug it in to some of the ports you mentioned.
Comment: Given the design of iMacs, which look at first blush just like a regular monitor, it is not unreasonable for someone to think *"I could probably use this thing that looks like a monitor as a monitor"* :)
Comment: Ironically, it was working with a display port cable. The arrangement feature showed. Applecare thinks I have a faulty cable and suggested a different attachment and cable. So if it's not supposed to work, why did it? And, why does the arrangement feature under display show up?
Answer: https://support.apple.com/en-au/HT204592 is your best source of information.
Just double check that you have the correct iMac model. And especially the cables. Thunderbolt and Mini DisplayPort is physically the same cable, but they are different. So once you know for sure which cable you need (based on the info on Apple website) - get the correct cable.
Without knowing your exact iMac model (and year) - it would be impossible to give you exact answer.
To look up the iMac model - you can put your iMac serial number into here https://everymac.com/ultimate-mac-lookup/


How do you keep up to date of the latest UX trends?

Question: I am new in UI/UX and I have been seeing design systems suggested by many articles and design trends to know about. I was wondering where people are getting all these ideas or news from? Is there some sort of website or group I could go to to stay up to date?
Comment: UI/UX doesn't exist. Other than that, this is one for the groups you're looking for, but you could also try doing a Google search for whatever specialty you have.
Answer: Personally, I use UX Collective, but NN Group are the OGs of UX. From what I remember, one of the founders coined the word UX, and already I see they have an article up on psychology in UX. Very, very good place to start.
But as for design systems and the like, UX Collective would be the place.
Answer: Whilst trends are usually very big in other design areas, UX is a bit more stable as the approach is usually much more scientific than, say, graphic design. There's three things playing a part on UX Trends:

Different products follow a specific approach for solving things through design, creating new patterns easily recognizable by users which are then reproduced.
Widely-used patterns are discredited through study and research and used less and less.
There are new findings in Psychology, HCI, etc. which push us into other directions previously unexplored or not considered. Have you noticed corners have gotten rounder? There's a reason for it.

I'm afraid I can't point you in the direction of quality content related to what I stated above as it's usually very sparse (as it's usually kept behind closed doors by the companies who fund the research), but I always share evernote.design with people new to the field, as it usually provides a big enough playground for you to start exploring a lot of UX/UI Resources.
I wish you the best on this new journey of yours!
Comment: While I agree with the gist of your answer, your first link is about Contour Bias, which is not exactly new ;)
Comment: Haha, that's a sharp observation @Devin. You are entirely correct! It was scientifically identified in 2006, if I'm not mistaken. The fact that squared buttons were better rendered on late-century computing systems and how people had gotten so used to them probably has played a big part in designers integrating them.


The stock answer for hosting doesn't always work

Question: This guy is quite correct, he has a good question, the stock answer isn't good enough to help him.
Answer:
What are people out there doing for pseodu high availability good
  performance setups under $400/month?

The question meets the same criteria that the catch-all was intended to address - the asker has presented requirements (note how both HA and failover are explicitly mentioned in the question - this is not a case of not knowing the terminology) and is polling for opinions.
Comment: I agree if he has a price in mind knows what he wants, Google is his best answer. Everyone else is going to be answering with their preferred service providers and giving opinions on others.


Any suggestions for a adobe indesign like body field?

Question: I'm on d7. I am looking for any suggestions on modules that can give me the functionality to have a field that acts like adobe indesign. (For the purpose of this explanation I am going to call this my "canvas" field) I would like for my canvas field to be a container that holds text/images/videos/audio instead of just text like a body field would. I would like to provide my users with the ability to write some text in a something like a text box and be able to resize and position it where they want in the "container" field along with images etc. Does anyone have any suggestions? Even a combination of modules or something to get me started would be very appreciated. Thanks.
Answer: The WYSIWYG module http://drupal.org/project/wysiwyg will allow you to offer a rich text editor for your users. You can combine that with the Media module http://drupal.org/project/media to embed media files. It won't be like indesign exactly but will allow users to have some freedom with the content.


Can I plug a 8-pin EPS connector from the PSU to a 4-pin ATX motherboard?

Question: The PSU for my motherboard just died and I was able to get a used one from a friend. Trouble is, this PSU I got from him doesn't have the 4-pin ATX power cord that powers the CPU. It only has an EPS 8-pin one. My question is, could I just use the EPS 8-pin and plug it to the motherboard, leaving the extra 4 pins hanging? Or do I have to get an adapter?
Answer: I think so. The 8 pin connector is in fact two 4 pin connectors, if I remember correctly.
Here's a link with picture. The 8 pin connector is indeed composed of two 4 pin connectors.


Create a custom form with paypal

Question: I'm making a site for a client using Joomla and I need your help to set up a custom form that gets submitted after a paypal payment has been made. Basically I need to create an article on which I will write some rules for a competition and then, below those, there has to be a form that gets sent after the paypal check out gets done. How can I make this possible?
Comment: This is a very broad post which is effectively dropping a list of requirements.   This places the great majority of the workload on volunteer contributors.  In its current state, your question may encourage general extension recommendations or vague/low-value answers. Ideally, we would like to see proof of research/effort from you.  If you have started to design/develop a solution, please [edit] your post to include these vital details.
Answer: Forget about creating an Article, install a Form builder extension to create a form that has the field that you require and place the 'rules' in the text before the fields. Use the return URL form Paypal to point to your Form.
Alternatively create a form using a form builder extension and then embed it in an article using a plugin like those available from Regular Labs or any of other similar plugins for embedding modules in articles.
If you are familiar with writing raw PHP code then you can find similar plugins that allow you to embed PHP into your Article.
Comment: Yeah the article is not mandatory, I can try how you suggested to me and then I'll let you know how it went.
Comment: In the end, I used a form builder just like you suggested, thank you!

Create a custom form with paypal


Can I develop for SDL Tridion 2013 with Visual Studio 2005?

Question: Which version of MS Visual Studio do I need to develop for SDL Tridion 2013?
Comment: Well phrased question avoiding the daunted *support* word. :-)
Comment: Indeed, but people often get confused about this. For the old APIs there were always people that insisted that only Visual Basic was supported, while in fact, compliance with the COM specification was the key issue for support, not the tooling you used.
Comment: Posted a question I answered for someone else. Maybe it can help others too.
Comment: Who mentioned support? :) Tridion supports specific .NET versions, that's what the product is tested with. Tridion probably at least partially works with other .NET versions too. This question indirectly is more about Microsoft support, Visual Studio 2005 does not support compiling for newer .NET versions.
Answer: Any IDE that produces .NET assemblies should work. For development for SDL Tridion 2013 SP1, SDL reccomends Visual Studio 2012. Visual Studio 2005 cannot compile .NET assemblys in the correct .NET version.
SDL Tridion 2013 SP1 uses Microsoft .NET Framework 4.5.1 or Microsoft .NET Framework version 4.0.; MS Visual Studio 2005 can only compile .NET 2.0 and with extensions .NET 3.0. To develop for .NET 4.5.1 you will need Visual Studio 2012. For .NET 4.0 you could use Visual Studio 2010.
Answer: It depends on how awkward a development process you are happy with. In principle, you can write your code in any .NET language, using the editor of your choice. Emacs, Vi, Notepad++++... whatever.
The thing is... you don't need an IDE at all. You could simply obtain the relevant .NET SDK from Microsoft's download page, install it, and use the compilers to build your assemblies.
Generally - you'd want IDE support while writing code, but it isn't necessary, and the SDK-only option might be appropriate for, say, a build server.
Answer: SDL Tridion 2013 SP1 still supports (Deprecated) the .NET Framework 3.5 SP1. Visual Studio 2005 only supports the .NET Frameworks 2.0 and 3.0. Having said that you can still compile a DLL using the .NET Framework 2.0 and use it. However, I do see an issue if you want to reference Tridion DLLs that are compiled using the .NET Framework 3.5 and higher.
Comment: Typically if your are developing for SDL Tridion you want to reference to the Tridion DLLs so that will be in issue indeed ;)


May one host irreligious guests on yom tov?

Question: Although it is permissible to cook on Yom Tov, this heter is limited to cooking for other Jews. Because of this prohibition, Chazal were concerned that if one had non Jews as guests, he would cook extra for them. They therefore disallowed inviting non jews on Yom Tov, SA, OC 512:1.(However, they allowed them on Shabbos, see Tur OC: 325). The law is that a Jew who openly violates the Sabbath would also be prohibited to cook for, so he would also be included in the prohibition against inviting gentiles.
What is the rationale for the common practice of inviting irreligious jews for the Seder and other Yom Tov meals.
Is it permissible for Kiruv purposes? Is it always permissible?
Is there any heter to actually cook food for him? Is this a rabbinic or biblical prohibition?
Can one at least do chazarah for him?
Comment: Not challenging, just curious - how do you know you cannot cook for a Jew who openly violates the Sabbath?
Comment: Heard from my rav that as long you don't cook portions - i.e. instead of counting 1 turkey wing per guest, make cholent without count, or just a large number of items without personal count, it's ok to cook like that.
Comment: The Mishnah Brurah 512:2 says it explicitly.
Comment: Similar: http://judaism.stackexchange.com/q/35438
Answer: This article details multiple viewpoints on the issue. I am excerpting the end / author's conclusion. Readers can agree or disagree, or better, follow M.Y.'s adage of consulting their Rav:

Common practice among our community is to host non-observant relatives
  for Yom Tov. Moreover, it is common practice for observant Jewish
  hotel owners to host and feed Jews who are obviously non-observant.
  Outreach professionals routinely invite non-observant Jews for Yom
  Tov, especially for the Seder. People either rely on the opinions that
  this prohibition does not apply to non-observant Jews or that
  contemporary non-observant Jews are regarded as Tinokot SheNishbeh'u.
  It is certainly preferable in such a situation to cook all the Yom Tov
  food in advance in order to eliminate concern for violating a Torah
  level prohibition. In any event, the Halacha (Mishnah Berurah 495:5)
  prefers preparing food before Yom Tov so as not to be preoccupied with
  food preparation during the holiday.
Conclusion
Rav Shlomo Zalman Auerbach (ad. loc.) laments the inability to
  properly observe this Halacha in today's circumstances. Nonetheless,
  we should aspire to create highly joyful and spiritual Yom Tov
  atmospheres in our homes that will inspire non-observant Yom Tov
  guests to return to a life of Torah observance.
Postscript
It is ironic that we rely on the opinions that contemporary
  non-observant Jews are compared to a Tinok SheNishbah in regard to
  inviting them for Yom Tov. However, in many circumstances we rely on
  Rav Moshe Feinstein's opinion that today's non-observant Jews are not
  classified as Tinok SheNishbah, and are considered to be invalid
  witnesses. These circumstances include situations regarding a child of
  a woman's second marriage who did not receive a proper Get from her
  first husband. In such cases, we embrace Rav Moshe's opinion that the
  child is not a Mamzeir (illegitimate) if all witnesses to the mother's
  first marriage were non-observant. (For further discussion of this
  issue, see Gray Matter: Volume One pages 83-92.) While there are ways
  to resolve this inconsistency, it highlights the fact that Rav Moshe's
  ruling should be relied upon only if no other options exist. We should
  all make efforts to ensure that civilly divorced non-observant Jews
  should receive a proper Get even if they were married in a
  non-Orthodox ceremony where all witnesses were non-observant Jews. Our
  discussion raises the very distinct possibility that non-observant
  Jews are not necessarily disqualified from serving as witnesses, since
  they may be regarded as Tinokot SheNishbe'u.
Comment: Rabbi Hershel Schachter shlit'a has a yutorah lecture where he says the Mishnah Brurah's ruling is somewhat surprising as many before him allowed it, and RHS felt the common practice today was to allow it.
Comment: @Shalom If you find it, include a link to the lecture. Practically speaking, I have discovered that inviting non-religious Jews to my home for a Shabbat or Yom Tov meal causes *Sholom Bayit* issues. Many have not respected my "house rules" in terms of proper dress and / or observing Shabbat while in my home such as turning lights on / off, etc. I stopped inviting them. I classify such people not as *Tinokot Shenishbu* but "hostile guests" or "intentional violators". My purpose of kiruv for them is beyond my capacity.
Answer: The halacha is stated with regards to those who break Shabbat (see Yalkut Yosef 512:2), and the reason given is that they are considered, in halacha, like non-Jews for these purposes. The Bene Tziyon Hachadashot #23 states that Shabbat desecration is widespread nowadays, and thus we do not consider Jews who desecrate it as akin to non-Jews, forbidden to invite for Yom Tov. He limits this provision to those who at least go to shul and make kiddush, but break it in other ways. One is permitted to invite them so long as one is cooking together with food for one's own family in the same pot.
Or Letziyon (Vol. III p.200) concurs, and adds that people who are simply ignorant of Jewish festivals are considered tinokei shenishba, akin to Jews raised in captivity and are thus blameless for their sins, and states, citing Hilchot Mamrim 3:3 (Rambam) that it is a very noble thing to invite such people on Yom Tov, as opposed to being forbidden!
Sources for the above are Yalkut Yosef 512:2 and footnote 154.
I'll add: It's hard to imagine a genuine case nowadays of a genuine Shabbat desecrator that this law would apply to, especially in light of all the big gedolim over the last century who have paskined that we are ALL tinokei shenishba (see The Tinok Shenishbah written by Rabbi Chaim Rapoport for the London Beth Din in 5757). Please CLYOR with regards to what to do in a practical situation.


What can we do to this [dymamic] tag?

Question: I came across this tag: dymamic
How can this be cleaned up?
Answer: Nice catch. I didn't even notice at first that this is a typo tag, one that dates all the way back to 2009.
Definitely don't just remove the tag, but replace it with the correct one, dynamic. As always, make sure you fix any other problems that you see with each question you edit, and vote to close (or delete) where appropriate so off-topic questions get into the right review queue.
Answer: While there are a literal handful of these questions, we should look to edit them into shape (or VTC and not remove the tag) as we go through this.  There are too few to go through the formal process, but some kind of rigor is expected here.

What can we do to this [dymamic] tag?


Displaying Json data in ajax call

Question: my problem is after ajax call i return a collection of date and time after converting it to json this is what i get "/Date(1377532800000)/" does anyone know how to convert it back to original format? im using MVC c#
Comment: the format should be like this 9/3/2013 12:00:00 AM
Answer: That is the time elapsed in seconds after a particular date. You can format it anyway you want. Below is a sample format. Just parse the int the way you want it to be and convert it to string if that is how you want it to be represented.
<code>(new Date(parseInt(HDate.substr(6))), 'dddd, MMMM dd yyyy');
</code>

Displaying Json data in ajax call


Make some files private in a repository

Question: I want to host the source code for a website I created in a public repository on Github. I want it to be public so that I can also show the source code to others, however there are some files that I want to remain private. Files that may contain passwords and such (like when connecting to databases). Is there a way to do that?
Comment: Another way is to use two repositories one private and one public. You can work in private and use something like https://github.com/open-condo-software/gitexporter to automatically export your files to the public repo.
Answer: Although keeping passwords in the repository is a bad practice as @aspyct has explained, I want to add that not all things that one might want to keep private in a repository are passwords, e.g., one might want to develop a new feature but not expose it until it's done(or maybe expose it never).
In these cases, we can create two remote repositories both associated with the same local repository, but each corresponding to a different branch. Here's a step by step instruction:

Create two remote repositories(on GitHub or BitBucket or wherever else) with different names, for example: one myrepo and the other privates.myrepo. Make the myrepo a public repository and the privates.myrepo a private repository.
On local, initiate a single git repository: git init.
Add the non-private files now in the repository and make an initial commit.
Connect this repository to the public remote:

git remote add <remote_branch_name> <remote_repository_address>

in our example which becomes:
git remote add origin https://github.com/<YOUR_USERNAME>/myrepo.git

Push: git push -u origin master

Now add a branch to the local repository and switch to it: git checkout -b private_work

Here comes the important step: Connect this branch to the other remote, i.e, the private one. In our example:

git remote add privates https://github.com/<YOUR_USERNAME>/privates.myrepo.git

Next, add the private files to the local repository and make a commit.
Push the private_work branch to the privates remote: git push -u privates private_work

Read more explanation on how it works here: https://24ways.org/2013/keeping-parts-of-your-codebase-private-on-github/. I've also learned this from him.
See a cool terminal-show recording of all these steps together here: http://showterm.io/04130676d3401229e7df6
Also, you can add an alias like alias private_push='git push privates private_work in an startup script like .bashrc in case you're on Linux, in order to lower the chances of making a wrong push of private work to the public repository.
Comment: But how to publish only public work you've done in `private_work`? `git merge private` will create your private files in `master`.
Answer: I see three options:

either you add these files to your .gitignore, don't commit them into the repository. You may optionally provide templates for these files (something like config.php.example), for other people to customise them. That way, they can keep their config and pull the changes easily.

or you put these files outside of the repository, and reference them with a relative path. define('CONFIG_DIR', '../config/');

(not recommended, submodules are hard) or you put these files in a git submodule. That'll be a little longer though ;)

For reference, the Symfony framework (PHP) uses the first option and provides configuration templates.
I've used successfully option 2 in many projects, it just works, but is less user-friendly.
Never used option 3 for this kind of cases, and submodules are probably not the best tool for this. It can work though...
Comment: +1 for advicing to store sensitive files in a non-versionned folder (submodules are not a solution here imho, one should **never** version files containing passwords or sensitive information). I personally use option 1, having a versionned config file from which I include a non-versionned file which contains the sensitive config settings ([example](https://github.com/mattoufoutu/EventViz/blob/30f986de65e112af8128366be4725b438eeebf16/eventviz/settings.py#L19) with a Python application, here sensitive info is the secret key used to sign cookies)
Comment: Thanks a lot for the information! I think I will go for option number 1 then, just ignore versioning the files containing sensitive information.
Answer: I had the same problem, and went with option #1 from the answer by aspyct. My project is open source like yours, but also had a few parts that contain sensitive info. I did the following:

Added a folder to my project (in visual studio)
Added that folder to my .gitignore
Created a text file in that folder that was included into git and visual studio.
Cloned a private repo into a subfolder.

That way, anyone from GitHub or from looking in visual studio and see that files are missing, and the text file shows them how to get the application to build without the sensitive files.
Comment: Yes, it very useful and simple, amazing idea

Make some files private in a repository


How do computers generate random numbers

Question: This may very well be the only question I ever ask on this stackexchange site. In programming there are many different ways to generate random numbers depending on different languages. What has been bothering me for a while now, however, is HOW can anything computer generated be random? I found this
post however it wasn't very well received and it said to broad or to many possible answers. However the way I see it there is only one possible answer, how it works! I mean to say that someone with a computer background should be able to answer this so it isn't like I am asking for your opinion. As a final note I would like to apologize if I am in the wrong forum.
Comment: The answers here are OK, but I bet if you had asked this on the security site you would have gotten lots of answers.  Generating random numbers securely is extremely critical for encryption.  It is extremely complex, and there is a huge variety of techniques with different complexity and performance. http://security.stackexchange.com/questions/tagged/prng http://security.stackexchange.com/questions/tagged/random
Answer: They don't
They use algorithms known as Pseudo-Random Number Generators (PRNGs). These always produce the same sequence of numbers unless you provide a unique "seed" number to start them with.
A seed number can be created from a combination of relatively random sources - for example the last few digits of the milliseconds of the current time, the last few motions of the mouse pointer.
The result is a sequence of numbers that, for many purposes, is sufficiently like a random sequence to be unpredictable.
Comment: wow I had never even though of using something as miniscule as the current time in milliseconds I had just assumed that any method used to generate a random number couldn't possibly be random.
Answer: They can and can't depending on the computer. Usually, it's a pseudorandom algorithm. One of the earliest algorithms was basically just to perform a series of basic arithmetic (multiply, divide, add, subtract, modulo) on a number called a seed, and take the middle numbers, or something like that. The numbers appear random, but after a certain number of trials, the same cycle will repeat itself.
Which means that they can't use a PRNG to encrypt your password. PRNGs usually use the system time as the seed, so if the attacker know the approximate time your password was encrypted (account creation time, password change time), they can just generate a small range of passwords using that time range, and try all the generated passwords instead of having to generate all possible combinations allowed.
If you've ever gone to www.random.org, you'll probably see that they generate truly random numbers. That's because they use devices to collect atmospheric noise, or some kind of noisy atmospheric data, and use that.
I'm not an expert on this, but I think some OSes might also collect data from user's mouse movement and keyboard presses along with a PRNG to generate numbers secure enough to encrypt passwords with
Comment: A good PRNG won't be seeded by the time, but can still be seeded from a relatively small amount of information (that's impractical to brute-force, but is occasionally guessable if it comes from a bad source).
Answer: Here's a code snippet from one of my assignments. It generates random numbers then checks if the random number has already been placed in the array and if it hasn't then it is allowed to go in and if not it isn't used.
<code>public static int[] RandomArray(int RandArrayNValue)
    {
        int[] array = new int[RandArrayNValue];

        Random rand = new Random();

        for (int i = 0; i < RandArrayNValue; i++)
        {
            array[i] = i + 1;
        }

        Console.WriteLine();

        for (int i = array.Length - 1; i >= 0; i--)
        {
            int Store = rand.Next(i);

            int TempStore = array[Store];

            array[Store] = array[i];

            array[i] = TempStore;
            Console.WriteLine(" " + array[i]);
        }
        return array;
    }
</code>
Comment: The OP is aware of how random numbers work at this level: "In programming there are many different ways to generate random numbers depending on different languages." The question is about how anything coming from a computer can really be random when a computer is completely deterministic (i.e. given input A, we always get output B).
Comment: `Random()` isn't magic--this question is about how it works.


Why has Rio Grande do Sul state (Brazil) never reelected its governor?

Question: This question is created inspired in a comment at this related question:
What state/country, given the right, refuses to reelect any previous governor/president by most consecutive time?
Comment: @Relaxed - the problem is that the state looks like an outlier in the pattern around it
Comment: Five times in a row does not seem so out of the ordinary, maybe there is nothing to explain.
Comment: @Relaxed I don't know. IMHO its _extraordinariness_ depends on how common has it been around the world.
At least in Brazil, with 26 states plus federal district plus its presidency itself, this unique consecutive dissatisfaction outstands.
Comment: I am looking at this from a completely different angle. If we assume reelection is a purely random process with an advantage to the incumbent, if you look at a large number of series of elections, you would expect some of them to have something that look like a special pattern, just by chance. You would not expect five non-reelection in a row to be common *per se* but certainly to occur in more than 3% of the cases (that's 1/26) so that the one time when it does occur is not remarkable.
Comment: @user4012 Maybe it is, I know nothing about Brazil, but from a purely statistical point of view five times in a row is very little evidence to go by. Have all or most governors in other states always served two mandates?
Comment: There are currently estimated to be 20+ political parties in Brazil. Coalitions have been made and remade over the years.
Answer: In 2018 we had the sixth election where the current governor was reelected which justifies, at least, give some time to think about. As you might notice, I used "we" because I'm natural from Rio Grande do Sul and voted for governors until move to USA in 2008.
First, let's see the six governors and their parties (1):

Olivio Dutra (PT), from January 1st 1999 - December 31st, 2003
Germano Rigotto (PMDB), 2004-2007
Yeda Crusius (PSDB), 2008-2011
Tarso Genro (PT), 2012-20015
Jose Ivo Sartori (PMDB), 2016-2019
Eduardo Leite (PSDB), 2019, expected to remain until December 31st 2022.

The elections are held on October of the previous year, at the same date that presidential elections are being held, ie presidential and gubernatorial campaigns are done together. Also, state and federal representatives are elected on the same day.
During all these years, one constant factor is the financial problems in the state. The last governor, Sartori wasn't able to pay salaries of public employees on the due date. In some months, it was paid in parcels, up to 60 days late. Some governors were more competent in terms of financial management, specially Yeda Crusius, an economist by profession, but when the crisis is deep, there's no easy solution.
Associated with the financial crisis, you have to consider that most of the public education and security (police) is managed by the state, not cities like in USA, and both services are suffering a lot by the lack of investments and money to hire good and enough professionals. It results in poor public services, with high numbers of murders and robberies, insufficient or inadequate schools. Usually, the middle class will enroll their children in private schools but no one could hire personal bodyguards to compensate the lack of police.
Another factor is the political structure of the country. Considering only the last 6 governors, they are from 3 different parties (PT, PMDB, PSDB). In the same day that Eduardo Leite (PSDB) was elected, 55 state representatives were also elected, the top party representations are (2):

PT and PMDB, 8 representatives each;
PP, 6 representatives;
PTB, 5 representatives;
PSDB, the new governor's party, with 4 representatives.

In total, there are 11 parties in the State House of Representatives. That is, the governor works with a political minority, the representatives could easily not approve any initiative from the executive branch and create an almost daily barrage of criticism that is exhaustive to answer.
The combination of economic crisis and political disarrangements, in my opinion, is lethal to any possibility of reelection.
Comment: Welcome to Politics.SE. This looks like a good answer, but it would be even better if you added links to sources supporting some of your statements. Even links to Wikipedia pages on historic data are helpful.


Semantic differences

Question: what are the semantic differences between the following sentences:
I'd appreciate it if you'd share some of your thoughts...
I'd appreciate it if you shared some of your thoughts...
Thanks
Comment: Pretty much identical.  There may be slight differences depending on context.
Answer: Here is an Ngram chart of "would appreciate if" (blue line) versus "would appreciate it if" (red line):

As you can see, the latter formulation is far more common. That's because idiomatically it has been the standard wording (since 1900) for expressing thoughts along the line of "I would appreciate [it] if you'd share some of your thoughts."
A look at the individual matches that the Google Books search returned for the two phrases reveals that virtually all of the matches for "would appreciate it if" follow the model of your first example sentence, whereas some of the matches for "would appreciate if" are false positives. For example:

If the stock of bullion in the world increased in the same ratio with the property of the world, the standard of value would be invariable; if more slowly, it would appreciate; if more rapidly, it would depreciate. [1852]
There is a broad range of delightful belles lettres, which I am sure you would appreciate if you would make yourself acquainted with it. [1865]
The University wanted money to pay its expenses. It could not very well wait for twenty or even five years for the purpose of seeing how the value of this scrip would appreciate, if at all. [1890]
There are many things that my modesty would not allow me to write about, that I believe you would appreciate if you were only to see them. [1897]
Yes, that is the doctrine of Ackroyd v. Smithson. Simple, is it not, and one that you would appreciate if you chanced to be A.'s heir; but one you would be inclined to cavil at, if you were one of A.'s next of kin, and not his heir! [1906]
That is one of the advantages that the profession would appreciate—if they had an eminent man as a permanent head, rather than having to refer frequently to someone who by chance was placed through his political position at the head of the bar? [1908]
If the Commonwealth would consider withdrawing from the whole field of income taxation there would be a saving which the public would appreciate. If it would do so, we would be willing to face the difficulties of approaching the people to make good the revenue that the Commonwealth had relinquished. [1923]

So the difference in relevant published usage is probably somewhat greater than the Ngram chart suggests. Nevertheless, from about 1910 onward, the vast majority of instances of "would appreciate if" are on point—and usage of that form appears to be increasing moderately in published writing (and probably much more vigorously in spoken English, where copy editors aren't around to force wayward expressions to conform to the idiomatically favored form).
To sum up,

I'd appreciate it if you'd share some of your thoughts.

remains the more common idiomatic form of the two that you ask about, but

I'd appreciate if you shared some of your thoughts.

is also widely used, and most people wouldn't dream of challenging its use on grounds that it is not the preferred idiomatic form. In any event, no one will have any trouble understanding either form of expression.

Semantic differences


Multiple proofs for the same problem

Question: One way of encouraging students to explore mathematics can be letting them to use different approaches to solve the same problem. If students can find alternatives from different areas of mathematics in the future they can develop that skill to use concepts from different areas outside of mathematics to solve global challenges in mathematics that was already achieved by great mathematicians in the past. As an example famous squaring the square problem was solved by applying Kirchhoff's circuit laws in physics .What are the examples you have relevant to fulfill this requirement not in mathematicians level but within the scope of students level ?
When you talk about geometry, you can find problems which can be solved using Geometry, Coordinate geometry, Trigonometry, Vectors and Argand diagram. In combinatorics you can use formula to simplify or combinatorial arguments where students have much freedom to think creatively. What would you suggest as problems to give this exposure to advanced level students ?
Comment: I would hope that *every* mathematical experience would include multiple approaches and diverse perspectives from the different participants!
Comment: What exactly is the "advanced level" you are talking about?
Comment: Yes of cause, but here I'm specifically concerning about alternative approaches from different areas rather than within the same topic. As an example Pythagoras theorem you can prove in more than 200 different ways but many of those by plane geometry itself. When you use dot product of vectors you have one example for the stated purpose.
Comment: @fedja may   equivalent to high school K 12 level in USA or Advanced level in UK.
Answer: It just crossed my mind that I can offer you some option you haven't probably considered yourself.
Once I experimented in my calculus course (which also involved some elements of analytic geometry and such; usually it is called Calculus 3 or Multivariate Calculus) with the idea to give the students some common sense tasks for which mathematical thinking would be useful

There is a brown electric pole right in front of the entrance to math. department building. Estimate its height with decent precision (telling the answer, the approach and the way to bound the error).

There is a pine tree in the back of the math. building. What (approximately) is the number of the needles on it (same format of submission). An easier version of that is to print a few thousand uniformly distributed points on a sheet of paper and ask to estimate their number. The pine tree was not a perfect rectangle or parallelepiped and the branches on it had different lengths and varying distribution density, so the best way to analyze it (IMO) was to take a few snapshots from various positions and do some measurements on the pictures, plus, of course to approach the lowest branch and to investigate it (it was hanging low enough).

Here is a reprint of the photograph of some electric line going straight to the horizon with a shed somewhere near it.
a) estimate the shed height (assuming that the photographer took the picture with a hand camera and was an average size adult)
b) Are the electric poles on the picture of essentially the same height or there is a noticeable difference in height between some of them? (both with an explanation of how you did it and why you think your approach works)

The problems were assigned in the beginning of the course and were due any time before the semester ends. They were for extra credit (30 points each, with each of 2 midterms worth 100 points and a regular weekly quiz 10 points). Almost nobody took the challenge so I abandoned the idea and tried something else next time I taught the same class, but it still may be a good source of problems allowing (or sometimes even requiring) a choice between or a combination of various approaches and neither of those problems requires anything a smart high school kid would not know or not be able to derive from first principles.
Comment: Yes we can't expect average students to know the value of this kind of work because they are lacking in sense of mathematics but as educators who have vision of their work , first we need to realize the importance of this.
Answer: At the college level, see here, here, here, here, and here. Only the first link is suitable for high school courses.
Comment: Quite interesting, yes as you mentioned only part of first case is helpful for high school mathematics.

Multiple proofs for the same problem