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
| import scala.util._ | |
| import akka.actor._ | |
| import akka.stream._ | |
| import akka.stream.scaladsl._ | |
| import akka.util._ | |
| object SimpleTcpServer extends App { | |
| val address = "127.0.0.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
| import java.awt.Dimension | |
| import java.awt.event.MouseAdapter | |
| import java.awt.event.MouseEvent | |
| import javax.swing.JFrame | |
| import scala.collection.immutable | |
| import scala.concurrent.duration._ | |
| import akka.actor._ | |
| import akka.stream._ |
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
| /* Data definition */ | |
| trait DocumentInfo { | |
| val title: String | |
| } | |
| case class D1(title: String, content: String) extends DocumentInfo | |
| case class D2(title: String, count: Int) extends DocumentInfo | |
| /* -------------- */ | |
| /* Type Class */ |
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
| case class Dni(src: String, parsed: String) { | |
| override def equals(obj: scala.Any): Boolean = obj match { | |
| case dni: Dni => dni.src == src || dni.parsed == parsed | |
| case dni: String => dni == src || dni == parsed | |
| case _ => false | |
| } | |
| override def toString: String = src | |
| } |
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
| const path = require('path'); | |
| const webpack = require('webpack'); | |
| const apiHost = require('./src/config/deploy.config'); | |
| module.exports = { | |
| entry: './src/frontend/app/index.js', | |
| output: { | |
| path: path.resolve(__dirname, './src/frontend/dist'), | |
| filename: 'bundle.js' | |
| }, |
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
| -module(submission). | |
| -export([bits/1, bitsTail/1, area/1, perimeter/1, enclose/1]). | |
| % Direct recursive definition of bits func. | |
| bits(0) -> 0; | |
| bits(1) -> 1; | |
| bits(N) when (N > 1) -> N rem 2 + bits(N div 2). | |
| % Tail version of the bits func. | |
| bitsTail(N) -> bitsTailIt(N, 0). |
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
| -module(vars_and_patterns). | |
| -export([xOr1/2, xOr2/2, xOr3/2, maxThree/3, howManyEqual/3]). | |
| xOr1(X, Y) when X and Y -> | |
| false; | |
| xOr1(X, Y) when not(X or Y) -> | |
| false; | |
| xOr1(_, _) -> true. | |
| xOr2(X, Y) when X == Y -> |
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
| test("blocking in Future") { | |
| var threadsBlock: mutable.Set[String] = scala.collection.mutable.Set() | |
| var threads: mutable.Set[String] = scala.collection.mutable.Set() | |
| def currentThread = Thread.currentThread().getName | |
| /*def nonBlockingFuture = Future{ | |
| threads += currentThread | |
| Thread.sleep(1000) | |
| }*/ |
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
| POST /authentication | |
| body: { | |
| "access_token": "kjbILH7hl8hpbyPBUP9...", | |
| "strategy": "facebook" | |
| } | |
| RESPONSE: | |
| { | |
| "access_token": "....." |
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
| feathers-authentication-local:verify Checking credentials +2ms [email protected] abc1234 | |
| feathers-authentication:passport:authenticate Authentication strategy 'local' failed +20ms undefined undefined | |
| error: (401) Route: /authentication - Error | |
| info: NotAuthenticated: Error | |
| at NotAuthenticated.ExtendableBuiltin (/home/ivcp/Documents/Sapco/mobi-backend/node_modules/feathers-errors/lib/index.js:21:28) | |
| at NotAuthenticated.FeathersError (/home/ivcp/Documents/Sapco/mobi-backend/node_modules/feathers-errors/lib/index.js:96:116) | |
| at new NotAuthenticated (/home/ivcp/Documents/Sapco/mobi-backend/node_modules/feathers-errors/lib/index.js:149:117) | |
| at /home/ivcp/Documents/Sapco/mobi-backend/node_modules/feathers-authentication/lib/hooks/authenticate.js:79:31 | |
| at process._tickCallback (internal/process/next_tick.js:103:7) |
NewerOlder