From: Alex Sadleir Date: Sat, 19 Jan 2013 13:11:26 +0000 Subject: group by category X-Git-Url: http://maxious.lambdacomplex.org/git/?p=scannr.git&a=commitdiff&h=7f656084c6c96fca04e8576ae1f88afcee20a5d0 --- group by category --- --- a/.idea/sqldialects.xml +++ /dev/null @@ -1,8 +1,1 @@ - - - - - - - --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,27 +2,49 @@ - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - + - - + + - + - - + + - + - - - - - - - - - - - + + @@ -117,10 +130,19 @@ - - + + - + + + + + + + + + + @@ -150,16 +172,15 @@ - @@ -212,13 +233,13 @@ - + + + + + - - - - + + + + + + + + + - - + + - + + + + - - - - + + + + - - + + + - - - - @@ -355,11 +401,26 @@ + + + + + + + + + + + + + + + @@ -380,6 +441,11 @@ + + + + + @@ -390,47 +456,37 @@ - - - - - - - - - - - - - + + + - - - + + + - - - - - - - - + - - - + + + + + + + + + + --- /dev/null +++ b/README.md @@ -1,1 +1,64 @@ +# [HTML5 Boilerplate](http://html5boilerplate.com) +HTML5 Boilerplate is a professional front-end template for building fast, +robust, and adaptable web apps or sites. + +This project is the product of many years of iterative development and combined +community knowledge. It does not impose a specific development philosophy or +framework, so you're free to architect your code in the way that you want. + +* Source: [https://github.com/h5bp/html5-boilerplate](https://github.com/h5bp/html5-boilerplate) +* Homepage: [http://html5boilerplate.com](http://html5boilerplate.com) +* Twitter: [@h5bp](http://twitter.com/h5bp) + + +## Quick start + +Choose one of the following options: + +1. Download the latest stable release from + [html5boilerplate.com](http://html5boilerplate.com/) or a custom build from + [Initializr](http://www.initializr.com). +2. Clone the git repo — `git clone + https://github.com/h5bp/html5-boilerplate.git` - and checkout the tagged + release you'd like to use. + + +## Features + +* HTML5 ready. Use the new elements with confidence. +* Cross-browser compatible (Chrome, Opera, Safari, Firefox 3.6+, IE6+). +* Designed with progressive enhancement in mind. +* Includes [Normalize.css](http://necolas.github.com/normalize.css/) for CSS + normalizations and common bug fixes. +* The latest [jQuery](http://jquery.com/) via CDN, with a local fallback. +* The latest [Modernizr](http://modernizr.com/) build for feature detection. +* IE-specific classes for easier cross-browser control. +* Placeholder CSS Media Queries. +* Useful CSS helpers. +* Default print CSS, performance optimized. +* Protection against any stray `console.log` causing JavaScript errors in + IE6/7. +* An optimized Google Analytics snippet. +* Apache server caching, compression, and other configuration defaults for + Grade-A performance. +* Cross-domain Ajax and Flash. +* "Delete-key friendly." Easy to strip out parts you don't need. +* Extensive inline and accompanying documentation. + + +## Documentation + +Take a look at the [documentation table of +contents](/h5bp/html5-boilerplate/blob/master/doc/README.md). This +documentation is bundled with the project, which makes it readily available for +offline reading and provides a useful starting point for any documentation +you want to write about your project. + + +## Contributing + +Anyone and everyone is welcome to +[contribute](/h5bp/html5-boilerplate/blob/master/doc/contribute.md). Hundreds +of developers have helped make the HTML5 Boilerplate what it is today. + --- /dev/null +++ b/README.txt @@ -1,1 +1,1 @@ - +ffmpeg from http://ffmpeg.zeranoe.com/builds/ --- /dev/null +++ b/cron.php @@ -1,1 +1,9 @@ + --- a/db.sql +++ b/db.sql @@ -92,22 +92,4 @@ -- PostgreSQL database dump complete -- -CREATE TABLE "compilation" ( - "filename" text NOT NULL, - "files" text ARRAY NOT NULL, - "datetime" timestamp NOT NULL -); -CREATE TABLE "trunk_log" ( - "id" text NOT NULL, - "datetime" integer NOT NULL, - "site" integer NOT NULL, - "action" text NOT NULL, - "sourcetype" character(1) NOT NULL, - "sourceid" smallint NOT NULL, - "targettype" character(1) NOT NULL, - "targetid" smallint NOT NULL, - "channel" smallint NOT NULL, - "calltype" text NOT NULL -); - --- /dev/null +++ b/generateConvos.php @@ -1,1 +1,36 @@ +prepare('select * from recordings limit 100;'); +$sth->execute(); +$recordings = $sth->fetchAll(); +$convos = Array(); +$convo = Array(); +foreach ($recordings as $i => $recording) { + + if (count($convo) > 0) { + echo "
" . strcasecmp($convos[count($convos) - 1][0]['call_timestamp'], $recording['call_timestamp']); + if (abs(strcasecmp($convos[count($convos) - 1][0]['call_timestamp'], $recording['call_timestamp'])) > 2) { + echo " " . $convos[count($convos) - 1][0]['call_timestamp'] . " " . $recording['call_timestamp']; + } + if (strcasecmp($convos[count($convos) - 1][0]['tgid'], $recording['tgid']) != 0) { + $convos[] = $convo; + $convo = Array(); + } + } + ; + //print_r($recording); + $convo[] = $recording; + //print_r($convo); + //echo "
\n"; +} +foreach ($convos as $i => $convo) { + foreach ($convo as $recording) { + echo $recording['filename'] . " , "; + } + echo "

