[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip / qa] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology

[Advertise on 4chan]


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


File: 1628906004861.jpg (293 KB, 1378x2039)
293 KB
293 KB JPG
Old thread: >>83797422

What are you working on, /g/?
>>
>tfw wrote code using a pajeet's instructions and it doesn't work
>>
class-oriented programming is the biggest scam in the industry
>>
>>83810811
You have to take the poo out of the loo to make it work.
>>
>>83810892
that would be dynamic and weak typing.
>>
>>83810801
Rewriting an ancient duct-tape solution for handling ingress of UPS QuantumView XML feeds.

>tfw you just shake your head looking at code you wrote ten years ago
>>
>>83810903
they don't matter
>>
>>83810892
Code is free bro
>>
>>83810954
consulting, books and talks aren't
>>
>>83810896
even if i shit myself in the loo, I think that it still wouldn't work
>>
I have a path "/something/something/", user enters string "foobar.txt", and they're combined into "/something/something/foobar.txt".

How do I validate the user's string to make sure they can't enter anything malicious like going backwards in directories or whatever they may try? Should I remove certain characters or what? The same string should work on both Windows and Linux.
>>
>>83811048
And to clarity, it's only used for file access, not databases or anything like that.
>>
>>83811048
Combine the paths then use the realpath function on the result.
>>
>>83811085
That doesn't exist on Windows. I'd prefer to know what needs to happen so I can make sure myself that it does.
>>
>>83811118
Is the user mean to just enter a file name? No directly path?
>>
>>83811118
Don't be a retard. Use the analogous function on whatever platform you're on.
>>
>>83811133
I have a config file where you can define filenames. Those files are loaded from a very specific folder so they must be relative paths. They should be able to be sub-folders though, so "diddle/foobar.txt" should work as well.

The user might get someone else's config file, that's why it can't have security holes.
>>
Reminding anons to use https://github.com/friendlyanon/cmake-init when creating new C++ and C projects!
>>
>>83811189
I guess I would just some some OS function to parse the path. Then use another to make sure the path points to a file within your intended directory.
>>
>>83811048
https://cs.opensource.google/go/go/+/refs/tags/go1.17.2:src/path/path.go;l=70
>>
>>83810966
>consulting
a meme
>books
sci-hub, libgen and z-lib exist
>talks
relevant ones are all on yt
>>
>>83811232
What this guy said. Try to filter/validate for path traversal is a bitch and a half. Usually just better off letting the platform figure out where the final absolute path would end up, and checking that to ensure it is somewhere they should be allowed to.

Also...
>>83811189
This sounds like you have a permissions issue on the filesystem. If only some users should have access to a directory/file, then only those users should have permissions on it. Trying to protect it in the program is a losing battle. What stops the user from simply copying the path from the config file and going in and fucking around?
>>
>>83811315
But why would you got to the effort of learning useless shite?
>>
>>83811321
>What stops the user from simply copying the path from the config file
Nothing. I'm just trying to protect stupid users who download someone else's template config because they're too retarded to edit it themselves, and then get fucked over by it.
>>
File: phi.jpg (5 KB, 125x125)
5 KB
5 KB JPG
Is phi calculus worth learning, /dpt/?
Or is it just a meme, like lambda calculus?
>>
>>83811407
Schizo meme
>>
>>83811452
Sweet, I haven't taken my meds in a year. Will learn phi calculus then, thanks!
>>
>>83811407
is that the one where the /sci/ poster had a mental breakdown over real numbers? you're him, aren't you
>>
>>83811371
That feels like a different use case from what you said before about security, but ok.

The only way you're likely to protect the user from setting the path 'wrong' is to not let them set it at all. Either structure the data store in such a way that you can generate the correct path based on their username or something similar, or establish a mapping source that the users don't have the ability to modify and use that.
>>
>>83811573
I know what I need and I already put it in extremely simple terms in the original post, I don't know what else to say.
>>
Ironically that little python script the romanian guy was working on would be mildly useful for my current unit testing stuff.

I randomly generate strings to feed into a function as a kind of black box testing, but I would like to know for sure the random number generator isn't getting fucked up and spitting out a bunch of the same value when doing it a billion times in a row.
>>
>>83811539
why would you have a mental breakdown over something that isn't even real
>>
Lisp!
>>
>>83811659
if it's so simple then just close the browser and fucking do it then
>>
>>83811790
Just making sure, but did you take today's meds yet?
>>
C++ is the most low level high level programming language!
>>
File: NESblast_21_2_6.png (55 KB, 777x781)
55 KB
55 KB PNG
>>83810801
Lua and ASM6F. NES engineering. It's taking forever and i could not be happier in my own insanity wasting away in moms basement =)
It's either this or bringing an AK47 into the office and filling every PM i see with a head full of lead whilst brutally painting the bland generic gray carpets, cubicles and white plaster walls with a beautiful shade of human crimson with the upmost accuracy and skill so i'm very very happy here =)
>>
>>83811979
you'll need money eventually though, right?
or are those concerns taken care of
>>
>>83811963
yeah pretty much
>>
>>83811539
Nope, it's this: https://www.eolang.org/eolang-paper.pdf
>>
>>83811979
hmm

I wonder if a VR version of tetris would be as cool as I imagine it to be
>>
File: money_for_nothing.jpg (157 KB, 1328x1028)
157 KB
157 KB JPG
>>83812031
dogecoin
>>
File: 20210921_101635.jpg (2.74 MB, 5312x2988)
2.74 MB
2.74 MB JPG
>>83812085
i don't like existing tools, so, i'm doing something about it. i'm making ones for me: because thats america baby
>>
File: 1633570771351.png (31 KB, 840x610)
31 KB
31 KB PNG
How do you deal with duplicates / junk data in your DB?

