text:
Q: bindable property for checkbox ischecked do not reflect when trigger used My bindable property RevalSurfaceChecked do not get updated when we set IsChecked property in trigger
<CheckBox Grid.Row="1" Grid.Column="2" Grid.ColumnSpan="2" x:Name="chkRevalSurface" Content="Export Reval Surface (if applicable)"
                  HorizontalAlignment="Left" VerticalAlignment="Center">
            <CheckBox.IsEnabled>
                <MultiBinding Converter="{StaticResource RevalSurfaceCheckboxEnableConverter}">
                    <Binding ElementName="ChkExportToCSV" Path="IsChecked"></Binding>
                    <Binding ElementName="chkExportToExcel" Path="IsChecked"></Binding>
                </MultiBinding>
            </CheckBox.IsEnabled>
            <CheckBox.Style>
                <Style TargetType="{x:Type CheckBox}">
                    <Setter Property="IsChecked" Value="{Binding RevalSurfaceChecked}" />
                    <Style.Triggers>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="IsChecked" Value="False"></Setter>
                        </Trigger>
                    </Style.Triggers>
                </Style>
            </CheckBox.Style>
        </CheckBox>

The logic here is that if I check any of the two checkbox, then the chkRevalSurface should get enabled else stay disabled-written in converter. When chkRevalSurface is disabled it should be set unchecked (written in trigger) and RevalSurfaceChecked property should be set to False. if checked set it to True in viewmodel.
ButRevalSurfaceCheckedis not set to true or false.

A: The problem is that the <Setter Property="IsChecked" Value="False"></Setter> clears the original binding, so your CheckBox's IsChecked property just ends up being False without changing the underlying property.
You mentioned you have a viewmodel, I assume the ChkExportToCSV and chkExportToExcel CheckBoxes are bound to a property in your viewmodel.
Lets assume this viewmodel:
public class MainWindowViewModel : INotifyPropertyChanged
{
    private bool _revalSurfaceChecked;
    public bool RevalSurfaceChecked
    {
        get { return _revalSurfaceChecked; }
        set
        {
            _revalSurfaceChecked = value;
            OnPropertyChanged();
        }
    }

    private bool _isChkExportToCSVChecked;
    public bool IsChkExportToCSVChecked
    {
        get { return _isChkExportToCSVChecked; }
        set
        {
            _isChkExportToCSVChecked = value;
            RevalSurfaceChecked = RevalSurfaceChecked && (_isChkExportToCSVChecked || _ischkExportToExcelChecked);
            OnPropertyChanged();
        }
    }

    private bool _ischkExportToExcelChecked;
    public bool IschkExportToExcelChecked
    {
        get { return _ischkExportToExcelChecked; }
        set
        {
            _ischkExportToExcelChecked = value;
            RevalSurfaceChecked = RevalSurfaceChecked && (_isChkExportToCSVChecked || _ischkExportToExcelChecked);
            OnPropertyChanged();
        }
    }

    public event PropertyChangedEventHandler PropertyChanged;

    private void OnPropertyChanged([CallerMemberName] string propertyName = null)
    {
        if (PropertyChanged != null)
        {
            PropertyChanged.Invoke(this, new PropertyChangedEventArgs(propertyName));
        }
    }
}

And this XAML:
<CheckBox x:Name="ChkExportToCSV" Content="ChkExportToCSV" IsChecked="{Binding IsChkExportToCSVChecked}"
          HorizontalAlignment="Left" VerticalAlignment="Center" />

<CheckBox x:Name="chkExportToExcel" Content="chkExportToExcel" IsChecked="{Binding IschkExportToExcelChecked}"
          HorizontalAlignment="Left" VerticalAlignment="Center" />

<CheckBox x:Name="chkRevalSurface" Content="Export Reval Surface (if applicable)"
          HorizontalAlignment="Left" VerticalAlignment="Center"
          IsChecked="{Binding RevalSurfaceChecked}">
    <CheckBox.IsEnabled>
        <MultiBinding Converter="{StaticResource AnyTrueConverter}">
            <Binding ElementName="ChkExportToCSV" Path="IsChecked"></Binding>
            <Binding ElementName="chkExportToExcel" Path="IsChecked"></Binding>
        </MultiBinding>
    </CheckBox.IsEnabled>
</CheckBox>

I'm binding the ChkExportToCSV's IsChecked property to the IsChkExportToCSVChecked property in the viewmodel and the chkExportToExcel's IsChecked to the IschkExportToExcelChecked property.
I removed the Style from chkRevalSurface and for the IsEnabled I use a converter that gives back true if any of the inputs are true. I assume your RevalSurfaceCheckboxEnableConverter does the same, but I'll include it here:
public class AnyTrueConverter : IMultiValueConverter
{
    public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
    {
        return values != null && values.OfType<bool>().Any(b => b);
    }

    public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
    {
        throw new NotImplementedException();
    }
}

The trick is in the setter of IsChkExportToCSVChecked and IschkExportToExcelChecked:
RevalSurfaceChecked = RevalSurfaceChecked && (_isChkExportToCSVChecked || _ischkExportToExcelChecked);

We moved the logic from the DataTrigger to here. This should solve your problem. I tested and it works for me.


text:
Q: Setting up ADS1216 to use IDAC First has anyone used this chip ADS1216 and the IDAC feature on the chip?
I have tried on many occasions to get the IDAC's to work on the ADS1216 and I'm not successful. I'm using an FPGA (artix-7 w/ Vivado 2016.4) to interface with the ADS1216.
I have setup the setup reg on the ADS1216 to use the internal reference and I have also set the range for the IDAC and I have also given the ADS1216s' IDAC a value. After all that I still see no current on the IDAC. I have to use the IDAC's because I'm using and 4 wire temp sensor that requires a current supply.
What do I need to do to get the IDAC to function?

A: TI chips are complex usually with two or three registers that need to be set before any operation happens.
Since you haven't added any info on your setup OR your register settings, I'll assume the worst.
Make sure these things are happening:
1) That your measuring current with a low impedance pathway (like 20k to 150k). I don't think your doing this but just know what the load is on the DAC.
2) Set the ACR range register to max current (which is 3)
3) Make sure the REF_EN pin is enabled if you don't have an external reference.
Set the voltage then measure the voltage with no load, if your not seeing a voltage then you are probably not setting registers right. If you do see a voltage then put a higher load like the 150k to ground and measure the voltage, it should be the really close to the no load voltage.

redpajama_set_name: RedPajamaStackExchange


text:
Q: "Operation not Permitted" for Redis I am developing on a mac which already have redis installed. by default it doesn't have a redis.conf so the default settings were used when I $ redis-server
# Warning: no config file specified, using the default config. In order to specify a config file use 'redis-server /path/to/redis.conf'

I am trying to use redis-py and have the following
import redis
r = redis.Redis('localhost')
r.set('foo','bar')
r.get('foo')

but got the following error
redis.exceptions.ResponseError: operation not permitted

I also tried in terminal $ redis-cli ping, but then i get the following error
(error) ERR operation not permitted

I suppose since there is no redis.conf the default settings doesn't have a password right? Anyways, I also tried to create a redis.conf
$ echo "requirepass foobared" >> redis.conf
$ redis-server redis.conf

then on another window
$ redis-cli
$ redis 127.0.0.1:6379> AUTH foobared
(error) ERR invalid password

also modified the second line of the python script to
r = redis.StrictRedis(host='localhost', port=6379, db=0, password='foobared')

but then I got
redis.exceptions.ResponseError: invalid password

what could I be doing wrong??? Thanks

A: Without any redis.conf file, Redis uses the default built-in configuration. So the default database file (dump.rdb) and the Append Only File are created in the server directory. Maybe the user running Redis does not have write permission on this dir.
So either you give him the permission, or you define another working directory using a config file.
You'll find a default config file for redis 2.6 here
You must modify this line in the file:
# The working directory.
dir ./


text:
Q: Inputting multiple integers from lines into a 2d array c++ I initialized a 2d array and am trying to fill the array respectively. My issue is I cannot get the 2d array to update.
Input is:
0 1 9
0 4 8
1 5 5
2 0 6
3 2 2
1 3 1
2 1 3
4 3 7
5 3 4

My code is:
stringstream s(input);

while(count != numV){
    getline(cin, input);
    while(s >> u >> v >> weight)
        Graph[u][v] = weight;

    count++;
}

A: You have to make the input stringstream after scanning the input, So your code should be
while(count != numV){
    getline(cin, input);
    stringstream s(input);
    while(s >> u >> v >> weight)
        Graph[u][v] = weight;

    count++;
}

A: Here is the full solution plus a print function:

#include <iostream>
#include <iomanip>
#include <sstream>
#include <tuple>

inline static constexpr size_t ROW_COUNT { 7 };
inline static constexpr size_t COL_COUNT { 7 };

void printGraph( int (&graph)[ ROW_COUNT ][ COL_COUNT ], const std::tuple< size_t, size_t >& dimensions, int maxDigitCount );
int getDigitCount( int num );

int main( )
{
    int Graph[ ROW_COUNT ][ COL_COUNT ] { };

    int numV { 9 };
    int count { };
    int maxDigitCount { };

    while( count != numV )
    {
        std::string input;
        std::getline( std::cin, input );
        std::stringstream ss( input );

        int u { };
        int v { };
        int weight { };

        while ( ss >> u >> v >> weight )
        {
            Graph[u][v] = weight;

            if ( getDigitCount( weight ) > maxDigitCount )
            {
                maxDigitCount = getDigitCount( weight );
            }
        }

        ++count;
    }

    constexpr std::tuple< size_t, size_t > dimensions( ROW_COUNT, COL_COUNT );

    printGraph( Graph, dimensions, maxDigitCount );
}

int getDigitCount( int num )
{
    num = abs( num );

    return ( num < 10    ? 1 :
           ( num < 100    ? 2 :
           ( num < 1000    ? 3 :
           ( num < 10'000   ? 4 :
           ( num < 100'000   ? 5 :
           ( num < 1'000'000  ? 6 :
           ( num < 10'000'000  ? 7 :
           ( num < 100'000'000  ? 8 :
           ( num < 1'000'000'000 ? 9 :
                                    10 )))))))));
}