\n"; +} +?> + + --- a/generateHourlys.php +++ b/generateHourlys.php @@ -1,7 +1,7 @@ prepare("select tgid, extract(hour from call_timestamp) ahour, date_trunc('day', call_timestamp) aday, count(filename), array_to_string(array_agg(filename order by call_timestamp), ',') filenames from recordings group by tgid, ahour, aday order by aday DESC, ahour, tgid;"); -// TODO use tgid categories instead, tgid too specific +/*$sth = $conn->prepare("select tgid, extract(hour from call_timestamp) ahour, date_trunc('day', call_timestamp) aday, +count(filename), array_to_string(array_agg(filename order by call_timestamp), ',') filenames from recordings group by tgid, ahour, aday order by aday DESC, ahour, tgid;"); + $sth->execute(); $hourlies = $sth->fetchAll(PDO::FETCH_ASSOC); foreach($hourlies as $hourly) { processHourly($hourly); } -$sth = $conn->prepare("select 'hour' as tgid, extract(hour from call_timestamp) ahour, date_trunc('day', call_timestamp) aday, count(filename), array_to_string(array_agg(filename order by call_timestamp), ',') filenames from recordings group by ahour, aday order by aday DESC, ahour;"); +$sth = $conn->prepare("select 'hour' as tgid, extract(hour from call_timestamp) ahour, date_trunc('day', call_timestamp) aday, +count(filename), array_to_string(array_agg(filename order by call_timestamp), ',') filenames from recordings group by ahour, aday order by aday DESC, ahour;"); + +$sth->execute(); +$hourlies = $sth->fetchAll(PDO::FETCH_ASSOC); +foreach($hourlies as $hourly) { + processHourly($hourly); +} +*/ +$sth = $conn->prepare("select coalesce(category,'unknown') as tgid, extract(hour from call_timestamp) ahour, date_trunc('day', call_timestamp) aday, +count(filename), array_to_string(array_agg(filename order by call_timestamp), ',') filenames +from recordings inner join tgids on recordings.tgid = tgids.tgid group by category, ahour, aday order by aday DESC, ahour, category;"); $sth->execute(); $hourlies = $sth->fetchAll(PDO::FETCH_ASSOC); @@ -40,5 +44,3 @@ } -// delete uninteresting compilations - --- /dev/null +++ b/inserttgid.txt @@ -1,1 +1,2 @@ +insert into tgids (tgid,alpha_tag) (SELECT distinct tgid, tgname as alpha_tag FROM recordings WHERE NOT EXISTS (SELECT tgid FROM tgids WHERE tgid=recordings.tgid)); --- /dev/null +++ b/run.bat @@ -1,1 +1,2 @@ - +python scannr.py > output.txt +pause