e.g. DB has an entry for John Wayne, anohter for John Waine, and another for Jon waynee even though they are the same person
>>
>>83810916
yes they do
c and shithon are everywhere
>>
>>83812202
figure it out and delete the junk records
>>
>>83812202
id entries by their hashed passwords instead of names.
>>
>>83812227
>2 random people have the same password
>same hash
kek
>>
>>83812241
>he doesn't salt
ngmi
>>
>>83812245
https://en.wikipedia.org/wiki/Hash_collision
>>
>>83810801
CMaking some stuff. I was expecting an absolute horror, but so far is just annoying and ugly.
>>
>>83812254
https://en.wikipedia.org/wiki/Salt_(cryptography)
ngmi
>>
>entry level software dev position
>$50,000-$60,000/yr (which was shit like 7 years ago even)
>no skills required almost, they will train you

lol some lucky fucker is going to get that without even a degree or knowing how to program, isn't he
>>
File: 1633683078674.png (86 KB, 1100x542)
86 KB
86 KB PNG
Is it actually possible to get free crypto by scanning wallets with python script?
>>
File: file.png (22 KB, 341x103)
22 KB
22 KB PNG
femboy flag
>>
File: jim_morrison.jpg (144 KB, 748x640)
144 KB
144 KB JPG
>>83812372
indians outsourced on dawns highway bleeding, java crowds the young childs fragile egghead mind
>>
>>83812372
im shocked they let people into uni without knowing how to program
>>
What's are good resources / tools for writing a bootloader?
>>
>>83812463
Isn't that what they would be going to college for?
>>
>>83812482
there needs to be some separation of 2+2=4 and solving second order differential equations
>>
>>83812500
so kinda like how before law school you need to do the lsat?
>>
>>83812509
i dont speak american sorry
>>
>>83812531
So you're saying america has higher education standards, got it
>>
File: alex_trebek.png (2.31 MB, 1000x1534)
2.31 MB
2.31 MB PNG
>>83812531
> sorry
clearly you're canadian
>>
>>83812544
yes
>>83812578
worse, british
>>
>>83811198
I don't get it, why? Doesn't it do this by default.
>>
>>83810801

I am a brainlet and passed my intro course exam for making recursive functions in C, thank you for the support /g/
>>
>>83812622
Do what?
>>
>>83812446
if you work for the NSA and are looking through people's cloud storage then perhaps, yes
>>
>>83812622
Visual Studio already has a Cmake project type, he is just some weirdo that doesn't use Visual Studio I think.
>>
File: clash_london_calling.png (141 KB, 300x290)
141 KB
141 KB PNG
>>83812597
> england
oh dearie me pardon sir the cat seems to have grabbed my tongue and filled me with misguided information for the future of humanity when word spreads to the isles and beyond the spanish inquisition tomorrow
>>
File: reagan.jpg (276 KB, 812x1024)
276 KB
276 KB JPG
>>83812756
> NSA
missed me
>>
>>83812775
I use Visual Studio 2019, but prefer to compile with Ninja and LLVM Clang on Windows.
>>
>>83812372
>One thousand, three hundred, and fourty applicants

>b-but Americans are all quitting their jobsss!

lmfao holy fuck, the economy is absolutely fucked get ready for another fucking depression
>>
>>83812836
>reagan
https://www.youtube.com/watch?v=QTcL6Xc_eMM
>>
File: 34792384732.png (605 KB, 935x826)
605 KB
605 KB PNG
>>83812777
dw theres no future for humanity in britain
>>
File: gigachad.jpg (65 KB, 1280x720)
65 KB
65 KB JPG
>>83813016
>speed it up
Yes, we're not going fast enough.
>>
File: file.png (35 KB, 465x86)
35 KB
35 KB PNG
onlyfans flag
>>
Another interview in 3 hours, I've lost count how many that makes this week.
>>
>>83813074
Fucker.

What kind of work experience lands you that many interviews?
>>
>>83813074

Good luck man
>>
>>83812085
>VR version of tetris
there's a tetris game for vr headsets called tetris effect but idk if that's what you're looking for

>>83812859
yeah the economy is fucked and everyone is switching into SWE to cope
unironically half the people i know in software didn't major in CS
>>
>>83813074
>tfw i've only gotten interviewed by 5 tech companies in my entire life