void printGraph( int (&graph)[ ROW_COUNT ][ COL_COUNT ], const std::tuple< size_t, size_t >& dimensions, int maxDigitCount )
{
    std::cout << "\nGraph data:\n" << '\n' << "    \\ Column  ";

    for ( size_t col = 0; col < std::get<1>( dimensions ); ++col )
    {
        std::cout << std::left << std::setw( maxDigitCount + 2 ) << std::setfill(' ') << col;
    }

    std::cout << '\n' << "Row  \\" << '\n' << '\n';

    for ( size_t row = 0; row < std::get<0>( dimensions ); ++row )
    {
        std::cout << " " << row << "            ";

        for ( size_t col = 0; col < std::get<1>( dimensions ); ++col )
        {
            std::cout << std::left << std::setw( maxDigitCount + 2 ) << std::setfill(' ') << graph[ row ][ col ];
        }

        std::cout << '\n' << '\n';
    }
}

This will give you a result like this:
0 1 9
0 4 8
1 5 55
2 0 6
3 2 2
1 3 112
2 1 3
4 3 7832
5 3 4

Graph data:

    \ Column  0     1     2     3     4     5     6
Row  \

 0            0     9     0     0     8     0     0

 1            0     0     0     112   0     55    0

 2            6     3     0     0     0     0     0

 3            0     0     2     0     0     0     0

 4            0     0     0     7832  0     0     0

 5            0     0     0     4     0     0     0

 6            0     0     0     0     0     0     0

Hopefully this is what you need.

A: Note that you don't have to use arrays for storing the information(like int values) in 2D manner because you can also use dynamically sized containers like std::vector as shown below. The advantage of using std::vector is that you don't have to know the number of rows and columns beforehand in your input file. So you don't have to allocate memory beforehand for rows and columns. You can add the values dynamically. The below program read data(int values) from input.txt and store those in a 2D vector.
#include <iostream>
#include <vector>
#include <string>
#include <sstream>
#include<fstream>
int main() {
    std::string line;
    int word;

    std::ifstream inFile("input.txt");

    //create/use a std::vector instead of builit in array
    std::vector<std::vector<int>> vec;

    if(inFile)
    {
        while(getline(inFile, line, '\n'))
        {
            //create a temporary vector that will contain all the columns
            std::vector<int> tempVec;

            std::istringstream ss(line);

            //read word by word(or int by int)
            while(ss >> word)
            {
                //std::cout<<"word:"<<word<<std::endl;
                //add the word to the temporary vector
                tempVec.push_back(word);

            }

            //now all the words from the current line has been added to the temporary vector
            vec.emplace_back(tempVec);
        }
    }

    else
    {
        std::cout<<"file cannot be opened"<<std::endl;
    }

    inFile.close();

    //lets check out the elements of the 2D vector so the we can confirm if it contains all the right elements(rows and columns)
    for(std::vector<int> &newvec: vec)
    {
        for(const int &elem: newvec)
        {
            std::cout<<elem<<" ";
        }
        std::cout<<std::endl;
    }

    return 0;
}

The output of the above program can be seen here. The input file through which int values are read is also given at the above mentioned link.
If you want to take input using std::cin instead of std::ifstream then you just need to change the line while(getline(inputFile, line, '\n'))  to :
while(getline(std::cin, line, '\n'))

And also remove other references to inputFile. The logic remains the same. IMO reading from file saves time and effort since the user don't have to write the inputs again and again into the console.


text:
Q: How to fetch Android Market data when there is no API? As far as I can tell, there is no API (official or unofficial) to access information about Apps on the Android Market (info such as Title, Icon, Description, Downloads, Comments, etc..) However, there are a few websites that have managed to compile this information anyway.
My question is: How is this being done?
A couple of guesses.

*

*Manually (not likely, due to volume)

*Implemented the protocol used by the official app (by decompiling or observing packets)

*Running some kind of debugger with the official app to extract the live data

*Using some kind of automation + screen shots + text recognition (seems complicated)

*Modifying the (open) source to write a log file

I'm just curious how this was done because I sure can't figure it out. Thanks.

A: Another option to capture data is using the tcpdump tool that comes with some custom images (like Cyanogenmod and others). You can capture all the packets and then analyze them using Wireshark. This route is easier than hijacking wifi.
Checkout this splendid posts to clear out some things:

*

*Gathering packets with tcpdump from Android

*Downloading Market applications without the vending app
Update I have been working on this a bit more and @gsmd is right and they use Protocol Buffers to transfer the information and with the technique described above you can capture the packets. Then you'll need to dig into protobuffers to understand the messages.

A: As far as I know, they are using Protocol Buffers. You'll have to sniff phone traffic while it's accessing the market connected over wifi.

A: There is a Java project on Google code which attempts to build an open source api for the market: http://code.google.com/p/android-market-api/
There're also some JRuby bindings for it: http://github.com/jberkel/supermarket.
However they both require a Google/Market account, and the API is only partially implemented (searching, comments and images at the moment). Also, the reconstructed protocol buffer descriptor (market.proto) could be used to generate bindings for languages other than Java.

A: There is a really good way of getting data from the Developer console. Take a look at: https://github.com/tmurakam/googleplay_dev_scraper
I have it running on my raspberry pi and it works really good. It's pretty simple to install and further automate it with a bash script. I'd really recommend this scraper to anyone interested in getting data from the developer console!

A: Google have recently added official support for this. Reports are exported to a Google cloud storage bucket
See https://support.google.com/googleplay/android-developer/answer/6135870?hl=en&ref_topic=3450942 for more information.

A: Unfortunately there is still no official API for Google Play Store (previously known as Android Market) to access Android apps' meta-data (or any other stats).
As mentioned in other answers, you could develop your own web crawler, parse the HTML page and extract the app meta-data you need (e.g. title, descriptions, price, etc). This topic has been covered in this other question.
Another option is to use an open-source library based on ProtoBuf to fetch meta-data about an app, here the link to the project: https://code.google.com/archive/p/android-market-api.
This library fetches app meta-data from Google Play on behalf of a valid Google account, but you still need a crawler to "find" which apps are available and schedule their meta-data retrieval. This other open-source project can help you with that: https://code.google.com/archive/p/android-marketplace-crawler.
If you don't want to implement all that by yourself, you could use a third-party service to access Android apps meta-data through a JSON-based API. For instance, 42matters.com (the company I work for) offers an API for both Android and iOS to retrieve apps' meta-data, here more details:
https://42matters.com/app-market-data
In order to get the Title, Icon, Description, Downloads for an app you can use the "lookup" endpoint as documented here:
https://42matters.com/docs/app-market-data/android/apps/lookup
This is an example of the JSON response for the "Angry Birds Space Premium" app:
{
    "package_name": "com.rovio.angrybirdsspace.premium",
    "title": "Angry Birds Space Premium",
    "description": "Play over 300 interstellar levels across 10 planets...",
    "short_desc": "The #1 mobile game of all time blasts off into space!",
    "rating": 4.3046236038208,
    "category": "Arcade",
    "cat_key": "GAME_ARCADE",
    "cat_keys": [
        "GAME_ARCADE",
        "GAME",
        "FAMILY_EDUCATION",
        "FAMILY"
    ],
    "price": "$1.15",
    "downloads": "1,000,000 - 5,000,000",
    "version": "2.2.1",
    "content_rating": "Everyone",
    "promo_video": "https://www.youtube.com/embed/g6AL9YqRHaI?ps=play&vq=large&rel=0&autohide=1&showinfo=0&autoplay=1",
    "market_update": "2015-07-03T00:00:00+00:00",
    "screenshots": [
        "https://lh3.googleusercontent.com/ZmuBQzIy1G74coPrQ1R7fCeKdJmjTdpJhNrIHBOaFyM0N2EYdUPwZaQjnQUtiUDGmac=h310",
        "https://lh3.googleusercontent.com/Xg2Aq70ZH0SnNhtSKH7xg9jCfisWgmmq3C7xQbx6YMhTVAIRqlRJeH8GYtjxapb_qR4=h310",
        "https://lh3.googleusercontent.com/T4o5-2_UP82sj4fSSegbjrGmslNHlfvtEYuZacXMSOC55-7eyiKySw05lNF1QQGO2FeU=h310",
        "https://lh3.googleusercontent.com/f2ennaLdivFu5cQQaVPKsRcWxB8FS5T4Bkoy3l0iPW9-GDDnTVRhvR5kz6l4m8FL1c8=h310",
        "https://lh3.googleusercontent.com/H-9M03_-O9Df1nHr2-rUdjtk2aeBY3bAxnqSX3m2zh_aV8-K1t0qU1DxLXnK0GrDAw=h310"
    ],
    "created": "2012-03-22T08:24:00+00:00",
    "developer": "Rovio Entertainment Ltd.",
    "number_ratings": 20812,
    "price_currency": "$",
    "icon": "https://lh3.ggpht.com/aQaIEGrmba1ENSEgUtArdm3yhJUug7BRWlu_WaspoJusZyHv1rjlWtYqe_qRjE_Kmh1E=w300",
    "icon_72": "https://lh3.ggpht.com/aQaIEGrmba1ENSEgUtArdm3yhJUug7BRWlu_WaspoJusZyHv1rjlWtYqe_qRjE_Kmh1E=w72",
    "market_url": "https://play.google.com/store/apps/details?id=com.rovio.angrybirdsspace.premium&referrer=utm_source%3D42matters.com%26utm_medium%3Dapi"
}

Alternatively, we also have a DATA FEED DUMP to access all mobile app data at once: https://42matters.com/docs/app-market-data/file-dump/android-app-details (on this page you can also find a free sample of data for your tests).
I hope this helps, otherwise feel free to get in touch with me. I know this topic quite well and can point you in the right direction.
Regards,
Andrea


text:
Q: "No such file or directory" BUT the file actually exist! / Executable problems I've been using Ubuntu (13.10) for a couple of months, and I really liked. But it crashed often and that's something that I didn't liked. I was able to run all my files in my terminal without any problem, like my favourite games. And also the executable files. I was able to run them perfectly.
Then elementary Luna OS came out and I decided to give it a try. When I installed was really quick, but after some days I realized that I couldn't open most of my files on the terminal. Just a few, I can't play games anymore because of that problem. Also, I can't open executable files.
So, I decided to reinstall Ubuntu, and guess what? I wasn't able to do nothing! my games and everything, I couldn't open them because the terminal didn't let me. Always displaying the message "no such file or directory" while the file actually exist.
Also tried in Linux mint, same thing. I've tried everything, can't do anything. Could some of you help me.
All of my desktops were x64 bits edition. Right now I'm running Linux mint 16 petra cinnamon desktop x64.
How to solve this?

