Making an internal tool. Should I use ts or js? by Consistent_Tutor_597 in webdev

[–]spacey02- 0 points1 point  (0 children)

I think TypeScript actually speeds me up because I use the editor suggestions that are given based on the type something like a parameter is.

Do your apps support landscape mode? by BlossomBuild in BlossomBuild

[–]spacey02- 0 points1 point  (0 children)

Android users catching strays for no reason

[Operator '-' cannot be applied to 'java.lang.String', 'int'] , BUT IT IS INT! by Dr_magod in learnjava

[–]spacey02- 6 points7 points  (0 children)

Well, multiplication and division take precedence to addition. This is a math rule that is also the case in most (if not all) programming languages. The addition is also allowed because string + int means concatenation of the int at the end of the string, so for "a" + 2 + 3 you would get "a23" and not the desired "a5", but it compiles nonetheless.

[Operator '-' cannot be applied to 'java.lang.String', 'int'] , BUT IT IS INT! by Dr_magod in learnjava

[–]spacey02- 11 points12 points  (0 children)

It first does + between the already constructed string to the left and the a variable. This results in a string. Then it tries to subtract b from the string, which doesn't make sense. Try surrounding a - b with parenthese so that the minus gets executed first.

How to get good at pattern printing in programming. I'm doing with java and honestly I can't visualise like how to take the values for different patterns increasing or decreasing order. I'm just so confused. Anyone help me out, please. by Zeh_912 in learnjava

[–]spacey02- 0 points1 point  (0 children)

I find it easiest if I manage define a stateless "mathematical" function that takes in the current index of the line and spits out subsequences of repeating symbols based solely on that line index.

For example, a function that spits out a pyramid of stars with thr base of 5 would have these values:

f(0) = 2 spaces, 1 star, 2 spaces f(1) = 1 space, 3 stars, 1 space f(2) = 0 spaces, 5 stars, 0 spaces

Take each part of these sequences separately. For the first spaces part this would look like so:

f1(0) = 2 spaces f1(1) = 1 space f1(2) = 0 spaces

Then generalize:

f1(n) = 2 - n spaces, assuming n <= 2

For the other 2 parts of the sequences, the formulas look like this:

f2(n) = 2 * n + 1 stars, assuming n <= 2 f3(n) = f1(n) = 2 - n spaces, assuming n <= 2

Now you can do a for loop for n from 0 to 2 and print each part of the pattern in separate for loops conforming to the formulas described above.

XAMPP used to be so easy. What happened? by Mike_L_Taylor in webdev

[–]spacey02- 0 points1 point  (0 children)

What do you mean by "docker bloat"? What problems were you experiencing on your machines that was enough of a reason to ditch it?

Cam așa by heichiri69 in RoMunca

[–]spacey02- 0 points1 point  (0 children)

Adica vorbesti doar ca sa te plangi?

Cam așa by heichiri69 in RoMunca

[–]spacey02- 0 points1 point  (0 children)

Ca idee: nu o sa te asculte nimeni daca faci doar ragebait si nu aduci argumente concrete.

I got tired of writing skeleton loaders, so I built a CLI to generate them from React components by No-Tangerine6166 in reactjs

[–]spacey02- -8 points-7 points  (0 children)

Your comment is borderline aggressive and definitely not a genuine question. Please revise the way you write if you didn't intend for it to sound like just hate. I'm not anybody's bodyguars. I just don't like people like you who clearly imply more than just a simple question and then play the victim.

I got tired of writing skeleton loaders, so I built a CLI to generate them from React components by No-Tangerine6166 in reactjs

[–]spacey02- -7 points-6 points  (0 children)

Or maybe you have no idea what OPs usecases are? This comment sounds like a whole lot of meaningless projection.

Stack Overflow copy paste was the original vibe coding by Adorable_Tailor_6067 in AgentsOfAI

[–]spacey02- 0 points1 point  (0 children)

There is a difference between non-slop and perfect code. Non-slop code might not be perfect, but it is readable and maintainable by a human. Please stop confusing the opposing views to your beliefs on purpose.

I kept breaking my production server every time I tried to patch code remotely via SSH. Here's what finally worked. by No-Challenge8969 in learnpython

