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
<html> | |
<body> | |
<form action=""> | |
<input id="m" autocomplete="off" /><button>Send</button> | |
</form> | |
<ul id="messages"></ul> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.0.0/socket.io.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.js"></script> | |
<script> |
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
sc.textFile("/home/bibi/Desktop/distributed.csv") \ | |
.map(lambda line: line.split(",")) \ | |
.map(lambda line: (int(line[0]),float(line[2]))) \ | |
.combineByKey( lambda value: (value, 1), | |
lambda x, value: (x[0] + value, x[1] + 1), | |
lambda x, y: (x[0] + y[0], x[1] + y[1])) \ | |
.map(lambda (label, (value_sum, count)): (label, value_sum / count)) \ | |
.collectAsMap() |
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
USE https://jsoneditoronline.org/ TO VISUALIZE THESE DATA! | |
USER.JSON | |
WRITE LOGIC TO COMPARE ALL VIDEOS WITHING ALL PLAYLISTS -> KEEP COUNT OF ALL VIDEOS COUNT -> COMPARE WITH WATCHED VIDEOS | |
WRITE LOGIC TO COMPARE QUIZES WITH COMPLETED WATCHED VIDEOS |
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 { ApolloServer, gql } = require('apollo-server'); | |
// The GraphQL schema | |
const typeDefs = gql` | |
type Query { | |
"A simple type for getting started!" | |
book: Book | |
} | |
type Book { |
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 typeDefs = gql` | |
type Query { | |
Posts: [Post], | |
} | |
type Mutation { | |
addPost(title: String!, content: String!): [Post] | |
} | |
type Post { | |
title: String |
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 graphqlHTTP = require('express-graphql'); | |
const { buildSchema } = require('graphql'); | |
const schema = buildSchema(` | |
input MessageInput { | |
content: String | |
author: String | |
} |
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
FROM node:8 | |
# Create app directory | |
WORKDIR /usr/src/app | |
# Install app dependencies | |
# A wildcard is used to ensure both package.json AND package-lock.json are copied | |
# where available (npm@5+) | |
COPY package*.json ./ |
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
using Microsoft.EntityFrameworkCore; | |
using System.Collections.Generic; | |
namespace efcore | |
{ | |
public class AppDBContext : DbContext | |
{ | |
public DbSet<Student> Students { get; set; } | |
public DbSet<Course> Courses { get; set; } |
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 React from 'react'; | |
const App = () => { | |
return <Menu colour="blue" language="en" />; | |
} | |
function Menu(props) { | |
return( | |
<MenuItem | |
colour={props.colour} |
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 React from 'react'; | |
const AppContext = React.createContext({ colour: 'blue', lang: 'en' }); | |
const App = () => | |
<AppContext.Provider value={{ colour: 'blue', lang: 'fr' }}> | |
<Menu /> | |
</AppContext.Provider>; | |
function Menu() { |
OlderNewer