Details
-
AboutProgrammer since forever
-
SkillsEverything and nothing
-
Github
Joined devRant on 6/18/2016
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
-
Programming when sad...
My dad is acutely ill, and trying to focus on code is so hard! This has happened before, and makes me realize that our normal day job is really taxing mentally...2 -
I came back here, after not logging in for about a year just to say that patents are fucking stupid. Thanks, see you in another year!5
-
package main
import (
"log"
"strings"
)
type Present struct {
from string
to string
}
type Santa struct {
presents []Present
}
type Person struct {
Name string
Nice bool
Presents []Present
}
func (santa *Santa) givePresents(person Person) []Present {
result := []Present{}
if person.Nice != true {
return result
}
for _, present := range santa.presents {
if strings.Compare(present.to, person.Name) == 0 {
result = append(result, present)
}
}
return result
}
func main() {
santa := Santa{
[]Present{
{"devRant", "Alex"},
{"Johanna", "Alex"},
{"Alex", "devRant"},
{"Alex", "Johanna"},
},
}
persons := []Person{
{"Alex", true, []Present{}},
{"Johanna", true, []Present{}},
{"devRant", false, []Present{}},
}
for idx, person := range persons {
persons[idx].Presents = santa.givePresents(person)
}
log.Println(persons)
}2 -
Exceptions... Are they good for anything? I haven't seen them add value to code once in my career...
-
I know people like to rant about Apple removing ports, but it was a great day for a great cable standard yesterday!1
-
Just turned myself inside out why parsing data from serial didn't work. A full day, and 20 minutes before going home I realize the uart interrupt function was too slow. I just didn't get all chars...
-
Playing around with GW-BASIC on an old 286 when I was maybe 8 I knew that I would spend my life programming. It was magic. It's less magic now, but I know I will not run out of challenges in my life or career, and that's pretty good too :)
-
Coding is like the minds virus for me. I can't stop, but I sometimes question if it's good for me. Work is ok nowadays, but keeping a balance in hobbies is so hard. When I discover something new that's fun it can eat me up for days. But that excitement can leave just as quickly with very few projects ever finished as a result.2
-
Had to code review a line of java with this code a while back: ServiceService.isProductProduct. Funny thing is that even though it's obviously stupid, it was in accordance with the coding standard and I couldn't really object to it (._.)