functional programming: function to capitalize and remove odd-length characters from the string

However, I wrote 2 different expressions to calculate the words of length come and one to convert them to uppercase, but how to merge them

(defn a (v) (clojure.string / uppercase v))

(filter # (even? (count%)) ("hello" "this" "is" "a" "test"))

ans must be ("THIS" IS "" PROOF ")

python – How to transform string values ​​of a data frame into numerical values?

I would like to transform a response dataframe into numerical values.

>>> df1('Intention_vote_2020').unique()
array(('Je sais pour en 2020',
       'Je ne voterai pas en 2020',
       'Je vais voter en 2020 mais je ne sais toujours pas pour qui je voterai',
       'Je voterai blanc', nan), dtype=object)

So I tried

    df1('ascii') = (ord(x) for x in df1('Intention_vote_2020').unique())

But it returns me:

TypeError                                 Traceback (most recent call last)
      1 df1 = df
----> 2 df1('ascii') = (ord(x) for x in df1('Intention_vote_2021').unique())

 in (.0)
      1 df1 = df
----> 2 df1('ascii') = (ord(x) for x in df1('Intention_vote_2020').unique())

TypeError: ord() expected a character, but string of length 45 found
    df1('ascii') = pd.to_numeric(df('Intention_vote_2020'))

But it returns me:

ValueError                                Traceback (most recent call last)
pandas_libslib.pyx in pandas._libs.lib.maybe_convert_numeric()

ValueError: Unable to parse string "Je sais déjà pour qui je vais voter en 2021"

During handling of the above exception, another exception occurred:

ValueError                                Traceback (most recent call last)
      1 df1 = df
----> 2 df1('ascii') = pd.to_numeric(df('Intention_vote_2020')) in to_numeric(arg, errors, downcast)
    148         try:
    149             values = lib.maybe_convert_numeric(
--> 150                 values, set(), coerce_numeric=coerce_numeric
    151             )
    152         except (ValueError, TypeError):

pandas_libslib.pyx in pandas._libs.lib.maybe_convert_numeric()

ValueError: Unable to parse string "Je sais déjà pour qui je vais voter en 2020" at position 0

How to find regular string from Grobner base in Mathematica?

Could anyone tell me how to find a regular string from a Grobner base that has many basic elements, each of which has many terms generated by the GroebnerBasis function in Mathematica? Thank you.

How do I search for an exact multi-word string in Bitbucket?

I want to search Bitbucket for public T get in this exact order Any word can be before public or later get but the whole sentence public T get must match

But when I search using double quotes like "public T get" so I get all kinds of results that have the words public u get but the exact relevant result that the complete phrase has is not even shown.

How to remove spaces from a string in Python without also removing breaks?

Hello people! I need to remove unnecessary spaces from the strings, but not separate them between lines. I have used the following command, which removes spaces, but also removes the break with & # 39; / n & # 39 ;. Does anyone know how to solve?

" ".join("   minha  n string do python    ".split())

Console output:
& # 39; my python string & # 39;

Result I am trying to do:
& # 39; my n python string & # 39;

drive: how to get multiple override string values ​​ToString ()?

I want to get multiple string values ​​(selectedNameY selectedCurrency) individually from public override string ToString()down.
How do I continue about it?

    using System.Collections;
       using System.Collections.Generic;
       using UnityEngine;  

       (CreateAssetMenu(fileName = "Country", menuName = "Country/Country", order = 0))
       public class country : ScriptableObject
           public class Item
               public string Name;
               public string Currency;
               public string Capital;
               public string() City;

    public override string ToString()
    string selectedName =;
    string selectedCurrency = this.currency;
    return selectedName + selectedCurrency; 


           public Item() m_Items;
       public Item PickRandomly()
        int index = Random.Range(0, m_Items.Length);
        return m_Items(index);

I need to use the selected string values ​​in the script below.

    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    using UnityEngine.UI;

    public class GameController: MonoBehaviour
    {   public country country; //This is the scriptable object country
    public Text countryText;
    public Text currencyText;

    void Start(){
    countryText.text = country.PickRandomly().ToString(); // This is where I need the country name string to show up.
currencyText.text = country.PickRandomly().ToString(); // This is where I need the currency string to show up.

Right now, it only shows a random country name and currency, for example USD in both fields.

Compress JSON string stored in PostgreSQL, like MessagePack?

JSON strings are currently stored in a PostgreSQL 11 table in a text field. For example, a row can have the text field asks which contains the string:


Question: Is it possible to store it in a format that consumes less space? Using some CPU cycles to serialize / deserialize the JSON string is acceptable as a compromise to use less storage space. JSON data need not be searchable.

I am particularly interested in using JSON encoding / compression algorithms like MessagePack with zlib, but how can we use this when inserting the record into PostgreSQL table?

Note: Node.js is also used with Knex.js to communicate with PostgreSQL. Currently converting JSON objects to strings using Node & # 39; s JSON.stringify function.

android: how to pass a string from an activity to a snippet contained in viewPager?

I have an app with 4 tabs in a viewer and I need to pass a chain of viewer activity to the first snippet. I read it with speechRecognizer and the result is stored in a string and it is this string that I need to send to the fragment. I have tried the interface, viewModel, sharedPreferences and bundle´s and the variable exchange. I found some examples, but they are all from fragment to fragment, from activity to fragment they exist but they did not work. Is there any other way to do this passage?

custom post types – Recoverable fatal error – WP_Post class object could not be converted to string

I am using ACF and trying to display a post type title based on the current time. So I have my post type input with start_time and end_time and my conditional shows my div.onAir, but I get this recoverable fatal error. Here is my code:

      'meta_query' => array(
          'key' => 'start_time',
          'compare' => '<=',
          'value' => $time_now,
          'type' => 'DATETIME',
          'key' => 'end_time',
          'compare' => '<=',
          'value' => $time_now,
          'type' => 'DATETIME',
  if( $shows ) {
    foreach( $shows as $show ){ ?>
Currently On Air:

I feel like I'm close, but I haven't seen this particular error before. Any help would be appreciated! Thank you.

Error message with StringReplace "Not a valid string replacement rule"

Following an example from my lectures, I get this error and can't explain why it occurs.

The instructions are as follows:

alphabet = CharacterRange("A","Z");
rc = RandomColor(26)
code = Table(alphabet((n))->rc((n)),{n,Length(alphabet)})
newstring = StringReplace(string, code)

but sometimes (but not always) I get this error: "StringReplace :: srep: Z -> () is not a valid string replacement rule" where () represents a certain color.

Could you help me understand why it happens?