[Solved] Journey Bu...
 
Notifications
Clear all

[Solved] Journey Builder - Some questions about Data Extension Entry Source

0 Posts
1 Users
0 Likes
6 Views
0
Topic starter
Joao Marano Asks: Journey Builder - Some questions about Data Extension Entry Source
I'm new in Marketing Cloud. It's my first time that i work with the Journey Builder. I read about the JB and learned to follow the steps when I like to work with a Data Extension like Entry Source in my Journey:

  1. Sendable Data Extension have the Subscriber Key the Email Address field.
  2. I've linked my DE to the Contacts data schema as a Population in Contact Builder, from ContactKey <=> Subscriber Key.
  3. In Contacts Configuration, I've added my DE and its Email Address attribute to the Email Address Channel Order
  4. I've put this Data Extension like the Entry Source just simple step: drag and drop
  5. In my Journey I want to divide the split the subscriber according the date exists in the field in the DE "DataNascimento"
  6. The Journey is evaluating on the average 90% of the all contacts. When I go to the View Event Results in Journey Builder, I noticed that the Rejected Contacts is on the average 90% appears this error: Failed - Currently Waiting In Same Interaction.

I want to know about this error, please. And the status about the subscriber that evaluated in Journey appears like ContactAttempted and none actvity. On the average by my Journey appears as:

  • 90% evaluated and has activity normally
  • 9% evaluated, but doesn't have an activity - ContactAttempted
  • 1% error like i said - Failed - Currently Waiting In Same Interaction.

I want to know more about this Journey. I noticed that it's normally

Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.

 

 


 

Unreplied Posts

[Solved] (react + express) DOM on server – Return web pages (SSR)

quertyqualified Asks: (react + express) DOM on server – Return web pages (SSR)
I have a problem related to rendering HTML from node js.

I am creating dynamic HTML (Reactj concept they are currently using), but I don’t know how to do it the same way Reactjs does on my node js server. Renderizando elementos – React

I used:

Code:
const express = require ('express')
const app = express ()
const port = 3000
// app.use (express.static ("public"))
app.listen (port, () => {
  console.log (`Example app listening at http: // localhost: $ {port}`)
})