what kinda place are you interviewing for? do you want the job?
>>
>>83813348
>inb4 "rust" and outs himself as a liar
>>
>>83813464
>unironically half the people i know in software didn't major in CS
well yeah, why would you study cs do be a programmer?
>>
>>83813464
My presumption is that people are leaving their existing jobs for higher paying jobs aka software jobs. The reason for this is most likely that companies can no longer afford to pay them enough to keep them there (or don't want to).

So either the labor market adjusts and starts raising wages (not likely) or the economy crashes again and the middle class is just fucked with rampant inflation and poverty.
>>
>>83813464
The irony of this post is that talking about the economy being fucked while simultaneously talking about switching into SWE as if that isn't how the economy is in action. There is huge demand for SWE, free market economy in action, honey. That's not a defect, that's the natural state of the world.
>>
A backpack > Data Structures > Algorithms > Computation Theory > Epistemology
>>
>>83813888
well there is the knapsack problem
>>
>>83813906
whats the nutsack problem?
>>
>>83813929
You are given a set of nuts with varying sizes and a nutsack that can only carry a certain volume of nuts. The nuts are priced based on a variety of factors, namely race. The goal of the nutsack problem is to figure out how many nuts you stuff into the nutsack to maximize the total price.
>>
File: carlos.jpg (23 KB, 355x500)
23 KB
23 KB JPG
>>83813976
you were supposed to say deez nuts
>>
>>83814001
do you like imagine dragon?
>>
>>83813929
The the nutte sac is a specialization of the dillsack commonly encountered when using the scungle methodology.
>>
File: BSDegrees-1975-2014.png (73 KB, 1813x1038)
73 KB
73 KB PNG
>>83813619
path of least resistance
>>83813690
>My presumption is that people are leaving their existing jobs for higher paying jobs aka software jobs.
that or they are recent grads who couldn't find a job in their field. happened in the 90s as well
>>83813832
easy come easy go. demand might not last forever
>>
good naming conventions for c++?
i like what the hungarian notation achieves, but most of it is unnecessary and cumbersome to work with.
>>
>>83814260
at one time I would say follow the conventions Microsoft uses
>>
>>83814260
all caps everything
>>
>>83814286
microsoft refers to the hungarian notation. are there even any others?
>>
>>83814293
HOLYFUCKINGBASED
>>
>>83814381
Well I would look at what Microsoft ACTUALLY uses, like create a VS MFC project and look at the boilerplate conventions.
>>
>>83814419
i'll check it out
>>
File: rust transies.jpg (80 KB, 596x662)
80 KB
80 KB JPG
>minority programmers association
>>
>>83814455
they program minorities?
>>
>>83814542
they are trannies
>>
File: 1626074552482.png (196 KB, 483x487)
196 KB
196 KB PNG
>>83814572
that's not as funny to imagine though
>>
File: cover.jpg (376 KB, 1280x1280)
376 KB
376 KB JPG
I'm working on programming tasks for my uni and few hours ago I got this problem:

~/.g/repo/education-introduction-to-programming-cxx [main] λ make all
g++ -g -std=c++17 -Wall -Wextra -Werror -Wpedantic -Wfatal-errors -I./include -c -o build/s05-sleeping-threads.o src/s05-sleeping-threads.cpp
cc build/s05-sleeping-threads.o -o build/s05-sleeping-threads
/usr/bin/ld: build/s05-sleeping-threads.o: in function `__static_initialization_and_destruction_0(int, int)':
/usr/include/c++/11/iostream:74: undefined reference to `std::ios_base::Init::Init()'
/usr/bin/ld: /usr/include/c++/11/iostream:74: undefined reference to `std::ios_base::Init::~Init()'
collect2: error: ld returned 1 exit status
make: *** [<builtin>: build/s05-sleeping-threads] Error 1
rm build/s05-sleeping-threads.o

~/.g/repo/education-introduction-to-programming-cxx [main] λ cat src/s05-sleeping-threads.cpp
#include <iostream>

auto main() -> int {
return 0;
}

~/.g/repo/education-introduction-to-programming-cxx [main] λ


As far as I understand, it's some linker issue, how would one solve it? It worked literally few hours ago.
>>
>>83814664
Nevermind, it's been completely my fault, I didn't realised I've changed makefile by mistake.
>>
>>83814664
not sure why it worked before, but using CC to link C++ seems suspect, it probably doesn't supply the required objects by default. Try using g++ for linking too.
>>
Learn Lisp.
>>
>>83814765
I ment Rust sorry
>>
>>83814777
see >>83814765
>>
How do you guys do tests with databases? I've got some python code that stores data in mongo and I want to test that it receives the correct data. At the moment I'm using pytest and cleaning the db before and after each test, but I think there should be a better way.
>>
when will you lispies start shilling Shen, the only decent L*sp?
>>
>>83814842
Why don't you learn it then?
>>
>>83814863
no reason when idris2 exists
>>
>>83814873
idris2 is written in lisp
>>
>>83814880
no it's written in idris1, it just uses chez for a backend.
dumb lispie
>>
>>83814836
Mocking, monkey patching, dependency injection, etc.
>>
>>83814664
>>83814708
>make
Just use CMake and >>83811198
>>
>>83814892
yeah but without lisp, idris2 would be DOA
it would also be slower than slow as shit
haskell eternally btfo
>>
>>83814905
The parts of my code that interact with mongo are testable in isolation. I'm looking for a more automated way to validate the data inside of mongo instead of writing assertions in pytest.
>>
>>83814936
>idris2 would be DOA
Edwin made it a point for it to be trivial to add more backends.
https://idris2.readthedocs.io/en/latest/backends/custom.html
Idris isn't dependent on anything
>>
>>83814957
why is it dependently typed if it doesn't depend on anything?
got em
>>
reeee i don't wanna work on my pointless project
mostly because i don't know where to start
>>
>>83815029
what is it
>>
>>83815037
Haskell to Haskell transpiler
>>
>>83815037
Idris2 to Chez compiler
>>
Whats a good library for multithreading in c++? Should I (badly) implement my own threadpool or use a library for that? Also any tipps on how to synchronize the work across different threads? Should I just use bool flags?
>>
>>83814260
Meaningful names everywhere. Capitalize the first letter of types. I preface private members with m_ and make member functions camelCase. Free functions are lower case snake_case. Preprocessor stuff is in all caps.

I don't like the way I've seen Hungarian Notation used, and when it comes down to it, you should almost never have to encode type info into a variable name in C++.

My C++ has started to go in a different direction once I started to move away from the overly OOP approach I was formally instructed with. I now find myself using types not so much to always directly model real world objects, but to enforce semantic correctness using the type system.

>>83815029
Write the parts you know you'll need.
>>
>>83815051
awful
>>83815063
less awful
>>
hmm

two concepts in testing are pretty useful
"equivalence class" and "boundary value analysis"

an equivalence class is the set of data where testing a few values should mean the rest of the values in the set will work as well

the boundary value analysis is testing outside of the boundaries of the equivalence class, i.e., if there is a range of expected values for the input to a function, then a boundary value test would test that range +1 or -1
>>
>>83815078
C++ has it's own thread library now, switch your compiler to use the newest C++ features you can
>>
>>83815080
It's Haskell to Haskell via Idris2 and Chez as intermediates
>>
>>83815096
now we're talking, how about a js interface via clojure too
>>
>>83815096
I'll fork it when you're done and add a Malbolge compilation step.
>>
https://github.com/kspalaiologos/malbolge-lisp
>>
>>83815143
>malbolge
>l*sp
>w*ndows
wow
>>
>>83815115
>interface
Woah slow down there you can't export the intermediates. They're vital to the process but all you're getting out is a haskell program.
>>
>>83815177
>all you're getting out is a haskell program
great, i've been meaning to revolutionize the trash paradigm in computing anyway
>>
File: tired.png (408 KB, 588x736)
408 KB
408 KB PNG
>>83815143
>(she/her)
>>
>>83815215
You just know.
>>
>>83815215
Why are all the smart ones just mentally ill?
>>
>>83815268
autism
>>
>>83815268
I think it's never being happy, considering carmack is fine, as he keeps himself satisfied .
>>
>>83814948
I would probably avoid validating the data that gets stored in Mongo, and instead write code that inserts data and then queries it back.
>>
>>83815455
That's exactly what my tests do right now. I guess for the time being it should work out.
>>
>>83815307
>considering carmack is fine
Is he though? Working on Oculus?
>>
>>83815592
no he quit to work on AI by himself
>>
Building my home lab. Currently wiring 8 drops to my workstation/work laptop area.
>>
>>83815592
he's doing AI stuff and is part-ish time at Oculus these days.
>>
>>83815085
In coding interviews I ask people what kind of unit tests they'd write, and about 50% of people say that would write only tests for various types of input that's invalid to the problem, like null or empty instead of an array. Not a single happy path test, special case, boundary condition, or anything else that would actually verify that any of their code actually works.
>>
>>83815614
What the fuck, anon? Do some cable management.
>>
>>83815653
>write code
>write code to check if it actually works
>write code to check if those tests are actually good
epic
>>
>>83815677
it's tests all the way down
>>
>>83815681
i feel it wouldn't have to be this way, if langs had proper contract programming tools built in.
>>
>>83815693
but who contracts the contracts?
>>
>>83815708
the compiler
>>
>>83815677
>write code to check if it actually works
Nah you can stop there and still be better than the majority
>>
>>83815708
a small irish man inside your computer
>>
>>83815653
tbdesu i didn't really fully learn about testing until i started working and saw a real test suite and how in depth it was. even then i'm still kinda shit at writing unit tests
and either i'm a dumb bitch or integration tests are a fucking nightmare to write when the APIs you call don't guarantee consistency

>>83815693
as one of my coworkers said "nobody cares how many unit tests you write in performance reviews, move fast, break things, get shit done, get code into production"
>>
>>83815215
>>83815237
It's kind of unfortunate that men have co-opted those pronouns. Even if the person using them is genetically female they're just going to be assumed to be a man with a mental disorder since you can't know the truth without seeing them. Imagine being a woman programmer and having everyone just assume you're some sexual deviant by default. I feel bad for them.
>>
>>83815677
>write test
>it passes perfectly on the first try
>sus.jpg.scr
>intentionally break code
>test still passes
>>
>>83815783
>feeling bad for roasting pussypassing into tech salaries
They deserve every bit of it.
>>
File: index.jpg (6 KB, 220x227)
6 KB
6 KB JPG
Is there something that functions as a “swift primer for people who already know a metric dickton of languages and just want to get up to speed on the quirks and conventions”, as opposed to a “swift primer for non-programmers trying to strike it big with their epic ios app idea”? If I hear another Indian accent I'm going to chimp.
>>
>>83813074
Update;
We just shot the shit about Vim and how Debian > Red Hat, I think a boss asked him last minute to interview me.
>>
>>83815895
data structures / algo books
>>
>>83815916
>Debian > Red Hat
do wagies really use debian?
>>
>>83815268
it's unironically correlated with high iq autism
>>
i have to print a mountain sequence with this function, but it doesn't work if I input negative numbers and natural numbers
i.e. if I input -2 -1 0 1 2 it will print False instead of True
what did I do wrong? i just followed the pseudocode given by a pajeet

def mountain(lst1):
if len(lst1) < 3:
return False
curent = 1
while curent < len(lst1) and lst1[curent] > lst1[curent-1]:
curent += 1
if curent == 1 or curent == len(lst1):
return False
while curent < len(lst1) and lst1[curent] < lst1[curent-1]:
curent += 1
return curent == len(lst1)
>>
>>83815895
If you already know other languages you should be able to just read the language specification to figure out the syntax. You already know how to program and general programming concepts. All you really need is to try and understand new concepts unique to the language / ones you haven't encountered in other languages yet.

I don't know how the swift documents are but it's from Apple so I imagine it's as good as the rest of their dev docs. (pretty good)
>>
Go is awesome, what don't people like about Go? First language I've gotten into in years that hasn't made me flip shit because of fighting the language/ecosystem on stupid things. I'm sure I'll find things I don't like but man, so far I'm a fan. Might have finally gotten over my stupid language-jumping neurosis. I get picking up some language for job reasons, but as a hobbyist, I can't abide by annoyances in the language or tooling.

Haven't even gotten to the concurrency stuff that it's actually praised for.
>>
>>83815916
Noice. Do you think you'll get it?
>>
>>83816006
what's a mountain sequence? from the code it sounds like it should be a sequence that first increases and then decreases. But -2,-1,0,1,2 just increases.
>>
>>83816084
i don't see the purpose of Go when Elixir exists
>>
>>83816114
yes, it's a sequence that increases and then decreases, I mistyped it
the input should've been -2 -1 0 -1 -2 and it shows false
>>
>>83816139
>it shows false
when it's supposed to show true
>>
>>83816104
I don't know, I doubt it, all these interviews have been set up by a recruitment firm and they just drop me in the middle of the process.
I've talked to several people who gel well with me and I know what we're talking about but there's been zero feedback from any of them.
>>
File: file.png (3 KB, 348x35)
3 KB
3 KB PNG
>>83816139
works for me. Are you using it in a weird way?
>>
>>83816006
$ python3 -i
Python 3.8.7 (default, Dec 22 2020, 10:37:26)
[GCC 10.2.1 20201207] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> def mountain(lst1):
... if len(lst1) < 3:
... return False
... curent = 1
... while curent < len(lst1) and lst1[curent] > lst1[curent-1]:
... curent += 1
... if curent == 1 or curent == len(lst1):
... return False
... while curent < len(lst1) and lst1[curent] < lst1[curent-1]:
... curent += 1
... return curent == len(lst1)
...
>>> mountain([-2, -1, 0, -1, -2])
True
>>>
>>
>>83816006
add print statements to figure out exactly what decisions are being taken at each stage. I don't know exactly what is going wrong because this is shit pajeet code. what exactly is the function meant to do? you haven't given a proper specification.
>>
>>83816084
its hated because its the first modern language to actually gain popularity. many other memelangs have tried but ultimatly failed, see >>83816117 for example.
also makes the trannies seethe for some reason
>>
File: file.png (7 KB, 463x125)
7 KB
7 KB PNG
>>83816196
>>83816205
i don't understand why it doesn't work for me
(if I press 1 I input the list)

>>83816216
>what exactly is the function meant to do?
it's supposed to print true or false if a sequence is a "mountain", i.e if it increases and at some point decreases
>>
File: gopher.png (3 KB, 496x403)
3 KB
3 KB PNG
>>83816084
I'm with you on this one. It's hard for me to go back to other languages after being spoiled by Go in several ways.
Not just the language decisions themselves but the tools have only improved massively over time and aren't stopping.
It's just too easy and too convenient to go from idea to static binary solution. It doesn't matter what I'm trying to do, that always seems to apply to whatever problem I need to solve.
There may as well be 0 friction. Any time spent is time I spend thinking about the logical solutions or design.
Not the language, not the tools, not how to distribute. There's no lack of comprehension when reading other people's code either. Every project looks no different than any other project. It all builds the same way. Works perfectly with my editor hooks inherently, etc.

The second you learn Go is the second you can apply Go effectively. I really really like it.
>>
>>83816217
>its hated because its the first modern language to actually gain popularity.
no it was shit on because
>
if err != nil

>literally made for retards
>no generics, lol nvm generics soon!
>>
>>83816246
forgot to mention, if I input 3 then it calls the function
>>
>>83816246
try making it print the list, it's probably an error with how you're reading the list in the first place.
>>
>>83816256
possibly, i'm trying to make it print the list now
I was trying to make it so that a new list called mountain appends the element curent until it is equal to or lower than len(lst1)/2 +1 and then reverse it
I'm a newfag if you haven't figured it out by now
>>
>>83816279
nvm i think i should slice it
>>
File: undefined - Imgur(1).jpg (493 KB, 2214x3072)
493 KB
493 KB JPG
Trying to script a patrol behaviour using a Navmesh in unity. I've baked the navmesh on the ground, I can see it shaded blue. I've attached all the scripts and defined the waypoints. Now i'm getting the error "Failed to create agent because it is not close enough to the NavMesh". I've tried resetting the object's transform position with no luck. Wat do?
>>
>>83816310
rewrite it in rust
>>
>>83816249
I think this is a big reason. A lot of programmers write terrible code and just don't account for errors. Go nearly forcing you to deal with them is obviously going to annoy lazy/bad programmers.

The line from rob gets misconstrued a lot too. For some reason people hear that the language is designed to be simple and easy to understand but treat that as if it's inherently bad. There's just no rationale for that one. People being (ironically) retarded I guess.

Generics aren't really that useful in Go considering it already offers a variety of generic facilities in multiple ways, but people keep demanding it and after several years of practice only now have come up with valid justifications for them which are still pretty limited in their usefulness compared to what's already possible.
Again though, you see people doing the retarded thing of complaining that it doesn't have them then complaining when it does. Almost like the second point. It's just people complaining for the sake of complaining.
Now people can write channel libraries which is cool, but it remains to be seen how cool that is. Obviously it wasn't needed up to this point, but now it's possible so nobody can complain about it anymore. So they have to complain about the fact they can't complain.

tl;dr
bad developers struggle to design programs well in a language made to be simple so they blame and mock the language itself instead of getting good
>>
>>83816353
i am not installing Go.
Take your memelang somewhere else G**gle rep
>>
>>83816084
>want to try out Go
>see pic rel
>no longer interested for some reason
>>
>>83816248
>>83816217
>>83816353
I'm glad that I'm not just feeling some "new language euphoria" or something. It's actually refreshing.
>>
>>83816371
>i am not installing Go.
I'm not telling you to install Go. Maybe you replied to the wrong post.
>Take your memelang somewhere else G**gle rep
Not really sure what Google has to do with this. They're about as relevant to Go as Mozilla is to Rust.
Go has existed on its own outside of Google since its release and has only been further removed from them over time into its own project.

Maybe this is some kind of attention bait?
>>
I can't accept Go because if I did, it would invalidate a decade of pointless brainspace taken up by my shit language of choice.
>>
>>83816084
>>83816248
>>83816353
Alright, you've sold me on it.
>>
>>83816310
>>>/vg/agdg/
also if you're making something inspired by DE, post lore/mechanics
>>
>>83816476
it's an exercise, unfortunately. Can't gib lore, mechanics don't work
>>
>>83816006
def mountain(lst):
for idx_1, (x, y) in enumerate(zip(lst, lst[1:])):
if not x < y: break
rev = lst[::-1]
for idx_2, (x, y) in enumerate(zip(rev, rev[1:])):
if not x < y: break
return idx_1 == len(lst) - idx_2 - 1
>>
>>83816463
https://quii.gitbook.io/learn-go-with-tests
https://gobyexample.com
>>
>>83816165
are you actually interviewing in-person?
>>
>>83816256
>>83816246
>>83816216
>>83816501
ok so this is interesting....
i went to take a shit and then I had the idea of plugging in assert mountain([-4,-3,-2,-1,0,-1,-2,-3,-4]) == True in my test function... and it doesn't return an error?
so it must definitely be an input error
well... i hope my prof won't make me input anything that's a negative number since the tests work somehow?....
>>
File: 1633973368402.jpg (1.44 MB, 2475x1859)
1.44 MB
1.44 MB JPG
>>83815143
you will never be a real girl anon, you're a mentally ill man and people think that you're a freak even though they pretend to use the right pronouns. it's never too late to go back to normality.
>>
>>83816415
When you consider Go's lineage it's not hard to imagine why it's good. It might seems like a "new language" but it's a practically a direct descendant of C that has been refined over and over since the 70s (mainly by the original authors of C). While simultaneously being experimented with and applied on a huge scale by some of the most important projects in computing.
You go from Unix C to Plan 9 C to offshoots like squeek and alef, into vm languages like limbo, finally ending up with Go. We're talking about decades of using a language, finding all its faults, trying to solve them, applying that solution, and doing this over and over again until we end up here.
All the bad ideas dropped, and the good ones retained.

People always criticize their opinionated decisions, acting as if they come from nowhere. But the authors have learned first hand why some things are bad, how to do certain things "right" and so on.
Go is born out of frustration from senior seasoned programmers being frustrated with other languages after years of applying those languages. It got its starting after a group of the ex-Bell labs people were bemoaning about upcoming changes to the C++ standard. They were so sick of it that they found it easier to just continue making their own languages.

It may not be a perfect system, but it's the closest and most complete one I've seen to date in terms of being practical without significant compromises in any single/particular way.
>>
>>83816504
>dep injection is a feature
but why
>>
>>83816525
>i hope my prof won't make me
Understand your mistakes. You're falling for the good boy treats game. It will fail you in the long term, and even in the short term.
Leave it for now if you must, but return on your own volition and understand.
>>
>>83816519
The most recent ones are over teams, before my countries lockdowns it was in person.
>>
Hello

What type variants are?

Have attempted to read many documentation but no avail

Many thank, and continue to produce quality codes
>>
>>83816560
Your tone is cast, and understood, by meme format.
Now, your task is to elaborate your point. Are you a bad enough dude to explain further?
>>
if I open a terminal inside Vim using :terminal it opens right at the middle of the window which is annoying.
Is there a way to resize it so it uses around 1/3 of the screen?
>>
>>83816570
fair...
i don't know why it doesn't work though, I even plugged it in an online compiler and it works there...
>>
>>83816602
In the past, it has been used for nothing but bad circumvention to deal with OOP. I see no objective good for it, so defend its merits to me in a language that supposedly "knows best".
>>
>>83816620
I love vim but fuck the tab/windowing shit.
Just open some new terminals. You are using a tiling window manager, right? Let the window manager handle the windowing.
>>
>>83816525
Are you using command prompt or something, I remember not being able to input negatives on that either when I first started programming
>>
>>83816525
general tip: write tests first, then write the function so that it passes the tests. once you do, try to come up with another failing test (falsifying example). keep doing this until you can't think of any more counterexamples. this forces you to think about edge cases, and you move closer to correctness like a ratchet.

test early, test often. it will seriously make your homework exercises much easier, you will be able to solve them almost on autopilot.
>>
>>83816645
yeah, i am using cmd

>>83816652
hmmm interesting... our prof told us the exact opposite lol, write the function and then write the tests
I will definitely keep it in mind though... I don't want to have to rewrite my functions in the future...
>>
>>83816620
If there's not a Vim thread up to ask in you could probably make one. Only saying so because you'll probably get better answers there.
But there's a number of plugins that deal with pane management.
Like this one (for neovim/lua) https://github.com/beauwilliams/focus.nvim/blob/master/DEMO.md#opening-an-auto-resizing-terminal-window-by-specifying-its-location

You can try to read how they work and implement a command or whatever that acts exactly how you want it to.
I do this
command St split | terminal
so that :St opens in a split, you could extend this further to split the current pane the way you want, resize it the way you want like via a percentage, and then replace the pane with the terminal.
>>
>>83816668
not who you're replying to but it's called Test Driven Development (TDD), probably ignored in your class as they're just trying to teach you the basics. But, a lot of people think that even at an early stage, thinking this way (write the test first, the test fails because no function, write the simplest function to make the test pass, make the function do what you want it to, make sure the test still passes, refactor, ...) is the way to go. It feels a bit silly upfront sometimes when you have "an idea" of what you just need to write, but at the same time, nobody anticipates bugs (or they wouldn't exist.) Test-driven mode of development ensures that you are not writing nonsense.

Also I just discovered
go test -cover
which is neat but I don't really understand how it's giving me the metric. Still, glad they were thinking about this as an addition from the ground-up. Not sure how useful it is in practice or how many people use it though.

https://go.dev/blog/cover
>>
>>83816592
good morning sirs
>>
>>83816668
> prof told us the exact opposite lol, write the function and then write the tests
he's full of shit. look up "test driven development". it isn't always the right thing to do, but it will work perfectly if you're doing homework problems.

look up "pytest", it makes things much easier. the workflow is:

>write a test
>run the test suite
>see that it fails for the right reason
>write the function
>run the test suite again
>if it all passes -> write a new test, repeat
>if it fails: fix the function and run the test suite again until it all passes, then write a new failing test and repeat
>repeat until you can't think of any more counterexamples, i.e. the function is as correct as you can make it

when you get used to this, it will be like a ~30 second cycle. the tests will make sure you don't re-introduce errors as you work. you will get closer and closer to correctness like a ratchet. also: it is important that you actually run the tests and see them fail deliberately; this is to make sure that the tests are actually testing what you think they are. it is easy to accidentally write a test that passes for the wrong reason.

start with simple case and then move towards more complex ones. like: empty list, list with one element, list with two equal elements, list of [0, 1, 0], list of [0, 0, 0], list of [0, -1, 0], etc.
>>
>>83816769
>>83816786
thanks for the tips anons
I have a seminar and lab tomorrow.. i'll put this to good use
for now I think I'm just going to get some shut eye... I've been coding for 6 hours now...
>>
What part of boost is worth using? Is the boost hate on /g/ a meme and I would be better of using something else?
>>
Another cool Go thing I found out, apparently each directory is allowed to have only one package, except in one case. You can also have
pkgname_test
, which you can use for tests so you don't have access to internals, as you would if you stuck tests in the
pkgname
package. Neat!
>>
Anybody here have experience parsing a epub chapter from html to pages as plaintext?
>>
>>83816845
Watching other people learn Go is very interesting, it's like they come from a world where their programming languages are designed to make it hard to work on large projects.
>>
>>83816923
C family + java people are just in a bubble.
A lot of people have no clue how nice programming can be, and that you don't have to put up with bullshit "standards" of other langs.
>>
>>83816830
>Is the boost hate on /g/ a meme
You'll have several days to figure this out for yourself while waiting for your programs to compile.
>>
>>83816923
Well, I'll give you a little context. I've toured a bunch of language.
my experience is C: makefiles and ... stuff, a lot of fighting with the language/stuff, no real package management. Duct tape things together, cross fingers.
C++: Kind of the same, but more duct tape. If you're careful, this works in larger projects, but it requires constant vigilance.
ruby, python, perl: various "high-level" advantages, but various drawbacks in regards to performance, portability, package management and reproducibility. Also a lot of retarded feelings of "you can do this in so many ways!!" as if that's a good thing, rather than an absolutely terrible thing.
Haskell: well, very different altogether. But again the duct-tape problem with using libraries. Stack is a red herring but as soon as you try veering off the Stack packages, you're fucked.
Java: Nah.

So far, it seems like Go stays out of my way, and has a good package system for developing larger systems.
I'm completely transparent as being new though, so I welcome criticism. I'm like basically an eternal new user, with shallow understanding of a bunch of languages.
>>
>>83816830
Boost is a great library, use it if you wish.
>>
>>83816845
One of my favorite features for sure. Makes black box testing so much easier to manage. Tests just ship in the same directory as the actual code but don't get internal access so you can't cheat the tests or public API. You have to do it right. This has helped me reduce and refine my API surface many times. I'm talking cutting LOC in half for the entire package.
>>
>>83817004
What kind of 3rd party library support does GO have, can you even use the Windows API functions in it?
>>
>>83817025
https://awesome-go.com/
>>
>>83817025
Go lets you define functions in C and assembly so you can write wrappers and interfaces with non-Go libraries pretty easily.
If the first party library doesn't already wrap some call for you
https://pkg.go.dev/golang.org/x/sys/windows
you can really easily just load a dll and call the method yourself manually the same way they do.
>>
>>83814664
>auto main() -> int {
> return 0;
>}
just why
>>
>>83816543
>Plan 9
lolwut
I literally thought this was a meme thing like Temple OS because of a friend
>>
>>83816845
>create arbitrary limitation
>allow exception to arbitrary limitation
Soooooooo fucking neat.
>>
>>83817069
sepples is a blobby mass that just haphazardly absorbs features from better langs, while not actually thinking about them
>>
>https://old.reddit.com/r/cpp/comments/q6tgod/c_committee_polling_results_for_asynchronous/
>the absolute state of how "consensus" is handled
>our process is broken. but we're under ISO so it can't be public and we can't fix it haha
>we can't actually implement TLS because if there's a security update we don't know if we'd break ABI and everyone's too scared of that
what a dumpster fire, no wonder people are moving on
>>
>>83817075
Pike used to be a FOSS personality before he sold his soul to google
>>
>>83817081
Doesn't seem arbitrary, seems very clean to me. Which also seems to go with the clean "you can't do this 30 different way, perltards" philosophy. A philosophy that leads to good meta-programming tools.
The single exception being tests is great, I don't see the problem.
>>
>>83817075
Plan 9 and Temple OS are both real operating systems.
The Plan 9 research papers are very good imo, and the system design itself is at least better than Unix.
http://doc.cat-v.org/plan_9/

I think the merits of 9P are indirectly validated by the success of HTTP and REST. They had this in the 80s except more efficient and flexible. And people are only now coming to see it as better than the more modern solutions. Kind of silly.
Not to mention the rest of their designs. Worth reading about.
>>
>>83817084
some things are useful
using trailing return type for no reason is just stupid
>>
>>83817092
what does TLS mean in this context?
>>
>>83817131
what else could it possibly mean
>>
File: hehe.jpg (182 KB, 722x507)
182 KB
182 KB JPG
>r*ddit
>>
File: 1623179866114.jpg (725 KB, 940x1280)
725 KB
725 KB JPG
>>83816786
>Write shit code that needs to constantly be tested and too lazy to just run it
>Somehow not writing shit tests that don't test right when writing double the code
Good meme design
>>
>>83817119
also /proc
>>
Python compilers be like "your code with 50,000 dictionary element typos looks good"
>>
>>83817152
i agree but this is actually the only place you get to see the c++ committee and group chairs' idiocy on full display in public
>>
>>83817156
3/10, good use of anime but use of quotes to mischaracterize gives it away
not good, but not completely failing
>>
File: 1617683317178.png (376 KB, 456x674)
376 KB
376 KB PNG
>>83817208
Did you test that response, did you test the test for that response?
>>
File: I had enough.png (33 KB, 509x411)
33 KB
33 KB PNG
>Study three semesters in Java
>Now studying functional programming (SML/NJ)
>Fucking hate it with every fiber of my being
How or why the fuck should I implement algorithms in this piece of shit where I don't even know how to debug it? I knew I'm retarded and I need more practice in data structures, but this shit makes me feel depressed.
>>
>Python compilers
What did he mean by this?
>>
>>83817217
>where I don't even know how to debug it?
print statement debugger tard detected

'213
0/10
>>
>>83817217
>getting filtered by ML
how
>>
Let's lightened up the mood /dpt/!

Post some music that helps you program or gets you bramblin for some stroppin codes!

https://www.youtube.com/watch?v=b1z4JfxFb6c
>>
>>83817253
the professor is trash and expects me to translate all the java code i wrote to ml.
>>
>>83817275
https://www.youtube.com/watch?v=RO4MaP1NUJQ

Every letter is a code, error: Oops!
>>
>>83817281
that is retarded.
But you're better off just re-implementing the solution instead of trying to port it.
You'll get lost in bullshit about how to translate java concepts, instead of just thinking about how to apply ML/functional concepts to solve things.
Glad i didn't fall for the CS meme
>>
>>83817103
Its not clean if you make a rule then immediately break it. It's just there to enforce "only one way to do it". So all code looks the same regardless of who made it. That doesn't make it "neat". Any retard can say "here is the one way to do it" and that be set in stone as the ultimate truth. There is no beauty in that, its just dictation. Its a good thing, but its not inherently beautiful or ugly. Its nothing.
>>
File: big wink.jpg (117 KB, 1024x680)
117 KB
117 KB JPG
>>83817327
>>
File: 1539540942120.png (341 KB, 657x527)
341 KB
341 KB PNG
>>83817318
I wish I learned ML before doing imperative programming. This feels so backwardly retarded
>Glad i didn't fall for the CS meme
It truly is an expensive meme...
>>
Go wins again
wtf maybe I should learn Go?
>>
>>83816006
in haskell this is just
mountain ns@(n:_) = lhs <> rhs == ns
where d = length ns `div` 2
l = iterate succ n
lhs = take (succ d) l
rhs = reverse (take d l)
>>
>>83817411
yeah well what is it in Idris big guy
>>
>AlphaGo beats all baduk masters
>Go programming language
>gf leaves me after seeing my shitty code
makes you think
>>
Haskell wins again
wtf maybe I should learn Haskell?
>>
>>83817375
I'd probably look up solutions for whatever you need in haskell, since vanilla haskell and ML are basically the same, so there shouldn't be much problems, beyond
maybe having to look up autistic haskell operators
>>
>>83817397
Learn Lisp.
>>
>>83811963
Haskell*
>>
If your favorite programming language were not a programming language, but a food/drink, what would it be?
>>
>>83817411
>`div`
you just want to be different so hard
>>
>>83817572
t. brainlet who doesn't know what she's talking about
>>
>>83817572
>noooo you're not allowed to use this feature
seek help
>>
>>83817411
*Main> mountain [1,2,3,2]
False


Reminder that if you don't understand the problem you're allowed to ask or google it
>>
>>83812446
yeah like how it's possible to get free fiat by checking every car door and if it's open taking whatever is inside. it's theft, retard. you're going to get in trouble
>>
>>83816990
>filtered by build systems and package management: the post
>>
>>83817635
>inputs a non-mountain
>surprised it gives her False
>>
>>83817690
This is your second reminder that you're allowed to google what a mountain sequence is
>>
>>83817498
>Scheme
Ham, spicy relish and cheese sandwich with a glass of mango juice.
Not actually that interesting but quite different from what most people like.
>>
>>83817696
maybe I don't want to?
>>
>>83817498
snake
>>
>>83817729
Then I can tell you, fren. It's a sequence that increases monotonically up to a point, then decreases monotonically from there.
>>
>>83817674
being filtered by basic functionability
ok I guess I'll be filtered by that
>>
>>83817742
still not googling some of the words you're saying
>>
File: implying.jpg (7 KB, 259x194)
7 KB
7 KB JPG
>her
>>
File: ice sandwich.jpg (49 KB, 730x400)
49 KB
49 KB JPG
>>83817498
>>
>>83818208
FORTRAN?
>>
What's the comfiest compiled language
>>
>>83816006
in haskell this is just
mountain xs = and (lhs <> rhs)
where lhs = takeWhile (==True) (inc xs)
rhs = case dec (drop (length lhs) xs) of
[] -> [False]
r -> r

(inc,dec) = (f (<), f (>))
where f = (<*> tail) . zipWith
>>
>>83818219
MUMPS
>>
>>83818226
haskell
>>
>>83818226
Go
>>
>>83818226
C#
>>
>>83812454
>why did the Rust program keep debug breaking?
>>
>>83818288
There is nothing comfy about C# wtf are you talking about
>>
>>83818226
D
>>
>>83818049
>t. her
>>
File: laughing whores.jpg (12 KB, 300x168)
12 KB
12 KB JPG
>>83817275
https://www.youtube.com/watch?v=5dbCN2yE_7U
>>
>>83818226
C++ once you know what you're doing. C# doesn't really count as compiled it's only compiled to bytecode then interpreted like Java is.

It has to be C++ honestly, the code you write just looks fucking awesome. And that feeling you get when you use some feature with tricky syntax that saves a bunch of typing or makes the function shorter.

Superb
>>
>>83818298
It just is ok?
>>
>>83818407
it's pretty opposite of comfy
jagged and sweaty under a bunch of blankets but the blankets are all tied up and you're half-asleep but too tired to deal with it so you just try the best you can to fall back asleep but you're all sweaty also your pillow is shit
>>
>>83818425
what is the pillow in this analogy
>>
hmm I wonder if the tranny in here is one of those hacktivists leaking random famous people's emails?

how many uber nerd trannies can there really be?
>>
>>83818407
The thing about C# that throws a lot of people is that it just isn't as clear how to design programs when using it. At least that's my opinion. So you're like looking at it for a few minutes hoping to discover that perfect layout but it's harder with C#.

So you end up not worrying about it and passing handles (pointers) to objects into class methods like you would in C.

typical C# class method header:
public bool DoSomething(HANDLE pointerToObject, HANDLE pointerToSecondObject)
{
//does stuff to your pointerToObject and then back in the calling
//function you just move on, terrible fucking design, it's basically C with classes
}
>>
>>83818435
>how many uber nerd trannies can there really be?
a lot, they've started taking over the speedrunning community in recent years, which is pretty nerdy and autistic
>>
>>83818486
Are they also Jewish or something? Why would they have the explicit purpose of turning America into an authoritarian state? No one else in the world has such rampant disregard for the well-being of themselves and those around them.

But, back to programming.
>>
>>83817275
https://www.youtube.com/watch?v=120HFjKPuJ4
https://www.youtube.com/watch?v=4UBI3XATAFY
https://www.youtube.com/watch?v=4AFdhhNSq38
https://www.youtube.com/watch?v=8mkofgRW1II
https://www.youtube.com/watch?v=VMxN6xRlxic
https://www.youtube.com/watch?v=8CvqmD0CZao
https://www.youtube.com/watch?v=3hIa271Idtg
>>
might be a dumb question but can you link cuda libraries without having to use nvcc to build the entire project? like can i create a project in cuda and then just export a library that can be used by a project in gcc/clang/whatever
>>
New thread:
>>83818640
>>83818640
>>83818640
>>
>>83818540
https://www.youtube.com/watch?v=ZBjIa6obU5E
https://www.youtube.com/watch?v=-ZdLbiF9gCo
Some more to send off a dying thread.
>>
>>83818370
This post is inspiring for some reason.



Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.