text:
Q: How to correctly terminate processes created with fork() without waiting for their result According to the task, the program must create a copy of itself using fork () to process the task. Parent process must not be blocked while the child is running.
However, I encountered strange behavior of the test program. According to the result of pgrep, child processes are not terminated until the parent program has completed its execution.
Each time fork() is called, pgrep shows that the number of processes is increasing, but they are not terminating.
I wrote a simple program that runs for nearly 35 seconds and spawns a child process 3 times, which should exit after 5 seconds:
#include <stdio.h>
#include <unistd.h>
int main(int argc, char* argv[])
{
    for (int i = 1; i < 36; i++) {
        if (i % 10 == 0) {
            pid_t forkrank = fork();
            if (forkrank == 0) {
                printf("forked process starts\n");
                sleep(5);
                return 1;
            }
        }
        sleep(1);
    }
    return 0;
}

But during its execution, pgrep shows that running processes are not terminated until parent ends:

But if I add a blocking code to wait for the result of the child process execution, then additional processes are terminated correctly:
#include <stdio.h>
#include <unistd.h>
#include <sys/wait.h>
int main(int argc, char* argv[])
{
    for (int i = 1; i < 36; i++) {
        if (i % 10 == 0) {
            pid_t forkrank = fork();
            if (forkrank == 0) {
                printf("forked process starts\n");
                sleep(5);
                return 1;
            }
            int wstatus;
            waitpid(forkrank, &wstatus, 0);
            int retValue = WEXITSTATUS(wstatus);
        }
        sleep(1);
    }
    return 0;
}

pgrep:

Why is this happening? How to terminate child processes without blocking the main one?

A: You could do a non-blocking wait.  This is done by passing the WNOHANG flag as the third parameter to waitpid.  You can also pass -1 for the first argument to allow the parent to wait for any pid.  You would then put the call to waitpid after the call to sleep in the main loop.
#include <stdio.h>
#include <unistd.h>
int main(int argc, char* argv[])
{
    for (int i = 1; i < 36; i++) {
        if (i % 10 == 0) {
            pid_t forkrank = fork();
            if (forkrank == 0) {
                printf("forked process starts\n");
                sleep(5);
                return 1;
            }
        }
        sleep(1);
        waitpid(-1, NULL, WNOHANG);
    }
    return 0;
}

A: The proper term is reaping the children.
This is done using wait/waitpid. The earlier answer shows how to do this using polling, which requires changing your program to periodically call waitpid. But it's also possible to do without making such changes.
To automatically reap the children as they exit, use sigaction to install a SIGCHLD handler which calls waitpid(-1, NULL, WNOHANG) until it returns a 0 or -1.
This has a side-effect. Blocking system calls can now fail with error EINTR unless you have them automatically restarted.

You could also daemonize the child, making it completely independent of the parent process. The process causes them to become children of init (pid 1), and it automatically reaps terminated children.

A: You can do that by passing flag WNOHANG as option to wpaitpid
See (2): waitpid
WNOHANG     return immediately if no child has exited.
waitpid(-1, NULL, WNOHANG);


text:
Q: interval between images in jquery i'm starting to learn jquery and i am now working on an header image crossover with jquery. ive got the code working but what i now need is an interval between images, after the crossover i want the script to pause for a specific time and then continue with the next image.
ive got this code.
$(document).ready(function(e) {
    $('.img:gt(0)').hide();
    setInterval(function(){
        $(".img:first-child").fadeOut(3000).next(".img").fadeIn(3000).end().appendTo("#kop")
    }, 4000);
});

is it possible in this form or do i have to change the code completly.
i now got it running on a test server of mine. swinging.icwebdesign.nl

A: Currently what is happening is you're taking 3000ms to do your transition, and inbetween the transition function call is 4000ms - therefore, you'll only get a 1000ms "delay".
The second parameter in setInterval() is the delay time, which in the code below is equal to the fadeTime + delay time.
$(document).ready(function(e) {
    var delay = 3000,
        fadeTime = 3000;
    $('.img:gt(0)').hide();
    setInterval(function(){
        $(".img:first-child").fadeOut(fadeTime).next(".img").fadeIn(fadeTime).end().appendTo("#kop")
    }, delay+fadeTime);
});

redpajama_set_name: RedPajamaStackExchange


text:
Q: Laravel Pivot table extra date-time field format (Not timestamp) using carbon object I have a pivot table ('offer_usage_detail') in my app, table having 4 field as below
id          int           AutoIncrement
user_id     int           reference to user table
offer_id    int           reference to offer table
use_date    date-time     Store date time when user use offer

I need to show list of user who used offer with date and time in d-m-Y H:i format.
So i added below code in my offer model
 public function user() {
    return $this->belongsToMany('User', 'offer_usage_detail', 'offer_id', 'user_id')->withPivot('use_time');
}

Currently i m using core php's date function with strtotime to format date time, But i want to know is there any way to convert Pivot tables date time fields to carbon object.
I tried putting use_time field in Offer Model's   protected $dates = array('created_at','use_time'); but it didn't worked.
Is it possible to convert extra pivot table column to carbon object if column is date time field?

A: The best solution I would suggest is creating custom pivot model for this relation:
// Offer model (the same goes for the User model, but change to 'instanceof Offer`
public function newPivot(Eloquent $parent, array $attributes, $table, $exists)
{
    if ($parent instanceof User) return new OfferUserPivot($parent, $attributes, $table, $exists);

    return parent::newPivot($parent, $attributes, $table, $exists);
}

// OfferUserPivot
use Illuminate\Database\Eloquent\Relations\Pivot;

class OfferUserPivot extends Pivot {
   // override either property:
   protected $dates = ['use_time'];

   // or method:
   // public function getDates()
   // {
   //   return ['use_time']; // and other columns like created_at etc if you like
   // }
}

// Then you can do this:
$user->offers->first()->pivot->useTime; // Carbon object
$offer->users->first()->pivot->useTime; // Carbon object

A: You can try this solution.
return $this->belongsToMany('App\Role')->withTimestamps();


text:
Q: HTML dropdown manipulated with JQuery not showing I am trying to update an HTML dropdown with JSON data from from Django backend.
When console logged, I can see the needed changes, but it doesn't reflect in the HTML document so I can select.
HTML code:

       Local Government
       <select id="lga" class="listing-input hero__form-input  form-control custom-select">
           <option value="">Select an option</option>
       </select>

Javascript Code:
$(document).ready(function(){
        $("#id_form1-state").on("change", function() {
            var stateID = $("#id_form1-state")[0]['value'];

            if(stateID){
                var selectBox = document.getElementById("lga");

                $.ajax({
                    type: "GET",
                    url: loadCitiesURL,
                    dataType: "JSON",
                    data: {
                        stateID: stateID,
                        csrfmiddlewaretoken: csrfToken
                    },
                    success: function(data){
                        $.each(JSON.parse(data), function(index, option){
                            selectBox[index] = new Option(option['fields']['name'], index, false, false)
                        });
                        console.log(selectBox);
                    }
                });
            }
        });
    });

Result page (Not displaying dropdown);

Update
Added the response from the server:
[{"model": "properties.lga", "pk": 2, "fields": {"name": "Ikpoba-Okha"}}, {"model": "properties.lga", "pk": 1, "fields": {"name": "Oredo"}}]

# handled with JSON.parse


text:
Q: Allocate CUDA pinned memory in a Fortran program with C wrapper (WITHOUT PGI CUDA Fortran) I am trying to let a Fortran program (main) write/read pinned memory allocated by CUDA C/C++, but tests show even cudaHostAlloc from a C wrapper would return error.
Fortran accessing CUDA C/C++ malloc memory can be done following "Passing allocatable array from fortran to C and malloc it", however, simply substituting malloc with cudaMallocHost or cudaHostAlloc will return cudaErrorMemoryAllocation (can successfully compile).
ifort is used for Fortran. Below is the not working code:
*edited to include the whole script
//CUDA C/C++ host function in "cudaMallocHost.cu"
#include <cuda.h>
#include <cuda_runtime_api.h>
#include <cstdio>

extern "C" {
int *alloc_test(size_t size) {
    int *a;
    size_t fm, gm;
    cudaMemGetInfo(&fm, &gm);
    printf("GPU memory usage: %lu/%lu MB\n", fm / 1024 / 1024,
            gm / 1024 / 1024);
    cudaHostAlloc((void **) &(a), sizeof(int) * size, cudaHostAllocDefault);
    printf("%s\n", cudaGetErrorString(cudaGetLastError()));
    //       a=(int*) malloc(sizeof(int) * 4);  // 'malloc' works
    return a;
}
void destroy_test(int *ptr) {
    cudaFreeHost(ptr);
    printf("%s\n", cudaGetErrorString(cudaGetLastError()));
    //       free(ptr);
}
}

! FORTRAN program in "main.f"
    PROGRAM fortran_side
      USE ISO_C_BINDING
      IMPLICIT NONE
      INTERFACE
        FUNCTION alloc_test(s) BIND(C, NAME='alloc_test')
          USE ISO_C_BINDING
          IMPLICIT NONE
          TYPE(C_PTR)   :: alloc_test
          INTEGER(C_SIZE_T) :: s
        END FUNCTION alloc_test
        SUBROUTINE destroy_test(p) BIND(C, NAME='destroy_test')
          USE, INTRINSIC :: ISO_C_BINDING, ONLY: C_PTR
          IMPLICIT NONE
          TYPE(C_PTR), INTENT(IN), VALUE :: p
        END SUBROUTINE destroy_test
      END INTERFACE

      TYPE(C_PTR) :: p
      INTEGER(C_INT), POINTER :: array(:)
      INTEGER(C_SIZE_T)       :: sz
      INTEGER(4)              :: i

      sz=4
      p = alloc_test(sz)
      CALL C_F_POINTER(p, array, [sz])

      DO i=1,sz
        array(i)=i*3
      END DO

      PRINT*,array

      CALL destroy_test(p)
    END PROGRAM fortran_side

#Makefile
all: cudaMallocHost.o main.f
    ifort -L/Developer/NVIDIA/CUDA-8.0/lib -lcudart -lcufft -O0 -132 \
        cudaMallocHost.o main.f -o ./test

clean:
    rm  -f *.o *.mod ./test
