问:
Click button to display editable fields using Vue.js
Hi hope you all are doing great!

I'm totally a beginner in Vue.js and I don't have so much idea how to work on with it your help to solve this issue will be appreciated.

Actually I'm stuck with an issue where I have to focus on the editable fields whenever the edit icon is clicked. But as per my old code I can edit the fields by clicking on the fields itself but as per new requirement I want to focus on editable fields by clicking on a edit icon.

Here's is my code

HTML File

```<code><form  class="editable-form editable-form-web">

                                        <div v-cloak id="vue">

                                            <!-- <form id="dynamic_crm_fields"> -->
                                            <div v-for="item, key in ordered_section(field_schema)" class="xyzz" :id="item.section_name|replace">

                                                <div class="accordion" id="cust_info_accordion" style="margin:15px 0 !important;">
                                                    <div class="item">
                                                        <div class="item-header p-0 shadow" role="tab" :id="'section_heading_'+key">
                                                            <h6 class="mb-0">
                                                                <button class="btn btn-link" type="button" data-toggle="collapse" v-bind:data-target="'#section_collaps_'+key" aria-expanded="true" aria-controls="collapse-1">
                                                                    ${item.section_name}
                                                                    <i class="fa fa-angle-down"></i>
                                                                </button>
                                                            </h6>
                                                        </div>

                                                        <div class="col-12 text-center mb-2">

                                                            <div :id="'section_collaps_'+key" v-bind:class="[key < 0 ?'collapse collapse-div': 'show']"  class=" collapse-div" data-parent="#cust_info_accordion" aria-labelledby="lead-heading" >
                                                                <div class="t-p">
                                                                    <div class="row">
                                                                        <div class="col-11">
                                                                            <div class="row lista1" style="font-size:11px; color:#333333">
                                                                                <template v-for="field, field_index in ordered_field(item.section_fields)">
                                                                                <div class="col-3 lsname">
                                                                                <div v-if="field.field_type != 'checkbox'" class="form-group row mb-0">
                                                                                <label :for="field.field|replace" class="font-weight-bold text-capitalize text-lg-left col-sm-7 col-form-label" style="font-family:Arial">${field.field} <span v-show="field.required" class="star">*</span></label>
                                                                                <label :for="field.field|replace" class="font-weight-bold text-lg-left col-sm-7 col-form-label mb-0 pt-0 pt-sm-3" key="field_index" v-on:click="editField($event,item.db_section_name,field_index,field.editable,field.field_type)" v-show="edit_field !== item.db_section_name+field_index" :style="[{'color':'rgba(0, 0, 0, 0.6)'}]" >${field_data[item.db_section_name][field.db_field]}</label> <!--:style="[field.editable ? {'cursor':'pointer'}:{},{'color':'rgba(0, 0, 0, 0.6)'}]-->
                                                                                <div v-show="edit_field == item.db_section_name+field_index" class="col-sm-8">
                                                                                <!-- text field -->
                                                                                <input v-if="field.field_type == 'text'"  type="text" class="form-control crm-form-control" :readonly=!field.editable v-model="field_data[item.db_section_name][field.db_field]" v-on:blur="edit_field = null" :ref="item.db_section_name" :maxlength="field.size" >
                                                                                <!-- textarea -->
                                                                                <textarea v-else-if="field.field_type == 'textarea'" type="text" class="form-control" :readonly=!field.editable v-model="field_data[item.db_section_name][field.db_field]" v-on:blur="edit_field = null" :ref="item.db_section_name" rows="4" :maxlength="field.size"></textarea>
                                                                                <!-- radio group -->
                                                                                <div v-else-if="field.field_type == 'radio'" :id="field.field" class="form-inline" :ref="item.db_section_name">
                                                                                <div class="form-check mr-sm-3" v-for="option in split_string(field.options)">
                                                                                <label :for="field.field|replace" class="form-check-label">
                                                                                <input class="form-check-input" type="radio" :value="option" :id="option" :disabled="!field.editable" v-model="field_data[item.db_section_name][field.db_field]" v-on:blur="edit_field = null">${option}<i class="input-helper"></i>
                                                                                </label>
                                                                                </div>
                                                                                </div>
                                                                                <!-- date field -->
                                                                                <datepicker v-else-if="field.field_type == 'datefield'" :value=field_data[item.db_section_name][field.db_field] v-on:set-date="field_data[item.db_section_name][field.db_field] = $event" v-on:blur="edit_field = null" :ref="item.db_section_name"></datepicker>
                                                                                <!-- Dropdowns -->
                                                                                <select v-else-if="field.field_type == 'dropdown'" class="form-control crm-form-control" :disabled=!field.editable v-model="field_data[item.db_section_name][field.db_field]" v-on:blur="edit_field = null" :ref="item.db_section_name">
                                                                                <option v-for="option in split_string(field.options)" :id="option" :value="option">${option}</option>
                                                                                </select>
                                                                                <!-- multiselect dropdown -->
                                                                                <select2 v-else-if="field.field_type == 'multiselect'" :options="split_string(field.options)" class="form-control crm-form-control" :disabled=!field.editable multiple="true" v-model="field_data[item.db_section_name][field.db_field]" v-on:blur="edit_field = null" :ref="item.db_section_name"></select2>
                                                                                <!-- integer field -->
                                                                                <input v-else-if="field.field_type == 'integer'" type="text" class="form-control crm-form-control" onkeypress="return isNumber(event)" :maxlength="field.size" :readonly=!field.editable v-model.number="field_data[item.db_section_name][field.db_field]" v-on:blur="edit_field = null" :ref="item.db_section_name">
                                                                                <!-- float field -->
                                                                                <input v-else-if="field.field_type == 'float'" type="number" class="form-control crm-form-control" :maxlength="field.size" :readonly=!field.editable v-model.number="field_data[item.db_section_name][field.db_field]" v-on:blur="edit_field = null" :ref="item.db_section_name" step="0.01">
                                                                                <!-- timefield -->
                                                                                <timepicker v-else-if="field.field_type == 'timefield'" :id="field.field|replace" :target="'#'+field.field|replace" v-on:set-time="field_data[item.db_section_name][field.db_field] = $event" :value=field_data[item.db_section_name][field.db_field] v-on:blur="edit_field = null" :ref="item.db_section_name"></timepicker>
                                                                                <!-- datetimefield -->
                                                                                <datetimepicker v-else-if="field.field_type == 'datetimefield'" :id="field.field|replace" :target="'#'+field.field|replace" v-on:set-datetime="field_data[item.db_section_name][field.db_field] = $event" :value=field_data[item.db_section_name][field.db_field] v-on:blur="edit_field = null" :ref="item.db_section_name"></datetimepicker>
                                                                                <!-- multiple checkbox -->
                                                                                <div class="form-inline" v-else-if="field.field_type == 'multicheckbox'" :ref="item.db_section_name">
                                                                                <div class="form-check mr-sm-3" v-for="option in split_string(field.options)">
                                                                                <label class="form-check-label">
                                                                                <input class="form-check-input" type="checkbox" :value="option" :id="option" :disabled=!field.editable v-model="field_data[item.db_section_name][field.db_field]" v-on:blur="edit_field = null">${option}<i class="input-helper"></i>
                                                                                </label>
                                                                                </div>
                                                                                </div>
                                                                                </div>
                                                                                <span v-show="field.required && (!field_data[item.db_section_name][field.db_field] || field_data[item.db_section_name][field.db_field].length == 0 )&& required_crm  " class="help-block form-error col-sm-8 offset-md-4 my-0">This is a required field</span>
                                                                                </div>
                                                                                <div v-else class="form-inline row mb-0">
                                                                                <label :for="field.field" class="col-form-label text-capitalize mb-0 px-2">${field.field}:</label>
                                                                                <!-- checkbox -->
                                                                                <div v-if="field.field_type == 'checkbox'" class="form-check">
                                                                                <label class="form-check-label">
                                                                                <input type="checkbox" class="form-check-input" :disabled=!field.editable v-model="field_data[item.db_section_name][field.db_field]" :ref="item.db_section_name">
                                                                                <i class="input-helper" ></i>
                                                                                </label>
                                                                                </div>
                                                                                </div>
                                                                                </div>
                                                                                </template>
                                                                            </div>
                                                                        </div>

                                                                            <template>
                                                                                <div class="col-1"  v-on:click="toggle_edit($event,item.db_section_name)">
                                                                                <iconify-icon icon="el:pencil" style="cursor:pointer;color: #2bb0e2;"></iconify-icon>
                                                                                <p id="edit" style="cursor:pointer;color: #2bb0e2;">Edit</p>
                                                                                </div>
                                                                            </template>
                                                                        </div>
                                                                    </div>
                                                                </div>

                                                    </div>

                                                </div>

                                            </div>

                                            </div>
                                    </div>
                                </form>
</code>```

Vue js code

```<code>var crm_field_vue = new Vue({
el: '#vue',
delimiters: ['${', '}'],
data:{
        field_schema:[],
        basic_field_data:{
            numeric:'',
            first_name:'',
            last_name:'',
            email:'',
            status:''
        },
        field_data:{},
        temp_data:{},
        edit_field:null,
        edit_basic_field:null,
        update_crm: false,
        required_fields:[],
        required_crm:false,
    // formData: {}
},
methods:{
    col_span(span_val){
        return{
            'col-sm-12': span_val === "3",
            'col-sm-8' : span_val === "2",
            'col-sm-4' : span_val === "1",
        }
    },
    // to split string of option tag in dropdown
    split_string: function(string_option){
        if ( string_option !== '') {
            return string_option.split(',')
        }
    },

    // to sort section priority wise in custom crm fields
    ordered_section: function (schema) {
        return _.sortBy(schema, 'section_priority')
    },
    // to sort fields priority wise in custom crm fields
    ordered_field: function(schema){
        return _.sortBy(schema, 'priority')
    },
    editField(event, sec_name, index, editable,field_type){
        if (!editable)
        return
        this.edit_field = sec_name + index
        this.update_crm = true
        this.$nextTick(() => {
            if ($.inArray(field_type,['datefield','datetimefield','timefield']) == -1){
                this.$refs[sec_name][index].focus()
            } else {
                $(this.$refs[sec_name][index].$el).find('input').focus()
            }
        })
    },
    toggle_edit(event,sec_name){
        console.log("button clicked")
    },
    editBasicField(field_name){
        this.edit_basic_field = field_name
        this.$nextTick(() => {
            this.$refs[field_name].focus()
        })
    },
    resetBasicField(){
        this.basic_field_data = {
            numeric:'',
            first_name:'',
            last_name:'',
            email:'',
            status:''
        }
    }
},
watch: {
    field_data:function(value){
        var vm = this
        if(Object.keys(vm.temp_data).length != 0 && Object.keys(value).length == 0){
            crm_field_vue.field_data = JSON.parse(JSON.stringify(vm.temp_data))
        }else if (Object.keys(vm.temp_data).length != 0){
            if($(Object.keys(vm.temp_data)).not(Object.keys(value)).length >0){
                $.each($(Object.keys(vm.temp_data)).not(Object.keys(value)), function(index,sec_key){
                    value[sec_key] = {}
                    $.each(Object.keys(vm.temp_data[sec_key]) , function(index,field_key){
                        value[sec_key][field_key] = null;
                    })
                })
            }
        }
    }
}});
</code>```

