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 Car: | |
""" | |
Regular classes use a __dict__ for attributes | |
""" | |
def __init__(self): | |
self.brand_name = "hyundai" | |
class ECar: | |
__slots__ = ("brand_name", ) # this will prevent declaration of new slots |
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
# In Ruby, a Proc is an object that represents a block of code that can be stored in a variable. | |
# It's a way to create an anonymous function or code block that can be assigned to a variable and passed around in your program. | |
# Procs are instances of the Proc class. | |
# Here's a basic example of using a Proc: | |
full_name = Proc.new{ |first, last| first + " " + last} | |
p full_name["Mashiro", "Moritaka"] # we can call proc using [], using the bracket followed by the arguments | |
p full_name.call("Azuki", "Miho") # we can also call proc using call method |
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
#!/usr/bin/env sh | |
# Program to implement an address book with options given below | |
#1. create the database | |
#2. View address book | |
#3. Insert a Record | |
#4. Delete a Record | |
#5. Modify the Record | |
#6. Exit |
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
#!/bin/sh | |
query="$1" | |
if [ "$query" == '' ]; then | |
read -p "Enter Porn name/category: " query | |
fi | |
# curl https://jp.pornhub.com/video/search?search="$query" | |
start "brave" --incognito "https://jp.pornhub.com/video/search?search="$query"" |
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
echo "Enter number of elements" | |
read k | |
echo "enter array elements" | |
for ((i=0; i<k; i++)) | |
do | |
read a[$i] | |
done | |
for ((i=0; i<k; i++)) | |
do |