A: Sounds like they don't have executable permissions. Use ls -l and look for the x in the permissions description at the start of each line.
If they don't have have executable permissions you can them using chmod a+x fileName


text:
Q: PHP Переход по ссылке с параметром Всем салют!
Подскажите, как реализовать проверку на нужный url с параметром?
    <?php
        $uri = $_SERVER['REQUEST_URI'];
        var_dump($uri);
        if($uri === '/')
            require 'template/main.php';
        elseif($uri === '/customers'){
                if($uri === '/customers?active')
                    require 'template/active.php';
                elseif($uri === '/customers?history')
                    require 'template/history.php';
                else
                    require 'template/customers.php';
        }
        else
            require 'template/404.php';

    ?>

необходимо, что бы при переходе по ссылке /customers?active=1 открывалась нужная страница, а меня редиректит на 404.

A: Видимо вы пытаетесь сделать свой MVC и не понимаете с чего начать. Вот хороший материал для начинающего. Сразу же обратите внимание на маршрутизатор URL.
Вернемся к вопросу. Вы сравниваете строку c точным значением, а ваша строка длиннее этого значения. В результате и получаете 404 по else.
Что сделать в вашем случае? Применить substr, и сравнивать нужное количество символов $uri c нужной строкой, соответственно строка с условием должна выглядеть вот так (прошу обратить внимание, что это только конкретный пример для частного случая):
elseif(substr($uri, 0, 10) === '/customers')


text:
Q: Question on second order partial differentiation involving chain rules from Schaum's Calculus 5ed I'm stuck on the below exercise which is in Schaum's calculus 5ed chapter 49 on total differentiation:
If $z$ = $\phi(u,v)$ where $u=f(x,y)$ and $v=g(x,y)$, and if $\frac{\partial u}{\partial x} = \frac{\partial v}{\partial y}$ and $\frac{\partial u}{\partial y} = -\frac{\partial v}{\partial x}$, show that
$\frac{\partial^2 u}{\partial x^2}+\frac{\partial^2 u}{\partial y^2} = \frac{\partial^2 v}{\partial x^2}+\frac{\partial^2 v}{\partial y^2} = 0$
I tried evaluating the second order partial derivatives of $\phi$ w.r.t $x$ and $y$ and using the derived expressions to solve for $\frac{\partial^2 u}{\partial x^2}$ etc but didn't come out to the result so not sure if I've made an algebraic mistake or my method is wrong somehow. Any pointers appreciated.

A: Actually, the information about $z=\phi(u,v)$ is completely redundant; it simply adds to the confusion. If you assume $u,v$ are $C^2$ functions, then this statement follows immediately from the equality of mixed partials and the given hypotheses on the first derivatives:
\begin{align}
\dfrac{\partial^2u}{\partial x^2} + \dfrac{\partial^2u}{\partial y^2} &=
\dfrac{\partial}{\partial x}\left(\dfrac{\partial u}{\partial x}\right)
+ \dfrac{\partial}{\partial y}\left(\dfrac{\partial u}{\partial y}\right) \tag{by definition}\\
&= \dfrac{\partial}{\partial x}\left(\dfrac{\partial v}{\partial y}\right)
+ \dfrac{\partial}{\partial y}\left(-\dfrac{\partial v}{\partial x}\right) \tag{by hypothesis} \\
&= \dfrac{\partial}{\partial x}\left(\dfrac{\partial v}{\partial y}\right)
- \dfrac{\partial}{\partial x}\left(\dfrac{\partial v}{\partial y}\right) \tag{equality of mixed partials} \\
&= 0
\end{align}
A similar proof holds for showing $v$ is harmonic.


text:
Q: How to add users to the Viewer role in a communications site to prevent the ability to download files? I have a communications site. It has got following groups:
Admin, Member, Visitor
The Visitor group members can read + download files from the document library.

*

*I understand there is a Viewer group (I'm not sure where I can find this) where-in the members of this group can only read, and not download the documents. Where can I add users to this Viewer group?

*Is there any alternate way to prevent users from the existing Visitor group from being able to download files?

A: You can find Owners, Members and Visitors group and add users to these groups from Site permissions settings:

*

*Go to SharePoint site and click on Settings (gear) icon

*Select "Site permissions"

*You can add users to groups from the Site permissions panel:

If you share the site with user and grant "Read" permissions, those will be added to Visitors group, if you grant "Edit" permissions, those will be added to Members group and if you grant "Full Control" permissions, those will be added to Owners group

*If you want to see the groups and permissions, then you can navigate to classic experience site permissions page using "Advanced permissions settings" option from same panel:

OR use URL in this format to directly go to classic experience site permissions page:
https://<tenant>.sharepoint.com/sites/<site>/_layouts/15/user.aspx

By default Read permissions are assigned to Visitors group. So, you cannot prevent users with "Read" permissions from downloading the files.
There was a way in classic SharePoint server sites to prevent downloading files by granting "View only" or "Restricted Read" permissions to users. But, these permission levels are not available in communication sites by default.
You need to activate "SharePoint Server Enterprise Site Collection features" feature in your communicate site to get "View only" permission level.
Check this article for more information: Prevent Contributors from Downloading SharePoint Content


text:
Q: time complexity of reversing a linked list I wrote the following function to reverse a linkedlist and was wondering about the time complexity of the 'swapping'. my rationale is as follows:
it is o(n)
insertion/deletion in a linkedlist is o(1), but that assumes just adding to the tail or removing from the head/tail. here you are iterating and accessing each element, and accessing elements in a linked list is o(n).
is that correct? generally, what is the time complexity of swaps?
LinkedList.prototype.reverse = function () {
  var previous = null;
  var current = this.head;
  var next;
  while (current) {
    //swap pointers
    //cache iteration/temp var
    next = current.next;
    //point the next to the previous
    current.next = previous;
    //previous is the current one
    previous = current;

    //iterate
    current = next;
  }
  //after you're done set the head to null (ie make it the tail)
  this.head = null;
};

A: The time complexity of linked list algorithms will depend on whether you start with the place in the list you want to operate.
Insertion/deletion is O(1) if you know and O(n) if you have to iterate to find it.
The same is true for swap.
Reversing a singly-linked list is O(n) since you must touch every single node. There is a data structure trick for which reversing a doubly-linked list is O(1). You use a bit to maintain which direction counts as "forward".


text:
Q: Need A Div To Appear When Clicking On A Link Okay so I got a embed player I need inside a div, but the div (including the embed link) needs to appear and disapear, using css or Javascript
Heres the Embed Code
<object type="application/x-shockwave-flash" height="378" width="620" id="live_embed_player_flash" data="http://www.twitch.tv/widgets/live_embed_player.swf?channel=deadpoolyplays" bgcolor="#000000"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="allowNetworking" value="all" /><param name="movie" value="http://www.twitch.tv/widgets/live_embed_player.swf" /><param name="flashvars" value="hostname=www.twitch.tv&channel=deadpoolyplays&auto_play=true&start_volume=25" /></object>Watch live video from DeadpoolyPlays on www.twitch.tv

And then I need the same thing for this.

A: There are multiple ways to do this. Using Javascript and CSS, you can change the display property of the two different elements to show and hide them.
For example:
function showStuff()
{
    document.getElementById("live_embed").style.display = "block";
    document.getElementById("chat_embed").style.display = "block";
}

function hideStuff()
{
    document.getElementById("live_embed").style.display = "none";
    document.getElementById("chat_embed").style.display = "none";
}

If you are willing to import jQuery, you can simply call the .fadeIn() and .fadeOut() methods to accomplish the same thing with a nice fading transition.

A: In JQuery you can use the show/hide function:
$(selector).hide(speed, callback);

$(selector).show(speed, callback);

For example:
$("button").click(function () {
  $("object/iframe").hide(1000);
});

You can find more examples in jQuery's documentation.


text:
Q: Should an organization admin always be assigned the type admin? While reading the Fabric CA Operations Guide I noticed that the admins of the Org 1 and 2 were not assigned the type of admin when registering them in the corresponding CA as shown below:
fabric-ca-client register -d --id.name admin-org1 --id.secret org1AdminPW --id.type user -u https://0.0.0.0:7054
fabric-ca-client register -d --id.name admin-org2 --id.secret org2AdminPW --id.type user -u https://0.0.0.0:7055

To make things worst I found another entry where the admin of the Org 0 was in fact registered with type admin:
fabric-ca-client register -d --id.name admin-org0 --id.secret org0adminpw --id.type admin --id.attrs "hf.Registrar.Roles=client,hf.Registrar.Attributes=*,hf.Revoker=true,hf.GenCRL=true,admin=true:ecert,abac.init=true:ecert" -u https://0.0.0.0:7053

Why this distinct behavior for the above registrations?

A: If you set up NodeOUs in your MSP, you must specify "admin" (or another identifier you specify in your config.yaml). This way, OU is set suitably in the enrolled certificate so that it is considered an admin.
If you don't set up NodeOUs in your MSP, then only certificates under admincerts in the MSP folder are considered admins. It does not matter its type or OU.
https://hyperledger-fabric.readthedocs.io/en/release-1.4/msp.html#organizational-units


text:
Q: Magento attribute default order on config products Anyone knows how Magento sorts attributes order in config products frontend?
I.e.: I have two attribute "size" and "color" applied to 2000 configurable products.
On frontend it show first size then color: I want to change this default order without updating all products..
Already tried changing attribute name and attribute order field in db: nothing..

A: You need to given sort order to product attribute
Please refer snapshot

A: The only way I could manage to work is to change the attribute id: in fact seems that Magento default attributes order is by attribute ID.

A: For others looking for a solution (You can do this in magento admin)
Go to the configurable product, go to the tab where u connect it to simpel products.
In the box labeled "Super product attributes configuration" you can drag and drop the position of the attribute (if you have more than 1)


text:
Q: jLabel won't show I am slightly confused, I have a jFrame of which I have made in Netbeans. This jFrame has a jLabel, of which is set to setVisible(false); from the beginning. Whenever a specific method is called, I then set the jLabel to setVisible(true); and then use a timer to set it to false again after 2 seconds. Apparently it won't work and I am unable to figure out why. I am aware of the repaint(); method, but can figure out how to make that work either.
I know the actual method for setting the visibility is called, as I have set it to print a line with the current state, which it does.
My actual code is the one below.
public JFram() {
        initComponents();
        setResizable(false);
        jLabel2.setVisible(false);
    }

static void tesMethod() {
            try {
         //function that does something
            } finally {
                new JFram().showHide(); //call function which is supposed to change the vissibility of jLabel
            }
    }

    void showHide() {
            jLabel2.setVisible(true);
            System.out.println("reached show");
            new java.util.Timer().schedule(
                new java.util.TimerTask() {
                    @Override
                    public void run() {
                     jLabel2.setVisible(false);
                     System.out.println("reached timer");
                    }
                 },
             2000
            );
    }

The code below here is how I tried to use the repaint(); method.
void showHide() {
            jLabel2.setVisible(true);
            jLabel2.repaint();
            System.out.println("reached show");
            new java.util.Timer().schedule(
                new java.util.TimerTask() {
                    @Override
                    public void run() {
                     jLabel2.setVisible(false);
                     jLabel2.repaint();
                     System.out.println("reached timer");
                    }
                 },
             2000
            );
    }

A: I think your problem lies mainly in you using a java.util.Timer instead of a javax.swing.Timer and probably you're blocking the Event Dispatch Thread (EDT).
You could try this code and compare it with yours, I also don't see where you're adding your JLabel to your frame.
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.SwingUtilities;
import javax.swing.Timer;

public class ShyLabel {

    private JFrame frame;
    private JLabel label;
    private Timer timer;
    private boolean isVisible;

    public static void main(String[] args) {
        SwingUtilities.invokeLater(new Runnable() {
            @Override
            public void run() {
                new ShyLabel().createAndShowGui();
            }
        });
    }

    public void createAndShowGui() {
        String labelText = "I'm a shy label that hides every 2 seconds";

        isVisible = true;
        frame = new JFrame(getClass().getSimpleName());
        label = new JLabel(labelText);
        timer = new Timer(2000, new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                label.setText(isVisible ? "" : labelText);
                isVisible = !isVisible;
            }
        });

        timer.setInitialDelay(2000);
        timer.start();

        frame.add(label);
        frame.pack();
        frame.setVisible(true);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }
}

