coding

Set dtype with dtype argument functions and get it in PyTorch

Set dtype with dtype argument functions and get it in PyTorch

You can set dtype with the functions which have dtype arguments and get it with dtype and type() as shown below: *Memos: tensor(). *My post explains tensor(): import torch my_tensor = torch.tensor([0, 1, 2]) my_tensor = torch.tensor([0, 1, 2], dtype=torch.int64) my_tensor = torch.tensor([0, 1, 2], dtype=int) my_tensor, my_tensor.dtype, my_tensor.type() # (tensor([0, 1, 2]), torch.int64, 'torch.LongTensor') my_tensor = torch.tensor([0., 1., 2.], dtype=torch.float64) my_tensor = torch.tensor([0., 1., 2.], dtype=float) my_tensor, my_tensor.dtype, my_tensor.type() # (tensor([0., 1., 2.], dtype=torch.float64), # torch.float64, # 'torch.DoubleTensor') my_tensor = torch.tensor([0.+7.j, 1.+4.j, 2.+5.j], dtype=torch.complex32) my_tensor, my_tensor.dtype, my_tensor.type() # (tensor([0.+7.j, 1.+4.j, 2.+5.j], dtype=torch.complex32), # torch.complex32, # 'torch.ComplexHalfTensor') my_tensor = torch.tensor([True,…
Read More
ONTO THE OTHER

ONTO THE OTHER

Hey everyone, I got super busy with a lot of stuff, but I am back! So, where were we? Ah yes, check out the progress I made in the past two hours. I wanted to update you all as soon as possible (image1). (image1) Yes, I know it looks like a Mario tube right now, and you're probably thinking, "What in the world is this?" Basically, I want to attach the actual head of the turret onto this thing. Remember how I wanted to make this a rail gun and showed a picture of how I wanted it to look?…
Read More
buffer Overflow (Application Vulnerability)

buffer Overflow (Application Vulnerability)

https://github.com/samglish/bufferOverflow/ In french dépassement de tampon ou débordement de tampon copy data without checking size.A bug whereby a process, when writing to a buffer, writes outside the space allocated to the buffer, thus overwriting information necessary for the process. Most common exploitation stack overflow Injection of a shellcode on the stack and calculation of its address Overflow of a variable on the stack Overwriting SEIP with the shellcode address A C program to demonstrate buffer overflow #include <stdio.h> #include <string.h> #include <stdlib.h> int main(int argc, char *argv[]) { // Reserve 5 byte of buffer plus the terminating NULL. // should…
Read More
How to improve Django Framework?

How to improve Django Framework?

On June 21, 2024 I started a thread on reddit with the following question: “What would you improve about Django framework?”. The response from the community was immediate and the conversation quickly filled up with suggestions on how to improve Django framework, ranging from modest to quite radical. I summarize the results below. HTMX meme Would type hints improve Django Framework? This was the comment that received the most support from the community. Although Python already has optional Type Hints since version 3.5, it seems that implementing them for the purpose of modernizing Django Framework does not seem to be…
Read More
Handling complex events with Bacon.js and combineTemplate

Handling complex events with Bacon.js and combineTemplate

Functional Reactive Programming (FRP) is an advanced programming paradigm that simplifies the management and manipulation of asynchronous events, such as user input or data streams. Bacon.js is a powerful JavaScript library that enables you to implement FRP principles in your web applications effectively. Understanding Functional Reactive Programming (FRP) Functional Reactive Programming is a paradigm that handles events and data streams in a more declarative manner, allowing you to describe the flow of data and reactions to it in a clear and concise way. This approach makes working with asynchronous events more manageable and intuitive, making your code easier to understand…
Read More
Java: The WHORE Without The H

Java: The WHORE Without The H

After a hard fast thrust, comes Sun's 1995 release, Java. People's love for Java is abound. This is because of the Java Virtual Machine, which ensures the same Java code can be run on different operating systems and platforms. This made Sun Microsystems’ slogan for Java was “Write Once, Run Everywhere”. The WhORE, Java, runs on different platforms, but programmers write it the same way. Which other programming language is a WORE? Source link lol
Read More
Sharing is Caring: Securely Extending AWS Resources Across Accounts

Sharing is Caring: Securely Extending AWS Resources Across Accounts

In the realm of cloud computing, where agility and scalability reign supreme, AWS offers a myriad of services that empower businesses to build robust and innovative solutions. As organizations grow and diversify, the need to segregate workloads and resources into separate AWS accounts often arises. This multi-account strategy enhances security, streamlines billing, and promotes efficient resource management. However, it also introduces the challenge of securely sharing resources and data across these isolated environments. This is where the power of cross-account access in AWS comes into play. This essential feature allows users and resources in one AWS account (the consumer account)…
Read More
HOW TO CONFIGURE PING URL TESTS AND HEALTH CHECKS WITH AZURE MONITOR APPLICATION INSIGHTS

HOW TO CONFIGURE PING URL TESTS AND HEALTH CHECKS WITH AZURE MONITOR APPLICATION INSIGHTS

Azure Monitor Application Insights offers powerful tools to monitor the availability and performance of your applications. One of its key features is the ability to configure URL ping tests and health checks to ensure that your web applications are running smoothly. This guide will walk you through the steps to set up these tests. Prerequisites• An active Azure subscription.• An Application Insights resource created in your Azure portal. Step-by-Step Guide 1. Navigate to Application Insights Resource Log in to the Azure Portal. In the left-hand menu, select Resource groups and then select the resource group containing your Application Insights resource.…
Read More
The Eternal Truth of Markdown

The Eternal Truth of Markdown

Markdown became a core part of how I wrote. The simplicity and flexibility meant I would live the dream of write once, run anywhere. It did lead to some ambiguity, though. Gruber would probably say this is by design. His emphasis throughout the Markdown documentation is on the syntax of Markdown, not—say—the resulting HTML. His Perl script does not support HTML class names or IDs, for example, so you can’t add those to the generated HTML. By the logic of the original Markdown script, if you want complete control over the HTML output, then you’d need to write in HTML.This…
Read More
Creating Chat Bubbles with curls in React Native (svg)

Creating Chat Bubbles with curls in React Native (svg)

Recently, while working on a project, I needed to create a chat feature with a UI similar to iMessage. When I reached the part where I had to implement the curls, I considered three options: One: Use before and after pseudo element. (Challenge: pseudo classes and element do not work in react-native, hence option 2) Two: Use two Views one for the curl and another to overlap it. Something like this <View style={styles.chatBubble}> <Text style={styles.text}> Hey whats up </Text> <View style={styles.curl}></View> <View style={styles.curlOverlap}></View> </View> Enter fullscreen mode Exit fullscreen mode Three: Use an Svg. Less work :) yay! Initially, I…
Read More
No widgets found. Go to Widget page and add the widget in Offcanvas Sidebar Widget Area.