<commit_before>/// <reference path='c:\repos\xs\src\xsrt2\xsrt.ts' />
var App;
(function (App) {
    App.setInitialState = function() {
        host.state.setState("x1", "Click Me!");
        host.state.setState("prefix", "Item");
        host.state.setState("sliderPos", 1);
        host.state.setState("filter", true);
    };

    function sliderChanged(sender, e) {
        host.state.setState("sliderPos", e.newValue);
    }

    function buttonClicked() {
        host.state.setState("x1", "Clicked!");
    }

    function textChanged(sender, e) {
        host.state.setState("prefix", sender.text);
    }

    function checked(sender, e) {
        host.state.setState("filter", host.helpers.getIsChecked(sender));
    }

    function render() {
        return (
            <Xaml.Grid name='root' 
                rows={['auto', 'auto', 'auto', 'auto', 'auto', 'auto', 'auto', 'auto']}
                columns={['auto', 'auto', '*']} >
                
                <Xaml.TextBlock name='header' grid$row='0' grid$columnSpan='3' text='Welcome to XS' fontSize='36' margin='10,10,10,10' />

                <Xaml.Button name='b1' grid$row='1' 
                    onClick={buttonClicked}
                    content={<Xaml.TextBlock name='t1' text={'O:' + host.state.getState("x1", "unset")} />} />

                <Xaml.CheckBox name='c1' grid$row='2' content='Filter' 
                    onClick={checked}
                    isChecked={host.state.getState("filter", true)} />

                <Xaml.TextBlock name='label1' grid$row='3'>Scale factor</Xaml.TextBlock>
                <Xaml.Slider name='slider1'
                    grid$row='3'
                    grid$column='1'
                    acc$labeledBy='label1'
                    minimum='1' maximum='20' value='5' 
                    onValueChanged={sliderChanged} />

                <Xaml.TextBlock name='label2' grid$row='4'>Prefix</Xaml.TextBlock>
                <Xaml.TextBox
                    name='text1'
                    grid$row='4'
                    grid$column='1'
                    acc$labeledBy='label2'
                    fontFamily='Consolas'
                    fontSize='20'
                    onTextChanged={textChanged}
                    text={host.state.getState("prefix", "Item")}  />

                <Xaml.TextBlock name='label3' grid$row='5'>Scale (output)</Xaml.TextBlock>
                <Xaml.TextBox
                    name='text2'
                    grid$row='5'
                    grid$column='1'
                    acc$labeledBy='label3'
                    fontFamily='Consolas'
                    fontSize='20'
                    text={'' + host.state.getState("sliderPos", 0)} />
                <Xaml.StackPanel
                    name='nest1'
                    grid$columnSpan='3'
                    grid$row='6'>{

                    [5,6,7,8,9,10,11,12,13,14].
                    filter(function (i) { return !host.state.getState("filter", true) || i % 2 == 1 }).
                    map(function (i) { 
                        return <Xaml.TextBlock
                            name={'item' + i}
                            text={host.state.getState("prefix", "Item")  + ':' + i} 
                            fontSize={(host.state.getState("sliderPos", 0)  + i)*2} />
                    })
                }</Xaml.StackPanel>
            </Xaml.Grid>
        );
    }
    App.render = render;
})(App || (App = {}));<commit_msg>snapshot new updates with better name usage<commit_after>/// <reference path='c:\repos\xs\src\xsrt2\xsrt.ts' />
var App;
(function (App) {
    App.setInitialState = function() {
        host.state.setState("x1", "Click Me!");
        host.state.setState("prefix", "Item");
        host.state.setState("sliderPos", 1);
        host.state.setState("filter", true);
    };

    function sliderChanged(sender, e) {
        host.state.setState("sliderPos", e.newValue);
    }

    function buttonClicked() {
        host.state.setState("x1", "Clicked!");
    }

    function textChanged(sender, e) {
        host.state.setState("prefix", sender.text);
    }

    function checked(sender, e) {
        host.state.setState("filter", host.helpers.getIsChecked(sender));
    }

    function render() {
        return (
            <Xaml.Grid 
                rows={['auto', 'auto', 'auto', 'auto', 'auto', 'auto', 'auto', 'auto']}
                columns={['auto', 'auto', '*']} >
                
                <Xaml.TextBlock grid$row='0' grid$columnSpan='3' text='Welcome to XS' fontSize='36' margin='10,10,10,10' />

                <Xaml.Button grid$row='1' 
                    onClick={buttonClicked}
                    content={<Xaml.TextBlock name='t1' text={'O:' + host.state.getState("x1", "unset")} />} />

                <Xaml.CheckBox grid$row='2' content='Filter' 
                    onClick={checked}
                    isChecked={host.state.getState("filter", true)} />

                <Xaml.TextBlock name='label1' grid$row='3'>Scale factor</Xaml.TextBlock>
                <Xaml.Slider 
                    grid$row='3'
                    grid$column='1'
                    acc$labeledBy='label1'
                    minimum='1' maximum='20' value='5' 
                    onValueChanged={sliderChanged} />
                <Xaml.ProgressBar 
                    grid$row='4'
                    grid$column='1'
                    minimum='1' maximum='20' value={host.state.getState("sliderPos", 0)} />

                <Xaml.TextBlock name='label2' grid$row='5'>Prefix</Xaml.TextBlock>
                <Xaml.TextBox
                    grid$row='5'
                    grid$column='1'
                    acc$labeledBy='label2'
                    fontFamily='Consolas'
                    fontSize='20'
                    onTextChanged={textChanged}
                    text={host.state.getState("prefix", "Item")}  />

                <Xaml.TextBlock name='label3' grid$row='6'>Scale (output)</Xaml.TextBlock>
                <Xaml.TextBox
                    grid$row='6'
                    grid$column='1'
                    acc$labeledBy='label3'
                    fontFamily='Consolas'
                    fontSize='20'
                    text={'' + host.state.getState("sliderPos", 0)} />
                <Xaml.StackPanel
                    grid$columnSpan='3'
                    grid$row='7'>{

                    [5,6,7,8,9,10,11,12,13,14].
                    filter(function (i) { return !host.state.getState("filter", true) || i % 2 == 1 }).
                    map(function (i) { 
                        return <Xaml.TextBlock
                            text={host.state.getState("prefix", "Item")  + ':' + i} 
                            fontSize={(host.state.getState("sliderPos", 0)  + i)*2} />
                    })
                }</Xaml.StackPanel>
            </Xaml.Grid>
        );
    }
    App.render = render;
})(App || (App = {}));
{'fraction_non_alphanumeric': 0.15720649518608995, 'fraction_numerical': 0.020405230636585718, 'mean_word_length': 1.4874910650464617, 'pattern_counts': {'":': 0, '<': 42, '<?xml version=': 0, '>': 42, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6307225', 'n_tokens_mistral': 2104, 'n_tokens_neox': 1949, 'n_words': 299}