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
class Player | |
def initialize | |
@direction = :forward | |
end | |
def feel | |
return @warrior.feel @direction | |
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
@Stateless @LocalBean | |
public class MyClass{ | |
@Resource(lookup = "java:openejb/Resource/helloDS") | |
private DataSource dataSource; | |
public int countSql(){ | |
Connection conn = datasource.getConnection(); | |
Statement st = null; | |
try{ |
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 org.uagrm.addressbook.util; | |
import java.lang.reflect.Constructor; | |
import java.util.HashMap; | |
import java.util.Map; | |
/** | |
* Generic factory cache component, which binds an specific class definition | |
* with a class instance. It provides caching and creation facilities. Note: All | |
* bind classes should use classes(Boolean) as constructor parameters, native |
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 org.timo.gitconfig; | |
import java.io.IOException; | |
import java.util.logging.Logger; | |
public class GitConfigurationExample { | |
private static final Logger LOG = Logger | |
.getLogger(GitConfigurationExample.class.getName()); |
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
# | |
# This is the config file, and | |
# a '#' or ';' character indicates | |
# a comment | |
# | |
; core variables | |
[core] | |
; Don't trust file modes | |
filemode = false |
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
import java.util.Arrays; | |
import java.util.List; | |
import java.util.logging.Logger; | |
import org.timo.paginator.ListProvider; | |
import org.timo.paginator.Paginator; | |
import org.timo.paginator.Segment; | |
import org.timo.paginator.SegmentProvider; | |
/** |
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
# lines of code | |
def count_files( base_dir ) | |
file_names = Dir.glob( base_dir + "/**/*.{java,py,sh,pl}") | |
puts "Counting LOC in [ #{file_names.length} ] files in folder : #{base_dir}" | |
total_count = 0 | |
file_names.each do |file| | |
total_count += count_file file | |
end | |
puts "Total LOC: #{total_count}" |
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
def find_primes( limit ) | |
list = Hash.new | |
(2..limit).each do |i| | |
list[ i ] = true | |
end | |
init = 2 | |
while init <= limit/2 do | |
if list[init] then | |
index = init * 2 | |
while index <= limit do |
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
def find_primes( limit ) | |
list = Hash.new | |
(2..limit).each do |i| | |
list[ i ] = false | |
end | |
init = 2 | |
while init <= limit do | |
prime = init | |
while prime <= limit do | |
if prime > init then |
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 void close ( Process process ){ | |
// statement.close(process,'0',1000,-1); | |
statement.close(process); | |
} |
OlderNewer