The below image is produced by the above code, however because of the time I recorded the GIF it looks really fast instead of taking 2 seconds as it should be...

A: May be it is a problem of layout.
As you set resizable to false before any layout calculation occurred, the label was ignored (as invisible) by the time of the first layout.
You could try revalidate().


text:
Q: Stocks Financial Statements from yahoo no longer transferrinf to excel
*

*I have a VBA code which transfers stocks Financial Statements (Income Statement, Balance Sheet, Cash Flows) from yahoo finance to excel, I have used it for a while now, but it seems yahoo has changed the links or something. Could someone help me re-link the links so that coding transfers the pulled information from yahoo to excel once again? Below is the coding
Sub FinancialStatements()
    Dim ticker As String
    Dim urlend As String
Application.ScreenUpdating = False

ticker = Sheets("inputs").Cells(2, 1)
If Sheets("Inputs").Shapes("Check Box 14").ControlFormat.Value = 1 Then
    urlend = "&annual"
Else: urlend = ""

End If

Sheets("Income Statement").Select
Cells.Clear

If Sheets("Inputs").Shapes("Check Box 11").ControlFormat.Value = 1 Then

'
    With ActiveSheet.QueryTables.Add(Connection:= _
        "URL;http://finance.yahoo.com/q/is?s=" & ticker & "" & urlend & "", Destination:=Range("$A$1") _
)
.Name = "is?s=MSFT&annual"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "9"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
  End With

      End If

    Sheets("Balance Sheet").Select
Cells.Clear

If Sheets("Inputs").Shapes("Check Box 12").ControlFormat.Value = 1 Then

'
    With ActiveSheet.QueryTables.Add(Connection:= _
        "URL;http://finance.yahoo.com/q/bs?s=" & ticker & "" & urlend & "", Destination:=Range("$A$1") _
)
.Name = "is?s=MSFT&annual"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "9"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
    End With
       End If

Sheets("Cash Flows").Select
Cells.Clear
If Sheets("Inputs").Shapes("Check Box 13").ControlFormat.Value = 1 Then

'
     With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://finance.yahoo.com/q/cf?s=" & ticker & "" & urlend & "", Destination:=Range("$A$1") _
)
.Name = "is?s=MSFT&annual"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "9"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
    End With
End If

Application.ScreenUpdating = True

End Sub

A: I think yahoo changed it's site recently.  Just check your URL, and get that working first.
http://finance.yahoo.com/quote/IBM/financials?p=IBM
When you know that is right, engineer everything else around that.
Here is a solution that works for me.  This imports data for several tickers, listed in a sheet, in cells A2, down to the end of the array.
Sub Dow_HistoricalData()

    Dim xmlHttp As Object
    Dim TR_col As Object, TR As Object
    Dim TD_col As Object, TD As Object
    Dim row As Long, col As Long

    ThisSheet = ActiveSheet.Name
    Range("A2").Select
    Do Until ActiveCell.Value = ""
    Symbol = ActiveCell.Value
    Sheets(ThisSheet).Select
    Sheets.Add

    Set xmlHttp = CreateObject("MSXML2.XMLHTTP.6.0")
    ' http://finance.yahoo.com/quote/" & Symbol & "/financials?ltr=1
    xmlHttp.Open "GET", "http://finance.yahoo.com/quote/" & Symbol & "/financials?ltr=1", False
    xmlHttp.setRequestHeader "Content-Type", "text/xml"
    xmlHttp.send

    Dim html As Object
    Set html = CreateObject("htmlfile")
    html.body.innerHTML = xmlHttp.ResponseText

    Dim tbl As Object
    Set tbl = html.getElementById("Lh(1.7) W(100%) M(0)")
    '

    row = 1
    col = 1

    Set TR_col = html.getelementsbytagname("TR")
    For Each TR In TR_col
        Set TD_col = TR.getelementsbytagname("TD")
        For Each TD In TD_col
            Cells(row, col) = TD.innerText
            col = col + 1
        Next
        col = 1
        row = row + 1
    Next

Sheets(ActiveSheet.Name).Name = Symbol
Sheets(ThisSheet).Select
ActiveCell.Offset(1, 0).Select

Loop

End Sub

Here is a screen shot of my setup.


text:
Q: C++, Valgrind reporting "possibly lost" after char* to std::string "conversion" I have a class with a constructor like,
Foo::Foo(string p) {
    path = p;
}

And I use it like this,
Foo foo = Foo("/tmp/foo");

Sorry for my C++ naivety. I understand that this is creating a std::string object implcitly (what's the right terminology for what's going on here?).
This causes Valgrind to complain as such,
==28188== 66 bytes in 1 blocks are possibly lost in loss record 3 of 5
==28188==    at 0x4C2B0E0: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==28188==    by 0x4EFBF28: std::string::_Rep::_S_create(unsigned long, unsigned long, std::allocator<char> const&) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.24)
==28188==    by 0x4EFD9B4: char* std::string::_S_construct<char const*>(char const*, char const*, std::allocator<char> const&, std::forward_iterator_tag) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.24)
==28188==    by 0x4EFDDDB: std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.24)
==28188==    by 0x4EC2B05: std::logic_error::logic_error(char const*) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.24)
==28188==    by 0x4EC5AA8: std::__throw_logic_error(char const*) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.24)
==28188==    by 0x4EFDA38: char* std::string::_S_construct<char const*>(char const*, char const*, std::allocator<char> const&, std::forward_iterator_tag) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.24)
==28188==    by 0x4EFDDDB: std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.24)
==28188==    by 0x4022F3: main (main.cpp:13)
==28188==
==28188== 144 bytes in 1 blocks are possibly lost in loss record 4 of 5
==28188==    at 0x4C2AB80: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==28188==    by 0x4E9FF9F: __cxa_allocate_exception (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.24)
==28188==    by 0x4EC5A92: std::__throw_logic_error(char const*) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.24)
==28188==    by 0x4EFDA38: char* std::string::_S_construct<char const*>(char const*, char const*, std::allocator<char> const&, std::forward_iterator_tag) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.24)
==28188==    by 0x4EFDDDB: std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.24)
==28188==    by 0x4022F3: main (main.cpp:13)

It looks like ultimately the "conversion" (sorry again) new'ing a std::string.
If I change my code to this,
string d = string("/tmp");
Foo Foo = Foo(d);

Valgrind does not report the leak.

*

*This is really a leak, right? Seems like it.

*What's the proper idiom to do what I'm doing here? I want the call semantics to be able to pass a char* but internally I want the class member to be a std::string.

A: The Valgrind error that you're getting seems to suggest that your program terminated abnormally due to an exception. You can see this through the call stack: it looks like an internal std::__throw_exception function is getting called and that there's an object of type std::logic_error getting constructed. From context, it seems like what's happening here is that you passed an invalid argument into the std::string constructor, which then caused the std::logic_error to get thrown, causing a different std::string to get constructed and then thrown. Since the program terminated due to an exception, the destructors for the std::strings constructed this way never got called, hence the leak.
I'd run this program in gdb rather than valgrind to see if you can debug the source of the error. From what you've posted above I don't think we have enough context to provide any specific insights.

A: Problem here is when you passed string literal which is actually of type const char * (c string) to const string , compiler creates temporary object by invoking overaloded ctor string(const char * ). This temporary object is then passed by value to Foo().
Temporary object of type string has internal allocation created something on heap and it should be freed when temporary object goes out of scope.
This is not definite memory leak but valgrind thinks (due to temp object doesnot have definite starting pointer pointing to it) in that way.
That's the reason it is reported as possbily lost (and not definitely lost).

A: The idiom I like to use is Foo::Foo(const std::string &str)
Passes strings by reference, but also allows for string literals.
The one thing to look out for is a NULL char pointer.  That is quite possibly what you are seeing.


text:
Q: Wrong URL pathname in the browser addressbar I have a website say: www.mywebsite.com
When I navigate to different pages, the url in the browser addressbar does not change. For instance, when i go to http://www.mywebsite.com/page1, the page1 loads fine with all the content, but the addressbar is showing http://www.mywebsite.com
Even worse, the window.location.pathname matches the addressbar, not the actual page that is being shown.

*

*This problem exists on IE, Chrome, and Firefox on Windows, and Firefox on OSX.

*Chrome and Safari in OSX work fine.

*The problem exists only on my production server (www.mywebsite.com). I have the exact same code on my stage server (stage.mywebsite.com) and it runs fine in all browsers without any problem.

This is very confusing. I spent an hour searching on google for a reason, with no success. Any help is appreciated!

A: Godaddy's fault...If you happen to have the same problem, reset your naked domain to www forwarding setting in your domain settings!