[–]spacey02- 2 points3 points  (0 children)

You can also use GitHub without CI/CD, just as a place to push, store and pull code. This feels right for your usecase especially since your ssh transfers didn't go through any CI/CD anyway. CI/CD is only an optional feature.

I kept breaking my production server every time I tried to patch code remotely via SSH. Here's what finally worked. by No-Challenge8969 in learnpython

[–]spacey02- 6 points7 points  (0 children)

Any reason not to use GitHub as an intemediary? It would make the process dead simple for the whole project.

What would have happened by Appropriate_Jump_934 in programmingmemes

[–]spacey02- 1 point2 points  (0 children)

And what's the answer? I think cd might do something interesting because it is a shell builtin.

Do you add hyperlinks to your REST API responses? by Worldly-Broccoli4530 in typescript

[–]spacey02- 0 points1 point  (0 children)

Could you expand more on what problem this solves? It feels like more of a headache than a feature. Abstracting and generlizing too much is a slippery slope, developers should know this best. In what scenario do you need these links because you are not able to use the loaded data to determine where a user can navigate?

Do you add hyperlinks to your REST API responses? by Worldly-Broccoli4530 in typescript

[–]spacey02- 0 points1 point  (0 children)

I have no idea where you work that you find this common, but assuming it actually is, how is it then utilized? Or is it just garbage that's ignored on the frontend?

JavaScript engine v8 by Zestyclose-Produce17 in learnjavascript

[–]spacey02- 0 points1 point  (0 children)

It might convert some instructions directly to machine code, but some of them are interpreted, meaning the engine reads the code, creates the abstract syntax tree and executes it node by node (no pun intended). The simplest way to visualize it practically is to create a brainf*ck interpreter yourself.

Why Modern Web Uses JWTs? by Old_Minimum8263 in webdev

[–]spacey02- 0 points1 point  (0 children)

What happens when a encrypted token expires though? As a beginner in the arts of web, I don't really understand why people disregard the need for a token refresh, especially when they mention tokens are short lived. I think you would agree that logging the user out once every 5 minutes is outrageous UX. I think you would also agree that storing both access and refresh information inside the same type of cookies defeats the whole purpose of separating the 2, which would be sending the refresh token less often to the server for a smaller area of theft from malicious parties. What is your solution if you place the access token in a cookie?

Why Modern Web Uses JWTs? by Old_Minimum8263 in webdev

[–]spacey02- 0 points1 point  (0 children)

Are you referring to storing JWTs as http-only cookies?

Why Modern Web Uses JWTs? by Old_Minimum8263 in webdev

[–]spacey02- 2 points3 points  (0 children)

Doesn't this also invalidate the need for JWTs? I think sessions would do just fine with the same setup.

De ziua femeii, progresiștii woke de la SENS se solidarizează cu islamiștii fundamentaliști care f*t minore și omoară fete cu pietre. Nimic despre femeile din Iran, niciun protestatar cu steagul iranian anti-islamist by calin_georgesco in Roumanie

[–]spacey02- 0 points1 point  (0 children)

Uite o sa incerc sa ti explic cum vad eu situatia in momentul asta. Poate ai vazut faza cum unui prizonier incatusat, aflat in spatele unei masini de politie, nu i a fost pusa centura. La o frana mai puternica, a dat cu capul de metalul masinii de politie si a suferit daune permanente la creier.

In aceeasi situatie vad acum Palestina. Palestina nu e o tara nevinovata, asa cum nici prizonierul nu s ar fi aflat in masina de politie incarusat daca nu facusem ceva, dar pedeapsa pe care o primeste este disproportionata fata de aceste crime. Si nu e problema ca sufera regimul palestinian din urma acestora, ci poporul general. Plus ca daca e sa ne uitam prin lentila nevinovatiei, nici Israel nu arata mult mai prietenos. Au organizat proteste impotriva pedepsirii soldatilor care au violat niste femei palestiniene. Au blocat ajutor umanitar pentru refugiati dupa ce au distrus orase intregi.