Here in the above code I have 2 different methods to work with first is the editField() method where actually the edit action is taking place but I want to do the editing activity through toggle_edit() method where toggle_edit() method is called on @click event in the edit icon. Whenever the edit icon is clicked it should focus on the editable fields.

Body:
Hi hope you all are doing great!

I'm totally a beginner in Vue.js and I don't have so much idea how to work on with it your help to solve this issue will be appreciated.

Actually I'm stuck with an issue where I have to focus on the editable fields whenever the edit icon is clicked. But as per my old code I can edit the fields by clicking on the fields itself but as per new requirement I want to focus on editable fields by clicking on a edit icon.

Here's is my code

HTML File

<form  class="editable-form editable-form-web">

                                                                <button class="btn btn-link" type="button" data-toggle="collapse" v-bind:data-target="'#section_collaps_'+key" aria-expanded="true" aria-controls="collapse-1">
                                                                    ${item.section_name}

                                                                </button>

                                                            <div :id="'section_collaps_'+key" v-bind:class="[key < 0 ?'collapse collapse-div': 'show']"  class=" collapse-div" data-parent="#cust_info_accordion" aria-labelledby="lead-heading" >

                                                                                <template v-for="field, field_index in ordered_field(item.section_fields)">

                                                                                ${field.field} *
                                                                                ${field_data[item.db_section_name][field.db_field]}

                                                                                <input v-if="field.field_type == 'text'"  type="text" class="form-control crm-form-control" :readonly=!field.editable v-model="field_data[item.db_section_name][field.db_field]" v-on:blur="edit_field = null" :ref="item.db_section_name" :maxlength="field.size" >

                                                                                <textarea v-else-if="field.field_type == 'textarea'" type="text" class="form-control" :readonly=!field.editable v-model="field_data[item.db_section_name][field.db_field]" v-on:blur="edit_field = null" :ref="item.db_section_name" rows="4" :maxlength="field.size"></textarea>

                                                                                <input class="form-check-input" type="radio" :value="option" :id="option" :disabled="!field.editable" v-model="field_data[item.db_section_name][field.db_field]" v-on:blur="edit_field = null">${option}

                                                                                <datepicker v-else-if="field.field_type == 'datefield'" :value=field_data[item.db_section_name][field.db_field] v-on:set-date="field_data[item.db_section_name][field.db_field] = $event" v-on:blur="edit_field = null" :ref="item.db_section_name"></datepicker>

                                                                                <select v-else-if="field.field_type == 'dropdown'" class="form-control crm-form-control" :disabled=!field.editable v-model="field_data[item.db_section_name][field.db_field]" v-on:blur="edit_field = null" :ref="item.db_section_name">
                                                                                <option v-for="option in split_string(field.options)" :id="option" :value="option">${option}</option>
                                                                                </select>

                                                                                <select2 v-else-if="field.field_type == 'multiselect'" :options="split_string(field.options)" class="form-control crm-form-control" :disabled=!field.editable multiple="true" v-model="field_data[item.db_section_name][field.db_field]" v-on:blur="edit_field = null" :ref="item.db_section_name"></select2>

                                                                                <input v-else-if="field.field_type == 'integer'" type="text" class="form-control crm-form-control" onkeypress="return isNumber(event)" :maxlength="field.size" :readonly=!field.editable v-model.number="field_data[item.db_section_name][field.db_field]" v-on:blur="edit_field = null" :ref="item.db_section_name">

                                                                                <input v-else-if="field.field_type == 'float'" type="number" class="form-control crm-form-control" :maxlength="field.size" :readonly=!field.editable v-model.number="field_data[item.db_section_name][field.db_field]" v-on:blur="edit_field = null" :ref="item.db_section_name" step="0.01">

                                                                                <timepicker v-else-if="field.field_type == 'timefield'" :id="field.field|replace" :target="'#'+field.field|replace" v-on:set-time="field_data[item.db_section_name][field.db_field] = $event" :value=field_data[item.db_section_name][field.db_field] v-on:blur="edit_field = null" :ref="item.db_section_name"></timepicker>

                                                                                <datetimepicker v-else-if="field.field_type == 'datetimefield'" :id="field.field|replace" :target="'#'+field.field|replace" v-on:set-datetime="field_data[item.db_section_name][field.db_field] = $event" :value=field_data[item.db_section_name][field.db_field] v-on:blur="edit_field = null" :ref="item.db_section_name"></datetimepicker>

                                                                                <input class="form-check-input" type="checkbox" :value="option" :id="option" :disabled=!field.editable v-model="field_data[item.db_section_name][field.db_field]" v-on:blur="edit_field = null">${option}

                                                                                This is a required field

                                                                                ${field.field}:

                                                                                <input type="checkbox" class="form-check-input" :disabled=!field.editable v-model="field_data[item.db_section_name][field.db_field]" :ref="item.db_section_name">

                                                                                </template>

                                                                            <template>

                                                                                <iconify-icon icon="el:pencil" style="cursor:pointer;color: #2bb0e2;"></iconify-icon>

Edit

                                                                            </template>

                                </form>

Vue js code

var crm_field_vue = new Vue({
el: '#vue',
delimiters: ['${', '}'],
data:{
        field_schema:[],
        basic_field_data:{
            numeric:'',
            first_name:'',
            last_name:'',
            email:'',
            status:''
        },
        field_data:{},
        temp_data:{},
        edit_field:null,
        edit_basic_field:null,
        update_crm: false,
        required_fields:[],
        required_crm:false,
    // formData: {}
},
methods:{
    col_span(span_val){
        return{
            'col-sm-12': span_val === "3",
            'col-sm-8' : span_val === "2",
            'col-sm-4' : span_val === "1",
        }
    },
    // to split string of option tag in dropdown
    split_string: function(string_option){
        if ( string_option !== '') {
            return string_option.split(',')
        }
    },

    // to sort section priority wise in custom crm fields
    ordered_section: function (schema) {
        return _.sortBy(schema, 'section_priority')
    },
    // to sort fields priority wise in custom crm fields
    ordered_field: function(schema){
        return _.sortBy(schema, 'priority')
    },
    editField(event, sec_name, index, editable,field_type){
        if (!editable)
        return
        this.edit_field = sec_name + index
        this.update_crm = true
        this.$nextTick(() => {
            if ($.inArray(field_type,['datefield','datetimefield','timefield']) == -1){
                this.$refs[sec_name][index].focus()
            } else {
                $(this.$refs[sec_name][index].$el).find('input').focus()
            }
        })
    },
    toggle_edit(event,sec_name){
        console.log("button clicked")
    },
    editBasicField(field_name){
        this.edit_basic_field = field_name
        this.$nextTick(() => {
            this.$refs[field_name].focus()
        })
    },
    resetBasicField(){
        this.basic_field_data = {
            numeric:'',
            first_name:'',
            last_name:'',
            email:'',
            status:''
        }
    }
},
watch: {
    field_data:function(value){
        var vm = this
        if(Object.keys(vm.temp_data).length != 0 && Object.keys(value).length == 0){
            crm_field_vue.field_data = JSON.parse(JSON.stringify(vm.temp_data))
        }else if (Object.keys(vm.temp_data).length != 0){
            if($(Object.keys(vm.temp_data)).not(Object.keys(value)).length >0){
                $.each($(Object.keys(vm.temp_data)).not(Object.keys(value)), function(index,sec_key){
                    value[sec_key] = {}
                    $.each(Object.keys(vm.temp_data[sec_key]) , function(index,field_key){
                        value[sec_key][field_key] = null;
                    })
                })
            }
        }
    }
}});

Here in the above code I have 2 different methods to work with first is the editField() method where actually the edit action is taking place but I want to do the editing activity through toggle_edit() method where toggle_edit() method is called on @click event in the edit icon. Whenever the edit icon is clicked it should focus on the editable fields.


来源: stackexchange

问:
Dynamically configuring SSE-C encryption key with each read request on hadoop + s3
I have a single bucket in s3 containing many objects. Some objects are encrypted using client keys. Some are encrypted using SSE-S3 managed keys. Among encrypted objects using a client key, object1's key may be different than object2's key.

I see that Hadoop supports SSE-C, but I haven't seen anybody address this mixed-encryption type use case. Can Hadoop support mixed, or "per request" encryption keys within the same bucket? I am trying to read several objects in a single request. Per request, all object's keys will be the same (IE no mixed keys within a single request).

I have looked at Hadoop's configurations, but they all seem to be applied on a global level. I'm not seeing the ability to dynamically configure the encryption keys.

ContentLicense: CC BY-SA 4.0


问:
Unable to generate signed APK for release build variant with newly created JKS file
I'm trying to create new app out of existing code by changing the application ID in build.gradle.

As per my understanding, applicationId is the unique identity for an app. So, if I change the applicationId, it should be treated as a whole new app.

In order to generate a signed build, I should create new JKS file, upload key and passwords. Even though I create them correctly by following these steps, Android studio fails to generate signed build with below error:

Execution failed for task ':app:packageRelease'.

