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
(ns sc.core | |
(:require [clj-http.client :as client] | |
[cheshire.core :refer :all] | |
[clojure.string] | |
[clojure.java.io :as io])) | |
;; !!!!! | |
;; FIXED version runs without problems | |
;; to run those functions you need enter below sound_client_id:::: |
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
(defn CHECKEDGES [G S unexpl BACKTRACK ORDERLIST] ;aux function checking all edges outgoing from vector S | |
(if (= (G S) []) | |
(if (= BACKTRACK []) | |
[G nil BACKTRACK ORDERLIST] ;nowhere to backtrack anymore new S is nil | |
(recur G (peek BACKTRACK) unexpl (pop BACKTRACK) (conj ORDERLIST S))) ;no more edges to verify, need to backtrack, add S to orderlist | |
; now if (G S) edges are not empty, check all vertices | |
(let [V (peek (G S)) | |
newedges (pop (G S)) | |
newG (assoc G S newedges)] ;new edges are without V anymore |
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
package module3; | |
//Java utilities libraries | |
import java.util.ArrayList; | |
//import java.util.Collections; | |
//import java.util.Comparator; | |
import java.util.List; | |
//Processing library | |
import processing.core.PApplet; |
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
// | |
// AppDelegate.swift | |
// RemoteReceiver | |
// Receive remote events from Bluetooth head set or player. | |
// Created by michal on 06/11/2018. | |
// Copyright © 2018 michal. All rights reserved. | |
// | |
import UIKit | |
import MediaPlayer |
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
// | |
// AudioPlayer.swift | |
// AudioPlayerNodes | |
// | |
// Created by michal on 23/01/2019. | |
// Copyright © 2019 michal. All rights reserved. | |
// | |
import AVFoundation |
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 AVKit | |
import Photos | |
func getVideos() -> PHFetchResult<PHAsset> { | |
let fetchOptions = PHFetchOptions() | |
fetchOptions.sortDescriptors = [NSSortDescriptor(key: "creationDate",ascending: false)] | |
fetchOptions.predicate = NSPredicate(format: "mediaType = %d",PHAssetMediaType.video.rawValue) | |
return PHAsset.fetchAssets(with: fetchOptions) | |
} |
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 Cocoa | |
extension NSImage { | |
var ciimage: CIImage? { | |
guard let tiffData = self.tiffRepresentation, | |
let bitmap = NSBitmapImageRep(data: tiffData) else { | |
return nil | |
} | |
return CIImage(bitmapImageRep: bitmap) | |
} |
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
struct Heap { | |
var a = [Int]() | |
init(_ array: [Int]) { | |
a = array | |
for i in stride(from: a.count / 2 - 1, to: 0, by: -1) { | |
bubbleDown(i) | |
} | |
} | |
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
// swift-tools-version:4.2 | |
import PackageDescription | |
let package = Package( | |
name: "server", | |
products: [ | |
.library(name: "server", targets: ["App"]), | |
], | |
dependencies: [ | |
.package(url: "https://github.com/vapor/vapor.git", from: "3.0.0"), |
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 FluentMySQL | |
import Vapor | |
final class Todo: Codable { | |
var id: Int? | |
var title: String | |
init(id: Int? = nil, title: String) { | |
self.id = id | |
self.title = title |
OlderNewer