%.o: %.cu
    nvcc -arch sm_30 -O0 -c $*.cu -o $*.o

Output:
GPU memory usage: 836/2047 MB
out of memory
forrtl: severe (174): SIGSEGV, segmentation fault occurred

Is cudaMallocHost doable in a Fortran main program? I have tried PGI CUDA Fortran and it can have this done quite easily, without involving Fortran/C mixed programing. I have also tried pure CUDA cudaMallocHost and it also works on my system (Mac).

A: The C function
int *alloc_test(size_t size)

expects its argument by value, but your Fortran interface passes it by reference
    FUNCTION alloc_test(s) BIND(C, NAME='alloc_test')
      ...
      INTEGER(C_SIZE_T) :: s

to pass it by value use
      INTEGER(C_SIZE_T), VALUE :: s


text:
Q: Divs incorrect placement after showing in intervals (fiddle included) I am having problems with my JavaScript code. I am implementing a card game where I click a button and 13 cards are supposed to show up in intervals.

$("button").click(function() {
 let i = 0;
 setInterval(function() {
   if(i == 4) clearInterval();
   $(".block").eq(i).css({visibility:"visible"});
   $(".block").eq(i).html("TEXT" + i);
    i++;
  },100);
});
.block {
  display: inline-block;
  width: 100px;
  height: 140px;
  border: 2px solid;
  visibility: hidden;
}

button {
  position: absolute;
  top: 170px;
  left: 50px;
}

    <button id="button">Generate!</button>

As seen above, I use the setInterval() function to display them with 100ms intervals, all the divs do what I tell them to do but they first appear quite below where I want them to be. How can I make it so that they appear in the correct places directly?
Thanks in advance!

A: Add vertical-align: top; to your inline elements

$("button").click(function() {
 let i = 0;
 setInterval(function() {
   if(i == 4) clearInterval();
   $(".block").eq(i).css({visibility:"visible"});
   $(".block").eq(i).html("TEXT" + i);
    i++;
  },100);
});
.block {
  display: inline-block;
  width: 100px;
  height: 140px;
  border: 2px solid;
  visibility: hidden;
  vertical-align: top;
}

button {
  position: absolute;
  top: 170px;
  left: 50px;
}

    <button id="button">Generate!</button>

A: Setting the blocks to display: none and then adding display: inline-block is a way of getting around the problem, but doesn't fix the problem itself.
The main issue is the vertical-align property set on the block class. By default, this is set to baseline. Before your button is clicked, all your divs are lined up in a row, invisible, with their baseline set to the bottom of the div. However, when the button is clicked, not only do your blocks become visible, but more crucially, you add some text inside the div. This changes the baseline, making it the bottom of the text within the div instead. However, because of vertical-align: baseline, the baselines of all the divs in the row try to align. The baseline of the visible divs with text has to align with the baseline of the invisible divs with no text. But their baselines are now different, so the only way they can all sit in a straight line on their baselines would be if the divs with text are pushed down.
I've simplified your snippets to show you what I mean. I've made the divs visible, removed the button, and instead, have manually added some text into your divs in html. As you can see, for the divs with text, the bottom of the text aligns with the bottom of the div without text.

body {
  background: white;
 }

.block {
  display: inline-block;
  width: 100px;
  height: 140px;
  border: 2px solid;
}

TEXT

TEXT

TEXT

The reason why changing the blocks to display: none in the beginning, and then displaying them one by one works is because in this case, there is never a point when textless divs and divs with text are present in the DOM at the same time, so there is never a mismatch of baselines. The divs enter the DOM with text in them, and so their baselines always match up. However, this doesn't entirely fix the issue. If the text in the divs were of different lengths, for instance, the bottom of the multiline text would match up with the bottom of the single-line text, resulting in misalignment once again.
Example:

body {
  background: white;
 }

.block {
  display: inline-block;
  width: 100px;
  height: 140px;
  border: 2px solid;
}

text

text

very long text which takes up more than one line

text

So the proper fix for this would be to add vertical-align: top to the block class, to make sure that our alignment doesn't jump all over the place in response to the changing baseline.

A: You can put a wrapper div around the .block elements.

    <button id="button">Generate!</button>

And then the CSS:
.container {
  display: flex;
}
.block {
  /* display: inline-block; */
  width: 100px;
  height: 140px;
  border: 2px solid;
  visibility: hidden;

  margin-left: 15px;
}

I added a margin-left to all the .block elements, but you can of course set them with the flex display or however you want.

A: You can set your .block element to display: none; instead of visibility: hidden; and change your script into this:
 $("button").click(function() {
    let i = 0;
    setInterval(function() {
    if(i == 4) clearInterval();
    $(".block").eq(i).css({display:"inline-block"});
    $(".block").eq(i).html("TEXT" + i);
    i++;
  },100);
});

Fiddle

A: Here is a working fiddle.
You could set the height to 0 then set it in the interval function.
$("button").click(function() {
    let i = 0;
    setInterval(function() {
    if(i == 4) clearInterval();
    $(".block").eq(i).css({visibility:"visible", height: "140px"});
    $(".block").eq(i).html("TEXT" + i);
    i++;
  },100);
});

With this css:
.block {
  display: inline-block;
  width: 100px;
  height: 0;
  border: 2px solid;
  visibility: hidden;
}

button {
  position: absolute;
  top: 170px;
  left: 50px;
}


text:
Q: In Python: how to verify if file has been downloaded correctly before opening it Is there a way to verify the file is valid before attempting to open it? The most simplistic way is to see if the file is 0 bytes in size. But I have encountered a situation when non-zero files are damaged/incomplete (mostly as a result of interrupted download). I wonder if there is some file header or other "common" place "inside" of every file where this information is recorded so it could be used to verify if the file is "completed" or it is 100% of what it is supposed to be...in term of data of course.
Edited later:
I am using urllib.urlretrieve(url_source, local_destination) to download the file. Is there a way to verify after download a destination file is the same file-size as the source?

A: Whether a file is valid or not largely depends on what it means for the file to be valid. There is nothing that says a stream of random bytes is necessarily invalid without any sort of context. To ask "is this a valid file?" without any information should always result in "Maybe, who knows, can you provide more details?"
For example, one technique is to specify that the first n bytes of the file begins with a sequence of bytes, and then any readers would simply check the first n bytes.
There are many ways to check the validity of a file.
In your case, when you issue an HTTP request, the response may (or should) include the size of the content that you are requesting in a header called content-length. You can compare the size of the file that you download against the size that the response sent.
So for example:
data = urllib.urlretrieve(url, targetPath)
msg = data[1]
print(msg.getheader("content-length"))


text:
Q: Не выполняется скрипт Я не знаю что с ним просиходит, но дела плохи.
number = int(input("Введите \033[01;38;05;34mчисло\033[0m\n>>>"))

for item in range(number+1, 2):
    if number%item==0:
        print("÷\033[01;38;05;157m{item}\o33[0m: \033[01;38;05;34m" + "v\033[0m")
    else:
        print("÷\033[01;38;05;157m{item}\o33[0m: \033[01;38;05;196m" + "x\033[0m")

От этого простого скрипта сходят с ума все компилеры, а pydroid и вовсе пишет ерунду. Помогите пожалуйста, что это и как это решить.

A: *

*Во первых, у вас какой-то странный цикл for

*Во вторых, вы забыли добавить f перед строкой, поэтому у вас просто выведется {item}

*В третьих, вместо \033, вы написали \o33


text:
Q: Developing task bar applets for Cinnamon: How to reload the code? Working on a Cinnamon Javascript applet (Example).
How can I reload the code, so that the applet in the task bar reflects the changes I make in the Javascript?
Manually removing the applet from the task bar and then re-adding it seems not to reload the code, and is cumbersome anyway. I have to log off and log in again to see the changes.

A: Copying from my other answer:
Use the Melange-Cinnamon debugger. To open it:

*

*Right click on the task bar and select Troubleshoot → Looking Glass.

*Alternatively, press Win key + L.

*Alternatively, press Alt + F2 → type "lg" → Enter.

Reload the code of the applet by finding the applet under the extensions tab, right click → reload code.

A: You can also reload the applet through command line, using
dbus-send --session --dest=org.Cinnamon.LookingGlass --type=method_call /org/Cinnamon/LookingGlass org.Cinnamon.LookingGlass.ReloadExtension string:'appletUUID' string:'APPLET'


text:
Q: HTML contenteditable, BR меняет высоту Tcnm div с такой вот разметкой:

.option__input {
    font-size: 100%;
    border: 0.075em solid black;
    border-radius: 0.3em;
    min-width: 7em;
    max-width: 10em;
    min-height: 1.5em;
    line-height: 1.5em;
    box-sizing: border-box;
    white-space: normal;
    word-break: break-all;
    padding: 0 0.5em;
  outline:none;
}
div{
  display:inline-block;
}

Другое

Когда первый раз вводится текст, добавляется br и немного увеличивает высоту.
Как можно от этого избавиться?

*

*Изображение, до ввода текста:

*Изображение, введен пробел:

В Chrome все работает, как надо. А вот в Firefox, происходит вышеописанное.


text:
Q: How to access parent objects scope of variables? I just started learning about module Javascript. I have objects called buoys, and there are multiple types of buoys (These are basically popups).
Live chat is one of those types.
I'm converting all of my code to a more module like structure, and I have ran across something problematic.
The code is below, I will leave comments to the parts that need attention.
Look inside the cacheDom function inside the variable $liveChat.
The reason I have this liveChat as a child element (Opposed to just putting all of its methods in the parent class) is because it will have unique methods, that would not apply to everything in the parents class. Keep in mind, I am going to have multiple types of buoys. LiveChat is just the only one I have created so far. And these functions that I am going to put in liveChat are going to be unique to liveChat buoys.
/* Buoy */
(function{
    var buoy = {
        init: function () {
            this.liveChat.init();
            this.cacheDom();
            this.bindEvents();
        },
        cacheDom: function () {
            this.liveChat.cacheDom();

            this.$document = $(document);

            this.$buoyContainer = $("#buoy-container");
            this.$buoy = this.$buoyContainer.find(".buoy");
            this.$addDream = this.$buoyContainer.find(".buoy.addDream");
            this.$scheduleDream = this.$buoyContainer.find(".buoy.live-chat");
        },
        bindEvents: function () {
            this.liveChat.bindEvents();
            /* Remove Focus */
            this.$document.on("click", this.removeFocusAll.bind(this.$buoy));
            /* Add Focus */
            this.$buoy.on("click", this.addFocus);
            this.$liveChat.on("click",)
        },
        addFocus: function () {
            this.addClass("focus");
        },
        removeFocus: function () {
            this.removeClass("focus");
        },
        /* Live chat */
        liveChat: {
            init: function () {

            },
            cacheDom: function () {
                //This is where I need to access the parent variable "$document" which is initialized in the parents cacheDom method
            },
            bindEvents: function () {

            }
        }
    }
    buoy.init();
}());

