text:
Q: Segundo, minutos entre el guardado y la hora actual Hola un cordial saludos,
tengo un inconveniente al momento de consultar quiero tener lo que es el intervalo desde que se realizo el guardo en la base de datos hasta el momento que refresca la pagina.

Tengo una tabla que me guarda el registro de la fecha y hora.
Quiero algo asi

Hasta el momento tengo de codigo:
SELECT * FROM `records` ORDER BY `records`.`modificado` DESC

Que me arroja lo que son los ultimos registros.

Gracias de antemano.

A: He realizado un pequeño test para lo que necesitas.
No tomes en cuenta la creación de la tabla y la inserción.
Lo que hice fue insertar datos de tiempo en una tabla. Después de eso aplicar la siguiente lógica para tener un tiempo de diferencia entre el valor en el que se guardo y el valor de la fecha actual. Entonces obtienes el valor de tiempo que ha pasado desde que se guardo el registro.

*

*Con TIMESTAMPDIFF obtienes la diferencia entre las fechas que deseas, en este caso la fecha del registro y la fecha actual del sistema.

*Con SEC_TO_TIME obtienes esa información en segundos, prácticamente como un cronometro en formato (hora:min:seg). Ejemplo (00:02:04)

///Creación de tabla
create table dates(
    id int auto_increment,
    datetimeInit datetime,
    primary key(id)
);

///Inserción de datos
insert into test.dates values(1, NOW());
insert into test.dates values(2, NOW());

///Sacar diferencia de tiempos
SELECT datetimeInit, now() as horaActual,
SEC_TO_TIME(TIMESTAMPDIFF(SECOND, datetimeInit, now())) as secondsDiff
FROM dates;

Estos son los resultados obtenidos con la query:

Ya solo tendrías que adaptar las sentencias SEC_TO_TIME(TIMESTAMPDIFF(SECOND, datetimeInit, now())) a tu problema.
Espero esto te sea de mucha ayuda.


text:
Q: AWS CloudFormation "Update Stack" and "Create Change Set" are disabled The stack creation failed with ROLLBACK_COMPLETE, yet any option to change the stack or the provided parameters is greyed out.
I know I can delete the stack and start again, but I don't understand conditions behind "Update Stack" and "Create Change Set" being disabled.
Thank you.

