What is the purpose of dreams?

Question: What is the purpose of dreams? I understand there are different types of dreams. I also understand that either directly or indirectly they are from our Creator. But, what is their purpose?
Please give sources if you are able.
Thank you
Answer: Asalaam Alaikum
purpose of dreams can be very general in meaning but i will try to clarify more based on authentic sunnah and quran, insha Allah.
first let us look at the hadith that lays the foundation for everything about dreams.
"True dreams are one of the forty-six parts of Prophethood." (al-Bukhaari, 6472; Muslim, 4201)
and now to have a better understanding of the purpose of dreams, let us remind ourselves of this following hadith.
"That will be because the Prophethood and its effects will be so far away in time, so the believers will be given some compensation in the form of dreams which will bring them some good news or will help them to be patient and steadfast in their faith." (al-Bukhaari, 6499; Muslim, 4200)
from this hadith it is very clear to us about the purpose dreams. it is something that will bring good news to believers and help them to be firm in their faith. as you have mentioned that you understand the different types of dreams, i find no reason to address that here.
i would like to remind you and me about one more hadith about dreams,
It was narrated from Ibn 'Abbaas that the Prophet (peace and blessings of Allaah be upon him) said:"Whoever tells of a dream that he did not see will be commanded [on the Day of Resurrection] to tie two grains of barley together, but he will never be able to do it." (Narrated by al-Bukhaari, 6635)
may Allah the mighty and sublime guide you to the straight path.
Allah knows best.
Comment: Cause and purpose must not be the same.
Comment: @Medi1Saif maybe my usage of words caused the confusion about cause and purpose, the answer is in the viewpoint of purpose. jazaakallah khairan for the clarity.
Comment: Alaikum Salam was Ratmatullahi wa barakatuh brother. Thank you for kindly taking the time to reply and your answer. Abdul Latif

What is the purpose of dreams?


Number of attending days for MP's

