Google Sheets – How do I apply two conditional formatting rules to a single cell?

I have two sets of rules … one color encodes the population of cells based on a visual grouping condition (7 rules for 7 groups); The other color identifies the text of cells based on another condition for a warning status.

I set the text color for the fill rule to None and the text rule to None. However, it appears that the default colors are applied by the rule with higher priority and the color with lower priority is ignored.

Is it possible to layer rules on multiple conditions to achieve this effect without having to enumerate an absurd set (x * y) of rule combinations?

sharepoint online – How can JSON column formatting be used to highlight duplicate entries in a list?

Column formatting is used in SharePoint Online to customize the display of fields in lists. Microsoft provides documentation for using JSON for column formatting.

As described in the documentation, this works well for basic things like adding a class depending on the name of the current one field, For example:

  "attributes": {
    "class": "=if(@currentField == 'Done', 'sp-field-severity--good', if(@currentField == 'In progress', 'sp-field-severity--low', if(@currentField == 'In review', 'sp-field-severity--warning', if(@currentField == 'Has issues', 'sp-field-severity--severeWarning', 'sp-field-severity--blocked')))) + ' ms-fontColor-neutralSecondary'"
  },

The end result is:

Column formatting about the status of a column

However, there is a way to check values ​​in the stream pillar and apply a class or color to duplicate entries in this column?

How do I create a custom shortcut in Google Docs to implement custom formatting?

When I take notes for CS classes, I find that I am constantly changing the selection and weighting of the font to distinguish lines of code from normal notes. For example:

formatting example

To improve productivity, I'd like to be able to highlight a text block and apply a keyboard shortcut to change the font of that text block only.

I found an incomplete workaround. I can select by changing the default font for Heading 1 to the desired formatting ctrl+alt+1 to change the selected line to my desired format. However, with this method, I can not change individual words or phrases in a row without changing the entire row.

Is there a way to create a keyboard shortcut to convert the highlighted text to a custom font (in my case Courier New, bold, size 11)?

Formatting – Format the Filling Multiplication Table in Python

I'm supposed to create a multiplication table that uses two for loops, and I can use the following method to print the function out of automatically starting a new line:

print("text", end="")
print("more text")

I have to print the numbers in the width of four, which I think I have already done
When I upload the exercise, however, I get the result: 19! = 10

This is my code

def main():


    for l in range(1,11):
        for t in range(1,11):
            print('{0:4}'.format(l*t),end="")

        print("n")


if __name__ == "__main__":
    main()

json formatting – color based on the value in the SharePont online to-do list (app added)

If you're using SharePoint through my company's 365 account and need a clean parent-child relationship list, the subtasks in the To-Do List app will immediately fit in, but now I feel like my hands are tied. I tried to apply JSON formatting to one column, as I did in another list, and it just does not work. An attempt was made to display a colored background for a row / column / dot to display the status. I had to add it via list settings, not column formatting, when I click on the heading of the column. Is that possible?

javascript – Formatting – Add custom custom component validation to my current Forms form

I have a form with some text input and some custom components. I have enabled formatter validation for text input, but not for the custom components. I am now trying to add to my habit of form-checking categoriesMultiselect Component. This component stores its data in the Redux memory. I took care of the validation myself and added value to my Redux props:

const mapStateToProps = (
  state: RecordOf,
  ownProps: { rerenderKey: boolean }
) => ({...
    isCategoriesValid: selectIsCategoriesValid(state),
...
})

, I just want to plug in props.isCategoriesValid in my form of form.

After reading the official documentation, I think I do that by adding validate={validateCategories} as a prop for the custom component and adding the function validateCategories to the component. So I tried it that way:

//above React render()
      validateCategories = () => {
        let error
        if (!this.props.selectIsCategoriesValid) {
          error = 'please select a category'
        }
        console.log(error)
        return error
      }

// Inside React render()
          

validateCategories never gets run. That's why I tested it by adding it validateField to one of my inputs onChange Function:

       validateField('categories')}
        deleteText={setFieldValue}
      />

When it tries to validate the field, I get a console error:

The property & # 39; validate & # 39; from undefined can not be read

