$ sudo -i -u postgres
postgres@username:~$ psql
postgres=# help
You are using psql, the command-line interface to PostgreSQL.
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit
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
| CC=gcc # compiler | |
| all: mainapp | |
| mainapp: main ops | |
| $(CC) main.o ops.o -o prog | |
| main: | |
| $(CC) -c main.c |
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 socket | |
| HOST = '127.0.0.1' | |
| PORT = 9000 | |
| inp = input('>> ') | |
| bytes_data = bytes(inp, 'utf-8') | |
| with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: | |
| s.connect((HOST, PORT)) |
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
| // Balance inquiry | |
| // Resource: C How to Program by The Dietels | |
| #include <stdio.h> | |
| int main( void ){ | |
| int request; // request number | |
| int account; // account number | |
| char name[30]; // account name | |
| double balance; // account balance |
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
| struct clientData { | |
| int acctNum; // account number | |
| char lastName[ 15 ]; // account last name | |
| char firstName[ 10 ]; // account first name | |
| double balance; // account balance | |
| }; |
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 main | |
| import ( | |
| "fmt" | |
| ) | |
| /* | |
| GO program to calculate | |
| the square root of a number | |
| */ |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 sqlite3 # import the sqlite3 library | |
| con = sqlite3.connect("main.db") # connect to database | |
| cur = con.cursor() # create a db cursor | |
| cur.execute("CREATE TABLE person(fullname, lastname, gender, age)") # create a table with the cursor | |
| cur.execute(""" | |
| INSERT INTO person VALUES | |
| ('John', 'Doe', 'MALE', 20 ), |