A failure occurred while executing com.android.build.gradle.tasks.PackageAndroidArtifact$IncrementalSplitterRunnable
com.android.ide.common.signing.KeytoolException: Failed to read key new_key from store "C:\Users\Dev\Downloads\test.jks": Invalid keystore format

NOTE: If I use the previous JKS file, alias key and passwords (used for signing the old app which has different applicationId) for signing the APK with new applicationId, I'm able to generate signed APK!

My question is, if applicationId is changed in build.gradle, why android studio is expecting me to use the JKS file and keys of previous app with different applicationId? It should sign the APK with newly created JKS right?

Tried invalidating the cache, clean and rebuild project. But it is not working.

Can anyone help me in resolving this issue?

Thanks in advance!


问:
Redirect Standard Output Log to a File in K8s Container
I am using nomad-autoscaler image to run a pod that emits the logs on standard out, I want to send these logs into a file (within the pod) to enable a liveness check based on logfile content.

Used below dockerfile -

```<code>FROM hashicorp/nomad-autoscaler:0.3.5

USER 0
RUN touch /var/log/nomad-autoscaler.log \
&& ln -sf /proc/$$/fd/1 /var/log/nomad-autoscaler.log
</code>```

but there is nothing in the log file when tailing the file.

I've followed the solutions -

Added an entrypoint.sh file which redirects the output with tee

```<code># entrypoint.sh
set -e
"$@" | tee -a "/log/nomad-autoscaler-logs.log"
</code>```

This creates the file but not adding the logs to that, it is always 0 size, I can see the below processes in the container

```<code>/ $ ps
PID   USER     TIME  COMMAND
    1 nomad-au  0:00 sh /log/script/entrypoint.sh nomad-autoscaler agent -config /etc/nomad-autoscaler/conf/shared -config /etc/nomad-autoscaler/conf/secret
    7 nomad-au  2:37 nomad-autoscaler agent -config /etc/nomad-autoscaler/conf/shared -config /etc/nomad-autoscaler/conf/secret
    8 nomad-au  0:00 tee -a /log/nomad-autoscaler-logs.log
</code>```

But when I redirect the output, I can see the logs in file but not it is not populated on standard output.

```<code># entrypoint.sh
set -e
"$@" &> "/log/nomad-autoscaler-logs.log"
</code>```

Additional info about log redirection configured within the container -

```<code>/ $ ls -l /dev/stdout /dev/stderr  /proc/self/fd/2 /proc/self/fd/1
lrwxrwxrwx    1 root     root            15 Jan  3 18:44 /dev/stderr -> /proc/self/fd/2
lrwxrwxrwx    1 root     root            15 Jan  3 18:44 /dev/stdout -> /proc/self/fd/1
lrwx------    1 nomad-au nomad-au        64 Jan  4 19:37 /proc/self/fd/1 -> /dev/pts/2
lrwx------    1 nomad-au nomad-au        64 Jan  4 19:37 /proc/self/fd/2 -> /dev/pts/2
</code>```

Any suggestions will be a great help.

Body:
I am using nomad-autoscaler image to run a pod that emits the logs on standard out, I want to send these logs into a file (within the pod) to enable a liveness check based on logfile content.

Used below dockerfile -

FROM hashicorp/nomad-autoscaler:0.3.5

USER 0
RUN touch /var/log/nomad-autoscaler.log \
&& ln -sf /proc/$$/fd/1 /var/log/nomad-autoscaler.log

but there is nothing in the log file when tailing the file.

I've followed the solutions -

Added an entrypoint.sh file which redirects the output with tee

# entrypoint.sh
set -e
"$@" | tee -a "/log/nomad-autoscaler-logs.log"

This creates the file but not adding the logs to that, it is always 0 size, I can see the below processes in the container

/ $ ps
PID   USER     TIME  COMMAND
    1 nomad-au  0:00 sh /log/script/entrypoint.sh nomad-autoscaler agent -config /etc/nomad-autoscaler/conf/shared -config /etc/nomad-autoscaler/conf/secret
    7 nomad-au  2:37 nomad-autoscaler agent -config /etc/nomad-autoscaler/conf/shared -config /etc/nomad-autoscaler/conf/secret
    8 nomad-au  0:00 tee -a /log/nomad-autoscaler-logs.log

But when I redirect the output, I can see the logs in file but not it is not populated on standard output.

# entrypoint.sh
set -e
"$@" &> "/log/nomad-autoscaler-logs.log"

Additional info about log redirection configured within the container -

/ $ ls -l /dev/stdout /dev/stderr  /proc/self/fd/2 /proc/self/fd/1
lrwxrwxrwx    1 root     root            15 Jan  3 18:44 /dev/stderr -> /proc/self/fd/2
lrwxrwxrwx    1 root     root            15 Jan  3 18:44 /dev/stdout -> /proc/self/fd/1
lrwx------    1 nomad-au nomad-au        64 Jan  4 19:37 /proc/self/fd/1 -> /dev/pts/2
lrwx------    1 nomad-au nomad-au        64 Jan  4 19:37 /proc/self/fd/2 -> /dev/pts/2

Any suggestions will be a great help.


问:
Creating Google Docs template with fields containing multiple text strings, from which user can select one (and others are removed)
On another piece of note-taking software I used previously, it was possible to create text selections that, when double-clicked, would choose that specific option from the available ones.

e.g. "Harvey is holding a [[ball][hammer][pencil]]."

If you double-click on [ball], the field collapses to only that selection:

"Harvey is holding a ball."

If not achieved exactly the same way, I want to create templates that as above 1) allow multiple text strings to be listed, and 2) once one is selected, to remove the non-selected strings.

=====

Obviously the specific method I described does not work in Google Docs, but looking through its Help section and searching on Google hasn't produced any results of a similar function or solution. (Nor has reading through the suggested previous questions.)

This is my first stack overflow question, apologies if this isn't the right tag to post to/this has been answered elsewhere.


问:
Is there any way to call API from certain selected slide of powerpoint?
I am working on powerpoint add-in created with react js. I created add-in in which user adds a url on each slide using input field and get saved in a table. The task is how to call API on that URL when you click on that certain slide.

I have tried

```<code>Office.context.document.getSelectedDataAsync(Office.CoercionType.SlideRange, function (result) {
  if (result.status === Office.AsyncResultStatus.Succeeded) {
    const slide = result.value;
    slide.addEventListener("click", function () {
      fetch(url)
        .then((response) => response.json())
        .then((data) => {
          console.log(result);
        })
        .catch((error) => {
          console.log(error);
        });
    });
  }
});
</code>```

Body:
I am working on powerpoint add-in created with react js. I created add-in in which user adds a url on each slide using input field and get saved in a table. The task is how to call API on that URL when you click on that certain slide.

I have tried

Office.context.document.getSelectedDataAsync(Office.CoercionType.SlideRange, function (result) {
  if (result.status === Office.AsyncResultStatus.Succeeded) {
    const slide = result.value;
    slide.addEventListener("click", function () {
      fetch(url)
        .then((response) => response.json())
        .then((data) => {
          console.log(result);
        })
        .catch((error) => {
          console.log(error);
        });
    });
  }
});


问:
Django - models fields join to django-table2
I have a django-tables2 table created with data from model Data. Model Data is linked to model Kategorie with "jmeno" (name of Category). And I would like to link field "jmeno" to my table PuDetailTable as category field.

Table definition:

```<code>class PuDetailTable(tables.Table):

    class Meta:
        model = Data
        fields = ("datum", "doklad", "cislo", "popis", "amount", "partner", "zakazka", "stredisko", "ucet", "company", "category")
        sequence = ("datum", "doklad", "cislo", "popis", "partner", "zakazka", "stredisko", "ucet", "category", "company", "amount")
        attrs = {'a': {"class": "a2"}, 'th': {'class': 'headline'}}

    ...

    category = tables.Column(verbose_name="Kategorie", accessor="ucet__mustek__kategorie__jmeno", attrs = {"td": {'class': 'text-center'}})

</code>```

Models:

```<code>class Data(models.Model):
    ucet = models.ForeignKey(Ucty, on_delete=models.CASCADE, null=True, blank=True)

class Ucty(models.Model):
    cislo = models.IntegerField("Účet", blank=True, null=True)

class Mustek(models.Model):
    ucet = models.ForeignKey(Ucty, on_delete=models.CASCADE)
    kategorie = models.ForeignKey(Kategorie, on_delete=models.CASCADE)

class Kategorie(models.Model):
    jmeno = models.CharField("Kategorie", max_length=20, blank=True, null=True)

</code>```

And I need help with correct accessor to get "jmeno" (category name) to the table as the accessor accessor="ucet__mustek__kategorie__jmeno" is not working. I have tried different variants like accessor="ucet_ucty__mustek__kategorie__jmeno", but this is also not working.

So any idea what should be the correct accessor?

Body:
I have a django-tables2 table created with data from model Data. Model Data is linked to model Kategorie with "jmeno" (name of Category). And I would like to link field "jmeno" to my table PuDetailTable as category field.

Table definition:

class PuDetailTable(tables.Table):

    class Meta:
        model = Data
        fields = ("datum", "doklad", "cislo", "popis", "amount", "partner", "zakazka", "stredisko", "ucet", "company", "category")
        sequence = ("datum", "doklad", "cislo", "popis", "partner", "zakazka", "stredisko", "ucet", "category", "company", "amount")
        attrs = {'a': {"class": "a2"}, 'th': {'class': 'headline'}}

    ...

    category = tables.Column(verbose_name="Kategorie", accessor="ucet__mustek__kategorie__jmeno", attrs = {"td": {'class': 'text-center'}})

Models:

class Data(models.Model):
    ucet = models.ForeignKey(Ucty, on_delete=models.CASCADE, null=True, blank=True)

class Ucty(models.Model):
    cislo = models.IntegerField("Účet", blank=True, null=True)

class Mustek(models.Model):
    ucet = models.ForeignKey(Ucty, on_delete=models.CASCADE)
    kategorie = models.ForeignKey(Kategorie, on_delete=models.CASCADE)

class Kategorie(models.Model):
    jmeno = models.CharField("Kategorie", max_length=20, blank=True, null=True)

