Skip to content

Instantly share code, notes, and snippets.

View RCura's full-sized avatar

Robin Cura RCura

View GitHub Profile
function (output = stdout(), envir = parent.frame())
{
sunk <- FALSE
if (!missing(output)) {
sunk <- TRUE
sink(output)
}
text <- get("text")
brew.cat <- function(from, to) cat(text[from:to], sep = "",
collapse = "")
@RCura
RCura / NetLogo_A-star_Implementation.nls
Created July 9, 2013 11:42
NetLogo A* implementation on nodes and links
; ########################################
; #### NetLogo A* Algorithm ######
; #### Author : Robin Cura ######
; #### Contact : robin.cura@gmail.com ####
; #### Date : 09/07/2013 ######
; #### Licence : GPL v2 ######
; ########################################
package rcfx
import scalafx.Includes._
import scalafx.application.JFXApp
import scalafx.scene.Scene
import scalafx.scene.paint.Color
import scalafx.scene.shape.Rectangle
import scalafx.stage.Stage
object World extends JFXApp {
myFolder <- "/home/robin/imagesR"
test <- runif(n=10)
for(i in 1:10){
png(filename=paste(myFolder, "/test_", i, ".png",sep=""),
units="in",
width=5,
height=4,
pointsize=12,
# -*- coding: utf-8 -*-
from osgeo import ogr
roadShpPath = "D:\\DonneesM2\\UMZ_2000_Cut.shp"
fieldToUse = 'Type'
driver = ogr.GetDriverByName("ESRI Shapefile")
datasource = driver.Open(roadShpPath)
layer = datasource.GetLayer()
package fr.geocite.simprocess.hook.xylinecharts
import org.openmole.core.model.data._
import fr.geocite.simprocess.javafx.ui.{ filter, IVariableData }
import org.openmole.misc.exception.UserBadDataError
import filter.FilterLine
import scala.collection.JavaConversions._
import spray.json._
import scala.Array
import javafx.collections.FXCollections
def createColumnNamesList(): List[String] =
{
val columnsToAdd = new ListBuffer[String]
val tmpXCol = mappedVar.get("X") match {
case Some(x: String) ⇒ x
case _ ⇒ ""
}
if (tmpXCol != "") {
columnsToAdd += tmpXCol
}
val abc = scala.collection.mutable.ListBuffer[Double]
abc += 45
abc += 87
def f(l: List[_]) = l
f(abc)
implicit def arrayToList[T](a:scala.collection.mutable.ListBuffer[T]): List[T] = a.toList
// We create a list of columns, that will contain all the variables to be filtred.
val buffer = new scala.collection.mutable.ListBuffer[Array[_]]
buffer += valueVariableX
buffer += valueVariableY
listFiltre.foreach { v ⇒ v
val columnName = v.name.toString
val columnVariable = getVariableFromColumn(columnName)
val columnValue = get[Array[Double]](columnVariable) match {
case Some(i: Array[Double]) ⇒ i
import fr.geocite.simprocess.javafx.ui.tableview.JFXTableView
import javafx.scene.layout._
import javafx.geometry.{ Orientation, HPos, Insets }
import javafx.scene.control._
import javafx.collections.{ ObservableList, FXCollections }
import fr.geocite.simprocess.javafx.ui.doubleslider.DoubleSlider
import fr.geocite.simprocess.javafx.ui.textfield.DoubleTextField
import javafx.beans.value.{ ObservableValue, ChangeListener }
import javafx.event.{ ActionEvent, EventHandler }
import javafx.scene.{ Node, Scene, input }