A: If stack creation has failed then the stack doesn't exist, so you can't update it. DELETE STACK on a stack that has failed to be created only removes the reference to it which is used to hold the error status - that's the only thing you can do with it.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Is NoSQL ideal to store stats? I'm not terribly familiar with NoSQL systems, but I remember reading a while back that they are ideal to handle statistical data.
Since I'm about to start writing code that will record data like "how many users were registered on each day", I was thinking I could use this as an opportunity to learn more about NoSQL if it fits the bill.
If NoSQL is indeed ideal for this, could you provide me with some information as to why? And which specific systems are best suited for this particular need?
So, after the first answer, maybe it's helpful to clarify a bit more.
I currently have a PostgreSQL database from which I'll get the data. It will be very simple, and no calculations needed. For example, I'll just get a resultset with the amount of users registered each day for the past month (so it'll basically just be a set of value pairs for the date/users) and save that in another table/database.
Thanks!

A: It kind of depends on what sorts of analysis you are going to be doing on these stats. If you are going to be doing a lot of different operations (averaging, summing, joining...) you may find NoSQL solutions to be more of a pain then they are worth.
However, if you are storing stats mostly for a display purpose, or for very specific analysis routines, NoSQL solutions start to shine.
If your data is small enough, stick with a SQL solution, which will give the benefit of a full query engine to work with, but if you have lots of values (one value a day is nothing, even if you were running for a million years), and are worried about storage size and performance, NoSQL options once again may be worth it.
If your data is semi-structured, take a look at CouchDB, which offers some rudimentary indexing and querying support, which could provide some basis for analysis routines. If you are storing individual values with very little structure, my best advice would be to take a look at Tokyo Cabinet and Tokyo Tyrant, which are absolutely incredible options for key-value storage.

A: NoSQL systems tend to optimize the case where data is stored frequently, but accessed infrequently.  In the case of statistics, you might gather lots of data from a (social) site frequently in small bits, which is optimized for. But retrieval and analysis might be slower...  It of course depends on which "NoSql" System you decide to use.


text:
Q: Align Icon left and right from toggle-switch checkbox I want to align my two icons left and right next to my toggle switch. But I just cant find a way to make it work.

      <input class="form-check-input bg-dark border border-secondary" type="checkbox" id="lightSwitch" />

using style="float: left;" is not fixing my issue because they are overlapping themselfes.
any help? thanks!

A: The tricks here are

*

*remove the padding:2.5em within the .form-switch (optional)

*remove the margin-left: -2.5em; within the .form-check .form-check-input (important)

*remove the float:left; within the .form-check .form-check-input (important)
There are two approach to achieve that :

*

*using d-flex on .form-switch (Approach 1)

*using float-none on .form-check-input (Approach 2)

.form-switch .form-check-input:checked {
  background-color: #000000;
  border-color: #000000;
}

.form-switch .form-check-input {
background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23adb5bd'/%3e%3c/svg%3e") !important;
}
.form-switch .form-check-input:focus {
background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23adb5bd'/%3e%3c/svg%3e") !important;
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.5.0/font/bootstrap-icons.css">

Approach 1

  <input class="form-check-input ms-0 me-3" type="checkbox" id="flexSwitchCheckDefault">

Approach 2

  <input class="form-check-input ms-0 float-none me-3" type="checkbox" id="flexSwitchCheckDefault">

A: I added bootstrap icon cdn link between head tags and some css code .Result is like below. If you want to do icons closer to the switch  you can remove float-end class

.form-switch .form-check-input:checked {
  background-color: #000000;
  border-color: #000000;
}

.form-switch .form-check-input {
background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23adb5bd'/%3e%3c/svg%3e") !important;
}
.form-switch .form-check-input:focus {
background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23adb5bd'/%3e%3c/svg%3e") !important;

}
<!DOCTYPE html>

    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.5.0/font/bootstrap-icons.css">

    <input class="form-check-input" type="checkbox" id="flexSwitchCheckDefault">


text:
Q: How can I load Geospatial RDF in Virtuoso? Sorry for noobish question. I want to know what kind of format (syntax) a geospatial RDF should have so I can load it into Virtuoso (Open Source) and do a GeoSPARQL query over it. I found a very small and simple geospatial RDF and wanted to load it into VOS, but it gave me an error as the result:

Unable to load RDF graph <something> from <geospatial data name> with Content-Type 'application/rdf+xml': 42000: RDFGE: RDF box with a geometry RDF type and a non-geometry content

Edit:
I uploaded RDF without any instances and VOS loaded it successfuly. But when I add the instance into it, the error pops. Here the whole RDF i use is:
<?xml version="1.0"?>
<rdf:RDF
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
    xmlns:owl="http://www.w3.org/2002/07/owl#"
    xmlns:sf="http://www.opengis.net/ont/sf#"
    xmlns:geo="http://www.opengis.net/ont/geosparql#"
    xmlns:my="http://example.org/ApplicationSchema#">
<rdfs:Class rdf:about="http://example.org/ApplicationSchema#PlaceOfInterest">
    <rdfs:subClassOf rdf:resource= "http://www.opengis.net/ont/geosparql#Feature"/>
</rdfs:Class>
<rdf:Property rdf:about="http://example.org/ApplicationSchema#hasExactGeometry">
    <rdfs:subPropertyOf rdf:resource="http://www.opengis.net/ont/geosparql#hasGeometry"/>
    <rdfs:subPropertyOf rdf:resource="http://www.opengis.net/ont/geosparql#hasDefaultGeometry"/>
</rdf:Property>
<rdf:Property rdf:about="http://example.org/ApplicationSchema#hasPointGeometry">
    <rdfs:subPropertyOf rdf:resource="http://www.opengis.net/ont/geosparql#hasGeometry"/>
</rdf:Property>
<!-- Instance -->
<my:PlaceOfInterest rdf:about="http://example.org/ApplicationSchema#F">
    <my:hasExactGeometry rdf:resource="http://example.org/ApplicationSchema#FExactGeom"/>
</my:PlaceOfInterest>
<sf:Point rdf:about="http://example.org/ApplicationSchema#FExactGeom">
    <geo:asWKT rdf:datatype= "http://www.opengis.net/ont/geosparql#wktLiteral">
        <![CDATA[ <http://www.opengis.net/def/crs/OGC/1.3/CRS84> Point(-83.4 34.4) ]]>
    </geo:asWKT>
</sf:Point>

</rdf:RDF>

VOS Version is 07.20.3217. What's wrong?


text:
Q: Copy formula vertical in Excel every third row (skip 2 rows and then take the next one) I need to copy a formula in excel but only every 3rd row.
Please see the image as reference:

And I need this for about 5000 cells so I ideally would be to drag it down but when I do that excel just references the same row instead the next one from Column A
There is an example on how to do this and skip one cell, but in my case I want to skip 2 cells.
The example is:
=IF(C1="",INDEX($A$2:$A$20,COUNTBLANK($C$1:C1)),"")

and is posted HERE

A: From cell C1 and drag down:
=IF(INT((ROW()+2)/3)=(ROW()+2)/3,INDIRECT("A"&((ROW()+2)/3)),"")

Or:
=IFERROR(INDIRECT("A"&(ROW()+2)/3),"")

Or non-volatile:
=IF(INT((ROW()+2)/3)=(ROW()+2)/3,INDEX($A$1:$A$10,(ROW()+2)/3),"")

Or another non-volatile:
=IF(MOD((ROW()+2)/3,1)=0,INDEX($A$1:$A$10,(ROW()+2)/3),"")

From cell C2 and drag down:
=IF(INT((ROW()+1)/3)=(ROW()+1)/3,INDIRECT("A"&((ROW()+1)/3)+1),"")

Or:
=IFERROR(INDIRECT("A"&((ROW()+1)/3)+1),"")

Or non-volatile:
=IF(INT((ROW()+1)/3)=(ROW()+1)/3,INDEX($A$1:$A$10,(ROW()+1)/3),"")

Or another non-volatile:
=IF(MOD((ROW()+1)/3,1)=0,INDEX($A$1:$A$10,(ROW()+1)/3),"")

A: If you statically input the value inside C1 as =A1
And then procceed from C4 with following formula:
=IF(MOD(COUNTBLANK($B$1:$B6),3)=0, INDEX($A$1:$A$18,MATCH(OFFSET(C4, -3, 0), $A$1:$A$18) + 1), "")

Then it will work:


text:
Q: ¿Como añado al .gitignore un archivo sin extension? Tengo en un directorio un archivo de texto llamado serie, sin extensión. ¿Cómo puedo agregarlo al .gitignore?
He probado a añadir *. en una linea pero no funciona. Cuando hago push en mi repo me lo sigue añadiendo
Se me ha ocurrido que lo podría modificar y guardarlo como un .txt pero no se si puedo hacerlo al formar este parte de un archivo de un programa.
Gracias de antemano.

A: Listo, gracias por el enlace a la pregunta en ingles. Era añadir
*
!/**/
!*.*

Pero antes de incluir cualquier otra extension, para que no te la deje de ignorar también.
Como dicen, tambien tenia que hacer un git rm --cached serie antes de realizar el commit con los cambios en el .gitignore


text:
Q: MSXML2: How can I get value of a node? I have this node
MSXML2::IXMLDOMNodePtr node;

node->Getxml() returns  "<level3>333<level4 atribute="444"><level5>555<level6>666</level6></level5></level4></level3>"
node->Gettext(); returns "333555666"
node->GetnodeValue() throws exception if node is not an attribute.
How can I get the value 333 ???

A: You have to walk the children of the node you have in hand - you can get a list using childNodes after checking the node has children of course, then you can use Gettext() to extract the individual element texts.
It's quite painful to code to the MSXML DOM, in my experience.  Glad to see you are using the built-in smart pointers, anyway.


text:
Q: Возможно ли на чистом css реализовать меню, которыое адаптируется под разные количества пунктов? Здравствуйте, есть задача сверстать меню, которое меняет свой вид в зависимости от количества пунктов в нем: http://prntscr.com/j6v6mn
Есть ли варианты сверстать без применения js? Количество пунктов меню можно опреелить с сервера и задать определенный класс списку, если больше определенного числа пунктов меню, но это может быть не совсем практично, ведь пункты могут быть разными по размеру.
Если всетаки нету варианта без js, возможно посоветуете как?
Очень благодарен за любую помощь

A: Т.е вам нужно что бы при любом кол-ве пунктов умещалось все в 1 строку? или элементы должны прятаться или смещаться если не подходят по размеру?
То, что на скрине можно через flex сделать.
списку ul даешь display:flex; flex-direction:row; justify-content: flex-start; и должно получиться что-то похожее.


text:
Q: facebook post users wall i have a@yahoo.com account and also created facebook account
another two users have also facebook account by b@yahoo.com and c@yahoo.com per each.
b@yahoo.com and c@yahoo.com account holder pressed like button of the fan page owned by
a@yahoo.com holder.
now as a fan page [a@yahoo.com] but not as others, I like to post some
message,attachment [to the wall of
the selected users + users who liked fan page] among all of the users.
now I select only b@yahoo.com user.
the code is given below:
     I accepted manage_pages,offline_access,publish_stream permission.
$page_id = "YYYYYYYYYYYYYYYY";
$page_access_token = "";
$result = $facebook->api("/me/accounts");
foreach($result["data"] as $page) {
    if($page["id"] == $page_id) {
        $page_access_token = $page["access_token"];
        break;
    }
}
$data["access_token"] = $page_access_token;
$data["message"] = "aaaaaaaaaaaaaaaaa";
$data["name"] = "ttttttttttttt";
$data["caption"] = "cccccccccccccc";
$data["link"] = "http://www.facebook.com/pages/CCCCC/OOOOOsk=app_UUUUUUUUUUU";
$data["description"] = "aaaaaaaasdfsfsdf";
$data["picture"] = "http://cdn1.kingdomsofcamelot.com/fb/e2/src/img/fte/army_troop.png";

$post_id = $facebook->api("/$page_id/feed", "post", $data);

but the above code post the message,attachment to the wall of all users who liked
   the fan page,but I only write post to the specific users.
how can I achieve? or is there any possiblity to pass the target users id only?

A: I'm not entirely sure i understood your problem.
Your code posts a post to the fan-page wall - not to the "wall of all users who liked the fan page".
As a fan page, you can not write to a user's wall, even if he is a fan of your fan-page.


text:
Q: php format field datetime-local in to php i have this input which i take like this
<input type="datetime-local">

which i am inserting in the db successfully. In the database it stores as such in my table
2021-05-17 23:00:00

but then i am trying to display it in my page like so
<input type="datetime-local" value="<?php echo $date_time; ?>" >

but it gives me a blank field
but when i inspect it shows my the correct value in the value field

A: get datetime from database using DATE_FORMAT()
SELECT *, DATE_FORMAT(datetime, '%Y-%m-%dT%H:%i') AS custom_date

and after fetching data in which variable your data exist use that in your input value
<input type='datetime-local' name='datetime' value='<?php echo $row['custom_date'] ?>' >


text:
Q: Center images within each column in a grid I am using Isotope to create a filterable gallery on Squarespace.  I have everything working perfectly, but I cannot seem to center the individual images within their columns. Any help would be great!
Each image is sourced like the below and the styling is listed after:

ul {
margin-bottom: 1em;
margin: auto;
list-style: none;
display: flex;
display: -webkit-box;
display: -ms-flexbox;
display: -webkit-flex;
justify-content: space-between;
}
ul li {
flex: 0 0 auto;
text-align: center;
}

.list {
margin: 0;
padding: 0;
list-style: none;
}

.list__item {
display: inline-block;
width: 100%;
height: 12em;
overflow: hidden;
margin-bottom: 1em;
margin: auto;
text-align: center;
font-size: 1em;
text-transform: uppercase;
color: white;
}

@media screen and (min-width: 600px) {
.list {
    display: flex;
    flex-wrap: wrap;
  margin: auto;
}
.list__item {
    width: calc(33% - 1em);
}
@media screen and (min-width: 768px) {

button {
    margin: 0.5em;
    padding: 0.5em;
}

.list__item {
    width: calc(33% - 1em);
}

}

A:

.list__item {
width: 100%;
height: 12em;
overflow: hidden;
margin-bottom: 1em;
margin: auto;
text-align: center;
font-size: 1em;
text-transform: uppercase;
color: white;

display: flex;
justify-content: center;
align-items: center;
}

.cont {
  height: 50%;
  width: 50%;
  margin: 5px;
  border: 1px solid yellow;
}


text:
Q: Convert multi-page PDF to single PNG I have a multi-page PDF.
I want to make a PNG which is just all of these pages appended. I.e., the bottom of page 1 is attached to the top of page 2, etc.
Preview.app's Export... > PNG option saves it as a ... multi-page PNG? I didn't know those were possible, but Preview opens up this PNG like it has many pages and Safari doesn't seem to be able to display both these "pages" properly.
I just want to convert a PDF into a very tall PNG, which is all of the pages on top of each other.

A: There is an app PDFElement6, a free trial version is available that will do what you want. The trail version is limited to only a five page PDF.


text:
Q: On my tumblr blog, how do I get the background to be one giant image? This is my tumblr blog:
thestorywithnoending.tumblr.com
the code for the blog is a theme I got here:
http://themes.pouretrebelle.com/lycoris/?download
(just scroll down a bit, the whole code is there)
I want the background image to just be ONE image...
I know I'm not being descriptive enough, so to fruther explain: I want it to be like this:
http://chloescheffe.com/
you see how on that website the background image is.... everything basically. And when you change the size of the webpage, the background image changes accordingly?
how can I do that on my tumblr blog?
THANKS :)

A: with css. set the height and width of your bg image to 100%. sorry, i'd give you the code but this keyboard doesn't have all the characters of a larger one.
use the background-size css property w3schools.com/cssref/css3_pr_background-size.asp

A: You can do this two ways using background-size. One will stretch the image and one will fill the width properly, but cut off the bottom.
For stretch, add this to your body CSS:
body {
    background-repeat: no-repeat;
    background-size: 100% 100%;
}

For width-fill (this looks better with your current blog), add this to your body CSS:
body {
    background-repeat: no-repeat;
    background-size: cover;
}


text:
Q: What is induction, really? I am usually confused about what is induction and what proof means in this context. As an example, take the proof of the sum of the first $n$-integers. First, we take the assertion $A_{n}$:
$$1+2+3+\dots + n\stackrel{?}{=}\frac{n(n+1)}{2}$$
Then, if $r$ is an integer and if the previous statement is true, that is:
$$1+2+3+\dots + r=\frac{r(r+1)}{2}$$
Then by adding $(r+1)$ to both sides, gives me:
$$1+2+3+\dots + r+(r+1)=\frac{r(r+1)}{2}+(r+1)=\frac{r(r+1)+2(r+1)}{2}=\frac{(r+1)(r+2)}{2}$$
Which is precisely the statement $A_{r+1}$. If we test for the statement $A_1$, it is true. Then it is true for each natural number. For this, we had the requirements:

*

*$P(k)$ is true;

*$P(n)\implies P(n+1)$ for $n\geq k$.

Side question In this example, it is not clear why $P(n)\implies P(n+1)$, that is: Why taking $\cfrac{n(n+1)}{2}$ and $\cfrac{r(r+1)}{2}$, making the substitutions $r:=r+1$, $n:=n+1$ and comparing the formulas show the truth of $A_n$? Why couldn't we use the same trick with any other formula not equivalent to $A_n$ and a similar result, that is: Have the proof I gave earlier as true and a proof that $1+2+3+\dots +n=F_n$ but $F_n\neq \cfrac{n(n+1)}{2}$?

Now, there is another proof for the same fact, take the following figure:
\begin{matrix}
 \circ & \circ   & \circ  \\
 \circ & \circ   & \\
 \circ &  &
\end{matrix}
Now make a rotated copy of this figure:
\begin{matrix}
 &  &\bullet    \\
 & \bullet &\bullet  \\
 \bullet &\bullet   & \bullet
\end{matrix}
And glue them together:
\begin{matrix}
 \circ & \circ   & \circ  \\
 \circ & \circ   & \bullet \\
 \circ & \bullet   & \bullet \\
 \bullet &\bullet   & \bullet
\end{matrix}
In any way you glue them, the side of one rectangle will be $n+1$, the other will be $n$. Now we can see that for any $n$, we must have a square of area $n(n+1)$ and we want the area of the triangle. We can just do it as $\cfrac{n(n+1)}{2}$.

Now here comes my problem: I don't actually feel that the first way proves this, but I feel that the second way does it. Also, with the first way, the formula appeared magically, we obtained it somewhere and are just proving it. But what is the actual meaning of proving here? Several months ago, I read a bit of Wittgenstein's Tractatus Logico-Philosophicus. There is an interesting item at it:
$$\text{7. Whereof one cannot speak, thereof one must remain silent.}$$
I guess that this hinted me for the first time what is the broader meaning of proving: I interpreted being able to speak as being able to say something in a given language. So in this case, it seems we are being able to speak in logic and induction is the ability to express a mathematical idea in the language of logic.  So, in the first case, we are speaking something and showing that the conclusion can be built coherently in logic. In the second case, we are not actually speaking, there is no well-defined language in which we are encoding the given propositions. With this, I've been able to discern that there are two different activities:

*

*Being able to see something clearly. (Second proof)

*Being able to speak something in a language, and if we can speak it, then we assume it is true. (First proof)

  Is this what induction is about?

A: For your "side question": You're missing something absolutely essential about induction - the base case. In a proof by induction, one must show not only that $P(n) \Rightarrow P(n+1)$, but also that $P(1)$ holds (or $P(0)$, or $P(2)$, or wherever you want $P$ to start being true). The standard analogy is of a sequence of dominoes; by showing $P(n) \Rightarrow P(n + 1)$, we've shown that each domino is heavy enough to knock the next one down, but we don't know that any of them fall at all until we've shown that the first one does. We could use some random other formula in the induction step, sure - for example, we could do the following attempted induction:
Suppose that $1 + 2 + 3 + \cdots + n = 1 + \frac{n(n+1)}{2}$. Adding $n + 1$ to both sides and simplifying, we obtain $1 + 2 + 3 + \cdots + n + (n + 1) = 1 + \frac{(n+1)(n+2)}{2}$, which seems to complete the induction. The problem is that the missing step doesn't work - $A_1$, which in this case is the statement $1 = 1 + \frac{1(1+1)}{2}$, is false. Analogously, the first domino does not fall.
To respond to your main question: The second proof is not really a proof. You've successfully demonstrated that the claim is true when $n = 3$, and you've given a good reason to believe that it will be true for other values of $n$; but that's not "proof". How do we know that there's not some very large $n$ with just the right properties so that the "teeth" of your triangles don't quite line up right? The proof by induction, however, is a proof, because all that's required in order to be sure that no $n$ escapes it is the axiom "all natural numbers are reachable by induction".
The key difference is that the second "proof" hinges heavily on intuition; that's why it "feels" more natural to you, but that's also why it isn't proof - intuitions can be wrong, sometimes very badly wrong. The first proof uses only logic, which is as unarguable as we can reasonably expect to achieve.
As for the speak/see distinction, I sort of see (forgive the pun) what you're getting at, but it's not quite right. Just because we can "say" something clearly doesn't mean we assume it's true - there are plenty of obviously false things we can say clearly, like "$1+1=3$". But it is the case that we (or rather, mathematicians in general) do not consider something proven unless we can "speak" the proof clearly and correctly.


text:
Q: add subfolder to ignored lists while the parent folder specified as not ignored I have the following in my .gitignore file:
www/bower_components/*
!www/bower_components/bootstrap

Which is - ignore everything inside www/bower_components except for bootstrap folder.
Now I want the dist folder inside bootstrap to be ignored. How do I do that? I tried this but it didn't work:
www/bower_components/*
!www/bower_components/bootstrap
www/bower_components/bootstrap/dist

A: Just put a .gitignore file in the bootstrap directory ignoring dist.

Patterns read from a .gitignore file in the same directory as the
  path, or in any parent directory, with patterns in the higher level
  files (up to the toplevel of the work tree) being overridden by those
  in lower level files down to the directory containing the file.


text:
Q: Image of complex circle under polynomial The question is, how many times does $f(C_r)$ go around $0$ for $C_r = \{x \in \mathbb{C}: |x|=r\}$ and a polynomial with complex coefficients $f$.
The answer is clear to me when $f(x) = ax^n + b$ but I don't see how exactly middle terms affect the result. How to see this without a graph? Can this be found for any $r$?
Many thanks

A: Look at the Argument Principle (eg, Conway's, "Functions of one complex variable", V.3.4).
You wish to compute $n(f \circ \gamma, 0)$, where $\gamma(t) = r e^{i t}$, and $n$ is the winding number. The Argument Principle gives:
$$n(f \circ \gamma, 0) = \sum n(\gamma, z_i) - \sum n(\gamma, p_j),$$
where $z_i$ are the zeros of $f$ and $p_j$ are the poles. Since $f$ is a polynomial, there are no poles, so you have $n(f \circ \gamma, 0) = \sum n(\gamma, z_i)$, ie, the number of zeros of $f$ inside $C_r$, counted according to multiplicity.
(The above assumes that $f$ has no zeros on the circle $C_r$.)


text:
Q: How To Set NULL is 0 in SQL Dynamic Pivot Query I developed one dynamic pivot table, and I set  ISNULL = 0.00.
The query is given below
SELECT DISTINCT hdr.EmpNo,hdr.FirstName AS Name,
                ISNULL(TBL.shortname,'')AS shortname,
                ISNULL(TBL.Amount,0.00) AS Amount,
                TBL.Adtype INTO #Temp FROM  tbl1 AS hdr
LEFT JOIN tbl2 TBL  ON TBL.EmpNo = hdr.EmpNo
DECLARE @Ded AS NVARCHAR(MAX)
SET @Ded = STUFF((SELECT ', ISNULL( ' + QUOTENAME(c.shortname) + ', 0.00 )AS ' +
            QUOTENAME(c.shortname)  FROM (SELECT DISTINCT shortname FROM #Temp
            WHERE ISNULL(shortname,'') <> '' AND Adtype = 2) AS c ORDER BY
            shortname  FOR XML PATH(''), TYPE ).value('.', 'NVARCHAR(MAX)')
            ,1,1,'')
SET @Query = 'SELECT CAST(ROW_NUMBER() OVER(ORDER BY EmpNo ASC) AS
              VARCHAR(100)) AS [S.No],EmpNo,Name,' + @Ded +' FROM  #Temp
              PIVOT(SUM(Amount)  FOR shortname IN (' + @Ded + ')) AS PVTTable'
EXEC sp_executesql @Query

But it displays the following error, and line 3 doesn't not have a "(".

Msg 102, Level 15, State 1, Line 3
                     Incorrect syntax near '('.

Any help to solve this problem would be appreciated.

A: Problem is with @der variable use in in clause.
you are setting column name with isnull and in in clause, it is not supported.
Please try below query.
;with tbl1 as
(
select 1 EmpNo,'Emp1' FirstName
union all
select 2 EmpNo,'Emp2' FirstName
),
tbl2 as
(
select 'EMP1' shortname,100 Amount, 2 Adtype,1 EmpNo
union all
select 'EMP2' shortname,100 Amount, 2 Adtype,2 EmpNo
)

SELECT DISTINCT hdr.EmpNo,hdr.FirstName AS Name,
                ISNULL(TBL.shortname,'')AS shortname,
                ISNULL(TBL.Amount,0.00) AS Amount,
                TBL.Adtype INTO #Temp FROM  tbl1 AS hdr
LEFT JOIN tbl2 TBL  ON TBL.EmpNo = hdr.EmpNo

DECLARE @Ded AS NVARCHAR(MAX)='' ,@Query AS NVARCHAR(MAX)=''
DECLARE @Wer AS NVARCHAR(MAX)=''
SET @Ded = STUFF((SELECT ', ISNULL( ' +  QUOTENAME(c.shortname) + ', 0.00 )AS ' +
            QUOTENAME(c.shortname)  FROM (SELECT DISTINCT shortname FROM #Temp
            WHERE ISNULL(shortname,'') <> '' AND Adtype = 2) AS c ORDER BY
            shortname  FOR XML PATH(''), TYPE ).value('.', 'NVARCHAR(MAX)')
            ,1,1,'')

SET @Wer = STUFF((SELECT ',  ' +  QUOTENAME(c.shortname)  FROM (SELECT DISTINCT shortname FROM #Temp
            WHERE ISNULL(shortname,'') <> '' AND Adtype = 2) AS c ORDER BY
            shortname  FOR XML PATH(''), TYPE ).value('.', 'NVARCHAR(MAX)')
            ,1,1,'')

SET @Query = 'SELECT CAST(ROW_NUMBER() OVER(ORDER BY EmpNo ASC) AS
              VARCHAR(100)) AS [S.No],EmpNo,Name,' + @Ded +' FROM  #Temp
              PIVOT(SUM(Amount)  FOR shortname IN (' + @Wer + ')) AS PVTTable'
--print @Query

EXEC sp_executesql @Query


text:
Q: weight issues in scikit-learn's adaboost I'm trying to use AdaBoostClassifier with a decision tree stump as the base classifier. I noticed that the weight adjustment done by AdaBoostClassifier has been giving me errors both for SAMME.R and SAMME options.
Here's a brief overview of what I'm doing
def train_adaboost(features, labels):
    uniqLabels = np.unique(labels)
    allLearners = []
    for targetLab in uniqLabels:
        runs=[]
        for rrr in xrange(10):
            feats,labs = get_binary_sets(features, labels, targetLab)
            baseClf = DecisionTreeClassifier(max_depth=1, min_samples_leaf=1)
            baseClf.fit(feats, labs)

            ada_real = AdaBoostClassifier( base_estimator=baseClf,
                                           learning_rate=1,
                                           n_estimators=20,
                                           algorithm="SAMME")
            runs.append(ada_real.fit(feats, labs))
        allLearners.append(runs)

    return allLearners

I looked at the fit for every single decision tree classifier and they are able to predict some labels.
When I look at the AdaBoostClassifier using this base classifier, however, I get errors about the weight boosting algorithm.
def compute_confidence(allLearners, dada, labbo):
    for ii,thisLab in enumerate(allLearners):
        for jj, thisLearner in enumerate(thisLab):
            #accessing thisLearner's methods here

The methods give errors like these:
ipdb> thisLearner.predict_proba(myData)
PATHTOPACKAGE/lib/python2.7/site-packages/sklearn/ensemble/weight_boosting.py:727: RuntimeWarning: invalid value encountered in double_scalars
  proba /= self.estimator_weights_.sum()
*** ValueError: 'axis' entry is out of bounds
ipdb> thisLearner.predict(myData)
PATHTOPACKAGE/lib/python2.7/site-packages/sklearn/ensemble/weight_boosting.py:639: RuntimeWarning: invalid value encountered in double_scalars
  pred /= self.estimator_weights_.sum()
*** IndexError: 0-d arrays can only use a single () or a list of newaxes (and a single ...) as an index
I tried SAMME.R algorithm for adaboost but I can't even fit adaboost in that case because of this error
[...]
File "PATH/sklearn/ensemble/weight_boosting.py", line 388, in fit
    return super(AdaBoostClassifier, self).fit(X, y, sample_weight)
File "PATH/sklearn/ensemble/weight_boosting.py", line 124, in fit
    X_argsorted=X_argsorted)
File "PATH/sklearn/ensemble/weight_boosting.py", line 435, in _boost
    X_argsorted=X_argsorted)
File "PATH/sklearn/ensemble/weight_boosting.py", line 498, in _boost_real
    (estimator_weight < 0)))
ValueError: non-broadcastable output operand with shape (1000) doesn't match the broadcast shape (1000,1000)
the data's dimensions are actually compatible with the format that classifier is expecting, both before using adaboost and when I try to test the trained classifiers. What can these errors indicate?

A: Well that was a little counterintuitive, coming from coding in Matlab.
Apparently the labs' dimensions was the issue, which is (1000,1). It needed to be (1000,)
Adding this line solved it:
labs = labs[:,0]


text:
Q: Clearing radio buttons with knockout I need to clear (no selection) my first 2 radio buttons (CMR conv + Out of CMR) when choice is 'Disable things'.
Is it possible with knockout?
I already disable them but I also need to clear them.
jsFiddle: http://jsfiddle.net/mnucj/
CMR convention: <input type="radio" name="cmrConvention" value="true" data-bind="checkedRadioToBool: cmrConvention, disable: thirdPartyInsured() ? true : false">

Out of CMR convention: <input type="radio" name="cmrConvention" value="false" data-bind="checkedRadioToBool: cmrConvention, disable: thirdPartyInsured() ? true : false">

- - - - - -

Enable things: <input type="radio" name="thirdParty" value="false" data-bind="checkedRadioToBool: thirdPartyInsured">

Disable things: <input type="radio" name="thirdParty" value="true" data-bind="checkedRadioToBool: thirdPartyInsured">

Thanks.

A: You can use the click binding when the "disable things" checkbox is clicked, like so:
Disable things:
<input type="radio" name="thirdParty" value="true"
       data-bind="checkedRadioToBool: thirdPartyInsured,
                  click: function() { cmrConvention(null); return true; }">

See the updated fiddle.


text:
Q: Ubuntu 20.04 with xen 4.11 domU panic with pci passthrough I started to upgrade my server from Ubuntu 18.04 to 20.04. After reinstalling xen / qemu in the dom0 XEN cannot start domains after upgrading from 18.04 to 20.04 dom0 and all domU instances worked as expected.
Next I updated a domU from 18.04 to 20.04. The update went well, but the domU crashed on boot.
The configuration of the domU looks like this:
#
#  Hostname
#
name        = 'smarthome'

#
#  Kernel + memory size
#
kernel      = '/usr/lib/grub-xen/grub-x86_64-xen.bin'
root        = ''
extra       = 'iommu=soft console=hvc0 earlyprintk=xen (xen/xvdb)/boot/grub/grub.cfg'

vcpus       = '2'
cpus        = '6-11'
memory      = '4096'
localtime   = 0

#
#  Disk device(s).
#
disk        = [
                  '/dev/pulsar02-vg/Xsmarthome-disk,,xvdb',
                  '/dev/pulsar02-vg/Xsmarthome-swap,,xvda',
              ]

#
#  Networking
#
#vif         = [ 'ip=192.168.20.250 ,mac=00:16:3E:2D:F8:6B,bridge=xbrlan' ]

pci = [
        "0000:02:12.1,permissive=1"     # SRV (VF)
]

#
#  Behaviour
#
on_poweroff = 'destroy'
on_reboot   = 'restart'
on_crash    = 'destroy'

The kernel message when starting with xl create -c /etc/xen/Xsmarthome.cfg is:
(early) [    1.652005] PM: Registered nosave memory: [mem 0xfed92000-0xfedfffff]
    (early) [    1.652008] PM: Registered nosave memory: [mem 0xfee00000-0xfeefffff]
    (early) [    1.652012] PM: Registered nosave memory: [mem 0xfef00000-0xfeffffff]
    (early) [    1.652015] PM: Registered nosave memory: [mem 0xff000000-0xffffffff]
    (early) [    1.652019] [mem 0x90000000-0xdfffffff] available for PCI devices
    (early) [    1.652023] Booting paravirtualized kernel on Xen
    (early) [    1.652026] Xen version: 4.11.4-pre (preserve-AD)
    (early) [    1.652032] clocksource: refined-jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645519600211568 ns
    (early) [    1.652040] setup_percpu: NR_CPUS:8192 nr_cpumask_bits:2 nr_cpu_ids:2 nr_node_ids:1
    (early) [    1.652133] percpu: Embedded 54 pages/cpu s184320 r8192 d28672 u1048576
    (early) [    1.652174] PV qspinlock hash table entries: 256 (order: 0, 4096 bytes, linear)
    (early) [    1.652180] Built 1 zonelists, mobility grouping on.  Total pages: 1032073
    (early) [    1.652184] Policy zone: Normal
    (early) [    1.652188] Kernel command line: root=UUID=024e1144-d306-4e5f-b67e-01db80827787 ro mitigations=off iommu=soft console=hvc0 earlyprintk=xen
    (early) [    1.652374] Dentry cache hash table entries: 524288 (order: 10, 4194304 bytes, linear)
    (early) [    1.652439] Inode-cache hash table entries: 262144 (order: 9, 2097152 bytes, linear)
    (early) [    1.652660] mem auto-init: stack:off, heap alloc:on, heap free:off
    (early) [    1.698831] software IO TLB: mapped [mem 0x178200000-0x17c200000] (64MB)
    (early) [    1.706256] Memory: 3960888K/4193916K available (14339K kernel code, 2398K rwdata, 4956K rodata, 2716K init, 4988K bss, 233028K reserved, 0K cma-reserved)
    (early) [    1.706269] random: get_random_u64 called from kmem_cache_open+0x2d/0x410 with crng_init=0
    (early) [    1.706471] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
    (early) [    1.706906] ftrace: allocating 44527 entries in 174 pages
    (early) [    1.718159] rcu: Hierarchical RCU implementation.
    (early) [    1.718164] rcu:     RCU restricting CPUs from NR_CPUS=8192 to nr_cpu_ids=2.
    (early) [    1.718168]  Tasks RCU enabled.
    (early) [    1.718171] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
    (early) [    1.718174] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2
    (early) [    1.721252] Using NULL legacy PIC
    (early) [    1.721257] NR_IRQS: 524544, nr_irqs: 48, preallocated irqs: 0
    (early) [    1.721304] xen:events: Using FIFO-based ABI
    (early) [    1.721478] random: crng done (trusting CPU's manufacturer)
    (early) [    1.721508] Console: colour dummy device 80x25
    (early) [    1.721597] printk: console [tty0] enabled
    [    1.721604] printk: console [hvc0] enabled
    (early) [    1.721604] printk: console [hvc0] enabled
    [    1.721610] printk: bootconsole [xenboot0] disabled
    (early) [    1.721610] printk: bootconsole [xenboot0] disabled
    [    1.721636] clocksource: xen: mask: 0xffffffffffffffff max_cycles: 0x1cd42e4dffb, max_idle_ns: 881590591483 ns
    [    1.721650] installing Xen timer for CPU 0
    [    1.721677] clocksource: tsc-early: mask: 0xffffffffffffffff max_cycles: 0x2fc04a0142b, max_idle_ns: 440795346615 ns
    [    1.721687] Calibrating delay loop (skipped), value calculated using timer frequency.. 6625.46 BogoMIPS (lpj=13250936)
    [    1.721694] pid_max: default: 32768 minimum: 301
    [    1.721752] LSM: Security Framework initializing
    [    1.721772] Yama: becoming mindful.
    [    1.721818] AppArmor: AppArmor initialized
    [    1.721900] Mount-cache hash table entries: 8192 (order: 4, 65536 bytes, linear)
    [    1.721910] Mountpoint-cache hash table entries: 8192 (order: 4, 65536 bytes, linear)
    [    1.721943] *** VALIDATE tmpfs ***
    [    1.722115] *** VALIDATE proc ***
    [    1.722214] *** VALIDATE cgroup1 ***
    [    1.722218] *** VALIDATE cgroup2 ***
    (early) Poking(early)  KASLR using(early)  RDRAND(early)  RDTSC(early) ...
    [    1.722386] Last level iTLB entries: 4KB 64, 2MB 8, 4MB 8
    [    1.722391] Last level dTLB entries: 4KB 64, 2MB 0, 4MB 0, 1GB 4
    [    1.722398] Speculative Store Bypass: Vulnerable
    [    1.722402] SRBDS: Unknown: Dependent on hypervisor status
    [    1.762961] cpu 0 spinlock event irq 1
    [    1.762967] VPMU disabled by hypervisor.
    [    1.763121] Performance Events: unsupported p6 CPU model 158 no PMU driver, software events only.
    [    1.763173] rcu: Hierarchical SRCU implementation.
    [    1.763631] NMI watchdog: Perf NMI watchdog permanently disabled
    [    1.763674] smp: Bringing up secondary CPUs ...
    [    1.763790] installing Xen timer for CPU 1
    [    1.763811] SMP alternatives: switching to SMP code
    [    1.803767] cpu 1 spinlock event irq 13
    [    1.803767] smp: Brought up 1 node, 2 CPUs
    [    1.803767] smpboot: Max logical packages: 1
    [    1.803767] devtmpfs: initialized
    [    1.803767] x86/mm: Memory block size: 128MB
    [    1.803767] PM: Registering ACPI NVS region [mem 0x836a9000-0x836a9fff] (4096 bytes)
    [    1.803767] PM: Registering ACPI NVS region [mem 0x8ccc5000-0x8cda6fff] (925696 bytes)
    [    1.803767] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
    [    1.803767] futex hash table entries: 512 (order: 3, 32768 bytes, linear)
    [    1.803767] pinctrl core: initialized pinctrl subsystem
    [    1.822672] PM: RTC time: 165:165:165, date: 2065-165-165
    [    1.822823] NET: Registered protocol family 16
    [    1.822837] xen:grant_table: Grant tables using version 1 layout
    [    1.849698] Grant table initialized
    [    1.849738] audit: initializing netlink subsys (disabled)
    [    1.849751] audit: type=2000 audit(1603042631.327:1): state=initialized audit_enabled=0 res=1
    [    1.849751] EISA bus registered
    [    1.850622] PCI: setting up Xen PCI frontend stub
    [    1.853869] fbcon: Taking over console
    [    1.853869] ACPI: Interpreter disabled.
    [    1.853869] xen:balloon: Initialising balloon driver
    [    1.853869] iommu: Default domain type: Translated
    [    1.853869] SCSI subsystem initialized
    [    1.853869] vgaarb: loaded
    [    1.853869] usbcore: registered new interface driver usbfs
    [    1.853869] usbcore: registered new interface driver hub
    [    1.853869] usbcore: registered new device driver usb
    [    1.853869] pps_core: LinuxPPS API ver. 1 registered
    [    1.853869] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
    [    1.853869] PTP clock support registered
    [    1.853869] EDAC MC: Ver: 3.0.0
    [    1.853869] PCI: System does not support PCI
    [    1.853869] NetLabel: Initializing
    [    1.853869] NetLabel:  domain hash size = 128
    [    1.853869] NetLabel:  protocols = UNLABELED CIPSOv4 CALIPSO
    [    1.853869] NetLabel:  unlabeled traffic allowed by default
    [    1.858197] clocksource: Switched to clocksource xen
    [    1.864969] *** VALIDATE bpf ***
    [    1.865005] VFS: Disk quotas dquot_6.6.0
    [    1.865017] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
    [    1.865033] *** VALIDATE ramfs ***
    [    1.865036] hugetlbfs: disabling because there are no supported hugepage sizes
    [    1.865085] AppArmor: AppArmor Filesystem Enabled
    [    1.865099] pnp: PnP ACPI: disabled
    [    1.866763] thermal_sys: Registered thermal governor 'fair_share'
    [    1.866763] thermal_sys: Registered thermal governor 'bang_bang'
    [    1.866785] thermal_sys: Registered thermal governor 'step_wise'
    [    1.866790] thermal_sys: Registered thermal governor 'user_space'
    [    1.866794] thermal_sys: Registered thermal governor 'power_allocator'
    [    1.866838] NET: Registered protocol family 2
    [    1.866947] tcp_listen_portaddr_hash hash table entries: 2048 (order: 3, 32768 bytes, linear)
    [    1.866968] TCP established hash table entries: 32768 (order: 6, 262144 bytes, linear)
    [    1.867010] TCP bind hash table entries: 32768 (order: 7, 524288 bytes, linear)
    [    1.867047] TCP: Hash tables configured (established 32768 bind 32768)
    [    1.867066] UDP hash table entries: 2048 (order: 4, 65536 bytes, linear)
    [    1.867077] UDP-Lite hash table entries: 2048 (order: 4, 65536 bytes, linear)
    [    1.867105] NET: Registered protocol family 1
    [    1.867112] NET: Registered protocol family 44
    [    1.867117] PCI: CLS 0 bytes, default 64
    [    1.867138] Trying to unpack rootfs image as initramfs...
    [    2.218397] Freeing initrd memory: 43228K
    [    2.218495] check: Scanning for low memory corruption every 60 seconds
    [    2.218936] Initialise system trusted keyrings
    [    2.218950] Key type blacklist registered
    [    2.219018] workingset: timestamp_bits=36 max_order=20 bucket_order=0
    [    2.219708] zbud: loaded
    [    2.219896] squashfs: version 4.0 (2009/01/31) Phillip Lougher
    [    2.220102] fuse: init (API version 7.31)
    [    2.220121] *** VALIDATE fuse ***
    [    2.220125] *** VALIDATE fuse ***
    [    2.220207] Platform Keyring initialized
    [    2.222191] Key type asymmetric registered
    [    2.222195] Asymmetric key parser 'x509' registered
    [    2.222204] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 244)
    [    2.222244] io scheduler mq-deadline registered
    [    2.222316] shpchp: Standard Hot Plug PCI Controller Driver version: 0.4
    [    2.222711] Serial: 8250/16550 driver, 32 ports, IRQ sharing enabled
    [    2.223862] Linux agpgart interface v0.103
    [    2.224871] loop: module loaded
    [    2.224876] Invalid max_queues (4), will use default max: 2.
    [    2.225814] libphy: Fixed MDIO Bus: probed
    [    2.225821] tun: Universal TUN/TAP device driver, 1.6
    [    2.225857] PPP generic driver version 2.4.2
    [    2.225890] xen_netfront: Initialising Xen virtual ethernet driver
    [    2.225922] VFIO - User Level meta-driver version: 0.3
    [    2.225977] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
    [    2.225983] ehci-pci: EHCI PCI platform driver
    [    2.225991] ehci-platform: EHCI generic platform driver
    [    2.226002] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
    [    2.226011] ohci-pci: OHCI PCI platform driver
    [    2.226018] ohci-platform: OHCI generic platform driver
    [    2.226023] uhci_hcd: USB Universal Host Controller Interface driver
    [    2.226060] i8042: PNP: No PS/2 controller found.
    [    2.226064] i8042: Probing ports directly.
    [    3.238830] i8042: No controller found
    [    3.238859] clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x2fc04a0142b, max_idle_ns: 440795346615 ns
    [    3.238984] mousedev: PS/2 mouse device common for all mice
    [    3.239072] i2c /dev entries driver
    [    3.239103] device-mapper: uevent: version 1.0.3
    [    3.239168] device-mapper: ioctl: 4.41.0-ioctl (2019-09-16) initialised: dm-devel@redhat.com
    [    3.239189] platform eisa.0: Probing EISA bus 0
    [    3.239213] platform eisa.0: EISA: Detected 0 cards
    [    3.239222] intel_pstate: CPU model not supported
    [    3.239263] ledtrig-cpu: registered to indicate activity on CPUs
    [    3.239301] BUG: unable to handle page fault for address: ffffc900401d3818
    [    3.239308] #PF: supervisor read access in kernel mode
    [    3.239312] #PF: error_code(0x0000) - not-present page
    [    3.239315] PGD 7ec72067 P4D 7ec72067 PUD 177d50067 PMD 177d51067 PTE 0
    [    3.239321] Oops: 0000 [#1] SMP NOPTI
    [    3.239325] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.4.0-51-generic #56-Ubuntu
    [    3.239333] RIP: e030:pmc_core_probe+0x134/0x17f
    [    3.239337] Code: 82 48 c7 c7 68 70 d7 82 e8 a9 e5 80 ff 48 8b 05 82 2c 48 01 48 c7 83 88 00 00 00 40 70 d7 82 48 63 40 44 48 03 05 64 2c 48 01 <8b> 00 48 8b 15 63 2c 48 01 48 c7 c7 60 db 14 82 8b 4a 48 ba 01 00
    [    3.239349] RSP: e02b:ffffc9004000bbc8 EFLAGS: 00010286
    [    3.239353] RAX: ffffc900401d3818 RBX: ffffffff827dbe80 RCX: 80000000fe001073
    [    3.239358] RDX: ffffffff82d77020 RSI: ffffffff8242e365 RDI: ffffffff82d77068
    [    3.239363] RBP: ffffc9004000bbe0 R08: 0000000000000000 R09: ffffc9004000ba80
    [    3.239368] R10: 0000000000007ff0 R11: ffff888177f96900 R12: ffffffff827dbe90
    [    3.239373] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
    [    3.239384] FS:  0000000000000000(0000) GS:ffff88817c600000(0000) knlGS:0000000000000000
    [    3.239389] CS:  e030 DS: 0000 ES: 0000 CR0: 0000000080050033
    [    3.239394] CR2: ffffc900401d3818 CR3: 000000000260a000 CR4: 0000000000040660
    [    3.239402] Call Trace:
    [    3.239408]  platform_drv_probe+0x3b/0x80
    [    3.239412]  really_probe+0x2b3/0x3e0
    [    3.239415]  driver_probe_device+0xbc/0x100
    [    3.239419]  __device_attach_driver+0x71/0xd0
    [    3.239423]  ? driver_allows_async_probing+0x50/0x50
    [    3.239427]  bus_for_each_drv+0x84/0xd0
    [    3.239431]  __device_attach+0xed/0x170
    [    3.239434]  device_initial_probe+0x13/0x20
    [    3.239437]  bus_probe_device+0x8f/0xa0
    [    3.239441]  device_add+0x3c7/0x6b0
    [    3.239444]  platform_device_add+0xf9/0x240
    [    3.239448]  platform_device_register+0x6b/0x70
    [    3.239455]  ? pmc_core_driver_init+0x19/0x19
    [    3.239459]  pmc_core_platform_init+0x43/0x45
    [    3.239464]  do_one_initcall+0x4a/0x1fa
    [    3.239469]  kernel_init_freeable+0x1b2/0x255
    [    3.239474]  ? rest_init+0xb0/0xb0
    [    3.239478]  kernel_init+0xe/0x100
    [    3.239481]  ret_from_fork+0x1f/0x40
    [    3.239485] Modules linked in:
    [    3.239488] CR2: ffffc900401d3818
    [    3.239494] ---[ end trace c5dde7a582f9e4e9 ]---
    [    3.239499] RIP: e030:pmc_core_probe+0x134/0x17f
    [    3.239502] Code: 82 48 c7 c7 68 70 d7 82 e8 a9 e5 80 ff 48 8b 05 82 2c 48 01 48 c7 83 88 00 00 00 40 70 d7 82 48 63 40 44 48 03 05 64 2c 48 01 <8b> 00 48 8b 15 63 2c 48 01 48 c7 c7 60 db 14 82 8b 4a 48 ba 01 00
    [    3.239513] RSP: e02b:ffffc9004000bbc8 EFLAGS: 00010286
    [    3.239517] RAX: ffffc900401d3818 RBX: ffffffff827dbe80 RCX: 80000000fe001073
    [    3.239522] RDX: ffffffff82d77020 RSI: ffffffff8242e365 RDI: ffffffff82d77068
    [    3.239527] RBP: ffffc9004000bbe0 R08: 0000000000000000 R09: ffffc9004000ba80
    [    3.239532] R10: 0000000000007ff0 R11: ffff888177f96900 R12: ffffffff827dbe90
    [    3.239538] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
    [    3.239547] FS:  0000000000000000(0000) GS:ffff88817c600000(0000) knlGS:0000000000000000
    [    3.239552] CS:  e030 DS: 0000 ES: 0000 CR0: 0000000080050033
    [    3.239556] CR2: ffffc900401d3818 CR3: 000000000260a000 CR4: 0000000000040660
    [    3.239565] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000009
    [    3.239574] Kernel Offset: disabled

During further attempts to start the domU I found out that the crash only happens when pci passthrough is used for a network card (i350 4-port SR-IOV VF). Once the line is disabled, the domU starts with Ubuntu 20.04 kernel 5.4.x
Another attempt shows that the domU with pci passthrough runs under Ubuntu 20.04 with older kernel for exmaple 4.15.x odr 5.0.x.
Are there new parameters for the boot command line of the domU for the kernel 5.4.x or do I have to load any xen related modules in the domU with initramfs?
Why does domU crash with kernel 5.4.x and how can I fix it?
Has anyone else had similar experiences? Is it a bug in Intel pmc_core_probe?
Kind regards
Torsten

A: Try adding swiotlb=force to your domU grub.cfg or xen.cfg extra section


text:
Q: ошибка при вызове декоратора есть декоратор
def beauty_print(func):
    def wrapper():
        print('---------------------------------------------------------------')
        func()
        print('---------------------------------------------------------------')

    return wrapper()

и есть класс в котором я его вызываю
    @beauty_print
    def info(self):
        print(f"Shop\n\tname:  {self.name}\tsquare: {self.square}")
        print(f"Goods : {' '.join(self.__goods)}")

возникает следующая ошибка

вот весь мой код
from abc import ABC, abstractmethod

def beauty_print(func):
    def wrapper():
        print('---------------------------------------------------------------')
        func()
        print('---------------------------------------------------------------')

    return wrapper()

class Shop(ABC):

    def __init__(self, name, square):
        self.__name = name
        self.__square = square

    @abstractmethod
    def info(self):
        pass

    @property
    def name(self):
        return self.__name

    @name.setter
    def name(self, name):
        if name.startswith(str(r'/[a-zA-ZА-Яа-я]/')):
            self.__name = name
        else:
            print("wrong name")

    @property
    def square(self):
        return self.__square

    @square.setter
    def square(self, square):
        self.__square = square if square > 0 else print("wrong square")

class Product(ABC):
    def __init__(self, name, price):
        self.__name = name
        self.__price = price

    @property
    def name(self):
        return self.__name

    @name.setter
    def name(self, name):
        if name.startswith(str(r'/[a-zA-ZА-Яа-я]/')):
            self.__name = name
        else:
            print("wrong name")

    @property
    def price(self):
        return self.__price

    @price.setter
    def price(self, price):
        self.__price = price if price > 0 else print("wrong square")

class ProductShop(Shop, Product):
    __goods = []

    def __init__(self, shop_name, square, product_name, price):
        Shop.__init__(self, shop_name, square)
        Product.__init__(self, product_name, price)
        self.__goods.append(f'{product_name} {price}')

    @beauty_print
    def info(self):
        print(f"Shop\n\tname:  {self.name}\tsquare: {self.square}")
        print(f"Goods : {' '.join(self.__goods)}")

def main():
    ps = ProductShop("pop", 123, "it", 12)
    ps.info()

if __name__ == '__main__':
    main()

A: во первых, wrapper вызывать не надо, а во вторых, wrapper должен принимать любые аргументы и передавать их в func
def beauty_print(func):
    def wrapper(*args, **kwargs):
        print('---------------------------------------------------------------')
        func(*args, **kwargs)
        print('---------------------------------------------------------------')

    return wrapper


text:
Q: Grails Database Migration Load Data I have initialy created a changeset which loads(via loadData) countries into my database if its synced with my grails application. Now I already have a system which is running in productive mode and want to change the loaded initial data of countries.
For example there is now only 2 columns instead of 4 in countries because the others are not needed anymore. How can I handle this at best?
I already changed the original changeset but this was not a good idea as I am getting only errors now.
Update:
Sorry I didnt mentioned it in my post. I am already using the database migration plugin which is using liquibase.
Thanks for your help

A: If you ever need to change your database, the correct process is to create a new migration, rather than try to change an old one.
If you created a migration to load the data with four columns, then you should create a migration to drop the extra columns down to two.    If the production database is differs from development (e.g. already has two columns), you can create a migration with failOnError=false to sync them.  Leave the migration that loads the data alone.

A: You could use liquidbase - http://www.grails.org/plugin/liquibase
or write your own alter statement in sql to drop the columns that are not needed.
Hope that helps.


text:
Q: GHC compiled binary stack overflow? I'm reading << real world haskell >> Chapter 8 and wanted to see how the SumFile.hs program handles say, 1 million numbers:
main :: IO ()
main = do
  contents <- getContents
  print (sumFile contents)
    where sumFile = sum . map read . words

When I feed 1 million integers to the program with:
runhaskell SumFile.hs < data.txt, the program gives a correct result.
However, when I compiled it using GHC:
ghc SumFile.hs

The binary gives a "Stack space overflow" error:
./SumFile < data.txt
Stack space overflow: current size 8388608 bytes.
Use `+RTS -Ksize -RTS' to increase it.

I have two questions:

*

*What is causing the stack space usage?

*Why does the compiled version differ from the interpreted version and what can I do?

Thanks!
EDIT:
Alright the reason is map, but here's a modified version that uses lazy bytestring:
import qualified Data.ByteString.Lazy as L
import qualified Data.ByteString.Lazy.Char8 as LCHAR
import Data.Monoid
import Data.List

main :: IO ()
main = do
  contents <- L.getContents
  case sumFile contents of
    Nothing -> print "Invalid input"
    Just s -> print $ getSum s
   where sumFile = foldl' mappend (Just (Sum 0)) . map ((fmap Sum) . (fmap fst) . LCHAR.readInt) . (LCHAR.words)

The result is the same: binary version uses up stack space even though I'm not using sum.

A: I had a discussion with folks on #haskell, the reason that the ByteString version gives stack overflow error is due to the nested Just (Sum Num) where the inner part is not strictly evaluated.
Essentially when we mappend two Maybe (Just Num), say, Just (Sum 2) and Just (Sum 3), foldl' uses seq to produce a Just ((Sum 2) mappend (Sum 3)), ie. seq strictly evaluated the outmost constructor (mappend two Just (Monoid) to produce a Just (Monoid)). In this case, the inner Monoid is not strictly evaluated, so they are left as mappend connected (Sum Num). This results in 1 million mappend connected (Sum Num) wrapped in Just.
So Saizan on #haskell gives this version which strictly evaluates the inner part of Maybe (Sum Num)
import qualified Data.ByteString.Lazy as L
import qualified Data.ByteString.Lazy.Char8 as LCHAR
import Data.Monoid
import Data.List

forceMaybe Nothing = Nothing
forceMaybe (Just x) = x `seq` (Just x)

main :: IO ()
main = do
  contents <- L.getContents
  case sumFile contents of
    Nothing -> print "Invalid input"
    Just s -> print $ getSum s
   where sumFile = foldl' (\ x y -> forceMaybe (x `mappend` y)) (Just (Sum 0)) . map ((fmap Sum) . (fmap fst) . LCHAR.readInt) . (LCHAR.words)

A: I checked out the online version of the book, there're some discussion under that program and the reason it uses stack space is due to map, replacing map with foldl' solves the problem.

A: First, simple clarification: the stack in ghc runtime has nothing to deal with stack segment, it is internal structure of runtime and this is not source of buffer-overflow type attacks.
Second. Haskell is lazy. Lazy io (getContents) produce lazy list. sum produce result lazily. However, once the result of sum is requested, it has to dig into list recursively, quickly exhausting stack space (you can look in the sources if wish)
to avoid it, you have to use strict version of sum, it should eliminate problem. Standard library has a special function for such cases, foldl' - a strict version of foldl. using foldl' (+) 0 in place of sum should eliminate problem
Third. Stack space leaks are very common problem when one use lazy IO. It may be solved if one switch to iteratee-based IO. Otherwise one should learn to add strictness annotation where needed.
Ah. And by the way. GHC is optimizing compiler. It is not common, but still possible to have some problems with memory leakage in compiled program and to not have them with ghci and vice versa.


text:
Q: Apple Preview encoding # I have a PDF file generated from a gDoc including links with jump marks. Example link:
https://digitaleneuordnung.de/blog/lean-management/#3M
Opening the generated PDF in Acrobat Reader everything works fine. Opening the same file in Preview, the hashtag in the link is replaced with %23 and opening the links in a browser end in a 404.
Is there anything I can do so that the links including jump marks also work fine if opened / clicked from the Preview?


text:
Q: The union basis of a group of finite sets Given a finite group of finite sets $\mathcal{A}$, how to find a smallest group of finite sets $\mathcal{B}$, such that for any finite set $A\in\mathcal{A}$, $A$ can be expressed by the union of some finite sets $B_1,B_2,\cdots,B_n\in\mathcal{B}$?
Obviously, $\mathcal{A}$ itself is an answer, so such a $\mathcal{B}$ exists. Another answer is the group of atoms, (the maximal subgroups of $\mathcal{A}$ such that the intersection of each subgroup is nonempty, and the atoms are just those intersections). I emphasize that $\mathcal{B}\subset \mathcal{A}$ is not necessary. Thus, this problem is different from the topology basis, which requires that the basis elements are open.
My question is, is there a method to get at least one smallest union basis ($\mathcal{B}$) just like one gets bases for vector space? Which mathematical branch does this problem belong to? Thank you.

A: I have found the answer.
L. J. Stockmeyer, The minimal set basis problem is NP-complete, Research Rep., RC5431, IBM, 1975, May
http://scholar.google.com/scholar?hl=en&q=L.+J.+Stockmeyer%2C+The+minimal+set+basis+problem+is+NP-complete%2C+Research+Rep.%2C+RC5431%2C+IBM%2C+1975%2C+May


text:
Q: Session Fixation- Getting an error while accessing value in a session I'm writing a grails application which uses Spring Security Plugins. I turned on the following attribute for the spring security plugin

grails.plugins.springsecurity.useSessionFixationPrevention = true
  grails.plugins.springsecurity.SessionFixationPrevention.migrate = true
  grails.plugins.springsecurity.SessionFixationPrevention.alwaysCreateSession
  = true

I have the following code in my AuthenticationProvider

def session =
  RequestContextHolder.currentRequestAttributes().getSession()
session.key = "Some Value"

Now after Authentication my code in the loginSuccess method of my RememberMeService class gets called and when I try to get the value in the session which was placed, I get this error
j

ava.lang.IllegalStateException: getAttribute: Session already
  invalidated   at
  org.apache.catalina.session.StandardSession.getAttribute(StandardSession.java:1014)
    at
  org.apache.catalina.session.StandardSessionFacade.getAttribute(StandardSessionFacade.java:110)
    at
  org.codehaus.groovy.grails.web.servlet.mvc.GrailsHttpSession.getAttribute(GrailsHttpSession.java:45)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  at
  sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at
  sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)     at
  org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoCachedMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:229)
    at
  org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:52)
    at
  org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
    at
  org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:54)
    at
  org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:124)
    at
  org.codehaus.groovy.grails.plugins.web.ServletsGrailsPlugin$_closure1_closure2.doCall(ServletsGrailsPlugin.groovy:44)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  at
  sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at
  sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)     at
  org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:88)
    at
  org.codehaus.groovy.runtime.metaclass.ClosureMetaMethod.invoke(ClosureMetaMethod.java:80)
    at
  groovy.lang.ExpandoMetaClass.getProperty(ExpandoMetaClass.java:1109)
    at
  org.codehaus.groovy.runtime.InvokerHelper.getProperty(InvokerHelper.java:161)
    at
  org.codehaus.groovy.runtime.callsite.PojoMetaClassGetPropertySite.getProperty(PojoMetaClassGetPropertySite.java:33)
    at
  org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGetProperty(AbstractCallSite.java:235)
    at
  com.teslagovernment.security.TabulaeRememberMeServices.loginSuccess(TabulaeRememberMeServices.groovy:59)
    at
  org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.successfulAuthentication(AbstractAuthenticationProcessingFilter.java:294)
    at
  org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:218)
    at
  org.codehaus.groovy.grails.plugins.springsecurity.RequestHolderAuthenticationFilter.doFilter(RequestHolderAuthenticationFilter.java:40)
    at
  org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:378)
    at
  org.codehaus.groovy.grails.plugins.springsecurity.MutableLogoutFilter.doFilter(MutableLogoutFilter.java:79)
    at
  org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:378)
    at
  org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:79)
    at
  org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:378)
    at
  org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:167)
    at
  org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
    at
  org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
    at
  org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at
  org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at
  org.codehaus.groovy.grails.web.servlet.filter.GrailsReloadServletFilter.doFilterInternal(GrailsReloadServletFilter.java:104)
    at
  org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
    at
  org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at
  org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at
  org.codehaus.groovy.grails.web.servlet.mvc.GrailsWebRequestFilter.doFilterInternal(GrailsWebRequestFilter.java:69)
    at
  org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
    at
  org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at
  org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at
  org.codehaus.groovy.grails.web.filters.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:65)
    at
  org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
    at
  org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at
  org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at
  org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
    at
  org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
    at
  org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
    at
  org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
    at
  org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at
  org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at
  org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at
  org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at
  org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
    at
  org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at
  org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at
  org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
    at
  org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
    at
  org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
    at
  org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)

My question is why is this happening and how can I set data in my AuthenticationProvider
 which I can access in my RememberMeService ?
Thanks

A: Try issuing a redirect immediately after authenticating, and before accessing any copied session properties. The session variable in your service right after authentication may still be referring to the old session from the request context. A redirect will refresh the request context.
Otherwise, you can store any additional properties in your spring security principal object within your AuthenticationProvider. Outside your provider, you can access the principal via the springSecurityService, which is inside the applicationContext:
MyPrincipalObject obj = springSecurityService.principal
def key = obj.key


text:
Q: How to get current time from internet in android I am making an app in which I want to get the current time from internet.
I know how to get the time from the device using System.currentTimeMillis, and even after searching a lot, I did not get any clue about how to get it from internet.

A: Here is a method that i have created for you
you can use this in your code
public String getTime() {
try{
    //Make the Http connection so we can retrieve the time
    HttpClient httpclient = new DefaultHttpClient();
    // I am using yahoos api to get the time
    HttpResponse response = httpclient.execute(new
    HttpGet("http://developer.yahooapis.com/TimeService/V1/getTime?appid=YahooDemo"));
    StatusLine statusLine = response.getStatusLine();
    if(statusLine.getStatusCode() == HttpStatus.SC_OK){
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        response.getEntity().writeTo(out);
        out.close();
        // The response is an xml file and i have stored it in a string
        String responseString = out.toString();
        Log.d("Response", responseString);
        //We have to parse the xml file using any parser, but since i have to
        //take just one value i have deviced a shortcut to retrieve it
        int x = responseString.indexOf("<Timestamp>");
        int y = responseString.indexOf("</Timestamp>");
        //I am using the x + "<Timestamp>" because x alone gives only the start value
        Log.d("Response", responseString.substring(x + "<Timestamp>".length(),y) );
        String timestamp =  responseString.substring(x + "<Timestamp>".length(),y);
        // The time returned is in UNIX format so i need to multiply it by 1000 to use it
        Date d = new Date(Long.parseLong(timestamp) * 1000);
        Log.d("Response", d.toString() );
        return d.toString() ;
    } else{
        //Closes the connection.
        response.getEntity().getContent().close();
        throw new IOException(statusLine.getReasonPhrase());
    }
}catch (ClientProtocolException e) {
Log.d("Response", e.getMessage());
}catch (IOException e) {
Log.d("Response", e.getMessage());
}
return null;
}

A: If you don't care for millisecond accuracy, and if you are already using google firebase or don't mind using it (they provide a free tier), check this out: https://firebase.google.com/docs/database/android/offline-capabilities#clock-skew
Basically, firebase database has a field that provides offset value between the device time and the firebase server time. You can use this offset to get the current time.
DatabaseReference offsetRef = FirebaseDatabase.getInstance().getReference(".info/serverTimeOffset");
offsetRef.addValueEventListener(new ValueEventListener() {
  @Override
  public void onDataChange(DataSnapshot snapshot) {
    double offset = snapshot.getValue(Double.class);
    double estimatedServerTimeMs = System.currentTimeMillis() + offset;
  }

  @Override
  public void onCancelled(DatabaseError error) {
    System.err.println("Listener was cancelled");
  }
});

As I said, it will be inaccurate based on network latency.

A: I think the best solution is to use SNTP, in particular the SNTP client code from Android itself, e.g.:
http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/4.1.1_r1/android/net/SntpClient.java/
I believe Android uses SNTP for automatic date/time updates when a cell network is not available (e.g. wifi tablets).
I think it is better then the other solutions because it uses SNTP/NTP rather then the Time protocol (RFC 868) used by the Apache TimeTCPClient.  I don't know anything bad about RFC 868, but NTP is newer and seems to have superceeded it and is more widely used.  I believe that Android devices that don't have cellular uses NTP.
Also, because it uses sockets.  Some of the solutions proposed use HTTP so they will lose something in their accuracy.

A: You can get time from internet time servers using the below program
import java.io.IOException;

import org.apache.commons.net.time.TimeTCPClient;

public final class GetTime {

    public static final void main(String[] args) {
        try {
            TimeTCPClient client = new TimeTCPClient();
            try {
                // Set timeout of 60 seconds
                client.setDefaultTimeout(60000);
                // Connecting to time server
                // Other time servers can be found at : http://tf.nist.gov/tf-cgi/servers.cgi#
                // Make sure that your program NEVER queries a server more frequently than once every 4 seconds
                client.connect("time.nist.gov");
                System.out.println(client.getDate());
            } finally {
                client.disconnect();
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}

1.You would need Apache Commons Net library for this to work. Download the library and add to your project build path.
(Or you can also use the trimmed Apache Commons Net Library here : https://www-us.apache.org/dist//commons/net/binaries/commons-net-3.6-bin.tar.gz This is enough to get time from internet )
2.Run the program. You will get the time printed on your console.

A: You will need to have access to a webservice that provides current time in XML or JSON format.
If you don't find such type of service, you could parse the time from a web page, like http://www.timeanddate.com/worldclock/, or host your own time service on a server using a simple PHP page for example.
Check out JSoup for the parsing of HTML pages.

A: Nothing from the above worked from me. This is what I ended up with (with Volley);
This example also converts to another timezone.
    Long time = null;
    RequestQueue queue = Volley.newRequestQueue(this);
    String url ="http://www.timeapi.org/utc/now";

    StringRequest stringRequest = new StringRequest(Request.Method.GET, url,
            new Response.Listener<String>() {
                @Override
                public void onResponse(String response) {
                    try {
                        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
                        simpleDateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
                        Date date = simpleDateFormat.parse(response);

                        TimeZone tz = TimeZone.getTimeZone("Israel");
                        SimpleDateFormat destFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
                        destFormat.setTimeZone(tz);

                        String result = destFormat.format(date);

                        Log.d(TAG, "onResponse: " + result.toString());
                    } catch (ParseException e) {
                        e.printStackTrace();
                    }
                }
            }, new Response.ErrorListener() {
        @Override
        public void onErrorResponse(VolleyError error) {
            Log.w(TAG, "onErrorResponse: "+ error.getMessage());
        }
    });
    queue.add(stringRequest);
    return time;

Import Volley in gradle:
compile 'com.android.volley:volley:1.0.0'

A: There is a clear answer available already in Stackoverflow
https://stackoverflow.com/a/71274296/11789675
Call this url or use as GET API
http://worldtimeapi.org/api/timezone/Asia/Kolkata
the response will be like
{
  "abbreviation": "IST",
  "client_ip": "45.125.117.46",
  "datetime": "2022-02-26T10:50:43.406519+05:30",
 }

A: This thing works best for my apps. I use jsoup to search the google time and gets current time and then I compare the phone time with google time. So if these time are different you can stop user using a dialogbox or alertbox to tell them the times have changed. You can implement in MainActivity to check this condition. Here is a snippet so you get the idea more clearly.
public class HomeActivity extends AppCompatActivity {
    //phoneDate and phoneTime to get current phone date and time
    String phoneDate = new SimpleDateFormat("dd MMM yyyy ").format(clnd.getTime()).trim();
    String phoneTime = new SimpleDateFormat("hh:mm a").format(clnd.getTime()).trim();
    String googleDate;
    String googleTime ;
    @Override
    protected void onCreate(Bundle _savedInstanceState) {
    super.onCreate(_savedInstanceState);
    setContentView(R.layout.home);
    Thread thread = new Thread(new Runnable() {
    @Override
    public void run() {
        try  {
                        //URL to search time
                        String url = "https://www.google.co.in/search?q=time";

                        Document document  = Jsoup.connect(url).get();
                        org.jsoup.select.Elements time = document.getElementsByClass("gsrt vk_bk FzvWSb YwPhnf");
                        org.jsoup.select.Elements date = document.getElementsByClass("KfQeJ");

                        Log.d("HTML", "google date" + String.format(date.text()));
                        Log.d("HTML", "google time" + time.text());

                        googleDate = date.text().trim();
                        googleTime = time.text().trim();
                        //'0'is not present when hour is single digit
                        char second = googleTime.charAt(1);
                        if(second == ':'){
                        googleTime = "0" + googleTime;
                    }
                    Log.d("Proper format", "google time" + googleTime);

                    Log.d("Date", "your current url when webpage loading.." + phoneDate);
                    Log.d("Time", "your current url when webpage loading.." + phoneTime);

                    if(googleDate.contains(phoneDate) && googleTime.equals(phoneTime)){
                        Log.d("Time", "your current url when webpage loading.." + " true");
                    }else{
                        Log.d("Time", "your current url when webpage loading.." + " false");
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        });
        thread.start();
    }
}


text:
Q: Send input from component.html to component.ts I'm doing a search, and I'm receiving the value I need to search from the User on my component.html.
I'm sending the data to the component.ts like the code below.
<input class="form-control mr-sm-2" #query (keyup.enter)="search(query.value)">
Buscar

And in my component.ts I've the following code
search(query: string) {
    if (query !== '') {
        window.location.href = 'http://mydomain/result.html?name=' + query;
    }
}

My doubt is, why the window.location.href always change the current URL in the browser on Firefox Developer Edition, and only sometimes on Google Chrome and Firefox Quantum.
If I click on the button, It always work as expected, but if I hit the enter, It work only sometimes on the other 2 browsers, and I don't know why this is happening, can you guys help me with that?

*

*EDIT
I've noticed while debugging that, when I hit enter, it doesn't call the function search.

A: You are using (keyup.enter) when in reality you want (key.enter). Also, you don't need a reference #query. You could write input as:
<input class="form-control mr-sm-2" (key.enter)="search($event)">

In the method use:
search(event: Event) {
    const query = (event.target as HTMLInputElement).value;

    if (query !== '') {
        window.location.href = 'http://mydomain/result.html?name=' + query;
    }
}

It seems that FireFox is catching keyup and not enter.

A: I've found a solution, I've changed the <input> tag content and the tag  to <button>, like the code below
<input type="text" class="form-control mr-sm-2" [(ngModel)]="query" name="busca">
<button type="submit" class="btn btn-light my-2 my-sm-0" (click)="search()">Buscar</button>

And in my component I've the code below
export class MyComponent implements OnInit {
    query = ''; // Global variable in my component

    constructor() {}

    ngOnInit() {
    }

    search() {
        if (this.query !== '') {
            window.location.href = 'http://mydomain/result.html?name=' + this.query;
        }
    }
}

And on my app.module.ts I've added the following lines
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms'; // Imported the FormsModule here

import { AppComponent } from './app.component';
import { MyComponent } from './my/my.component';

@NgModule({
  declarations: [
    AppComponent,
    HeaderComponent,
    MyComponent
  ],
  imports: [
    BrowserModule,
    FormsModule  // Added the FormsModule here
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }


text:
Q: What does log4j2 file appenders use for file encoding/format? What file format does log4j2 use when it writes to rollingfileappender? Furthermore, is there a way to change it?  What I'd like to do use use UTF-16.

A: The Charset is specified on the Layout. AbstractStringLayout defaults to UTF-8.
You should be able to change that by specifying charset="UTF-16" on the Layout configuration.

A: Small correction on Ralph's answer: for PatternLayout the default charset is the system default. This is important because for example the Windows console won't be able to correctly display UTF-8 on Japanese Windows.

A: If you use log4j.properties, configure it as follow:
appender.rolling.layout.charset = UTF-16

or make the corresponding configurations in your xml configuration file.


text:
Q: binding of array elements in d3.js Basiclly I have an Array of some Strings and I want to bind each of this strings to an circle. Then when I hover over the Circle I want to display these strings in a tooltip.
So this is my Array:
var node = [
        "Hallo Hallo Hallo Hallo Hallo Hallo Hallo",
        "foobarbaz",
        "This is a short text",
        "Changed some things on the folder structure and added some functions to the convert.c file",
    ];

Then there is my Tooltip which displays a html text...
var tooltip = svg.append('foreignObject')
        .attr('x', 50)
        .attr('y', 50)
        .attr('width', 200)
        .attr('height', 300)
        .style("visibility", "hidden")
        .append("xhtml:body")
        .html('
Example
');

And now I want to create my circles over a for loop, append the data to them and let the tooltip display the right data on a mouseover:
for (var i = 0; i < 4; i++) {

    svg.append("circle")
        .data(node[i])
        .attr("cx", 100*i+250)
        .attr("cy", 100)
        .attr("r", 10)
        .attr("fill", "steelblue" )
        .on("mouseover", function(d){
            return tooltip.style("visibility","visible")
                .html('
'+d+'
');
        }).on("mouseout", function(){
            return tooltip.style("visibility", "hidden");
        });
    }

But for some reason the result is not the whole string when I hover over the points it is just the fist character of the string. I am obviously missing something here...

A: D3 expects you to provide an array of values, such as .data([1,2,3,4]). You are passing in strings instead. So, D3 tries to match individual characters of a string (because a string, just like an array, can be iterated over) to the elements of the selection. In this case there's already one element, so it will assign to it the __data__ property equal to the first character of the string. The rest of the characters will go to the enter selection.
As Lars Kotthoff mentioned in his comment, you shouldn't be using for loops when working with D3. Instead, try something like this:
svg.selectAll('circle') // empty (yet) selection of circles
  .data(node) // apply data to the empty selection, where node is your array of strings
  .enter() // same as "for all entering (new) elements... "
    .append('circle') // creates as many circles as there are elements in node array
    .attr('cx', function (d, i) {
        // d is "Hello...", "foobarbaz", "This is a short text", etc.
        // i is 0, 1, 2, 3
        return 100 * i + 250; // dynamic, index-dependent x
    })
    .attr('cy', 100) // constant y value across all elements
    .on('mouseover', function (d) {
      console.log(d);
    });


text:
Q: What is the best data structure for an emission probability table? For my project I have a dataset of words(e.g. dog, ran, cat) and each word is tagged with a part of speech (e.g. verb, noun, adjective). I need to create a data structure which stores the totals that each word will be a certain part of speech. I am currently using a 3d array, with a word being the first element in each array, and then the parts of speech coming afterward, with the total number of instances following each respective pos. Here is an example below.
emissiontable = [[Fight, [Verb, 100], [Noun, 120]], [Run,[Verb,100],[Noun,120]]]

This just seems very tedious and there's probably a better way to do it. And especially since I will have to convert each of the totals to probabilities(probability that x word is an x part of speech). This is also called an emission probability table. Is there a better data structure for this?

A: I would use dictionaries instead
https://www.w3schools.com/python/python_dictionaries.asp


text:
Q: Make all lowercase letters capital in font file I have a .ttf font file I created. I got all the capital characters, but not the lowercase. Is there a tool or easy way I could make all the lowercase letters the same as capital?
Example: The font should display "hello" as  "HELLO"
If that is not possible is there a way I can do this with HTML/CSS?

A: Sure, you can add CSS rule:
body {
    text-transform: uppercase;
}

@DominatorX According to your answer, you can try something like this:
var allDomElems = $('body *'),
    helper;

allDomElems.each(function () {
    helper = $(this).text();
    helper = helper.toUpperCase();
    if($(this).children().length === 0) {
        $(this).text(helper);
    }
});

This doesn't work in all cases, so you'll have to debug the script.

A: I am unsure how to convert cases in HTML, CSS, or font files. There is a method in JavaScript that can convert strings though.
("string").toUpperCase(/*Enter substring value, by default it converts the whole string*/);

A similar method is used for "lowercasing":
("string").toLowerCase();
You could input the HTML content into JavaScript to convert the cases, then document.write them back out onto the page.


text:
Q: Open, closed or connected subsets in $\mathbb{R}$ Given that $(\mathbb{R}, |\cdot|)$ is a metric space, consider the following subsets of $\mathbb{R}$:
(a) $\{(-1)^n(\frac{n + 1}{n})\}$
(b) $\cup_{n \in \mathbb{N}} [n, \frac{n^2 + 1}{n}]$
(c) $\cup_{n \in \mathbb{N}} [\frac{1}{2^{n+1}}, \frac{1}{2^{n}}]$
(d) $\mathbb{Q}$
(e) $\mathbb{Q} \cap [0, 1]$
For each subset above, determine if they are open, closed, or not open and not closed, connected or not connected. Then, give the set of accumulation points for each of them. Don't forget to justify your answers.
My attempt:
(a) Closed. Not connected.
(b) Unsure.
(c) Unsure.
(d) Neither open nor closed. Not connected.
(e) Neither open nor closed. Not connected.
I am preparing for an exam and this problem was part of a practice set but there are no solutions available. Any assistance with a solution, preferably with an explanation, is much appreciated.
Edit: $\mathbb{N}$ in this case, does not include $0$.

A: (a) $n$ usually denotes an integer.  If so, you have a totally disconnected set.  EDIT: Wrong here: "You are right that it is closed.  It has one accumulation point, can you see it?"  There are actually two accumulation points, and they are not in the set, therefore it is not closed.  Thanks to those who pointed that out.
To help see this, list the first several terms: $-2/1, 3/2, -4/3, 5/4, -6/5, 7/6, -8/7, 9/8, ...$. The odd terms are all negative: $-2, -4/3, -6/5, -8/7, -10/9...$ and approach $-1$.  Meanwhile the even terms are all positive: $3/2, 5/4, 7/6, 9/8...$ and approach $1$.
(b) actually makes no sense, as all the sets are empty except the first, which is $[1,2]$.  If that is what it actually says, then work with the interval $[1,2]$.  EDIT: Now that the intervals are defined more clearly, $[n, n+ 1/n]$ is a set of disjoint intervals, closed but not connected.
For a closed interval, every point in it is an accumulation point, and the same is true for this union of closed intervals.
(c) This one is $[1/4, 1/2] \cup [1/8, 1/4] \cup ... $. Sketch this out if you need to to see whether it is connected.  The union forms the interval (0, 1/2]. So every point in the set, and 0 as well, are accumulation points.
(d) and (e) you have correct.  Remember the definition of the reals when looking for accumulation points.


text:
Q: While loop menu never ends I'm trying to do a menu, it's so easy but I don't understand why never ends my loop, I attach my code:
def main():
    menu_bool = False
    while(menu_bool == False):
        print("Menu:\n\t1. Copiar")
        x = input()
        if x == 1:
            print("You have selected option 1.")
            menu_bool = True

# Ejecutamos la función main
if __name__ == '__main__':
    main()

Why when I press "1" ask me again to choose an option? I have declared a boolean variable for stop it, menu_bool = True, but I don't know why my main function is in loop.
I try it doing a global variable but it don't works too. Then this means that my menu_bool = True is never done but I don't understand why.
menu_bool = False
def main():
    global menu_bool
    while(menu_bool == False):
        print("Menu:\n\t1. Copiar")
        x = input()
        if x == 1:
            print("You have selected option 1.")
            menu_bool = True

# Ejecutamos la función main
if __name__ == '__main__':
    main()

Thank you so much!

A: As others have said, basically you are comparing strings with ints. Also I'd suggest being a bit more pythony with bools, in this case using not instead of comparing explicitly via comparison operator.
def main():
    menu_bool = False
    while(not menu_bool):
        print("Menu:\n\t1. Copiar")
        x = input()
        if x == '1':
            print("You have selected option 1.")
            menu_bool = True


text:
Q: How to remove In[ ] and Out[ ] cell tags in a Jupyterlab notebook? I'd like a simple way to hide all the cell tags in my notebook, that is, things of the form In[..] and Out[..].

The reason being that they up a lot of the margin and are not useful to me (also they make the git history messy)!
Of course, I would like to keep line numbering within each code cell, so I have set 'lineNumbers':true in my config:

Is there another field I can use to set this, like 'in_out_prompts':false? Perhaps from some other extension? It would be great to at the very least remove the numbers inside the In and Out tag brackets.
Related:

*

*This reddit question

*Docs for jupyter

A: Jupyter lab doesn't follow the custom css that IPython/Jupyter used to. So the previous approaches may not work. But you can still customize the themes.
Based on how and where you install jupyter there will be themes folder
So in my case it was at below path

~/.virtualenvs/jlab/share/jupyter/lab/themes/@jupyterlab/theme-dark-extension/fonts.css

in this file I just added
.jp-InputArea-prompt {
   display: none;
}

And got the desired result

Edit-1: 11 Apr 2018
As per feedback from OP, doing this disables drag and drop. This is because the drag is controlled by the margin that we have hidden. So to fix the same we need few things

*

*Hide the text but not element

*Lower the width so drag can work

For the same you can use below css
.jp-InputArea-prompt {
     flex: none;
     width: 10px;
     text-indent: 100%;
 }


text:
Q: How to 'freeze' my running tensorflow with cuda installation Using the tag [tensorflow], there are plenty of problems on this page from people who try to get their installation running.
I managed to install tensorflow with a GPU backend using this installation (note, the versions are outdated by now)
https://www.pytorials.com/how-to-install-tensorflow-gpu-with-cuda-10-0-for-python-on-ubuntu/
After a few updates, the GPU backend stopped running for tensorflow.
If I manage to get it to work again, what can I do to stop the packages from updating until they are not compatible any more? Generally, I'd like my system to update, but not the nvidia/cuda/tensorflow part.

A: If there are specific packages that you would like apt to not update, you can "hold" them:
sudo apt-mark hold <packagename>

This will allow all other updates to be performed as normal. If you decide to update the software in the future, you can "unhold" the package like this:
apt-mark unhold <packagename>

Be aware that there is a possibility that holding a package for too long (several years) can result in warning messages when updating software that relies on newer versions of that package.


text:
Q: Get a previous date based on a future date using Javascript Ideally what i would like to do is take an input field attach a datepicker to it have someone pick a future date in time for example. [today is 08/09/2013 at the time of writing this and get 07/31/2013 in return.]
I want for no matter what date is picked, the input field using javascript, will always default the value to the Wednesday prior to the week in-which was the initial selected date value.
function getWednesday(date) {
    var d = (date.getDay() == 0 ? 6 : date.getDay() - 3);
    date.setTime(date.getTime() - (d * 24 * 60 * 60 * 1000));
    return date;
}

This will only return the Wednesday of the current week. My understanding of the javascript functions getDay will only return 0-6 representing sun-sat. setTime function takes a string of milliseconds since January 1, 1970 and convert to a actual date in time and getTime does the exact opposite. I'm not sure im taking the right approch to have a solid solution to the problem. Thanks in Advance for any help

A: Ok, here's the most clever way I can think of:
function prevWed(inDate){
  var adder=(3-inDate.getDay());
  var d=new Date(inDate.getFullYear(), inDate.getMonth(), inDate.getDate() + adder - 7);
  return d
}

even smaller:
return new Date(inDate.getFullYear(), inDate.getMonth(), inDate.getDate() + (3-inDate.getDay()) - 7);

Will this work?

A: You can tweak your function to include this:
function getWednesday(date) {
    var d = (date.getDay() == 0 ? 6 : date.getDay() - 3);
    date.setTime(date.getTime() - (d * 24 * 60 * 60 * 1000));
    return new Date(date.getFullYear(), date.getMonth(), date.getDate()-7);
}
alert(getWednesday(new Date()));

I think that should work.

A: var date = new Date();
var wednesday = new Date(date.setDate(date.getDate() - ((date.getDay() == 0 ? 7 : date.getDay()) + 4)));

Counts the number of the day of today (5) + the number of days to subtract from last week to get to Wednesday.

A:             var d = date.getDay();
        if (d == 0) {
            date.setTime((date.getTime() - 604800000) + 86400000 * 3);
            return date;
        }
        else if (d == 1) {
            date.setTime((date.getTime() - 604800000) + 86400000 * 2);
            return date;
        }
        else if (d == 2) {
            date.setTime((date.getTime() - 604800000) + 86400000 );
            return date;
        }
        else if (d == 4) {
            date.setTime((date.getTime() - 604800000) - 86400000 );
            return date;
        }
        else if (d == 5) {
            date.setTime((date.getTime() - 604800000) - 86400000 * 2);
            return date;
        }
        else if (d == 6) {
            date.setTime((date.getTime() - 604800000) - 86400000 * 3);
            return date;
        }
        else date.setTime(date.getTime() - 604800000);
        return date;

This actually get the solution i want a bit clunky thought...lol

A: Thats should get you the previous wed of any given date and time
Live Demo
var x = new Date('8/1/2013') ;
var wed ;
for(var i=7 ; i > 0 ; i--){
    var myday = x.getTime() - (i * 24 * 60 * 60 * 1000) ;
    var d = new Date(myday) ;

    if(!!~String(d).indexOf('Wed')) wed = d

}
 console.log(wed) ;


text:
Q: STLPort ambiguous copy constructor in VS2008 with smart pointer class We've written a smart pointer class and have been using it with great success with the built-in Visual Studio STL implementation.
The problem is we've realized our performance bottlenecks are in the STL library in code ported from Linux (where the STL is significantly faster the way we're using it). So I'm trying to link in STLPort to see if it deals with our performance problems.
When using STLPort 5.2.1 however I get very strange build errors related to ambigous copy constructors. I've stripped it down to a 50 line C++ program
#include "stdafx.h"
#include <set>

using namespace std;

template<class T>
class CRefCountPtr
{
public:
    CRefCountPtr(T* pT) : m_T(pT)
    {
    }

    T** operator&()
    {
        return &m_T;
    }

    operator T*() const
    {
        return (T*)m_T;
    }

    bool operator< (T* pT) const
    {
        return m_T < pT;
    }

    T* m_T;
};

class Example
{
    int example;
};

int _tmain(int argc, _TCHAR* argv[])
{

    set< CRefCountPtr<Example> > blah;
    Example ex;
    blah.insert(&ex);

    return 0;
}

The error I get back from VS2008SP1 is
stlport\stl\_tree.h(318) : error C2782: 'void stlp_std::_Copy_Construct(_Tp *,const _Tp &)' : template parameter '_Tp' is ambiguous
        stlport\stl\_construct.h(130) : see declaration of 'stlp_std::_Copy_Construct'
        could be 'CRefCountPtr<T>'
        with
        [
            T=Example
        ]
        or       'Example *'
        .....
        stlport_example.cpp(43) : see reference to class template instantiation 'stlp_std::set<_Key>' being compiled
        with
        [
            _Key=CRefCountPtr<Example>
        ]

I'm kind of stuck at how to proceed here, anybody have any idea what's going on with this one?

A: It's actually your operator& that's causing ambiguity. In g++ the ambiguity is in destruct rather than construct but I assume it's a similar problem.
The compiler tries to take the address of your T to construct/destruct it, and gets back a T** instead of a CRefCountPtr<T>*, causing confusion.
I bet you could create your own specific allocator that knows how to deal with this (aka not a template) and get it to compile.
Probably better long term is to get rid of the operator& as it'll only cause confusion.