And I need help with correct accessor to get "jmeno" (category name) to the table as the accessor accessor="ucet__mustek__kategorie__jmeno" is not working. I have tried different variants like accessor="ucet_ucty__mustek__kategorie__jmeno", but this is also not working.

So any idea what should be the correct accessor?


问:
When a session has been modified?

express-session

When saveUninitialized:false and the user is logged in, if I modify req.session.views = 1, the session will be saved. But if the user is not logged in, it will not be saved, while I modified the session myself.

I know:

A session is uninitialized when it is new but not modified.

I want to know how passport modifies req.session, which express-session assumes as modified and saves it.

Title: When a session has been modified?


问:
How to send custom headers in spring boot GET Request?
I have an api which looks like this:

@Get
@Path("/{user_id}")
public Response getUser(@RequestHeader(name="email", required = false) String email, @PathParam("user_id") String userId, @QueryParam("pref") Boolean pref)
```

When I am sending a sample request through postman, I am not able to fetch the value of email even though i am providing it in the headers. It keeps showing email: ""

What am I missing?

I have tried changing some configs but its of no use. Maybe I am missing something.

Body:
I have an api which looks like this:

@Get
@Path("/{user_id}")
public Response getUser(@RequestHeader(name="email", required = false) String email, @PathParam("user_id") String userId, @QueryParam("pref") Boolean pref)

When I am sending a sample request through postman, I am not able to fetch the value of email even though i am providing it in the headers. It keeps showing email: ""

What am I missing?

I have tried changing some configs but its of no use. Maybe I am missing something.


问:
C project will not compile with Clang - Undefined symbols for arch
I have been writing a C project, which I usually compile and run using GCC. However, I am now trying to work on this project on my M2 Macbook, which replaces GCC with Clang.

When using GCC, I am keeping all of the headers in a single include/ directory. The project structure is as follows:

```<code>bin/                // Binary output location
docs/
include/            // Header files are here
input/
makefile
obj/                // Generated object .o files here
src/                // Actual source code, .c files
tesh.sh
</code>```

My makefile is as follows:

```<code># Compiler Makefile
# Author: John L. Carveth <jlcarveth@gmail.com>
SRC_DIR := src# Source Code Location
OBJ_DIR := obj# Object Output Location
BIN_DIR := bin# Binary Output location
DOC_DIR := docs# Document location
OUT_DIR := out# Testing output location
CC := gcc
# Output file named ZeroCompiler
TARGET := $(BIN_DIR)/ZeroCompiler
# Include directory
IDIR := include
# All source files to compile
SRC := $(wildcard $(SRC_DIR)/*.c)
# Object files linked to the .c files
OBJ := $(SRC:$(SRC_DIR)/%.c=$(OBJ_DIR)/%.o)
# All Document files to be rendered (all files w/ .md extension)
DOC := $(wildcard $(DOC_DIR)/*.md)

# Compiler flags
CFLAGS := -Wall -D DEBUG -g
CPPFLAGS := -I$(IDIR) -MMD -MP
LDFLAGS := -Llib
LDLIBS := -lm

# PHONY targets so they can still be executed
.PHONY: all clean docs

all : $(TARGET)

$(TARGET): $(OBJ) | $(BIN_DIR)
    $(CC) $(LDFLAGS) $^ $(LDLIBS) -o $@

$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c | $(OBJ_DIR)
    $(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@

$(BIN_DIR) $(OBJ_DIR):
    mkdir -p $@

clean:
    @$(RM) -rv $(TARGET) $(OBJ_DIR) $(BIN_DIR) $(DOC_DIR)/out $(OUT_DIR)
docs:
    mkdir -p $(DOC_DIR)/out
    mdtodoc $(DOC) --dest "docs/out" --layout "page" --theme "github" --highlight-style "atom-one-light"

test:
    ./test.sh

-include $(OBJ:.o=.d)
</code>```

My makefile would generate the necessary object files, link them, and generates a working binary output when I used GCC. On my Macbook however, I am getting the following error when running make:

```<code>Undefined symbols for architecture arm64:
  "_arithmeticExpression", referenced from:
    _forStatement in Parser.o
[...]
</code>```

In this case, arithmeticExpression is a function that who's prototype is defined within one of the header files within 'includes/'.

Now obviously it seems that I am lacking some understanding of the entire compilation process. How can I ensure I am properly linking the includes/ directory when compiling my application?

Body:
I have been writing a C project, which I usually compile and run using GCC. However, I am now trying to work on this project on my M2 Macbook, which replaces GCC with Clang.

When using GCC, I am keeping all of the headers in a single include/ directory. The project structure is as follows:

bin/                // Binary output location
docs/
include/            // Header files are here
input/
makefile
obj/                // Generated object .o files here
src/                // Actual source code, .c files
tesh.sh

My makefile is as follows:

# Compiler Makefile
# Author: John L. Carveth <jlcarveth@gmail.com>
SRC_DIR := src# Source Code Location
OBJ_DIR := obj# Object Output Location
BIN_DIR := bin# Binary Output location
DOC_DIR := docs# Document location
OUT_DIR := out# Testing output location
CC := gcc
# Output file named ZeroCompiler
TARGET := $(BIN_DIR)/ZeroCompiler
# Include directory
IDIR := include
# All source files to compile
SRC := $(wildcard $(SRC_DIR)/*.c)
# Object files linked to the .c files
OBJ := $(SRC:$(SRC_DIR)/%.c=$(OBJ_DIR)/%.o)
# All Document files to be rendered (all files w/ .md extension)
DOC := $(wildcard $(DOC_DIR)/*.md)

# Compiler flags
CFLAGS := -Wall -D DEBUG -g
CPPFLAGS := -I$(IDIR) -MMD -MP
LDFLAGS := -Llib
LDLIBS := -lm

# PHONY targets so they can still be executed
.PHONY: all clean docs

all : $(TARGET)

$(TARGET): $(OBJ) | $(BIN_DIR)
    $(CC) $(LDFLAGS) $^ $(LDLIBS) -o $@

$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c | $(OBJ_DIR)
    $(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@

$(BIN_DIR) $(OBJ_DIR):
    mkdir -p $@

clean:
    @$(RM) -rv $(TARGET) $(OBJ_DIR) $(BIN_DIR) $(DOC_DIR)/out $(OUT_DIR)
docs:
    mkdir -p $(DOC_DIR)/out
    mdtodoc $(DOC) --dest "docs/out" --layout "page" --theme "github" --highlight-style "atom-one-light"

test:
    ./test.sh

-include $(OBJ:.o=.d)

My makefile would generate the necessary object files, link them, and generates a working binary output when I used GCC. On my Macbook however, I am getting the following error when running make:

Undefined symbols for architecture arm64:
  "_arithmeticExpression", referenced from:
    _forStatement in Parser.o
[...]

In this case, arithmeticExpression is a function that who's prototype is defined within one of the header files within 'includes/'.

Now obviously it seems that I am lacking some understanding of the entire compilation process. How can I ensure I am properly linking the includes/ directory when compiling my application?


问:
Java DAX client dependency throws "com.amazonaws:aws-java-sdk-dynamodb:pom:1.11 was not found" error
I am trying to implement a POC on DAX with DynamoDB. What is the correct DAX java client dependency I need to use ?
Examples refer to

```<code>    <dependency>
                    <groupId>com.amazonaws</groupId>
                    <artifactId>amazon-dax-client</artifactId>
                    <version>1.0.230341.0</version>
                </dependency>
</code>```

But this dependency throws the following error :
com.amazonaws:aws-java-sdk-dynamodb:pom:1.11 was not found in maven repository during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of central has elapsed or updates are forced

Body:
I am trying to implement a POC on DAX with DynamoDB. What is the correct DAX java client dependency I need to use ?
Examples refer to

    <dependency>
                    <groupId>com.amazonaws</groupId>
                    <artifactId>amazon-dax-client</artifactId>
                    <version>1.0.230341.0</version>
                </dependency>

But this dependency throws the following error :
com.amazonaws:aws-java-sdk-dynamodb:pom:1.11 was not found in maven repository during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of central has elapsed or updates are forced


问:
NetSuite Invoice Custom Field to store Billing Schedule information from Sales Order
We have turned on Billing Schedule feature and it has multiple Invoice created on certain day.
Is there any method to get Billing Schedule information from the Invoice?
I can see the "Created from" field shows the Sales Order but I want to know it's specific Billing Schedule so that I can see Billing Period
In Invoice advanced pdf template, I have to show Billing Start Date but I can't find it from the Invoice. I don't think it will be same with Created Date.
Any help would be appreciated</p>


问:
Build Gstreamer gst-plugins-bad 1.18.6 with support for Nvidia cuda, encoding/decoding, etc
Similar questions have been asked elsewhere on Stack Overflow. However, I do not believe any posts here give an answer relevant to the more recent releases of gst-plugins-bad.

I'd like to encode and decode H264 video streams with gstreamer using hardware support via my GTX1080 video card. I have been able to get this to work previously following this guide on gst-plugins-bad 1.16.3, but my goal now is to access features available in 1.18.6. However, starting with 1.17.0, the build system for gst-plugins-bad changed from autoconf to Meson. I don't have ANY experience w/ Meson at all (honestly, I hadn't even heard of it until this point), and as such have no idea how to pass the proper arguments to build w/ nvidia support. Also, I wouldn't have come asking if there were any documentation available referencing what I'm trying to do here specific to later versions of gstreamer plugins. As far as I can tell, there isn't.

I am on Ubuntu 22.04 with Cuda 11.8, Gstreamer 1.20.3, gst-plugins-bad 1.18.6.

For brevity is the output from nvidia-smi:

```<code>Wed Jan  4 14:42:19 2023
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 520.61.05    Driver Version: 520.61.05    CUDA Version: 11.8     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ...  Off  | 00000000:42:00.0  On |                  N/A |
|  0%   54C    P2    40W / 240W |    652MiB /  8192MiB |      1%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      1879      G   /usr/lib/xorg/Xorg                354MiB |
|    0   N/A  N/A      2034      G   /usr/bin/gnome-shell               92MiB |
|    0   N/A  N/A     12603      G   ...1/usr/lib/firefox/firefox      163MiB |
|    0   N/A  N/A     20393      G   ...RendererForSitePerProcess       38MiB |
+-----------------------------------------------------------------------------+

</code>```

Any help is appreciated, thanks in advance.

Body:
Similar questions have been asked elsewhere on Stack Overflow. However, I do not believe any posts here give an answer relevant to the more recent releases of gst-plugins-bad.

I'd like to encode and decode H264 video streams with gstreamer using hardware support via my GTX1080 video card. I have been able to get this to work previously following this guide on gst-plugins-bad 1.16.3, but my goal now is to access features available in 1.18.6. However, starting with 1.17.0, the build system for gst-plugins-bad changed from autoconf to Meson. I don't have ANY experience w/ Meson at all (honestly, I hadn't even heard of it until this point), and as such have no idea how to pass the proper arguments to build w/ nvidia support. Also, I wouldn't have come asking if there were any documentation available referencing what I'm trying to do here specific to later versions of gstreamer plugins. As far as I can tell, there isn't.

I am on Ubuntu 22.04 with Cuda 11.8, Gstreamer 1.20.3, gst-plugins-bad 1.18.6.

For brevity is the output from nvidia-smi:

Wed Jan  4 14:42:19 2023
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 520.61.05    Driver Version: 520.61.05    CUDA Version: 11.8     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ...  Off  | 00000000:42:00.0  On |                  N/A |
|  0%   54C    P2    40W / 240W |    652MiB /  8192MiB |      1%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      1879      G   /usr/lib/xorg/Xorg                354MiB |
|    0   N/A  N/A      2034      G   /usr/bin/gnome-shell               92MiB |
|    0   N/A  N/A     12603      G   ...1/usr/lib/firefox/firefox      163MiB |
|    0   N/A  N/A     20393      G   ...RendererForSitePerProcess       38MiB |
+-----------------------------------------------------------------------------+

Any help is appreciated, thanks in advance.


问:
How to implement a transfer function with variable coefficients?
I want to implement two filters using transfer functions with variable coefficients and passing a gaussian noise. The two filters are:

F1: F(s) = ((5d)^(1/2))/(b+s);

F2: F1(s) = (((5d)^(1/2))*((b/sqrt(3))+s)) / (b+s)^2;

Where d and b vary every time step.

The implementations for the two filters in simulink are as follow:

For the first filter:

Filter1

And for the second one:

Filter2

The obtained results have values of 10^-12, while the expected results should be between 10^-3 - 10.

Since it's the first time when I try to implement a tf with variable coefficients I am not sure the implementations are correct.


问:
Nested Navigation Stack does not find navigator
I am want to add a secondary Navigation so that a subset of screens have access to providers, as opposed to the whole stack being wrapped by providers they do not need access to.  However, I think there is something wrong with my nested setup because I get an error when clicking a button that would navigate to the substack:

ERROR  The action 'NAVIGATE' with payload {"name":"VehicleDetailInspections","params":{"vehicleId":27541}} was not handled by any navigator.

Do you have a screen named 'VehicleDetailInspections'?

If you're trying to navigate to a screen in a nested navigator, see https://reactnavigation.org/docs/nesting-navigators#navigating-to-a-screen-in-a-nested-navigator.

The link to this only shows tabs & drawers, which we do not have.

My setup is:

HOMESTACK

```<code>const HomeStack = createNativeStackNavigator<HomeStackParams>();

export function HomeNavigator(): JSX.Element {
  const styles = useInspectionStyles();

  return (
    <VehicleDataProvider>
      <HomeStack.Navigator
        screenOptions={{
          headerStyle: styles.headerStyles,
          headerBackVisible: false,
          headerTitle: '',
          headerLeft: () => <GoBack />,
        }}
      >
        <HomeStack.Group
          screenOptions={{
            headerShadowVisible: false,
            headerStyle: [styles.headerStyles],
          }}
        >
          <HomeStack.Screen
            name={VEHICLE_DETAIL}
            component={VEHICLE_DETAIL.component}
          />
        </HomeStack.Group>
        /*
        // I have tried both of these options:
        <HomeStack.Group>
            {() => <InspectionNavigator />}
        </HomeStack.Group>
       // or
        <HomeStack.Screen
          name={'InspectionSubStack'}
          component={InspectionNavigator}
        />
        */
      </HomeStack.Navigator>
    </VehicleDataProvider>
  );
}

