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
| class WidgetRepository @Inject constructor(@ApplicationContext val appContext: Context) { | |
| private var _currentTitle = MutableStateFlow<String?>("") | |
| val currentTitle = _currentTitle.asStateFlow() | |
| @EntryPoint | |
| @InstallIn(SingletonComponent::class) | |
| interface WidgetRepoEntryPoint { | |
| fun widgetRepo(): WidgetRepository | |
| } |
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 dnslib import DNSRecord, DNSHeader, DNSBuffer, DNSQuestion, RR, QTYPE, RCODE | |
| from socket import socket, SOCK_DGRAM, AF_INET | |
| """ | |
| There are 13 root servers defined at https://www.iana.org/domains/root/servers | |
| """ | |
| ROOT_SERVER = "199.7.83.42" # ICANN Root Server | |
| DNS_PORT = 53 | |
| def get_dns_record(udp_socket, domain:str, parent_server: str, record_type): |
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
| export type State = { | |
| // abbreviation: string | |
| name: string; | |
| capital: string; | |
| population: number; | |
| nationalParks: Array<string>; | |
| }; | |
| export type City = { | |
| name: 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
| export type State = { | |
| // abbreviation: string | |
| name: string, | |
| capital: string, | |
| population: number, | |
| nationalParks: Array<string> | |
| } | |
| export type City = { | |
| name: 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 socket import gethostbyname, getprotobyname, socket, SOCK_RAW, AF_INET, htons, inet_ntoa | |
| from os import getpid | |
| import sys | |
| from struct import pack, unpack_from | |
| from time import time, sleep | |
| from select import select | |
| ICMP_ECHO_REQUEST = 8 | |
| def checksum(sdata): |
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
| package edu.gvsu.computing.cs357 | |
| import kotlinx.coroutines.* | |
| import kotlin.system.measureTimeMillis | |
| fun sample1() { | |
| println ("Begin Sample 1") | |
| runBlocking { | |
| launch { | |
| println("Begin A") | |
| delay(5000) |
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 nix::unistd::{fork, ForkResult}; | |
| // use nix::sys::wait::wait; | |
| // use nix::sys::wait::WaitStatus; | |
| use std::process; | |
| fn main() { | |
| let pid = fork(); | |
| match pid { | |
| Ok(ForkResult::Child) => { | |
| println!("I'm a child with PID {}", process::id()); |
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
| #include <fcntl.h> | |
| #include <stdio.h> | |
| #include <unistd.h> | |
| #include <errno.h> | |
| int main() { | |
| char name[50]; | |
| int fd = open("myoutput.txt", | |
| O_WRONLY | O_CREAT | O_EXCL, |
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
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <unistd.h> | |
| #include <string.h> | |
| #define READ 0 | |
| #define WRITE 1 | |
| #define MAX 1024 | |
| int main () { |
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
| #include <stdio.h> | |
| #include <signal.h> | |
| #include <stdlib.h> | |
| #include <errno.h> | |
| #include <stdbool.h> | |
| int number = 0; | |
| bool running = true; | |
| void do_nothing(int s) { |
NewerOlder