BeNN
1.1K subscribers
915 photos
82 videos
115 files
154 links
From simple ML algorithms to Neural Networks and Transformers β€” and from Number Theory to Topology, Cosmology to QED β€” dive into the world where code meets the cosmos.πŸ‘¨β€πŸ’»πŸŒŒ

For Any Questions @benasphy
Download Telegram
BeNN
Video
You Beautiful AlienπŸ”₯πŸ”₯πŸ”₯No Any AGI or ASI system would be like him. Beyond Greatness😎
πŸ‘Œ4πŸ‘2
BeNN
Video
It's Ridiculous seeing other clubs cooking Europe Teams in this club world cup. Al Hilal and Inter Miami has surprised me.
πŸ”₯2
🐍 Why Python is Dynamically Typed β€” and What That Really Means

In the world of programming languages, a major distinction you’ll encounter is ''statically typed'' vs ''dynamically typed'' languages. Python falls into the latter category β€” and understanding what that means is not just theoretical. It affects how you write code, debug, and build scalable systems.

🧠 What Does "Dynamically Typed" Even Mean?

In a dynamically typed language like Python, variable types are determined at runtime, not in advance.

That means:

- You don’t have to declare the type of a variable.
- The type is determined when the code is executed.
- The same variable can hold values of different types at different points in time.

Compare that to statically typed languages (like Java, C, or Go), where:

- You must declare the type beforehand.
- The compiler enforces type correctness.
- Type-related bugs are caught at compile time.


πŸ§ͺ A Simple Python Example


print(type(x)) # <class 'int'>

x = "hello" # Now x holds a string!
print(type(x)) # <class 'str'>

Python lets you reassign a variable to a completely different type. No complaints, no compiler errors β€” because Python doesn't check types until the code runs.


πŸ”¬ What’s Going on Under the Hood?

When you write x = 42 in Python, you’re not binding a type to a variable. Instead, you’re:

1. Creating an object of type int with value 42.
2. Binding the name x to that object in a dictionary that represents the current namespace.

You can think of Python variables as labels attached to objects, not as memory slots of a specific type like in C.

Internally:

Python stores all objects in memory, and every object has:

- A type tag (`PyTypeObject*`)
- A reference count
- Optional value fields

When x = 42, this happens:


When you do x = "hello":


- Python decreases the reference count of the integer object (maybe deletes it if count == 0).
- Then creates a new str object.
- Binds x to this new string object.

This level of indirection is what makes Python dynamic β€” and flexible.


βš–οΈ Static Typing Comparison: Java

Here’s a similar example in Java:


x = "hello"; // ❌ Compile-time error!

Java won't allow this because the variable x is statically typed as int. The compiler enforces this restriction before the program even runs.

That’s the difference: Static typing = types known and checked before runtime.

🚨 Benefits and Drawbacks of Dynamic Typing

βœ… Pros:

* Fast prototyping
* Less boilerplate code
* More flexible (you can write generic functions easily)
❌ Cons:

* Type-related bugs are found at runtime
* Harder to reason about large codebases
* Less performance optimization by interpreter

🧰 Optional Static Typing in Python

