Best approach to send 0.5 million emails with lowest cost [closed]

I am from engineering background. I have to send 0.5 million emails to users. I already have email addresses of the users.

I have few confusions

  • Sending mail through sendgrid etc, do I need to buy subscription which can hold 0.5 contacts?

  • I want to send via API, is there any API only approach?

  • What if I send via gmail SMTP?

Any kind of information is highly appreciated.

What is the approach to working on this?

I have a question I am working on with regards to PHP vulnerability. Below is the code snippet. Basically, I need to print the contents of get_flag.php.

My train of thoughts is that the following could be the vulnerabilities in the code

  1. The global $ secret variable
  2. The unserialized_safe function
  3. The hash_equals built in PHP function

The attack will be somewhere along the line of getting the value of the global $ secret and then creating a payload in the cookie to exploit the unserialized_safe function to print the content of get_flag.php. To do that, I have to ensure that I can compute the signature of the payload so that the loop will go into the unserialized portion.

My question is, how do I get the value of the global $ secret in the first place? Or is there something I am missing.

Thanks in advance!

<?php      include 'get_flag.php';      class Hacker {         private $  show_flag = FALSE;         private $  username = 'hacker1337';          public function toString() {             $  str = $  this->username;             if($  this->show_flag === TRUE) $  str .= ' ' . getFlag($  this->username);              return $  str;         }     }      function sign($  str) {         global $  secret;         return hash('sha256', $  secret . $  str);     }      function unserialize_safe($  str) {                 return unserialize($  str, ['allowed_classes' => ['Hacker']]);     }      if(isset($  _COOKIE['hackers']) && isset($  _COOKIE['signature'])){         $  serialized_hackers = $  _COOKIE['hackers'];         $  signature = $  _COOKIE['signature'];         if (hash_equals(sign($  serialized_hackers), $  signature) === FALSE) {             unset($  _COOKIE['hackers']);         } else {             $  serialized_hackers = explode(' ', $  serialized_hackers);             $  hackers = array_map('unserialize_safe', $  serialized_hackers);         }             }      if(!isset($  _COOKIE['hackers']) || !isset($  _COOKIE['signature'])) {         $  hackers = [new Hacker];         $  serialized_hackers = implode(' ', array_map('serialize', $  hackers));                 setcookie('hackers', $  serialized_hackers);         setcookie('signature', sign($  serialized_hackers));     } ?>  <html> <head>     <meta charset="UTF-8">     <title>Secure site 10000</title> </head> <body> <h1>The Hacker Wall of Fame:</h1> <?php foreach($  hackers as $  hacker): ?>     <li><?= $  hacker->toString() ?></li> <?php endforeach; ?> <p /><a href="?source=1">Show</a>/<a href="/">hide</a> page source<p /> <?php if (isset($  _GET['source'])) highlight_file(__FILE__); ?> </body> </html> 

An approach to determine whether language is regular or not?

I have the following problem. I need to determine whether this language is regular or not:

L:= { w∈Σ*: for every α ∈ Σ, |w|α is even or divisible by 3}

(α is index here |w|)

I know that I need to use deterministic/non-deterministic finite automata, regular expression/grammar to prove that it is regular or to use pumping lemma to prove that it is not.

But I’m not sure how to approach this problem to start proving something. Is this trial and error method or is there some way to know from the start?

I appreciate your help!

0/1 Knapsack in bottom up approach

I’ve tried the Recursive, Memoization and DP-Top-Down approach of Knapsack problem. But not able to restructure the code for DP-Bottom-Up approach. Below is my code, its only working for fewer inputs.

def knapsackBFBottomUp(W, val, wt):     n = len(val)     dp = [[0 for i in range(W+1)] for i in range(n+1)]      for i in range(n-1, -1, -1):         for j in range(W-1, -1, -1):             if j > wt[i]:                 ans = dp[i+1][j]             else:                 ans1 = val[i] + dp[i+1][j+wt[i]]                 ans2 = dp[i+1][j]                 ans = max(ans1, ans2)             dp[i][j] = ans     return dp[0][0]   n = int(input()) W = int(input()) val = list(int(i) for i in input().strip().split(' ')) wt = list(int(i) for i in input().strip().split(' ')) print(knapsackBFBottomUp(W, val, wt))  Input Which I've used. 3 2 20 30 40 1 1 1  Returns Answer as 70 

Can any one please assist me what I’m missing here? I’ll be very thankful to you.

How to approach weighted job/interval scheduling problem with 2 machines (dynamic programming)

Given N jobs where every job is represented by the following: Start Time, Finish Time and Value Associated (>= 0) and two machines that can do the jobs,

