twitter / scala_school Goto Github PK
View Code? Open in Web Editor NEWLessons in the Fundamentals of Scala
Home Page: https://twitter.github.io/scala_school
License: Apache License 2.0
Lessons in the Fundamentals of Scala
Home Page: https://twitter.github.io/scala_school
License: Apache License 2.0
I've tried the following statement but an error occurred in REPL for 2.10. The statement is from 'Advance Types' - 'Other type bounds'.
class Container[A](value: A) { def addIt(implicit evidence: A <%< Int) = 123 + value }
The operator '<%<' does not seem to work, at least for Scala 2.10.
Regular
Welcome to Scala version 2.10.2 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_21).
Type in expressions to have them evaluated.
Type :help for more information.
scala> implicit def strToInt(x:String) = x.toInt
warning: there were 1 feature warning(s); re-run with -feature for details
strToInt: (x: String)Int
scala> class C[A](v:A){def a(implicit ev:A=>Int)=123+ev(v)}
defined class C
scala> class D[A](v:A){def a[A<%Int]=123+v}
<console>:8: error: overloaded method value + with alternatives:
(x: Double)Double <and>
(x: Float)Float <and>
(x: Long)Long <and>
(x: Int)Int <and>
(x: Char)Int <and>
(x: Short)Int <and>
(x: Byte)Int <and>
(x: String)String
cannot be applied to (A)
class D[A](v:A){def a[A<%Int]=123+v}
^
scala> class E[A](v:A){def a(implicit ev:A<%<Int)=123+v}
<console>:8: error: not found: type <%<
class E[A](v:A){def a(implicit ev:A<%<Int)=123+v}
^
<console>:8: error: overloaded method value + with alternatives:
(x: Double)Double <and>
(x: Float)Float <and>
(x: Long)Long <and>
(x: Int)Int <and>
(x: Char)Int <and>
(x: Short)Int <and>
(x: Byte)Int <and>
(x: String)String
cannot be applied to (A)
class E[A](v:A){def a(implicit ev:A<%<Int)=123+v}
using scala 2.9.1
scala> val ahemThenUmm = addAhem().andThen(addUmm ())
:9: error: missing parameter type for expanded function ((x$1) => addAhem(x$1).andThen(((x$2) => addUmm(x$2))))
val ahemThenUmm = addAhem().andThen(addUmm ())
^
:9: error: type mismatch;
found : Char
required: String
val ahemThenUmm = addAhem().andThen(addUmm ())
In the collections chapter.
I have a service that should only be available to auth'd users. When I read Scala School's Finagle page, I'm pretty sure I want to put together my service, some ServiceBuilder code, and a filter, uhm, somehow. I can figure it out if I re-read carefully while thinking really hard. But thinking is for chumps. We probably either want to copy-from and/or link-to an example like
https://github.com/twitter/finagle/blob/master/README.md#Building%20a%20Robust%20Server
On the Basics page, we have this section:
Functions
You can create functions with def.
scala> def addOne(m: Int): Int = m + 1 addOne: (m: Int)Int
...
You can leave off parens on functions with no arguments.
scala> def three() = 1 + 2 three: ()Int scala> three() res2: Int = 3 scala> three res3: Int = 3
Perhaps this could be titled "Methods", and refer to methods instead of functions? You can leave off parens on methods with no arguments, but you can't leave off parens on functions with no arguments. E.g. this will not evaluate the function:
scala> val f = () => 1
f: () => Int = <function0>
scala> f
res19: () => Int = <function0>
The aside further down is helpful, but it seems to take the approach that the difference between functions and methods is very complicated and is best left to language experts. This doesn't necessarily need to be the case (IMO), and a brief explanation of the following shouldn't be too terrifying:
Functions are objects
val threeFunction = () => 1 + 2
Methods are not functions (and hence not objects)
def threeMethod: Int = 1 + 2
This is okay, because in most cases, a method is automatically wrapped in a new function if you try to treat it as one
val threeFunction = threeMethod
The tutorial states that "There is Function1 through 22." whereas it is in fact the case that "There is Function0 through 22.".
The text is at line 102 in scala_school/web/basics2.textile
Hi,
I would like to work on Turkish translation as far as I can.
If there is someone else who are interested in Turkish translation please drop a comment on this issue.
The Mocks
section in Testing with specs
contain the code
import org.specs.Specification
import org.specs.mock.Mockito
class Foo[T] {
def get(i: Int): T
}
which will result in
<console>:16: error: class Foo needs to be abstract, since method get is not defined
class Foo[T] {
^
#202 was recently merged, after which I pulled from master and ran make publish
, as the readme says. This deployed the latest version of the site except it lost all its styling in production.
Steps to reproduce:
make serve
to see the local site with the proper stylingmake publish
to see the production site without the stylingIn a live intro-to-scala class, students wanted a rule of thumb: when defining an interface-ish thing, when do you use a trait vs an abstract class?
Hi,
I'm interested in helping with the spanish translation.
Also:
Here's my script of running the instructions that are currently on the webpage:
[tw-mbp13-jowens workspace]$ mkdir searchbird;cd searchbird
[tw-mbp13-jowens searchbird]$ scala-bootstrapper -p searchbird
writing build.sbt
writing config/development.scala
writing config/production.scala
writing config/staging.scala
writing config/test.scala
writing console
writing Gemfile
writing project/plugins.sbt
writing README.md
writing src/main/scala/com/twitter/searchbird/SearchbirdConsoleClient.scala
writing src/main/scala/com/twitter/searchbird/SearchbirdServiceImpl.scala
writing src/main/scala/com/twitter/searchbird/config/SearchbirdServiceConfig.scala
writing src/main/scala/com/twitter/searchbird/Main.scala
writing src/main/thrift/searchbird.thrift
writing src/scripts/searchbird.sh
writing src/scripts/config.sh
writing src/scripts/devel.sh
writing src/scripts/server.sh
writing src/scripts/service.sh
writing src/test/scala/com/twitter/searchbird/AbstractSpec.scala
writing src/test/scala/com/twitter/searchbird/SearchbirdServiceSpec.scala
writing TUTORIAL.md
[tw-mbp13-jowens searchbird]$ find . -type f
./build.sbt
./config/development.scala
./config/production.scala
./config/staging.scala
./config/test.scala
./console
./Gemfile
./project/plugins.sbt
./README.md
./src/main/scala/com/twitter/searchbird/config/SearchbirdServiceConfig.scala
./src/main/scala/com/twitter/searchbird/Main.scala
./src/main/scala/com/twitter/searchbird/SearchbirdConsoleClient.scala
./src/main/scala/com/twitter/searchbird/SearchbirdServiceImpl.scala
./src/main/thrift/searchbird.thrift
./src/scripts/config.sh
./src/scripts/devel.sh
./src/scripts/searchbird.sh
./src/scripts/server.sh
./src/scripts/service.sh
./src/test/scala/com/twitter/searchbird/AbstractSpec.scala
./src/test/scala/com/twitter/searchbird/SearchbirdServiceSpec.scala
./TUTORIAL.md
I just watched @jdowens present about Finagle to TwitterFolks. They had some questions. The presentation wasn't the same material as Scala School, but questions can point out confusing topics. At some point I should take time to ponder these (and maybe turn some of them into their own individual issues). But I should at least note them down in an issue instead of in a little text file on my laptop:
It says:
This example shows how you might provide authentication (via an
authentication service) in order to convert a Service[AuthHttpReq,
HttpRep] into Service[HttpReq, HttpRep].
I think it should be:
This example shows how you might provide authentication (via an
authentication service) in order to convert a Service[HttpReq,
HttpRep] into Service[AuthHttpReq, HttpRep].
Can I submit a pull request to fix it?
We should have one of these.
There is not Adder, add and i in sample code.
I downloaded the repo and ran "make" and then "make serve"
I can connect to the webserver on port 4000 and see the main page but none of the linked pages can be accessed. I just see, for example "`/basics.html' not found." when going to "http://localhost:4000/basics.html"
Hi, I'll start to translate to portuguese-br.
If anyone would like to help, drop a comment bellow.
https://github.com/blog/2115-upgrading-your-textile-posts-to-markdown
Do you want help converting these documents to markdown? It looks like your site won't render after May 1st. I was looking into making these documents responsive and noticed this might be an issue for this soon?
The apply() section has a factory object. That makes some sense, since that's a common idiom that uses apply().
But we don't intro "object" until the next section, whoopsie.
Mmmaybe reorder sections. Mmmaybe replace "object FooMaker" example with text blurb saying something like "One of the main uses of .apply is a factory object, as shown in the next section." Or maybe some much more brilliant idea.
Hello
My name is Jungbu Yoon and I am living in South Korea.
I am working in the IT industry so, I heard your site that is interesting programs.
I would like to your "Scala school site" translate by Korean to share more Koreans.
When you accept this, I want show a localized source in any way to your approve of this.
My email address is [email protected]
I am waiting your answer and appreciate it.
Thank you
Add Favicon to the default layout
A not-easily-confused reader pointed out that "uhm" and "ahem" are easily confused in the examples at the top of
http://twitter.github.com/scala_school/pattern-matching-and-functional-composition.html
They're not quite the same. But the difference can trip you up.
The difference is subtle; I don't think a tutorial's a great place to explain it. I watched a bunch of n00bs try to learn this in a live class and get confused. I'm a n00b myself, and when I tried to apply the method-vs-fn things I learned in that class I discovered that, uhm, I hadn't understood the explanation so well myself.
So maybe say: there's a difference, but most of the time you don't care. Here are some situations where it matters; if you're confused and you're in one of these situations and you're using a [function|method] try using "the other one".
And we can link to a longer explanation for folks who really want it.
Possible sample code to show differences
class C {
var acc = 0
def inc = { acc += 1 }
val finc = { () => acc += 1 }
def invoke(f: () => Unit) { f() }
}
c invoke c.inc // fail
c invoke c.finc // triumph
c inc // calls c.inc()
c finc // the function c.finc
@sandrobsantos and I would like to work on the Portuguese translation. We have started working on it already: https://github.com/marcelocenerine/scala_school/tree/pt_br.
If anyone wants to join us, please let us know.
I'm trying to publish the site since it looks to me like there's a small rendering error in the "Futures" section here: https://twitter.github.io/scala_school/finagle.html. I'm following the README. Here are the commands I've run and their output.
$ gem install jekyll
Fetching: blankslate-2.1.2.4.gem (100%)
Successfully installed blankslate-2.1.2.4
Fetching: parslet-1.5.0.gem (100%)
Successfully installed parslet-1.5.0
Fetching: toml-0.1.0.gem (100%)
Successfully installed toml-0.1.0
Fetching: redcarpet-2.3.0.gem (100%)
Building native extensions. This could take a while...
Successfully installed redcarpet-2.3.0
Fetching: colorator-0.1.gem (100%)
Successfully installed colorator-0.1
Fetching: safe_yaml-0.9.7.gem (100%)
Successfully installed safe_yaml-0.9.7
Fetching: highline-1.6.21.gem (100%)
Successfully installed highline-1.6.21
Fetching: commander-4.1.5.gem (100%)
Successfully installed commander-4.1.5
Fetching: posix-spawn-0.3.8.gem (100%)
Building native extensions. This could take a while...
Successfully installed posix-spawn-0.3.8
Fetching: yajl-ruby-1.1.0.1.gem (100%)
Building native extensions. This could take a while...
Successfully installed yajl-ruby-1.1.0.1
Fetching: pygments.rb-0.5.4.gem (100%)
Successfully installed pygments.rb-0.5.4
Fetching: maruku-0.7.1.gem (100%)
Successfully installed maruku-0.7.1
Fetching: rb-kqueue-0.2.3.gem (100%)
Successfully installed rb-kqueue-0.2.3
Fetching: listen-1.3.1.gem (100%)
Successfully installed listen-1.3.1
Fetching: fast-stemmer-1.0.2.gem (100%)
Building native extensions. This could take a while...
Successfully installed fast-stemmer-1.0.2
Fetching: classifier-1.3.3.gem (100%)
Successfully installed classifier-1.3.3
Fetching: liquid-2.5.4.gem (100%)
Successfully installed liquid-2.5.4
Fetching: jekyll-1.4.2.gem (100%)
Successfully installed jekyll-1.4.2
Parsing documentation for blankslate-2.1.2.4
Installing ri documentation for blankslate-2.1.2.4
Parsing documentation for parslet-1.5.0
Installing ri documentation for parslet-1.5.0
Parsing documentation for toml-0.1.0
Installing ri documentation for toml-0.1.0
Parsing documentation for redcarpet-2.3.0
unable to convert "\xCF" from ASCII-8BIT to UTF-8 for /Users/slance/.rvm/gems/ruby-2.0.0-p648/extensions/x86_64-darwin-16/2.0.0/redcarpet-2.3.0/redcarpet.bundle, skipping
unable to convert "\xCF" from ASCII-8BIT to UTF-8 for lib/redcarpet.bundle, skipping
Installing ri documentation for redcarpet-2.3.0
Parsing documentation for colorator-0.1
Installing ri documentation for colorator-0.1
Parsing documentation for safe_yaml-0.9.7
Installing ri documentation for safe_yaml-0.9.7
Parsing documentation for highline-1.6.21
Installing ri documentation for highline-1.6.21
Parsing documentation for commander-4.1.5
Installing ri documentation for commander-4.1.5
Parsing documentation for posix-spawn-0.3.8
unable to convert "\xCF" from ASCII-8BIT to UTF-8 for /Users/slance/.rvm/gems/ruby-2.0.0-p648/extensions/x86_64-darwin-16/2.0.0/posix-spawn-0.3.8/posix_spawn_ext.bundle, skipping
unable to convert "\xCF" from ASCII-8BIT to UTF-8 for lib/posix_spawn_ext.bundle, skipping
Installing ri documentation for posix-spawn-0.3.8
Parsing documentation for yajl-ruby-1.1.0.1
unable to convert "\xCF" from ASCII-8BIT to UTF-8 for /Users/slance/.rvm/gems/ruby-2.0.0-p648/extensions/x86_64-darwin-16/2.0.0/yajl-ruby-1.1.0.1/yajl/yajl.bundle, skipping
unable to convert "\xCF" from ASCII-8BIT to UTF-8 for lib/yajl/yajl.bundle, skipping
Installing ri documentation for yajl-ruby-1.1.0.1
Parsing documentation for pygments.rb-0.5.4
Installing ri documentation for pygments.rb-0.5.4
gems:
- jekyll-textile-converter
permalink: none
lessons:
-
title: Basics
title_ko: 기초
title_ru: Основы
title_zh_cn: 基础
url: basics.html
desc: Values, functions, classes, methods, inheritance, try-catch-finally. Expression-oriented programming
desc_ko: 값, 함수, 클래스, 메소드, 상속, try-catch-finally. 식 중심의 프로그래밍
desc_ru: Переменные, функции, классы, методы, наследование, try-catch-finally. Программирование ориентированное на выражения
desc_zh_cn: 值,函数,类,方法,继承,try-catch-finally。面向表达式编程
-
title: Basics continued
title_ko: 기초(계속)
title_ru: Основы языка. Продолжение
title_zh_cn: 基础知识(续)
url: basics2.html
desc: Case classes, objects, packages, apply, update, Functions are Objects (uniform access principle), pattern matching.
desc_ko: 케이스 클래스, 객체, 패키지, apply, update, 함수는 객체이다(동일한 억세스 원칙), 패턴 매치
desc_ru: Case классы, объекты, пакеты, apply, update, Функции как Объекты (единый принцип доступа), сопоставление с образцом.
desc_zh_cn: 样本类,对象,包,应用,更新,函数即对象(统一访问原则),模式匹配。
-
title: Collections
title_ko: 컬렉션
title_ru: Коллекции
title_zh_cn: 集合
url: collections.html
desc: Lists, Maps, functional combinators (map, foreach, filter, zip, folds)
desc_ko: 리스트, 맵, 함수 콤비네이터(map, foreach, filter, zip, fold들)
desc_ru: Списки, Карты, функциональные комбинаторы (map, foreach, filter, zip, folds)
desc_zh_cn: 列表,映射,功能组合(map, foreach, filter, zip, folds)
-
title: Pattern matching & functional composition
title_ko: 패턴 매치와 함수 합성
title_ru: Сопоставление с образцом и функкциональная композиция
title_zh_cn: 模式匹配与函数组合
url: pattern-matching-and-functional-composition.html
desc: More functions! PartialFunctions, more Pattern Matching
desc_ko: 함수에 대한 추가 설명, 부분함수, 패턴 매치에 대한 설명
desc_ru: Еще больше функций! Частичные функции, еще больше сопоставления с образцом
desc_zh_cn: 更多函数!偏函数,更多模式匹配
-
title: Type & polymorphism basics
title_ko: 타입과 다형성의 기초
title_ru: Основы типов и полиморфизма
title_zh_cn: 类型和多态基础
url: type-basics.html
desc: Basic Types and type polymorphism, type inference, variance, bounds, quantification
desc_ko: 기본 타입, 타입 다형성, 타입 추론, 공변성, 바운드, 한정하기
desc_ru: Основные типы и полиморфизм типов, вывод типов, изменчивость, пределы, квантификация
desc_zh_cn: 基本类型和类型多态性,类型推断,变性,边界,量化
-
title: Advanced types
title_ko: 타입(고급 주제)
title_ru: Дополнительные типы
title_zh_cn: 高级类型
url: advanced-types.html
desc: Advanced Types, view bounds, higher-kinded types, recursive types, structural types
desc_ko: 타입에 대한 추가 설명, 뷰 바운드, 상류 타입, 재귀적 타입, 구조적 타입
desc_ru: Дополнительные типы, видимое ограничение, типы высшего порядка, рекурсивные типы, структурные типы
desc_zh_cn: 高级类型,视界,更高级多态性类型,递归类型,结构类型
Parsing documentation for maruku-0.7.1
Installing ri documentation for maruku-0.7.1
Parsing documentation for rb-kqueue-0.2.3
Installing ri documentation for rb-kqueue-0.2.3
Parsing documentation for listen-1.3.1
Installing ri documentation for listen-1.3.1
Parsing documentation for fast-stemmer-1.0.2
unable to convert "\xCF" from ASCII-8BIT to UTF-8 for /Users/slance/.rvm/gems/ruby-2.0.0-p648/extensions/x86_64-darwin-16/2.0.0/fast-stemmer-1.0.2/stemmer.bundle, skipping
unable to convert "\xCF" from ASCII-8BIT to UTF-8 for lib/stemmer.bundle, skipping
Installing ri documentation for fast-stemmer-1.0.2
Parsing documentation for classifier-1.3.3
Installing ri documentation for classifier-1.3.3
Parsing documentation for liquid-2.5.4
Installing ri documentation for liquid-2.5.4
Parsing documentation for jekyll-1.4.2
Installing ri documentation for jekyll-1.4.2
18 gems installed
$ gem install RedCloth
Fetching: RedCloth-4.2.9.gem (100%)
Building native extensions. This could take a while...
Successfully installed RedCloth-4.2.9
Parsing documentation for RedCloth-4.2.9
unable to convert "\xCF" from ASCII-8BIT to UTF-8 for /Users/slance/.rvm/gems/ruby-2.0.0-p648/extensions/x86_64-darwin-16/2.0.0/RedCloth-4.2.9/redcloth_scan.bundle, skipping
unable to convert "\xCF" from ASCII-8BIT to UTF-8 for ext/redcloth_scan/redcloth_attributes.o, skipping
unable to convert "\xCF" from ASCII-8BIT to UTF-8 for ext/redcloth_scan/redcloth_inline.o, skipping
unable to convert "\xCF" from ASCII-8BIT to UTF-8 for ext/redcloth_scan/redcloth_scan.bundle, skipping
unable to convert "\xCF" from ASCII-8BIT to UTF-8 for ext/redcloth_scan/redcloth_scan.o, skipping
unable to convert "\xCF" from ASCII-8BIT to UTF-8 for lib/redcloth_scan.bundle, skipping
Installing ri documentation for RedCloth-4.2.9
1 gem installed
$ gem install jekyll-textile-converter
Fetching: jekyll-textile-converter-0.1.0.gem (100%)
Successfully installed jekyll-textile-converter-0.1.0
Parsing documentation for jekyll-textile-converter-0.1.0
Installing ri documentation for jekyll-textile-converter-0.1.0
1 gem installed
$ make serve
jekyll serve --watch -s web -d web.out
Configuration file: web/_config.yml
error: undefined method `highlighter_prefix' for Jekyll::Converters::Textile:Class. Use --trace to view backtrace
make: *** [serve] Error 1
I searched for a few minutes and nothing useful turned up. Any ideas? If this is just a weird ruby config problem specific to my machine, someone else can publish the site and this ticket can be closed.
I'm following the basic lesson and the last example in the section 'Curried functions' doesn't compile. When I try this
multiplyThenFilter { m: Int =>
m * 2
} { n: Int =>
n < 5
}
The output is
<console>:8: error: not found: value multiplyThenFilter
multiplyThenFilter { m: Int =>
Describe the bug
The https://twitter.github.io/scala_school/ page contains some links to deprecated subdomains of GH Pages in github.com
. This causes a 404 error when an user try to click in one of these links.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
We expect that the link described above has as target the page: https://twitter.github.io/effectivescala/
Screenshots
If applicable, add screenshots to help explain your problem.
Environment
Any browser
Additional context
In Collection
section of the scala school, gerneralized functional combinator gives an example of a customized map which utilizes ::
and this value member of List
abstract class (doc) hasn't been brought up/introduced before, thus might cause some confusion for the readers/beginners.
Using scala 2.9.1 and sbt 0.11.2, the example with the title 'Overloading methods' on basics section does not work as documented.
scala> class ScientificCalculator(brand: String) extends Calculator(brand) {
| def log(m: Double, base: Double) = math.log(m) / math.log(base)
| }
defined class ScientificCalculator
scala> class EvenMoreScientificCalculator(brand: String) extends ScientificCalculator(brand) {
| def log(m: Int) = log(m, math.exp(1))
| }
<console>:10: error: overloaded method log needs result type
def log(m: Int) = log(m, math.exp(1))
Also filed at https://github.com/twitter/scala-bootstrapper/issues/20 - not sure if it's a scala-bootstrapper issue or a scala_school issue.
For the instructions here:
http://twitter.github.com/scala_school/searchbird.html
"We’ve also written a simple client library that you can run from the sbt console" indicates running:
scala> import com.twitter.searchbird.Client
import com.twitter.searchbird.Client
However, this doesn't appear to be present with the latest build of scala-bootstrapper; there's no Client() available. There's a SearchbirdConsoleClient() only, which requires configuration through args.
are there any plans to do that?
Hi! I am working in jquery plugin is a javascript library for creating interactive command line tutorials that run in your web browser.
http://twitter.github.io/cli-guide.js/
Demo: http://twitter.github.io/cli-guide.js/demo/aurora.html
I hope we can work together ^_^
Describe the bug
twitter.github.com/scala_school is broken.
Returns 404
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Suggested Fix
Replace mentions of twitter.github.com around this repository to twitter.github.io
Link http://twitter.github.io/scala_school/finagle.html#combined_combinator_thumbnail takes to nowhere because the anchor on the page is named "combined_combinator_example_thumbnail"
First of all: thank you for providing this tutorial! :)
In the calculator example presented in the "Basics" lesson, an example value for brand
is "HP"
.
In the next lesson, "Basics continued," the calculator example is revisited, but the example value for brand
is "hp"
.
I realize that this difference doesn't affect the effectiveness of the lesson, but I would suggest using "HP"
in "Basics continued," for consistency.
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Describe the solution you'd like
it should have a dark mode and light mode toggle
Describe alternatives you've considered
use other libraries like antd
Additional context
Add any other context or screenshots about the feature request here.
对给定的输入参数类型,偏函数只能接受该类型的某些特定的值。一个定义为(Int) => String 的偏函数可能不能接受所有Int值为输入。
对于不能接受所有Int值的输入这句话不是太理解,网上搜了很多关于偏函数的资料没有找到能够印证这句话的代码。能举一个例子吗?非常感谢!
Hi!
The Futures examples in the Finagle part (http://twitter.github.io/scala_school/finagle.html) are outdated. As this is the best documentation and tutorial for Twitter Futures, it would be great if this was updated to whatever the current API and best practices are.
I bet there are a few. It'd be good to know what they are. And to file issues for them. (or if it's easier to just fix a broken example than to file an issue for it, then fix it)
Hello I having the following problem when running sbt or sbt update when following the https://twitter.github.io/scala_school/searchbird.html
[info] Updating plugins...
[warn] Host artifactory.local.twitter.com not found. url=http://artifactory.local.twitter.com/repo/com/twitter/sbt-thrift/1.3.4/sbt-thrift-1.3.4.pom
[info] You probably access the destination server through a proxy server that is not well configured.
[warn] Host artifactory.local.twitter.com not found. url=http://artifactory.local.twitter.com/repo/com/twitter/sbt-thrift/1.3.4/sbt-thrift-1.3.4.jar
[info] You probably access the destination server through a proxy server that is not well configured.
[warn] module not found: com.twitter#sbt-thrift;1.3.4
[warn] ==== local: tried
[warn] /Users/camol/.ivy2/local/com.twitter/sbt-thrift/1.3.4/ivys/ivy.xml
[warn] -- artifact com.twitter#sbt-thrift;1.3.4!sbt-thrift.jar:
[warn] /Users/camol/.ivy2/local/com.twitter/sbt-thrift/1.3.4/jars/sbt-thrift.jar
[warn] ==== twitter.artifactory: tried
[warn] http://artifactory.local.twitter.com/repo/com/twitter/sbt-thrift/1.3.4/sbt-thrift-1.3.4.pom
[warn] -- artifact com.twitter#sbt-thrift;1.3.4!sbt-thrift.jar:
[warn] http://artifactory.local.twitter.com/repo/com/twitter/sbt-thrift/1.3.4/sbt-thrift-1.3.4.jar
[warn] Host artifactory.local.twitter.com not found. url=http://artifactory.local.twitter.com/repo/com/twitter/standard-project/0.11.4/standard-project-0.11.4.pom
[info] You probably access the destination server through a proxy server that is not well configured.
[warn] Host artifactory.local.twitter.com not found. url=http://artifactory.local.twitter.com/repo/com/twitter/standard-project/0.11.4/standard-project-0.11.4.jar
[info] You probably access the destination server through a proxy server that is not well configured.
[warn] module not found: com.twitter#standard-project;0.11.4
[warn] ==== local: tried
[warn] /Users/camol/.ivy2/local/com.twitter/standard-project/0.11.4/ivys/ivy.xml
[warn] -- artifact com.twitter#standard-project;0.11.4!standard-project.jar:
[warn] /Users/camol/.ivy2/local/com.twitter/standard-project/0.11.4/jars/standard-project.jar
[warn] ==== twitter.artifactory: tried
[warn] http://artifactory.local.twitter.com/repo/com/twitter/standard-project/0.11.4/standard-project-0.11.4.pom
[warn] -- artifact com.twitter#standard-project;0.11.4!standard-project.jar:
[warn] http://artifactory.local.twitter.com/repo/com/twitter/standard-project/0.11.4/standard-project-0.11.4.jar
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: com.twitter#sbt-thrift;1.3.4: not found
[warn] :: com.twitter#standard-project;0.11.4: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[info]
[warn] :: problems summary ::
[warn] :::: WARNINGS
[warn] Host artifactory.local.twitter.com not found. url=http://artifactory.local.twitter.com/repo/com/twitter/sbt-thrift/1.3.4/sbt-thrift-1.3.4.pom
[warn] Host artifactory.local.twitter.com not found. url=http://artifactory.local.twitter.com/repo/com/twitter/sbt-thrift/1.3.4/sbt-thrift-1.3.4.jar
[warn] module not found: com.twitter#sbt-thrift;1.3.4
[warn] ==== local: tried
[warn] /Users/camol/.ivy2/local/com.twitter/sbt-thrift/1.3.4/ivys/ivy.xml
[warn] -- artifact com.twitter#sbt-thrift;1.3.4!sbt-thrift.jar:
[warn] /Users/camol/.ivy2/local/com.twitter/sbt-thrift/1.3.4/jars/sbt-thrift.jar
[warn] ==== twitter.artifactory: tried
[warn] http://artifactory.local.twitter.com/repo/com/twitter/sbt-thrift/1.3.4/sbt-thrift-1.3.4.pom
[warn] -- artifact com.twitter#sbt-thrift;1.3.4!sbt-thrift.jar:
[warn] http://artifactory.local.twitter.com/repo/com/twitter/sbt-thrift/1.3.4/sbt-thrift-1.3.4.jar
[warn] Host artifactory.local.twitter.com not found. url=http://artifactory.local.twitter.com/repo/com/twitter/standard-project/0.11.4/standard-project-0.11.4.pom
[warn] Host artifactory.local.twitter.com not found. url=http://artifactory.local.twitter.com/repo/com/twitter/standard-project/0.11.4/standard-project-0.11.4.jar
[warn] module not found: com.twitter#standard-project;0.11.4
[warn] ==== local: tried
[warn] /Users/camol/.ivy2/local/com.twitter/standard-project/0.11.4/ivys/ivy.xml
[warn] -- artifact com.twitter#standard-project;0.11.4!standard-project.jar:
[warn] /Users/camol/.ivy2/local/com.twitter/standard-project/0.11.4/jars/standard-project.jar
[warn] ==== twitter.artifactory: tried
[warn] http://artifactory.local.twitter.com/repo/com/twitter/standard-project/0.11.4/standard-project-0.11.4.pom
[warn] -- artifact com.twitter#standard-project;0.11.4!standard-project.jar:
[warn] http://artifactory.local.twitter.com/repo/com/twitter/standard-project/0.11.4/standard-project-0.11.4.jar
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: com.twitter#sbt-thrift;1.3.4: not found
[warn] :: com.twitter#standard-project;0.11.4: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[info]
[info] :: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS
[error] sbt.ResolveException: unresolved dependency: com.twitter#sbt-thrift;1.3.4: not found
[error] unresolved dependency: com.twitter#standard-project;0.11.4: not found
sbt.ResolveException: unresolved dependency: com.twitter#sbt-thrift;1.3.4: not found
unresolved dependency: com.twitter#standard-project;0.11.4: not found
When I change the Plugins.scala code to:
import sbt._
class Plugins(info: ProjectInfo) extends PluginDefinition(info) {
import scala.collection.jcl
val environment = jcl.Map(System.getenv())
def isSBTOpenTwitter = environment.get("SBT_OPEN_TWITTER").isDefined
def isSBTTwitter = environment.get("SBT_TWITTER").isDefined
override def repositories = if (isSBTOpenTwitter) {
Set("twitter.artifactory" at "http://artifactory.local.twitter.com/open-source/")
} else if (isSBTTwitter) {
Set("twitter.artifactory" at "http://artifactory.local.twitter.com/repo/")
} else {
super.repositories ++ Set(
"twitter.com" at "http://maven.twttr.com/",
"scala-tools" at "http://scala-tools.org/repo-releases/",
"freemarker" at "http://freemarker.sourceforge.net/maven2/"
)
}
override def ivyRepositories = Seq(Resolver.defaultLocal(None)) ++ repositories
val standardProject = "com.twitter" % "standard-project" % "0.12.7"
val sbtThrift = "com.twitter" % "sbt-thrift" % "1.4.4"
}
I get another set of errors:
[info] Recompiling plugin definition...
[info] Source analysis: 1 new/modified, 0 indirectly invalidated, 0 removed.
[info]
[info] Updating plugins...
[warn] module not found: org.jruby#jruby-complete;1.6.0.RC2
[warn] ==== local: tried
[warn] /Users/camol/.ivy2/local/org.jruby/jruby-complete/1.6.0.RC2/ivys/ivy.xml
[warn] -- artifact org.jruby#jruby-complete;1.6.0.RC2!jruby-complete.jar:
[warn] /Users/camol/.ivy2/local/org.jruby/jruby-complete/1.6.0.RC2/jars/jruby-complete.jar
[warn] ==== twitter.com: tried
[warn] http://maven.twttr.com/org/jruby/jruby-complete/1.6.0.RC2/jruby-complete-1.6.0.RC2.pom
[warn] -- artifact org.jruby#jruby-complete;1.6.0.RC2!jruby-complete.jar:
[warn] http://maven.twttr.com/org/jruby/jruby-complete/1.6.0.RC2/jruby-complete-1.6.0.RC2.jar
[warn] ==== scala-tools: tried
[warn] http://scala-tools.org/repo-releases/org/jruby/jruby-complete/1.6.0.RC2/jruby-complete-1.6.0.RC2.pom
[warn] -- artifact org.jruby#jruby-complete;1.6.0.RC2!jruby-complete.jar:
[warn] http://scala-tools.org/repo-releases/org/jruby/jruby-complete/1.6.0.RC2/jruby-complete-1.6.0.RC2.jar
[warn] ==== freemarker: tried
[warn] http://freemarker.sourceforge.net/maven2/org/jruby/jruby-complete/1.6.0.RC2/jruby-complete-1.6.0.RC2.pom
[warn] -- artifact org.jruby#jruby-complete;1.6.0.RC2!jruby-complete.jar:
[warn] http://freemarker.sourceforge.net/maven2/org/jruby/jruby-complete/1.6.0.RC2/jruby-complete-1.6.0.RC2.jar
[warn] module not found: org.markdownj#markdownj;0.3.0-1.0.2b4
[warn] ==== local: tried
[warn] /Users/camol/.ivy2/local/org.markdownj/markdownj/0.3.0-1.0.2b4/ivys/ivy.xml
[warn] -- artifact org.markdownj#markdownj;0.3.0-1.0.2b4!markdownj.jar:
[warn] /Users/camol/.ivy2/local/org.markdownj/markdownj/0.3.0-1.0.2b4/jars/markdownj.jar
[warn] ==== twitter.com: tried
[warn] http://maven.twttr.com/org/markdownj/markdownj/0.3.0-1.0.2b4/markdownj-0.3.0-1.0.2b4.pom
[warn] -- artifact org.markdownj#markdownj;0.3.0-1.0.2b4!markdownj.jar:
[warn] http://maven.twttr.com/org/markdownj/markdownj/0.3.0-1.0.2b4/markdownj-0.3.0-1.0.2b4.jar
[warn] ==== scala-tools: tried
[warn] http://scala-tools.org/repo-releases/org/markdownj/markdownj/0.3.0-1.0.2b4/markdownj-0.3.0-1.0.2b4.pom
[warn] -- artifact org.markdownj#markdownj;0.3.0-1.0.2b4!markdownj.jar:
[warn] http://scala-tools.org/repo-releases/org/markdownj/markdownj/0.3.0-1.0.2b4/markdownj-0.3.0-1.0.2b4.jar
[warn] ==== freemarker: tried
[warn] http://freemarker.sourceforge.net/maven2/org/markdownj/markdownj/0.3.0-1.0.2b4/markdownj-0.3.0-1.0.2b4.pom
[warn] -- artifact org.markdownj#markdownj;0.3.0-1.0.2b4!markdownj.jar:
[warn] http://freemarker.sourceforge.net/maven2/org/markdownj/markdownj/0.3.0-1.0.2b4/markdownj-0.3.0-1.0.2b4.jar
[warn] module not found: org.freemarker#freemarker;2.3.16
[warn] ==== local: tried
[warn] /Users/camol/.ivy2/local/org.freemarker/freemarker/2.3.16/ivys/ivy.xml
[warn] -- artifact org.freemarker#freemarker;2.3.16!freemarker.jar:
[warn] /Users/camol/.ivy2/local/org.freemarker/freemarker/2.3.16/jars/freemarker.jar
[warn] ==== twitter.com: tried
[warn] http://maven.twttr.com/org/freemarker/freemarker/2.3.16/freemarker-2.3.16.pom
[warn] -- artifact org.freemarker#freemarker;2.3.16!freemarker.jar:
[warn] http://maven.twttr.com/org/freemarker/freemarker/2.3.16/freemarker-2.3.16.jar
[warn] ==== scala-tools: tried
[warn] http://scala-tools.org/repo-releases/org/freemarker/freemarker/2.3.16/freemarker-2.3.16.pom
[warn] -- artifact org.freemarker#freemarker;2.3.16!freemarker.jar:
[warn] http://scala-tools.org/repo-releases/org/freemarker/freemarker/2.3.16/freemarker-2.3.16.jar
[warn] ==== freemarker: tried
[warn] http://freemarker.sourceforge.net/maven2/org/freemarker/freemarker/2.3.16/freemarker-2.3.16.pom
[warn] -- artifact org.freemarker#freemarker;2.3.16!freemarker.jar:
[warn] http://freemarker.sourceforge.net/maven2/org/freemarker/freemarker/2.3.16/freemarker-2.3.16.jar
[info] downloading http://maven.twttr.com/com/twitter/sbt-thrift/1.4.4/sbt-thrift-1.4.4.jar ...
[info] [SUCCESSFUL ] com.twitter#sbt-thrift;1.4.4!sbt-thrift.jar (4938ms)
[info] downloading http://maven.twttr.com/com/twitter/standard-project/0.12.7/standard-project-0.12.7.jar ...
[info] [SUCCESSFUL ] com.twitter#standard-project;0.12.7!standard-project.jar (586ms)
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: org.jruby#jruby-complete;1.6.0.RC2: not found
[warn] :: org.markdownj#markdownj;0.3.0-1.0.2b4: not found
[warn] :: org.freemarker#freemarker;2.3.16: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[info]
[warn] :: problems summary ::
[warn] :::: WARNINGS
[warn] module not found: org.jruby#jruby-complete;1.6.0.RC2
[warn] ==== local: tried
[warn] /Users/camol/.ivy2/local/org.jruby/jruby-complete/1.6.0.RC2/ivys/ivy.xml
[warn] -- artifact org.jruby#jruby-complete;1.6.0.RC2!jruby-complete.jar:
[warn] /Users/camol/.ivy2/local/org.jruby/jruby-complete/1.6.0.RC2/jars/jruby-complete.jar
[warn] ==== twitter.com: tried
[warn] http://maven.twttr.com/org/jruby/jruby-complete/1.6.0.RC2/jruby-complete-1.6.0.RC2.pom
[warn] -- artifact org.jruby#jruby-complete;1.6.0.RC2!jruby-complete.jar:
[warn] http://maven.twttr.com/org/jruby/jruby-complete/1.6.0.RC2/jruby-complete-1.6.0.RC2.jar
[warn] ==== scala-tools: tried
[warn] http://scala-tools.org/repo-releases/org/jruby/jruby-complete/1.6.0.RC2/jruby-complete-1.6.0.RC2.pom
[warn] -- artifact org.jruby#jruby-complete;1.6.0.RC2!jruby-complete.jar:
[warn] http://scala-tools.org/repo-releases/org/jruby/jruby-complete/1.6.0.RC2/jruby-complete-1.6.0.RC2.jar
[warn] ==== freemarker: tried
[warn] http://freemarker.sourceforge.net/maven2/org/jruby/jruby-complete/1.6.0.RC2/jruby-complete-1.6.0.RC2.pom
[warn] -- artifact org.jruby#jruby-complete;1.6.0.RC2!jruby-complete.jar:
[warn] http://freemarker.sourceforge.net/maven2/org/jruby/jruby-complete/1.6.0.RC2/jruby-complete-1.6.0.RC2.jar
[warn] module not found: org.markdownj#markdownj;0.3.0-1.0.2b4
[warn] ==== local: tried
[warn] /Users/camol/.ivy2/local/org.markdownj/markdownj/0.3.0-1.0.2b4/ivys/ivy.xml
[warn] -- artifact org.markdownj#markdownj;0.3.0-1.0.2b4!markdownj.jar:
[warn] /Users/camol/.ivy2/local/org.markdownj/markdownj/0.3.0-1.0.2b4/jars/markdownj.jar
[warn] ==== twitter.com: tried
[warn] http://maven.twttr.com/org/markdownj/markdownj/0.3.0-1.0.2b4/markdownj-0.3.0-1.0.2b4.pom
[warn] -- artifact org.markdownj#markdownj;0.3.0-1.0.2b4!markdownj.jar:
[warn] http://maven.twttr.com/org/markdownj/markdownj/0.3.0-1.0.2b4/markdownj-0.3.0-1.0.2b4.jar
[warn] ==== scala-tools: tried
[warn] http://scala-tools.org/repo-releases/org/markdownj/markdownj/0.3.0-1.0.2b4/markdownj-0.3.0-1.0.2b4.pom
[warn] -- artifact org.markdownj#markdownj;0.3.0-1.0.2b4!markdownj.jar:
[warn] http://scala-tools.org/repo-releases/org/markdownj/markdownj/0.3.0-1.0.2b4/markdownj-0.3.0-1.0.2b4.jar
[warn] ==== freemarker: tried
[warn] http://freemarker.sourceforge.net/maven2/org/markdownj/markdownj/0.3.0-1.0.2b4/markdownj-0.3.0-1.0.2b4.pom
[warn] -- artifact org.markdownj#markdownj;0.3.0-1.0.2b4!markdownj.jar:
[warn] http://freemarker.sourceforge.net/maven2/org/markdownj/markdownj/0.3.0-1.0.2b4/markdownj-0.3.0-1.0.2b4.jar
[warn] module not found: org.freemarker#freemarker;2.3.16
[warn] ==== local: tried
[warn] /Users/camol/.ivy2/local/org.freemarker/freemarker/2.3.16/ivys/ivy.xml
[warn] -- artifact org.freemarker#freemarker;2.3.16!freemarker.jar:
[warn] /Users/camol/.ivy2/local/org.freemarker/freemarker/2.3.16/jars/freemarker.jar
[warn] ==== twitter.com: tried
[warn] http://maven.twttr.com/org/freemarker/freemarker/2.3.16/freemarker-2.3.16.pom
[warn] -- artifact org.freemarker#freemarker;2.3.16!freemarker.jar:
[warn] http://maven.twttr.com/org/freemarker/freemarker/2.3.16/freemarker-2.3.16.jar
[warn] ==== scala-tools: tried
[warn] http://scala-tools.org/repo-releases/org/freemarker/freemarker/2.3.16/freemarker-2.3.16.pom
[warn] -- artifact org.freemarker#freemarker;2.3.16!freemarker.jar:
[warn] http://scala-tools.org/repo-releases/org/freemarker/freemarker/2.3.16/freemarker-2.3.16.jar
[warn] ==== freemarker: tried
[warn] http://freemarker.sourceforge.net/maven2/org/freemarker/freemarker/2.3.16/freemarker-2.3.16.pom
[warn] -- artifact org.freemarker#freemarker;2.3.16!freemarker.jar:
[warn] http://freemarker.sourceforge.net/maven2/org/freemarker/freemarker/2.3.16/freemarker-2.3.16.jar
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: org.jruby#jruby-complete;1.6.0.RC2: not found
[warn] :: org.markdownj#markdownj;0.3.0-1.0.2b4: not found
[warn] :: org.freemarker#freemarker;2.3.16: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[info]
[info] :: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS
[error] sbt.ResolveException: unresolved dependency: org.jruby#jruby-complete;1.6.0.RC2: not found
[error] unresolved dependency: org.markdownj#markdownj;0.3.0-1.0.2b4: not found
[error] unresolved dependency: org.freemarker#freemarker;2.3.16: not found
sbt.ResolveException: unresolved dependency: org.jruby#jruby-complete;1.6.0.RC2: not found
unresolved dependency: org.markdownj#markdownj;0.3.0-1.0.2b4: not found
unresolved dependency: org.freemarker#freemarker;2.3.16: not found
Page: http://twitter.github.com/scala_school/basics2.html
Section: "Functions are Objects"
Line: http://img.ly/iCMm
I would be interested in working through Scala School by translating it into German (native speaker). Would there be any interest in this field?
The link to sbt should be changed to: http://www.scala-sbt.org/release/docs/Getting-Started/Setup
Basics lesson 1 shows the following as included in the lesson:
values
expressions
functions
classes
methods
basic inheritance
try-catch-finally
However, try-catch-finally is not included in this lesson, but in the next, basics2 lesson.
Hi, I want to make tutorial translation into Russian. What is best choice do this? Can I do the translation like in Effective Scala using my translation files and adding a link in the original?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.