For companies that work with online advertising, more precisely DSPs and their Real-time Bidding platforms is very important to consider collecting information about the behavior and interests of users while they surfing on the internet. Therefore, in this graph gist, I describe a basic approach that can be used to analyze such data, considering a certain period of time and the products visualized by each user. Let’s consider some characters from Breaking Bad surfed on the internet a few days ago and found some products interesting, chemical elements, and they are thinking about buying them. Such information is extremely important when making a bid at auction advertising, knowing the profile and interests of a given user. Then we store these users, products and dates of views so we can extract this information in the future.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
You need to format the EBS volume (block device) with a file system between step 1 and step 2. So the entire process with your sample mount point is: | |
Create EBS volume. | |
Attach EBS volume to /dev/sdf (EC2's external name for this particular device number). | |
Format file system /dev/xvdf (Ubuntu's internal name for this particular device number): | |
sudo mkfs.ext4 /dev/xvdf | |
Mount file system (with update to /etc/fstab so it stays mounted on reboot): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo mkdir -p /Library/Internet\ Plug-Ins/disabled | |
sudo mv /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin /Library/Internet\ Plug-Ins/disabled | |
sudo ln -sf /System/Library/Java/Support/Deploy.bundle/Contents/Resources/JavaPlugin2_NPAPI.plugin /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin | |
sudo ln -sf /System/Library/Frameworks/JavaVM.framework/Commands/javaws /usr/bin/javaws |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install python-software-properties | |
sudo add-apt-repository ppa:git-core/ppa | |
sudo apt-get update | |
sudo apt-get install git |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo apt-get purge openjdk* | |
$ sudo add-apt-repository ppa:webupd8team/java | |
$ sudo apt-get update | |
Install Java 8: | |
$ sudo apt-get install oracle-java8-installer | |
Or, install Java 7: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ListaDuplamenteEncadeada { | |
private Pessoa primeiraPessoa; | |
private Pessoa ultimaPessoa; | |
private int totalPessoas; | |
public void insereInicio(Pessoa novaPessoa) { | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0. Installing - http://www.apache.org/dyn/closer.cgi/lucene/solr/4.3.0 | |
1. Setup your fields types in solr/collections/conf/schema.xml | |
2. POST JSON - | |
curl http://localhost:8983/solr/update/json?commit=true --data-binary @file-name.json -H 'Content-type:application/json' | |
3. CLEAR DATABASE | |
curl http://localhost:8983/solr/update?commit=true -H "Content-Type: text/xml" --data-binary '<delete><query>*:*</query></delete>' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.IOException; | |
import java.util.List; | |
import org.apache.solr.client.solrj.SolrQuery; | |
import org.apache.solr.client.solrj.SolrServer; | |
import org.apache.solr.client.solrj.SolrServerException; | |
import org.apache.solr.client.solrj.impl.HttpSolrServer; | |
import org.apache.solr.client.solrj.response.QueryResponse; | |
import org.apache.solr.common.SolrInputDocument; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
redis> SET key "value" | |
OK | |
redis> EXPIRE key 15 | |
(integer) 1 | |
redis> TTL key | |
(integer) 10 | |
redis> TTL key | |
(integer) 9 | |
redis> TTL key | |
(integer) 8 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
StringWriter sw = new StringWriter(); | |
PrintWriter pw = new PrintWriter(sw); | |
t.printStackTrace(pw); | |
sw.toString(); |