text:
Q: Highlighting columns on a WPF DataGrid as mouse moves I wish to highlight the columns on a WPF datagrid as the mouse moves. Some of the problems I face are:

*

*Getting the coordinates of columns to test for when the mouse is over them

*Changing the background color of a column

Any help will be much appreciated.

A: How about updating the style for the DataGridCell and defining an "IsMouseOver" trigger in it?  Something like this:
<DataGrid x:Name="dg">
    <DataGrid.Resources>
        <Style x:Key="{x:Type DataGridCell}" TargetType="{x:Type DataGridCell}">
            <Style.Triggers>
                <Trigger Property="IsMouseOver" Value="true">
                    <Setter Property="Background" Value="LightGray"/>
                </Trigger>
                <Trigger Property="IsSelected" Value="true">
                    <Setter Property="Background" Value="Blue" />
                    <Setter Property="Foreground" Value="White" />
                    <Setter Property="BorderBrush" Value="Black" />
                </Trigger>
                <Trigger Property="IsKeyboardFocusWithin" Value="true">
                    <Setter Property="BorderBrush" Value="Gray" />
                </Trigger>
            </Style.Triggers>
            <Setter Property="Background" Value="Transparent" />
            <Setter Property="BorderBrush" Value="Transparent" />
            <Setter Property="BorderThickness" Value="1" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type DataGridCell}">
                        <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="true">
                            <ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </DataGrid.Resources>
</DataGrid>

EDIT:
Below is a solution that:  1)  highlights the currently hovered cell, 2) highlights the entire row, and 3) highlights the entire column.  I just coded this up quickly and haven't tested it thoroughly so you might encounter some issues.  But anyway, this should give you an idea on how they can be done.
My solution for highlighting the entire column involves the use of two attached properties that were being assigned to the DataGridCell when the mouse is over it.  Just check it out and see if it works for you.
XAML:
<Window x:Class="StackOverflow.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="clr-namespace:StackOverflow"
        Title="MainWindow" Height="350" Width="525">
    <DataGrid x:Name="dg" AutoGenerateColumns="True">
        <DataGrid.Resources>
            <Style x:Key="{x:Type DataGridCell}" TargetType="{x:Type DataGridCell}">
                <Setter Property="Background" Value="Transparent" />
                <Setter Property="BorderBrush" Value="Transparent" />
                <Setter Property="BorderThickness" Value="1" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type DataGridCell}">
                            <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="true">
                                <ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                            </Border>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
                <Style.Triggers>
                    <Trigger Property="local:DataGridBehavior.IsCellHighlighted" Value="True">
                        <Setter Property="Background" Value="LightGray"/>
                    </Trigger>
                    <Trigger Property="IsMouseOver" Value="True">
                        <Setter Property="local:DataGridBehavior.HighlightColumn" Value="True"/>
                        <Setter Property="Background" Value="Green"/>
                    </Trigger>
                    <Trigger Property="IsSelected" Value="true">
                        <Setter Property="Background" Value="Blue" />
                        <Setter Property="Foreground" Value="White" />
                        <Setter Property="BorderBrush" Value="Black" />
                    </Trigger>
                    <Trigger Property="IsKeyboardFocusWithin" Value="true">
                        <Setter Property="BorderBrush" Value="Gray" />
                    </Trigger>
                </Style.Triggers>
            </Style>
            <Style TargetType="{x:Type DataGridRow}">
                <Style.Triggers>
                    <Trigger Property="IsMouseOver" Value="True">
                        <Setter Property="Background" Value="LightGray"/>
                    </Trigger>
                </Style.Triggers>
            </Style>
        </DataGrid.Resources>
    </DataGrid>
</Window>

DataGridBehavior class:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Interactivity;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Controls.Primitives;

namespace StackOverflow
{
    public class DataGridBehavior : DependencyObject
    {

        public static bool GetHighlightColumn(DependencyObject obj)
        {
            return (bool)obj.GetValue(HighlightColumnProperty);
        }

        public static void SetHighlightColumn(DependencyObject obj, bool value)
        {
            obj.SetValue(HighlightColumnProperty, value);
        }

        // Using a DependencyProperty as the backing store for HighlightColumn.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty HighlightColumnProperty =
            DependencyProperty.RegisterAttached("HighlightColumn", typeof(bool),
            typeof(DataGridBehavior), new FrameworkPropertyMetadata(false, OnHighlightColumnPropertyChanged));

        public static bool GetIsCellHighlighted(DependencyObject obj)
        {
            return (bool)obj.GetValue(IsCellHighlightedProperty);
        }

        public static void SetIsCellHighlighted(DependencyObject obj, bool value)
        {
            obj.SetValue(IsCellHighlightedProperty, value);
        }

        // Using a DependencyProperty as the backing store for IsCellHighlighted.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty IsCellHighlightedProperty =
            DependencyProperty.RegisterAttached("IsCellHighlighted", typeof(bool), typeof(DataGridBehavior),
            new UIPropertyMetadata(false));

        private static void OnHighlightColumnPropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            Console.WriteLine(e.NewValue);
            DataGridCell cell = sender as DataGridCell;

            if (cell != null)
            {
                DataGrid dg = GetDataGridFromCell(cell);
                DataGridColumn column = cell.Column;

                for (int i = 0; i < dg.Items.Count; i++)
                {
                    DataGridRow row = dg.ItemContainerGenerator.ContainerFromIndex(i) as DataGridRow;
                    DataGridCell currentCell = GetCell(row, column);
                    if (currentCell != null)
                    {
                        currentCell.SetValue(DataGridBehavior.IsCellHighlightedProperty, e.NewValue);
                    }
                }

            }
        }

        private static DataGrid GetDataGridFromCell(DataGridCell cell)
        {
            DataGrid retVal = null;
            FrameworkElement fe = cell;
            while ((retVal == null) && (fe != null))
            {
                if (fe is DataGrid)
                    retVal = fe as DataGrid;
                else
                    fe = VisualTreeHelper.GetParent(fe) as FrameworkElement;
            }
            return retVal;
        }

        private static DataGridCell GetCell(DataGridRow row, DataGridColumn column)
        {
            DataGridCell retVal = null;
            DataGridCellsPresenter presenter = GetVisualChild<DataGridCellsPresenter>(row);
            if (presenter != null)
            {
                for (int i = 0; i < presenter.Items.Count; i++)
                {
                    DataGridCell cell = presenter.ItemContainerGenerator.ContainerFromIndex(i) as DataGridCell;
                    if ((cell != null) && (cell.Column == column))
                    {
                        retVal = cell;
                        break;
                    }
                }
            }

            return retVal;
        }

        private static T GetVisualChild<T>(Visual parent) where T : Visual
        {
            T child = default(T);
            int numVisuals = VisualTreeHelper.GetChildrenCount(parent);
            for (int i = 0; i < numVisuals; i++)
            {
                Visual v = (Visual)VisualTreeHelper.GetChild(parent, i);
                child = v as T;
                if (child == null)
                {
                    child = GetVisualChild<T>(v);
                }
                if (child != null)
                {
                    break;
                }
            }
            return child;
        }
    }
}


text:
Q: Using Glide with RecyclerView and multi-part HTTP requests I'm trying to use Glide to display thumbnails from the Google Photos library in a RecyclerView. In order to fetch images from this library, I must make two HTTP requests: first I must get the MediaItem from the id (I've already obtained a list of ids in a previous step), and second I must request the actual image from thumbnailUrl. This is the recommended process, as baseUrls expire after one hour so you aren't supposed to store them:
val googlePhotosThumbnailUrl =
    App.googlePhotosService.getMediaItem(asset.googlePhotosId) // First HTTP request fetches MediaItem
        .run {
            val baseUrl = this.baseUrl
            val thumbnailUrl = "$baseUrl=w400-h400" // Appends the requested dimensions to the Url.
            thumbnailUrl // Second HTTP request fetches this URL
        }

The problem is that Glide's load() method doesn't appear to support chaining HTTP requests like what's shown above:
GlideApp.with(itemView.context)
    .asBitmap()
    .load(googlePhotosThumbnailUrl)
    .diskCacheStrategy(DiskCacheStrategy.ALL)
    .into(binding.imageViewLargeThumbnail)

The above code executes synchronously, so loading is incredibly slow. I've managed to fix this by using coroutines as shown below. But the problem with this is Glide doesn't cache any of the images, so if I scroll down and back up Glide refetches every image:
override fun bindAsset(asset: GooglePhotosAsset, position: Int) {
    this.asset = asset
    this.index = position

    // We set the loading animation here for Google Photos assets, since for those we need to fetch a mediaItem and then a baseUrl.
    // This forces us to perform the process in a coroutine, and Glide can't set the loading animation until the baseUrl is fetched.
    binding.imageViewLargeThumbnail.setImageResource(R.drawable.loading_animation)

    fragment.lifecycleScope.launch(Dispatchers.Default) {
        val googlePhotosThumbnailUrl = App.googlePhotosService.getMediaItem(asset.googlePhotosId) // First HTTP request fetches MediaItem
            .run {
                val baseUrl = this.baseUrl
                val thumbnailUrl = "$baseUrl=w400-h400" // Appends the requested dimensions to the Url.
                thumbnailUrl // Second HTTP request fetches this URL
            }

        withContext(Dispatchers.Main) {
            GlideApp.with(itemView.context)
                .asBitmap()
                .load(googlePhotosThumbnailUrl)
                .diskCacheStrategy(DiskCacheStrategy.ALL)
                .fitCenter()
                .into(binding.imageViewLargeThumbnail)
        }
    }
}

The only potentially relevant answer I've found is this one, but it seems super complicated and outdated. Are there any better solutions?

redpajama_set_name: RedPajamaStackExchange


text:
Q: remove duplicates (tuple of tuples) input data:
input_tuple = (
            (1, 'name1', 'Noah'),
            (1, 'name2', 'Liam'),

            (2, 'name3', 'Mason'),

            (3, 'name4', 'Mason'),

            (4, 'name5', 'Noah'),
            (4, 'name6', 'Liam'),

            (5, 'name7', 'Elijah'),
            (5, 'name8', 'Noah'),
            (5, 'name9', 'Liam')
          )