text:
Q: Backup restore without content in sharepoint I want to take a backup of my existing site and restore it on a different Sharepoint server. I know its easily possible through stsadm backup restore. But I dont want the content of my lists to appear in the restored sites. Is there any way to achieve this using backup or export command????

A: You can create a site template and choose NOT to include content.
Site Actions > Site Settings > Look and Feel > Save site as Template
See this guide

*

*SharePoint Site Templates: KISS guide to creating, saving and using


text:
Q: AS3: Check if there is an item selected in the List component? i've created a list component in flash with AS3,and i want to check if there is an item selected or not.

A: If it is the fl.controls.List then if(list.selectedIndex != -1)


text:
Q: CentOS 7: Can't connect via WinSCP when bash is executed I'm running CentOS Server 7 on a VM (ESXi) with root permissions. I have a bash script (in my /etc/profile.d/ directory) which is executed immediately after login. Before I created my .sh file in the directory there was no problem connecting to my VM via WinSCP. After creating the file and rebooting the system I cannot connect any longer. OpenSSH is installed.. Seems that the bash execution blocks the connection.. If I delete my .sh file via console afterwards the connection is established again. Is this a CentOS problem? Never had this issue under Ubuntu Server.
Error I'm getting:

Cannot initialize SFTP protocol. Is the host running a SFTP server?

Any ideas? Thank you in advance!

A: You are not showing us your script, so this is obviously somewhat speculative; but most probably your script should not be in profile.d because it requires some sort of user interaction.
The profile should be reserved exclusively for things which need to run even in noninteractive sessions.
The proper place for interactive functionality is probably not in your login scripts at all, but something like this e.g. in your $HOME/.bash_profile can at least avoid producing damage for noninteractive sessions.
case $- in *i*) invoke your script here;; esac

If you have a .bash_profile already, it may well already contain a case $- statement which you can amend instead of adding a second one.


text:
Q: Recycler View initial lag while scrolling So I have a pretty basic recycler view where Items are in cardViews.
There are no pictures loading , it's just data represented on cardViews. When data is loaded from server , while trying to scroll though initially it starts to lag. after a while a lag is gone. What could be wrong ?
My adapter code is as follows.
public class TeacherJobBoardAdapter extends
    RecyclerView.Adapter<TeacherJobBoardAdapter.ViewHolder> {

public class ViewHolder extends RecyclerView.ViewHolder {

    TextView salary, location,numberOfStudents,curriculum,teacherGender,class1,class2,gender1,gender2,daysInWeek, std1Subject, std2Subject,time;
    LinearLayout linearLayoutStd2;
    ImageView doneTick;
    CardView v;
    SlideToActView slider;
    AnimatedVectorDrawable animated;
    Context context;

    public ViewHolder(View itemView, Context context) {

        super(itemView);
        this.context = context;
        v = itemView.findViewById(R.id.card);
        slider = itemView.findViewById(R.id.slider_teacherJobBoard);

        doneTick = itemView.findViewById(R.id.doneTick_teacherJobBoard);
        animated = (AnimatedVectorDrawable) doneTick.getDrawable();

        numberOfStudents = itemView.findViewById(R.id.spn_teacherJobBoard_numberOfStudents);
        linearLayoutStd2 = itemView.findViewById(R.id.linlayout_teacherJobBoard_std2);
        location = itemView.findViewById(R.id.txt_teacherJobBoard_location);
        salary = itemView.findViewById(R.id.txt_teacherJobBoard_salary);
        curriculum = itemView.findViewById(R.id.txt_teacherJobBoard_curriculum);
        class1 = itemView.findViewById(R.id.txt_teacherJobBoard_std1Class);
        class2 = itemView.findViewById(R.id.txt_teacherJobBoard_std2Class);
        gender1 = itemView.findViewById(R.id.txt_teacherJobBoard_std1Gender);
        gender2 = itemView.findViewById(R.id.txt_teacherJobBoard_std2Gender);
        teacherGender = itemView.findViewById(R.id.txt_teacherJobBoard_tutorGender);
        daysInWeek = itemView.findViewById(R.id.txt_teacherJobBoard_daysInWeek);
        std1Subject = itemView.findViewById(R.id.txt_teacherJobBoard_std1Subject);
        std2Subject = itemView.findViewById(R.id.txt_teacherJobBoard_std2Subject);
        time = itemView.findViewById(R.id.txt_teacherJobBoard_time);
    }

}

private List<ParseObject> mObjects;

public TeacherJobBoardAdapter(List<ParseObject> object) {
    mObjects = object;
}

@NonNull
@Override
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
    Context context = parent.getContext();
    LayoutInflater inflater = LayoutInflater.from(context);

    // Inflate the custom layout
    View contactView = inflater.inflate(R.layout.item_teacher_job_board, parent, false);

    // Return a new holder instance
    return new ViewHolder(contactView,context);
}

@Override
public void onBindViewHolder(@NonNull final ViewHolder holder, int pos) {
    int position = pos;
    holder.salary.setText(""+mObjects.get(pos).getInt("salary"));
    holder.location.setText(mObjects.get(pos).getString("location"));
    holder.numberOfStudents.setText(mObjects.get(pos).getInt("numberOfStudents")+"");
    holder.curriculum.setText(mObjects.get(pos).getString("curriculum"));
    holder.teacherGender.setText(mObjects.get(pos).getString("teacherGender"));

    if (mObjects.get(pos).getInt("numberOfStudents")==1){
        holder.linearLayoutStd2.setVisibility(View.GONE);
    }else{
        holder.gender2.setText(mObjects.get(pos).getString("gender2"));
        holder.class2.setText(mObjects.get(pos).getString("class2"));
        holder.std2Subject.setText(mObjects.get(pos).getString("subject2")+"");
    }
    holder.gender1.setText(mObjects.get(pos).getString("gender1"));
    holder.class1.setText(mObjects.get(pos).getString("class1"));
    holder.std1Subject.setText(mObjects.get(pos).getString("subject1")+"");

    holder.daysInWeek.setText(mObjects.get(pos).getInt("daysInWeek")+"");
    holder.time.setText(mObjects.get(pos).getString("time"));

    holder.slider.setOnSlideCompleteListener(new SlideToActView.OnSlideCompleteListener() {
        @Override
        public void onSlideComplete(SlideToActView slideToActView) {
            TeacherJobBoard myActivity = (TeacherJobBoard) holder.context;
            myActivity.apply(slideToActView,holder.doneTick,holder.animated);
        }
    });
}

@Override
public int getItemCount() {
    return mObjects.size();
}
}

