Permalink
Browse files

updating old app, like dotcloud despite their close free hosted

  • Loading branch information...
1 parent ee6cdc5 commit 4678342829923aeefd21b4e00395cf22fcd2eda0 @j3nnn1 committed May 27, 2013
Showing with 1,421 additions and 26 deletions.
  1. +0 −21 DBformatCsvTsv/02smote.r
  2. +2 −0 dotcloud-test/dotcloud.yml
  3. +3 −0 dotcloud-test/helloperl/Makefile.PL
  4. +21 −4 dotcloud-test/helloperl/app.psgi
  5. +4 −0 dotcloud-test/helloperl/app.psgi.old
  6. 0 dotcloud-test/helloperl/hellkintrini.pl
  7. +41 −0 dotcloud-test/helloperl/lib/Kintrini.pm
  8. 0 dotcloud-test/helloperl/lib/Kintrini/Controller/Cuenta.pm
  9. 0 dotcloud-test/helloperl/lib/Kintrini/Controller/Diccionario.pm
  10. +16 −0 dotcloud-test/helloperl/lib/Kintrini/Controller/Example.pm
  11. +28 −0 dotcloud-test/helloperl/lib/Kintrini/Controller/History.pm
  12. 0 dotcloud-test/helloperl/lib/Kintrini/Controller/Metrica.pm
  13. 0 dotcloud-test/helloperl/lib/Kintrini/Controller/Pendiente.pm
  14. +18 −0 dotcloud-test/helloperl/my_mojolicious_app/kintrini/lib/Kintrini.pm
  15. +13 −0 dotcloud-test/helloperl/my_mojolicious_app/kintrini/lib/Kintrini/Example.pm
  16. +11 −0 dotcloud-test/helloperl/my_mojolicious_app/kintrini/public/index.html
  17. +21 −0 dotcloud-test/helloperl/my_mojolicious_app/kintrini/script/kintrini
  18. +9 −0 dotcloud-test/helloperl/my_mojolicious_app/kintrini/t/basic.t
  19. +10 −0 dotcloud-test/helloperl/my_mojolicious_app/kintrini/templates/example/welcome.html.ep
  20. +5 −0 dotcloud-test/helloperl/my_mojolicious_app/kintrini/templates/layouts/default.html.ep
  21. +18 −0 dotcloud-test/helloperl/my_mojolicious_app/lib/MyMojoliciousApp.pm
  22. +13 −0 dotcloud-test/helloperl/my_mojolicious_app/lib/MyMojoliciousApp/Example.pm
  23. +11 −0 dotcloud-test/helloperl/my_mojolicious_app/public/index.html
  24. +21 −0 dotcloud-test/helloperl/my_mojolicious_app/script/my_mojolicious_app
  25. +9 −0 dotcloud-test/helloperl/my_mojolicious_app/t/basic.t
  26. +10 −0 dotcloud-test/helloperl/my_mojolicious_app/templates/example/welcome.html.ep
  27. +5 −0 dotcloud-test/helloperl/my_mojolicious_app/templates/layouts/default.html.ep
  28. +12 −0 dotcloud-test/helloperl/myapp.pl
  29. +163 −0 dotcloud-test/helloperl/myapp.pl.old
  30. +21 −0 dotcloud-test/helloperl/script/kintrini
  31. +21 −0 dotcloud-test/helloperl/script/kintrini.pl
  32. +163 −0 dotcloud-test/helloperl/script/myapp.pl
  33. +417 −0 dotcloud-test/helloperl/static/css/style.css
  34. BIN dotcloud-test/helloperl/static/images/img01.jpg
  35. BIN dotcloud-test/helloperl/static/images/img02.jpg
  36. BIN dotcloud-test/helloperl/static/images/img03.jpg
  37. 0 dotcloud-test/helloperl/static/index.html
  38. 0 dotcloud-test/helloperl/static/license.txt
  39. 0 dotcloud-test/helloperl/static/style.css
  40. +9 −0 dotcloud-test/helloperl/t/basic.t
  41. +11 −0 dotcloud-test/helloperl/templates/example/welcome.html.ep
  42. 0 dotcloud-test/helloperl/templates/exception.development.html.ep
  43. 0 dotcloud-test/helloperl/templates/exception.html.ep
  44. +2 −0 dotcloud-test/helloperl/templates/history/index.html.ep
  45. +8 −0 dotcloud-test/helloperl/templates/index.html.ep
  46. +80 −0 dotcloud-test/helloperl/templates/layouts/default.html.ep
  47. +80 −0 dotcloud-test/helloperl/templates/layouts/historia.html.ep
  48. +144 −0 dotcloud-test/helloperl/templates/layouts/index.html
  49. +1 −1 twitter/ruby/twitterStatus.rb