converted into dict(key, value):
input_tuple = {
         1: [['name1', 'Noah'], ['name2', 'Liam']],
         2: [['name3', 'Mason']],
         3: [['name4', 'Mason']],
         4: [['name5', 'Noah'], ['name6', 'Liam']],
         5: [['name7', 'Elijah'], ['name8', 'Noah'],
             ['name9', 'Liam']]
         }

did some more filter just for understanding the data model:
    dict =
    {
    1: ['Noah', 'Liam'],
    2: ['Mason'],
    3: ['Mason'],
    4: ['Noah', 'Liam'],
    5: ['Elijah', 'Noah', 'Liam']
    }

Now i want to eliminate duplicate and then revert back to tuple like below:
duplicate matching conditions:
1) eliminate duplicate if len(value) > 1
2) value should exact match not partial.
Note:
key 2 and 3 value is not duplicate because len(value) is not -gt 1
key 4 value has gone because its exact duplicate
since we are doing exact matching, hence in key 5 value ['Noah', Liam] will not go.
 output_tuple =
      (
        (1, 'name1', 'Noah'),
        (1, 'name2', 'Liam'),

        (2, 'name3', 'Mason'),

        (3, 'name4', 'Mason'),

        (5, 'name7', 'Elijah'),
        (5, 'name8', 'Noah'),
        (5, 'name9', 'Liam')
      )

code which i tried:
from functools import reduce
from collections import defaultdict

input_tuple_dictionary = defaultdict(list)
for (key, *value) in input_tuple:
    input_tuple_dictionary[key].append(value[1])

input_tuple_dictionary
for index in range(len(input_tuple_dictionary)-1):
    for key, value in input_tuple_dictionary.items():
        if len(value) > 1:
            if value == value[index+1]:
                print(key)

A: # Using the dict format of yours
data = [set(dict[x]) for x in range(1, len(dict) + 1)]
input_tuple = dict
seen = []
output_tuple = []
for i in range(len(data)):
    if (data[i] not in seen) or len(data[i]) == 1:
        for j in range(len(input_data)):
            if input_data[j][0] == i + 1:
                output_tuple.append(input_data[j])
    seen.append(data[i])
output_tuple = tuple(output_tuple)

If you did not understand please ask
Good Luck

A: One common solution for skipping duplicates is to keep a set that contains all of the elements you've already seen. If the object has been seen before, you don't add it to the result.
The tricky bit is that the object you're trying to un-duplicate is the aggregation of multiple objects that reside within different tuples in your collection. Using groupby is an effective way to get those objects together in one convenient package.
from itertools import groupby

input_tuple = (
    (1, 'name1', 'Noah'),
    (1, 'name2', 'Liam'),

    (2, 'name3', 'Mason'),

    (3, 'name4', 'Mason'),

    (4, 'name5', 'Noah'),
    (4, 'name6', 'Liam'),

    (5, 'name7', 'Elijah'),
    (5, 'name8', 'Noah'),
    (5, 'name9', 'Liam')
  )

seen = set()
result = []
for _, group in groupby(input_tuple, key=lambda t: t[0]):
    #convert from iterator to list, since we want to iterate this more than once
    group = list(group)
    #extract just the names from each tuple.
    names = tuple(t[2] for t in group)
    #check for duplicates, but only for name groups with more than one element.
    if len(names) == 1 or names not in seen:
        result.extend(group)
    seen.add(names)

print(result)

Result:
[(1, 'name1', 'Noah'), (1, 'name2', 'Liam'), (2, 'name3', 'Mason'), (3, 'name4', 'Mason'), (5, 'name7', 'Elijah'), (5, 'name8', 'Noah'), (5, 'name9', 'Liam')]

A: from collections import defaultdict

dct = defaultdict(list)

for k,n_id,name in input_tuple:
    dct[k].append(name)

#print(dct)

seen = set()
ignore_id_set = set()

for _id, _namelst in dct.items():
    if len(_namelst) > 1:
        k = tuple(sorted(_namelst)) # note 1

        if k not in seen:
            seen.add(k)
        else:
            ignore_id_set.add(_id) # duplicate

#print(seen)

# del dct,seen # dct,seen are now eligible for garbage collection

output = tuple(item for item in input_tuple if item[0] not in ignore_id_set)
print(output)

'''
note 1:
    important to sort **if** situations like this can be possible
     (1, 'name1', 'Noah'),
     (1, 'name2', 'Liam'),

     (4, 'name6', 'Liam'),
     (4, 'name5', 'Noah'),

     because when we will create dct it will result in

     1 : [Noah,Liam]
     4 : [Liam,Noah]

     since we want to treat them as duplicates we need to sort before creating their hash( via tuple)

**else** no need to do sort

'''

A: Here is one solution using a defaultdict of set objects and toolz.unique. toolz.unique is equivalent to the itertools unique_everseen recipe available in the docs.
The idea is to find keys with lone values and also keys which do not have duplicate values. The union of these two categories make up your result.
from collections import defaultdict
from toolz import unique

dd = defaultdict(set)

for k, _, v in input_tuple:
    dd[k].add(v)

lones = {k for k, v in dd.items() if len(v) == 1}
uniques = set(unique(dd, key=lambda x: frozenset(dd[x])))

res = tuple(i for i in input_tuple if i[0] in lones | uniques)

Result:
print(res)

((1, 'name1', 'Noah'),
 (1, 'name2', 'Liam'),
 (2, 'name3', 'Mason'),
 (3, 'name4', 'Mason'),
 (5, 'name7', 'Elijah'),
 (5, 'name8', 'Noah'),
 (5, 'name9', 'Liam'))


text:
Q: How to simulate random effects models? It is quite simple to simulate linear models:
set.seed(42)
years <- rnorm(100, 12, 8)
work_hours <- rnorm(100, 8, 2)
income <- 2*years + 0.5*work_hours + 2000 + rnorm(100, 0, 10)
plot(work_hours, income2)
lmmodel <- lm(income ~ years + work_hours)
summary(lmmodel)

Or logistic models:
set.seed(42)
x1 <-  rnorm(100)
x2 <-  rnorm(100)
z <- 1 + 2*x1 + 3*x2
pr <- 1/(1+exp(-z))

y = rbinom(100,1,pr)

df <- data.frame(y=y,x1=x1,x2=x2)
logitmodel <- glm( y~x1+x2,data=df,family="binomial")
summary(logitmodel)

So, how does one simulate random effects models?
I mean, there are lots of "flavors" with this class of models. Looking at Faraway's [book][1] there are:

*

*Blocks as Random Effects

*Split Plots

*Nested Effects

*Crossed Effects

*Multilevel Models

*Repeated Measures

*Longitudinal/Panel Data

*Mixed effect models for nonnormal Responses

How would I simulate them so I can toy with them?
[1]: Extending the Linear Model with R - John Faraway

A: Just write down an (algebraic) formula for the model, and simulate from that description. I will give a very simple example, a model with multiple observations of the same subjects, with an exchangeable covariance structure. Such a structure can be represented with a random intercept for each subject. Also an subject-level covariate:
$$ y_{ij}=\mu + \alpha x_i + \epsilon_i + \epsilon_{ij} $$ for $i=1,2,\dotsc,n$ and $j=1,\dotsc,k$ within each subject. So this is a balanced model. The same principle is used for unbalanced situations, but that gives more programming. Then we must specify values for fixed parameters  and distributions for random effects $\epsilon_i, \epsilon_{ij}$.   Some simple R code is:
N <- 20 # Number subjects
k <- 4  # Number obs within subject
set.seed(7*11*13) # My public seed

id <- as.factor(1:N)
x <-  runif(N, 1, 5)
idran <- rnorm(N, 0, 1)
obsran <- rnorm(N*k, 0, 2)
mu <- 10.
alpha <- 1.

X <- rep(x, each=k)
Y <- mu + alpha*X + rep(idran, each=k) + obsran

A plot of this simulated data is:

For more complex situations it would help with some preprogrammed package, there is a package simstudy on CRAN which can help. See also Model Matrices for Mixed Effects Models and https://stackoverflow.com/questions/30896540/extract-raw-model-matrix-of-random-effects-from-lmer-objects-lme4-r,   https://stackoverflow.com/questions/55199251/how-to-create-a-simulation-of-a-small-data-set-in-r.

A: Here is how I simulate random effects.  I'll demonstrate for linear regression, but extending it to a different GLM should be straight forward.
Let's start with a random intercept model.  The model is usually written as
$$ y = XB + Z\gamma $$
Where $Z$ is an indicator for the group and $\gamma_i$ is normally distributed with mean 0 and some variance.  Simulation of this model is as follows...
groups<-1:5
N <- 250
g <- factor(sample(groups, replace = T, size = N), levels = groups)
x <- rnorm(N)
X <- model.matrix(~x)
Z <- model.matrix(~g-1)

beta <- c(10, 2)
gamma <- rnorm(length(groups), 0, 0.25)

y = X %*% beta + Z%*% gamma + rnorm(N, 0, 0.3)

Let's fit a mixed model and see if we recover some of these estimates

library(lme4)

model = lmer(y~x + (1|g), data = d)

summary(model)
inear mixed model fit by REML ['lmerMod']
Formula: y ~ x + (1 | g)
   Data: d

REML criterion at convergence: 136.2

Scaled residuals:
     Min       1Q   Median       3Q      Max
-2.85114 -0.65429 -0.00888  0.65268  2.63459

Random effects:
 Groups   Name        Variance Std.Dev.
 g        (Intercept) 0.05771  0.2402
 Residual             0.09173  0.3029
Number of obs: 250, groups:  g, 5

Fixed effects:
            Estimate Std. Error t value
(Intercept)  9.95696    0.10914   91.23
x            2.00198    0.01993  100.45

Correlation of Fixed Effects:
  (Intr)
x -0.008

Fixed effects look good, and the group standard deviation (0.25) is estimated pretty accurately, and so is the residual standard deviation.
Random slope models are similar.  Under the assumption each slope comes from a normal distribution, then we can write the slope as
$$ y = Bx + \beta_i x$$
Here $B$ is the population mean and $\beta_i$ is the effect of group i.  Here is a simulation
library(tidyverse)

groups<-1:5
N <- 250
g <- sample(groups, replace = T, size = N)
x <- rnorm(N)
X <- model.matrix(~x)

B <- c(10, 2)
beta <- rnorm(length(groups), 0, 2)

y = X %*% B + x*beta[g] + rnorm(N, 0, 0.3)

and a model...

library(lme4)

d = tibble(y, x, g)