</code>```

In the above HomeStack, in the VEHICLE_DETAIL screen, there is a button which when clicked navigates to VEHICLE_DETAIL_INSPECTIONS which is part of the InspectionStack below.

```<code>const navigation = useNavigation<NavigationProp<InspectionStackParams>>();
...
onPress={() =>
  navigation.navigate('VEHICLE_DETAIL_INSPECTIONS', {
     vehicleId: vehicle.id,
  })
}
</code>```

INSPECTION substack:

```<code>const InspectionStack = createNativeStackNavigator<InspectionStackParams>();

export function InspectionNavigator(): JSX.Element {
  const styles = useInspectionStyles();

  return (
    <InspectionsDataProvider>
      <InspectionProgresssProvider>
        <InspectionStack.Navigator
          screenOptions={{
            headerStyle: styles.headerStyles,
            headerBackVisible: false,
            headerTitle: '',
            headerLeft: () => <GoBack />,
          }}
        >
          <InspectionStack.Screen
            name={VEHICLE_DETAIL_INSPECTIONS}
            component={
              VEHICLE_DETAIL_INSPECTIONS.component
            }
          />
          <InspectionStack.Screen
            name={VEHICLE_INSPECTIONS_SECTION].name}
            component={
              VEHICLE_INSPECTIONS_SECTION.component
            }
          />
          <InspectionStack.Screen
            name={VEHICLE_INSPECTIONS_STEP}
            component={VEHICLE_INSPECTIONS_STEP.component}
          />
        </InspectionStack.Navigator>
      </InspectionProgresssProvider>
    </InspectionsDataProvider>
  );
}
</code>```

What do I need to do to get the InspectionNavigator to be found by the navigate() from HomeStack?

Body:
I am want to add a secondary Navigation so that a subset of screens have access to providers, as opposed to the whole stack being wrapped by providers they do not need access to.  However, I think there is something wrong with my nested setup because I get an error when clicking a button that would navigate to the substack:

ERROR  The action 'NAVIGATE' with payload {"name":"VehicleDetailInspections","params":{"vehicleId":27541}} was not handled by any navigator.

Do you have a screen named 'VehicleDetailInspections'?

If you're trying to navigate to a screen in a nested navigator, see https://reactnavigation.org/docs/nesting-navigators#navigating-to-a-screen-in-a-nested-navigator.

The link to this only shows tabs & drawers, which we do not have.

My setup is:

HOMESTACK

const HomeStack = createNativeStackNavigator<HomeStackParams>();

export function HomeNavigator(): JSX.Element {
  const styles = useInspectionStyles();

  return (
    <VehicleDataProvider>
      <HomeStack.Navigator
        screenOptions={{
          headerStyle: styles.headerStyles,
          headerBackVisible: false,
          headerTitle: '',
          headerLeft: () => <GoBack />,
        }}
      >
        <HomeStack.Group
          screenOptions={{
            headerShadowVisible: false,
            headerStyle: [styles.headerStyles],
          }}
        >
          <HomeStack.Screen
            name={VEHICLE_DETAIL}
            component={VEHICLE_DETAIL.component}
          />
        </HomeStack.Group>
        /*
        // I have tried both of these options:
        <HomeStack.Group>
            {() => <InspectionNavigator />}
        </HomeStack.Group>
       // or
        <HomeStack.Screen
          name={'InspectionSubStack'}
          component={InspectionNavigator}
        />
        */
      </HomeStack.Navigator>
    </VehicleDataProvider>
  );
}

In the above HomeStack, in the VEHICLE_DETAIL screen, there is a button which when clicked navigates to VEHICLE_DETAIL_INSPECTIONS which is part of the InspectionStack below.

const navigation = useNavigation<NavigationProp<InspectionStackParams>>();
...
onPress={() =>
  navigation.navigate('VEHICLE_DETAIL_INSPECTIONS', {
     vehicleId: vehicle.id,
  })
}

INSPECTION substack:

const InspectionStack = createNativeStackNavigator<InspectionStackParams>();

export function InspectionNavigator(): JSX.Element {
  const styles = useInspectionStyles();

  return (
    <InspectionsDataProvider>
      <InspectionProgresssProvider>
        <InspectionStack.Navigator
          screenOptions={{
            headerStyle: styles.headerStyles,
            headerBackVisible: false,
            headerTitle: '',
            headerLeft: () => <GoBack />,
          }}
        >
          <InspectionStack.Screen
            name={VEHICLE_DETAIL_INSPECTIONS}
            component={
              VEHICLE_DETAIL_INSPECTIONS.component
            }
          />
          <InspectionStack.Screen
            name={VEHICLE_INSPECTIONS_SECTION].name}
            component={
              VEHICLE_INSPECTIONS_SECTION.component
            }
          />
          <InspectionStack.Screen
            name={VEHICLE_INSPECTIONS_STEP}
            component={VEHICLE_INSPECTIONS_STEP.component}
          />
        </InspectionStack.Navigator>
      </InspectionProgresssProvider>
    </InspectionsDataProvider>
  );
}

What do I need to do to get the InspectionNavigator to be found by the navigate() from HomeStack?


问:
How to move (i.e. reset) a local git upstream tracking branch? e.g. to "undo" a `git fetch origin main`
AFAIK the only git command to manipulate upstream tracking branches is git fetch (and other commands that trigger a fetch), but they only really allow a "fast forward" operation against the remote branch.

I would like to have more control and be able to "reset" it like any other local branch, without affecting remote. I think one way is to modify the file at .git/refs/remotes/origin/<branchname> to point to a different SHA, but is that correct/safe?

Why: to decouple multiple ongoing branches/workstreams

Let's say I've got:

```<code>* (HEAD -> kache/foo, origin/kache/foo) done, ready to push
| * (kache/bar) almost done, commits are atomic
|/
| * (kache/baz) still wip, commits are a mess
|/
* (main, origin/main)
</code>```

I discover that foo needs a fresh main (for w/e reason), so I fetch origin/main, rebase foo on top, and then get it merged.

But now, main is far behind origin/main. Before I context switch, getting back a "clean slate" means forwarding main to origin/main and rebasing all branches on top. Should rebase conflicts arise, bar will be easy to fix, but baz won't.

I generally have many local dev branches and working on a single one (foo) has caused a workflow interruption on every other branch. In addition, the more "wip" like baz there are, the worse the mass-rebase overhead will be.

I've already tried/got various "rebasing a tree" solutions. I'll keep trying, but solving the general-case means being resilient against (multiple) rebase conflicts, being abort-able (atomic), retryable (recorded resolutions), etc, and AFAIK a general-case turnkey solution doesn't exist.

In this situation, I'd like to just reset origin/main back to main. Once foo is merged, I can delete my local foo, reset my origin/main, and immediately context-switch to bar or baz. Unlike a mass-rebase, it would be fast and would always work. I'd be able to fetch main and mass-rebase later when it's convenient, decoupling my foo workstream from every other.

Body:
AFAIK the only git command to manipulate upstream tracking branches is git fetch (and other commands that trigger a fetch), but they only really allow a "fast forward" operation against the remote branch.

I would like to have more control and be able to "reset" it like any other local branch, without affecting remote. I think one way is to modify the file at .git/refs/remotes/origin/<branchname> to point to a different SHA, but is that correct/safe?

Why: to decouple multiple ongoing branches/workstreams

Let's say I've got:

* (HEAD -> kache/foo, origin/kache/foo) done, ready to push
| * (kache/bar) almost done, commits are atomic
|/
| * (kache/baz) still wip, commits are a mess
|/
* (main, origin/main)

I discover that foo needs a fresh main (for w/e reason), so I fetch origin/main, rebase foo on top, and then get it merged.

But now, main is far behind origin/main. Before I context switch, getting back a "clean slate" means forwarding main to origin/main and rebasing all branches on top. Should rebase conflicts arise, bar will be easy to fix, but baz won't.

I generally have many local dev branches and working on a single one (foo) has caused a workflow interruption on every other branch. In addition, the more "wip" like baz there are, the worse the mass-rebase overhead will be.

I've already tried/got various "rebasing a tree" solutions. I'll keep trying, but solving the general-case means being resilient against (multiple) rebase conflicts, being abort-able (atomic), retryable (recorded resolutions), etc, and AFAIK a general-case turnkey solution doesn't exist.

In this situation, I'd like to just reset origin/main back to main. Once foo is merged, I can delete my local foo, reset my origin/main, and immediately context-switch to bar or baz. Unlike a mass-rebase, it would be fast and would always work. I'd be able to fetch main and mass-rebase later when it's convenient, decoupling my foo workstream from every other.


问:
i want add variables into a table whit python, and i get an error in one of these variables
`

