Dagmawi Babi
6.64K subscribers
15.3K photos
2.07K videos
236 files
2.16K links
Believer of Christ | Creative Developer.

Files Channel: https://t.me/+OZ9Ul_rSBAQ0MjNk

Community: @DagmawiBabiChat
Download Telegram
The longest word you can display on a seven segment display.

We all know these 7 Segmented displays showing the time or various informations on clocks, calculators or other devices.

They're also used to show letters too.
So that got me thinking, what is the longest English word you can display using these 7 Segment displays? 🤔

To answer this I went about exploring my curiousity by writing code to display letters on a seven segment display and uploading it to an Arduino and then writing code to scan through a dictionary and find words that can be displayed on a seven segment display and then choose the longest amongst them and much more. 🤓

You can view the answer and how I got there in the following short video. 🥰

Enjoy! 😊

Here's the TikTok link for better quality
https://vm.tiktok.com/ZMNBfWyrs/?k=1

Lower quality video 👇

#Curiosity #Code
#SevenSegmentDisplay #Arduino
@Dagmawi_Babi
Media is too big
VIEW IN TELEGRAM
The longest word you can display on a seven segment display. 📚

#Curiosity #Code
#SevenSegmentDisplay #Arduino
@Dagmawi_Babi
🍩🍩🍩

Hide this one from Homer Simpson cause this donut shaped code displays a 3D rotating donut on the terminal.

It's considered one of the most beautiful codes ever written.

#Donut #Code
@Dagmawi_Babi
Testing out telegram's code syntax highlighting with some beautiful code....


k;double sin()
,cos();main(){float A=
0,B=0,i,j,z[1760];char b[
1760];printf("\x1b[2J");for(;;
){memset(b,32,1760);memset(z,0,7040)
;for(j=0;6.28>j;j+=0.07)for(i=0;6.28
>i;i+=0.02){float c=sin(i),d=cos(j),e=
sin(A),f=sin(j),g=cos(A),h=d+2,D=1/(c*
h*e+f*g+5),l=cos (i),m=cos(B),n=s\
in(B),t=c*h*g-f* e;int x=40+30*D*
(l*h*m-t*n),y= 12+15*D*(l*h*n
+t*m),o=x+80*y, N=8*((f*e-c*d*g
)*m-c*d*e-f*g-l *d*n);if(22>y&&
y>0&&x>0&&80>x&&D>z[o]){z[o]=D;;;b[o]=
".,-~:;=!*#$@"[N>0?N:0];}}/*#****!!-*/
printf("\x1b[H");for(k=0;1761>k;k++)
putchar(k%80?b[k]:10);A+=0.04;B+=
0.02;}}/*****####*******!!=;:~
~::==!!!**********!!!==::-
.,~~;;;========;;;:~-.
..,--------,*/

#Telegram #Code
@Dagmawi_Babi
This is a fork bomb. Do not write this into your Linux terminal...


:(){ :|:& };:
`

#Telegram #Code #Fork
@Dagmawi_Babi
Quick Sort in Python
def sort(array):
#Sort the array by using quicksort

less = []
equal = []
greater = []

if len(array) > 1:
pivot = array[0]
for x in array:
if x < pivot:
less.append(x)
elif x == pivot:
equal.append(x)
elif x > pivot:
greater.append(x)
return sort(less)+equal+sort(greater)
else:
return array

#Telegram #Code #QuickSort #Python
@Dagmawi_Babi
Python program to display the Fibonacci sequence


# Recursive Fibonacci

def recur_fibo(n):
if n <= 1:
return n
else:
return(recur_fibo(n-1) + recur_fibo(n-2))

nterms = 10

# check if the number of terms is valid
if nterms <= 0:
print("Plese enter a positive integer")
else:
print("Fibonacci sequence:")
for i in range(nterms):
print(recur_fibo(i))

#Telegram #Code #Fibonacci #Python
@Dagmawi_Babi
Mess around and find out. Lolz messing with PATH vars in Ubuntu sometimes crashes your system or it will render the terminal basically useless.

Fix with this:
export PATH=/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin
#Code #Ubuntu
@Dagmawi_Babi
Single and Multiple Files uploader without using external packages :)

#Code
@Dagmawi_Babi
Here's a one liner to completely remove NGINX and everything related from your server
sudo systemctl stop nginx && sudo apt remove -y nginx nginx-common nginx-core && sudo apt autoremove -y && sudo rm -rf /etc/nginx /var/www/nginx /var/log/nginx && sudo apt purge -y nginx && nginx -v

#NGINX #Code
@Dagmawi_Babi