Here is the xml for the items layout
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical">

    <androidx.cardview.widget.CardView
        android:id="@+id/card"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginLeft="@dimen/_4sdp"
        android:layout_marginRight="@dimen/_4sdp"
        app:cardBackgroundColor="#FFFFFF"
        app:cardCornerRadius="@dimen/_5sdp"
        app:cardElevation="@dimen/_3sdp"
        app:cardUseCompatPadding="true">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:orientation="vertical"
            android:weightSum="10">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="horizontal"
                android:weightSum="3">

                <TextView
                    android:id="@+id/txt_teacherJobBoard_location"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="2"
                    android:fontFamily="@font/kiona_regular"
                    android:paddingLeft="@dimen/_8sdp"
                    android:paddingTop="@dimen/_8sdp"
                    android:paddingBottom="@dimen/_8sdp"
                    android:text="ADABOR"
                    android:textColor="@color/tutor_bear_dark_blue"
                    android:textSize="@dimen/_20sdp" />

                <LinearLayout
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:orientation="vertical">

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_gravity="end"
                        android:layout_weight="1"
                        android:fontFamily="@font/kiona_regular"
                        android:paddingTop="@dimen/_8sdp"
                        android:paddingEnd="@dimen/_8sdp"
                        android:text="SALARY"
                        android:textAlignment="textEnd"
                        android:textColor="@color/tutor_bear_dark_blue"
                        android:textSize="@dimen/_20sdp" />

                    <TextView
                        android:id="@+id/txt_teacherJobBoard_salary"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_gravity="end"
                        android:layout_weight="1"
                        android:drawableEnd="@drawable/ic_taka"
                        android:fontFamily="@font/kiona_regular"
                        android:paddingBottom="@dimen/_8sdp"
                        android:text="9000"
                        android:textAlignment="textEnd"
                        android:textColor="@color/tutor_bear_dark_blue"
                        android:textSize="@dimen/_20sdp" />

                </LinearLayout>

            </LinearLayout>

            <View
                android:layout_width="match_parent"
                android:layout_height="@dimen/_1sdp"
                android:layout_marginLeft="@dimen/_10sdp"
                android:layout_marginRight="@dimen/_10sdp"
                android:background="@color/tutor_bear_dark_blue" />

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_margin="@dimen/_2sdp"
                android:orientation="vertical">

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_marginTop="@dimen/_7sdp"
                    android:orientation="horizontal"
                    android:weightSum="2">

                    <TextView
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:fontFamily="@font/roboto_light"
                        android:paddingStart="@dimen/_7sdp"
                        android:text="@string/studentViewMyPost_numberOfStudents"
                        android:textColor="@color/tutor_bear_dark_blue"
                        android:textSize="@dimen/_13sdp" />

                    <TextView
                        android:id="@+id/spn_teacherJobBoard_numberOfStudents"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:fontFamily="@font/roboto_light"
                        android:paddingEnd="@dimen/_7sdp"
                        android:text="2"
                        android:textAlignment="textEnd"
                        android:textColor="@color/tutor_bear_dark_blue"
                        android:textSize="@dimen/_13sdp" />

                </LinearLayout>

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_marginTop="@dimen/_6sdp"
                    android:orientation="horizontal">

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:fontFamily="@font/roboto_light"
                        android:paddingLeft="@dimen/_7sdp"
                        android:text="@string/teacherJobBoard_curriculum"
                        android:textColor="@color/tutor_bear_dark_blue"
                        android:textSize="@dimen/_13sdp" />

                    <View
                        android:layout_width="0dp"
                        android:layout_height="0dp"
                        android:layout_weight="1" />

                    <TextView
                        android:id="@+id/txt_teacherJobBoard_curriculum"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:fontFamily="@font/roboto_light"
                        android:paddingEnd="@dimen/_7sdp"
                        android:text="English Medium"
                        android:textAlignment="textEnd"
                        android:textColor="@color/tutor_bear_dark_blue"
                        android:textSize="@dimen/_13sdp" />

                </LinearLayout>

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="@dimen/_7sdp"
                    android:orientation="horizontal">

                    <TextView
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:fontFamily="@font/roboto_light"
                        android:paddingStart="@dimen/_7sdp"
                        android:text="Student 1"
                        android:textColor="@color/tutor_bear_dark_blue"
                        android:textSize="@dimen/_13sdp" />

                    <LinearLayout
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:orientation="vertical">

                        <TextView
                            android:id="@+id/txt_teacherJobBoard_std1Subject"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_gravity="end"
                            android:fontFamily="@font/roboto_light"
                            android:paddingEnd="@dimen/_7sdp"
                            android:text="Physics, Chemistry, Maths, Psycology"
                            android:textAlignment="textEnd"
                            android:textColor="@color/tutor_bear_dark_blue"
                            android:textSize="@dimen/_13sdp" />

                        <TextView
                            android:id="@+id/txt_teacherJobBoard_std1Gender"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_gravity="end"
                            android:layout_marginTop="@dimen/_3sdp"
                            android:drawableStart="@drawable/ic_male"
                            android:fontFamily="@font/roboto_light"
                            android:paddingEnd="@dimen/_7sdp"
                            android:text="Male"
                            android:textAlignment="textEnd"
                            android:textColor="@color/tutor_bear_dark_blue"
                            android:textSize="@dimen/_13sdp" />

                        <TextView
                            android:id="@+id/txt_teacherJobBoard_std1Class"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_gravity="end"
                            android:layout_marginTop="@dimen/_3sdp"
                            android:layout_marginBottom="@dimen/_3sdp"
                            android:fontFamily="@font/roboto_light"
                            android:paddingEnd="@dimen/_7sdp"
                            android:text="Class 8"
                            android:textAlignment="textEnd"
                            android:textColor="@color/tutor_bear_dark_blue"
                            android:textSize="@dimen/_13sdp" />

                    </LinearLayout>

                </LinearLayout>

                <LinearLayout
                    android:id="@+id/linlayout_teacherJobBoard_std2"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="@dimen/_7sdp"
                    android:orientation="horizontal">

                    <TextView
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:fontFamily="@font/roboto_light"
                        android:paddingStart="@dimen/_7sdp"
                        android:text="Student 2"
                        android:textColor="@color/tutor_bear_dark_blue"
                        android:textSize="@dimen/_13sdp" />

                    <LinearLayout
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:orientation="vertical">

                        <TextView
                            android:id="@+id/txt_teacherJobBoard_std2Subject"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_gravity="end"
                            android:fontFamily="@font/roboto_light"
                            android:paddingEnd="@dimen/_7sdp"
                            android:text="Physics, Chemistry, Maths, Psycology"
                            android:textAlignment="textEnd"
                            android:textColor="@color/tutor_bear_dark_blue"
                            android:textSize="@dimen/_13sdp" />

                        <TextView
                            android:id="@+id/txt_teacherJobBoard_std2Gender"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_gravity="end"
                            android:layout_marginTop="@dimen/_3sdp"
                            android:drawableStart="@drawable/ic_male"
                            android:fontFamily="@font/roboto_light"
                            android:paddingEnd="@dimen/_7sdp"
                            android:text="Male"
                            android:textAlignment="textEnd"
                            android:textColor="@color/tutor_bear_dark_blue"
                            android:textSize="@dimen/_13sdp" />

                        <TextView
                            android:id="@+id/txt_teacherJobBoard_std2Class"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_gravity="end"
                            android:layout_marginTop="@dimen/_3sdp"
                            android:layout_marginBottom="@dimen/_3sdp"
                            android:fontFamily="@font/roboto_light"
                            android:paddingEnd="@dimen/_7sdp"
                            android:text="Class 8"
                            android:textAlignment="textEnd"
                            android:textColor="@color/tutor_bear_dark_blue"
                            android:textSize="@dimen/_13sdp" />

                    </LinearLayout>

                </LinearLayout>

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_marginTop="@dimen/_6sdp"
                    android:orientation="horizontal">

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:fontFamily="@font/roboto_light"
                        android:paddingLeft="@dimen/_7sdp"
                        android:text="@string/studentViewMyPost_preferredTutorGender"
                        android:textColor="@color/tutor_bear_dark_blue"
                        android:textSize="@dimen/_13sdp" />

                    <View
                        android:layout_width="0dp"
                        android:layout_height="0dp"
                        android:layout_weight="1" />

                    <TextView
                        android:id="@+id/txt_teacherJobBoard_tutorGender"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:drawableStart="@drawable/ic_female"
                        android:fontFamily="@font/roboto_light"
                        android:paddingEnd="@dimen/_7sdp"
                        android:text="Female"
                        android:textAlignment="textEnd"
                        android:textColor="@color/tutor_bear_dark_blue"
                        android:textSize="@dimen/_13sdp" />

                </LinearLayout>

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_marginTop="@dimen/_6sdp"
                    android:orientation="horizontal">

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"

                        android:fontFamily="@font/roboto_light"
                        android:paddingLeft="@dimen/_7sdp"
                        android:text="@string/studentViewMyPost_daysInWeek"
                        android:textColor="@color/tutor_bear_dark_blue"
                        android:textSize="@dimen/_13sdp" />

                    <View
                        android:layout_width="0dp"
                        android:layout_height="0dp"
                        android:layout_weight="1" />

                    <TextView
                        android:id="@+id/txt_teacherJobBoard_daysInWeek"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:drawableStart="@drawable/ic_calender"
                        android:fontFamily="@font/roboto_light"
                        android:paddingEnd="@dimen/_7sdp"
                        android:text="5"
                        android:textColor="@color/tutor_bear_dark_blue"
                        android:textSize="@dimen/_13sdp" />
                </LinearLayout>

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_marginTop="@dimen/_6sdp"
                    android:layout_marginBottom="@dimen/_8sdp"
                    android:orientation="horizontal">

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"

                        android:fontFamily="@font/roboto_light"
                        android:paddingLeft="@dimen/_7sdp"
                        android:text="@string/studentViewMyPost_preferredTime"
                        android:textColor="@color/tutor_bear_dark_blue"
                        android:textSize="@dimen/_13sdp" />

                    <View
                        android:layout_width="0dp"
                        android:layout_height="0dp"
                        android:layout_weight="1" />

                    <TextView
                        android:id="@+id/txt_teacherJobBoard_time"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:drawableStart="@drawable/ic_time_new"
                        android:fontFamily="@font/roboto_light"
                        android:paddingEnd="@dimen/_7sdp"
                        android:text="9:00 PM - 6:00 AM"
                        android:textColor="@color/tutor_bear_dark_blue"
                        android:textSize="@dimen/_13sdp" />
                </LinearLayout>

                <com.ncorti.slidetoact.SlideToActView
                    android:id="@+id/slider_teacherJobBoard"
                    android:layout_width="@dimen/_220sdp"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center"
                    android:layout_marginTop="@dimen/_10sdp"
                    android:layout_marginBottom="@dimen/_10sdp"
                    android:clickable="false"
                    android:hapticFeedbackEnabled="true"
                    app:animation_duration="250"
                    app:area_margin="@dimen/_5sdp"
                    app:bump_vibration="60"
                    app:complete_icon="@drawable/anim_loading_spinner"
                    app:icon_margin="@dimen/_5sdp"
                    app:inner_color="@color/color_white"
                    app:outer_color="@color/tutor_bear_dark_blue"
                    app:slider_height="@dimen/_40sdp"
                    app:slider_icon="@drawable/ic_next_arrow"
                    app:text="Slide to Apply" />

                <ImageView
                    android:id="@+id/doneTick_teacherJobBoard"
                    android:layout_width="@dimen/_40sdp"
                    android:layout_height="@dimen/_40sdp"
                    android:layout_gravity="center"
                    android:layout_marginTop="@dimen/_10sdp"
                    android:layout_marginBottom="@dimen/_10sdp"
                    android:src="@drawable/done_tick_new_anim"
                    android:visibility="gone" />
            </LinearLayout>
    </LinearLayout>
    </androidx.cardview.widget.CardView>
    </LinearLayout>

A: Try creating a release build of the app. Debug builds often display minor amounts of animation lag.


text:
Q: Still able to select disabled dates in Date picker Dialog I want to disable the past dates of date picker in android. i can do it by using
dialog.getDatePicker().setMinDate(System.currentTimeMillis() - 1000);
This is working fine and the past dates in date picker looks disabled. But I can still click on a previous date and select it. How to not let that happen ? below is the screenshot of my date picker

A: you can get the calendarInstance and setMinDate to current time
Calendar newCalendar = Calendar.getInstance();
newCalendar.get(Calendar.YEAR), newCalendar.get(Calendar.MONTH),   newCalendar.get(Calendar.DAY_OF_MONTH));
    mDatePickerDialog.getDatePicker().setMinDate(newCalendar.getTimeInMillis());


text:
Q: Taking the mean of 10000 replications of random sampling for each row I did a replication 10000 times where I took a random sample from a list of ID's and then paired them with another list of IDs. After that I added a colomn that gives the relatedness of pair to each other. Then I took thee mean of the relatedness for each set of random sampling. So I end up with 10000 values which represent the mean of the relatedness for each set of random sampling. However, I want to instead take the mean of the relatedness of first row for all the 10000 sets of random sampling.
An example of what I want:
Lets say I have 10000 sets of 3 random pairings.
Set 1
     female_ID male_ID relatedness
  0  12-34     23-65   0.034
  1  44-62     56-24   0.56
  2  76-11     34-22   0.044

Set 2
     female_ID male_ID relatedness
  0  98-54     53-12   0.022
  1  22-43     13-99   0.065
  2  09-22     65-22   0.12

etc...

I want the mean of the rows for relatedness of each set, so I want a list of 3   values: 0.028 (mean of 0.034 and 0.022), 0.3125 (mean of 0.56 and 0.065), 0.082 (mean of 0.044 and 0.12), except it would be the mean across 10000 sets, and not just 2.
Here's my code so far:
    mean_rel <- replicate(10000, {
       random_mal <- sample(list_of_males, 78, replace=TRUE)
       random_pair <- cbind(list_of_females, random_mal)
       random_pair <- data.frame(random_pair)
       random_pair$pair <- with(random_pair, paste(list_of_females, random_mal, sep = " "))
       typeA <- genome$rel[match(random_pair$pair, genome_year$pair1)]
       typeB <- genome$rel[match(random_pair$pair, genome_year$pair2)]
       random_pair$relatedness <- ifelse(is.na(typeA), typeB, typeA)
       random_pair <- na.omit(random_pair)
       mean_random_pair_relatedness <- mean(random_pair$relatedness)
       mean_random_pair_relatedness
    })

