/dpt/ - Daily Programming Thread

Old thread: What are you working on, Sup Forums?

Other urls found in this thread:

exercism.io/
pypi.python
twitter.com/SFWRedditGifs

Post crypto trading bot gainz

post some resources so we can actually stop shitposting and start programming

exercism.io/

quit being a lazy fuck
there's no amount of "resources" that will help you if all you do is ask for more resources

Your post number is 75. For the interests of this challenge, post numbers start at 01 and go up to 00, which counts as 100.
75 / 100 = 0.75
0.75 * 145 = 108.75
Congratulations, you're doing programming challenge 109: Pac-Man with different behaviors for each ghost.

...

You again
Fuck off, no one wants your project roller garbage

Thanks for your input, buddy, but I haven't been on Sup Forums since I was 15.

>post some resources so we can actually start programming
>no one wants your project roller garbage
What did he mean by this?

By all means, keep shitposting instead of programming, but let's not pretend I'm the problem here. :^)

>What did he mean by this?
He means nobody wants your roller trash

So I'm working on a webpage, and I need to execute a perl script through a web browser to actually build the HTML.
Problem is that I cannot get apache to execute it for the life of me.
I've made sure that perl-mod and cgi-mod are loaded, I've set "options +execcgi" and "addhandler cgi-handler .cgi .pl" for the sites directory in apache2.conf, and I set chmod 755 for the script.
Every time I try to launch it apache just serves the perl script as a regular file, and Firefox downloads it.

What do I need to do?

>What do I need to do?
You need to fuck off to the webshit general

Friendly reminder that you should return reference to an object iff:
1. The object itself is passed to the scope as a non-const reference
2. If the object is created within the scope, it is static
3. In no other situation

Reminder that you don't also need multi-return functions, create the expected values first and pass them as non-cost references into the function. These are called out params.

Friendly reminder not to use objects

Eat shit. Everything is an object

>Tfw the more you learn the more you go back to structs and loose functions

- t. brainlet
*implements abstract base virtual move constructor observer pattern factory*

wrong

objects aren't even the problem
inheritance is the problem
just don't use that and you're good to go

Idiot.

Hello Sup Forums,
I made my raspberry draw lines (in pure ARM asm)

Where do I get hired now?

Has anyone thought about replacing ; with akari buns?

top kike. Better watch the webm before uploading it. Here have higher bitrate.

So I want to learn python and was looking around and found the O'Reilly books. Are they any good? Or should I learn somewhere else? Does it teach good practices, scaling projects, python standards etc?

I was also looking to properly learn frontend as i college was pretty shit about that. Where can i learn html/css properly and some meme popular framework to go along? I tried django but making the website pretty was no good.

Also, I have experience as a developer.

>he doesn't use the Whitesmith style of bracket placement
Quickest way to detect a pleb

>gtk_icon_view
>no icons
aaaaaaa
i gave ittt the pixbufffff

you forgot about when the object referenced is not (explicitly) passed in as a parameter but still has naturally greater scope/lifetime than the function, like a member function returning a reference to a data member or member array value from the containing object. or a member function returning a reference to the containing object itself, like an operator+= overload returning *this

allman is the only logical style there.

I think you mean K&R

