Currently learning python as I want to rebrand to backend in the near future
Gavin Ramirez
how do I check an array of random integers for duplicates and place in a new random replacement in java? These duplicates are throwing off my array searcher
current code for loading the array is just this.
for (int i = 0; i < numbers.length; i++) numbers[i] = randomNum.nextInt(100) + 1;
I assume i will need another loop or two to go through the array again and check if a given random number is already in the array but I have no idea how to go about doing that
>I assume i will need another loop that's O(N^2), you don't want that. >but I have no idea how to go about doing that what? what do you mean? you just fucking said what you'd have to do. You'd have to loop over the array again. What the hell user. Go ahead and implement this O(N^2) solution so you can at least be sure you can do stuff. And then use a set. Java's a big boy language. It's got a set you can use.
Aiden Cook
The most powerful programming language is Lisp. If you don't know Lisp (or its variant, Scheme), you don't appreciate what a powerful language is. Once you learn Lisp you will see what is missing in most other languages.
Kevin Martin
Lisp is the most powerful programming language.
Noah Sanchez
>And then use a set. Java's a big boy language. It's got a set you can use.
I haven't gotten to that stuff yet. If it wasn't already obvious I'm just starting out. taking a course at college and we haven't even gotten to calling methods from other classes yet. we are just beginning to play around with 1d arrays.
accounting for duplicates wasn't part of the assignment though, I just wanted to see how it might be done.
>is perfecting a AI waifu. my dream programming lang comes first which means exploring the field of langs, learning type theory, math, compilers and so on.
Caleb Gray
I've been working with vue.js for a while but now i am out of a job. Most companies in my region only want react.js programmers. Can anyone recommend a decent but quick crash course on react.js that i can do in a week or so? I have a few interviews lined up next week and i dont want to fuck it up.
you've got an ordered collection with n members. in the worst case, how many steps does it take to get the nth member of this collection? arrays: O(1). it's one step, regardless of the index. You calculate an offset into the array and dereference it linked lists: O(n): it's as many as n steps, because you have to start at the beginning of the list, then get the next cell from that, then the next cell from that. now suppose you want to print out any members of the collection are present in the collection more than once. One way to do this is to loop over the array, and within your loop, once per each member of the array, loop over the array again, to look for other members of the array that match the member you're looking at currently in the outer loop. this whole process takes N steps for the outer array and N steps in the inner array, or N*N altogether, or N^2. So this algorithm is O(N^2). Which tells you very quickly that if you've get an array of 100 elements that your innermost loop is going to spin up to 10k times. This gets expensive fast.
for a better explanation, get an algo book.
Nathan Moore
>finished the in-class assignment >also finished the extra in-class assignment if we finished that one >also finished the chapter project if we finished both >checked email and worked on my math homework for the last 40 minutes of class So this is the power of Java...
Anthony King
>bragging about babys first CS101 assignment oof
Jayden Scott
>bragging I'm not bragging. The class is easy as fuck. Too easy.
A month in and we're "learning" about if/else/else if.
I should've tested out but I already skipped 3 pre-req classes (this is supposed to be a second year class) and they wouldnt let me try
Luke Cook
Thanks user
Kevin Torres
How do i get started making artificial intelligence? Any good books/tutorials you reccommend?(anything not made by pajeets is good at this point)
Jason White
youtube
Levi Watson
So i'm reading SICP and doing the exercises in scheme, should i continue doing that or is using common lisp better?
Joshua James
I cant find anything, just trash made by poos which is why i asked here. I really want to make one so i can build robots but i dont know where to start
Sebastian Morgan
upgrade to a modern language like python 4
Aaron Collins
What framework should I learn for graphical programs on linux using python?
Gabriel Baker
Qt
Jose Brown
r8 my sepples #include #include
using namespace std;
string operator % (string src, string insert) { if (src.length()
David Ross
I hope I die soon.
Caleb Reyes
do it fa git
Justin Harris
>using namespace std; fail >no constexpr fail >no friend please at least pretend to have friends in your code, loser >this horrible idea again scanning a string at runtime to find its {}, and to possibly throw an exception about it, is dynamic language shit. You are writing C++, son. What's wrong with you? >hey x dude 42 gj on not fixing the "hey x} dude 42" bug. >int main() { >not: auto main() -> int YOU FAIL, SIR YOU FAIL
Kayden Nelson
>not fixing I mean to say "fixing", without the not. it was a good job, to fix that.
Dylan Phillips
How do you do it at compile time, douchebag?
Asher Stewart
I'm gonna start applying to Erlang jobs this week.
Oliver Green
>being this rude I'm not going to tell you.
Colton Carter
Also the 2nd argument and onward aren't necessarily known at compile time in its intended use case, you despicable piece of nigger shit.
Cooper Bennett
Good luck convincing people to use your shitty program when it's hardcoded to one language. std::cout
Nolan Long
>args aren't known and? How does this excuse you looping over the constant format string at runtime again? >despicable piece of nigger shit this is a whole lot of nasty words for "my code is slow and I'm pretending to not feel bad"
Jeremiah Hall
That would be nice if I were just printing to stdout but unfortunately I'll need to use the formatted string in the program when I use format for real.
Charles Young
>he cares about catering to notEnglish speakers disgusting.
Luke Sanchez
have sex
Gabriel Russell
thank you for posting Chihaya
Liam Robinson
Will SPARK revive Ada? Should I learn the lang?
Carson Reed
Anyone have experience with interviewing for a new job after 4+ years of experience? I'm getting bored with my job but I've forgotten most of the finer points of data structures+algos, wondering how important it is to brush up on this stuff in comparison to a new grad for interviews.
Parker Ross
I wanna paizuri Chihaya.
Andrew Peterson
>are there any jobs with it? Nope, it's a shitty hipster language.
Luis Wilson
SPARK has been a thing for over a decade. Just like Ada it fills a niche and it's used with Ada since SPARK 2014. You're not going to use SPARK unless you're in an industry that requires it. It's like writing Ada, but with more restrictions on what you can and the next SPARK revision is getting a BC. HAHAHAH.
Jaxon Morales
So, is there any decent way to make a bit of part-time/side money programming? I don't want to do it as a full-time job because I'd burn out on it and not want to work on my own projects, but I could also use a little extra income.
Nathaniel Foster
No, Ada is a meme only used in niche industries for regulatory reasons.
Samuel James
Yes but you'll be a webshitter.
Jackson Rodriguez
user, please, he asked for a DECENT way.
Owen Diaz
i want to nakadashi chihaya
Sebastian Hall
Use Common Lisp.
Tyler Gray
everyone asks this shit now, just read the first few chapters dasgupta's algorithms book and work through the basic questions in epi or some leet code. you can get back up to speed in a month or so
Ethan King
Working through the little schemer in JavaScript
Wyatt Peterson
Why did C never adopt RAII?
Logan Gutierrez
You should be using MIT Scheme. The entire fucking reason the language was chosen for the book was for its simplicity. That it doesn't have all the bells and whistles of other languages is a GOOD thing.
When you read SICP, you're not learning a programming language. If you want to learn a programming language, just go pick up Java for Dummies. No, SICP teaches PROGRAMMING. After you've read SICP, go ahead and start using a different language, like Common Lisp. But that's not the point of SICP.
SICP just teaches you recursion and ((((((((brackets))))))))))
Robert Richardson
Because it doesn't follow C's design principles and what C programmers are looking for out of the language.
Matthew Hernandez
that book is a waste of time. t. lithpfag
Gavin Morgan
>you're not learning a programming language correct, it doesn't matter what language you use so just use (common) lisp
Carter Parker
>what C programmers are looking for out of the language. memory leaks? RAII would be an optional feature. I don't get why you people are so stubborn in your ways.
You don't seem to understand C at its core. I don't want your invisible state changing bullshit, and I don't want seemingly simple operations to generate an explosion of object code. Complaining about C being too simple and not doing enough shit for you behind your back is completely missing the point of C.
Landon Phillips
Alright thanks, i'll just finish the book using scheme and learn common lisp later then.
Grayson Young
>C at its core. Nobody understands C at its core. Here's a fun exercise (you can google for the source and solution): write a C function that returns an integer to the caller, with the following constraints:
1. the function source code text is self-contained (no access to external code, including the standard library) and is shorter than 700 characters;
2. the function has no state and no input whatsoever (no static variables, no parameters, no access to globals, no access to the environment);
3. the function uses only the features of the C language specified in any version of the ISO C standard, its output does not depend on unspecified or undefined behavior, and its code does not exceed any minimum implementation limit;
4. the function can be compiled in more than 700 different ways, each corresponding to a single invocation of GCC/x86 64 (version 8 or later), so that it returns more than 700 different values;
5. the used GCC command lines do not include any -D or -U options (including synonyms, i.e., no explicit fiddling with macros), use no assembler options (i.e., no fiddling with assembly code), no linker options (i.e., no fiddling with object files and libraries), and no directory options (i.e., tools, header files and libraries will only be searched in standard places).
Kevin Russell
>picture of a fractal >"it basically looks like a pair of lakes" >OH YEAH MOTHERFUCKER >YOU THINK YOU KNOW WHAT THIS FRACTAL LOOKS LIKE >ZOOM IN 6000x ON THIS SPOT RIGHT HERE >DIDN'T EXPECT THAT DID YA wow C is so hard and yet people get so much done in it. very mysterious.
Nathan Scott
I'm learning Kotlin
Tyler Peterson
Huh?
Alexander Roberts
waste
Jason Morales
I'm reading a book on how to implement a compiler/interpreter so I don't feel bad for dropping out of college and ending up in a level 1 helpdesk nightmare.
Cameron Williams
y tho
Adam Sullivan
Learn Lisp.
Charles Flores
Can I use Lisp to make an Android app?
Dominic Gonzalez
Just learn how to do networking and you'll be okay.
Caleb Hill
yes just use ECL
Colton Gonzalez
This, but social networking if you want a good job.
Austin Carter
yikes
Joshua Morales
do both and while you're at it, some cybersecurity bullshit
Leo Gutierrez
Do I need a iq above 100 to learn programming?
Nolan Fisher
wukix.com/mocl is a product for it, but you still write the GUI in in a platform-specific language. Mobile development sucks desu. If you want to involve Lisp, do it server-side and just write a little mobile frontend.
Easton Cruz
You need an IQ above 100 if you wish to become an expert programmer. If you wish to code apps, then 80 is probably more than enough.
Hudson Sanchez
No. You just need to stick to it, get past the learning curve, and after you spend at least 100 hundred hours and have a grasp of what programming actually is then you can decide if it's something you want to keep doing or not.
Adam Ross
See
John Hughes
How are you anons preparing for ICPC? I only solve problems on Codeforces. So any specific tips?
Lucas Ramirez
I don't think I can make it to this year's Insane Clown Posse Conference. Gonna miss getting down with the clowns :-(
Chase Gutierrez
That's fine, more girls for me.
Benjamin Robinson
What the fuck are you going on about, you delusional sepplescuck?
Andrew Kelly
I'm writing a text editor with PureScript to erlang compiler and no one can stop me.
Kayden Thomas
sounds esoteric
John Harris
In java, what's better to use with setters when instantiating and object with user input: Console or Scanner?