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
const readline = require('readline'); | |
const mongoose = require('mongoose'); | |
const usermodel = require('../models/users.model'); | |
const bcrypt = require('bcrypt'); | |
const database = process.env.MONGODB_URI || "mongodb://localhost:27017/<inputlocaldb>"; | |
mongoose.connect(database, { | |
useCreateIndex: true, | |
useNewUrlParser: true, |
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 'package:flutter/material.dart'; | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
// This widget is the root of your application. | |
@override | |
Widget build(BuildContext context) { |
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
name: Build Android Release Apk | |
on: | |
push: | |
branches: | |
- release | |
workflow_dispatch: | |
inputs: | |
logLevel: | |
description: 'Log level' | |
required: true |
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
fn main() { | |
// using the as keyword you can cast a type to another | |
let f = 21.32424242_f32; | |
let i = f as u8; | |
let c = i as char; | |
println!("{} {} {}", f, i , c); | |
} |
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
if __name__ == '__main__': | |
n = int(input()) | |
student_marks = {} | |
for _ in range(n): | |
name, *line = input().split() | |
scores = list(map(float, line)) | |
student_marks[name] = scores | |
query_name = input() | |
percentage = 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
const sieveofetathothese = (n) => { | |
// Create a boolean array that holds true for all the range of n | |
let prime = []; | |
// initialize the first non-prime number which is 2 | |
let p = 2; | |
// populate array with the boolean of true | |
for (let i = 0; i <= n; i++) prime.push(true); | |
// While the multiples of the current value of p is not more than the number n | |
while(p * p <= n) { |
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
if __name__ == '__main__': | |
# create a dictionary | |
d = {} | |
for _ in range(int(input())): | |
name = input() | |
score = float(input()) | |
# assing name as key and score as value in dictionary | |
d[name] = score | |
# assign values to a varible |
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
if __name__ == '__main__': | |
n = int(input()) | |
arr = map(int, input().split()) | |
# Convert the arr variable to a list | |
a = list(arr) | |
# a = [2, 4, 5, 2] | |
# Select the first item in the |
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
// Allow for rust to recognized unused code | |
#[!allow(dead_code)] | |
// Allow rust to be able to debug enum | |
#[derive(Debug)] | |
// Direction enum that each type is type of struct (Point) | |
enum Direction { | |
Up(Point), | |
Down(Point), | |
Left(Point), |
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
P | Q | P->Q | |
---|---|---|---|
T | T | T | |
F | T | T | |
F | T | T | |
F | F | T |
NewerOlder