Question: In the United Kingdom, is there a minimum requirement for the number of days the MP's have to attend parliament in their tenure of 5 years?
Answer: Not everything that an MP does is done in the chamber.
All MPs will have "surgeries" in their constituency, where they meet with local people and listen to their problems. They will have other constituency work (trying to solve the problems that come up in the surgery, visiting local schools, further meetings with interest groups and so on).
In Westminster, some MP in the governing party will have a job as part of the government.  Opposition MPs will often have party positions, shadowing a particular government department. Back benchers of all parties will have positions on various committees (select committees, public bill committees).
Finally they are whipped to vote on many divisions of the house. The parties don't require MPs to listen to the debate, only to vote the "right" way.
There is no requirement for an MP to attend all debates, or a certain proportion of them. In general, MPs only attend debates in which they have an interest, or feel that they can contribute to. I would not want my MP to be spending his time listening to a debate on Arts Council funding of coal mining communities, when he could be bending a Minister's ear on funding for the local hospital or picking through a piece of legislation in which he has knowledge and interest.
MPs have the "annunciator" system: a live feed from the chamber available to play in their officies. MPs can be following a debate without participating in the Chamber itself.
As an extreme example, Sinn Fein MPs have attended exactly zero debates and voted zero times. They represent their constituents in other ways. If their constituents wanted to, the could vote Sinn Fein out of Parliament. The fact that Sinn Fein MPs continue to be elected shows that for some voters, attendance at Parliament is not required.
It would not be a good idea to force attendance at debates. It is not a good measure of the effort that they are making. It would encourage a culture of "clock watching": MPs would turn up to the required number of days but do nothing.
Comment: It might be worth disambiguating that not all MPs belonging to the party (or parties) in Government will actually hold governmental office.
Comment: They have The Annunciator system, which is a internal system providing live video and info of proceedings (see [here](http://lordsoftheblog.net/2009/05/11/the-annunciator/) or [here](https://www.whatdotheyknow.com/request/parliament_annunciator) for more details).
Comment: Note that MPs can, if they want to, listen to debates from their offices and elsewhere.
Comment: @SteveMelnikoff Do you mean on the BBC parliament channel, or do MPs have their own set up?

Number of attending days for MP's


Is it possible to determine the Miller voltage of a MOSFET from the ON-region characteristics?

Question: Miller's voltage from \$I_{ds}\$ vs \$V_{ds}\$ characteristics for different values of gate-source voltages. Miller's voltage or Miller plateau is the critical gate-source voltage at which MOSFET enters saturation region. In a typical MOSFET datasheet it is observed that there is a curve of gate-source voltage \$(V_{gs})\$ vs gate charge \$(Q_{g})\$ at different values of drain-source voltage \$(V_{ds})\$. Which curve is more relevant to find Miller voltage between on-region characteristics and the previously mentioned graph?
Comment: Can you clarify what you mean by Miller voltage? Do you mean the Early voltage? (https://en.wikipedia.org/wiki/Early_effect)
Comment: Miller voltage is the critical gate-source voltage at which MOSFET enters into saturation region from linear/ohmic/triode region.
Comment: @ArindamMaulik typically, there is already a  substantial Vds before there is a Vgs. When that is the case, the MOSFET enters saturation immediately after leaving cutoff. It would only enter ohmic region if/when Vgs becomes high enough.
Answer:
Miller's voltage or Miller plateau is the critical gate-source voltage at which MOSFET enters saturation region.

A horizontal Miller plateau occurs in a MOSFET circuit with low gate current when the drain current \$I_D\$ of the MOSFET is held constant (or nearly so) by the external circuit, and the MOSFET is operating in the saturated region.
[More generally, a not necessarily horizontal feature, which might or might not be considered a "plateau", will occur in a MOSFET circuit when the \$V_{DS}\$ of the MOSFET changes while the MOSFET is operating in the saturated region.]
Explanation and justification to come.
Here are the \$I_D - V_{DS}\$ characteristics given by CircuitLab's model of the IRF530. The IRF530 obviously operates with \$V_{DS}\$ well above 12V. However, to keep the plots in nice proportions, I have limited the graph to 12V.

Let's place the MOSFET into a circuit with the following constraints.

if \$I_D \le 4 A\$ then \$V_{DS} = 8 V\$
if \$V_{DS}\le 8 V\$ then \$I_D = 4 A\$

We will abbreviate these restraint like this as CCCV for constant-current constant-voltage.

When the MOSFET is placed in such a circuit with CCCV restraints imposed on the drain, then any \$(V_{DS}, I_D)\$ operating point will lie on one of the two black lines at 8V and 4A in the following diagram.

It is important to note that, in the case under consideration,

Any \$(V_{DS}, I_D)\$ operating point will lie on one of the two black lines at 8V and 4A in the above diagram diagram no matter how much or how little charge is present in the MOSFET gate!

Any \$(V_{DS}, I_D)\$ operating point will lie on one of the two black lines at 8V and 4A in the above diagram diagram no matter what the internal capacitances are within the MOSFET or how they may be changing

Now lets consider what happens when we add circuitry that changes the charge in the gate. In this example, we are only applying 1mA current to the gate. This might be 3 orders of magnitude smaller than what one might see in practice. We use such a small current because it makes voltage drops across parasitic impedances negligible.

simulate this circuit – Schematic created using CircuitLab
We show \$V_{DS}\$, \$I_D\$, and \$V_{GS}\$, and we annotate 5 particular points of interest.

In the above plot, we see the Miller plateau between the point labeled "Maximum \$I_D\$, maximum \$V_{GS}\$, and the point labeled "Boundary between saturation region and Ohmic region"

We map each \$(V_{GS},I_D)\$ point of interest onto the \$V_{GS}\$ vs \$I_D\$ characteristics curve.

In this graph, the segment of the horizontal black line between the point labeled "Maximum \$I_D\$, maximum \$V_{GS}\$, and the point labeled "Boundary between saturation region and Ohmic region" corresponds with operating points within the Miller plateau. Since this segment runs nearly parallel with the \$V_{GS}=5.3 V\$, the Miller plateau will occur when \$V_{GS} \approx 5.3 V\$. In fact, the Miller plateau begins slightly below \$V_{GS}=5.3 V\$, and ends at at about \$V_{GS}=5.3 V\$ almost exactly.
We have, above given the general procedure for finding the voltage of the Miller plateau in a MOSFET circuit under CCCV drain conditions, when gate current is small.
By considering how these diagrams are constructed, it should become clear that

The Miller plateau is flat and level when the drain is kept under a CCCV conditions, because the Miller plateau occurs in the constant current part of the curve. When a MOSFET is in the saturation region and drain current is held constant, one is following, or nearly following a curve of constant \$V_{GS}\$.

The voltage at which the Miller plateau begins, when the drain is under CCCV constraints, is the value of \$V_{GS}\$ corresponding to the point where the constant current regime of \$I_D\$ begins. We do not need to know what the charge in the gate is, or the value of the MOSFET's internal capacitance

And to reiterate one more time

When a MOSFET is operated such that its drain is under a CCCV regime, any \$(V_{DS}, I_D)\$ operating point for the MOSFET will lie on either the constant voltage line or the constant current line, no matter how much or how little charge is present in the MOSFET gate! and no matter what are the internal capacitances with the MOSFET and how they are changing.

In practice, manufacturers often test gate charge characteristics with a circuit like this one taken from the datasheet of the IRFZ44N. Here the top MOSFET serves as an adjustable current limiter. This circuit approximates a CCCV regime on the drain.

Resistive Load Line
If a resistive load is connected between the drain and \$V_{DD}\$, the operating points of the MOSFET (under low gate current) will take a different form. The following diagram shows the operating points of a MOSFET circuit with low gate current, under a resistive load line regime.

We don't have as many points of interest in this graph as we did in the case of CCCV. There is no "Maximum \$I_D\$, maximum \$V_{DS}\$" point. We anticipate that as the MOSFET operating point goes from the "\$V_{GS} = V_{th}\$" point to the "Boundary between saturation and Ohmic regions" point, there will be a "feature" that might be called a plateau, but it will not be horizontal. Rather, \$V_{GS}\$ will rise from \$V_{th}\$ (i.e. 4.0 V) to somewhere in the vicinity of 5.2 V. We anticipate 5.2 V, because the "Boundary between saturation and Ohmic regions" point lies between the \$V_{GS} = 5.1 V\$ curve and the \$V_{GS} = 5.3 V\$ curve.
We now show the simulation.

simulate this circuit

As anticipated, we do see a feature that might be called a plateau from \$V_{GS}=4 V\$ to \$V_{GS}=5.2 V\$.
If we made the load resistor much larger, the angle of the load line would become more horizontal, and the Miller plateau would become much more horizontal and distinct. Recalling that we used a low voltage to make our graphs have nice proportions, we are going to switch our \$V_{dd}\$ to 80V now, and run our simulation with the load resistor at 8 and at 80 \$\Omega\$ to show the effects of the load resistance on the slope of the Miller plateau.

simulate this circuit

Indeed, we see that with a larger resistance, the Miller plateau is much more of a plateau.

Effect of high \$I_G\$ on Miller plateau
So far, we have used low values of gate current in our investigations of Miller plateaux. Low currents are often used to test gate-charge vs gate-voltage characteristics. But in practice, gate currents are often in the ampere range, rather than the milli-ampere range. How does that affect Miller plateaux?
One obvious effect is that high gate currents will cause not insignificant voltage drops across the internal resistances of the MOSFET. In the interest of brevity, I will not illustrate examples.
Another, perhaps less obvious effect is related to the drain-source capacitance. Simulations show that the ratio between gate current and drain-source capacitance can have a substantial effect on the symmetry (or asymmetry) of the turn-on Miller plateau and the turn-off Miller plateau. Again, in the interest of brevity, I will not illustrate examples.

Which curve is more relevant to find Miller voltage between on-region characteristics and the previously mentioned graph?
So far, we have used the \$V_{DS}\$ vs \$I_D\$ characteristic curves to investigate the Miller plateau. Often these characteristic curves are not available. In the particular case where drain current is held to a CCCV regime, the full \$V_{DS}\$ vs \$I_D\$ characteristic curves are not needed. One can use the \$V_{GS}\$ vs \$I_{D(sat)}\$ transfer characteristics curve, which carries some of the same information.
The data you want to find is the value of \$V_{GS}\$ which gives the \$I_{D(sat)}\$ which is equal to the maximum current setting of the supply.
The transfer characteristics charts often look like this one from Taiwan Semiconductor's application note AN1001

Or with a log scale for \$I_D\$, they may look like this one from the IRF44N datasheet

What's all this about MOSFET architecture, transconductance, and \$C_{GD}\$?
If the voltage(s) at which the Miller plateau (or "feature") occurs are determined by the path the MOSFET circuit takes through the \$V_{DS}\$ vs \$I_D\$ characteristics curves graph, then why do some answers to this question focus instead on MOSFET architecture, transconductance and \$C_{GD}\$?
Interest in Miller plateaux stems mainly from the impact such plateaux have on switching speed and efficiency. When a MOSFET is in cutoff, \$V_{DS}\$ may be high, but \$I_D\$ is very low, so the power dissipated in the MOSFET is low. On the other hand, when the MOSFET is fully on, \$I_D\$ may be very high, but \$V_{DS}\$ is relatively low, so the dissipated power is again relatively low. However, when \$V_{DS}\$ and \$I_D\$ are both high, dissipated power is high. The area where \$V_{DS}\$ and \$I_D\$ are both high, roughly corresponds to the saturation region. Therefore, there are incentives for a designer to move the MOSFET through this region quickly.
What determines how fast the MOSFET can traverse the saturation region? That is where \$C_{GS}\$, \$C_{GD}\$, and transconductance come into play. They determine, not the voltage of the Miller plateaux, but the width, that is, the amount of charge that needs to be transferred into (or out of) the gate in order to make the MOSFET traverse the saturation region (or at least that part of the saturation region which corresponds to the Miller plateau). It is here that MOSFET architecture becomes an important factor. Different architectures can require different amounts of charge to traverse the exact same \$V_{DS}\$ vs \$I_D\$ path.
Because of the importance of parameters like \$C_{GS}\$, \$C_{DS}\$ and transconductance for switching speed and efficiency, there is a great deal of literature about these parameters. Innovation in MOSFET design aims to give MOSFETs improved values for these parameters. Much of the educational literature, as well as Manufacturer's Application Notes, approach Miller plateaux via discussion about these parameters. So it is natural for one to follow this approach when searching for the answer that was raised by the OP:

"Is it possible to determine the Miller voltage of a MOSFET from the ON-region characteristics?"

Unfortunately, looking at \$C_{GS}\$, \$C_{GD}\$ and transconductance in an attempt to solve the voltage question, is using the wrong tool for the job, and just leads down a rabbit hole.
Answer: Consider these plots from a typical MOSFET:

From: Nell Semi IRF260
Gate charge is measured with fixed drain current (constant current source), therefore drain voltage swing (during which Miller effect is relevant) occurs at a constant point in the transfer function (until the conditions of that function are violated, that is).
This also means the plateau is flat, as the load line follows the flat (active region) region of the drain curves.

Some manufacturers use a resistive load, which gives a sloped plateau; this doesn't make a whole lot of difference usually, because the bulk of the plateau occurs at low voltages, where Crss is highest.  Example:

Source: own website, https://www.seventransistorlabs.com/Images/STP19NM50N%201.045mA%20Gate%20Charge%20400V%2030.1%20ohm%20Drain.png
Waveforms are IG (Ch2, ~1mA/div), VGS (Ch3, 10x) and VDS (Ch1, 10x), in common-source configuration. Notice for this 500V type, Vds drops rapidly after very little charge, because Crss is so tiny at high VDS.  The rest of the plateau is at low VDS so the voltage drop across the resistor, and therefore ID, changes little.  The exact way VDS changes during the plateau, varies between MOSFET types.

Apparent plateau can be higher or lower due to source inductance × \$\frac{dI}{dt}\$ as well, often both during a cycle; in that case the mean plateau voltage is determined by drain current. Though in a real application, turn-on and turn-off currents will differ, and so will the voltages further.  Characterizing the system allows these effects to be separated and measured.
The plateau might also never appear, in cases where the assumptions for Miller effect do not apply.  In switching converters, this is typically ZVS switching, where VDS remains zero while VGS is rising/falling.  Note the above test was done with quite "weak" gate drive (1mA), so that drain voltage changes slowly, ensuring Miller effect shows up.
If the load current is small (relative to Coss and tf), strong gate drive will violate this assumption; note that QDG is still drawn from the gate, but at a delay (when VDS is changing, which thus happens later past the falling edge of VGS), where it doesn't look much like Miller effect anymore.
Put another way, ZVS or other dynamic conditions no longer follow a constant-current load line, thus violating the assumption that the transistor has constant current flow, or passes through a linear amplifying region at all.
Answer: What application notes and datasheets mean when writing about gate plateau (Miller plateau) voltage is a relatively constant region of Vgp(Id) due to the high transconductance of power VDMOS MOSFETs. This phenomenon occurs in the vicinity of abrupt change in Cgd(Vgd).
The VDMOS layout is entirely different from the textbook pictures of lateral MOSFET: its source and drain are on opposite sides of die. This results in a characteristic behavior of VDMOS nonlinear gate-drain capacitance
Cgdmax=300E-12
Cgdmin=3E-12
A=1
s=(Cgdmin+Cgdmax*np.pi/2)/(1+np.pi/2)
leftV = -10
rightV = 10
v = np.linspace(leftV,rightV,2000, endpoint= False)
Cgd = np.where(v<0,
             (
                 (Cgdmin/(np.pi/2)+Cgdmax)/(1+np.pi/2)-Cgdmin/(np.pi/2)) * np.arctan(A*v) + s,
                 (Cgdmax-(Cgdmin+(np.pi/2)*Cgdmax)/(1+np.pi/2)) * np.tanh(A*v) + s
             )

You can examine the BSP89 behavior in the simulation where the BSP89 model is dissected and the parasitic resistances and capacitances are moved into the circuit.
Cgd is low in cutoff and there is a significant contribution of the channel when in inversion. Unlike VDMOS, in lateral MOSFETS the channel contributes to Cgd only in weak inversion; in strong inversion only the drain overlap term contributes, as is also the case in cutoff.
This abrupt change in Cgd behavior, in the vicinity of zero Vgd value, is the only reason of the gate plateau (Miller plateau) existence. Notice that the plateau regions appear when the Vgd( =V(D_int)-V(G_int) ) graph reaches zero. The gate voltage Vgs( =V(G_int)-V(S_int) ) is almost constant while Vgd is small.

The original BSP89 SPICE model (from LTspice's standard.mos library) reads in the comment text (in blue); the "dissected" model is in the .model directive. I reproduce the model gate-drain capacitance behavior with the non-linear variable capacitor Cgd. The capacitor's charge parameter Q=s*(-x*atan(A*x)+ln(1+(A*x)**2)/(A*2))+y*x is the integral of the model nonlinear capacitance (Cgdmin/(np.pi/2)+Cgdmax)/(1+np.pi/2)-Cgdmin/(np.pi/2))*np.arctan(A*v) + s times voltage drop. The simulation against the original BSP89 model gives the identical plot.

To delve deeper into the power MOSFET internals, one can examine the currents and voltages and compare how the drain current is shared among the channel versus the parasitics.
Notice also that, in the Miller plateau phenomenon, the VDMOS specifics reveal itself only through a special Cgd behavior of trench MOSFETs. The plateau regions in transients can be reproduced with a monolithic NMOS transistor augmented with an external nonlinear drain-to-gate capacitor:

Notice that with an unreal great transconductance in simulation, Kp=100, the Miller plateau voltage becomes equal to the threshold voltage:

In this aspect, the OP suspicion about possible connection between Miller plateau and threshold voltages comes true.
Following the discussion, here is the simulation run with the BSP89 model from the manufacturer (Infineon) website; Infineon's spice model of BSP89 exposed as a circuit in a dashed rectangle:
Comment: 1) "due to the high transconductance of power VDMOS MOSFETs." Miller plateaux are present in ALL MOSFET circuits with a voltage limited constant current drain regime. Miller plateaux and not peculiar to  VDMOS. 2) Miller plateau at threshold voltage is characteristic of drain connected to V_DD through resistor.
Comment: This is a topic beside what OP asked for, but is an interesting one by itself: in fact, the situation is *even weirder* as Cgd is not a function of Vgd, but Vds! (Or both in general, but Vds is dominant.) I had made measurements of this, but I don't think I have any data handy anymore. Do not take the SPICE model as gospel: they made the same (reasonable, but faulty!) assumption. Measure the real device!
Comment: "I'm from Jamaica, the "Show Me" island. So show me you're blowing it out your fanny." ( (C) Futurama, The Sting episode ). Seriously, show the visitors to this page that `Miller plateaux are present in ALL MOSFET circuits with a voltage limited constant current drain regime` as the serious problem for system designers, and not just some negligible notches in transients. Please, do not just confidently proclaim your opinion, but try and justify this and the other claims of yours. If you can spare your leisure time
Comment: @Tim Williams: you're right, I used the post as an opportunity in hope to attract attention to SPICE models of power MOSFET in LTspice, the simulator much popular with electronics.SE posters and experts. The attempt has failed to get noticed: for example, nobody seems to care that Cgd=f(Vgd) has two branches like in `if(Vgd<0){Cgd=k1*arctan(A*v)+s}else{Cgd=k2*tanh(A*v)+s})` while the BSP89 model (not just my decriptage, but also standard.mos's original model) seems to use a nonconditional expression with only `arctan` part.
Comment: And you are twice right that the SPICE models are not gospel. However, we need to develop the models to be as perfect as we can get, since the simulation is an unavoidable stage of any serious design effort.
Comment: @Tim Williams: LTspice's model for BSP89 in standard.mos is outdated, but simple to use and can be easily custom-tailored. Infineon's 2015 year model for OptiMOS and the other power MOSFETs is more precise (see the plot in answer update) but not so easy for simulation dissection. Happily, it is not encrypted and Infineon does not forbid making research with their library. An aspiring student might learn for oneself intricate details of power MOSFET internals and operation in the course of this research and maybe publish the results interesting for industry.
Comment: Looks like they have a good bit of package parasitics in there as well.  The waveforms are very much in line with expectations (such as laid out in my answer), even despite the high speed (10ps(!!) edge at 6 ohms).