Thanks to Python’s evolution, you can now use type hints (via [PEP 484](https://peps.python.org/pep-0484/)) to make your code feel more like statically typed code β€” without losing flexibility.

Example:


return "Hello, " + name

But remember: type hints are not enforced by Python itself. They’re used by tools like mypy or IDEs to check types statically, but they don’t change how Python runs your code.


πŸ› οΈ Recap: Why Python Is Dynamically Typed

* Type is determined at runtime
* Variables are just names bound to objects, not memory slots with types
* No compiler-time type checking
* You can reassign a variable to any type

Under the hood, Python uses dynamic memory management, object metadata, and runtime type checking to make this flexibility possible β€” at the cost of some performance and type safety.


🧩 Final Thought

Python’s dynamic nature is what makes it intuitive and elegant, especially for scripting, data science, and AI development. But as your codebase grows, combining dynamic typing with good practices and optional static hints can give you the best of both worlds.
❀1πŸ‘1πŸ”₯1
From now on we will also talk about what is going under the hood in python. Learning and knowing those normal codes is an easy thing, but deeply understanding what's going under the hood will give you an edge; That's why Hackers (The real one not script kiddies or use another person tools) are the best at what they do. They have understood how the whole computer works mostly. I think One day I have heard Kevin Mitnick or someone saying Hacker is someone who deeply understood about computers.
πŸ‘3
BeNN
https://youtu.be/jtrFTHlUJ5Q?si=QIZwXdvaNn7OUEiS
Check out all Mariana's Documentaries she's Gangster!!! Damn the Documentaries are addictiveπŸ”₯
πŸ‘2
πŸ‘1
BeNN
https://youtu.be/LCEmiRjPEtQ?si=th6sisVkWW1OwcdY
Another Materclass by Andrej Karpathy. An Amazing man!
​️Title: StartUp [2016 -2018]
Also Known As: StartUp
Rating ⭐️: 7.8 / 10
(7.8 based on 29973 user ratings) | 16 | 0h 44min |
Release Info: 8 / 11 / 2016 (Germany)
Genre: #Crime #Thriller
Language: #English
Country of Origin: πŸ‡ΊπŸ‡Έ #United_States
Story Line: A desperate banker, a Haitian-American gang lord and a Cuban-American hacker are forced to work together to unwittingly create their version of the American dream - organized crime 2.0.
Directors Ben Ketai
Stars Adam Brody Edi Gathegi Otmara Marrero Kristen Ariza Fredrick Bam Scott Martin Freeman Ron Perlman

Read More ...
'''Simple HIV prediction using Logistic Regression'''
import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import accuracy_score, confusion_matrix, classification_report

#Load Data

data = {
'Age': [25, 35, 45, 28, 50, 30, 40, 23, 60, 33],
'CD4_Count': [500, 350, 200, 450, 180, 320, 250, 600, 150, 400],
'Viral_load': [10, 20, 50, 15, 60, 25, 40, 12, 70, 30],
'HIV_status': [0, 1, 1, 0, 1, 0, 1, 0, 1, 0]
}

#Convert to DataFrame

df = pd.DataFrame(data)

#Split into Features and Target

X = df[['Age', 'CD4_Count', 'Viral_load']]
y = df['HIV_status']

#Split into Train and Test

X_train, X_test, y_train, y_test = train_test_split(X, y, test_size = 0.2, random_state = 42)

#Train the model

model = LogisticRegression()
model.fit(X_train, y_train)

#predicting

y_pred = model.predict(X_test)


#New data prediction

new_data = np.array([20, 480, 12])
new_prediction = model.predict(new_data.reshape(1, -1))
for i, (input_data, prediction) in enumerate(zip(new_data, new_prediction)):
status = "Positive" if prediction == 1 else "Negative"
print(f"predicted HIV status: {status}")
❀3
Forwarded from AI Post β€” Artificial Intelligence
This media is not supported in your browser
VIEW IN TELEGRAM
Robotaxi slows down really nice for speed bumps. Extremely smooth stops as well

@aipost πŸͺ™ | Our X πŸ₯‡
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ”₯2
Forwarded from AI Post β€” Artificial Intelligence
This media is not supported in your browser
VIEW IN TELEGRAM
Tesla Robotaxi performance at night is as great as it is during the day.

@aipost πŸͺ™ | Our X πŸ₯‡
Please open Telegram to view this post
VIEW IN TELEGRAM
L1 = [1, ('a', 3)]
L2 = [1, ('a', 3)]
L1 is L2
Anonymous Quiz
52%
True
48%
False
Anyone who's good at iOS and Android Development DM @benasphy
Please don't if you haven't done some projects to show
Forwarded from Beka (Beka)
I'm happy to announce Better Auth has raised a $5M seed led by PeakXV Partners (formerly Sequoia Capital India & SEA), with participation from Y Combinator, Chapter One, P1 Ventures, and a group of incredible investors and angels

Thanks everyone for your support and for being a part of this journey!

https://www.better-auth.com/blog/seed-round
πŸ”₯3πŸ‘2