The goal is to find the maximum value subset of the jobs such that no two jobs in the subset overlap.

How should I approach this? I could only think of using the solution for a single machine and then doing it again for the second machine…

Is re-skinning equipment a balanced approach for concept diversity?

Sometimes, it is quite difficult to make that one concept you want for your character.

My group quite often ends up in the situation that the concept one of them have in mind for their character doesn’t quite fit the rules, and you can’t really make that character work with what Pathfinder offers as-is, sometimes even with supplements and third-party material. To give a recent example:

  • A player wants to roll a tanky barbarian-like warrior focused on defending its group while wielding an axe and shield, but:
    • Doesn’t like Rage mechanics,
    • Wants to keep her character’s gear more savage-like, with heavy furs serving as the little clothing she’ll wear,
    • Wants to be able to protect her group and tank effectively, while being able to deal good damage,

An almost-perfect match for this is the warder. The class is very tanky, has good defensive mechanics, is very closely-related in power level to the rest of the group, and works nicely with sword and board.

But the warder uses plate armor, and it doesn’t fit the “visual concept” the player wants for her character.

To solve that, I created the Berserker’s Battle Furs. It is basically the same as a Full Plate in terms of stats:

Type: Heavy Armor

Cost: 1,500 gp;

Weight: 50 lbs.

Armor Bonus: +9;

Max Dex Bonus: +1;

Armor Check Penalty: -6

Arcane Spell Failure Chance: 35%;

Speed: 20 ft./15 ft.

…But it looks like a heavy set of fur bracers, boots, loincloth and cloak, more or less like the reference image. I used a lore explanation to justify the price and the stats, saying that it is made from the treated pelts of dire beasts. My only problem would be to time to don, since this is obviously easier to put over your body than a full suit of armor, and even so this situation comes up so rarely that it wouldn’t be a big deal.

This solved the issue at hand, the player got quite happy, and now our group has a barbarian-but-not-really defending the group as a wall of flesh, fur, and awesomeness.

This got me wondering – is this a balanced approach for giving my players more diversity regarding character concepts? Or am I going to shoot myself in the foot, like I did so many other times in the past, by not seeing something coming?

using NoScript – what approach to use with randomnly named CDN scripts?

I ran across this on This question isn’t about itself, which I have no problem trusting. Rather, what approach do you recommend in dealing with CDN scripts that have very long random names? Now, I know they’re most likely just how the main site decided to refer to external utility scripts they’ve put on a CDN.

But, if the main site had been hacked, the attackers could also inject a script to fire and use a long random name that looks innocuous by looking a like a utility script.

Is there any particular reason to be more cautious about these long random named scripts than for the more recognizably-named ones? I suppose not, but they do make me a bit queasy on NoScript. Especially on sites that I will enter credit cards into.

enter image description here

Approach for algorithm to find closest 3-D object in a list of many similar objects to a given test case

Lets say I have a list of many (10s of thousands – millions) objects, and each of these objects has a given number of 3-D vertices (my current implementation uses 8 vertices each, but this number can be reduced if it causes a very significant increase in performance). These vertices are currently stored as floats from 0-255, but this range can also be changed if need be, assuming it will not reduce accuracy too drastically. Also, I can store these objects in any data structure that would be beneficial for this algorithm.

I am given another such object, also with the same number (8) 3-D vertices, but of which in general it must be assumed that none of the vertices are common with any vertices included in the list of stored previous objects.

With all of this in mind, I need an algorithm that will return an object from that list that is optimally close to the test case object (close being defined in the normal, euclidean distance, sense). By optimally close, I mean that it does not have to be the global optimum if this will greatly increase performance, although if there is a quick algorithm that will always return the global optimum i would love to hear it.

What is the main concept of using lexical,linguistic, semantic or syntactic approach in NLP for cyberbullying

Am really in need of some explanation, am working on a nlp cyberbullying detection tool which i will deploy to the web using django framework, however, am stuck on some idea, can someone explain to me….What is the main concept of using lexical,linguistic, semantic or syntactic approach in (NLP) and how is applied in cyberbullying or what are the step, i know POS-tag is way of grouping word and look for dependency in other word, my idea of pos-tag is a synonym of semantic because pos-tagging is a process linking words to it root and representation word in a understandable context correct me if wrong.

I read an article where a paper tackled a project using predictive analysis approach with feature extraction techniques, navie baye for classification and to train the model, in the discussion they also spoke on how other team used Semantics approach to classifier cyber bullying . I know of data cleaning, tokenisation stemming and most of feature extraction model, however, am stuck on the problem of approach which is what is the relevant on lexical, semantic or syntactic and how are they been approached.