A: You could pass in this to the child, then set it as this.parent
var buoy = {
  init: function() {
    this.liveChat.init(this);
    this.cacheDom();
    this.bindEvents();
  },
  // ...
  liveChat: {
    init: function(parent) {
      this.parent = parent;
    },
    cacheDom: function() {
      //This is where I need to access the parent variable "$document" which is initialized in the parents cacheDom method
      this.parent.$document // do whatever you want here.
    },
    // ...
  }
}


text:
Q: How to add numbers occuring in a text? How make LaTeX to remember some numbers and output the total sum by calling another command? Consider this example:
\documentclass{article}

\usepackage{lipsum}

\begin{document}

The price of the first item is \pr{10.23}, that of the second item is

\pr{2.30}.

%% The command \pr{10.23} should print the number 10.23 (perhaps with unit) and then remember it for the total sum.

The total so far  is \prsum the overall total sum is \prallsum.
%% should print 12.53 and 14.86.
There is another item about \pr{2.33}.

Not the total sum so far is \prsum and the overall total sum is \prallsum

%% This should print 14.86 in both cases.

\end{document}

A: You can use xparse and expl3:
\documentclass{article}
\usepackage{xparse}

\ExplSyntaxOn

\fp_new:N \g_student_sum_fp
\fp_new:N \g_student_total_fp

