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 - "avoid void"
-
Long story short:
My system need to talk with a 3rd party PoS API. The provided doc is pretty useless and with few errors.. nonetheless I came to finish the 99% of the job.
I was stuckd on the 1%, one frickin function.
Everytime I would call the endpoint I would receive...NOTHING. Just a 200.
I've spent like 5 hours trying everything, even sending wrong params...nothing...
Always 200 and nothing else.
Apparently, for an entire nation and the IT Company behind them, is ok to have A PAYMENT API TO RETURN VOID AND A 200 NO MATTER WHAT.
I got the luck/unluck that the main developer of such piece of art came in the office and I've almost throw him out the window (we are at 26th floor).
FUCK OFF DUDE. YOU AND ALL THE OTHERS THAT DO LIKE YOU DO.
P.S. in this days I'll try to write the full story, but it's hard without giving many details...small anticipation: 1.5 months of work and nothing but red bull and coffee...4 -
Some compilers give an error message on forgotten type casting. From that it shows good typing style casting. So you also avoid clerical errors that can lead to the program crash in the worst case. With some types it is also necessary to perform type casting comma on others Types, however, do this automatically for the compiler.
In short:Type casting is used to prevent mistakes.
An example of such an error would be:
#include <stdio.h>
#include <stdlib.h>
int main ()
{
int * ptr = malloc (10*sizeof (int))+1;
free(ptr-1);
return 0;
}
By default, one tries to access the second element of the requested memory. However, this is not possible, since pointer calculation (+,-) does not work for a void pointer.
The improved example would be:
int * ptr = ((int *) malloc (10*sizeof (int)))+1;
Here, typecasting is done beforehand and this turns the void pointer into its int pointer and pointer calculation can be applied. Note: If instead of error "no output" is displayed on the sololearn C compiler try another compiler.
1 -
Top 12 C# Programming Tips & Tricks
Programming can be described as the process which leads a computing problem from its original formulation, to an executable computer program. This process involves activities such as developing understanding, analysis, generating algorithms, verification of essentials of algorithms - including their accuracy and resources utilization - and coding of algorithms in the proposed programming language. The source code can be written in one or more programming languages. The purpose of programming is to find a series of instructions that can automate solving of specific problems, or performing a particular task. Programming needs competence in various subjects including formal logic, understanding the application, and specialized algorithms.
1. Write Unit Test for Non-Public Methods
Many developers do not write unit test methods for non-public assemblies. This is because they are invisible to the test project. C# enables one to enhance visibility between the assembly internals and other assemblies. The trick is to include //Make the internals visible to the test assembly [assembly: InternalsVisibleTo("MyTestAssembly")] in the AssemblyInfo.cs file.
2. Tuples
Many developers build a POCO class in order to return multiple values from a method. Tuples are initiated in .NET Framework 4.0.
3. Do not bother with Temporary Collections, Use Yield instead
A temporary list that holds salvaged and returned items may be created when developers want to pick items from a collection.
In order to prevent the temporary collection from being used, developers can use yield. Yield gives out results according to the result set enumeration.
Developers also have the option of using LINQ.
4. Making a retirement announcement
Developers who own re-distributable components and probably want to detract a method in the near future, can embellish it with the outdated feature to connect it with the clients
[Obsolete("This method will be deprecated soon. You could use XYZ alternatively.")]
Upon compilation, a client gets a warning upon with the message. To fail a client build that is using the detracted method, pass the additional Boolean parameter as True.
[Obsolete("This method is deprecated. You could use XYZ alternatively.", true)]
5. Deferred Execution While Writing LINQ Queries
When a LINQ query is written in .NET, it can only perform the query when the LINQ result is approached. The occurrence of LINQ is known as deferred execution. Developers should understand that in every result set approach, the query gets executed over and over. In order to prevent a repetition of the execution, change the LINQ result to List after execution. Below is an example
public void MyComponentLegacyMethod(List<int> masterCollection)
6. Explicit keyword conversions for business entities
Utilize the explicit keyword to describe the alteration of one business entity to another. The alteration method is conjured once the alteration is applied in code
7. Absorbing the Exact Stack Trace
In the catch block of a C# program, if an exception is thrown as shown below and probably a fault has occurred in the method ConnectDatabase, the thrown exception stack trace only indicates the fault has happened in the method RunDataOperation
8. Enum Flags Attribute
Using flags attribute to decorate the enum in C# enables it as bit fields. This enables developers to collect the enum values. One can use the following C# code.
he output for this code will be “BlackMamba, CottonMouth, Wiper”. When the flags attribute is removed, the output will remain 14.
9. Implementing the Base Type for a Generic Type
When developers want to enforce the generic type provided in a generic class such that it will be able to inherit from a particular interface
10. Using Property as IEnumerable doesn’t make it Read-only
When an IEnumerable property gets exposed in a created class
This code modifies the list and gives it a new name. In order to avoid this, add AsReadOnly as opposed to AsEnumerable.
11. Data Type Conversion
More often than not, developers have to alter data types for different reasons. For example, converting a set value decimal variable to an int or Integer
Source: https://freelancer.com/community/...2 -
Need to work on GitHub CI action that wraps a terraform deploy (previous teams deploy setup that they would run from inside a docker compose setup locally). Working directly on main and get moaned at (definitely consider the moan reasonable) when it was originally being duct taped together. It's scrappy and doesn't have all the repo rules that other repos have set up, but it's stable, and I need to move onto “actual” requirements.
Several months later, I'm still the only “active” maintainer (it's been stable since then and hasn't needed any changes).
Have to do a hotfix experiment after adding support for a new bucket, put the changes in a PR and merge (since it has to be on main, and I'm the only one who maintains it, and if it's truly deploy change related that is the only thing that changed)
Come back to the PRs at the end of the day after discovering it's just a change to django storage, and it turns out a colleague who is tangentially related to the project dropped a comment. He's complaining about the lack of a description, the lack of a ticket and “skipping” the review process.
I, too, would have liked all that, but the damn code needs to be merged so I can check that it was that MFer. Sorry, I expected you to be able to deal with a “vague” 10 contiguous lines of iam config values, ignore the immediately following PR that reverts this revert and the preceding one adds a bucket. Sorry, that the title saying that this is a revert isn't enough of a description for you. Sorry that the other dev that told me about it didn't create a ticket. Sorry that I didn't immediately do overtime to update all the PRs and magically conjure up someone who is available to review them. But hey now that's evening and I have time to get back to going through the PRs again I can see your indignant comment which I wasn't notified about since the PR is fucking closed.
Now that I have had time to go through and see your comment, message you to let you know that commenting on a closed PR is screaming into the void and updated the PRs I can get back to what I was supposed to do today. Which is dealing with streaming data into S3. Hope you had a good day in your Clojure tower with your hired PR person (yes a person to review his PRs).
Not having to deal with your comment would have saved me an hour+.
Getting real tired of the “act like product” when it comes to fixing bugs/any polishing that isn't exploding in prod and even then. Sometimes I really wish I could refuse people from messaging me to fix an issue and can only communicate by tickets 🙄 to avoid these problems. They've been told to create a ticket and assign it to me when there is an issue, and even then, I tend to fix the issue before they get to it. I can't wait until next friday…
Anyway /rant keep up the good work in keeping quality up :D2 -
Signify Solar Services: Affordable Solar Panel Cleaning for Homes
At Signify Solar Services, we understand the importance of maintaining your solar panels to ensure they are running at their highest efficiency. Whether you're noticing that your solar panels are not producing enough power, wondering should I clean my solar panels at home, or simply seeking affordable solar panel cleaning for homes, our team is here to help. We proudly serve homeowners in Canoga Park, Woodland Hills, Simi Valley, and surrounding areas with top-quality cleaning services designed to restore and maintain your solar system's performance.
Why Solar Panel Cleaning is Essential for Homeowners
Solar panels are a significant investment for homeowners looking to save on energy bills and reduce their environmental impact. However, over time, solar panels can accumulate dirt, dust, bird droppings, and other debris. This can block sunlight, reducing the panels' ability to generate power. If you're experiencing solar panels not producing enough power, cleaning may be the solution.
At Signify Solar Services, we offer affordable solar panel cleaning for homes, ensuring your panels are free from any obstacles that could be hindering their performance. Regular cleaning helps increase the efficiency of your solar system, ensuring it continues to operate at its best for years to come.
Should I Clean My Solar Panels at Home?
You might be asking, "Should I clean my solar panels at home?" While it's possible to clean your solar panels yourself, there are several factors to consider before attempting it. Cleaning solar panels requires careful attention to avoid causing damage, especially when working with rooftops or delicate equipment. Improper cleaning methods can lead to scratches, cracks, or even void warranties.
That’s where Signify Solar Services comes in. We are trained professionals who understand the best techniques and products to use to clean your panels safely and effectively. Our team ensures that your solar panels are cleaned without any risk of damage, preserving their efficiency and lifespan.
How to Clean Home Solar Panels
If you're wondering how to clean home solar panels, it's essential to know the proper steps and tools to use. While there are DIY methods, it is important to approach solar panel cleaning with care. Here’s a general overview of the process:
Use Soft, Non-Abrasive Materials: To avoid scratching the panels, use soft brushes or cloths designed specifically for cleaning solar panels.
Avoid Harsh Chemicals: Harsh chemicals can damage the panels. It's best to use a mild detergent mixed with water for cleaning.
Use a Hose, Not a Pressure Washer: Pressure washers can damage the panels, so it’s safer to use a regular hose with moderate water pressure.
Clean During Cooler Hours: Avoid cleaning solar panels in direct sunlight as the heat can cause the water to evaporate too quickly, leaving streaks or residue behind.
Ensure Safety: Solar panels are often installed on rooftops, which can be dangerous to access. If you're unsure about how to clean your panels safely, it’s always best to hire a professional.
While these steps can help you clean your panels, it's always recommended to hire a professional service, especially if your panels are on a roof or if you’re unsure about how to clean them properly.
Local Solar Panel Cleaning for Houses
If you're looking for local solar panel cleaning for houses, Signify Solar Services is here to serve you. We specialize in solar panel cleaning for homeowners in Canoga Park, Woodland Hills, Simi Valley, and the surrounding areas. Our local team is experienced and equipped to handle all types of solar systems, ensuring your panels are cleaned efficiently and safely.
We understand the unique needs of local homeowners and provide personalized services to ensure your solar system is functioning at its best. Our goal is to make sure you’re getting the most out of your solar investment by improving efficiency and extending the life of your panels.
Why Choose Signify Solar Services for Your Solar Panel Cleaning?
1. Affordable Pricing
We offer affordable solar panel cleaning for homes, ensuring that homeowners can keep their solar systems in top condition without breaking the bank. Our services are priced competitively, and we offer free quotes to help you plan your budget.
2. Professional, Safe Cleaning
Our team of experts is trained to clean solar panels safely and effectively. We use specialized equipment and eco-friendly cleaning solutions to ensure your panels are cleaned without any risk of damage. Our technicians follow best practices to ensure maximum efficiency and care.2