if K&R had you put align the body contents with either the ( or the following char, it'd be okay.
But how it is normally is just ugly, illogical and not very readable.

it's perfectly readable and wastes the least whitespace

if you have e.g.

if (x) {
...
}

you already get the 2 "separators" - one is the if

>wastes the least whitespace
Oh god, how will i survive not having my source files be the max optimized they can be at the expense of readability.
I just think you need a newline or else things are just too scrunched up. Which is why allman is so good.

I used to do allman as I was introduced to programming with C#. However, when I started doing Swift recently, I realised that allman is fucking horrible and wastes so much space. An entire line for a single { when you know where it starts anyway? Stupid. Really bad design. Looks bad once you are used to K&R.

kek

I disagree, I think you end up with too much pointless space, which makes it harder to read.

You get a look of the layout but having pointless space just confuses you

>what are you doing Sup Forums
lmaoing @ lisp since it cant do method/function overloading

Man the left is so much better. Only change I would make would be the else would start on a new line.

>You get a look of the layout but having pointless space just confuses you
Wrong. Our eyes are really good at parsing shapes, and symmetry is inherently pleasing.

I personally believe Mozilla style is superior in every single aspect.
#include "mainwindow.h"

#include

#include
#include
#include
#include

MainWindow::MainWindow(QWidget* parent)
: DMainWindow(parent)
{
setMinimumSize(1050, 850);

m_topToolbar = new TopToolbar(this);

titlebar()->setCustomWidget(m_topToolbar, Qt::AlignCenter);
titlebar()->setMenu(m_topToolbar->mainMenu());

m_titlebarWidth = titlebar()->width();
m_topToolbar->setFixedWidth(this->width() - m_titlebarWidth);

m_mainWidget = new MainWidget(this);
m_mainWidget->setFocusPolicy(Qt::StrongFocus);
setContentsMargins(QMargins(0, 0, 0, 0));
setCentralWidget(m_mainWidget);

connect(m_topToolbar,
&TopToolbar::openImage,
m_mainWidget,
&MainWidget::setImageInCanvas);

connect(m_topToolbar,
&TopToolbar::initShapeWidgetAction,
m_mainWidget,
&MainWidget::initShapesWidget);

connect(m_topToolbar,
&TopToolbar::rotateImage,
m_mainWidget,
&MainWidget::rotateImage);

connect(m_topToolbar,
&TopToolbar::mirroredImage,
m_mainWidget,
&MainWidget::mirroredImage);

connect(
m_topToolbar, &TopToolbar::saveImage, m_mainWidget, &MainWidget::saveImage);
}

void
MainWindow::resizeEvent(QResizeEvent* event)
{
DMainWindow::resizeEvent(event);
m_topToolbar->setFixedWidth(this->width() - m_titlebarWidth);

this->update();
}

void
MainWindow::keyPressEvent(QKeyEvent* event)
{
DMainWindow::keyPressEvent(event);
}

MainWindow::~MainWindow() {}

K&R cuz that's the cleanest and the way C was meant to be. Fuck y'all snowflakes doing other fancy tacky shit

nvm im a retard

You're wrong, what you're imagining is just getting in the way. The shape you see is hindered by needless detail. The symmetry is indentation symmetry, which ISN'T shared by allman since it means you have two lines at the start and one at the end (on either side of indentation)
The complaint that the different length of the lines is an issue is nonsense.

C can't either which is also a popular language. I don't see your point.

Currently in possession of a bot that detects large amount of Volume in a short amount a time.

It's good to use to find whales in the markets.

bullshit
QCefGlobalSettings::QCefGlobalSettings()
: p_(new QCefGlobalSettingsPrivate())
{
// TODO(LiuLang): Initialize default values.
}

QCefGlobalSettings::~QCefGlobalSettings()
{
delete p_;
p_ = nullptr;
}

void
QCefGlobalSettings::setSingleProcess(bool enabled)
{
p_->single_process = enabled;
}

bool
QCefGlobalSettings::singleProcess() const
{
return p_->single_process;
}

void
QCefGlobalSettings::setNoSandbox(bool enabled)
{
p_->no_sandbox = enabled;
}

bool
QCefGlobalSettings::noSandbox() const
{
return p_->no_sandbox;
}

void
QCefGlobalSettings::setDisableCommandLineArgs(bool enabled)
{
p_->disable_command_line_args = enabled;
}

bool
QCefGlobalSettings::disableCommandLineArgs() const
{
return p_->disable_command_line_args;
}

void
QCefGlobalSettings::setCachePath(const QString& path)
{
p_->cache_path = path;
}

const QString&
QCefGlobalSettings::cachePath() const
{
return p_->cache_path;
}

void
QCefGlobalSettings::setUserDataPath(const QString& path)
{
p_->user_data_dir = path;
}

>Not GNU

KYS

lol I was just trolling :D

why, when instantiating, does each object in java have to have parent objects created too, all the way up to Object?

>C
>popular
pick one

Quick Python style question.
Which one of these would you write:

if not some_condition:
return None
return something
or
if not some_condition:
return None
else:
return something
?

None

I don't speak snek but a way to do this is a ternary
return cond ? something : something_else;

Wtf is this senseless crap, good job getting a good job with that code styling lmfao

if some_condition:
return None
elif not some_condition:
return something
else:
return 5;

Oh yeah, I forgot about the ternary operator. Not really a fan of it in Python, but it fits for me right now.

if not some_condition is an error condition, the first.
if not some_condition is a "typical" condition, the second.

That's one of the oficially recognized formats, also available in clang-format

Python Bullshit. Gtfo

Beginner Programmer/Comp Sci freshman here, what would be the best skills for me to have for the field in the future? I'm thinking about having a concentration in information assurance but I was told that would be near-impossible to get a job in

wrong

Hmm, sounds like a good rule of thumb. Thanks!

Whoever created that format needs to be banned from using computers

From the Zen of Python: "flat is better than nested"

Therefore you should try to nest as rarely as possible, so omitting the else branch is the correct choice.

>implying you need it in a dynamically typed language
>implying you know shit about Lisp's methods or CLOS

All of them, quit being an idiot, your ideal company probably won't even accept you because the market is flooded.

Your best bet is when all the High level Visas user get deported, along with the dreamers.

If you're a minority, you're fucked as well.
If you're white, you better be good looking.

Why are you even programming for companies?
Learn Programming for yourself

>Program something
>Sell to idiots
>????
>Profit.

spotted the new fag. Mozilla style is probably the best style

You mean GNU

awesome work user

I got into programming because I had an interest in cybersecurity and making videogames, but I know trying to make a living off of making videogames would be suicide.
I'm thinking of also getting involved in research, specifically at my college maybe? Coding in and of itself has always caught my interest but it feels like if I go into a jack-of-all trades and learn everything I won't be "good enough". I keep getting told to specialize, specialize, specialize, but it makes more sense to be flexible and adaptable so I'm not stuck trying to find one job out of hundreds under the degree.

Nth for C#

...

anyone?

Take that to oniichan

user, if you live anywhere in the U.S, go into business. It's a capitalist country.

Everyone here codes for fun. Only a selected few in here probably have a job in programming and that's in Fiver, Upwork or an actual Salary based job.

Truth is, Whatever language you're being taught is probably the most flooded and can be done better than you by others.

Now you said something about Cybersecurity. Same. I'm doing the same thing. Except my dumb ass is currently attending a college that has Cybersecurity under the College of Business. Which means I won't learn Jack shit of programming/networking, except for my final year here.

I know C++, Python, HTML, CSS, learned by myself. If I could do it, holy shit imagine how many others could.

Trying to learn Networking through Cybrary dot it so I can get CompTIA A+ and Networking Certificate.

I have a list of other useful links given to me from an internship with the Department of Homeland Security in case you're interested. Just sit tight.

kek

learn everything to talk about it in interviews. once you get hired somewhere, there you will be able to become really good at a particular thing

it's amazing how good you become at a language/framework when doing it for 40 hours for a few weeks

rollan

Been there done that, rerollan

>NEET thinks he has an opinion
thanks for the hearty kek user

Image

Tip: Cybersecurity isn't Hacking and shit btw. If you want to learn that, it's Information systems, with a focus on Networks.

HTML and CSS I learned easily through this website, and I know several IT employees who use this immediately as a resource

W3schools dot com

For Python, I open a code that someone gave me and just used common sense and referenced it with C++

It's almost similar, so I can't guide you on that

how hard is it to learn c# if I know plenty of java and hate it.

Flexibility is good, but if you know one Programming language, you basically know them all.

>NEET thinks he has an opinion
Yes, to get a job, winch C# toddlers tend to have less than Java fags. Fuck off lmfao

thanks for replying. Do you think w3schools is better than freecodecamp.org? I used the website a lot during college for reference in html, but never as a complete experience.

Also I dont want to just open some python code and read it as I'm scared I'll miss some python good practices or may just come with shit code in general.

Easy. The transition vice versa is more difficult because of how shit java is.

More than whatever language you use though. Please tell me you're not a haskellfag.

C# is probably the weakest race imaginable
>Cucked by Micropenis
>Slower than Java
>Less job than Java

Why do they even try?

decided to get my feet wet and wanted a small project that I would actually want to complete.
I want to create a bot for a crappy web browser game. (In the same category as like neopets)
Should I learn python or is there something better for this type of project?
Can anyone help me with any tutorials/useful links I should look into?

>Everyone I don't like is a hasklelfag

Microsoft fanboys are a bunch of sad, brainwashed cult

I learned CSS and HTML in less than a week.

Go to Github
pick up any Python code
Try to "reverse engineer" and you'll understand how easy it is.

Programming is just "PC, do this if this and this and this and this, except if this and this and this and this, while doing this and this and this and this, also if this and this and this and this, do this and this and this, except if this and this and this."

Follow the code, if you can't understand a variable or function, google it.

Also, Python and other languages work in a way where you can't create everything, so people create libraries so you can get the job faster.

The first few lines of code is just accessing that library. Instead of writing 100 lines of code to create a square, you could just grab a library and create one in 2 lines.

Here's the list of many libraries
pypi.python dot org/pypi

I made a quick script to fetch urls from crunchy roll and the url I get is used with mpv to stream full hd with no f*ing flash, and no comercials, who wants to contribute so it's not hardcoded to the anime One piece

#!/bin/bash

episodenum=$1

episode="$(googler --nocolor --np crunchyroll one piece $episodenum | ack --lines=2 $episodenum $episode)"
echo $episode

What do you mean no commercials?
You'd have to be a premium member for that, how would you "find a specific link" without it?

crunchy roll does the job for you, the first result is always the chapter url, nope commercials work with flash, that's why you need flash player so they can pause your video an insert the ads, if you stream to another player with no flash, it's just the full video

wow, that's even worse than 4chans implementation of recaptcha

the world would be a better place if windows never existed

84fMYFS

Join my discord, I want to talk more about this.

>Cucked by Micropenis
Define cucked. C# is the best OOP language out there wether you liked it or not (if you try to deny this you have either never used C# or work at a pajeet tier job). And the insane freedom and ease of use provided by microsofts visual studio (desu comfiest IDE currently) with it's nuget packages is a huge bonus, while maven gave me ass cancer.
>Slower than Java
In what world do you live?
There is a reason why Java hosting is this expensive. (inb4 some autistic benchmarks tested under linux from 7 years ago with some irrelevant shit)
>Less job than Java
Yet it's twice as well payed and in the next 3 years Java will probably die to the hands of .NET completely. There are almost no new projects wrtiten in Java. The only Java jobs are about mainting existing projects. Stay pajeet, pajeet.

lucky us

not that user
>Slower than Java
Silly claim. Too many things to consider.

>Less job than Java
Both in high demand, got a job a month after graduating last year. There's a few things to consider. Android/xamarin and how they affect listings, listing comparisons should be Java vs .NET not Java vs C#, how many Javascript listing are included when you search Java, location, etc.. I agree Java is in higher demand in general, but it's pretty close with all things considered.

>Why do they even try?
Better language, better tools, better frameworks.

You're right on the first part. It's getting better though.

sure

Waiting on the language.