model = lmer(y ~ x + (x|g), data = d)

summary(model)

Linear mixed model fit by REML ['lmerMod']
Formula: y ~ x + (x | g)
   Data: d

REML criterion at convergence: 158.9

Scaled residuals:
     Min       1Q   Median       3Q      Max
-2.95141 -0.65904  0.02218  0.61932  2.66614

Random effects:
 Groups   Name        Variance  Std.Dev. Corr
 g        (Intercept) 2.021e-05 0.004496
          x           3.416e+00 1.848314 1.00
 Residual             9.416e-02 0.306856
Number of obs: 250, groups:  g, 5

Fixed effects:
            Estimate Std. Error t value
(Intercept) 10.00883    0.01984  504.47
x            2.05913    0.82682    2.49

Correlation of Fixed Effects:
  (Intr)
x 0.099

Here are the coefficients of the 5 groups
coef(model)
$g
  (Intercept)         x
1    10.00135 -1.015180
2    10.01335  3.919787
3    10.00934  2.270760
4    10.01081  2.873636
5    10.00928  2.246626

and compare them to the true values
B[2] + beta

-0.9406479  3.9195119  2.2976457  2.8536623  2.3539863

```


text:
Q: CSS reveal rest of element outside of mask I have a single element with a non-repeating background-image at background-position: 4px 4px. The image is an avatar and to it's right is a single paragraph with margin-left: 120px so the text doesn't flow over the background-image. I've already accomplished the effect on an image element however to solidify my comprehension of CSS masks I wanted to determine how to apply this same effect on a background-image. Here is my current code (fuchsia used only for my debugging and now here to help visualize the problem):
/***
-webkit- prefixes automatically appended by my system software.
Testing with Waterfox first, Chrome second.
***/
background-color: #f0f;
background-image: url(avatar.png);
mask-image: radial-gradient(ellipse at center, rgba(255,255,255,1) 1%,rgba(255,255,255,1) 50%,rgba(255,255,255,0) 70%,rgba(255,255,255,0) 100%);
mask-position: 4px 4px;
mask-size: 100px 100px;

Setting mask-repeat: no-repeat; hides everything else (e.g. the child paragraph element) and most other mask-repeat values simply repeat the circle effect as demonstrated in the sample image. I've been going through Mozilla Developer Network's Mask documentation though nothing seems to help. Sure, I could mess around with CSS generated content however I wouldn't learn anything and limit my own design capabilities.
How do I only mask part of an element using CSS without hiding the rest of the element or it's child elements?

.preface {
  overflow: auto;
}

.preface .synopsis {
  background-color: #f0f;
  background-image: url(https://picsum.photos/id/1074/110/110);
  background-position: 4px 4px;
  background-repeat: no-repeat;
  float: left;
  height: 108px;
  -webkit-mask-image: radial-gradient(ellipse at center, rgba(255, 255, 255, 1) 1%, rgba(255, 255, 255, 1) 50%, rgba(255, 255, 255, 0) 70%, rgba(255, 255, 255, 0) 100%);
  -webkit-mask-position: 4px 4px;
  -webkit-mask-size: 100px 100px;
  mask-image: radial-gradient(ellipse at center, rgba(255, 255, 255, 1) 1%, rgba(255, 255, 255, 1) 50%, rgba(255, 255, 255, 0) 70%, rgba(255, 255, 255, 0) 100%);
  mask-position: 4px 4px;
  mask-size: 100px 100px;
  min-height: 108px;
  overflow: auto;
  position: relative;
  width: 75%;
}

Some text.

A: Why not using multiple background to achieve the same effect without affecting the text nodes:

.box {
  background:
    radial-gradient(circle 50px,transparent 70%,#224e7c 100%) right -54px top 0/200% 100%,
    url(https://picsum.photos/id/1074/110/110) 4px 4px no-repeat;
  height:120px;
  font-size:50px;
  padding-left:120px;
}

  some text

Another syntax for the gradient. Easier but not supported on Safari like the above one.

.box {
  background:
    radial-gradient(circle 50px at 54px 50% ,transparent 70%,#224e7c 100%),
    url(https://picsum.photos/id/1074/110/110) 4px 4px no-repeat;
  height:120px;
  font-size:50px;
  padding-left:120px;
}

  some text


text:
Q: How to simplify $A^{-1}a\cdot A^Tb$? Positive real vectors $x,y,x',y'\in\mathbb R^2_+$; $f,g$ are multivariate functions: $f,g:\mathbb R^2\to\mathbb R^2$. Matrix $A\in\mathbb R^{2\times2}$.
Given that $y=Ax$, $y'=Ax'$, $A^Tg(y)=f(x)$, and $(x-x')\cdot(f(x)-f(x'))\leq0$
Prove that $(y-y')\cdot(g(y)-g(y'))\leq 0$.

The first step is obviously $(x-x')(f(x)-f(x'))\leq0$ implies $(x-x')\cdot A^T(g(y)-g(y'))\leq0.$
If we furhter assume the invertability of $A$, then$$A^{-1}(y-y')\cdot A^T(g(y)-g(y'))\leq0.$$
It seems that it cannot be further simplified.....

A: Note that
$$(A^{-1} a) \cdot (A^Tb) = (A^Tb)^T(A^{-1}a) = b^TAA^{-1}a = b^Ta = a \cdot b.$$
This completes your proof.


text:
Q: Permanently set microphone input to MacBook Pro Mic Every time I connect a Bluetooth device, headphones or speakers, the output switches to the new device.
This is fine, however, the input also switches.
I would prefer for the microphone input to never switch.
How can I permanently set a 2013 MacBook Pro Microphone to onboard hardware mic?
Also, if there is a way to switch inputs via AppleScript or Alfred workflow, I would love to try them out.

A: Introduction
Right now, to the best of my knowledge, it is not possible to prevent the input/output switching between external devices and the onboard instruments using built-in features from the Operating System. I have added a simple trick (that you may already be aware of) to switch between input devices quickly and given an explanation as to why macOS behaves this way. I may not be the answer you are looking for but I wanted to share this information with you anyway, in the hope that it shows the problem from a different perspective or somebody is able to add to my thinking.
TL;DR
Input switching occurs when the new input/output device has microphone capabilities, which (in theory) gets the mic closer to the user thus produces greater audio and reducing background noise through less distance between the source and the mic - as the majority of headphones/earphones do with a built-in mic. This is how Apple views it and most customers don't want to put up with picking the right source every time they connect a pair of headphones.
Why might it be a positive?
Unlike in the Windows world, where a Default Device can be set in the Sound Settings, Macs (unlike PC's) have a built-in speaker and microphone in pretty much every single (recent) computer ever released. Microsoft does not restrict Windows to a select group of systems (the way macOS only works on an Apple device, with the exception of unsupported Hackintosh builds). That is a major factor in the lack of flexibility when it comes to different ways of settings the input devices because if Apple knows an interface exists, it becomes the default (and fallback) interface - there would be no reason to think otherwise.
Apple, known for its user experience, has decided that for the majority of its customers, the headphone goes into the socket, it detects whether it has microphone capabilities, switches inputs accordingly and is in that way able to deliver and send clearer audio between the mac and the headset (the headset presumably being closer to the user now than the onboard microphone).
A Common Workaround
The most common (and simplest) trick is to adjust the sound I/O interfaces themselves by switching to the desired device(s) through the menu bar.

*

*Find the Speaker icon in the menu bar (if not present, go to: System Preferences > Sound > Check/Enable: Show volume in menu bar.

*Hold the Alt/Option key and click on the Speaker icon in the menu bar.

*You will now be able to switch between the devices as required. It may cost you a second or two of your time but it is by far a better alternative to messing with the system in other ways that may produce unknown side effects.

Conclusion
I hope I was able to shed some light on Apple's way of appealing to the majority and the reason why they believe auto switching is better than the manual way. I understand this is a rather long-winded explanation of a simple no but it was important to get the point across anyway.
Maybe you, like me, are able to forgive Apple for making an inflexible choice in their OS design that disregards a portion of the market's needs. I never found a reliable piece of software to prevent the switching so I learned to live with the quick menu bar trick and never let it bother me again. Maybe one day Apple adds a preference for preventing auto-switching of inputs.
Let me know if that was helpful in any way or if you have any other questions, I'd be more than happy to follow up with you on this.

Is there a way to switch inputs via AppleScript?
Absolutely, there is! Let me show you how.
AppleScript
tell application "System Preferences" to activate
tell application "System Preferences"
    reveal anchor "input" of pane id "com.apple.preference.sound"
end tell
tell application "System Events" to tell process "System Preferences"
    tell table 1 of scroll area 1 of tab group 1 of window 1
        select (row 1 where value of text field 1 is "Line In") --> Or change to "Internal Microphone"
    end tell
end tell
quit application "System Preferences"

What next?
You will need to allow the ScriptEditor to control your computer. Go to System Preferences > Security & Privacy > Privacy > Accessibility, then add the ScriptEditor/Compiled script to this list. This is an essential (security) step because your script is manipulating the GUI and in a way intercepting the window events. If you have no clue what any of that means, don't worry now, just paste the code into your ScriptEditor and run it - an error will tell you if anything was not done properly.
Potential Improvements
I'll leave you to your imagination but you could very easily make a toggle switch script (although the before mentioned menu bar trick pretty much does this already). One suggestion might be to find the Terminal equivalent and simply run a do shell script command through AppleScript. Such would involve looking for the .plist file which contains the current state (input selection) of the Sound Preferences and manipulating it to your choice. This is highly OS-specific and has a tendency to require the user to log out for the changes to take effect. With that method, I think we are simply looking for trouble where we don't need it. As the age-old KISS principle states: "Keep it simple, stupid" - sometimes it's just better to do the simplest task that anyone without the technical knowledge (AppleScript/Terminal) can achieve.

A: I found a workaround that fixed it for me. OBS (free streaming software) appears to be able to assign a default input device. It works for me system-wide and even when OBS is not running.

*

*Install OBS

*Provide OBS with the permissions it requests during setup.

*In the Audio Mixer section of the main page you should see Mic/AUX. Hit the three-dot Menu > Properties > Device.

*Select the device you want as your default.


text:
Q: Heroku bundle: command not found I'm trying to deploy a Rails/ReactJS app on Heroku, and I've committed and pushed the app onto it. However, when I try to run any rake command, or bundler --version on the Heroku CLI, I get the following error:
bash: bundler: command not found
I've tried the following to no avail.
$ heroku config:set GEM_PATH=vendor/bundle/ruby/3.1.1
$ heroku config:set PATH=bin:vendor/bundle/ruby/3.1.1/bin:/usr/local/bin:/usr/bin:/bin

I'm on Ruby 3.1.1. Any help would be appreciated, thank you!


text:
Q: Python pandas: accumulate data frame rows by condition I have a data frame with 2 columns in following format:
Anna         15
Mary         14
Elizabeth    11
Margaret     10
Alice         6
Bertha        5
Helen         5
Emily         4
Maria         4
Marie         4
Catherine     4
Marion        4
Ellen         4
Florence      4
Augusta       4
...
Juliette      1
Mara          1
Elise         1
Alfrida       1
Nourelain     1
Margaretta    1
Manca         1
Aloisia       1
Hulda         1
Clear         1
Wendla        1
Ellis         1
Lulu          1
Juliet        1
Gertrude      1

How can I accumulate rows with value < 5 to get something like
Anna         15
Mary         14
Elizabeth    11
Margaret     10
Alice         6
Bertha        5
Helen         5
Other        50

A: here is a way:
# create some random data
df =pd.DataFrame({'letter': list('qwertyuiopasdfghjklzxcvbnm'),'value': np.random.randint(1,15,26)})

define a function to replace letters where value < 5 with other:
def f(x):
    if x.value <5:
        l= 'other'
    else:
        l =x.letter
    return l

apply the function to the dataframe:
df['letter'] =df.apply(f,axis=1)

group by the new letter column and sum:
df.groupby('letter').sum()


text:
Q: onLoad happening multiple times with Iframe Having some issues with Angular 2, im making a component that has a iframe and sets the source from the input. However when it loads, it hits onLoad twice, one with src='' and another with the actual input url.
I cant seem to figure out how to hook the url up for the iframe when it gets put into the view.
export class ExternalComponent implements OnInit {
    @Input()
    url: string;

    private src: any;

    constructor(private sanitizer: DomSanitizer) {

    }

    ngOnInit()
    {
        this.src = this.sanitizer.bypassSecurityTrustResourceUrl(this.url)
    }

    onLoad() {

    }
}

Html:

Reproduction: http://plnkr.co/edit/Dnpmv6X2IO3WGQAg0372?p=preview
Thanks

A: Using debugger I found out that event.target.src could provide the solution. The first time it runs, it is an empty string "". The second time the value is the image url. So, in my case it works like that:
onLoad(event: any) {
  if (event.target.src) {
      //do some stuff here
  }
}

A:
You could try an attribute binding, which isn't added at all if the value is null

update
As explained in https://stackoverflow.com/a/15880489/217408
when the event handler is added to the element before the  is added to the DOM. This seems to be what Angular is doing.
Add event handler imperatively after the element was added to the DOM
Plunker example
Ignore events while url is null
Plunker example

A: ngOnInit()
    {
        this.src = this.sanitizer.bypassSecurityTrustResourceUrl(this.url)
    }
This is wrong code if use like this iframe will load more time .
ts file
ngOnInit()
    {
        this.src = this.url;
    }
make html page like this (use pipe)

pipe file

      import { DomSanitizer} from '@angular/platform-browser';
    constructor(private sanitizer:DomSanitizer){
      return   this.sanitizer.bypassSecurityTrustResourceUrl(value);

A: 'onLoad executed' runs only once in this example (http://plnkr.co/edit/wRZTH8?p=preview). Are you sure something else is not going on?
import { Component , OnInit } from '@angular/core';
import { DomSanitizer} from '@angular/platform-browser';

@Component({
  selector: 'my-app',
  template: `<iframe [attr.src]="url ? url : null" frameBorder="0" (load)="onLoad()" style="width:200px;height:200px"></iframe>`
})
export class AppComponent implements ngOnInit{
    public url: any;

    constructor(private sanitizer:DomSanitizer){

    }

    ngOnInit()
    {
        this.url =     this.sanitizer.bypassSecurityTrustResourceUrl('http://www.nekkon.com');
    }

    onLoad() {
        console.log('onLoad executed');
    }
}


text:
Q: Unable to mount CIFS share using AutoFS and Kerberos I can mount a CIFS share using mount directly from my terminal:
sudo mount -t cifs -o multiuser,cruid=1395409773,vers=3.0,sec=krb5 //fileserver2.mba.ac.uk/Z\ Drive /mnt

shows the following in /var/log/syslog:
Dec 14 10:58:36 L21SC646 cifs.upcall: key description: cifs.spnego;0;0;39010000;ver=0x2;host=fileserver2.mba.ac.uk;ip4=192.171.193.80;sec=krb5;uid=0x0;creduid=0x532c436d;user=root;pid=0x148d
Dec 14 10:58:36 L21SC646 cifs.upcall: ver=2
Dec 14 10:58:36 L21SC646 cifs.upcall: host=fileserver2.mba.ac.uk
Dec 14 10:58:36 L21SC646 cifs.upcall: ip=192.171.193.80
Dec 14 10:58:36 L21SC646 cifs.upcall: sec=1
Dec 14 10:58:36 L21SC646 cifs.upcall: uid=0
Dec 14 10:58:36 L21SC646 cifs.upcall: creduid=1395409773
Dec 14 10:58:36 L21SC646 cifs.upcall: user=root
Dec 14 10:58:36 L21SC646 cifs.upcall: pid=5261
Dec 14 10:58:36 L21SC646 cifs.upcall: get_cachename_from_process_env: pathname=/proc/5261/environ
Dec 14 10:58:36 L21SC646 cifs.upcall: get_cachename_from_process_env: cachename = FILE:/tmp/krb5cc_1395409773_yINoep
Dec 14 10:58:36 L21SC646 cifs.upcall: get_existing_cc: default ccache is FILE:/tmp/krb5cc_1395409773_yINoep
Dec 14 10:58:36 L21SC646 cifs.upcall: handle_krb5_mech: getting service ticket for fileserver2.mba.ac.uk
Dec 14 10:58:36 L21SC646 cifs.upcall: handle_krb5_mech: obtained service ticket
Dec 14 10:58:36 L21SC646 cifs.upcall: Exit status 0

But ls /cifs/Z which should automount the same share:
Dec 14 10:58:53 L21SC646 automount[4910]: attempting to mount entry /cifs/Z
Dec 14 10:58:53 L21SC646 cifs.upcall: key description: cifs.spnego;0;0;39010000;ver=0x2;host=fileserver2.mba.ac.uk;ip4=192.171.193.80;sec=krb5;uid=0x0;creduid=0x532c436d;user=root;pid=0x149f
Dec 14 10:58:53 L21SC646 cifs.upcall: ver=2
Dec 14 10:58:53 L21SC646 cifs.upcall: host=fileserver2.mba.ac.uk
Dec 14 10:58:53 L21SC646 cifs.upcall: ip=192.171.193.80
Dec 14 10:58:53 L21SC646 cifs.upcall: sec=1
Dec 14 10:58:53 L21SC646 cifs.upcall: uid=0
Dec 14 10:58:53 L21SC646 cifs.upcall: creduid=1395409773
Dec 14 10:58:53 L21SC646 cifs.upcall: user=root
Dec 14 10:58:53 L21SC646 cifs.upcall: pid=5279
Dec 14 10:58:53 L21SC646 cifs.upcall: get_cachename_from_process_env: pathname=/proc/5279/environ
Dec 14 10:58:53 L21SC646 cifs.upcall: get_existing_cc: default ccache is FILE:/tmp/krb5cc_1395409773
Dec 14 10:58:53 L21SC646 cifs.upcall: get_tgt_time: unable to get principal
Dec 14 10:58:53 L21SC646 cifs.upcall: krb5_get_init_creds_keytab: -1765328378
Dec 14 10:58:53 L21SC646 cifs.upcall: Exit status 1
Dec 14 10:58:53 L21SC646 automount[4910]: >> mount error(126): Required key not available
Dec 14 10:58:53 L21SC646 automount[4910]: >> Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
Dec 14 10:58:53 L21SC646 automount[4910]: mount(generic): failed to mount //fileserver2.mba.ac.uk/Z Drive (type cifs) on /cifs/Z
Dec 14 10:58:53 L21SC646 automount[4910]: failed to mount /cifs/Z
Dec 14 10:58:53 L21SC646 automount[4910]: re-reading map for /cifs
Dec 14 10:58:53 L21SC646 kernel: [ 4190.521151] CIFS VFS: Send error in SessSetup = -126
Dec 14 10:58:53 L21SC646 kernel: [ 4190.521164] CIFS VFS: cifs_mount failed w/return code = -126

It is quite obvious what's happening. The working mount reports:
get_cachename_from_process_env: cachename = FILE:/tmp/krb5cc_1395409773_yINoep
get_existing_cc: default ccache is FILE:/tmp/krb5cc_1395409773_yINoep

while the failing mount reports:
get_existing_cc: default ccache is FILE:/tmp/krb5cc_1395409773

Implying that it didn't find that environment variable. I'm at a loss, though, to figure what needs to be modified to make the AutoFS mount add that little bit of sugar after the UID in the temp file name. After all, the correct filename is in the environment of the bash process that issued both the working mount, and the ls command that failed to mount.

A: I get same problem on my ubuntu 18.04,
For some unknown reason when systemd mount/automount try to mount the cifs destination, form:
get_cachename_from_process_env: pathname =
get_cachename_from_process_env: cachename =

get krb file with format

FILE:/tmp/krb5cc_%U

while system is using

FILE:/tmp/krb5cc_%U_XXXX (secure format)

If the template ends with 'XXXXXX' mkstemp(3) is used to create a unique filename in a safe way.
Default: FILE:%d/krb5cc_%U_XXXXXX

SSSD Manual pages
As workaround on my system i using sssd as security Orchestrator and i for the system tu use FILE:%d/krb5cc_%U format, Modding sssd.config adding krb5_ccname_template=FILE:%d/krb5cc_%U inside [domain/DOMAIN.EXT] section.


text:
Q: Laravel 4.2: After checking "remember me" checkbox user's login doesn't get remembered in database, only in cookie, thus remember me not working I am using laravel 4.2
I have a login form where I am trying to implement the remember me functionality. I have used Auth::attempt() to implement the above. Here's my code.
        public function logintest()
        {

            // set the remember me cookie if the user check the box
            $remember = (Input::has('remember')) ? true : false;

            // attempt to do the login
            $auth=Auth::attempt(
            [
                'username'  => Input::get('username'),
                'password'  => put::get('password')
            ], $remember);

          if ($auth)
            {
                // The user is active, not suspended, and exists.
                $id = Auth::user()->id;
                return Redirect::to("example/$id");
            }
            else
            {
                return Redirect::to('example')
                ->with('flash_error', 'Incorrect Username or Password!');
            }
         }

I have also created a column "remember_token"(a nullable string with 255 chars) in registration table. And also added below 3 methods in the model MyModel.php
   public function getRememberToken()
   {
            return $this->remember_token;
   }

   public function setRememberToken($value)
   {
           $this->remember_token = $value;
   }

   public function getRememberTokenName()
   {
           return 'remember_token';
   }

Yes it does sets the cookie named remember_xxxxxx, but it doesn't add anything to the remember_token column. It's not working. Is there something i missed ?

A: Please notice that remember_token only makes sure that the user won't be logged out after 2 hours (or any other amount of time that has been given in the config file).
You need to have a user model before it will work.
The fillable variable tells the model which fields may be mass assigned (changed).
class Users extends Eloquent {

    protected $fillable = array('username', 'password', 'remember_token');

    public function getRememberToken()
    {
        return $this->remember_token;
    }

    public function setRememberToken($value)
    {
        $this->remember_token = $value;
    }

    public function getRememberTokenName()
    {
        return 'remember_token';
    }
}

This name of the model needs to have the exact same name as the table in the database or you can specify the table name in a variable called table. I think you want to store the remember_token in the same table as where the users are.
In the controller you should add
use Location\To\Model;

So assuming you created a Model directory inside the app directory
use App\Model\Users;

To authenticate users by their remember token you should use
if (Auth::viaRemember())
{
    //
}


text:
Q: Is it possible to write package documentation using non-ASCII characters with roxygen2? Is it possible to write documentation in R using non-ASCII characters (such as å, ä, ö) using roxygen2? I'm asking because I am writing an package with internal functions in Swedish.
I have use the following code using roxygen to write documentation:
#' @param data data frame där variablen finns
#' @param x variabeln, måste vara en av typen character

This results in the non-ASCII characters being distorted. I can change the .Rd files manually but I'd rather not.

A: On Windows, encoding sucks in R, and is very complicated - and those developing packages don't always consider it as a real issue (see roxygen or devtools).  What worked for me:

*

*if you have data in your package with non-ASCII labels, e.g. a colorvector c(rød = "#C30000", blå = "#00A9E0"), you have to escape the names/values in code:
c(r\u00f8d = "#C30000", bl\u00e5 = "#00A9E0")

*in the documentation (if you use roxygenize or devtools::document()) you have to place @encoding UTF-8 before EVERY function description but then use regular keyboard.
If you have two functions in the same file (e.g. "palette" and "saturation" in a design package for your organisation), you have to place the tag in every description block, not just once.
Example:
    #' @encoding UTF-8
    #' datastruktur for å definere firmapalett med æøå
    dummypalett <- structure(.Data = c("#c30000", "#00A9E0"),
                   names = c("r\u00f8d", "bl\u00e5"))

    #' @encoding UTF-8
    #' neste funksjon som er beskrevet med æøåäö

For good measure, I placed Language: nob in the DESCRIPTION file and changed the encoding tag in Rprofile to "UTF-8".

A: Non-ASCII characters are tricky to use with R (https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Package-subdirectories).

Only ASCII characters (and the control characters tab, formfeed, LF and CR) should be used in code files. Other characters are accepted in comments13, but then the comments may not be readable in e.g. a UTF-8 locale. Non-ASCII characters in object names will normally14 fail when the package is installed. Any byte will be allowed in a quoted character string but \uxxxx escapes should be used for non-ASCII characters. However, non-ASCII character strings may not be usable in some locales and may display incorrectly in others.

For documentation you have to add the tag @encoding UTF-8 to your roxygen2 code.
You can check whether \uxxxx escapes have been successfully employed by the tag using the following.
path <- "path to Rd file"
tools::checkRd(path)

A: I solved this problem by putting
##' @encoding UTF-8

in the roxygen2 documentation comment and then typing
options(encoding = "UTF-8")

in the R console before roxygenizing.  For future sessions, it is helpful to add the line
options(encoding = "UTF-8")

in the R/etc/Rprofile.site file.


text:
Q: Can someone give me the name for this "area" of math? I'm a math major and have come upon an section in Calculus II that has grabbed me by the horns. I'm currently working on sequences, infinite series, geometric series and touching on a bit of fractals. I can't get enough of this stuff.
I'm really interested in doing additional self study in this "area," but I'm unsure if this is classified as a specific branch of mathematics - maybe even a subcategory within calculus.
I'm keen to learn the name of this area of mathematics, presuming it has one. If anyone could provide it for me I'll happily use it as a starting point in my subsequent search. Additionally, any recommendations for a book (given my level in math) would be very appreciated.

A: The real analysis books mentioned in the comments are excellent but are not directly accessible from Calculus II. I recommend "Calculus" by Michael Spivak. It is used for an advanced introductory course at some universities and is full of "real" math (namely, proofs) but has essentially no prerequisites.


text:
Q: Finding generators for products of ideals If you want to find the generators for the product of ideals, do you simply take all possible products of the generators in the ideals. For example, let $R$ be a ring and let $I = (a,b)$ and $J = (c,d)$. Then we have
\begin{equation*}
\begin{aligned}
IJ &= \{(ax + by)(cw + dz) : w,x,y,z \in R\} \\
&= \{ac(xw) + ad(xz) + bc(yw) + bd(yz) : w,x,y,z \in R\}.
\end{aligned}
\end{equation*}
We see that $IJ$ contains all multiples of $ac,ad,bc,bd$ and their sums. So then $IJ = (ac,ad,bc,bd)$. Is this true in general?
Thanks!

A:
Does this method work regardless of the number of ideals and
  generators is what I mean.

Yes, it does. Let $I = (a_1, \ldots, a_m)$ and $J = (b_1, \ldots, b_n)$ be left ideals in a ring commutative ring $R$. Then
$$IJ = \{(x_1a_1 + x_1a_2 + \ldots + x_ma_m)(y_1b_1 + y_2b_2 + \ldots + y_nb_n) \}$$
and clearly $a_ib_j \in IJ$ for all $1 \le i \le m$ and $1 \le j \le n$. Conversely, every element in $IJ \setminus \{0\}$ is of the form $\sum_{i,j} z_{i,j}a_i b_j$.
An easy induction on the number of factors yields the result for $I_1I_2 \ldots I_n$ as well.
However, in a non-commutative ring we only get $(a_1, \ldots, a_m)(b_1, \ldots, b_n) \supseteq (a_ib_j)_{i,j}$.
As an example consider the ring of $2 \times 2$ matrices with integer coefficients. Then
$$
\left( \begin{matrix} 1 & 0 \\ 0 & 0 \end{matrix} \right) \left( \begin{matrix} 0 & 0 \\ 1 & 1 \end{matrix} \right) = \left( \begin{matrix} 0 & 0 \\ 0 & 0 \end{matrix} \right)
$$
and thus $ \left( \left( \begin{matrix} 1 & 0 \\ 0 & 0 \end{matrix} \right)  \left( \begin{matrix} 0 & 0 \\ 1 & 1 \end{matrix} \right) \right) = (0) $, but
$$
\left( \begin{matrix} 1 & 0 \\ 0 & 0 \end{matrix} \right)\left( \begin{matrix} 1 & 1 \\ 1 & 1 \end{matrix} \right) \left( \begin{matrix} 0 & 0 \\ 1 & 1 \end{matrix} \right) =  \left( \begin{matrix} 1 & 1 \\ 0 & 0 \end{matrix} \right)
$$
demonstrates $ \left( \left( \begin{matrix} 1 & 0 \\ 0 & 0 \end{matrix} \right),  \left( \begin{matrix} 0 & 0 \\ 1 & 1 \end{matrix} \right) \right) \neq (0)$.


text:
Q: Is row based or column based raw input better? I have a vendor that is starting to give me some rather large reports on course completions and usage.
They have two formats for the reports:

*

*If a student is enrolled in a course, they will have an row entry with basic student and course information for each course.  Fields would be student name, student id, student email, course name, course status, course completion date.

*Each student would have one row.  Each course would be represented by a different column.  So we would have student name, student id, student email, course name A, course status A, course completion date A, course name B, course status B, course completion date B, course name C, course status C, course completion date C, course name D, course status D, course completion date D...
The good point of report #2 is that it is much smaller than the report #1.  However I am having a hard time getting a handle on executing views and jobs based on a variable column table (as courses get added I don't really know).
I need to make some advanced usage reports and wrap up student info with certain courses and completions.  Is there a reason why one of the raw formats will either make my job easier or make the database perform queries easier?

A: From a database design point of view, #1 is better.  But...  In either case (#1 or #2) you should not populate your database with only one table.
You should have these tables (at least):

*

*Students - one row per student: Student id, name, email

*Courses - one row per course: Course id (created by you), course name

*StudentCourses - one row per student-course pair that exists: student id (but no other student info), course id, status, completion date.


text:
Q: Multi-sample structural equation modeling: good practices for invariance tests I have a question concerning good practices when testing invariance in multi-sample structural equation models.
I am currently working with a questionnaire which has been administered to three different groups (three countries, in fact). This study includes some single-item measures and some latent variables with 3 or 6 items each. I have tested for invariance using confirmatory factor analyses for the latent variables (each construct separately), obtaining partial scalar invariance in all cases. Ok, good.
Now I am proceeding to test the structural equation models to examine my hypotheses pertaining relationships among variables. Do I keep the loadings and intercepts constrained across groups in this last model? (except for those couple of items that are non-invariant, naturally). Or do I start fresh so to say and keep everything free to vary?
Thank you


text:
Q: CentOS - updating PHP via yum doesn't change the version apache uses The server was running PHP 5.1.6, so we have updated it through running yum update. This updated PHP to 5.3.3 and running php -v shows this version. However, after restarting the apache, phpinfo() reports that the PHP version is still 5.1.6.
Are there somehow two versions of PHP on the server? What is going on?

A: You also need to upgrade the Apache httpd module for PHP. Usually there are three packages for PHP: one for CLI, one for FastCGI and CGI, and one for mod_php.

A: did you restart apache?
service httpd restart

A: Check which libphp5.so is loaded into your Apache through the LoadModule directive.
Then see if this file is part of your php5-package (not sure what's it's name for centos): rpm -qf <path/to/libphp5.so>. If the file does not belong to any package then you should point you Apache configuration to the libphp5.so shipped through the rpm package.

A: I personally use the IUS project for my CentOS packages. PHP and MySQL is kept bang up to date.
http://iuscommunity.org/


text:
Q: Tomcat 7 manager-text with curl and self-signed certificate not working So, I have an interesting dilemma here.  I have a Tomcat 7 server setup with the manager application.
The exact command [within reason] I am running is as follows:

curl -k --upload-file ~/[build.directory]/ROOT.war
  https://[ManagerLoginName]:[ManagerLoginPwd]@[fqdn-serverName]:8443/manager/text/deploy?war=ROOT.war&path=/&update=true

I am getting FAIL - Invalid context path  null was specified
If I run the /manager/text/reload?path=/ it reloads the context, the same as if I run the undeploy command, it undeploy's correctly.  It just seems that I cannot deploy using:
deploy?war=ROOT.war&path=/&update=true
The syntax is correct, I'm kind of stumped as why this would not deploy.  Any ideas?

A: It was a permissions based issue at the firewall.


text:
Q: What data type do you use for storing IDs? Why is there a minimum character count for posting questions? o.O
Do you use int, bigint, tinyint, whatever?
It seems like a small thing I guess, I was just wondering what the usual practice is

A: It all depends ... my favorite answer to a question! =)
Most of the time we use Guids.  While they are larger, size-wise, than int, tinyint and so on, I like the fact that my business objects can know what the value is before inserting records into the database.
At other times I may use strings, for things like customer id, where it might need to be easily recognized when working with the database.

A: I've found int to be plenty large.
Going smaller is pointless . . .

A: We use GUIDs as well.
It works better to synchronize multiple foreign database into one data warehouse. The drawback is it isn't as easy to figure out which items were created first, but you can still store the creation date or an autonomber if that is truly a problem.

A: I like Guid's very much. The best thing is they can easily be generated on client or server without making any trips to the database. Also if you have to synchronise databases ever they will be a god send. The only disadvantage I find is with web apps if you pass the key on the url then you can easily get messy query strings.

A: Wouldn't it depend on how many ids you're likely to need to store over the lifetime of the app?

A: Need more information.  What kind of IDs are you storing?  Anything smaller than int is probably a bad idea, a string might make sense given that it doesn't have the tiny issue of running out of digits, and isn't constrained constrained by numbers, so you could use a username as an id, for example.

A: I'll echo Jason with regards to always having a comparative column when using guids. I prefer sequences over guids though as you'll want a sequence either way.
Datatype-wise, it depends on how many records you need to store, but int usually suffices.


text:
Q: Cygwin Could not find or load main class edu.stanford.nlp.patterns.surface.GetPatternsFromDataMultiClass
Hi,
I am trying to run the SPIED viz master demo of the Stanford Library that helps train the model on our own language tags. I am running this on Windows 7 with Cygwin. According to the documentation I got the setupWithCoreNLP.sh to work which put all the required jar files and other dependencies in the right folds and path. Now when I run demo.sh I get the main class not found error. I corrected the home path in the demo.sh file but I am not sure what else to fix to make this demo work.
Any help would be greatly appreciated.

A: There are two problems using java for windows under cygwin:

*

*java for windows use ; as jar separator (: is used for drives), while java for POSIX systems use :

*java for windows does not understand cygwin pathnames, like /cygwin/c/Users/....   Please, take a look at this article, which explains how to handle cygwin POSIX pathnames while using windows programs, like java. This one can also be useful, although is more general.

In your case, I'd do something like:
java -cp $(cygpath -wp ./stanford-corenlp-3.5.1.jar:./stanford-corenlp-3.5.1-models.jar:./javax.json.jar:./joda-time.jar:./jollyday.jar) edu.stanford.nlp.patterns.GetPatternsFromDataMultiClass -props patterns/example.properties

You'll have to change jars paths according to the appropiate directory.
I mean, if stanford-corenlp-3.5.1.jar is located in C:\Users\k.shwetika\Desktop\NLP\SPIED-viz-master\SPIED-viz-master, then change ./stanford-corenlp-3.5.1.jar to
/cygdrive/c/Users/k.shwetika/Desktop/NLP/SPIED-viz-master/SPIED-viz-master/stanford-corenlp-3.5.1.jar.
The same for the other jars.
Lastly, I assume edu.stanford.nlp.patterns.GetPatternsFromDataMultiClass is within any of these jars.
UPDATE
I think, instead of using cygpath command to convert POSIX pathnames to windows pathnames, you can also use windows pathnames escaping jar separator ; (ie: \;), but I not completely sure.
For example
java -cp win_path\jar1.jar\;...\;win_path\jarN.jar MainClass

Hope this helps!


text:
Q: Whitespace around linebreaked text Here is the fiddle of my problem: http://jsfiddle.net/hp61pthk/3/
The code is:

    h2.nadpis {
      text-transform: uppercase;
      text-align: center;
      position: relative;
      font-size: 2.5em;
    }
    h2.nadpis:after {
      display: block;
      content: '';
      height: 0;
      border-top: 1px solid #2C3E50;
      top: 50%;
      width: 100%;
      position: absolute;
      z-index: 1;
    }
    h2.nadpis span {
      background: #fff;
      z-index: 2;
      position: relative;
      padding: 0 15px;
      display: inline-block;
    }

Long heading long heading

Short heading

what i want to achieve is to have a heading with lines on both sides in the middle of text.
If you enter short text it works, but when i enter longer text in span breaks the line correctly but its width remains as it was full-length. Is this a normal behaviour? How can i say to span to have the width exactly

A: My contribution:

http://jsfiddle.net/hp61pthk/13/

h2.nadpis {
    text-transform: uppercase;
    text-align: center;
    border-bottom: 1px solid #2C3E50;
}

h2.nadpis span {
    background: #fff;
    position: relative;
    top: 0.5em;
    padding-left: 15px;
    padding-right: 15px;
}


text:
Q: JS, появление и исчезание блоков, delay Мне нужно реализовать появление блоков через определенный промежуток (не одинаковый), при этом чтобы одновременно с появлением третьего блока пропадал первый, с появлением четвертого блока пропадал второй и т.д. Таким образом на экране одновременно должно быть только два блока. Я написал такой скрипт:
$(function(){
  $('#1').delay(1000).show(400);
  $('#2').delay(2000).show(400);
  $('#1').delay(3000).hide(400);
  $('#3').delay(3000).show(400);
  $('#2').delay(4000).hide(400);
  $('#4').delay(4000).show(400);
  $('#3').delay(5000).hide(400);
  $('#5').delay(5000).show(400);
});

Но почему-то таймер срабатывает неправильно. По логике первый блок должен скрыться перед показом третьего, но он скрывается только после показа четвертого. В общем тут лучше один раз увидеть - пример на JSFiddle
Подскажите, в чём может быть проблема?

A: Кажется, вот такой код работает как нужно:

$(function() {
  setTimeout(function() {
    $('#1').show(400);
  }, 1000);
  setTimeout(function() {
    $('#2').show(400);
  }, 2000);
  setTimeout(function() {
    $('#3').show(400);
  }, 3000);
  setTimeout(function() {
    $('#1').hide(400);
    $('#4').show(400);
  }, 4000);
  setTimeout(function() {
    $('#2').hide(400);
    $('#5').show(400);
  }, 5000);
});
div {
  display: none;
  width: 100px;
  padding: 10px;
  margin: 10px;
  border: 1px solid black;
}

Один

Два

Три

Четыре

Пять


text:
Q: Irc Server/Kiwi IRC questions I just installed IRC server & kiwi IRL on my debian server, everything was okay but now on the kiwi irc I have the message:

(Closing Link: anonymous5_6434[unknown@...] (Too many host connections (local)))

Yesterday it worked... how to fix it ? I'm really novice in the domain
Other thing, my kiwi irc client is like http://mywebsite.com:7778 - it's possible to put it like http://irc.mywebsite.com : so without the port number ?
I already have a website on my server, but there is maybe a solution ? Thank you
My config:
# This is ircd's config-file. Look at
# /usr/share/doc/ircd-irc2/ircd.conf.example.gz and
# and /usr/share/doc/ircd-irc2/INSTALL.* for more detailled information
# and instructions

# M-Line
M:irc.outline.lol::Debian ircd default configuration::000A

# A-Line
A:This is Debian's default ircd configurations:Please edit your /etc/ircd/ircd.$

# Y-Lines
Y:1:90::100:512000:5.5:100.100
Y:2:90::300:512000:5.5:250.250

# I-Line
I:*:::0:1
I:127.0.0.1/32:::0:1

A: "(Too many host connections (local))" is an error by your IRC server. It is saying there are too many connections from the same host (local) which is a setting in your irc config.
You can raise this setting in your IRC server, or the usual way is to configure WEBIRC/CGIIRC to pass your users hostnames correctly to IRC. The kiwiirc docs for this can be found here: https://kiwiirc.com/docs/installing/webirc
As for the port in the URL, you need to run kiwiirc on port 80 to not have it shown in the URL. This is the standard port for all websites. This can be set in the kiwiirc config.js file near the top.


text:
Q: Truncating columns of a double complex to get a filtration of the homology of the total complex My question refers to the document found here. Specifically page 394 of the book (page 14 of the pdf). Theorem 2.5 on that page refers to "the filtration of $H_{m}(Tot)$ obtained by truncating columns of the double complex".
I have no idea what this phrase is supposed to mean. What exactly does it mean by truncating the columns of the double complex? And how does this result in a filtration of the homology of the total complex?

A: So if $C$ is a double complex, we have by definition $Tot(C)_i = \bigoplus_{p+q = i} C_{p,q}$.
Now, we can look at the subcomplexe $Tot(C)^{p \geq r}$, verifying $Tot(C)_i = \bigoplus_{p+q = i, p \geq r} C_{p,q}$. If you draw $Tot(C)$ in the $xy$ plane, $Tot(C)^{p \geq r}$ is the subcomplex with zero at every $(p,q)$ with $p < r$, hence the name truncating the columns.
Notice that for each $r$ there are maps $Tot(C)^{p \geq r} \to Tot(C)$. This gives submodules $H_m^{p \leq r}(Tot(C)) \subset H_m(Tot(C))$ and this is how your filtration is defined.


text:
Q: ByeBug or Pry not running on one of the controllers on Rails app I have two controllers, One lets me use byebug and pry, the other just skips it, not sure why. Wondering if anyone has ran into a similar issue. I have installed pry and byebug correctly for it to work on one of the controllers, i try to import and call pry correctly.
require 'pry'

class UsersController < ApplicationController
  skip_before_action :authenticate_user!, only: [:index]

  before_action :set_current_user_for_view

  def index
    @users = User.order(created_at: :desc)
  end

  def show
    binding.pry
    @user = User.find_by!(username: params[:id])
  end
end

I know the information i'm providing is not great, i'm new to Rails so let me know if you need any further info


text:
Q: Android: How do I place a ScrollView (with text in) into Gallery? I am going to place text in gallery in android app. The text is in a scrollView. Everything works fine but on draging the text towards right or left, no next page/ element shows (The screen remains still).If i have some thing outside the scrollView, it changes to the next element on dragging.
Can anyone help?

A: You need to override onInterceptTouchEvent - you can use this to get the MotionEvents before they are delivered to the ScrollView, and then redirect them to your ViewGroup (Gallery in this case) if you wish.
The following class redirects MotionEvents to your Gallery if the user moves their finger too far left or right. Also if the user moves their finger up or down quite a bit then moving their finger left or right will have no longer have an effect, so you don't have to worry about the Gallery changing while doing a lot of scrolling.
class ScrollViewGallery extends Gallery {

    /**
     * The distance the user has to move their finger, in density independent
     * pixels, before we count the motion as A) intended for the ScrollView if
     * the motion is in the vertical direction or B) intended for ourselfs, if
     * the motion is in the horizontal direction - after the user has moved this
     * amount they are "locked" into this direction until the next ACTION_DOWN
     * event
     */
    private static final int DRAG_BOUNDS_IN_DP = 20;

    /**
     * A value representing the "unlocked" state - we test all MotionEvents
     * when in this state to see whether a lock should be make
     */
    private static final int SCROLL_LOCK_NONE = 0;

    /**
     * A value representing a lock in the vertical direction - once in this state
     * we will never redirect MotionEvents from the ScrollView to ourself
     */
    private static final int SCROLL_LOCK_VERTICAL = 1;

    /**
     * A value representing a lock in the horizontal direction - once in this
     * state we will not deliver any more MotionEvents to the ScrollView, and
     * will deliver them to ourselves instead.
     */
    private static final int SCROLL_LOCK_HORIZONTAL = 2;

    /**
     * The drag bounds in density independent pixels converted to actual pixels
     */
    private int mDragBoundsInPx = 0;

    /**
     * The coordinates of the intercepted ACTION_DOWN event
     */
    private float mTouchStartX;
    private float mTouchStartY;

    /**
     * The current scroll lock state
     */
    private int mScrollLock = SCROLL_LOCK_NONE;

    public ScrollViewGallery(Context context) {
        super(context);
        initCustomGallery(context);
    }

    public ScrollViewGallery(Context context, AttributeSet attrs) {
        super(context, attrs);
        initCustomGallery(context);
    }

    public ScrollViewGallery(Context context, AttributeSet attrs,
            int defStyle) {
        super(context, attrs, defStyle);
        initCustomGallery(context);
    }

    private void initCustomGallery(Context context) {
        final float scale = context.getResources().getDisplayMetrics().density;
        mDragBoundsInPx = (int) (scale*DRAG_BOUNDS_IN_DP + 0.5f);
    }

    /**
     * This will be called before the intercepted views onTouchEvent is called
     * Return false to keep intercepting and passing the event on to the target view
     * Return true and the target view will recieve ACTION_CANCEL, and the rest of the
     * events will be delivered to our onTouchEvent
     */
    @Override
    public boolean onInterceptTouchEvent(MotionEvent ev) {
        final int action = ev.getAction();
        switch (action) {
        case MotionEvent.ACTION_DOWN:
            mTouchStartX = ev.getX();
            mTouchStartY = ev.getY();
            mScrollLock = SCROLL_LOCK_NONE;

            /**
             * Deliver the down event to the Gallery to avoid jerky scrolling
             * if we decide to redirect the ScrollView events to ourself
             */
            super.onTouchEvent(ev);
            break;

        case MotionEvent.ACTION_MOVE:
            if (mScrollLock == SCROLL_LOCK_VERTICAL) {
                // keep returning false to pass the events
                // onto the ScrollView
                return false;
            }

            final float touchDistanceX = (ev.getX() - mTouchStartX);
            final float touchDistanceY = (ev.getY() - mTouchStartY);

            if (Math.abs(touchDistanceY) > mDragBoundsInPx) {
                mScrollLock = SCROLL_LOCK_VERTICAL;
                return false;
            }
            if (Math.abs(touchDistanceX) > mDragBoundsInPx) {
                mScrollLock = SCROLL_LOCK_HORIZONTAL; // gallery action
                return true; // redirect MotionEvents to ourself
            }
            break;

        case MotionEvent.ACTION_CANCEL:
        case MotionEvent.ACTION_UP:
            // if we're still intercepting at this stage, make sure the gallery
            // also recieves the up/cancel event as we gave it the down event earlier
            super.onTouchEvent(ev);
            break;
        }

        return false;
    }
}

A: I understand your question. This situation is already handle by me after overriding method. I am not sure this will be the best solution, may be some one have more efficient solution then this, But it works for me.
I used customised object of gallery with the over ridden method.
 public boolean isScrollingLeft(MotionEvent e1, MotionEvent e2) {
    return e2.getX() > e1.getX();
 }

 @Override
 public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,
   float velocityY) {
    return super.onFling(e1, e2, 0, velocityY);
 }

A: I found that if you place a textview in a vertical scrollbar mode it only moves up or down. If we want to swipe horizontally, you have to touch outside of the textview.


text:
Q: Limiting FOV both horizontally and vertically How can I create a perspective matrix that limits maximum FOV?
What I means is that, if I for example have a scene that looks like this:
/-------\
|#######|
|#######|
\-------/

And the screen is currently size 16:10, I can see:
/-------\
 #######
  #####
   ---

Now, if I resize the screen to 16:9, I see this (b is black):
b/-------\b
 |#######|
  #######
   -----

When I would rather it cut more of the top/bottom off.
How can I do this? I'm using OpenGL and GLM. I'm creating that current matrix with glm::perspective(yFov, width / height, zNear, zFar).
(Attempted) Clarification: The problem is that in my application, I want the required amount of "margin" for the terrain on each side to be fixed. The problem I'm trying to solve is that depending on the aspect ratio of the screen, this value currently changes. I can set a yFov, so that I'll always be able to see the same amount vertically. However, as the screen gets wider, I can see more and more horizontally. What I want instead is to be able to see less vertically. Thanks for any advice :)
Solution I went with:
projMat = glm::perspective(fov, aspect.x / aspect.y, zRange.x, zRange.y);
// ^ could be any other maths lib / code

if (aspect.x > aspect.y * 1.6f) {
    float tanFov = std::tan(0.5f * fov);
    projMat[0][0] = 1.f / tanFov / 1.6f;
    projMat[1][1] = 1.f / (aspect.y / aspect.x * tanFov) / 1.6f;
}

The 1.6 is because I'd like the the "standard" ratio to be 16:10. This works great :)

A: You could change the definition of your projection to use the field-of-view angle for the larger dimension, instead of always for the y dimension. This means that you see a given range of your object in the larger dimension, and less in the smaller dimension.
While this is doable by combining the projection matrix you get from your matrix library with an additional scaling, the cleaner method is to calculate your own projection matrix.
The calculation of a standard projection matrix looks like this:
float tanFov = tan(0.5f * fov);
float aspRat = (float)width / (float)height;

mat[0][0] = 1.0f / (aspRat * tanFov);
mat[0][1] = 0.0f;
mat[0][2] = 0.0f;
mat[0][3] = 0.0f;

mat[1][0] = 0.0f;
mat[1][1] = 1.0f / tanFov;
mat[1][2] = 0.0f;
mat[1][3] = 0.0f;

mat[2][0] = 0.0f;
mat[2][1] = 0.0f;
mat[2][2] = (zNear + zFar) / (zNear - zFar);
mat[2][3] = -1.0f;

mat[3][0] = 0.0f;
mat[3][1] = 0.0f;
mat[3][2] = 2.0f * zNear * zFar / (zNear - zFar);
mat[3][3] = 0.0f;

Most of this will stay the same if you use the proposed logic to calculate the projection matrix. Only elements [0][0] and [1][1], which determine the scaling in the x and y dimensions, are calculated differently if width is greater than height:
if (width > height) {
    float aspRat = (float)height/ (float)width;
    mat[0][0] = 1.0f / tanFov;
    mat[1][1] = 1.0f / (aspRat * tanFov);
} else {
    float aspRat = (float)width / (float)height;
    mat[0][0] = 1.0f / (aspRat * tanFov);
    mat[1][1] = 1.0f / tanFov;
}

This is the same as before if height is greater than width, and swaps the calculation logic for the two directions otherwise.


text:
Q: Configuring Maven repositories? I'm trying to configure Maven to be used inside my company. However, i reach the phase in which I must configure the repositories to be used.

*

*The common configuration for all user is set in the setting.xml file
under MAVEN_HOME

*A user's configuration  is set in the setting.xml file under
USER_HOME.

*A project's special configuration is set in the pom.xml

In my case, the second type of configuration should be used (A configuration for each user). However, a mismatch occurs while having a look at the Maven documentation. There is 2 cases either to use a <mirrors> or <repositories>  under a default profile.
What is the recommended and in case the 2 are set what's the one it will be taken by Maven engine http://repository.poo/ or http://repository.foo/ ?
  <mirrors>
    <mirror>
      <id> </id>
      <mirrorOf>* </mirrorOf>
      <name> </name>
       <url>http://repository.foo </url>
    </mirror>
  </mirrors>

or
 <profiles>
    <profile>
            <id> </id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <repositories>
                <repository>
                    <id></id>
                    <name></name>
                    <url>http://repository.poo/</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    <snapshots>
                        <enabled>false</enabled>
                    </snapshots>
                </repository>
            </repositories>

A: You will almost certainly need the <repositories> if you have your own company repository and you want something other than the maven default.
You may need a mirror if you want to override something, for instance you may want to cache maven central artifacts in a local Nexus.
Take a look at https://maven.apache.org/guides/mini/guide-mirror-settings.html
If in doubt leave the mirror.


text:
Q: Not working on azure server but works fine in local environment? I have jQuery Ajax method to call a web method in C# code. The code works fine in local environment but it does not work in server. But some web method and jQuery Ajax calls work fine with normal SQL statement, but with a stored procedure in web method which returns some data it does not work. It shows an error message as

{Message: "There was an error processing the request.",StackTrace:"", ExceptionType: ""}
  ExceptionType:""
  Message:"There was an error processing the request."
  StackTrace:""

Here's my Ajax call...
$.ajax({
            url: "AutoRFQ_Vendors_SP.aspx/BindGrid"
            , type: "POST"
            , data: JSON.stringify(objdrpdata)
            , contentType: "application/json;"
            , success: function (data) {
                $body.removeClass("loading");
                var vendorsource = {
                    datatype: "json"
                    , localdata: data.d
                    , datafields: [
                        {
                            name: 'CommonMakerNameDisplay'
                        }
                        , {
                            name: 'EqpExtendType'
                        }
                        , {
                            name: 'CommonMakerName'
                        }
                        , {
                            name: 'IsForAutoRFQ'
                        }
                        , {
                            name: 'VendorName'
                        }
                        , {
                            name: 'CurrencyCode'
                        }
                        , {
                            name: 'Proc_Vendors_AllowedCurrencyID'
                        }
                        , {
                            name: 'SortCode'
                        }
                        , {
                            name: 'xSortCode'
                        }
                        , {
                            name: 'IsTitle'
                        }
                        , {
                            name: 'NoOfRFQs'
                        }
                        , {
                            name: 'NoOfOrders'
                        }
                        , {
                            name: 'TotalPOAmtInUSD'
                        }
                    }
                });

Here's my web method:
[WebMethod(EnableSession = true)]
public static string BindGrid(string vslFilter, string yearFilter, string eqpmtFilter)
{
      DataTable dt = null;

      string gridvendorlist = "";

      try
      {
           if (HttpContext.Current.Session["P_Hub_AutoRFQVendorDataTable"] == null || (string) HttpContext.Current.Session["P_Hub_AutoRFQVslFilter"] != vslFilter || (string) HttpContext.Current.Session["P_Hub_AutoRFQYearFilter"] != yearFilter || (string) HttpContext.Current.Session["P_Hub_AutoRFQEqpmtFilter"] != eqpmtFilter)
           {
               string vslFilterType = "", vslFilterValue = "";

               if (vslFilter.Length == 3)
                   vslFilter = "VSL-" + vslFilter;

               string[] vslType = vslFilter.Trim().Split('-');

               if (vslType[0].ToString().Trim().ToUpper() == "VSL")
               {
                   vslFilterType = "VSL";
                   vslFilterValue = vslType[1].ToString();
               }
               else if (vslFilter != "-1")
               {
                   vslFilterType = "Group";
                   vslFilterValue = vslFilter.ToString();
               }

               string spName = "W_Enh_CommonMakers_RFQVendors";

               string[] paramField = { "@CompanyCode", "@VslFilterType",
                                       "@VslFilterValue", "@NoOfYrToShow",
                                       "@EQ_EquipmentID" };
               object[] paramValue = { GenFuncs.COMPANYCODE,
                                       vslFilterType,
                                       vslFilterValue,
                                       yearFilter,
                                       eqpmtFilter };
               dt = DBFuncs.dbExecuteSP(spName, paramField, paramValue);

               HttpContext.Current.Session["P_Hub_AutoRFQVendorDataTable"] = dt;
               HttpContext.Current.Session["P_Hub_AutoRFQVendorSelectedRowIndex"] = null;
               HttpContext.Current.Session["P_Hub_AutoRFQ_ScrollIndex"] = null;
               HttpContext.Current.Session["P_Hub_AutoRFQVslFilter"] = vslFilter;
               HttpContext.Current.Session["P_Hub_AutoRFQYearFilter"] = yearFilter;
               HttpContext.Current.Session["P_Hub_AutoRFQEqpmtFilter"] = eqpmtFilter;

               gridvendorlist = Func_Ajax.GetJson(dt);
           }
           else
           {
               dt = (DataTable)HttpContext.Current.Session["P_Hub_AutoRFQVendorDataTable"];
               gridvendorlist = Func_Ajax.GetJson(dt);
           }
      }
      catch (Exception err)
      {
           GenFuncs.AddToErrLog("-1", "xxx", "Error", err.Message, Path.GetFileName(HttpContext.Current.Request.PhysicalPath), "BindGrid");
      }
      finally
      {
           dt = null;
      }

      return gridvendorlist;
 }

Is there any extra thing I need to do in server?

A: After 5 hrs of explore i finally found some silly mistake which was in my web.config file
  <system.web.extensions>
        <scripting>
          <webServices>
            <jsonSerialization maxJsonLength="2147483647"/>
          </webServices>
        </scripting>
      </system.web.extensions>

works fine....Thank you


text:
Q: Pairs of points exactly $1$ unit apart in the plane This is a problem I found in a graph theory text, but I can't figure it out.
Let $S$ be a set of $n$ points in a plane, the distance between any two of which is at least one. Show that there are at most $3n$ pairs of points of $S$ at distance exactly one.
Experimenting, I figured the way to get the most points of distance exactly 1 would be to lay out the points in a grid made out of equilateral triangles. While building up this grid, it seems that when adding a new vertex, I can connect it to 2 or 3 other points to have distance exactly 1, which implies that I can only add at most 3 new pairs of points 1 unit apart for every point I add, which suggests the result. Is there a nonhandwavey way to show this?

A: Each point can have at most $6$ neighbours at distance $1$, so it can be in at most $6$ pairs. Each pair contains $2$ points. So there can be at most $6n/2=3n$ such pairs.

A: It's natural (especially since this is a graph theory text...) to turn the set $S$ into a graph by connecting two points (vertices) if they are exactly one unit apart. What can you say about this graph? Can you say something about the degrees of the vertices? What, in terms of this graph, are you trying to prove?

A: Define $G(V, E)$ such that $V$ contains all the points and $(u, v) \in E$ iff $u, v$ are exactly one unit of distance apart.
Given $\sum_{v \in V} d_v = 2 |E|$, showing that there are at most $3n$ pairs with distance 1 is equal with
$$ \sum_{v \in V} d_v \leq 6n $$
Now, assume $\sum_{v \in V} d_v > 6n$. Then there exists at least one vertex $v$ such that $d_v > 6$. Observe that any 2 vertices must be at least one unit of distance apart. The most number of vertices you can keep at a distance of 1 around $v$ is 6, using triangle geometry.
Assume there are 7 points $u_1, \cdots, u_7$ on the circumference of a circle with radius 1 around $v$. Then there exist $u_i, u_j$ such that $\angle u_i v u_j < 60^\circ$; you have an equilateral triangle where two edges are one unit long and exactly one angle is less than 60 degrees, so the third edge ($u_iu_j$) is less than one unit long (use one of the triangle inequalities). This contradicts what we assume in the problem description.


text:
Q: How to create a table like the following? I want to create the following table without the estimated value(only two columns), I'm unsure what to do:

EDIT:
Since my table is longer than the one in the picture, is there a way to split it into two(4 columns) like:
Parameter Description    | Parameter Description \[1ex]
A         blah blah blah | \mu     blah blah blah

A: Using just a basic table
\documentclass{article}
\usepackage{booktabs}
\begin{document}
\begin{tabular}{lp{2in}}
\toprule
Parameter & Description\\
\midrule
$A$ & Recruitment rate of the\newline population\\
\bottomrule
\end{tabular}
\end{document}

Per your edit:
\documentclass{article}
\usepackage{booktabs}
\begin{document}
\noindent\begin{tabular}{lp{1.5in}lp{1.5in}}
\toprule
Parameter & Description & Parameter & Description\\
\midrule
$A$ & Recruitment rate of the population & $B$ & Transmission coefficient\\
\bottomrule
\end{tabular}
\end{document}

See https://www.overleaf.com/learn/latex/Tables for a good tutorial on making tables.

A: \begin{table}[]
\begin{tabular}{ll} \hline
 &    \\ \hline
 &    \\
 &    \\
 &

and so on...
finish with
\hline
\end{tabular}
\caption{}
\end{table}

worst case - use
https://www.tablesgenerator.com/


text:
Q: axios.post not sending auth header (but .get does) I am using axios in my Vue project, and one of the calls to my api involves a POST. Both my posts and gets require that the Authorization header be set with my token. All get requests work fine, but putting the exact same headers in axios.post results in a 403.
Here is my axios code:
axios.post('https://my.example.org/myapi/meta?uname=' + uname + '&umetaid=' + post.umeta_id + '&umetavalue=' + post.meta_value, {
          withCredentials: true,
          headers: { 'Authorization': 'Bearer ' + mytoken }
        })
     .then(function (response) {
       console.log(response)
     })
     .catch(function (error) {
       console.log(error)
     })

This always results in a 403 error, and checking my request headers show that the Authorization header is never sent. If I change axios.post to axios.get above (and add a GET method to my api code, in addition to the existing POST,OPTIONS), it will execute just fine. I suppose I could leave it this way, but I think it is bad practice to use a GET call when one really is performing a POST. Is there something I am missing about forming a POST request with axios?

A: Axios Post request assumes that the second parameter is data and third parameter is config.
Axios Get request assumes that the second parameter is config while the data is appended in URL.
You are sending data in the url which should be as second parameter(For POST request).
Code Should be:
var data = {
  'uname': uname,
  'umetaid': post.umeta_id,
  'umetavalue': post.meta_value
}
var headers = {
  withCredentials: true,
  headers: { 'Authorization': 'Bearer ' + mytoken }
}
axios.post('https://my.example.org/myapi/meta',data,headers)
 .then(function (response) {
   console.log(response)
 })
 .catch(function (error) {
   console.log(error)
 })