In this line of code in form:

  var validateField = useEventCallback(function (name) {
if (isFunction(fieldRegistry.current(name).validate)) {

At least I have plugged Formik into my Redux because I at least successfully trigger a Redux action when submitting the form. What am I doing wrong?

Code:

//@flow

import * as Yup from 'yup'
import { Formik, withFormik } from 'formik'
import { Container } from 'native-base'
import * as React from 'react'
import { ScrollView, View, Alert, Button } from 'react-native'
import { connect } from 'react-redux'
import { Category as CategoryEnums } from 'src/enums'
import type { VepoState } from 'src/components/model'
import type { RecordOf } from 'immutable'
import type { Product } from 'src/model'
import VepoHeader from 'src/components/formControls/header/view'
import { selectIsAddFormValid } from './selector'
import { selectProduct } from './selector'
// import { Button } from 'src/components/formControls'
import { ImagePicker } from 'src/components/formControls'
import LocationAutocomplete from 'src/components/formControls/locationAutocomplete/view'
import { uploadAddProduct, updateRerenderKey } from './action'
import { viewStyle } from './style'
import type { Dispatch } from 'redux'
import { updateAddProductImage } from './action'
import type { Place } from 'src/model/location'
import { Colors, Spacing } from 'src/styles'
import { Input } from 'src/components/formControls'
import { onPress } from './controller'
import { CategoriesMultiselect } from 'src/components/formControls'
import {
  selectIsGrocerySelected,
  selectIsCategoriesValid,
  isLocationValid
} from 'src/components/product/add/groceryItem/selector'

const mapStateToProps = (
  state: RecordOf,
  ownProps: { rerenderKey: boolean }
) => ({
  locationListDisplayed: state.formControls.root.locationListDisplayed,
  isAddFormValid: selectIsAddFormValid(state),
  // $FlowFixMe
  product: selectProduct(state),
  // $FlowFixMe
  isGrocerySelected: selectIsGrocerySelected(state),
  // $FlowFixMe
  categories: state.formControls.categories,
  isCategoriesValid: selectIsCategoriesValid(state),
  image: state.product.add.image,
  rerenderKey: ownProps.rerenderKey,
  location: state.formControls.location,
  isLocationValid: isLocationValid(state)
})

// eslint-disable-next-line flowtype/no-weak-types
const mapDispatchToProps = (dispatch: Dispatch<*>): Object => ({
  updateAddProductImage: (value): void => {
    dispatch(updateAddProductImage({ value }))
  },
  uploadAddProduct: (product: Product): void => {
    dispatch(uploadAddProduct(product))
  },
  updateRerenderKey: () => {
    dispatch(updateRerenderKey())
  }
})

export const getLocationIsValid = (place: Place): boolean => {
  return Object.keys(place).length > 0 ? true : false
}
type AddGroceryStoreState = {
  name: string,
  brand: string,
  description: string,
  price?: number
}

class AddGroceryItemView extends React.Component {
  validateCategories = () => {
    let error
    if (!this.props.selectIsCategoriesValid) {
      error = 'please select a category'
    }
    console.log(error)
    return error
  }
  render() {
    const {
      values,
      handleSubmit,
      setFieldValue,
      errors,
      touched,
      setFieldTouched,
      isValid,
      isSubmitting,
      validateField
    } = this.props
    return (
      
        
        
          
            
              
            
            
              
              
               validateField('categories')}
                deleteText={setFieldValue}
              />
              
                
                
                
                  
                
              
            
          
        
        

Re-enable formatting in Visual Studio 2017

The way VS2017 automatically formats C ++, especially when pasting, drove me insane, so I disabled some of them, d. H., While I changed several options in the options. But now it does not format anything.

I tried to re-enable all the options that appeared to be in the context of remote access (ie within text editor C ++), but so far nothing worked. Tried to also enable / disable ClangFormat. Alt + F8 still works.

(By the way, I work most of the time with VS as an administrator, although this is not a perfect solution to copy the binaries into the app folder, but it's very handy for debugging, which could have messed up the settings ??)

How can I reactivate automatic formatting?

Here is a screenshot of my current options:

options screen

python – Fills the list with the excel area and retains its formatting

I've written a Python program that pulls data from Excel spreadsheets and adds that data to new DAT files.
I use win32com.client because the Excel spreadsheets are already open and other modules need to open a file before they can process them.

As the win32com.client Prints the scope as a Component Object Model and modifies the content in a minor, but destructive way. Numbers like 2, are issued as 2.0, In addition, empty cells are output as None,
Because of this, I can not immediately insert the values ​​of the cells into a file. Instead, I use a loop to populate a list where I edit the data.

However, this loop is relatively slow. I would like a faster method, but I'm not sure how to do it.

def convertdata(r, l):
    newr = ()
    for c in r:
        # Some codes start with leading zeroes and need to be left as-is
        # The try...except clause would convert this code into integers, stripping
        # the leading zeroes. str(c) == '0.0' makes sure single 0 values do get
        # processed.
        if str(c) == '0.0' or not str(c)(:1) == '0':
            try:
                float(str(c))
                newr.append(str(int(c)))
            except ValueError:
                if str(c) == 'None':
                    newr.append('')
                else:
                    newr.append(str(c))
        else:
            newr.append(str(c))
        if c.Column == l and not c.Row - 1 == r.Rows.Count:
            newr.append('n')
        else:
            newr.append('t')
    return newr

# ... Code omitted

rng = sht.Range(sht.Cells(2, 1), sht.Cells(lrow, lcol))
newrng = convertdata(rng, lcol)
dataf = ''.join(newrng)

with open(fpath, "w") as newfile:
    newfile.write(dataf)

lrow and lcol are integers. fpath is a string for the new file

entry example
Enter image description here
output example (not the same data as the input, but you get the gist of it)

I   08.5070     Plate assembly  Plate assembly  5   5070    VIRTUAL 1   1   1               0       
I   0070_01.01      Plate D10 (SA)  Plate D10 (SA)  08.58070    101 VIRTUAL 1   1   1               0       
I   001170      Support Support 6   1170    VIRTUAL 1   1   1               0       
I   0010.1170_01.01     conveyor (SA)   conveyor (SA)   0090.1170   101 VIRTUAL

Formatting – How to change bullet indentation in Google Slides Master

I've created a bulleted list in a Google slide that inherits the indent specified in the master slide. I can pick the Level 1 bullets and manually change their indent to make the layout more compact. Is there a way to apply the new indents to the master slide so that they automatically apply to all newly created slides? I tried to make the same changes to the master slide, but all indent controls are greyed out in the Format sidebar.

PHP – Help formatting date from the database

I finish a data filtering system that comes from the database with BETWEEN. My difficulty is to find the field & # 39; Date & # 39; to format it to filter the timestamp for my code:

$where =  "date BETWEEN $start_timestamp AND $end_timestamp";
$this->db->where($where);
$plannings = $this->db->get_where('plannings', array('teacher_id' => 
$teacher_id, 'status' => '1'))->result_array();
foreach ($plannings as $row)

The variables $ start_timestamp and $ start_timestamp are already in the time stamp format. I tried the following and got the following result:

$where =  "strtotime(date) BETWEEN $start_timestamp AND $end_timestamp";

Result:

Enter image description here