\NewDocumentCommand{\pr}{m}
 {
  \fp_eval:n { #1 } % print the value
  \fp_gadd:Nn \g_student_sum_fp { #1 } % add to the global container
 }
\DeclareExpandableDocumentCommand{\prsum}{}
 {
  \fp_eval:n { \g_student_sum_fp }
 }
\DeclareExpandableDocumentCommand{\prallsum}{}
 {
  \fp_eval:n { \g_student_total_fp }
 }

\AtEndDocument
 {
  \iow_now:cx { @auxout }
   {
    \ExplSyntaxOn ^^J
    \fp_gset:Nn \exp_not:N \g_student_total_fp { \fp_eval:n { \g_student_sum_fp } } ^^J
    \ExplSyntaxOff ^^J
   }
 }

\ExplSyntaxOff

\begin{document}

The price of the first item is \pr{10.23}, that of the second item is
\pr{2.30}.

The total so far is \prsum{} and the overall total sum is \prallsum.

There is another item about \pr{2.33}.

Now the total sum so far is \prsum{} and the overall total sum is \prallsum.

\end{document}

The macros should be sufficiently clear: \pr prints the given value and updates the total; at end document, the total is written in a suitable way in the aux file.

A warning might be added if the values of \g_student_sum_fp and \g_student_total_fp are different, telling the user that a new LaTeX run is needed: change the code from \AtEndDocument to \ExplSyntaxOff into
\AtEndDocument
 {
  \iow_now:cx { @auxout }
   {
    \ExplSyntaxOn ^^J
    \fp_gset:Nn \exp_not:N \g_student_total_fp { \fp_eval:n { \g_student_sum_fp } } ^^J
    \ExplSyntaxOff ^^J
   }
  \fp_compare:nF { \g_student_sum_fp = \g_student_total_fp }
   {
    \msg_warning:nn { student/sum } { rerun }
   }
 }

\msg_new:nnn { student/sum } { rerun }
 {
  Value~for~\exp_not:N \prallsum has~changed.~Rerun~LaTeX
 }

\ExplSyntaxOff

In case the value has changed from the previous run, you get the warning
*************************************************
* student/sum warning: "rerun"
*
* Value for \prallsum has changed. Rerun LaTeX
*************************************************

A: Here is a solution using the minifp package and some aux file magic (and so you need to run the file through latex twice to get the correct values).
\documentclass{article}
\usepackage{minifp}

\makeatletter
\newcommand*\@subtotal{0}
\newcommand*\pr[1]{%
    #1%
    \MFPadd{\@subtotal}{#1}\@subtotal\relax%
    \MFPstrip{\@subtotal}\@subtotal}
\newcommand*\prsum{\@subtotal}
\def\student@allsum{???}
\gdef\prallsum{\student@allsum}

\AtEndDocument{%
    \write\@auxout{\string\gdef\string\student@allsum{\@subtotal}}}
\makeatother

\begin{document}
The price of the first item is \pr{10.23}, that of the second item is

\pr{2.30}.

The total so far  is \prsum{} the overall total sum is \prallsum.
There is another item about \pr{2.33}.

Not the total sum so far is \prsum{} and the overall total sum is \prallsum.
\end{document}

Discussion
The command
\newcommand*\pr[1]{%
    #1%
    \MFPadd{\@subtotal}{#1}\@subtotal\relax%
    \MFPstrip{\@subtotal}\@subtotal}

defines the \pr macro, so that it first prints the input value (assumed to be a decimal number}, and adds it to the subtotal using the \MFPadd function of the minifp package. It then strips the trailing zeros using the \MFPstrip function. (Side note: minifp performs fixed-point arithmetic with up to 8 decimal places.)
The command \prsum just prints the subtotal; noticed that in the course of the text I've edited your file to use \prsum{} instead, to avoide the macro gobbling up the space afterwards. If you are only using \prsum in text, you can use xspace to circumvent this need.
To print the overall total sum, what we do is, at the end of the document (when you write \end{document}, write to the .aux file the current subtotal. We do this by writing it as a command definition: after running pdflatex on your file, the .aux file should contain the line
\gdef\student@allsum{14.86}

This line is read back into the stream around \begin{document} (when the aux file is read), and so overwrites the original definition of \student@allsum to be ???. We have to include an original definition because, before the first pass of pdflatex, the command \student@allsum would otherwise be undefined (since the aux file is generated during the run, and is not available to be read before the first run).
Notice that this means, like resolving label-references, that to update the correct value from \prallsum you need to run pdflatex at least twice after changing the file.


text:
Q: While Login from Cordova app server sends Object reference not null I am sending login details from a Cordova app in the asp.net service layer. It checks for sender referrer. In our Cordova app we have file://. Is it good to use this as referer in the service layer?
If it's not please tell any other good way to authorise my customer app?


text:
Q: Why is this javascript function not able to call this other function? I have a simple function that uses javascript to write a table to the body of a webpage. If I call the function directly when the submit button is pressed, it calls the function and it executes properly, but if I wrap the function in another function, such as function constructor()..., it doesn't do anything. I'm very new to javascript and am really just looking for an explanation of why this works the way that it does.
function makeTable(){
var body = document.body,
    tbl = document.createElement('table');
tbl.style.width  = '100px';
tbl.style.border = '1px solid black';
for(var i = 0; i < 2; i++){
    var row = tbl.insertRow();
    for(var j = 0; j < 2; j++){
            var cell = row.insertCell();
            cell.style.border = '1px solid black';
            var myText = document.createTextNode("some val");
            cell.appendChild(myText);
        }
    }
    body.appendChild(tbl);
}

function constructor(){
maketable();
}

The HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

    <title>JS Test</title>
    <meta http-equiv="content-type" content="text/html;charset=utf-8" />
    <meta name="generator" content="Geany 1.27" />

    <form>
    </form>
    <input type="submit" value="Submit" onclick="makeTable()"/>

A: look at how u spelled the function!!
function constructor(){
    maketable();
}

It should be makeTable();
:D


text:
Q: Intel RFLAGS and POPFQ PUSHFQ? Reading up on EFLAGS, got me thinking, what about 64 bit flag register? Is this register only 32bit? I looked online, and there is extended to 64bits with RFLAGS. I looked it up in the Intel Guide, and it simply says,

RFLAGS Register in 64-Bit Mode
  In 64-bit mode, EFLAGS is extended to 64 bits and called RFLAGS. The upper 32 bits of RFLAGS register is reserved. The lower 32 bits of RFLAGS is the same as EFLAGS.

I wasn't sure however, what "reserved" means. Does anything use RFLAGS? Is it used internally by Intel? The docs seem to suggest that the register is 64 bit, but is there any way to even interact with the upper 32 bits when PUSHFD and POPFD seem to be double words, and quad words. Will a future processor likely deliver PUSHFQ and POPFQ?

If a calling procedure needs to maintain the state of the EFLAGS register, it can save and restore all or part of the
  register using the PUSHF/PUSHFD and POPF/POPFD instructions. The PUSHF instruction pushes the lower word of the EFLAGS register on the stack, while the PUSHFD instruction pushes the entire register. The POPF instruction pops a word from the stack into the lower word of the EFLAGS register, while the POPFD instruction pops a double word from the stack into the register.

A: Sometimes it's useful to distinguish between the ISA (the architecture presented to programmers) and the internal implementation (what actually happens in silicon). As far as the ISA is concerned, RFLAGS is a 64-bit register (where most bits are reserved), and as far as the internal implementation is concerned (in theory) different CPUs can do whatever they like and some may only implement a 24-bit register because all the reserved bits don't really need to be implemented.
Note that when the sizes are increased CPU manufacturers mostly just add more bits onto existing registers. This means that RFLAGS, EFLAGS and FLAGS are the same register; it's just that RFLAGS is the whole register, EFLAGS is the lower 32 bits only, and FLAGS is the lower 16 bits only.
For RFLAGS (and previous EFLAGS and FLAGS); "reserved" means that it's reserved for future CPUs. This means that software should never set these bits and software should not rely on the value of these bits (so that software doesn't break on future CPUs if/when new features are added to the ISA and the bits are actually used for something new).
PUSHFQ and POPFQ have existed since the introduction of 64-bit/long mode (about 15 years now).


text:
Q: Обработка текста Есть текст
   Ибица На телевидении
    MMS :/ / 81.174.67.45/ibizaontv
    ТМФ танца
    MMS :/ / 94.75.250.121:554 / 39987 @ 662299? MSWMExt =. ASF
    Worm ТВ
    MMS :/ / wms.global-streaming.net/04988

Нужно обработать это в array массив
array 1
Ибица На телевидении , MMS :/ / 81.174.67.45/ibizaontv

Как с помощью php выдергивать строчку 1 и 2 и так все сначала в новый массив
A: предлагаю сделать двумерный массив
'myfile.txt'- входной файл.
код
$filearray=file('myfile.txt');
$outarray=array();
$sub_array=array();
foreach ($filearray as $key => $value)
    {
       $sub_array[]=$value;
       if (count($sub_array)==2)
       {
           $outarray[]=$sub_array;
           $sub_array=array();
       }
    }
var_dump($outarray);

результат
array(3) {
   [0]=> array(2) { [0]=> string(26) " Ибица На телевидении " [1]=> string(38) " MMS :/ / 81.174.67.45/ibizaontv " }
   [1]=> array(2) { [0]=> string(16) " ТМФ танца " [1]=> string(66) " MMS :/ / 94.75.250.121:554 / 39987 @ 662299? MSWMExt =. ASF " }
   [2]=> array(2) { [0]=> string(14) " Worm ТВ " [1]=> string(43) " MMS :/ / wms.global-streaming.net/04988" }
}


text:
Q: Get list of test classes to be executed in JUnit 5 I have a test in my suite that requires a specific type of log to be in Azure's OMS resource. My approach is to insert these logs at the very beginning of my test run, before any tests have been executed, and to run the specific test fixture that needs them last. I do this because the SLA for OMS is not reliable. Logs do not appear instantly in log analytics, they take a few minutes to propagate.
My question is: is it possible to peek into the TestPlan object to see the list of classes to be run? I do not need to do this OMS log injection if I am not running the fixture that needs it (example: running a subset of the entire suite, debugging a single test, etc...). The entire test suite is run using the mvn clean install command, and I frequently execute and debug single tests using the built in JUnit5 runner in intellij

A: Launch the JUnit Platform in your own program to discover all test classes that Jupiter will execute. With this you get a handle to the test plan for each registered test engine:
LauncherDiscoveryRequest request = LauncherDiscoveryRequestBuilder.request()
    .selectors(
        selectPackage("com.example.mytests"),
        selectClass(MyTestClass.class)
    )
    .filters(
        includeClassNamePatterns(".*Tests")
    )
    .build();

Launcher launcher = LauncherFactory.create();

TestPlan testPlan = launcher.discover(request);

// Examine testPlan for Jupiter-based test classes...

See https://junit.org/junit5/docs/current/user-guide/#launcher-api-discovery for details.
No, there's no Maven plugin that supports a dry-run mode.


text:
Q: PHP: Can't add array to array correctly I am creating new arrays and then adding these into a 'parent' array. Each of the new arrays represents a day Sunday to Saturday. Each of the days is an array itself and I am trying to preserve the name of the day as the key. This is the output I am getting at the moment (copied from Chrome):
array(3) {
  ["active"]=>
  string(0) ""
  ["start"]=>
  int(1440219600)
  ["end"]=>
  int(1440221400)
}
array(8) {
  ["Sunday"]=>
  array(3) {
    ["active"]=>
    string(2) "no"
    ["start"]=>
    int(1440219600)
    ["end"]=>
    int(1440221400)
  }
  ["Monday"]=>
  array(3) {
    ["active"]=>
    string(2) "no"
    ["start"]=>
    int(1440219600)
    ["end"]=>
    int(1440221400)
  }
  ["Tuesday"]=>
  array(3) {
    ["active"]=>
    string(2) "no"
    ["start"]=>
    int(1440219600)
    ["end"]=>
    int(1440221400)
  }
  ["Wednesday"]=>
  array(3) {
    ["active"]=>
    string(3) "yes"
    ["start"]=>
    int(1440219600)
    ["end"]=>
    int(1440221400)
  }
  ["Thursday"]=>
  array(3) {
    ["active"]=>
    string(2) "no"
    ["start"]=>
    int(1440219600)
    ["end"]=>
    int(1440221400)
  }
  ["Friday"]=>
  array(3) {
    ["active"]=>
    string(2) "no"
    ["start"]=>
    int(1440219600)
    ["end"]=>
    int(1440221400)
  }
  ["Saturday"]=>
  array(3) {
    ["active"]=>
    string(2) "no"
    ["start"]=>
    int(1440219600)
    ["end"]=>
    int(1440221400)
  }
  ["exceptional_days"]=>
  array(3) {
    ["active"]=>
    string(0) ""
    ["start"]=>
    int(1440219600)
    ["end"]=>
    int(1440221400)
  }
}

As you can see, Sunday is NOT the key of the first array, instead it is the key of the second array. 'exceptional days' should be empty.
Here is my code:
$newWorkerSchedule = array();
$keys = array_keys($workerSchedule);
for($i = 0; $i < count($workerSchedule); $i++) {
    if (is_array($workerSchedule[$keys[$i]])) {
        $oldStart = $workerSchedule[$keys[$i]]['start'];
        $oldEnd = $workerSchedule[$keys[$i]]['end'];
        if($oldEnd == '00:00') {
            $oldEnd = '23:59';
        }
        $oldStart = strtotime($oldStart);
        $oldEnd = strtotime($oldEnd);
        $newStart = strtotime('+' . $timeZoneDiffHours . ' hours', $oldStart);
        $newEnd = strtotime('+' . $timeZoneDiffHours . ' hours', $oldEnd);
        $dayStart = strtotime('00:00');
        $dayEnd = strtotime('23:59');
        $timeSlotArray = array('active'=>$workerSchedule[$keys[$i]]['active'],'start'=>$newStart,'end'=>$newEnd);
        $newWorkerSchedule[$keys[$i]] = $timeSlotArray;
    }
}

Why is there an additional array being created at the beginning?
EDIT: As requested, the $workerSchedule array:
array(8) {
  ["Sunday"]=>
  array(3) {
    ["active"]=>
    string(2) "no"
    ["start"]=>
    string(5) "00:00"
    ["end"]=>
    string(5) "00:30"
  }
  ["Monday"]=>
  array(3) {
    ["active"]=>
    string(2) "no"
    ["start"]=>
    string(5) "00:00"
    ["end"]=>
    string(5) "00:30"
  }
  ["Tuesday"]=>
  array(3) {
    ["active"]=>
    string(2) "no"
    ["start"]=>
    string(5) "00:00"
    ["end"]=>
    string(5) "00:30"
  }
  ["Wednesday"]=>
  array(3) {
    ["active"]=>
    string(3) "yes"
    ["start"]=>
    string(5) "00:00"
    ["end"]=>
    string(5) "00:30"
  }
  ["Thursday"]=>
  array(3) {
    ["active"]=>
    string(2) "no"
    ["start"]=>
    string(5) "00:00"
    ["end"]=>
    string(5) "00:30"
  }
  ["Friday"]=>
  array(3) {
    ["active"]=>
    string(2) "no"
    ["start"]=>
    string(5) "00:00"
    ["end"]=>
    string(5) "00:30"
  }
  ["Saturday"]=>
  array(3) {
    ["active"]=>
    string(2) "no"
    ["start"]=>
    string(5) "00:00"
    ["end"]=>
    string(5) "00:30"
  }
  ["exceptional_days"]=>
  string(0) ""
}

A: It is being created because you have it on your $workerSchedule array. So, you should check the results of var_dump($workerShedule).
A quick way to sort it out, would be to start your loop from i=1 instead of i=0.
However, you should always prefer using a simple foreach, it will make your code more readable, since you won't need to call keys[$i] all the time... eg.
foreach ($array as $key => $value)


text:
Q: What preposition should I use in this phrase? I wnat to say 'this ilness invoves women who are in their fertility age'.
Which preposition is appropriate?
Should I use related to or relating to
which is an inflammatory disease RELATING TO/ RELATED TO estrogen and it involves 2 to 10 percent of the women IN/AT/INSIDE their fertility age range.
If none of them is good enough to be used in this sentence, please share your ideas.
Thank you

A: Either:

This illness involves women who are of childbearing age.

-or-

This illness involves women who are in their childbearing years.

The adjective "childbearing" means capable of, suitable for, or relating to the bearing of a child or of children.  The first sentence above is probably more precise, but the second sentence above is probably how more people would say it.  The caveat with the second sentence, however, is that some might infer that it only effects women who have actually had children, which is why the first one is probably better.


text:
Q: How should I program this controllers ActionResult method with this simple Create View for my ASP.NET MVC3 view? I'm not sure if I should use a FormsCollection or something else, with this basic Create view.
(note: I'm using a custom editor template for the Tags ICollection<string>)
Model
public class Question
{
    [Required, StringLength(100)]
    public string Title { get; set; }
    [Required]
    public string Body { get; set; }
    public ICollection<string> Tags { get; set; }
}

View
@model AWing.Core.Entities.Product

@{
    ViewBag.Title = "Create";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

Create

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Question</legend>

            @Html.LabelFor(model => model.Name)

            @Html.EditorFor(model => model.Name)
            @Html.ValidationMessageFor(model => model.Name)

            @Html.LabelFor(model => model.Description)

            @Html.EditorFor(model => model.Description)
            @Html.ValidationMessageFor(model => model.Description)

            @Html.LabelFor(model => model.Tags)

            @Html.EditorFor(model => model.Tags, "tags")
            @Html.ValidationMessageFor(model => model.Tags)

            <input type="submit" value="Create a new product" />

    </fieldset>
}

Controller
[HttpPost]
public ActionResult Create(FormsCollection formsCollection)
{
  ... ????
}

or something else?
[HttpPost]
public ActionResult Create(... ??? ...)
{
  .... ????
}

A: Since you have a strongly typed View, you can have your [HttpPost] method take that same type as the variable, e.g.:
[HttpPost]
public ActionResult Create(Product model)
{
    if (ModelState.IsValid)
    {
        // add new product
        .... ????
    }
}

The DefaultModelBinder will take the values returned, and plug them into your strongly typed model.  Viola!
As long as the model for your template for your tags collection is of type string, MVC will iterate through the collection, so that it can be bound (though you may have to change from ICollection to List).
UPDATE
As we discussed in the comments, rather than creating one textbox per tag, create a separate ViewModel which has all of your other Product properties.
Instead of using List<string> Tags in your ViewModel, create this property:
public string TagCollection { get; set; }

In your view, have a textbox for TagCollection. Then, in your Create action, you can parse the TagCollection string into your list of tags.


text:
Q: Django composition clean forms don't work correctly class RegisterForm(forms.ModelForm):
    ...
    class Meta:
        model = CreateUser
        ...
    def clean(self, password1, password2, error_key="password"):
        symbols = ['$', '@', '#', '%', '!']
        password1 = self.cleaned_data.get('password')
        password2 = self.cleaned_data.get('password2')
        errors = dict()
        if password1 and password2:
            if password1 != password2:
                errors[error_key] = "Passwords do not match"
                raise forms.ValidationError(errors)
            if not any(symbol in symbols for symbol in password1):
                s = ", "
                errors[error_key] = f"Passwords don\'t have symbols like {s.join(symbols)}"
                raise forms.ValidationError(errors)
            if not any(char.isdigit() for char in password1):
                errors[error_key] = "Password should have at least one numeral"
                raise forms.ValidationError(errors)
            if not any(char.isupper() for char in password1):
                errors[error_key] = "Password should have at least one uppercase letter"
                raise forms.ValidationError(errors)
            if not any(char.islower() for char in password1):
                errors[error_key] = "Password should have at least one lowercase letter"
                raise forms.ValidationError(errors)
        return self.cleaned_data

class SetPasswordsForm(forms.Form):
    ...
    def __init__(self, user, *args, **kwargs):
        self.user = user
        self.register = RegisterForm
        super().__init__(*args, **kwargs)

    def clean(self):
        password1 = self.cleaned_data.get('new_password')
        password2 = self.cleaned_data.get('confirm_new_password')
        self.register.clean(self, password1, password2, error_key="new_password")
        return self.cleaned_data

I want composition class and function and override this in django, I created my own User, and now i created my own validation but i dont want duplicate code-lines.
Why this second function clean don't work correctly? ;/

A: On this line you call the clean RegisterForm method.
self.register.clean(self, password1, password2, error_key="new_password")

But you create the form and you don't set the data, and the form has no data to validate:
class SetPasswordsForm(forms.Form):
    def __init__(....):
        self.register = RegisterForm

Additionally, the RegisterForm's clean method sets parameters that are then overwritten with the values from cleaned_data. Obviously, these parameters has no effect:
def clean(self, password1, password2, error_key="password"):
        symbols = ['$', '@', '#', '%', '!']
        password1 = self.cleaned_data.get('password')
        password2 = self.cleaned_data.get('password2')

Don't reinvent the wheel. Use the tools provided by Django. If you need write forms validators and reuse the code, you can start here: https://docs.djangoproject.com/en/3.2/ref/validators/


text:
Q: Does anyone know what framework Google Analytics is designed with? The customer I am working for enjoys the look/feel of the Google Analytics site.  The look & feel, ajax refreshes, live graphs, etc.
Does anyone know what framework Google uses for producing it?  Are they still using GWT, or have they moved onto something else (such as AngularJS)?
I found a link to the Google Analytics site on https://www.madewithangular.com/#/sites.  Does that mean that the whole Analytics site is designed with Angular?


text:
Q: ASP .NET MVC Url.Action from within Web API 2 controller I'm currently using ASP .NET MVC and Web API 2 in parallel in a project I'm working on.
I'd like to be able to include links to certain MVC Actions from within my API responses, as these actions often relate to the resources being provided.
The issue is that I have no MVC HttpContext from within Web API, so I cannot use the Url.Action method to generate links. My only other option is to manually/hard-code the links but I'd rather not take this approach as it doesn't scale.
Any way to spawn a MVC HttpContext/RequestContext?

A: You shouldn't consider mixing MVC/WebAPI because WebAPI is designed to be stateless, that's why its context is different than MVC.
If you need to use MVC links in WebAPI(just curious - why?), you should either use helpers like T4MVC or prepare your own, which encapsulate URLs to be used. You shouldn't ever consider using MVC context in WebAPI because you can never know what is its current state.
If API has to know something about your MVC structure, there is something wrong with your design IMO.


text:
Q: SQL Developer won't attempt to import an .xlsx file because it's too large I have two .xlsx files that total 1.6 million rows, and I'm trying to import these things into SQL Developer.
I right click the table name and select "Import Data..." and then select my file and nothing happens.  It logs my attempt to open this file in the "File - Log" output

This is two separate attempts to import the same file logged here.  When I click one of them, I get the following message:

However, I know that this warning is not true, because my attempts with importing a smaller .xlsx file are successful.  So I figured the problem was just the file size is too large, and tried to change the memory available.  I went into "C:\Users\User\Documents\sqldeveloper\sqldeveloper\bin" and changed sqldeveloper.conf to change one existing value to
AddVMOption  -XX:MaxPermSize=2048M
and added another value
AddVMOption  -Xmx2048M
Which helps the Java VM according to this source:
http://codechief.wordpress.com/2008/07/30/configuring-oracle-sql-developer-for-large-files-fix-out-of-memory-errors/
But this did nothing for me, and I still receive the same errors.  I am using SQL Developer version 3.2.20.09 but I have also tried this on 4.0.1.14 to the same effect.
Many thanks!

A: I tried looking into SQL*Loader.  Apparently you should be able to right click a table > Import Data > next and there should be an option to generate SQL*Loader files.
Unfortunately, not only did the import wizard not open with my large .xlsx files, the SQL*Loader option was not even present for smaller .xlsx files, or even .xls for that matter.
In the end, I decided to convert my .xlsx files into .csv and import those instead.  This worked for all but 4 rows of my 1.6 million, and gave me the insert statement for those 4, of which 2 worked when run with no additional modifications.

A: In case of large volume of data, add a line "AddVMOption -Xmx4096M" to the sqldeveloper.conf file and even if it is not working change your file to *.csv format instead of *.xls. It will work fine.


text:
Q: Graph of the function $\frac{(x-1)(x-4)}{(x-2)(x-3)}$ We are given the function
$$\frac{(x-1)(x-4)}{(x-2)(x-3)}$$
and we have to draw graph of this.
We know its domain will be all real numbers except $x=2$ and $x=3$; also, it has a local minimum at $x=\frac52$.
But now how to proceed?

A: We can find out many more factoids about the graph: There is a zero at $x=1$ and one at $x=4$, both with a change of sign, the poles at $x=2$, $x=3$ are also with change of sign. We have a horizontal asymptote $y=1$ as $x\to\pm\infty$. Additionally, the graph is in fact symmetric to $x=\frac52$. These should be enough guiding hints to allow you making a good enough sketch of the graph:
Coming from negative infinity the graph is close to the line $y=1$ and falls down to intersect the $x$ axis at $x=1$ and then tend to $-\infty$ as $x\to 2^-$; to the right of $x=2$, the graph comes down again from $+\infty$, passes through the minimum at $x=\frac52$ 8and $y=9$, as you may compute) just do go up to $+\infty$ again as we approach $3$ from the left; to the right of $3$ the graph comes up again from $-\infty$, crosses the $x$ axis at $x=4$ and huddles against the line $y=1$ again.


text:
Q: Does the symmetric square L-function vanish at one? Take a cuspidal automorphic representation $\pi$ of $GL(3)$ over a number field. My question is quite straightforward and can be related to this one :

Can $L(1, \pi, \mathrm{sym}^2)$ be zero? If yes, is there any extra assumption ensuring it cannot?

I know that we have the splitting $L(s, \pi \times \tilde{\pi}) = L(s, \pi, \mathrm{sym}^2)L(s, \pi, \wedge^2 \pi)$. If we assume $\pi$ self-contragredient for instance, then the Rankin-Selberg convolution has a simple pole at $s=1$. Either $L(s, \pi, \mathrm{sym}^2)$ has a pole at $s=1$ (Gelbart-Jacquet lift case) and in that case it does not vanish ; or it has none and in that case the question rephrases as : can $L(s, \pi, \wedge^2 \pi)$ have a pole of order 2 at $s=1$?
Any new insight or reference on this precise question is welcome.

A: For $GL(3)$, the exterior square $L$-function $L(s,\wedge^2\pi)$ is entire as it agrees with $L(s,\tilde\pi\otimes\omega)$, where $\omega$ is the central character of $\pi$. Therefore, $L(1,\mathrm{sym}^2\pi)=0$ would imply that $L(1,\pi\otimes\pi)=0$, contradicting a result of Shahidi (1980). The best known zero-free region for general Rankin-Selberg $L$-functions is due to Brumley (2012): see the Appendix here.


text:
Q: Delayed slide after page load using CSS I have a header inside of a DIV and I would like to add in a transition so it slides into view a couple of seconds after the pages loads.
Is this possible using CSS alone? I understand how transitions and transform works but they load in immediately and that isn't what I want.

A: In order for this to work, you'll need to place the CSS at the bottom of your Body content, to ensure the DOM has rendered as well as any other CSS/scripts run (e.g. the page has loaded). That said, the better way would be to listen to the document load event in Javascript, and apply a transitioning class at that point, as noted by Josiah in the comment to your question.
Demo Fiddle
HTML

CSS
html,body{
    padding:0;
    margin:0;
}
#slidingContent {
    height: 100px;
    width: 100%;
    margin-top: -120px;
    color: red;
    background-color: grey;
    -webkit-animation-name: slideIn;
    -webkit-animation-duration: 0.3s;
    -webkit-animation-delay: 2s;
    -webkit-animation-fill-mode:forwards;
    animation-name: slideIn;
    animation-duration: 0.3s;
    animation-delay: 2s;
    animation-fill-mode:forwards;
}
@-webkit-keyframes slideIn {
    0%   { margin-top: -120px;   }
    100% { margin-top: 0px;  }
}
@keyframes slideIn {
    0%   { margin-top: -120px;   }
    100% { margin-top: 0px;  }
}


text:
Q: Piping two inputs into comm I have two lists I produce using the following commands:

*

*find . -type f -name config.php -exec ls {} \;

*find . -type f -name config.php -exec grep --files-with-matches some_string {} \; | sort

How could I pipe the lists into com -23 so I can see those entries from list1 that aren't contained in list2?


text:
Q: Is topological surface state always tangential to bulk bands? Think of a topologically nontrivial $D$-dimensional system. Its bulk bands form a $D+1$-dimensional manifold ($+1$ from energy). Its surface/edge bands form a $D$-dimensional one. Is the latter always tangential to the former? If so, why? If not, any counterexample?
For instance, on page 340 Fig.2a of this paper, it is said that in a Weyl metal (Fermi level not at Weyl point), the Fermi arc tangentially connect two Fermi loops around two Weyl points.

A: Since the velocity $v_\parallel$ parallel to the surface is given by the derivative $v_\parallel = dE/dp_\parallel$, with $p_\parallel$ the parallel momentum component, the velocity would vary discontinuously if the surface bands would not be tangential to the bulk bands. In particular, at the transition point the velocity would not exist. The reason this does not happen is that the transition from a bulk state to a surface state is a smooth crossover: the perpendicular momentum component $p_\perp$ varies continuously from purely imaginary to purely real in the transition from surface state to bulk state. Nothing singular happens with $v_\parallel$ at the transition point where $p_\perp=0$.
This is discussed in more detail, with a worked-out example, by Duncan Haldane in Attachment of Surface "Fermi Arcs" to the Bulk Fermi Surface: "Fermi-Level Plumbing" in Topological Metals: Close to the boundary, the surface state is extremely weakly-bound, and its properties approach those of the bulk electronic band from which it evolves at the termination point. In particular, its group velocity tangent to the surface will approach that of the bulk band edge at the termination point from which it evolves.
Trivia: The need for tangential connection was not initially appreciated on Wikipedia, see this image which has the surface bands merge with the bulk bands at an angle. It is now corrected.


text:
Q: how to check the check box in ListView and change the text in same row in listView? I have list view with check box and text view. When i checked check box, change the text in same row. This way i will check all the check boxes in list view and change the text in every row. Can any one explain with sample code?
public class DialogAdapter extends BaseAdapter{
    //private LayoutInflater inflater = null;
    ArrayList<String> timeList = new ArrayList<String>();
    Context context;

    public DialogAdapter(Context context, ArrayList<String> timeList) {
        // TODO Auto-generated constructor stub

        this.context = context;
        this.timeList = timeList;
    }

    @Override
    public int getCount() {
        // TODO Auto-generated method stub
        //return timings.size();
        return timeList.size();
    }

    @Override
    public Object getItem(int position) {
        // TODO Auto-generated method stub
        return timeList.get(position);
    }

    @Override
    public long getItemId(int position) {
        // TODO Auto-generated method stub
        return position;
    }

    @SuppressLint("ViewHolder")
    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        // TODO Auto-generated method stub
        //String timing = "10-30,14-08,16-30,19-00";
        LayoutInflater inflater = (LayoutInflater)getSystemService(LAYOUT_INFLATER_SERVICE);
        convertView = inflater.inflate(R.layout.dialog_row_list,null);

        //timeListView.setVisibility(convertView.VISIBLE);

        TextView txt_time=(TextView) convertView.findViewById(R.id.text_times);
        txt_time.setText(timeList.get(position).toString());

        EditText comments=(EditText)convertView.findViewById(R.id.editText_comment);

        final TextView txt_Action=(TextView) convertView.findViewById(R.id.textView_act);

        CheckBox cBox= (CheckBox) convertView.findViewById(R.id.checkBox_action);

        cBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {

            @SuppressLint("ResourceAsColor")
            @Override
            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                // TODO Auto-generated method stub
                int getPosition = (Integer) buttonView.getTag();
                 timeList.get(getPosition).setSelected(buttonView.isChecked());
                 Toast.makeText(context, "position"+getPosition, 0).show();
                 if(isChecked){
                        txt_Action.setText("finished");
                        txt_Action.setTextColor(R.color.Green);
                    }
                    else{
                        txt_Action.setText("UnChecked");
                        txt_Action.setTextColor(R.color.Red);
                    }
            }

        });

        return convertView;
    }

}

