/dpt/ - Daily Programming Thread

What are you working on, Sup Forums?

Old thread: Recommended viewing:

youtube.com/watch?v=3U3lV5VPmOU

youtube.com/watch?v=uqsZa36Io2M

youtube.com/watch?v=hIZxTQP1ifo

Other urls found in this thread:

en.cppreference.com/w/cpp/header/iosfwd
careercup.com/resume
pastebin.com/u5G6mVfT
twitter.com/NSFWRedditVideo

give me answer my friends

What inane things can we talk about for this thread

How do you teach pythons?

I want to make a markov chain. What language should I use?

why my language is better than yours, and how that makes me better, and you a brainlet

>why my language is better than yours, and how that makes me better, and you a brainlet
This guy gets it.

Well I just wondered because I saw this thing
en.cppreference.com/w/cpp/header/iosfwd
and thought maybe they don't work like I thought they did.

english

I'm learning .NET/C#, I just learned how to do a hello world program but I'm sort of bored. I don't really feel like I deeply understand anything, just following tutorials. Any tips or anything?

don't thread on me

Students of /dpt/:

Now's the time to make your portfolio! First thing: upload all past school projects to your GitHub if you haven't already. Next, open a empty text file and list in order of cool->not that cool the projects you've done. Your goal is to have 4-6. Then, write a single sentence summarizing what the project is. Now, try to write 2 more sentences on the project focussing on the tools and technologies you've used and what makes it interesting. Focus on what you've *done*. Buzzwords (NoSQL database, what framework, which stack) are good.

Then, add these to your resume, again in order of cool->not cool. Convert sentences to point form. Finally, under your projects list the programming languages you know. In a separate list technical skills (Git, UNIX, GNU Make, CMake, Android development etc...)

Now that your resume is made, take it to your school's career office to have them look it over. Ask them if your school posts local internships on your career site. Apply to every single internship you see.

Important: the listing for internships usually have things they're looking for (Java experience, Agile methodology, SQL, etc...) Add these buzzwords to your resume. Companies use resume readers that looks for key words so you don't want to miss out.

If you don't a resume yet, look at the following guide as a references. You might have to run a Windows VM to edit it in Word.

careercup.com/resume

Good luck!

My dad owns a software consulting company I don't need a portfolio, I just want to be a better programmer as not to disappoint my father.

Keep in mind that they have poor hearing and vision compared to humans. A more tactile approach may be better.

>Any tips or anything?
Any good book or tutorial series should give you extra things to do to test your knowledge at the end of a lesson. If they don't find a new one.

>You might have to run a Windows VM
>edit it in Word
dropped

Maybe I need a better book.... I'll finish this little series my dad wanted me to do, even though it's really dull, he's so proud of me. For once I don't want to let him down.

How much should you use parenthesizes?
t. use it around every operation which is normally written with spaces

can anyone help me copy a file from one directory to another in a python application? I keep running into an " IOError: [Errno 13] Permission denied: " issue, even when I'm running CMD as administrator.

im currently importing shutil

from shutil import copyfile
from sys import exit
import os

and copying a file

copyfile(src dst)

open src for reading, open dest for writing, read from src, write result to dest, repeat until finished

in this case im trying to copy an image file from one folder to another in the same C directory

I skipped to the end of mine and it said to find a .net community online to hang out with. No test, it's just him coding and I have to follow along and make a working version on my system.

I'm doing Pluralsight's course on "Becoming a .NET developer."

The deadline for the homework is over so I'm gonna post my code from it so you can laugh
pastebin.com/u5G6mVfT

Tell me how bad it is, Sup Forums

Yes, it's the same process, or you can do it the pajeet way and invoke xcopy from the shell

>Important: the listing for internships usually have things they're looking for (Java experience, Agile methodology, SQL, etc...) Add these buzzwords to your resume. Companies use resume readers that looks for key words so you don't want to miss out.

If you do this, you're a pajeet and deserve pajeet work. I uterly, terminally, completely, absolutely REFUSE to add anything of the sort to my curriculum.

SQL isn't a buzzword though.

i'm trying to do this from within a python application file. my goal is to get the program to copy the image of the current playing song in VLC, and paste that image into a 'albumart' folder. Then check every couple seconds and delete that image and replace it with the image for whatever is playing currently.

I've got the path for the image saved as a variable, and I have the destination saved as a variable too

>bubblesort
Why not just C qsort()?
>strcpy
use strncpy