```<code>import pymysql
import random
import time
from colorama import Fore, Back, Style, init
well='''
    print("==================================================")
    print("=                                                =")
    print('=                      Darkyxs                   =')
    print('=                    I AM A Man                  =')
    print("=                                                =")
    print("=  Who Live a Stranger Life, are deamon´s        =")
    print("=  Inside my Head.                               =")
    print("=                                                =")
    print("=                                                =")
    print("=                                                =")
    print("=                                                =")
    print("=                                                =")
    print("=                                                =")
    print("=                                                =")
    print("=                                                =")
    print("=                                                =")
    print("=                                                =")
    print("==================================================")
    '''

chose = ('Humano','Elfo', 'Orco')
clases = ('Mago', 'Guerrero', 'Ladron')
player = ()
pas_ = ()

n = 20
s_ = stre = random.randrange(n)
i_ = inte = random.randrange(n)
c_ = cons = random.randrange(n)
h_ = hp = random.randrange(n)
l_ = luck = random.randrange(n)
m_ = mana = random.randrange(n)

class Players:

    def __init__(self):
        self.cnn = pymysql.connect(host='localhost', user='root', password='',database='player')

    def welcome():
        print('Hola')
        time.sleep(1)
        print()
        name = input(f'Como te llamas? ').capitalize()

        print(f'Hola {name}'); print(' Estas entrando al mundo de Darkyxs.')
        time.sleep(1)
        print("Un Mundo de Magia y Oscuridad que hay que salvar.")
        time.sleep(1)
        player = input((f'{name} Como se llamara tu personaje? ')).capitalize()
        time.sleep(1)
        pas_ = input('Elige una Contraseña: ')
        print(f'Bienvenido al Mundo de Darkyxs {player}.')

    welcome()
    def create(self,name, Stre, Inte, Cons, Hp, Luck, Mana,password):

        cur = self.cnn.cursor()
        sql='''INSERT INTO players (name, Stre, Inte, Cons, Hp, Luck, Mana, password)
        VALUES ('{}','{}','{}','{}','{}','{}','{}','{}')'''.format(name, Stre, Inte, Cons, Hp, Luck, Mana, password)
        cur.execute(sql)
        self.cnn.commit()
        cur.close()
        return
    create(player,s_,i_,c_,h_,l_,m_,pas_)
    print('Usuario creado')
`
</code>```

in this function i want to add into the db a variables, but i get an error whit one of these variables, password.

i get in the console this:

Como te llamas? dan
Hola Dan
Estas entrando al mundo de Darkyxs.
Un Mundo de Magia y Oscuridad que hay que salvar.
Dan Como se llamara tu personaje? luffy
Elige una Contraseña: 12345
Bienvenido al Mundo de Darkyxs Luffy.
Traceback (most recent call last):
File "i:\code\game\darkxys\main.py", line 39, in <module>
class Players:
File "i:\code\game\darkxys\main.py", line 70, in Players
create(player,s_,i_,c_,h_,l_,m_,pas_)

`TypeError: Players.create() missing 1 required positional argument: 'password'

i try to fix the proble changing the position of the variable and taking it out of the function.

```<code>import pymysql
import random
import time
from colorama import Fore, Back, Style, init

chose = ('Humano','Elfo', 'Orco')
clases = ('Mago', 'Guerrero', 'Ladron')

player = ()
   #Variables

init(autoreset=True)
print(Fore.RED + "==================================================")
print("=                                                =")
print('=                      Darkyxs                   =')
print('=                    I AM A Man                  =')
print("=                                                =")
print("=  Who Live a Stranger Life, are deamon´s        =")
print("=  Inside my Head.                               =")
print("=                                                =")
print("=                                                =")
print("=                                                =")
print("=                                                =")
print("=                                                =")
print("=                                                =")
print("=                                                =")
print("=                                                =")
print("=                                                =")
print("=                                                =")
print(Fore.RED + "==================================================")
time.sleep(1)
print('Como te llamas?')

name = input()

print(f'Hola {Fore.RED + name.capitalize()}'); print(Fore.RESET +' Estas entrando al mundo de Darkyxs.')
time.sleep(1)
print("Un Mundo de Magia y Oscuridad que hay que salvar.")
time.sleep(1)
print("¿Que Raza Quieres Ser?")
time.sleep(1)

print("=========================")
print("=      Razas            =")
print("=                       =")
print(f"=  1.  Humano          =")
print(f"=  2.  Elfo            =")
print(f"=  3.  Orco            =")
print("=========================")

#Eligiendo Razas #Función para que repita en caso de que sea invalido

def raza(razas = input().capitalize()):

    while True:

      if razas in chose:

        print(f'Has Elegido {razas}')
        break

      try:
        razas = input('Elige una Raza de la lista ').capitalize()
      except:
        print('Elige una Raza de la lista ')
raza()
time.sleep(1)
#Eligiendo Clase

print("Elige una Clase:" )

print("=========================")
print("=      Clases           =")
print("=                       =")
print(f"=  1.  Mago            =")
print(f"=  2.  Guerrero        =")
print(f"=  3.  Ladron          =")
print("=========================")

def clase_(clase = input().capitalize()):

  while True:

    if clase in clases:

      print(f'Has Elegido {clase}')
      break
    try:
      clase = input('Elige una Clase de la lista ').capitalize()

    except:
     print('Elige una Clase de la lista ')

clase_()
time.sleep(1)

print(f'{name.capitalize()} Como se llamara tu personaje?')

player = input()
time.sleep(1)

print(f'Bienvenido al Mundo de Darkyxs {player.capitalize()}.')

pas_ = password = input('Elige una Contraseña: ')

print('Usuario creado')

n = 20
s_ = stre = random.randrange(n)
i_ = inte = random.randrange(n)
c_ = cons = random.randrange(n)
h_ = hp = random.randrange(n)
l_ = luck = random.randrange(n)
m_ = mana = random.randrange(n)

print("====================================")
print("=      Puntos Habilidad            =")
print("=                                  =")
print(f"=  Str =     {stre}                     =")
print(f"=  Int =     {inte}                    =")
print(f"=  Cons =    {cons}                    =")
print(f"=  HP =      {hp}                    =")
print(f"=  Luck =    {luck}                     =")
print(f"=  Mana =    {mana}                     =")
print("====================================")

con=pymysql.connect(host='localhost', user='root', password='',database='player')
print(con)

def insert_players(name, Stre, Inte, Cons, Hp, Luck, Mana, password):
  cur = con.cursor()
  sql="INSERT INTO players (name, Stre, Inte, Cons, Hp, Luck, Mana, password) VALUES ('{}','{}','{}','{}','{}','{}','{}','{}')".format(name, Stre, Inte, Cons, Hp, Luck, Mana, password)
  cur.execute(sql)
  n=cur.rowcount
  con.commit()
  cur.close()
  return n
print(insert_players(player,s_,i_,c_,h_,l_,m_,pas_))

</code>```

i expect add a variable password into the database, but i get an error whit these variable i dont know why i try whitout functions and it work fine