How to get the balance of a contract using Ether.js library

Question: When I am using (await provider.getBalance(contractAddress)).toNumber() I am getting a balance of zero. I have sent 1 Ether to the smart contract prior to this. What am I doing wrong?
Answer: I am no JavaScript expert, but I think the problem is that you are using .toNumber() on a promise (since the .toNumber() would run instantly and not wait for the promise to return), which will be undefined (or 0 I guess?)
I think this would work instead:
numStr = await provider.getBalance(contractAddress);
number = parseInt(numStr);

Where number will be your balance as an integer, I think in wei, so you should expect ```number = 1000000000000000000````
If you want it in ether, you could do
numStr = await provider.getBalance(contractAddress);
wei = parseInt(numStr);
ether = web3.utils.fromWei(wei, "ether");

Where ether should be 1 obviously
Answer: EthersJS stores balance in Wei as an object of BigNumber class. toNumber() tries to cast input, in your case, to Integer, which is not enough to hold 1 ETH represented in Wei. Many operations in Ethereum operate on numbers that are outside the range of safe values to use in JavaScript.
1ETH = 1000000000000000000 WEI (vs a MAX_SAFE_INTEGER of 9007199254740991, see below)
console.log(Number.MAX_SAFE_INTEGER);
// Expected output: 9007199254740991

If you try to simply display the balance, you can cast it to String:
(await provider.getBalance(contractAddress)).toString()

will return 1000000000000000000
A BigNumber is an object which safely allows mathematical operations on numbers of any magnitude. Here is the list of common methods to manipulate BigNumber class


How To have Dynamic SQL in MySQL Stored Procedure

Question: How do you build and use dynamic sql in a MySQL stored procedure?
Answer: After 5.0.13, in stored procedures, you can use dynamic SQL:
delimiter //
CREATE PROCEDURE dynamic(IN tbl CHAR(64), IN col CHAR(64))
BEGIN
    SET @s = CONCAT('SELECT ',col,' FROM ',tbl );
    PREPARE stmt FROM @s;
    EXECUTE stmt;
    DEALLOCATE PREPARE stmt;
END
//
delimiter ;

Dynamic SQL does not work in functions or triggers. See the MySQL documentation for more uses.
Comment: Notice that you can only execute one statment each time. View https://stackoverflow.com/a/20374657/2630035 for an easier way
Answer: I don't believe MySQL supports dynamic sql.  You can do "prepared" statements which is similar, but different.
Here is an example:
mysql> PREPARE stmt FROM
    -> 'select count(*)
    -> from information_schema.schemata
    -> where schema_name = ? or schema_name = ?'
;
Query OK, 0 rows affected (0.00 sec)
Statement prepared
mysql> EXECUTE stmt
    -> USING @schema1,@schema2
+----------+
| count(*) |
+----------+
|        2 |
+----------+
1 row in set (0.00 sec)
mysql> DEALLOCATE PREPARE stmt;

The prepared statements are often used to see an execution plan for a given query.  Since they are executed with the execute command and the sql can be assigned to a variable you can approximate the some of the same behavior as dynamic sql.
Here is a good link about this:
Don't forget to deallocate the stmt using the last line!
Good Luck!
Comment: it isn't working when the `?` is in the place of the table name
Comment: @JaderDias use CONCAT to create the stmt, and only use `?` for non-meta information. e.g. : `PREPARE stmt FROM CONCAT('SELECT ',col,' FROM ',tbl,' WHERE col = ? AND col2 = ?' );`
Comment: Apparently, they're studying [EXECUTE IMMEDIATE](http://dev.mysql.com/worklog/task/?id=2793) for future versions.
Comment: Are you trying this via the mysql console? or using another method, if you are using this in code, your provider would need to support it.
Comment: Also doesn't work on column names (as with table names) - see below answer/above comment instead.
Comment: That link to rpbouman.blogspot.com was super-helpful!
Answer: You can pass thru outside the dynamic statement using User-Defined Variables
Server version: 5.6.25-log MySQL Community Server (GPL)

mysql> PREPARE stmt FROM 'select "AAAA" into @a';
Query OK, 0 rows affected (0.01 sec)
Statement prepared

mysql> EXECUTE stmt;
Query OK, 1 row affected (0.01 sec)

DEALLOCATE prepare stmt;
Query OK, 0 rows affected (0.01 sec)

mysql> select @a;
+------+
| @a   |
+------+
|AAAA  |
+------+
1 row in set (0.01 sec)


Did Earth "tilt" seasonally before it was accepted that the world was not flat?

Question: Before it was widely accepted that the Earth was round, how did astronomers describe the yearly movement of the sun to south in the Northern Winter that produced the seasons? Did the Earth wobble or did the Sun just not have a perfectly circular trajectory around the Earth? Did this perspective change when we realized the Earth was a globe? What about before Heliocentrism was the norm?
Comment: The fact that the Earth is spherical has been accepted nearly since the beginning. Even the ancient Greeks knew it was spherical (or at the very least not flat) from such evidence as the Earth's shadow on the Moon during a lunar eclipse is circular. They even did a reasonably good job of measuring the Earth's radius. I don't know of any ancient cultures or groups who honestly thought the Earth was flat, but I'm no historian.
Comment: I've always found it strange that the rumor is that people at the time of Columbus thought the Earth was flat when the educated read Aristotle and held his ideas in high regard. . . . That said, this is a better question for history of Science & Math.    http://hsm.stackexchange.com/
Comment: Found essentially the same question here with a nice answer:   http://physics.stackexchange.com/questions/128081/how-do-geocentric-theories-explain-seasons
Answer: This is not really a physics or astronomy question, but I reckon that when you model the Earth as flat, the stars and the Sun are merely minor objects and their motion is governed by heavenly spirits rather than regular orbits. So, rather then the flat Earth tilting, the Sun's trajectory changed with the seasons.
Btw, what I find more concerning is how the (infinitely extended) flat Earth can be reconciled with the Sun rising in the East after setting in the West: how did it get there?

Btw2, I don't think that elites in classic times (Greek/Egyptian/Middle East Cultures ~1000Bc and more recent) seriously considered the Earth to be flat. All the constructions of epicyles etc for explaining the data assume a spherical Earth in the centre of the cosmos. Flat is much more arcane than Geocentric.
Comment: In Greek mythology, Helios (the sun god) with his horses and carriage boarded a kind of ship in the evening, in the West, that travelled on the Okeanos (the saltwater stream circling the flat Earth) so that he arrived in the East at morning, ready to start a new ride across the sky. The Earth was not considered infinite.
Comment: this really doesn't address teh problem that the original question is invalid.  Besides which, I don't recall any ancient flat-Earthers claiming it had infinite extent.
Comment: I suppose only the less educated actually considered the Earth to be flat, as it is not immediately evident that it is not unless you travel a lot. From the POV of your tiny village life, all the world you know ends after the mountains surrounding you. I don't see why this question is being called invalid. I had a question and now I have an answer. There is a "history" tag in this forum, and I felt it was appropriate. Thanks for the brief explanation.
Comment: The question was called _invalid_ because it is based on a false premise (that ancient astronomers thought the World was flat). At any time in history, anyone capable of doing calculations on the positions of heavenly bodies has known about the Earth being round. Several cultures around the world established this independently (as they would - it's obvious to anyone who can measure things).


Can our team perform Sprint Reviews using JIRA?

Question: I want to make a Sprint Review for one of my Sprints using JIRA. I have no idea whether this can be created on JIRA. Can the Sprint Review for a Sprint be done in JIRA?
Comment: A sprint review is an interactive meeting of people. What do you expact to "make" in Jira? What do you want it to look like?
Answer: TL;DR
At heart, JIRA is just a ticketing system. It is not a substitute for interpersonal interactions or real-time collaboration, and absolutely not an effective substitute for the Sprint Review event in Scrum.
JIRA Tickets are Not Sprint Reviews
Even if you use its comment features,  you can't substitute ticket-based comments in JIRA for a collaborative Sprint Review. The Scrum Guide clearly describes the Sprint Review as follows (bold emphasis mine):

The Scrum Team presents the results of their work to key stakeholders and progress toward the Product Goal is discussed.
During the event, the Scrum Team and stakeholders review what was accomplished in the Sprint and what has changed in their environment. Based on this information, attendees collaborate on what to do next. The Product Backlog may also be adjusted to meet new opportunities. The Sprint Review is a working session and the Scrum Team should avoid limiting it to a presentation.

While you could have an asynchronuous conversation in JIRA about a given work item, you can't make it into a collaborative working session, and would have to fight the tool's ticketing system metaphor to even approach making it something other than a presentation.
Successful Scrum practitioners generally use the Sprint Review for product/feature demonstrations, and treat those demos as part of a test-first approach during Sprint Planning. Using a ticketing system like JIRA does the exact opposite: it typically turns the "review" process into a status report of tickets completed, which is largely useless for:

interactively inspecting the current Increment,
understanding the value or implementation of the Sprint Goal,
building real collaboration with stakeholders,
holding real-time discussions, or
creating two-way conversations about how to refine the product further.

If you think of the Sprint Review only as a "percent completed" status report, then thinking you can do this in JIRA is a logical (if incorrect) interpretation. However, this type of status reporting misses the essential aspects of what a well-executed Sprint Review should do, and is most definitely an agility anti-pattern.
Answer: First of all, Jira is a ticketing tool where you create and constantly define and update your backlog. What should be concentrated  on during sprint review is a compete gathering of the team members; PM, developers, solution architects, designers, to demonstrate the efforts of the whole team. All team members are given the opportunity to speak about the work they have done during the iteration/sprint.


construction joint in shear wall passing through vertical bar splices

Question: Usually in cores and shear walls, one extends vertical bars above the construction joint a distance at least equal to the lap splice length to allow for splices away from the construction joint. But is there a problem if the splice does occur at the construction joint (such that part of the splice is below and part is above the joint)?
Comment: You'll likely need to put some more effort into this post before receiving a quality answer. You might start by updating the post with a better / more legible sketch. Also, some rough dimensions, an indication of where this section is being cut, and rough rebar size / splice length would be good. You might also 'show your work' by summarizing your knowledge of general construction joint placement guidelines.
Comment: I asked generally, usually in cores and shear wall I extend vertical bars above construction joint minimum lap splice length to make splice away construction joint. But if this splice location intersecting construction join ( I mean that part of splice below and part above construction joint) is there any problem
Answer: There's no structural issue to any code that I know of. In the final state for design strength calculations construction joints are ignored.
However, it may make construction more difficult. Ask the contractor (if he's already been appointed for the project).


Motion graphics vs compositing

Question: I am really confused between the meaning of motion graphics and compositing. Is motion graphics mean using still image to create illusion of moving object and compositing is combining 2 or more clips together in the same frame?
Answer: Motion graphics consists of Graphic Design and Animation. Main focus is to deal with images, typography, color and illustrations, also it's key to work with design assets, like flow charts, icons, images or backdrops, which created with animation in mind.
However Compositing consists of Animation, Mathematics and Rating Pictures (eyeballing). Main focus is digital image manipulation - it's the art and science to combine (matching) images from multiple sources like film, photographs or 3d renderings into new (blended) images to create a perfect illusion.
Comment: Melted? That might not be the right word. "Blended" maybe?
Comment: Thanks for your help @stib. I'm not a native :) "Blended" is too technical term, something more artistic would be nice, maybe "fuse"?
Comment: I wouldn't say "blended" is technical, it's a synonym for "mixed". "Fuse" is more for connecting things (usually using heat to melt them). You might say "the colours were blended" but you wouldn't say "the colours were fused".
Answer: Composition involves layering of multiple provided elements, such as live action footage, matte paintings, and special effects. Skills include keying, color correction, and integration. Compositing is often seamless and invisible, with the intent of making the shot appear to have been captured entirely in camera. All special effects in movies for instance have compositing as a final step to integrate the work of the other disciplines.
Motion graphics on the other hand is an extension of graphic design, but animated. The purpose of motion graphics is to tell a story, sell a product, or add visual interest. It does not produce a seamless photo-real image.
Comment: yea, a more succinct explanation, I like it :)
Comment: @eLouai Why the downvote?
Comment: @poor what do you mean downvote? Oh, for your explanation ... did you read your explanation ... "motion graphics consists of graphic design and animation?", that can be shortened to motion graphics is animation. But then is it fair to call motion graphics an animation, too generic because  it's not really an animation in the traditional cel animated sense. I would say "motion graphics is used to create the illusion of motion in multimedia projects" NOW that is MUCH clearer. Your explanation was just too generic and needed to be reworked. Maybe it was harsh for a downvote but that was my reason
Comment: @eLouai Thanks for your explanation. Feel free to improve my post instead, I'd really appreciate your edit. If an answer shows effort in general, I'd encorage you to expand or re-word it, which is better practice (IMO). This increases the quality of the whole site, which is need to get out of beta someday. Anyway, regarding to your proposal: "...multimedia projects" does not refer to graphic design, what is key. Eg. think of kinetic typography, it's mainly well staged typography combined with classical animation principles. So I don't think this one setence will help to make it better (IMO).
Answer: In addition to what @poor said, there are many applications which do both. For example, Apple Motion, Adobe After Effects, or Autodesk Combustion. Each one can do some combination of animating stills, drawing shapes, displaying text, and each also comes with tools for doing compositing (keyers, masks, matte manipulation tools, etc.).
In fact, motion graphics often involves compositing. For example, if you think of the title sequence of most James Bond movies, they often involve a combination of silhouettes of people (usually women), hand or computer-drawn graphics, and text. This is a perfect example of how motion graphics involves both graphic design and compositing.
Answer: Motion graphics are pieces of digital footage or animation which create the illusion of motion or rotation, and are usually combined with audio for use in multimedia projects
It's the industry standard now and it's very important to know the benefits from the clients' perspective. Here is a great resource on that
https://yansmedia.com/2d-motion-graphics-is-the-best-animation-style-for-corporate-video-production/

Motion graphics vs compositing


Is it possible to swim 125 km in week?

Question: Simple question, can a swimmer train and swim 125 km in week? Just curious to know if it is possible that a swimmer can train and swim 125 km every week, week in week out?
Comment: Comments are not for extended discussion; this conversation has been [moved to chat](https://chat.stackexchange.com/rooms/78313/discussion-on-question-by-kyloren-is-it-possible-to-swim-125-km-in-week).
Comment: My personal opinion, a question about the limits of the human body ARE about the fitness.
Answer: Yes, it's possible. Is it possible for the vast majority of people? No. Is it beneficial? No. How long would it take? 52 hours at a pace of 2.5 minutes per 100 meters.
Here is one guy that could do it.
https://en.m.wikipedia.org/wiki/Martin_Strel
Comment: It is said that Michael Phelps swims 80 km a week in a total of 36 hours. I guess if you were about as fit as him but specialised in long distance-swimming yes it would be possible to swim 125 km, but resulting in about 9 hours of swimming 6 days a week I do not think it is sustainable
Comment: I can't see how it would not be beneficial? And I doubt very much that anyone who can only swim 2.5 minutes per 100m would even be able to complete the distance stated week in week out.
Comment: @Gimli, Phelps is a middle distance swimmer and his training is much different than a distance swimmer. 4 hours per day and 5 hours on the 6th day, with kick and medley thrown in is all you need.

Is it possible to swim 125 km in week?


Does wave-particle duality rely on accepting the Copenhagen interpretation?

Question: If you're a scientist that subscribes to the many worlds theorem, does that mean you do not accept wave particle duality? Seeing as MW postulates that the wave or particle form has always existed that way in your world (If I understood it correctly)
Answer: No, there is no logical dependence on the two.  Recall that particle wave duality existed long before the Copenhagen interpretation of QM.  Relative to that interpretation the wave and the particle acquire specific meaning but they existence of duality is not dependent on, nor does it require, the Copenhagen view of QM.  Particles and Waves were two competing paradigms for describing phenomena that go way back.  I say competing since we usually say, based on experience, that something is either a particle or a wave.  In fact the "things" to which we attribute these behaviors have proven us wrong.  Each is an abstraction based on our experiences.  Duality means that the "things" we play with can behave in both ways and there was not reason to choose one paradigm over the other.  Now the two views are seen as complementary rather than competing.
Comment: I believe the OP suggests the wave does not exist if you consider it spread among many worlds.
Comment: What is "the wave".  waves exist in each world.  If you mean the wave function that is a different story perhaps but rejecting the existence of one based on an interpretation is illogical.  It is the interpretation that does not survive.
Comment: Thanks! That makes sense, so it just describes a motion or state that we dont understand in our "real world"
Comment: Wave effects are due to amplitude wave functions, so if wave functions are not representing a probability inside one world but a distribution among worlds, there is no wave in one single world I suppose. But I would like to OP to give more details about what they mean.
Comment: I agree but again, that only means that the Copenhagen view of the meaning of this dies.  One can develop a many worlds view in which, in each world, there are dualistic objects that have particle properties and wave properties.


How would you write informal language like this?

Question: "What are you, a saint?"
or
"What are you?  A saint?"
Or is there a better way of punctuating this?
Comment: Either one works, especially if you're using informal language.
Comment: No love for the dash? What are you — a dash contemner?
Answer: Either one would be correct, but the two different representations could indicate a slight difference in how they are enunciated.
In the first example, there would be the slightest of pauses after the initial clause, before the final phrase. It would be perceived overall as one sentence, one complete thought.
In the second example, it would likely be spoken with a slightly longer pause after the first sentence. There would be a momentary break (less than a second) for the concept What are you? to register, and then the offered (and disdained) possible answer given, A saint? This second sentence is technically a fragment, but it is easily understood to mean [Are you] a saint?
The latter form would be perceived as more dramatic, and probably more critical.
These distinctions would be very subtle, and either is an appropriate way to convey the overall concept.


is it possible to replace excel with oracle in XLLOOP?

Question: in XLLoop we have tow main components:
<code>An Excel addin implementation (XLL written in c++).
A server and framework written in java (and in many other languages - see languages section).
</code>
i want to know is any way to replace excel with oracle?
Answer: Interesting effort.
Oracle Database can run java code (except the free Oracle XE versions).
To access the functionserver, which seems to be available as a service over http,
you can use the utl_http package from PL/SQL even if you run Oracle XE.


Tab visibility with Default On

Question: I am currently facing issue where I turned my tab of "insurance policies" object on, but still is not visible. I can find it normally in app menu and click there, but specific tab is nowhere. I also tried to "Overwrite Users' Personal Custom App Customizations" but without any effect :/ . Would be happy for any advice.
Comment: have you added  specific  object tab  to  saleforce app  you are working under setup-> app manager ->  your specific app?
Answer: You created a Custom Object and a tab for it, and the tab isn't visible for your Users (non Admin Users). First thing's first, check your User's permissions.
User Permissions Needed:

To create or change Tab layouts: "Customize Application".
To create or edit Users: "Manage Users".

If the Custom Object is still in the status of "In Development" it will not be available. Follow the steps below to check the status of the object :-

Click the gear icon | Setup
Go to Object Manager
Click on the name of the object
Click "Edit"
In the section "Deployment Status", ensure it is set to "Deployed" then save

If you've checked User permissions and the tab is still hidden, check the following troubleshooting steps:

The tab may be hidden for the Profile. Go to the User's profile and change it to Default On.
Check if the Object permission checkboxes are checked for the profile (Read/Write/Delete/View All/Modify All). If they aren't checked, then check the boxes as per your business requirements.
Important: You will be unable to edit this permission for a Standard Profile.
If the User has a Standard Profile, you need to create a Custom Profile and then give the "View" permission so that the Custom Object tab is accessible by the User. The Custom Object tabs are not visible for Standard Profiles, however. Alternatively, you could create a Permission Set that allows this access and assign it to the individual users.
If the Custom Object is on the Detail side of a Master-Detail Relationship, then the Master Object is not visible to the user.
Users can also modify their own tab settings under the User settings. This could also cause Tabs to be hidden for some Users. Related documentation:  Customize Your Tabs in Salesforce Classic

Tab visibility with Default On


da Vinci Jr. nozzle diagram

Question: Has anybody taken apart a da Vinci Jr. 3D printer nozzle?
My first time trying to clean the nozzle after it jammed, I broke off the filament immediately before it gets heated, inside the nozzle assembly. The XYZprinting video, "da Vinci Jr. 1.0 - Advanced Nozzle Cleaning", shows the filament coming out easily when heated, but now I'm seeing that I should have cut the filament by the feeder and pulled it out after heating.
I have a long length of wire that is similar to the tiny cleaning wire that comes with the kit. Is it safe to heat up the nozzle and push the wire all the way through?
I tried pushing from the other direction with the large cleaning tool (as shown in video). I also tried heating the tip of the filament and pushing it to the jammed filament inside the nozzle and reconnecting it. It held a while as I tried wiggling it when heated but did not break the jam loose and broke off again...
What should I do?
Comment: If the wire is the same diameter as teh cleaning wire (or less), then OK to use.  There's a number of kits out there which provide what are essentially  ultra-small diameter drill bits for cleaning nozzles.   For that matter, replacement nozzles are pretty cheap, tho' I'm not knowledgeable about compatibility with daVincis
Comment: OK well I tried with a drill bit, not long enough so I unscrewed the small gromet bushing that holds in the feeder tube one the top of the black nozzle assembly box ( it sticks up about a quarter inch, it looks like stainless steel and has a black rubber washer gromet connected to the top to connect feeder tube.) Then, after trying again (no luck) I noticed the female threads that were inside the assembly were now gone... The top connector piece was screwed onto a small nut and now it is trapped inside the black box....
Comment: Now can how can I take the dang thing apart or do I even need extra small torq bits???     please don't reply unless you have dealt with this machine before I'm trying to fix the one I have if possible and not break it
Comment: Have you managed to resolve your issue yet? If so, could you post the solution in an answer? I think that a tried, and tested, solution would be rather useful for other users. Have you tried emailing XYZprinting tech support for a solution?
Answer: After watching the video, it looks this is a Bowden style extruder.  The extruder assembly is encased in the black box the OP mentions.  The assembly is user removable.  It appears they also include two cleaning tools

Small (0.4mm?) wire to clean the nozzle tip
Large (1.7mm?) rod for pushing filament down that is stuck in the cold end

It appears the OP tried accessing the filament in the cold end by removing the fitting at the top of the assembly without opening the assembly.  Unfortunately that caused the nut holding the fitting on from the inside fell off.  At that point he was in a bit of a mess.
I believe the manufacture's intent is to "ram" any broken pieces in the cold end through the hot extruder by using the provided rod and pushing while the extruder is on.  It seems that it should work but would not be easy to do if the filament broke off outside the extruder (which seems to be the case).
At the point he left it, it would seem that he would either have to do surgery or replace the extruder assembly.

da Vinci Jr. nozzle diagram


Need help creating a file reference in a Visual Studio 2008 project

Question: If I remember correctly, in past versions of Visual Studio (6, 2003, 2005), if you add an existing file to a project / solution, the file will be left where it is, rather than copied into the current solution.  Regardless, this is what I need in VS2008.
For example, I have two projects that, for 3rd party DLL reasons, need to link to different DLLs, yet I want to keep the wrapper and my higher level API identical.
Let's say I start with ProjectA, and it has files wrapper.cs and api.cs.  wrapper.cs links to c1.dll and c2.dll.  Now for reasons out of my control, I now need a ProjectB that uses wrapper.cs and api.cs, but links to c3.dll and c4.dll.
Ideally, I'd just create ProjectB in VS2008 and then use "add existing item" to reference wrapper.cs and api.cs in the ProjectA folder.  But when I do this, it performs a file copy, and now I would need to keep track of the changes between the source files and merge as necessary.
Possible solutions that I could really use advice on executing:
1.  perhaps there is an SVN trick that I could employ to make this work?  I couldn't think of one, but if I could make the files in the ProjectB project link to the ProjectA files, I would be happy.
2.  find the right option in VS2008 that will act like "add file reference".  I went through the project's context sensitive menus and didn't find anything that works.
Answer: Have you tried the add as link option ? When you open the "add existing item menu ... " find your file, select it and pick the arrow next to "Add" button and choose "Add as a link".
Comment: talking about a lousy UI (IMO).  Why the heck would they put that in a droplist with those three options?  "Add" should be the default.  "Show previous versions" doesn't even belong in that list.  "Add as link" should have been a checkbox so it's clear.  When "Add" is the first in the list, it's very easy to miss.  MS, drop the droplist and just have a checkbox!!!  Ok, rant over.  :)  **Thank you** for pointing that out to me!  I think that is **exactly** what I was looking for, but for the past two years had never once noticed.
Comment: FYI -- works perfectly.  I just did a test and it went without a hitch.  :)  Thanks again.
Answer: You can edit the .csproj file to refer to the original file, but I thought it did this anyway - look at it in notepad and you'll see plenty of ...... relative directory paths.
There is one SVN trick you can use, you can use externals to check out the original files, and you can get these to any directory you like, but it cannot checkout to a directory that contains existing files - it clears the contents first IIRC.
Comment: VS2008 does actually make a file copy.  Just try "add existing" right now and you'll see that your project will now have a copy of the file you had specified.  Thanks for the SVN tip -- I'll have to look into "externals".  The reason why I figured this would be a problem was because of what you said -- you can't check out in a non-empty directory.
Answer: I don't have a direct answer to your question, but it really sounds like the correct solution in this case is to isolate the functionality of wrapper.cs and api.cs, provide functionality to dynamically load their dependencies, and to package these as a seperate class library that each project can consume.


In app development is it common to first write your app in a high level language, then rewrite it in a low level language?

Question: Maybe I have misunderstood this concept. But is it common, when developing the backend to an app, mobile or web. To first write it in a high level programming language such as php, python, javascript to quickly develop a working prototype with fewer lines of code.
And then if performance becomes a priority rewriting the app in a low level language such as C or C++?
Comment: Script languages are not what I would call a higher level language. And I wouldn't call C++ a low level language either.
Answer: If an application needs to be optimized for performance, you don't rewrite the whole thing in a different programming language.  Instead, you profile the application, find its "hot spots" (the code where the program is spending most of its clock cycles), and rewrite only the code in those hot spots.  Generally, those hot spots will comprise 10 percent or less of the overall code.
In practice, it is uncommon to change programming languages mid-project, because languages are commonly chosen for their applicability to the problem domain.  Web applications are written in web languages because they run in browsers and web servers, and because most of your time is spent waiting for networks and databases, not crunching numbers.  Games are not always written in such languages, because there are languages that are better suited to the gaming domain.
Comment: A game might be written in two parts, with a high level language doing the "what meshes to draw with which textures", and a low level language doing the actual drawing, etc. This may be presented as solely the high level language with a "3D graphics" library
Comment: @Caleth: Sure.  This is just the broad brush strokes.
Comment: Oh I agree. My comment was more an example of the "pick language based on the problem domain" process having "surprising" results
Comment: @Caleth Don't worry about the horse going blind,just load the wagon.
Answer: It's certainly not uncommon to write a prototype implementation when in an exploratory phase. I would bet the vast majority of such prototypes are written in the same language as the language used for a rewrite (which often never comes). Similarly, the language used for either part is likely determined by the local culture of the company implementing the code rather than "performance". No one is going to use a language they are not familiar with to write a prototype just because someone says it's "good at prototyping", at least not for critical functionality. Language choices are almost always predicated on familiarity.
As Robert Harvey states, usually programs (or really systems) are rewritten piece-meal, not all at once. Usually there are "hot spots" that can be rewritten in the same language or potentially a different language that will provide the needed performance gains. A whole rewrite for performance reasons would typically be after all the obvious "hot spots" were addressed, and an attempt to optimize the current code. Rewrites may also happen due to changes in the project's culture.
There have definitely been several public projects that have been rewritten from "high-level" languages to "low-level" languages, but it's often not clear what the motivations are and rarely are they solely performance. They may not even include performance. It's not clear how often this actually happens overall though. Again, culture likely has a dominant influence. For example, one of those examples is a project Paul Graham wrote in Common Lisp that was used by Yahoo for years but was eventually rewritten in C++ and Perl at a point when Paul Graham was not involved with the project.
If a rewrite was to be done with performance as one of the major goals and the current language is a language whose primary implementation is an interpreter, then assuming a new language is chosen for performance, it is likely to be any language whose primary implementation is a (potentially JIT) compiler, not just C or C++. This includes Java, C#, Go, Rust, O'Caml, Haskell, even JavaScript nowadays. Again, such a choice is likely to be more driven by familiarity and culture than any objective metric.
Comment: To avoid that "rewrite that never comes" it can be handy to pick a language no one wants to work with for the prototype. Makes it more likely that the prototype will be thrown away... of course, at the risk of a terrible backfire.


Adjective that describes a person who does not care, but with a hint of malice to it

Question: I cannot think of a word that means to deliberately not care. I thought ambivalent might fit; however, that means having conflicting feelings about a person or subject. I am searching for a word that means to not care either way something happens, almost as if this person thinks so lowly of another (perhaps considering them obsolete), they do not subject themselves to any involvement in that persons life. Any help is appreciated.
Answer: That person could be described as callous, and they would exhibit callous indifference.
Callous (MW, definition 2)

feeling no emotion
feeling or showing no sympathy for others

Plenty of examples at that link.  Plus you could say:

Mary exhibited callous indifference when she didn't hold the door open for the man with a walker.
My boss is so callous - the first thing he said when I told him that I had the flu was "I hope you didn't infect anyone else."
Answer: See if this one fits the bill .......
an·ti·pa·thet·ic
/anˌtipəˈTHetik/
adjective
adjective: antipathetic
showing or feeling a strong aversion.
"it is human nature to be antipathetic to change"
synonyms: hostile to, against, (dead) set against, opposed to, antagonistic to/toward, ill-disposed to, unsympathetic to/toward; More
informalanti, down on
Usage;
"we were taught to be antipathetic to all foreigners"
antonyms: pro


What do you call this type of top down grid, sort of trapezoidal?

Question:
I have checked and this may be called Top-Down (Oblique) from the wikipedia page of Axonometric projection BUT the image I am looking for kinda have that trapezoidal nature. As you can see the grids aren't necessarily straight. Any clues?
Comment: what is this image from? Looks like a fun game.
Comment: It is called Eiyuu Senki by Tenco. @Vincent.
Comment: "All wrong" comes to mind :) I can't decide if the characters are standing up on a deformed rectangle titled towards the viewer, or flat cut-outs leaning backwards, away from the viewpoint.
Comment: The perspective might throw you off, but this kinds of orientation is normal in these games @usr2564301
Answer: Its not in the family of axonometric projections. So it is either in the family of perspective, some random projection or it is not a projection at all.
I would just call it a perspective grid. This is also by the way why a image is worth more than a thousand words as there really is no name for half of what you see. Only a rather leg thy and misinterpretation prone description.
Comment: Thanks! That limits the things i have to look up. "Perspective grid", ill put that in mind!
Answer:
The image seems to contain three different perspectives:

The tiles (magenta) are drawn using two-point perspective. The x-axis is parallel to the picture plane while the lines parallel to the y-axis converge to vanishing point A (backwards) and the lines parallel to the z-axis converge to vanishing point B (downwards).
The characters (cyan) doesn't really have perspective. They are just flat sprites seen from the side. The rear character seems to bee a little bit smaller than the others, so there might be some scaling going on. In lack of a better term I would call it two and a half dimensional or 2.5D.
The background (orange) is drawn using a classic two-point perspective with the two vanishing points, C and D, placed on the horizon.

This style of graphics might have a proper name in the (japanese?) gaming industry, but I'm not aware of it.
I don't think there is a special mathematical logic behind it. It's really just a collage of images, cleverly placed and sized in an attempt to give a three-dimensional illusion.
Wikipedia on perspective.
Wikipedia on 2.5D.
Comment: This is the closest explanation i can have. The details on how the image is formed is the biggest clue i have right now. Thanks
Comment: I don't understand your vanishing point B. It's "just a skewed rectagle" so shouldn't it be 1-Point-Perspective?
Comment: @BlueWizard, it's not just a skewed rectangle - it's a 3d box skewed in two dimensions. Look at the thickness of the board (in the original image). The lines parallel to the z-axis are in fact not vertical, but converge to a point. Try zooming in on one of the bottom corners of the image.


The solutions of the inequality $[x^2]+5[x]+6>2$?

Question: I tried to solve this inequality by taking the square outside the floor function $[y]$ (greatest integer less than $y$)but it was wrong since if $x=2.5$ then $[x]= 2$ and $x^2=4$ while $[x^2]=[6.25]=6$.
Comment: write $n = [x]$ and $[x^2] = n^2 + c$. Solve the problem as if its a quadratic in $n$, with answer depending on $c$. This gives you the range of values that $x$ can take
Comment: I think there are negative values for $x$.
Comment: What operation is your $[\cdot]$?
Comment: Oviously the roots are negative but what are they?
Comment: Did you try Calvin's method? When you take  $[x]$ as $n$ and $[x^2]$ as $n^2$ and solve it as quadratic equation you'll get $n$ varying from $(-4-c)$ to $(-9-c)$. So, for the equation to be true your $n$ needs to be at least greater than $-4$.
Comment: @ItiShree  thanks for your help this is correct answer but I don't know about Calvin's method can you please tell me about that
Comment: I have posted the answer, if you feel it is correct then accept it :)
Answer: Define $f(x)=\operatorname{floor}\left(x^2\right)+5\operatorname{floor}\left(x\right)+6 = [x^2] + 5[x] + 6$.
I'll present some graphs that indicate the solution set is more complicated than $x\ge -4$.
(Desmos link)
We see the solution is made up of 3 different regions. As you can see Desmos is not certain about the accuracy of its plot so I found a second opinion that indeed indicates that there is a small hole in the solution regions a small bit to the left of $-5$ (W|A link),

I don't understand where $-4$ came from. Firstly, it does not come from the other potential interpretation of $[\cdot]$ as the ceiling function, as these calculations in W|A show. Secondly, under the interpretation $[x] = \operatorname{floor}(x)$, we have $f(-2)=0$.
Clearly, even without a graph, there are at least two distinct regions that satisfy the inequality, since if $x>0$, then
$$ f\left(x\right)=[x^2] + 5[x]+6 > 6 > 2$$
and if $x < -6 $ then
$$ [x^2] + 5[x]+6 ≥ (x^2-1) + 5(x-1) + 6 =  \underbrace{x(x+5)}_{>6}  > 2  $$
so the solution region must contain
$$ \{ x < -6 \} \cup \{x > 0\}$$
as a subset. The fact that there is a third region is not so obvious and requires more careful study of the difference between $[x^2]$ and $x^2$.
Comment: I think you are copied the wrong question.
Comment: @user584880 please explain?
Comment: It was$$[x^2]+5[x]+6>2$$
Comment: @user584880 what did I use instead? Looks the same to me?
Comment: @user584880 I made a large number of claims. If you could point out one that isn't right, I would appreciate it greatly. In addition, I have provided a number of graphs, and you can change the inputs. If you could provide me with a graph / link that has the 'correct' function, that would be great.
Answer: I think the answer should be: $x\le-\sqrt{27}\qquad $ or $\qquad -5\le{x}\le-\sqrt{22}\qquad $
or
$\qquad 0\le{x}\qquad $
Here is a sketch:
For $$-4\le{x}\le-1$$ it is $$x^2+5x+4\le0$$  or   $$x^2+5x\le-4$$, but also
$$ [x^2]+5[x]\le{x^2+5x}$$
so there is no solution in $[-4, -1]$.
For $$-5\le{x}\lt-4$$ it is $\qquad [x]=-5\qquad $ and so $\qquad 5[x]=-25\qquad $ therefor $\qquad [x^2]-25\gt-4\qquad $ $\iff$ $\qquad [x^2]\geqslant22\qquad $ $\iff$ $\qquad x^2\geqslant22\qquad $ $\implies$ $\qquad x\le{-\sqrt{22}}\qquad $
Comment: this matches my graph :)
Comment: How did you obtain this answer?
Comment: For $x$ non negative or smaller than $-6$ is rather obvious. Then I checked the values in the interval $[-6, 0]$
Answer: We can you Calvin's suggested method here (see his comment) by solving the equation as we would with the quadratic equation.
You solve this equation as following, let us take $[x]$ another variable say $n$, and $[x^2]$ as $n^2 + c$. Now your equation becomes :
$$n^2 + c + 5n + 6 = 2$$
$$n (n + 5) = -4 - c$$
Now, we know from above equation that,
n varies from , $$ n = -4 -c$$
to $$ n = -9 - c$$
here, for our required equation to be true, the equation should be strictly greater than $2$. Hence, the least possible value for $x$ in greatest integer function should be greater than $-4$.
I hope this clears your doubt.
Comment: Please tell me about Calvin method
Comment: I used the same thing he mentioned in the comment.
Comment: If you make a graph of the function there should be 3 regions. One is the one you found, one more is for X sufficiently large and negative, and one more comes from a careful study of the term $c$
Comment: You can try to write $[x]+d = x  $ so that $n^2 +2dn+d^2=x^2 $ ie $c=[2dn+d^2], where d is any number in $[0,1)$. Some case analysis will be needed...
Comment: Actually it doesn't seem that any of the boundaries of the regions is -4...sorry


best figure format in terms of resolution?

Question: I am learning latex recently and I want to add figures, charts, maps to my paper. What is the best figure formats in terms of resolution? I have some charts and it has many numbers on them. The numbers are pretty small and I want them to be easily readable. Also, can anyone explain the code.
Thank you and have a good day.
Comment: What code is it that you want explained?
Comment: Use vector graphics, convert it to `tikz` using inkscape, and include the file to your latex file.
Answer: If you have the possibility to obtain a vector graphics, it is the best solution, because it is scalable. An exemplary format is PostScript (*.ps and *.eps iles), but all depends on tools that you are using and a version of TeX (tex/pdftex engine) you want to use.
Comment: also pdf and svg
Comment: @Mark PDF is a lot easier to use with TeX than SVG... @ Kola B. If using pdfTeX, EPS will get converted to PDF anyway, so PDF is at least as good, if not better, in that case. But for TeX, of course, EPS is essential.


What options are there to increase the level of a locus in Werewolf the Forsaken 1st edition?

Question: From what I can figure out there is a rule in the appendix about gathering 150 essence to either create or increase the level of a locus. However, there is also a ritual (Drawing down the Shadow) that will achieve the creation much much cheaper.
Is there something similar for increasing the level?
Answer: There is not a rite for increasing the level of a locus.
As you stated, the only RAW way to increase the level of a locus is to allow 150 essence to accumulate at the site of the locus, and then having it settle over the course of a week. The 150 essence can be provided either by an external source, or by preventing the essence the locus generates from being consumed.


Boolean Logic when one component switches from 0 to 1

Question: I recently was constructing boolean logic for all sorts of examples from Morris Mano's "Digital Logic and Circuit Design".
I noticed that it is possible to construct a boolean logic wrt the inputs which depends on the current state. My question is that is it possible to construct a boolean logic which depend on the previous states too. For example, I wonder if we can construct a boolean logic such that the output will change only when one input changes from 0 to 1 in that time step. Suppose we have 2 inputs p and q, with an output z. When q transits from 0 to 1 ,if p = 0, z = 1 and if p = 1, z = 0. Otherwise, if q transits from 1 to 0, or remains the same as the previous state, no change in output occurs.
Comment: All knowledge of previous state *is* current state. You may differentiate between observable state (outputs) and internal state.
Comment: @greybeard ohh.. okay. Thanks. So is it possible that we can also include the information of the state which was previous to our prior state, without adding other variables?
Comment: What do you mean by "construct a boolean logic"?
Comment: @D.W. by "constructing a boolean logic", I mean generating a boolean expression ( for example, c = a + b )
Comment: I encourage you to [edit] the question accordingly.
Comment: Boolean expressions are stateless: every input always yields the same output. To get a memory effect, you need some... memory, to hold the previous input.
Answer: Designing pure functions (i.e. output depends only on input) is called combinational logic, and designing stateful logic (i.e. a finite state machine) is called sequential logic. If you're working your way through Mano's book, I promise you will get to it.
The traditional way to design a basic sequential circuit is to start with a state diagram, and assign each state to a binary number which is stored in flip-flops.  You then design a combinational circuit whose inputs include the previous state and whose output includes the appropriate inputs to the flip-flops to transition it them to the desired state.
For this, you need the truth table for the flip-flops that you are using. As an example, this is the truth table for a JK flip-flop:
  Q  Q'  |  J  K
---------+--------
  0  0   |  0  X
  0  1   |  1  X
  1  0   |  X  1
  1  1   |  X  0

So, for example, to transition from state 0 to state 1, the J line must be 1, and the K signal can be anything. You can either "reset" (J=1, K=0) or
"toggle" (J=1, K=1); either will work. The previous state of the flip-flop is an input to the combinational circuit, and the J and K signals are outputs of the combinational circuit.
Pulse-triggered JK flip-flops are especially popular for basic sequential design because the pulse-triggered design avoid timing hazards, and the "don't care" inputs often make the combinational circuitry simpler.
There is an art in how to assign binary values to states. Sometimes, it is worth using more flip-flops to simplify the combinational circuitry, especially in high-speed circuits where edge-triggered flip-flops may be more appropriate than pulse-triggered ones to minimise propagation delay.
A final note on terminology: Older texts use the term "master-slave" to refer to pulse-triggered flip-flops. For obvious reasons, that phrase is falling out of favour. That older terminology describes how it has traditionally been built (with two RS flip flops), rather than what it actually does.
Answer: If we want to build a circuit that depends on previous states, the way we do that is to keep a copy of the previous state.  That way, it is part of the current state.  Indeed, the circuit can only depend on the input and current state; it can't depend on past information that hasn't been stored in the current state.  This may involve introducing additional variables (or registers) to store that information about the past.


Explicit Riemann Hilbert correspondence

Question: For simplicity, we assume that $X=\mathbb P_{\mathbb C}^1-\{s_1, s_2, \dots, s_k\}$ and $\infty \in X$.
Consider the trivial bundle $E=\mathcal O_X^r$ with the connection $\nabla$ induced by a Fushcian system on $X$, i.e.
$$\nabla:= d+\sum_{i=1}^k \frac{A_i}{z-s_i},$$
where $A_i$'s are $r\times r$ constant matrices over $\mathbb C$ such that $\sum_{i=1}^kA_i=0$.
Then we have a flat bundle with connection (or a logarithmic connection), note it only has regular singularities.
My question is that what is the corresponding monodromy representation to $(E,\nabla)$ via the Riemann Hilbert correspondence?
The known part is that locally at each $z=s_i$, the monodromy $T_i$ can be obtained by the residue map: $T_i=\exp(2\pi i A_i)$, but this seems not to admit a unique representation up to isomorphism.
Is there any more properties/facts around the question?
Comment: You cannot solve ode "explicitly" - so cannot find explicit monodromies. Rare exceptions like Knizhnik-Zamolodchikov equation are due some hidden Lie group symmetry inside.
Comment: By Riemann Hilbert correspondence, if the sum of A_i is zero, and fix a map $\mathbb C/\mathbb Z\to \mathbb C$, then there exists a unique local system, namely a unique representation.
Answer: It depends on what is called "explicit". If $k>2$, monodromy representation is a transcendental function of the $A_j$ and $s_j$. When $d=0$, it was expressed as an everywhere convergent power series in
the $A_j$ whose coefficients are explicit (rational) functions in $s_j$ by Lappo-Danilevski:
Lappo-Danilevsky, J. A. Mémoires sur la théorie des systèmes des équations différentielles linéaires. (French) Chelsea Publishing Co., New York, N. Y., 1953.
If $d\neq 0$, the system is not Fuchsian: singularity at $\infty$ is irregular. If $k=2, d\neq 0$ your system already contains the
"prolate/oblate spheroid equations", which were studied much and no reasonable explicit formula for the monodromy
is known. There are asymptotics, of course. A recent paper about this special case, with a good reference list is
Richard-Jung, F.; Ramis, J.-P.; Thomann, J.; Fauvet, F. New characterizations for the eigenvalues of the prolate spheroidal wave equation. Stud. Appl. Math. 138 (2017), no. 1, 3–42.
The case $d=0$, $k=3$ was also much studied. The papers usually refer to "Heun's equation".
Comment: In physics they call it 'time ordered exponent' https://en.m.wikipedia.org/wiki/Ordered_exponential
Comment: @Alexander Chervov: good remark! This gives many references which are more modern than the original papers of Lappo-Danilevsky.
Comment: @Alexander Chervov: what is this m.wikipedia? I could not find any general description.
Comment: M stands for mobile it is the same wiki, but it looks like that from mobile devices
Comment: Thanks a lot for your help. Maybe I should assume that the sum of A_i is 0 and d is not 0 so that the system is Fuchsian, do you have any idea in this case?
Comment: Indeed, I am working on the cases of $d\neq 0$ and $k\geq 3$.
Answer: You are correct that the monodromy representation is given by the $T_i$. To address your concerns about this being unique up to isomorphism, notice that a change of basis of $\mathcal{O}_X^r$ induces a corresponding (compatible) change to the $T_i$.
You might be interested in the following references: Sections 5.1.1 and 5.1.2 of Hotta, Tanasaki, and Takeuchi's "D-Modules, Perverse Sheaves, and Representation Theory"; and Chapter III of "Algebraic D-Modules" by Borel, et al.
Comment: Thanks a lot. Actually the reference you gave is exactly the book I am reading. In this book, they gave a way to obtain the monodromy representation, however, their method requires that all monodromy are commuting invertible matrices, which I do not get the point, do you have any idea?
Comment: @Longma if you don't have commuting matrices, you don't get an integrable connection, and in particular can't use the Riemann-Hilbert Correspondence. In fact, you won't even get a D-module
Comment: In higher dimensional cases, I totally agree with you. However, in my example, we are working on the one dimensional case, namely, every two components of the NCD divisor has no intersection, so we don't need to require that the monodromy commutates. (Since the commutativity condition is due to monodromy agrees on the intersection of each "singularity". Does it make any sense for you?
Comment: @Longma Oh! Shoot! You're right! Yeah, there's no particular reason you need commuting matrices. My answer still holds , though.
Comment: Ok. I need more information to determine the induced map between isomorphic classes. Thanks anyway.

Explicit Riemann Hilbert correspondence


create a sub directory in asset directory on run time in android

Question: Can anybody tell me how to create a sub folder in asset folder at run time and copy the files from res folder to my assets sub folder?
Answer: It is not possible to do this in runtime.
Answer: As far as I know this is not possible because of security restrictions. Your asset folder is merged with all your other files into one <code>.apk</code> package. That's your app ready for deployment.
When installing the package the user is asked if he's granting a set of privileges to the app such as accessing private data (text message, contacts) as well as technical stuff like writing on the external storage (SD card).
At this moment you can't modify your asset folder any more because it became a part of the app and application's code and resources may not be change after installation.
See also Android's page about security and permissions.
PS: I'm quite new to Android and I just explain it the way I understood it. In case I'm just talking bullshit feel free to edit me :)


How do I create a Class using the Singleton Design Pattern in Ruby?

Question: The singleton pattern is a design pattern that is used to restrict instantiation of a class to one object instance. Although I know how to code the singleton pattern in C++ and Java, I was wondering if anyone know how to implement it in Ruby?
Comment: This question received a close vote as "too broad," but it's not: it has an obvious and succinct answer in Ruby.
Answer: Actually, the above answer was not completely correct.
require 'singleton'

class Example
  include Singleton
end

You also need to include the require 'singleton' statement.
Answer: Use the singleton module:
class Clazz
  include Singleton
end

See http://www.ruby-doc.org/stdlib/libdoc/singleton/rdoc/index.html for more info.
Answer: You could use modules to the same effect I believe, although its not "the singleton pattern" you can have global state that way (which is what a singleton is ! Naughty global state !).


7 laws of Noach - Tinnok Shenishbah

Question: I know in Judaism, we have a concept of "Tinok Shenishba" - does this not apply to a gentile? How will a ben noach at the end of time be punished for not keeping the 7 mitzvah bnei Noach if they are simply not aware of it?
Comment: Related: "[Will A Non Jew who did not keep the Noachide Laws be Held Accountable](https://judaism.stackexchange.com/q/20528/1368)"?
Comment: @DannySchoemann I don't think so: (a) The question here is more about whether the term _Tinoq she-Nishbah_ applies to Noachides (with the subject of the other question being a ramification), and (b) neither the question there, nor the existing answers, presently  address the idea of a Noachide _Tinoq she-Nishbah_.
Answer: According to Rambam (Melachim 10):

"A gentile who inadvertently violates one of his commandments is exempt from all punishment with the exception of a person who kills inadvertently. ...
  When does the above apply? When he inadvertently violates a command without sinful intention; for example, a person who engages in relations with his colleague's wife under the impression that she is his own wife or unmarried.
  If, however, one knew that she was his colleague's wife, but did not know that she was forbidden to him or it occurred to him that this act was permitted or one killed without knowing that it is forbidden to kill, he is considered close to having sinned intentionally and is executed. This is not considered as an inadvertent violation. For he should have learned the obligations incumbent upon him and did not."

7 laws of Noach - Tinnok Shenishbah


How can one find out how many days per year a city x experiences a temperature of less than y degrees at time z of the day?

Question: I'm trying to estimate which clothes I should bring when traveling to some city in the US. Is there any online resource that indicates how many days per year a city x experiences a temperature of less than y degrees at time z of the day? (where x, y and z are specified by the user) E.g. how many days per year Seattle experiences a temperature of fewer than 10° C at 8 p.m.
Comment: The weather Underground has this sort of information, but not arranged quite as you ask, [see here for example](https://www.wunderground.com/history/daily/us/wa/seatac/KSEA/date/2019-9-1).
Comment: Completely pointless question (as always it seems) because statistics simply won't help you, especially these days. Look up the weather forecast and dress appropriately.
Comment: @chx Completely pointless comment (as always it seems) because weather forecast is only up to 10 days.
Comment: https://weather.com/weather/monthly/l/Vancouver+British+Columbia+Canada?canonicalCityId=3c9f9c7dd098e7719388ee7fc44e3d1de1aeee14a428910d45efe3bd73a31c0d
Comment: @chx forecast past 14 days, the link you gave only contains statistics. But you said "statistics simply won't help you", so what's your point?
Answer: WeatherSpark solves your problem ("do I need a warm jacket?") perfectly. Go to their page for Seattle, then click on September and you get this wonderful chart:

As you can see, if you travel to Seattle on Sep 1st, night time temperatures get down to 14 degrees. If you want to dive deeper and ask about 8pm specifically, the next chart can do that as well:

This tells you that temps stay above 18 degrees until roughly September 22nd and you should expect cooler weather after that. Not "exact temperatures" but this is as good as it gets, short of downloading public weather datasets.
If you do wish to download and parse data on your own, you can use the Mesowest service for US measurements. After making a free account, you will be able to download data for 1 year/month at a time. In 2020, the lowest temperature at 8PM in September was 56F/13C according to that dataset. If you want to get data for more years, you'll have to write a small script to download/parse multiple CSVs or make use of their public API.
Answer: Padmanabha Chowdhury pointed me to:

All the climate data of US are available on the National Climatic Data Center, under the National Oceanic and Atmospheric Administration (NOAA). You can get county, city or state based rainfall, wind etc. data of both recent and historical times.
Data link: https://www.ncdc.noaa.gov/cdo-web/search

E.g. to answer the question how many days per year Seattle experiences a temperature of fewer than 10° C at 8 p.m., using the freely available NOAA data:

Data file (bug: all hours are given, not just 20:00):

Notes:

I've added col E to get celsius, formula: =ROUND(CONVERT(D2,"F","C"), 1).
FYI: Meaning of columns from NOAA documentation  (mirror)

To only keep 20:00: open in Notepad++, replace regexp (?!^.*T20.*$)^.+\r?\n with empty string (if one wants a different time, change T20 with e.g. T05 for 5 AM):

Plotting temperature at 20:00 in Celsius vs. day:

Converting day# to readable days: https://www.calendar-365.com/day-numbers/2021.html
The temperature change over days is very smooth because the given temperatures are average. From the NOAA documentation  (mirror)

This is the aggregation of the value for a particular date and time, plus and minus 7 days, over each of 30 years.

and https://www.ncdc.noaa.gov/cdo-web/datasets#NORMAL_HLY:

Hourly climate normals are computed for the 30 year period from 1981 to 2010 for U.S. stations (usually airports). Values include temperature, dew point temperature, sea level pressure, wind direction and speed, and other climate probabilities and statistics.

(which explains why earlier we could only select 2010 as the year when selecting which data to download)
Data check: JonathanReez♦ wrote:

In 2020, the lowest temperature at 8PM in September was 56F/13C according to that dataset.

Same in NOAA data.
Same plot for midnight:


Why are two database tables (node and node_field_data) used for node data?

Question: I would like to understand the database architecture of Drupal 8. I noticed that Drupal 8 has two separate tables (node and node_field_data) which include almost the same columns. Can anyone give some clarification on this?
Answer: To add additional information to @jaypan's answer following are my observations
node_field_data contains 6 fields
<code>nid     int(10) unsigned
vid     int(10) unsigned
type    varchar(32) The ID of the target entity.
status  tinyint(4)
title   varchar(255)
uid     int(10) unsigned    The ID of the target entity.
revision_translation_affected   tinyint(4)NULL
</code>
the nid is primary key in this table and referred by node and other fields as target id.
The type attribute tells what kind of content it is referring to, like posts, article or custom. In case of custom, it will store the name of the content type.
Comment: For me there are more fields, and the primary key contains node nid + langcode.


Where are some good places to publish free flash fiction?

Question: This question has been asked about paying markets, but does anyone know good places for putting up flash fiction just to build readership?
Answer: Create a web site and publish them there.
Create a Facebook page and post them there.
Publish them in collections in ebook form. And in paperback, if you want to.
You don't need all that many to make a publishable collection. I've published standalone short stories as short as 3000 words. That makes for a pretty darned thin paperback, but I do sell a few copies.
I haven't tried Wattpad myself, but a few writer friends of mine (whose stories sell way better than mine) swear by that for building readership.
Comment: Good suggestions. The problem with a website (which I have) is that it's hard to get people to just find it out of the blue.

Wattpad I just don't understand. It's so... stark. And I feel like it's full of teenagers. (Not that there's anything wrong with teenagers...)
Comment: True. You will have to market your work, just as if you had published it in some other way. The challenge is discoverability. Kristine Kathryn Rusch has a whole series of blog posts about that. http://kriswrites.com/business-rusch-publishing-articles/discoverability-series/
Answer: Books of flash fiction usually list the places where the included pieces have been previously published. So you can safely assume that those journals accept flash. Send your stuff to those.
Might be a good idea to visit their websites to double-check.


STM32 F4 GPIO clock rate

Question: I am looking at the STM32 F4 series Discovery board. I have the eval board on my desk currently. I want to use this system to send data from USB to a 3 byte parallel data bus using an external clock source. I am using the STM32407 chip. I need to input data from a PC through the USB bus. My wish list is for the chip to handle a 2 MHz external clock rate and load the 3-byte GPIOs every clock cycle.
 That would be 2MHz x 24bits = 48 Mbits/s or 6 MBytes/s if my math is correct. The output from the STM32 GPIO would need to be smooth as the USB would be in packets.
Is the 2 MHz possible? Can I go faster?
Thank you very much.
Comment: What speed does the USB on the SoC support? Assuming you need to buffer the data, is there enough RAM, and a DMA facility to keep the USB fed?
Comment: It has the on-the-go OTG-USB slave/master port. It says USB full speed. The STM32F407 chip has 192 KBytes of ram. I know very little about the direct memory access of this chip. I bought the eval kit to learn about this chip and it looks promising and fun. I am a complete novice about this chip. I would expect one would set the ram buffer size of the USB system and it would flag the PC when data is needed. All this to be done in the background. Code should then increment a position counter and move the next three bytes to the GPIO ports on a pin change.
Answer: 6 MBytes/s through USB full-speed 12Mbit USB is impossible. So no 2MHz outside clock is not possible through that interface.
A more feasible target through that interface might be about 0.5MB/s over USB. Loading a 3-byte GPIO, would be about 0.5/3, or 167kHz.
The STM32F4 Discovery board (part number STM32F4DISCOVERY) does not have the USB high-speed, 480Mbit, interface implemented, so you'll need to build that (I vaguely remember something about a daughterboard with some more peripheral interfaces, might I might be wrong).
You'll need to check out the library code to drive that peripheral. It runs at 168MHz, which is 28 cycles/byte. ARM load and store instructions are 2 cycles, so 28 cycles isn't many instructions. Worse, GPIO ports are only 16 bits wide, so it's going to be a couple of writes to set up the 24 bits. Depending on the 24-bit bus, it might need a handshake too. Each of those writes is 2 cycles. IIRC DMA runs at about 1/4 CPU frequency (I'd need to dig hard to find that).
It only has 192kB of RAM, so say 180kB for buffers. That is only 3% of your data rate, i.e. 33milliseconds, which isn't very 'luxurious'.
So I guess it might be feasible, but it is likely to be a hard piece of code to write and polish.
I'd have to do some tests to get a better sense for what is reasonable.
I might try something like a BeagleBone Black, i.e. about 4-5x more CPU. It has two RISC CPU's on SoC too, which could offload the low-level I/O, and lots of I/O pins. It might even have 32bit wide ports (maybe someone else can comment).
PS:
I wrote and polished code to toggle one pin on STM32F103, which ran at a CPU clock of 72MHz. IIRC it got 12MHz doing no processing at all. So 2MHz, with two I/O port writes, with USB processing, but just over 2x faster clock (which will suffer program memory wait states), seems impossible.
Comment: I like the BeagleBone Black. It is a lot faster. However, it does a lot. It is like my back hoe. It does a lot of things but does not do one thing very well at least when I am using it.
Comment: @Doug - I think the BeagleBone gives you a few things, but mainly the two 200MHz RISC cores, lots of RAM, and High-speed USB.

STM32 F4 GPIO clock rate


Start tor and polipo when I launch my container

Question: I wrote my first Dockerfile in order to test Docker with tor and polipo.
My Dockerfile looks like:
# Pull base image.
FROM ubuntu:latest

# Upgrade system
RUN apt-get update && apt-get dist-upgrade -y --no-install-recommends && apt-get autoremove -y && apt-get clean

# Install TOR
RUN apt-get install -y --no-install-recommends tor tor-geoipdb torsocks && apt-get autoremove -y && apt-get clean

# INSTALL POLIPO
RUN apt-get update && apt-get install -y polipo

# Default ORPort
EXPOSE 9001

# Default DirPort
EXPOSE 9030

# Default SOCKS5 proxy port
EXPOSE 9050

# Default ControlPort
EXPOSE 9051
# Default polipo Port
EXPOSE 8123

RUN echo 'socksParentProxy = "localhost:9050"'  >> /etc/polipo/config
RUN echo 'socksProxyType = socks5'  >> /etc/polipo/config
RUN echo 'diskCacheRoot = ""' >> /etc/polipo/config

RUN echo 'ORPort 9001' >> /etc/tor/torrc
RUN echo 'ExitPolicy reject *:*' >> /etc/tor/torrc

RUN mkdir scrapy
ADD scrapyTor scrapy

ADD startpolipotor.sh .
RUN chmod 775 ./startpolipotor.sh

my startpolipotor.sh contains 3 lines:
#!/bin/bash
/etc/init.d/tor start &
/etct/init.d/polipo start &

But when I launch this command:
docker run -i -t id_image /bin/bash

And once inside in the container when I launch ps, I see nothing.
How I can resolve this?
Comment: your Dockerfile should either have `CMD somecommand` or `ENTRYPOINT somecommand` as last command , or your `docker run` command should launch Tor/Polipo, and after `docker exec` you should do `ps -e`, not `ps` which will only show your process.
Answer: Your Dockerfile should have a command defined like:
CMD ./startpolipotor.sh

Then you do not need to provide /bin/bash as a run command. Only the following should be enough:
docker run -i -t id_image

By the way: your script file creates two processes running in background. That will not work!
Docker containers need to have always a process in foreground. In your case the container would stop immediately after executing your start script. And while stopping the SIGTERM will not properly be sent to those background processes so they will simply get killed and may leave some corrupt data.
You should think about using supervisord instead when you need to have multiple processes in your container started.


Send SMS to Email address using Android without Internet

Question: I would like to know whether its possible to send an SMS text message to an email address in Android. Moreover, I need to send it without using Internet. I have heard of SMS to Email gateways but then how can one use it
Answer: It is possible to send emails to SMS inboxes. But you can't send a SMS to an email inbox given you do not have an internet connection. You must already know that emails require internet connectivity. As you asked, SMS gateways can be used to send and receive SMSes provided you are subscribed to a SMS line via a Direct-to-mobile or a Direct-to SMS gateway. Simply put, you cannot use this functionality with your normal SIM card, if you are willing to do it in an offline method. Read more about SMS Gateways in Wikipedia.
On a side note, if you can go online (say mobile data), you can do this by way of a MMS. All you have to do is to send the MMS to the desired email address. Some of the gateway addresses for email to SMS are listed below.

Alltel: email@example.com
AT&T: email@example.com
T-Mobile: email@example.com
Virgin Mobile: firstname.lastname@example.com
Sprint: email@example.com
Verizon: firstname.lastname@example.com
Nextel: firstname.lastname@example.com
US Cellular: firstname.lastname@example.com

Keep in mind that most of the networks tend to block and/or alter their gateways once the traffic is considerably high, as this method is widely used by spammers.
Comment: thanks for the quick reply..so in short i can't send an sms message to an email address (without internet)...but I can send an email to SMS using email to SMS gateways...do u know gateway addresses for indian mobile carriers like Airtel etc that provide such service?
Comment: There is a complete list in [Wikipedia](http://en.wikipedia.org/wiki/List_of_SMS_gateways). Remember not all the gateways work as carriers block these for regular users.
Comment: Hi...can I do something like this..i have a phone without internet connection..using this phone I send a SMS msg to another phone..and this another phone is connected to some desktop or server that has internet...so this 2nd phone will send the email..that will involve setting up of server etc..but then can you tell me if this is possible?
Comment: @Parth_90 Yes, as long as the second phone can use MMS and programmed to forward the messages to an email address.
Answer: Yes you can send SMS to email without internet. You just type in the email address where the phone number would go in the SMS address field.
This has been possible for years, I did it in 2000 with a Nokia candy bar phone on a 2g network.
To go the other way, sending email to SMS, does require internet, and knowing the gateway address/carrier.