This file contains 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
from django.conf.urls import url | |
from . import views | |
urlpatterns = [ | |
# ex: / | |
url(r'^$', views.review_list, name='review_list'), | |
# ex: /review/5/ | |
url(r'^review/(?P<review_id>[0-9]+)/$', views.review_detail, name='review_detail'), | |
# ex: /wine/ |
This file contains 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
library(shiny) | |
library(tm) | |
library(SnowballC) | |
library(randomForest) | |
options(mc.cores=1) | |
build_model <- function(new_data_df, sparsity) { | |
# Create new data corpus | |
new_corpus <- Corpus(VectorSource(new_data_df$Text)) |
This file contains 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
package com.jadianes.samples.genericdao.factory; | |
import com.jadianes.samples.genericdao.datasource.DataSource; | |
/** | |
* An abstract factory interface representing Dao factories for a particular data source. Implementations of this | |
* interface will typically offer methods to obtain Dao instances for the given DataSource. The use of | |
* factories is optional in the Dao libraries. They are actually traversal to different ModelEntities and vertical | |
* to specific data sources. However, they will increase the portability of business layers across multiple data sources. | |
*/ |
This file contains 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
package com.jadianes.samples.genericdao.datasource; | |
/** | |
* An interface representing data sources in the Dao pattern. | |
*/ | |
public interface DataSource { | |
} |
This file contains 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
package com.jadianes.samples.genericdao.dao; | |
import com.jadianes.samples.genericdao.transfer.TransferEntity; | |
/** | |
* The Dao represents the DataAccessObject (Dao) in the Dao pattern. It is generified so it is associated | |
* will a specific TransferEntity (TransferEntity in the Dao pattern) that will create, update, persist, etc.The interface | |
* enforces the minimum set of operations needed to deal with TransferEntity instances. | |
* Other methods can be used under the following conventions: | |
*/ |
This file contains 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
package com.jadianes.samples.genericdao.transfer; | |
/** | |
* This interface represents a TransferEntity in the Dao pattern used to interchange information between the | |
* BusinessObject and the DataAccessObject (Dao). Tipically the Dao will set/get this object from the | |
* DataSource (e.g. a DB or a message channel). See more info about the Dao pattern in: | |
*/ | |
public interface TransferEntity<K> { | |
public void setId(K id); | |
public K getId(); |