Q: How to change data in vue-component In Vue component I have some data that comes from a localStorage.
if (localStorage.getItem("user") !== null) {
  const obj_user = localStorage.getItem('user');
  var user = JSON.parse(obj_user);
} else {
  user = null;
}
return {
  user
}

After in this component I have to check this data. I do it like this

Login

    {{user.name}}

But the data does not change immediately, but only after the page is reloaded. Right after I login in on the page and redirected the user to another page, I still see the Login link.
What am I doing wrong?
Maybe there is some other way how to check and output data from the localstorage in component?
Thank you in advance.

A: It looks like the issue may be related to they way that your user variable is not a piece of reactive stateful data. There isn't quite enough code in your question for us to determine that for sure, but it looks like you are close to grasping the right way to do it in Vue.
I think my solution would be something like this...
export default {
  data() {
    return {
      user: null,
    }
  },
  methods: {
    loadUser() {
      let user = null;
      if (localStorage.getItem("user")) {
        const obj_user = localStorage.getItem("user");
        user = JSON.parse(obj_user);
      }
      this.user = user;
    }
  },
  created() {
    this.loadUser();
  }
}

I save the user in the data area so that the template will react to it when the value changes.
The loadUser method is separated so that it can be called from different places, like from a user login event, however I'm making sure to call it from the component's created event.
In reality, I would tend to put the user into a Vuex store and the loadUser method in an action so that it could be more globally available.


Q: Using TikZ circuits library and CircuiTikZ in the same document After some pocking around, I found some solution to use tikz libraries in the same document as circuitkz package. Or thought I did.
I like the visuals of tikz logic (and the ability to have multi-input logic gates) and the transistors in circuitikz.
I tried the above mentioned solution and it works when doing this:
 \documentclass{article}

 \usepackage{circuitikz}
 \usepackage{tikz}

 \begin{document}

 \begin{figure}[htbp]
      \centering
      \begingroup
      \usetikzlibrary{circuits.logic.US}
      \usetikzlibrary{circuits.ee.IEC}
      \begin{tikzpicture}[circuit logic US, circuit ee IEC, huge circuit symbols, set resistor graphic = var resistor IEC graphic]
           \matrix[column sep=10mm, row sep=10mm,anchor=center]
           {
                \node [not gate] (not1) {}; \\
                \node [not gate] (not2) {}; \\
           };

           \node (a) at ([xshift=-25mm]not1.input) {$V_{in}^+$};
           \node [contact] (a1) at ([xshift=-10mm]not1.input) {};

           \node (b) at ([xshift=-25mm]not2.input) {$V_{in}^-$};
           \node [contact] (b1) at ([xshift=-10mm]not2.input) {};

           \node (x) at ([xshift=25mm]not1.output) {$V_{out}^-$};
           \node [contact] (x1) at ([xshift=10mm]not1.output) {};

           \node (z) at ([xshift=25mm]not2.output) {$V_{out}^+$};
           \node [contact] (z1) at ([xshift=10mm]not2.output) {};

           \node (en) at ([xshift=-30mm]$(not1.south)!0.5!(not2.north)$) {$EN$};
           \node [contact] (en1) at ($(not1.south)!0.5!(not2.north)$) {};

           \draw (en1.center) -- (not1.south) node[below right] (ennot1) {$E$};
           \draw (en1.center) -- (not2.north) node[above right] (ennot2) {$E$};

           \node [resistor={info'={$R$}}] (res1) at ([xshift=2mm, yshift=10mm]not1.north){};
           \node [resistor={info={$R$}}] (res2) at ([xshift=2mm, yshift=-10mm]not2.south){};

           \draw (a.east) -- (a1.center);
           \draw (a1.center) |- (res1.input);
           \draw (a1.center) -- (not1.input);

           \draw (b.east) -- (b1.center);
           \draw (b1.center) |- (res2.input);
           \draw (b1.center) -- (not2.input);

           \draw (en.east) -- (en1.center);

           \draw (not1.output) -- (x1.center);
           \draw (x1.center) |- (res1.output);
           \draw (x1.center) |- (x.west);

           \draw (not2.output) -- (z1.center);
           \draw (z1.center) |- (res2.output);
           \draw (z1.center) |- (z.west);

      \end{tikzpicture}
      \endgroup
      \caption{Some NOT gates with enable and resistors.}
 \end{figure}

 \begin{figure}[htbp]
      \begin{center}
           \begin{circuitikz}[scale=0.7, transform shape]
                \draw[thick,->] (0,0.5) --(1,0.5) node[anchor=south east] {$i(x,t)$};
                \node[] at (0,-1) {$v(x,t)$};
                \draw
                (0,0) node[anchor=east] {+}
                     to[short, o-] (1,0)
                     to[R=$Rx$] (3,0)
                     to[L=$Lx$] (5,0)
                (5,-2) to[R=$Gx$, *-*] (5,0)
                (5,0) to[short] (7,0)
                (7,-2) to[C=$Cx$, *-*] (7,0)
                (5,-2) to[short] (7,-2)
                (0,-2) node[anchor=east]{-}
                     to[short, o-] (5,-2)
                (9,0) node[anchor=west]{+}
                     to[short, o-] (7,0)
                (9,-2) node[anchor=west]{-}
                     to[short, o-] (7,-2)
                ;
                \draw[thick,->] (7,0.5) --(9,0.5) node[anchor=south east] {$i(x+ x,t)$};
                \node[] at (9,-1) {$v(x+ x,t)$};
           \end{circuitikz}
           \caption{Infinitesimal section of a transmission line.}
           \label{fig:transmission_line_section}
      \end{center}
 \end{figure}

 \end{document}

But, if I try to add another figure with tikzpicture, it exits out with errors. For example:
 \documentclass{article}

 \usepackage{circuitikz}
 \usepackage{tikz}

 \begin{document}

 \begin{figure}[htbp]
      \centering
      \begingroup
      \usetikzlibrary{circuits.logic.US}
      \usetikzlibrary{circuits.ee.IEC}
      \begin{tikzpicture}[circuit logic US, circuit ee IEC, huge circuit symbols, set resistor graphic = var resistor IEC graphic]
           \matrix[column sep=10mm, row sep=10mm,anchor=center]
           {
                \node [not gate] (not1) {}; \\
                \node [not gate] (not2) {}; \\
           };

           \node (a) at ([xshift=-25mm]not1.input) {$V_{in}^+$};
           \node [contact] (a1) at ([xshift=-10mm]not1.input) {};

           \node (b) at ([xshift=-25mm]not2.input) {$V_{in}^-$};
           \node [contact] (b1) at ([xshift=-10mm]not2.input) {};

           \node (x) at ([xshift=25mm]not1.output) {$V_{out}^-$};
           \node [contact] (x1) at ([xshift=10mm]not1.output) {};

           \node (z) at ([xshift=25mm]not2.output) {$V_{out}^+$};
           \node [contact] (z1) at ([xshift=10mm]not2.output) {};

           \node (en) at ([xshift=-30mm]$(not1.south)!0.5!(not2.north)$) {$EN$};
           \node [contact] (en1) at ($(not1.south)!0.5!(not2.north)$) {};

           \draw (en1.center) -- (not1.south) node[below right] (ennot1) {$E$};
           \draw (en1.center) -- (not2.north) node[above right] (ennot2) {$E$};

           \node [resistor={info'={$R$}}] (res1) at ([xshift=2mm, yshift=10mm]not1.north){};
           \node [resistor={info={$R$}}] (res2) at ([xshift=2mm, yshift=-10mm]not2.south){};

           \draw (a.east) -- (a1.center);
           \draw (a1.center) |- (res1.input);
           \draw (a1.center) -- (not1.input);

           \draw (b.east) -- (b1.center);
           \draw (b1.center) |- (res2.input);
           \draw (b1.center) -- (not2.input);

           \draw (en.east) -- (en1.center);

           \draw (not1.output) -- (x1.center);
           \draw (x1.center) |- (res1.output);
           \draw (x1.center) |- (x.west);

           \draw (not2.output) -- (z1.center);
           \draw (z1.center) |- (res2.output);
           \draw (z1.center) |- (z.west);

      \end{tikzpicture}
      \endgroup
      \caption{Some NOT gates with enable and resistors.}
 \end{figure}

 \begin{figure}[htbp]
      \centering
      \begingroup
      \usetikzlibrary{circuits.logic.US}
      \usetikzlibrary{circuits.ee.IEC}
      \begin{tikzpicture}[circuit logic US, circuit ee IEC, huge circuit symbols, set resistor graphic = var resistor IEC graphic]
           \matrix[column sep=10mm, row sep=10mm,anchor=center]
           {
                \node [not gate] (not1) {}; \\
                \node [not gate] (not2) {}; \\
           };

           \node (a) at ([xshift=-25mm]not1.input) {$V_{in}^+$};
           \node [contact] (a1) at ([xshift=-10mm]not1.input) {};

           \node (b) at ([xshift=-25mm]not2.input) {$V_{in}^-$};
           \node [contact] (b1) at ([xshift=-10mm]not2.input) {};

           \node (x) at ([xshift=25mm]not1.output) {$V_{out}^-$};
           \node [contact] (x1) at ([xshift=10mm]not1.output) {};

           \node (z) at ([xshift=25mm]not2.output) {$V_{out}^+$};
           \node [contact] (z1) at ([xshift=10mm]not2.output) {};

           \node (en) at ([xshift=-30mm]$(not1.south)!0.5!(not2.north)$) {$EN$};
           \node [contact] (en1) at ($(not1.south)!0.5!(not2.north)$) {};

           \draw (en1.center) -- (not1.south) node[below right] (ennot1) {$E$};
           \draw (en1.center) -- (not2.north) node[above right] (ennot2) {$E$};

           \node [resistor={info'={$R$}}] (res1) at ([xshift=2mm, yshift=10mm]not1.north){};
           \node [resistor={info={$R$}}] (res2) at ([xshift=2mm, yshift=-10mm]not2.south){};

           \draw (a.east) -- (a1.center);
           \draw (a1.center) |- (res1.input);
           \draw (a1.center) -- (not1.input);

           \draw (b.east) -- (b1.center);
           \draw (b1.center) |- (res2.input);
           \draw (b1.center) -- (not2.input);

           \draw (en.east) -- (en1.center);

           \draw (not1.output) -- (x1.center);
           \draw (x1.center) |- (res1.output);
           \draw (x1.center) |- (x.west);

           \draw (not2.output) -- (z1.center);
           \draw (z1.center) |- (res2.output);
           \draw (z1.center) |- (z.west);

      \end{tikzpicture}
      \endgroup
      \caption{Some NOT gates with enable and resistors.}
 \end{figure}

 \begin{figure}[htbp]
      \begin{center}
           \begin{circuitikz}[scale=0.7, transform shape]
                \draw[thick,->] (0,0.5) --(1,0.5) node[anchor=south east] {$i(x,t)$};
                \node[] at (0,-1) {$v(x,t)$};
                \draw
                (0,0) node[anchor=east] {+}
                     to[short, o-] (1,0)
                     to[R=$Rx$] (3,0)
                     to[L=$Lx$] (5,0)
                (5,-2) to[R=$Gx$, *-*] (5,0)
                (5,0) to[short] (7,0)
                (7,-2) to[C=$Cx$, *-*] (7,0)
                (5,-2) to[short] (7,-2)
                (0,-2) node[anchor=east]{-}
                     to[short, o-] (5,-2)
                (9,0) node[anchor=west]{+}
                     to[short, o-] (7,0)
                (9,-2) node[anchor=west]{-}
                     to[short, o-] (7,-2)
                ;
                \draw[thick,->] (7,0.5) --(9,0.5) node[anchor=south east] {$i(x+ x,t)$};
                \node[] at (9,-1) {$v(x+ x,t)$};
           \end{circuitikz}
           \caption{Infinitesimal section of a transmission line.}
           \label{fig:transmission_line_section}
      \end{center}
 \end{figure}

 \end{document}

Am I doing  something wrong? If the libraries are only declared in the group, can't they be declared in another group? Is there a better solution to limiting the scope of the declared libraries?

A: After carefully reading CircuiTikZ's manual, the proper solution is to use the compatilibity package option and leaving TikZ libraries globaly loaded. The only downside is when using CircuiTikZ definifions, one should use an * before it.
For example, this:
\begin{figure}[htbp]
  \begin{center}
       \begin{circuitikz}[scale=0.7, transform shape]
            \draw[thick,->] (0,0.5) --(1,0.5) node[anchor=south east] {$i(x,t)$};
            \node[] at (0,-1) {$v(x,t)$};
            \draw
            (0,0) node[anchor=east] {+}
                 to[short, o-] (1,0)
                 to[R=$Rx$] (3,0)
                 to[L=$Lx$] (5,0)
            (5,-2) to[R=$Gx$, *-*] (5,0)
            (5,0) to[short] (7,0)
            (7,-2) to[C=$Cx$, *-*] (7,0)
            (5,-2) to[short] (7,-2)
            (0,-2) node[anchor=east]{-}
                 to[short, o-] (5,-2)
            (9,0) node[anchor=west]{+}
                 to[short, o-] (7,0)
            (9,-2) node[anchor=west]{-}
                 to[short, o-] (7,-2)
            ;
            \draw[thick,->] (7,0.5) --(9,0.5) node[anchor=south east] {$i(x+ x,t)$};
            \node[] at (9,-1) {$v(x+ x,t)$};
       \end{circuitikz}
       \caption{Infinitesimal section of a transmission line.}
       \label{fig:transmission_line_section}
  \end{center}
\end{figure}

Goes to this, when using the compatibility option:
\begin{figure}[htbp]
  \begin{center}
       \begin{circuitikz}[scale=0.7, transform shape]
            \draw[thick,->] (0,0.5) --(1,0.5) node[anchor=south east] {$i(x,t)$};
            \node[] at (0,-1) {$v(x,t)$};
            \draw
            (0,0) node[anchor=east] {+}
                 to[*short, o-] (1,0)
                 to[*R=$Rx$] (3,0)
                 to[*L=$Lx$] (5,0)
            (5,-2) to[*R=$Gx$, *-*] (5,0)
            (5,0) to[*short] (7,0)
            (7,-2) to[*C=$Cx$, *-*] (7,0)
            (5,-2) to[*short] (7,-2)
            (0,-2) node[anchor=east]{-}
                 to[*short, o-] (5,-2)
            (9,0) node[anchor=west]{+}
                 to[*short, o-] (7,0)
            (9,-2) node[anchor=west]{-}
                 to[*short, o-] (7,-2)
            ;
            \draw[thick,->] (7,0.5) --(9,0.5) node[anchor=south east] {$i(x+ x,t)$};
            \node[] at (9,-1) {$v(x+ x,t)$};
       \end{circuitikz}
       \caption{Infinitesimal section of a transmission line.}
       \label{fig:transmission_line_section}
  \end{center}
\end{figure}

A: It can be done, but it is still a kludge.
Evidently, loading the libraries makes some global changes which are not removed at the end of the group.  You can however create all your mixed circuits at one time and store them (globally) in saveboxes.
You might try using externalize, or just create the images using standalone.  The best solution would be to copy the source for the TikZ components desired and rename them for use in circuitikz.
 \documentclass{article}

 \usepackage{circuitikz}
 \usepackage{tikz}

\newsavebox{\figA}
\newsavebox{\figB}

\begin{document}

\begingroup
      \usetikzlibrary{circuits.logic.US}
      \usetikzlibrary{circuits.ee.IEC}
      \global\setbox\figA=\hbox{%
      \begin{tikzpicture}[circuit logic US, circuit ee IEC, huge circuit symbols, set resistor graphic = var resistor IEC graphic]
           \matrix[column sep=10mm, row sep=10mm,anchor=center]
           {
                \node [not gate] (not1) {}; \\
                \node [not gate] (not2) {}; \\
           };

           \node (a) at ([xshift=-25mm]not1.input) {$V_{in}^+$};
           \node [contact] (a1) at ([xshift=-10mm]not1.input) {};

           \node (b) at ([xshift=-25mm]not2.input) {$V_{in}^-$};
           \node [contact] (b1) at ([xshift=-10mm]not2.input) {};

           \node (x) at ([xshift=25mm]not1.output) {$V_{out}^-$};
           \node [contact] (x1) at ([xshift=10mm]not1.output) {};

           \node (z) at ([xshift=25mm]not2.output) {$V_{out}^+$};
           \node [contact] (z1) at ([xshift=10mm]not2.output) {};

           \node (en) at ([xshift=-30mm]$(not1.south)!0.5!(not2.north)$) {$EN$};
           \node [contact] (en1) at ($(not1.south)!0.5!(not2.north)$) {};

           \draw (en1.center) -- (not1.south) node[below right] (ennot1) {$E$};
           \draw (en1.center) -- (not2.north) node[above right] (ennot2) {$E$};

           \node [resistor={info'={$R$}}] (res1) at ([xshift=2mm, yshift=10mm]not1.north){};
           \node [resistor={info={$R$}}] (res2) at ([xshift=2mm, yshift=-10mm]not2.south){};

           \draw (a.east) -- (a1.center);
           \draw (a1.center) |- (res1.input);
           \draw (a1.center) -- (not1.input);

           \draw (b.east) -- (b1.center);
           \draw (b1.center) |- (res2.input);
           \draw (b1.center) -- (not2.input);

           \draw (en.east) -- (en1.center);

           \draw (not1.output) -- (x1.center);
           \draw (x1.center) |- (res1.output);
           \draw (x1.center) |- (x.west);

           \draw (not2.output) -- (z1.center);
           \draw (z1.center) |- (res2.output);
           \draw (z1.center) |- (z.west);

      \end{tikzpicture}}%
      \global\setbox\figB=\hbox{%
      \begin{tikzpicture}[circuit logic US, circuit ee IEC, huge circuit symbols, set resistor graphic = var resistor IEC graphic]
           \matrix[column sep=10mm, row sep=10mm,anchor=center]
           {
                \node [not gate] (not1) {}; \\
                \node [not gate] (not2) {}; \\
           };

           \node (a) at ([xshift=-25mm]not1.input) {$V_{in}^+$};
           \node [contact] (a1) at ([xshift=-10mm]not1.input) {};

           \node (b) at ([xshift=-25mm]not2.input) {$V_{in}^-$};
           \node [contact] (b1) at ([xshift=-10mm]not2.input) {};

           \node (x) at ([xshift=25mm]not1.output) {$V_{out}^-$};
           \node [contact] (x1) at ([xshift=10mm]not1.output) {};

           \node (z) at ([xshift=25mm]not2.output) {$V_{out}^+$};
           \node [contact] (z1) at ([xshift=10mm]not2.output) {};

           \node (en) at ([xshift=-30mm]$(not1.south)!0.5!(not2.north)$) {$EN$};
           \node [contact] (en1) at ($(not1.south)!0.5!(not2.north)$) {};

           \draw (en1.center) -- (not1.south) node[below right] (ennot1) {$E$};
           \draw (en1.center) -- (not2.north) node[above right] (ennot2) {$E$};

           \node [resistor={info'={$R$}}] (res1) at ([xshift=2mm, yshift=10mm]not1.north){};
           \node [resistor={info={$R$}}] (res2) at ([xshift=2mm, yshift=-10mm]not2.south){};

           \draw (a.east) -- (a1.center);
           \draw (a1.center) |- (res1.input);
           \draw (a1.center) -- (not1.input);

           \draw (b.east) -- (b1.center);
           \draw (b1.center) |- (res2.input);
           \draw (b1.center) -- (not2.input);

           \draw (en.east) -- (en1.center);

           \draw (not1.output) -- (x1.center);
           \draw (x1.center) |- (res1.output);
           \draw (x1.center) |- (x.west);

           \draw (not2.output) -- (z1.center);
           \draw (z1.center) |- (res2.output);
           \draw (z1.center) |- (z.west);

      \end{tikzpicture}}
 \endgroup

 \begin{figure}[htbp]
      \centering
      \usebox{\figA}
      \caption{Some NOT gates with enable and resistors.}
 \end{figure}

 \begin{figure}[htbp]
      \centering
      \usebox{\figB}
      \caption{Some NOT gates with enable and resistors.}
 \end{figure}

 \begin{figure}[htbp]
      \begin{center}
           \begin{circuitikz}[scale=0.7, transform shape]
                \draw[thick,->] (0,0.5) --(1,0.5) node[anchor=south east] {$i(x,t)$};
                \node[] at (0,-1) {$v(x,t)$};
                \draw
                (0,0) node[anchor=east] {+}
                     to[short, o-] (1,0)
                     to[R=$Rx$] (3,0)
                     to[L=$Lx$] (5,0)
                (5,-2) to[R=$Gx$, *-*] (5,0)
                (5,0) to[short] (7,0)
                (7,-2) to[C=$Cx$, *-*] (7,0)
                (5,-2) to[short] (7,-2)
                (0,-2) node[anchor=east]{-}
                     to[short, o-] (5,-2)
                (9,0) node[anchor=west]{+}
                     to[short, o-] (7,0)
                (9,-2) node[anchor=west]{-}
                     to[short, o-] (7,-2)
                ;
                \draw[thick,->] (7,0.5) --(9,0.5) node[anchor=south east] {$i(x+ x,t)$};
                \node[] at (9,-1) {$v(x+ x,t)$};
           \end{circuitikz}
           \caption{Infinitesimal section of a transmission line.}
           \label{fig:transmission_line_section}
      \end{center}
 \end{figure}

 \end{document}


Q: dropdown button not working on looping it in Angular I am working in Angular ,

*

*Where I have created a tree based structure

*on going down to tree structure there is a dropdown button name
"Dropdown"

*Problem is on clicking to  "Dropdown" button dropdown is not working .
Kindly check I am putting stackblitz link below for the code
https://stackblitz.com/edit/angular-tree-un?file=src%2Fapp%2Fapp.component.html

A: I made some changes please see whether it's as per your expected output or not.
Ts file
myFunction(value) {
console.log(value);
if (value == 1) {
  this.availableBtn = !this.availableBtn;
}

if (value == 2) {
  this.vaccanttoggle = !this.vaccanttoggle;
 }
}

HTML  File

Link 1
Link 2
Link 3

seems like there is problem with class="dropdown-content". remove it and try.


Q: Alter the Main WP_Comment_Query (comments at the bottom of posts)? My plugin retrieves a few comments at the beginning of the post through my own WP_Comment_Query. I save these IDs so I can then alter the WP_Comment_Query request and not fetch these IDs.
When I use the pre_get_comments hook to hide these already-fetched IDs, they are also hidden from my first query at the beginning of each post. It defies the point.
$this->loader->add_action( 'pre_get_comments', $plugin_public, 'hide_the_comments' );

public function hide_the_comments( $comment_query ) {

    $comment_query->query_vars['comment__not_in'] = $the_ids_to_hide;
}

How can we target the bottom request only, just like there is is_main_query() for the post loop?

A: *

*Create a private variable, eg private $count = 0;

*Increment it each time your function is run

*Don't hide the comments if it's the first time you're running it :)

A: If you need to target the "main" WP_Query_Comments() within the comments_template() core function, then the  comments_template_query_args  filter is available since WordPress 4.5:
$comment_args = apply_filters( 'comments_template_query_args', $comment_args );
$comment_query = new WP_Comment_Query( $comment_args );

See ticket #34442 for more info and a simple example here.


Q: Error with jekyll-sitemap when run rake generate to user jekyll with octopuses I am building a blog with octopuses and Jekyll on GitHub with Mac OSX and I followed every step on the octopuses website. Error with sitemap occurred when I run rake generate.
## Generating Site with Jekyll
identical source/stylesheets/screen.css
Configuration file: /Users/WangWei/Documents/GitHubPage/octopress/_config.yml
            Source: source
       Destination: public
      Generating...
Error reading file /Library/Ruby/Gems/2.0.0/gems/jekyll-sitemap-0.6.1/lib/sitemap.xml: No such    file or directory -   /Users/WangWei/Documents/GitHubPage/octopress/source/Library/Ruby/Gems/2.0.0/gems/jekyll-sitemap-0.6.1/lib/sitemap.xml

Any one can help?

A: This is a bug of jekyll-sitemap and it has already been fixed. You can upgrade jekyll-sitemap to v0.6.2 and everything will be ok. https://github.com/jekyll/jekyll-sitemap/issues/54


Q: curl https inside docker return: unable to get local issuer certificate I have a problem with cURL inside docker container jenkins-slave, when execute curl inside container get this error:
curl https://mytool.domain.com
curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here: https://curl.haxx.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.

*

*I have installed ca-certificate trough package manager

*added certificate.cer to /usr/local/share/ca-certificate

*executed command "update-ca-certificates"

I have tried to run curl with :
curl --cert certificate.cer https://mytool.domain.com, but get same error
whats wrong?
NB: outside container ssl work and no error is retrived


Q: Walking Core Data graph to-many relationships always seems awkward, is there a better way? I'm able to get things working fine with Core Data and to achieve my desired results, but I always feel it very awkward when walking to-many relationships because NSSet is, for my typical purposes, fairly useless.
An example is if I have obtained a NSManagedObject of Entity "Zoo" with attribute "nameOfZoo" and to-many relationship "animalCages", the to-many relationship pointing to Entity "AnimalCage" which has attribute "nameOfSpecies" and to-many relationship pointing to Entity "IndividualAnimal"
Zoo [nameOfZoo] ->> AnimalCage [nameOfSpecies] ->> Animals
So, getting the top level Zoo object, that's simple.  But then I want to get the data for nameOfSpecies "Canus Lupus".  The code I want to write is this:

// Normal NSEntityRequest or whichever it is, I have no gripe with this
NSManagedObject *zoo = ..the request to get the one Zoo..;

// I want to get the object where the key "nameOfSpecies" is set to "CanusLupus"
NSManagedObject *wolf = [[zoo animalCages] object:@"Canus Lupus" forKey:@"nameOfSpecies"];

Obviously, I can't obtain wolf in this manner.  Instead, I have to write like 10 lines of code (feels like 100 lines of code) to first obtain the set, then set up a search predicate request, and declare an error variable, execute the request, then get an array of the results, then get the first element of that array..  and if I want to walk further down the tree, to find the animal named "Wolfy" for instance, then I have to do it all over again.
Am I doing things correctly or am I foolishly an easier way?  I guess I can put a category on NSSet, maybe I will, but I feel like there should be a built in better way.  If not, why?

A: If you have a data model like this:
Zoo{
  name:string
  animalCages<-->>AnimalCage.zoo
}

AnimalCage{
  nameOfSpecies:string
  zoo<<-->Zoo.animalCages
  animals<-->>Animal.animalCage
}

Animal{
  name:string
  animalCage<<-->AnimalCage.animals
}

The to find a specific AnimalCage by name of species for a given Zoo object:
  NSString *soughtSpecies=@"Canis Lupis"; // normally this variable would be passed in to the method
  NSPredicate *p=[NSPredicate predicateWithFormat:@"nameOfSpecies==%@", soughtSpecies];
  NSSet *wolves=[[zoo animalCages] filteredSetUsingPredicate:p];

Or you can use objectPassingTest: if you like blocks.
If you use custom NSManagedObject subclasses, then you get custom accessor methods and can use self.dot notation so the above would be:
  Zoo *zoo= // fetch the appropriate zoo object
  NSString *soughtSpecies=@"Canis Lupis";
  NSPredicate *p=[NSPredicate predicateWithFormat:@"nameOfSpecies==%@", soughtSpecies];
  NSSet *wolves=[zoo.animalCages filteredSetUsingPredicate:p];

If you know before hand that you are going to have to find cages a lot, you could wrap the above up in a method on your Zoo class e.g.
@implementation Zoo
//... other stuff
-(AnimalCage *) cageForSpecieNamed:(NSString *) specieName{
  NSPredicate *p=[NSPredicate predicateWithFormat:@"nameOfSpecies==%@", specieName];
  NSSet *wolves=[self.animalCages filteredSetUsingPredicate:p];
  return [wolves anyObject]; // assuming one cage per species
}

Objective-c is intentionally verbose because it was supposed to be "self documenting" and the editor written for the language at the beginning had autocomplete. So, if your used to a more expressive language it might seem you are doing a lot of work but logically you aren't.


Q: How to concatenate the data on one line instead of two? I spend a lot of time at the office manually combining latitudes and longitudes to paste into a program that locates our customers and sets up for repairs.
As an example... I copy this from the customers information page:
43.481075
CPE LON
-84.787613

I then manually modify it to look like:
43.481075 -84.787613

I'm attempting to come up with some code that will do this for me. the problem I'm encountering is, no matter what I try the latitude and longitude always end up on separate lines
43.481075
-84.787613

I've tried removing vblf,vbcrlf and vbnewline before combining the strings "lat" and  "lon". I've tried using lat & lon,   lat + lon, latlon = String.Concat(lat, " ", lon) and in my last attempt, I used stringbuilder to try and concatenate. It always gives both on separate lines. What am I missing?
Here's my latest version:
Imports System.Text.RegularExpressions
Imports System.Text

Public Class Form1
    Public c As Integer
    Public lastlat As Integer

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        ' Copy string to format from clipboard
        Dim strClipText As String = Clipboard.GetText

        ' Remove CPE LON from String
        Dim clean As String = strClipText.Replace("CPE LON", "")
        strClipText = clean

        strClipText = Replace(strClipText, vbLf, "")
        strClipText = Replace(strClipText, vbCrLf, "")
        strClipText = Replace(strClipText, vbNewLine, "")

        'Get string length
        Dim length As Integer = strClipText.Length

        ' Find minus sign (Start of Longitude)
        For c1 = 1 To length - 1
            Dim cchk As Char = strClipText(c1)
            If cchk = "-" Then
                c = c1
                lastlat = c1 - 1
            End If
        Next

        Dim lastc As Integer = length - 1
        Dim cchk1 As String = strClipText(lastc)
        Dim lat As String = strClipText.Substring(0, lastlat)
        Dim lon As String
        Dim lon1 As String
        For curc = c To lastc
            lon1 = strClipText(c)
            lon = lon & lon1
            c = c + 1
        Next

        Dim builder As StringBuilder = New StringBuilder(lat)
        Dim llen As Integer = lat.Length
        builder.Insert(llen, lon)
        Dim latlon As String = builder.ToString()

        Clipboard.Clear()
        My.Computer.Clipboard.SetText(latlon)
    End Sub
End Class

A: It sounds like you're doing a lot of work manipulating the string that's causing you bugs. I think it would be easier to go with Regex to solve this.
Try this code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    ' Copy string to format from clipboard
    Dim strClipText As String = Clipboard.GetText
    Dim regex = New Regex("-{0,1}\d+(\.\d+|)")
    Dim latlon = String.Join(" ", regex.Matches(strClipText).OfType(Of Match)().Select(Function(m) m.Value))
    Clipboard.Clear()
    My.Computer.Clipboard.SetText(latlon)
End Sub

A: Please notice that you're never replacing the carriage return.
Don't forget that these constants turn into actual ASCII characters or combinations of ASCII characters

*

*vbCr == Chr(13)

*vbLf == Chr(10)

*vbCrLf == Chr(13) + Char(10)

*vbNewLine == Chr(13) + Char(10)

Now, in your code, you're doing this:
strClipText = Replace(strClipText, vbLf, "")
strClipText = Replace(strClipText, vbCrLf, "")
strClipText = Replace(strClipText, vbNewLine, "")

Which does these three things:

*

*Replace Chr(10) with an empty string

*Replace Chr(13)+Char(10) with an empty string

*Replace Chr(13)+Char(10) with an empty string

Thus, you're never getting rid of the Chr(13) which will sometimes show as a new line. Because, even if the lines begin life as Char(13) + Char(10) (vbCrLf) when you replace vbLf with an empty string, you're breaking up the Char(13) + Char(10).
Do something like this instead:
strClipText = Replace(strClipText, vbCrLf, "")
strClipText = Replace(strClipText, vbNewLine, "")
strClipText = Replace(strClipText, vbCR, "")
strClipText = Replace(strClipText, vbLf, "")


Q: Updating a joined table PHP MySQL In MySQL I know its possible to select from two tables that have been joined, but is it possible to update the same two tables using a join? Or will I have to update each table individually?

A: Yes, e.g.
UPDATE table1 t1
JOIN table2 t2
    ON t2.id = t1.id -- Your keys.
SET t1.column = '...', t2.column = '...' -- Your Updates
WHERE ... -- Your conditional


Q: Burger Menu Drop Down Navbar background colour First of all, I have not coded properly in around nine years, so I'm trying to re-learn from scratch pretty much.
I'm having an issue with the background colour of a drop down menu from a burger menu. The burger menu appears when you minimise the screen. I want the background to be white when you click the burger menu but instead it's coming out a dark grey.
In Codepen it is fine, the background is white. However, on my laptop in all the folders it comes out dark grey. So, I've uploaded the code onto Code Pen and all my folders to Github for folk to try and find the discrepancy which I've been really struggling to spot and understand.
enter code herehttps://codepen.io/cmc89/pen/RwoYZRR)
GitHub: https://github.com/cmc1989/website-toggle.git
<!DOCTYPE html>

    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
    <link rel="stylesheet" type="text/css" href="css/style.css"/>

    <title>Website</title>

            Artwork

            Programming

            Writing

            Talking

            Production

            CV

            About

A Feeling for the Organism (2020)

Organs (2020)

Private Lives (2019)

these were the things that made the step familiar (2019)

A Strange American Funeral (2019)

Handwave (2019)

playback (2018)

correct (2017)

Magnificent Beach

© 2020 Website

CSS:
   * {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    height: 100%;
    background-color:#ffffff;
}

.p1 {
  font-family: prestige-elite-std, monospace;
  font-weight: bold;
  font-size: 20px;
  font-style: italic;
}

.p2 {
  font-family: prestige-elite-std, monospace;
}

.p3 {
  font-family: TNYAdobeCaslonPro,Times New Roman,Times,serif;
  font-size: 18px;
}

#wrapper{
  background-color:#ccc2c2;
  width: 100%;
  max-width: 1200px;
  position: relative;
  margin: 0 auto;
  padding: 5px 0;
}

.navbar {
    display: flex;
    position: relative;
    justify-content: space-between;
    align-items: center;
    background-color: #ffffff;
    margin: 10px 0 0 0;
}

.logo {
    font-size: 1.5rem;
    margin: .5rem;
}

.navbar-links {
    height: 100%;
}

.navbar-links ul {
    display: flex;
    margin: 0;
    padding: 0;
}

.navbar-links li {
    list-style: none;
    padding: 0 20px 0 20px;
}

.navbar-links li a {
    font-family: vollkorn, serif;
    font-size: 20px;
    display: block;
    text-decoration: none;
    color: #262626;
    padding: 5px;

}

.navbar-links li:hover {

}

.navbar-links ul li .underline {
    height: 3px;
    background-color: transparent;
    width: 0%;
    transition: width 0.8s, background-color 0.5s;
    margin: 0 auto;

}

.navbar-links ul li.active-link .underline {
    width: 100%;
    background-color: #262626;
}

.navbar-links ul li:hover .underline {
    background-color: #262626;
    width: 100%;

}

.navbar-links ul li:hover a {
}

.navbar-links ul li:active a {
    transition: none;
    color: rgba(255,255,255,0.76);
}

.navbar-links ul li:active .underline {
    transition: none;
    background-color: rgba(255,255,255,0.76);
}

.toggle-button {
    position: absolute;
    top: 25px;
    right: 1rem;
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
}

.toggle-button .bar {
    height: 4px;
    width: 100%;
    background-color: #262626;
    border-radius: 10px;
}

@media (max-width: 1028px) {
    .navbar {
        flex-direction: column;
        align-items: flex-start;
        background: #FFFFFF;

    }

    .toggle-button {
        display: flex;
    }

    .navbar-links {
        display: none;
        width: 100%;

    }

    .navbar-links ul {

        flex-direction: column;
        text-align: left;
        width: 40%;
        position:relative;
        left: 35%;
    }

    .navbar-links ul li {
        padding: 10px 0;
        text-align: center;
        width: auto;
    }

    .navbar-links ul li a {
        padding: .5rem 1rem;
        font-family: Arial;

    }

    .navbar-links.active {
        display: flex;

    }
}

#content {
  padding: 5px 0 5px 0 ;
  position: relative;
  overflow: hidden;

}

.container {
  position: relative;
  clear: both;
  width: 100%;
  max-width: 1200px;
  padding: 0;
  overflow: hidden;
  background: #FFFFFF;
}

/* GRID */

.grid-card {
  border: 1px solid #E5E5E5;
  margin-bottom: 20px;
}

.grid-card:hover{
  opacity: 0.7;
}

.grid-card-image {
  max-width: 100%;
 max-height: 100%;

}

.grid-card-content {
  padding: 5px;
}

.grid-card-content h3 {
  margin-top: 0;
  margin-bottom: 0;
  font-size: 13px;
}

.grid-card-content p {
  margin: 0.5em 0;
}

* {
  box-sizing: border-box;
}

/* Grid measurements:
 *
 *   960px wide including 12 gutters (half gutters on both edges)
 *
 *   60px columns (12)
 *   20px gutters (two half-gutters + 11 full gutters, so 12 total)
 *
 *
 *   For smaller screens, we always want 20px of padding on either side,
 *   so 960 + 20 + 20 => 1000px
 *
 **/
.grid-row {
  max-width: 1200px;
  padding-left: 20px;
  padding-right: 20px;
  margin: 0 auto;
}

/* Clearfix */
.grid-row::before,
.grid-row::after {
  display: table;
  content: '';
}

.grid-row::after {
  clear: both;
}

.col-3, .col-4, .col-6, .col-12 {
  float: left;

  /* Gutters:
   * Each column is padded by half-a-gutter on each side,
   *
   * Half a gutter is 10px, 10/960 (context) = 1.041666%
   *
   */
  padding-left: 1.04166666%;
  padding-right: 1.04166666%;
}

/* Mobile defaults */
.col-3, .col-4, .col-6, .col-12 {
  width: 100%;
}

/* Non-mobile, grid */
@media only screen and (min-width: 550px) {
  /* 3 columns, 3/12 in % */
  .col-3 {
    width: 25%;
  }

  /* 4 columns, 4/12 in % */
  .col-4 {
    width: 33.333333%;
  }

  /* 6 columns, 6/12 in % */
  .col-6 {
    width: 50%;
  }

  /* 12 columns, 12/12 in % */
  .col-12 {
    width: 100%;
  }
}

/* End of GRID */

/* FOOTER */

footer {
  text-align: center;
  padding: 3px;
  background-color: #FFFF00;
  color: #262626;
  font-family: prestige-elite-std, monospace;

}

JavaScript:
const toggleButton = document.getElementsByClassName('toggle-button')[0]
const navbarLinks = document.getElementsByClassName('navbar-links')[0]

toggleButton.addEventListener('click', () => {
  navbarLinks.classList.toggle('active')
})

Thank you for your time.


Q: Place a background image in a specific position in ggplot2 and take measurements My question is quite challenging for me so far. Hope with your help we can get what I need.
I want to place an image as background of a ggplot.
Data to reproduce : Two objects are necessary: a data frame and an image.
DATA at the end of this question.
Background image:
And this is the image to place as background (molar.png):

What I got so far...
I ggplotted:
library(png)
library(grid)
library(ggplot2)

img <- readPNG("images/molar.png")
g <- rasterGrob(img, interpolate = TRUE)

ggplot(df), aes(x = X, y = Y)) +
  coord_fixed(ratio = .75) +
  annotation_custom(g, xmin=-Inf, xmax=Inf, ymin=-Inf, ymax=Inf) +
  geom_point(alpha = .20, size = 1, shape = 19, color = "red") +
  stat_smooth(method = 'lm', formula = y ~ poly(x, 3)) +
  xlim(0, 100) + ylim(0, 100) +
  theme_minimal() +
  geom_hline(aes(yintercept = 0), color = "red", lty = 2) +
  geom_vline(aes(xintercept = 0), color = "red", lty = 2)

I got this result:

... and what I really want
1. Adapt the regression to this line
Take this red horizontal line as reference:

The X axis (from 0 to 100) must be fitted to this line, as shown now:

This is really what I want: to adapt the background image (without modifying its proportion) to that horizontal line, from the cusp tip (gray) to the ending of the white area to the right.
This would require to select two landmarks in the image, but don't know how to make it automatic by simply selecting one or two points, so that the regression automatically fits that distance.
2. Take measurements
I would like to measure the distance between the highest point of the regression and the point [100, 0], as shown below in green line.

The point here, how can we reference if we are having a scale in the image?
DATA
df <- structure(list(tooth_num = c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2,
    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
    2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
    3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
    3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4,
    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
    4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
    5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6,
    6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
    6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
    6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
    7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
    7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
    8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
    8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9,
    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
    9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
    9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
    10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
    10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10),
        sample = c(1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L,
        12L, 13L, 14L, 15L, 16L, 17L, 18L, 19L, 20L, 21L, 22L, 23L,
        24L, 25L, 26L, 27L, 28L, 29L, 30L, 31L, 32L, 33L, 34L, 35L,
        36L, 37L, 38L, 39L, 40L, 41L, 42L, 43L, 44L, 45L, 46L, 47L,
        48L, 49L, 50L, 51L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L,
        11L, 12L, 13L, 14L, 15L, 16L, 17L, 18L, 19L, 20L, 21L, 22L,
        23L, 24L, 25L, 26L, 27L, 28L, 29L, 30L, 31L, 32L, 33L, 34L,
        35L, 36L, 37L, 38L, 39L, 40L, 41L, 42L, 43L, 44L, 45L, 46L,
        47L, 48L, 49L, 50L, 51L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L,
        9L, 10L, 11L, 12L, 13L, 14L, 15L, 16L, 17L, 18L, 19L, 20L,
        21L, 22L, 23L, 24L, 25L, 26L, 27L, 28L, 29L, 30L, 31L, 32L,
        33L, 34L, 35L, 36L, 37L, 38L, 39L, 40L, 41L, 42L, 43L, 44L,
        45L, 46L, 47L, 48L, 49L, 50L, 51L, 1L, 2L, 3L, 4L, 5L, 6L,
        7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 15L, 16L, 17L, 18L,
        19L, 20L, 21L, 22L, 23L, 24L, 25L, 26L, 27L, 28L, 29L, 30L,
        31L, 32L, 33L, 34L, 35L, 36L, 37L, 38L, 39L, 40L, 41L, 42L,
        43L, 44L, 45L, 46L, 47L, 48L, 49L, 50L, 51L, 1L, 2L, 3L,
        4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 15L, 16L,
        17L, 18L, 19L, 20L, 21L, 22L, 23L, 24L, 25L, 26L, 27L, 28L,
        29L, 30L, 31L, 32L, 33L, 34L, 35L, 36L, 37L, 38L, 39L, 40L,
        41L, 42L, 43L, 44L, 45L, 46L, 47L, 48L, 49L, 50L, 51L, 1L,
        2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L,
        15L, 16L, 17L, 18L, 19L, 20L, 21L, 22L, 23L, 24L, 25L, 26L,
        27L, 28L, 29L, 30L, 31L, 32L, 33L, 34L, 35L, 36L, 37L, 38L,
        39L, 40L, 41L, 42L, 43L, 44L, 45L, 46L, 47L, 48L, 49L, 50L,
        51L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L,
        14L, 15L, 16L, 17L, 18L, 19L, 20L, 21L, 22L, 23L, 24L, 25L,
        26L, 27L, 28L, 29L, 30L, 31L, 32L, 33L, 34L, 35L, 36L, 37L,
        38L, 39L, 40L, 41L, 42L, 43L, 44L, 45L, 46L, 47L, 48L, 49L,
        50L, 51L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L,
        13L, 14L, 15L, 16L, 17L, 18L, 19L, 20L, 21L, 22L, 23L, 24L,
        25L, 26L, 27L, 28L, 29L, 30L, 31L, 32L, 33L, 34L, 35L, 36L,
        37L, 38L, 39L, 40L, 41L, 42L, 43L, 44L, 45L, 46L, 47L, 48L,
        49L, 50L, 51L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L,
        12L, 13L, 14L, 15L, 16L, 17L, 18L, 19L, 20L, 21L, 22L, 23L,
        24L, 25L, 26L, 27L, 28L, 29L, 30L, 31L, 32L, 33L, 34L, 35L,
        36L, 37L, 38L, 39L, 40L, 41L, 42L, 43L, 44L, 45L, 46L, 47L,
        48L, 49L, 50L, 51L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L,
        11L, 12L, 13L, 14L, 15L, 16L, 17L, 18L, 19L, 20L, 21L, 22L,
        23L, 24L, 25L, 26L, 27L, 28L, 29L, 30L, 31L, 32L, 33L, 34L,
        35L, 36L, 37L, 38L, 39L, 40L, 41L), X = c(0, 1.96207644325269,
        3.96448989844662, 6.02285180886395, 8.15165005779206, 10.3635651674945,
        12.6674140636077, 15.0640931778694, 17.5406465345979, 20.0647832611694,
        22.5857329433686, 25.0458992379799, 27.3978582481916, 29.6291517474813,
        31.8764771189544, 34.0520372099874, 36.1615029782313, 38.2134690535817,
        40.2184171634735, 42.1879211839819, 44.1341445581471, 46.0695527612659,
        48.0067272490216, 49.9582712234201, 51.9366936524031, 53.9541918066236,
        56.0223057345439, 58.1471219902002, 60.015986446532, 62.0418690161973,
        64.172643764213, 66.3646706538791, 68.5820610043302, 70.7926665021678,
        72.9630123083219, 75.0533364802678, 77.0143642675254, 78.7889946597798,
        80.3221949636097, 81.6792186440018, 83.1246290439824, 84.6572566946537,
        86.2607918541562, 87.9199855179157, 89.6207074088368, 91.349834829432,
        93.0950207010492, 94.844403612905, 96.5863082060859, 98.3089189787115,
        100, 0, 2.07242714587787, 4.28691224245265, 6.60638277527078,
        8.99634804343432, 11.4282251674021, 13.8802080085279, 16.3366019674999,
        18.7865642588865, 21.2228067680933, 23.6405691464549, 26.0268342309397,
        28.2980527055826, 30.4950596311624, 32.6499592979795, 34.7798224410736,
        36.8956207286784, 39.0058437957066, 41.1183659656274, 43.2421092543673,
        45.3894713560051, 47.5991212687389, 49.7770452245596, 51.9171025815641,
        54.0147450240845, 56.0668835223753, 58.0722874535502, 60.0316719092865,
        61.9474399302204, 63.8232002348162, 65.6632101130593, 67.4719472029522,
        69.2537602596947, 71.1020020072457, 73.0197406878018, 74.8895017058263,
        76.7134344938606, 78.4953847484249, 80.2407780197449, 81.9562954259909,
        83.649499477401, 85.3283767502077, 87.0008805605653, 88.6745443161437,
        90.3562154355033, 92.0029343703826, 93.595173297479, 95.1912911811735,
        96.7911009335273, 98.3943073713479, 100, 0, 2.49538787860394,
        4.98986333706054, 7.48094091039875, 9.95158514589746, 12.3765352721187,
        14.7826711324534, 17.1741487059107, 19.5379450224354, 21.8376445004796,
        24.2011429944043, 26.5151298348149, 28.7199538624058, 31.0167238490571,
        33.2844073975993, 35.4322146421557, 37.6300939882099, 39.8422715265431,
        41.8385466322099, 43.9606111742119, 46.1772777113709, 48.0735169131695,
        50.1458450809683, 52.0775711992983, 54.0389983532847, 56.0114855556445,
        57.9507899054059, 59.8445463497116, 61.7655941740918, 63.7919980969677,
        65.7952774486913, 67.8300149894114, 69.6945929413499, 71.6911766995294,
        73.5625774964864, 75.3913842466844, 77.1888383995349, 78.9539192357634,
        80.672317733178, 82.2770969086854, 83.9169027294331, 85.5602445166866,
        87.1949684008868, 88.8468983089335, 90.5308901736114, 92.1034422363185,
        93.6509365884513, 95.3521507218448, 96.9695007185512, 98.5200274462478,
        100, 0, 1.93071662500976, 3.82909585694513, 5.83503737371176,
        7.96719181032991, 10.2303413170764, 12.617316402646, 15.1102082752161,
        17.6402520534245, 20.1564846032436, 22.6509074609361, 25.0393836587477,
        27.3129712478007, 29.4988321446333, 31.6158908190034, 33.5547876344398,
        35.4063709991687, 37.2999307397267, 39.3177890463815, 41.2304325787261,
        43.1170170017018, 45.1909193214654, 47.1049295380901, 49.1859515610248,
        51.13271739105, 53.1310164292379, 55.0797239964915, 57.1128373874235,
        58.9454191107869, 60.9254683084337, 62.9947826516433, 65.0902258076096,
        67.1539265387035, 69.1321933211508, 71.0068236131378, 72.9528127482717,
        74.868864278393, 76.7358744964615, 78.5828026706554, 80.4923369340278,
        82.44389985077, 84.3433495275878, 86.0966137745744, 87.9057900961145,
        89.7809605893561, 91.5773662545089, 93.2971230872706, 94.8659471916182,
        96.5480144068937, 98.2832055612151, 100, 0, 2.45904597118919,
        4.9478077699383, 7.4437174468872, 9.93045045419645, 12.3969081092835,
        14.8359017068762, 17.2430125015322, 19.6157029336795, 21.9526351315638,
        24.2532312350846, 26.5173310764965, 28.744978623416, 30.9362680921638,
        33.0912151854599, 35.2096628761033, 37.2911746284744, 39.334940182215,
        41.3396279466586, 43.3031840060133, 45.2225306271349, 47.2687426646706,
        49.3178157378126, 51.3497697054769, 53.3645511784153, 55.3621224700994,
        57.3424678778091, 59.3055999637205, 61.2515438521856, 63.1803529324531,
        65.0920931559475, 66.9868618795333, 68.8647627411635, 70.7259245031432,
        72.5704916304973, 74.3986274315152, 76.2105077766622, 78.0063242391239,
        79.7862840948059, 81.5506040412458, 83.2995196192455, 85.0332663696068,
        86.7521175196599, 88.4563337345588, 90.1461348523852, 91.8219291438623,
        93.4838736361913, 95.1323766000954, 96.7676892790966, 98.3900943221571,
        100, 0, 2.20427029931411, 4.42577825043187, 6.67629529636218,
        8.96662563154085, 11.3064974908959, 13.704119943729, 16.165246307201,
        18.6916215311874, 21.2788860284595, 23.9143289820342, 26.5756256258544,
        29.2320665145903, 31.8490369716412, 34.3727083595587, 36.7961343283599,
        39.1127253229244, 41.3113092041144, 43.3888560030568, 45.3501991751572,
        47.2064997097139, 48.9732280089765, 50.6683743389121, 52.3111665976677,
        53.9212675271295, 55.5183816810814, 57.1220463657154, 58.7515758904346,
        60.4258971077205, 62.1633013292058, 63.9808505967227, 65.8934996324456,
        67.912799670054, 70.0333597621695, 71.9831740002692, 73.9087652121441,
        75.8101919344515, 77.6875628781259, 79.5410090537812, 81.3706865591696,
        83.1767905164818, 84.9595299852075, 86.7191558367347, 88.4559245173709,
        90.170123135482, 91.862066674033, 93.5320896282075, 95.1805376430287,
        96.8077452136806, 98.414102584544, 100, 0, 2.50973310686108,
        4.98257000649406, 7.40768627831619, 9.78047063985944, 12.100599944502,
        14.3704650807463, 16.5940944776443, 18.776452301705, 20.9230915203372,
        23.0399794423239, 25.1335076302947, 27.2106366228331, 29.2791814137006,
        31.3594526601995, 33.4580064720123, 35.556233172214, 37.6533199380137,
        39.7484638590935, 41.8408600426407, 43.9297035958428, 46.0141896258872,
        48.0934993624991, 50.1668041229306, 52.2332633294661, 54.2920126144546,
        56.3421658028046, 58.3828149119835, 60.4130261870291, 62.4318202756028,
        64.4382019654095, 66.4311244992937, 68.4095034527027, 70.3722187161805,
        72.3180946704221, 74.2459160462301, 76.1544160295474, 78.0422683314784,
        79.9081070132353, 81.7505086436864, 83.5679982468404, 85.3590473193511,
        87.1220777955072, 88.8554739421999, 90.5575664989655, 92.2266544854268,
        93.8610012363035, 95.458856208853, 97.0184430879027, 98.537991505764,
        100, 0, 2.49186292873155, 4.96628290858449, 7.40387310725186,
        9.79133340002794, 12.1468199057625, 14.5011896071325, 16.8431655039685,
        19.1723761535772, 21.4884872575346, 23.7911793751244, 26.0801603047613,
        28.355162607706, 30.6159386554963, 32.8622655825162, 35.0939428097114,
        37.310792044589, 39.5126572812178, 41.6993973713744, 43.8708934533968,
        46.0270489521849, 48.1677771977769, 50.2930162830572, 52.4027142060487,
        54.4968362987667, 56.5753602746497, 58.6382811811283, 60.6856064470565,
        62.7173459775728, 64.7335369169464, 66.7342089805929, 68.7194141704892,
        70.6892069648972, 72.6436517472169, 74.582822805987, 76.5067919534617,
        78.4156508121718, 80.30948109951, 82.1883843431457, 83.8953343826177,
        85.318702783443, 86.7569115580089, 88.2078484355329, 89.6694432420707,
        91.1396480902398, 92.6164522369269, 94.0978597967267, 95.5818971707953,
        97.0665932365733, 98.5499867766401, 100, 0, 2.61369623570294,
        5.25019204546923, 7.89758672867171, 10.4854413123113, 13.0066240676632,
        15.4846710718853, 17.9159547041448, 20.2976684759407, 22.6276875072264,
        24.9044541625748, 27.1268476764071, 29.2940720764344, 31.4055784162507,
        33.4609732842652, 35.4599616217844, 37.4022781047122, 39.2876574089524,
        41.115772453938, 42.8862115298645, 44.5984417012627, 46.5824735364946,
        48.8579364441288, 51.0689873528466, 53.2187049370753, 55.31212578009,
        57.3558486751465, 59.3576503629965, 61.3261515894915, 63.2705517814855,
        65.2004117555501, 67.125505044989, 69.0556829505137, 71.0007693255153,
        72.9704141903561, 74.9739450593852, 77.0201427878221, 79.1169465130639,
        80.9682934274075, 82.7378404654242, 84.4621062867744, 86.1441466931183,
        87.7873262684694, 89.3952520481705, 90.9717460715737, 92.5207813382925,
        94.0464474990516, 95.5529302701972, 97.0444725499921, 98.5253927168307,
        100, 0, 2.19489342240264, 4.47470248895734, 6.80636996136228,
        9.16189235515265, 11.5204119968896, 13.8679818386464, 16.1962336516669,
        18.5008000956494, 20.7800403414259, 23.0340446346007, 25.2640080457511,
        27.4717901812673, 29.6596690589774, 31.8301824946609, 33.9860569994518,
        36.1301804326855, 38.2656102060449, 40.395611569574, 42.5237505919975,
        44.6539625286031, 46.790726843019, 48.9392449637073, 51.1057000819157,
        53.0838372365286, 55.0005198693747, 56.9159691456296, 58.8292579968134,
        60.7394374767241, 62.645542230868, 64.5465987006055, 66.4416169190052,
        68.3295795719832, 70.2094638760246, 72.080216965747, 73.9407777716216,
        75.7900606116825, 77.6269798039636, 79.4504168499154, 81.2592587204191,
        83.0523732433488), Y = c(84.5741422911491, 87.0989688246201,
        89.5436034157802, 91.8694746551154, 94.0314174040144, 95.9740138468311,
        97.628391911438, 98.9112343041615, 99.7302288176452, 100,
        99.6682935009841, 98.7381965579207, 97.2664228638507, 95.3825982722905,
        93.5434433368078, 91.50049262398, 89.2915552625009, 86.9514674858642,
        84.511940176201, 82.0015588642778, 79.4462792120302, 76.8706085478357,
        74.2982919192514, 71.7531887159568, 69.2602636348217, 66.8466919870944,
        64.5423551809367, 62.3722941413001, 59.6800326256192, 57.2857466826492,
        55.128758759083, 53.1294867372666, 51.2007256913408, 49.2527551687403,
        47.1957784888164, 44.9429337520794, 42.418488359019, 39.5725891439776,
        36.3973083864229, 33.0253591771941, 29.7461795438129, 26.5669349259918,
        23.4758099710143, 20.4586262556193, 17.4994139966193, 14.5814411300049,
        11.6872895390296, 8.79946487886403, 5.90043469063777, 2.97289519972717,
        0, 93.0321380957158, 95.1946109521693, 96.937054277536, 98.2619255824812,
        99.1910694062447, 99.7577986711693, 100, 99.9550821661862,
        99.6575185832176, 99.1377550776607, 98.4215955114931, 97.4779796804826,
        95.9441517048638, 94.1389735933651, 92.2010899059795, 90.1898222195824,
        88.1388247774415, 86.0724678936469, 84.0123913148843, 81.9837162612796,
        80.0234419211725, 78.2597001700458, 76.3926747068224, 74.4111019409554,
        72.3108177571526, 70.0927095898208, 67.7621020453996, 65.3282107888812,
        62.802504203367, 60.1968602570691, 57.5234982391254, 54.7931356266002,
        52.0153976695973, 49.3678395136313, 46.8461605150396, 44.2290481856401,
        41.5261960397215, 38.748799403644, 35.9094871516561, 33.021434271488,
        30.098088807609, 27.1525574835635, 24.19719611686, 21.2436096189696,
        18.3024472027724, 15.3103597044707, 12.2378569960892, 9.17074715833242,
        6.10882539864554, 3.05175039610287, 0, 100, 99.9740960784806,
        99.8730270144876, 99.6594688780895, 99.1648671200451, 98.300448086114,
        97.3281159413371, 96.2806584450564, 95.1069839916948, 93.6992988433163,
        92.5227992310794, 91.1519207300211, 89.4389990501897, 88.0315526476314,
        86.5030621141021, 84.637382900149, 82.9008651750625, 81.2041782110219,
        79.064856495856, 77.1370635776142, 75.4555767641426, 73.1766285349799,
        71.1390523302985, 68.8176471360649, 66.5503178701644, 64.3037992816136,
        61.9957638533255, 59.6077485751849, 57.270625947771, 55.1882053198138,
        53.005988938906, 50.8933669646611, 48.4803231663425, 46.2904669191802,
        43.8645308465569, 41.369278904061, 38.8252432322521, 36.2327421588907,
        33.5735116287118, 30.7665372266409, 28.0047653665761, 25.244744309195,
        22.4736613621324, 19.7247419854022, 17.0183591556834, 14.1736629139801,
        11.3015506938947, 8.6188037004008, 5.82611425658707, 2.95264914351926,
        0, 86.7221127164863, 89.2450865945842, 91.8256626160176,
        94.2050712850442, 96.3082958568556, 98.0567601186487, 99.356578317864,
        100, 99.8266960099512, 99.3672567218446, 98.6837623193952,
        97.4546359200075, 95.8095875992727, 93.8391732848531, 91.6986699837336,
        89.1914649315853, 86.5315472203614, 83.9427805951582, 81.5889388575256,
        79.0374892354799, 76.4382738493923, 74.2129556980193, 71.6847000287053,
        69.5197780116735, 67.026504640704, 64.6334322074442, 62.1466653908716,
        59.8252416036741, 57.210640130131, 54.8147737058654, 52.5672567218449,
        50.3760405702802, 48.1148980958759, 45.6822122284949, 43.0613338436512,
        40.5655726724713, 38.0157305521002, 35.3812266768728, 32.7135011003732,
        30.1526743852262, 27.6670940579847, 25.0888527413645, 22.2776767773419,
        19.7712372021815, 17.1514304851209, 14.4034446464453, 11.542359582815,
        8.48492967180167, 5.57098842216043, 2.73145153573813, 0,
        99.1041781658029, 99.7254865136605, 100, 99.9614316109632,
        99.6447768919466, 99.0834281892782, 98.3070217828948, 97.341621109093,
        96.2090754809024, 94.9278903961505, 93.5136855943403, 91.9791492509625,
        90.3350457026248, 88.5899864186136, 86.7511628918963, 84.8242550277467,
        82.8134769494328, 80.7219434437174, 78.5514867381084, 76.302473278107,
        73.9737121158334, 71.8911107192181, 69.810524772861, 67.694531029918,
        65.5438623813919, 63.3593433296612, 61.1416609600414, 58.8917313862862,
        56.6101958880234, 54.2979247733192, 51.9556967388641, 49.5842904813491,
        47.1845305031526, 44.757241306653, 42.303109977166, 39.8229610170695,
        37.317527317367, 34.7876333804369, 32.2340120972821, 29.657396358906,
        27.058564861999, 24.438158886189, 21.7969571281666, 19.1356924789353,
        16.4549604124345, 13.7555396253553, 11.0379797859501, 8.30305959090951,
        5.55132870848586, 2.78342841830685, 0, 84.1515543172144,
        86.2722836260793, 88.3566153916604, 90.3773896250419, 92.3062620354674,
        94.111690717205, 95.7577913244362, 97.203231722867, 98.4009161759049,
        99.2995644137824, 99.8474619227218, 100, 99.7284790643066,
        99.0275302806241, 97.8277140842702, 96.2611985608363, 94.3983312397508,
        92.2676143186827, 89.9054453409169, 87.3514589414394, 84.6443817904904,
        81.8193876527848, 78.9076236667722, 75.9361708679116, 72.9289916301439,
        69.9079560608225, 66.8938683956418, 63.9077697306659, 60.9718854638001,
        58.1105727362662, 55.3511099671633, 52.7239337138365, 50.2623228580521,
        47.9794231502588, 45.4070011187705, 42.7981815439979, 40.1541092510553,
        37.4757316814164, 34.7641541834675, 32.0204031521378, 29.2455049823579,
        26.4404465923295, 23.6062938537105, 20.7439547312464, 17.8544950965959,
        14.9388623912317, 11.9979251031726, 9.0326701506196, 6.04400549831871,
        3.03283911101569, 0, 100, 99.5848739044175, 98.8739209129315,
        97.9105346461211, 96.7351022995956, 95.3831954679074, 93.885250878182,
        92.2670226841415, 90.5504870541479, 88.7545871260625, 86.8960843842295,
        84.9905164585802, 83.0528356573708, 81.0986594271243, 79.1673905588146,
        77.2717198905873, 75.3754106896234, 73.4768134130185, 71.5743849399925,
        69.6665023331719, 67.7516224717761, 65.8282022350241, 63.8947517131965,
        61.9497011799818, 59.9915873311911, 58.0188670460438, 56.0301302314122,
        54.0238603720464, 51.9985941637575, 49.9528949078877, 47.8852726947172,
        45.794397247711, 43.6787786571497, 41.5370334354364, 39.3678047005055,
        37.1697621758216, 34.941522373788, 32.6818614399924, 30.3895023089609,
        28.063247731812, 25.7019536707251, 23.304582510003, 20.8700966339479,
        18.3975648489857, 15.8861889891947, 13.3352240997155, 10.7440582533417,
        8.11223915605116, 5.43939433041456, 2.72533753771655, 0,
        100, 99.9134879636606, 99.4737726511386, 98.7119319033914,
        97.6645725261045, 96.4711111592938, 95.2721931018034, 94.0226109361477,
        92.7232680879358, 91.374959571704, 89.9785165390125, 88.5348785524954,
        87.0449851747857, 85.5095952833957, 83.9297207150073, 82.3061926211812,
        80.6400228385995, 78.9320063817987, 77.1831189504364, 75.3942278330975,
        73.5662725924159, 71.7000843799518, 69.7965666213147, 67.8565504680649,
        65.8809393458113, 63.8706005431396, 61.8262568005362, 59.7488476806353,
        57.6390236498756, 55.4977604079147, 53.3256361471427, 51.123554293169,
        48.8921653124316, 46.6322280824431, 44.344429206666, 42.0294914255877,
        39.6880290686225, 37.3207287392334, 34.9282409038592, 32.3093546108134,
        29.3214008878868, 26.3486608522194, 23.3891108304469, 20.4407632862286,
        17.5015222721514, 14.5693279778263, 11.6421205928639, 8.71769575877807,
        5.79402980220384, 2.86895450167932, 0, 99.0881176828924,
        99.616812993443, 99.9245775334157, 100, 99.4144184933504,
        98.4080380989905, 97.2482296158507, 95.9447863261935, 94.5072176490275,
        92.9445788221548, 91.2653289705444, 89.4773594926569, 87.5879656741198,
        85.6037331424258, 83.5306797985592, 81.3743977486237, 79.139712667937,
        76.8311379822374, 74.4527045497319, 72.0079322747694, 69.5001707437473,
        67.4173241176181, 65.7355478830473, 63.9261751158092, 62.0062376111431,
        59.9926536189868, 57.9018588217461, 55.7494373120646, 53.5502067518011,
        51.3181332130511, 49.0667285867045, 46.8089938097941, 44.5579865920031,
        42.3268498019911, 40.129152103299, 37.979256976578, 35.89220917429,
        33.8840753566102, 31.5408977402496, 29.095103557573, 26.6000023276786,
        24.0608455207656, 21.4827994480562, 18.8707181711938, 16.2292854338693,
        13.56295788917, 10.8759367132551, 8.1722811506567, 5.45590851427953,
        2.73059418540176, 0, 96.4662652426023, 98.0232502530471,
        99.1147667554613, 99.7607331141328, 100, 99.8803419056255,
        99.4511603186742, 98.7585534337238, 97.843294734107, 96.7405371746194,
        95.4801583016932, 94.0874997966255, 92.5842056245715, 90.989010880653,
        89.3184813331895, 87.587358543869, 85.8094473196242, 83.9978129241588,
        82.1654220154131, 80.3260794003192, 78.4945266405658, 76.6880690477,
        74.9274631350027, 73.2399733961649, 70.9563625122581, 68.4738638027609,
        65.9881111030584, 63.4970829949925, 60.9982157287041, 58.4893399773897,
        55.9680398998363, 53.4319489577125, 50.8788978242146, 48.3064706581295,
        45.7125474355354, 43.0948602238647, 40.4513876049598, 37.7800095548987,
        35.0788032612873, 32.3458952146129, 29.5794612082463)), .Names = c("tooth_num",
    "sample", "X", "Y"), row.names = c(NA, 500L), class = "data.frame")


Q: Outlook.com does not allow stylesheet to be loaded externally? It looks like Outlook.com prevents a stylesheet to be loaded from an external url this way:
http://cdn.xxxx.com/email/style.css' rel='stylesheet' type='text/css'>
When I download the email via POP3, everything is just fine. However, when I open the same email in outlook.com somehow the css is blocked. I am suprised that it does not block the images inside the email and prefers to block only the css. How come?? Any ideas how to solve this?

A: Best practice , use inline style on all elements.
It's not just outlook, gmail has similar issues ( security reasons )

A: It is always a good practice when making a mailer always use inline style.
All Outlook versions and others like gmail, yahoo, hotmail have a good support for inline style.


Q: Equivalent condition for an open set in a metric space I'm reviewing for a first-year exam in introductory topology.  I've run across this question:
Let $X$ be a metric space.  Prove that a subset $U$ of $X$ is open iff for every $z\in U$ and every sequence $\{x_n\}_{n\in\omega}$ that converges to $z$, there exists an $N\in\omega$ such that for all $n\geq N$, $x_n\in U$.
The forward direction is easy.  The converse has always, \textit{always} given me trouble, for some reason.  I can't figure out how to construct an open ball completely contained in $U$ to show that the interior of $U$ is all of $U$.  I would like to make a sequence that encompasses all of the points in such an open ball, but I can only capture finite or countable subsets.  This should be super basic, but can anyone give me a hint on how to proceed?
Also, apologies if this is a duplicate.  I couldn't figure out how to parse the question for Google.
Thank you!

A: If $U$ is not open then it must contain an element $z$ that does not belong to the interior of $U$.
So for $n=1,2,\dots$ the open ball having $z$ as center and $\frac1n$ as radius has a nonempty intersection with $U^c$.
Choose $x_n$ as an element of that intersection. Then $x_n\to z\in U$ while $x_n\notin U$ for each $n$.

A: If $U$ is not open, then $U^c$ is not closed and hence not sequentially closed (use that $X$ is metric space), so there is a sequence of elements $x_n \to x \in X$ with $x_n \in U^c$ but $x \in U$.


Q: how to add KASlideShow inside a cell inside the UITableView Before we move into the main purpose of the question, KASlideShow is a library on github.  I am using this library for showing a slide show of images.  After many searches on to how to implement a custom cell, I found the following: Is it possible to add UITableView within a UITableViewCell.  Here is the code that i am using:
#import "HomeTableViewController.h"
#import "KASlideShow.h"
#import "CustomTableViewCell.h"
@interface HomeTableViewController ()
@property (strong,nonatomic) IBOutlet KASlideShow * slideshow;

@end

@implementation HomeTableViewController

 - (void)viewDidLoad {
[super viewDidLoad];

 }

  - (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}

-(UITableViewCell *)tableView:(UITableView *)tableView       cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    CustomTableViewCell *cell = [self.tableView   dequeueReusableCellWithIdentifier:@"SlideShowCell"];
   if(cell == nil)
   {
         cell = [[CustomTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"SlideShowCell"];

       }

    [_slideshow setDelay:5]; // Delay between transitions
    [_slideshow setTransitionDuration:5]; // Transition duration
    [_slideshow setTransitionType:KASlideShowTransitionFade]; // Choose a transition type (fade or slide)
     [_slideshow setImagesContentMode:UIViewContentModeScaleAspectFill]; // Choose a content mode for images to display
     [_slideshow addImagesFromResources:@[@"adidas.jpg",@"adidas_neo.jpeg"]]; // Add images from resources
      [_slideshow addGesture:KASlideShowGestureTap]; // Gesture to go previous/next directly on the image
[_slideshow start];
       return  cell;
   }

@end

    #import <UIKit/UIKit.h>
    #import "KASlideShow.h"
    @interface CustomTableViewCell : UITableViewCell
    @property (nonatomic) IBOutlet  KASlideShow *slideshow;

  #import "CustomTableViewCell.h"
  #import "KASlideShow.h"
  @implementation CustomTableViewCell

  - (void)awakeFromNib {
    [super awakeFromNib];
// Initialization code
 }

 - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
   [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
     if (self) {
        // Initialization code

    }
     return self;
 }

 @end

    @end

KASlideShow never appears inside the UITableViewCell  I know there is something wrong but i am not able to know where it is to fix it.

A: why don't u add KASlideShow to a header view in ur UITableViewController ?
First create that headerView and add to it 1 more view and subclass it of KASlideShow
then connect your IBOutlet slideshow with this view
then add KASlideShow settings to ViewDidLoad
your code should look like the following code
#import "SlideShowTableViewController.h"
#import "KASlideShow.h"

@interface SlideShowTableViewController ()
@property (strong,nonatomic) IBOutlet KASlideShow * slideShow;
@end

@implementation SlideShowTableViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    // Do any additional setup after loading the view, typically from a nib.
    [self.slideShow setDelay:5]; // Delay between transitions
    [self.slideShow setTransitionDuration:5]; // Transition duration
    [self.slideShow setTransitionType:KASlideShowTransitionFade]; // Choose a transition type (fade or slide)
    [self.slideShow setImagesContentMode:UIViewContentModeScaleAspectFill]; // Choose a content mode for images to display
    [self.slideShow addImagesFromResources:@[@"adidas.jpg",@"adidas_neo.jpeg"]]; // Add images from resources
    [self.slideShow addGesture:KASlideShowGestureTap]; // Gesture to go previous/next directly on the image
    [self.slideShow start];

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 0; // <<-- set your sections count
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 0; // <<-- set your rows count in section
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"reuseIdentifier" forIndexPath:indexPath];

    // Configure the cell...

    return cell;
}

and your Interface Builder should look like


Q: Docker file to clone the files which are in git I have a server.xml files for 50 applications which are different for all the applications. i need to write a docker file for all the applications to grab that server.xml.
Where is server.xml: Gitserver private repo uses ssh based clone only
I cannot clone complete repo only for single server.xml file
what is the best approach to grab that file and make part of dockerfile.
Is there any way to do it instead of keeping in dockerfile?

A: You could use an argument to pull the xml file and then build it into the image.
FROM alpine
ARG SERVER_CONF
RUN curl ${SERVER_CONF}
EXEC server.sh

Then you can run build and pass in the location of the xml file
docker build --build-arg SERVER_CONF=http://localhost/server.xml

Alternatively you could set this as an environment variable so that you can get the xml file at runtime.
FROM alpine
ARG SERVER_CONF
ENV SERVER_CONF=${SERVER_CONF}
RUN server.sh --config=$SERVER_CONF

This would allow you to set the config dynamically when you build the image.
If you would like to set the config at runtime then you could pass it as an environment variable when starting the docker container
FROM alpine
RUN server.sh --config=$SERVER_CONF

Then start your container by passing in the environment variable
docker run -e "SERVER_CONF=http://localhost/server.xml" server

You don't have to pass a url, you could pass the entire contents of the xml file as a string. You can use an entry point to write the contents of the environment to a file before your application starts.

A:
Is there any way to do it instead of keeping in dockerfile?

As long as you have fetched that server.xml (or simply copied its content to a local file), you can:

*

*either COPY it in your Dockerfile

*or put it in a public place, remotely accessible, which your container could, at runtime, fetch from (instead of having to try and clone a private repo, which your container should not be able to do)


Q: WCF Error because The maximum message size quota for incoming messages (65536) has been exceeded i make WCF service on server side to return binary (bytes) of file..
i just can return binary of txt file,otherwise it's say "The maximum message size quota for incoming messages (65536) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element."
<bindings>
      <basicHttpBinding>
        <binding name="basicHttp" allowCookies="true"
                 maxReceivedMessageSize="2147483647"
                 maxBufferSize="2147483647"
                 maxBufferPoolSize="2147483647"
          transferMode="Buffered"
          messageEncoding="Text"
          textEncoding="utf-8"
          bypassProxyOnLocal="false"
               useDefaultWebProxy="true" >
        <security mode="None" />
            <readerQuotas maxDepth="2147483647"
                 maxArrayLength="2147483647"
                 maxStringContentLength="2147483647"
        maxBytesPerRead="2147483647"
        maxNameTableCharCount="2147483647"/>
        </binding>
      </basicHttpBinding>
    </bindings>
    <behaviors>
      <serviceBehaviors>
        <behavior name="">
          <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
      </serviceBehaviors>
    </behaviors>

can you give me solution?
i need your help..thanks before :)
here is client code side (app.config)
<bindings>
  <basicHttpBinding>
    <binding name="BasicHttpBinding_IService" />
    </basicHttpBinding>
  </bindings>
  <client>
    <endpoint address="http://localhost:3724/Service.svc"
              binding="basicHttpBinding"
              bindingConfiguration="BasicHttpBinding_IService"
              contract="ServiceReference1.IService"
              name="BasicHttpBinding_IService" />
  </client>

this client is desktop application not website

A: You need to assign the binding you defined to an endpoint you create.  Here's an example:
<bindings>
  <basicHttpBinding>
    <binding name="basicHttp" allowCookies="true"
             maxReceivedMessageSize="2147483647"
             maxBufferSize="2147483647"
             maxBufferPoolSize="2147483647"
             transferMode="Buffered"
             messageEncoding="Text"
             textEncoding="utf-8"
             bypassProxyOnLocal="false"
             useDefaultWebProxy="true" >
      <security mode="None" />
      <readerQuotas maxDepth="2147483647"
                    maxArrayLength="2147483647"
                    maxStringContentLength="2147483647"
                    maxBytesPerRead="2147483647"
                    maxNameTableCharCount="2147483647"/>
    </binding>
  </basicHttpBinding>
</bindings>
<behaviors>
  <serviceBehaviors>
    <behavior name="">
      <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="false" />
    </behavior>
  </serviceBehaviors>
</behaviors>
<services>
  <service>
    <endpoint address="/Service.svc" binding="basicHttpBinding"
              bindingCongifuration="basicHttp"
              contract="service.IService"/>
  </service>
</services>

A couple of things to note - in your comment, your service endpoint was using wsHttpBinding, but you defined basicHttpBinding in your <bindings> section.  Also, the bindingConfiguration attribute must be the name assigned to the binding defined.  My example above is based on the original posted config file.
Alternatively, if you are using .NET 4.0 or later, you can define a binding in the <bindings> setting and set it as the default definition for that binding by omitting the name attribute on the <binding> element.
By default, .NET 4.0+ uses basicHttpBinding for http.  You can change this in the config file in the <protocolMapping> section (which is contained in the <system.serviceModel> section).  For example, if you wanted to use wsHttpBinding for all http requests, you would do this:
<protocolMapping>
  <add binding="wsHttpBinding" scheme="http" />
</protocolMapping>

Added Client Example
The client side would look very similar, except you'd have a <clients> section instead of a <services> section.  Note that some of the settings on the binding apply to the machine (client or server) the application is on, and setting them on one side of the client-server relationship will have no effect on the other side (like maxReceivedMessageSize, for example).  Generally the binding type and security have to agree, and in practice it's usually easier to just use the same bindings on both ends, but it is possible to have a scenario where one side would have different buffers or other items.
<bindings>
  <basicHttpBinding>
    <binding name="BasicHttpBinding_IService" allowCookies="true"
             maxReceivedMessageSize="2147483647"
             maxBufferSize="2147483647"
             maxBufferPoolSize="2147483647"
             transferMode="Buffered"
             messageEncoding="Text"
             textEncoding="utf-8"
             bypassProxyOnLocal="false"
             useDefaultWebProxy="true" >
      <security mode="None" />
      <readerQuotas maxDepth="2147483647"
                    maxArrayLength="2147483647"
                    maxStringContentLength="2147483647"
                    maxBytesPerRead="2147483647"
                    maxNameTableCharCount="2147483647"/>
    </binding>
  </basicHttpBinding>
</bindings>
<client>
  <endpoint address="localhost:3724/Service.svc"
            binding="basicHttpBinding"
            bindingConfiguration="BasicHttpBinding_IService"
            contract="ServiceReference1.IService"
            name="BasicHttpBinding_IService" />
</client>


Q: Force bgSave() using Spring Data Redis Is there any way to call bgSave() (force writing to disk) using Spring Data Redis Repositories?
public interface UserRepository extends CrudRepository<User, String> {
}

I've gone through the docs but I couldn't find any reference about bgSave(). The only way I can think of would be by autowiring RedisConnectionFactory, getting the RedisConnection and calling the method, although I'm not sure it would work.


Q: Is it an issue to use "setAdapter()" more than once in recyclerview? Actually I am fetching data from server and showing that on my recyclerview .But it was showing nothing . Even after a lot of question's reference my problem couldn't be solved but then I tried to use setAdapter() method after fetching data and now my problem is solved . But what I'm asking is Is it unusual to use setAdapter more than once? . In my first attempt I was setting adapter first then trying to use adp.notifyDataSetChanged() after fetching data from server. but now I'm setting adapter again after getting data.
Code:
private List<TImelineDataList> timelineDatalist;
@Override
public void onViewCreated(@NonNull View v, @Nullable Bundle savedInstanceState) {

    timelineDataList= new ArrayList<>();
    adapter=new CustomRecyclerViewAdapter(timelineDataList);
    recyclerView.setItemViewCacheSize(30);
    recyclerView.setDrawingCacheEnabled(true);
    recyclerView.setDrawingCacheQuality(View.DRAWING_CACHE_QUALITY_HIGH);
    recyclerView.setLayoutManager(new
    LinearLayoutManager(ctx,LinearLayoutManager.HORIZONTAL,false));
    recyclerView.setAdapter(adapter);

}
 void addTimelineData(String email,String time,String img_link,String caption){
    timelineDataList.add(new TimelineData(email,time,img_link,caption));
    adapter=new CustomRecyclerViewAdapter(timelineDataList);
    adapter.notifyDataSetChanged();
    recyclerView.setAdapter(adapter);
}
  private  Emitter.Listener handlePosts = new Emitter.Listener(){

    @Override
    public void call(final Object... args){
        try {
            JSONArray jsonArray=(JSONArray)args[0];

               for(int i=0;i<jsonArray.length();i++){
                   try {
                       JSONObject ob=jsonArray.getJSONObject(i);
                       demo_email=ob.getString("_pid");

                       demo_time=ob.getString("time");

                       demo_link=ob.getString("img_link");

                       demo_caption=ob.getString("caption");

                       addTimelineData(demo_email,demo_time,demo_link,demo_caption);

                   } catch (JSONException e) {
                       e.printStackTrace();
                   }
               }

        } catch (Exception e) {
            Log.e("error",e.toString());
        }
    }
};

A: Finally I figured out the problem . The problem was there in constructing adapter twice . Now I've removed the next adapter construction and the setAdapter() as well and it's working without any errors.
Previous Code:
private List<TImelineDataList> timelineDatalist;
@Override
public void onViewCreated(@NonNull View v, @Nullable Bundle savedInstanceState) {

    timelineDataList= new ArrayList<>();
    **adapter=new CustomRecyclerViewAdapter(timelineDataList);**//Here
    recyclerView.setItemViewCacheSize(30);
    recyclerView.setDrawingCacheEnabled(true);
    recyclerView.setDrawingCacheQuality(View.DRAWING_CACHE_QUALITY_HIGH);
    recyclerView.setLayoutManager(new
    LinearLayoutManager(ctx,LinearLayoutManager.HORIZONTAL,false));
    recyclerView.setAdapter(adapter);

}
 void addTimelineData(String email,String time,String img_link,String caption){
    timelineDataList.add(new TimelineData(email,time,img_link,caption));
    **adapter=new CustomRecyclerViewAdapter(timelineDataList);**//Here
    adapter.notifyDataSetChanged();
    recyclerView.setAdapter(adapter);
}
  private  Emitter.Listener handlePosts = new Emitter.Listener(){

    @Override
    public void call(final Object... args){
        try {
            JSONArray jsonArray=(JSONArray)args[0];

               for(int i=0;i<jsonArray.length();i++){
                   try {
                       JSONObject ob=jsonArray.getJSONObject(i);
                       demo_email=ob.getString("_pid");

                       demo_time=ob.getString("time");

                       demo_link=ob.getString("img_link");

                       demo_caption=ob.getString("caption");

                       addTimelineData(demo_email,demo_time,demo_link,demo_caption);

                   } catch (JSONException e) {
                       e.printStackTrace();
                   }
               }

        } catch (Exception e) {
            Log.e("error",e.toString());
        }
    }
};

New Code:
private List<TImelineDataList> timelineDatalist= new ArrayList<>();;
@Override
public void onViewCreated(@NonNull View v, @Nullable Bundle savedInstanceState) {

    adapter=new CustomRecyclerViewAdapter(timelineDataList);
    recyclerView.setItemViewCacheSize(30);
    recyclerView.setDrawingCacheEnabled(true);
    recyclerView.setDrawingCacheQuality(View.DRAWING_CACHE_QUALITY_HIGH);
    recyclerView.setLayoutManager(new
    LinearLayoutManager(ctx,LinearLayoutManager.HORIZONTAL,false));
    recyclerView.setAdapter(adapter);

}
 void addTimelineData(String email,String time,String img_link,String caption){
    timelineDataList.add(new TimelineData(email,time,img_link,caption));
    adapter.notifyDataSetChanged():
}
  private  Emitter.Listener handlePosts = new Emitter.Listener(){

    @Override
    public void call(final Object... args){
        try {
            JSONArray jsonArray=(JSONArray)args[0];

               for(int i=0;i<jsonArray.length();i++){
                   try {
                       JSONObject ob=jsonArray.getJSONObject(i);
                       demo_email=ob.getString("_pid");

                       demo_time=ob.getString("time");

                       demo_link=ob.getString("img_link");

                       demo_caption=ob.getString("caption");

                       addTimelineData(demo_email,demo_time,demo_link,demo_caption);

                   } catch (JSONException e) {
                       e.printStackTrace();
                   }
               }

        } catch (Exception e) {
            Log.e("error",e.toString());
        }
    }
};

A: Call adapter.notifyDataSetChanged() method to update RecyclerView adapter after adding data into arraylist which is attached to adapter.
You can also call method notifyItemInserted(index) which can show item added with animation effect.

A: The proper way is to call notifyDataSetChanged on the adapter or other methods from that family.
The problem with setting adapter will be that your scroll position will be lost.
It looks like the problem is in your CustomRecyclerViewAdapter. Good practice is to move timelineDatalist into the CustomRecyclerViewAdapter and have something like:
void addTimelineData(String email,String time,String img_link,String caption){
    adapter.addToTimelineDataList(new TimelineData(email,time,img_link,caption));
    adapter.notifyDataSetChanged();
}

Please post your CustomRecyclerViewAdapter for more details.

A: I think its usual to use setAdapter multiple times as it won't create any issues in functionality. But if you want to use
notifyDataSetChanged()

then try not to reinitialize your data while receiving the data if you perform
yourData = newData

then this will reinitialize your old data and notifyDataSetChanged() will not work on that
if its string then try concatenating in the current instance.

A: make some change in method like below code ..
        void addTimelineData (String email, String time, String img_link, String caption){
        timelineDataList.clear()
        timelineDataList.add(new TimelineData(email, time, img_link, caption));
        setAdapter();
    }

and make one setAdapter method like..
  public void setAdapter(){
    if (adpter==null){
        if(!timelineDataList.isEmpty()){
            adapter = new CustomRecyclerViewAdapter(timelineDataList);

        }
    }
    else{
        adapter.notifyDataSetChanged();
    }
}

and remove the code onCreate() define recyclerView.setAdapter(adapter);


Q: Calculate the surface area of this shape. I am stuck at calculating the surface area for this shape (only red area).
I know how to calculate some area, but not sure how to substract area

$$P = \frac{20 \cdot 10}2 = 100 - 25\pi\, -\, ?$$

A: Segment $x$ is twice $y$ because the rectangle base is twice the height.
The second equation is Pythagora's Theorem
$
\left\{
\begin{array}{l}
 x=2 y \\
 (5-x)^2+(5-y)^2=25 \\
\end{array}
\right.
$
we get $(5-2y)^2+(5-y)^2=25$
$y^2-6 y+5=0 \to y_1=1;\;y_2=5$
$x=2;\;y=5$ is the point where diagonal and circle intersect
So we have $\sin\alpha=\frac{3}{5}$
The area $\mathcal{S}$ we are calculating is composed by the green triangle and the pink curved part. The pink part is the trapezoid less the sector with angle $\alpha$
$$\mathcal{S}=\frac{2\times 1}{2}+\left(\frac{3\times(1+5)}{2}-\frac{25 \pi }{\arcsin\left(\frac{3}{5}\right)}\right)\approx 1.95624$$
Hope this is useful
$$
.
$$


Q: Using a .lib built with Visual Studio in Eclipse/CDT/gcc I am having some trouble compiling a programm with gcc on windows which was initially developed with Visual Studio. So far I was able to resolve almost all problems like missing header files and such, but now I am stuck at one last thing: gcc fails to link to one of the third party libs my program uses (FlyCapture2.lib). It tells me that it does not find any of the functions/methods there. I already checked if the library is actually on the library path and that sort of things, but it still does not work.
I searched a bit around and learned that it might have something to do with the format of .libs created with the Microsoft compiler. Is there any way to convert such a lib to be compatible with gcc? Anything else I might have missed?
(I already found this similar question, but its solution won't work here)

A: In this page the author gives several ways to achieve what you want


Q: Get point on ellipse from point and angle I have the bounds (x from, x to ...) of an ellipse (and thus its radius and center), x and y of a point A that is in the ellipse and an angle. I want to get point B to which the angle points (from point A) and that lies on the ellipse.
This is what I can do:
center_x = (x_from + x_to) / 2
center_y = (y_from + y_to) / 2
radius_x = center_x - x_from
radius_y = center_y - y_from
How to go on?

@All: Thank you very much! The formula works perfectly well!

A: The ellipse can be described by the equation:
$$\left(\frac{x-x_0}{a}\right)^2 + \left(\frac{y-y_0}{b}\right)^2 = 1$$
where $(x_0, y_0)$ is the center and $a$ and $b$ are the lengths of the ellipse's semi-axes (what you call radius_x and radius_y).
If $A = (p,q)$ and the given angle is $\alpha$, then the ray starting at $A$ in the direction $\alpha$ can be described by
$$(x,y) = (p + t\cos\alpha, q + t\sin\alpha) \qquad \text{where $t > 0$}.\tag{*}$$
Plug this expression into the equation for the ellipse and solve for $t$. (This will be a quadratic equation; you want its positive root.) Plug this value of $t$ into (*) to get the coordinates of $B$.

A: You need to state as an explicit assumption that the main axes of the ellipse are parallel to the coordinate axes -- if that is not true, knowing the extreme $x$ and $y$ values is not enough to describe the ellipse.
However, if we can make the assumption, the way to proceed is as follows. First compute the lengths of the main semiaxes:
$$ a = \frac12(x_{\rm max}-x_{\rm min}) \qquad b = \frac12(y_{\rm max}-y_{\rm min}) $$
Then the equation for the ellipse is
$$ \tag{*} \left(\frac{x-x_{\rm center}}{a}\right)^2 + \left(\frac{y-y_{\rm center}}{b}\right)^2 = 1$$
Since you also know the angle $\theta$ (between $A$ and your sought point, I assume), you know there's a positive $t$ such that
$$ \tag{**} x= x_A+t\cos\theta \qquad y = y_A+t\sin\theta $$
Substitute these expressions for $x$ and $y$ into $(*)$ and you get a quadratic equation in $t$. Solve that, choosing the positive root (which always exists if $A$ is inside the ellipse), and put the resulting $t$ back into $(**)$.


Q: Filtering long lists take a long time to run I have a Dropdown with about 7000 objects. I have tried using semantic-ui react components but it still takes a long time to search and get results.
My copyList contains all the options and the filteredCopyList is what is rendered in the dropdown onKeyUp. Is it going slow due to rendering a long list of items and filtering them at the same time?
//list of 7000
const copyList = [
    {itemDesc: 'itemDesc1', shortDesc: 'shortDesc1'}
]

filterList = () => {
    const re = new RegExp(_.escapeRegExp(this.state.searchCopyList),'i');
    const isMatch = result => (re.test(result.shortDesc) ||
    re.test(result.itemDesc));
    this.setState({
        filteredCopyList: _.filter(this.state.copyList, isMatch)
    });
}

A: You can try with the following package of npm:
Infinite Scrolling package


Q: send simple email using codeigniter I am trying to send simple email using codeigniter as explain this link codeigniter email class ,but it doesn't work.
This is my form :
<form method="post" action="<?php base_url()?>main/send_email">
               <input type="text" placeholder="Name" name="name" class="name">
               <input type="text" placeholder="Surname" name="surname" class="surname">
               <input type="email" placeholder="email" name="email" class="email">
               <textarea placeholder="What's on your mind" name="text" class="text"></textarea>
               <input type="submit" value="SEND" class="send_mail" name="send_mail">
</form>

And this is my controller
  <?php
    defined('BASEPATH') OR exit('No direct script access allowed');

   class Main extends CI_Controller {
     public function __construct(){
     parent::__construct();
     $this->load->helper("common_helper");

    date_default_timezone_set('Asia/Tbilisi');
 }

public function index()
{

    $this->load->view('pages/main');
}

public function send_email()
{
    $this->load->library("email");
    if($this->input->post("send_mail"))
    {
        $name = $this->input->post("name");
        $surname = $this->input->post("surname");
        $email = $this->input->post("email");
        $text = $this->input->post("text");
         $this->email->from($email, $name);
         $this->email->to('77vanich77@gmail.com');
         $this->email->subject('Email Test');
         $this->email->message('testing email message');

         $this->email->send();
    }

 }
}

I don't have any error.

A: Try the below code.
$email_config = Array(
             'protocol'  => 'smtp',
             'smtp_host' => 'bh-24.webhostbox.net',
             'smtp_port' => '465',
             'smtp_user' => 'feedback@domain.com',
             'smtp_pass' => '12feedback34',
             'mailtype'  => 'html',
             'starttls'  => true,
             'newline'   => "\r\n"
             );
                $this->load->library('email', $email_config);
                $this->email->from($to, 'FEEDBACK');
                $this->email->to('feedback@domain.com');
                $this->email->subject($sub);
                $this->email->message($msg);
                $this->email->send();


Q: Bokeh Categorical Data Heatmap Not Showing I am trying to create a Heatmap from a csv using python pandas.  I keep on getting a blank screen for my output, and I not sure why-- I've exhausted the documentation online to try to figure it out.  My code is as follows:
import numpy as np
from bokeh.io import output_file, show
from bokeh.models import (
    ColumnDataSource,
    HoverTool,
    LinearColorMapper,
    BasicTicker,
    PrintfTickFormatter,
    ColorBar,
    FactorRange
)
from bokeh.plotting import figure
from bokeh.sampledata.unemployment1948 import data
from bokeh.transform import transform

#Initialize DataFrame
df = pd.read_csv("myData.csv")

df.dropna().astype(float)
df.columns.name = 'Month'
df.index.name = 'Facility'

df_1 = pd.DataFrame(df.stack(), columns=['state']).reset_index()
source = ColumnDataSource(df_1)

#Heatmap
colors = ["#75968f", "#a5bab7", "#c9d9d3", "#e2e2e2", "#dfccce", "#ddb7b1", "#cc7878", "#933b41", "#550b1d"]
mapper = LinearColorMapper(palette=colors, low=df_1.state.min(), high=df_1.state.max())

TOOLS = "hover,save,pan,box_zoom,reset,wheel_zoom"

p = figure(title="WSSDM4",
           x_range= list(df.columns), y_range=list(df.index),
           x_axis_location="above", plot_width=1800, plot_height=800,
           tools= TOOLS, toolbar_location='below',
           tooltips=[('Facility', '@Facility'), ('Month', '@Month')])

p.rect(x='Facility', y = 'Month',width=1, height=1, source=source,
        line_color=None, fill_color=transform('state', mapper))

color_bar = ColorBar(color_mapper=mapper, major_label_text_font_size="7px",
                     ticker=BasicTicker(desired_num_ticks=len(colors)),
                     label_standoff=6, border_line_color=None, location=(0, 0))

p.add_layout(color_bar, 'right')

p.axis.axis_line_color = None
p.axis.major_tick_line_color = None
p.axis.major_label_text_font_size = "7px"
p.axis.major_label_standoff = 0
p.xaxis.major_label_orientation = 1.0
show(p)

I am using Jupyter notebooks and have all the up-to-date libraries.
Thank you!

A: I believe your problem is this line:
df.index.name = 'Facility'
All this would do is name the existing df index (which looks like 0, 1, 2, 3...) "Facility," rather than taking the existing Facility column and making it the index. To do that, you'd want:
df = df.set_index('Facility')
I found this discrepancy by adding a bunch of print(df.head()) statements after each line where your code modified the dataset, and doing the same in the original Bokeh heatmap example, and looking for where they diverged. Might be useful in case there are other problems.


Q: GET request variable error in PHP I have a simple PHP code, as below.
When I try the URL localhost/df.php?result1=bharat, I get the result Bharat, exactly as I want it. But when I try the URL localhost/df.php?result2=bharat, I get an error, meaning my result2 variable was not read like my result1 variable did.
Could you please correct my code so that it works?
<?php
if(isset($_GET['Result1']))
{
    $file = $_GET['Result1'];
}
else
{
    echo "Error"; exit;
}
echo "$result1";
?>
elseif(isset($_GET['Result2']))
{
    $file = $_GET['Result2'];
}
else
{
    echo "Error"; exit;
}
echo "$result2";
?>

A: You have way too many errors in your code. The following is the solution to your problem:
<?php
if(isset($_GET['result1']))
{
    $result1 = $_GET['result1'];
    echo $result1;
}
elseif(isset($_GET['result2']))
{
    $result2 = $_GET['result2'];
    echo $result2;
}
else
{
    echo "Error";
    exit();
}
?>

For the future, I would recommend you to learn PHP and be familiar with the basic syntax, at least, before posting questions about it here.