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
module ViJedi::SentenceUtil | |
SIMILARITY_PERCENTAGE = 0.4 | |
# boolean check to see if the source and prime sentences are the same | |
def self.similar(source, prime) | |
return compute_values(source, prime)[:mismatch_percentage] < SIMILARITY_PERCENTAGE | |
end | |
# returns the word difference between the source and prime | |
def self.word_distance(source, prime) |
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
create_table :no_autoincrements, :primary_key => :my_id do |t| | |
t.integer :my_id, :null => false | |
end |
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
User.where("facebook_id IN (:facebook_ids)", {:facebook_ids => ids}) | |
# You need to manually add parenthesis around the parameter, since AR does not do anything magical with the query. | |
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
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> | |
<property name="ignoreResourceNotFound" value="false"/> | |
<property name="locations"> | |
<list> | |
<value>http://noah.domain/path/to/file</value> | |
</list> | |
</property> | |
</bean> |
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
public class OrderedPropertyPlaceholderConfigurator implements Ordered, BeanFactoryPostProcessor { | |
private Resource[] locations; | |
private String systemPropertiesModeName; | |
private Boolean ignoreResourceNotFound; | |
private String propertyPlaceholderPrefix; | |
private String propertyPlaceholderSuffix; | |
@Override | |
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException { | |
PropertyPlaceholderConfigurer configurer = new PropertyPlaceholderConfigurer(); |
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
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> | |
<property name="ignoreResourceNotFound" value="false"/> | |
<property name="ignoreUnresolvablePlaceholders" value="true" /> | |
<property name="placeholderPrefix" value="@{" /> | |
<property name="placeholderSuffix" value="}" /> | |
<property name="locations"> | |
<list> | |
<value>classpath:env.properties</value> | |
</list> | |
</property> |
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
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>com.tejusparikh</groupId> | |
<artifactId>tejusparikh</artifactId> | |
<packaging>pom</packaging> | |
<version>1.0-SNAPSHOT</version> | |
<modules> | |
<module>web</module> | |
</modules> | |
<properties> |
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
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | |
<parent> | |
<groupId>com.tejusparikh</groupId> | |
<artifactId>tejusparikh</artifactId> | |
<version>1.0.RELEASE</version> | |
</parent> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>com.tejusparikh.web</groupId> | |
<artifactId>tejusparikh-web</artifactId> | |
<packaging>war</packaging> |
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
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | |
<parent> | |
<groupId>com.tejusparikh</groupId> | |
<artifactId>tejusparikh</artifactId> | |
<version>1.0-SNAPSHOT</version> | |
</parent> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>com.tejusparikh.web</groupId> | |
<artifactId>tejusparikh-web</artifactId> | |
<packaging>war</packaging> |
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
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>com.tejusparikh</groupId> | |
<artifactId>tejusparikh</artifactId> | |
<packaging>pom</packaging> | |
<version>1.0.RELEASE</version> | |
<modules> | |
<module>web</module> | |
</modules> | |
<properties> |
OlderNewer