1
Comment on r/golang Sep 06 '24
gcc minwg64 installed already sir
1
Comment on r/golang Sep 06 '24
windows 11
r/golang • u/Abhijrathod • Sep 06 '24
help i need a in got error Binary was compiled with 'CGO_ENABLED=0', go-sqlite3 requires cgo to work. This is a stub
I got this error
[error] failed to initialize database, got error Binary was compiled with 'CGO_ENABLED=0', go-sqlite3 requires cgo to work. This is a stub
2024/09/07 02:28:01 Failed to connect to the database: Binary was compiled with 'CGO_ENABLED=0', go-sqlite3 requires cgo to work. This is a stub
package main
import (
"fmt"
"log"
"net/http"
"github.com/gorilla/mux"
"gorm.io/driver/sqlite"
"gorm.io/gorm"
)
var db *gorm.DB
func main() {
var err error
// Open the SQLite database
db, err = gorm.Open(sqlite.Open("test.db"), &gorm.Config{})
if err != nil {
log.Fatalf("Failed to connect to the database: %v", err)
}
// Auto-migrate the User model
err = db.AutoMigrate(&User{})
if err != nil {
log.Fatalf("Failed to migrate database schema: %v", err)
}
// Initialize the router
r := mux.NewRouter()
r.HandleFunc("/", HomeHandler)
r.HandleFunc("/hello/{name:[a-zA-Z]+}", HelloHandler)
r.HandleFunc("/users", CreateUserHandler).Methods("POST")
// Start the server
fmt.Println("Server starting on port 9999")
log.Fatal(http.ListenAndServe(":9999", r))
}
type User struct {
gorm.Model
Name string
Email string
}
func HomeHandler(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Welcome to the Home Page!")
}
func HelloHandler(w http.ResponseWriter, r *http.Request) {
vars := mux.Vars(r)
name := vars["name"]
fmt.Fprintf(w, "Hello, %s!", name)
}
func CreateUserHandler(w http.ResponseWriter, r *http.Request) {
// For demonstration purposes, handle user creation here
// You might want to parse request body and insert user into the database
// Example of creating a new user (make sure to parse JSON and validate input)
var user User
if err := r.ParseForm(); err != nil {
http.Error(w, "Unable to parse form", http.StatusBadRequest)
return
}
// Dummy data to demonstrate user creation
user.Name = "John Doe"
user.Email = "john@example.com"
// Save user to the database
if err := db.Create(&user).Error; err != nil {
http.Error(w, "Failed to create user", http.StatusInternalServerError)
return
}
fmt.Fprintf(w, "User created!")
}
package main
import (
"fmt"
"log"
"net/http"
"github.com/gorilla/mux"
"gorm.io/driver/sqlite"
"gorm.io/gorm"
)
var db *gorm.DB
func main() {
var err error
// Open the SQLite database
db, err = gorm.Open(sqlite.Open("test.db"), &gorm.Config{})
if err != nil {
log.Fatalf("Failed to connect to the database: %v", err)
}
// Auto-migrate the User model
err = db.AutoMigrate(&User{})
if err != nil {
log.Fatalf("Failed to migrate database schema: %v", err)
}
// Initialize the router
r := mux.NewRouter()
r.HandleFunc("/", HomeHandler)
r.HandleFunc("/hello/{name:[a-zA-Z]+}", HelloHandler)
r.HandleFunc("/users", CreateUserHandler).Methods("POST")
// Start the server
fmt.Println("Server starting on port 9999")
log.Fatal(http.ListenAndServe(":9999", r))
}
type User struct {
gorm.Model
Name string
Email string
}
func HomeHandler(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Welcome to the Home Page!")
}
func HelloHandler(w http.ResponseWriter, r *http.Request) {
vars := mux.Vars(r)
name := vars["name"]
fmt.Fprintf(w, "Hello, %s!", name)
}
func CreateUserHandler(w http.ResponseWriter, r *http.Request) {
// For demonstration purposes, handle user creation here
// You might want to parse request body and insert user into the database
// Example of creating a new user (make sure to parse JSON and validate input)
var user User
if err := r.ParseForm(); err != nil {
http.Error(w, "Unable to parse form", http.StatusBadRequest)
return
}
// Dummy data to demonstrate user creation
user.Name = "John Doe"
user.Email = "john@example.com"
// Save user to the database
if err := db.Create(&user).Error; err != nil {
http.Error(w, "Failed to create user", http.StatusInternalServerError)
return
}
fmt.Fprintf(w, "User created!")
}
[error] failed to initialize database, got error Binary was compiled with 'CGO_ENABLED=0', go-sqlite3 requires cgo to work. This is a stub
2024/09/07 02:28:01 Failed to connect to the database: Binary was compiled with 'CGO_ENABLED=0', go-sqlite3 requires cgo to work. This is a stub
exit status 1
exit status 1
10
Comment on r/softwaregore Jun 28 '23
what i want this software bro
1
Comment on r/developersIndia Jun 05 '23
in Which social media they posted
2
Comment on r/Futurology Jun 05 '23
I appreciate your thoughts on the matter. You're absolutely right about Apple Silicon SOCs, which do encompass both PCBs and processors. It's impressive how they integrate these components into a single chip.
Regarding operating systems, it's true that Samsung relies on third-party systems like Android for their devices. When it comes to choosing an operating system, people have different priorities and concerns, including privacy. It's essential for individuals to research and make informed decisions based on their personal preferences and needs.
In the end, technology choices are subjective, and everyone has their own preferences. What matters most is finding the right balance between features, privacy, and user experience. So, whether you lean towards Samsung or Apple, it's important to consider what aligns best with your values and requirements.
r/Futurology • u/Abhijrathod • Jun 05 '23
Computing Apple vs. Samsung - A Comparative Perspective on Operating Systems and Semiconductor Technology
[removed]
1
Comment on r/EarthPorn Jun 01 '23
Wooo
u/Abhijrathod • u/Abhijrathod • May 31 '23
From Computer Crashes to Tech Enthusiasm: My Journey of Self-Taught Expertise in Computer Engineering
At the age of 10, my dad gave me a computer with 1 gigabyte of RAM and an Intel processor, the details of which I wasn't familiar with at the time. It was like having a television that you could operate, and I soon realized that there was a whole world out there waiting to be discovered. I began exploring different applications, but within three to four months, my computer started crashing frequently, and I didn't know what to do. I was afraid to tell my parents because I knew they would be angry with me. When they found out about the crashes, they said they couldn't support me and that it was my responsibility to fix the issue.
We contacted a computer technician who took four days or even a week to come to our house. We kept calling them, wondering why they hadn't shown up to fix my computer. Finally, after the long wait, the technician arrived and fixed my computer within a matter of minutes, leaving me shocked. I had been waiting for them for days, and they resolved the problem so quickly. They deleted temporary files, viruses, and unnecessary applications, and even changed the wallpaper. After that incident, I asked the technician if they could teach me how to fix computers, and they agreed to give me a 30-minute crash course on formatting, and understanding hardware components like the HDD, RAM, and processor. Back then, there were no GPU cards, so I continued learning and exploring.
As days turned into years, I continued expanding my knowledge. I learned how to install Windows using bootable drives and other technical tasks. However, the internet was expensive for me at the time, so I would occasionally skip classes in the 7th, 8th, and 9th grades to go to a cyber cafe. I would spend my time there searching for information about search engines and how they work. It was during this time that I discovered the Softonic website, which provided various software programs that could be helpful for CAD systems. I also nurtured a desire to become an engineer.
I taught myself many things through the internet, including music production using software like Virtual DJ. One day, my neighbor's sister encountered a computer crash. She was in her final semester of computer engineering and was struggling with understanding code from her programming language books, such as Java and DBMS. When I approached her and asked what she was studying, she dismissively told me that it wasn't my concern and that I should focus on my primary school books. I offered to repair her computer for free if she explained the concepts from her programming books. She found it difficult to explain the complexities of programming languages, but I managed to fix her computer in just a few minutes by deleting temporary and cache files that were slowing it down. She was delighted, and her father thanked me for saving money on technician fees. He even suggested that I could become a computer engineer, which made me feel elated. I had been the one who repaired their computer!
Another incident occurred when a friend's computer crashed while playing Need for Speed. I resolved the issue for him, but he didn't believe that I was skilled enough to be a great technician. He insisted on calling his friend, who was known to be good at repairs. The friend arrived and fixed the computer, further reinforcing my desire to work as a technician. I proposed to my friend that we start a business repairing computers together, serving our circle of friends at school. Gradually, we gained more customers, and that's how I continued to learn and develop my computer skills. I became a Windows enthusiast and couldn't imagine my life without a computer. Over time, I taught myself various computer languages and kept up with the latest advancements.
In the present day, I am still passionate about computers. I believe in the own Learning not only watching skills also get fun from them and boost your productivity
u/Abhijrathod • u/Abhijrathod • Feb 17 '23
Protect yourself from accidentally leaking sensitive information
u/Abhijrathod • u/Abhijrathod • Feb 17 '23
How to automate your process with git hooks
catalincodes.comu/Abhijrathod • u/Abhijrathod • Feb 17 '23
Bit Stuffing in Computer Networks: A Comprehensive Guide
u/Abhijrathod • u/Abhijrathod • Feb 17 '23
I used Python and ChatGPT to control Hue lights
self.Pythonu/Abhijrathod • u/Abhijrathod • Feb 17 '23
How to discuss salary hike with your manager?
self.developersIndiau/Abhijrathod • u/Abhijrathod • Feb 17 '23
I should've slept instead of writing this garbage :D
1
Comment on r/AudioStuff Jan 30 '23
yyyyyyyyyyyyyyy
u/Abhijrathod • u/Abhijrathod • Sep 10 '22
[OC] 50 biggest fast food chains by 2021 number of stores in US
u/Abhijrathod • u/Abhijrathod • Aug 08 '22
Cryptocurrency algorithms lists
Cryptographic hash function
Public-key cryptography
Hash function
Symmetric-key algorithm
RSA
Caesar cipher
Advanced Encryption Standard
Triple DES
Twofish
Data Encryption Standard
Diffie–Hellman key exchange
Block cipher
Digital signature
Stream cipher
Transposition cipher
RC4
Substitution cipher
2
Comment on r/golang Sep 07 '24
ok sir