text:
Q: Is it fair to require copyright assignments from contributors of an OS project? As a follow up to Does a BSD-licensed project need a signed statement from each contributor?:
There are several reasons why an open source project might want to get copyright assignments from its contributors. For example:

*

*To allow the project author to sue for infringement (as only the copyright holder can do so). This is also why FSF requires such an assignment.

*To prevent future problems with the contributors, such as they claiming later that they didn't release their contribution under the same OS license.

Another reason is if a company releases its software under (L)GPL and also sells it under a commercial license. Then a copyright assignment is necessary so that the company can include contributions under the commercial license. If the contributors are informed beforehand, this is fair.
But if the company has the copyright to everything, it can do basically anything with the sources, something that the contributors wouldn't agree on. It can switch to another license, like from (L)GPL to a non-copyleft license, or even stop releasing the project as open-source and switch to proprietary licensing only. This has reportedly happened with SourceForge.
So what is a fair way to handle the problem? If the project owner doesn't get copyright assignments, (s)he can get into problems in the future. If (s)he does, the work of the contributors can lose its license or open-source status. Is there a solution to this dilemma that is fair to both sides?
As I'm not a native speaker, I might used wrong legal terms. Please feel free to correct the question.
Related:

*

*How to get contributors assign copyright for copyright holder?.

*Copyright assignment on open source projects

A: The FSF assignment grants back an irrevocable and unlimited license to your contribution, so you may continue to use your code as you wish.  Additionally, it places constraints upon the FSF requiring them to keep the source open.
I think copyright assignment can definitely be made fair presuming the right language is put into the assignment not only to protect the assignee's rights but also the assignor.  I had no qualms signing the FSF assignment for two projects.
Many open source projects don't do copyright assignment because they think it's unlikely they'll need it and the paperwork does impose a barrier to entry. But RMS did run into the need (with code from Gosling Emacs) and that's where the FSF requirements come from.

A: Fair is a value judgement, and a little tricky to judge.
BUT:

*

*As long as the intention is clear beforehand then it is probably understandable even if they go overboard to some persons viewpoint.

*If they go back on their word or stated intention, there might be a case to answer.

And there are other avenues available.
If the original was open sourced, then it is always available at that version as an open source project. And can be easily forked from that point (see numerous examples i.e. XFree86).

A: As stated by @Andrew - fair is a value statement.
However, provided the conditions are clearly stated up front for all to see, it is fair - you have the choice to make if you wish to participate under those conditions, you participate, if not, you don't - what can be considered unfair about that?
As far as full assignment - is it fair for a contributor who made a tiny, insignificant contribution to prevent the major contributor changing the direction of the product? In the case is it fair and reasonable to expect the major contributor to track down every  small contributor (maybe decades later, long after they have lost interest), to make a small change to the licensing?
So the question to ask with copyright assignment is not "is it fair" but "Is it practical not to"

A: I personally would be much happier assigning copyright to a properly constituted not-for-profit foundation than to a company or a person.
On the other hand, if the project has a sound Open Source License and publicly available source code, then a company or individual can't kill a vibrant project.  They cannot take away the community's ability to fork.
(You will note that I'm don't find it particularly concerning that the copyright assignee can turn a profit from my contributions ... or do other things with the code-base that I would find distasteful, etcetera.  1) I didn't contribute to make a buck, and 2) other people's bad actions are not my moral responsibility.  Of course, if you didn't share my view then you would have more reasons to hesitate about assigning copyright at all.)


text:
Q: When should I start and destroy session in PHP I am making a simple oauth site.
In index.php:
<?php
session_start();
if (empty($_SESSION['authentication']))
    $_SESSION['authentication'] = 'pending';
?>
<html>
<form action="oauth.php" method="post">
    <span>
    <?php
        echo $_SESSION['authentication'];
    ?>
    </span>
    <input type="hidden" name="action" value="authenticate">
    <input type="submit" value="authenticate">
</form>
</html>

In oauth.php:
<?php
session_start();
if (isset($_POST['action']) and $_POST['action'] == 'authenticate') {
    $url = $serverAuth ... ;
    header('Location: ' . $url); //google oauth, it will come back to oauth.php
    exit();
}

if (isset($_GET['code'])) {
    $ch = curl_init($serverToken);
    $result = curl_exec($ch);
    $tokens = json_decode($result, true);

    if (isset($tokens['access_token'])) {
        $_SESSION['authentication'] = 'good';
        $_SESSION['access_token'] = $tokens['access_token'];
    } else {
        $_SESSION['authentication'] = 'error';
    }

    header('Location: ./');
    exit();
}

if (isset($_GET['error'])) {
    if ($_GET['error'] == 'access_denied')
        $_SESSION['authentication'] = 'denied';
    else
        $_SESSION['authentication'] = 'error';
    header('Location: ./');
    exit();
}
?>

I want to make the site like: by default, $_SESSION['authentication'] is "pending"; when I refresh the page, every session variables are gone, and $_SESSION['authentication'] reset to default. But I cannot reset $_SESSION at the beginning of index.php, because functions in oauth.php have header() to redirect to this page.
How to deal with it?

A: You must start the session on every single page that requires access to $_SESSION. Only destroy it when explicitly requested, e.g. on logout.

redpajama_set_name: RedPajamaStackExchange


text:
Q: How can I use rsync over AFP and SMB protocols? I have a Lacie CloudBox NAS drive. I can acces the folders with no problems via the file explorer, however I would like to use rsync to sync some files. I have used rsync before to sync folders on a USB drive with no hassles.
I want so do something like this:
rsync -a /home/myuser/folder_to_sync nas_folder

what should I write instead of "nas_folder"?
The NAS automatically creates a folder called Family which can be accessed anonymously. If I navigate to it and click "Properties", its location is
afp://anonymous@mynas.local/Family/

However if I create a password protected user in the NAS, the location of its folder is:
smb://mynnas.local:139/user_with_pwd/

How can I use rsync in each case?


text:
Q: Group GPS locations based on the first and last two points of the event Everyone.
I'm trying to identify attempted road crossing events using GPS data. My initial plan was to buffer the road by two distances (10km, 500m) on the west and east side of a road, intersect the GPS data with the buffers, and identify/group instances in which an individual travels from the 10km buffer into the 500m buffer and back to the 10km buffer on the same side of the road. The number of points that fall within the 500m buffer and between the 10km points could range from 1 to n-2 points meaning the groupings of attempted road crossing events will be a minimum of 3 points to a maximum of n total points. I'm not quite sure how to identify these groupings as the group would have to be identified by the first and last two rows of the grouping with all groups potentially being different lengths. I've provided simple example input and results datasets. Note that the attempted crossing events would also need to be grouped by id and year. That isn't an issue but something I thought I'd add for clarity. Also, if you think there's a better way of accomplishing this task please feel free to suggest a solution.
Thanks for your help!
library(tidyverse)

set.seed(321)

# Example data set. 20 individuals across 20 years with locations assigned to either the west or east side of the road and in the 10km or 500m buffers.
df<-tibble(id = rep(1:20,
                    each = 10),
           year = rep(2000:2019,
                      each = 10),
           location = sample(c('west_10km',
                               'west_500m',
                               'east_10km',
                               'east_500m'),
                             size = 200,
                             replace = TRUE))

# What the results should look like when attempted crossing events grouped by id and year have been pulled from the df dataset.
results<-tibble(id = c(1,1,1,1,1,1,9,9,9,9,9,15,15,15,
                       19,19,19,19,19,19,19,20,20,20,20),
                year = c(2000,2000,2000,2000,2000,2000,2008,2008,
                         2008,2008,2008,2014,2014,2014,2018,2018,
                         2018,2018,2018,2018,2018,2019,2019,2019,2019),
                location = c('west_10km','west_500m','west_10km','west_10km',
                         'west_500m','west_10km','east_10km','east_500m',
                         'east_500m','east_500m','east_10km','west_10km',
                         'west_500m','west_10km','east_10km','east_500m',
                         'east_500m','east_10km','east_10km','east_500m',
                         'east_10km','west_10km','west_500m','west_500m',
                         'west_10km'),
                group_event = c(1,1,1,2,2,2,3,3,3,3,3,4,4,4,5,5,5,5,6,6,6,7,7,7,7)))

