Old thread: What are you working on, Sup Forums?
/dpt/ - Daily Programming Thread
Other urls found in this thread:
youtube.com
github.com
twitter.com
First for web development
first for superior OOP programming style
Sorry /dpt/, I might learn the web dev meme
Apparently it makes you like 5 times more employable
C++ and lua game engine. Its going pretty well you could even make pong with it
Turing machine ... screensaver. For... uh... science.
In case you migrate over, I just want to make sure you see me blowing you the fuck out
it even pays much better, at lest in Europe
Delete your post. You're fucking embarrassing yourself.
Okay my backpedaling friend
>Both of them have a reference to the same C object
>Both of them have a reference to the same C object
>Both of them have a reference to the same C object
>Both of them have a reference to the same C object
>Both of them have a reference to the same C object
He just doesn't want to admit that he learned that's not how OOP works today
...
>do_something()
No such method exists for class 'A'.
Baby doesn't class members work
He said it was a typo, so I'll be nice and give him that
ffs OOP is a tool its good for some things and bad for other...
I'm going to leave this here:
youtube.com
don't bring that shit in the new thread, ffs
...
WHOA HOLD UP AND REFRAIN FROM DOING THAT HERE
WE ARE NOT SUPPOSED TO MAKE ANY SENSE
Thank you for not using an anime image
No, everything must be good or bad.
Preferably, things that are bad are completely bad because of a small issue I have with it.
Things that are good are things I am already predisposed to like, based on a sense of superiority in using that thing via attribution to individuals I respect or an image I would like to portray.
is there a C++ book about data structures beyond STL ? like all kinds of trees and shit
Hello, I'm learning C++ but I can't past pointers and anything related to memory management. Any good book that ELI5?
Thanks
>ELI5
>>>/reddit/
"Pointers on C".
>ELI5
?
>Pointers on C
Thank you
Explain like I'm 5
I would recommend using a language-agnostic data structures book and convert the examples to C++ on your own.
What specific questions do you have?
This, if you are going to just copy paste c++ code from book might as well use library.
I get that you can get the memory address of a variable but how is it useful in real life
> if you are going to just copy paste c++ code from book
I just want to learn from it, that's all
on a recent job interview I was owned with a question like that because I implemented a recursion to build it which they didn't like and I couldn't immediately show something else, and I guess my c++ style was shit too
Very useful. The most important reason for pointers is that they are the only way to access dynamically-allocated memory. Pointers are also used to avoid copying a large piece of data when passing it to a function, but that's better done with references in C++.
Pass by reference to functions
What was the question?
Pick up The Algorithm Design Manual. Then read Cracking the Coding Interview to make sure your knowledge is up to par.
>Cracking the Coding Interview
God, I despise whiteboard "coding"
I wish interviewers would just Google my name, check out my github, check out my kernel patch, ask my previous employers about what I did at the company instead.
I have a fucking master's degree and 5 years of experience as a software developer (7 if you count part-time jobs too), why the hell do I have to prove to you that I can reverse a string without invoking any standard library functions.
>God, I despise whiteboard "coding"
Same, but the reality is that coding interviews are an important barrier to getting a job and thus need to be diligently prepared for.
References are just syntactic sugar for passing a pointer to a function and automatically dereferencing it. You probably know that, mentioning just in case.
Alternatively you could not be a cuck and get into cyber security. Even more employability and you don't have to be a webshit
>Even more employability
Preach it brother, went into InfoSec and got an internship right after my freshman year of college. Now I'm lined up for a full-time job once I graduate.
And references arent replacement for pointers since you cant dynamicaly allocate memory.
apparently it's pretty standard, to build and populate some fucking tree thing but I don't remember the exact question
like I said, I knew what it was in theory but I never fucked with something like that in an actual program so I was slow, too
>why the hell do I have to prove to you that I can reverse a string without invoking any standard library functions.
post your code for it without using array traversal loop.
size_t strrev(const char* input, char* output)
{
if (*input != '\0')
{
size_t n = strrev(input + 1, output);
output[n] = *input;
return n + 1;
}
return 0;
}
wow nerd just call .Reverse() on the string
Nice.
Sorry for the delay, I didn't see the post immediately and I had to test if it actually worked so I didn't make a fool out of myself on the Internet.
You're missing the point of the original post.
yeah, and you should have told that user that he's a nerd and just to use the built-in function
>telling the interviewer that he is a nerd and doing the opposite of what he is asked to do
This is why it is so hard for you to find a job, Sup Forums
>not TCOptimizable
In2theTrash.exe
>You're missing the point of the original post.
you never know, user
it's very possible that if you were asked this question in an interview that the only acceptable answer is
>just use .Reverse()
Teach us your way then, senpai. Show us the code. In C, preferably.
>No, everything must be good or bad.
>Preferably, things that are bad are completely bad because of a small issue I have with it.
>Things that are good are things I am already predisposed to like, based on a sense of superiority in using that thing via attribution to individuals I respect or an image I would like to portray.
fuck
>without built-ins/standard lib explicitly stated
>just use reverse :^)
k
There is no String.Reverse() in C, so no, that's not the only acceptable answer, there isn't even a string type. The question was clearly "reverse a string without invoking the standard library function"
>I've never been in an interview!
it's a trap, you're supposed to do the best thing and prove to them why it's the best thing in your opinion
>I would recommend using a language-agnostic data structures book
I want to learn coding and this seems like an amazing idea if possible
can you recommend a book or explain further?
I think he's just jealous. Beautiful recursive solution user.
See
Thank you.
I'm not him but Introduction to Algorithms is a classic introductory book.
Ironically, this is why whiteboard programming sucks. I had to test it to know that it for sure worked, since I don't have a slightest idea how to formally prove my routine using Hoare logic.
thx user
fuck off nigger
>fuck off nigger
That's based Kenny faggot
literally who
Hello newfriend
>based
You fuck off, too, cuck.
A tripfag from two summers ago.
Python guy who used to help a lot in the DPT. He left us when he started working at Edmodo
>Python
>tripfag
Suddenly it all makes sense
>can't even reverse a string in c
>can't even average two ints in c
>thinks his opinion matters
webcuck, please
Meanwhile he's making 6 figures...
who are you talking about?
(You)
>buys a tesla
>"look Sup Forums no hands"
>dies
I've posted here for over 2 years now.
I make six figures and I don't resort to tripfagging.
Speaking of Python, what do you guys think about BeautifulSoup? I started using it a few days ago and it looks pretty interesting. Do you guys have any idea for projects I could use it?
I wanna buy a new laptop for dev
I think im gonna get a mac
>Stop working on unofficial API because it's functional and competent, but nobody uses it anyway
>The data source of the API is changed drastically
>My decision to write the entire API as statically typed objects immediately comes back to haunt me as ~4000 lines of code-generated codebase becomes entirely redundant
Fuck, why didn't I just wrap the entire thing generically and let the devs on the other side deal with it.
Who else /LackOfForesightLeadingToImmenseRegret/ here?
BeautifulSoup is great.
However, you should be using APIs if they are available for what you're trying to do.
Webscrapper of some sorts, obviously.
Are you an OpenDNS developer?
how does c++ linker/compiler know where to find header ( aside from /../../goo.h)
also where does the linker now where to look for cpp files when theyre in separate folders ?
Sup Forums image scraper
>scraping the images when the Sup Forums API exists
No I'm just some self-taught bedroom programming NEET working on some garbage .NET API that about 3 people have used since I open sourced it about 2 months ago.
>how does c++ linker/compiler know where to find header ( aside from /../../goo.h)
>also where does the linker now where to look for cpp files when theyre in separate folders ?
The linker doesn't look for cpp or h files, the compiler does. It looks in a default set of directories for include files, which you can override by setting -I and -i. As for source files (cpp), if you supply the path to them rather than just the filenames, then the compiler will be able to find them.
I want to earn some money on the side with fixing computers. but how the fuck do I get the word out and advertise my services? I distributed over 500 flyers so far in my neighbourhood, im on google maps and Im on the google index. And Im much cheaper than my competitors and I have better opening hours.
so far nothing.
Making myself a personal program that searches Sup Forums archives, as there is no archive that searches all boards.
Last thread some guy made fun of me for not using an API? I'm new to programming. What the hell is an API? Does the API work on Foolfuuka or just Sup Forums? Some code below:
System.out.println("What board would you like to search?");
Scanner input = new Scanner(System.in);
String board = input.next();
System.out.println("What would you like to search for?");
String query = input.next();
URL archive = new URL(archives.get(board) + "/" + board + "/search/text/" + query);
//System.out.println(archive);
Connection connection = Jsoup.connect(String.valueOf(archive));
connection.userAgent("Mozilla/5.0");
Document doc = connection.get();
Elements elements = doc.select("div [class=text]");
System.out.println(elements);
Sample output: What board would you like to search?
v
What would you like to search for?
mario
>>345867798
Did... Mario just kill a man?
>>345868386
>>345868946
>purchasing the game to make them think this is what Paper Mario fans want
Please
Tell your friends about it
Also, I don't know Javascript or HTML.
Website, approach local small businesses to provide them with tech support, tell your friends and family to tell their friends and family.
Nothing more than proactively reaching as many people as you can and waiting for some bites.
well then give a better idea i think its a fun excersise
so when I include a header, the compiler looks for the header in the given directory then, will look for the source files which i somehow (how?) supplied
now two more questions: first, I have to use a build tool after even like 5 modules right ? otherwise it wont be doable to compile from hand ?
also i forgot the second question while typing this
I did. but my whole point is to try to acquire customers without any vitamin B.
I did everything except approaching the business. thinking of buying a small add in the local newspaper.
Jesus christ, user.
github.com
>so when I include a header, the compiler looks for the header in the given directory then,
Yes
>will look for the source files which i somehow (how?) supplied
Arguments to the compiler, for example
gcc -o executable file1.cpp file2.cpp ../file3.cpp somedir/file4.cpp
>I have to use a build tool after even like 5 modules right ? otherwise it wont be doable to compile from hand ?
It's easier to use a build script, like Makefiles, yes. It's not impossible without, but it takes a lot of time and especially if your project is expanding and/or you're collaborating with other people.
1. how many competitors are in your area
2. what kind of business are they doing? if they have shops maybe scope outside one you think is popular for a few hours to judge traffic.
computer repair biz isn't quite what it was... people just toss their laptops and get new ones now.
I don't know what this is... I don't know what JSON is...
I don't even know if it works on foolfuuka archives, or just Sup Forums. It needs to work on all Sup Forums archives like rebecccablacktech.
thanks for the answers, I originally thought the compiler would somehow on his own look for source and header files
are there any beginner projects that you recommend for cpp learners comming from a java backround ?