list – CSS code to adjust the width of columns by using a static name instead of the display name

I'm currently using this code to adjust the width of specific columns by referencing the display name:

English version:

.ms-vh-div(DisplayName = "Recent History")
 {
 width:300px
}

However, I have encountered a problem where column headers with accents (that is, French versions) are not recognized.

French version:

.ms-vh-div(DisplayName = "Histoire récente")
 {
 width:300px
}

As a result, I would like to use the static name of the column instead of the display name because all my columns were created in English for the first time and do not have any accents. But I can not execute the code.

.ms-vh-div(StaticName = "Recent_x0020_History")
 {
 width:300px
}

Any ideas on how to improve my code and / or other workarounds for this problem would be greatly appreciated. Thanks in advance!

concatenation – Create a new flat list from a mix of items and parts ranges

I want to edit a list of table rows by adding an extra column. For that I Map the data with a pure function that evokes the new column value of the exisit and rebuilds a new list from this and from the initial Parts from the list:

b = 5000
data = {{1, 45000., 27500., "Inverted"}, 
        {2, 22500., 18333.3, ""}, 
        {3, 15000., 13750., "Inverted"}, 
        {4, 11250., 11000., ""}, 
        {5, 9000., 9166.67, "Inverted"}, 
        {6, 7500., 7857.14, ""}, 
        {7, 6428.57, 6875., "Inverted"}}