EDIT: Thanks to @Skaaqs for their help. This isn't the first time I've forgotten about lag()/lead(), but I think this time it will stick. I had to modify a few lag()/lead() arguments to correctly identify the row of interest. I also wasn't sure how to identify all of the 'in/500m' between the starting and ending 'out/10km' points so I did so by a brute force. It's not pretty but it worked as long as there weren't >10 'in' locations within a crossing attempt. I then added another ifelse() statement to identify the point at which an individual left the area of interest. Unfortunately, events in which the individual did successfully crossed were pulled in so I added a simple quality control check by specifying that the first and last location in an event needed to be on the same side and out of the 'in' zone (e.g., east_10km, east_500m,..., east_10km). Again, if anyone has a cleaner solution, please feel free to chime in.
df_results <- df %>%
  tidyr::separate(col = "repulsion_location",
                  sep = "_",
                  into = c("side",
                           "dist")) %>%
  mutate(distm = ifelse(test = dist == "500m",
                        yes = 500,
                        no = 10000)) %>%
  group_by(id, year) %>%
  mutate(cross = ifelse(test = side == lag(side),
                        yes = 1,
                        no = 0)) %>%
  mutate(cross_atmpt = ifelse(test = side == lag(side) & distm < lag(distm) & side == lead(side),
                              yes = 1,
                              no = 0),
         cross_atmpt =  ifelse(test = side == lead(side) & lead(cross_atmpt) == 1,
                  yes = 1,
                  no = cross_atmpt),
         cross_atmpt =  ifelse(test = side == lag(side) & lag(cross_atmpt) == 1 & distm == 500,
                               yes = 1,
                               no = cross_atmpt),
         cross_atmpt =  ifelse(test = side == lag(side) & lag(cross_atmpt) == 1 & distm == 500,
                               yes = 1,
                               no = cross_atmpt),
         cross_atmpt =  ifelse(test = side == lag(side) & lag(cross_atmpt) == 1 & distm == 500,
                               yes = 1,
                               no = cross_atmpt),
         cross_atmpt =  ifelse(test = side == lag(side) & lag(cross_atmpt) == 1 & distm == 500,
                               yes = 1,
                               no = cross_atmpt),
         cross_atmpt =  ifelse(test = side == lag(side) & lag(cross_atmpt) == 1 & distm == 500,
                               yes = 1,
                               no = cross_atmpt),
         cross_atmpt =  ifelse(test = side == lag(side) & lag(cross_atmpt) == 1 & distm == 500,
                               yes = 1,
                               no = cross_atmpt),
         cross_atmpt =  ifelse(test = side == lag(side) & lag(cross_atmpt) == 1 & distm == 500,
                               yes = 1,
                               no = cross_atmpt),
         cross_atmpt =  ifelse(test = side == lag(side) & lag(cross_atmpt) == 1 & distm == 500,
                               yes = 1,
                               no = cross_atmpt),
         cross_atmpt =  ifelse(test = side == lag(side) & lag(cross_atmpt) == 1 & distm == 500,
                               yes = 1,
                               no = cross_atmpt),
         cross_atmpt =  ifelse(test = side == lag(side) & lag(cross_atmpt) == 1 & distm == 500,
                               yes = 1,
                               no = cross_atmpt),
         cross_atmpt = ifelse(test = side == lag(side) & distm > lag(distm) & lag(cross_atmpt) == 1,
                              yes = 1,
                              no = cross_atmpt),
         cross_atmpt = ifelse(test = is.na(cross_atmpt),
                              yes = 0,
                              no = cross_atmpt)) %>%
  group_by(crossing_event_id = cumsum(cross_atmpt == 0)) %>%
  filter(cross_atmpt == 1) %>%
  group_by(crossing_event_id) %>%
  mutate(crossing_event_id = cur_group_id())

    #' _____________________________________________________________________________
    #' ## Quality Control
    #'
    # Check if each crossing attempt is bookended by an out/10km point.
    repulsion_pts_clean <- repulsion_pts %>%
      group_by(crossing_event_id) %>%
      filter(first(distm) == 10000 & last(distm) == 10000)

    repulsion_pts_null <- repulsion_pts %>%
      st_drop_geometry()

repulsion_pts_clean_null <- repulsion_pts_clean %>%
  st_drop_geometry()

false_repulsion <- anti_join(repulsion_pts_null,
                             repulsion_pts_clean_null )

A: If you want the first and last events with in a group, you could use group_by() and first() and last() in the dplyr package.
But what if you wanted to summarize all movements by each individual within year? You could define each case with logic, e.g., west_10km to west_500m is a "closer" movement and west_10km to east_10km is a "long cross".
library(dplyr)
library(tidyr)

df <- df %>%
  tidyr::separate(col = "loc", sep = "_", into = c("side", "dist")) %>%
  mutate(distm = ifelse(dist == "500m", 500, 10000)) %>%
  group_by(id, year) %>%
  mutate(cross = ifelse(side == lag(side), 1, 0)) %>%
  mutate(cross_atmpt = ifelse(side == lag(side) & distm < lag(distm), 1, 0))

Then you can summarize by id and year:
df %>%
  group_by(id, year) %>%
  summarize(tot_cross = sum(cross, na.rm = TRUE),
            tot_cross_atmpt = sum(cross_atmpt, na.rm = TRUE))