A: If you add simplify = FALSE to your replicate after the between the closing } and ), then mean_rel will be output as a list.
   mean_rel <- replicate(10000, {
     random_mal <- sample(list_of_males, 78, replace=TRUE)
     random_pair <- cbind(list_of_females, random_mal)
     random_pair <- data.frame(random_pair)
     random_pair$pair <- with(random_pair, paste(list_of_females, random_mal, sep = " "))
     typeA <- genome$rel[match(random_pair$pair, genome_year$pair1)]
     typeB <- genome$rel[match(random_pair$pair, genome_year$pair2)]
     random_pair$relatedness <- ifelse(is.na(typeA), typeB, typeA)
     random_pair <- na.omit(random_pair)
     mean_random_pair_relatedness <- mean(random_pair$relatedness)
     mean_random_pair_relatedness
  }, simplify = FALSE)

From there, you can use purrr to add two classification columns and then can use dplyr for the rest. Here is how I did it:
library(tidyverse)
mean_rel <- purrr::map2(.x = mean_rel, .y = seq_along(mean_rel),
                        function(x, y){
                          x %>%
                            mutate(set = paste0("set_", y)) %>%
                            # do this so the same row of each set can be
                            # compared
                            rownames_to_column(var = "row_number")
})

mean_rel_comb <- mean_rel %>%
  do.call(rbind, .) %>%
  as.tibble() %>%
  mutate(relatedness = as.numeric(as.character(relatedness))) %>%
  group_by(row_number) %>%
  summarize(mean = mean(relatedness))

Using your two datasets combined as a list gave me this:
# A tibble: 3 x 2
  row_number   mean
       <chr>  <dbl>
1          1 0.0280
2          2 0.3125
3          3 0.0820


text:
Q: What is the difference between "Elder is a girl" and "Random child is a girl" problem? I'm learning Probability and Statistics for the first time and there is a part where my professor said "it's done the same way, let's skip" but I don't understand how it's done the same way.
The first question goes like this:

A family has two children, and it is known that at least one is a
  girl. What is the probability that both are girls, given this
  information?

For this I understood that the all possible cases of having 2 children are $ \{GG, GB, BG, BB\} $. So when calculating the probability, it would be
$$ P(both \space girls|at \space least \space one \space girl) = \frac{P(both \space girls \cap at  \space least \space  one \space girl)}{ P(at \space least \space one \space girl)} $$
Since the cases of having at least one girl is $\{GG,GB,BG\}$ so $ P(at \space  least  \space one \space  girl)$ should be $\frac 34 $.
And the cases of $ both \space  girls \cap at \space least \space one  \space girl $ is when all are girls, $\{GG\}$, so $ P(both \space girls \cap at \space least \space one \space girl) $ is $\frac{1}{4}$.
So I put all the values in, $$ P(both \space girls|at \space least \space one \space girl) = \frac{P(both \space girls \cap at  \space least \space  one \space girl)}{ P(at \space least \space one \space girl)} = \frac{\frac{1}{4}}{\frac{3}{4}} = \frac{1}{3} $$
So the first question I understood, but when I tried to solve the second question the same way I got confused.
The second question goes like this:

A family has two children. You run into one of them and she is a girl.
  What is the probability that both children are girls given this
  information. Assuming that you are likely to run into either child,
  and that which one you run into has nothing to do with gender.