{#[[1;;3]], #[[1]]> 2b, #[[4]]} & /@ data
{{{1,45000.,27500.},False,Inverted},
   {{2,22500.,18333.3},False,},
   {{3,15000.,13750.},False,Inverted},
   {{4,11250.,11000.},False,},
   {{5,9000.,9166.67},False,Inverted},
   {{6,7500.,7857.14},False,},
   {{7,6428.57,6875.},False,Inverted}}

The problem is #[[1;;3]] return a list – so I end up with a nested list instead of flat registrations.

To work around this problem, I Flatten each record:

    Flatten[{#[[1;;3]], #[[1]]> 2b, #[[4]]}] & /@ data
{{1,45000.,27500.,False,Inverted},
   {2,22500.,18333.3,False,},
   {3,15000.,13750.,False,Inverted},
   {4,11250.,11000.,False,},
   {5,9000.,9166.67,False,Inverted},
   {6,7500.,7857.14,False,},
   {7,6428.57,6875.,False,Inverted}}
Flatten[{#[[1;;3]], #[[1]]> 2b, #[[4]]}] & /@ data

It works in this particular case Case. But this is not entirely satisfactory because, if the initial registration already contained list items, they would also have been flattened.

Is there a more generic solution for building a list from list items and ranges?

Error 415 (Media Type No.) When creating a new list of items on SP Online using the REST API and POSTMAN

As you can see, I have successfully authenticated to my tenant because I can retrieve the information from the list.

enter the description of the image here

But I just can not create an element. I still get an error 415 "Media Type Supported" regardless of the headers I've tried, for example:

Content-Type: application/json;odata=verbose 
Accept: application/json;odata=verbose 
X-HTTP-Method: POST 
Authorization: Bearer eyJ0eXAiOiJKV1QiL...

Here is the body of the request:

data:{"__metadata":{"type":"SP.Data.OiseNumListItem"},"Operateur":"opérateur","typeEquipement":"Poteau","accesDifficile":"Oui","adresse":"mon adresse","codePostal":"38100","Commune":"Grenoble","natureDeclarant":"Particulier","nomDeclarant":"Julien","emailDeclarant":"julien@gmail.com","Photo1":"blablabla.jpg photo1"}

And the result in POSTMAN

With a GET, the answer is even stranger because I get an OK status with an empty body and nothing added to the list

enter the description of the image here

What's wrong?

THX

PS: I get the same results using PHP and JS

Handling list values ​​in python

I've written a function that I use to preprocess pandas data frames before executing them through a machine learning model. The function works perfectly, but I do not think this is the most pythonic way of writing it.

This function accepts a list of words:
("Here," & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & # 39; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; what, 'the', 'function', 'accept'

    def clean_text(x):

        stopwords_english = stopwords.words('english')

        for i,word in enumerate(x):
            if word.lower() in stopwords_english:
                x(i) = ''
            else:
                for punct in "/-'":
                    x(i) = x(i).replace(punct, ' ')
                for punct in '&':
                    x(i) = x(i).replace(punct, f' {punct} ')
                for punct in '?!.,"#$%'()*+-/:;<=>@(\)^_`{|}~' + '“”’':
                    x(i) = x(i).replace(punct, '')
        return x

Here, I use enumerate to change the value inside the list. I would have supposed that a more pythonic way of doing it would be to write it as follows:

    def clean_text(x):

        stopwords_english = stopwords.words('english')

        for word in x:
            if word.lower() in stopwords_english:
                word = ''
            else:
                for punct in "/-'":
                    word = word.replace(punct, ' ')
                for punct in '&':
                    word = word.replace(punct, f' {punct} ')
                for punct in '?!.,"#$%'()*+-/:;<=>@(\)^_`{|}~' + '“”’':
                    word = word.replace(punct, '')
        return x

Is my current implementation the most pythonic way or is there a better solution?

replace – Extract values ​​from the function / list containing arguments / elements (using templates)

Here is an example of an entry list:

list = {SomeFunction(v1, arg -> "val"), 
  SomeFunction(v2, target -> "targetVal"), 
  SomeFunction(v3, arg -> "val", target -> "targetVal")}

I want to extract the first argument of each function from the list that contains the argument target -> "targetVal". Sample output:

list = {SomeFunction(v1, arg -> "val"), 
  "extractedVal" -> v2, 
  "extractedVal" -> v3}

Here is a naive way to achieve this:

list /. {SomeFunction(x_, target -> "targetVal") -> ("extractedVal" -> x),
  SomeFunction(x_, arg -> "val", target -> "targetVal") -> ("extractedVal" -> x)}

The problem with this approach is that one has to list all the variants of the function with different combinations of arguments, for ReplaceAll (/.) to work. How can I get the desired output by simply providing the condition that the function must contain the required argument (multiple arguments may be required)?

I'm trying to use Mathematica's ability to parse RTF files to extract elements containing certain styles, which are given as "arguments" in StyleBox function / objects. I will extract several items at once.

Temporarily disable alerts in a specific list in SP Online?

During maintenance time, if these alerts have been enabled, then during a bulk download, end users will receive a large number of emails. Therefore, we must disable alerts, not delete them. For this, there is no direct option on the screen, but PowerShell does it.

Import-Module   'C:MilindPRACTICE SOURCE CODESOffice365.ConsolepackagesMicrosoft.SharePointOnline.CSOM.16.1.6420.1200libnet45Microsoft.SharePoint.Client.dll'
Import-Module   'C:MilindPRACTICE SOURCE CODESOffice365.ConsolepackagesMicrosoft.SharePointOnline.CSOM.16.1.6420.1200libnet45Microsoft.SharePoint.Client.Runtime.dll'

 #Mysite URL
 $site = 'https://**********.sharepoint.com/sites/TeamSite/'

 #Admin User Principal Name
 $admin = 'milind@********.OnMicrosoft.Com'

 #Get Password as secure String
 $password = Read-Host 'Enter Password' -AsSecureString

 #Get the Client Context and Bind the Site Collection
 $context = New-Object Microsoft.SharePoint.Client.ClientContext($site)

 #Authenticate
 $credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($admin , $password)
 $context.Credentials = $credentials

 $context.Load($context.Web)
 $context.Load($context.Web.Alerts)

 $context.ExecuteQuery()

 foreach($alert in $context.Web.Alerts)
 {
     if($alert.Status -eq 'On')
     {
 #The below will enable the Alert
 # $alert.Status = 'On' 

 #The below will disable the Alert
         $alert.Status = 'Off'
         $alert.UpdateAlert()
         $context.Load($alert)
         $context.ExecuteQuery()
     }
     Write-Host $alert.Title + "-" + $alert.Status
 }

 Write-Host $context.Web.Alerts.Count

google play store – How to remove from the list of "already installed applications" of the PlayStore the applications already installed on my phone?

How to remove from the list of "already installed applications" of the PlayStore the applications already installed on my phone?

For example, the anyconnect application appears in the list of "already installed applications":

enter the description of the image here

Even if it's already installed on my phone:

enter the description of the image here

I use Android 9 on Samsung Galaxy S9 with PlayStore 17.8.14.

python 3.x – list of matching files in a folder tree – a better way?

I am a former beginner in python here, migrating from fortran77;)
Not sure about python terminology yet 🙁

The python3 script below retrieves a large list of matching files in a folder tree, in the format:

( fully_qualified_folder_name, (list of matching files in this folder) )

Being a beginner in python, there MUST be a better way?

I hope to use the code to generate a nocturnal json file underlying a chromecasting web server on a Raspberry Pi 4, based on the example of Google (Sender) Chrome (web page).
The web page will eventually use client-side javascript for the user to choose a file from a list and cast it from the apache2 web server of the Pi4 to the chromecast device.
So, I thought, why not try Python?

I've noticed that the files are returned unsorted, is there a way to solve this problem without sorting me out?

Suggestions would be appreciated.

Thank you.

import os
import fnmatch
def yield_files_with_extensions(folder_path, file_match):
    for root, dirs, files in os.walk(folder_path):
        for file in files:
            if fnmatch.fnmatch(file.lower(),file_match.lower()):
                #yield os.path.join(root, file)
                yield file
        break  # without this line it traverses the subfolders too
def yield_files_in_subfolders(folder_path, file_match):
    for root, dirs, files in os.walk(folder_path):
        for d in dirs:
            subfolder = os.path.join(root, d)
            mp4_files = (subfolder, (f for f in yield_files_with_extensions(subfolder, file_match)))
            yield mp4_files
#
the_path = r'/mnt/mp4library/mp4library'
# retieve the topmost folder's files
mp4_files1 = (( the_path, (f for f in yield_files_with_extensions(the_path, "*.mp4")) ))
mp4_files2 = (f for f in yield_files_in_subfolders(the_path, "*.mp4"))
mp4_files2 = mp4_files1 + mp4_files2
crecords=0
cfiles=0
for a in mp4_files2:
    crecords=crecords+1
    print ("-----record "+str(crecords)+"---" + a(0) + " ... files=" + str(len(a(1))))
    #print (a(0))
    #print (a(1))
    c=0
    for b in a(1):
        c=c+1
        print ("mp4 File "+str(c)+"---" + b)
    cfiles=cfiles+c
print ('Count of files: ' + str(cfiles))

Since there are .mp4 files, is there a way to determine the size, duration, and resolution of the file?

Make a list from two lists by grouping them in a special way

I have two lists:

{{{x1,x2},{x3,x4}}, {{x5,x6},{x7,x8}}};
{{{x9,x10},{x11,x12}}, {{x13,x14},{x15,x16}}}

I have to join them to get a list:

 {{{x1,x2},{x3,x4},{x9,x10},{x11,x12}}, {{x5,x6},{x7,x8},{x13,x14},{x15,x16}}}

There is a Join [] function that seems to be a good choice for solving this problem, but I can not apply it correctly to get the proper result. What can I do?

sharepoint online – How to access a specific URL base on the choices in the drop-down list and the checkbox

I have this code that when users select a specific value, it will go to that URL. But I only have the HTML part.

For example:

Emergency = high ||
Impact = Site / Department ||
Platform = Unix and Windows

When they click submit, they access a URL database on those choices

It's like High + Site / Dept + Unix & Windows = URL1 …. and so on.

I only have the HTML codes that I found during my research, but I'm not very good at javascript, so I can not find the logic on how to make it work that.

I also use the content editor of sharepoint WebPart

I can not add the code here, so I put it on the link below

Link for the code

Sampling conditions:

I hope that the conditions below answer your question. But that's a lot so I gave some examples

Urgency and impact = Display all; Platform = All Verified => Home Page

Urgency = high and impact = show everything; Platform = All Checked => URL1

Urgency = low and impact = display everything; Platform = All Checked => URL2

Urgency = Show All & Impact = Site / Department; Platform = All Checked => URL3

Urgency = Show All & Impact = Multiple Users; Platform = All Verified => URL4

Urgency and impact = Display all; Platform = Unix and Windows => URL5