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
"""Example demonstrating hovering with line widths specified in the data source - with bokeh server""" | |
from bokeh.io import curdoc | |
from bokeh.plotting import figure | |
data = dict( | |
x=[0, 0, 25], | |
y=[5, 20, 5], | |
dw=[20, 20, 10], | |
dh=[10, 10, 25], |
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 numpy as np | |
import pandas as pd | |
from bokeh.models import Circle, ColumnDataSource, Range1d, HoverTool, CustomJS | |
from bokeh.transform import factor_cmap | |
from bokeh.plotting import figure, show, output_file | |
output_file("hover_linked_samples.html") | |
raw_array=np.random.rand(80,2) |
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
ktoso@moon /Users/ktoso | |
$ scalac vals_by_types.scala | |
warning: there were 2 deprecation warnings; re-run with -deprecation for details | |
one warning found | |
ktoso@moon /Users/ktoso | |
$ scala Main | |
The combined names are: UserFinder and UserStatusReader |
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 A | |
class A2 extends A | |
class B | |
trait M[X] | |
// | |
// Upper Type Bound | |
// | |
def upperTypeBound[AA <: A](x: AA): A = x |
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
// scala 2.7 simple type constraint. This can only constrain a type parameter of this function. | |
// Below, in ListW.sumint28, we can't use this approach because we want to constrain T, | |
// a type param of the enclosing trait. | |
def sumint27A[T <: Int](l: List[T]) : Int = l.reduceLeft((a: Int, b: Int) => a + b) | |
trait IntLike[X] extends (X => Int) | |
object IntLike { | |
implicit val intIntLike: IntLike[Int] = new IntLike[Int] { def apply(x: Int) = identity(x) } | |
} |