View
@@ -1,21 +0,0 @@
-require(DMwR)
-# must set ydata as factor and has to be placed at the end!!!!!!!!
-data = read.table('creditosForSPSS_clean.csv', sep=',', header=T)
-
-train <- sample(nrow(data), floor(nrow(data) * 0.66))
-training <- data[train, ]
-validation <- data[-train, ]
-remove (train) # remove data to free up space
-
-write.csv(training, 'witout_smote_training.csv');
-
-training$clase <- as.factor(training$clase)
-data <- SMOTE(clase ~ ., training
- ,k = 70
- ,perc.over = 7000,perc.under=100)
-table(data$clase)
-write.csv(data, 'smote_training.csv');
-write.csv(validation, 'witout_smote_validation.csv');
-
-#1 over: 900 under = 400 k = 9
-#2 over: 7000 under = 200 k = 70
View
2 dotcloud-test/dotcloud.yml 100644 → 100755
@@ -1,3 +1,5 @@
www:
type: perl
approot: helloperl
+data:
+ type: mongodb
View
@@ -10,6 +10,9 @@ WriteMakefile(
'Dancer' => 1.3030,
'Plack' => 0.9974,
'PSGI' => 1.03,
+ 'Mojolicious::Plugin::Mongodb' => 1.07,
+ 'Net::Twitter' => 3.18,
+ 'Mojolicious::Plugin::LinkedContent' => 0.04 ,
}
);
View
25 dotcloud-test/helloperl/app.psgi 100644 → 100755
@@ -1,4 +1,21 @@
-$ENV{MOJO_MODE} = 'production';
-require 'myapp.pl';
-#require 'hellkintrini.pl';
-#require 'kintrino/bin/app.pl';
+#!/usr/bin/env perl
+use Mojo::Base -strict;
+
+use File::Basename 'dirname';
+use File::Spec;
+
+use lib join '/', File::Spec->splitdir(dirname(__FILE__)), 'lib';
+use lib join '/', File::Spec->splitdir(dirname(__FILE__)), '..', 'lib';
+
+# Check if Mojolicious is installed;
+die <<EOF unless eval 'use Mojolicious::Commands; 1';
+It looks like you don't have the Mojolicious framework installed.
+Please visit http://mojolicio.us for detailed installation instructions.
+
+EOF
+
+# Application
+$ENV{MOJO_APP} ||= 'Kintrini';
+
+# Start commands
+Mojolicious::Commands->start;
@@ -0,0 +1,4 @@
+$ENV{MOJO_MODE} = 'production';
+require 'myapp.pl';
+#require 'hellkintrini.pl';
+#require 'kintrino/bin/app.pl';
View
No changes.
@@ -0,0 +1,41 @@
+package Kintrini;
+use Mojolicious::Plugin::Mongodb;
+use Mojo::Base 'Mojolicious';
+
+# This method will run once at server start
+sub startup {
+ my $self = shift;
+
+ # Documentation browser under "/perldoc"
+ #$self->plugin('PODRenderer');
+
+ # Routes
+ my $r = $self->routes;
+ # namespace
+ $r->namespace('Kintrini::Controller');
+
+ # Normal route to controller
+ $r->route('/')->to('example#welcome');
+ $r->route('/index')->to('history#index');
+
+ #Model
+ $self->plugin('linked_content', {
+ 'js_base' => '/jsdir',
+ });
+ $self->plugin('mongodb', {
+ host => 'twinfo-j3nnn1-data-0.dotcloud.com',
+ port => 22284,
+ helper => 'db',
+ });
+ my $login = $self->db->authenticate("metrics", "twjenn", "twjennni");
+ $self->db->get_database(history);
+ #select databaase
+ $self->db->get_collection("my_collection")->insert({'bar' => 'baz'});
+ #
+ #my $absolute_path = '../static';
+ #$self->app->static->root($absolute_path);
+
+#my_collection
+}
+
+1;
@@ -0,0 +1,16 @@
+package Kintrini::Controller::Example;
+use Mojo::Base 'Mojolicious::Controller';
+use Mojolicious::Renderer;
+
+
+# This action will render a template
+sub welcome {
+ my $self = shift;
+ # $c = $c->app(Mojolicious->new);
+ # Render template "example/welcome.html.ep" with message
+ $self->stash( otavariable => 'Hola probando');
+ $self->flash( error => 'Wrong password or user doesn');
+ $self->render( message=> 'Welcome to the Mojolicious real-time web framework!');
+}
+
+1;
@@ -0,0 +1,28 @@
+package Kintrini::Controller::History;
+use Mojo::Base 'Mojolicious::Controller';
+use Mojo::Loader;
+use Data::Dumper;
+
+sub index {
+ my $self = shift;
+ my $dato;
+ my $collection;
+ $dato = $self->db('metrics')->getcollection('history');
+ $collection = $self->db('metrics')->my_collection;
+ $dato = $collection->find_one({screenname => '@tatadbb'});
+
+ $self->app->log->debug(Dumper $dato);
+ $self->stash(titulo => 'buscando.. palabras claves', collection => $collection);
+}
+#
+#sub create {
+#
+#
+#}
+#
+#sub getall {
+#
+#
+#}
+#
+1;
@@ -0,0 +1,18 @@
+package Kintrini;
+use Mojo::Base 'Mojolicious';
+
+# This method will run once at server start
+sub startup {
+ my $self = shift;
+
+ # Documentation browser under "/perldoc"
+ $self->plugin('PODRenderer');
+
+ # Routes
+ my $r = $self->routes;
+
+ # Normal route to controller
+ $r->route('/')->to('example#welcome');
+}
+
+1;
@@ -0,0 +1,13 @@
+package Kintrini::Example;
+use Mojo::Base 'Mojolicious::Controller';
+
+# This action will render a template
+sub welcome {
+ my $self = shift;
+
+ # Render template "example/welcome.html.ep" with message
+ $self->render(
+ message => 'Welcome to the Mojolicious real-time web framework!');
+}
+
+1;
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Welcome to the Mojolicious real-time web framework!</title>
+ </head>
+ <body>
+ <h2>Welcome to the Mojolicious real-time web framework!</h2>
+ This is the static document "public/index.html",
+ <a href="/">click here</a> to get back to the start.
+ </body>
+</html>
@@ -0,0 +1,21 @@
+#!/usr/bin/env perl
+use Mojo::Base -strict;
+
+use File::Basename 'dirname';
+use File::Spec;
+
+use lib join '/', File::Spec->splitdir(dirname(__FILE__)), 'lib';
+use lib join '/', File::Spec->splitdir(dirname(__FILE__)), '..', 'lib';
+
+# Check if Mojolicious is installed;
+die <<EOF unless eval 'use Mojolicious::Commands; 1';
+It looks like you don't have the Mojolicious framework installed.
+Please visit http://mojolicio.us for detailed installation instructions.
+
+EOF
+
+# Application
+$ENV{MOJO_APP} ||= 'Kintrini';
+
+# Start commands
+Mojolicious::Commands->start;
@@ -0,0 +1,9 @@
+use Mojo::Base -strict;
+
+use Test::More tests => 4;
+use Test::Mojo;
+
+use_ok 'Kintrini';
+
+my $t = Test::Mojo->new('Kintrini');
+$t->get_ok('/')->status_is(200)->content_like(qr/Mojolicious/i);
@@ -0,0 +1,10 @@
+% layout 'default';
+% title 'Welcome';
+<h2><%= $message %></h2>
+This page was generated from the template
+"templates/example/welcome.html.ep" and the layout
+"templates/layouts/default.html.ep",
+<a href="<%== url_for %>">click here</a>
+to reload the page or
+<a href="/index.html">here</a>
+to move forward to a static page.
@@ -0,0 +1,5 @@
+<!DOCTYPE html>
+<html>
+ <head><title><%= title %></title></head>
+ <body><%= content %></body>
+</html>
@@ -0,0 +1,18 @@
+package MyMojoliciousApp;
+use Mojo::Base 'Mojolicious';
+
+# This method will run once at server start
+sub startup {
+ my $self = shift;
+
+ # Documentation browser under "/perldoc"
+ $self->plugin('PODRenderer');
+
+ # Routes
+ my $r = $self->routes;
+
+ # Normal route to controller
+ $r->route('/')->to('example#welcome');
+}
+
+1;
@@ -0,0 +1,13 @@
+package MyMojoliciousApp::Example;
+use Mojo::Base 'Mojolicious::Controller';
+
+# This action will render a template
+sub welcome {
+ my $self = shift;
+
+ # Render template "example/welcome.html.ep" with message
+ $self->render(
+ message => 'Welcome to the Mojolicious real-time web framework!');
+}
+
+1;
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Welcome to the Mojolicious real-time web framework!</title>
+ </head>
+ <body>
+ <h2>Welcome to the Mojolicious real-time web framework!</h2>
+ This is the static document "public/index.html",
+ <a href="/">click here</a> to get back to the start.
+ </body>
+</html>
@@ -0,0 +1,21 @@
+#!/usr/bin/env perl
+use Mojo::Base -strict;
+
+use File::Basename 'dirname';
+use File::Spec;
+
+use lib join '/', File::Spec->splitdir(dirname(__FILE__)), 'lib';
+use lib join '/', File::Spec->splitdir(dirname(__FILE__)), '..', 'lib';
+
+# Check if Mojolicious is installed;
+die <<EOF unless eval 'use Mojolicious::Commands; 1';
+It looks like you don't have the Mojolicious framework installed.
+Please visit http://mojolicio.us for detailed installation instructions.
+
+EOF
+
+# Application
+$ENV{MOJO_APP} ||= 'MyMojoliciousApp';
+
+# Start commands
+Mojolicious::Commands->start;
@@ -0,0 +1,9 @@
+use Mojo::Base -strict;
+
+use Test::More tests => 4;
+use Test::Mojo;
+
+use_ok 'MyMojoliciousApp';
+
+my $t = Test::Mojo->new('MyMojoliciousApp');
+$t->get_ok('/')->status_is(200)->content_like(qr/Mojolicious/i);
@@ -0,0 +1,10 @@
+% layout 'default';
+% title 'Welcome';
+<h2><%= $message %></h2>
+This page was generated from the template
+"templates/example/welcome.html.ep" and the layout
+"templates/layouts/default.html.ep",
+<a href="<%== url_for %>">click here</a>
+to reload the page or
+<a href="/index.html">here</a>
+to move forward to a static page.
@@ -0,0 +1,5 @@
+<!DOCTYPE html>
+<html>
+ <head><title><%= title %></title></head>
+ <body><%= content %></body>
+</html>
@@ -1,5 +1,17 @@
#!/usr/bin/env perl
use Mojolicious::Lite;
+use Mojolicious::Plugin::Mongodb;
+use lib 'lib';
+
+sub startup {
+ my $self = shift;
+ $self->plugin('mongodb', {
+ host => 'twinfo-j3nnn1-data-0.dotcloud.com',
+ port => 22283,
+ database => 'metrics',
+ helper => 'db',
+ });
+}
# Documentation browser under "/perldoc" (this plugin requires Perl 5.10)
#plugin 'pod_renderer';
Oops, something went wrong.

0 comments on commit 4678342

Please sign in to comment.