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
SELECT YEAR(e.event_start_time) AS event_year, MONTH(e.event_start_time) AS event_month, rx_year, rx_month, product_name, SUM(nrx_cnt) AS rx_cnt, 0 AS segment | |
FROM provider_rx_segment prs | |
INNER JOIN provider dr ON (dr.provider_id = prs.provider_id) | |
INNER JOIN roi_campaign_project rcp ON (rcp.project_id = dr.project_id) | |
INNER JOIN event_provider edr ON (edr.provider_id = dr.provider_id) | |
INNER JOIN [event] e ON (e.event_id = edr.event_id AND YEAR(DATEADD(MONTH, -1, e.event_start_time)) = rx_year AND MONTH(DATEADD(MONTH, -1, e.event_start_time)) = rx_month) | |
WHERE rcp.roi_campaign_id = 46 AND edr.event_role_id = 1 | |
GROUP BY YEAR(e.event_start_time), MONTH(e.event_start_time), rx_year, rx_month, product_name | |
UNION | |
SELECT YEAR(e.event_start_time) AS event_year, MONTH(e.event_start_time) AS event_month, rx_year, rx_month, product_name, SUM(nrx_cnt) AS rx_cnt, 1 AS segment |
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
pssh -i -h hosts.txt ps aux | grep cassandra | awk '{ print $2 }' |xargs sudo kill | |
pssh -i -h hosts.txt sudo /usr/local/apache-cassandra-1.1.2/bin/cassandra |
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
SELECT x.y, x.m, | |
SUM(x.is_influencer) AS influencer_count, | |
SUM(on_target_list) AS target_count, | |
SUM(is_other) AS other_count, | |
y.event_ct AS event_count | |
FROM (SELECT DISTINCT YEAR(e.event_start_time) AS y, MONTH(e.event_start_time) AS m, | |
CASE WHEN provider_default_score > 0.0 THEN 1 ELSE 0 END AS is_influencer, | |
CASE WHEN provider_default_score = 0.0 THEN CAST(ISNULL(drt.is_target_list, 0) AS INT) ELSE 0 END AS on_target_list, |
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
SELECT speaker.provider_id, drx.product_name, drx.rx_year, drx.rx_month, SUM(drx.nrx_cnt) AS rx_ct | |
FROM provider speaker | |
INNER JOIN event_provider speakerevt ON (speakerevt.provider_id = speaker.provider_id) | |
INNER JOIN roi_campaign_project rcp ON (rcp.project_id = speaker.project_id) | |
INNER JOIN roi_campaign rc ON (rc.roi_campaign_id = rcp.roi_campaign_id) | |
INNER JOIN [event] e ON (e.event_id = speakerevt.event_id) | |
INNER JOIN event_provider attendeeevt ON (attendeeevt.event_id = e.event_id) | |
INNER JOIN provider attendee ON (attendee.provider_id = attendeeevt.provider_id and attendeeevt.provider_id != speaker.provider_id) | |
INNER JOIN provider_rx_segment drx ON (drx.provider_id = attendee.provider_id) | |
WHERE rcp.roi_campaign_id = 46 AND e.event_start_time BETWEEN rc.event_rx_start AND DATEADD(s,-1,DATEADD(mm, DATEDIFF(m,0,rc.event_rx_end)+1,0)) |
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
//blows heap | |
engine.eval(String.format("g.v(%s)", ix), bindings); | |
// does not | |
engine.eval(String.format("g.v(%s)", (ix % 4) + 1), bindings);; |
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
doppelganger.core=> (def z (incanter.core/matrix [[1 2 3 10][3 2 1 10][10 20 30 50][20 40 60 100][60 40 10 100]])) | |
#'doppelganger.core/z | |
doppelganger.core=> (incanter.stats/correlation z) | |
[1.0000 0.7896 0.0630 0.7942 | |
0.7896 1.0000 0.6621 0.9997 | |
0.0630 0.6621 1.0000 0.6560 | |
0.7942 0.9997 0.6560 1.0000] | |
doppelganger.core=> (incanter.stats/correlation (incanter.stats/trans z)) | |
CompilerException java.lang.RuntimeException: No such var: incanter.stats/trans, compiling:(NO_SOURCE_PATH:1) |
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
select dr.provider_id, dr.provider_name_first, dr.provider_name_last, dr.primary_addr_line_1, dr.primary_addr_city, | |
dr.primary_addr_city, dr.primary_addr_realm, dr.primary_addr_zip, s.specialty_name, | |
ims.provider_identifier_identity as ims, me.provider_identifier_identity as me, npi.provider_identifier_identity as npi | |
from provider dr | |
left outer join provider_specialty drs on (drs.provider_id = dr.provider_id and drs.provider_specialty_primary = 1) | |
left outer join specialty s on (s.specialty_id = drs.specialty_id) | |
left outer join provider_identifier npi on (npi.provider_id = dr.provider_id and npi.identifier_type_id = 22) | |
left outer join provider_identifier me on (me.provider_id = dr.provider_id and me.identifier_type_id = 2) | |
left outer join provider_identifier ims on (ims.provider_id = dr.provider_id and ims.identifier_type_id = 3) | |
where project_id = 41 |
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
SELECT drmi.provider_id, dr.provider_profile_selected, dr.provider_profile_respondent, | |
dr.provider_profile_media, dr.provider_profile_event, dr.provider_profile_clinical_trial, | |
drmr.provider_media_role_name, COUNT(DISTINCT drmi.media_item_id) AS articles, | |
dr.provider_name_first, dr.provider_name_last, dr.primary_addr_city, dr.primary_addr_realm, | |
dr.primary_addr_zip | |
FROM media m | |
INNER JOIN media_item mi ON (mi.media_id = m.media_id) | |
INNER JOIN provider_media_item drmi ON (drmi.media_item_id = mi.media_item_id) | |
INNER JOIN provider_media_role drmr ON (drmr.provider_media_role_id = drmi.provider_media_role_id) | |
INNER JOIN provider dr ON (dr.provider_id = drmi.provider_id) |
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
[default@titan] list edgestore; | |
Using default limit of 100 | |
------------------- | |
RowKey: 000000000003a9a0 | |
------------------- | |
RowKey: 000000000003a988 | |
------------------- | |
RowKey: 0000000000013890 | |
------------------- | |
RowKey: 000000000003a990 |
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
types = [(TinkerGraph.FileType.GRAPHSON) : '/tmp/tg/graphson', | |
(TinkerGraph.FileType.GML) : '/tmp/tg/gml', | |
(TinkerGraph.FileType.GRAPHML) : '/tmp/tg/graphml', | |
(TinkerGraph.FileType.JAVA) : '/tmp/tg/java'] | |
m = [:] | |
types.each{ gt -> | |
graph = new TinkerGraph(gt.value, gt.key); | |
graph.createKeyIndex("index", Vertex.class); |