this is my code please check n give solution how to change listview text when check checkbox in listview???

A: in the getView method of your ListView adapter:
if(yourCheckBox.isChecked)
           yourTextView.setText("text if checkBox is checked.");
else
           yourTextView.setText("text if checkBox is not checked.");

A: There is view before checkboxes and texviews that is listview ,if u want to access textviews from listview please make sure you are accessing from listview one item layout
Like
TextView txtvw=findViewByID(ur_layout_of_list_item).findViewByID(ur_textview);

after that changes will be done.

A: First I will suggest you to use ViewHolder pattern for listview adapter so that you don't need to do findViewById() everytime you scroll your list this will prevent your listview from performance slow down and also I would prefer to use setOnClickListener() over CheckedChangeListener().
Below is the sample code you can try
public class CustomAdapter  extends BaseAdapter {

    private Context context;
    public static ArrayList<Item> modelArrayList;

    public CustomAdapter(Context context, ArrayList<Item> modelArrayList){

        this.context = context;
        this.modelArrayList = modelArrayList;

    }

    @Override
    public int getViewTypeCount() {
        return getCount();
    }

    @Override
    public int getItemViewType(int position) {
        return position;
    }

    @Override
    public int getCount() {
        return modelArrayList.size();
    }

    @Override
    public Object getItem(int position) {
        return modelArrayList.get(position);
    }