A bit funky indentation I guess

It's okay, not horrible.

We had to make our own sorting algorithm and there was nothing in the requirements that said speed mattered, so I just went with the simplest. I was gonna do mergesort but decided it wasn't worth the hassle.

Also why use strncpy? In case something fucks up and there's no null character?

>use strncpy
This isn't good advice. strncpy has a lot of its own problems.

Fix your indentation.

Well, okay. Champagnesort is marginally better and marginally faster.
You should always use strncpy, it should be an instinctual reaction.

In case something fucks up and there's no null character?

Also why use strncpy?

Then assign a null character faggot

Too bad it's not /dpt/ looking at your resume

If there's a character assigned then how is it a null character?

strncpy doesn't guarantee null termination in certain situations and and has the whole useless zeroing business. It's not a "safe" version of strcpy. It's more useful for copying into the middle of other strings or some other niche situations.
I avoid a good chunk of the str* functions, and prefer to use snprintf.

Companies are looking for a degree and or experience. Not that complicated, being good in Microsoft word doesn't hurt either.

string[6] = '\0';

If the company I'm applying to turns me down because I don't have the experience or the desire to work a menial, unfulfilling job assembling pre-built bloated pieces of software like some sort of lego for adults, then good riddance.

Is this some sort of insult?

But what if you want money. Don't you want money? I want money.

Has someone made something like PHP but with perl? So you can write perl code inside a .html file inside some tags, and it will replace the tags with whatever the code outputs to stdout, and access headers/query inside the language?

>string[6] = '\0';
the absolute state

Luckily for you there's a thousand interesting and challenging jobs in CS. Work in HFT or algorithmic trading and you can roll your own linked lists to your heart's desire.

Just be good enough for a proper company to need your expertise.

e.g. have 5 years of experience writing monad tutorials for haskell

Im working on a game in C# using duality (google it), since im a noob at game dev its going to take a while.

I've been working on it more or less sporadically since mid-june, right now its in the pre-alpha stage.

.t clueless brainelts

>.Html

What happened to Dreamweaver? What am I missing? God help me

I'm like 20, I just did my first HelloWorld! program.

>20

not gonna make it

Don't listen to this user. 18-20 is perfectly normal to begin

if you really think that is good code or practice, youre the brainlet

>no u

"lol"

18 to 20 is huge. 18 is the upper limit, after that you might as well give up.

prime starting age is 12. at 20 you're almost a decade behind real programmers.

I'm running a shell script that interfaces with a sqlite database. It builds insert statements, echoes them to stdout, then I run sort|uniq|sqlite3 database.db on them. Now, this works fine (I have unique key constraint), but sometimes I get syntax errors. I think this is because SQLite has some line length limit after which it just starts discarding stuff (including newlines)
How do I increase this? It's annoying to get syntax errors. The lines are at most maybe 1MB long.
>The maximum number of bytes in the text of an SQL statement is limited to SQLITE_MAX_SQL_LENGTH which defaults to 1000000. You can redefine this limit to be as large as the smaller of SQLITE_MAX_LENGTH and 1073741824.
> The maximum length of an SQL statement can be lowered at run-time using the sqlite3_limit(db,SQLITE_LIMIT_SQL_LENGTH,size) interface.
Can I use a pragma to increase it without having to recompile?

That's one way to get yourself burnt out

>at 20 you're almost a decade behind real programmers.
I really hope you don't fall for the "I started programming at 4 years old" people.

>he doesn't write edgy code

Dreaming in code at an early age is also a significant predictor for programming success

stop this meme

I've been programming for over 15 years and I've never dreamed in code

i only really seriously started when i was 22. now i'm a phd student in cs at one of the top programs around.

this bullshit about needing to start early is retarded. you need to be young enough that you can think creatively and be flexible as you learn new things. that means you should probably start before you turn 70. otherwise, don't sweat it.

>now i'm a phd student in cs at one of the top programs around

I can't wait for you to provide proof for this.

