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 <[email protected]> | |
# Bart Trojanowski <[email protected]> | |
# Brian Carper <[email protected]> | |
# steeef2 <[email protected]> | |
# Sorin Ionescu <[email protected]> | |
# |
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 = "[email protected]" | |
"[email protected]" | |
iex(17)> [email, username, host] = Regex.run(~r/(\w+)@([\w.]+)/, str) | |
["[email protected]", "riza", "elixirdose.com"] | |
iex(18)> email | |
"[email protected]" | |
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) |