I thought that $ P(random \space child\space is \space girl) $ will be $\frac{3}{4}$, as in the first question, because the cases that you randomly meet a girl is $\{GG,GB,GB\}$ out of $ \{GG, GB, BG, BB\} $.
And $P(both \space girls \cap random \space child\space is \space girl)$ would be $\{GG\}$ out of $ \{GG, GB, BG, BB\} $, $\frac{1}{4}$.
So the answer for this question would be (what I thought) was $$ P(both \space girls|random \space child\space is \space girl) = \frac{P(both \space girls \cap random \space child\space is \space girl)}{ P(random \space child\space is \space girl)} = \frac{\frac{1}{4}}{\frac{3}{4}} = \frac{1}{3} $$
However, in the book it says that for events $G_1, G_2, G_3$ that elder, younger, and random child is a girl respectively, $P(G_1), P(G_2), P(G_3)$ are all $\frac{1}{2}$.
For $P(G_1), P(G_2)$ I understand because it would be cases of $\{GG,GB\}$ and $\{GG,BG\}$ out of $ \{GG, GB, BG, BB\} $.
But shouldn't it be $\frac{3}{4}$ for $P(G_3)$ because the possible cases are $ \{GG, GB, BG\} $ out of $ \{GG, GB, BG, BB\} $?
Sorry for the long question and bad formatting (it's my first time). But I really don't understand how this is supposed to work. What makes the two questions different that the answers are different? I must be thinking in some wrong way... Could you please help? Thank you in advance!!

A:
But shouldn't it be $\tfrac 34$ for $P(G3)$ because the possible cases are $\{GG,GB,BG\}$ out of $\{GG,GB,BG,BB\}$?

$G_3$ is the event that you meet a random child of the family, and that one is a girl.
So the outcomes are described by family-type and which-child.   Of the eight equiprobable outcomes, four result in meeting a girl. $$\rm \{\underline{GG1}, \underline{GG2}, \underline{GB1}, GB2, BG1, \underline{BG2}, BB1, BB2\} $$
So, of the four equiprobable outcomes where you meet a girl, two belong to a family with two girls.  You might have met the younger or older sibling with equal probability, but whichever it was, the probability that the other child is a girl is $1/2$.

Notice how you do not meet a girl in two outcomes where the family does have exactly one girl, but you meet her sibling.
This highlights the difference in information given by the statements "at least one is a girl", and "this one is a girl"


text:
Q: What does DC voltage reading from a DMM mean? When a DMM is set to measure DC voltage, does a read-out value correspond to an output of the ADC inside the DMM, or do multiple ADC outputs are averaged over a time interval and then converted to the DMM read-out value?
An oscilloscope always reads fluctuations in voltage, but a DMM tends to give stable readings. I wonder where the source of the difference is.

A: A typical DMM will only give 1-3 readings per second, whereas a DSO is expected to make potentially billions of readings per second.
The primary consequence of this is that fewer readings per second lets you integrate the reading over time, which is how a DMM can give true RMS readings, whereas a DSO can only give instantaneous readings.
If you slow a DSO down to just a few readings per second and tell it to average the results, you will get something closer to what a DMM gives you. But realize that it is not designed to do this, so a DMM will still do a better job at the tasks it is made for.
Another aspect of the difference is that even high-end DSOs rarely exceed 8 bits per sample, meaning only 256 values per range. Even a cheap DMM will generally give at least 2000 counts per range, and many go more than an order of magnitude higher than that.
These two aspects — speed and precision — are inversely related: it takes time to do a 16-bit or so measurement with high accuracy, so 50000 count DMMs either can only give a few readings per second or they're really expensive. Flipping it around, it's cheap to make a DSO that can do 500 megasamples per second over a 100 MHz measurement bandwidth if you only ask for 8-bit sampling.

A: Having a display which 'jumps all over the place' is bad for user confidence and also bad for meeting the typical use-case of "Tell me: ABOUT what voltage is present?" in many cases.
"Once upon a time", and quite likely still, DMMs use(d) "dual slope" analog to digital conversion. This has the advantage of being able to achieve a large number of bits of accuracy (and/or resolution) at relatively low cost.
It has the disadvantage of tending to be slower to much slower per conversion cycle.
DMM's once (and probably still) used to often make the conversion period a multiple of the mains cycle time (60 or 50 Hz mains) to minimise the impact of mains AC noise.
AND if you have a somewhat suspect conversion system, not only averaging the result but doing some sort of sliding window averaging when the input signal is 'a little noisy' and/or the conversion process is pushing its limits somewhat will add apparent stability.
All these (or some subset) add up to a high resolution, OK accuracy stable display.
If you look in the spec sheet (that small sheet of close typed thin paper that often comes with meters) you'll find that on a 1999 display (which thus has 0.05% resolution), the accuracy is usually around 1% (ie merits a 199 display.)
On a digital display of actual voltage, the last digit "should" hunt between two adjacent digits, with the time on each proportional to the undisplayed remainder. eg a voltage of 1.9876 V on a perfect accuracy "three and a half digit" 1999 display should alternate between 1.987 V and 1.988 V. On avergae it should display the former 40% of the time and the latter 60% of the time as the undisplayed 6 is 6/10 of the way between 1.987 and 1.988. Many meters do NOT have the least significant digit "hunting" in this manner.

A: A DMM takes a certain amount of time to digitize each reading. There are trade offs to that: longer is less responsive in the case of "varying DC", but averaged out AC noise better.
Precision instruments sometimes have this adjustable. Some call it "reading time", for example.  NI has a nice discussion in one of their manuals.


text:
Q: EGIT Can't connect to any repository - Missing unknown I just created a new repository on GitHub and trying to initially push my local Java project.
I added the ssh key in my GitHub account, and it's referenced correctly by Eclipse, I assume.
I only get this error message when I'm trying to push:
Can't connect to any repository:
git@github.com:MaximStein/MyProject.git
(git@github.com:MaximStein/MyProject.git: Missing unknown
366362as232d670123a2267b4879bbd01d142426)

Any ideas?

A: Your Git repository seems to be broken or at least in an invalid state.
The root cause seems to be Missing unknown 366362as232d670123a2267b4879bbd01d142426 which means something (probably the HEAD) points to the object with the hash 366362as232d670123a2267b4879bbd01d142426 (which will be stored in the file .git/objects/36/6362as232d670123a2267b4879bbd01d142426) that does not exist.
In the Git History you might right-click the last commit and choose Reset > Soft (HEAD Only). If commits are missing, you might be able to recover them via the Git Reflog view.
Make also sure your Eclipse and EGit/JGit is up to date (for instance, there was an issue causing a Missing unknown error that has been fixed more than four years ago) and that you do a refresh (F5) in Eclipse after you have executed Git operations on the command line.

A: Try first if the push would succeed from command line (which means you need in to install Git first):

*

*check you are correctly identified with ssh -Tv git@github.com

*check your remote origin URL: git remote -v

*check your local status (git status: to make sure you are on a branch, here I assume main, and that you have made at least one commit)

*check your initial push: git push -u origin main
Check also if you have declared any submodules (.gitmodules file), or look for any nested Git repository (.git subfolder anywhere beside your repository root folder)
It is helpful to rule out (or not) a git-core issue, before investigation an Egit/JGit one.
And the OP Maxim confirms in the comments:

It's a good idea to try it in the command line first.
It says "fatal: bad object HEAD" when I do git status.
I think I've only made one local commit for that project.

Indeed, making local commits, in a branch, is a prerequisite to pushing anything.
In your case, do a git branch -avv to check if there are any.
If you already pushed that missing commit, assuming your main branch is main (not master):
git fetch origin
git reset --soft origin/main


text:
Q: Определить закрыта ли камера или нет (C++) Рабочее приложение сотрудника (клиент) транслирует веб-камеру. Нужно определять не заклеена ли камера и не заблокирована ли она какой-то программой. С последним просто: в этом случае все кадры будут одинаковые - просто несколько раз сравнивается следующий кадр с предыдущим. А вот с заклеенной камерой беда. Текущий алгоритм проверяет кадры по размеру, но, как выяснилось, иногда размер кадра с закрытой камеры может быть больше реального изображения с не закрытой камеры. Вот примеры закрытых камер:

*

*Бумажка (11 111 байт)

*Палец (10 541 байт)

*Плотная ткань (22 659 байт !!!)

Как видно, по размеру кадра судить бессмысленно - нормальный кадр выходит 17-20 кб, а на третьем фото аж 22 кб при закрытой камере. Определять лица тоже не вариант, так как сотрудник может отойти - не выключать же ему приложение за это. А вот если он закрыл камеру, программа должна прекратить работу.
Как провести более точный анализ заклеенных камер при помощи OpenCV?

A: В комментариях говорили про ПФ. Но, я думаю, что это излишнее. Легко можно обойтись и без этого, более простыми методами. Я рассмотрю 3 изображения. 2 из них Ваши. Ещё одно -- из сети.

Очевидно, что изображения, представляющие собой закрытую камеру -- есть однотонные изображения, на которых преобладают оттенки из определённого цветового диапазона. Для того, чтобы это продемонстрировать, можно привести в пример гистограммы (распределение частот интенсивностей). Сразу оговорюсь, что предварительно все изображения я привожу к градации серого. Делаю это стандартным методом (питон). В принципе, он везде, как правило, реализовывается одинаково.

На гистограмме частот для пальца наблюдается всплеск частот вблизи нуля. Далее, более яркие интенсивности отсутствуют. Уже отсюда можно сделать вывод, что в нашей гистограмме много нулевых значений. Аналогичную гистограмму можно привести и для листка бумаги:

Если мы рассмотрим лицо, то нулевые значения гистограммы отсутствуют:

Таким образом, возможным решением будет являться следующая метрика:

Данная метрика рассматривает все точки гистограммы, значения которых нулевые и нормирует их (делит на возможное количество точек). Очевидно, что коль скоро данное отношение близко к 1, то мы находимся в условиях открытой камеры. В противном случае мы находимся в условиях с закрытой камерой. Для того, чтобы понять, что есть 1, а что нет, нужно смотреть на все данные (все изображения), которые у Вас имеются и на основе них делать вывод. Для этого необходимо, вероятно, посмотреть на дисперсию и мат. ождание ненулевых значений гистограммы. Т.е. на числители для всех изображений закрытой камеры. Для них выбрать, например среднюю дисперсию.

Замечу, что можно произвести более глубокий анализ. Например, отчётливо видно, что у нас есть круглый объект -- палец. Бумажка же, вероятно, плотно прижата ладонью к экрану:

Здесь мне отчётливо видится ладонь.
К сожалению, openCV я знаю плохо, но вот на питоне скрипт накидал:
import matplotlib.pyplot as plt
from scipy import fftpack, ndimage
import matplotlib.image as mpimg
import numpy as np

img = mpimg.imread(pathToImage)

imgplot = plt.imshow(img)
plt.show()
lum_img = img[:,:,0]
imgplot = plt.imshow(lum_img)
plt.colorbar()
plt.show()
y = np.histogram(lum_img, bins = range(0, 257))
plt.plot(np.array(range(0, 256)), y[0])
plt.show()
fft = fftpack.fft(img)
plt.imshow(abs(fft))
plt.show()
lum_fft = fft[:,:,0]
y = np.histogram(lum_fft, bins = range(0, 257))
plt.plot(np.array(range(0, 256)), y[0])
plt.show()

Но я полагаю, что его не составит труда перенести на нужный Вам язык, с использованием нужной либы. В коде также строится гистограмма для ПФ и само преобразование Фурье. Так что можно пронаблюдать, какие картинки возникают при этом. Кроме того, призываю заметить, что гистограмма для ПФ не несёт дополнительной информации при беглом осмотре.
Преобразование Фурье для картинки с пальцем и гистограмма для преобразования Фурье для картинки с пальцем:


text:
Q: How to properly set-up ou DNS Zone delegation for the "_acme-challenge" subdomain? We have hard times setting up a DNS Zone Delegation for one of our subdomains.
We have one DNS record "_acme-challenge" that will change frequently, and this DNS record is defined directly on our server, which acts as a SECONDARY Name Server only for this record.
Our need is to have this record delegated to our SECONDARY Name Server, instead of having to change it manually in our MAIN DNS zone.
Please note that our SECONDARY Name Server is the same domain "example.com".
Our domain name is registered at OVH : example.com
Our MAIN DNS Servers are at OVH :

*

*ns15.ovh.net

*dns15.ovh.net

Our example.com content is hosted on a web server (not on OVH) having the following IP :
212.123.456.789
We do not have any problem with this DNS zone : our domain and emails are working correctly.
Our MAIN DNS zone is defined at OVH like this (shortened for brevity) :
$TTL 3600
@   IN SOA dns15.ovh.net. tech.ovh.net. (2019111705 86400 3600 3600000 300)
                       IN NS     ns15.ovh.net.
                       IN NS     dns15.ovh.net.
                       IN A      212.123.456.789
ftp                    IN CNAME  example.com.
mail                   IN A      212.123.456.789
www                    IN CNAME  example.com.

Our second DNS Server have these always existing records :
example.com.            NS      ns1.example.com.
ns1.example.com.        A       212.123.456.789
example.com.            NS      ns2.example.com.
ns2.example.com.        A       212.123.456.789

Our second DNS Server will regularly update the following record in its zone :
_acme-challenge.example.com     TXT     HereIsTheTextContent

We tried to add the following records to our MAIN DNS zone at OVH, in order to delegate this record to the SECONDARY Name Server, but had no success : _acme-challenge.example.com does not ping at all.
ns1                    IN A      212.123.456.789
ns2                    IN A      212.123.456.789
_acme-challenge        IN NS     ns1.example.com.
_acme-challenge        IN NS     ns2.example.com.

We guessed that some kind of records are missing, but where ?

*

*Did we forget to add some records to ou MAIN DNS zone ? (defined at OVH)

*Did we forget to add some records to ou SECONDARY DNS zone ? (defined on our "example.com" hosted on our server)

I would be happy if you could pinpoint the error, and give us a clue to make it work :-)
Thanks

A: Thank you for your comments ! Here a re some answers, and the solution.
TL;DR : The initial DNS configuration posted in my question is fully functional. We were unduly thinking it was not functional because we forgot that TXT records cannot be pinged ! (Shame on us)
Detailed explanations and answers :

*

*@Ryan Bolger : What we call our "MAIN DNS server" : ns15.ovh.net AND dns15.ovh.net. They are managed by a machine hosted on OVH.

*@Ryan Bolger : What we call our "SECONDARY DNS server" : ns1.example.com AND ns2.example.com. They are managed by a machine hosted on our own infrastructure. The correct term for this seems to be "a subdelegate DNS zone".

*@Ryan Bolger : These MAIN and SECONDARY Name Servers have different names because they are not managed by the same machine.

*@Ryan Bolger : We did not choose to use AXFR/IFXR zone transfers without any manual intervention, because our knowledge to set them up properly is not enough.

*@Harry Johnston : Yes, what we are trying to achieve is to set up a primary nameserver for a subdomain. This one is called our "SECONDARY DNS server". Sorry for the confusion and wording !

*@Harry Johnston : No, we wera not using this "SECONDARY DNS server" before. We are only using it to contain, and supply the _acme-challenge record

*@Harry Johnston : Sorry when we said that the _acme-challenge record "does not ping at all" : You are right, and we made a mistake, forgetting that TXT records cannot be pinged ! (Shame on us again)

So to wrap up all info about the current situation :
=> The _acme-challenge TXT record is defined on our "SECONDARY DNS server" (AKA. our subdelegate DNS Zone) (which, in fact, acts as a Primary Name Server as noted by @Harry Johnston). More information about this technique can be found in the Use a "Throwaway" Validation Domain section of this article :
https://www.eff.org/deeplinks/2018/02/technical-deep-dive-securing-automation-acme-dns-challenge-validation
=> Our "MAIN DNS server", hosted at OVH, have the following zone :
$TTL 3600
@   IN SOA dns15.ovh.net. tech.ovh.net. (2019111705 86400 3600 3600000 300)
                       IN NS        ns15.ovh.net.
                       IN NS        dns15.ovh.net.
                       IN A         212.123.456.789
ftp                    IN CNAME     example.com.
mail                   IN A         212.123.456.789
www                    IN CNAME     example.com.
ns1                    IN A         212.123.456.789
ns2                    IN A         212.123.456.789
_acme-challenge        IN NS        ns1.example.com.
_acme-challenge        IN NS        ns2.example.com.

=> Our "SECONDARY DNS server", hosted on our own infrastructure, have the following zone, with a regularly changing _acme-challenge TXT record :
HOST                                Record Type         Value
example.com.                        NS                  ns1.example.com.
ns1.example.com.                    A                   212.123.456.789
example.com.                        NS                  ns2.example.com.
ns2.example.com.                    A                   212.123.456.789
_acme-challenge.example.com.        TXT                 k9ieQiTudAC7XydqdG7UIOtJn0PPC4brDK7e_zOC-7m

The conclusion is that it's working :

*

*The _acme-challenge TXT record is correctly retrieved from our "SECONDARY DNS server", meaning that the zone delegation for the _acme-challenge subdomain is operational.

We do not see any error in this configuration : can you all confirm ?