this
check this out
int main ()
{
char code[CODE_LEN], ware[CODE_LEN], prod[CODE_LEN], qual[CODE_LEN];
int i, n, found = 0;

scanf("%s", &code);

for (i = 0; i < strlen(code) && found != 1; i++)
if (code[i] >= 48 && code[i] = 65 && code[n]

>he didn't learn how to lucid dream so he can solve cool programming problems while he sleeps

don't be mean, he goes to one of the top universities in his town

what would be sufficient for you? my ID with name and face covered?

i'm not going to offer a thing and then have you say that's not good enough and then repeat that process a dozen times with a dozen different things. just name the thing that'll shut you up so i can provide it and you can acknowledge you're being a dickhole about needing to start young

>implying I want to spend my lucid dreaming time solving programming problems

>scanf("%s", ...);
And your code is shit.

If you have a high IQ it doesn't matter when you start because you'll surpass people who've been programming their entries life in a month

Not that user btw

I've been working on my A+ certifciation for the past 2 years, my dad told me it'd be a great place for me to start. Now that I've got most of that stuff down, I'm moving into coding. I actually know a lot of stuff, I've just never been a coda.

I coded basic HTML in middleschool, and my dad taught me about binary when I was in kindergarten before bed.

Your ID card with your dick covering your face picture and your contact so we can go out for drinks

i'm not posting my dick, and i'm not really interested in getting drinks with someone from Sup Forums (let alone someone from Sup Forums who wants to see my dick)

Since when is 20 not young?

I never met anybody who coded when they were younger than that.

fag

#define FORMAT_BOOL(b) (("false\0true")+(((bool)b)*(1+strlen("false"))))

Then I don't believe you and you're a fucking attention whore liar

What's the problem with going out for drinks with someone from Sup Forums anyway? I just want to suck your dick and steal your research

Yeah, I'm a PhD student. I don't need a project portfolio, I just need a list of publications and conferences, which is already under development.

Where are you user? I'll start driving right now

I started learning C++ in high school.

Kyrgyzstan

I'm a SEO with Google, I've over 20 years experience with Microsoft Technology basically, this hot stud is fucking random bitches and you're a looser, wanna find out more? Hire me for details.

Or you could stop being stupid and just do
#define FORMAT_BOOL(b) ((b) ? "true" : "false")
or even make it a "proper" function
static inline const char *format_bool(bool b)
{
return b ? "true" : "false";
}

My flight leaves in 4 hours get your lips nice and moist

people on Sup Forums who want to meet offline are almost always incredibly socially awkward people who are also unbearably needy.

Hurts my brain to think about it, in highschool I was smoking weed and barely passed, I remember I got stuck in parenting class for my elective and had to haul a mechanical baby around school. What the fuck is that supposed to teach me.

Story time?

No shit. We have to go through a fucking PhD. You guys can start working as soon as you get your BS.

But strictly speaking, I'm going into research/academia. So I can't NOT get a PhD.

This can be written much more edgy, you have lots of dead code

Not always, I've made a friend or two off Sup Forums and they're normal people with nice dicks

99% are, though

It won't teach you shit. Want to know how to take care of a baby? Knock up your high school sweetheart. You'll find out very quickly.

duh. phd students in any field are trained to take nebulous inquiries and turn them into actionable research questions, methods, and finally answers.

phd students in cs aren't optimizing for churning out code anymore; they would stop at a masters degree if we wanted to optimize for lines of code. we're optimizing for scholarship, so the amount of programming that we do starts to shrink more or less from day 1

>high school sweetheart
why'd you go there user

Yeah, babies are cool though.

What is there even to research in computer science? I don't get it.

why'd you post this

>parents forced me to use linux and c when younger
>completely screwed now that i have to use windows and python at uni
what should I do? everyone else on my course is bragging about how they already know the stuff

>What is there even to research in computer science
on the scale from 1 to 3 how serious are you?

3. What u nerds up to

>What is there even to research in computer science? I don't get it.
copying from my department site:
- AI, ML, NLP, Robotics, and other applications of CS, including Database research, general purpose network analysis and graph mining.
- Theory (Complexity Theory, Cryptography, Algorithmic Game Theory, Geometric Algorithms, algorithmic techniques for internet applications, various aspects of network and computer security, databases, design and analysis of programs and programming languages, and supporting studies in combinatorial, logical, and algebraic mathematics).
- Computer Graphics / Human-Computer Interaction (geometric computation, light fields and computational photography, human-computer interaction and design thinking as well as computational algorithms for a variety of applications).
- Systems (energy efficient and robust hardware systems, software defined networks, secure distributed systems, data science, and integrated circuits and power electronics).

I taught myself the very basics of C++ in middle school, didn't really get to objects or memory management but understood enough about loops and functions

yall are okay

don't go to Sup Forums tomarrow