text:
Q: Need help adding Django model object via form In my django based project, I have a 'Field' model that the user can add via a form.
The view that gets called upon loading the page is this.
@login_requred
def index(request):
    if request.method == 'POST':
        # do 'Field' saving stuff
        HttpResponseRedirect('/index/')
    else:
        # some code ...
        return render(request, 'precisionagweb/index.html', {# stuff to render})

And the form in index.html is
<form id="addFieldForm" class="ui form" method="post">
    form stuff
</form>

This approach works fine, but I want to change the structure by creating a view that is specifically for adding a 'Field', so I can avoid an overly complex function definition for index when I add in modification and delete features.
My approach was to create a view like this:
@login_required
def user_addField(request):
    print 'made it here'
    addField_form = addField(data=request.POST)
    if addField_form.is_valid():
        field = addField_form.save(commit=False)
        field.user = request.user
        field.save()
    return HttpResponseRedirect('/index/')

remove the POST stuff from the index definition like this:
@login_requred
def index(request):
    # some code
    return render(request, 'precisionagweb/index.html', {# stuff to render})

and change the "action" in the form like this:
<form id="addFieldForm" class="ui form" method="post" action="addField/">
    form stuff
</form>

My urls are configured like this:
urlpatterns = [
    url(r'^signup/', views.signup),
    url(r'^index/', views.index),
    url(r'^addField/', views.user_addField),
    url(r'^login/', views.user_login),
    url(r'^logout/', views.user_logout),
]

This does not work because the print statement in my new view definition never prints to the terminal, and thus the view never gets called. I do not know what to do at this point, so any help would be greatly appreciated.

A: Usually a view like this would look like this:
def add_field(request):
    form = AddFieldForm(data=request.POST or None)

    if form.is_valid():
        field = form.save(commit=False)
        field.user = request.user
        field.save()

        return redirect('named_url')

    return render(request, 'template.html', { 'form': form })

The concept behind this is easy: This view is responsible for showing the actual form to the user aswell as actually storing your new object.


text:
Q: Cannot find module 'hardhat/config' or its corresponding type declarations I'm setting up a new project with hardhat, using typescript and yarn.
I'm following https://hardhat.org/guides/typescript.html and when I get to the step "We need to apply three changes to your config for it to work with TypeScript:" there is an instruction to update the hardhat.config.js to hardhat.config.ts
The instructions and the example code say to put import { task } from "hardhat/config"; but vscode and the compiler say Cannot find module 'hardhat/config' or its corresponding type declarations.
What am I missing?

A: Maybe add this import to your hardhat config file?
import { HardhatUserConfig, task } from "hardhat/config";

And be careful to install all necessary types:
import "@nomiclabs/hardhat-etherscan";
import "@nomiclabs/hardhat-waffle";
import "@typechain/hardhat";
import "hardhat-gas-reporter";
import "solidity-coverage";

A: I had the same issue as well. I then tried using npm instead of the yarn package manager and the error got resolved.
I'd recommend uninstalling and reinstalling yarn and check if the error gets resolved, or use the npm package manager instead.

A: Use the below command:
npm install -D hardhat-deploy

Then, require("hardhat-deploy");.


text:
Q: How can I update object by model`s method, django I need to write the method, that update object, passed by argument. Something, like this:
class ArticlesSerie(models.Model):
    title = models.CharField(max_length=120)

    def add_article(self, article):
         article.serie = self
         article.save()

and model Article:
class Article(models.Model):
    ...
    serie = models.ForeignKey(ArticlesSerie, blank=True, null=True)
    ...

But this code cause error, when I try to use method add_article in shell:
a = Article.objects.get(id=4)
b = ArticlesSerie.objects.get(id=1)
b.add_article(a)

UserWarning: update is not implemented in this backend

What should I do?

A: As it shows in the official django docs, you can simply add the new article by adding it to the series set (of related articles)
class ArticlesSerie(models.Model):
    title = models.CharField(max_length=120)

    def add_article(self, article):
         self.article_set.add(article)

As you can see, it's probably not worth it to do it in a specific method since it's a one-liner, unless you want to perform further checking (e.g. on the article's fields)
Note: you might want to consider using create instead of add, if you do not need to instantiate the article beforehand.


text:
Q: find two controls point from two endpoint Bezier Curve Can I find the control points for a Bezier Curve if I have the two end point?
I have an array of endpoint, so I want to find the control point for my application on Javascript Canvas, is it possible?

A: No, it's not possible to define a curve given only 2 points. Even a circular arc with 2 points gives 2 results (clockwise or counter-clockwise).
If your curve is quadratic you will need at least 3 points.
If your curve is cubic you will need at least 4 points.


text:
Q: OLED display using dspic33f i2c I am trying to use OLED display in a dspic33f microchip. I've successfully initialized and sent data using I2C to OLED. I managed to display a small font(8pt) on the OLED. However, when I tried a bigger font, part of the font is being obstructed(can't show the whole part of that font).
The code is as the following.
static unsigned char buffer[1024 ] = {
    // @18 '2' (5 pixels wide)         //generated by using The Dot Factory
    0xC0, 0x80, // ##      #
    0xA0, 0x80, // # #     #
    0x90, 0x80, // #  #    #
    0x8D, 0x80, // #   ## ##
    0x87, 0x00, // #    ###

    // @9 '2' (4 pixels wide)
    0x00,
    0xC1, // ##     #
    0xA1, // # #    #
    0x91, // #  #   #
    0x8E, // #   ###
    0x00
};

void Oled_init(void){
    command(0xAE);  //display off
    command(0xD5);  //display clk div
    command(0x80);  //ratio -- continuation of clk_div
    command(0xA8);  //mux ratio
    command(0x3F);
    command(0xD3);  //display offset
    command(0x0);   //no offset- continuation of display_offset
    command(0x40 | 0x00);   //display starting line
    command(0x8D);  //charge pump
    command(0x14);  //internal vcc
    command(0x20);  //memory mode
    command(0x00);
    command(0xA1);  //remap columns
    command(0xC8);  //remap rows
    command(0xDA);  //com pins
    command(0x12);
    command(0x81);  //set contrast
    command(0xCF);
    command(0xDB);  //set Vcomh
    command(0x40);
    command(0xD9);  //pre charge
    command(0xF1);
    command(0xA4);  //entire display on
    command(0xA6);  //normal display
    command(0x2E);
    command(0xAF);  //display on
}

void display (void){
    command(0x21);  //column start address
    command(0);
    command(0x7F);

    command(0x22);  //set page address
    command(0x00);  //min
    command(0x07);  //max   //128x64resolution

    unsigned int i = 0;
    unsigned char x = 0;

    for(i = 0; i < 1023; i++){
      OpenI2C2(I2CConfig2, I2C2_BRG);
      IdleI2C2 ();
      StartI2C2 ();
      while(I2C2CONbits.SEN);
      MasterWriteI2C2(0x78);
      MasterWriteI2C2(0x40);      //Co = 0, D/C = 1, last 6 bit = 0

      for (x = 0; x < 16; x++){
         MasterWriteI2C2(buffer[i]);
         i++;
       }
         i--;

      StopI2C2 ();
      while(I2C2CONbits.PEN);
      CloseI2C2();
   }
}

This problem has been troubling me since the last few weeks and I still couldn't find any solution to it. Thanks for any solution in advance.


text:
Q: Get the filename of which the function is inside in Node Lets say we have 2 Files
FileA.js:
function foo(){
    return;
}

FileB.js:
const filea = require("FileA.js");
console.log( GetFunctionFileName( filea.foo ));

How can I make it so that console.log( GetFunctionFileName( filea.foo )); Prints FileA.js?


text:
Q: jQuery Validate not working on one particular form field For some reason jQuery validate is validating all the form fields below, except for 'depdate'. Arrdate, arrtime, depdate, deptime all use pickadate.js for a picker, the other three work absolutely fine, this one doesn't. HTML and jQuery code included below.
<form id="cabinbook" method="POST" action="submitform-cabin.php">

Hirer Details

Organisation / Group Name

<input name="groupname" minlength="4" type="text" required/>

Aims and Objectives of the Organisation / Group

<textarea name="aims" minlength="20" class="textarea-message" required/></textarea>

Group Leader Name

<input name="maincontact" minlength="5" type="text" required/>

Group Leader Email Address

<input name="email" type="text" required/>

Group Leader Contact Address (including postcode)

<textarea name="address" minlength="10"  class="textarea-message" required/></textarea>

Group Leader Telephone Number

<input name="telnum" type="text" required/>

Mobile Number (whilst on site)

<input name="mobnum" type="text" required/>

Arrival and Departure

Arrival and departure times are subject to Foundation agreement, and confirmation by the key manager. Please be specific so that we can make sure somebody is there to meet you with the keys.
Please use the date & time pickers or enter in the format DD-MM-YY (no forward slashes) and HH:MM AM

Arrival Date

<input id="datepicker1" name="arrdate" type="text" required/>

Estimated Arrival Time

<input id="timepicker1" name="arrtime" type="text" required/>

Departure Date

<input id="datepicker2" name="depdate" type="text" required/>

Estimated Departure Time

<input id="timepicker2" name="deptime" type="text" required/>

Group Type

<select name="grptype">

<option value="">Choose...</option>
<option value="Norfolk Youth Group">Norfolk Youth Group</option>
<option value="Norfolk Community Group">Norfolk Community Group</option>
<option value="Other Youth Group">Other Youth Group</option>
<option value="Other Community Group">Other Community Group</option>
<option value="School">School</option>
<option value="Family Use">Family Use</option>
<option value="Respite Use">Respite Use</option>
</select>

Group Numbers

Please provide us with details of how many people of each age group are staying as part of your booking. If you only want to hire the Log Cabin for day time use (e.g. no overnight stays), enter the details in the "Indoor Day Time Use Only" section. All fields in this section are required, please enter a zero if it does not apply to you.

Indoor Residential

Male Under 18

<input name="IRmu18" type="text" value="0" required/>

Female Under 18

<input name="IRfu18" type="text" value="0" required/>

Male Over 18

<input name="IRmo18" type="text" value="0" required/>

Female Over 18

<input name="IRfo18" type="text" value="0" required/>

Indoor Day Time Use Only

Male Under 18

<input name="IDTmu18" type="text" value="0" required/>

Female Under 18

<input name="IDTfu18" type="text" value="0" required/>

Male Over 18

<input name="IDTmo18" type="text" value="0"required/>

Female Over 18

<input name="IDTfo18" type="text" value="0"required/>

Campers

Male Under 18

<input name="OCmu18" type="text" value="0"required/>

Female Under 18

<input name="OCfu18" type="text" value="0"required/>

Male Over 18

<input name="OCmo18" type="text" value="0"required/>

Female Over 18

<input name="OCfo18" type="text" value="0"required/>

Proposed Benefit

Proposed activities during hire period

<textarea name="propactivities" minlength="20" class="textarea-message" required/></textarea>

Proposed benefits to users during hire period

<textarea name="propbenefits" minlength="20" class="textarea-message" required/></textarea>

Declarations

Before submitting this request, please check all the statements carefully. By placing this booking, you agree to the following declarations.

All the information given in this booking is correct to the best of my knowledge

I have read, understood and agree with the conditions of hire

I have read, understood and agree with the terms of payment

<input type="submit" id="submit" value="Submit">
</form>

jQuery


text:
Q: Android - Youtube Player Stop an video at specified time I'm trying to play an youtube video using Youtube Video Player in my android app from given start_time and end_time.
I used player.loadVideo("_wcs7ixyDbY", 12000), so that my video starts playing after 12 seconds. But I want to end my video at 20 seconds.
I used
player.loadVideo(videoID, 12000);
final Handler handler = new Handler();
handler.postDelayed(new Runnable() {
    public void run() {
        if(player.getCurrentTimeMillis() <= 20000) {
            handler.postDelayed(this, 1000);
        } else {
            handler.removeCallbacks(this);
            player.pause();
        }
    }
}, 1000);

This option pause my video after 20 seconds.
How to end my video after 20 seconds (not pause)
Thank You

A: The Android YouTube API provides a method to stop / release the video also:

abstract void release()
Stop any loading or video playback and release any system resources used by this YouTubePlayer.

https://developers.google.com/youtube/android/player/reference/com/google/android/youtube/player/YouTubePlayer


text:
Q: getting failed to obtain info for control in alsa setup while booting the raspbain? I am getting the error or warning like  failed to obtain info for control #335 while booting the raspbain on the raspberry pi
Can anyone help me?


text:
Q: Detect how many array exist? I am using CodeIgniter framework. I am sending an array to my view, but I could not get the array in my view.
This is my controller code:
public function edit($id)
{
    $record = $this->Start_model->get_entry($id);//receiving array from model
    $this->load->view('edit',$record);//send array to my view
}

This is my array on controller that I send:
Array
(
    [0] => Array
        ( [id] => 1 [name] => Hamza [age] => 20 [address] => audit and account [phone] => 03000000000  )
)

But when I call this array view I get this error:

Undefined variable: record

This is how I am getting my array in view:
<?php
echo '
';
print_r($record);
echo '
';
?>

Now I know I am sending an array to my view but I want to know If there is array in my view or not. I can get record through another method but I think it is not a good practice. So anyone can help me how I can detect if there is an array in my view?

A: In your controller, send a parent array instead:
public function edit($id)
{
    $data = array();
    $data['record'] = $this->Start_model->get_entry($id); // provided this is not empty
    $this->load->view('edit', $data);
}

Then in your view:
foreach($record[0] as $key => $value) {
    echo $value['id'];
    // the rest blah blah
}

A: Codeigniter extracts the array passed to a view, creating variables based on the keys of the array. To work as you want, pass an array with a key or record and a value of your array:
public function edit($id)
{
    $data = array('record' => $this->Start_model->get_entry($id));
    $this->load->view('edit',$data);//send array to my view
}

Then this will work in your view:
<?php
echo '
';
print_r($record);
echo '
';
?>

The way you are currently sending the data, it will be extracted into individual variables for each element in the array, however as your array is numerically indexed, and php variable name rules prevent numeric variable names, you cannot access the data.


text:
Q: using variable name within list as string for file save python I have a python list which contains 4 elements, each of which is a time-series dataset.
e.g.,
full_set = [Apple_px, Banana_px, Celery_px]

I am charting them via matplotlib and I want to save the charts individually using the variable names.
for n in full_set:

*perform analysis

    plt.savefig("Chart_{}.png".format(n))

The ideal output would have Chart_Apple_px, Chart_Banana_px, Chart_Celery_px as the chart names.

A: In Python names and values are two very different things, stored and dealt with in different ways - and more practically one value can have multiple names assigned to it.
So, instead of trying to get the name of some data value, use a tuple where you assign a title to the dataset in your list of datasets, something like this:
full_set = [('Chart_Apple_px', Apple_px), ('Chart_Banana_px', Banana_px)]

for chart_name, dataset in full_set:
   # do your calculations on the dataset
   plt.savefig("{}.png".format(chart_name))


text:
Q: XCharter broken after MikTeX Update? I am writing a document using TexStudio and MikTeX as package source. Today I updated some packages including XCharter. Now this package seems to be broken (see also I can't find file `xkeyval´).
A minimal example does not compile and throws following error:
`! Font T1/XCharter-TOsF/m/n/10=XCharter1-Roman-tosf-t1 at 9.60007pt not loadable: Metric (TFM) file not found.

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

\usepackage[charter,expert]{mathdesign}
\usepackage[scaled=.96,osf]{XCharter}

\begin{document}
Hello World
\end{document}

Could this be related to I can't find file `xkeyval´ ?
The log file:
entering extended mode
**./document.tex
(document.tex
LaTeX2e <2020-10-01> patch level 2
L3 programming layer <2020-10-27> xparse <2020-03-03>
("C:\Program Files\MiKTeX\tex/latex/base\article.cls"
Document Class: article 2020/04/10 v1.4m Standard LaTeX document class
("C:\Program Files\MiKTeX\tex/latex/base\size10.clo"
File: size10.clo 2020/04/10 v1.4m Standard LaTeX file (size option)
)
\c@part=\count175
\c@section=\count176
\c@subsection=\count177
\c@subsubsection=\count178
\c@paragraph=\count179
\c@subparagraph=\count180
\c@figure=\count181
\c@table=\count182
\abovecaptionskip=\skip47
\belowcaptionskip=\skip48
\bibindent=\dimen138
)
("C:\Program Files\MiKTeX\tex/latex/base\fontenc.sty"
Package: fontenc 2020/08/10 v2.0s Standard LaTeX package
)
("C:\Program Files\MiKTeX\tex/latex/base\inputenc.sty"
Package: inputenc 2020/08/01 v1.3d Input encoding file
\inpenc@prehook=\toks15
\inpenc@posthook=\toks16
)
("C:\Program Files\MiKTeX\tex/latex/mathdesign\mathdesign.sty"
Package: mathdesign 2013/08/29 v2.31 Math Design Project

("C:\Program Files\MiKTeX\tex/latex/graphics\keyval.sty"
Package: keyval 2014/10/28 v1.15 key=value parser (DPC)
\KV@toks@=\toks17
)
("C:\Program Files\MiKTeX\tex/latex/base\ifthen.sty"
Package: ifthen 2014/09/29 v1.1c Standard LaTeX ifthen package (DPC)
)
("C:\Program Files\MiKTeX\tex/latex/mathdesign/mdbch\mdbch.cfg")
("C:\Program Files\MiKTeX\tex/latex/mathdesign/mdbch\mdbch.sty"
Package: mdbch 2013/08/29 v2.31 bitstream bitstream charter + mdbch (Math Desig
n Project)

("C:\Program Files\MiKTeX\tex/latex/mathdesign\mdfont.def"
File: mdfont.def 2013/08/29 v2.31 (Math Design Project)
)
("C:\Program Files\MiKTeX\tex/latex/mathdesign\mdsffont.def"
File: mdsffont.def 2013/08/29 v2.31 (Math Design Project)

LaTeX Warning: Font shape declaration has incorrect series value `mc'.
               It should not contain an `m'! Please correct it.
               Found on input line 53.

LaTeX Warning: Font shape declaration has incorrect series value `mc'.
               It should not contain an `m'! Please correct it.
               Found on input line 56.

LaTeX Warning: Font shape declaration has incorrect series value `mc'.
               It should not contain an `m'! Please correct it.
               Found on input line 59.

LaTeX Warning: Font shape declaration has incorrect series value `mc'.
               It should not contain an `m'! Please correct it.
               Found on input line 79.

LaTeX Warning: Font shape declaration has incorrect series value `mc'.
               It should not contain an `m'! Please correct it.
               Found on input line 102.

LaTeX Warning: Font shape declaration has incorrect series value `mc'.
               It should not contain an `m'! Please correct it.
               Found on input line 105.

LaTeX Warning: Font shape declaration has incorrect series value `mc'.
               It should not contain an `m'! Please correct it.
               Found on input line 108.

LaTeX Warning: Font shape declaration has incorrect series value `mc'.
               It should not contain an `m'! Please correct it.
               Found on input line 128.

LaTeX Warning: Font shape declaration has incorrect series value `mc'.
               It should not contain an `m'! Please correct it.
               Found on input line 259.

LaTeX Warning: Font shape declaration has incorrect series value `mc'.
               It should not contain an `m'! Please correct it.
               Found on input line 262.

LaTeX Warning: Font shape declaration has incorrect series value `mc'.
               It should not contain an `m'! Please correct it.
               Found on input line 265.

LaTeX Warning: Font shape declaration has incorrect series value `mc'.
               It should not contain an `m'! Please correct it.
               Found on input line 268.

LaTeX Warning: Font shape declaration has incorrect series value `mc'.
               It should not contain an `m'! Please correct it.
               Found on input line 313.

LaTeX Warning: Font shape declaration has incorrect series value `mc'.
               It should not contain an `m'! Please correct it.
               Found on input line 316.

LaTeX Warning: Font shape declaration has incorrect series value `mc'.
               It should not contain an `m'! Please correct it.
               Found on input line 319.

LaTeX Warning: Font shape declaration has incorrect series value `mc'.
               It should not contain an `m'! Please correct it.
               Found on input line 322.

) ("C:\Program Files\MiKTeX\tex/latex/mathdesign\mdttfont.def"
File: mdttfont.def 2013/08/29 v2.31 (Math Design Project)
)
\symmdcal=\mathgroup4
LaTeX Font Info:    Overwriting symbol font `mdcal' in version `bold'
(Font)                  OMS/mdbch/m/n --> OMS/mdbch/b/n on input line 97.
\symmdscr=\mathgroup5
LaTeX Font Info:    Overwriting symbol font `mdscr' in version `bold'
(Font)                  OMS/mdbch/m/n --> OMS/mdbch/b/n on input line 103.
LaTeX Font Info:    Overwriting math alphabet `\mathfrak' in version `bold'
(Font)                  U/xmdeuf/m/n --> U/xmdeuf/b/n on input line 110.
LaTeX Font Info:    Overwriting symbol font `operators' in version `normal'
(Font)                  OT1/cmr/m/n --> OT1/mdbch/m/n on input line 121.
LaTeX Font Info:    Overwriting symbol font `letters' in version `normal'
(Font)                  OML/cmm/m/it --> OML/mdbch/m/it on input line 122.
LaTeX Font Info:    Overwriting symbol font `symbols' in version `normal'
(Font)                  OMS/cmsy/m/n --> OMS/mdbch/m/n on input line 123.
LaTeX Font Info:    Overwriting symbol font `largesymbols' in version `normal'
(Font)                  OMX/cmex/m/n --> OMX/mdbch/m/n on input line 124.
LaTeX Font Info:    Overwriting symbol font `operators' in version `bold'
(Font)                  OT1/cmr/bx/n --> OT1/mdbch/b/n on input line 126.
LaTeX Font Info:    Overwriting symbol font `letters' in version `bold'
(Font)                  OML/cmm/b/it --> OML/mdbch/b/it on input line 127.
LaTeX Font Info:    Overwriting symbol font `symbols' in version `bold'
(Font)                  OMS/cmsy/b/n --> OMS/mdbch/b/n on input line 128.
LaTeX Font Info:    Overwriting symbol font `largesymbols' in version `bold'
(Font)                  OMX/cmex/m/n --> OMX/mdbch/b/n on input line 129.
LaTeX Font Info:    Overwriting math alphabet `\mathrm' in version `normal'
(Font)                  OT1/mdbch/m/n --> T1/mdbch/m/n on input line 131.
LaTeX Font Info:    Overwriting math alphabet `\mathbf' in version `normal'
(Font)                  OT1/cmr/bx/n --> T1/mdbch/b/n on input line 132.
LaTeX Font Info:    Overwriting math alphabet `\mathit' in version `normal'
(Font)                  OT1/cmr/m/it --> T1/mdbch/m/it on input line 133.
LaTeX Font Info:    Overwriting math alphabet `\mathsf' in version `normal'
(Font)                  OT1/cmss/m/n --> T1/cmss/m/n on input line 134.
LaTeX Font Info:    Overwriting math alphabet `\mathtt' in version `normal'
(Font)                  OT1/cmtt/m/n --> T1/cmtt/m/n on input line 135.
LaTeX Font Info:    Overwriting math alphabet `\mathrm' in version `bold'
(Font)                  OT1/mdbch/b/n --> T1/mdbch/b/n on input line 137.
LaTeX Font Info:    Overwriting math alphabet `\mathbf' in version `bold'
(Font)                  OT1/cmr/bx/n --> T1/mdbch/b/n on input line 138.
LaTeX Font Info:    Overwriting math alphabet `\mathit' in version `bold'
(Font)                  OT1/cmr/bx/it --> T1/mdbch/b/it on input line 139.
LaTeX Font Info:    Overwriting math alphabet `\mathsf' in version `bold'
(Font)                  OT1/cmss/bx/n --> T1/cmss/b/n on input line 140.
LaTeX Font Info:    Overwriting math alphabet `\mathtt' in version `bold'
(Font)                  OT1/cmtt/m/n --> T1/cmtt/b/n on input line 141.
\symlettersupright=\mathgroup6
LaTeX Font Info:    Overwriting symbol font `lettersupright' in version `bold'
(Font)                  OML/mdbch/m/n --> OML/mdbch/b/n on input line 144.
LaTeX Font Info:    Redeclaring math alphabet \mathrm on input line 145.
LaTeX Font Info:    Overwriting math alphabet `\mathcal' in version `normal'
(Font)                  OMS/mdbch/m/n --> OMS/mdbch/m/n on input line 167.

("C:\Program Files\MiKTeX\tex/latex/xkeyval\xkeyval.sty"
Package: xkeyval 2014/12/03 v2.7a package option processing (HA)

("C:\Program Files\MiKTeX\tex/generic/xkeyval\xkeyval.tex"
("C:\Program Files\MiKTeX\tex/generic/xkeyval\xkvutils.tex"
\XKV@toks=\toks18
\XKV@tempa@toks=\toks19
)
\XKV@depth=\count183
File: xkeyval.tex 2014/12/03 v2.7a key=value parser (HA)
))
LaTeX Font Info:    Trying to load font information for T1+mdbch on input line
186.

("C:\Program Files\MiKTeX\tex/latex/mathdesign/mdbch\t1mdbch.fd"
File: t1mdbch.fd 2013/08/29 Fontinst v1.933 font definitions for T1/mdbch.
)
LaTeX Font Info:    Font shape `T1/mdbch/m/n' will be
(Font)              scaled to size 9.60007pt on input line 186.
LaTeX Font Info:    Redeclaring math accent \widetilde on input line 449.
LaTeX Font Info:    Redeclaring math accent \widehat on input line 450.
Now handling font encoding MDA ...
... no UTF-8 mapping file for font encoding MDA
\symmathdesignA=\mathgroup7
LaTeX Font Info:    Overwriting symbol font `mathdesignA' in version `bold'
(Font)                  MDA/mdbch/m/n --> MDA/mdbch/b/n on input line 491.
Now handling font encoding MDB ...
... no UTF-8 mapping file for font encoding MDB
\symmathdesignB=\mathgroup8
LaTeX Font Info:    Overwriting symbol font `mathdesignB' in version `bold'
(Font)                  MDB/mdbch/m/n --> MDB/mdbch/b/n on input line 498.
\@emptytoks=\toks20
LaTeX Font Info:    Redeclaring math accent \widetilde on input line 532.
LaTeX Font Info:    Redeclaring math accent \widehat on input line 533.
\rulethickness=\skip49
)
("C:\Program Files\MiKTeX\tex/latex/base\fontenc.sty"
Package: fontenc 2020/08/10 v2.0s Standard LaTeX package
))
("C:\Program Files\MiKTeX\tex/latex/xcharter\XCharter.sty"
Package: XCharter 2020/09/20 v1.208

`XCharter' v1.208, 2020/09/20 Text macros for XCharter, an extension of Charter
 (msharpe) ("C:\Program Files\MiKTeX\tex/latex/base\fontenc.sty"
Package: fontenc 2020/08/10 v2.0s Standard LaTeX package

("C:\Program Files\MiKTeX\tex/latex/cyrillic\t2aenc.def"
File: t2aenc.def 2005/09/27 v1.0i Cyrillic encoding definition file
Now handling font encoding T2A ...
... processing UTF-8 mapping file for font encoding T2A

("C:\Program Files\MiKTeX\tex/latex/base\t2aenc.dfu"
File: t2aenc.dfu 2019/11/14 v1.2k UTF-8 support for inputenc
   defining Unicode char U+00A4 (decimal 164)
   defining Unicode char U+00A7 (decimal 167)
   defining Unicode char U+00AB (decimal 171)
   defining Unicode char U+00BB (decimal 187)
   defining Unicode char U+0131 (decimal 305)
   defining Unicode char U+0237 (decimal 567)
   defining Unicode char U+0400 (decimal 1024)
   defining Unicode char U+0401 (decimal 1025)
   defining Unicode char U+0402 (decimal 1026)
   defining Unicode char U+0403 (decimal 1027)
   defining Unicode char U+0404 (decimal 1028)
   defining Unicode char U+0405 (decimal 1029)
   defining Unicode char U+0406 (decimal 1030)
   defining Unicode char U+0407 (decimal 1031)
   defining Unicode char U+0408 (decimal 1032)
   defining Unicode char U+0409 (decimal 1033)
   defining Unicode char U+040A (decimal 1034)
   defining Unicode char U+040B (decimal 1035)
   defining Unicode char U+040C (decimal 1036)
   defining Unicode char U+040D (decimal 1037)
   defining Unicode char U+040E (decimal 1038)
   defining Unicode char U+040F (decimal 1039)
   defining Unicode char U+0410 (decimal 1040)
   defining Unicode char U+0411 (decimal 1041)
   defining Unicode char U+0412 (decimal 1042)
   defining Unicode char U+0413 (decimal 1043)
   defining Unicode char U+0414 (decimal 1044)
   defining Unicode char U+0415 (decimal 1045)
   defining Unicode char U+0416 (decimal 1046)
   defining Unicode char U+0417 (decimal 1047)
   defining Unicode char U+0418 (decimal 1048)
   defining Unicode char U+0419 (decimal 1049)
   defining Unicode char U+041A (decimal 1050)
   defining Unicode char U+041B (decimal 1051)
   defining Unicode char U+041C (decimal 1052)
   defining Unicode char U+041D (decimal 1053)
   defining Unicode char U+041E (decimal 1054)
   defining Unicode char U+041F (decimal 1055)
   defining Unicode char U+0420 (decimal 1056)
   defining Unicode char U+0421 (decimal 1057)
   defining Unicode char U+0422 (decimal 1058)
   defining Unicode char U+0423 (decimal 1059)
   defining Unicode char U+0424 (decimal 1060)
   defining Unicode char U+0425 (decimal 1061)
   defining Unicode char U+0426 (decimal 1062)
   defining Unicode char U+0427 (decimal 1063)
   defining Unicode char U+0428 (decimal 1064)
   defining Unicode char U+0429 (decimal 1065)
   defining Unicode char U+042A (decimal 1066)
   defining Unicode char U+042B (decimal 1067)
   defining Unicode char U+042C (decimal 1068)
   defining Unicode char U+042D (decimal 1069)
   defining Unicode char U+042E (decimal 1070)
   defining Unicode char U+042F (decimal 1071)
   defining Unicode char U+0430 (decimal 1072)
   defining Unicode char U+0431 (decimal 1073)
   defining Unicode char U+0432 (decimal 1074)
   defining Unicode char U+0433 (decimal 1075)
   defining Unicode char U+0434 (decimal 1076)
   defining Unicode char U+0435 (decimal 1077)
   defining Unicode char U+0436 (decimal 1078)
   defining Unicode char U+0437 (decimal 1079)
   defining Unicode char U+0438 (decimal 1080)
   defining Unicode char U+0439 (decimal 1081)
   defining Unicode char U+043A (decimal 1082)
   defining Unicode char U+043B (decimal 1083)
   defining Unicode char U+043C (decimal 1084)
   defining Unicode char U+043D (decimal 1085)
   defining Unicode char U+043E (decimal 1086)
   defining Unicode char U+043F (decimal 1087)
   defining Unicode char U+0440 (decimal 1088)
   defining Unicode char U+0441 (decimal 1089)
   defining Unicode char U+0442 (decimal 1090)
   defining Unicode char U+0443 (decimal 1091)
   defining Unicode char U+0444 (decimal 1092)
   defining Unicode char U+0445 (decimal 1093)
   defining Unicode char U+0446 (decimal 1094)
   defining Unicode char U+0447 (decimal 1095)
   defining Unicode char U+0448 (decimal 1096)
   defining Unicode char U+0449 (decimal 1097)
   defining Unicode char U+044A (decimal 1098)
   defining Unicode char U+044B (decimal 1099)
   defining Unicode char U+044C (decimal 1100)
   defining Unicode char U+044D (decimal 1101)
   defining Unicode char U+044E (decimal 1102)
   defining Unicode char U+044F (decimal 1103)
   defining Unicode char U+0450 (decimal 1104)
   defining Unicode char U+0451 (decimal 1105)
   defining Unicode char U+0452 (decimal 1106)
   defining Unicode char U+0453 (decimal 1107)
   defining Unicode char U+0454 (decimal 1108)
   defining Unicode char U+0455 (decimal 1109)
   defining Unicode char U+0456 (decimal 1110)
   defining Unicode char U+0457 (decimal 1111)
   defining Unicode char U+0458 (decimal 1112)
   defining Unicode char U+0459 (decimal 1113)
   defining Unicode char U+045A (decimal 1114)
   defining Unicode char U+045B (decimal 1115)
   defining Unicode char U+045C (decimal 1116)
   defining Unicode char U+045D (decimal 1117)
   defining Unicode char U+045E (decimal 1118)
   defining Unicode char U+045F (decimal 1119)
   defining Unicode char U+0490 (decimal 1168)
   defining Unicode char U+0491 (decimal 1169)
   defining Unicode char U+0492 (decimal 1170)
   defining Unicode char U+0493 (decimal 1171)
   defining Unicode char U+0496 (decimal 1174)
   defining Unicode char U+0497 (decimal 1175)
   defining Unicode char U+0498 (decimal 1176)
   defining Unicode char U+0499 (decimal 1177)
   defining Unicode char U+049A (decimal 1178)
   defining Unicode char U+049B (decimal 1179)
   defining Unicode char U+049C (decimal 1180)
   defining Unicode char U+049D (decimal 1181)
   defining Unicode char U+04A0 (decimal 1184)
   defining Unicode char U+04A1 (decimal 1185)
   defining Unicode char U+04A2 (decimal 1186)
   defining Unicode char U+04A3 (decimal 1187)
   defining Unicode char U+04A4 (decimal 1188)
   defining Unicode char U+04A5 (decimal 1189)
   defining Unicode char U+04AA (decimal 1194)
   defining Unicode char U+04AB (decimal 1195)
   defining Unicode char U+04AE (decimal 1198)
   defining Unicode char U+04AF (decimal 1199)
   defining Unicode char U+04B0 (decimal 1200)
   defining Unicode char U+04B1 (decimal 1201)
   defining Unicode char U+04B2 (decimal 1202)
   defining Unicode char U+04B3 (decimal 1203)
   defining Unicode char U+04B6 (decimal 1206)
   defining Unicode char U+04B7 (decimal 1207)
   defining Unicode char U+04B8 (decimal 1208)
   defining Unicode char U+04B9 (decimal 1209)
   defining Unicode char U+04BA (decimal 1210)
   defining Unicode char U+04BB (decimal 1211)
   defining Unicode char U+04C0 (decimal 1216)
   defining Unicode char U+04C1 (decimal 1217)
   defining Unicode char U+04C2 (decimal 1218)
   defining Unicode char U+04D0 (decimal 1232)
   defining Unicode char U+04D1 (decimal 1233)
   defining Unicode char U+04D2 (decimal 1234)
   defining Unicode char U+04D3 (decimal 1235)
   defining Unicode char U+04D4 (decimal 1236)
   defining Unicode char U+04D5 (decimal 1237)
   defining Unicode char U+04D6 (decimal 1238)
   defining Unicode char U+04D7 (decimal 1239)
   defining Unicode char U+04D8 (decimal 1240)
   defining Unicode char U+04D9 (decimal 1241)
   defining Unicode char U+04DA (decimal 1242)
   defining Unicode char U+04DB (decimal 1243)
   defining Unicode char U+04DC (decimal 1244)
   defining Unicode char U+04DD (decimal 1245)
   defining Unicode char U+04DE (decimal 1246)
   defining Unicode char U+04DF (decimal 1247)
   defining Unicode char U+04E2 (decimal 1250)
   defining Unicode char U+04E3 (decimal 1251)
   defining Unicode char U+04E4 (decimal 1252)
   defining Unicode char U+04E5 (decimal 1253)
   defining Unicode char U+04E6 (decimal 1254)
   defining Unicode char U+04E7 (decimal 1255)
   defining Unicode char U+04E8 (decimal 1256)
   defining Unicode char U+04E9 (decimal 1257)
   defining Unicode char U+04EC (decimal 1260)
   defining Unicode char U+04ED (decimal 1261)
   defining Unicode char U+04EE (decimal 1262)
   defining Unicode char U+04EF (decimal 1263)
   defining Unicode char U+04F0 (decimal 1264)
   defining Unicode char U+04F1 (decimal 1265)
   defining Unicode char U+04F2 (decimal 1266)
   defining Unicode char U+04F3 (decimal 1267)
   defining Unicode char U+04F4 (decimal 1268)
   defining Unicode char U+04F5 (decimal 1269)
   defining Unicode char U+04F8 (decimal 1272)
   defining Unicode char U+04F9 (decimal 1273)
   defining Unicode char U+200C (decimal 8204)
   defining Unicode char U+2013 (decimal 8211)
   defining Unicode char U+2014 (decimal 8212)
   defining Unicode char U+2018 (decimal 8216)
   defining Unicode char U+2019 (decimal 8217)
   defining Unicode char U+201C (decimal 8220)
   defining Unicode char U+201D (decimal 8221)
   defining Unicode char U+201E (decimal 8222)
   defining Unicode char U+2030 (decimal 8240)
   defining Unicode char U+2031 (decimal 8241)
   defining Unicode char U+2116 (decimal 8470)
   defining Unicode char U+2329 (decimal 9001)
   defining Unicode char U+232A (decimal 9002)
   defining Unicode char U+2423 (decimal 9251)
   defining Unicode char U+27E8 (decimal 10216)
   defining Unicode char U+27E9 (decimal 10217)
   defining Unicode char U+FB00 (decimal 64256)
   defining Unicode char U+FB01 (decimal 64257)
   defining Unicode char U+FB02 (decimal 64258)
   defining Unicode char U+FB03 (decimal 64259)
   defining Unicode char U+FB04 (decimal 64260)
   defining Unicode char U+FB05 (decimal 64261)
   defining Unicode char U+FB06 (decimal 64262)
))
("C:\Program Files\MiKTeX\tex/latex/ly1\ly1enc.def"
File: ly1enc.def 2009/07/22 v0.7 TeX 'n ANSI encoding (DPC/KB)
Now handling font encoding LY1 ...
... processing UTF-8 mapping file for font encoding LY1

("C:\Program Files\MiKTeX\tex/latex/base\ly1enc.dfu"
File: ly1enc.dfu 2019/11/14 v1.2k UTF-8 support for inputenc
   defining Unicode char U+00A0 (decimal 160)

   defining Unicode char U+2039 (decimal 8249)
   defining Unicode char U+203A (decimal 8250)
   defining Unicode char U+2122 (decimal 8482)
   defining Unicode char U+FB00 (decimal 64256)
   defining Unicode char U+FB01 (decimal 64257)
   defining Unicode char U+FB02 (decimal 64258)
   defining Unicode char U+FB03 (decimal 64259)
   defining Unicode char U+FB04 (decimal 64260)
   defining Unicode char U+FB05 (decimal 64261)
   defining Unicode char U+FB06 (decimal 64262)
)))
("C:\Program Files\MiKTeX\tex/latex/base\textcomp.sty"
Package: textcomp 2020/02/02 v2.0n Standard LaTeX package
)
("C:\Program Files\MiKTeX\tex/latex/carlisle\scalefnt.sty")
LaTeX Font Info:    Setting XCharter-LF sub-encoding to TS1/0 on input line 16.

LaTeX Font Info:    Changing XCharter-TLF sub-encoding to TS1/0 on input line 1
6.
LaTeX Font Info:    Setting XCharter-OsF sub-encoding to TS1/0 on input line 16
.
LaTeX Font Info:    Changing XCharter-TOsF sub-encoding to TS1/0 on input line
16.

("C:\Program Files\MiKTeX\tex/latex/etoolbox\etoolbox.sty"
Package: etoolbox 2020/10/05 v2.5k e-TeX tools for LaTeX (JAW)
\etb@tempcnta=\count184
)
("C:\Program Files\MiKTeX\tex/latex/xstring\xstring.sty"
("C:\Program Files\MiKTeX\tex/generic/xstring\xstring.tex"
\integerpart=\count185
\decimalpart=\count186
)
Package: xstring 2019/02/06 v1.83 String manipulations (CT)
)
("C:\Program Files\MiKTeX\tex/latex/fontaxes\fontaxes.sty"
Package: fontaxes 2020/07/21 v1.0e Font selection axes
LaTeX Info: Redefining \upshape on input line 29.
LaTeX Info: Redefining \itshape on input line 31.
LaTeX Info: Redefining \slshape on input line 33.
LaTeX Info: Redefining \swshape on input line 35.
LaTeX Info: Redefining \scshape on input line 37.
LaTeX Info: Redefining \sscshape on input line 39.
LaTeX Info: Redefining \ulcshape on input line 41.
LaTeX Info: Redefining \textsw on input line 47.
LaTeX Info: Redefining \textssc on input line 48.
LaTeX Info: Redefining \textulc on input line 49.
))
LaTeX Font Info:    Trying to load font information for T1+XCharter-TOsF on inp
ut line 10.

("C:\Program Files\MiKTeX\tex/latex/xcharter\t1xcharter-tosf.fd"
File: T1XCharter-TOsF.fd 2017/06/25 (autoinst) Font definitions for T1/XCharter
-TOsF.
)
LaTeX Font Info:    Font shape `T1/XCharter-TOsF/m/n' will be
(Font)              scaled to size 9.60007pt on input line 10.

! Font T1/XCharter-TOsF/m/n/10=XCharter1-Roman-tosf-t1 at 9.60007pt not loadabl
e: Metric (TFM) file not found.
<to be read again>
                   relax
l.10 \begin{document}

I wasn't able to read the size data for this font,
so I will ignore the font specification.
[Wizards can fix TFM files using TFtoPL/PLtoTF.]
You might try inserting a different font spec;
e.g., type `I\font<same font id>=<substitute font name>'.

("C:\Program Files\MiKTeX\tex/latex/l3backend\l3backend-pdftex.def"
File: l3backend-pdftex.def 2020-09-24 L3 backend support: PDF output (pdfTeX)
\l__kernel_color_stack_int=\count187
\l__pdf_internal_box=\box47
)
(document.aux)
\openout1 = `document.aux'.

LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 10.
LaTeX Font Info:    ... okay on input line 10.
LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 10.
LaTeX Font Info:    ... okay on input line 10.
LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 10.
LaTeX Font Info:    ... okay on input line 10.
LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 10.
LaTeX Font Info:    ... okay on input line 10.
LaTeX Font Info:    Checking defaults for TS1/cmr/m/n on input line 10.
LaTeX Font Info:    ... okay on input line 10.
LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 10.
LaTeX Font Info:    ... okay on input line 10.
LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 10.
LaTeX Font Info:    ... okay on input line 10.
LaTeX Font Info:    Checking defaults for MDA/cmr/m/n on input line 10.
LaTeX Font Info:    Trying to load font information for MDA+cmr on input line 1
0.
 ("C:\Program Files\MiKTeX\tex/latex/mathdesign\mdacmr.fd"
File: mdacmr.fd
)
LaTeX Font Info:    ... okay on input line 10.
LaTeX Font Info:    Checking defaults for MDB/cmr/m/n on input line 10.
LaTeX Font Info:    Trying to load font information for MDB+cmr on input line 1
0.

("C:\Program Files\MiKTeX\tex/latex/mathdesign\mdbcmr.fd"
File: mdbcmr.fd
)
LaTeX Font Info:    ... okay on input line 10.
LaTeX Font Info:    Checking defaults for T2A/cmr/m/n on input line 10.
LaTeX Font Info:    Trying to load font information for T2A+cmr on input line 1
0.

("C:\Program Files\MiKTeX\tex/latex/cyrillic\t2acmr.fd"
File: t2acmr.fd 2001/08/11 v1.0a Computer Modern Cyrillic font definitions
)
LaTeX Font Info:    ... okay on input line 10.
LaTeX Font Info:    Checking defaults for LY1/ptm/m/n on input line 10.
LaTeX Font Info:    Trying to load font information for LY1+ptm on input line 1
0.

("C:\Program Files\MiKTeX\tex/latex/ly1\ly1ptm.fd"
File: ly1ptm.fd 2001/02/01 font definitions for LY1/ptm using Berry names.
)
LaTeX Font Info:    ... okay on input line 10.
\c@mv@tabular=\count188
\c@mv@boldtabular=\count189
Missing character: There is no H in font nullfont!
Missing character: There is no e in font nullfont!
Missing character: There is no l in font nullfont!
Missing character: There is no l in font nullfont!
Missing character: There is no o in font nullfont!
Missing character: There is no W in font nullfont!
Missing character: There is no o in font nullfont!
Missing character: There is no r in font nullfont!
Missing character: There is no l in font nullfont!
Missing character: There is no d in font nullfont!
Missing character: There is no 1 in font nullfont!
 [1

] (document.aux) )
Here is how much of TeX's memory you used:
 3848 strings out of 479799
 53432 string characters out of 2879595
 299851 words of memory out of 3000000
 20815 multiletter control sequences out of 15000+200000
 537917 words of font info for 31 fonts, out of 3000000 for 9000
 1141 hyphenation exceptions out of 8191
 66i,4n,72p,262b,106s stack positions out of 5000i,500n,10000p,200000b,50000s

Output written on document.pdf (1 page, 867 bytes).
PDF statistics:
 6 PDF objects out of 1000 (max. 8388607)
 0 named destinations out of 1000 (max. 500000)
 1 words of extra memory for PDF output out of 10000 (max. 10000000)

````

  [1]: https://i.stack.imgur.com/XKNsR.png


text:
Q: How to rename changelog files in Liquibase? I'm using Liquibase for my project and would like to rename my changelog files.
From old structure:
databaseChangeLog:
    - include:
        file: db/changelog/add_pokemons.sql
    - include:
        file: db/changelog/add_minions.sql

To new structure:
databaseChangeLog:
    - include:
        file: db/changelog/v001__add_table_pokemons.sql
    - include:
        file: db/changelog/v002__add_table_minions.sql

The Liquibase documentation unfortunately does not state best practices for such intention.
I was thinking about duplicating my files so I have the old ones plus new ones in one directory and then write a migration to change column filename in the databasechangelog table.
What would be the best approach in your opinion?

A: The problem here is that liquibase holds the name of file inside databasechangelog.filename. So if you are not using logicalFilePath yet maybe you have a chance.
If those files you've posted are formatted sql files then you could do something like this (example for file db/changelog/add_pokemons.sql):
--liquibase formatted sql logicalFilePath:db/changelog/add_pokemons.sql

and you can rename the actual file to whatever you want.
In that case nothing should be broken inside existing databasechangelog table.
Other than that there is probably no available change that will do that automatically from liquibase.


text:
Q: How to get the x-coordinate of a region by it's y-value I get region like this:
region = ConvexHullMesh[data = RandomReal[{0, 100}, {100, 2}]] //
  RegionBoundary

Then I get a equally spaced y-value from minimum to maximum.
yrange = data[[All, -2]] // MinMax;
y = Subdivide[Sequence @@ yrange, 10]

{0.235321, 10.1105, 19.9857, 29.861, 39.7362, 49.6114, 59.4866, \
  69.3618, 79.237, 89.1122, 98.9875}

When I wanna get the x-value by these y-value in this region,the warning in my procedure.But I think have no syntax errors in  RegionMember's usage.
Solve[#, x] & /@ (RegionMember[region, {x, #}] & /@ y)

Or another way is failure to make it.
RegionIntersection[region, #] & /@ (ImplicitRegion[#, {x, yy}] & /@
   Thread[yy == y])

So are there better way to get the x-coordinate which is corresponding the region?Please the answer explain these two reason where failure to it and give a method to get the right x-coordinates.I will appreciate you very much.
Update:
I'm appreciate @JasonB.But its answer doesn't metion the reason,especially the kind of second method.I think it is a bug of RegionIntersection.Please everyone have a affirm and I'll attach a bug label to help improve Mathematica.

A: This definitely seems like a bug in RegionIntersection, and you can confirm it using this simple example.
Take two Region objects, one an ImplicitRegion defined along a horizontal line, the other a unit square.  This error shows up regardless of whether RegionBoundary is used to define the region, so we'll leave it out.
region1 = Rectangle[];
line1 = ImplicitRegion[y == 1/2, {x, y}];
{RegionPlot[{region1, line1},
  PlotRange -> {{-.1, 1.1}, {-.1, 1.1}}],
 DiscretizeRegion@RegionIntersection[line1, region1]}

No problem there, as RegionIntersection had no trouble, and we were able to discretize the resulting intersection.  If however, we defined the region using an explicit set of points (in a way that it should be the exact same region), then we can't find the intersection
region1b = ConvexHullMesh[{{0, 1}, {1, 1}, {1, 0}, {0, 0}}];
line1 = ImplicitRegion[y == 1/2, {x, y}];
{RegionPlot[{region1b, line1}, PlotRange -> {{-.1, 1.1}, {-.1, 1.1}}],
 DiscretizeRegion@RegionIntersection[line1, region1b]}

The problem seems to be that RegionIntersection cannot find the intersection between a 2D MeshRegion and a 1D region.  In the example above, region1 is not a MeshRegion while region1b is.  If we try it again, this time making the exact same region with ImplicitRegion, we have no problem,
region1c = ImplicitRegion[0 <= x <= 1 && 0 <= y <= 1, {x, y}];
line1 = ImplicitRegion[y == 1/2, {x, y}];
{RegionPlot[{region1c, line1}, PlotRange -> {{-.1, 1.1}, {-.1, 1.1}}],
  DiscretizeRegion@RegionIntersection[line1, region1c]}

The documentation for RegionIntersection doesn't mention this problem, it only says that the two regions should have the same RegionEmbeddingDimension, which they do. That seems pretty conclusive to be a bug.  Regions are fairly new, and there are lots of kinks left to work out.
The same problem applies to Solve,
Solve[RegionMember[RegionBoundary[#], {x, 1/2}], x] & /@ {region1,
  region1b, region1c}

So we can narrow down that the problem is finding intersections between  2D MeshRegion and BoundaryMeshRegion objects and 1D regions.
But your question "How to get the x-coordinate of a region by it's y-value" has a workable solution.  You can't use Solve, RegionNearest will give you the nearest point and not keep the same y value, NMinimize will only give one x value, so what we are left with is FindRoot. Here is the best way I can find to get both of the x values for a given y value in your example.
region = ConvexHullMesh[
    data = Rationalize@RandomReal[{0, 100}, {100, 2}]] //
   RegionBoundary;
(*You originally had -2 here, seems like a typo*)

yrange = data[[All, 2]] // MinMax;
xrange = data[[All, 1]] // MinMax;

yvalues = Subdivide[Sequence @@ yrange, 10];
xvalues = x /. {
    (Quiet@
        FindRoot[RegionDistance[region, {x, #}], {x, xrange[[1]]}] & /@
       yvalues), (Quiet@
        FindRoot[RegionDistance[region, {x, #}], {x, xrange[[2]]}] & /@
       yvalues)};
Show[
 RegionPlot[region],
 ListPlot[{
   Transpose[{xvalues[[1]], yvalues}],
   Transpose[{xvalues[[2]], yvalues}]}, PlotStyle -> Red]]

Edit
@yode, as to your last comment, RegionDistance returns a number, which is why we can use it with NMinimize, while RegionMember returns a truth value, which is why we can often use it with Solve, Reduce, or NSolve.  Mathematica is able to simplify the truth statement when the Region is defined via a geometric object, or a call to ImplicitRegion, but not when it is numerically defined as a MeshRegion.
I still think that you should be able to use NSolve in this case, but as we see above, many of the functions that work with regions fail when using MeshRegion objects.

A: Just for the record, this is a way to do it in V9:
<< ComputationalGeometry`
SeedRandom[42];
l = RandomReal[{0, 50}, {100, 2}];
{xr, yr} = Through[{Min, Max}[#]] & /@ Transpose@l;
mylines = Line/@(Thread[{xr + {-1,1}, #}]&/@  Range[Sequence @@ yr, -Subtract @@ yr/10]);
gc = GraphicsComplex[l, {FaceForm[White], EdgeForm[Black], Polygon@ConvexHull[l]}];
gmf = Graphics`Mesh`FindIntersections;
pts = Flatten[gmf[{#, gc}] & /@ mylines, 1];
pts = Join[pts, gmf[{Line @@ (# - {0, 10000 $MachineEpsilon} & /@
                                                         List @@ mylines[[-1]]), gc}]];
Graphics[{mylines, gc, Black, Point@l, PointSize@Large, Red, Point@pts}]


text:
Q: Apache behind Nginx - PhP needs to know the correct port Im currently using Apache behind an Nginx Proxy which really works fine with one exception:
Apache waits on Port 8888 and only accepts connections from 127.0.0.1
Nginx listens on Port 80 to the real world - servers static content, does load balancing and handles proxy requests to Apache listening on 8888.
The Problem is:
PHP Scripts executed by Apache experience that the server Port is 8888. Scripts like phpmyadmin or nusoap provide redirecting and use this port as part of the redirect url. The Problem is Port 8888 is not visible from the outside thus no connection can be established.
Do you know where the configuration went wrong or how i can force php to think it is working on a port 80 Apache server?
As I cannot pin down the problem I have no clue whether posting my configuration files would help. Maybe its just an option I forgot or stuff.
If you need I can - of coure - provide additional config lines.
Thank you very much

A: Just that everyone knows - here is the answer to the question:
Some douchebag (me) created a virtual host with the servername including the port
ServerName   some.server.com:8888

Removing the :8888 removed the errors.
Ty all

A: I guess you just need to rewrite the Location header the proxied server sets.
Take a look at
http://wiki.nginx.org/HttpProxyModule#proxy_redirect


text:
Q: How can I plot 2d FEM mesh?
I am quit new to python, tried to search in the documentations to draw 2D mesh (a filled rectangle ) using vertices/nodes values at each point as shown in fig attached? I have tried many ideas but all failed, as the following:
from mpl_toolkits.mplot3d import Axes3D
from mpl_toolkits.mplot3d.art3d import Poly3DCollection
import matplotlib.pyplot as plt
import numpy as np
fig = plt.figure()
ax = Axes3D(fig, auto_add_to_figure=False)
fig.add_axes(ax)
coord = [0,25,25,0]
coord_y = [.06,.6,.1,.125]
z = [0,0,0,0]
connectivity=np.array([[0,3,4,1],[1,4,5,2]])
verts = [list(zip(coord,coord_y,z))]
ax.add_collection3d(Poly3DCollection(verts))
plt.show()


text:
Q: glob.iglob to find all .txt files in all sub-directories yields error Simple code gives the below error. It's directly from the docs (https://docs.python.org/3/library/glob.html)
TypeError: iglob() got an unexpected keyword argument 'recursive'
import glob
for filename in glob.iglob('C:\\**\\*txt', recursive=True):
    print filename

A: It seems you're using Python 2.7 and reading the Python 3.5 documentation.

A: The recursive parameter has been added in python 3.5, which means version 3.4.3 also has that problem.
If you don't want to upgrade your python version, you can use glob2, which supports recursive calls (**) by default.


text:
Q: While writing fibonacci series in python, getting IndexError: list index out of range def fib(n):
    lst = [0,1]
    for i in range(n):
        lst.append(lst[n] + lst[n+1])
    print lst

fib(3)

Getting IndexError: list index out of range

A: You're using the wrong index in lst.append(lst[n] + lst[n+1]). You should be using: lst.append(lst[i] + lst[i+1]) (i not n).

A: You are using wrong index n, you should use i.
You can fix like this,
def fib(n):
    lst = []
    for item in range(n):
        lst.append(item + item+1)
    print lst

fib(3)


text:
Q: python If I have a dictonary with keys that contain mutliple values and a single value how to filter out only keys that contain multiple values word_freq = {'is': [1, 3, 4, 8, 10],'no' :[1], 'yes':[1,2]}
I want to only get 'is' and 'yes' using the fact that they contain more than one value.

A: filtered_keys = [k for k in word_freq.keys() if len(word_freq[k])>1]

A: You can try this:
for i in word_freq:
    if len(word_freq[i]) > 1:
        print(word_freq[i])

It loops through the dictionary in word_freq and if the items/values in the word_freq are more than 1 then it prints them out.


text:
Q: How do I use Tapestry-Security? I discovered Tapestry 5, quite recently, its clear separation between view and controller, the use of name standardization instead of XML made me go for it straight. Quite frankly I don't plan on changing but the documentation is just not enough for me.
The project I'm working on must be able to support several types of roles. I must allow users authentifications, the use of certains services according to their roles ans the access of url by their roles as well.
After some research I came across Tapestry-Security which is part of the Tynamo project.
I want my Service layer to be totaly independant from my web application because I will then use it to implement web services and some others stuff. I do not feel like doing another identification system when the time comes.
My problem is that I do not see how use Tapestry-Security without using Tapestry.The example they show on Tapestry-Security guide is just not enough for me. I have a pretty rough idea, how it works.
However I do not know how I could use it outside the Tapestry 5.
How can I use Tapestry-Security without Tapestry 5 ?
I also do not understand the filter systems used in the AppModule class in Tapestry project.
Is there a document which explain the way AppModule works with the filter system ?
Is there someone which can explain me those things or point me in the right direction ?
Thanks.

A: Tapestry-Security is just a thin layer on top of the Apache Shiro project. It only provides:

*

*a way to configure Shiro via your Tapestry application module

*a set of Tapestry filters to do the actual security checks for Tapestry pages and actions

*annotations should you like to declare your security declaratively

*components to support conditional rendering in your .tml files

Underneath that layer, there is an ordinary instance of Shiro doing all the work, so you can access security (for example via the SecurityUtils class) like you normally would if Tapestry wasn't involved at all.
Edit based on comment: So while you can use Shiro in any web application you use, Tapestry-Security is really just a wrapper for use with Tapestry. If you, however, have an app that includes Tapestry along with other servlets (such as a web service), you should be able to let Tapestry-Security do the initialization work.
Concerning Tapestry filters:  I'm afraid this isn't documented very well. Tapestry filters work very much like Servlet Filters, but as Tapestry is implemented as a Servlet Filter itself, it has its own filter chain. Filters for Tapestry implement the RequestFilter interface.
public class MyFilter implements RequestFilter {

    @Override
    public boolean service(final Request request, final Response response,
            final RequestHandler handler) throws IOException {
        ... //your code
        try {
            return handler.service(request, response);
        } finally {
            ... //your code
        }

    }
}

You can add them to the filter chain by contributing them in your application module:
public void contributeRequestHandler(
            final OrderedConfiguration<RequestFilter> configurations) {
    configuration.add("MyFilter", new MyFilter());
}


text:
Q: Authentication Across Sites I have 2 sites:

*

*SITE A - an asp.net site

*SITE B - a php site

We have all the user information in an asp.net site (which is actually a Kentico site).
Now, there is a business requirement that users should be able to log-in with the same credentials in Site B. Ideally, we would need that users who log-in Site A, and navigate to Site B, the authentication would be automatic.
Is there a way to achieve this form of authentication. Or is it not possible?

A: This is not an authentication problem, but an authorization one. Once you have authenticated your user, in whichever way you want, with whichever technology you want, you probably will grant them some sort of token that you will then use to grant authorization to the different resources in your sites.
In your case you have two different technologies, which only means that you won't be able to use the out of the box asp.net or php session management, but all you need to do is have a common place to check that the session tokens are valid, they belong to a legitimate user and that user has permissions to access this resource.
If the above is trivial, sorry, maybe your question is more oriented to the sites being in two different domains, and therefore not being able to use a domain cookie to store the session information. is that the case?

A: The canonical solution to this is to use a protocol like OpenID. OpenID allows a website to ask a user to authenticate themselves using a different site, and then honour those credentials; using a protocol called "attribute Exchange", the authentication provider can provide additional data about the user.
OpenID is how StackExchange manages to log you in with your Google account (or whatever you're using), and how sites in the SO network recognize your identity without you logging in everywhere.
The benefit for OpenID is that it's a widely used protocol, so it's likely to be highly secure and well-tested; you don't risk weaving your own solution and accidentally exposing your users to security risks. It's well-documented, and widely supported.
There's an OpenID framework for .Net which allows you to create your own OpenID provider; it appears Kentico supports OpenID as an authentication mechanism. There are several OpenID libraries for PHP (Google is your friend here).
Exactly how you implement this depends on how your Kentico authentication works right now, but in principle it should be fairly easy to glue the Kentico user database to an OpenID provider you write; getting Kentico to use that for authentication appears to be a configuration setting. You'd have to re-write the PHP site to use OpenID; again, not clear how that currently works, but I can't imagine it would be harder than any other solution you might try.

A: I had a similar issue on a .net platform where I didn't have the option to put them on one subdomain. In that case you could pass the username and a token (that signified the user was already authenticated by site B) and perhaps the encrypted password to re-authenticate against an external DB, then redirect them to the site. In my case I needed to do this as I was redirecting to the corresponding site CMS for site admins.


text:
Q: The multi-part identifier could not be bound I have this very simple sql statement:
SELECT     max_dose
FROM         psychotropes
WHERE     (patient_meds.psychotrope = psychotrope_name) AND (patient_meds.patient_id = 12)

when I try to run it in Visual Studio 2008, it tells me "The multi-part 'patient_meds.psychotrope' identifier could not be bound"
it's weird, because I did set a relationship between the two tables in the diagram viewer

A: You are not including the table in the query. Without knowing the schema this is just an assumption. Also a database diagram does nothing to assist in queries.
SELECT ax_dose
FROM psychotropes
INNER JOIN patient_meds ON psychotropes.psychotrope_name = patient_meds.psychotrope
WHERE (patient_meds.patient_id = 12)

A: I guess you'll have to include patient_meds in the table list as:
FROM psychotropes, patient_meds


text: Q: Firebase Realtime Database to Jetpack Compose's LazyColumn I am creating an app using Jetpack Compose library in Android. I am using Firebase Realtime Database to retrieve and show data to the users. I have already created the database in firebase console. Now, I want to retrieve that data and show it as LazyColumn in my layout. The database only has names as string. I have watched many videos and seen many posts on how to achieve this, however they all show examples of retrieving data from Firestore. None of them show how to retrieve data from realtime database. So my question is, how to retrieve the names from realtime database and show them as LazyColumn in the app?


text:
Q: Is there a device or executable on Windows that can provide cryptographically secure random bytes via CMD or Powershell? Essentially, I'm looking for the Windows equivalent of /dev/urandom on Linux.
I know I can use Windows CNG via the C++ APIs, but no idea if there's an available (portable) method to access random bytes on any modern Windows system via command line.

A: Anything you can use through .NET (e.g. C#) you can also use through PowerShell, and this includes the Cryptography.RandomNumberGenerator class. (In .NET Core 2.x, this class is implemented via CNG BCryptGenRandom() on Windows, OpenSSL RAND_bytes() on Linux, AppleCrypto CCRandomGenerateBytes() on macOS.)
$bytes = New-Object byte[](8)
$rng = [System.Security.Cryptography.RandomNumberGenerator]::Create()
$rng.GetBytes($bytes)

(Code adapted from CryptoGetRandom.ps1 from Microsoft's "Script Center". The original script uses the RNGCryptoServiceProvider class, which is nearly the same thing but unavailable on ancient .NET 1.x runtime versions.)


text:
Q: Cross plot markers in a ListPlot? How can I obtain crosses as plot markers in a ListPlot?
I know how to obtain circles, disks, squares, using Graphics, like PlotMarkers -> {Graphics[{Red, Thick, Disk[]}, ImageSize -> 10]}. But I can't think of any way to obtain a cross this way, other than actually drawing the cross, which seems overkill. Is there a simpler way? I just need some advice on the best way to do this without too much work.

A: Using PlotMarkers -> "+" is not a good solution, because the text is aligned with its foot at the point, not the centre of the cross.
If you want the centre of the cross to have a precise position in the plot, you can use:
cross = Graphics[{Line[{{-1,0},{1,0}}], Line[{{0,-1},{0,1}}]}]
ListPlot[data, PlotMarkers -> {cross,0.05}]

A: This would be a simple solution:
ListPlot[{1, 2, 3, 4}, PlotMarkers -> Style["+", {Black, FontSize -> 20}]]


text:
Q: NSURLSessionDataTask and handler block I'm developing a library that gets json data from a server, and I'm using NSURLSessionDataTask. In order to test my library I created a new project that calls this library method.
typedef void (^CompletionBlock)();
// More stuff...
- (void)downloadAllPodcastsMetadataWithCompletionHandler:(CompletionBlock)block{

   NSURL *url = [NSURL URLWithString:@"MyServerURL"];

   NSURLSessionDataTask *dataTask = [self.session dataTaskWithURL:url completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
     // Connection and response handling stuff...
     // When my data is saved, executes the block parameter

     dispatch_async(dispatch_get_main_queue(), ^{
        block();
     });
   }
   [dataTask resume];
}

EDIT: I forgot to put [dataTask resume] here, but it's in my code. Sorry.
EDIT 2: So, as some of you have said, i changed dispatch_sync with dispatch_async. But the result is the same :(
In my test project i call this method like this.
[UIApplication sharedApplication].networkActivityIndicatorVisible = YES;

[manager downloadAllPodcastsMetadataWithCompletionHandler:^{
    [UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
}];

But the network activity Indicator never shows off. It's like the block parameter never executes.
It's because it executes the NSURLSessionDataTask logic inside a library and then I should use something else instead dispatch_sync?
I already checked NSURLSessionDataTask not executing the completion handler block and I think I do the same. If it helps, manager is a Singleton.  Any thoughts?
Thank you.

A: You need to start the download with [dataTask resume];.

A: You need to add [dataTask resume]; and also  add this in completion handler
       dispatch_async(dispatch_get_main_queue(), ^{
               [UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
              });

A: I tested some code.
Dispatch_sync won't work.
dispatch_sync(dispatch_get_main_queue(), ^{
    [UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
});

Dispatch_async worked for me. But I had to put the code on veiwWillAppear.
Not sure what's going to happen using it inside a block...
dispatch_async(dispatch_get_main_queue(), ^{
    [UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
});

A: Well, i'm dumb.
There was an error in my previous code i didn't notice, so the completion block war never executing. That is what happens when someone has too much confidence in his code.
Sorry for bothering you.