Comments are code that the parser and compiler can't verify for you, and therefore should be regarded with suspicion
Now that I am playing Persona 3, I read that comment in Mitsuru's voice...
Regarding code comments, the locality of reference makes a huge difference. Always really frustrating to find a small book of documentation 10 classes above where you needed an explanation.
Monkey Ball WarriorA collection of mediocre hatsSeattle, WARegistered Userregular
edited August 2019
There's three categories of comment.
There's that stuff that is required because it is API documentation (thing Javadoc, Godoc, python docstrings, etc).
Then there is what should be there because the code is confusing or otherwise warrants elaboration (ex. regex, intentional switch case fallthroughs, etc). Knowing when and where to write these is the trick to good commenting.
Then finally there's comments that are there because people were brainwashed in college to think that any code that isn't completely saturated with comments is inherently bad. These folks tend to ignore important concerns, like how code and comments, even if great to start with, can quickly diverge if not carefully maintained. Comments that lie are far worse than no comment at all.
Monkey Ball Warrior on
"I resent the entire notion of a body as an ante and then raise you a generalized dissatisfaction with physicality itself" -- Tycho
If you have to explain your code with comments, fix your code. If you have to add a comment so I can read your switch statement, just fucking stop being cute and rewrite it.
If you are leaving a breadcrumb about WEIRD BUSINESS RULES JUST GO WITH IT, please comment! Those are the only ones that have been valuable and saved our asses.
Ugh, I am SO CLOSE. I have ONE more thing to get working and I'm set. But it's kicking my ass. This is much harder than it should be.
...or I'm MAKING it way harder =p.
I have a string of values from a datarow in my DB that I need to use to repopulate a listbox when it loads.
Right now I have: Dim s As String = (survinfo.Rows(0)("condition"))
Which works great if they have only selected one item but any more and the listbox shows nothing selected, even though the variable is still holding all of the values.
I'm trying to figure out how to say "select all the things" instead of the Rows(0).I
I did a few things like this to try and split it up: Dim condList = Split(survinfo.Rows(0)("condition"), ",")
or Dim condList As String() = s.Split(New Char() {","c})
And then I tried a ton of combinations to try and say "for each item in the loop, add that value to the listbox" ...which is I THINK is done like so: ddCondition.Items.Add.
I've googled so much for this that every link when I try to google it in a new way is showing I've already visited it =p.
This is my latest attempt that I was SO SURE was going to work: Dim s As String = (survinfo.Rows(0)("condition"))
Dim condList As String() = s.Split(New Char() {","c})
Dim word As String
For Each word In condList
ddCondition.Items.Add(word)
Next
Any suggestions?
I really wish the listbox was smart enough that the variable having a value of "1,2,3" means to select value 1, 2, and 3 without having to do this voodoo.\
EDIT - Oh crap, I realized I'm closer than I thought. I just saw that my listbox literally adds the value numbers at the end of the list now.
So THAT is what the Items.Add does. Maybe I just need to figure out how to say "select those values" instead of .Add. Not quite sure what that is since the available ones seem to only do singular:
Monkey Ball WarriorA collection of mediocre hatsSeattle, WARegistered Userregular
Not wrong. However, that thing about switch fallthroughs is more of a workaround for languages with the bad switch design where fallthrough is the default. Go, correctly, makes break the default, and you have to specifically fallthrough, in the rare cases where that is what you actually want to do.
"I resent the entire notion of a body as an ante and then raise you a generalized dissatisfaction with physicality itself" -- Tycho
+1
thatassemblyguyJanitor of Technical Debt.Registered Userregular
The real danger is when the code changes but the comments don't so the comments are wrong
This means the team has people that do not, and/or a culture that allows them to not, fully participate in the code-review process.
To be honest, this same argument applies to 'self describing' code - The real danger, and it is more dangerous than comment rot, is that someone decides that variable_for_purpose_x can be leveraged forward to mean both purpose_x and newly added purpose_y, but the variable stays the same name leading to code that now no longer documents itself (happens a lot in the embedded space, or during bug fixes where there is a desire to make minimal changes to avoid triggering more-than-necessary lengthy retests).
Code reviews y'all, participate!
Personally, having been burned (and I am currently en fuego grande) by other's code that is inadequately, or not at all, commented under the guise of 'self documenting code', I'm a Comment Advocate. There's a reason why it is taught as best practice during training/schooling.
Document/Comment intent even if you think it should be clear by the structuring of the code. Very often there is a massive gulf between should and is.
Different industries will have different needs for commenting, but across the board a lot of the arguments against comments can be boiled down to simply, "I don't want to explain my code, you figure it out."
Which is often a really bad tactic for everyone.
Every time someone comes back to a piece of code that (at the time) everyone thought was very clear with variables and everything and thinks, "Oh snap, who wrote this? It's really difficult to.. ooh, it was me, I wrote that. Whelp time to figure out what I was thinking, and do a refactor."
Those poor sustaining/field/customer engineers that have to pick-up and maintain the code for the life-cycle of the product? No comments is equivalent of saying to them, "Fuck you. Got mine." However, it often comes back to bite the development engineer in the ass because they get called in on the escalation when the field/sustaining team can't figure out the code in order to fix the bug.
http://antirez.com/news/124 is, in my opinion, the definitive summary of types of comments and why you would or would not write each type.
0
Ear3nd1lEärendil the Mariner, father of ElrondRegistered Userregular
@thatassemblyguy Agreed. There are times I have to go back and look at some of my old code. Fortunately, I've documented it well enough that I can figure out why I did what I did, even if it is a language I haven't used in many years. I may not remember exactly what the code does, but I've usually got a pretty good handle on why it does what it does.
+1
Ear3nd1lEärendil the Mariner, father of ElrondRegistered Userregular
Ugh, I am SO CLOSE. I have ONE more thing to get working and I'm set. But it's kicking my ass. This is much harder than it should be.
...or I'm MAKING it way harder =p.
I have a string of values from a datarow in my DB that I need to use to repopulate a listbox when it loads.
Right now I have: Dim s As String = (survinfo.Rows(0)("condition"))
Which works great if they have only selected one item but any more and the listbox shows nothing selected, even though the variable is still holding all of the values.
I'm trying to figure out how to say "select all the things" instead of the Rows(0).I
I did a few things like this to try and split it up: Dim condList = Split(survinfo.Rows(0)("condition"), ",")
or Dim condList As String() = s.Split(New Char() {","c})
And then I tried a ton of combinations to try and say "for each item in the loop, add that value to the listbox" ...which is I THINK is done like so: ddCondition.Items.Add.
I've googled so much for this that every link when I try to google it in a new way is showing I've already visited it =p.
This is my latest attempt that I was SO SURE was going to work: Dim s As String = (survinfo.Rows(0)("condition"))
Dim condList As String() = s.Split(New Char() {","c})
Dim word As String
For Each word In condList
ddCondition.Items.Add(word)
Next
Any suggestions?
I really wish the listbox was smart enough that the variable having a value of "1,2,3" means to select value 1, 2, and 3 without having to do this voodoo.\
EDIT - Oh crap, I realized I'm closer than I thought. I just saw that my listbox literally adds the value numbers at the end of the list now.
So THAT is what the Items.Add does. Maybe I just need to figure out how to say "select those values" instead of .Add. Not quite sure what that is since the available ones seem to only do singular:
But I feel like I'm close!
I'm not ignoring you, I just haven't had a chance to sit and analyze this to the point where I might be able to offer advice. I'll get back with you as soon as I have a free moment.
On the subject of code reviews and coding style, I'm going to give some feedback to a junior dev about this stuff. I saw a bunch of code where it went
if blah {
doStuff()
return
} else if blerp {
otherStuff()
return
} else {
finalStuff()
}
The else statements are redundant there, and of course it was more code than that, so it ended up really dense and hard to follow. Getting rid of the else gives us more distinct blocks of logic and is generally way easier to follow, and gets rid of the indentation of the final logic. I'm always a fan of avoiding indenting deeper than required.
if blah {
doStuff()
return
}
if blerp {
otherStuff()
return
}
finalStuff()
+3
thatassemblyguyJanitor of Technical Debt.Registered Userregular
On the subject of code reviews and coding style, I'm going to give some feedback to a junior dev about this stuff. I saw a bunch of code where it went
if blah {
doStuff()
return
} else if blerp {
otherStuff()
return
} else {
finalStuff()
}
The else statements are redundant there, and of course it was more code than that, so it ended up really dense and hard to follow. Getting rid of the else gives us more distinct blocks of logic and is generally way easier to follow, and gets rid of the indentation of the final logic. I'm always a fan of avoiding indenting deeper than required.
if blah {
doStuff()
return
}
if blerp {
otherStuff()
return
}
finalStuff()
Browser doesn't have a 'set tab length', and the indent was bothering me... <.< >.>
On the subject of code reviews and coding style, I'm going to give some feedback to a junior dev about this stuff. I saw a bunch of code where it went
if blah {
doStuff()
return
} else if blerp {
otherStuff()
return
} else {
finalStuff()
}
The else statements are redundant there, and of course it was more code than that, so it ended up really dense and hard to follow. Getting rid of the else gives us more distinct blocks of logic and is generally way easier to follow, and gets rid of the indentation of the final logic. I'm always a fan of avoiding indenting deeper than required.
if blah {
doStuff()
return
}
if blerp {
otherStuff()
return
}
finalStuff()
Note, not a dev (most of the time): the elifs aren't necessarily bad if you want to make it clear these are mutually exclusive conditions. If it wasn't commented, you could interpret this as "oh, when these conditions happen, fire off this function, regardless of other things".
I've seen this mess with too many SQL and data things not to comment, as you need to make mutual exclusivity very clear when it happens.
I'm assuming the actual example is different than what he showed, because, well, it's really not improving the code(in specific context, it would be making it worse).
The initial il/elif flows towards a single exit point for the fn. The "refactored" version doesn't. I would personally rarely use multiple exit points outside of handling errors/unexpected flow.
Yeah, the actual code returns on handling errors, because Go.
+1
thatassemblyguyJanitor of Technical Debt.Registered Userregular
As Echo points out, the "if(error) { return } ... if (error) {return}" pattern is extremely common in embedded space.
Ever since Dijkstra went HAM on GOTO statements, and because C doesn't have an exception-like option, the "if (error) { return }" pattern is pretty much the best way of keeping a function from being a series of 8-deep nested if's.
Without GOTOs, however, you lose some efficiency and code space because the only other way to do a "catch" (instead of just a blind return, one might want to clean-up) is to inline a function, or call a function for the clean-up.
Wee, releasing brand new stuff we've never really done before! We're definitely finding out which parts of our infra is creaking at the seams. Need to take a pass and optimize a bunch of API calls.
On that note, anyone have a hot take on websockets vs grpc?
0
Ear3nd1lEärendil the Mariner, father of ElrondRegistered Userregular
@vamen I want to be sure I am understanding your issue clearly. You have a listbox with a bunch of items in it, right? And you want to select multiple items based on a value from the database?
If so, something like this might be what you need. Keep in mind that I ran this through a C# => VB.NET translator...
Dim selectedItems As String() = {"itemCode1", "itemCode4", "ItemCode12"} // This is the selected items list that you are pulling from your database.
For Each item As ListItem In Listbox1.Items
If selectedItems.Contains(item.Value) Then
item.Selected = True
End If
Next
Man, I was SO close, but somehow I never ran across "contains" and that was what I really needed.
You're correct in understanding what I needed (and probably badly explained). I used your code and it selected EVERYTHING, which is the opposite of selecting nothing...so I met in the middle and got it FINALLY working (thaaaaank you) with this:
Dim selectedItems As String() = Split(survinfo.Rows(0)("condition"), ",")
For Each item As ListItem In ddCondition.Items
If selectedItems.Contains(item.Value) Then
item.Selected = True
End If
Next
I have no idea how ideal all my code (or how I set up my data tables) is for all of this... probably all sorts of a disaster, but man am I glad to finally get this last piece working.
Very humbling to look at how little code it took to accomplish my goal compared to how LONG it took me to get it working =p.
Man, I was SO close, but somehow I never ran across "contains" and that was what I really needed.
You're correct in understanding what I needed (and probably badly explained). I used your code and it selected EVERYTHING, which is the opposite of selecting nothing...so I met in the middle and got it FINALLY working (thaaaaank you) with this:
Dim selectedItems As String() = Split(survinfo.Rows(0)("condition"), ",")
For Each item As ListItem In ddCondition.Items
If selectedItems.Contains(item.Value) Then
item.Selected = True
End If
Next
I have no idea how ideal all my code (or how I set up my data tables) is for all of this... probably all sorts of a disaster, but man am I glad to finally get this last piece working.
Very humbling to look at how little code it took to accomplish my goal compared to how LONG it took me to get it working =p.
Sometimes the best things are stupidly simple. That's precisely why saying "I wrote x lines of code more than you did!" is a terrible metric when evaluating the skill level of a developer.
For example, several years ago I was working on an Angular project and having trouble getting different components to talk to each other. I had been using Angular events to bubble up to the parent component and pass the updates down to the other children, but it was clunky and made the components too tightly coupled together. So one night I decided to write something similar to a message bus. Different components could listen to a central queue for messages directed to them and process the attached data. So if I wanted to send a message from a component to update a shopping cart, it was a piece of cake.
Wee, releasing brand new stuff we've never really done before! We're definitely finding out which parts of our infra is creaking at the seams. Need to take a pass and optimize a bunch of API calls.
On that note, anyone have a hot take on websockets vs grpc?
Machines are going to fail, then the system is going to fail, then it's about who has the will to survive...
Wee, releasing brand new stuff we've never really done before! We're definitely finding out which parts of our infra is creaking at the seams. Need to take a pass and optimize a bunch of API calls.
On that note, anyone have a hot take on websockets vs grpc?
Do you love protocol buffers?
Do you need complex RPC semantics? (Parallel requests, many messages per request)
If the answer to both is yes then grpc is fine
Naah, those two things don't have a comparable use case.
The use case for websockets is very limited, only in terms of very concrete need of sessions and push semantics. Using websockets (usually) has absolutely no implication on ops and one just needs to be careful with the long term connection per session tradeoff.
GRPC is just a regular RPC framework on top of protobuffs. There are very clear tradeoffs and advantages in moving to a binary format vs cleartext serialization for team productivity. Make no mistake, GRPC requires a significant amount of additional tooling in dev and ops both(depending on how mature your team is, this could be from "almost none" to "lol, we can't do that"). I've phased GRPC in and I've also phased GRPC out of production. In general I've found that:
- It's a lot easier to *start* with GRPC than migrate to GRPC.
- If you want json/grpc to live side by side even with jsonproxy etc, it will be a pain.
Personally, I'm not using GRPC in small teams and/or new domains again and I'd say that GRPC requires complete buy-in for successful rollout.
Ear3nd1lEärendil the Mariner, father of ElrondRegistered Userregular
Have I mentioned how much I hate TFS??? I created a new branch to work on the next app feature. I modified one file and there were a bunch of changes in this new branch that I didn't make. So I decided that I would check them in and start a new branch from the Trunk branch. But instead of checking them into the new branch (which I had open), it checked it into the Trunk branch.
0
gavindelThe reason all your softwareis brokenRegistered Userregular
Microsoft bought Git. If that's not a rousing endorsement of TFS, I don't know what is. :bzz:
I've been searching google for a while and maybe I'm just not expressing properly what I need because I'm running in circles and pulling my hair.
This is for Python.
I'm trying to create a time series but everything I find is showing me how to manipulate a time series and create nice tables and graphs using the pandas module. Plenty of info for that I can figure it out once I reach that point.
But I don't have the time series that contains ranges of time with a count for each range. what I have is the raw data that looks something like this:
and I want to make this a time series where I can have the count and 'good requests/ total requests' based on the return code of each entry, in a given timeframe and interval.
Every tutorial I see already starts with data that is already a timestamp + some kind of count in the interval.
Please anyone point me in the right direction to start. I feel dumb.
EDIT: OK I figured it out I think...
I just had to create a function that would evaluate the status_code and return 1 if it's a good code. Then I just created a column using this function after which I can df.resample().sum() to have it how I want.
so I've been troubleshooting this issue with this repo for fucking ever and it just came to a head not too long ago when I had to do some major updates and I couldn't see my diffs and it was bothering me
but
if you've got an older repository and work with C# and .NET like I do, at some point git/github added csharp as a special diff option, and it broke diffs. So if you don't see any diff in your git client, give a quick look at your gitattributes file and change
*.cs diff=astextplain
to
*.cs diff=csharp
And suddenly your diffs/history will start working again
bowen on
not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
0
OrcaAlso known as EspressosaurusWrexRegistered Userregular
Lol git
+1
Ear3nd1lEärendil the Mariner, father of ElrondRegistered Userregular
so I've been troubleshooting this issue with this repo for fucking ever and it just came to a head not too long ago when I had to do some major updates and I couldn't see my diffs and it was bothering me
but
if you've got an older repository and work with C# and .NET like I do, at some point git/github added csharp as a special diff option, and it broke diffs. So if you don't see any diff in your git client, give a quick look at your gitattributes file and change
*.cs diff=astextplain
to
*.cs diff=csharp
And suddenly your diffs/history will start working again
Or your client hates you. The core API of the project I'm working on is so antiquated it's not funny. I'm pretty sure it's what the British used to manage their logistics during the War of 1812.
I think I isolated a bug to a third-party package that has an error-handling function that can in theory receive a nil error, causing a panic. I added some debug logging to verify this, and now the damn thing just refuses to happen.
Posts
Now that I am playing Persona 3, I read that comment in Mitsuru's voice...
Regarding code comments, the locality of reference makes a huge difference. Always really frustrating to find a small book of documentation 10 classes above where you needed an explanation.
There's that stuff that is required because it is API documentation (thing Javadoc, Godoc, python docstrings, etc).
Then there is what should be there because the code is confusing or otherwise warrants elaboration (ex. regex, intentional switch case fallthroughs, etc). Knowing when and where to write these is the trick to good commenting.
Then finally there's comments that are there because people were brainwashed in college to think that any code that isn't completely saturated with comments is inherently bad. These folks tend to ignore important concerns, like how code and comments, even if great to start with, can quickly diverge if not carefully maintained. Comments that lie are far worse than no comment at all.
If you are leaving a breadcrumb about WEIRD BUSINESS RULES JUST GO WITH IT, please comment! Those are the only ones that have been valuable and saved our asses.
...or I'm MAKING it way harder =p.
I have a string of values from a datarow in my DB that I need to use to repopulate a listbox when it loads.
Right now I have:
Dim s As String = (survinfo.Rows(0)("condition"))
Which works great if they have only selected one item but any more and the listbox shows nothing selected, even though the variable is still holding all of the values.
I'm trying to figure out how to say "select all the things" instead of the Rows(0).I
I did a few things like this to try and split it up:
Dim condList = Split(survinfo.Rows(0)("condition"), ",")
or
Dim condList As String() = s.Split(New Char() {","c})
And then I tried a ton of combinations to try and say "for each item in the loop, add that value to the listbox" ...which is I THINK is done like so: ddCondition.Items.Add.
I've googled so much for this that every link when I try to google it in a new way is showing I've already visited it =p.
This is my latest attempt that I was SO SURE was going to work:
Dim s As String = (survinfo.Rows(0)("condition"))
Dim condList As String() = s.Split(New Char() {","c})
Dim word As String
For Each word In condList
ddCondition.Items.Add(word)
Next
Any suggestions?
I really wish the listbox was smart enough that the variable having a value of "1,2,3" means to select value 1, 2, and 3 without having to do this voodoo.\
EDIT - Oh crap, I realized I'm closer than I thought. I just saw that my listbox literally adds the value numbers at the end of the list now.
So THAT is what the Items.Add does. Maybe I just need to figure out how to say "select those values" instead of .Add. Not quite sure what that is since the available ones seem to only do singular:
But I feel like I'm close!
This means the team has people that do not, and/or a culture that allows them to not, fully participate in the code-review process.
To be honest, this same argument applies to 'self describing' code - The real danger, and it is more dangerous than comment rot, is that someone decides that variable_for_purpose_x can be leveraged forward to mean both purpose_x and newly added purpose_y, but the variable stays the same name leading to code that now no longer documents itself (happens a lot in the embedded space, or during bug fixes where there is a desire to make minimal changes to avoid triggering more-than-necessary lengthy retests).
Code reviews y'all, participate!
Personally, having been burned (and I am currently en fuego grande) by other's code that is inadequately, or not at all, commented under the guise of 'self documenting code', I'm a Comment Advocate. There's a reason why it is taught as best practice during training/schooling.
Document/Comment intent even if you think it should be clear by the structuring of the code. Very often there is a massive gulf between should and is.
Different industries will have different needs for commenting, but across the board a lot of the arguments against comments can be boiled down to simply, "I don't want to explain my code, you figure it out."
Which is often a really bad tactic for everyone.
Every time someone comes back to a piece of code that (at the time) everyone thought was very clear with variables and everything and thinks, "Oh snap, who wrote this? It's really difficult to.. ooh, it was me, I wrote that. Whelp time to figure out what I was thinking, and do a refactor."
Those poor sustaining/field/customer engineers that have to pick-up and maintain the code for the life-cycle of the product? No comments is equivalent of saying to them, "Fuck you. Got mine." However, it often comes back to bite the development engineer in the ass because they get called in on the escalation when the field/sustaining team can't figure out the code in order to fix the bug.
I'm not ignoring you, I just haven't had a chance to sit and analyze this to the point where I might be able to offer advice. I'll get back with you as soon as I have a free moment.
The else statements are redundant there, and of course it was more code than that, so it ended up really dense and hard to follow. Getting rid of the else gives us more distinct blocks of logic and is generally way easier to follow, and gets rid of the indentation of the final logic. I'm always a fan of avoiding indenting deeper than required.
Browser doesn't have a 'set tab length', and the indent was bothering me... <.< >.>
Note, not a dev (most of the time): the elifs aren't necessarily bad if you want to make it clear these are mutually exclusive conditions. If it wasn't commented, you could interpret this as "oh, when these conditions happen, fire off this function, regardless of other things".
I've seen this mess with too many SQL and data things not to comment, as you need to make mutual exclusivity very clear when it happens.
The initial il/elif flows towards a single exit point for the fn. The "refactored" version doesn't. I would personally rarely use multiple exit points outside of handling errors/unexpected flow.
Ever since Dijkstra went HAM on GOTO statements, and because C doesn't have an exception-like option, the "if (error) { return }" pattern is pretty much the best way of keeping a function from being a series of 8-deep nested if's.
Without GOTOs, however, you lose some efficiency and code space because the only other way to do a "catch" (instead of just a blind return, one might want to clean-up) is to inline a function, or call a function for the clean-up.
alas
On that note, anyone have a hot take on websockets vs grpc?
If so, something like this might be what you need. Keep in mind that I ran this through a C# => VB.NET translator...
My hero!
Man, I was SO close, but somehow I never ran across "contains" and that was what I really needed.
You're correct in understanding what I needed (and probably badly explained). I used your code and it selected EVERYTHING, which is the opposite of selecting nothing...so I met in the middle and got it FINALLY working (thaaaaank you) with this:
I have no idea how ideal all my code (or how I set up my data tables) is for all of this... probably all sorts of a disaster, but man am I glad to finally get this last piece working.
Very humbling to look at how little code it took to accomplish my goal compared to how LONG it took me to get it working =p.
Sometimes the best things are stupidly simple. That's precisely why saying "I wrote x lines of code more than you did!" is a terrible metric when evaluating the skill level of a developer.
For example, several years ago I was working on an Angular project and having trouble getting different components to talk to each other. I had been using Angular events to bubble up to the parent component and pass the updates down to the other children, but it was clunky and made the components too tightly coupled together. So one night I decided to write something similar to a message bus. Different components could listen to a central queue for messages directed to them and process the attached data. So if I wanted to send a message from a component to update a shopping cart, it was a piece of cake.
The best thing about it? It was 17 lines of code.
My code started out as around 30 or 40 lines so I'm glad I got it down to such a small amount =p.
Machines are going to fail, then the system is going to fail, then it's about who has the will to survive...
Do you love protocol buffers?
Do you need complex RPC semantics? (Parallel requests, many messages per request)
If the answer to both is yes then grpc is fine
The use case for websockets is very limited, only in terms of very concrete need of sessions and push semantics. Using websockets (usually) has absolutely no implication on ops and one just needs to be careful with the long term connection per session tradeoff.
GRPC is just a regular RPC framework on top of protobuffs. There are very clear tradeoffs and advantages in moving to a binary format vs cleartext serialization for team productivity. Make no mistake, GRPC requires a significant amount of additional tooling in dev and ops both(depending on how mature your team is, this could be from "almost none" to "lol, we can't do that"). I've phased GRPC in and I've also phased GRPC out of production. In general I've found that:
- It's a lot easier to *start* with GRPC than migrate to GRPC.
- If you want json/grpc to live side by side even with jsonproxy etc, it will be a pain.
Personally, I'm not using GRPC in small teams and/or new domains again and I'd say that GRPC requires complete buy-in for successful rollout.
PS: https://github.com/twitchtv/twirp carries some of the benefits of GRPC with reduced ops complexity.
They're actually the largest corporate user of GitHub.
This is for Python.
I'm trying to create a time series but everything I find is showing me how to manipulate a time series and create nice tables and graphs using the pandas module. Plenty of info for that I can figure it out once I reach that point.
But I don't have the time series that contains ranges of time with a count for each range. what I have is the raw data that looks something like this:
[('timestamp', 'data1', 'data2', '...', 'status_code'),]
and I want to make this a time series where I can have the count and 'good requests/ total requests' based on the return code of each entry, in a given timeframe and interval.
Every tutorial I see already starts with data that is already a timestamp + some kind of count in the interval.
Please anyone point me in the right direction to start. I feel dumb.
EDIT: OK I figured it out I think...
I just had to create a function that would evaluate the status_code and return 1 if it's a good code. Then I just created a column using this function after which I can df.resample().sum() to have it how I want.
Battle.net: Fireflash#1425
Steam Friend code: 45386507
but
if you've got an older repository and work with C# and .NET like I do, at some point git/github added csharp as a special diff option, and it broke diffs. So if you don't see any diff in your git client, give a quick look at your gitattributes file and change
to
And suddenly your diffs/history will start working again
That's a weird one.
Well, it's no TFS...
Or your client hates you. The core API of the project I'm working on is so antiquated it's not funny. I'm pretty sure it's what the British used to manage their logistics during the War of 1812.
I think I isolated a bug to a third-party package that has an error-handling function that can in theory receive a nil error, causing a panic. I added some debug logging to verify this, and now the damn thing just refuses to happen.