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 * as tf from "@tensorflow/tfjs"; | |
| // Define a model for linear regression. | |
| const model = tf.sequential(); | |
| model.add(tf.layers.dense({ units: 1, inputShape: [1] })); | |
| // Prepare the model for training: Specify the loss and the optimizer. | |
| model.compile({ loss: "meanSquaredError", optimizer: "sgd" }); | |
| // Provide some housing data |
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 express = require('express') | |
| const path = require('path') | |
| const app = express() | |
| // View Engine setup | |
| app.set('views', path.join(__dirname, 'templates')) | |
| app.set('view engine', 'hbs') | |
| app.use(express.static('public')) |
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
| # | |
| # A theme based on Steve Losh's Extravagant Prompt with vcs_info integration. | |
| # | |
| # Authors: | |
| # Steve Losh <steve@stevelosh.com> | |
| # Bart Trojanowski <bart@jukie.net> | |
| # Brian Carper <brian@carper.ca> | |
| # steeef2 <steeef2@gmail.com> | |
| # Sorin Ionescu <sorin.ionescu@gmail.com> | |
| # |
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
| var pg = require('pg') | |
| var faker = require('Faker') // install using npm install Faker | |
| var conString = "postgres://postgres:5432@localhost/students" | |
| var client = new pg.Client(conString) | |
| client.connect((err) => { | |
| if(err) { | |
| return console.error('could not connect to postgres', err) |
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
| var fs = require('fs') | |
| var file = 'test.db' | |
| var exists = fs.existsSync(file) | |
| var sqlite3 = require('sqlite3').verbose() | |
| var db = new sqlite3.Database(file) | |
| // --------------------------------------- | |
| // create the table we'll use later | |
| // --------------------------------------- |
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.net.*; | |
| public class ProtocolTester { | |
| public static void main(String[] args) { | |
| String url = "www.bl.ac.id"; | |
| testProtocol("http://" + url); | |
| testProtocol("https://" + url); | |
| testProtocol("ftp://" + url); | |
| testProtocol("nfs://" + url); |
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
| iex(16)> str = "riza@elixirdose.com" | |
| "riza@elixirdose.com" | |
| iex(17)> [email, username, host] = Regex.run(~r/(\w+)@([\w.]+)/, str) | |
| ["riza@elixirdose.com", "riza", "elixirdose.com"] | |
| iex(18)> email | |
| "riza@elixirdose.com" | |
| iex(19)> username | |
| "riza" | |
| iex(20)> host | |
| "elixirdose.com" |
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
| defmodule Randomize do | |
| def random(number) do | |
| :random.uniform(number) | |
| end | |
| end | |
| IO.inspect Randomize.random(10) |