This file contains hidden or 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
    
  
  
    
  | require 'open-uri' | |
| require 'CSV' | |
| require 'mysql2' | |
| require 'json' | |
| start = [1,1,1992] | |
| name_list = "../data/sp" | |
| file = File.new(name_list+"_selected.csv", "r") | |
| start_from = "" # if download hangs or crashes, start from stock with this symbol | |
  
    
      This file contains hidden or 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
    
  
  
    
  | reset; | |
| model MODEL_FILE.mod; | |
| data DATA_FILE.dat; | |
| let VARIABLE := INITIAL_VALUE; | |
| display VARIABLE > OUTPUT_FILE.txt; | |
| for {1..15}{ | |
| solve; | |
| display GOAL_VARIABLE >> OUTPUT_FILE.txt; | |
| let VARIABLE := VARIABLE+1; | |
| } | 
  
    
      This file contains hidden or 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
    
  
  
    
  | #' Create k random permutations of a vector | |
| #' should be used only for length(input)! >> k | |
| #' @param input vector to be permutated | |
| #' @param k number of permutations | |
| gen.samp <- function(input,k){ | |
| n <- length(input) | |
| mat <- matrix(data=NA,nrow=k,ncol=n) # allocate memory | |
| k <- min(k, nperm(input)) | |
| inserted <- 0 | |
| while(inserted < k){ | 
  
    
      This file contains hidden or 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
    
  
  
    
  | <!DOCTYPE html> | |
| <html class="no-js"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <meta name="description" content=""> | |
| <meta name="viewport" content="width=device-width"> | |
| <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css"> | 
  
    
      This file contains hidden or 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
    
  
  
    
  | # Input data: | |
| # a data frame with columns from and to (each containing addresses readable for Google Maps) | |
| # if you already have a vector of addresses, omit the all.addresses <- ... line | |
| library(ggmap) | |
| AddressFrequency <- function(addresses){ | |
| tab <- table(addresses) | |
| unique.points <- data.frame(address=names(tab), frequency = c(tab)) | |
| rownames(unique.points) <- NULL | |
| unique.points | 
  
    
      This file contains hidden or 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
    
  
  
    
  | library(ggmap) # mapdist | |
| library(xlsx) # read.xlsx | |
| # Data for these functions was stored in an xlsx file: | |
| # date | from | city from | to | city to | who | back | comment | | |
| # usage: | |
| # df <- read.xlsx("routes.xlsx", 1, encoding="UTF-8", stringsAsFactors=F)[,1:7] | |
| # df <- PasteCities(df) | |
| # kilometers <- GetDistancesImproved(df) | 
  
    
      This file contains hidden or 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
    
  
  
    
  | require 'open-uri' | |
| require 'CSV' | |
| require 'mysql2' | |
| require 'json' | |
| start = [1,1,1992] | |
| name_list = "small_cap" | |
| file = File.new(name_list+"_selected.csv", "r") | |
| start_from = "" # if download hangs or crashes, start from stock with this symbol | 
  
    
      This file contains hidden or 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
    
  
  
    
  | # find stocks, that fit certain requirements, considering long period of records and no big gaps | |
| # place list with stock to filter in the file [name_list]_full.csv | |
| # results will be stored in [name_file]_selected.csv | |
| require 'open-uri' | |
| require 'CSV' | |
| start = Date.new(1992,1,1) | |
| max_gap = 7 | |
| name_list = "mid_cap" | 
  
    
      This file contains hidden or 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
    
  
  
    
  | function wynik = gradient_in_point(point) | |
| x = point(1)-4:0.1:point(1)+4; | |
| y = point(2)-4:0.1:point(2)+4; | |
| [x y] = meshgrid(x,y); | |
| z = (1.5 - x .* (1- y )).^2 + (2.25 - x .*(1- y.^2)).^2 + (2.625 - x .* (1- y.^3)).^2; | |
| [px py] = gradient(z); | |
| middle = (4+4)/0.1/2; | |
| wynik = [-1*px(middle,middle) -1*py(middle,middle)]; | |
| end | 
  
    
      This file contains hidden or 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
    
  
  
    
  | \documentclass[10pt,a4paper]{article} | |
| \usepackage{fullpage} | |
| \usepackage{graphicx} %grafiki | |
| \usepackage{color} | |
| \usepackage{amsmath} % matematyka | |
| \usepackage{mathtools} % matematyka | |
| \usepackage{amssymb} % symbole, np. triangleeq | |
| \usepackage{float} | |
| \usepackage[OT4]{polski} | |
| \usepackage[utf8x]{inputenc} | 
NewerOlder