    @Override
    public long getItemId(int position) {
        return 0;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent){
        ViewHolder viewHolder;

    if (convertView == null) {
        convertView = LayoutInflater.from(context).inflate(R.layout.layout_list_view_row_items, parent, false);
        viewHolder = new ViewHolder(convertView);
        convertView.setTag(viewHolder);
    } else {
        viewHolder = (ViewHolder) convertView.getTag();
    }

    Item currentItem = (Item) getItem(position);
    if(currentItem.isChecked())
        viewHolder.tvName.setText("Checked);
    else
        viewHolder.tvName.setText("Unchecked);

    viewHolder.checkBox.setChecked(currentItem.isChecked());
    viewHolder.checkBox.setOnClickListener(new OnClickListener() {

    @Override
    public void onClick(View v) {
        final boolean checked = currentItem.isChecked();
        if(checked){
           viewHolder.checkBox.setChecked(!checked);
           viewHolder.tvName.setText("Unchecked");
           currentItem.setChecked(!checked);
        }else{
           viewHolder.checkBox.setChecked(checked);
           viewHolder.tvName.setText("Checked");
           currentItem.setChecked(checked);

        }

    }

  });
    return convertView;
    }

private class ViewHolder {

    protected CheckBox checkBox;
    private TextView tvName;

    public ViewHolder(View view) {
        checkBox = (CheckBox)view.findViewById(R.id.checkbox);
        tvName = (TextView) view.findViewById(R.id.textView);
    }

}
}


text:
Q: Access the DOM element in React Native What is the alternative to document.getElementById in React Native? I want to access the element in the DOM. I am using a functional component.

A: You can use refs. Lets say you have a div, and you want to get a DOM reference.
  const MyFuncComp = React.memo(() => {
    const divRef = React.useRef(null)

    /* your other logic here */
    /* refer the div node using divRef.current - its the HTML DOM Node.

    return (
      <div ref={divRef.current}>
        // whatever you want to render
      </div>
    )
  })

Resources: https://reactjs.org/docs/refs-and-the-dom.html


text:
Q: "cross-env" no se reconoce como un comando interno o externo, programa o archivo por lotes ejecutable Estoy intentando ejecutar el comando: npm run watch para compilar los archivos en laravel 5.6. Estoy usando laragon que incluye Node js 8.9.
Este es el script del error:
$ npm run watch

> @ watch C:\laragon\www\learning
> npm run development -- --watch

> @ development C:\laragon\www\learning
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js "--watch"

"cross-env" no se reconoce como un comando interno o externo,
programa o archivo por lotes ejecutable.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ development: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js "--watch"`npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ development script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Juanzu\AppData\Roaming\npm-cache\_logs\2018-11-21T22_07_58_504Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ watch: `npm run development -- --watch`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ watch script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Juanzu\AppData\Roaming\npm-cache\_logs\2018-11-21T22_07_58_582Z-debug.log

Asi tengo mi archivo package.json:
{
    "private": true,
    "scripts": {
        "dev": "npm run development",
        "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
        "watch": "npm run development -- --watch",
        "watch-poll": "npm run watch -- --watch-poll",
        "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
        "prod": "npm run production",
        "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
    },
    "devDependencies": {
        "axios": "^0.18",
        "bootstrap": "^4.0.0",
        "cross-env": "^5.1",
        "jquery": "^3.2",
        "laravel-mix": "^2.0",
        "lodash": "^4.17.5",
        "popper.js": "^1.12",
        "vue": "^2.5.7"
    }

}

A: Asegurate de ejecutar npm install antes de ejecutar npm run watch o similar. Debes tener la carpeta "/node_modules" y si entras deberian salirte todos los paquetes que estén instalados (puedes verlo en /package.json)

A: Prueba a instalar cross-env como módulo global:
npm uninstall cross-env

Borra el directorio node_modules y asegúrate de que la línea "cross-env": "^5.1", ya no está en el archivo package.json.
npm install --global cross-env
npm install --no-bin-links

Y prueba otra vez:
npm run watch

A: Ejecuta npm install si descargaste tu proyecto de git y no habías corrido anteriormente.
Esto es para configurar node y para que en el proyecto se descarguen los paquetes en la carpeta node_modules ya que por el archivo .gitignore estos no se encuentran en git.

A: Desinstala cross-env
npm uninstall cross-env

Reinstala sin enlaces binarios.
npm install cross-env --no-bin-links

Y prueba otra vez:
npm run watch

Instalarlo de forma global lo quitará de tu proyecto de forma definitiva, no me parece buena idea porque luego ya no se instalará con tu repositorio.


text:
Q: how can i fix the wifi connection for ubuntu 12.04? My wifi connection is gone, but I got ethernet. Could it be the wireless adapter, I had the similar problem with the erased windows 7, but the wireless usb adapter what I used
doesn't work for Ubuntu. I got Acer Extensa 4420... Any ideas?

A: simply taking their solution 2 and tweaking it to look like :

sudo rmmod -f iwlwifi
sudo modprobe iwlwifi 11n_disable=1

If you notice that the wifi speed improved, then make the change permanent :

gksudo gedit /etc/modprobe.d/iwlwifi-disable11n.conf

and add this line to the file:

options iwlwifi 11n_disable=1

save and quit.
If you're on battery, turning off power management could help as well

sudo iwconfig wlan0 power off


text:
Q: Looking for alternative taxonomies (semantical tagging) [Context]
I have been using schema since I learned that this vocabulary was taken into account by most search engines. I like this ontology, but I find it quite poor and not well founded compared to some others -- e.g. the Obofoundry DOLCE or even Wordnet -- I have been working with on an academic level.
For instance, it is quite easy to tag that somebody knowsAbout some ComputerLanguage (e.g. Python) but I can't find any relevant category for

*

*operating systems

*Web servers

*DBMS

That being said, I am aware of the fact that scientific accuracy is not the mere matter here. There are a lot of better taxonomies than schema but, if not "aligned" with search engines expectations.
[my questions] Are there other vocabulary as well supported as schema? Is there a way to use any published ontology and expect results? I find most SEO related articles on the subject deliberately misleading and vague while I am looking for a simple answer (and not some revealed truth)
[disclaimer] I have been using "vocabulary" "ontology" and "taxonomy" interchangeably. The academical nuance is irrelevant for the present purpose


text:
Q: IExtensibleDataObject vs IExtensibleObject? I am trying to figure out what is the difference between IExtensibleDataObject and IExtensibleObject.
MSDN say that the first one (IExtensibleDataObject) is to let the deserialization of object that may have added attribute and the second one (IExtensibleObject) look very similar, it does let the object add attribute too.
I am confused.

A: IExtensibleDataObject is for accommodating extra data in a service message (perhaps data that wasn't specified by the contract when proxies were generated).
IExtensibleObject is used to extend certain aspects of the WCF engine (Such as ServiceHostBase and InstanceContext).
The names sound similar, but they are simply different interfaces for different purposes.

A: IExtensibleDataObject is about serialization, and it can be used outside of WCF's service stack. Its main purpose is round-tripping different versions of a data contract without losing information. For example, on the first version of your contract, you have this type:
[DataContract(Name = "Person")]
public class Person : IExtensibleDataObject {
   ExtensionDataObject IExtensibleDataObject.ExtensionData { get; set; }
   [DataMember(Order = 0)] public string Name;
   [DataMember(Order = 1)] public int Age;
}

You deploy your services with this data type, and you have some clients using this type. Some service operations return a Person to the client, and the client can send those objects back to the service, as in the example below.
[ServiceContract]
public interface ITest {
    [OperationContract] Person[] GetAllPeople();
    [OperationContract] void DoSomething(Person person);
}

It all works great, until a change in the business logic requires that a new member to be added to Person, and a backing database requires that field to be present (not null).
[DataContract(Name = "Person")]
public class Person_V2 : IExtensibleDataObject {
   ExtensionDataObject IExtensibleDataObject.ExtensionData { get; set; }
   [DataMember(Order = 0)] public string Name;
   [DataMember(Order = 1)] public int Age;
   [DataMember(Order = 2)] public string Address;
}

Without IExtensibleDataObject, the existing clients would receive the Person object, fill its Name / Age property and promptly discard the Address element passed to it. And when it called the DoSomething method with that object, it would pass an instance which would be invalid at the server (Address would be null).
What IEDO does is enable this scenario, where existing (legacy) clients can continue receiving new versions of data contracts from the service - the client will fill the fields it understands with the data from the service, and those elements which it doesn't understand will be stored in the ExtensionDataObject so that they can be reserialized later. In the example above, the legacy clients will only be able to read the Name and Age properties of the Person, but when it sends the object back to the server, the serialized data will contain all three properties.
That was a long story about IEDO. IExtensibleObject does not have anything to do with serialization - is about hooking up extensions to some pre-defined objects in the WCF service stack (the host, the operation context, the instance context and the context channel). Not as interesting as IEDO, so I'll stop for here :)
Edited: for completeness sake, if you want more information about IExtensibleObject, you can check the post at http://blogs.msdn.com/b/carlosfigueira/archive/2012/01/31/wcf-extensibility-iextension-and-iextensibleobject.aspx.


text:
Q: Explicit computation of $H^2(\mathbb{F}_p^n, \mathbb{R}/\mathbb{Z})$. I'm interested in the computation of the second cohomology group of the elementary abelian group $\mathbb{F}_p^n$ with coefficients in $\mathbb{R}/\mathbb{Z}$:
$$H^2(\mathbb{F}_p^n, \mathbb{R}/\mathbb{Z}) \cong \mathbb{F}_p^{n(n-1)/2}$$
where for simplicity let's suppose $p$ is odd.  I'm pretty sure this is right.
The following discussion of how the right hand side arises is cribbed from [Tata Lectures on Theta III, Mumford, Nori and Norman]; any mistakes my own.
The space $\mathbb{F}_p^{n(n-1)/2}$ on the right corresponds naturally to the space of alternating bilinear maps $\mathbb{F}_p^n \times \mathbb{F}_p^n \to \mathbb{R}/\mathbb{Z}$.  The link to $H^2$ comes from looking at the commutator map $G \times G \to \mathbb{R}/\mathbb{Z}$ in the corresponding central extension
$$0 \to \mathbb{R}/\mathbb{Z} \to G \to \mathbb{F}_p^n \to 0$$
and noting it descends to an alternating bilinear map  $\mathbb{F}_p^n \times \mathbb{F}_p^n \to \mathbb{R}/\mathbb{Z}$ on the quotient.
If $\rho \colon \mathbb{F}_p^n \times \mathbb{F}_p^n \to \mathbb{R}/\mathbb{Z}$ is an explicit 2-cocycle, then this alternating form is just
$$\sigma(a,b) = \rho(a,b) - \rho(b,a) $$
and is readily seen to be invariant under adding coboundaries to $\rho$.
So, this defines a homomorphism
$$H^2(\mathbb{F}_p^n, \mathbb{R}/\mathbb{Z}) \to \mathbb{F}_p^{n(n-1)/2}$$
and it's not hard to show it's surjective, i.e., to construct very explicit Heisenberg-group-type examples of group extensions or cocycles showing that every $\sigma$ arises in this way.  It is also clear that the kernel consists precisely of even cocycles (i.e., $\rho(a,b) = \rho(b,a)$) modulo coboundaries.
My question is:
Question: can someone give me an fairly explicit proof that this map is injective, and therefore that $H^2(\mathbb{F}_p^n, \mathbb{R}/\mathbb{Z})$ is what we think it is?
At some point a proof must use the fact that $\mathbb{R}/\mathbb{Z}$ hasn't been replaced by, say, $\mathbb{F}_p$, as then cocycles corresponding to $\mathbb{Z}/p^2 \mathbb{Z}$ will be in the kernel.
What I would love to have, in order of preference, is:

*

*an algorithm that takes any even cocycle on $\mathbb{F}_p^n$ and spits out an explicit function whose coboundary is $\rho$;

*any proof from which such an algorithm could in principle be recovered, even if doing so involves a lot of work diving into proofs of standard results; or

*any proof at all.
As ever, any pointers or references greatly appreciated.


text:
Q: How to return a specific attribute of an object from an axios Get request as functional component I'm quite new at React/axios/js in general, so I apologize if it is a somewhat silly question,
I'm fetching multiple objects with multiple attributes each from an springboot API, for a simple table display, using axios to fecth the data. my problem is that i can only get the whole object with all attributes at once, i would like after getting the object trough the axios Get request, to separate each attribute from the object, and then export it to my table module, so i can properly display each on the corresponding table fields (name, age, and so on).
I was able to make it work using a class based approach, constructors and setStates, but i need to do it using hooks and as a functional component with React. i'll paste my current code.
The Axios request module
import axios from "axios";

const API_ADRESS = "http://localhost:8080/api/users";

const userDatax = axios.get(API_ADRESS).then((res) => {
  return { nome: res.data[0] };
});

console.log(userDatax);

export default userDatax;

now the the React module which i need  to display the object attributes as individual elements for the table display
import React, { useState, useEffect } from "react";
import userDatax from "../services/UserService";
import "./card.css";

const TabelaUsuarios = (props) => {
  const [usuario, setUsuario] = useState();

  console.log(userDatax);
  console.log(
    userDatax.then((res) => {
      console.log(res);
    })
  );

  let DATARUX = userDatax.then((res) => {
    return res;
  });

  console.log(DATARUX);

  function callUseState() {
    setUsuario(DATARUX);
  }

  return (

USUARIOS CADASTRADOS

              ID
              NOME
              SOBRENOME
              EMAIL
              <button onClick={callUseState}>change user</button>

            {

                {usuario}
                {usuario}
                {usuario}
                {usuario}

            }

  );
};

export default TabelaUsuarios;

oh, and for reference here are the objects i'm fetching from the java springboot API

public void run(String... args) throws Exception {
RepositorioUsuarios.save(new User("Roger","Waters","rgrwaterspf@gmail.com"));
RepositorioUsuarios.save(new User("Peter","Gabriel","sledgehammer@gmail.com"));
RepositorioUsuarios.save(new User("Rick","Wakeman","srick.wake77@gmail.com"));
RepositorioUsuarios.save(new User("Chuck","Berry","MrChuck10@gmail.com"));

Thanks in advance for any guidance, I'm quite new at coding and i'm trying to improve myself as fast as I can, I will be grateful for any tips or methods on this particular problems, cheers everyone!
I've tried to use the Map method on the object to map all elements without success, also I've tried Destructuring the object, once i've fetched the data using the axios get request, but even when I set a variable to the fetch result, I could not work with the variable as an normal object or array, it always an axios promise package, i've tried to look on axios documentation on how to better deal with requests but still with not success, I'm hoping for a solution on how to handle the data request and access the individual elements and attributes of the object.

A: You can access the field of your response this way:
usuario.fieldName

So it would look like this
{

        {usuario.fieldOne}
        {usuario.fieldTwo}
        {usuario.fieldThree}
        {usuario.fieldFour}

}


text:
Q: Local SMTP server for ubuntu I'm using a Java class that sends mails using JavaMail. I really need to use it even though authentication is not yet implemented. Basically it just has SMTP hostname, port, from, to, subject and body.
I need a SMTP server for it. Most of the ones I've tried use authentication.
Does anyone know maybe a local smtp server for ubuntu?
It doesn't have to be very complex/secure because it's just a proof of concept.
Something like sending a text email from my gmail account to my yahoo account. Thanks


text:
Q: How to Create Single line bubble Chartjs chart? I want to create this chart:

I'm thinking I need a bubble chart to get the different size bubbles but I don't know how to get a single line.  I tried using an scatter plot but again I don't know how to get a single line:

Which chart would be best to recreate this chart?

A: You can make the colors transparent of all other lines and make the chart small with css like so:

Chart.register(ChartDataLabels)

const options = {
  type: 'bubble',
  data: {
    datasets: [{
      label: '# of Votes',
      data: [{
        x: 0,
        y: 0,
        r: 4
      }, {
        x: 3,
        y: 0,
        r: 8
      }, {
        x: 6,
        y: 0,
        r: 4
      }],
      borderWidth: 1
    }]
  },
  options: {
    plugins: {
      datalabels: {
        align: 'end',
        color: 'purple',
        formatter: (point, ctx) => (
          ((ctx.dataset.data.length - 1) === ctx.dataIndex) ? point.x : ''
        )
      },
      legend: {
        display: false
      }
    },
    scales: {
      x: {
        grid: {
          borderColor: 'transparent'
        }
      },
      y: {
        ticks: {
          display: false
        },
        grid: {
          color: (ctx) => (ctx.tick.value === 0 ? 'rgba(0,0,0,0.1)' : 'transparent')
        }
      }
    }
  }
}

const ctx = document.getElementById('chartJSContainer').getContext('2d');
new Chart(ctx, options);
canvas {
  max-height: 70px
}
<body>
  <canvas id="chartJSContainer" width="600" height="400"></canvas>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/3.5.1/chart.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/chartjs-plugin-datalabels/2.0.0/chartjs-plugin-datalabels.min.js"></script>
</body>


text:
Q: Generating the convex hull of a subset of points while avoiding the other point containing in the generated convex hull I have a set of 2-D points and I need to generate a convex hull such that the generated convex hull does not contain a certain subset of points in the original set. Actually, I am interested in generating the maximum-area convex hull which satisfies this requirement.
Is there any existing algorithm to achieve this? Is this problem NP-hard in nature?


text:
Q: UIkit framework (html/css/js) video slider creation I am using UIkit framework for my website and I can't figure out how to make a video slider. I am using "slidenav" and "slideshow" components from the framework, but nothing works. Here is my HTML

A: I've copy-pasted the example from the http://getuikit.com/docs/slideshow.html into a working jsfiddle: https://jsfiddle.net/6d6pwrrz/
I've added your links as a

You can experiment with this yourself further.
All styles are copypasted from the element on the getuikit website.
To keep in mind: you need to add the libraries for the slideshow and slidenav  css & javascript.
If you want to see the working code on the getuikit.com website, i use the 'inspect element' function -right click in chrome- on the working examples.
There you can find more information than in the codesnippets provided.

A: Looks to me like you are missing the ID in your Slideshow
. Try this

Important to understand is that in JS
var slideshow = UIkit.slideshow($('#yourEl'), {option:value})

is effectively the same as
.


text:
Q: Incremental continuous timeseries using TensorFlow RNN I want to feed timeseries data as it comes - one step at a time, to incrementally build the rnn ( after few initial steps ).
currently the rnn() takes encoder_input and decoder_input as complete sequence.
def rnn_seq2seq(encoder_inputs, decoder_inputs, cell, initial_state=None,output_projection=None,feed_previous=False, dtype=tf.float32, scope=None):
  with tf.variable_scope(scope or "rnn_seq2seq"):
    _, enc_states = rnn.rnn(cell, encoder_inputs, initial_state=initial_state, dtype=dtype)

    def extract_argmax(prev, i):
        with tf.device('/gpu:0'):
            prev = tf.nn.softmax(tf.nn.xw_plus_b(prev, output_projection[0], output_projection[1]))
        return prev

    loop_function = None
    if feed_previous:
      loop_function = extract_argmax

    print enc_states[-1]
    return seq2seq.rnn_decoder(decoder_inputs, enc_states[-1], cell, loop_function=loop_function)

feedP = tf.placeholder(dtype=tf.bool)
with tf.variable_scope("mylstm"):
    output,state = rnn_seq2seq(enc_inputs,dec_inputs,cell,output_projection=output_projection,feed_previous=feedP)

Is it possible to feed decoder_input one step at a time instead of whole sequence, because that's how the data would come in real time ?

A: Check out Scikit Flow. The example folder includes a lot of examples dealing with RNNs and there are built-in RNN estimators that you can just plug into your existing code.
Check this fit() method in estimators and you'll find partial_fit() that allows continuous training, which suits your needs. Many of the examples use this to continue training in a while loop and save the checkpoint over time (you can also configure the frequency).
Hope this helps.


text:
Q: How to mute mic in Skype using a keyboard shortcut? I'm using the normal skype, not skype for business, I'm using windows 10 mostly when doing skype calls and sometimes ubuntu 16.04, I'm required to mute my mic whenever someone speaks in meetings.
Is there a shortcut to toggle the mic on and off when doing skype meetings?

A: From the documentation:

*

*Windows: Ctrl + M

*macOS: Cmd + Shift + M


text:
Q: Jquery cycle pager with menu tree? I have gotten lots of help from others posts in the past so I hope you can help me out now.
I want to use the jquery cycle with a pager function (http://malsup.com/jquery/cycle/pager3.html)
but instead of it generating thumbnails as links I would like the navigation to be text links in an accordion tree like this lovely demo: jquery.bassistance.de/treeview/demo/?1.0
My main issue is that the pager cycle generated numbers instead of text as links, and to override that I tried using the 'title' tag in the image tag, and change the 'return' in the js

which worked-- -but then gives me no ability to manipulate or style the text links.
And I would ideally like to have the nav in a text tree like the link above.
I am quite new to JQuery and have learned what I know only from going through threads, tuts and forums but am not really able to figure out how to write it correctly on my own...so frustrating!

A: The cycle documentation recommends you use css, such as
#nav a { border: 1px solid #ccc; background: #fc0; text-decoration: none; margin: 0 5px; padding: 3px 5px; }
#nav a.activeSlide { background: #ea0 }
#nav a:focus { outline: none; }

If you didn't want all that in your pristine css files, you could write it into your html with $('head').append() or something. Or you could style the elements with jQuery using something like
$('#nav a').css({
  border: '1px solid #ccc',
  background: '#fc0',
  text-decoration: 'none',
  margin: '0 5px',
  padding: '3px 5px',
  focus: { outline: 'none' }
}).filter('.activeSlide').css({
  background: '#ea0'
});

That's untested, and the "focus: {...}" part is just wishful thinking. I don't know if there's a way to do that with jQuery.


text:
Q: Entity DbSet and Any() producing true on empty collection I have a weird error I cannot understand. After setting breakpoints and local watches it came to this:

How can _temp be true (i.e., the collection db.Users contains a user of name "dummy") although the collection db.Users is empty?
For completeness:
public class DBCUsers : DbContext {
    public DbSet<User> Users { get; set; }
}

public class User {
    public int ID {get; set;}
    public string Name {get; set;}
}

A: DbSet<T>.Local contains a collection of entries already retrieved from the database by previous queries. Among other things, the idea is to save unnecessary round trips.
Unless you have previously executed queries in the context to retrieve User entities, Local will be empty. Your call to Any() can be translated into a SQL query which returns a boolean, so it does not cause the context to retrieve any entities.
To resolve your problem, either use the straightforward db.Users.Count(), which will query the database to get the count, or populate Local with a call to Load(), which as of EF6 is available in QueryableExtensions in System.Data.Entity.


text:
Q: Is there any point to placing a lock within a non-static operation, particularly in a web service? So I'm going through some of our code trying to clean some stuff up and I came across this bit, and I can't for the life of me figure out what purpose it serves:
public class SomeOperationBaseClass
{
    private readonly ISomeRepository _someRepository;

    // stuff...

    public SomeReturnType RunTransaction(SomeRequestType request)
    {
        SomeReturnType result;

        // some stuff happens here

        lock(request.UserId)
        {
            // run some stuff

            var info = _someRepository.GetDatabaseLock(lockRequest);

            lock(request.UserId) // lolwat?
            {
                // run some more stuff

                _someRepository.ReleaseDatabaseLock(releaseLockRequest);
            }
        }

        return result;
    }
}

Allegedly, all of this nonsense is to prevent a particular user's account from processing more than one thing at a time. The database "lock" just sets a flag stating that the user has something in progress; elsewhere in the code, it prevents this operation from running until it can get back a result saying that the user is not in the middle of something. It's some dirty workaround for not having any sort of cache server.
My main question is regarding the locks:

*

*The inner lock seems pointless. It's attempting to place a lock on
the user id. I removed it.

*The database lock has to stay for now, so I left it alone

*The outer lock seems pointless. This is a WebAPI web
service and this class is a base class of a child operation that is
spun up as a result of an HttpRequest. As far as I understand, the
request has it's own thread and that thread owns this instance of the
class. It is not a static class nor a static method. No input
parameters are being modified by reference. I don't see any issues of
thread safety here.

With all that said, I'm pretty sure that both locks are pointless and I'd like to remove them. But if there is something else about the lock keyword that I am missing, I'd like some insight.

A: The inner lock is pointless.  You already have the lock on the request.UserId from the outer lock.
Without knowing more, the outer lock may be there to attempt to restrict access to the GetDatabaseLock method, or potentially an static variables/properties within the class.  So, if SomeOperationBaseClass contained a static variable, which was acted upon within RunTransaction, then you would want exclusive use of it.  However, in that case, I would expect the lock to be on a private static, or private variable.