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 - "val"
-
Our CTO has been told, this morning by management, that our development department is "too quiet" and that it's spoiling "the atmosphere" of the office space.
So we've ordered mechanical keyboards.21 -
Four months ago changed a laptop failing hdd and give it back to customer. Today I got a 30 minutes call because the computer "is not like before the repair, it doesn't work well".
*Thinks* Well, s#*@, before the repair the hdd had more than 2000 damaged clusters, which prevented even the os to start
*Says* "Could you describe me the issue?"
....
...
[ basically he was saying that since he started using IE as a browser, he didn't have Google.com set as the first page and that he had to bing it]
...
"When did the 'issue' start, If I may ask?"
>"Two weeks ago. "
Two weeks ago.
Two f*""#ng weeks ago.
Set aside for the nature of the issue, you blame my four months ago repair for a two weeks ago issue?
"The computer was better before"?
THAT F###ING MACHINE WAS LIKE A BURNING HOUSE - I RESCUED DATA FOR 2 DAYS JUST BEFORE THE HDD STARTED TO CRANK AT EVERY SPIN - I REBUILT IT TO GIVE IT YOU BACK FULLY WORKING AFTER YOU USED AS A FOOTBALL, AND NOW YOU BLAME ME BECAUSE THE
BROWSER ISN'T SETTED AS YOU LIKE
No,seriously, is like I rebuilt a burned house from scrap and now the owner blames me because in the kitchen sink the hot water tap is on the right side instead of the left side.
Seriusly, wtf.6 -
"So what got you in to development and programming?"
Me: well. I needed something to new to help with my depression, stress and anger.
"Oh cool. Did it help?"
Me: yes... They're so much stronger now.4 -
Oh yeah. Hey guys. 2 things.
First off. Forgot to say. Officially got a job. Finally. So thank you for all the help/advice and patience with my depressive rants!!
I'm in a new chapter of my life now so thanks.
And secondly.
I FUCKING HATE MY JOB6 -
Website Intro: Hello! I'm here to tell you how my life changed since I learned to build websites and became independent blah blah blah
Me: Cool. One sec.
*scrolls down*
Footer: Proudly powered by WordPress. Get the theme here!
Me: Bruh... No.11 -
How Microsoft devs think about Linux 😁.
This was found inside the index.html of Visual Studio Code editor.9 -
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 -
iOS Programming:
something.openCamera()
DONE!
—-
Android Programming:
val jobProcessorHandler = FuckingBuilder.something().inject().whatTheFuck()
val cameraDecoderFuck = Camera(CodePackFuck.shit, jobProcessorHandler)
CRASH!22 -
Dev: "What if the user has more than 100 entries? How would that display?"
UX: "They won't ever have that many"
Dev: "But what if they do?"
UX: "They won't."
(spoiler: they do)3 -
Email from a company I applied To:
"Hi... We will be in touch by the 7th of November"
Me:... It's December already. Maybe I missed it.
Second email: "Sorry! Typo. It's meant to say 7th of November. Refer to this instead"
Me: ...
THIRD email: "So sorry. Or mailing system is failing so disregard all those emails and refer to this one. Thank you."
Me: ... WHERE THE FUCK IS THE DATE!??6 -
Upwork:
"Hey freelancer, sorry we can't let you join this website made for freelancers like you as there are too many freelancers like you on this site made for freelancers like you"3 -
this.onSleep = function() {
for(let i = 0; i < hair.length; i++) {
hair[i].orientation = Math.random();
}
Object.freeze(hair);
}
😐
Whoever thought it was a good idea to put this there, fuck you.15 -
Ok yeahhh it’s not me.
Just got told I didn’t pass an interview that lasted 15 minutes with him talking about the company and no questions for me.
My interviewers lately have just been unfortunate2 -
I'm currently rewriting perfectly clean and functioning Scala code in Java (because "Enterprise", yay). The amount of unnecessary boilerplate I have to add is insane. I'm not even talking big complicated code but two liners or the lack of simple things like a range from 5 to 10.
Why do I have to write
List<Position> occupiedPositions = placedEntities.stream()
.flatMap((pe) -> pe.occupiedPositions().stream())
.collect(Collectors.toList());
instead of simply
val occupiedPositions = placedEntities.flatMap(_.occupiedPositions)
Why on earth does `occupiedPositions.distinct` suddenly become a monstrosity like `occupiedPositions.stream().distinct().collect(Collectors.toList())` where the majority of code is pure boilerplate? And this is supposed to be the new and better Java8 api which people use as evidence that Java is now suddenly "functional" (yeah no, just no).
Why do APIs that annotate parameters with @Nullable throw NullPointerExceptions when I pass a null? Why does the compiler not help prevent such stupidity? Why do we use static typing PLUS those annotations and it still crashes at runtime like every damn dynamic, interpreted language out there? That's not unfortunate, it's a complete waste of time.
Why is a simple idea like a range from x to 10 (in scala literally `x to 10`) not by default included in Java? There's Guava's version of Range which does not have a helper for integer ranges (even though they are the most used ones). Then there's apache.commons version which _has_ a helper for integers, but is strangely not iterable (wtf I don't even...).
Speaking of Iterable: How difficult could it be to convert an abstract Iterable<T> into a concrete List<T>? In scala it's surprisingly `someIterable.toList`. I found nothing like that so I took to stackoverflow where I found a thread in which people suggested everything from writing your own ListUtils helper class, using Guava (which is a huge dependency!) to using the new Java8 features inline (which is still about three lines long). I didn't know this was such a hard problem in computer science, TIL.
How anyone can be productive in this abomination of a language is beyond me now, even though I've used it for many years while learning to code (back then I didn't know there were much better ways to do things). The only good part is that I have to endure this nonsense for only about 3 days longer then I'm free again!12 -
Ayy. Finally hit the 1000++ point. Now I can get the shirt that I literally have 5 of irl for my avatar2
-
Someone I work with transfered 7 credit card numbers including cvv and month/year using..... pastebin.
He was not signed in.3 -
Never had one due to this trick I borrowed from an old friend.
So we all know about those meetings where its all crap flying around right?.
First go in there with your alarm clock set on vibration every 7 minutes(trust me on this-makes you look important and you ought to be somewhere else)
Actually the alarm is a reminder that you need to bring yourself back online.
At this point just listen to the speaker for a couple of seconds(especially if its marketing dept) and being the engineer your are; rephrase parts of their presentation in a question-comment hybrid( at this point you're the wisest looking person in the room)
Now go back to thinking about that pizza slice you left in the fridge as they discuss the "lean production" methods that they can use based on "your opinion"..
To more happy meetings..cheers3 -
Another project with legacy code got just dusted off at work. Shits fucked beyond recognition! We got:
- Rando variable names that mean nothing
- Timers running with a cycle time of 2.5ms if you start them with the multiplier 1.
- An Interrupt routine thats 300 lines long.
- Another interrupt thats starting an ADC conversion and waiting for it to complete before returning.
- For loops that start with one and subtract one from the iterator in the loop
- Every value that would normally be expressed as a regular number is written down in Hex. Eg: if(val==0x05)
- State machine built without writing down which state is which. Its just a number. (In hex obviously!)
- All running on a Microcontroller you cant debug on.
- Using a compiler no one has ever heard of before.
- Weird ass Port manipulations
- 15 different .hex and .elf files with no clue whats in them.
- No version control
- We tried explaining the code to a monkey and it hanged itself.10 -
WHY AM I SO FUCKING AWKWARD OH MY LORD! LITERALLY ALL I HAD TO DO WAS WATCH A SCHOOL PLAY AND THEN GET A PICTURE WITH A CAST MEMBER AND IT WAS PROBABLY ONE OF THE FEELINGS I'VE HAD IN THE PAST WEEK! GOD FUCKING DAMMIT I AM SO DONE WITH THIS! I'M TIRED OF BEING SO AWKWARD AND ANXIOUS! I DON'T GET HOW PEOPLE CAN DO ANYTHING LIKE THAT WITHOUT FEELING UNCOMFORTABLE. THIS HAS LITERALLY RUINED MY FUCKING LIFE AND I'M SO TIRED OF IT. I KNOW PEOPLE LIKE ME BUT I JUST CAN'T GET MYSELF TO TALK TO ANYONE! THE SIMPLEST THINGS TAKE SO MUCH OUT OF ME AND I'M SICK OF IT! I'M JUST TIRED OF IT! I'm just, tired.8
-
Actual production code:
function isEmpty(val) {
return typeof val === 'undefined'
|| val === undefined
|| !(val !== undefined);
}
I'm starting to think the "infinite monkeys" metaphor is not a metaphor...5 -
Never worked before so I'll talk about one of the former staff at my school.
This guy worked as IT and did some teaching in the high school. Early last year, he suddenly disappears for no reason.
Now, I'm going to go in order of what we (the students) found out, not, chronological order.
Firstly, turns out that in class he would make comments about female students. Nothing explicit, just kinda strange. I forget the examples I heard but think like the overly friendly old guy. Those types of comments from a 40-something IT guy. (Some female students knew about this for a long while but I only heard about it after the investigation)
Next, rumor got out that they found some stuff on his computer. I don't know how, but it turned out to be accurate, and we were accurate at the follow-up assumption that it was porn.
After that, the school made an announcement that we had been arrested. Up until then, we just assumed he had been sacked. He was weird sure, but we didn't think criminal.
Some other students looked into the police records, and it turns out this guy had been arrested for possession and distribution of child pornography.
Pretty sick right? Its worth pointing out now that our school has Pre-K through 12th grade students.
I gained a new level of respect for my female classmates after that. I didn't even know that was going on, really wish I could have helped out.1 -
Real question tho. How do y'all actually put stickers directly on your laptop??
Like. For me that's some serious level of commitment. I always want to but I worry I'll hate it eventually and removing it would suck and scar
I can't even put stickers on the cases 😭😭 but like. Seeing a fresh new looking body when you take everything off is always soo soothing to me9 -
Welp. That was fun.
Just had an interview I wasn't even expecting. Basically the company emailed me saying that the role has been filled and as such the interview has been canceled.
And I'm like ok. Thanks for letting me know.
Then at literally the same time someone sent me a skype request asking me if I'm ready.
I get another email saying they're sorry about the inconvenience and hope my front end interview goes well... like. Wtf.
Why didn't they specify which? And why wait so long ffs.
I had two interviews with them. They stood me up on the last one and i emailed and never heard back.
So now I just had the most awkward interview in my life.
I was so rattled I forgot the answer to a simple af question. What's a JavaScript closure.
I wanna cry but it was so bad I wanna laugh3 -
Is it just the novice in me that finds the Haskell community's misguided obsession over character count really annoying? Learn You a Haskell For Greater Good states
> Shorter code means less bugs
A lot of people and resources seem to share this opinion, but it's obviously false. Simpler code means less bugs, but look at this function which just means "apply this applicative to each element of a list"
> sequence :: (Applicative f) => [f a] -> f [a]
> sequence = foldr (liftA2 (:)) (pure [])
This isn't "less buggy", it's fucking madness. The same in JS, the king of unreadable languages, would be:
function sequence(seq, val, apply = (f, x) => f(x)) {
seq.map(f => apply(f, val))
}
Seriously, how can you design a strictly typed language that gets beaten by JS in readability?16 -
So I had an interview. Went well. But apparently while they liked me I didn't show passion for development.
Any tips on how to that? Cause like... I like it and all but who really can show passion for working for someone else.
Tips please. Or job opportunities!!!23 -
Yeah I get what the intention was but like... why? I feel there are way better ways to do this
(Ps. I've become the pic post guy)8 -
So like... did every social media app meet up and go
"yo!
Ordering notifications and timelines chronologically in a way that makes sense?
Yeah mate, fuck it!"?2 -
Sometimes, when bugs get a bit out of hand... You have to counter them with better debugging methods 🐥2
-
CONTEST - Win big $$$ straight from Wisecrack!
For all those who participated in my original "cracking prime factorization" thread (and several I decided to add just because), I'm offering a whopping $5 to anyone who posts a 64 bit *product* of two primes, which I cant factor. Partly this is a thank you for putting up with me.
FIVE WHOLE DOLLARS! In 1909 money thats $124 dollars! Imagine how many horse and buggy rides you could buy with that back then! Or blowjobs!
Probably not a lot!
But still.
So the contest rules are simple:
Go to
https://asecuritysite.com/encryptio...
Enter 32 for the number of bits per prime, and generate a 64 bit product.
Post it here to enter the contest.
Products must be 64 bits, and the result of just *two* prime numbers. Smaller or larger bit lengths for products won't be accepted at this time.
I'm expecting a few entries on this. Entries will generally be processed in the order of submission, but I reserve the right to wave this rule.
After an entry is accepted, I'll post "challenge accepted. Factoring now."
And from that point on I have no more than 5 hours to factor the number, (but results usually arrive in 30-60 minutes).
If I fail to factor your product in the specified time (from the moment I indicate I've begun factoring), congratulations, you just won $5.
Payment will be made via venmo or other method at my discretion.
One entry per user. Participants from the original thread only, as well as those explicitly mentioned.
Limitations: Factoring shall be be done
1. without *any* table lookup of primes or equivalent measures, 2. using anything greater than an i3, 3. without the aid of a gpu, 4. without multithreading. 5. without the use of more than one machine.
FINALLY:
To claim your prize, post the original factors of your product here, after the deadline has passed.
And then I'll arrange payment of the prize.
You MUST post the factors of your product after the deadline, to confirm your product and claim your prize.99 -
I promised a friend to have a look over his dads website to add a small blog. No big deal, I've got it on my drive, can reuse it just need to adapt it to the environment.
I take a look at what I'm working with and I see the most terrifying piece of "Please, take my data" code I could possibly imagine (And I've seen passwords, in plain text in a script tag). I quote "function queryDB(mode, val) {
var query=" ";
if(mode==="findProd")
query="Select * from Products where ProdNam=" +val;
... (same shit for different cases)
sendQuery(query) ;
}
He literally built the query on the client side sent it to a php script (without validation) and inserted it into the database.
You could literally call window.sendQuery with any sql query and get the result printed into the console.
And other than the plain text passwords guy that wasn't some kid someone knew, this was a "Webdesign" Agency.
Now I took the entire thing offline, called my friends dad, explained it to him and try to sort this out. I would not charge a good friends father but that hack will get a quite hefty bill since my hourly rate just tripled.
And the worst thing : If I publicly name that asshole or warn the people in his portfolio I can, according to Google, be sued. (But, and I assume thats vague enough not to count as bad mouthing, if anyone of you has a customer from Rheinland-Pfalz, Germany with a preexisting page, please have a look at the database interface)
I will call that agency tomorrow, ask for a detailed explanation for why they apparently let trained monkeys write their code and anonymously warn everyone in their portfolio about those flaws...
I don't know if I'm cursed or if there are just that many bad devs but it seems that once a year I have to stumble over some "mistakes" that make me question my sanity.4 -
"The role: You will be designing and building responsive emails on a daily basis using HTML5/ CSS3/JavaScript"
Errrrrrrmmmm...5 -
Hey, senior developers, is there a reason for this?
I just can't believe it.
The line that makes me wanna kill is the
$("#" + id).val(val);
Taken from a very profesional site.9 -
If only.
Tbh. When I read about ruby and how it was meant to be as close to English as possible a little part of me was hoping for this1 -
Behold the monstrosity regex my transpiler produces!
/val|var|[1-9]{1,32}|\+|\-|\*|s\/s|>>|=|;|(["'])(?:(?=(\\?))\2.)*?\1|print\(|log\(|sqrt\(|input\(|strToArray\(|httpGet\(|if\(|else|{|}|s==s|s>=s|s<=s|s>s|s<s|s&&s|\|\||!|;|\(|\)|\[|\]| |\w+/gi13 -
The team spirit in our team has improved over the past 1 month with this etiquette..
*walk up to team member
*no greetings
Just say " bring yourself back online"
Watch them light up..share those ten Westworld seconds..ask for what you need
..and the hell back to your desk
..cheers -
Passed a code test for once and invited to interview with engineers.
I’m nervous yet proud. Any tips? It’s the first time I’ve reached this point5 -
Five interviews and challenges later and I’m told they won’t be going further with me.
Over month of my life. Finally thought this was the one. But oh well. Depression.
I officially quit being a dev.
It’s been rad y’all.12 -
Kotlin and mother tongue
In my mother tongue (my first language which is Kikuyu) we do not have the letter L in our alphabet thus meaning L and R to us is similar thus pronounced the same.
Then Kotlin makes life hard for devs who got a mother influence in their speech from my tribe. Was having a talk with fellow dev who is my tribe mate and we had an issue agreeing between val and var hehe.
We had to write it down to tell which is which.
Thankyou Kotlin for making my day.6 -
Do people really struggle with CSS?
I thought it was just design and ideas but is it actual CSS y’all struggle with?
Not judging. Just asking to be sure31 -
An update on my rant about that interview I had.
They emailed saying they're sorry I didn't pass etc.
My literal response was: wow. Shocker. No shit I didn't pass 😂 -
Trying to debug why there's NaN% instead of 15% (project in JS).
Later realises isNaN(Val) literally checks for NaN datatype rather than Val is a number or not.
*shit*
Ctrl Shift F - isNaN in Atom (searches entire project), rethinks logic, refactors code
Looks around *no ones there*
Silently pushes the changes along with another major commit. -
bool isTrue(bool val){
If(val == true){
return true;
}
else if(val == false){
return false;
}
else{
cout<<"Wrong value";
}
Function isTrue is the future ! 😂😂😂2 -
other dev changed constructor from
public A(String val){
this.val = val;
}
to
public A(String val){
this.setVal(val);
}
this feels bad in many ways, but need some arguments to convince him that its wrong11 -
I didn't know "bandwidth" can be so hard to understand even after 2 hrs explaining..client still wants widgets with autoplay videos..God why?4
-
Baby all I want for Christmas is Uuuuuuuuu-I design that made sense while being cute.
Late I know. But I just thought of it.1 -
Ooh. Here's a "deep" one.
For the self thought/online learners, at what point did you consider yourself an "actual" developer and felt ready to go out and apply for jobs and stuff?
And what challenges/reactions did you face?3 -
University: "It is important to distinguish between read-only variables and editable variables. They make it easier to find bugs if you're changing a value that should not be changed"
Me: changes all `const`s and `val`s for `var`s every time I get a re-assign error.2 -
Given the recent election, I'm taking measures to ensure the privacy and security of my data. Call me paranoid, but I think the NSA is going to be getting some extra funding soon. I'm already working on encrypting a ton of my data. Any other tips some of you guys could give me?8
-
Code reviewing, came across this:
Double val = item.getPrice() * pointMultiplier;
String[] s = String.split(val.toString(), "\\.");
points = Integer.parseInt(s[0]);
if(Integer.parseInt(s[1]) > 0) { points++; }
Usually I'd leave it at that, but to add insult to injury this was a level 3 developer who had been there for four (4!!!!) years.
She argued with me that we shouldn't round up loyalty points if theres only 0.00001 in the calculation.
I argued that since it's a BigDecimal, we can set the rounding factor of it.
She didn't understand that solution, refused to hear it.
The code is probably still there.5 -
I'm a young dev with ADD. Basically I just need to stay up late, and then get myself to hyperfocus on my code. It typically gets done in time to get a decent night's sleep.1
-
To those following the saga so far...
ya boi just had his followup python interview.
YIKES. Like, i aint even sure if it went bad or not.
Wish me luck.
Corey Schafer! Bless me!!!5 -
#Apple #FaceID
Yet another step towards the God's eye in Fast & Furious. Since it requires a 360 scan of a face, CIA just requires a photo to find anyone in the planet who's using an iPhone X [Stands for Expensive]. There's a reason why Apple ditched the fingerprint sensor.
RIP #Privacy 😶5 -
I'm a node JS developer, but I basically don't use Typescript but with the whole buzz around the technology, I feel I'm doing something wrong by not using Typescript and refusing to learn it. What do you think?4
-
Anyone know small-medium companies hiring front end devs around the eu?
Or any recruiters with a soul?
React btw. Thanks.
Why yes. This is a last resort. Thanks for noticing/criticizing6 -
Had to create a quick server side script. Created a quick function that returns an array, and tried to access a value from the function call like this:
$val = func()[0]
Apparently php didn’t include that feature until PHP 5.4
Wtf PHP.
Log into my webhost to update the the PHP version; only to discover that the highest PHP is PHP 5.5. PHP 7 is the current revision.
Wtf a2hosting.8 -
Anyone else like... REALLY bad at algorithms and logic stuff?
I just hate them so much.
Tell me to build something and gg done. But all these tests for jobs freak me out.
Like. It probably ends up being something simple and when it's explained I know what to do but at first I just instantly shut down and can't think.5 -
It took me putting on my glasses to make sure these pixels were real and not just blind ass not seeing shit.
-
Happened to know this devRant app from a friend. And these community of developers are lit ƪ(˘⌣˘)ʃ4
-
So what exactly is it like working as a developer?
I'm still in the learning phase but I can't seem to picture what exactly it is you'll be doing daily if you get hired.
Is it like constant coding? But like, the site is already made and is huge.
Or is it like making new stuff? But then like, there's already a big company site.
It's what I wanna do but I honestly can't imagine how it will work different from doing it for yourself7 -
$ python
>>> class Object:
>>> pass
>>> self = Object()
>>> self.attr = val...
>>> * copy paste code from some class
<Ctrl>+d
Testing ☑️ -
That moment you write and test HTML code on your phone in a metro bus and a brother looks at you like you're from the future
-
rant, but !really.
Trying out this new Kotlin language. Pretty cool, except for...
val str: String = "what the fuck is this syntax?"6 -
Haha, fuck you kotlin! and your null safety!
I was able to break it 😆
After reading about its syntax for over 2 weeks , i finally sat down to write a simple parsing app completely in kotlin. And now i don't know how, but i am able to store a null in a "val x:String" (i.e a non null variable)
I am not going to claim it as some miracle or discovery as some other ranters, it might be a mistake. I am just a 21 yo Android/java dev trying to re write my old ,tested java code to kotlin by myself, without any auto convert, in the middle of night when i am 99% asleep by brain.
I will try to raise an SO question with details, but all i used was a simple volley request returning heterogeneous data, a gson convertor and a single activity,
Right now i am buzzing off to my sleep11 -
I keep posting that I need job and I appreciate the feedback but I feel just saying that makes it seem like I'm not trying.
Like. I legit don't know. Could it be my cv that's a dud? Thinking of paying a resume writing thing
Cause I'm actually trying hard af to learn new stuff as well keep doing what I'm good at.
I got one interview in a year and even then they didn't gimme the chance to show tech side. It's soo tilting.
I'm actually competent though inexperienced I think.
Any advice or questions please. I legit need to sort this out this year. Like its very important that I do.
Help.13 -
so i just realised my stack overflow ban came after less than 10 questions in total...
how dumb am i exactly??? man’s got real questions to ask now5 -
Fuck accessibility.
No WAIT, before you call me an asshole hear me out.
So when you use CSS grid to create layouts you're supposed to not use the features it has (reordering items) too much, and instead keep the HTML structured the way it's supposed to be read.
When you add a picture of a cat you're supposed to put a alt="Brown cat sitting on a chair" there.
Also you should test for all kinds of sight disabilities and use high contrast colors.
All that for likely <1% of your users.
What would be the alternative? HTML is a markup language, and not supposed to be directly read by humans. Invest the time ONCE for screenreaders to understand CSS positioning and read content in a sensible order. Use image recognition to describe pictures (with selectable levels of detail). Let the browser modify colors on the fly for better readability.
Don't spend time and money to solve a problem 100000 Times that could be solved once.
Fuck accessibility.28 -
Err. I'm working on something this is a stupid question. But is there a way to save data and stuff without having to go into back end?
If not or if there is. What should I look into/learn to get it done without having to go too deep6 -
Sighhhhhh.
SIGHHHHHH.
been looking for days now and can’t still figure out how to sort with redux.
Can someone just teach me this? I’m starting to feel “special”35 -
Err. Any web developers or recruitment people able to please give me feedback on my resume?
I'd greatly appreciate the help 😭24 -
I’m always tired all the time. Depression and what not but today I am TIRED
Had an interview that requires vanilla javascript but I suck at algos even tho I was getting it done till time ran out. We gelled tho so I hope they see potential and move to next round.
But the good news is. I had a follow up interview based on a challenge. It’s the second I’ve ever had and I did well this time.
So much so that they’re booking another interview for tomorrow.
So I’m done with the technical portions of the process.
This is the first time I’ve gotten this far and I’m so happy. I’m hoping really that this is the one cause I doubt I have the energy and will power to keep going though the processes.
I’m so excited. It’s as if all my work is slowly showing and I’m getting closer and closer
Wish me luck guys. Hopefully I ace it as I come across well In General Chats.
This is my last application. If it doesn’t work I think I’m done with dev life and job hunt.
Fingers crossed I’ve found the one1 -
How do people make clones without tutorials!? 😭😭
I'm tryna clone bleacher report but have no clue where to start cause they're no guides anywhere2 -
Was trying to pull an all nighter to meet a deadline and I accidentally fell asleep. I was also texting a new person I liked at the same time.
Dreamt I got so much work done and was still texting and got into an argument.
Woke up, but by the time I realized what happened and that I slept off I had already randomly texted something aggressive and insulted 😭
So yeah. Guess who got no work done and is probably gonna be single for life 😂 -
I love this wk108 tag. Have a lot of stories related to it.
For me , my mentors are the reason i am what i am today. In this crazy selfish world where people only want to run faster than the others, having nice helping people around is great.
(Val titanLannister=xx)
(1)class 6-10th, xx is a curious, but poor boy with no desktop/mobile , but still loves cs classes due to various ,caring teachers.
(2) class 11th end,programming for the first time that year, hates programming, one day when everybody goes out for lunch, xx tears down while talking to his cs teacher "why can't i score good marks when i was the best till 10th? Is programming so tough?" . I remember him giving me a little but greatest motivational lecture followed by 40 minutes of the most basic concepts in which i might had asked him a 1000 questions. "You are my chaempion", he used to say😂 (bad accent) . But god, if he hadn't motivated me that day, i swear i would have left all this and go for business. Thank-you, lokesh sir💗💗
First year : tried to go for a competitive learning course. Mann, am not cool in that stuff. Again was about to break (i was among the top scorers in school boards and had designed many small games back then. I should have been good here too, but nah... the other guys were like bullets .)
Oh my, my deepest bow to this amazing teacher SUMEET MALIK (oh sir, you were so good) .
How this guy taught? Well, he first explained the concept. Fo those who understood, he gave them question 'A', for those who didn't, he repated . For those who understood , can do question a again, and those eho did A already gets an even advance question B. And this cycle went on until the weakest student(usually me) understood the concept.
And no, it never happened even once that class finished with even a single child not doing all questions he gave.he used to teach very less concepts each class and would go to everybody's desk to check they understood the concept, the question, its working, weather we implemented or not and weather our implementation is correct or not +our doubts. Hell , i even took doubts with him for hours after the class and he always just smiled💗(oh sir, am so sorry for being so dumb)
Real Doubt classes, doubts on whatsApp, revision assignments , tests , competitions,... damn, i haven't seen a teacher with this much dedication. At one point of time, that institution was famous for our Sumeet sir's classes 😂
Then last year, i got another mentor . Harshit bhiya. The guy is awesome, and a little extra swaggy 😂. He got a lot of chill, with his big AAD badge, a bag full of stickers and his every day association with people at udacity and google. As always i tried to overwhelm him with my ton of doubts in class, but he use to just give me a few pointers/links, after which i was like quiet for the complete session😂. He gave me a lot to think/work upon and i got a kind of career to work on.
I also think of mentioning a fucked up depressing-bot assholic friend of mine, but he don't deserve to be in this list of my best people. Just fuck you mann with a blockchain of dicks, if you are reading this.1 -
Anyone who codes like this?
if(IsThereAValue($("#txt_term").val(), true) == false)
{
}
this is too much!!! damn! complexity!!!
PS. He is my senior developer.6 -
public static void turnItUpTo(int val) {
this.setLevel(val);
}
public static void main(String[] args) {
turnItUpTo(11);
System.out.println("Rock out");
} -
Rant/Question
So I had this friend who has his own company, hosting is part of their business. He gave me a VM to host some websites, test stuff and whatnot. Free. I have quite some important stuff on there (personal, and a few demo sites for clients). No backups of my own, because they do nightly tape backups, and RAID accross physically seperated datacenters. Today, he just shut down my VM - for personal reasons (really personal, nothing to do with his company whatsoever, he hates me lately for something I can't influence). He doesn't say weather or when Ill get the data, and gave me no time to pull it. Can/should I go to the police? I just want my data back, but I don't know if I can do anything as it was free (no contract).
Switzerland, btw.5 -
PHP are you freaking kidding me right now? Why are you forcing me to write ugly and meaningless code like this?
Today I just learned that boolval("false") will return true.
I'd deffo expect this from casting operators, but not from a function which even has val inside of its name.
What purpose is to have functions like these in language if they just serve as plain wrapper for casting operators8 -
I feel retarded. Just spent a good solid 15 minutes trying to figure out what was wrong:
<input id="#example" type="text">
let data = $('#example').val()
And I was sending data to the backend and wondering why it always came across as undefined...6 -
It's bad enough that Facebook videos in my country have ads but some cunt actually had the genius idea to make the tagline for their ad "Un-skippable quality"
Not sure I can even be mad at how trolly that is 😭😂3 -
Does anyone know why websockets aren't used far and wide for APIs? I mean not like chat applications, but the typical webapp, say an online shop. For me it seems kinda wasteful to fire separate requests with tiny payloads all the time. I currently use moleculer and socketio for a quite big project with multiple websites and backend containers, and so far, i haven't found a disadvantage.
So what have i missed?12 -
I think I'm a dev.... sigh.
After I quit I didn't do it but out of all my interests and hobbies this one kept bugging me. So yeahhhhhh. I'm a dev.
Speaking of. Got bored and finally made a portfolio website. It's not great but people were asking for a link to my cV. So let me know what you think and I can get around to adjusting.
It's
Www.almxnames.com21 -
Not a new friend. But it made a dick I know be an even better closer dick.
.
.
.
.
.
.
.
@soulskrix love you really2 -
Spent quite some time debugging an odd problem.
A null check failed to trigger correctly, and when checking in eclipse I saw the null value.
Much digging later I finally noticed that the value wasn't null, it was "null", but eclipse doesn't quote strings...
The problem was that somebody at one time decided to convert an Integer to String by prepending an empty string...
Integer val=getInt()
return "" + val; -
Hello, Hi! Friendly neighbourhood noob here!
What’s he stuck on today you ask? React and Firebase!
Did he try? Yes he did! Only a little hitch this time.
Really? Little?
...It’s all relative... like the truth!
Anyway PLEASE someone look at my StackOverflow question!!
https://stackoverflow.com/questions...
Firebase and react are awesome tbh. But I cant figure this out!
Thank you!! -
The hotel I'm staying at only has mini toilet paper that I have had to call for an embarrassing number of times yet they're tryna judge me for wanting pasta at 3 am???
Like, we've passed that stage. I feel no shame anymore!! -
Guys. please help.
I’m trying to build something with multiple crud pages using and angular and rails.
For some reason when I attempt to go one of the routes it fails and goes straight to the backup(otherwise).
It’s the patients/new route that isn’t working. Everything else seems fine so I’m not sure what else to add to the question. I’ve tried changing things around to narrow down the problem and I’m almost convinced it’s from the routes. The button works fine when I link to other pages.
fml. I’ve been up for too long. I can link to the Stack overflow question WHICH NO ONE WANTS TO ANSWER if you need an idea,
https://stackoverflow.com/questions... -
I handle multiple projects at a time... Sometimes I feel stupid to mess up the basic syntax of Kotlin and Java.
So I made a stupid mistake in my code like this. I wrote this in Java file
" val something : String = "value"; " (which this is a Kotlin syntax, without knowing that I am coding in a Java file not Kotlin!
Oh stupid me~3 -
Hey. Need to beef up my portfolio as well as gain more experience.
If anyone needs some design/styling help or input please hit me up!!
Doesn't have to be paid actually.7 -
My new goal is to get a great af job but still appear as open and looking online so it'll be turn to fuck with recruiters and waste their time3
-
Hello y’all.
Could someone please show me what their/a good developer cover letter looks like?
It’s the thing that’s hardest for me at the moment3 -
Pose a question to the students and check devRant as they come up with an answer ..which happens to fix that bug on a freelance project you're doing..
<schemes> -
on a pleasant note,
Seriously, fuck myPhpAdmin. Fuck c9 and fuck MySql. My connection is solid i can do mini crap. my ajax call is good too. so idk why.
Ive spent over a week on a bug and now “occasionally working” is the best I can get and im not even sure why.
This assignment is due today.
I cant even try to do it locally cause for some reason myphpadmin and mysql dont wanna work on my laptop so yay fuck me.4 -
Looking into Kotlin, and it seems pretty cool, but I just can't get over how unnatural and annoying the mapOf syntax is.
In JavaScript: const obj = { a: 1, b: { c: 3, d: 4 } }
In Kotlin: val obj = mapOf("a" to 1, "b" to mapOf("c" to 3, "d" to 4))5 -
I might be wrong but all the interviewers I’ve had lately have been duds and didn’t know how to interview
Like. I can’t tell if I sucked or they had no personality and energy for me to work off of -
Can someone-not me- make a way to go lower than the lowest brightness setting on my phone?
Thanks.
From me and my shut in photophobic eyes5 -
Broke it. It happened once with normal usage, and i managed to reproduce it by switching excessively fast between notifications and the rant icon. :D3
-
I think what's keeping me going right now is discovering devs love rubber ducks so I can finally give into my secret addiction2
-
Hello council of elders.. or should I say "console"? Heh? Heh? I've been up for a long time sorry.
Anyway. I've started learning framework stuff. Angular right now. Been long overdue tbh. And I found a free course on udemy and followed it. It's cool and everything but I gotta ask...
Why can't I just use vanilla js and everything from scratch? I'm not sure if its the course I'm using (I'd appreciate more resources. Thanks) but I feel like it's a lot of effort. Is there something I'm missing or haven't learned yet?
It might sound stupid please let me know why it's better to use that than regular methods. Apparently it's meant to make stuff easier but I feel like it's just a lot linking files and making various things in different places.
Also. Other stupid question which might just be cause of the course but like... Is it mostly just for manipulating json??
Thanks. More questions to come soon!!3 -
Debating whether to be the guy that posts deep slash depressing shit on here. Or let my other personality of a meme Lord handle my devRant3
-
Ayy. It's time. Someone wants to hire me to make a site for them...
How much do I charge? 😭. They also said they want it as an exclusive design that I can't do for anyone else. It's one of my first proper ones so its basically my baby
But yeah. How much is appropriate?
Do bare in mind that I'm broke af 😂. Suggestions in GBP please6 -
*updates LinkedIn with new jobs*
*Wakes up to invites and messages from recruiters who wasted my time then disappeared*
*Some from people who I didn't even removed me*
Oh my. Whatever will I do in this situation? 😈 -
er guys... I don’t think i can code anymore.
I was unable to do anything for like 2 weeks while i was away and it’s been a month since i got back and like... I’m blanking out big time. I sit and stare at my computer and everything but there is like 0 motivation/interest. I’m fairly new to it tbh so i thought this is was a good time to try new languages but still no.
Any ideas or advice please? It’s like come weird ass code block.3 -
How do you guys deal with PRs where things just don't go in and you're always making the same comments and suggestions?
We have a fairly experienced guy in the team who doesn't seem that familiar with the language (Kotlin), despite having now used it for almost a year. We're constantly making the same comments on code not using the correct syntax (basic things like val vs var) or following the style guide and after a lot of grumbling the changes are made, but the same issues are present in the next PR.
He also keeps doing things their own way, even if as a team we've reached consensus on a particular design pattern to follow, or way to solve a problem. When you mention this, you just get a "Hmm okay" but nothing changes. It's like things just go in one ear and out the other.
Even as the reviewer this is really frustrating and demoralising. PRs have loads of comments which makes you feel like you're being picky, and they take forever to get approved and merged.
I even often find myself effectively feeling bullied into approving once most of the main comments are addressed, because you're talking the brick wall that isn't yielding - and none of us are happy with the quality of the code going in. A couple of us are even starting to think "I'm just going to have to accept this and then fix it myself later", which is just not a healthy approach.
Now I'm blessed with an amazing manager who is well aware of the problem and knows from his own experience that this guy is genuinely problematic to work with. We're working towards a solution but I was wondering if anyone here has had a similar experience and how you worked towards solving it?
I'm a little at my wit's end :/9 -
Trying to do an LFS build on a computer that keeps restarting. Need to mount the partitions and export variables all over again (ノ=Д=)ノ┻━┻1
-
Tried (and still trying) to do an LFS build. I already worked with Ubuntu, Debian, and Arch, but somehow a successful build eludes me. Each time I follow the book as closely and possible, but each time I got different issues. I've had to format the partition I'm working on at least 20 times now. Its fun, but I have no idea how I manage to mess up in so many ways.
-
Trying to write a program a la `man` in ncurses and just, is this hell?
I just want a floating header, a scrollable main body that reads from a file, and a command line footer, why is that so difficult? I finally got it to handle resizing terminals but now I need to try to compile it for windows, which does have unofficial ports of ncurses, but I have no idea how to use them.
Should I just restrict the windows version to a non-interactive command instead of a TUI like I want?2 -
Hey so I have to make something using both angular and rails and I wanna ask. After I manage to get angular running on rails, do I just proceed to build what I wanted on angular normally? Or is there a special way I have to do.
I'm learning to build something but I can't find specific guides on how to combine those to do so.
So I've found how to make it without rails. And how to link angular and rails. My plan is to learn both seperately then add. Will that work?
Sorry. My words are muddled. I'm just so tired.2 -
Let's list off all the craziest stuff that happened in 2016. (Crazy meaning unexpected not good or bad)
I'll start with the cubs winning the world series.6 -
Here's a question that I still don't know how to respond.
What's the expected salary of a front end developer?
In euros please.6 -
Mansplaining stories are my favorite thing on the internet right now tbh
Anyone got any good ones?7 -
*hot chic from office walks up to me*
Her: hi,are you the computer guy?
Me: heey,that's me..wassup
Her: nothing,you just seem different from the others ..you're so calm under all these deadlines.
Me: sure, when I'm frustrated I go to devrant
Her: where's that?
Me: exactly
Her: you're so funny.
Me: wanna grab lunch
* nothing ever happens how I imagine them..except code*3 -
DAMN IT TO HELL
BURN IT
six. SIX videos ive seen. read docs. and tutorials. and still dont know how to even start
you want oauth for facebook and spotify sureee i can
but for defualt?
and an api mock online?
FML
no clue
SOS3 -
Anyone good with react-native? I need help cause I'm about to lose my shit 😭 not even exaggerating when I say I've cried many times over this.12
-
so I have both PyCharm and VScode running for the same project. It’s React Redux Django so my servers and stuff are running through pycharm while i edit and code on VS cause PyCharm is crap for react and javascript.
But VS cant seem to run my crap without additional steps which PyCharm does for you automatically like the virtual env
Is there a better way to do this or is this my life now?4 -
Hi guys. Finally cleared up my time. Well not really but I wanna do something else cause I've been depressed af lately so I wanna try stuff I enjoyed.
Anyway. Last time I got quite a few from here but anyone need help with design/styling of projects? Wanna boost portfolio. Can use sketch or directly code in the styling for you.
For free. Though I wouldn't pizza money haha.
Let me know if you have/need anything
Thanks.3 -
I hate when I visit a new web framework's site and see documentation that promotes HTML tags like this:
<input type='text' name='foo' value='{{val}}' />
If you don't know enough about which quotes you should use and why... I have no faith in the quality of your software solution. -
everytime i try to learn kotlin, i can only think WTF is happening, why should it be happening?
after wasting last 4 hours, i came to this conclusion table regarding kotlin var and val notation.
And now my fucking compiler is saying that i can rather write :
val x:Int
and initialize it later, when i thought val is immutable and must be initialized at the beginning only(like public static final int x =5)
Who the fuck are those people that like this stupid language? why would you say some variable as immutable(meaning which can be changed 0 Times "ONCE" ASSIGNED A VALUE ) and when i can create a program with a variable that never got ASSIGNED A VALUE EVEN ONCE??10 -
Hey. So like I know been gone a while straight to the point.
Anyone in the Netherlands looking for a team member for the Odyssey Hackathon?
In addition to design and front end Ive also got you covered for legal and ethical.
So please if you’re interested hit me up -
Err so i gave in and decided to set up my dev environment locally as opposed to cloud. Especially since I wanna do mobile stuff now.
But yeah. I had to revert to npm 4 for react native with sudo but now I literally can't npm install anything without sudo...
Should I be worried or carry on?7 -
Had a really really good interview last week I think. And the weirdest thing was that he was friends with my ex bosses so we talked about them a lot. Lots of jokes. So I thought ooh slam dunk.
But now apparently I’m not going forward “based in part of what they said”
Fuck my life. Fuck you. You fucked me over during my time at your company and I tried to be civil cause I thought we somehow became friends.
But. Fuck you all to hell. I’ve been struggling to find something and been in a state a depression since the horrible experience I’ve been trying to be positive on.
Don’t even get me going on how I ended up leaving the company4 -
i have been watching some jetpack compose tutorials and trying to create projects with it. Its quite cool and looks very interesting. but wrti8 those modifiers seems like a great wastage of time :/
Also, i have an OCD of writing code in lesser number of lines , as much as possible . so i would rather prefer writing
val x = Modifier.function1().fun2().fun()
than
val x = Modifier
.function1()
.fun2()
.fun()
as long as my code line does not cross the 80 character limit guideline, and as long as it makes sense to not switch to a new line.
but IDE seems adamant on breaking those long modifier lines to weird indented codeblock, so its already getting very noring for me :/2 -
So like... is there a reason no one can answer a react-native question on stack overflow or do they only reply to things that give them the chance to be dicks? 🤔2
-
!rant
Anyone else wonder how they got into the kind of the coding they're in?
Like, I wanted to make plugins for music software and DAWs and now I do front end web...
I don't even know what fucking language is used for something like that -
In an already verbose, strongly types Java codebase and you see
private String m_strDisplayName;
private boolean m_bIsResolved;
...
I can understand the itch of another teams decided to rename it with correct Java convention. All nice and good, except that these changes were not merged back to master.
Five years, few re-orgs and product restructuring later, I'm staring at 500+ files merging mess trying to bring back these product codebase together.4 -
val true : bool = isFrustrated(me : Human)
1) Honestly fuck SML. Who's goddamn idea was it to make a useless fucking programming language that does absolutely nothing relevant unless you're trying to learn recursion. Who's fucking idea was it to not be able to even have side effects. And who gives a shit if you can explicitly declare the type of variables on every single fucking line that's what comments are for if you really need it. All this is aside from the fact that nobody ever has been like "OH UNMUTABLE TYPES? WOW IM SO HAPPY THIS IS SO USEFUL". At this point I feel like SML is basically a DFA - ABSOLUTELY FUCKING USELESS
2) Aside from that, who's idea was it to duplicate two classes. There's 15-122 (Principles of Imperative Computation) and 15-150 (Principles of Functional Programming). So far the ONLY fucking thing different is we learned about work and span in 15-150 - OTHER THAN THAT ITS LIKE TAKING THE EXACT SAME COURSE. BUT AGAIN. So then I have to fucking sit in lecture and pay attention for that tiny bit of information that is new amongst the giant cesspool of information that isn't. BECAUSE I ALREADY LEARNED IT.
Oh and did I mention that both classes are required to graduate as a CS major? Fuck me.
Thanks devRant for helping <3
Edit: We are 4 weeks into the semester so you'd expect we'd have gotten into the new stuff by now right????5 -
Question.
If you're working remotely- like a whole other country/continent- do you have to give taxes for the country the company is in?
Context. Got a "job". Not sure if I'll take it full time but for now I will be getting some backpay so I want to know everything before deciding and planning
Right now in my country I don't have to pay taxes so I want to know if that still stands3 -
Am I the only one to fix incrementally worse issues with the wrong approach, only to do it right in the end (with minimal research and coding) - being left with 1000 unnecessary workarounds to remove :( happened over the last week or so with a personal Vue project...
-
this aint working for some reason. unless im missing something then im completely stumped.
https://gyazo.com/37598c63be6af4702...
can someone please tell me what’s wrong?
It’s an array of objects that im trying to turn into options for a selector with the id prop being the value and the name prop being the actual text but it keeps saying select.add or appendCHild isn’t a function. now im lost.
god i hate tests, i know they are needed but damn5 -
Hello Devrant! It’s ya boi!
Update. Currently back in school in the Netherlands. Studying law and technology. Yeet.
But yeahhhh so stressed omfg. Finals already in October. This school is a mess.
And I’m the middle of that my thesis got rejected so here I am. Crying. Asking y’all for ideas. Anything you can think of please say.
It’s gotta be tech but a legal question. Ethical is fine too tbh. So if there is anything you’ve wondered or think is of please tell me the question. 😭
all I’ll say is that the last one they said was too vague and not specific enough. And ideally it should be AI or data science but anything tech would do.
Not sure if this is the place to ask but thank youuu.9 -
Got a job test today and I’m already almost done.
All that’s left are two features and I don’t know how to do them and I just wanna cry and all my momentum has gone to waste4 -
I heard I should not allow users to inject arbitrary text into my webpage without sanitizing it. Is it a clean solution to just eval it on the (node) server, and if it runs not post it because it's obviously JS and not just text?
Any opinions on that?11 -
so yesterday was a fun day. I'm wiring up dbvis toour db life cycle envs. connection to dev, works. move on to Val, connection works. move on to prod, boom, dbvis violates some security protocal that obviously does not exist in dev or Val which locks out the dB acct. I single handedly shutdown production, simply trying to connect with dbvis. smh. what a day!!
-
I would know how is Schrödinger's cat by just seeing this:
val cat = getSchrodingersCat()
> cat: Option[Cat] -
Anyone free and willing to help me with a react code review?
I’m stuck somewhere and not sure where i went wrong12 -
Im going to shove their soapy WordPress plugin up their ass sideways.
Just had to reverse engineer a WordPress plugin communicating with a SOAP API.
Why? Because the stupid fucking retard company thinks "we do not support custom integrations at this time, only plugins for certain CMS and some external providers" IS IN ANY WAY AN OK THING? IT IS NOT.
And i am feeling ashamed for having purchased a WordPress plugin (100 bucks) just for reversing it. My server even has to Report to them as wordpress to get access.
So fucking typical for swiss companies
Edit: also, they state they DO support custom integrations on their main website :/ -
Today you have the privilege of experiencing a rare look inside one of my servers: https://youtu.be/JcSPnsX-wAA
-
I would like to share this piece of knowledge for the web devs out there, even though it's probably known:
If you're using the Spring framework and you want to accept a list of items as a multipart/form-data request, then Spring will only be able to correctly deserialize your JavaScript FileList in the backend if you have scripted it as follows:
var data = ev.dataTransfer.files;
var formData = formData();
for (i = 0, j = data.length; i < j; i++) {
formData.append('files', data[i]);
}
The for loop with the 'files' name is key here. Why? Because then it will resolve into:
key=val&key=val&key=val
and that's how Spring will correctly be able to deserialize it into a List. We remember from our HTML learnings that if we want values in a form to be processed as one, we must provide the same name= for each element in the form, otherwise if you have a separate name for each input, it won't be passed on as one collection of values.
This is why my list was originally null when received in the backend.
Courtesy of StackOverflow:
https://stackoverflow.com/questions... -
Function in my Dao file is:
@Query("SELECT * from appData WHERE type = :type ORDER BY id DESC")
fun getData(type: String): Flow<List<AppData>>
The database contains a column of automatically generated int primary key 'id', a column of string named 'type', and another string column named 'content'.
A Part of code from my composable function is:
val currentRetrievedDate: Date = Date()
val currentDate: String = SimpleDateFormat("dd-MM-yyyy").format(currentRetrievedDate)
var lastDateObjectList by remember { mutableStateOf(emptyList<AppData>()) }
LaunchedEffect(streakCounterViewModel) {
coroutineScope {
streakCounterViewModel.appDataRepository.getDataStream("lastDate")
.collect { newDataList ->
lastDateObjectList = newDataList as List<AppData>
}
}
}
if (lastDateObjectList.size>1){/*TODO*/
for (i in 1 until lastDateObjectList.size){
LaunchedEffect (Unit){
streakCounterViewModel.deleteData(id = lastDateObjectList[i]!!.id,
type = lastDateObjectList[i]!!.type,
content = lastDateObjectList[i]!!.content)
}
}
}
val lastDateObject: AppData?/* = lastDateObjectList[0] ?: null*/
lastDateObject = if (lastDateObjectList.isNotEmpty())
lastDateObjectList[0]
else null
var lastDate = lastDateObject?.content ?: "00-00-0000"
var currentStreakObjectList by remember { mutableStateOf(emptyList<AppData>()) }
LaunchedEffect(streakCounterViewModel) {
coroutineScope {
streakCounterViewModel.appDataRepository.getDataStream("currentStreak")
.collect { newDataList ->
currentStreakObjectList = newDataList as List<AppData>
}
}
}
if (currentStreakObjectList.size>1){
for (i in 1 until currentStreakObjectList.size){
LaunchedEffect (Unit){
streakCounterViewModel.deleteData(id = currentStreakObjectList[i]!!.id,
type = currentStreakObjectList[i]!!.type,
content = currentStreakObjectList[i]!!.content)
}
}
}
val currentStreakObject: AppData?/* = currentStreakObjectList[0] ?: null*/
currentStreakObject = if (currentStreakObjectList.isNotEmpty())
currentStreakObjectList[0]
else null
var currentStreak = currentStreakObject?.content ?: "0"
In this code, the last login time and last streak of user is already saved, we just have to fetch the data from the local database, make sure that there are not more than 1 occurrences of same data type in the database, and then use that data. But this, instead of using the database values, uses 00-00-0000 as the lastDate, and uses "0" as the currentStreak (which should only be used for the first not, and in some rare situations only), and is not able to retrieve data from the database properly.
The data saving and updating logic is working fine, but only the retrieval part is causing some issue.
The complete project is also uploaded on github: at HealthEase repo of tauqirnizami4 -
A news/article/blog site and forum revolving around social issues where in addition to reading articles people can ask questions that are sensitive judgment free and get answers.
The aim is to slowly make the world a better more tolerant place8 -
Best part of being single on Valentine's Day is bitching about all the couples around you with your other single friends.
Happy val int tines = day;
#SingleDevelopers2 -
Is it just me who finds coding so relaxing? In all the messy crap flying around it's just me and code..my precious!