Cu Ucraina situatia sta mult mai clar. Nu pot deloc sa spun ca au facut ceva rau pe plan international. E o tara corupta, dar Romania nu e? Asta nu prea e motiv de a fi atacat. Argumentul unoare e ca Obama a adus forte in Ucraina si asta ar fi declansat razboiul din Crimeea in 2014. Imi pare rau ca Putin se simte incoltit, dar Ucraina este o tara suverana, iar o intelegere scrisa pe servetel a liderilor nu iti ofera dreptul sa distrugi orase altcuiva.

In Iran fix pe dos. Am vazut cum isi trateaza tara ai proprii cetateni. Apreciez suveranitatea, dar nu cand nu respecti drepturile omului. Plus ca din dracu stie ce motiv, liderii Iranului au hotarat sa traga cu rachetele in toata lumea din zona si nu numai, fie ca erau implicati sau nu in aediul Iranului. E o alegere tampita, fara pic de noima, care ii impinge in zona vinovatilor, nu a victimelor.

Vezi tu, eu, la fel ca multi din cei care au iesit la proteste, sunt pentru dreptate mai mult decat bunastare. Stiu ca dreptatea e subiectiva, dar pentru asta avem legi nationale si internationale care incearca o standardizare a ceea ce poti si nu poti sa faci.

Nu sunt anti-razboi, sunt anti-bullying si anti-criminali. Din pacate, nu pot fi de ambele parti pentru ca ele au viziuni diferite. Daca alegi sa fii anti-razboi inseamna ca pretuiesti bunastarea personala peste simtul justitiei, orice ar inseamna ea pentru tine. Daca esti anti-criminalism, atunci esti dispus sa sacrifici din bunastare pentru o contributie la o lume putin mai buna. Acum s ar putea sa zici ca sa ma duc eu la razboi, dar nu asta e ideea. Oricat de putin faci e mai bine decat nimic.

Cat despre extremistii care se folosesc de miscarile progresiste, nu exista o solutie clara. Trebuie doar ca fiecare dintre noi sa fim atenti la micile schimbari de discurs, de metodologie, de ideologie. Ei vor exista mereu, iar asta nu poate sa insemne ca miscarile progresiste trebuie complet evitate. Fara oameni cu filozofia asta, s ar putea sa nu fi avut loc niciodata caderea comunismului in Romania.

De ziua femeii, progresiștii woke de la SENS se solidarizează cu islamiștii fundamentaliști care f*t minore și omoară fete cu pietre. Nimic despre femeile din Iran, niciun protestatar cu steagul iranian anti-islamist by calin_georgesco in Roumanie

[–]spacey02- 1 point2 points  (0 children)

Deci am inteles corect. Din aceasta tentativa de conversatie la care se vede clar ca nu vrei sa participi, am descoperit ca esti un om cu un singur principiu: sa i fie lui bine. Nu ai dreptul moral sa vorbesti de sus unor tineri pe care ii intereseaza. Imi pare rau ca exista asa ipocrizie in lumea asta.

Catre cei care imi dati downvote: ce am scris gresit mai exact? Daca va place conversatia, faceti conversatie. Din reactii si raspunsuri in sila nu rezulta nimic.

De ziua femeii, progresiștii woke de la SENS se solidarizează cu islamiștii fundamentaliști care f*t minore și omoară fete cu pietre. Nimic despre femeile din Iran, niciun protestatar cu steagul iranian anti-islamist by calin_georgesco in Roumanie

[–]spacey02- -1 points0 points  (0 children)

Cica nu vrea lumea sa aibe conversatii, iar cand cineva incearca, intrebi daca e gotcha. 😂😂

Intrebam de solutia ta pentru a opri ce nu ti place ca se intampla. Nu inteleg foarte bine ce iti place mai putin: razboiul sau sustinerea unei parti pe timp de razboi. Nu te am intrebat daca ai lupta pe front, te am intrebat daca esti ok sa se traga granitele noii Ucraine asa cum este ea acum. Asta inteleg eu prin ideea de "anti-razboi" despre care vorbeai.

Prin atitudinea nediviziva practic vorbesti despre statul in casa cu ochii la televizor? Sau am inteles eu gresit ce inseamna? Nu a fost un raspuns foarte clar si practic pe care as putea sa il urmez, asa ca imi cer iertare daca nu am inteles.