I have read that if you use app.use (express.static .., it just loads static files.

So I decided to add an endpoint, to convert the site to dynamic:

Code:
app.get ("/", (req, res) => {
  res.send ("<html> <head> </head> <body> <h1> .... </h1> </body> </html>");
});

The problem is that I need to take an “index.html” pass it to plain text, read it with DOM and through the DOM add or remove elements (text) Finally return the entire html page.

Code:
1 - Pass the html to text.
2 - Cycle that text by dom
3 - Add or remove items
3.1 - Add divs inside other containers "through an id" by DOM

app.get ("/", (req, res) => {
  res.send (stringTextHtmlWebPage); 
// The problem is that I have to return the entire directory like 
// app.use(express.static ("public")) does; but with the modified file.
});

In Reactj they do something similar. They inject with the ReactDOM.render. They have a:

Code:
index.js
function App () {
  return (<div className = "container mt-5"> ... </div>);
  // I was surprised by this line, it goes without any quotes ... and it works ...
}

ReactDOM.render (
  <React.StrictMode>
    <App />
  </React.StrictMode>,
  document.getElementById ('root') // element from public / index.html
);

Index.html
  <body>
    <noscript> You need to enable JavaScript to run this app. </noscript>
    <div id = "root"> </div>

In my case, how would it be to return an entire HTML page. With the steps that I indicated?

Edit:

I have to return a whole directory of files. (But some modified and some not) For instance: I modify the index.html but it has associated a css, js, bootstrap … It has to work like an “app.use (express.static (” public “));” but with some modified files. In short, modify a file using node js and then call app.use (express.static (“public”)); and that this file is modified. (Similar to what React does)

Code:
// Modify file
// calls app.use (express.static ("public")); (with the modification)

or would there be some way to inject the code into my “app” variable? Some of the style

Code:
app.injectPath ("public / index.html"). Tour_the_DOM (tag ["tag1"]) = "<div> add this div </div>";

Just like React does?

I can’t use templates (pug, manillar…), because the source code of the pages is written elsewhere.

I have also read: Agregar React a un sitio web – React But I don’t know how to integrate it with app.use (express.static (“public”))

This is what I am looking for. Representación del lado del servidor con React But it’s not working. Any solution to do the same?

Thanks in advance.

Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.
 
 
 

[Solved] Function default argument value depending on argument name in C++

Fedor Asks: Function default argument value depending on argument name in C++
If one defines a new variable in C++, then the name of the variable can be used in the initialization expression, for example:

Code:
int x = sizeof(x);

And what about default value of a function argument? Is it allowed there to reference the argument by its name? For example:

Code:
void f(int y = sizeof(y)) {}

This function is accepted in Clang, but rejected in GCC with the error:

Code:
'y' was not declared in this scope

Demo: Compiler Explorer – C++

Which compiler is right here?

Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.

 

 


 

[Solved] Create new words by replacing all occurrences by letter pair

GameAtrix Asks: Create new words by replacing all occurrences by letter pair
Im trying to write a function that loops over a string and replaces all the occurrences of one letter with another and create new words of all possible combinations. The letters that should replace each other are a pair. Like s and z or v and f and are hard coded. The combinations should work both ways, e.i sam -> zam and zed -> sed

The order of the words in the set are not important. For the pairs [s,z] and [v,f] the word stuffs should generate ztuffs, ztuvfs, ztuvfz, ztuffz, stuvvs, stuvvz, stuffz, stufvz. (I think thats all possible combinations, but i may have missed some)

I can’t get it to work and it feels like I’m missing something, maybe the function should be recursive in some way? Or there is something i miss?

First function I tried the more dynamic way by adding arrays of combinations and the latter it’s just if statements doing the checks.

This only replaces the first occurring letter in the set and not the other way around

Code:
console.log(replaceSimilarCharacters('stuffs')); // `[ 'stuffs', 'ztuffz', 'stuvvs' ]`

const replaceSimilarCharacters = (word) => {
  let letterCombination = [
    ['s', 'z'],
    ['f', 'v']

  ];
  const set = new Set();
  set.add(word); // original word
  for (let i = 0; i < word.length; i++) {
    letterCombination.forEach((letterCombo) => {
      letterCombo.forEach((letter) => {
        if (word[i] === letter) {
          const currentIndex = letterCombo.indexOf(letter);
          const nextIndex = (currentIndex + 1) % letterCombo.length;

          const nextLetter = letterCombo[nextIndex];
          const prevLetter = letterCombo[nextIndex - 1];
          const regex = new RegExp(letter, 'g');

          word = word.replace(regex, nextLetter);
          set.add(word);
          word = word.replace(regex, prevLetter);
          set.add(word);
        }
      });
    });
  }

  return Array.from(set);
};

This works a bit better but still missing some combinations

Code:
console.log(replaceLettersInWord('stuffs')); // `[ 'stuffs', 'ztuffs', 'stuvfs', 'stufvs', 'stuffz' ]`

const replaceLettersInWord = (word) => {
  const set = new Set();
  set.add(word);

  for (let i = 0; i < word.length; i++) {
    const currentLetter = word[i];

    if (currentLetter === 'z') {
      set.add(setCharAt(word, i, 's'));
    }
    if (currentLetter === 's') {
      set.add(setCharAt(word, i, 'z'));
    }
    if (currentLetter === 'f') {
     set.add(setCharAt(word, i, 'v'));
    }
    if (currentLetter === 'v') {
     set.add(setCharAt(word, i, 'f'));
    }
  }
  return Array.from(set);
};
const setCharAt = (str, index, chr) => {
  if (index > str.length - 1) return str;
  return str.substring(0, index) + chr + str.substring(index + 1);
};

Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.

 

 


 

[Solved] Powershell Set Lid Close Action

CraigJPerry Asks: Powershell Set Lid Close Action
I wanted to automate setting the action Windows 7 takes when the lid is closed on my work laptop, as this is reset via GPO every time i login.

I know that i can use the powercfg command in a batch script to achieve this:

Code:
powercfg -setacvalueindex 5ca83367-6e45-459f-a27b-476b1d01c936 0
powercfg -setdcvalueindex 5ca83367-6e45-459f-a27b-476b1d01c936 0

However, this was a good excuse to attempt learning some powershell. My first attempt takes over 10 seconds to run.

How can i improve on the below, both in terms of runtime & in terms of cleanliness of the code. What would be the idiomatic powershell way to approach the below?

Code:
$DO_NOTHING = 0

$activePowerPlan = Get-WmiObject -Namespace "rootcimv2power" Win32_PowerPlan | where {$_.IsActive}
$rawPowerPlanID = $activePowerPlan | select -Property InstanceID
$rawPowerPlanID -match '\({.*})}'
$powerPlanID = $matches[1]

# The .GetRelated() method is an inefficient approach, i'm looking for a needle and this haystack is too big. Can i go directly to the object instead of searching?
$lidCloseActionOnACPower = $activePowerPlan.GetRelated("win32_powersettingdataindex") | where {$_.InstanceID -eq "Microsoft:PowerSettingDataIndex$powerPlanIDAC{5ca83367-6e45-459f-a27b-476b1d01c936}"}
$lidCloseActionOnBattery = $activePowerPlan.GetRelated("win32_powersettingdataindex") | where {$_.InstanceID -eq "Microsoft:PowerSettingDataIndex$powerPlanIDDC{5ca83367-6e45-459f-a27b-476b1d01c936}"}

$lidCloseActionOnACPower | select -Property SettingIndexValue
$lidCloseActionOnACPower.SettingIndexValue = $DO_NOTHING
$lidCloseActionOnACPower.put()

$lidCloseActionOnBattery | select -Property SettingIndexValue
$lidCloseActionOnBattery.SettingIndexValue = $DO_NOTHING
$lidCloseActionOnBattery.put()

Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.

 

 


 

[Solved] How to give a time delay of less than one second in excel vba?

Rito Asks: How to give a time delay of less than one second in excel vba?
i want to repeat an event after a certain duration that is less than 1 second. I tried using the following code

Code:
Application.wait Now + TimeValue ("00:00:01")

But here the minimum delay time is one second. How to give a delay of say half a seond?

Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.

 

 


 

[Solved] TypeDoc how do i generate documentation for internal functions

ValleTSF Asks: TypeDoc how do i generate documentation for internal functions
I’m trying to generate documentation for my TypeScript/React Native project. But from what I’ve seen you need to add an export to a function for TypeDoc to generate documentation. However, most of my functions are inside components so its not possible to add export to them. Example:

Code:
const TVShowDetailsScreen: React.FC<Props> = (props: any) => {
  const user: firebase.User = firebase.auth().currentUser;
  const watchlistRef = firebase.firestore().collection("Watchlist");
  const { email } = user;
  const [data, setData] = useState<TVShowDetails>();
  const { show } = props.route.params;

  useEffect(() => {
    init();
  }, []);

  
  const init = async () => {
    const { data } = await getTVShowDetails(show.id);
    setData(data);
  };

  if (!data) {
    return (
      <View
        style={{
          height: Dimensions.get("window").height,
          width: Dimensions.get("window").width,
          backgroundColor: "#18181b",
        }}
      ></View>
    );
  }
 
  const renderGenres = () => {
    return data.genres.map((o) => {
      return (
        <S.GenreText key={o.id} style={{ color: "white", top: 10 }}>
          {o.name}
        </S.GenreText>
      );
    });
  };

  async function handleAddToWatchList() {
    const watchListSnapshot = await watchlistRef
      .where("userId", "==", email)
      .get();
    const watchlistId = watchListSnapshot.docs[0].id;
    const documentRef = watchlistRef.doc(watchlistId);

    data.seasons.forEach(async (s) => {
      let season = {
        [s.season_number]: {},
      };
      let episodesList: {
        episodeNumber: number;
        episodeName: string;
        season: number;
      }[] = [];
      const { data: seasonData } = await getTVShowSeasonDetails(
        data.id,
        s.season_number
      );
      const { episodes } = seasonData;
      const seasonEpisodes = episodes.filter(
        (e) => e.season_number === s.season_number
      );

      seasonEpisodes.forEach((e) => {
        const episodeObject = {
          episodeNumber: e.episode_number,
          episodeName: e.name,
          season: e.season_number,
          imdb: e.vote_average,
          date: e.air_date,
          overview: e.overview,
          id: e.id,
          stillPath: e.still_path,
        };
        episodesList.push(episodeObject);
        season[s.season_number] = episodesList;
      });

      documentRef.set(
        {
          tvShows: {
            [data.name]: {
              title: data.name,
              overview: show.overview,
              backdrop: "http://image.tmdb.org/t/p/w500" + data.backdrop_path,
              id: data.id,
              seasons: season,
            },
          },
        },

        { merge: true }
      );
    });
    ToastAndroid.showWithGravity(
      "Added to Watchlist!",
      ToastAndroid.SHORT,
      ToastAndroid.CENTER
    );
  }

  const renderSeasonTabs = () => {
    return data.seasons.map((s) => {
      return (
        <Tab
          key={s.season_number}
          heading={
            <TabHeading style={{ backgroundColor: "#880421" }}>
              <Text>{s.season_number}</Text>
            </TabHeading>
          }
        >
          <TVShowSeasonTab seasonNumber={s.season_number} showId={data.id} />
        </Tab>
      );
    });
  };

  return (
    <View
      style={{
        flex: 1,
        justifyContent: "center",
        alignItems: "center",
        backgroundColor: "#18181b",
      }}
    >
      <StatusBar hidden translucent backgroundColor="transparent" />
      <ScrollView
        style={{ flex: 1 }}
        contentContainerStyle={{
          width: Dimensions.get("window").width,
        }}
      >
        <Image
          style={{ height: 281, width: 500 }}
          source={{
            uri: "http://image.tmdb.org/t/p/w500" + data.backdrop_path,
          }}
        />
        <S.AddToWatchListButton onPress={handleAddToWatchList}>
          <S.ButtonText>+</S.ButtonText>
        </S.AddToWatchListButton>
        <Text
          style={{
            color: "white",
            position: "absolute",
            top: 210,
            left: 10,
            fontSize: 30,
          }}
        >
          {data.name}
        </Text>
        {renderGenres()}
        <Text
          style={{
            fontSize: 20,
            top: 20,
            left: 20,
            color: "#b9042c",
          }}
        >
          Synposis
        </Text>
        <Text
          style={{
            margin: 20,
            color: "white",
          }}
        >
          {show.overview}
        </Text>
        <Text
          style={{
            fontSize: 20,

            left: 20,
            color: "#b9042c",
          }}
        >
          IMDB
        </Text>
        <Text
          style={{
            left: 20,
            color: "white",
          }}
        >
          {data.vote_average}
        </Text>
        <S.Header>Seasons</S.Header>
        <Tabs style={{ marginTop: 15 }}>{renderSeasonTabs()}</Tabs>
      </ScrollView>
    </View>
  );
};

export default TVShowDetailsScreen;

Here i’d like to generate documentation for the renderGenres function, the handleAddToWatchList function etc. Is it possible with TypeDoc? Or is there an alternate doc generator that i can use?

Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.

 

 


 

[Solved] Generate XML with attributes from generic JSON

brainwash Asks: Generate XML with attributes from generic JSON
I’m trying to write a generic JSON to XML converter and cannot figure out how to convert some JSON properties to XML attributes.

Let’s say I have the following JSON:

Code:
{
  "data" : {
    "key1" : "value1",
    "key2" : {
      "value": "value2",
      "attribute#someattribute": "value3"
    }
  }
}

then I would like to obtain this:

Code:
<xml>
  <data>
    <key1>value1</key1>
    <key2 someattribute=value3>value2</key2>
  </data>
</xml>

I can change the convention to something else, but should be able to achieve something similar.

So far I’m converting the JSON to a Map<String, Object> and writing that to XML.

Code:
    xmlMapper = new XmlMapper();
    xmlMapper.configure(ToXmlGenerator.Feature.WRITE_XML_1_1, true);

    final SimpleModule sm = new SimpleModule();

    sm.addKeySerializer(String.class, new JsonSerializer<String>() {
      @Override
      public void serialize(final String value, final JsonGenerator gen, final SerializerProvider serializers) throws IOException {
        gen.writeFieldName(StringEscapeUtils.escapeXml11(value.trim()));
      }
    });
    xmlMapper.registerModule(sm);

    final OutputStream os = new ByteArrayOutputStream();
    xmlMapper.writer().withRootName(rootElement).writeValue(os, map.get(rootElement));

I can hook into the serialize() method and intercept the writing from there, but it seems to write keys and values one-after-another. The ToXmlGenerator has a method called setNextIsAttribute() but I don’t know how to hook into that.

Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.

 

 


 

[Solved] Create item- item Interaction Matrix in Pyspark

Adi Singh Asks: Create item- item Interaction Matrix in Pyspark
I have a dataset containing two columns, user_id and item_id. The DataFrame looks like this:

Code:
index user_id item_id
0     user1   A
1     user1   B
2     user2   A
3     user3   B
4     user4   C

I’m looking for a way to transform this table into an item-item interaction matrix where we have distinct intersection of common users between items:

Code:
       A   B   C
A      2   1   0
B      1   2   0
C      0   0   1

And another item-item interaction matrix where we have distinct union of users between items:

Code:
       A   B   C
A      2   3   3
B      3   2   3
C      3   3   1

Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.

 

 


 

[Solved] How to improve MySQL query that already hits INDEX

Pow4Pow5 Asks: How to improve MySQL query that already hits INDEX
How do I optimize a query which already hits Index condition and still take up to 40-80 seconds to process around 400k – 500k records?

Code:
CREATE TABLE `merchant_bank_transaction ` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`status` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`transaction_type` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`transaction_date` timestamp NULL DEFAULT NULL,
`currency` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`merchant_id` bigint(20) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `index_primary` (`merchant_id`,`transaction_date`),
ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci

I have a table as above with index:

Code:
index_primary ('merchant_id', 'transaction_date')

Sample query:

Code:
SELECT id,transaction_date, currency, status
FROM merchant_bank_transaction 
WHERE merchant_id=1
transaction_date>='2020-04-01'
transaction_date<='2020-04-30'
AND transaction_type in ('D', 'W')
ORDER BY id desc, transaction_date desc
LIMIT 0, 50;

I ran the above query and it took 54 secs++, the explain query is as below:


enter image description here

Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.

 

 


 

[Solved] Extract first stage results from feols() IV regression for modelsummary()

Umut Asks: Extract first stage results from feols() IV regression for modelsummary()
I’d like to report the first and the second stage results from feols() IV regression using modelsummary(). I couldn’t find a way (except running the first stage as a separate model).

I can display first and second stage results using etable() like this:

Code:
library(fixest)
library(tidyverse)
library(modelsummary)

# create a toy dataset
base <- iris
names(base) <- c("y", "x1", "x_endo_1", "x_inst_1", "fe")
base$x_inst_2 <- 0.2 * base$y + 0.2 * base$x_endo_1 + rnorm(150, sd = 0.5)
base$x_endo_2 <- 0.2 * base$y - 0.2 * base$x_inst_1 + rnorm(150, sd = 0.5)

# estimate an instrumental variable model
mod <- feols(y ~ x1 | fe | x_endo_1 + x_endo_2 ~ x_inst_1 + x_inst_2, base)

# First and second stage results
etable(mod, stage = 1:2)

I’d appreciate any pointers.

Thanks, Umut

Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.

 

 


 

Share: