repo_name stringlengths 6 97 | path stringlengths 3 341 | text stringlengths 8 1.02M |
|---|---|---|
malloc3/YG_Harmonization | libraries/BiotekPlateReaderCalibration.rb | <gh_stars>0
needs 'Standard Libs/MatrixTools'
needs 'YG_Harmonization/PlateReaderMethods'
# This module is used for doing the extraction and calculations required to
# successfully calibrate the Biotek Plate reader
#
module BiotekPlateReaderCalibration
include PlateReaderMethods
include MatrixTools
require ... |
dgf1979/epicodus-tic_tac_toe | lib/board.rb | require('pry')
class Board
attr_reader(:spaces)
define_method(:initialize) do
@spaces = []
x = 0
y = 0
3.times() do
3.times() do
@spaces.push(Space.new({:x => x, :y => y}))
x += 1
end
x = 0
y += 1
end
end
define_method(:find) do |x, y|
return @... |
dgf1979/epicodus-tic_tac_toe | lib/game.rb | require('pry')
class Game
@@game = nil
attr_reader(:player1, :player2, :board, :player1_turn, :message)
define_method(:initialize) do
@player1 = Player.new({:mark => "X"})
@player2 = Player.new({:mark => "O"})
@board = Board.new()
@message = "Welcome to Tic Tac Toe!"
@player1_turn = true
e... |
dgf1979/epicodus-tic_tac_toe | spec/tic_tac_toe_integration_spec.rb | require('capybara/rspec')
require('./app')
Capybara.app = Sinatra::Application
set(:show_exceptions, false)
describe("Sinatra test", {:type => :feature}) do
it('checks a test page to verify basic Sinatra functionality') do
visit('/test')
expect(page).to have_content('Sinatra OK')
end
end
describe("tic tac... |
dgf1979/epicodus-tic_tac_toe | spec/space_spec.rb | require('rspec')
require('space')
describe(Space) do
describe("#x") do
it("returns the space's x coordinate") do
test_space = Space.new({ :x => 1, :y => 2 })
expect(test_space.x()).to(eq(1))
end
end
describe("#y") do
it("returns the space's y coordinate") do
test_space = Space.new... |
dgf1979/epicodus-tic_tac_toe | app.rb | <filename>app.rb
require('sinatra')
require('sinatra/reloader')
also_reload('lib/**/*.rb')
require('./lib/game')
require('./lib/board')
require('./lib/space')
require('./lib/player')
require('pry')
get('/test') do
erb(:test)
end
get('/') do
if Game.load() == nil #start a new game if one is not in progress
... |
dgf1979/epicodus-tic_tac_toe | spec/player_spec.rb | require('rspec')
require('player')
describe(Player) do
describe("#mark") do
it("returns the player's mark") do
test_player = Player.new({ :mark => "X" })
expect(test_player.mark()).to(eq("X"))
end
end
end
|
dgf1979/epicodus-tic_tac_toe | spec/game_spec.rb | require('rspec')
require('game')
describe(Game) do
describe("#initialize") do
it('sets up a new game state') do
new_game = Game.new()
expect(new_game.player1.mark).to(eq("X"))
expect(new_game.player2.mark).to(eq("O"))
expect(new_game.board.class).to(eq(Board))
end
end
describe("... |
dgf1979/epicodus-tic_tac_toe | lib/space.rb | class Space
attr_reader(:x, :y, :marked_by)
define_method(:initialize) do |attributes|
@x = attributes.fetch(:x)
@y = attributes.fetch(:y)
@marked_by = nil
end
define_method(:mark_by) do |player|
@marked_by = player
end
end
|
dgf1979/epicodus-tic_tac_toe | lib/player.rb | <reponame>dgf1979/epicodus-tic_tac_toe
class Player
attr_reader(:mark)
define_method(:initialize) do |attributes|
@mark = attributes.fetch(:mark)
end
end
|
dgf1979/epicodus-tic_tac_toe | spec/board_spec.rb | require("rspec")
require('board')
describe(Board) do
describe('#initialize') do
it("creates 9 spaces when it is initialized") do
board = Board.new()
expect(board.spaces.length()).to(eq(9))
end
end
describe('#find') do
it('returns the space at the given coordinates') do
board = Boa... |
csfrancis/lmdb_store | lib/lmdb_store.rb | # frozen_string_literal: true
require 'lmdb'
require 'active_support/cache'
class LmdbStore < ActiveSupport::Cache::Store
def initialize(path, options = nil)
options ||= {}
super(options)
@path = path
@max_size = options[:size] || 32.megabytes
@name = options[:name] || 'cache'
@env = LMDB.ne... |
csfrancis/lmdb_store | lmdb_store.gemspec | Gem::Specification.new do |s|
s.name = 'lmdb_store'
s.version = '0.0.1'
s.summary = 'LMDB implementation of ActiveSupport::Store'
s.description = <<-DOC
This gem provides an ActiveSupport::Store implementation that is backed by an LMDB database.
DOC
s.homepage = 'https://github.com/csfrancis/lmdb_store'... |
csfrancis/lmdb_store | lmdb-profile.rb | <reponame>csfrancis/lmdb_store
#!/usr/bin/env ruby
# frozen_string_literal:true
require 'lmdb'
require 'pry'
# Customize these things
DURATION = 5
NUM_WORKERS = 16
UPDATE_SLEEP = 0.001
class Worker
class Result
attr_accessor :count, :duration
attr_reader :worker_num
def initialize(worker_num)
@... |
csfrancis/lmdb_store | test/lmdb_store_test.rb | # frozen_string_literal: true
require 'minitest/autorun'
require 'lmdb_store'
require 'fileutils'
class TestLmdbStore < Minitest::Test
def setup
FileUtils.rm_rf(db_path)
FileUtils.mkdir_p(db_path)
end
def test_create
LmdbStore.new(db_path)
end
def test_write
c = LmdbStore.new(db_path)
... |
cleversoap/homebrew-cask | Casks/second-life-viewer.rb | cask :v1 => 'second-life-viewer' do
version '3.6.13.284995'
sha256 '8aa1bc39077452c3006390d4a888ca4113c087e8cdc78f5008dc85091015627d'
url "http://download.cloud.secondlife.com/Viewer_3/Second_Life_#{version.gsub('.','_')}_i386.dmg"
name 'Second Life Viewer'
homepage 'http://secondlife.com/'
license :unknow... |
cleversoap/homebrew-cask | Casks/seil.rb | <filename>Casks/seil.rb
cask :v1 => 'seil' do
version '11.0.0'
sha256 '4b2a5afe8c45a46af7b8a5ef291615627d795c90ba1614b5532eafa479e8f30b'
url "https://pqrs.org/macosx/keyremap4macbook/files/Seil-#{version}.dmg"
name 'Seil'
homepage 'https://pqrs.org/macosx/keyremap4macbook/seil.html.en'
license :public_doma... |
cleversoap/homebrew-cask | Casks/electron.rb | cask :v1 => 'electron' do
version '0.25.1'
sha256 '87c97fbe768c61773226e51a12e0567020e9c5a9807cc75f3ab87d38543c9d03'
url "https://github.com/atom/electron/releases/download/v#{version}/electron-v#{version}-darwin-x64.zip"
appcast 'https://github.com/atom/electron/releases.atom'
name 'Electron'
homepage 'ht... |
cleversoap/homebrew-cask | Casks/qtox.rb | cask :v1 => 'qtox' do
version :latest
sha256 :no_check
# libtoxcore.so is the official download host per the vendor homepage
url 'https://jenkins.libtoxcore.so/job/qTox%20OS%20X/lastSuccessfulBuild/artifact/qtox.dmg'
name 'qTox'
name 'Tox'
homepage 'https://tox.im/'
license :gpl
app 'qTox.app'
end
|
cleversoap/homebrew-cask | Casks/bartender.rb | cask :v1 => 'bartender' do
version '1.2.38'
sha256 'c4e1a59bf21d9f2d8ab714e0b4ff8504724954c1db06f23d96de3bf0a2084d1b'
url "http://macbartender.com/updates/#{version.gsub('.', '-')}/Bartender.zip",
:referer => 'http://www.macbartender.com'
name 'Bartender'
appcast 'http://www.macbartender.com/updates/Ap... |
arslankhalid0067/bourbon-xquic | lib/bourbon/version.rb | module Bourbon
VERSION = "7.0.0"
end
|
arslankhalid0067/bourbon-xquic | spec/bourbon/utilities/font_source_declaration_spec.rb | <reponame>arslankhalid0067/bourbon-xquic
require "spec_helper"
describe "font-source-declaration" do
before(:all) do
ParserSupport.parse_file("utilities/font-source-declaration")
end
context "called with pipeline" do
it "returns pipeline path" do
rule = 'src: font-url("b.woff2") format("woff2"), '... |
arslankhalid0067/bourbon-xquic | spec/bourbon/library/font_face_spec_1.rb | require "spec_helper"
describe "font-face" do
before(:all) do
ParserSupport.parse_file("library/font-face-1")
end
context "called with defaults" do
it "outputs defaults" do
ruleset = 'font-family: "source-sans-pro"; ' +
'src: url("/fonts/source-sans-pro/source-sans-pro-regular.woff... |
arslankhalid0067/bourbon-xquic | spec/support/sass_support.rb | <reponame>arslankhalid0067/bourbon-xquic
module SassSupport
def generate_css
FileUtils.mkdir("tmp")
`sass -I . spec/fixtures:tmp --update --precision=5 --sourcemap=none`
end
def clean_up
FileUtils.rm_rf("tmp")
end
end
|
arslankhalid0067/bourbon-xquic | spec/bourbon/library/font_face_spec_3.rb | require "spec_helper"
describe "font-face" do
before(:all) do
ParserSupport.parse_file("library/font-face-3")
end
context "called with defaults" do
it "outputs defaults" do
ruleset = 'font-family: "pitch";' +
'src: font-url("/fonts/pitch.woff2") format("woff2");'
expect("@fo... |
sous-chefs/dpkg_autostart | metadata.rb | name 'dpkg_autostart'
maintainer '<NAME>'
maintainer_email '<EMAIL>'
description 'Control service actions initialized from dpkg'
license 'Apache-2.0'
source_url 'https://github.com/sous-chefs/dpkg_autostart'
issues_url 'https://github.com/sous-chefs/dpkg_autostart/issu... |
superfeedr/superfeedr-rb | spec/spec_helper.rb | require 'rubygems'
require 'minitest/spec'
require 'mocha'
$:.unshift File.expand_path(File.join(File.dirname(__FILE__), '..'))
$:.unshift File.expand_path(File.join(File.dirname(__FILE__), *%w[.. lib]))
require 'superfeedr-rb'
def message_node
Blather::XMPPNode.import(Nokogiri::XML(<<-XML).root)
<message from=... |
superfeedr/superfeedr-rb | lib/superfeedr/entry.rb | <gh_stars>1-10
module Superfeedr
class Entry < Blather::Stanza::PubSubItem
NS = 'http://www.w3.org/2005/Atom'.freeze
def self.parse(node)
node.find('//ns:event/ns:items/ns2:item', :ns => Blather::Stanza::PubSub::Event.registered_ns,
:ns2 => Blather::Stanz... |
superfeedr/superfeedr-rb | spec/superfeedr/entry_spec.rb | require 'spec_helper'
# <item chunks="1" chunk="1">
# <entry xmlns="http://www.w3.org/2005/Atom">
# <title>16:32:41</title>
# <id>tag:superfeedr.com,2005:String/1257438761</id>
# <published>2009-11-05T16:32:41+00:00</published>
# <summary>sprsquish wanted to know what time it was.</summary>
# <co... |
superfeedr/superfeedr-rb | spec/superfeedr/status_spec.rb | <gh_stars>1-10
require 'spec_helper'
# <status xmlns="http://superfeedr.com/xmpp-pubsub-ext" feed="http://superfeedr.com/dummy.xml">
# <http code="200">957 bytes fetched in 0.228013s</http>
# <next_fetch>2009-11-05T16:34:12+00:00</next_fetch>
# </status>
describe Superfeedr::Status do
before do
@status = Su... |
superfeedr/superfeedr-rb | example/subscribe_superfeedr.rb | require 'superfeedr-rb'
channel = EM::Channel.new
Thread.new do
Superfeedr::Client.connect('<EMAIL>', '<PASSWORD>', :subscribe_channel => channel ) do |client|
client.register_handler(:pubsub_event) do |evt|
pp evt
end
client.register_handler(:disconnected){ client.connect }
end
end
sleep 10
ch... |
superfeedr/superfeedr-rb | spec/spec_superfeedr-rb_spec.rb | <reponame>superfeedr/superfeedr-rb
require 'spec_helper'
describe Superfeedr::Client do
it 'should it herited Blater::Client' do
Superfeedr::Client.new.must_be_kind_of Blather::Client
end
describe '#initialize' do
it 'should initialize deferred attribute like array' do
client = Superfeedr::Client.... |
superfeedr/superfeedr-rb | example/superfeedr.rb | require 'rubygems'
require 'superfeedr-rb'
require 'pp'
Blather.logger.level = Logger::DEBUG
Superfeedr::Client.connect('n@d/r', 'password') do |client|
# Automatically subscribes to the feed
# If already subscribed it simply catches the events coming in.
client.feed('http://superfeedr.com/dummy.xml') do |status... |
superfeedr/superfeedr-rb | lib/superfeedr/status.rb | <reponame>superfeedr/superfeedr-rb
require 'date'
module Superfeedr
class Status < Blather::XMPPNode
NS = 'http://superfeedr.com/xmpp-pubsub-ext'.freeze
def self.parse(node)
self.new('status').inherit node.find_first('//ns:status', :ns => NS)
end
def failed?
false
end
def feed
... |
superfeedr/superfeedr-rb | lib/superfeedr-rb.rb | %w[
blather
blather/client/client
superfeedr/entry
superfeedr/status
].each { |r| require r }
module Superfeedr
class Client < Blather::Client
def self.connect(jid, pass, options={} )
if block_given?
client = self.setup jid, pass, options[:host], options[:port]
EM.run {
... |
isabella232/over_board | app/models/database.rb | class Database
module ClassMethods
def lvarayut
User.new(1, '<NAME>', 'lvarayut', 'https://github.com/lvarayut/relay-fullstack');
end
def features
@features ||= [
Feature.new(1, 'React', 'A JavaScript library for building user interfaces.', 'https://facebook.github.io/react'),
... |
isabella232/over_board | app/graphql/types/mutation_type.rb | Types::MutationType = GraphQL::ObjectType.define do
name "Mutation"
# Add the mutation's derived field to the mutation type
field :addFeature, field: Mutations::AddFeatureMutation.field
end
|
isabella232/over_board | app/graphql/mutations/add_feature_mutation.rb | <filename>app/graphql/mutations/add_feature_mutation.rb
Mutations::AddFeatureMutation = GraphQL::Relay::Mutation.define do
# Used to name derived types, eg `"AddFeatureInput"`:
name 'AddFeature'
# Accessible from `inputs` in the resolve function:
input_field :name, !types.String
input_field :description, !t... |
isabella232/over_board | app/models/feature.rb | Feature = Struct.new(:id, :name, :description,:url) |
isabella232/over_board | app/graphql/types/feature_type.rb | <reponame>isabella232/over_board
Types::FeatureType = GraphQL::ObjectType.define do
name "Feature"
global_id_field :id
field :id, !types.ID
field :name, !types.String
field :description, !types.String
field :url, !types.String
implements GraphQL::Relay::Node.interface
end
|
isabella232/over_board | app/graphql/types/query_type.rb | <filename>app/graphql/types/query_type.rb
Types::QueryType = GraphQL::ObjectType.define do
name "Query"
# Used by Relay to lookup objects by UUID:
field :node, GraphQL::Relay::Node.field
# Fetches a list of objects given a list of IDs
field :nodes, GraphQL::Relay::Node.plural_field
field :viewer do
t... |
isabella232/over_board | app/models/user.rb | <gh_stars>1-10
User = Struct.new(:id, :name, :username, :website) |
isabella232/over_board | app/graphql/over_board_schema.rb | OverBoardSchema = GraphQL::Schema.define do
query Types::QueryType
mutation Types::MutationType
id_from_object ->(object, type_definition, query_ctx) {
# Call your application's UUID method here
# It should return a string
GraphQL::Schema::UniqueWithinType.encode(type_definition.name, object.id)
}
... |
isabella232/over_board | app/graphql/types/user_type.rb | Types::UserType = GraphQL::ObjectType.define do
name "User"
global_id_field :id
field :id, !types.ID
field :username, !types.String
field :website, !types.String
connection :features, Types::FeatureType.connection_type do
resolve ->(user, args, ctx) {
Database.get_features
}
end
impleme... |
gnufied/merb_ajax | lib/merb_ajax/javascript_helper.rb | <reponame>gnufied/merb_ajax
module Merb
module Helpers
# Provides functionality for working with JavaScript in your views.
#
# == Ajax, controls and visual effects
#
# * For information on using Ajax, see
# Merb::Helpers::PrototypeHelper.
# * For information on using controls and visu... |
gnufied/merb_ajax | lib/mixins/render.rb | module Merb
module RenderMixin
# Uses the JavaScriptGenerator to render a JavaScript block, updating the current view.
# (similar to Rails' render :update)
#
# render_js_block do |page|
# page.replace_html 'user_list', :partial => 'user', :collection => @users
# page.vis... |
gnufied/merb_ajax | lib/core_ext/hash.rb | class Hash #:nodoc;
# Return a new hash with all keys converted to symbols.
def symbolize_keys
inject({}) do |options, (key, value)|
options[key.to_sym] = value
options
end
end
end |
gnufied/merb_ajax | lib/core_ext/array.rb | <reponame>gnufied/merb_ajax<gh_stars>1-10
class Array #:nodoc:
def extract_options!
last.is_a?(::Hash) ? pop : {}
end
end |
gnufied/merb_ajax | lib/merb_ajax/form_tag_helper.rb | module Merb
module Helpers
# Provides a number of methods for creating form tags that doesn't rely on an object assigned to the template like
# FormHelper does. Instead, you provide the names and values manually.
#
# NOTE: The HTML options <tt>disabled</tt>, <tt>readonly</tt>, and <tt>multiple</tt> ca... |
gnufied/merb_ajax | lib/merb_ajax/merbtasks.rb | <reponame>gnufied/merb_ajax
namespace :merb_ajax do
desc "Do something for merb_ajax"
task :default do
puts "merb_ajax doesn't do anything"
end
end |
gnufied/merb_ajax | lib/merb_ajax.rb | module Merb
module Ajax
CORE_EXT_DIR = File.dirname(__FILE__) / 'core_ext'
CORE_EXT_FILES = Dir["#{CORE_EXT_DIR}/*.rb"].collect {|h| h.match(/\/(\w+)\.rb/)[1]}
HELPERS_DIR = File.dirname(__FILE__) / 'merb_ajax'
HELPERS_FILES = Dir["#{HELPERS_DIR}/*_helper.rb"].collect {|h| h.match(/\/(\w+)\.rb/)[1]... |
vcilabs/terradactyl | lib/terradactyl/version.rb | # frozen_string_literal: true
module Terradactyl
VERSION = '1.1.2'
end
|
vcilabs/terradactyl | terradactyl.gemspec | lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'terradactyl/version'
Gem::Specification.new do |spec|
spec.name = "terradactyl"
spec.version = Terradactyl::VERSION
spec.authors = ["<NAME>"]
spec.email = ["<EMAIL>"]
spec.license ... |
MercurieVV/jobs-crawler | core/src/main/scala/com/github/mercurievv/http4s/coders/scalaxb/Http4sScalaxbEncodersDecoders.scala | package com.github.mercurievv.http4s.coders.scalaxb
import cats.Monad
import cats.implicits._
import cats.effect.ConcurrentEffect
import fs2.Chunk
import org.http4s.headers.`Content-Type`
import org.http4s._
import scalaxb.XMLFormat
import scala.xml.NamespaceBinding
/**
* Created with IntelliJ IDEA.
* User: <NAM... |
MercurieVV/jobs-crawler | core/src/main/scala/com/github/mercurievv/jobsearch/model/Job.scala | <reponame>MercurieVV/jobs-crawler
package com.github.mercurievv.jobsearch.model
import java.time.ZonedDateTime
import org.http4s.Uri
import org.http4s.blaze.http.Url
/**
* Created with IntelliJ IDEA.
* User: <NAME>
* Date: 3/10/2020
* Time: 5:05 PM
* Contacts: email: <EMAIL> Skype: 'grobokopytoff' or 'merc... |
MercurieVV/jobs-crawler | core/src/main/scala/com/github/mercurievv/jobsearch/businesslogic/JobsStorage.scala | <gh_stars>0
package com.github.mercurievv.jobsearch.businesslogic
import com.github.mercurievv.jobsearch.model.Job
/**
* Created with IntelliJ IDEA.
* User: <NAME>
* Date: 3/19/2020
* Time: 9:48 PM
* Contacts: email: <EMAIL> Skype: 'grobokopytoff' or 'mercurievv'
*/
trait JobsStorage[F[_], S[_]] {
// def filte... |
MercurieVV/jobs-crawler | core/src/main/scala/com/github/mercurievv/jobsearch/model/package.scala | package com.github.mercurievv.jobsearch
import shapeless.tag
import shapeless.tag.@@
/**
* Created with IntelliJ IDEA.
* User: <NAME>
* Date: 3/10/2020
* Time: 5:19 PM
* Contacts: email: <EMAIL> Skype: 'grobokopytoff' or 'mercurievv'
*/
package object model {
trait IdTag
type Id = String @@ IdTag
object I... |
MercurieVV/jobs-crawler | core/src/main/scala/com/github/mercurievv/jobsearch/App.scala | package com.github.mercurievv.jobsearch
/**
* Created with IntelliJ IDEA.
* User: <NAME>
* Date: 3/13/2020
* Time: 5:24 PM
* Contacts: email: <EMAIL> Skype: 'grobokopytoff' or 'mercurievv'
*/
object App extends zio.App {
import zio._
override def run(args: List[String]): ZIO[zio.ZEnv, Nothing, Int] = ... |
MercurieVV/jobs-crawler | core/src/main/scala/com/github/mercurievv/jobsearch/businesslogic/JobsServer.scala | <reponame>MercurieVV/jobs-crawler
package com.github.mercurievv.jobsearch.businesslogic
import cats.data.NonEmptyChain
import cats._
import cats.implicits._
import com.github.mercurievv.jobsearch.Errorable
import com.github.mercurievv.jobsearch.model.Job
import com.github.mercurievv.jobsearch.remote.stackowerflow.{Rss... |
MercurieVV/jobs-crawler | core/src/main/scala/com/github/mercurievv/jobsearch/persistence/DynamodbJobsStorage.scala | package com.github.mercurievv.jobsearch.persistence
import java.time.{ZoneId, ZonedDateTime}
import cats.effect.Async
import cats.kernel.Eq
import com.amazonaws.services.dynamodbv2.AmazonDynamoDBAsync
import com.github.mercurievv.jobsearch.businesslogic.JobsStorage
import com.github.mercurievv.jobsearch.model.{Job, Jo... |
MercurieVV/jobs-crawler | project/BuildKeys.scala | <filename>project/BuildKeys.scala
import sbt.Def._
import sbt.{Def, settingKey}
object BuildKeys {
/**
* When this value is set, it means we want to test and publish a custom Scala.js
* version, therefore we shouldn't re-publish the JVM packages.
*/
lazy val customScalaJSVersion =
Option(System.get... |
MercurieVV/jobs-crawler | core/src/test/scala/com/github/mercurievv/jobsearch/xml/RssTest.scala | package com.github.mercurievv.jobsearch.xml
import com.github.mercurievv.rss.generated.XMLProtocol
import javax.xml.datatype.{DatatypeFactory, XMLGregorianCalendar}
import scalaxb.{DataTypeFactory, ElemName, Helper, XMLCalendar, XMLFormat}
import scala.xml.{Text, XML}
class RssTest extends org.scalatest.FunSuite {... |
MercurieVV/jobs-crawler | core/src/main/scala/com/github/mercurievv/jobsearch/remote/stackowerflow/RssItemToJobConverter.scala | <gh_stars>0
package com.github.mercurievv.jobsearch.remote.stackowerflow
import java.time.ZonedDateTime
import cats.Monad
import cats.data.{Validated, ValidatedNec}
import cats.implicits._
import com.github.mercurievv.jobsearch._
import com.github.mercurievv.jobsearch.model._
import com.github.mercurievv.rss.generate... |
MercurieVV/jobs-crawler | core/src/main/scala/com/github/mercurievv/jobsearch/Module.scala | <filename>core/src/main/scala/com/github/mercurievv/jobsearch/Module.scala
package com.github.mercurievv.jobsearch
import cats.{FunctorFilter, Monad, ~>}
import cats.effect.{Async, ConcurrentEffect}
import com.amazonaws.client.builder.AwsClientBuilder.EndpointConfiguration
import com.amazonaws.services.dynamodbv2.Amaz... |
MercurieVV/jobs-crawler | core/src/main/scala/com/github/mercurievv/jobsearch/AppHandler.scala | <reponame>MercurieVV/jobs-crawler
package com.github.mercurievv.jobsearch
/**
* Created with IntelliJ IDEA.
* User: <NAME>
* Date: 5/30/2020
* Time: 6:58 PM
* Contacts: email: <EMAIL> Skype: 'grobokopytoff' or 'mercurievv'
*/
import java.io.{InputStream, OutputStream}
import cats._
import cats.implicits._... |
MercurieVV/jobs-crawler | core/src/main/scala/com/github/mercurievv/jobsearch/xml/CustomXmlProtocol.scala | <gh_stars>0
package com.github.mercurievv.jobsearch.xml
import java.text.DateFormat
import java.time.{LocalDateTime, OffsetDateTime, ZoneId, ZonedDateTime}
import java.time.format.DateTimeFormatter
import java.util.{Date, Locale}
import com.github.mercurievv.rss.generated.XMLProtocol
import javax.xml.datatype.{Dataty... |
MercurieVV/jobs-crawler | core/src/main/scala/com/github/mercurievv/jobsearch/businesslogic/CollectJobs.scala | package com.github.mercurievv.jobsearch.businesslogic
import cats._
import cats.data.Validated.{Invalid, Valid}
import cats.implicits._
import com.github.mercurievv.jobsearch.model.Job
import org.slf4j.{Logger, LoggerFactory}
/**
* Created with IntelliJ IDEA.
* User: <NAME>
* Date: 3/19/2020
* Time: 9:52 PM
... |
MercurieVV/jobs-crawler | core/src/main/scala/com/github/mercurievv/jobsearch/model/JobsResource.scala | <gh_stars>0
package com.github.mercurievv.jobsearch.model
/**
* Created with IntelliJ IDEA.
* User: <NAME>
* Date: 3/12/2020
* Time: 2:29 PM
* Contacts: email: <EMAIL> Skype: 'grobokopytoff' or 'mercurievv'
*/
import enumeratum._
sealed trait JobsResource extends EnumEntry {}
object JobsResource extends Enum[J... |
MercurieVV/jobs-crawler | core/src/main/scala/com/github/mercurievv/jobsearch/remote/stackowerflow/StackowerflowJobsApi.scala | package com.github.mercurievv.jobsearch.remote.stackowerflow
import cats.effect._
import com.github.mercurievv.http4s.coders.scalaxb.Http4sScalaxbEncodersDecoders._
import com.github.mercurievv.jobsearch.xml.CustomXmlProtocol._
import com.github.mercurievv.rss.generated.Rss
import org.http4s.client.Client
import org.h... |
MercurieVV/jobs-crawler | core/src/main/scala/com/github/mercurievv/jobsearch/remote/upwork/UpworkJobsApi.scala | package com.github.mercurievv.jobsearch.remote.upwork
import cats.effect._
import com.github.mercurievv.http4s.coders.scalaxb.Http4sScalaxbEncodersDecoders._
import com.github.mercurievv.jobsearch.xml.CustomXmlProtocol._
import com.github.mercurievv.rss.generated.Rss
import org.http4s.client.Client
import org.http4s.i... |
MercurieVV/jobs-crawler | project/plugins.sbt | addSbtPlugin("com.github.tkawachi" % "sbt-doctest" % "0.9.6")
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.7.0")
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.6.0")
addSbtPlugin("com.dwijnand" % "sbt-dynver" % "4.0.0")
addSbtPl... |
MercurieVV/jobs-crawler | core/src/main/scala/com/github/mercurievv/jobsearch/package.scala | package com.github.mercurievv
import cats.data.{NonEmptyChain, Validated}
import zio.Task
/**
* Created with IntelliJ IDEA.
* User: <NAME>
* Date: 3/19/2020
* Time: 6:34 PM
* Contacts: email: <EMAIL> Skype: 'grobokopytoff' or 'mercurievv'
*/
package object jobsearch {
type AIO[+A] = Task[A]
type Errorable[A... |
MercurieVV/jobs-crawler | core/src/main/scala/com/github/mercurievv/jobsearch/persistence/package.scala | <filename>core/src/main/scala/com/github/mercurievv/jobsearch/persistence/package.scala
package com.github.mercurievv.jobsearch
import com.github.mercurievv.jobsearch.model.{Company, Id, JobsResource, Tag}
import enumeratum.NoSuchMember
import org.http4s.Uri
import org.scanamo.DynamoFormat
/**
* Created with Intell... |
Liuxg16/BrainMatrix | scala-package/core/src/test/scala/ml/dmlc/mxnet/train/ConvSuite.scala | <gh_stars>100-1000
package ml.dmlc.mxnet.train
import ml.dmlc.mxnet.optimizer.SGD
import ml.dmlc.mxnet._
import org.scalatest.{BeforeAndAfterAll, FunSuite}
import org.slf4j.LoggerFactory
import scala.collection.mutable.ListBuffer
import scala.sys.process._
class ConvSuite extends FunSuite with BeforeAndAfterAll {
... |
Liuxg16/BrainMatrix | scalakernel/src/main/java/thu/brainmatrix/util/CVTool.scala | <reponame>Liuxg16/BrainMatrix
package thu.brainmatrix.util
import thu.brainmatrix.NDArray
import com.sksamuel.scrimage.Image
import com.sksamuel.scrimage.Pixel
import com.sksamuel.scrimage.filter.GaussianBlurFilter
import com.sksamuel.scrimage.nio.JpegWriter
object CVTool {
def saveImage(img: NDArray, filename:... |
Liuxg16/BrainMatrix | scalakernel/src/main/java/thu/brainmatrix/AttrScope.scala | <filename>scalakernel/src/main/java/thu/brainmatrix/AttrScope.scala
package thu.brainmatrix
/**
* Attribute manager for scoping.
* User can also inherit this object to change naming behavior.
* @author <NAME>
*/
class AttrScope(attr: Map[String, String] = Map.empty) {
private var _attr = attr
/**
* Get the ... |
Liuxg16/BrainMatrix | scalakernel/src/main/java/thu/brainmatrix/util/CodeTrick.scala | package thu.brainmatrix.util
object CodeTrick {
def main(args:Array[String]){
ArrayFillTest
}
def ArrayFillTest{
val arr = Array.fill[Float](5)(3f)
(arr).foreach(println)
}
} |
Liuxg16/BrainMatrix | scalakernel/src/main/java/thu/brainmatrix/synapse/Dendrite.scala | <filename>scalakernel/src/main/java/thu/brainmatrix/synapse/Dendrite.scala
package thu.brainmatrix.synapse
import thu.brainmatrix.NDArray
import thu.brainmatrix.Context
import thu.brainmatrix.Shape
class Dendrite(val ctx: Context = Context.defaultCtx) extends Module{
val onenda = NDArray.ones(Config.SHAPE,ctx)
var ... |
Liuxg16/BrainMatrix | scalakernel/src/main/java/thu/brainmatrix/synapse_symbol/Synapse.scala | <reponame>Liuxg16/BrainMatrix
package thu.brainmatrix.synapse_symbol
import thu.brainmatrix.NDArray
import thu.brainmatrix.Symbol
import thu.brainmatrix.Context
import thu.brainmatrix.Shape
class Synapse(val ctx: Context = Context.defaultCtx,val name:String) extends Module{
// a basic synapse
override var variab... |
Liuxg16/BrainMatrix | scalakernel/src/main/java/thu/brainmatrix/gan/DCgan.scala | package thu.brainmatrix.gan
class DCgan {
} |
Liuxg16/BrainMatrix | scalakernel/src/main/java/thu/brainmatrix/OperatorProperty.scala | <reponame>Liuxg16/BrainMatrix<filename>scalakernel/src/main/java/thu/brainmatrix/OperatorProperty.scala
package thu.brainmatrix
import thu.brainmatrix.Base._
import scala.collection.mutable.{ListBuffer,ArrayBuffer}
import scala.Vector
/**
* by liuxianggen
* 2015-3-3
* bref like OperatorProperty in mxnet,provide Op... |
Liuxg16/BrainMatrix | scalakernel/src/main/java/thu/brainmatrix/lstmbyguo/LSTMModel.scala | package thu.brainmatrix.lstmbyguo
import java.io.File
import java.io.FileNotFoundException
import scala.collection.immutable.Set
import scala.io.Source
import thu.brainmatrix.NDArray
import thu.brainmatrix.Random
import thu.brainmatrix.Shape
/*
* 这是标准LSTM模型的变种,与标准LSTM模型不同之处在于
* input gate,forget gate 和 output gate... |
Liuxg16/BrainMatrix | scalakernel/src/test/java/thu/brainmatrix/suite/TestSymbol.scala | //
//import ml.dmlc.mxnet.Symbol
//import ml.dmlc.mxnet.Base._
//import scala.collection.mutable.{ArrayBuffer,ListBuffer}
//import ml.dmlc.mxnet.Context
//import ml.dmlc.mxnet.lxg.ScalaSymFunction
//import ml.dmlc.mxnet.NDArray
//import ml.dmlc.mxnet.Random
//import ml.dmlc.mxnet.Executor
//
//
object TestSymbol{
// ... |
Liuxg16/BrainMatrix | scala-package/spark/src/main/scala/ml/dmlc/mxnet/spark/utils/Network.scala | <reponame>Liuxg16/BrainMatrix
package ml.dmlc.mxnet.spark.utils
import java.io.IOException
import java.net.{ServerSocket, NetworkInterface}
import java.util.regex.Pattern
/**
* Helper functions to decide ip address / port
* @author Yizhi
*/
object Network {
private val IPADDRESS_PATTERN = Pattern.compile(
"^... |
Liuxg16/BrainMatrix | scalakernel/src/main/java/thu/brainmatrix/cnn/Predition.scala | package thu.brainmatrix.cnn
import java.io.File
import com.sksamuel.scrimage.Image
import thu.brainmatrix.NDArray
import thu.brainmatrix.Context
import thu.brainmatrix.Shape
import thu.brainmatrix.Model
import thu.brainmatrix.Symbol
import thu.brainmatrix.util.CVTool
object Predition {
val newWidth = 28
val... |
Liuxg16/BrainMatrix | scala-package/core/src/test/scala/ml/dmlc/mxnet/RandomSuite.scala | package ml.dmlc.mxnet
import org.scalatest.{BeforeAndAfterAll, FunSuite}
class RandomSuite extends FunSuite with BeforeAndAfterAll {
test("uniform on cpu") {
Context.cpu().withScope {
val (a, b) = (-10, 10)
val shape = Shape(100, 100)
Random.seed(128)
val un1 = Random.uniform(a, b, shape... |
Liuxg16/BrainMatrix | scalakernel/src/main/java/thu/brainmatrix/Serializer.scala | package thu.brainmatrix
import java.io._
import java.nio.ByteBuffer
import java.nio.charset.Charset
import org.apache.commons.codec.binary.Base64
import scala.reflect.ClassTag
/**
* Serialize & deserialize Java/Scala [[Serializable]] objects
* @author <NAME>
*/
abstract class Serializer {
def serialize[T: Clas... |
Liuxg16/BrainMatrix | scalakernel/src/main/java/thu/brainmatrix/lstmSort/lstmSortInfer.scala | package thu.brainmatrix.lstmSort
import thu.brainmatrix._
import thu.brainmatrix.util.IOHelper
import thu.brainmatrix.lstmSort.RnnModel.Bi_LSTMInferenceModel
object lstmSortInfer {
def main(args:Array[String]){
val path_train = "./data/sort.train.txt"
val path_test = "./data/sort.valid.txt"
val saveModelPa... |
Liuxg16/BrainMatrix | scala-package/examples/src/main/scala/ml/dmlc/mxnet/examples/neuralstyle/ModelVgg19.scala | <filename>scala-package/examples/src/main/scala/ml/dmlc/mxnet/examples/neuralstyle/ModelVgg19.scala
package ml.dmlc.mxnet.examples.neuralstyle
import ml.dmlc.mxnet.Context
import ml.dmlc.mxnet.Executor
import ml.dmlc.mxnet.NDArray
import ml.dmlc.mxnet.Symbol
import ml.dmlc.mxnet.Shape
/**
* Definition for the neural... |
Liuxg16/BrainMatrix | scalakernel/src/main/java/thu/brainmatrix/lstmSort/ButketIo.scala | package thu.brainmatrix.lstmSort
import thu.brainmatrix.{DataBatch, DataIter, NDArray, Shape}
import org.slf4j.LoggerFactory
import scala.io.Source
import scala.util.Random
/**
* @author <NAME>
*/
object ButketIo {
type Text2Id = (String, Map[String, Int]) => Array[Int]
type ReadContent = String => String
d... |
Liuxg16/BrainMatrix | scalakernel/src/main/java/thu/brainmatrix/synapse_symbol/Module.scala | package thu.brainmatrix.synapse_symbol
import thu.brainmatrix.NDArray
import thu.brainmatrix.Symbol
abstract class Module {
var variable_table:Array[String]
var variableindices:Array[Int]
def getSymbol():Symbol = {
null
}
def getInitialY():Array[NDArray] = {
Array[NDArray]()
}
... |
Liuxg16/BrainMatrix | scalakernel/src/main/java/thu/brainmatrix/util/RK4.scala | <reponame>Liuxg16/BrainMatrix
package thu.brainmatrix.util
import scala.collection.mutable.ArrayBuffer
import thu.brainmatrix.NDArray
import thu.brainmatrix.Shape
import thu.brainmatrix.Context
//import util.Draw
//import util.ArrOps
/**
* @Author: <NAME>
* Runge-Kutta method
* functions: the functions:
* f(t,dy0,... |
Liuxg16/BrainMatrix | scalakernel/src/main/java/thu/brainmatrix/Context.scala | package thu.brainmatrix
object Context {
val devtype2str = Map(1 -> "cpu", 2 -> "gpu", 3 -> "cpu_pinned")
val devstr2type = Map("cpu" -> 1, "gpu" -> 2, "cpu_pinned" -> 3)
private var _defaultCtx = new Context("cpu", 0)
def defaultCtx: Context = _defaultCtx
def cpu(deviceId: Int = 0): Context = {
new Co... |
Liuxg16/BrainMatrix | scalakernel/src/main/java/thu/brainmatrix/synapse_symbol/Engine.scala | package thu.brainmatrix.synapse_symbol
import thu.brainmatrix.util.RK4
import scala.util.parsing.json._
import thu.brainmatrix.Symbol
import thu.brainmatrix.Visualization
import thu.brainmatrix.Executor
import thu.brainmatrix.NDArray
import thu.brainmatrix.Symbol
import thu.brainmatrix.Context
import thu.brainmatrix.Sh... |
Liuxg16/BrainMatrix | scala-package/core/src/main/scala/ml/dmlc/mxnet/io/MXDataIter.scala | package ml.dmlc.mxnet.io
import ml.dmlc.mxnet.Base._
import ml.dmlc.mxnet.{DataPack, DataBatch, DataIter, NDArray, Shape}
import ml.dmlc.mxnet.IO._
import org.slf4j.LoggerFactory
import scala.collection.mutable.ListBuffer
/**
* DataIter built in MXNet.
* @param handle the handle to the underlying C++ Data Iterator... |
Liuxg16/BrainMatrix | scalakernel/src/main/java/thu/brainmatrix/synapse/Synapse.scala | package thu.brainmatrix.synapse
import thu.brainmatrix.NDArray
import thu.brainmatrix.Context
import thu.brainmatrix.Shape
class Synapse(val ctx: Context = Context.defaultCtx) extends Module{
// a basic synapse
override var variable_table = Array[String]("preCa","preCaBuff","aPreCDK","preSensor","aPreTrkB","preN... |
Liuxg16/BrainMatrix | scalakernel/src/main/java/thu/brainmatrix/char_rnn_symbol/Lstm.scala | package thu.brainmatrix.char_rnn_symbol
import thu.brainmatrix.Symbol
import thu.brainmatrix.Shape
import Config._
object Lstm {
/**
* @author liuxianggen
* @date 20160718
* @brief
* @param n_layer
* @param seq_len:the length of sequence
* @param n_layer
* @param n_layer
... |
Liuxg16/BrainMatrix | scalakernel/src/test/java/thu/brainmatrix/suite/kvstoreTest.scala |
package thu.brainmatrix.suite
import thu.brainmatrix.Base._
import thu.brainmatrix.KVStore
import thu.brainmatrix.MXKVStoreUpdater
import thu.brainmatrix.NDArray
import thu.brainmatrix.Shape
import scala.Vector
object kvstoreTest {
def main(args:Array[String]){
test1
// val kv = KVStore.create()
// ... |
Liuxg16/BrainMatrix | scalakernel/src/test/java/thu/brainmatrix/suite/OPTest.scala | //import
package thu.brainmatrix.suite
import thu.brainmatrix.OperatorProperty
import thu.brainmatrix.OperatorProperty
/***
* by liuxianggen
* 2016-3-9
* brief to test the functions in OperatorProperty class
*/
object OPTest {
def main(args:Array[String]){
println("<--------------TEST OperatorProperty-... |
Liuxg16/BrainMatrix | scalakernel/src/test/java/thu/brainmatrix/suite/TestModelParallel.scala | //import thu.brainmatrix.Symbol
//import thu.brainmatrix.AttrScope
//import thu.brainmatrix.Context
//import thu.brainmatrix.NDArray
//import thu.brainmatrix.Base._
//
//
object ModelParallel {
//
// def main(args:Array[String]){
// testChain
//// testChain_simple
}
//
//
// def testChain {
// val n = 2
//
// ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.