Body:
`

import pymysql
import random
import time
from colorama import Fore, Back, Style, init
well='''
    print("==================================================")
    print("=                                                =")
    print('=                      Darkyxs                   =')
    print('=                    I AM A Man                  =')
    print("=                                                =")
    print("=  Who Live a Stranger Life, are deamon´s        =")
    print("=  Inside my Head.                               =")
    print("=                                                =")
    print("=                                                =")
    print("=                                                =")
    print("=                                                =")
    print("=                                                =")
    print("=                                                =")
    print("=                                                =")
    print("=                                                =")
    print("=                                                =")
    print("=                                                =")
    print("==================================================")
    '''

chose = ('Humano','Elfo', 'Orco')
clases = ('Mago', 'Guerrero', 'Ladron')
player = ()
pas_ = ()

n = 20
s_ = stre = random.randrange(n)
i_ = inte = random.randrange(n)
c_ = cons = random.randrange(n)
h_ = hp = random.randrange(n)
l_ = luck = random.randrange(n)
m_ = mana = random.randrange(n)

class Players:

    def __init__(self):
        self.cnn = pymysql.connect(host='localhost', user='root', password='',database='player')

    def welcome():
        print('Hola')
        time.sleep(1)
        print()
        name = input(f'Como te llamas? ').capitalize()

        print(f'Hola {name}'); print(' Estas entrando al mundo de Darkyxs.')
        time.sleep(1)
        print("Un Mundo de Magia y Oscuridad que hay que salvar.")
        time.sleep(1)
        player = input((f'{name} Como se llamara tu personaje? ')).capitalize()
        time.sleep(1)
        pas_ = input('Elige una Contraseña: ')
        print(f'Bienvenido al Mundo de Darkyxs {player}.')

    welcome()
    def create(self,name, Stre, Inte, Cons, Hp, Luck, Mana,password):

        cur = self.cnn.cursor()
        sql='''INSERT INTO players (name, Stre, Inte, Cons, Hp, Luck, Mana, password)
        VALUES ('{}','{}','{}','{}','{}','{}','{}','{}')'''.format(name, Stre, Inte, Cons, Hp, Luck, Mana, password)
        cur.execute(sql)
        self.cnn.commit()
        cur.close()
        return
    create(player,s_,i_,c_,h_,l_,m_,pas_)
    print('Usuario creado')
`

in this function i want to add into the db a variables, but i get an error whit one of these variables, password.

i get in the console this:

Como te llamas? dan
Hola Dan
Estas entrando al mundo de Darkyxs.
Un Mundo de Magia y Oscuridad que hay que salvar.
Dan Como se llamara tu personaje? luffy
Elige una Contraseña: 12345
Bienvenido al Mundo de Darkyxs Luffy.
Traceback (most recent call last):
File "i:\code\game\darkxys\main.py", line 39, in <module>
class Players:
File "i:\code\game\darkxys\main.py", line 70, in Players
create(player,s_,i_,c_,h_,l_,m_,pas_)

`TypeError: Players.create() missing 1 required positional argument: 'password'

i try to fix the proble changing the position of the variable and taking it out of the function.

import pymysql
import random
import time
from colorama import Fore, Back, Style, init

chose = ('Humano','Elfo', 'Orco')
clases = ('Mago', 'Guerrero', 'Ladron')

player = ()
   #Variables

init(autoreset=True)
print(Fore.RED + "==================================================")
print("=                                                =")
print('=                      Darkyxs                   =')
print('=                    I AM A Man                  =')
print("=                                                =")
print("=  Who Live a Stranger Life, are deamon´s        =")
print("=  Inside my Head.                               =")
print("=                                                =")
print("=                                                =")
print("=                                                =")
print("=                                                =")
print("=                                                =")
print("=                                                =")
print("=                                                =")
print("=                                                =")
print("=                                                =")
print("=                                                =")
print(Fore.RED + "==================================================")
time.sleep(1)
print('Como te llamas?')

name = input()

print(f'Hola {Fore.RED + name.capitalize()}'); print(Fore.RESET +' Estas entrando al mundo de Darkyxs.')
time.sleep(1)
print("Un Mundo de Magia y Oscuridad que hay que salvar.")
time.sleep(1)
print("¿Que Raza Quieres Ser?")
time.sleep(1)

print("=========================")
print("=      Razas            =")
print("=                       =")
print(f"=  1.  Humano          =")
print(f"=  2.  Elfo            =")
print(f"=  3.  Orco            =")
print("=========================")

#Eligiendo Razas #Función para que repita en caso de que sea invalido

def raza(razas = input().capitalize()):

    while True:

      if razas in chose:

        print(f'Has Elegido {razas}')
        break

      try:
        razas = input('Elige una Raza de la lista ').capitalize()
      except:
        print('Elige una Raza de la lista ')
raza()
time.sleep(1)
#Eligiendo Clase

print("Elige una Clase:" )

print("=========================")
print("=      Clases           =")
print("=                       =")
print(f"=  1.  Mago            =")
print(f"=  2.  Guerrero        =")
print(f"=  3.  Ladron          =")
print("=========================")

def clase_(clase = input().capitalize()):

  while True:

    if clase in clases:

      print(f'Has Elegido {clase}')
      break
    try:
      clase = input('Elige una Clase de la lista ').capitalize()

    except:
     print('Elige una Clase de la lista ')

clase_()
time.sleep(1)

print(f'{name.capitalize()} Como se llamara tu personaje?')

player = input()
time.sleep(1)

print(f'Bienvenido al Mundo de Darkyxs {player.capitalize()}.')

pas_ = password = input('Elige una Contraseña: ')

print('Usuario creado')

n = 20
s_ = stre = random.randrange(n)
i_ = inte = random.randrange(n)
c_ = cons = random.randrange(n)
h_ = hp = random.randrange(n)
l_ = luck = random.randrange(n)
m_ = mana = random.randrange(n)

print("====================================")
print("=      Puntos Habilidad            =")
print("=                                  =")
print(f"=  Str =     {stre}                     =")
print(f"=  Int =     {inte}                    =")
print(f"=  Cons =    {cons}                    =")
print(f"=  HP =      {hp}                    =")
print(f"=  Luck =    {luck}                     =")
print(f"=  Mana =    {mana}                     =")
print("====================================")

con=pymysql.connect(host='localhost', user='root', password='',database='player')
print(con)

def insert_players(name, Stre, Inte, Cons, Hp, Luck, Mana, password):
  cur = con.cursor()
  sql="INSERT INTO players (name, Stre, Inte, Cons, Hp, Luck, Mana, password) VALUES ('{}','{}','{}','{}','{}','{}','{}','{}')".format(name, Stre, Inte, Cons, Hp, Luck, Mana, password)
  cur.execute(sql)
  n=cur.rowcount
  con.commit()
  cur.close()
  return n
print(insert_players(player,s_,i_,c_,h_,l_,m_,pas_))

i expect add a variable password into the database, but i get an error whit these variable i dont know why i try whitout functions and it work fine


问:
How to use Flag and Pickle in python to continue a program
I'm trying to learn about using flags in python, and the specific case I'm trying to learn about is continuing a program via a flag like -continue.

I'm using the pickle module, and want to be able to continue a program after a loop hits 10, and again after it hits 30. This is what I have tried:

```<code>start = 0
try:
    with open("state.txt", "rb") as fp:
        state = pickle.load(fp)

    if int(state) > 0:
        start = int(state) + 1
except:
    pass
for i in range(start, 100):

    print(i)
    if i == 10 or i == 30:
        with open("state.txt", "wb") as fp:
            pickle.dump(i,fp)
            break
</code>```

The file name is myLoop.py, and I run it using python3 myLoop.py, and I continue it using python3 myLoop.py. Instead, I would like to continue it using python3 -continue myLoop.py or something similar. How can I implement this?

Body:
I'm trying to learn about using flags in python, and the specific case I'm trying to learn about is continuing a program via a flag like -continue.

I'm using the pickle module, and want to be able to continue a program after a loop hits 10, and again after it hits 30. This is what I have tried:

start = 0
try:
    with open("state.txt", "rb") as fp:
        state = pickle.load(fp)

    if int(state) > 0:
        start = int(state) + 1
except:
    pass
for i in range(start, 100):

    print(i)
    if i == 10 or i == 30:
        with open("state.txt", "wb") as fp:
            pickle.dump(i,fp)
            break

The file name is myLoop.py, and I run it using python3 myLoop.py, and I continue it using python3 myLoop.py. Instead, I would like to continue it using python3 -continue myLoop.py or something similar. How can I implement this?


问:
Is it advisable to use locks in multithreaded real-time code when they are contained within a class?
In the situation where you have a high priority real-time data processing thread reading from a parameter and a second thread with lower priority writing to the parameter (or vice versa) you can end up with a data race.

One solution would be to let the parameter be an std::atomic or to protect the reading/writing of the parameter with mutexes. According to this talk  it's best to avoid non-lock free atomics and mutexes to solve such a data race for the following reasons:

The real-time thread will occasionally have to wait to acquire the lock. The execution time of the real-time code, which has to meet a deadline, will suddenly have to take into account any code that can be executed inside the lock protected section of the low priority thread.

If the code inside the lock protected section in the low priority thread contains e.g. memory allocations/deallocation, system calls, or other calls with unbounded execution time the real-time thread can no longer guarantee that it's able meet it's deadline.

The low priority thread can be interrupted by threads which have a higher priority but a priority still below that of the real-time thread, leading to priority inversion.

If one can disregard the last point due to an OS with priority inheritance, is it still advisable to avoid locking even if all lock protected sections are contained inside the same class such as in this example:

```<code>#include <mutex>

class RealTimeProcessor
{

     public:

        struct Parameter
        {
           // some non atomic data
        };

        void processData()
        {
           Parameter p;

           mtx.lock();
           p = m_param;
           mtx.unlock();

           // do some processing with the local copy of the parameter...
        }

        void setParameter(Parameter param)
        {
           mtx.lock();
           m_param = param;
           mtx.unlock();
        }

     private:

        Parameter m_param;
        std::mutex mtx;
};
</code>```

Where processData() is called from the real-time thread and setParameter() is called from the low priority thread.

My thought is that since all locking is done within the class, I can make sure that no calls with unbounded execution time are made within the lock protected areas, and that the total worst case completion time of the real-time processing still meets the deadline even in the worst case when having to wait to acquire the lock.

Body:
In the situation where you have a high priority real-time data processing thread reading from a parameter and a second thread with lower priority writing to the parameter (or vice versa) you can end up with a data race.

One solution would be to let the parameter be an std::atomic or to protect the reading/writing of the parameter with mutexes. According to this talk  it's best to avoid non-lock free atomics and mutexes to solve such a data race for the following reasons:

The real-time thread will occasionally have to wait to acquire the lock. The execution time of the real-time code, which has to meet a deadline, will suddenly have to take into account any code that can be executed inside the lock protected section of the low priority thread.

If the code inside the lock protected section in the low priority thread contains e.g. memory allocations/deallocation, system calls, or other calls with unbounded execution time the real-time thread can no longer guarantee that it's able meet it's deadline.

The low priority thread can be interrupted by threads which have a higher priority but a priority still below that of the real-time thread, leading to priority inversion.

If one can disregard the last point due to an OS with priority inheritance, is it still advisable to avoid locking even if all lock protected sections are contained inside the same class such as in this example:

#include <mutex>

class RealTimeProcessor
{

     public:

        struct Parameter
        {
           // some non atomic data
        };

        void processData()
        {
           Parameter p;

           mtx.lock();
           p = m_param;
           mtx.unlock();

           // do some processing with the local copy of the parameter...
        }

        void setParameter(Parameter param)
        {
           mtx.lock();
           m_param = param;
           mtx.unlock();
        }

     private:

        Parameter m_param;
        std::mutex mtx;
};

Where processData() is called from the real-time thread and setParameter() is called from the low priority thread.

My thought is that since all locking is done within the class, I can make sure that no calls with unbounded execution time are made within the lock protected areas, and that the total worst case completion time of the real-time processing still meets the deadline even in the worst case when having to wait to acquire the lock.


问:
how to enable sidebar of Yoast SEO in WordPress
I am creating a post but I can't see the sidebar of Yoast SEO.

I know that if you cannot see the sidebar, click on the Yoast icon in the upper right corner, and the sidebar will appear. But i haven't this icon.

However, I have Yoast Seo enabled and in fact I can see the Yoast SEO meta box below the post.

I have the Divi theme, perhaps it helps to know.

How can I enable the sidebar of Yoast SEO?

Thanks


问:
How to add suporte for android TV using react native EXPO in Google Play Store
I'm using Expo, so I can't / don't know how to change the settings on Android Manifest to make it compatible with Android TV. My app runs fine on Android TV emulator and on APK install in a real device. The problem is with Google Play Store it does not recognize it as compatible with android TV so I can download from the device store.

I tried adding this code to app.json inside "android" but it didn't change anything.

```<code>"intentFilters": [
    {
      "action": "MAIN",
      "category": ["LEANBACK_LAUNCHER"]
    }
  ]
</code>```

You can see how it looks on google play store bellow. It is not in English, but the last column translation is State of segmentation: Not joined

Here on a print of the device page:

Body:
I'm using Expo, so I can't / don't know how to change the settings on Android Manifest to make it compatible with Android TV. My app runs fine on Android TV emulator and on APK install in a real device. The problem is with Google Play Store it does not recognize it as compatible with android TV so I can download from the device store.

I tried adding this code to app.json inside "android" but it didn't change anything.

"intentFilters": [
    {
      "action": "MAIN",
      "category": ["LEANBACK_LAUNCHER"]
    }
  ]

You can see how it looks on google play store bellow. It is not in English, but the last column translation is State of segmentation: Not joined

Here on a print of the device page:


问:
Excel search is duplicating found values
I am trying to create a winform that will search an Excel sheet to find matching text values. When the value is found, I need to continue searching for any more values that are the same. After, the results are placed in a ListView.

Currently, my program is finding all matching values in each row, but it is finding the same row several times before moving onto the next.

Any help would be appreciated.

This is a snippet of the search code:

```<code>var app = new Microsoft.Office.Interop.Excel.Application();
var workbook = app.Workbooks.Open(@"//FilePath//");
var sheet = workbook.Worksheets["sheet1"];
Microsoft.Office.Interop.Excel.Range currentFind = null;
Microsoft.Office.Interop.Excel.Range firstFind = null;
object missing = System.Reflection.Missing.Value;
var range = (Microsoft.Office.Interop.Excel.Range)sheet.Columns["A:F"];
currentFind = range.Find(All, missing, Microsoft.Office.Interop.Excel.XlFindLookIn.xlValues,
                         Microsoft.Office.Interop.Excel.XlLookAt.xlPart,    Microsoft.Office.Interop.Excel.XlSearchOrder.xlByRows,
                         Microsoft.Office.Interop.Excel.XlSearchDirection.xlNext, false, missing, missing);
var address = currentFind.Address;

while (currentFind != null)
{
    if (firstFind == null)
    {
        firstFind = currentFind;
    }
    else if (currentFind.Address[Microsoft.Office.Interop.Excel.XlReferenceStyle.xlA1] ==
             firstFind.Address[Microsoft.Office.Interop.Excel.XlReferenceStyle.xlA1])
    {
        break;
    }
    var row = currentFind.EntireRow;
    object[,] rowvalues = row.Value2;
    var column = currentFind.EntireColumn;
    object[,] colvalues = column.Value2;

    string[] arr = new string[6];
    ListViewItem itm;
    arr[0] = Convert.ToString(rowvalues[1, 1]);
    arr[1] = Convert.ToString(rowvalues[1, 2]);
    arr[2] = Convert.ToString(rowvalues[1, 3]);
    arr[3] = Convert.ToString(rowvalues[1, 4]);
    arr[4] = Convert.ToString(rowvalues[1, 5]);
    arr[5] = Convert.ToString(rowvalues[1, 6]);
    itm = new ListViewItem(arr);
    listView1.Items.Add(itm);

    currentFind = range.FindNext(currentFind);
}
</code>```

Body:
I am trying to create a winform that will search an Excel sheet to find matching text values. When the value is found, I need to continue searching for any more values that are the same. After, the results are placed in a ListView.

Currently, my program is finding all matching values in each row, but it is finding the same row several times before moving onto the next.

Any help would be appreciated.

This is a snippet of the search code:

var app = new Microsoft.Office.Interop.Excel.Application();
var workbook = app.Workbooks.Open(@"//FilePath//");
var sheet = workbook.Worksheets["sheet1"];
Microsoft.Office.Interop.Excel.Range currentFind = null;
Microsoft.Office.Interop.Excel.Range firstFind = null;
object missing = System.Reflection.Missing.Value;
var range = (Microsoft.Office.Interop.Excel.Range)sheet.Columns["A:F"];
currentFind = range.Find(All, missing, Microsoft.Office.Interop.Excel.XlFindLookIn.xlValues,
                         Microsoft.Office.Interop.Excel.XlLookAt.xlPart,    Microsoft.Office.Interop.Excel.XlSearchOrder.xlByRows,
                         Microsoft.Office.Interop.Excel.XlSearchDirection.xlNext, false, missing, missing);
var address = currentFind.Address;

while (currentFind != null)
{
    if (firstFind == null)
    {
        firstFind = currentFind;
    }
    else if (currentFind.Address[Microsoft.Office.Interop.Excel.XlReferenceStyle.xlA1] ==
             firstFind.Address[Microsoft.Office.Interop.Excel.XlReferenceStyle.xlA1])
    {
        break;
    }
    var row = currentFind.EntireRow;
    object[,] rowvalues = row.Value2;
    var column = currentFind.EntireColumn;
    object[,] colvalues = column.Value2;

    string[] arr = new string[6];
    ListViewItem itm;
    arr[0] = Convert.ToString(rowvalues[1, 1]);
    arr[1] = Convert.ToString(rowvalues[1, 2]);
    arr[2] = Convert.ToString(rowvalues[1, 3]);
    arr[3] = Convert.ToString(rowvalues[1, 4]);
    arr[4] = Convert.ToString(rowvalues[1, 5]);
    arr[5] = Convert.ToString(rowvalues[1, 6]);
    itm = new ListViewItem(arr);
    listView1.Items.Add(itm);

    currentFind = range.FindNext(currentFind);
}


问:
Try Sort Table JS
Here is code, I want to order by default by item order alpha asc.

I try

```<code>        <script src="../js/sorttable.js"></script>
        <script src="../js/sort-table.js"></script>
    <script src="../js/table-sort.js"></script>
</code>```

order a list in js , try some scripts but no one works

```<code><table class="table_sales table-starpos-responsive" id="tab">
                <thead class="thead_sales">
                    <tr>
                        <th class="normal"><bean:message  key="item" /></th>
                        <th class="normal"><bean:message  key="price" /></th>
                        <th class="normal"></th>
                        <th></th>
                    </tr>
                </thead>
                <tbody class="tbody-sales">
                    <% boolean rowodd = false; %>

                    <c:forEach var="product" items="${products}" varStatus="nr">
                        <% rowodd = !rowodd; %>
                        <tr class="<%= rowodd ? "odd" : "even" %>">
                            <div id="pro${nr.count - 1}">
                            <td class="name">${product.name}</td>
                            <td class="normal"><fmt:formatNumber type="currency" value="${product.priceSellTax}" maxFractionDigits="2" minFractionDigits="2"/></td>
                            <td class="normal"></td>
                            <td><input value=<bean:message key="button.add" /> type="submit" class="btn btn-starpos btn-place floor" onclick="ajaxAddProduct('<%=request.getSession().getAttribute("place")%>', '${product.name}', '${product.id}');"/></td>
                            </div>
                        </tr>
                        <tr>
                            <td colspan="4"><div id="aux${nr.count - 1}"></div></td>
                        </tr>
                    </c:forEach>
                </tbody>
            </table>

</code>```

Title: Try Sort Table JS

Body:
Here is code, I want to order by default by item order alpha asc.

I try

order a list in js , try some scripts but no one works

                        <bean:message  key="item" />
                        <bean:message  key="price" />

                    <% boolean rowodd = false; %>

                    <c:forEach var="product" items="${products}" varStatus="nr">
                        <% rowodd = !rowodd; %>
                        <tr class="<%= rowodd ? "odd" : "even" %>">

                            ${product.name}
                            <fmt:formatNumber type="currency" value="${product.priceSellTax}" maxFractionDigits="2" minFractionDigits="2"/>

                            <input value=<bean:message key="button.add" /> type="submit" class="btn btn-starpos btn-place floor" onclick="ajaxAddProduct('<%=request.getSession().getAttribute("place")%>', '${product.name}', '${product.id}');"/>

                    </c:forEach>