Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "potholes"
-
fork() can fail: this is important
Ah, fork(). The way processes make more processes. Well, one of them, anyway. It seems I have another story to tell about it.
It can fail. Got that? Are you taking this seriously? You should. fork can fail. Just like malloc, it can fail. Neither of them fail often, but when they do, you can't just ignore it. You have to do something intelligent about it.
People seem to know that fork will return 0 if you're the child and some positive number if you're the parent -- that number is the child's pid. They sock this number away and then use it later.
Guess what happens when you don't test for failure? Yep, that's right, you probably treat "-1" (fork's error result) as a pid.
That's the beginning of the pain. The true pain comes later when it's time to send a signal. Maybe you want to shut down a child process.
Do you kill(pid, signal)? Maybe you do kill(pid, 9).
Do you know what happens when pid is -1? You really should. It's Important. Yes, with a capital I.
...
...
...
Here, I'll paste from the kill(2) man page on my Linux box.
If pid equals -1, then sig is sent to every process for which the calling process has permission to send signals, except for process 1 (init), ...
See that? Killing "pid -1" is equivalent to massacring every other process you are permitted to signal. If you're root, that's probably everything. You live and init lives, but that's it. Everything else is gone gone gone.
Do you have code which manages processes? Have you ever found a machine totally dead except for the text console getty/login (which are respawned by init, naturally) and the process manager? Did you blame the oomkiller in the kernel?
It might not be the guilty party here. Go see if you killed -1.
Unix: just enough potholes and bear traps to keep an entire valley going.
Source: https://rachelbythebay.com/w/2014/...12 -
Made this project "Come Fix Me" in a 24hr hackathon. Won the most innovative solution.
An android application for citizens(users) which allows them to register issues on potholes in their area.
Web for report management
Usage Flow:
User clicks a photo of the pothole and registers a new issue.
The photo gets uploaded on the firebase database along with other information like GPS co-ordinates.
The image is downloaded in the server and served in the pothole detection script.
If pothole is detected an estimated area is calculated, if no pothole is detected user's issue gets rejected.
After successful detection details are uploaded on the web for administrator, these issue are forwarded to govt. officials.
Once the officials claim that they have fixed the pothole, the user gets a notification and they can close their issue if pothole is fixed
Demontration:
https://youtu.be/cN9kijExwyI
Github Link:
https://github.com/globefire/...rant story innovation python web development firebase yolo opencv android development machine learning cuda12 -
!dev
I like biking to places, but the roads are so terrible quality in Budapest (the capital city) that I can't sit down without risking getting sterilized.2 -
NYC:
- Constant construction work that never ends
- You can buy ad place on scaffolding
- Potholes are “repaired” with literal trash left outside by shop owners that is compacted by passing cars
- It's okay to bump other cars to make room for parking yours
I've never been there. NYC dwellers, are those rumors true?37 -
Motorcycle Accident Lawyer: Your Trusted Advocate in Miami – Pita Weber Del Prado
Motorcycle accidents can result in devastating injuries, from broken bones and spinal injuries to traumatic brain injuries and even fatalities. The physical, emotional, and financial toll of a motorcycle accident can be overwhelming, leaving victims unsure of how to navigate the complexities of insurance claims and legal proceedings. If you’ve been involved in a motorcycle accident in Miami, having an experienced motorcycle accident lawyer by your side is essential to ensuring you receive the compensation you deserve. At Pita Weber Del Prado, we are committed to protecting the rights of motorcycle accident victims and guiding them through every step of the legal process.
Why You Need a Motorcycle Accident Lawyer in Miami
Motorcycle accidents are unique and often involve more severe injuries compared to car accidents due to the lack of protective barriers. Additionally, the public’s perception of motorcyclists can sometimes be biased, making it harder for victims to get the fair treatment they deserve. An experienced motorcycle accident lawyer can help level the playing field by ensuring that your case is properly investigated and that your rights are vigorously defended.
At Pita Weber Del Prado, we specialize in representing motorcycle accident victims in Miami and surrounding areas. Our legal team has a deep understanding of Florida’s motorcycle laws, insurance regulations, and how to navigate the complex issues that arise in these types of cases.
Common Causes of Motorcycle Accidents
Motorcycle accidents can happen for a variety of reasons. Some of the most common causes include:
Distracted Drivers: One of the leading causes of motorcycle accidents is other drivers not paying attention to the road. Distracted driving—such as texting, using a phone, or even eating—can prevent drivers from noticing a motorcyclist, leading to collisions.
Failure to Yield: Drivers often fail to yield the right of way to motorcyclists, particularly at intersections, causing accidents. Many drivers simply don’t notice motorcyclists or fail to check their blind spots before changing lanes or making turns.
Speeding and Reckless Driving: Speeding and aggressive driving are dangerous for all road users, but they are particularly risky for motorcyclists. Excessive speed reduces the time to react to hazards, which can lead to accidents.
Road Hazards: Poor road conditions—such as potholes, uneven surfaces, or wet roads—can be especially dangerous for motorcyclists. These hazards can cause loss of control, resulting in crashes.
Impaired Driving: Driving under the influence of alcohol or drugs significantly impairs a driver’s reaction time and ability to judge distances, leading to crashes involving motorcycles.
How a Motorcycle Accident Lawyer Can Help You
If you’ve been injured in a motorcycle accident, you may be facing steep medical bills, lost wages, and emotional distress. An experienced motorcycle accident lawyer can help you by:
Investigating the Accident: Our team will conduct a thorough investigation into the accident, gathering crucial evidence such as witness statements, police reports, and accident scene photographs. We will also work with accident reconstruction experts, if necessary, to establish fault.1
